QCParts: Check if signatures are available

This commit is contained in:
Gustave Monce
2024-08-30 20:41:57 +02:00
parent c6f6ef4429
commit 0174fc8b30
+14 -11
View File
@@ -160,24 +160,27 @@ namespace WPinternals
} }
} }
byte[] RootCertificate = Signatures[^1]; if (Signatures.Count > 0)
for (int i = 0; i < Signatures.Count; i++)
{ {
if (i + 1 != Signatures.Count) byte[] RootCertificate = Signatures[^1];
for (int i = 0; i < Signatures.Count; i++)
{ {
if (i + 1 != Signatures.Count)
{
#if DEBUG #if DEBUG
System.Diagnostics.Debug.Print("Cert: " + Converter.ConvertHexToString(SHA256.HashData(Signatures[i]), "")); System.Diagnostics.Debug.Print("Cert: " + Converter.ConvertHexToString(SHA256.HashData(Signatures[i]), ""));
#endif #endif
} }
else else
{ {
// This is the last certificate. So this is the root key. // This is the last certificate. So this is the root key.
RootKeyHash = SHA256.HashData(Signatures[i]); RootKeyHash = SHA256.HashData(Signatures[i]);
#if DEBUG #if DEBUG
System.Diagnostics.Debug.Print("RKH: " + Converter.ConvertHexToString(RootKeyHash, "")); System.Diagnostics.Debug.Print("RKH: " + Converter.ConvertHexToString(RootKeyHash, ""));
#endif #endif
}
} }
} }
} }