Add X509_NAME_hash_ex() to be able to check if it failed due to unsupported SHA1
[openssl.git] / crypto / x509 / by_dir.c
index 965625973cdbcfac51291dff264e7c894561ffc7..ff1c875b4d84258605adf35876cc6c7c01463c46 100644 (file)
@@ -252,8 +252,9 @@ static int get_cert_by_subject_ex(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
     }
 
     ctx = (BY_DIR *)xl->method_data;
-
-    h = X509_NAME_hash(name);
+    h = X509_NAME_hash_ex(name, libctx, propq, &i);
+    if (i == 0)
+        goto finish;
     for (i = 0; i < sk_BY_DIR_ENTRY_num(ctx->dirs); i++) {
         BY_DIR_ENTRY *ent;
         int idx;