aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/tls/tls_session_key.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-11-03 23:08:58 +0000
committerlloyd <[email protected]>2014-11-03 23:08:58 +0000
commit85e0f9510fde42905e8d4883614ca1920a914c30 (patch)
treed4abfd9b004870c59330ff7424dabc323d112669 /src/lib/tls/tls_session_key.cpp
parentbcd83686c3daed38974d1f9b533c07d35c5a7476 (diff)
Cleanup handling of TLS AEAD nonce sizes, push all knowledge of what
the nonce sizes should be down to the ciphersuite generating script.
Diffstat (limited to 'src/lib/tls/tls_session_key.cpp')
-rw-r--r--src/lib/tls/tls_session_key.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/tls/tls_session_key.cpp b/src/lib/tls/tls_session_key.cpp
index 8bf0c94c1..4c09b29fd 100644
--- a/src/lib/tls/tls_session_key.cpp
+++ b/src/lib/tls/tls_session_key.cpp
@@ -22,9 +22,9 @@ Session_Keys::Session_Keys(const Handshake_State* state,
{
const size_t cipher_keylen = state->ciphersuite().cipher_keylen();
const size_t mac_keylen = state->ciphersuite().mac_keylen();
- const size_t cipher_ivlen = state->ciphersuite().cipher_ivlen();
+ const size_t cipher_nonce_bytes = state->ciphersuite().explicit_nonce_bytes();
- const size_t prf_gen = 2 * (mac_keylen + cipher_keylen + cipher_ivlen);
+ const size_t prf_gen = 2 * (mac_keylen + cipher_keylen + cipher_nonce_bytes);
const byte MASTER_SECRET_MAGIC[] = {
0x6D, 0x61, 0x73, 0x74, 0x65, 0x72, 0x20, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74 };
@@ -73,10 +73,10 @@ Session_Keys::Session_Keys(const Handshake_State* state,
s_cipher = SymmetricKey(key_data, cipher_keylen);
key_data += cipher_keylen;
- c_iv = InitializationVector(key_data, cipher_ivlen);
- key_data += cipher_ivlen;
+ c_iv = InitializationVector(key_data, cipher_nonce_bytes);
+ key_data += cipher_nonce_bytes;
- s_iv = InitializationVector(key_data, cipher_ivlen);
+ s_iv = InitializationVector(key_data, cipher_nonce_bytes);
}
}