Allow odd size of certificate

This commit is contained in:
NIIBE Yutaka
2013-10-08 10:31:07 +09:00
parent e2ec98225f
commit f9eaa6e0d1
2 changed files with 8 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2013-10-08 Niibe Yutaka <gniibe@fsij.org>
* src/openpgp.c (modify_binary): Allow odd size of certificate.
2013-10-07 Niibe Yutaka <gniibe@fsij.org>
* polarssl/library/bignum.c (mpi_sub_hlp): Return CARRY.

View File

@@ -995,6 +995,10 @@ modify_binary (uint8_t op, uint8_t p1, uint8_t p2, int len)
DEBUG_SHORT (len);
DEBUG_SHORT (offset);
if (file_id == FILEID_CH_CERTIFICATE && (len&1))
/* It's OK the size of last write is odd. */
apdu.cmd_apdu_data[len++] = 0xff;
r = flash_write_binary (file_id, apdu.cmd_apdu_data, len, offset);
if (r < 0)
{