Fix race in Crypto/unedat.cpp, Make NPDRM keys usage atomic

This commit is contained in:
Eladash 2020-06-20 14:12:19 +03:00 committed by Ani
parent 97717defa5
commit 2483cc6f8d
13 changed files with 91 additions and 136 deletions

View file

@ -3,6 +3,7 @@
#include "sha1.h"
#include "utils.h"
#include "unself.h"
#include "Utilities/BEType.h"
#include "Emu/VFS.h"
#include "Emu/System.h"
@ -1483,9 +1484,7 @@ bool verify_npdrm_self_headers(const fs::file& self, u8* klic_key)
return true;
}
std::array<u8, 0x10> get_default_self_klic()
v128 get_default_self_klic()
{
std::array<u8, 0x10> key;
std::copy(std::begin(NP_KLIC_FREE), std::end(NP_KLIC_FREE), std::begin(key));
return key;
return std::bit_cast<v128>(NP_KLIC_FREE);
}