From 58ec26f6b7a0400c8fa05263be9b19bb179495fd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 31 Oct 2013 01:28:22 +0100 Subject: Rename session_init to session_init_compat to prepare for the upcoming new key derivation scheme --- src/methods/aes128_gcm/aes128_gcm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/methods/aes128_gcm') diff --git a/src/methods/aes128_gcm/aes128_gcm.c b/src/methods/aes128_gcm/aes128_gcm.c index 0b0ad56..6608618 100644 --- a/src/methods/aes128_gcm/aes128_gcm.c +++ b/src/methods/aes128_gcm/aes128_gcm.c @@ -29,8 +29,6 @@ #include "../common.h" -#define KEYBYTES 16 - struct fastd_method_session_state { fastd_method_common_t common; @@ -61,8 +59,8 @@ static size_t method_min_decrypt_tail_space(fastd_context_t *ctx UNUSED) { } -static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, uint8_t *secret, size_t length, bool initiator) { - if (length < KEYBYTES) +static fastd_method_session_state_t* method_session_init_key(fastd_context_t *ctx, uint8_t *secret, size_t length, bool initiator) { + if (length < sizeof(fastd_block128_t)) exit_bug(ctx, "aes128-gcm: tried to init with short secret"); fastd_method_session_state_t *session = malloc(sizeof(fastd_method_session_state_t)); @@ -232,7 +230,7 @@ const fastd_method_t fastd_method_aes128_gcm = { .min_encrypt_tail_space = method_min_encrypt_tail_space, .min_decrypt_tail_space = method_min_decrypt_tail_space, - .session_init = method_session_init, + .session_init_compat = method_session_init_key, .session_is_valid = method_session_is_valid, .session_is_initiator = method_session_is_initiator, .session_want_refresh = method_session_want_refresh, -- cgit v1.2.3