Skip to content

Commit

Permalink
reorder mkdigest
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Apr 21, 2024
1 parent c355cec commit 7b6f19c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sip/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ int sip_auth_encode(struct mbuf *mb, struct sip_auth *auth, const char *met,
struct realm *realm = le->data;
struct mbuf *digest = NULL;

err = mkdigest(&digest, realm, met, uri, cnonce);
if (err)
break;

switch (realm->hdr) {

case SIP_HDR_WWW_AUTHENTICATE:
Expand All @@ -301,10 +305,6 @@ int sip_auth_encode(struct mbuf *mb, struct sip_auth *auth, const char *met,
continue;
}

err = mkdigest(&digest, realm, met, uri, cnonce);
if (err)
break;

err |= mbuf_printf(mb, "Digest username=\"%s\"", realm->user);
err |= mbuf_printf(mb, ", realm=\"%s\"", realm->realm);
err |= mbuf_printf(mb, ", nonce=\"%s\"", realm->nonce);
Expand Down

0 comments on commit 7b6f19c

Please sign in to comment.