summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_locl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_locl.h')
-rw-r--r--src/lib/libssl/ssl_locl.h110
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
982typedef 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
989typedef 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
1050typedef struct cert_st { 982typedef 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
1271int ssl3_do_change_cipher_spec(SSL *ssl); 1203int ssl3_do_change_cipher_spec(SSL *ssl);
1272 1204
1273int dtls1_do_write(SSL *s, int type);
1274int ssl3_packet_read(SSL *s, int plen); 1205int ssl3_packet_read(SSL *s, int plen);
1275int ssl3_packet_extend(SSL *s, int plen); 1206int ssl3_packet_extend(SSL *s, int plen);
1276int ssl_server_legacy_first_packet(SSL *s); 1207int ssl_server_legacy_first_packet(SSL *s);
1277int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek);
1278int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, 1208int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
1279 unsigned int len); 1209 unsigned int len);
1280void dtls1_set_message_header(SSL *s, unsigned char mt, unsigned long len,
1281 unsigned long frag_off, unsigned long frag_len);
1282void 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
1286int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len);
1287int dtls1_write_bytes(SSL *s, int type, const void *buf, int len);
1288
1289int dtls1_read_failed(SSL *s, int code);
1290int dtls1_buffer_message(SSL *s, int ccs);
1291int dtls1_retransmit_message(SSL *s, unsigned short seq,
1292 unsigned long frag_off, int *found);
1293int dtls1_get_queue_priority(unsigned short seq, int is_ccs);
1294int dtls1_retransmit_buffered_messages(SSL *s);
1295void dtls1_clear_record_buffer(SSL *s);
1296int dtls1_get_message_header(unsigned char *data,
1297 struct hm_header_st *msg_hdr);
1298void dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr);
1299void dtls1_reset_read_seq_numbers(SSL *s);
1300struct timeval* dtls1_get_timeout(SSL *s, struct timeval* timeleft);
1301int dtls1_check_timeout_num(SSL *s);
1302int dtls1_handle_timeout(SSL *s);
1303const SSL_CIPHER *dtls1_get_cipher(unsigned int u);
1304void dtls1_start_timer(SSL *s);
1305void dtls1_stop_timer(SSL *s);
1306int dtls1_is_timer_expired(SSL *s);
1307void dtls1_double_timeout(SSL *s);
1308unsigned int dtls1_min_mtu(void);
1309 1210
1310/* some client-only functions */ 1211/* some client-only functions */
1311int ssl3_send_client_hello(SSL *s); 1212int ssl3_send_client_hello(SSL *s);
@@ -1347,15 +1248,6 @@ int tls1_new(SSL *s);
1347void tls1_free(SSL *s); 1248void tls1_free(SSL *s);
1348void tls1_clear(SSL *s); 1249void tls1_clear(SSL *s);
1349 1250
1350int dtls1_new(SSL *s);
1351void dtls1_free(SSL *s);
1352void dtls1_clear(SSL *s);
1353long dtls1_ctrl(SSL *s, int cmd, long larg, void *parg);
1354
1355long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok);
1356int dtls1_get_record(SSL *s);
1357int dtls1_dispatch_alert(SSL *s);
1358
1359int ssl_init_wbio_buffer(SSL *s, int push); 1251int ssl_init_wbio_buffer(SSL *s, int push);
1360void ssl_free_wbio_buffer(SSL *s); 1252void ssl_free_wbio_buffer(SSL *s);
1361 1253