diff options
author | 2021-01-19 19:07:39 +0000 | |
---|---|---|
committer | 2021-01-19 19:07:39 +0000 | |
commit | a802a16adaa92c0a0d3b8521ebf2eaf7341efd30 (patch) | |
tree | 3594e3ea263f5f0bcfcab515c135e3ce2ebf446b /lib/libssl/d1_both.c | |
parent | Provide functions to determine if TLSv1.2 record protection is engaged. (diff) | |
download | wireguard-openbsd-a802a16adaa92c0a0d3b8521ebf2eaf7341efd30.tar.xz wireguard-openbsd-a802a16adaa92c0a0d3b8521ebf2eaf7341efd30.zip |
Add code to handle change of cipher state in the new TLSv1.2 record layer.
This provides the basic framework for handling change of cipher state in
the new TLSv1.2 record layer, creating new record protection. In the DTLS
case we retain the previous write record protection and can switch back to
it when retransmitting. This will allow the record layer to start owning
sequence numbers and encryption/decryption state.
ok inoguchi@ tb@
Diffstat (limited to 'lib/libssl/d1_both.c')
-rw-r--r-- | lib/libssl/d1_both.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/libssl/d1_both.c b/lib/libssl/d1_both.c index d6bf6dfd1b8..8c4fec589f6 100644 --- a/lib/libssl/d1_both.c +++ b/lib/libssl/d1_both.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_both.c,v 1.64 2021/01/19 18:51:08 jsing Exp $ */ +/* $OpenBSD: d1_both.c,v 1.65 2021/01/19 19:07:39 jsing Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -1055,9 +1055,8 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, /* restore state in which the message was originally sent */ s->session = frag->msg_header.saved_retransmit_state.session; D1I(s)->w_epoch = frag->msg_header.saved_retransmit_state.epoch; - if (!tls12_record_layer_set_write_cipher_hash(s->internal->rl, - frag->msg_header.saved_retransmit_state.enc_write_ctx, - frag->msg_header.saved_retransmit_state.write_hash, 0)) + + if (!tls12_record_layer_use_write_epoch(s->internal->rl, D1I(s)->w_epoch)) return 0; if (frag->msg_header.saved_retransmit_state.epoch == @@ -1074,8 +1073,8 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, /* restore current state */ s->session = saved_state.session; D1I(s)->w_epoch = saved_state.epoch; - if (!tls12_record_layer_set_write_cipher_hash(s->internal->rl, - s->internal->enc_write_ctx, s->internal->write_hash, 0)) + + if (!tls12_record_layer_use_write_epoch(s->internal->rl, D1I(s)->w_epoch)) return 0; if (frag->msg_header.saved_retransmit_state.epoch == |