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>
This commit is contained in:
@@ -168,7 +168,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);
|
||||
|
Reference in New Issue
Block a user