Skip to content

Commit

Permalink
Ensure all code paths can be tested for both curve and q structs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dzoep committed Dec 13, 2024
1 parent 6920910 commit e955ace
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions oarepo_c4gh/key/gpg_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ def ensure_public_key(self):
curve_struct = next(
v for v in key_struct[1][1:] if v[0] == b"curve"
)
q_struct = next(v for v in key_struct[1][1:] if v[0] == b"q")
if (
(curve_struct is None)
or (len(curve_struct) < 2)
or (curve_struct[1] != b"Curve25519")
or (q_struct is None)
or (len(q_struct) < 2)
):
continue
q_struct = next(v for v in key_struct[1][1:] if v[0] == b"q")
if (q_struct is None) or (len(q_struct) < 2):
continue
self._public_key = q_struct[1][1:]
self._keygrip = keygrip
break
Expand Down

0 comments on commit e955ace

Please sign in to comment.