Skip to content

Commit 5e33b4f

Browse files
committed
Fix use-after-free in key derivation
1 parent e27e935 commit 5e33b4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pki.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ void pki_derive_keys(nca_keyset_t *keyset) {
891891
continue;
892892
}
893893
aes_ctx_t *mac_gen_ctx = new_aes_ctx(&keyset->keyblob_keys[i], 0x10, AES_MODE_ECB);
894-
aes_decrypt(sbk_ctx, &keyset->keyblob_mac_keys[i], keyset->keyblob_mac_key_source, 0x10);
894+
aes_decrypt(mac_gen_ctx, &keyset->keyblob_mac_keys[i], keyset->keyblob_mac_key_source, 0x10);
895895
free_aes_ctx(mac_gen_ctx);
896896
}
897897
for (unsigned int i = 0; i < 0x20; i++) {

0 commit comments

Comments
 (0)