Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public static void DeepRootDecryptedXml_Throws()

private static void DecryptDeepXml(bool root)
{
const int Depth = 100000;
const int Depth = 10000;
XmlDocument doc = new XmlDocument { PreserveWhitespace = true };
string plaintext = "<target>" + BuildDeepMarkup(Depth, "x") + "</target>";
doc.LoadXml(root ? plaintext : "<root><data>" + plaintext + "</data></root>");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ private static void AssertCertificateContentType(X509ContentType contentType, bo
byte[] rawData = new X509Certificate2Collection(certificate).Export(contentType);
if (contentType == X509ContentType.Pkcs7)
{
// The single-certificate importer requires signer information to select a certificate from PKCS#7.
// Windows requires signer information to select a certificate from PKCS#7.
// Unix does not support importing a single certificate from PKCS#7.
SignedCms cms = new SignedCms(new ContentInfo(new byte[] { 1, 2, 3 }));
CmsSigner cmsSigner = new CmsSigner(signingCertificate) { IncludeOption = X509IncludeOption.EndCertOnly };
cms.ComputeSignature(cmsSigner);
Expand Down Expand Up @@ -210,7 +211,8 @@ private static void AssertCertificateContentType(X509ContentType contentType, bo
KeyInfoX509Data loadedData = new KeyInfoX509Data();
SignedXml loadedSignature = new SignedXml(document);

if (contentType == X509ContentType.Cert || allowNonCertificate)
if (contentType == X509ContentType.Cert ||
(allowNonCertificate && (contentType != X509ContentType.Pkcs7 || PlatformDetection.IsWindows)))
{
loadedData.LoadXml(x509Data);
Assert.Equal(certificate.RawData, ((X509Certificate2)Assert.Single(loadedData.Certificates)).RawData);
Expand Down
Loading