Skip to content

Commit

Permalink
replace some leftover functions calls with their const.h equivalent
Browse files Browse the repository at this point in the history
Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Feb 25, 2024
1 parent 737e40b commit 254b7ad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/mod_auth_openidc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,8 +1606,8 @@ static apr_byte_t oidc_userinfo_create_signed_jwt(request_rec *r, oidc_cfg *cfg,
if (oidc_util_json_merge(r, json, jwt->payload.value.json) == FALSE)
goto end;
s_claims = oidc_util_encode_json_object(r, jwt->payload.value.json, JSON_PRESERVE_ORDER | JSON_COMPACT);
if (oidc_jose_hash_and_base64url_encode(r->pool, OIDC_JOSE_ALG_SHA256, s_claims, strlen(s_claims) + 1, &key,
&err) == FALSE) {
if (oidc_jose_hash_and_base64url_encode(r->pool, OIDC_JOSE_ALG_SHA256, s_claims, _oidc_strlen(s_claims) + 1,
&key, &err) == FALSE) {
oidc_error(r, "oidc_jose_hash_and_base64url_encode failed: %s", oidc_jose_e2s(r->pool, err));
goto end;
}
Expand Down Expand Up @@ -2250,7 +2250,7 @@ static int oidc_handle_authorization_response(request_rec *r, oidc_cfg *c, oidc_
if (c->error_template) {
// retain backwards compatibility
int rc = HTTP_BAD_REQUEST;
if ((r->user) && (strncmp(r->user, "", 1) == 0)) {
if ((r->user) && (_oidc_strncmp(r->user, "", 1) == 0)) {
r->header_only = 1;
r->user = NULL;
rc = OK;
Expand Down
4 changes: 2 additions & 2 deletions src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,10 @@ const char *oidc_parse_use_enc_kid_key_tuple(apr_pool_t *pool, const char *tuple
if (use) {
if (_oidc_strstr(tuple, OIDC_KEY_SIG_PREFIX) == tuple) {
*use = OIDC_JOSE_JWK_SIG_STR;
tuple += strlen(OIDC_KEY_SIG_PREFIX);
tuple += _oidc_strlen(OIDC_KEY_SIG_PREFIX);
} else if (_oidc_strstr(tuple, OIDC_KEY_ENC_PREFIX) == tuple) {
*use = OIDC_JOSE_JWK_ENC_STR;
tuple += strlen(OIDC_KEY_ENC_PREFIX);
tuple += _oidc_strlen(OIDC_KEY_ENC_PREFIX);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ static char *oidc_util_utf8_to_latin1(request_rec *r, const char *src) {
int i = 0;
if (src == NULL)
return NULL;
dst = apr_pcalloc(r->pool, strlen(src) + 1);
dst = apr_pcalloc(r->pool, _oidc_strlen(src) + 1);
while (*src != '\0') {
ch = (unsigned char)(*src);
if (ch <= 0x7f)
Expand Down

0 comments on commit 254b7ad

Please sign in to comment.