Changes

Jump to navigation Jump to search
→‎Technical explanation: renaming in the code, and left a marker where the bug is (I also almost fixed the signing bug in that code, oops)
};
struct tmd tmdview {
char issuer[0x40];
// more metadata...
}
struct signed_tmd tmd {
struct rsa_cert cert;
struct tmd tmdtmdview view;
}
int verify_tmd (struct signed_tmd tmd stmd) {
char decrypted_sig[256] = RSA_DecryptSig(CA_public_key, stmd.cert.rsa_signature);
char sig_hash = decrypted_sig[256-SHA1_LENGTH:256];
char payload_hash[SHA1_LENGTH] = SHA1(stmd.tmdview);
if (strncmp(payload_hash, sig_hash, SHA1_LENGTH) == 0) {// bug here!
return SIG_OK;
} else {
}
int is_a_valid_disc(struct signed_tmd tmd stmd, char *disc_hash) {
if(verify_tmd(stmd) == SIG_BAD) {
return DISC_BAD;
}
if(memcmp(stmd.tmdview.content_hash, disc_hash, SHA1_LENGTH) != 0) {
return DISC_BAD;
}

Navigation menu