diff options
author | Matt Caswell <matt@openssl.org> | 2015-04-28 15:19:50 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-04-30 23:27:05 +0100 |
commit | 26800340dba2bf056d508007ee4d30e41d4e8f5f (patch) | |
tree | e95cae9fa4aefa98c7d551274e07e737711dc47c | |
parent | 592ac25342a7863f38a3b316b183e90596f528b1 (diff) |
Sanity check the return from final_finish_mac
The return value is checked for 0. This is currently safe but we should
really check for <= 0 since -1 is frequently used for error conditions.
Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3
Solutions) for reporting this issue.
Reviewed-by: Andy Polyakov <appro@openssl.org>
(cherry picked from commit c427570e5098e120cbcb66e799f85c317aac7b91)
Conflicts:
ssl/ssl_locl.h
Conflicts:
ssl/ssl_locl.h
-rw-r--r-- | ssl/s3_both.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/s3_both.c b/ssl/s3_both.c index 77374f41ee..107b460f27 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -169,7 +169,7 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) i = s->method->ssl3_enc->final_finish_mac(s, sender, slen, s->s3->tmp.finish_md); - if (i == 0) + if (i <= 0) return 0; s->s3->tmp.finish_md_len = i; memcpy(p, s->s3->tmp.finish_md, i); |