]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Don't fail if a candidate certificate has no SANs
authorNalin Dahyabhai <nalin@redhat.com>
Mon, 14 Jan 2013 18:57:54 +0000 (13:57 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 10 May 2013 20:03:29 +0000 (16:03 -0400)
When we're doing certificate matching and we're asked for the list of
SAN values for a certifiate, and it contains none, don't return an
error, as that will eventually cause the module to just return an error.
Instead, just return an empty list of SAN values so that processing will
continue on to check if other certificates match.

src/plugins/preauth/pkinit/pkinit_crypto_nss.c

index 26901986b66025440d82457b021100a2af798e77..1aae6147ffda0a1fe76fd7f8b6260fd6ef79b87b 100644 (file)
@@ -3161,12 +3161,8 @@ crypto_cert_get_matching_data(krb5_context context,
     md->ku_bits = cert_get_ku_bits(context, cert_handle->cert);
     md->eku_bits = cert_get_eku_bits(context, cert_handle->cert, PR_FALSE);
     if (cert_retrieve_cert_sans(context, cert_handle->cert,
-                                &md->sans, &md->sans, NULL) != 0) {
-        free(md->subject_dn);
-        free(md->issuer_dn);
-        free(md);
-        return ENOMEM;
-    }
+                                &md->sans, &md->sans, NULL) != 0)
+        md->sans = NULL;
     *ret_data = md;
     return 0;
 }