mirror of https://gerrit.osmocom.org/libosmocore
Deprecate comp128
Mark function as deprecated to discourage its usage: people should use generic API in osmocom/crypt/auth.h
This commit is contained in:
parent
fdb3d8ce78
commit
1f9d8183be
|
@ -8,11 +8,15 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <osmocom/core/defs.h>
|
||||
|
||||
/*
|
||||
* Performs the COMP128 algorithm (used as A3/A8)
|
||||
* Performs the COMP128v1 algorithm (used as A3/A8)
|
||||
* ki : uint8_t [16]
|
||||
* srand : uint8_t [16]
|
||||
* sres : uint8_t [4]
|
||||
* kc : uint8_t [8]
|
||||
*/
|
||||
void comp128(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc);
|
||||
void comp128v1(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc);
|
||||
|
||||
void comp128(const uint8_t *ki, const uint8_t *srand, uint8_t *sres, uint8_t *kc) OSMO_DEPRECATED("Use generic API from osmocom/crypt/auth.h instead");
|
||||
|
|
|
@ -28,7 +28,7 @@ static int c128v1_gen_vec(struct osmo_auth_vector *vec,
|
|||
struct osmo_sub_auth_data *aud,
|
||||
const uint8_t *_rand)
|
||||
{
|
||||
comp128(aud->u.gsm.ki, _rand, vec->sres, vec->kc);
|
||||
comp128v1(aud->u.gsm.ki, _rand, vec->sres, vec->kc);
|
||||
vec->auth_types = OSMO_AUTH_TYPE_GSM;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -185,7 +185,7 @@ _comp128_permutation(uint8_t *x, uint8_t *bits)
|
|||
}
|
||||
|
||||
void
|
||||
comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc)
|
||||
comp128v1(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc)
|
||||
{
|
||||
int i;
|
||||
uint8_t x[32], bits[128];
|
||||
|
@ -228,3 +228,8 @@ comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc)
|
|||
kc[7] = 0;
|
||||
}
|
||||
|
||||
void
|
||||
comp128(const uint8_t *ki, const uint8_t *rand, uint8_t *sres, uint8_t *kc)
|
||||
{
|
||||
comp128v1(ki, rand, sres, kc);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue