diff options
author | jsing <> | 2020-10-03 17:35:17 +0000 |
---|---|---|
committer | jsing <> | 2020-10-03 17:35:17 +0000 |
commit | 3058247715ff89d092334e9137126e12b7220589 (patch) | |
tree | f4def91d73228cb651f854abf6bf23f4d3c22025 /src/lib/libssl/ssl_locl.h | |
parent | 0f1f8d13de82c94a30254ca849b3933f8356101b (diff) | |
download | openbsd-3058247715ff89d092334e9137126e12b7220589.tar.gz openbsd-3058247715ff89d092334e9137126e12b7220589.tar.bz2 openbsd-3058247715ff89d092334e9137126e12b7220589.zip |
Reimplement the TLSv1.2 record handling for the read side.
This is the next step in replacing the TLSv1.2 record layer.
The existing record handling code does decryption and processing in
place, which is not ideal for various reasons, however it is retained
for now as other code depends on this behaviour. Additionally, CBC
requires special handling to avoid timing oracles - for now the
existing timing safe code is largely retained.
ok beck@ inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 9a9ef59282..0dda3ecd01 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.295 2020/09/24 18:12:00 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.296 2020/10/03 17:35:16 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 | * |
@@ -477,6 +477,8 @@ struct tls12_record_layer; | |||
477 | 477 | ||
478 | struct tls12_record_layer *tls12_record_layer_new(void); | 478 | struct tls12_record_layer *tls12_record_layer_new(void); |
479 | void tls12_record_layer_free(struct tls12_record_layer *rl); | 479 | void tls12_record_layer_free(struct tls12_record_layer *rl); |
480 | void tls12_record_layer_alert(struct tls12_record_layer *rl, | ||
481 | uint8_t *alert_desc); | ||
480 | void tls12_record_layer_set_version(struct tls12_record_layer *rl, | 482 | void tls12_record_layer_set_version(struct tls12_record_layer *rl, |
481 | uint16_t version); | 483 | uint16_t version); |
482 | void tls12_record_layer_set_read_epoch(struct tls12_record_layer *rl, | 484 | void tls12_record_layer_set_read_epoch(struct tls12_record_layer *rl, |
@@ -497,6 +499,10 @@ int tls12_record_layer_set_read_cipher_hash(struct tls12_record_layer *rl, | |||
497 | EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *hash_ctx, int stream_mac); | 499 | EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *hash_ctx, int stream_mac); |
498 | int tls12_record_layer_set_write_cipher_hash(struct tls12_record_layer *rl, | 500 | int tls12_record_layer_set_write_cipher_hash(struct tls12_record_layer *rl, |
499 | EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *hash_ctx, int stream_mac); | 501 | 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, | ||
503 | const uint8_t *mac_key, size_t mac_key_len); | ||
504 | 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); | ||
500 | int tls12_record_layer_seal_record(struct tls12_record_layer *rl, | 506 | int tls12_record_layer_seal_record(struct tls12_record_layer *rl, |
501 | uint8_t content_type, const uint8_t *content, size_t content_len, | 507 | uint8_t content_type, const uint8_t *content, size_t content_len, |
502 | CBB *out); | 508 | CBB *out); |
@@ -1361,9 +1367,7 @@ int tls1_transcript_record(SSL *s, const unsigned char *buf, size_t len); | |||
1361 | void tls1_cleanup_key_block(SSL *s); | 1367 | void tls1_cleanup_key_block(SSL *s); |
1362 | int tls1_change_cipher_state(SSL *s, int which); | 1368 | int tls1_change_cipher_state(SSL *s, int which); |
1363 | int tls1_setup_key_block(SSL *s); | 1369 | int tls1_setup_key_block(SSL *s); |
1364 | int tls1_enc(SSL *s, int snd); | ||
1365 | int tls1_final_finish_mac(SSL *s, const char *str, int slen, unsigned char *p); | 1370 | int tls1_final_finish_mac(SSL *s, const char *str, int slen, unsigned char *p); |
1366 | int tls1_mac(SSL *ssl, unsigned char *md, int snd); | ||
1367 | int tls1_generate_master_secret(SSL *s, unsigned char *out, | 1371 | int tls1_generate_master_secret(SSL *s, unsigned char *out, |
1368 | unsigned char *p, int len); | 1372 | unsigned char *p, int len); |
1369 | int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, | 1373 | int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, |
@@ -1411,8 +1415,8 @@ int tls1_check_ec_server_key(SSL *s); | |||
1411 | /* s3_cbc.c */ | 1415 | /* s3_cbc.c */ |
1412 | void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD_INTERNAL *rec, | 1416 | void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD_INTERNAL *rec, |
1413 | unsigned int md_size, unsigned int orig_len); | 1417 | unsigned int md_size, unsigned int orig_len); |
1414 | int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD_INTERNAL *rec, | 1418 | int ssl3_cbc_remove_padding(SSL3_RECORD_INTERNAL *rec, unsigned int eiv_len, |
1415 | unsigned int block_size, unsigned int mac_size); | 1419 | unsigned int mac_size); |
1416 | char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); | 1420 | char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); |
1417 | int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, | 1421 | int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, |
1418 | size_t *md_out_size, const unsigned char header[13], | 1422 | size_t *md_out_size, const unsigned char header[13], |