diff options
author | jsing <> | 2021-05-16 13:56:31 +0000 |
---|---|---|
committer | jsing <> | 2021-05-16 13:56:31 +0000 |
commit | 6eb9f4e8d442a1181957027a462b0fd7230baeba (patch) | |
tree | e59ed0b0555e9f15cbdb2eec4de487cb9336b8c5 /src/lib/libssl/ssl_locl.h | |
parent | a2af7b496e0aa8d2dbb66a0218ead36ed0e52edc (diff) | |
download | openbsd-6eb9f4e8d442a1181957027a462b0fd7230baeba.tar.gz openbsd-6eb9f4e8d442a1181957027a462b0fd7230baeba.tar.bz2 openbsd-6eb9f4e8d442a1181957027a462b0fd7230baeba.zip |
Move DTLS structs/definitions/prototypes to dtls_locl.h.
Now that the DTLS structs are opaque, add a dtls_locl.h header and move
internal-only structs from dtls1.h, along with prototypes from ssl_locl.h.
Only pull this header in where DTLS code actually exists.
ok inoguchi@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 110 |
1 files changed, 1 insertions, 109 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index 52daec611f..2e324e5d31 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.345 2021/05/16 10:55:17 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.346 2021/05/16 13:56:31 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 | * |
@@ -979,74 +979,6 @@ typedef struct ssl3_state_internal_st { | |||
979 | } SSL3_STATE_INTERNAL; | 979 | } SSL3_STATE_INTERNAL; |
980 | #define S3I(s) (s->s3->internal) | 980 | #define S3I(s) (s->s3->internal) |
981 | 981 | ||
982 | typedef struct dtls1_record_data_internal_st { | ||
983 | unsigned char *packet; | ||
984 | unsigned int packet_length; | ||
985 | SSL3_BUFFER_INTERNAL rbuf; | ||
986 | SSL3_RECORD_INTERNAL rrec; | ||
987 | } DTLS1_RECORD_DATA_INTERNAL; | ||
988 | |||
989 | typedef struct dtls1_state_internal_st { | ||
990 | unsigned int send_cookie; | ||
991 | unsigned char cookie[DTLS1_COOKIE_LENGTH]; | ||
992 | unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; | ||
993 | unsigned int cookie_len; | ||
994 | |||
995 | /* | ||
996 | * The current data and handshake epoch. This is initially | ||
997 | * undefined, and starts at zero once the initial handshake is | ||
998 | * completed | ||
999 | */ | ||
1000 | unsigned short r_epoch; | ||
1001 | |||
1002 | /* records being received in the current epoch */ | ||
1003 | DTLS1_BITMAP bitmap; | ||
1004 | |||
1005 | /* renegotiation starts a new set of sequence numbers */ | ||
1006 | DTLS1_BITMAP next_bitmap; | ||
1007 | |||
1008 | /* handshake message numbers */ | ||
1009 | unsigned short handshake_write_seq; | ||
1010 | unsigned short next_handshake_write_seq; | ||
1011 | |||
1012 | unsigned short handshake_read_seq; | ||
1013 | |||
1014 | /* Received handshake records (processed and unprocessed) */ | ||
1015 | record_pqueue unprocessed_rcds; | ||
1016 | record_pqueue processed_rcds; | ||
1017 | |||
1018 | /* Buffered handshake messages */ | ||
1019 | struct _pqueue *buffered_messages; | ||
1020 | |||
1021 | /* Buffered application records. | ||
1022 | * Only for records between CCS and Finished | ||
1023 | * to prevent either protocol violation or | ||
1024 | * unnecessary message loss. | ||
1025 | */ | ||
1026 | record_pqueue buffered_app_data; | ||
1027 | |||
1028 | /* Is set when listening for new connections with dtls1_listen() */ | ||
1029 | unsigned int listen; | ||
1030 | |||
1031 | unsigned int mtu; /* max DTLS packet size */ | ||
1032 | |||
1033 | struct hm_header_st w_msg_hdr; | ||
1034 | struct hm_header_st r_msg_hdr; | ||
1035 | |||
1036 | struct dtls1_timeout_st timeout; | ||
1037 | |||
1038 | /* storage for Alert/Handshake protocol data received but not | ||
1039 | * yet processed by ssl3_read_bytes: */ | ||
1040 | unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; | ||
1041 | unsigned int alert_fragment_len; | ||
1042 | unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; | ||
1043 | unsigned int handshake_fragment_len; | ||
1044 | |||
1045 | unsigned int retransmitting; | ||
1046 | unsigned int change_cipher_spec_ok; | ||
1047 | } DTLS1_STATE_INTERNAL; | ||
1048 | #define D1I(s) (s->d1->internal) | ||
1049 | |||
1050 | typedef struct cert_st { | 982 | typedef struct cert_st { |
1051 | /* Current active set */ | 983 | /* Current active set */ |
1052 | CERT_PKEY *key; /* ALWAYS points to an element of the pkeys array | 984 | CERT_PKEY *key; /* ALWAYS points to an element of the pkeys array |
@@ -1270,42 +1202,11 @@ int ssl3_record_write(SSL *s, int type); | |||
1270 | 1202 | ||
1271 | int ssl3_do_change_cipher_spec(SSL *ssl); | 1203 | int ssl3_do_change_cipher_spec(SSL *ssl); |
1272 | 1204 | ||
1273 | int dtls1_do_write(SSL *s, int type); | ||
1274 | int ssl3_packet_read(SSL *s, int plen); | 1205 | int ssl3_packet_read(SSL *s, int plen); |
1275 | int ssl3_packet_extend(SSL *s, int plen); | 1206 | int ssl3_packet_extend(SSL *s, int plen); |
1276 | int ssl_server_legacy_first_packet(SSL *s); | 1207 | int ssl_server_legacy_first_packet(SSL *s); |
1277 | int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); | ||
1278 | int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, | 1208 | int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, |
1279 | unsigned int len); | 1209 | unsigned int len); |
1280 | void dtls1_set_message_header(SSL *s, unsigned char mt, unsigned long len, | ||
1281 | unsigned long frag_off, unsigned long frag_len); | ||
1282 | void dtls1_set_message_header_int(SSL *s, unsigned char mt, | ||
1283 | unsigned long len, unsigned short seq_num, unsigned long frag_off, | ||
1284 | unsigned long frag_len); | ||
1285 | |||
1286 | int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len); | ||
1287 | int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); | ||
1288 | |||
1289 | int dtls1_read_failed(SSL *s, int code); | ||
1290 | int dtls1_buffer_message(SSL *s, int ccs); | ||
1291 | int dtls1_retransmit_message(SSL *s, unsigned short seq, | ||
1292 | unsigned long frag_off, int *found); | ||
1293 | int dtls1_get_queue_priority(unsigned short seq, int is_ccs); | ||
1294 | int dtls1_retransmit_buffered_messages(SSL *s); | ||
1295 | void dtls1_clear_record_buffer(SSL *s); | ||
1296 | int dtls1_get_message_header(unsigned char *data, | ||
1297 | struct hm_header_st *msg_hdr); | ||
1298 | void dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr); | ||
1299 | void dtls1_reset_read_seq_numbers(SSL *s); | ||
1300 | struct timeval* dtls1_get_timeout(SSL *s, struct timeval* timeleft); | ||
1301 | int dtls1_check_timeout_num(SSL *s); | ||
1302 | int dtls1_handle_timeout(SSL *s); | ||
1303 | const SSL_CIPHER *dtls1_get_cipher(unsigned int u); | ||
1304 | void dtls1_start_timer(SSL *s); | ||
1305 | void dtls1_stop_timer(SSL *s); | ||
1306 | int dtls1_is_timer_expired(SSL *s); | ||
1307 | void dtls1_double_timeout(SSL *s); | ||
1308 | unsigned int dtls1_min_mtu(void); | ||
1309 | 1210 | ||
1310 | /* some client-only functions */ | 1211 | /* some client-only functions */ |
1311 | int ssl3_send_client_hello(SSL *s); | 1212 | int ssl3_send_client_hello(SSL *s); |
@@ -1347,15 +1248,6 @@ int tls1_new(SSL *s); | |||
1347 | void tls1_free(SSL *s); | 1248 | void tls1_free(SSL *s); |
1348 | void tls1_clear(SSL *s); | 1249 | void tls1_clear(SSL *s); |
1349 | 1250 | ||
1350 | int dtls1_new(SSL *s); | ||
1351 | void dtls1_free(SSL *s); | ||
1352 | void dtls1_clear(SSL *s); | ||
1353 | long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg); | ||
1354 | |||
1355 | long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); | ||
1356 | int dtls1_get_record(SSL *s); | ||
1357 | int dtls1_dispatch_alert(SSL *s); | ||
1358 | |||
1359 | int ssl_init_wbio_buffer(SSL *s, int push); | 1251 | int ssl_init_wbio_buffer(SSL *s, int push); |
1360 | void ssl_free_wbio_buffer(SSL *s); | 1252 | void ssl_free_wbio_buffer(SSL *s); |
1361 | 1253 | ||