Allow odd size of certificate
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user