summaryrefslogtreecommitdiff
path: root/src/lib/libssl/d1_pkt.c
diff options
context:
space:
mode:
authorjsing <>2021-01-19 19:07:39 +0000
committerjsing <>2021-01-19 19:07:39 +0000
commite99005f53b351b3c662664891d988adaa02c4d0b (patch)
tree05f28e11dfa0755554909e35637b6e3f6f3a076b /src/lib/libssl/d1_pkt.c
parenteb720c630d40660f4bf00d58faa6f6d59ba82ea2 (diff)
downloadopenbsd-e99005f53b351b3c662664891d988adaa02c4d0b.tar.gz
openbsd-e99005f53b351b3c662664891d988adaa02c4d0b.tar.bz2
openbsd-e99005f53b351b3c662664891d988adaa02c4d0b.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 'src/lib/libssl/d1_pkt.c')
-rw-r--r--src/lib/libssl/d1_pkt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index 14ff8221be..bde13c99e5 100644
--- a/src/lib/libssl/d1_pkt.c
+++ b/src/lib/libssl/d1_pkt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: d1_pkt.c,v 1.89 2021/01/19 18:57:09 jsing Exp $ */ 1/* $OpenBSD: d1_pkt.c,v 1.90 2021/01/19 19:07:39 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.
@@ -1105,7 +1105,6 @@ do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len)
1105 goto err; 1105 goto err;
1106 1106
1107 tls12_record_layer_set_version(s->internal->rl, s->version); 1107 tls12_record_layer_set_version(s->internal->rl, s->version);
1108 tls12_record_layer_set_write_epoch(s->internal->rl, D1I(s)->w_epoch);
1109 1108
1110 if (!tls12_record_layer_seal_record(s->internal->rl, type, buf, len, &cbb)) 1109 if (!tls12_record_layer_seal_record(s->internal->rl, type, buf, len, &cbb))
1111 goto err; 1110 goto err;
@@ -1245,6 +1244,7 @@ dtls1_reset_seq_numbers(SSL *s, int rw)
1245 memset(S3I(s)->read_sequence, 0, sizeof(S3I(s)->read_sequence)); 1244 memset(S3I(s)->read_sequence, 0, sizeof(S3I(s)->read_sequence));
1246 } else { 1245 } else {
1247 D1I(s)->w_epoch++; 1246 D1I(s)->w_epoch++;
1247 tls12_record_layer_set_write_epoch(s->internal->rl, D1I(s)->w_epoch);
1248 memcpy(D1I(s)->last_write_sequence, S3I(s)->write_sequence, 1248 memcpy(D1I(s)->last_write_sequence, S3I(s)->write_sequence,
1249 sizeof(S3I(s)->write_sequence)); 1249 sizeof(S3I(s)->write_sequence));
1250 memset(S3I(s)->write_sequence, 0, sizeof(S3I(s)->write_sequence)); 1250 memset(S3I(s)->write_sequence, 0, sizeof(S3I(s)->write_sequence));