Skip to content

Commit

Permalink
fix: sd-jwt breaking changes without OWF updates
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Oct 9, 2023
1 parent 80ee38e commit d1fc74c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyeudiw/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.0"
__version__ = "0.7.0"
10 changes: 7 additions & 3 deletions pyeudiw/sd_jwt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def issue_sd_jwt(specification: dict, settings: dict, issuer_key: JWK, holder_ke
return {"jws": sdjwt_at_issuer.serialized_sd_jwt, "issuance": sdjwt_at_issuer.sd_jwt_issuance}


def _cb_get_issuer_key(issuer: str, settings: dict, adapted_keys: dict):
def _cb_get_issuer_key(issuer: str, settings: dict, adapted_keys: dict, *args, **kwargs):
if issuer == settings["issuer"]:
return adapted_keys["issuer_public_key"]
else:
Expand All @@ -162,7 +162,7 @@ def verify_sd_jwt(
sd_jwt_presentation: str,
issuer_key: JWK,
holder_key: JWK,
settings: dict = {'default_exp': 60, 'key_binding': True}
settings: dict = {'key_binding': True}
) -> dict:

settings.update(
Expand All @@ -179,7 +179,11 @@ def verify_sd_jwt(
serialization_format = "compact"
sdjwt_at_verifier = SDJWTVerifier(
sd_jwt_presentation,
cb_get_issuer_key = (lambda x: _cb_get_issuer_key(x, settings, adapted_keys)),
cb_get_issuer_key = (
lambda x, unverified_header_parameters: _cb_get_issuer_key(
x, settings, adapted_keys, **unverified_header_parameters
)
),
expected_aud = None,
expected_nonce = None,
serialization_format = serialization_format,
Expand Down

0 comments on commit d1fc74c

Please sign in to comment.