if (kea == kt_rsa) { rv = ssl3_CreateRSAStepDownKeys(ss); if (rv != SECSuccess) { return SECFailure;
if (kea == kt_rsa && cert && sc->serverKeyBits > 512) { if (ss->noStepDown) {  } else { rv = ssl3_CreateRSAStepDownKeys(ss); if (rv != SECSuccess) { return SECFailure;  }
SSL_ConfigSecureServer(PRFileDesc *fd, CERTCertificate *cert,		       SECKEYPrivateKey *key, SSL3KEAType kea){    SECStatus rv;    sslSocket *ss;    sslServerCerts  *sc;    ss = ssl_FindSocket(fd);    if (!ss) {	return SECFailure;    }    /* Both key and cert must have a value or be NULL */    /* Passing a value of NULL will turn off key exchange algorithms that were     * previously turned on */    if (!cert != !key) {	PORT_SetError(SEC_ERROR_INVALID_ARGS);	return SECFailure;    }    /* make sure the key exchange is recognized */    if ((kea >= kt_kea_size) || (kea < kt_null)) {	PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);	return SECFailure;    }    if (kea != ssl_FindCertKEAType(cert)) {    	PORT_SetError(SSL_ERROR_CERT_KEA_MISMATCH);	return SECFailure;    }    sc = ss->serverCerts + kea;    /* load the server certificate */    if (sc->serverCert != NULL) {	CERT_DestroyCertificate(sc->serverCert);    	sc->serverCert = NULL;    }    if (cert) {	SECKEYPublicKey * pubKey;	sc->serverCert = CERT_DupCertificate(cert);	if (!sc->serverCert)	    goto loser;    	/* get the size of the cert's public key, and remember it */	pubKey = CERT_ExtractPublicKey(cert);	if (!pubKey) 	    goto loser;	sc->serverKeyBits = SECKEY_PublicKeyStrengthInBits(pubKey);	SECKEY_DestroyPublicKey(pubKey); 	pubKey = NULL;    }    /* load the server cert chain */    if (sc->serverCertChain != NULL) {	CERT_DestroyCertificateList(sc->serverCertChain);    	sc->serverCertChain = NULL;    }    if (cert) {	sc->serverCertChain = CERT_CertChainFromCert(			    sc->serverCert, certUsageSSLServer, PR_TRUE);	if (sc->serverCertChain == NULL)	     goto loser;    }    /* load the private key */    if (sc->serverKey != NULL) {	SECKEY_DestroyPrivateKey(sc->serverKey);    	sc->serverKey = NULL;    }    if (key) {	sc->serverKey = SECKEY_CopyPrivateKey(key);	if (sc->serverKey == NULL)	    goto loser;	SECKEY_CacheStaticFlags(sc->serverKey);    }    if (kea == kt_rsa) {        rv = ssl3_CreateRSAStepDownKeys(ss);	if (rv != SECSuccess) {	    return SECFailure;	/* err set by ssl3_CreateRSAStepDownKeys */	}    }    /* Only do this once because it's global. */    if (ssl3_server_ca_list == NULL)	ssl3_server_ca_list = CERT_GetSSLCACerts(ss->dbHandle);    return SECSuccess;loser:    if (sc->serverCert != NULL) {	CERT_DestroyCertificate(sc->serverCert);	sc->serverCert = NULL;    }    if (sc->serverCertChain != NULL) {	CERT_DestroyCertificateList(sc->serverCertChain);	sc->serverCertChain = NULL;    }    if (sc->serverKey != NULL) {	SECKEY_DestroyPrivateKey(sc->serverKey);	sc->serverKey = NULL;    }    return SECFailure;}