return SECFailure;
goto loser;
ssl3_ComputeHandshakeHashes(sslSocket *     ss,                            ssl3CipherSpec *spec,   /* uses ->master_secret */			    SSL3Hashes *    hashes, /* output goes here. */			    uint32          sender){    ssl3State *   ssl3      = ss->ssl3;    PK11Context * md5;    PK11Context * sha       = NULL;    SECStatus     rv        = SECSuccess;    unsigned int  outLength;    PRBool        isTLS;    SSL3Opaque    md5_inner[MAX_MAC_LENGTH];    SSL3Opaque    sha_inner[MAX_MAC_LENGTH];    unsigned char s[4];    PORT_Assert( ssl_HaveSSL3HandshakeLock(ss) );    isTLS = (PRBool)(spec->version > SSL_LIBRARY_VERSION_3_0);    md5 = PK11_CloneContext(ssl3->hs.md5);    if (md5 == NULL) {	ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);    	return SECFailure;    }    sha = PK11_CloneContext(ssl3->hs.sha);    if (sha == NULL) {	ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);	goto loser;    }    if (!isTLS) {	/* compute hashes for SSL3. */	s[0] = (unsigned char)(sender >> 24);	s[1] = (unsigned char)(sender >> 16);	s[2] = (unsigned char)(sender >> 8);	s[3] = (unsigned char)sender;	if (sender != 0) {	    rv |= PK11_DigestOp(md5, s, 4);	    PRINT_BUF(95, (NULL, "MD5 inner: sender", s, 4));	}	PRINT_BUF(95, (NULL, "MD5 inner: MAC Pad 1", mac_pad_1, mac_defs[mac_md5].pad_size));	rv |= PK11_DigestKey(md5,spec->master_secret);	rv |= PK11_DigestOp(md5, mac_pad_1, mac_defs[mac_md5].pad_size);	rv |= PK11_DigestFinal(md5, md5_inner, &outLength, MD5_LENGTH);	PORT_Assert(rv != SECSuccess || outLength == MD5_LENGTH);	if (rv != SECSuccess) {	    ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);	    rv = SECFailure;	    goto loser;	}	PRINT_BUF(95, (NULL, "MD5 inner: result", md5_inner, outLength));	if (sender != 0) {	    rv |= PK11_DigestOp(sha, s, 4);	    PRINT_BUF(95, (NULL, "SHA inner: sender", s, 4));	}	PRINT_BUF(95, (NULL, "SHA inner: MAC Pad 1", mac_pad_1, mac_defs[mac_sha].pad_size));	rv |= PK11_DigestKey(sha, spec->master_secret);	rv |= PK11_DigestOp(sha, mac_pad_1, mac_defs[mac_sha].pad_size);	rv |= PK11_DigestFinal(sha, sha_inner, &outLength, SHA1_LENGTH);	PORT_Assert(rv != SECSuccess || outLength == SHA1_LENGTH);	if (rv != SECSuccess) {	    ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);	    rv = SECFailure;	    goto loser;	}	PRINT_BUF(95, (NULL, "SHA inner: result", sha_inner, outLength));	PRINT_BUF(95, (NULL, "MD5 outer: MAC Pad 2", mac_pad_2, mac_defs[mac_md5].pad_size));	PRINT_BUF(95, (NULL, "MD5 outer: MD5 inner", md5_inner, MD5_LENGTH));	rv |= PK11_DigestBegin(md5);	rv |= PK11_DigestKey(md5, spec->master_secret);	rv |= PK11_DigestOp(md5, mac_pad_2, mac_defs[mac_md5].pad_size);	rv |= PK11_DigestOp(md5, md5_inner, MD5_LENGTH);    }    rv |= PK11_DigestFinal(md5, hashes->md5, &outLength, MD5_LENGTH);    PORT_Assert(rv != SECSuccess || outLength == MD5_LENGTH);    if (rv != SECSuccess) {	ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);	rv = SECFailure;	goto loser;    }    PRINT_BUF(60, (NULL, "MD5 outer: result", hashes->md5, MD5_LENGTH));    if (!isTLS) {	PRINT_BUF(95, (NULL, "SHA outer: MAC Pad 2", mac_pad_2, mac_defs[mac_sha].pad_size));	PRINT_BUF(95, (NULL, "SHA outer: SHA inner", sha_inner, SHA1_LENGTH));	rv |= PK11_DigestBegin(sha);	rv |= PK11_DigestKey(sha,spec->master_secret);	rv |= PK11_DigestOp(sha, mac_pad_2, mac_defs[mac_sha].pad_size);	rv |= PK11_DigestOp(sha, sha_inner, SHA1_LENGTH);    }    rv |= PK11_DigestFinal(sha, hashes->sha, &outLength, SHA1_LENGTH);    PORT_Assert(rv != SECSuccess || outLength == SHA1_LENGTH);    if (rv != SECSuccess) {	ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);	rv = SECFailure;	goto loser;    }    PRINT_BUF(60, (NULL, "SHA outer: result", hashes->sha, SHA1_LENGTH));    rv = SECSuccess;loser:    if (md5) PK11_DestroyContext(md5, PR_TRUE);    if (sha) PK11_DestroyContext(sha, PR_TRUE);    return rv;}