Skip to content

Commit a2b1e66

Browse files
committed
add a configuration check for public/private keys when using DPoP
closes #1293; thanks @ahus1 Signed-off-by: Hans Zandbelt <[email protected]>
1 parent 127e170 commit a2b1e66

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
01/02/2025
2+
- add a configuration check for public/private keys when using DPoP; closes #1293; thanks @ahus1
3+
14
12/17/2024
25
- code: address SonarQube warnings in src/cache/*.c
36

src/mod_auth_openidc.c

+9
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,15 @@ static int oidc_check_config_openid_openidc(server_rec *s, oidc_cfg_t *c) {
14701470
}
14711471
}
14721472

1473+
if (oidc_cfg_provider_dpop_mode_get(oidc_cfg_provider_get(c)) != OIDC_DPOP_MODE_OFF) {
1474+
if (oidc_util_key_list_first(oidc_cfg_private_keys_get(c), -1, OIDC_JOSE_JWK_SIG_STR) == NULL) {
1475+
oidc_serror(s,
1476+
"'" OIDCDPoPMode "' is configured but the required signing keys have not been "
1477+
"provided in '" OIDCPrivateKeyFiles "'/'" OIDCPublicKeyFiles "'");
1478+
return HTTP_INTERNAL_SERVER_ERROR;
1479+
}
1480+
}
1481+
14731482
return OK;
14741483
}
14751484

src/proto/jwt.c

-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ apr_byte_t oidc_proto_jwt_create_from_first_pkey(request_rec *r, oidc_cfg_t *cfg
252252
oidc_debug(r, "enter");
253253

254254
*jwk = oidc_util_key_list_first(oidc_cfg_private_keys_get(cfg), -1, OIDC_JOSE_JWK_SIG_STR);
255-
// TODO: detect at config time
256255
if (*jwk == NULL) {
257256
oidc_error(r, "no RSA/EC private signing keys have been configured (in " OIDCPrivateKeyFiles ")");
258257
goto end;

0 commit comments

Comments
 (0)