From e955ace008221e10d7b387dd881b059332accb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Fri, 13 Dec 2024 13:35:50 +0100 Subject: [PATCH] Ensure all code paths can be tested for both curve and q structs. --- oarepo_c4gh/key/gpg_agent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oarepo_c4gh/key/gpg_agent.py b/oarepo_c4gh/key/gpg_agent.py index c286719..0f5d21f 100644 --- a/oarepo_c4gh/key/gpg_agent.py +++ b/oarepo_c4gh/key/gpg_agent.py @@ -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