[makerom] Relaxed support for bad signatures (-ignoresign). Warns user when something cannot be signed, instead of treating it like a fatal error.

This commit is contained in:
jakcron
2017-05-28 10:27:55 +08:00
parent 4f875b0d0b
commit 6e858be07b
9 changed files with 212 additions and 184 deletions
+19 -14
View File
@@ -31,11 +31,18 @@ typedef enum
// Structs
typedef struct
{
u8 *pub;
u8 *pvt;
} rsa2048_key;
typedef struct
{
pki_keyset keyset;
bool keysetLoaded;
bool dumpkeys;
bool ignore_sign;
struct
{
@@ -60,23 +67,16 @@ typedef struct
struct
{
bool isFalseSign;
// CIA RSA
u8 *cpPvt;
u8 *cpPub;
u8 *xsPvt;
u8 *xsPub;
rsa2048_key cp;
rsa2048_key xs;
// CCI/CFA
u8 *cciCfaPvt;
u8 *cciCfaPub;
rsa2048_key cciCfa;
// CXI
bool requiresPresignedDesc;
u8 *acexPvt;
u8 *acexPub;
u8 *cxiHdrPub;
u8 *cxiHdrPvt;
rsa2048_key acex;
rsa2048_key cxi;
} rsa;
struct
@@ -96,4 +96,9 @@ void FreeKeys(keys_struct *keys);
int SetCommonKey(keys_struct *keys, const u8 *key, u8 Index);
int SetCurrentCommonKey(keys_struct *keys, u8 Index);
int SetNormalKey(keys_struct *keys, const u8 *key);
int SetSystemFixedKey(keys_struct *keys, const u8 *key);
int SetSystemFixedKey(keys_struct *keys, const u8 *key);
void Rsa2048Key_Alloc(rsa2048_key* key);
void Rsa2048Key_Free(rsa2048_key* key);
void Rsa2048Key_Set(rsa2048_key* key, const u8* pvt, const u8* pub);
bool Rsa2048Key_CanSign(const rsa2048_key* key);