diff --git a/ChangeLog b/ChangeLog index 8d4941b..73739ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-10-08 Niibe Yutaka + + * src/openpgp.c (modify_binary): Allow odd size of certificate. + 2013-10-07 Niibe Yutaka * polarssl/library/bignum.c (mpi_sub_hlp): Return CARRY. diff --git a/src/openpgp.c b/src/openpgp.c index 2007a2e..f745a53 100644 --- a/src/openpgp.c +++ b/src/openpgp.c @@ -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) {