Remove unnecessary NULL check from get_cert_by_subject since
authorbcook <bcook@openbsd.org>
Sun, 5 Aug 2018 14:17:12 +0000 (14:17 +0000)
committerbcook <bcook@openbsd.org>
Sun, 5 Aug 2018 14:17:12 +0000 (14:17 +0000)
sk_BY_DIR_HASH_find already does it, removing ambiguity later in the function.

ok tb@

lib/libcrypto/x509/by_dir.c

index 01a302b..04eada8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: by_dir.c,v 1.38 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: by_dir.c,v 1.39 2018/08/05 14:17:12 bcook Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -103,7 +103,7 @@ static X509_LOOKUP_METHOD x509_dir_lookup = {
        .name = "Load certs from files in a directory",
        .new_item = new_dir,
        .free = free_dir,
-       .init = NULL, 
+       .init = NULL,
        .shutdown = NULL,
        .ctrl = dir_ctrl,
        .get_by_subject = get_cert_by_subject,
@@ -316,7 +316,7 @@ get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name,
                        X509error(ERR_R_MALLOC_FAILURE);
                        goto finish;
                }
-               if (type == X509_LU_CRL && ent->hashes) {
+               if (type == X509_LU_CRL) {
                        htmp.hash = h;
                        CRYPTO_r_lock(CRYPTO_LOCK_X509_STORE);
                        idx = sk_BY_DIR_HASH_find(ent->hashes, &htmp);