diff --git a/ChangeLog b/ChangeLog index 081ceb5..41b41ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-02-22 Niibe Yutaka + + * src/openpgp.c (ECDSA_SIGNATURE_LENGTH): It's 65. + + * src/call-ec_p256.c (ecdsa_sign): Add a header byte. + 2013-02-21 Niibe Yutaka * src/gnuk.ld.in (MEMORY): Fix adding FLASH_SIZE unit. diff --git a/src/call-ec_p256.c b/src/call-ec_p256.c index a929fb1..23f4225 100644 --- a/src/call-ec_p256.c +++ b/src/call-ec_p256.c @@ -43,6 +43,8 @@ ecdsa_sign (const uint8_t *hash, uint8_t *output, bn256 r[1], s[1], z[1], d[1]; uint8_t *p; + *output++ = '\x04'; /* No compression. */ + p = (uint8_t *)d; for (i = 0; i < ECDSA_BYTE_SIZE; i++) p[ECDSA_BYTE_SIZE - i - 1] = kd->data[i]; diff --git a/src/openpgp.c b/src/openpgp.c index 5275d15..4f72281 100644 --- a/src/openpgp.c +++ b/src/openpgp.c @@ -879,7 +879,7 @@ cmd_internal_authenticate (void) } #else #define ECDSA_P256_HASH_LEN 32 -#define ECDSA_SIGNATURE_LENGTH 64 +#define ECDSA_SIGNATURE_LENGTH (1+64) static void cmd_internal_authenticate (void)