IOS/ES: Add helper function ReadCertStore
This commit is contained in:
parent
88348e2903
commit
f3bf1d626c
|
@ -781,6 +781,19 @@ bool ES::IsIssuerCorrect(VerifyContainerType type, const IOS::ES::CertReader& is
|
|||
}
|
||||
}
|
||||
|
||||
ReturnCode ES::ReadCertStore(std::vector<u8>* buffer) const
|
||||
{
|
||||
const std::string store_path = Common::RootUserPath(Common::FROM_SESSION_ROOT) + "/sys/cert.sys";
|
||||
File::IOFile store_file{store_path, "rb"};
|
||||
if (!store_file)
|
||||
return FS_ENOENT;
|
||||
|
||||
buffer->resize(store_file.GetSize());
|
||||
if (!store_file.ReadBytes(buffer->data(), buffer->size()))
|
||||
return ES_SHORT_READ;
|
||||
return IPC_SUCCESS;
|
||||
}
|
||||
|
||||
ReturnCode ES::WriteNewCertToStore(const IOS::ES::CertReader& cert)
|
||||
{
|
||||
const std::string store_path = Common::RootUserPath(Common::FROM_SESSION_ROOT) + "/sys/cert.sys";
|
||||
|
|
|
@ -319,6 +319,7 @@ private:
|
|||
UpdateCertStore,
|
||||
};
|
||||
bool IsIssuerCorrect(VerifyContainerType type, const IOS::ES::CertReader& issuer_cert) const;
|
||||
ReturnCode ReadCertStore(std::vector<u8>* buffer) const;
|
||||
ReturnCode WriteNewCertToStore(const IOS::ES::CertReader& cert);
|
||||
ReturnCode VerifyContainer(VerifyContainerType type, VerifyMode mode,
|
||||
const IOS::ES::SignedBlobReader& signed_blob,
|
||||
|
|
Loading…
Reference in New Issue