Skip unsupported ciphers in evp_test.
authorDr. Stephen Henson <steve@openssl.org>
Thu, 26 Feb 2015 19:26:53 +0000 (19:26 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 27 Feb 2015 00:18:10 +0000 (00:18 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/evp/evp_test.c

index 7d15332a28e1e472053a1c1ff6b90101b8664ceb..97269931632b045be95921faec9bda7ed6a99ddc 100644 (file)
@@ -638,8 +638,14 @@ static int cipher_test_init(struct evp_test *t, const char *alg)
     const EVP_CIPHER *cipher;
     struct cipher_data *cdat = t->data;
     cipher = EVP_get_cipherbyname(alg);
-    if (!cipher)
+    if (!cipher) {
+        /* If alg has an OID assume disabled algorithm */
+        if (OBJ_sn2nid(alg) != NID_undef || OBJ_ln2nid(alg) != NID_undef) {
+            t->skip = 1;
+            return 1;
+        }
         return 0;
+    }
     cdat = OPENSSL_malloc(sizeof(struct cipher_data));
     cdat->cipher = cipher;
     cdat->enc = -1;