]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Make the PKINIT NSS path also check for NULL certs
authorNalin Dahyabhai <nalin@dahyabhai.net>
Tue, 9 Jul 2013 18:13:16 +0000 (14:13 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 17 Jul 2013 16:24:21 +0000 (12:24 -0400)
When called to free identity information, do what the OpenSSL-based
version does, and error out if the identity information is NULL.

src/plugins/preauth/pkinit/pkinit_crypto_nss.c

index 1b2172c223918e2479497d23f97b49a88e803467..56a21702d43a9ba9f31585b84770cd946eb56e6b 100644 (file)
@@ -2985,7 +2985,12 @@ crypto_free_cert_info(krb5_context context,
                       pkinit_req_crypto_context req_cryptoctx,
                       pkinit_identity_crypto_context id_cryptoctx)
 {
-    return 0;   /* Maybe should we nuke the id_certs list here? */
+    /* Mimic the OpenSSL-based implementation's check first. */
+    if (id_cryptoctx == NULL)
+        return EINVAL;
+
+    /* Maybe should we nuke the id_certs list here? */
+    return 0;
 }
 
 /* Count how many candidate "self" certificates and keys we have.  We could as