From 3f9fc10aed4a9281a97ea04e60ecc751c840411d Mon Sep 17 00:00:00 2001 From: chrysn Date: Thu, 1 Aug 2024 16:18:42 +0200 Subject: [PATCH] group oscore: Allow setting a gm_cred_fmt --- aiocoap/oscore.py | 4 ++++ tests/test_group_oscore.py | 1 + 2 files changed, 5 insertions(+) diff --git a/aiocoap/oscore.py b/aiocoap/oscore.py index 004202f9..b8b41e46 100644 --- a/aiocoap/oscore.py +++ b/aiocoap/oscore.py @@ -1960,6 +1960,8 @@ class SimpleGroupContext(GroupContext, CanProtect, CanUnprotect, SecurityContext sender_auth_cred = None # type: ignore group_manager_cred = None # type: ignore cred_fmt = None + # This is currently not evaluated, but any GM interaction will need to have this information available. + group_manager_cred_fmt = None def __init__( self, @@ -1977,6 +1979,7 @@ def __init__( peers, group_manager_cred, cred_fmt=COSE_KCCS, + group_manager_cred_fmt=COSE_KCCS, ): self.sender_id = sender_id self.id_context = group_id @@ -1989,6 +1992,7 @@ def __init__( self.sender_auth_cred = sender_auth_cred self.group_manager_cred = group_manager_cred self.cred_fmt = cred_fmt + self.group_manager_cred_fmt = group_manager_cred_fmt self.peers = peers.keys() self.recipient_public_keys = { diff --git a/tests/test_group_oscore.py b/tests/test_group_oscore.py index 399a67e7..f80e8ed6 100644 --- a/tests/test_group_oscore.py +++ b/tests/test_group_oscore.py @@ -57,6 +57,7 @@ def setUp(self): if i != j }, gm_cred, + group_manager_cred_fmt="dummy", ) for i, _ in enumerate(participants) ]