From 32370d91c840936b7e6153bdf7fad5a9e45aa265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Martins?= Date: Wed, 14 Mar 2018 14:19:51 +0100 Subject: [PATCH] Fix openssl certificate peername validation --- source/vibe/stream/openssl.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/vibe/stream/openssl.d b/source/vibe/stream/openssl.d index 800adabad9..187fe86ca1 100644 --- a/source/vibe/stream/openssl.d +++ b/source/vibe/stream/openssl.d @@ -898,7 +898,7 @@ private bool verifyCertName(X509* cert, int field, in char[] value, bool allow_w } X509_NAME* name = X509_get_subject_name(cert); - int i; + int i = -1; while ((i = X509_NAME_get_index_by_NID(name, cnid, i)) >= 0) { X509_NAME_ENTRY* ne = X509_NAME_get_entry(name, i); ASN1_STRING* str = X509_NAME_ENTRY_get_data(ne);