makerom: fixes

Moved away from ctrtool's polarssl api completely. Brought certs.c/h
inline with code style, fixed bugs relating to tmd savedata field
generation and not recording savedata size from rsf (ncsd.c)
This commit is contained in:
applestash
2014-09-16 19:15:55 +10:00
parent b4b22944a4
commit c7c2c3f73e
12 changed files with 243 additions and 323 deletions
+14 -15
View File
@@ -2,41 +2,40 @@
typedef struct
{
u8 Issuer[0x40];
u8 KeyType[4];
u8 Name[0x40];
u8 Unknown[4];
} Cert_Struct;
u8 issuer[0x40];
u8 keyType[4];
u8 name[0x40];
u8 id[4];
} cert_hdr;
typedef struct
{
u8 Modulus[0x200];
u8 PubExponent[4];
u8 Padding[0x34];
u8 modulus[0x200];
u8 pubExponent[4];
u8 padding[0x34];
} rsa_4096_pubk_struct;
typedef struct
{
u8 Modulus[0x100];
u8 PubExponent[4];
u8 Padding[0x34];
u8 modulus[0x100];
u8 pubExponent[4];
u8 padding[0x34];
} rsa_2048_pubk_struct;
typedef struct
{
u8 PubK[0x3C];
u8 Padding[0x3C];
u8 pubK[0x3C];
u8 padding[0x3C];
} ecc_pubk_struct;
// Cert Sizes
u32 GetCertSize(u8 *cert);
void GetCertSigSectionSizes(u32 *SigSize, u32 *SigPadding, u8 *cert);
u32 GetCertPubkSectionSize(pubk_types type);
// Issuer/Name Functions
u8 *GetCertIssuer(u8 *cert);
u8 *GetCertName(u8 *cert);
int GenCertChildIssuer(u8 *dest, u8 *cert);
void GenCertChildIssuer(u8 *dest, u8 *cert);
// Pubk
pubk_types GetCertPubkType(u8 *cert);