diff options
author | jsing <> | 2021-05-05 19:52:00 +0000 |
---|---|---|
committer | jsing <> | 2021-05-05 19:52:00 +0000 |
commit | 00a09bf96d7f1c78d30414599acdc9f4726ae1d9 (patch) | |
tree | c4972b111b85c35ea051ffda0557306d1ed130c8 /src/lib/libssl/d1_both.c | |
parent | 61ec18da26d0571bc925e8f60b9f8b60ce5ca1fb (diff) | |
download | openbsd-00a09bf96d7f1c78d30414599acdc9f4726ae1d9.tar.gz openbsd-00a09bf96d7f1c78d30414599acdc9f4726ae1d9.tar.bz2 openbsd-00a09bf96d7f1c78d30414599acdc9f4726ae1d9.zip |
Replace DTLS w_epoch with epoch from TLSv1.2 record layer.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/d1_both.c')
-rw-r--r-- | src/lib/libssl/d1_both.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/lib/libssl/d1_both.c b/src/lib/libssl/d1_both.c index ba05c2a354..3b9880b600 100644 --- a/src/lib/libssl/d1_both.c +++ b/src/lib/libssl/d1_both.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: d1_both.c,v 1.69 2021/04/19 16:51:56 jsing Exp $ */ | 1 | /* $OpenBSD: d1_both.c,v 1.70 2021/05/05 19:52:00 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * DTLS implementation written by Nagendra Modadugu | 3 | * DTLS implementation written by Nagendra Modadugu |
4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. | 4 | * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. |
@@ -972,7 +972,8 @@ dtls1_buffer_message(SSL *s, int is_ccs) | |||
972 | 972 | ||
973 | /* save current state*/ | 973 | /* save current state*/ |
974 | frag->msg_header.saved_retransmit_state.session = s->session; | 974 | frag->msg_header.saved_retransmit_state.session = s->session; |
975 | frag->msg_header.saved_retransmit_state.epoch = D1I(s)->w_epoch; | 975 | frag->msg_header.saved_retransmit_state.epoch = |
976 | tls12_record_layer_write_epoch(s->internal->rl); | ||
976 | 977 | ||
977 | memset(seq64be, 0, sizeof(seq64be)); | 978 | memset(seq64be, 0, sizeof(seq64be)); |
978 | seq64be[6] = (unsigned char)(dtls1_get_queue_priority( | 979 | seq64be[6] = (unsigned char)(dtls1_get_queue_priority( |
@@ -1039,15 +1040,14 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, | |||
1039 | 1040 | ||
1040 | /* save current state */ | 1041 | /* save current state */ |
1041 | saved_state.session = s->session; | 1042 | saved_state.session = s->session; |
1042 | saved_state.epoch = D1I(s)->w_epoch; | 1043 | saved_state.epoch = tls12_record_layer_write_epoch(s->internal->rl); |
1043 | 1044 | ||
1044 | D1I(s)->retransmitting = 1; | 1045 | D1I(s)->retransmitting = 1; |
1045 | 1046 | ||
1046 | /* restore state in which the message was originally sent */ | 1047 | /* restore state in which the message was originally sent */ |
1047 | s->session = frag->msg_header.saved_retransmit_state.session; | 1048 | s->session = frag->msg_header.saved_retransmit_state.session; |
1048 | D1I(s)->w_epoch = frag->msg_header.saved_retransmit_state.epoch; | 1049 | if (!tls12_record_layer_use_write_epoch(s->internal->rl, |
1049 | 1050 | frag->msg_header.saved_retransmit_state.epoch)) | |
1050 | if (!tls12_record_layer_use_write_epoch(s->internal->rl, D1I(s)->w_epoch)) | ||
1051 | return 0; | 1051 | return 0; |
1052 | 1052 | ||
1053 | ret = dtls1_do_write(s, frag->msg_header.is_ccs ? | 1053 | ret = dtls1_do_write(s, frag->msg_header.is_ccs ? |
@@ -1055,9 +1055,8 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, | |||
1055 | 1055 | ||
1056 | /* restore current state */ | 1056 | /* restore current state */ |
1057 | s->session = saved_state.session; | 1057 | s->session = saved_state.session; |
1058 | D1I(s)->w_epoch = saved_state.epoch; | 1058 | if (!tls12_record_layer_use_write_epoch(s->internal->rl, |
1059 | 1059 | saved_state.epoch)) | |
1060 | if (!tls12_record_layer_use_write_epoch(s->internal->rl, D1I(s)->w_epoch)) | ||
1061 | return 0; | 1060 | return 0; |
1062 | 1061 | ||
1063 | D1I(s)->retransmitting = 0; | 1062 | D1I(s)->retransmitting = 0; |