Skip to content

Annotate System.Security.Cryptography.Xml for trimming #73432

@MichalStrehovsky

Description

@MichalStrehovsky

Hitting following test failure in Microsoft.Extensions.Configuration tests.

The underlying problem seems to be that GetDecryptionKey has a string with the crypto algorithm name and calls into an API annotated as RequiresUnreferencedCode.

I don't want to block the test on aggressive trimming (it will probably be the ultimate fix for that) because the test is currently not calling into anything annotated as RequiresUnreferencedCode. So it's a conditional ActiveIssue conditioned on this.

If this API is annotated, the test can be converted to ConditionalFact conditioned on trimming.

[FAIL] Microsoft.Extensions.Configuration.Xml.Test.XmlConfigurationTest.LoadKeyValuePairsFromValidEncryptedXml
System.Security.Cryptography.CryptographicException : Symmetric algorithm is not specified.
   at System.Security.Cryptography.Xml.EncryptedXml.GetDecryptionKey(EncryptedData, String) + 0x44e
   at System.Security.Cryptography.Xml.EncryptedXml.DecryptDocument() + 0xf1
   at Microsoft.Extensions.Configuration.Xml.XmlDocumentDecryptor.DecryptDocumentAndCreateXmlReader(XmlDocument) + 0x4f
   at Microsoft.Extensions.Configuration.Xml.XmlStreamConfigurationProvider.Read(Stream, XmlDocumentDecryptor) + 0xa0
   at Microsoft.Extensions.Configuration.Xml.XmlConfigurationProvider.Load(Stream) + 0x14
   at Microsoft.Extensions.Configuration.Xml.Test.XmlConfigurationTest.LoadKeyValuePairsFromValidEncryptedXml() + 0x1ee
   at Microsoft.Extensions.Configuration.Xml.Tests!<BaseAddress>+0x8b10dc
   at System.Reflection.DynamicInvokeInfo.Invoke(Object, IntPtr, Object[], BinderBundle, Boolean) + 0xf1
Finished Microsoft.Extensions.Configuration.Xml.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions