summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_locl.h
diff options
context:
space:
mode:
authorjsing <>2020-10-03 17:35:17 +0000
committerjsing <>2020-10-03 17:35:17 +0000
commit3058247715ff89d092334e9137126e12b7220589 (patch)
treef4def91d73228cb651f854abf6bf23f4d3c22025 /src/lib/libssl/ssl_locl.h
parent0f1f8d13de82c94a30254ca849b3933f8356101b (diff)
downloadopenbsd-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.h14
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
478struct tls12_record_layer *tls12_record_layer_new(void); 478struct tls12_record_layer *tls12_record_layer_new(void);
479void tls12_record_layer_free(struct tls12_record_layer *rl); 479void tls12_record_layer_free(struct tls12_record_layer *rl);
480void tls12_record_layer_alert(struct tls12_record_layer *rl,
481 uint8_t *alert_desc);
480void tls12_record_layer_set_version(struct tls12_record_layer *rl, 482void tls12_record_layer_set_version(struct tls12_record_layer *rl,
481 uint16_t version); 483 uint16_t version);
482void tls12_record_layer_set_read_epoch(struct tls12_record_layer *rl, 484void 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);
498int tls12_record_layer_set_write_cipher_hash(struct tls12_record_layer *rl, 500int 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);
502int tls12_record_layer_set_read_mac_key(struct tls12_record_layer *rl,
503 const uint8_t *mac_key, size_t mac_key_len);
504int 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);
500int tls12_record_layer_seal_record(struct tls12_record_layer *rl, 506int 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);
1361void tls1_cleanup_key_block(SSL *s); 1367void tls1_cleanup_key_block(SSL *s);
1362int tls1_change_cipher_state(SSL *s, int which); 1368int tls1_change_cipher_state(SSL *s, int which);
1363int tls1_setup_key_block(SSL *s); 1369int tls1_setup_key_block(SSL *s);
1364int tls1_enc(SSL *s, int snd);
1365int tls1_final_finish_mac(SSL *s, const char *str, int slen, unsigned char *p); 1370int tls1_final_finish_mac(SSL *s, const char *str, int slen, unsigned char *p);
1366int tls1_mac(SSL *ssl, unsigned char *md, int snd);
1367int tls1_generate_master_secret(SSL *s, unsigned char *out, 1371int tls1_generate_master_secret(SSL *s, unsigned char *out,
1368 unsigned char *p, int len); 1372 unsigned char *p, int len);
1369int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, 1373int 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 */
1412void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD_INTERNAL *rec, 1416void 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);
1414int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD_INTERNAL *rec, 1418int 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);
1416char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); 1420char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx);
1417int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, 1421int 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],