Skip to content

Commit

Permalink
Fix use-after-free in key derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
SciresM committed Apr 27, 2018
1 parent e27e935 commit 5e33b4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pki.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ void pki_derive_keys(nca_keyset_t *keyset) {
continue;
}
aes_ctx_t *mac_gen_ctx = new_aes_ctx(&keyset->keyblob_keys[i], 0x10, AES_MODE_ECB);
aes_decrypt(sbk_ctx, &keyset->keyblob_mac_keys[i], keyset->keyblob_mac_key_source, 0x10);
aes_decrypt(mac_gen_ctx, &keyset->keyblob_mac_keys[i], keyset->keyblob_mac_key_source, 0x10);
free_aes_ctx(mac_gen_ctx);
}
for (unsigned int i = 0; i < 0x20; i++) {
Expand Down

0 comments on commit 5e33b4f

Please sign in to comment.