summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_clnt.c
diff options
context:
space:
mode:
authorjsing <>2018-11-21 15:13:29 +0000
committerjsing <>2018-11-21 15:13:29 +0000
commitab91451e6ebf1260022c78c25a334e437c04d78e (patch)
tree7992535c747d2aff7dd9a131f8fc65ad2af3636d /src/lib/libssl/ssl_clnt.c
parent1b50b4396296c64d8937c2ec1c7ed2eb5547cf91 (diff)
downloadopenbsd-ab91451e6ebf1260022c78c25a334e437c04d78e.tar.gz
openbsd-ab91451e6ebf1260022c78c25a334e437c04d78e.tar.bz2
openbsd-ab91451e6ebf1260022c78c25a334e437c04d78e.zip
Fix DTLS transcript handling for HelloVerifyRequest.
If DTLS sees a HelloVerifyRequest the transcript is reset - the previous tls1_init_finished_mac() function could be called multiple times and would discard any existing state. The replacement tls1_transcript_init() is more strict and fails if a transcript already exists. Provide an explicit tls1_transcript_reset() function and call it from the appropriate places. This also lets us make DTLS less of a special snowflake and call tls1_transcript_init() in the same place as used for TLS. ok beck@ tb@
Diffstat (limited to '')
-rw-r--r--src/lib/libssl/ssl_clnt.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index 35df70f2f0..65277ef4ef 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.49 2018/11/19 15:07:29 jsing Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.50 2018/11/21 15:13:29 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -244,11 +244,9 @@ ssl3_connect(SSL *s)
244 244
245 /* don't push the buffering BIO quite yet */ 245 /* don't push the buffering BIO quite yet */
246 246
247 if (!SSL_IS_DTLS(s)) { 247 if (!tls1_transcript_init(s)) {
248 if (!tls1_transcript_init(s)) { 248 ret = -1;
249 ret = -1; 249 goto end;
250 goto end;
251 }
252 } 250 }
253 251
254 S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_A; 252 S3I(s)->hs.state = SSL3_ST_CW_CLNT_HELLO_A;
@@ -270,10 +268,7 @@ ssl3_connect(SSL *s)
270 268
271 if (SSL_IS_DTLS(s)) { 269 if (SSL_IS_DTLS(s)) {
272 /* every DTLS ClientHello resets Finished MAC */ 270 /* every DTLS ClientHello resets Finished MAC */
273 if (!tls1_transcript_init(s)) { 271 tls1_transcript_reset(s);
274 ret = -1;
275 goto end;
276 }
277 272
278 dtls1_start_timer(s); 273 dtls1_start_timer(s);
279 } 274 }