diff options
author | Adam Langley <agl@chromium.org> | 2014-06-20 23:00:00 +0400 |
---|---|---|
committer | Adam Langley <agl@chromium.org> | 2014-06-21 00:17:42 +0400 |
commit | 0fbf33a691f1e9f294bf7392b9631046bcb3ab3f (patch) | |
tree | d80a363e12ac90731a114500b2a772d0f9f1ecd2 /ssl/s3_enc.c | |
parent | e044fe4bc773061589d40bf56011843570fd63aa (diff) |
Fixed incorrect return code handling in ssl3_final_finish_mac.
Based on an original patch by Joel Sing (OpenBSD) who also originally
identified the issue.
(Imported from upstream's 728bd41a159ea16a60111e7c1120ec2a005507b3)
Diffstat (limited to 'ssl/s3_enc.c')
-rw-r--r-- | ssl/s3_enc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index b35af844..4a557f62 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -608,10 +608,18 @@ int ssl3_cert_verify_mac(SSL *s, int md_nid, unsigned char *p) int ssl3_final_finish_mac(SSL *s, const char *sender, int len, unsigned char *p) { - int ret; + int ret, sha1len; ret=ssl3_handshake_mac(s,NID_md5,sender,len,p); + if(ret == 0) + return 0; + p+=ret; - ret+=ssl3_handshake_mac(s,NID_sha1,sender,len,p); + + sha1len=ssl3_handshake_mac(s,NID_sha1,sender,len,p); + if(sha1len == 0) + return 0; + + ret+=sha1len; return(ret); } |