Skip to content

Commit ea5a8a7

Browse files
committed
Fix key_ops validation for OKP.
1 parent 59e0864 commit ea5a8a7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cwt/algs/okp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(self, params: Dict[int, Any]):
131131
else:
132132
# public key.
133133
if self._crv in [4, 5]: # X25519/X448
134-
if not set(self._key_ops) & set([7, 8]):
134+
if len(self._key_ops) != 0 and not (set(self._key_ops) & set([7, 8])):
135135
raise ValueError("Invalid key_ops for public key.")
136136
else: # Ed25519/Ed448
137137
if len(self._key_ops) != 1 or self._key_ops[0] != 2:

0 commit comments

Comments
 (0)