MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / mark_authorized_cred

Function mark_authorized_cred

parser/digest/digest.c:206–228  ·  view source on GitHub ↗

* Mark credentials as selected so functions * following authorize know which credentials * to use if the message contained more than * one */

Source from the content-addressed store, hash-verified

204 * one
205 */
206int mark_authorized_cred(struct sip_msg* _m, struct hdr_field* _h)
207{
208 struct hdr_field* f;
209
210 switch(_h->type) {
211 case HDR_AUTHORIZATION_T: f = _m->authorization; break;
212 case HDR_PROXYAUTH_T: f = _m->proxy_auth; break;
213 default:
214 LM_ERR("invalid header field type\n");
215 return -1;
216 }
217
218 if (!(f->parsed)) {
219 if (new_credentials(f) < 0) {
220 LM_ERR("new_credentials failed\n");
221 return -1;
222 }
223 }
224
225 ((auth_body_t*)(f->parsed))->authorized = _h;
226
227 return 0;
228}
229
230
231/*

Callers 2

pre_authFunction · 0.85
aka_challenge_preFunction · 0.85

Calls 1

new_credentialsFunction · 0.85

Tested by

no test coverage detected