Fix SSL GetCertificates with certificate ID set to All (#3727)
* Fix SSL GetCertificates with certificate ID set to All * Fix last entry status value
This commit is contained in:
parent
f502cfaf62
commit
dbe43c1719
2 changed files with 40 additions and 22 deletions
|
@ -181,7 +181,11 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
}
|
||||
}
|
||||
|
||||
public bool TryGetCertificates(ReadOnlySpan<CaCertificateId> ids, out CertStoreEntry[] entries)
|
||||
public bool TryGetCertificates(
|
||||
ReadOnlySpan<CaCertificateId> ids,
|
||||
out CertStoreEntry[] entries,
|
||||
out bool hasAllCertificates,
|
||||
out int requiredSize)
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
|
@ -190,7 +194,8 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
throw new InvalidSystemResourceException(CertStoreTitleMissingErrorMessage);
|
||||
}
|
||||
|
||||
bool hasAllCertificates = false;
|
||||
requiredSize = 0;
|
||||
hasAllCertificates = false;
|
||||
|
||||
foreach (CaCertificateId id in ids)
|
||||
{
|
||||
|
@ -205,12 +210,14 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
if (hasAllCertificates)
|
||||
{
|
||||
entries = new CertStoreEntry[_certificates.Count];
|
||||
requiredSize = (_certificates.Count + 1) * Unsafe.SizeOf<BuiltInCertificateInfo>();
|
||||
|
||||
int i = 0;
|
||||
|
||||
foreach (CertStoreEntry entry in _certificates.Values)
|
||||
{
|
||||
entries[i++] = entry;
|
||||
requiredSize += (entry.Data.Length + 3) & ~3;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -218,6 +225,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
else
|
||||
{
|
||||
entries = new CertStoreEntry[ids.Length];
|
||||
requiredSize = ids.Length * Unsafe.SizeOf<BuiltInCertificateInfo>();
|
||||
|
||||
for (int i = 0; i < ids.Length; i++)
|
||||
{
|
||||
|
@ -227,6 +235,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl
|
|||
}
|
||||
|
||||
entries[i] = entry;
|
||||
requiredSize += (entry.Data.Length + 3) & ~3;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue