From a433fa4d8f5f436a7e42547bc670f71e586f862d Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Thu, 14 Oct 2010 23:06:28 +0200 Subject: [PATCH] auth: add definitions for AC and UPI length Signed-off-by: Patrick McHardy --- example/fp-mm.c | 2 +- example/pp-access-rights.c | 4 ++-- include/dect/auth.h | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/example/fp-mm.c b/example/fp-mm.c index 98b2091..53ebab3 100644 --- a/example/fp-mm.c +++ b/example/fp-mm.c @@ -105,7 +105,7 @@ static void mm_authenticate_cfm(struct dect_handle *dh, struct mm_priv *priv = dect_mm_priv(mme); uint8_t k[DECT_AUTH_KEY_LEN], ks[DECT_AUTH_KEY_LEN]; uint8_t dck[DECT_CIPHER_KEY_LEN]; - uint8_t ac[4]; + uint8_t ac[DECT_AUTH_CODE_LEN]; uint32_t res1; if (!accept) diff --git a/example/pp-access-rights.c b/example/pp-access-rights.c index d8b6de7..73997bf 100644 --- a/example/pp-access-rights.c +++ b/example/pp-access-rights.c @@ -56,7 +56,7 @@ static void mm_authenticate_cfm(struct dect_handle *dh, { struct mm_priv *priv = dect_mm_priv(mme); uint8_t k[DECT_AUTH_KEY_LEN], ks[DECT_AUTH_KEY_LEN]; - uint8_t ac[4]; + uint8_t ac[DECT_AUTH_CODE_LEN]; uint32_t res2; if (!accept) @@ -95,7 +95,7 @@ static void mm_key_allocate_ind(struct dect_handle *dh, }; uint8_t k[DECT_AUTH_KEY_LEN], ks[DECT_AUTH_KEY_LEN]; uint8_t dck[DECT_CIPHER_KEY_LEN]; - uint8_t ac[4]; + uint8_t ac[DECT_AUTH_CODE_LEN]; auth_type.auth_id = DECT_AUTH_DSAA; auth_type.auth_key_type = DECT_KEY_AUTHENTICATION_CODE; diff --git a/include/dect/auth.h b/include/dect/auth.h index ee21ff6..c1366cc 100644 --- a/include/dect/auth.h +++ b/include/dect/auth.h @@ -16,6 +16,8 @@ extern "C" { * @{ */ +#define DECT_AUTH_CODE_LEN 4 /**< Length of authentication code */ +#define DECT_UPI_LEN 4 /**< Length of User Personal Identification */ #define DECT_AUTH_KEY_LEN 16 /**< Length of a DECT authentication key */ #define DECT_CIPHER_KEY_LEN 8 /**< Length of a DECT cipher key */