mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-06 04:01:44 +00:00
exosphere: correct reencryption of rsa private keys
This commit is contained in:
parent
524da78b0e
commit
7bc0250cea
1 changed files with 15 additions and 13 deletions
|
@ -205,10 +205,12 @@ void gcm_encrypt_key(void *dst, size_t dst_size, const void *src, size_t src_siz
|
||||||
se_generate_random(KEYSLOT_SWITCH_RNGKEY, intermediate_buf, 0x10);
|
se_generate_random(KEYSLOT_SWITCH_RNGKEY, intermediate_buf, 0x10);
|
||||||
flush_dcache_range(intermediate_buf, intermediate_buf + 0x10);
|
flush_dcache_range(intermediate_buf, intermediate_buf + 0x10);
|
||||||
|
|
||||||
|
/* Copy in the src. */
|
||||||
|
memcpy(intermediate_buf + 0x10, src, src_size);
|
||||||
|
|
||||||
/* Write Device ID. */
|
/* Write Device ID. */
|
||||||
write64be(intermediate_buf, src_size + 0x18, fuse_get_device_id() | (deviceid_high << 56));
|
write64be(intermediate_buf, src_size + 0x18, fuse_get_device_id() | (deviceid_high << 56));
|
||||||
|
|
||||||
|
|
||||||
/* J = GHASH(CTR); */
|
/* J = GHASH(CTR); */
|
||||||
uint8_t j_block[0x10];
|
uint8_t j_block[0x10];
|
||||||
ghash(j_block, intermediate_buf, 0x10, NULL, false);
|
ghash(j_block, intermediate_buf, 0x10, NULL, false);
|
||||||
|
|
Loading…
Reference in a new issue