rv = ssl3_SetupPendingCipherSpec(ss, ss->ssl3);
rv = ssl3_SetupPendingCipherSpec(ss);
ssl3_SendServerHello(sslSocket *ss){    sslSessionID *sid;    SECStatus     rv;    PRUint32      length;    SSL_TRC(3, ("%d: SSL3[%d]: send server_hello handshake", SSL_GETPID(),		ss->fd));    PORT_Assert( ssl_HaveXmitBufLock(ss));    PORT_Assert( ssl_HaveSSL3HandshakeLock(ss));    PORT_Assert( MSB(ss->version) == MSB(SSL_LIBRARY_VERSION_3_0));    if (MSB(ss->version) != MSB(SSL_LIBRARY_VERSION_3_0)) {	PORT_SetError(SSL_ERROR_NO_CYPHER_OVERLAP);	return SECFailure;    }    sid = ss->sec.ci.sid;    length = sizeof(SSL3ProtocolVersion) + SSL3_RANDOM_LENGTH + 1 +             ((sid == NULL) ? 0: SSL3_SESSIONID_BYTES) +	     sizeof(ssl3CipherSuite) + 1;    rv = ssl3_AppendHandshakeHeader(ss, server_hello, length);    if (rv != SECSuccess) {	return rv;	/* err set by AppendHandshake. */    }    rv = ssl3_AppendHandshakeNumber(ss, ss->version, 2);    if (rv != SECSuccess) {	return rv;	/* err set by AppendHandshake. */    }    rv = ssl3_GetNewRandom(&ss->ssl3->hs.server_random);    if (rv != SECSuccess) {	ssl_MapLowLevelError(SSL_ERROR_GENERATE_RANDOM_FAILURE);	return rv;    }    rv = ssl3_AppendHandshake(	ss, &ss->ssl3->hs.server_random, SSL3_RANDOM_LENGTH);    if (rv != SECSuccess) {	return rv;	/* err set by AppendHandshake. */    }    if (sid)	rv = ssl3_AppendHandshakeVariable(	    ss, sid->u.ssl3.sessionID, sid->u.ssl3.sessionIDLength, 1);    else	rv = ssl3_AppendHandshakeVariable(ss, NULL, 0, 1);    if (rv != SECSuccess) {	return rv;	/* err set by AppendHandshake. */    }    rv = ssl3_AppendHandshakeNumber(ss, ss->ssl3->hs.cipher_suite, 2);    if (rv != SECSuccess) {	return rv;	/* err set by AppendHandshake. */    }    rv = ssl3_AppendHandshakeNumber(ss, ss->ssl3->hs.compression, 1);    if (rv != SECSuccess) {	return rv;	/* err set by AppendHandshake. */    }    rv = ssl3_SetupPendingCipherSpec(ss, ss->ssl3);    if (rv != SECSuccess) {	return rv;	/* err set by ssl3_SetupPendingCipherSpec */    }    return SECSuccess;}