skip inappropriate X25519 tests
authorDr. Stephen Henson <steve@openssl.org>
Tue, 23 Feb 2016 14:35:33 +0000 (14:35 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 28 Feb 2016 22:54:54 +0000 (22:54 +0000)
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
test/ecdhtest.c
test/ecdsatest.c
test/ectest.c

index e37a020cc7fb2467fdb1716df82b080d2a87dbf1..fb4df79ea75732159953a3901ff823c8ffc93c79 100644 (file)
@@ -493,6 +493,13 @@ int main(int argc, char *argv[])
     /* NAMED CURVES TESTS */
     for (n = 0; n < crv_len; n++) {
         nid = curves[n].nid;
+        /*
+         * Skipped for X25519 because affine coordinate operations are not
+         * supported for this curve.
+         * Higher level ECDH tests are performed in evptests.txt instead.
+         */
+        if (nid == NID_X25519)
+            continue;
         if (!test_ecdh_curve(nid, ctx, out)) goto err;
     }
 
index 55ebad904ccc1b6e030e07621328b095169a1c8a..f5b753a110110cf40086b3f61921037eb0553c05 100644 (file)
@@ -338,7 +338,7 @@ int test_builtin(BIO *out)
         unsigned char dirt, offset;
 
         nid = curves[n].nid;
-        if (nid == NID_ipsec4)
+        if (nid == NID_ipsec4 || nid == NID_X25519)
             continue;
         /* create new ecdsa key (== EC_KEY) */
         if ((eckey = EC_KEY_new()) == NULL)
index b0fbcdc6124ea0f129fafeddd8b638fa6bcf79a5..bbc7ed0ac9903f08aeb7cd257d56e8ed4e95b7ad 100644 (file)
@@ -1417,6 +1417,12 @@ static void internal_curve_test(void)
     for (n = 0; n < crv_len; n++) {
         EC_GROUP *group = NULL;
         int nid = curves[n].nid;
+        /*
+         * Skip for X25519 because low level operations such as EC_POINT_mul()
+         * are not supported for this curve
+         */
+        if (nid == NID_X25519)
+            continue;
         fprintf(stdout, "%s:\n", OBJ_nid2sn(nid));
         fflush(stdout);
         if ((group = EC_GROUP_new_by_curve_name(nid)) == NULL) {