about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2010-06-21 08:36:29 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2010-06-21 08:36:29 -0400
commita75e82813ea9ad7d716f81ce790b4b1b3a4ba4b7 (patch)
treef8c2621f04a078a0cbe20982fa0b331a9750d3e6 /src
parentcf8dea28bede9af20f1b6b3435a793e91924f4d6 (diff)
downloadlynx-snapshots-a75e82813ea9ad7d716f81ce790b4b1b3a4ba4b7.tar.gz
snapshot of project "lynx", label v2-8-8dev_3i
Diffstat (limited to 'src')
-rw-r--r--src/LYMain.c12
-rw-r--r--src/LYrcFile.c7
-rw-r--r--src/tidy_tls.c50
3 files changed, 36 insertions, 33 deletions
diff --git a/src/LYMain.c b/src/LYMain.c
index acd63897..7e87bc3a 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.214 2010/06/18 00:12:27 tom Exp $
+ * $LynxId: LYMain.c,v 1.215 2010/06/20 20:03:00 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -907,14 +907,10 @@ static void append_ssl_version(char **target,
 
 #if defined(SSLEAY_VERSION)
 #define LYNX_SSL_VERSION SSLeay_version(SSLEAY_VERSION)
-#else
-#if defined(OPENSSL_VERSION_TEXT)
+#elif defined(OPENSSL_VERSION_TEXT)
 #define LYNX_SSL_VERSION OPENSSL_VERSION_TEXT
-#else
-#if defined(GNUTLS_VERSION)
-#define LYNX_SSL_VERSION GNUTLS_VERSION
-#endif /* GNUTLS_VERSION */
-#endif /* OPENSSL_VERSION_TEXT */
+#elif defined(GNUTLS_VERSION)
+#define LYNX_SSL_VERSION "GNUTLS " GNUTLS_VERSION " "
 #endif
 
 #ifdef LYNX_SSL_VERSION
diff --git a/src/LYrcFile.c b/src/LYrcFile.c
index d00c90b9..e93e9fd7 100644
--- a/src/LYrcFile.c
+++ b/src/LYrcFile.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYrcFile.c,v 1.83 2010/05/05 09:19:31 tom Exp $ */
+/* $LynxId: LYrcFile.c,v 1.84 2010/06/20 16:42:27 tom Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <LYUtils.h>
@@ -698,7 +698,10 @@ void read_rc(FILE *fp)
 	    if (!strncasecomp(name, special, (int) strlen(special))) {
 		tbl = lookup_config(special);
 	    }
-	    /* lynx ignores unknown keywords */
+	    /*
+	     * lynx ignores unknown keywords.
+	     * This includes known keywords where there is no ENABLE_LYNXRC.
+	     */
 	    if (tbl->name == 0) {
 		CTRACE((tfp, "LYrcFile: ignored %s=%s\n", name, value));
 		continue;
diff --git a/src/tidy_tls.c b/src/tidy_tls.c
index 473020cd..a3d37731 100644
--- a/src/tidy_tls.c
+++ b/src/tidy_tls.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: tidy_tls.c,v 1.4 2010/04/29 20:49:46 tom Exp $
+ * $LynxId: tidy_tls.c,v 1.5 2010/06/20 19:25:46 tom Exp $
  * Copyright 2008, Thomas E. Dickey
  * with fix Copyright 2008 by Thomas Viehmann
  *
@@ -20,11 +20,11 @@ static int last_error = 0;
 
 /* ugly, but hey, we could just use a more sane api, too */
 #define GetDnByOID(target, oid, thewhat) \
-		len = sizeof(target); \
-                if (! thewhat) \
-		  gnutls_x509_crt_get_dn_by_oid(xcert, oid, 0, 0, target, &len); \
-                else \
-                  gnutls_x509_crt_get_issuer_dn_by_oid(xcert, oid, 0, 0, target, &len)
+	len = sizeof(target); \
+	if (! thewhat) \
+	    gnutls_x509_crt_get_dn_by_oid(xcert, oid, 0, 0, target, &len); \
+	else \
+	    gnutls_x509_crt_get_issuer_dn_by_oid(xcert, oid, 0, 0, target, &len)
 
 /* thewhat: which DN to get 0 = subject, 1 = issuer */
 static int ExtractCertificate(const gnutls_datum_t * cert, X509_NAME * result, int thewhat)
@@ -531,18 +531,22 @@ SSL_METHOD *SSLv23_client_method(void)
 
 static int add_name(char *target, int len, const char *tag, const char *data)
 {
-    int need = strlen(tag);
+    if (*data != '\0') {
+	int need = strlen(tag) + 2;
 
-    target += strlen(target);
-    if (need < len) {
-	strcat(target, tag);
-	len -= need;
-	target += need;
+	target += strlen(target);
+	if (need < len) {
+	    strcat(target, "/");
+	    strcat(target, tag);
+	    strcat(target, "=");
+	    len -= need;
+	    target += need;
+	}
+	need = strlen(data);
+	if (need >= len - 1)
+	    need = len - 1;
+	strncat(target, data, need)[need] = '\0';
     }
-    need = strlen(data);
-    if (need >= len - 1)
-	need = len - 1;
-    strncat(target, data, need)[need] = '\0';
     return len;
 }
 #define ADD_NAME(tag, data) len = add_name(target, len, tag, data);
@@ -556,13 +560,13 @@ char *X509_NAME_oneline(X509_NAME * source, char *target, int len)
     if (target && (len > 0)) {
 	*target = '\0';
 	if (source) {
-	    ADD_NAME("C=", source->country);
-	    ADD_NAME(", ST=", source->state_or_province_name);
-	    ADD_NAME(", L=", source->locality_name);
-	    ADD_NAME(", O=", source->organization);
-	    ADD_NAME(", OU=", source->organizational_unit_name);
-	    ADD_NAME(", CN=", source->common_name);
-	    ADD_NAME("/Email=", source->email);
+	    ADD_NAME("C", source->country);
+	    ADD_NAME("ST", source->state_or_province_name);
+	    ADD_NAME("L", source->locality_name);
+	    ADD_NAME("O", source->organization);
+	    ADD_NAME("OU", source->organizational_unit_name);
+	    ADD_NAME("CN", source->common_name);
+	    ADD_NAME("Email", source->email);
 	}
     }
     return target;