diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-07-18 19:47:56 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-07-18 19:47:56 +0200 |
commit | 007a71e3329aa76bb92701c9eb10743c68c93af9 (patch) | |
tree | 9fa4d0e47340f7ec57a1d97f8da09d122dbb8e52 /include/osmocom | |
parent | a9e4a1402b96652004d808bbe09d27c9b884c5df (diff) |
authentication: More documentation
Diffstat (limited to 'include/osmocom')
-rw-r--r-- | include/osmocom/crypt/auth.h | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 67b32009..871e7c87 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -1,11 +1,17 @@ #ifndef _OSMOCRYPTO_AUTH_H #define _OSMOCRYPTO_AUTH_H +/*! \addtogroup auth + * @{ + */ + +/*! \file auth.h */ + #include <stdint.h> #include <osmocom/core/linuxlist.h> -/*! \brief Authentication Type */ +/*! \brief Authentication Type (GSM/UMTS) */ enum osmo_sub_auth_type { OSMO_AUTH_TYPE_NONE = 0x00, OSMO_AUTH_TYPE_GSM = 0x01, @@ -29,42 +35,44 @@ struct osmo_sub_auth_data { enum osmo_auth_algo algo; union { struct { - uint8_t opc[16]; - uint8_t k[16]; + uint8_t opc[16]; /*!< operator invariant value */ + uint8_t k[16]; /*!< secret key of the subscriber */ uint8_t amf[2]; - uint64_t sqn; - int opc_is_op; + uint64_t sqn; /*!< sequence number */ + int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ } umts; struct { - uint8_t ki[16]; + uint8_t ki[16]; /*!< secret key */ } gsm; } u; }; /* data structure describing a computed auth vector, generated by AuC */ struct osmo_auth_vector { - uint8_t rand[16]; - uint8_t autn[16]; - uint8_t ck[16]; - uint8_t ik[16]; - uint8_t res[16]; - uint8_t res_len; - uint8_t kc[8]; - uint8_t sres[4]; + uint8_t rand[16]; /*!< random challenge */ + uint8_t autn[16]; /*!< authentication nonce */ + uint8_t ck[16]; /*!< ciphering key */ + uint8_t ik[16]; /*!< integrity key */ + uint8_t res[16]; /*!< authentication result */ + uint8_t res_len; /*!< length (in bytes) of res */ + uint8_t kc[8]; /*!< Kc for GSM encryption (A5) */ + uint8_t sres[4]; /*!< authentication result for GSM */ uint32_t auth_types; /*!< bitmask of OSMO_AUTH_TYPE_* */ }; /* \brief An implementation of an authentication algorithm */ struct osmo_auth_impl { struct llist_head list; - enum osmo_auth_algo algo; - const char *name; - unsigned int priority; + enum osmo_auth_algo algo; /*!< algorithm we implement */ + const char *name; /*!< name of the implementation */ + unsigned int priority; /*!< priority value (resp. othe implementations */ + /*! \brief callback for generate authentication vectors */ int (*gen_vec)(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *_rand); + /* \brief callback for generationg auth vectors + re-sync */ int (*gen_vec_auts)(struct osmo_auth_vector *vec, struct osmo_sub_auth_data *aud, const uint8_t *rand_auts, const uint8_t *auts, @@ -89,3 +97,5 @@ const char *osmo_auth_alg_name(enum osmo_auth_algo alg); enum osmo_auth_algo osmo_auth_alg_parse(const char *name); #endif /* _OSMOCRYPTO_AUTH_H */ + +/* @} */ |