Skip to content

Commit

Permalink
group oscore: Allow setting a gm_cred_fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Aug 1, 2024
1 parent 631dce7 commit 3f9fc10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aiocoap/oscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand All @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions tests/test_group_oscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def setUp(self):
if i != j
},
gm_cred,
group_manager_cred_fmt="dummy",
)
for i, _ in enumerate(participants)
]
Expand Down

0 comments on commit 3f9fc10

Please sign in to comment.