From 278c0e6e8d828db86773233587f352d12cfaba5a Mon Sep 17 00:00:00 2001
From: Valeri <v19930312@gmail.com>
Date: Sun, 27 Nov 2022 05:08:25 +0300
Subject: [PATCH] crypto: use user-provided keys whenever possible

Solves an issue where autogenerated title keys would take precedence over those provided by user.
---
 src/core/crypto/key_manager.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index 443323390c..65a9fe8027 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -578,18 +578,18 @@ KeyManager::KeyManager() {
 
     if (Settings::values.use_dev_keys) {
         dev_mode = true;
-        LoadFromFile(yuzu_keys_dir / "dev.keys", false);
         LoadFromFile(yuzu_keys_dir / "dev.keys_autogenerated", false);
+        LoadFromFile(yuzu_keys_dir / "dev.keys", false);
     } else {
         dev_mode = false;
-        LoadFromFile(yuzu_keys_dir / "prod.keys", false);
         LoadFromFile(yuzu_keys_dir / "prod.keys_autogenerated", false);
+        LoadFromFile(yuzu_keys_dir / "prod.keys", false);
     }
 
-    LoadFromFile(yuzu_keys_dir / "title.keys", true);
     LoadFromFile(yuzu_keys_dir / "title.keys_autogenerated", true);
-    LoadFromFile(yuzu_keys_dir / "console.keys", false);
+    LoadFromFile(yuzu_keys_dir / "title.keys", true);
     LoadFromFile(yuzu_keys_dir / "console.keys_autogenerated", false);
+    LoadFromFile(yuzu_keys_dir / "console.keys", false);
 }
 
 static bool ValidCryptoRevisionString(std::string_view base, size_t begin, size_t length) {