diff options
| author | jsing <> | 2021-05-02 17:18:10 +0000 | 
|---|---|---|
| committer | jsing <> | 2021-05-02 17:18:10 +0000 | 
| commit | b037a2e716343521c64f800a36f2361bfa861f94 (patch) | |
| tree | 635d2be6e673bbc73bbd4e14d51b19d0a5a629a1 /src/lib/libssl/t1_enc.c | |
| parent | 00bc6c73637e1a664708ad0a6fd34c5b904543de (diff) | |
| download | openbsd-b037a2e716343521c64f800a36f2361bfa861f94.tar.gz openbsd-b037a2e716343521c64f800a36f2361bfa861f94.tar.bz2 openbsd-b037a2e716343521c64f800a36f2361bfa861f94.zip | |
Clean up dtls1_reset_seq_numbers().
Rather than doing flag gymnastics, split dtls1_reset_seq_numbers() into
separate read and write functions. Move the calls of these functions into
tls1_change_cipher_state() so they directly follow the change of cipher
state in the record layer, which avoids having to duplicate the calls in
the client and server.
ok inoguchi@ tb@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libssl/t1_enc.c | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index 642c210900..6cdae0caed 100644 --- a/src/lib/libssl/t1_enc.c +++ b/src/lib/libssl/t1_enc.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: t1_enc.c,v 1.140 2021/04/30 19:26:45 jsing Exp $ */ | 1 | /* $OpenBSD: t1_enc.c,v 1.141 2021/05/02 17:18:10 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 | * | 
| @@ -369,12 +369,16 @@ tls1_change_cipher_state(SSL *s, int which) | |||
| 369 | if (!tls12_record_layer_change_read_cipher_state(s->internal->rl, | 369 | if (!tls12_record_layer_change_read_cipher_state(s->internal->rl, | 
| 370 | mac_secret, mac_secret_size, key, key_len, iv, iv_len)) | 370 | mac_secret, mac_secret_size, key, key_len, iv, iv_len)) | 
| 371 | goto err; | 371 | goto err; | 
| 372 | if (SSL_is_dtls(s)) | ||
| 373 | dtls1_reset_read_seq_numbers(s); | ||
| 372 | tls12_record_layer_read_cipher_hash(s->internal->rl, | 374 | tls12_record_layer_read_cipher_hash(s->internal->rl, | 
| 373 | &s->enc_read_ctx, &s->read_hash); | 375 | &s->enc_read_ctx, &s->read_hash); | 
| 374 | } else { | 376 | } else { | 
| 375 | if (!tls12_record_layer_change_write_cipher_state(s->internal->rl, | 377 | if (!tls12_record_layer_change_write_cipher_state(s->internal->rl, | 
| 376 | mac_secret, mac_secret_size, key, key_len, iv, iv_len)) | 378 | mac_secret, mac_secret_size, key, key_len, iv, iv_len)) | 
| 377 | goto err; | 379 | goto err; | 
| 380 | if (SSL_is_dtls(s)) | ||
| 381 | dtls1_reset_write_seq_numbers(s); | ||
| 378 | } | 382 | } | 
| 379 | return (1); | 383 | return (1); | 
| 380 | 384 | ||
