diff options
author | jkim <jkim@FreeBSD.org> | 2013-02-13 23:07:20 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-02-13 23:07:20 +0000 |
commit | 754bee57763650b50ece26c6f026c1795b4132d8 (patch) | |
tree | 265bba8e82f9a88ce59fc212bc8bf5e01c270b16 /crypto/openssl/ssl/s3_both.c | |
parent | a6d6a2787087806f8a0ae6290d1df47c9471a269 (diff) | |
parent | 9069337c8384d04bea914cdfac40b533e60cade6 (diff) | |
download | FreeBSD-src-754bee57763650b50ece26c6f026c1795b4132d8.zip FreeBSD-src-754bee57763650b50ece26c6f026c1795b4132d8.tar.gz |
Merge OpenSSL 1.0.1e.
Approved by: secteam (simon), benl (silence)
Diffstat (limited to 'crypto/openssl/ssl/s3_both.c')
-rw-r--r-- | crypto/openssl/ssl/s3_both.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crypto/openssl/ssl/s3_both.c b/crypto/openssl/ssl/s3_both.c index b63460a..ead01c8 100644 --- a/crypto/openssl/ssl/s3_both.c +++ b/crypto/openssl/ssl/s3_both.c @@ -204,7 +204,8 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) #ifndef OPENSSL_NO_NEXTPROTONEG /* ssl3_take_mac calculates the Finished MAC for the handshakes messages seen to far. */ -static void ssl3_take_mac(SSL *s) { +static void ssl3_take_mac(SSL *s) + { const char *sender; int slen; @@ -221,7 +222,7 @@ static void ssl3_take_mac(SSL *s) { s->s3->tmp.peer_finish_md_len = s->method->ssl3_enc->final_finish_mac(s, sender,slen,s->s3->tmp.peer_finish_md); -} + } #endif int ssl3_get_finished(SSL *s, int a, int b) @@ -231,8 +232,9 @@ int ssl3_get_finished(SSL *s, int a, int b) unsigned char *p; #ifdef OPENSSL_NO_NEXTPROTONEG - /* the mac has already been generated when we received the change - * cipher spec message and is in s->s3->tmp.peer_finish_md. */ + /* the mac has already been generated when we received the + * change cipher spec message and is in s->s3->tmp.peer_finish_md. + */ #endif n=s->method->ssl_get_message(s, @@ -263,7 +265,7 @@ int ssl3_get_finished(SSL *s, int a, int b) goto f_err; } - if (memcmp(p, s->s3->tmp.peer_finish_md, i) != 0) + if (CRYPTO_memcmp(p, s->s3->tmp.peer_finish_md, i) != 0) { al=SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_FINISHED,SSL_R_DIGEST_CHECK_FAILED); @@ -537,12 +539,14 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) s->init_num += i; n -= i; } + #ifndef OPENSSL_NO_NEXTPROTONEG /* If receiving Finished, record MAC of prior handshake messages for * Finished verification. */ if (*s->init_buf->data == SSL3_MT_FINISHED) ssl3_take_mac(s); #endif + /* Feed this message into MAC computation. */ ssl3_finish_mac(s, (unsigned char *)s->init_buf->data, s->init_num + 4); if (s->msg_callback) |