From 88d5f62270af75eb920d26b5dad4f375a4305e0c Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:24:00 -0800 Subject: [PATCH] umu_proton: mypy lint --- umu/umu_proton.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/umu/umu_proton.py b/umu/umu_proton.py index 5fa5dfe7..2acd5a40 100644 --- a/umu/umu_proton.py +++ b/umu/umu_proton.py @@ -551,10 +551,7 @@ def _get_delta( log.debug("Acquired lock '%s'", lock.lock_file) # Validate the integrity of the embedded public key - if ( - sha512(cbor.get("public_key")).hexdigest() - not in UMU_SSH_PUBLIC_KEYS - ): + if sha512(cbor["public_key"]).hexdigest() not in UMU_SSH_PUBLIC_KEYS: # OWC maintainer forgot to add digest to whitelist, a different # public key was accidentally used or patch was created by a # 3rd party @@ -566,12 +563,11 @@ def _get_delta( # With the public key, verify the signature and data ssh_public_key = ed25519.Ed25519PublicKey.from_public_bytes( - cbor.get("public_key") + cbor["public_key"] ) try: ssh_public_key.verify( - cbor.get("signature"), - dumps(cbor.get("contents"), canonical=True), + cbor["signature"], dumps(cbor["contents"], canonical=True) ) except InvalidSignature: # Patch file data was tampered