Skip to content

Conversation

@k9ert
Copy link
Contributor

@k9ert k9ert commented Oct 16, 2025

This is adding two scripts which can introspect the release binaries for signatures (upgrade) and keys (initial).

(.env-bootloader-check) ➜  bootloader git:(kn/introspect_scripts) ✗ python3 tools/introspect-binary.py --type upgrade /Users/k9ert/Downloads/specter_upgrade_v1.9.0.bin
📋 Loaded keys from: /Users/kim/src/specter-diy.old/bootloader/tools/../keys/production/pubkeys.c
   Vendor keys: 5
   Maintainer keys: 5

📦 Upgrade file analysis:
   Payload sections: 1
   Type: Main Firmware
   Required signatures: 1
   Message hash: 1.9.0-1wu5ml3hcutqw2tz6n628anrmap2m2mhfq9cta7av7slju27pmd8q4ynvhr

🔐 Signature analysis:
   Found 2 signature(s)

🔐 Signature verification:
   ✅ maintainer (Backup_m/99h): 7c5de6a71d2abae563945e05d767626a
   ✅ maintainer (Stepan): 33793141d1557bc6b4249e0be8ef6b46

✅ Threshold verification:
   Valid signatures: 2/1
   Signed by: Backup_m/99h(maintainer), Stepan(maintainer)
   Result: Upgrade file is valid and can be installed
(.env-bootloader-check) ➜  bootloader git:(kn/introspect_scripts) ✗ python3 tools/introspect-binary.py --type initial /Users/k9ert/Downloads/initial_firmware_v1.9.0.bin 
📋 Loaded keys from: /Users/kim/src/specter-diy.old/bootloader/tools/../keys/production/pubkeys.c
   Vendor keys: 5
   Maintainer keys: 5

📦 Initial firmware analysis:
   Binary size: 1966048 bytes
✅ Found ICR (Integrity Check Record)
   ICR structure revision: 1

� Public key analysis:
   Searching for embedded keys...
   Found 5 embedded public keys:
   ✅ Mike (maintainer/vendor): cf0239e7708148c0fe2bc1ff485d950e
   ✅ Stepan (maintainer/vendor): 33793141d1557bc6b4249e0be8ef6b46
   ✅ Ben (maintainer/vendor): 778c17a7aeb4cb013998a23eeb575361
   ✅ Moritz (maintainer/vendor): d07b3402987d8d722686995f98497401
   ✅ Backup_m/99h (maintainer/vendor): 7c5de6a71d2abae563945e05d767626a

✅ Key verification:
   Result: Initial firmware contains the public keys needed for upgrade verification
(.env-bootloader-check) ➜  bootloader git:(kn/introspect_scripts) ✗

After upgrading cryptography, this is now working oob.

@miketlk
Copy link
Contributor

miketlk commented Oct 16, 2025

I think it would have been needed to upgrade cryptography a long time ago.
Maybe adjust requirements.txt?

@k9ert
Copy link
Contributor Author

k9ert commented Oct 22, 2025

Done! Should work now oob.

tests are also working.

(.env) ➜  tools git:(kn/update_cryptography) ✗ pytest                                    
========================================= test session starts ==========================================
platform darwin -- Python 3.9.23, pytest-7.2.0, pluggy-0.13.1
rootdir: /Users/kim/pubsrc/specter-bootloader/tools, configfile: pytest.ini
plugins: cov-2.10.0
collected 42 items                                                                                     

bech32/segwit_addr_test.py .....                                                                 [ 11%]
core/blsection_test.py ...........................                                               [ 76%]
core/integritychk_test.py .                                                                      [ 78%]
core/memmap_test.py .                                                                            [ 80%]
core/recovery_test.py .                                                                          [ 83%]
core/signature_test.py .......                                                                   [100%]

========================================== 42 passed in 0.60s ==========================================
(.env) ➜  tools git:(kn/update_cryptography) ✗

@k9ert k9ert marked this pull request as ready for review October 22, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants