diff options
Diffstat (limited to 'lib/libssl/ssl_locl.h')
-rw-r--r-- | lib/libssl/ssl_locl.h | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/lib/libssl/ssl_locl.h b/lib/libssl/ssl_locl.h index 77c1a517980..a696ef99b10 100644 --- a/lib/libssl/ssl_locl.h +++ b/lib/libssl/ssl_locl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_locl.h,v 1.267 2020/03/10 17:02:21 jsing Exp $ */ +/* $OpenBSD: ssl_locl.h,v 1.268 2020/03/12 17:01:53 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -776,6 +776,24 @@ typedef struct ssl_internal_st { int empty_record_count; } SSL_INTERNAL; +typedef struct ssl3_record_internal_st { + int type; /* type of record */ + unsigned int length; /* How many bytes available */ + unsigned int off; /* read/write offset into 'buf' */ + unsigned char *data; /* pointer to the record data */ + unsigned char *input; /* where the decode bytes are */ + unsigned long epoch; /* epoch number, needed by DTLS1 */ + unsigned char seq_num[8]; /* sequence number, needed by DTLS1 */ +} SSL3_RECORD_INTERNAL; + +typedef struct ssl3_buffer_internal_st { + unsigned char *buf; /* at least SSL3_RT_MAX_PACKET_SIZE bytes, + * see ssl3_setup_buffers() */ + size_t len; /* buffer size */ + int offset; /* where to 'copy from' */ + int left; /* how many bytes left */ +} SSL3_BUFFER_INTERNAL; + typedef struct ssl3_state_internal_st { unsigned char read_sequence[SSL3_SEQUENCE_SIZE]; int read_mac_secret_size; @@ -784,8 +802,8 @@ typedef struct ssl3_state_internal_st { int write_mac_secret_size; unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; - SSL3_BUFFER rbuf; /* read IO goes into here */ - SSL3_BUFFER wbuf; /* write IO goes into here */ + SSL3_BUFFER_INTERNAL rbuf; /* read IO goes into here */ + SSL3_BUFFER_INTERNAL wbuf; /* write IO goes into here */ /* we allow one fatal and one warning alert to be outstanding, * send close alert via the warning alert */ @@ -796,8 +814,8 @@ typedef struct ssl3_state_internal_st { int need_empty_fragments; int empty_fragment_done; - SSL3_RECORD rrec; /* each decoded record goes in here */ - SSL3_RECORD wrec; /* goes out from here */ + SSL3_RECORD_INTERNAL rrec; /* each decoded record goes in here */ + SSL3_RECORD_INTERNAL wrec; /* goes out from here */ /* storage for Alert/Handshake protocol data received but not * yet processed by ssl3_read_bytes: */ @@ -897,6 +915,13 @@ typedef struct ssl3_state_internal_st { } SSL3_STATE_INTERNAL; #define S3I(s) (s->s3->internal) +typedef struct dtls1_record_data_internal_st { + unsigned char *packet; + unsigned int packet_length; + SSL3_BUFFER_INTERNAL rbuf; + SSL3_RECORD_INTERNAL rrec; +} DTLS1_RECORD_DATA_INTERNAL; + typedef struct dtls1_state_internal_st { unsigned int send_cookie; unsigned char cookie[DTLS1_COOKIE_LENGTH]; @@ -1346,9 +1371,9 @@ long ssl_get_algorithm2(SSL *s); int tls1_check_ec_server_key(SSL *s); /* s3_cbc.c */ -void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, +void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD_INTERNAL *rec, unsigned md_size, unsigned orig_len); -int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD *rec, +int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD_INTERNAL *rec, unsigned block_size, unsigned mac_size); char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, |