mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
The AVB 1.0 BootSignature format comes from AOSP's BootSignature.java, which signs and verifies with Java's SHA256withECDSA family. Those produce and expect ASN.1 DER encoded (r, s) signatures. magiskboot wrote and parsed the fixed width r || s form instead. An image signed by AOSP with an EC key was therefore not recognized by `magiskboot verify` (nor flagged AVB1_SIGNED by unpack), and an image signed by `magiskboot sign-avb1` with an EC key was rejected by AOSP's verifier with "Invalid encoding for signature". Encode and decode ECDSA signatures as DER. RSA is unchanged. Assisted-by: Claude Opus 5.5