1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-19 00:29:03 +00:00

style(python): use explicit keyword arguments

This commit is contained in:
Ondřej Vejpustek 2025-04-02 19:45:03 +02:00
parent c0660ef34e
commit cc188f31d4
2 changed files with 20 additions and 20 deletions

View File

@ -249,11 +249,11 @@ def get_ownership_proof_common(
# This function verifies that the signature includes the host's entropy and that its s value is less than half of the curve's order. However, it does not verify the signature itself, as trezorlib doesn't have the digest. The verification of the signature is the caller's responsibility.
if not verify(
None,
res.signature,
None,
entropy,
nonce_commitment,
public_key=None,
signature=res.signature,
digest=None,
entropy=entropy,
nonce_commitment=nonce_commitment,
):
# This is a violation of the anti-exfil protocol.
raise ValueError("Invalid signature")
@ -485,11 +485,11 @@ def sign_tx_common(
)
# This function verifies that the signature includes the host's entropy and that its s value is less than half of the curve's order. However, it does not verify the signature itself, as trezorlib doesn't have the digest. The verification of the signature is the caller's responsibility.
if not verify(
None,
sig,
None,
entropy_list[idx],
nonce_commitment,
public_key=None,
signature=sig,
digest=None,
entropy=entropy_list[idx],
nonce_commitment=nonce_commitment,
):
# This is a violation of the anti-exfil protocol.
raise ValueError(f"Invalid signature for index {idx}")

View File

@ -268,11 +268,11 @@ def sign_tx_common(
# This function verifies that the signature includes the host's entropy and that its s value is less than half of the curve's order. However, it does not verify the signature itself, as trezorlib doesn't have the digest. The verification of the signature is the caller's responsibility.
if nonce_commitment is None or not verify(
None,
response.signature_r + response.signature_s,
None,
entropy,
nonce_commitment,
public_key=None,
signature=response.signature_r + response.signature_s,
digest=None,
entropy=entropy,
nonce_commitment=nonce_commitment,
):
# This is a violation of the anti-exfil protocol.
raise exceptions.TrezorException("Invalid signature")
@ -446,11 +446,11 @@ def sign_tx_eip1559_common(
# This function verifies that the signature includes the host's entropy and that its s value is less than half of the curve's order. However, it does not verify the signature itself, as trezorlib doesn't have the digest. The verification of the signature is the caller's responsibility.
if nonce_commitment is None or not verify(
None,
response.signature_r + response.signature_s,
None,
entropy,
nonce_commitment,
public_key=None,
signature=response.signature_r + response.signature_s,
digest=None,
entropy=entropy,
nonce_commitment=nonce_commitment,
):
# This is a violation of the anti-exfil protocol.
raise exceptions.TrezorException("Invalid signature")