From 1267bf013aafa68c14d57a3339cb1c222b56bcdc Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mar 24 2011 18:43:41 +0000 Subject: - apply the check-for-readable-pin test to certificate reading, too --- diff --git a/src/certread-n.c b/src/certread-n.c index c4d6a37..0048324 100644 --- a/src/certread-n.c +++ b/src/certread-n.c @@ -112,6 +112,10 @@ cm_certread_n_main(int fd, struct cm_store_ca *ca, struct cm_store_entry *entry, /* Walk the list looking for the requested slot, or the first one if * none was requested. */ cert = NULL; + if (cm_pin_read_for_cert(entry, &pin) != 0) { + cm_log(1, "Error reading PIN for cert db.\n"); + _exit(CM_STATUS_ERROR_AUTH); + } PK11_SetPasswordFunc(&cm_pin_read_for_cert_nss_cb); for (sle = slotlist->head; ((sle != NULL) && (sle->slot != NULL));