]> the.earth.li Git - onak.git/commitdiff
Add Curve25519 ECC OID details
authorJonathan McDowell <noodles@earth.li>
Sat, 15 Aug 2015 09:28:31 +0000 (10:28 +0100)
committerJonathan McDowell <noodles@earth.li>
Sat, 15 Aug 2015 09:28:31 +0000 (10:28 +0100)
keyindex.c

index bef41f42c41abcd1621834efd54c469b2acbed74..13a2ccdb2cb19917bf6f13364536b0c9acebeb16 100644 (file)
@@ -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) &&