From 10bdc2862cd23a217a3c4355b441977f9d91f6ce Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Sun, 12 Apr 2026 16:53:42 +0100 Subject: [PATCH] Additional assurance against accidental inclusion of default_keys.h --- src/core/CMakeLists.txt | 5 ++++- src/core/hw/default_keys.h | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 79ed4695a..ec7a45bfe 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -464,7 +464,6 @@ add_library(citra_core STATIC hw/aes/key.h hw/ecc.cpp hw/ecc.h - hw/default_keys.h hw/rsa/rsa.cpp hw/rsa/rsa.h hw/unique_data.cpp @@ -502,6 +501,10 @@ add_library(citra_core STATIC tracer/recorder.h ) +if (ENABLE_BUILTIN_KEYBLOB) + target_sources(citra_core PRIVATE hw/default_keys.h) +endif() + create_target_directory_groups(citra_core) target_link_libraries(citra_core PUBLIC citra_common PRIVATE audio_core network video_core) diff --git a/src/core/hw/default_keys.h b/src/core/hw/default_keys.h index 554b74ae1..c908d1564 100644 --- a/src/core/hw/default_keys.h +++ b/src/core/hw/default_keys.h @@ -2,6 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#pragma once + +#ifndef ENABLE_BUILTIN_KEYBLOB +#error Attempting to include default_keys.h, but ENABLE_BUILTIN_KEYBLOB is disabled. +#endif + unsigned char default_keys_enc[] = { 0x4E, 0x81, 0xE9, 0x54, 0xCC, 0xDE, 0xFD, 0x56, 0x7D, 0xD2, 0x72, 0xE6, 0xD9, 0xCD, 0x8E, 0x11, 0xE1, 0x7F, 0x74, 0xF4, 0xFC, 0x54, 0xA6, 0xA4, 0x27, 0xC2, 0xD7, 0x50, 0xEA, 0xE7, 0xBE, 0xC9,