Skip to content

Commit

Permalink
auth_radius: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent 552c5b1 commit 08e2430
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions src/modules/auth_radius/authorize.c
Expand Up @@ -70,8 +70,8 @@ static inline int get_uri_user(struct sip_msg *_m, str **_uri_user)
/*
* Authorize digest credentials
*/
static int ki_authorize(sip_msg_t *_msg, str *srealm,
str *suser, hdr_types_t _hftype)
static int ki_authorize(
sip_msg_t *_msg, str *srealm, str *suser, hdr_types_t _hftype)
{
int res;
auth_cfg_result_t ret;
Expand Down Expand Up @@ -133,8 +133,8 @@ static int ki_authorize(sip_msg_t *_msg, str *srealm,
/* get uri_user from _uri_user pvap (if exists) or
from To/From URI */
if(suser != NULL && suser->len > 0) {
res = radius_authorize_sterman(_msg, &cred->digest,
&_msg->first_line.u.request.method, suser);
res = radius_authorize_sterman(
_msg, &cred->digest, &_msg->first_line.u.request.method, suser);
} else {
if(get_uri_user(_msg, &uri_user) < 0) {
LM_ERR("To/From URI not found\n");
Expand Down Expand Up @@ -201,13 +201,13 @@ static inline int authorize(struct sip_msg *_msg, gparam_t *_realm,

/* get pre_auth domain from _realm param (if exists) */
if(_realm) {
if(fixup_get_svalue(_msg, _realm, &srealm)<0) {
if(fixup_get_svalue(_msg, _realm, &srealm) < 0) {
LM_ERR("failed to get realm value\n");
return -5;
}
}
if(_uri_user) {
if(fixup_get_svalue(_msg, _uri_user, &suser)<0) {
if(fixup_get_svalue(_msg, _uri_user, &suser) < 0) {
LM_ERR("cannot get uri user value\n");
return AUTH_ERROR;
}
Expand Down Expand Up @@ -253,8 +253,7 @@ int ki_radius_www_authorize_user(sip_msg_t *msg, str *srealm, str *suser)
int radius_proxy_authorize_1(struct sip_msg *_msg, char *_realm, char *_s2)
{
/* realm parameter is converted in fixup */
return authorize(
_msg, (gparam_t *)_realm, (gparam_t *)0, HDR_PROXYAUTH_T);
return authorize(_msg, (gparam_t *)_realm, (gparam_t *)0, HDR_PROXYAUTH_T);
}


Expand Down
2 changes: 1 addition & 1 deletion src/modules/auth_radius/sterman.c
Expand Up @@ -150,7 +150,7 @@ static int generate_avps(VALUE_PAIR *received)
vp = rc_avpair_get(vp, attrs[A_SIP_AVP].v, 0);
for(; vp; vp = ((ar_radius_avps_mode) ? vp->next
: rc_avpair_get(vp->next,
attrs[A_SIP_AVP].v, 0))) {
attrs[A_SIP_AVP].v, 0))) {
flags = 0;
if(!extract_avp(vp, &flags, &name, &val)) {
LM_ERR("error while extracting AVP '%.*s'\n", (int)strlen(vp->name),
Expand Down

0 comments on commit 08e2430

Please sign in to comment.