Skip to content

SigningVerifyingX509Cert.SignedXmlHasDSACertificateVerifiableSignature fails on Android due to missing RC2 #55694

Closed

Description

@danmoseley

Needs disabling presumably.

      <test name="System.Security.Cryptography.Xml.Tests.SigningVerifyingX509Cert.SignedXmlHasCertificateVerifiableSignature" type="System.Security.Cryptography.Xml.Tests.SigningVerifyingX509Cert" method="SignedXmlHasCertificateVerifiableSignature" time="0.0996002" result="Pass" />
      <test name="System.Security.Cryptography.Xml.Tests.SigningVerifyingX509Cert.SignedXmlHasDSACertificateVerifiableSignature" type="System.Security.Cryptography.Xml.Tests.SigningVerifyingX509Cert" method="SignedXmlHasDSACertificateVerifiableSignature" time="0.0440539" result="Fail">
        <failure exception-type="System.Security.Cryptography.CryptographicException">
          <message><![CDATA[System.Security.Cryptography.CryptographicException : The certificate data cannot be read with the provided password, the password may be incorrect.\n---- System.PlatformNotSupportedException : Algorithm 'RC2' is not supported on this platform.]]></message>
          <stack-trace><![CDATA[   at Internal.Cryptography.Pal.UnixPkcs12Reader.Decrypt(SafePasswordHandle password, Boolean ephemeralSpecified) in System.Security.Cryptography.X509Certificates.dll:token 0x600020e+0xb3
   at Internal.Cryptography.Pal.AndroidCertificatePal.ReadPkcs12(ReadOnlySpan`1 rawData, SafePasswordHandle password, Boolean ephemeralSpecified) in System.Security.Cryptography.X509Certificates.dll:token 0x6000101+0x7
   at Internal.Cryptography.Pal.AndroidCertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) in System.Security.Cryptography.X509Certificates.dll:token 0x60000fe+0x43
   at Internal.Cryptography.Pal.CertificatePal.FromBlob(ReadOnlySpan`1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) in System.Security.Cryptography.X509Certificates.dll:token 0x6000135+0x0
   at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags) in System.Security.Cryptography.X509Certificates.dll:token 0x60003e8+0x47
   at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password) in System.Security.Cryptography.X509Certificates.dll:token 0x60003e6+0x0
   at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password) in System.Security.Cryptography.X509Certificates.dll:token 0x600042e+0x0
   at System.Security.Cryptography.Xml.Tests.TestHelpers.GetSampleDSAX509Certificate() in /_/src/libraries/System.Security.Cryptography.Xml/tests/TestHelpers.cs:line 235
   at System.Security.Cryptography.Xml.Tests.SigningVerifyingX509Cert.SignedXmlHasDSACertificateVerifiableSignature() in /_/src/libraries/System.Security.Cryptography.Xml/tests/Samples/SigningVerifyingX509Cert.cs:line 84
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004b15+0x6a
----- Inner Stack Trace -----
   at Internal.Cryptography.RC2Implementation.CreateTransformCore(CipherMode cipherMode, PaddingMode paddingMode, Byte[] key, Int32 effectiveKeyLength, Byte[] iv, Int32 blockSize, Int32 feedbackSizeInBytes, Int32 paddingSize, Boolean encrypting) in System.Security.Cryptography.Algorithms.dll:token 0x6000101+0xf
   at Internal.Cryptography.RC2Implementation.CreateTransform(Byte[] rgbKey, Byte[] rgbIV, Boolean encrypting) in System.Security.Cryptography.Algorithms.dll:token 0x60000f7+0x9b
   at Internal.Cryptography.RC2Implementation.CreateDecryptor(Byte[] rgbKey, Byte[] rgbIV) in System.Security.Cryptography.Algorithms.dll:token 0x60000f2+0x8
   at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(SymmetricAlgorithm cipher, ReadOnlySpan`1 key, ReadOnlySpan`1 iv, ReadOnlySpan`1 encryptedData, Span`1 destination) in System.Security.Cryptography.X509Certificates.dll:token 0x6000372+0xc3
   at System.Security.Cryptography.PasswordBasedEncryption.Pkcs12PbeDecrypt(AlgorithmIdentifierAsn algorithmIdentifier, ReadOnlySpan`1 password, HashAlgorithmName hashAlgorithm, SymmetricAlgorithm cipher, ReadOnlySpan`1 encryptedData, Span`1 destination) in System.Security.Cryptography.X509Certificates.dll:token 0x6000371+0xc9
   at System.Security.Cryptography.PasswordBasedEncryption.Decrypt(AlgorithmIdentifierAsn& algorithmIdentifier, ReadOnlySpan`1 password, ReadOnlySpan`1 passwordBytes, ReadOnlySpan`1 encryptedData, Span`1 destination) in System.Security.Cryptography.X509Certificates.dll:token 0x6000368+0x250
   at Internal.Cryptography.Pal.UnixPkcs12Reader.DecryptSafeContents(ReadOnlySpan`1 password, ContentInfoAsn& safeContentsAsn) in System.Security.Cryptography.X509Certificates.dll:token 0x6000217+0xd2
   at Internal.Cryptography.Pal.UnixPkcs12Reader.DecryptAndProcessSafeContents(ReadOnlySpan`1 password, CertBagAsn[]& certBags, AttributeAsn[][]& certBagAttrs, Int32& certBagIdx, SafeBagAsn[]& keyBags, Int32& keyBagIdx) in System.Security.Cryptography.X509Certificates.dll:token 0x6000212+0x39
   at Internal.Cryptography.Pal.UnixPkcs12Reader.Decrypt(ReadOnlySpan`1 password, ReadOnlyMemory`1 authSafeContents) in System.Security.Cryptography.X509Certificates.dll:token 0x6000210+0x10f
   at Internal.Cryptography.Pal.UnixPkcs12Reader.VerifyAndDecrypt(ReadOnlySpan`1 password, ReadOnlyMemory`1 authSafeContents) in System.Security.Cryptography.X509Certificates.dll:token 0x600020f+0x72
   at Internal.Cryptography.Pal.UnixPkcs12Reader.Decrypt(SafePasswordHandle password, Boolean ephemeralSpecified) in System.Security.Cryptography.X509Certificates.dll:token 0x600020e+0x43]]></stack-trace>
        </failure>

Activity

  1. ghost added
    untriaged
    on Jul 14, 2021
  2. vcsjones commented on Jul 15, 2021

    @vcsjones
    Member

    We should just be able to use a different symmetric algorithm like 3DES for the PKCS12. The point of the test is for DSA, so we should still be able to test that on Android.

    Since I added that test in the first place, I will fix it.

  3. self-assigned this
    on Jul 15, 2021
  4. vcsjones commented on Jul 15, 2021

    @vcsjones
    Member

    Oh. This was for both of those tests, not just the DSA one. I will fix both. It was only the DSA one.

  5. ghost added
    in-pr
    on Jul 15, 2021
  6. ghost removed
    in-pr
    on Jul 15, 2021
  7. ghost locked as resolved and limited conversation to collaborators on Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-System.Securityos-androiduntriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions