This bug causes cert subjects where common name is the first component of the subject, to be parsed incorrectly, resulting in no common name being returned at all.

Observed effects include incorrect client configuration being read (the UNDEF one) etc.

Patch is attached.

Regards,
upb

League of local jewish enterpreneurs.
--- ssl.c.buggy	2009-02-05 17:54:32.000000000 +0200
+++ ssl.c	2009-02-05 17:55:09.000000000 +0200
@@ -402,7 +402,7 @@
   do {
     lastpos = tmp;
     tmp = X509_NAME_get_index_by_NID(x509, nid, lastpos);
-  } while (tmp > 0);
+  } while (tmp != -1);
 
   /* Nothing found */
   if (lastpos == -1)

Reply via email to