Skip to content

Commit 82c89ab

Browse files
committed
[unitytls] Fix reporting leaf/root in X509ChainElementCollection collection twice
1 parent 1124796 commit 82c89ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mcs/class/System/Mono.UnityTls/X509ChainImplUnityTls.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public override X509ChainElementCollection ChainElements {
4747
elements = new X509ChainElementCollection ();
4848
UnityTls.unitytls_errorstate errorState = UnityTls.NativeInterface.unitytls_errorstate_create ();
4949
var cert = UnityTls.NativeInterface.unitytls_x509list_get_x509 (nativeCertificateChain, (size_t)0, &errorState);
50-
for (int i = 0; cert.handle != UnityTls.NativeInterface.UNITYTLS_INVALID_HANDLE; ++i) {
50+
for (int i = 1; cert.handle != UnityTls.NativeInterface.UNITYTLS_INVALID_HANDLE; ++i) {
5151
size_t certBufferSize = UnityTls.NativeInterface.unitytls_x509_export_der (cert, null, (size_t)0, &errorState);
5252
var certBuffer = new byte[(int)certBufferSize]; // Need to reallocate every time since X509Certificate constructor takes no length but only a byte array.
5353
fixed(byte* certBufferPtr = certBuffer) {

0 commit comments

Comments
 (0)