From: Jonathan McDowell Date: Sat, 15 Aug 2015 09:28:31 +0000 (+0100) Subject: Add Curve25519 ECC OID details X-Git-Tag: onak-0.4.6~7 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=634f55ed8af9e8a3360519d58f65cb011700e3fe;p=onak.git Add Curve25519 ECC OID details --- diff --git a/keyindex.c b/keyindex.c index bef41f4..13a2ccd 100644 --- a/keyindex.c +++ b/keyindex.c @@ -96,8 +96,21 @@ unsigned int keylength(struct openpgp_packet *keydata) case OPENPGP_PKALGO_ECDSA: case OPENPGP_PKALGO_EDDSA: /* Elliptic curve key size is based on OID */ + /* Curve25519 / 1.3.6.1.4.1.3029.1.5.1 */ + if ((keydata->data[6] == 10) && + (keydata->data[7] == 0x2B) && + (keydata->data[8] == 0x06) && + (keydata->data[9] == 0x01) && + (keydata->data[10] == 0x04) && + (keydata->data[11] == 0x01) && + (keydata->data[12] == 0x97) && + (keydata->data[13] == 0x55) && + (keydata->data[14] == 0x01) && + (keydata->data[15] == 0x05) && + (keydata->data[16] == 0x01)) { + length = 255; /* Ed25519 / 1.3.6.1.4.1.11591.15.1 */ - if ((keydata->data[6] == 9) && + } else if ((keydata->data[6] == 9) && (keydata->data[7] == 0x2B) && (keydata->data[8] == 0x06) && (keydata->data[9] == 0x01) &&