Use `SafePasswordHandle` in the internal certificate APIs. (#9651)
commiteeb2802076c00209aa23a46fbf0ba6aef6f7da05
authorMartin Baulig <mabaul@microsoft.com>
Mon, 23 Jul 2018 13:12:09 +0000 (23 09:12 -0400)
committerMarek Safar <marek.safar@gmail.com>
Mon, 23 Jul 2018 13:12:09 +0000 (23 15:12 +0200)
treebc112e486eb93926b38b2ef49ad06bc0ab4a5be3
parentf093a01b279a0669603baeca31e66b2313795da0
Use `SafePasswordHandle` in the internal certificate APIs. (#9651)

* `X509Helper`, `X509CertificateImpl`, `X509Certificate2Impl` and `ISystemCertificateProvider` now use `SafePasswordHandle` instead of strings.

* `X509Certificate`: actually implement `SecurePassword` based APIs using `SafePasswordHandle`.

* `mono_btls_pkcs12_import()`: when passed an empty password, try both the empty string and null.
26 files changed:
external/api-snapshot
mcs/class/System/Mono.AppleTls/X509CertificateImplApple.cs
mcs/class/System/Mono.AppleTls/X509PalImpl.Apple.cs
mcs/class/System/Mono.Btls/MonoBtlsContext.cs
mcs/class/System/Mono.Btls/MonoBtlsPkcs12.cs
mcs/class/System/Mono.Btls/MonoBtlsProvider.cs
mcs/class/System/Mono.Btls/X509CertificateImplBtls.cs
mcs/class/System/Mono.Btls/X509PalImpl.Btls.cs
mcs/class/System/Mono/SystemCertificateProvider.cs
mcs/class/System/Mono/X509PalImpl.Mono.cs
mcs/class/System/Mono/X509PalImpl.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2Impl.cs
mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2ImplMono.cs
mcs/class/corlib/Mono/ISystemCertificateProvider.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate20.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509CertificateImpl.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Helper.cs
mcs/class/corlib/corefx/Mono.SafePasswordHandle.Unix.cs [new file with mode: 0644]
mcs/class/corlib/corefx/Mono.SafePasswordHandle.Windows.cs [new file with mode: 0644]
mcs/class/corlib/corlib.csproj
mcs/class/corlib/corlib.dll.sources
mcs/class/corlib/win32_net_4_x_corlib.dll.exclude.sources
mcs/class/corlib/win32_net_4_x_corlib.dll.sources
mcs/class/corlib/winaot_corlib.dll.exclude.sources
mono/btls/btls-pkcs12.c