if (ss->ssl3->prSpec == ss->ssl3->pwSpec) { ssl3_DestroyCipherSpec(ss->ssl3->pwSpec);
if (ss->ssl3.prSpec == ss->ssl3.pwSpec) { ssl3_DestroyCipherSpec(ss->ssl3.pwSpec);
ssl3_SendChangeCipherSpecs(sslSocket *ss){    uint8             change = change_cipher_spec_choice;    ssl3State *       ssl3   = ss->ssl3;    ssl3CipherSpec *  pwSpec;    SECStatus         rv;    PRInt32           sent;    SSL_TRC(3, ("%d: SSL3[%d]: send change_cipher_spec record",		SSL_GETPID(), ss->fd));    PORT_Assert( ssl_HaveXmitBufLock(ss) );    PORT_Assert( ssl_HaveSSL3HandshakeLock(ss));    rv = ssl3_FlushHandshake(ss, ssl_SEND_FLAG_FORCE_INTO_BUFFER);    if (rv != SECSuccess) {	return rv;	/* error code set by ssl3_FlushHandshake */    }    sent = ssl3_SendRecord(ss, content_change_cipher_spec, &change, 1,                              ssl_SEND_FLAG_FORCE_INTO_BUFFER);    if (sent < 0) {	return (SECStatus)sent;	/* error code set by ssl3_SendRecord */    }    /* swap the pending and current write specs. */    ssl_GetSpecWriteLock(ss);	/**************************************/    pwSpec                     = ss->ssl3->pwSpec;    pwSpec->write_seq_num.high = 0;    pwSpec->write_seq_num.low  = 0;    ssl3->pwSpec = ssl3->cwSpec;    ssl3->cwSpec = pwSpec;    SSL_TRC(3, ("%d: SSL3[%d] Set Current Write Cipher Suite to Pending",		SSL_GETPID(), ss->fd ));    /* We need to free up the contexts, keys and certs ! */    /* If we are really through with the old cipher spec     * (Both the read and write sides have changed) destroy it.     */    if (ss->ssl3->prSpec == ss->ssl3->pwSpec) {    	ssl3_DestroyCipherSpec(ss->ssl3->pwSpec);    }    ssl_ReleaseSpecWriteLock(ss); /**************************************/    return SECSuccess;}