Support ECParameters that contain only D on Windows and Linux
authorKevin Jones <kevin@vcsjones.com>
Sun, 5 Apr 2020 19:11:43 +0000 (15:11 -0400)
committerGitHub <noreply@github.com>
Sun, 5 Apr 2020 19:11:43 +0000 (12:11 -0700)
commit6d395de48ac718a913e567ae80961050f2a9a4fa
tree7c8a7ed48e418022507c2a6ddf4d0cf93a37d770
parent68625db81f1c9b119a7f5510067e40492873cdc8
Support ECParameters that contain only D on Windows and Linux

If D (private key) is supplied but not the public key (Q), permit
this and allow the platform to re-calculate the public key from
the private key.

* Windows uses CNG blobs with the Q.X and Q.Y values set to (0,0).
* LInux uses the ECC math module to recompute Q from D and G.
* macOS is TBD.
32 files changed:
.config/CredScanSuppressions.json
src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EcDsa.ImportExport.cs
src/libraries/Common/src/System/Security/Cryptography/CngPkcs8.cs
src/libraries/Common/src/System/Security/Cryptography/ECDiffieHellmanCng.ImportExport.cs
src/libraries/Common/src/System/Security/Cryptography/ECDsaCng.ImportExport.cs
src/libraries/Common/src/System/Security/Cryptography/ECOpenSsl.ImportExport.cs
src/libraries/Common/src/System/Security/Cryptography/EccKeyFormatHelper.cs
src/libraries/Common/src/System/Security/Cryptography/KeyFormatHelper.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.LimitedPrivate.cs [new file with mode: 0644]
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/EC/ECKeyFileTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDhKeyFileTests.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanFactory.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDiffieHellman/ECDiffieHellmanTests.ImportExport.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaFactory.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaImportExport.cs
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/ECDsa/ECDsaKeyFileTests.cs
src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.h
src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_ecc_import_export.c
src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Unix.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDiffieHellmanProvider.Windows.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Unix.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/DefaultECDsaProvider.Windows.cs
src/libraries/System.Security.Cryptography.Algorithms/tests/System.Security.Cryptography.Algorithms.Tests.csproj
src/libraries/System.Security.Cryptography.Cng/src/Resources/Strings.resx
src/libraries/System.Security.Cryptography.Cng/src/System.Security.Cryptography.Cng.csproj
src/libraries/System.Security.Cryptography.Cng/tests/ECDiffieHellmanCngProvider.cs
src/libraries/System.Security.Cryptography.Cng/tests/ECDsaCngProvider.cs
src/libraries/System.Security.Cryptography.Cng/tests/System.Security.Cryptography.Cng.Tests.csproj
src/libraries/System.Security.Cryptography.OpenSsl/tests/EcDiffieHellmanOpenSslProvider.cs
src/libraries/System.Security.Cryptography.OpenSsl/tests/EcDsaOpenSslProvider.cs
src/libraries/System.Security.Cryptography.OpenSsl/tests/System.Security.Cryptography.OpenSsl.Tests.csproj