ams: globally prefer R_RETURN to return for ams::Result
This commit is contained in:
@@ -30,35 +30,35 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result GenerateAesKek(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation, u32 option) {
|
||||
return m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option);
|
||||
R_RETURN(m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option));
|
||||
}
|
||||
|
||||
Result LoadAesKey(s32 keyslot, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.LoadAesKey(keyslot, this, access_key, key_source);
|
||||
R_RETURN(m_manager.LoadAesKey(keyslot, this, access_key, key_source));
|
||||
}
|
||||
|
||||
Result GenerateAesKey(sf::Out<AesKey> out_key, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source);
|
||||
R_RETURN(m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source));
|
||||
}
|
||||
|
||||
Result DecryptAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 option) {
|
||||
return m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option);
|
||||
R_RETURN(m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option));
|
||||
}
|
||||
|
||||
Result ComputeCtr(const sf::OutNonSecureBuffer &out_buf, s32 keyslot, const sf::InNonSecureBuffer &in_buf, IvCtr iv_ctr) {
|
||||
return m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr);
|
||||
R_RETURN(m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr));
|
||||
}
|
||||
|
||||
Result ComputeCmac(sf::Out<Cmac> out_cmac, s32 keyslot, const sf::InPointerBuffer &in_buf) {
|
||||
return m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize());
|
||||
R_RETURN(m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize()));
|
||||
}
|
||||
|
||||
Result AllocateAesKeySlot(sf::Out<s32> out_keyslot) {
|
||||
return m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this);
|
||||
R_RETURN(m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this));
|
||||
}
|
||||
|
||||
Result DeallocateAesKeySlot(s32 keyslot) {
|
||||
return m_manager.DeallocateAesKeySlot(keyslot, this);
|
||||
R_RETURN(m_manager.DeallocateAesKeySlot(keyslot, this));
|
||||
}
|
||||
|
||||
Result GetAesKeySlotAvailableEvent(sf::OutCopyHandle out_hnd) {
|
||||
|
||||
@@ -32,99 +32,99 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result GetConfig(sf::Out<u64> out, u32 which) {
|
||||
return m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(which));
|
||||
R_RETURN(m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(which)));
|
||||
}
|
||||
|
||||
Result ModularExponentiate(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod) {
|
||||
return m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize());
|
||||
R_RETURN(m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize()));
|
||||
}
|
||||
|
||||
Result GenerateAesKek(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation, u32 option) {
|
||||
return m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option);
|
||||
R_RETURN(m_manager.GenerateAesKek(out_access_key.GetPointer(), key_source, generation, option));
|
||||
}
|
||||
|
||||
Result LoadAesKey(s32 keyslot, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.LoadAesKey(keyslot, this, access_key, key_source);
|
||||
R_RETURN(m_manager.LoadAesKey(keyslot, this, access_key, key_source));
|
||||
}
|
||||
|
||||
Result GenerateAesKey(sf::Out<AesKey> out_key, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source);
|
||||
R_RETURN(m_manager.GenerateAesKey(out_key.GetPointer(), access_key, key_source));
|
||||
}
|
||||
|
||||
Result SetConfig(u32 which, u64 value) {
|
||||
return m_manager.SetConfig(static_cast<spl::ConfigItem>(which), value);
|
||||
R_RETURN(m_manager.SetConfig(static_cast<spl::ConfigItem>(which), value));
|
||||
}
|
||||
|
||||
Result GenerateRandomBytes(const sf::OutPointerBuffer &out) {
|
||||
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
|
||||
R_RETURN(m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize()));
|
||||
}
|
||||
|
||||
Result DecryptAndStoreGcKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
|
||||
return m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
|
||||
R_RETURN(m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result DecryptGcMessage(sf::Out<u32> out_size, const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest) {
|
||||
return m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize());
|
||||
R_RETURN(m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize()));
|
||||
}
|
||||
|
||||
Result IsDevelopment(sf::Out<bool> is_dev) {
|
||||
return m_manager.IsDevelopment(is_dev.GetPointer());
|
||||
R_RETURN(m_manager.IsDevelopment(is_dev.GetPointer()));
|
||||
}
|
||||
|
||||
Result GenerateSpecificAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 which) {
|
||||
return m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which);
|
||||
R_RETURN(m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which));
|
||||
}
|
||||
|
||||
Result DecryptDeviceUniqueData(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
|
||||
return m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option);
|
||||
R_RETURN(m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result DecryptAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 option) {
|
||||
return m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option);
|
||||
R_RETURN(m_manager.DecryptAesKey(out_key.GetPointer(), key_source, generation, option));
|
||||
}
|
||||
|
||||
Result ComputeCtrDeprecated(const sf::OutBuffer &out_buf, s32 keyslot, const sf::InBuffer &in_buf, IvCtr iv_ctr) {
|
||||
return m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr);
|
||||
R_RETURN(m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr));
|
||||
}
|
||||
|
||||
Result ComputeCtr(const sf::OutNonSecureBuffer &out_buf, s32 keyslot, const sf::InNonSecureBuffer &in_buf, IvCtr iv_ctr) {
|
||||
return m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr);
|
||||
R_RETURN(m_manager.ComputeCtr(out_buf.GetPointer(), out_buf.GetSize(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize(), iv_ctr));
|
||||
}
|
||||
|
||||
Result ComputeCmac(sf::Out<Cmac> out_cmac, s32 keyslot, const sf::InPointerBuffer &in_buf) {
|
||||
return m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize());
|
||||
R_RETURN(m_manager.ComputeCmac(out_cmac.GetPointer(), keyslot, this, in_buf.GetPointer(), in_buf.GetSize()));
|
||||
}
|
||||
|
||||
Result LoadEsDeviceKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
|
||||
return m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
|
||||
R_RETURN(m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result PrepareEsTitleKeyDeprecated(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest) {
|
||||
return m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), 0);
|
||||
R_RETURN(m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), 0));
|
||||
}
|
||||
|
||||
Result PrepareEsTitleKey(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest, u32 generation) {
|
||||
return m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation);
|
||||
R_RETURN(m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation));
|
||||
}
|
||||
|
||||
Result LoadPreparedAesKey(s32 keyslot, AccessKey access_key) {
|
||||
return m_manager.LoadPreparedAesKey(keyslot, this, access_key);
|
||||
R_RETURN(m_manager.LoadPreparedAesKey(keyslot, this, access_key));
|
||||
}
|
||||
|
||||
Result PrepareCommonEsTitleKeyDeprecated(sf::Out<AccessKey> out_access_key, KeySource key_source) {
|
||||
return m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, 0);
|
||||
R_RETURN(m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, 0));
|
||||
}
|
||||
|
||||
Result PrepareCommonEsTitleKey(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation) {
|
||||
return m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation);
|
||||
R_RETURN(m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation));
|
||||
}
|
||||
|
||||
Result AllocateAesKeySlot(sf::Out<s32> out_keyslot) {
|
||||
return m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this);
|
||||
R_RETURN(m_manager.AllocateAesKeySlot(out_keyslot.GetPointer(), this));
|
||||
}
|
||||
|
||||
Result DeallocateAesKeySlot(s32 keyslot) {
|
||||
return m_manager.DeallocateAesKeySlot(keyslot, this);
|
||||
R_RETURN(m_manager.DeallocateAesKeySlot(keyslot, this));
|
||||
}
|
||||
|
||||
Result GetAesKeySlotAvailableEvent(sf::OutCopyHandle out_hnd) {
|
||||
@@ -133,11 +133,11 @@ namespace ams::spl {
|
||||
}
|
||||
|
||||
Result SetBootReason(BootReasonValue boot_reason) {
|
||||
return m_manager.SetBootReason(boot_reason);
|
||||
R_RETURN(m_manager.SetBootReason(boot_reason));
|
||||
}
|
||||
|
||||
Result GetBootReason(sf::Out<BootReasonValue> out) {
|
||||
return m_manager.GetBootReason(out.GetPointer());
|
||||
R_RETURN(m_manager.GetBootReason(out.GetPointer()));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIDeprecatedGeneralInterface<DeprecatedService>);
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result DecryptDeviceUniqueDataDeprecated(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
|
||||
return m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option);
|
||||
R_RETURN(m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result DecryptDeviceUniqueData(const sf::OutPointerBuffer &dst, const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptDeviceUniqueData));
|
||||
R_RETURN(m_manager.DecryptDeviceUniqueData(dst.GetPointer(), dst.GetSize(), src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptDeviceUniqueData)));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIDeviceUniqueDataInterface<DeviceUniqueDataService>);
|
||||
|
||||
@@ -25,35 +25,35 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result LoadEsDeviceKeyDeprecated(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
|
||||
return m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
|
||||
R_RETURN(m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result LoadEsDeviceKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreEsDeviceKey));
|
||||
R_RETURN(m_manager.LoadEsDeviceKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreEsDeviceKey)));
|
||||
}
|
||||
|
||||
Result PrepareEsTitleKey(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest, u32 generation) {
|
||||
return m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation);
|
||||
R_RETURN(m_manager.PrepareEsTitleKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation));
|
||||
}
|
||||
|
||||
Result PrepareCommonEsTitleKey(sf::Out<AccessKey> out_access_key, KeySource key_source, u32 generation) {
|
||||
return m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation);
|
||||
R_RETURN(m_manager.PrepareCommonEsTitleKey(out_access_key.GetPointer(), key_source, generation));
|
||||
}
|
||||
|
||||
Result DecryptAndStoreDrmDeviceCertKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.DecryptAndStoreDrmDeviceCertKey(src.GetPointer(), src.GetSize(), access_key, key_source);
|
||||
R_RETURN(m_manager.DecryptAndStoreDrmDeviceCertKey(src.GetPointer(), src.GetSize(), access_key, key_source));
|
||||
}
|
||||
|
||||
Result ModularExponentiateWithDrmDeviceCertKey(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod) {
|
||||
return m_manager.ModularExponentiateWithDrmDeviceCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize());
|
||||
R_RETURN(m_manager.ModularExponentiateWithDrmDeviceCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize()));
|
||||
}
|
||||
|
||||
Result PrepareEsArchiveKey(sf::Out<AccessKey> out_access_key, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest, u32 generation) {
|
||||
return m_manager.PrepareEsArchiveKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation);
|
||||
R_RETURN(m_manager.PrepareEsArchiveKey(out_access_key.GetPointer(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize(), generation));
|
||||
}
|
||||
|
||||
Result LoadPreparedAesKey(s32 keyslot, AccessKey access_key) {
|
||||
return m_manager.LoadPreparedAesKey(keyslot, this, access_key);
|
||||
R_RETURN(m_manager.LoadPreparedAesKey(keyslot, this, access_key));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIEsInterface<EsService>);
|
||||
|
||||
@@ -25,27 +25,27 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result DecryptAndStoreGcKeyDeprecated(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source, u32 option) {
|
||||
return m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option);
|
||||
R_RETURN(m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result DecryptAndStoreGcKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreGcKey));
|
||||
R_RETURN(m_manager.DecryptAndStoreGcKey(src.GetPointer(), src.GetSize(), access_key, key_source, static_cast<u32>(smc::DeviceUniqueDataMode::DecryptAndStoreGcKey)));
|
||||
}
|
||||
|
||||
Result DecryptGcMessage(sf::Out<u32> out_size, const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod, const sf::InPointerBuffer &label_digest) {
|
||||
return m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize());
|
||||
R_RETURN(m_manager.DecryptGcMessage(out_size.GetPointer(), out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize(), label_digest.GetPointer(), label_digest.GetSize()));
|
||||
}
|
||||
|
||||
Result GenerateSpecificAesKey(sf::Out<AesKey> out_key, KeySource key_source, u32 generation, u32 which) {
|
||||
return m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which);
|
||||
R_RETURN(m_manager.GenerateSpecificAesKey(out_key.GetPointer(), key_source, generation, which));
|
||||
}
|
||||
|
||||
Result LoadPreparedAesKey(s32 keyslot, AccessKey access_key) {
|
||||
return m_manager.LoadPreparedAesKey(keyslot, this, access_key);
|
||||
R_RETURN(m_manager.LoadPreparedAesKey(keyslot, this, access_key));
|
||||
}
|
||||
|
||||
Result GetPackage2Hash(const sf::OutPointerBuffer &dst) {
|
||||
return m_manager.GetPackage2Hash(dst.GetPointer(), dst.GetSize());
|
||||
R_RETURN(m_manager.GetPackage2Hash(dst.GetPointer(), dst.GetSize()));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIFsInterface<FsService>);
|
||||
|
||||
@@ -27,31 +27,31 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result GetConfig(sf::Out<u64> out, u32 key) {
|
||||
return m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(key));
|
||||
R_RETURN(m_manager.GetConfig(out.GetPointer(), static_cast<spl::ConfigItem>(key)));
|
||||
}
|
||||
|
||||
Result ModularExponentiate(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &exp, const sf::InPointerBuffer &mod) {
|
||||
return m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize());
|
||||
R_RETURN(m_manager.ModularExponentiate(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), exp.GetPointer(), exp.GetSize(), mod.GetPointer(), mod.GetSize()));
|
||||
}
|
||||
|
||||
Result SetConfig(u32 key, u64 value) {
|
||||
return m_manager.SetConfig(static_cast<spl::ConfigItem>(key), value);
|
||||
R_RETURN(m_manager.SetConfig(static_cast<spl::ConfigItem>(key), value));
|
||||
}
|
||||
|
||||
Result GenerateRandomBytes(const sf::OutPointerBuffer &out) {
|
||||
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
|
||||
R_RETURN(m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize()));
|
||||
}
|
||||
|
||||
Result IsDevelopment(sf::Out<bool> is_dev) {
|
||||
return m_manager.IsDevelopment(is_dev.GetPointer());
|
||||
R_RETURN(m_manager.IsDevelopment(is_dev.GetPointer()));
|
||||
}
|
||||
|
||||
Result SetBootReason(BootReasonValue boot_reason) {
|
||||
return m_manager.SetBootReason(boot_reason);
|
||||
R_RETURN(m_manager.SetBootReason(boot_reason));
|
||||
}
|
||||
|
||||
Result GetBootReason(sf::Out<BootReasonValue> out) {
|
||||
return m_manager.GetBootReason(out.GetPointer());
|
||||
R_RETURN(m_manager.GetBootReason(out.GetPointer()));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIGeneralInterface<GeneralService>);
|
||||
|
||||
@@ -108,22 +108,22 @@ namespace ams {
|
||||
switch (port_index) {
|
||||
case PortIndex_General:
|
||||
if (g_use_new_server) {
|
||||
return this->AcceptImpl(server, m_general_service_object.GetShared());
|
||||
R_RETURN(this->AcceptImpl(server, m_general_service_object.GetShared()));
|
||||
} else {
|
||||
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IDeprecatedGeneralInterface, spl::DeprecatedService>(m_allocator, m_secure_monitor_manager));
|
||||
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IDeprecatedGeneralInterface, spl::DeprecatedService>(m_allocator, m_secure_monitor_manager)));
|
||||
}
|
||||
case PortIndex_Random:
|
||||
return this->AcceptImpl(server, m_random_service_object.GetShared());
|
||||
R_RETURN(this->AcceptImpl(server, m_random_service_object.GetShared()));
|
||||
case PortIndex_Crypto:
|
||||
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ICryptoInterface, spl::CryptoService>(m_allocator, m_secure_monitor_manager));
|
||||
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ICryptoInterface, spl::CryptoService>(m_allocator, m_secure_monitor_manager)));
|
||||
case PortIndex_Fs:
|
||||
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IFsInterface, spl::FsService>(m_allocator, m_secure_monitor_manager));
|
||||
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IFsInterface, spl::FsService>(m_allocator, m_secure_monitor_manager)));
|
||||
case PortIndex_Ssl:
|
||||
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ISslInterface, spl::SslService>(m_allocator, m_secure_monitor_manager));
|
||||
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::ISslInterface, spl::SslService>(m_allocator, m_secure_monitor_manager)));
|
||||
case PortIndex_Es:
|
||||
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IEsInterface, spl::EsService>(m_allocator, m_secure_monitor_manager));
|
||||
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IEsInterface, spl::EsService>(m_allocator, m_secure_monitor_manager)));
|
||||
case PortIndex_Manu:
|
||||
return this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IManuInterface, spl::ManuService>(m_allocator, m_secure_monitor_manager));
|
||||
R_RETURN(this->AcceptImpl(server, ObjectFactory::CreateSharedEmplaced<spl::impl::IManuInterface, spl::ManuService>(m_allocator, m_secure_monitor_manager)));
|
||||
AMS_UNREACHABLE_DEFAULT_CASE();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result ReencryptDeviceUniqueData(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &src, AccessKey access_key_dec, KeySource source_dec, AccessKey access_key_enc, KeySource source_enc, u32 option) {
|
||||
return m_manager.ReencryptDeviceUniqueData(out.GetPointer(), out.GetSize(), src.GetPointer(), src.GetSize(), access_key_dec, source_dec, access_key_enc, source_enc, option);
|
||||
R_RETURN(m_manager.ReencryptDeviceUniqueData(out.GetPointer(), out.GetSize(), src.GetPointer(), src.GetSize(), access_key_dec, source_dec, access_key_enc, source_enc, option));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIManuInterface<ManuService>);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result GenerateRandomBytes(const sf::OutBuffer &out) {
|
||||
return m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize());
|
||||
R_RETURN(m_manager.GenerateRandomBytes(out.GetPointer(), out.GetSize()));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsIRandomInterface<RandomService>);
|
||||
|
||||
@@ -23,111 +23,111 @@ namespace ams::spl {
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::ModularExponentiate(void *out, size_t out_size, const void *base, size_t base_size, const void *exp, size_t exp_size, const void *mod, size_t mod_size) {
|
||||
return impl::ModularExponentiate(out, out_size, base, base_size, exp, exp_size, mod, mod_size);
|
||||
R_RETURN(impl::ModularExponentiate(out, out_size, base, base_size, exp, exp_size, mod, mod_size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GenerateAesKek(AccessKey *out_access_key, const KeySource &key_source, u32 generation, u32 option) {
|
||||
return impl::GenerateAesKek(out_access_key, key_source, generation, option);
|
||||
R_RETURN(impl::GenerateAesKek(out_access_key, key_source, generation, option));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::LoadAesKey(s32 keyslot, const void *owner, const AccessKey &access_key, const KeySource &key_source) {
|
||||
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
|
||||
return impl::LoadAesKey(keyslot, access_key, key_source);
|
||||
R_RETURN(impl::LoadAesKey(keyslot, access_key, key_source));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GenerateAesKey(AesKey *out_key, const AccessKey &access_key, const KeySource &key_source) {
|
||||
return impl::GenerateAesKey(out_key, access_key, key_source);
|
||||
R_RETURN(impl::GenerateAesKey(out_key, access_key, key_source));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DecryptDeviceUniqueData(void *dst, size_t dst_size, const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source, u32 option) {
|
||||
return impl::DecryptDeviceUniqueData(dst, dst_size, src, src_size, access_key, key_source, option);
|
||||
R_RETURN(impl::DecryptDeviceUniqueData(dst, dst_size, src, src_size, access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::ReencryptDeviceUniqueData(void *dst, size_t dst_size, const void *src, size_t src_size, const AccessKey &access_key_dec, const KeySource &source_dec, const AccessKey &access_key_enc, const KeySource &source_enc, u32 option) {
|
||||
return impl::ReencryptDeviceUniqueData(dst, dst_size, src, src_size, access_key_dec, source_dec, access_key_enc, source_enc, option);
|
||||
R_RETURN(impl::ReencryptDeviceUniqueData(dst, dst_size, src, src_size, access_key_dec, source_dec, access_key_enc, source_enc, option));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GetConfig(u64 *out, spl::ConfigItem key) {
|
||||
return impl::GetConfig(out, key);
|
||||
R_RETURN(impl::GetConfig(out, key));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::SetConfig(spl::ConfigItem key, u64 value) {
|
||||
return impl::SetConfig(key, value);
|
||||
R_RETURN(impl::SetConfig(key, value));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GetPackage2Hash(void *dst, const size_t size) {
|
||||
return impl::GetPackage2Hash(dst, size);
|
||||
R_RETURN(impl::GetPackage2Hash(dst, size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GenerateRandomBytes(void *out, size_t size) {
|
||||
return impl::GenerateRandomBytes(out, size);
|
||||
R_RETURN(impl::GenerateRandomBytes(out, size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DecryptAndStoreGcKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source, u32 option) {
|
||||
return impl::DecryptAndStoreGcKey(src, src_size, access_key, key_source, option);
|
||||
R_RETURN(impl::DecryptAndStoreGcKey(src, src_size, access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DecryptGcMessage(u32 *out_size, void *dst, size_t dst_size, const void *base, size_t base_size, const void *mod, size_t mod_size, const void *label_digest, size_t label_digest_size) {
|
||||
return impl::DecryptGcMessage(out_size, dst, dst_size, base, base_size, mod, mod_size, label_digest, label_digest_size);
|
||||
R_RETURN(impl::DecryptGcMessage(out_size, dst, dst_size, base, base_size, mod, mod_size, label_digest, label_digest_size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DecryptAndStoreSslClientCertKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source) {
|
||||
return impl::DecryptAndStoreSslClientCertKey(src, src_size, access_key, key_source);
|
||||
R_RETURN(impl::DecryptAndStoreSslClientCertKey(src, src_size, access_key, key_source));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::ModularExponentiateWithSslClientCertKey(void *out, size_t out_size, const void *base, size_t base_size, const void *mod, size_t mod_size) {
|
||||
return impl::ModularExponentiateWithSslClientCertKey(out, out_size, base, base_size, mod, mod_size);
|
||||
R_RETURN(impl::ModularExponentiateWithSslClientCertKey(out, out_size, base, base_size, mod, mod_size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DecryptAndStoreDrmDeviceCertKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source) {
|
||||
return impl::DecryptAndStoreDrmDeviceCertKey(src, src_size, access_key, key_source);
|
||||
R_RETURN(impl::DecryptAndStoreDrmDeviceCertKey(src, src_size, access_key, key_source));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::ModularExponentiateWithDrmDeviceCertKey(void *out, size_t out_size, const void *base, size_t base_size, const void *mod, size_t mod_size) {
|
||||
return impl::ModularExponentiateWithDrmDeviceCertKey(out, out_size, base, base_size, mod, mod_size);
|
||||
R_RETURN(impl::ModularExponentiateWithDrmDeviceCertKey(out, out_size, base, base_size, mod, mod_size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::IsDevelopment(bool *out) {
|
||||
return impl::IsDevelopment(out);
|
||||
R_RETURN(impl::IsDevelopment(out));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GenerateSpecificAesKey(AesKey *out_key, const KeySource &key_source, u32 generation, u32 which) {
|
||||
return impl::GenerateSpecificAesKey(out_key, key_source, generation, which);
|
||||
R_RETURN(impl::GenerateSpecificAesKey(out_key, key_source, generation, which));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::DecryptAesKey(AesKey *out_key, const KeySource &key_source, u32 generation, u32 option) {
|
||||
return impl::DecryptAesKey(out_key, key_source, generation, option);
|
||||
R_RETURN(impl::DecryptAesKey(out_key, key_source, generation, option));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::ComputeCtr(void *dst, size_t dst_size, s32 keyslot, const void *owner, const void *src, size_t src_size, const IvCtr &iv_ctr) {
|
||||
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
|
||||
return impl::ComputeCtr(dst, dst_size, keyslot, src, src_size, iv_ctr);
|
||||
R_RETURN(impl::ComputeCtr(dst, dst_size, keyslot, src, src_size, iv_ctr));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::ComputeCmac(Cmac *out_cmac, s32 keyslot, const void *owner, const void *data, size_t size) {
|
||||
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
|
||||
return impl::ComputeCmac(out_cmac, keyslot, data, size);
|
||||
R_RETURN(impl::ComputeCmac(out_cmac, keyslot, data, size));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::LoadEsDeviceKey(const void *src, size_t src_size, const AccessKey &access_key, const KeySource &key_source, u32 option) {
|
||||
return impl::LoadEsDeviceKey(src, src_size, access_key, key_source, option);
|
||||
R_RETURN(impl::LoadEsDeviceKey(src, src_size, access_key, key_source, option));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::PrepareEsTitleKey(AccessKey *out_access_key, const void *base, size_t base_size, const void *mod, size_t mod_size, const void *label_digest, size_t label_digest_size, u32 generation) {
|
||||
return impl::PrepareEsTitleKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation);
|
||||
R_RETURN(impl::PrepareEsTitleKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::PrepareEsArchiveKey(AccessKey *out_access_key, const void *base, size_t base_size, const void *mod, size_t mod_size, const void *label_digest, size_t label_digest_size, u32 generation) {
|
||||
return impl::PrepareEsArchiveKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation);
|
||||
R_RETURN(impl::PrepareEsArchiveKey(out_access_key, base, base_size, mod, mod_size, label_digest, label_digest_size, generation));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::PrepareCommonEsTitleKey(AccessKey *out_access_key, const KeySource &key_source, u32 generation) {
|
||||
return impl::PrepareCommonEsTitleKey(out_access_key, key_source, generation);
|
||||
R_RETURN(impl::PrepareCommonEsTitleKey(out_access_key, key_source, generation));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::LoadPreparedAesKey(s32 keyslot, const void *owner, const AccessKey &access_key) {
|
||||
R_TRY(this->TestAesKeySlot(nullptr, keyslot, owner));
|
||||
return impl::LoadPreparedAesKey(keyslot, access_key);
|
||||
R_RETURN(impl::LoadPreparedAesKey(keyslot, access_key));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::AllocateAesKeySlot(s32 *out_keyslot, const void *owner) {
|
||||
@@ -153,7 +153,7 @@ namespace ams::spl {
|
||||
R_TRY(this->TestAesKeySlot(std::addressof(index), keyslot, owner));
|
||||
|
||||
m_aes_keyslot_owners[index] = nullptr;
|
||||
return impl::DeallocateAesKeySlot(keyslot);
|
||||
R_RETURN(impl::DeallocateAesKeySlot(keyslot));
|
||||
}
|
||||
|
||||
void SecureMonitorManager::DeallocateAesKeySlots(const void *owner) {
|
||||
@@ -166,11 +166,11 @@ namespace ams::spl {
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::SetBootReason(BootReasonValue boot_reason) {
|
||||
return impl::SetBootReason(boot_reason);
|
||||
R_RETURN(impl::SetBootReason(boot_reason));
|
||||
}
|
||||
|
||||
Result SecureMonitorManager::GetBootReason(BootReasonValue *out) {
|
||||
return impl::GetBootReason(out);
|
||||
R_RETURN(impl::GetBootReason(out));
|
||||
}
|
||||
|
||||
os::SystemEvent *SecureMonitorManager::GetAesKeySlotAvailableEvent() {
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace ams::spl {
|
||||
public:
|
||||
/* Actual commands. */
|
||||
Result DecryptAndStoreSslClientCertKey(const sf::InPointerBuffer &src, AccessKey access_key, KeySource key_source) {
|
||||
return m_manager.DecryptAndStoreSslClientCertKey(src.GetPointer(), src.GetSize(), access_key, key_source);
|
||||
R_RETURN(m_manager.DecryptAndStoreSslClientCertKey(src.GetPointer(), src.GetSize(), access_key, key_source));
|
||||
}
|
||||
|
||||
Result ModularExponentiateWithSslClientCertKey(const sf::OutPointerBuffer &out, const sf::InPointerBuffer &base, const sf::InPointerBuffer &mod) {
|
||||
return m_manager.ModularExponentiateWithSslClientCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize());
|
||||
R_RETURN(m_manager.ModularExponentiateWithSslClientCertKey(out.GetPointer(), out.GetSize(), base.GetPointer(), base.GetSize(), mod.GetPointer(), mod.GetSize()));
|
||||
}
|
||||
};
|
||||
static_assert(spl::impl::IsISslInterface<SslService>);
|
||||
|
||||
Reference in New Issue
Block a user