tls-crypto: Simplify handshake/application key derivation and rename methods

Also consistently change the ciphers outside of tls_crypto_t and
simplify key derivation in tls_peer_t and fix a memory leak.
This commit is contained in:
Tobias Brunner
2021-02-12 11:45:44 +01:00
parent fff1974012
commit 2921f43705
3 changed files with 85 additions and 153 deletions
+8 -3
View File
@@ -1,4 +1,9 @@
/*
* Copyright (C) 2020 Tobias Brunner
* Copyright (C) 2020 Pascal Knecht
* Copyright (C) 2020 Méline Sieber
* HSR Hochschule fuer Technik Rapperswil
*
* Copyright (C) 2010 Martin Willi
* Copyright (C) 2010 revosec AG
*
@@ -514,7 +519,7 @@ struct tls_crypto_t {
bio_reader_t *reader);
/**
* Calculate the data of a legacyTLS finished message.
* Calculate the data of a legacy TLS finished message.
*
* @param label ASCII label to use for calculation
* @param out buffer to write finished data to
@@ -551,14 +556,14 @@ struct tls_crypto_t {
* @param shared_secret input key material
* @return TRUE if secret derived successfully
*/
bool (*derive_handshake_secret)(tls_crypto_t *this, chunk_t shared_secret);
bool (*derive_handshake_keys)(tls_crypto_t *this, chunk_t shared_secret);
/**
* Derive the application keys.
*
* @return TRUE if secret derived successfully
*/
bool (*derive_app_secret)(tls_crypto_t *this);
bool (*derive_app_keys)(tls_crypto_t *this);
/**
* Try to resume a TLS session, derive key material.