Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions cups/oauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,13 +1382,18 @@ cupsOAuthGetTokens(
jnonce = cupsJWTGetClaimString(jwt, "nonce");
nonce = oauth_load_value(auth_uri, resource_uri, _CUPS_OTYPE_NONCE, /*try_sysconfig*/false);

// We need a JWT...
if (!jwt)
goto done;
// We need a JWT...
if (!jwt)
goto done;

/*
* Validate the nonce step to prevent replay attacks...
*/

if (!nonce || !jnonce || strcmp(nonce, jnonce) != 0)
goto done;


// Validate nonce
if (nonce && (!jnonce || strcmp(jnonce, nonce)))
goto done;

// Validate id_token against the Authorization Server's JWKS
if ((jwks = cupsOAuthGetJWKS(auth_uri, metadata)) == NULL)
Expand Down