X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fssl_locl.h;h=8b4c6150efdc5db923131f49d5cc83d966f2613d;hp=323a00df1ef7b919d58aba19f4833bb3209103fd;hb=98c9ce2f55609d00a06c2106df03a5a7e9dbfa75;hpb=d5a25ae0deeabc9baaacef64f4c23fbd0c2d67e9;ds=sidebyside diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 323a00df1e..8b4c6150ef 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -165,9 +165,7 @@ # include # include -#include "record/ssl3_buffer.h" -#include "record/ssl3_record.h" -#include "record/rec_layer.h" +#include "record/record.h" # ifdef OPENSSL_BUILD_SHLIBSSL # undef OPENSSL_EXTERN @@ -1022,16 +1020,12 @@ struct ssl_st { int shutdown; /* where we are */ int state; - /* where we are when reading */ - int rstate; BUF_MEM *init_buf; /* buffer used during init */ void *init_msg; /* pointer to handshake message body, set by * ssl3_get_message() */ int init_num; /* amount read/written */ int init_off; /* amount read/written */ - /* used internally to point at a raw packet */ - unsigned char *packet; - unsigned int packet_length; + struct ssl3_state_st *s3; /* SSLv3 variables */ struct dtls1_state_st *d1; /* DTLSv1 variables */ @@ -1228,10 +1222,8 @@ struct ssl_st { typedef struct ssl3_state_st { long flags; int delay_buf_pop_ret; - unsigned char read_sequence[8]; int read_mac_secret_size; unsigned char read_mac_secret[EVP_MAX_MD_SIZE]; - unsigned char write_sequence[8]; int write_mac_secret_size; unsigned char write_mac_secret[EVP_MAX_MD_SIZE]; unsigned char server_random[SSL3_RANDOM_SIZE]; @@ -1241,20 +1233,6 @@ typedef struct ssl3_state_st { int empty_fragment_done; /* The value of 'extra' when the buffers were initialized */ int init_extra; - /* - * storage for Alert/Handshake protocol data received but not yet - * processed by ssl3_read_bytes: - */ - unsigned char alert_fragment[2]; - unsigned int alert_fragment_len; - unsigned char handshake_fragment[4]; - unsigned int handshake_fragment_len; - /* partial write - check the numbers match */ - unsigned int wnum; /* number of bytes sent so far */ - int wpend_tot; /* number bytes written */ - int wpend_type; - int wpend_ret; /* number of bytes submitted */ - const unsigned char *wpend_buf; /* used during startup, digest all incoming/outgoing packets */ BIO *handshake_buffer; /* @@ -1423,36 +1401,17 @@ typedef struct dtls1_state_st { unsigned char cookie[DTLS1_COOKIE_LENGTH]; unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH]; unsigned int cookie_len; - /* - * The current data and handshake epoch. This is initially - * undefined, and starts at zero once the initial handshake is - * completed - */ - unsigned short r_epoch; - unsigned short w_epoch; - /* records being received in the current epoch */ - DTLS1_BITMAP bitmap; - /* renegotiation starts a new set of sequence numbers */ - DTLS1_BITMAP next_bitmap; + /* handshake message numbers */ unsigned short handshake_write_seq; unsigned short next_handshake_write_seq; unsigned short handshake_read_seq; - /* save last sequence number for retransmissions */ - unsigned char last_write_sequence[8]; - /* Received handshake records (processed and unprocessed) */ - record_pqueue unprocessed_rcds; - record_pqueue processed_rcds; + /* Buffered handshake messages */ pqueue buffered_messages; /* Buffered (sent) handshake records */ pqueue sent_messages; - /* - * Buffered application records. Only for records between CCS and - * Finished to prevent either protocol violation or unnecessary message - * loss. - */ - record_pqueue buffered_app_data; + /* Is set when listening for new connections with dtls1_listen() */ unsigned int listen; unsigned int link_mtu; /* max on-the-wire DTLS packet size */ @@ -1466,14 +1425,7 @@ typedef struct dtls1_state_st { struct timeval next_timeout; /* Timeout duration */ unsigned short timeout_duration; - /* - * storage for Alert/Handshake protocol data received but not yet - * processed by ssl3_read_bytes: - */ - unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH]; - unsigned int alert_fragment_len; - unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH]; - unsigned int handshake_fragment_len; + unsigned int retransmitting; /* * Set when the handshake is ready to process peer's ChangeCipherSpec message. @@ -1487,15 +1439,6 @@ typedef struct dtls1_state_st { # endif } DTLS1_STATE; -typedef struct dtls1_record_data_st { - unsigned char *packet; - unsigned int packet_length; - SSL3_BUFFER rbuf; - SSL3_RECORD rrec; -# ifndef OPENSSL_NO_SCTP - struct bio_dgram_sctp_rcvinfo recordinfo; -# endif -} DTLS1_RECORD_DATA; # ifndef OPENSSL_NO_EC @@ -1979,8 +1922,10 @@ const SSL_METHOD *func_name(void) \ struct openssl_ssl_test_functions { int (*p_ssl_init_wbio_buffer) (SSL *s, int push); int (*p_ssl3_setup_buffers) (SSL *s); - int (*p_tls1_process_heartbeat) (SSL *s); - int (*p_dtls1_process_heartbeat) (SSL *s); + int (*p_tls1_process_heartbeat) (SSL *s, + unsigned char *p, unsigned int length); + int (*p_dtls1_process_heartbeat) (SSL *s, + unsigned char *p, unsigned int length); }; # ifndef OPENSSL_UNIT_TEST @@ -2100,7 +2045,6 @@ __owur long ssl3_ctx_ctrl(SSL_CTX *s, int cmd, long larg, void *parg); __owur long ssl3_callback_ctrl(SSL *s, int cmd, void (*fp) (void)); __owur long ssl3_ctx_callback_ctrl(SSL_CTX *s, int cmd, void (*fp) (void)); -void ssl3_record_sequence_update(unsigned char *seq); __owur int ssl3_do_change_cipher_spec(SSL *ssl); __owur long ssl3_default_timeout(void); @@ -2127,7 +2071,6 @@ void dtls1_set_message_header(SSL *s, unsigned long frag_len); __owur int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf, int len); -__owur int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); __owur int dtls1_send_change_cipher_spec(SSL *s, int a, int b); __owur int dtls1_send_finished(SSL *s, int a, int b, const char *sender, int slen); @@ -2267,8 +2210,8 @@ __owur int ssl_prepare_serverhello_tlsext(SSL *s); # ifndef OPENSSL_NO_HEARTBEATS __owur int tls1_heartbeat(SSL *s); __owur int dtls1_heartbeat(SSL *s); -__owur int tls1_process_heartbeat(SSL *s); -__owur int dtls1_process_heartbeat(SSL *s); +__owur int tls1_process_heartbeat(SSL *s, unsigned char *p, unsigned int length); +__owur int dtls1_process_heartbeat(SSL *s, unsigned char *p, unsigned int length); # endif __owur int tls1_process_ticket(SSL *s, unsigned char *session_id, int len,