diff options
author | jsing <> | 2020-03-12 17:01:53 +0000 |
---|---|---|
committer | jsing <> | 2020-03-12 17:01:53 +0000 |
commit | cf38ddcaf43a2f6fd1de2405aa74feca6523733c (patch) | |
tree | 1386c6711648c45e415953677ee13b17cdc299a3 /src/lib/libssl/ssl_locl.h | |
parent | e0c848b5bda852697d7b956ff1f7b8eb68b7ad18 (diff) | |
download | openbsd-cf38ddcaf43a2f6fd1de2405aa74feca6523733c.tar.gz openbsd-cf38ddcaf43a2f6fd1de2405aa74feca6523733c.tar.bz2 openbsd-cf38ddcaf43a2f6fd1de2405aa74feca6523733c.zip |
Use internal versions of SSL3_BUFFER, SSL3_RECORD and DTLS1_RECORD_DATA.
SSL3_BUFFER, SSL3_RECORD and DTLS1_RECORD_DATA are currently still in
public headers, even though their usage is internal. This moves to
using _INTERNAL suffixed versions that are in internal headers, which
then allows us to change them without any potential public API fallout.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 77c1a51798..a696ef99b1 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.267 2020/03/10 17:02:21 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.268 2020/03/12 17:01:53 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 | * |
@@ -776,6 +776,24 @@ typedef struct ssl_internal_st { | |||
776 | int empty_record_count; | 776 | int empty_record_count; |
777 | } SSL_INTERNAL; | 777 | } SSL_INTERNAL; |
778 | 778 | ||
779 | typedef struct ssl3_record_internal_st { | ||
780 | int type; /* type of record */ | ||
781 | unsigned int length; /* How many bytes available */ | ||
782 | unsigned int off; /* read/write offset into 'buf' */ | ||
783 | unsigned char *data; /* pointer to the record data */ | ||
784 | unsigned char *input; /* where the decode bytes are */ | ||
785 | unsigned long epoch; /* epoch number, needed by DTLS1 */ | ||
786 | unsigned char seq_num[8]; /* sequence number, needed by DTLS1 */ | ||
787 | } SSL3_RECORD_INTERNAL; | ||
788 | |||
789 | typedef struct ssl3_buffer_internal_st { | ||
790 | unsigned char *buf; /* at least SSL3_RT_MAX_PACKET_SIZE bytes, | ||
791 | * see ssl3_setup_buffers() */ | ||
792 | size_t len; /* buffer size */ | ||
793 | int offset; /* where to 'copy from' */ | ||
794 | int left; /* how many bytes left */ | ||
795 | } SSL3_BUFFER_INTERNAL; | ||
796 | |||
779 | typedef struct ssl3_state_internal_st { | 797 | typedef struct ssl3_state_internal_st { |
780 | unsigned char read_sequence[SSL3_SEQUENCE_SIZE]; | 798 | unsigned char read_sequence[SSL3_SEQUENCE_SIZE]; |
781 | int read_mac_secret_size; | 799 | int read_mac_secret_size; |
@@ -784,8 +802,8 @@ typedef struct ssl3_state_internal_st { | |||
784 | int write_mac_secret_size; | 802 | int write_mac_secret_size; |
785 | unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; | 803 | unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; |
786 | 804 | ||
787 | SSL3_BUFFER rbuf; /* read IO goes into here */ | 805 | SSL3_BUFFER_INTERNAL rbuf; /* read IO goes into here */ |
788 | SSL3_BUFFER wbuf; /* write IO goes into here */ | 806 | SSL3_BUFFER_INTERNAL wbuf; /* write IO goes into here */ |
789 | 807 | ||
790 | /* we allow one fatal and one warning alert to be outstanding, | 808 | /* we allow one fatal and one warning alert to be outstanding, |
791 | * send close alert via the warning alert */ | 809 | * send close alert via the warning alert */ |
@@ -796,8 +814,8 @@ typedef struct ssl3_state_internal_st { | |||
796 | int need_empty_fragments; | 814 | int need_empty_fragments; |
797 | int empty_fragment_done; | 815 | int empty_fragment_done; |
798 | 816 | ||
799 | SSL3_RECORD rrec; /* each decoded record goes in here */ | 817 | SSL3_RECORD_INTERNAL rrec; /* each decoded record goes in here */ |
800 | SSL3_RECORD wrec; /* goes out from here */ | 818 | SSL3_RECORD_INTERNAL wrec; /* goes out from here */ |
801 | 819 | ||
802 | /* storage for Alert/Handshake protocol data received but not | 820 | /* storage for Alert/Handshake protocol data received but not |
803 | * yet processed by ssl3_read_bytes: */ | 821 | * yet processed by ssl3_read_bytes: */ |
@@ -897,6 +915,13 @@ typedef struct ssl3_state_internal_st { | |||
897 | } SSL3_STATE_INTERNAL; | 915 | } SSL3_STATE_INTERNAL; |
898 | #define S3I(s) (s->s3->internal) | 916 | #define S3I(s) (s->s3->internal) |
899 | 917 | ||
918 | typedef struct dtls1_record_data_internal_st { | ||
919 | unsigned char *packet; | ||
920 | unsigned int packet_length; | ||
921 | SSL3_BUFFER_INTERNAL rbuf; | ||
922 | SSL3_RECORD_INTERNAL rrec; | ||
923 | } DTLS1_RECORD_DATA_INTERNAL; | ||
924 | |||
900 | typedef struct dtls1_state_internal_st { | 925 | typedef struct dtls1_state_internal_st { |
901 | unsigned int send_cookie; | 926 | unsigned int send_cookie; |
902 | unsigned char cookie[DTLS1_COOKIE_LENGTH]; | 927 | unsigned char cookie[DTLS1_COOKIE_LENGTH]; |
@@ -1346,9 +1371,9 @@ long ssl_get_algorithm2(SSL *s); | |||
1346 | int tls1_check_ec_server_key(SSL *s); | 1371 | int tls1_check_ec_server_key(SSL *s); |
1347 | 1372 | ||
1348 | /* s3_cbc.c */ | 1373 | /* s3_cbc.c */ |
1349 | void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD *rec, | 1374 | void ssl3_cbc_copy_mac(unsigned char *out, const SSL3_RECORD_INTERNAL *rec, |
1350 | unsigned md_size, unsigned orig_len); | 1375 | unsigned md_size, unsigned orig_len); |
1351 | int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD *rec, | 1376 | int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD_INTERNAL *rec, |
1352 | unsigned block_size, unsigned mac_size); | 1377 | unsigned block_size, unsigned mac_size); |
1353 | char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); | 1378 | char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); |
1354 | int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, | 1379 | int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, |