diff options
author | jsing <> | 2021-01-19 19:07:39 +0000 |
---|---|---|
committer | jsing <> | 2021-01-19 19:07:39 +0000 |
commit | e99005f53b351b3c662664891d988adaa02c4d0b (patch) | |
tree | 05f28e11dfa0755554909e35637b6e3f6f3a076b /src/lib/libssl/ssl_locl.h | |
parent | eb720c630d40660f4bf00d58faa6f6d59ba82ea2 (diff) | |
download | openbsd-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/ssl_locl.h')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index e0a4c49ccb..5a3e3ff726 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_locl.h,v 1.314 2021/01/19 18:57:09 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.315 2021/01/19 19:07:39 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 | * |
@@ -485,6 +485,10 @@ void tls12_record_layer_set_version(struct tls12_record_layer *rl, | |||
485 | uint16_t version); | 485 | uint16_t version); |
486 | void tls12_record_layer_set_write_epoch(struct tls12_record_layer *rl, | 486 | void tls12_record_layer_set_write_epoch(struct tls12_record_layer *rl, |
487 | uint16_t epoch); | 487 | uint16_t epoch); |
488 | int tls12_record_layer_use_write_epoch(struct tls12_record_layer *rl, | ||
489 | uint16_t epoch); | ||
490 | void tls12_record_layer_write_epoch_done(struct tls12_record_layer *rl, | ||
491 | uint16_t epoch); | ||
488 | void tls12_record_layer_clear_read_state(struct tls12_record_layer *rl); | 492 | void tls12_record_layer_clear_read_state(struct tls12_record_layer *rl); |
489 | void tls12_record_layer_clear_write_state(struct tls12_record_layer *rl); | 493 | void tls12_record_layer_clear_write_state(struct tls12_record_layer *rl); |
490 | void tls12_record_layer_set_read_seq_num(struct tls12_record_layer *rl, | 494 | void tls12_record_layer_set_read_seq_num(struct tls12_record_layer *rl, |
@@ -501,6 +505,12 @@ int tls12_record_layer_set_write_cipher_hash(struct tls12_record_layer *rl, | |||
501 | EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *hash_ctx, int stream_mac); | 505 | EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *hash_ctx, int stream_mac); |
502 | int tls12_record_layer_set_read_mac_key(struct tls12_record_layer *rl, | 506 | int tls12_record_layer_set_read_mac_key(struct tls12_record_layer *rl, |
503 | const uint8_t *mac_key, size_t mac_key_len); | 507 | const uint8_t *mac_key, size_t mac_key_len); |
508 | int tls12_record_layer_change_read_cipher_state(struct tls12_record_layer *rl, | ||
509 | const uint8_t *mac_key, size_t mac_key_len, const uint8_t *key, | ||
510 | size_t key_len, const uint8_t *iv, size_t iv_len); | ||
511 | int tls12_record_layer_change_write_cipher_state(struct tls12_record_layer *rl, | ||
512 | const uint8_t *mac_key, size_t mac_key_len, const uint8_t *key, | ||
513 | size_t key_len, const uint8_t *iv, size_t iv_len); | ||
504 | int tls12_record_layer_open_record(struct tls12_record_layer *rl, | 514 | int tls12_record_layer_open_record(struct tls12_record_layer *rl, |
505 | uint8_t *buf, size_t buf_len, uint8_t **out, size_t *out_len); | 515 | uint8_t *buf, size_t buf_len, uint8_t **out, size_t *out_len); |
506 | int tls12_record_layer_seal_record(struct tls12_record_layer *rl, | 516 | int tls12_record_layer_seal_record(struct tls12_record_layer *rl, |