2016-05-18 02:18:30 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								/*
							 | 
						
					
						
							
								
									
										
										
										
											2020-04-23 20:55:52 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-30 21:46:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-06 20:08:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 * Licensed under the Apache License 2.0 (the "License").  You may not use
							 | 
						
					
						
							
								
									
										
										
										
											2016-05-18 02:18:30 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								 * this file except in compliance with the License.  You can obtain a copy
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * in the file LICENSE in the source distribution or at
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * https://www.openssl.org/source/license.html
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-30 21:46:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								typedef struct ssl_connection_st SSL_CONNECTION;
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-06 22:10:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								typedef struct ssl3_buffer_st SSL3_BUFFER;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-25 22:16:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include <openssl/core_dispatch.h>
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-06 22:10:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "recordmethod.h"
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 19:41:29 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/*****************************************************************************
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *                                                                           *
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * These structures should be considered PRIVATE to the record layer. No     *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * non-record layer code should be using these structures in any way.        *
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 19:41:29 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *                                                                           *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *****************************************************************************/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-06 22:10:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct ssl3_buffer_st {
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* at least SSL3_RT_MAX_PACKET_SIZE bytes, see ssl3_setup_buffers() */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char *buf;
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-13 22:20:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* default buffer size (or 0 if no default set) */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t default_len;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* buffer size */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t len;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* where to 'copy from' */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 16:24:19 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t offset;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* how many bytes left */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 16:24:19 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t left;
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-21 05:40:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* 'buf' is from application for KTLS */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int app_buffer;
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-12 16:51:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* The type of data stored in this buffer. Only used for writing */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int type;
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-06 22:10:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:12:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#define SEQ_NUM_SIZE                            8
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								typedef struct ssl3_record_st {
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-28 07:01:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* Record layer version */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* r */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int rec_version;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* type of record */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* r */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int type;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* How many bytes available */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* rw */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 19:05:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t length;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /*
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * How many bytes were available before padding was removed? This is used
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * to implement the MAC check in constant time for CBC records.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* rw */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 19:05:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t orig_len;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* read/write offset into 'buf' */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* r */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 19:05:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t off;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* pointer to the record data */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* rw */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char *data;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* where the decode bytes are */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* rw */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char *input;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* only used with decompression - malloc()ed */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* r */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char *comp;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* epoch number, needed by DTLS1 */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* r */
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-27 21:37:27 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    uint16_t epoch;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* sequence number, needed by DTLS1 */
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-26 21:17:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* r */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char seq_num[SEQ_NUM_SIZE];
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								} SSL3_RECORD;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 21:50:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								typedef struct tls_record_st {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    void *rechandle;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int version;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int type;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* The data buffer containing bytes from the record */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char *data;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* Number of remaining to be read in the data buffer */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t length;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* Offset into the data buffer where to start reading */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t off;
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-02 23:29:04 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* epoch number. DTLS only */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint16_t epoch;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* sequence number. DTLS only */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char seq_num[SEQ_NUM_SIZE];
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#ifndef OPENSSL_NO_SCTP
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    struct bio_dgram_sctp_rcvinfo recordinfo;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 21:50:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								} TLS_RECORD;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 18:38:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								typedef struct record_pqueue_st {
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-27 21:37:27 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    uint16_t epoch;
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-23 03:54:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    struct pqueue_st *q;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 18:38:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								} record_pqueue;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 22:54:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								typedef struct dtls_record_layer_st {
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 23:14:24 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /*
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * The current data and handshake epoch.  This is initially
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * undefined, and starts at zero once the initial handshake is
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * completed
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     */
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-27 21:37:27 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    uint16_t r_epoch;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    uint16_t w_epoch;
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-22 00:01:54 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 18:27:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /*
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * Buffered application records. Only for records between CCS and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * Finished to prevent either protocol violation or unnecessary message
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * loss.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    record_pqueue buffered_app_data;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 19:57:34 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* save last and current sequence numbers for retransmissions */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char last_write_sequence[8];
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char curr_write_sequence[8];
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 22:54:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								} DTLS_RECORD_LAYER;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/*****************************************************************************
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *                                                                           *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * This structure should be considered "opaque" to anything outside of the   *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * record layer. No non-record layer code should be accessing the members of *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * this structure.                                                           *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *                                                                           *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *****************************************************************************/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-30 21:46:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								typedef struct record_layer_st {
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* The parent SSL_CONNECTION structure */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    SSL_CONNECTION *s;
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-22 19:39:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* Method to use for the read record layer*/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    const OSSL_RECORD_METHOD *rrlmethod;
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-19 23:54:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* Method to use for the write record layer*/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    const OSSL_RECORD_METHOD *wrlmethod;
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-22 19:39:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* The read record layer object itself */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    OSSL_RECORD_LAYER *rrl;
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-19 23:54:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* The write record layer object itself */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    OSSL_RECORD_LAYER *wrl;
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-22 19:39:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* BIO to store data destined for the next read record layer epoch */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    BIO *rrlnext;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* Default read buffer length to be passed to the record layer */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t default_read_buf_len;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-30 21:46:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /*
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * Read as many input bytes as possible (for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     * non-blocking reads)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								     */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int read_ahead;
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-12 22:52:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* How many pipelines can be used to write data */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 18:34:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t numwpipes;
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-31 00:17:25 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* write IO goes into here */
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-12 16:51:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    SSL3_BUFFER wbuf[SSL_MAX_PIPELINES + 1];
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 19:16:30 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* number of bytes sent so far */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 18:34:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t wnum;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 21:12:22 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char handshake_fragment[4];
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 19:05:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t handshake_fragment_len;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 21:22:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* partial write - check the numbers match */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* number bytes written */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 18:34:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t wpend_tot;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 21:22:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int wpend_type;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* number of bytes submitted */
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 18:34:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    size_t wpend_ret;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 21:22:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    const unsigned char *wpend_buf;
							 | 
						
					
						
							
								
									
										
										
										
											2022-07-26 19:44:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-15 05:49:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    unsigned char write_sequence[SEQ_NUM_SIZE];
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-21 21:07:31 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    /* Count of the number of consecutive warning alerts received */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned int alert_count;
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 22:54:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    DTLS_RECORD_LAYER *d;
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 21:50:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* How many records we have read from the record layer */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t num_recs;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* The next record from the record layer that we need to process */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    size_t curr_rec;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    /* Record layer data to be processed */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    TLS_RECORD tlsrecs[SSL_MAX_PIPELINES];
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-30 21:46:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								} RECORD_LAYER;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 19:41:29 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/*****************************************************************************
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *                                                                           *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * The following macros/functions represent the libssl internal API to the   *
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 * record layer. Any libssl code may call these functions/macros             *
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 19:41:29 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *                                                                           *
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 *****************************************************************************/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-04 00:42:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct ssl_mac_buf_st {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    unsigned char *mac;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    int alloced;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								typedef struct ssl_mac_buf_st SSL_MAC_BUF;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-28 07:01:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#define MIN_SSL2_RECORD_LEN     9
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-30 21:46:43 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define RECORD_LAYER_set_read_ahead(rl, ra)     ((rl)->read_ahead = (ra))
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define RECORD_LAYER_get_read_ahead(rl)         ((rl)->read_ahead)
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 04:55:15 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define RECORD_LAYER_get_packet(rl)             ((rl)->packet)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define RECORD_LAYER_add_packet_length(rl, inc) ((rl)->packet_length += (inc))
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 23:14:24 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define DTLS_RECORD_LAYER_get_w_epoch(rl)       ((rl)->d->w_epoch)
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-08 22:46:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#define RECORD_LAYER_get_rbuf(rl)               (&(rl)->rbuf)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define RECORD_LAYER_get_wbuf(rl)               ((rl)->wbuf)
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 18:38:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void RECORD_LAYER_init(RECORD_LAYER *rl, SSL_CONNECTION *s);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 19:53:20 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void RECORD_LAYER_clear(RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-02 20:18:03 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void RECORD_LAYER_release(RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2016-02-12 20:03:58 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int RECORD_LAYER_read_pending(const RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-03 20:41:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int RECORD_LAYER_processed_read_pending(const RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2016-02-12 20:03:58 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int RECORD_LAYER_write_pending(const RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 22:26:50 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void RECORD_LAYER_reset_write_sequence(RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2015-03-28 07:01:51 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int RECORD_LAYER_is_sslv2_record(RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-07 02:17:54 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur size_t ssl3_pending(const SSL *s);
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 18:34:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int ssl3_write_bytes(SSL *s, int type, const void *buf, size_t len,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                            size_t *written);
							 | 
						
					
						
							
								
									
										
										
										
											2015-05-11 16:35:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int ssl3_read_bytes(SSL *s, int type, int *recvd_type,
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 19:05:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                           unsigned char *buf, size_t len, int peek,
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-26 17:43:34 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                           size_t *readbytes);
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int ssl3_setup_buffers(SSL_CONNECTION *s);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								__owur int ssl3_enc(SSL_CONNECTION *s, SSL3_RECORD *inrecs, size_t n_recs,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    int send, SSL_MAC_BUF *mac, size_t macsize);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								__owur int n_ssl3_mac(SSL_CONNECTION *s, SSL3_RECORD *rec, unsigned char *md,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                      int send);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								__owur int tls1_enc(SSL_CONNECTION *s, SSL3_RECORD *recs, size_t n_recs,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                    int sending, SSL_MAC_BUF *mac, size_t macsize);
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-18 15:57:32 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int tls1_mac_old(SSL_CONNECTION *s, SSL3_RECORD *rec, unsigned char *md,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        int send);
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int tls13_enc(SSL_CONNECTION *s, SSL3_RECORD *recs, size_t n_recs,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                     int send, SSL_MAC_BUF *mac, size_t macsize);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-03 22:54:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void DTLS_RECORD_LAYER_free(RECORD_LAYER *rl);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 19:57:34 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void DTLS_RECORD_LAYER_set_saved_w_epoch(RECORD_LAYER *rl, unsigned short e);
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-04 23:44:12 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl);
							 | 
						
					
						
							
								
									
										
										
										
											2015-09-15 05:49:35 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void DTLS_RECORD_LAYER_set_write_sequence(RECORD_LAYER *rl, unsigned char *seq);
							 | 
						
					
						
							
								
									
										
										
										
											2015-05-11 16:35:41 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int dtls1_read_bytes(SSL *s, int type, int *recvd_type,
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-06 19:05:25 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                            unsigned char *buf, size_t len, int peek,
							 | 
						
					
						
							
								
									
										
										
										
											2016-10-26 17:43:34 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                            size_t *readbytes);
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								__owur int dtls1_write_bytes(SSL_CONNECTION *s, int type, const void *buf,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             size_t len, size_t *written);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int do_dtls1_write(SSL_CONNECTION *s, int type, const unsigned char *buf,
							 | 
						
					
						
							
								
									
										
										
										
											2016-09-07 18:34:39 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                   size_t len, int create_empty_fragment, size_t *written);
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-20 23:11:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void dtls1_reset_seq_numbers(SSL_CONNECTION *s, int rw);
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-02 23:29:04 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								void ssl_release_record(SSL_CONNECTION *s, TLS_RECORD *rr);
							 | 
						
					
						
							
								
									
										
										
										
											2022-04-12 21:50:28 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# define HANDLE_RLAYER_RETURN(s, ret) \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    ossl_tls_handle_rlayer_return(s, ret, OPENSSL_FILE, OPENSSL_LINE)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int ossl_tls_handle_rlayer_return(SSL_CONNECTION *s, int ret, char *file,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                  int line);
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-06 22:10:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-11 01:50:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int ssl_set_new_record_layer(SSL_CONNECTION *s, int version, int direction,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             int level, unsigned char *key, size_t keylen,
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-06 22:10:00 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                             unsigned char *iv,  size_t ivlen,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             unsigned char *mackey, size_t mackeylen,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             const EVP_CIPHER *ciph, size_t taglen,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             int mactype, const EVP_MD *md,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             const SSL_COMP *comp);
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-25 22:16:48 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# define OSSL_FUNC_RLAYER_SKIP_EARLY_DATA        1
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-23 21:45:32 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								OSSL_CORE_MAKE_FUNC(int, rlayer_skip_early_data, (void *cbarg))
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-25 23:41:30 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# define OSSL_FUNC_RLAYER_MSG_CALLBACK           2
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								OSSL_CORE_MAKE_FUNC(void, rlayer_msg_callback, (int write_p, int version,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                                int content_type,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                                const void *buf, size_t len,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                                void *cbarg))
							 | 
						
					
						
							
								
									
										
										
										
											2022-05-26 00:10:38 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# define OSSL_FUNC_RLAYER_SECURITY               3
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								OSSL_CORE_MAKE_FUNC(int, rlayer_security, (void *cbarg, int op, int bits,
							 | 
						
					
						
							
								
									
										
										
										
											2022-08-19 23:54:09 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                                           int nid, void *other))
							 |