From 977afaae343f38909d6bb6cb74b6ff846c647cb0 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 16 May 2018 20:09:31 +0200 Subject: tests: gea_test: Use correct max size for key in buffer Expect key sizes for GEA are 64-128 bits. Change-Id: Iaf81992a2901733b630e3046b0c4bdc1fb9a8ace --- tests/gea/gea_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/gea/gea_test.c b/tests/gea/gea_test.c index ebccaafd..87020e2e 100644 --- a/tests/gea/gea_test.c +++ b/tests/gea/gea_test.c @@ -23,9 +23,9 @@ static inline void print_check(char *res, uint8_t *out, uint16_t len) static inline void test_gea(bool v4, char *kc, uint32_t iv, int dir, uint16_t len, char *res) { - uint8_t out[len], ck[256]; + uint8_t out[len], ck[16]; printf("len %d, dir %d, INPUT 0x%X -> ", len, dir, iv); - osmo_hexparse(kc, ck, len); + osmo_hexparse(kc, ck, sizeof(ck)); int t = gprs_cipher_run(out, len, v4 ? GPRS_ALGO_GEA4 : GPRS_ALGO_GEA3, ck, iv, dir); printf("%s ", t < 0 ? strerror(-t) : "OK"); -- cgit v1.2.3