Module: kamailio Branch: master Commit: aa167c410860732918061106c4a84a7c6b030d69 URL: https://github.com/kamailio/kamailio/commit/aa167c410860732918061106c4a84a7c...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-01-23T14:25:09+01:00
auth: removed commented code and prefixed short global variable
---
Modified: src/modules/auth/auth_mod.c Modified: src/modules/auth/auth_mod.h Modified: src/modules/auth/nid.c Modified: src/modules/auth/nonce.c
---
Diff: https://github.com/kamailio/kamailio/commit/aa167c410860732918061106c4a84a7c... Patch: https://github.com/kamailio/kamailio/commit/aa167c410860732918061106c4a84a7c...
---
diff --git a/src/modules/auth/auth_mod.c b/src/modules/auth/auth_mod.c index fb633a10259..9bf4ac2923a 100644 --- a/src/modules/auth/auth_mod.c +++ b/src/modules/auth/auth_mod.c @@ -138,7 +138,7 @@ calc_response_t calc_response;
/*! SL API structure */ -sl_api_t slb; +sl_api_t _auth_slb;
/* * Exported functions @@ -248,8 +248,6 @@ static inline int generate_random_secret(void) secret2.s = sec_rand2; secret2.len = RAND_SECRET_LEN;
- /* DBG("Generated secret: '%.*s'\n", secret.len, secret.s); */ - return 0; }
@@ -263,7 +261,7 @@ static int mod_init(void) auth_realm_prefix.len = strlen(auth_realm_prefix.s);
/* bind the SL API */ - if(sl_load_api(&slb) != 0) { + if(sl_load_api(&_auth_slb) != 0) { LM_ERR("cannot bind to SL API\n"); return -1; } @@ -949,8 +947,8 @@ static int auth_send_reply( reason_str.s = reason; reason_str.len = strlen(reason);
- return force_stateless_reply ? slb.sreply(msg, code, &reason_str) - : slb.freply(msg, code, &reason_str); + return force_stateless_reply ? _auth_slb.sreply(msg, code, &reason_str) + : _auth_slb.freply(msg, code, &reason_str); }
/** diff --git a/src/modules/auth/auth_mod.h b/src/modules/auth/auth_mod.h index ea3617e3d5e..48066750d2d 100644 --- a/src/modules/auth/auth_mod.h +++ b/src/modules/auth/auth_mod.h @@ -38,7 +38,6 @@ extern str secret1; /* secret phrase used to generate nonce */ extern str secret2; /* secret phrase used to generate nonce */ extern int nonce_expire; /* nonce expire interval */ extern int protect_contacts; /* Enable/disable contact hashing in nonce */ -extern sl_api_t sl; extern avp_ident_t challenge_avpid; extern str proxy_challenge_header; extern str www_challenge_header; diff --git a/src/modules/auth/nid.c b/src/modules/auth/nid.c index 408e6ab3e14..3aee167c633 100644 --- a/src/modules/auth/nid.c +++ b/src/modules/auth/nid.c @@ -77,11 +77,6 @@ int init_nonce_id() for(r = 0; r < nid_pool_no; r++) atomic_set(&nid_crt[r].id, random()); return 0; - /* -error: - destroy_nonce_id(); - return -1; -*/ }
diff --git a/src/modules/auth/nonce.c b/src/modules/auth/nonce.c index 0304b394bd7..56cd49b7ec2 100644 --- a/src/modules/auth/nonce.c +++ b/src/modules/auth/nonce.c @@ -223,7 +223,7 @@ int calc_nonce(char *nonce, int *nonce_len, int cfg, unsigned int since, len = calc_bin_nonce_md5(&b_nonce, cfg, secret1, secret2, msg); *nonce_len = base64_enc( &b_nonce.raw[0], len, (unsigned char *)nonce, *nonce_len); - assert(*nonce_len >= 0); /*FIXME*/ + assert(*nonce_len >= 0); return 0; }