Skip to content

Commit

Permalink
Fix type collision
Browse files Browse the repository at this point in the history
  • Loading branch information
npmccallum committed Jul 10, 2018
1 parent 9ec5bf7 commit e1b3f51
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/jwk.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,25 @@ jwk_hook(jose_cfg_t *cfg, json_t *jwk, jose_hook_jwk_kind_t kind, bool dflt)
if (j->kind != kind)
continue;

if (!j->prep.handles(cfg, jwk))
switch (kind) {
case JOSE_HOOK_JWK_KIND_PREP:
if (!j->prep.handles(cfg, jwk))
continue;

upd = j->prep.execute(cfg, jwk);
break;

case JOSE_HOOK_JWK_KIND_MAKE:
if (!j->make.handles(cfg, jwk))
continue;

upd = j->make.execute(cfg, jwk);
break;

default:
continue;
}

upd = j->prep.execute(cfg, jwk);
if (!json_is_object(upd))
return false;

Expand Down

0 comments on commit e1b3f51

Please sign in to comment.