]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fixed an issue in extract_x509_field_ssl where the extraction
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 4 Jun 2008 06:17:53 +0000 (06:17 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 4 Jun 2008 06:17:53 +0000 (06:17 +0000)
would fail on the first field of the subject name, such as
the common name in:

  /CN=foo/emailAddress=foo@bar.com

git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@2980 e7ae566f-a301-0410-adde-c780ea21d3b5

ssl.c

diff --git a/ssl.c b/ssl.c
index 9b3c4b5fb932016e177485369d9dc8ab1a4fe283..34eb09480d082b101adc8602c2b7d0b0595a7f0b 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -401,7 +401,7 @@ extract_x509_field_ssl (X509_NAME *x509, const char *field_name, char *out, int
   do {
     lastpos = tmp;
     tmp = X509_NAME_get_index_by_NID(x509, nid, lastpos);
-  } while (tmp > 0);
+  } while (tmp > -1);
 
   /* Nothing found */
   if (lastpos == -1)