提交 c427570e 编写于 作者: M Matt Caswell

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: NAndy Polyakov <appro@openssl.org>
上级 29b0a15a
...@@ -168,7 +168,7 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) ...@@ -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, i = s->method->ssl3_enc->final_finish_mac(s,
sender, slen, sender, slen,
s->s3->tmp.finish_md); s->s3->tmp.finish_md);
if (i == 0) if (i <= 0)
return 0; return 0;
s->s3->tmp.finish_md_len = i; s->s3->tmp.finish_md_len = i;
memcpy(p, s->s3->tmp.finish_md, i); memcpy(p, s->s3->tmp.finish_md, i);
......
...@@ -2073,7 +2073,6 @@ void dtls1_set_message_header(SSL *s, ...@@ -2073,7 +2073,6 @@ void dtls1_set_message_header(SSL *s,
__owur int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len); __owur int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len);
__owur int dtls1_send_change_cipher_spec(SSL *s, int a, int b); __owur int dtls1_send_change_cipher_spec(SSL *s, int a, int b);
__owur int dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen);
__owur int dtls1_read_failed(SSL *s, int code); __owur int dtls1_read_failed(SSL *s, int code);
__owur int dtls1_buffer_message(SSL *s, int ccs); __owur int dtls1_buffer_message(SSL *s, int ccs);
__owur int dtls1_retransmit_message(SSL *s, unsigned short seq, __owur int dtls1_retransmit_message(SSL *s, unsigned short seq,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册