aboutsummaryrefslogtreecommitdiff
path: root/openssl/ssl/s3_both.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/ssl/s3_both.c')
-rw-r--r--openssl/ssl/s3_both.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openssl/ssl/s3_both.c b/openssl/ssl/s3_both.c
index ead01c82a..53b9390fd 100644
--- a/openssl/ssl/s3_both.c
+++ b/openssl/ssl/s3_both.c
@@ -161,6 +161,8 @@ 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)
+ return 0;
s->s3->tmp.finish_md_len = i;
memcpy(p, s->s3->tmp.finish_md, i);
p+=i;
@@ -208,7 +210,11 @@ static void ssl3_take_mac(SSL *s)
{
const char *sender;
int slen;
-
+ /* If no new cipher setup return immediately: other functions will
+ * set the appropriate error.
+ */
+ if (s->s3->tmp.new_cipher == NULL)
+ return;
if (s->state & SSL_ST_CONNECT)
{
sender=s->method->ssl3_enc->server_finished_label;