From f0de72ae8d04fcd97c03cc52ac2bc8dc6c2c0527 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 1 Nov 2013 00:59:13 +0100 Subject: Add missing const attribute to secret argument of the session init functions --- src/methods/aes128_gcm/aes128_gcm.c | 4 ++-- src/methods/null/null.c | 4 ++-- src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/methods') diff --git a/src/methods/aes128_gcm/aes128_gcm.c b/src/methods/aes128_gcm/aes128_gcm.c index a2fbf17..297031b 100644 --- a/src/methods/aes128_gcm/aes128_gcm.c +++ b/src/methods/aes128_gcm/aes128_gcm.c @@ -63,7 +63,7 @@ static size_t method_key_length(fastd_context_t *ctx UNUSED) { return sizeof(fastd_block128_t); } -static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, uint8_t *secret, bool initiator) { +static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, const uint8_t *secret, bool initiator) { fastd_method_session_state_t *session = malloc(sizeof(fastd_method_session_state_t)); fastd_method_common_init(ctx, &session->common, initiator); @@ -82,7 +82,7 @@ static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, u return session; } -static fastd_method_session_state_t* method_session_init_compat(fastd_context_t *ctx, uint8_t *secret, size_t length, bool initiator) { +static fastd_method_session_state_t* method_session_init_compat(fastd_context_t *ctx, const 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"); diff --git a/src/methods/null/null.c b/src/methods/null/null.c index c51b592..f49d94a 100644 --- a/src/methods/null/null.c +++ b/src/methods/null/null.c @@ -45,7 +45,7 @@ static size_t method_key_length(fastd_context_t *ctx UNUSED) { return 0; } -static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx UNUSED, uint8_t *secret UNUSED, bool initiator) { +static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx UNUSED, const uint8_t *secret UNUSED, bool initiator) { fastd_method_session_state_t *session = malloc(sizeof(fastd_method_session_state_t)); session->valid = true; @@ -54,7 +54,7 @@ static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx UN return session; } -static fastd_method_session_state_t* method_session_init_compat(fastd_context_t *ctx, uint8_t *secret, size_t length UNUSED, bool initiator) { +static fastd_method_session_state_t* method_session_init_compat(fastd_context_t *ctx, const uint8_t *secret, size_t length UNUSED, bool initiator) { return method_session_init(ctx, secret, initiator); } diff --git a/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c b/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c index 466ff34..768e5c8 100644 --- a/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c +++ b/src/methods/xsalsa20_poly1305/xsalsa20_poly1305.c @@ -58,7 +58,7 @@ static size_t method_key_length(fastd_context_t *ctx UNUSED) { return crypto_secretbox_xsalsa20poly1305_KEYBYTES; } -static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, uint8_t *secret, bool initiator) { +static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, const uint8_t *secret, bool initiator) { fastd_method_session_state_t *session = malloc(sizeof(fastd_method_session_state_t)); fastd_method_common_init(ctx, &session->common, initiator); @@ -68,7 +68,7 @@ static fastd_method_session_state_t* method_session_init(fastd_context_t *ctx, u return session; } -static fastd_method_session_state_t* method_session_init_compat(fastd_context_t *ctx, uint8_t *secret, size_t length, bool initiator) { +static fastd_method_session_state_t* method_session_init_compat(fastd_context_t *ctx, const uint8_t *secret, size_t length, bool initiator) { if (length < crypto_secretbox_xsalsa20poly1305_KEYBYTES) exit_bug(ctx, "xsalsa20-poly1305: tried to init with short secret"); -- cgit v1.2.3