Closed Bug 1055010 Opened 10 years ago Closed 10 years ago

dumpkey.py outputs everything as version 1

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.1 fixed)

RESOLVED FIXED
2.1 S3 (29aug)
Tracking Status
b2g-v2.1 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

Details

Attachments

(2 files)

dumpkey.py was introduced in bug 904517, but where android's dumpkey.jar supports 4 different key versions, dumpkey.py's output only conforms to version 1. I had a case where recovery could not verify the update package. I was then using a version 2 key, but the output from dumpkey.py did not include the "v2 " prefix necessary to identify the correct version. It was instead interpreted as a version 1 key. From DumpPublicKey.java: --- /** * @param key to perform sanity checks on * @return version number of key. Supported versions are: * 1: 2048-bit RSA key with e=3 and SHA-1 hash * 2: 2048-bit RSA key with e=65537 and SHA-1 hash * 3: 2048-bit RSA key with e=3 and SHA-256 hash * 4: 2048-bit RSA key with e=65537 and SHA-256 hash * @throws Exception if the key has the wrong size or public exponent */ static int checkRSA(RSAPublicKey key, boolean useSHA256) throws Exception { --- We could implement something similar.
Assignee: nobody → pehrsons
Depends on: 904517
Adds a function to check the key version. Either returns the version, or None if unsupported. Then outputs the version as expected by recovery. Tested on version 1 and 2 keys.
Attachment #8474560 - Flags: review?(mwu)
Attachment #8474560 - Flags: feedback?(kli)
DumpPublicKey.java for Jellybean only supports version 1 and 2, however here I just cherry-picked the 4.4 commit.
Attachment #8474563 - Flags: review?(mwu)
Attachment #8474563 - Flags: feedback?(kli)
I just updated the PRs with improved error handling. In case anyone just had a look you might want to reload.
Hey Marshall, would you be able to review this? This looks like code you originally wrote. Can find someone else if you prefer, though. Thanks!
Flags: needinfo?(marshall)
Comment on attachment 8474563 [details] [review] [JB 4.3] dumpkey.py: support key versions 1,2,3,4 some minor nits, but overall it looks good
Attachment #8474563 - Flags: review?(mwu) → review+
Flags: needinfo?(marshall)
Attachment #8474560 - Flags: review?(mwu) → review+
Comment on attachment 8474560 [details] [review] [KK 4.4] dumpkey.py: support key versions 1,2,3,4 It is better to support 4 different key veraion. Andreas, Thanks for you input!
Attachment #8474560 - Flags: feedback?(kli) → feedback+
Attachment #8474563 - Flags: feedback?(kli) → feedback+
Thanks guys. Nits fixed and PRs updated.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 2.1 S3 (29aug)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: