mirror of
https://github.com/diamante0018/MW3ServerFreezer.git
synced 2025-04-19 19:52:53 +00:00
fix comp?
This commit is contained in:
parent
47c1b02b85
commit
2cea0ff173
@ -15,7 +15,6 @@ bool load_key(utils::cryptography::ecc::key& key) {
|
||||
|
||||
key.deserialize(data);
|
||||
if (!key.is_valid()) {
|
||||
console::info("Loaded key is invalid!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -32,14 +31,12 @@ utils::cryptography::ecc::key generate_key() {
|
||||
throw std::runtime_error("Failed to write server key!");
|
||||
}
|
||||
|
||||
console::info("Generated cryptographic key: {}", key.get_hash());
|
||||
return key;
|
||||
}
|
||||
|
||||
utils::cryptography::ecc::key load_or_generate_key() {
|
||||
utils::cryptography::ecc::key key{};
|
||||
if (load_key(key)) {
|
||||
console::info("Loaded cryptographic key: {}", key.get_hash());
|
||||
return key;
|
||||
}
|
||||
|
||||
@ -51,6 +48,7 @@ utils::cryptography::ecc::key get_key_internal() {
|
||||
if (!utils::io::write_file("./public.key", key.get_public_key())) {
|
||||
console::info("Failed to write public key!");
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
} // namespace
|
||||
|
Loading…
x
Reference in New Issue
Block a user