From d1fc74cc09e2ad8f653e35b55e2572ddc81a35b7 Mon Sep 17 00:00:00 2001 From: Giuseppe De Marco Date: Mon, 9 Oct 2023 14:11:33 +0200 Subject: [PATCH] fix: sd-jwt breaking changes without OWF updates --- pyeudiw/__init__.py | 2 +- pyeudiw/sd_jwt/__init__.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pyeudiw/__init__.py b/pyeudiw/__init__.py index 906d362f..49e0fc1e 100644 --- a/pyeudiw/__init__.py +++ b/pyeudiw/__init__.py @@ -1 +1 @@ -__version__ = "0.6.0" +__version__ = "0.7.0" diff --git a/pyeudiw/sd_jwt/__init__.py b/pyeudiw/sd_jwt/__init__.py index 4fda3841..f103adc2 100644 --- a/pyeudiw/sd_jwt/__init__.py +++ b/pyeudiw/sd_jwt/__init__.py @@ -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: @@ -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( @@ -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,