diff options
Diffstat (limited to 'src/lib/libssl/s3_both.c')
-rw-r--r-- | src/lib/libssl/s3_both.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/libssl/s3_both.c b/src/lib/libssl/s3_both.c index 6981852b5b..ed0fcfc532 100644 --- a/src/lib/libssl/s3_both.c +++ b/src/lib/libssl/s3_both.c | |||
@@ -161,6 +161,8 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
161 | 161 | ||
162 | i=s->method->ssl3_enc->final_finish_mac(s, | 162 | i=s->method->ssl3_enc->final_finish_mac(s, |
163 | sender,slen,s->s3->tmp.finish_md); | 163 | sender,slen,s->s3->tmp.finish_md); |
164 | if (i == 0) | ||
165 | return 0; | ||
164 | s->s3->tmp.finish_md_len = i; | 166 | s->s3->tmp.finish_md_len = i; |
165 | memcpy(p, s->s3->tmp.finish_md, i); | 167 | memcpy(p, s->s3->tmp.finish_md, i); |
166 | p+=i; | 168 | p+=i; |
@@ -208,6 +210,11 @@ static void ssl3_take_mac(SSL *s) { | |||
208 | const char *sender; | 210 | const char *sender; |
209 | int slen; | 211 | int slen; |
210 | 212 | ||
213 | /* If no new cipher setup return immediately: other functions will | ||
214 | * set the appropriate error. | ||
215 | */ | ||
216 | if (s->s3->tmp.new_cipher == NULL) | ||
217 | return; | ||
211 | if (s->state & SSL_ST_CONNECT) | 218 | if (s->state & SSL_ST_CONNECT) |
212 | { | 219 | { |
213 | sender=s->method->ssl3_enc->server_finished_label; | 220 | sender=s->method->ssl3_enc->server_finished_label; |