Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -35,6 +35,7 @@ using System.Threading.Tasks;
using System.Security.Cryptography.X509Certificates;
using System.Security.Authentication;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
#if MONO_SECURITY_ALIAS
using MonoSecurity::Mono.Security.Interface;
@ -76,11 +77,13 @@ namespace Mono.Btls
return (X509CertificateImplBtls)impl.Clone ();
var password = Guid.NewGuid ().ToString ();
var buffer = certificate.Export (X509ContentType.Pfx, password);
using (var handle = new SafePasswordHandle (password)) {
var buffer = certificate.Export (X509ContentType.Pfx, password);
impl = new X509CertificateImplBtls ();
impl.Import (buffer, password, X509KeyStorageFlags.DefaultKeySet);
return impl;
impl = new X509CertificateImplBtls ();
impl.Import (buffer, handle, X509KeyStorageFlags.DefaultKeySet);
return impl;
}
}
new public MonoBtlsProvider Provider {