Skip to content

Commit

Permalink
Use PKCS11_MODNAME for NSS PKINIT by default
Browse files Browse the repository at this point in the history
Do what the OpenSSL-using code paths do, and load PKCS11_MODNAME if no
module is specified when we're told to use a PKCS11 identity.
  • Loading branch information
nalind authored and greghudson committed Jul 17, 2013
1 parent 805cd60 commit fc975f6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plugins/preauth/pkinit/pkinit_crypto_nss.c
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,13 @@ crypto_load_pkcs11(krb5_context context,
if (idopts == NULL)
return SECFailure;

/* If no module is specified, use the default module from pkinit.h. */
if (idopts->p11_module_name == NULL) {
idopts->p11_module_name = strdup(PKCS11_MODNAME);
if (idopts->p11_module_name == NULL)
return SECFailure;
}

/* Build the module spec. */
spec_size = strlen("library=''") + strlen(idopts->p11_module_name) * 2 + 1;
spec = PORT_ArenaZAlloc(id_cryptoctx->pool, spec_size);
Expand Down

0 comments on commit fc975f6

Please sign in to comment.