From 21db90bae99ddc28e76fa7569f0de72856a9336b Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Fri, 26 Apr 2019 02:32:23 -0700 Subject: [PATCH] spl: make ssl key decryption work on >= 5.0.0 --- stratosphere/spl/source/spl_rsa_service.cpp | 6 +++++- stratosphere/spl/source/spl_rsa_service.hpp | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stratosphere/spl/source/spl_rsa_service.cpp b/stratosphere/spl/source/spl_rsa_service.cpp index 23849b9de..348edae79 100644 --- a/stratosphere/spl/source/spl_rsa_service.cpp +++ b/stratosphere/spl/source/spl_rsa_service.cpp @@ -19,6 +19,10 @@ #include "spl_rsa_service.hpp" -Result RsaService::DecryptRsaPrivateKey(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source, u32 option) { +Result RsaService::DecryptRsaPrivateKeyDeprecated(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source, u32 option) { return this->GetSecureMonitorWrapper()->DecryptRsaPrivateKey(dst.pointer, dst.num_elements, src.pointer, src.num_elements, access_key, key_source, option); +} + +Result RsaService::DecryptRsaPrivateKey(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source) { + return this->GetSecureMonitorWrapper()->DecryptRsaPrivateKey(dst.pointer, dst.num_elements, src.pointer, src.num_elements, access_key, key_source, SmcDecryptOrImportMode_DecryptRsaPrivateKey); } \ No newline at end of file diff --git a/stratosphere/spl/source/spl_rsa_service.hpp b/stratosphere/spl/source/spl_rsa_service.hpp index 6e9b2471e..97e467cca 100644 --- a/stratosphere/spl/source/spl_rsa_service.hpp +++ b/stratosphere/spl/source/spl_rsa_service.hpp @@ -32,7 +32,8 @@ class RsaService : public CryptoService { } protected: /* Actual commands. */ - virtual Result DecryptRsaPrivateKey(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source, u32 option); + virtual Result DecryptRsaPrivateKeyDeprecated(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source, u32 option); + virtual Result DecryptRsaPrivateKey(OutPointerWithClientSize dst, InPointer src, AccessKey access_key, KeySource key_source); public: DEFINE_SERVICE_DISPATCH_TABLE { MakeServiceCommandMetaEx(), @@ -51,7 +52,8 @@ class RsaService : public CryptoService { MakeServiceCommandMetaEx(), MakeServiceCommandMetaEx(), MakeServiceCommandMetaEx(), - MakeServiceCommandMetaEx(), + MakeServiceCommandMetaEx(), + MakeServiceCommandMetaEx(), }; };