add ec point header for public key

This commit is contained in:
NIIBE Yutaka
2013-02-22 11:57:53 +09:00
parent 3fd875e7e8
commit a8cfda93e0
2 changed files with 5 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
2013-02-22 Niibe Yutaka <gniibe@fsij.org>
* src/openpgp-do.c (gpg_do_public_key): Add header of EC point.
* src/openpgp-do.c (GPG_DO_DISCRETIONARY, cmp_discretionary): New.
(cmp_app_data): Change to factor out GPG_DO_DISCRETIONARY.
(gpg_do_table): Add GPG_DO_DISCRETIONARY.

View File

@@ -1539,8 +1539,9 @@ gpg_do_public_key (uint8_t kk_byte)
/* LEN = 2+64 */
*res_p++ = 0x42;
{
/*TAG*/ /* LEN = 64 */
*res_p++ = 0x81; *res_p++ = 0x40;
/*TAG*/ /* LEN = 1+64 */
*res_p++ = 0x81; *res_p++ = 0x41;
*res_p++ = 0x04; /* No compression of EC point. */
/* 64-byte binary (big endian) */
memcpy (res_p, key_addr + KEY_CONTENT_LEN, 64);
res_p += 64;