log: replace all NGLOG with LOG
This commit is contained in:
parent
fde415968e
commit
7c5a76e58b
152 changed files with 1541 additions and 1541 deletions
|
@ -46,7 +46,7 @@ public:
|
|||
std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& nonce,
|
||||
size_t slot_id) {
|
||||
if (!IsNormalKeyAvailable(slot_id)) {
|
||||
NGLOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id);
|
||||
LOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id);
|
||||
}
|
||||
const AESKey normal = GetNormalKey(slot_id);
|
||||
std::vector<u8> cipher(pdata.size() + CCM_MAC_SIZE);
|
||||
|
@ -59,7 +59,7 @@ std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& non
|
|||
new CryptoPP::AuthenticatedEncryptionFilter(
|
||||
e, new CryptoPP::ArraySink(cipher.data(), cipher.size())));
|
||||
} catch (const CryptoPP::Exception& e) {
|
||||
NGLOG_ERROR(HW_AES, "FAILED with: {}", e.what());
|
||||
LOG_ERROR(HW_AES, "FAILED with: {}", e.what());
|
||||
}
|
||||
return cipher;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ std::vector<u8> EncryptSignCCM(const std::vector<u8>& pdata, const CCMNonce& non
|
|||
std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce& nonce,
|
||||
size_t slot_id) {
|
||||
if (!IsNormalKeyAvailable(slot_id)) {
|
||||
NGLOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id);
|
||||
LOG_ERROR(HW_AES, "Key slot {} not available. Will use zero key.", slot_id);
|
||||
}
|
||||
const AESKey normal = GetNormalKey(slot_id);
|
||||
const std::size_t pdata_size = cipher.size() - CCM_MAC_SIZE;
|
||||
|
@ -81,11 +81,11 @@ std::vector<u8> DecryptVerifyCCM(const std::vector<u8>& cipher, const CCMNonce&
|
|||
d, new CryptoPP::ArraySink(pdata.data(), pdata_size));
|
||||
CryptoPP::ArraySource as(cipher.data(), cipher.size(), true, new CryptoPP::Redirector(df));
|
||||
if (!df.GetLastResult()) {
|
||||
NGLOG_ERROR(HW_AES, "FAILED");
|
||||
LOG_ERROR(HW_AES, "FAILED");
|
||||
return {};
|
||||
}
|
||||
} catch (const CryptoPP::Exception& e) {
|
||||
NGLOG_ERROR(HW_AES, "FAILED with: {}", e.what());
|
||||
LOG_ERROR(HW_AES, "FAILED with: {}", e.what());
|
||||
return {};
|
||||
}
|
||||
return pdata;
|
||||
|
|
|
@ -91,7 +91,7 @@ void LoadPresetKeys() {
|
|||
std::vector<std::string> parts;
|
||||
Common::SplitString(line, '=', parts);
|
||||
if (parts.size() != 2) {
|
||||
NGLOG_ERROR(HW_AES, "Failed to parse {}", line);
|
||||
LOG_ERROR(HW_AES, "Failed to parse {}", line);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ void LoadPresetKeys() {
|
|||
try {
|
||||
key = HexToKey(parts[1]);
|
||||
} catch (const std::logic_error& e) {
|
||||
NGLOG_ERROR(HW_AES, "Invalid key {}: {}", parts[1], e.what());
|
||||
LOG_ERROR(HW_AES, "Invalid key {}: {}", parts[1], e.what());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -112,12 +112,12 @@ void LoadPresetKeys() {
|
|||
size_t slot_id;
|
||||
char key_type;
|
||||
if (std::sscanf(name.c_str(), "slot0x%zXKey%c", &slot_id, &key_type) != 2) {
|
||||
NGLOG_ERROR(HW_AES, "Invalid key name {}", name);
|
||||
LOG_ERROR(HW_AES, "Invalid key name {}", name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (slot_id >= MaxKeySlotID) {
|
||||
NGLOG_ERROR(HW_AES, "Out of range slot ID {:#X}", slot_id);
|
||||
LOG_ERROR(HW_AES, "Out of range slot ID {:#X}", slot_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ void LoadPresetKeys() {
|
|||
key_slots.at(slot_id).SetNormalKey(key);
|
||||
break;
|
||||
default:
|
||||
NGLOG_ERROR(HW_AES, "Invalid key type {}", key_type);
|
||||
LOG_ERROR(HW_AES, "Invalid key type {}", key_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue