aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_record.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2020-04-23 07:21:30 -0400
committerJack Lloyd <[email protected]>2020-04-24 09:57:43 -0400
commit9b3d1c467b93e27d88bb2da0a90dc0b9b1e95cfd (patch)
tree173085af29bb9ff7426f14473fdf141a29203d20 /src/lib/tls/tls_record.h
parent39c5aacdf1572dfe27bb3e58fbceb7854bfca117 (diff)
Small refactorings of TLS record layer
Reduces some code duplication in #2320
Diffstat (limited to 'src/lib/tls/tls_record.h')
-rw-r--r--src/lib/tls/tls_record.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/tls/tls_record.h b/src/lib/tls/tls_record.h
index 779954439..7593ac970 100644
--- a/src/lib/tls/tls_record.h
+++ b/src/lib/tls/tls_record.h
@@ -129,6 +129,22 @@ class Record_Header final
};
/**
+* Create an initial (unencrypted) TLS handshake record
+* @param write_buffer the output record is placed here
+* @param record_type the record layer type
+* @param record_version the record layer version
+* @param record_sequence the record layer sequence number
+* @param message the record contents
+* @param message_len is size of message
+*/
+void write_unencrypted_record(secure_vector<uint8_t>& output,
+ uint8_t record_type,
+ Protocol_Version version,
+ uint64_t record_sequence,
+ const uint8_t* message,
+ size_t message_len);
+
+/**
* Create a TLS record
* @param write_buffer the output record is placed here
* @param record_type the record layer type
@@ -145,7 +161,7 @@ void write_record(secure_vector<uint8_t>& write_buffer,
uint64_t record_sequence,
const uint8_t* message,
size_t message_len,
- Connection_Cipher_State* cipherstate,
+ Connection_Cipher_State& cipherstate,
RandomNumberGenerator& rng);
// epoch -> cipher state