Skip to content

Commit 9a207b1

Browse files
committed
fix(espsecure): Allow verifying multiple appended ECDSA signatures
- Also extend espsecure's test coverage Closes #1120
1 parent 70afbaa commit 9a207b1

15 files changed

+99
-47
lines changed

espsecure/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,10 +961,7 @@ def verify_signature_v2(hsm: bool, hsm_config: IO | None, keyfile: IO, datafile:
961961

962962
vk = _get_sbv2_pub_key(keyfile)
963963

964-
if isinstance(vk, rsa.RSAPublicKey):
965-
SIG_BLOCK_MAX_COUNT = 3
966-
elif isinstance(vk, ec.EllipticCurvePublicKey):
967-
SIG_BLOCK_MAX_COUNT = 1
964+
SIG_BLOCK_MAX_COUNT = 3
968965

969966
image_content = datafile.read()
970967
if len(image_content) < SECTOR_SIZE or len(image_content) % SECTOR_SIZE != 0:
36 KB
Binary file not shown.
36 KB
Binary file not shown.
36 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-----BEGIN EC PRIVATE KEY-----
2+
MF8CAQEEGMNCl8ezjmYsLgClrXr11O4zcAJPOD5s46AKBggqhkjOPQMBAaE0AzIA
3+
BJ0AKQaLfGs+4KXlAWkzmKj6e5S5LC4Vso1Nci6kserCSI3E7aMVZFBFVq+DDmpq
4+
NA==
5+
-----END EC PRIVATE KEY-----
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-----BEGIN EC PRIVATE KEY-----
2+
MF8CAQEEGGn2EFibrTQ6K5txb+qsxnmxY1+yfpMzj6AKBggqhkjOPQMBAaE0AzIA
3+
BK+3nF0EbI8U0HBwuuWMTyGDmJbZEeFA4RKhZS1ilj9QsNrJpOHamUeLBfA4aUoQ
4+
iA==
5+
-----END EC PRIVATE KEY-----
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-----BEGIN PUBLIC KEY-----
2+
MEkwEwYHKoZIzj0CAQYIKoZIzj0DAQEDMgAEr7ecXQRsjxTQcHC65YxPIYOYltkR
3+
4UDhEqFlLWKWP1Cw2smk4dqZR4sF8DhpShCI
4+
-----END PUBLIC KEY-----
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-----BEGIN EC PRIVATE KEY-----
2+
MHcCAQEEIFHb2ZMfsoHXdQ82DH7QGrSh4wAum3AIag7Djz6AnRIpoAoGCCqGSM49
3+
AwEHoUQDQgAERNsudNrhGfWCohrfa5G+nAMBQKsOzxGSBBEqt+134cLjAJ1ForgZ
4+
hHS8Q+cYsPclzWLnEX+nhQUwR0S8/j5Z7g==
5+
-----END EC PRIVATE KEY-----
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-----BEGIN EC PRIVATE KEY-----
2+
MHcCAQEEIMxQzaSw+tTrzqKp6y4uKVaZ1HMifC7JzbOgbi7vyLqaoAoGCCqGSM49
3+
AwEHoUQDQgAEUqcYbO3Ag8ab8JDLCsmVVHTedB+KB+/Q8Q4frS7pvBjslHwWmumD
4+
Ca0enIGhfWRaQ1VePe6NP0ZKFB+n0DLyjQ==
5+
-----END EC PRIVATE KEY-----

0 commit comments

Comments
 (0)