if (sock->clientCertNickname) { cert = PK11_FindCertFromNickname(sock->clientCertNickname, NULL ); if ( cert ) { privkey = PK11_FindKeyByAnyCert(cert, NULL ); if ( privkey ) { rv = SECSuccess; } else { CERT_DestroyCertificate(cert); }
if (sock->clientCert) { privkey = PK11_FindKeyByAnyCert(sock->clientCert, NULL ); if ( privkey ) { rv = SECSuccess;
JSSL_GetClientAuthData( void * arg,                        PRFileDesc *        fd,                        CERTDistNames *     caNames,                        CERTCertificate **  pRetCert,                        SECKEYPrivateKey ** pRetKey){    CERTCertificate *  cert;    SECKEYPrivateKey * privkey;    JSSL_SocketData *  sock;    SECStatus          rv         = SECFailure;    PR_ASSERT(arg != NULL);    sock = (JSSL_SocketData*) arg;    if (sock->clientCertNickname) {        cert = PK11_FindCertFromNickname(sock->clientCertNickname,                                         NULL /*pinarg*/);        if ( cert ) {            privkey = PK11_FindKeyByAnyCert(cert, NULL /*pinarg*/);            if ( privkey ) {                rv = SECSuccess;            } else {                 CERT_DestroyCertificate(cert);            }        }    }        if (rv == SECSuccess) {        *pRetCert = cert;         *pRetKey  = privkey;    }        return rv;}