Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <mabaul@microsoft.com>2018-07-26 10:22:36 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2018-07-26 10:22:36 +0300
commitf97e990290f44aade535fdc7b6133be9ffdf3032 (patch)
treeb8d8c06131c553a90c0c2e80a99277691f1af935 /mcs/class/Mono.Btls.Interface
parent4160564aa5dfc2a3723f894131a0dcfc9bd74e57 (diff)
[corlib]: Cleanup `X509Certificate` implementation and sync it with CoreFx. (#9650)
* [corlib]: Cleanup `X509Certificate` implementation and sync it with CoreFX. Completely refactored the `X509Certificate` implementation to make it based very closely on CoreFX. We cannot fully switch to their implementation yet because we are missing things and they also have a few issues in their implementation. However, this will make it a lot easier to do this at a later time. The internal `X509CertificateImpl` has been cleaned up as well, using properties instead of methods in most places and the `ToString()` implementation is now shared between all platforms. * `X509Certificate.CreateFromSignedFile()`: in CoreFX, this is the same as `CreateFromCertFile()`. Our old implementation was incomplete and did not verify the signature - we even had a test where loading a certificate with an invalid signature was supposed to work; this test has been disabled because we're now throwing an exception. * `X509CertificateImpl.KeyAlgorithmParameters`: this is supposed to throw `CryptographicException` on error, see `Certificate13` in `X509CertificateTest.cs`. * We now match CoreFX's behavior regarding serialization - while the `X509Certificate` type is still marked as `[Serializable]`, we now throw `PlatformNotSupportedException` when attempting to serialize or deserialize it. * Bump API snapshot submodule * [csproj] Update project files
Diffstat (limited to 'mcs/class/Mono.Btls.Interface')
-rw-r--r--mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs
index abcdafbf006..8560e4b77a1 100644
--- a/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs
+++ b/mcs/class/Mono.Btls.Interface/Mono.Btls.Interface/BtlsX509.cs
@@ -87,7 +87,10 @@ namespace Mono.Btls.Interface
public byte[] GetSerialNumber (bool mono_style)
{
- return Instance.GetSerialNumber (mono_style);
+ var serial = Instance.GetSerialNumber (mono_style);
+ if (mono_style)
+ Array.Reverse (serial);
+ return serial;
}
public int GetVersion ()