fix(parser): handle raw SeedPGP payloads without prefix

Modifies the frame parsing logic to accommodate Base45-encoded SeedPGP payloads that are missing the 'SEEDPGP1:' prefix and CRC. This scenario occurs with certain QR code generators, such as some modes on Krux devices.

- `frameParse` now detects when the prefix is missing and treats the entire input as a raw Base45 payload.
- A `rawPayload` flag is added to the `ParsedSeedPgpFrame` type to signal this case.
- `frameDecodeToPgpBytes` now bypasses the CRC check when this flag is true, allowing the decryption to proceed.
- This resolves a bug where valid encrypted payloads were being rejected due to a missing frame structure.
This commit is contained in:
LC mac
2026-02-04 13:22:19 +08:00
parent 26fb4ca92e
commit e8b0085689
2 changed files with 25 additions and 15 deletions

View File

@@ -11,6 +11,7 @@ export type ParsedSeedPgpFrame = {
kind: "single";
crc16: string;
b45: string;
rawPayload?: boolean;
};
// Krux KEF types