public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in www-client/w3m/files: w3m-CVE-2010-2074.patch
@ 2010-06-19 17:43 Matsuu Takuto (matsuu)
  0 siblings, 0 replies; only message in thread
From: Matsuu Takuto (matsuu) @ 2010-06-19 17:43 UTC (permalink / raw
  To: gentoo-commits

matsuu      10/06/19 17:43:51

  Added:                w3m-CVE-2010-2074.patch
  Log:
  Fixed security issue.
  (Portage version: 2.1.8.3/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  www-client/w3m/files/w3m-CVE-2010-2074.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/w3m/files/w3m-CVE-2010-2074.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/w3m/files/w3m-CVE-2010-2074.patch?rev=1.1&content-type=text/plain

Index: w3m-CVE-2010-2074.patch
===================================================================
Index: istream.c
===================================================================
--- istream.c
+++ istream.c
@@ -447,8 +447,17 @@ ssl_check_cert_ident(X509 * x, char *hos
 
 		    if (!seen_dnsname)
 			seen_dnsname = Strnew();
+		    /* replace \0 to make full string visible to user */
+		    if (sl != strlen(sn)) {
+			int i;
+			for (i = 0; i < sl; ++i) {
+			    if (!sn[i])
+				sn[i] = '!';
+			}
+		    }
 		    Strcat_m_charp(seen_dnsname, sn, " ", NULL);
-		    if (ssl_match_cert_ident(sn, sl, hostname))
+		    if (sl == strlen(sn) /* catch \0 in SAN */
+			&& ssl_match_cert_ident(sn, sl, hostname))
 			break;
 		}
 	    }
@@ -466,16 +475,27 @@ ssl_check_cert_ident(X509 * x, char *hos
     if (match_ident == FALSE && ret == NULL) {
 	X509_NAME *xn;
 	char buf[2048];
+	int slen;
 
 	xn = X509_get_subject_name(x);
 
-	if (X509_NAME_get_text_by_NID(xn, NID_commonName,
-				      buf, sizeof(buf)) == -1)
+	slen = X509_NAME_get_text_by_NID(xn, NID_commonName, buf, sizeof(buf));
+	if ( slen == -1)
 	    /* FIXME: gettextize? */
 	    ret = Strnew_charp("Unable to get common name from peer cert");
-	else if (!ssl_match_cert_ident(buf, strlen(buf), hostname))
+	else if (slen != strlen(buf)
+		|| !ssl_match_cert_ident(buf, strlen(buf), hostname)) {
+	    /* replace \0 to make full string visible to user */
+	    if (slen != strlen(buf)) {
+		int i;
+		for (i = 0; i < slen; ++i) {
+		    if (!buf[i])
+			buf[i] = '!';
+		}
+	    }
 	    /* FIXME: gettextize? */
 	    ret = Sprintf("Bad cert ident %s from %s", buf, hostname);
+	}
 	else
 	    match_ident = TRUE;
     }







^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-19 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-19 17:43 [gentoo-commits] gentoo-x86 commit in www-client/w3m/files: w3m-CVE-2010-2074.patch Matsuu Takuto (matsuu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox