OSSL_RECORD_TEMPLATE *templ,
unsigned int rectype,
unsigned char **recdata);
+
+ int (*add_record_padding)(OSSL_RECORD_LAYER *rl,
+ OSSL_RECORD_TEMPLATE *thistempl,
+ WPACKET *thispkt,
+ SSL3_RECORD *thiswr);
+
+ /*
+ * This applies any mac that might be necessary, ensures that we have enough
+ * space in the WPACKET to perform the encryption and sets up the
+ * SSL3_RECORD ready for that encryption.
+ */
+ int (*prepare_for_encryption)(OSSL_RECORD_LAYER *rl,
+ size_t mac_size,
+ WPACKET *thispkt,
+ SSL3_RECORD *thiswr);
+
+ /*
+ * Any updates required to the record after encryption has been applied. For
+ * example, adding a MAC if using encrypt-then-mac
+ */
+ int (*post_encryption_processing)(OSSL_RECORD_LAYER *rl,
+ size_t mac_size,
+ OSSL_RECORD_TEMPLATE *thistempl,
+ WPACKET *thispkt,
+ SSL3_RECORD *thiswr);
+
+ /*
+ * Some record layer implementations need to do some custom preparation of
+ * the BIO before we write to it. KTLS does this to prevent coalescing of
+ * control and data messages.
+ */
+ int (*prepare_write_bio)(OSSL_RECORD_LAYER *rl, int type);
};
struct ossl_record_layer_st
int tls_get_more_records(OSSL_RECORD_LAYER *rl);
int dtls_get_more_records(OSSL_RECORD_LAYER *rl);
+int dtls_prepare_record_header(OSSL_RECORD_LAYER *rl,
+ WPACKET *thispkt,
+ OSSL_RECORD_TEMPLATE *templ,
+ unsigned int rectype,
+ unsigned char **recdata);
+int dtls_write_records(OSSL_RECORD_LAYER *rl, OSSL_RECORD_TEMPLATE *templates,
+ size_t numtempl);
+
int tls_default_set_protocol_version(OSSL_RECORD_LAYER *rl, int version);
int tls_default_validate_record_header(OSSL_RECORD_LAYER *rl, SSL3_RECORD *re);
+int tls_do_compress(OSSL_RECORD_LAYER *rl, SSL3_RECORD *wr);
int tls_do_uncompress(OSSL_RECORD_LAYER *rl, SSL3_RECORD *rec);
int tls_default_post_process_record(OSSL_RECORD_LAYER *rl, SSL3_RECORD *rec);
int tls13_common_post_process_record(OSSL_RECORD_LAYER *rl, SSL3_RECORD *rec);
OSSL_RECORD_TEMPLATE *templ,
unsigned int rectype,
unsigned char **recdata);
+int tls_prepare_for_encryption_default(OSSL_RECORD_LAYER *rl,
+ size_t mac_size,
+ WPACKET *thispkt,
+ SSL3_RECORD *thiswr);
+int tls_post_encryption_processing_default(OSSL_RECORD_LAYER *rl,
+ size_t mac_size,
+ OSSL_RECORD_TEMPLATE *thistempl,
+ WPACKET *thispkt,
+ SSL3_RECORD *thiswr);
int tls_write_records_default(OSSL_RECORD_LAYER *rl,
OSSL_RECORD_TEMPLATE *templates,
size_t numtempl);