Skip to content

Commit 1f42891

Browse files
author
Roxana Meixner
committed
remove deletion of unused backend response verification keys from keystore in Proto constructor as it unnecessarily crowds the code and decreases readability
1 parent 3915e88 commit 1f42891

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

examples/UbirchWrapper.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,11 @@ def __init__(self, key_store: ubirch.KeyStore, uuid: UUID, env: str, key_type: s
5858

5959
# check if the keystore has the same key_type for the device UUID and the backend response
6060
if key_type == ECDSA_TYPE:
61-
if self.__ks._ks.entries.get(ubirch.get_backend_uuid(env).hex, None) != None:
62-
# suffix-less pubkey found, delete it
63-
self.__ks._ks.entries.pop(ubirch.get_backend_uuid(env).hex)
64-
65-
self.__ks.insert_ecdsa_verifying_key(ubirch.get_backend_uuid(env), ubirch.get_backend_verifying_key(env, ECDSA_TYPE))
61+
self.__ks.insert_ecdsa_verifying_key(ubirch.get_backend_uuid(env),
62+
ubirch.get_backend_verifying_key(env, ECDSA_TYPE))
6663
elif key_type == EDDSA_TYPE:
67-
if self.__ks._ks.entries.get(ubirch.get_backend_uuid(env).hex + '_ecd', None) != None:
68-
# suffix-less pubkey found, delete it
69-
self.__ks._ks.entries.pop(ubirch.get_backend_uuid(env).hex + '_ecd')
70-
71-
self.__ks.insert_ed25519_verifying_key(ubirch.get_backend_uuid(env), ubirch.get_backend_verifying_key(env, EDDSA_TYPE))
64+
self.__ks.insert_ed25519_verifying_key(ubirch.get_backend_uuid(env),
65+
ubirch.get_backend_verifying_key(env, EDDSA_TYPE))
7266

7367
# load last signature for device
7468
self.load(uuid)

0 commit comments

Comments
 (0)