cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: problem with NSS backend and threads

From: Peter Wang <novalazy_at_gmail.com>
Date: Thu, 18 Aug 2016 11:45:24 +1000

On Wed, 17 Aug 2016 10:42:38 +0200, Kamil Dudka <kdudka_at_redhat.com> wrote:
>
> Do I understand it correctly that PK11_FindSlotByName(slot_name) returns NULL?
> What is the output of PR_GetError() in that case?

Hi,

Yes, PK11_FindSlotByName() returns NULL.
PR_GetError() returns -8127 SEC_ERROR_NO_TOKEN.

Upon further investigation, PK11_FindSlotByName() returns NULL
... because PK11_IsPresent(tmpSlot) returns false
... because pk11_IsPresentCertLoad(slot,PR_TRUE) returns false
... because nssToken_IsPresent(slot->nssToken) returns false
... because nssSlot_IsTokenPresent(token->slot) returns false

which is due to this branch in nssSlot_IsTokenPresent()

    /* avoid repeated calls to check token status within set interval */
    if (within_token_delay_period(slot)) {
        return ((slot->ckFlags & CKF_TOKEN_PRESENT) != 0);
    }

Peter
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-08-18