SSL3WaitState              ws      = ss->ssl3->hs.ws;
SSL3WaitState              ws      = ss->ssl3.hs.ws;
ssl3_HandleChangeCipherSpecs(sslSocket *ss, sslBuffer *buf){    ssl3CipherSpec *           prSpec;    SSL3WaitState              ws      = ss->ssl3->hs.ws;    SSL3ChangeCipherSpecChoice change;    PORT_Assert( ssl_HaveRecvBufLock(ss) );    PORT_Assert( ssl_HaveSSL3HandshakeLock(ss) );    SSL_TRC(3, ("%d: SSL3[%d]: handle change_cipher_spec record",		SSL_GETPID(), ss->fd));    if (ws != wait_change_cipher) {	(void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);	PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER);	return SECFailure;    }    if(buf->len != 1) {	(void)ssl3_DecodeError(ss);	PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);	return SECFailure;    }    change = (SSL3ChangeCipherSpecChoice)buf->buf[0];    if (change != change_cipher_spec_choice) {	/* illegal_parameter is correct here for both SSL3 and TLS. */	(void)ssl3_IllegalParameter(ss);	PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);	return SECFailure;    }    buf->len = 0;    /* Swap the pending and current read specs. */    ssl_GetSpecWriteLock(ss);   /*************************************/    prSpec                    = ss->ssl3->prSpec;    prSpec->read_seq_num.high = prSpec->read_seq_num.low = 0;    ss->ssl3->prSpec  = ss->ssl3->crSpec;    ss->ssl3->crSpec  = prSpec;    ss->ssl3->hs.ws         = wait_finished;    SSL_TRC(3, ("%d: SSL3[%d] Set Current Read Cipher Suite to Pending",		SSL_GETPID(), ss->fd ));    /* If we are really through with the old cipher prSpec     * (Both the read and write sides have changed) destroy it.     */    if (ss->ssl3->prSpec == ss->ssl3->pwSpec) {    	ssl3_DestroyCipherSpec(ss->ssl3->prSpec);    }    ssl_ReleaseSpecWriteLock(ss);   /*************************************/    return SECSuccess;}