about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/LYGlobalDefs.h4
-rw-r--r--src/LYMain.c26
-rw-r--r--src/LYOptions.c24
-rw-r--r--src/LYReadCFG.c4
-rw-r--r--src/LYrcFile.h4
-rw-r--r--src/tidy_tls.c10
6 files changed, 61 insertions, 11 deletions
diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h
index 59e34cf9..0fc576e8 100644
--- a/src/LYGlobalDefs.h
+++ b/src/LYGlobalDefs.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYGlobalDefs.h,v 1.138 2014/02/04 01:25:39 tom Exp $
+ * $LynxId: LYGlobalDefs.h,v 1.139 2015/10/08 08:51:26 Simon.Kainz Exp $
  *
  * global variable definitions
  */
@@ -536,6 +536,8 @@ extern "C" {
     extern int LYHiddenLinks;
 
     extern char *SSL_cert_file;	/* Default CA CERT file */
+    extern char *SSL_client_cert_file;	/* Default client CERT file */
+    extern char *SSL_client_key_file;	/* Default client key file */
 
     extern int Old_DTD;
 
diff --git a/src/LYMain.c b/src/LYMain.c
index a15c9447..a09e9626 100644
--- a/src/LYMain.c
+++ b/src/LYMain.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYMain.c,v 1.256 2015/10/08 00:41:48 tom Exp $
+ * $LynxId: LYMain.c,v 1.258 2015/10/08 09:24:13 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTP.h>
@@ -553,7 +553,9 @@ char *XLoadImageCommand = NULL;	/* Default image viewer for X */
 BOOLEAN LYNoISMAPifUSEMAP = FALSE;	/* Omit ISMAP link if MAP present? */
 int LYHiddenLinks = HIDDENLINKS_SEPARATE;	/* Show hidden links? */
 
-char *SSL_cert_file = NULL;	/* Default CA CERT file */
+char *SSL_cert_file = NULL;	/*y Default CA CERT file */
+char *SSL_client_cert_file = NULL;
+char *SSL_client_key_file = NULL;
 
 int Old_DTD = NO;
 static BOOLEAN DTD_recovery = NO;
@@ -1579,6 +1581,26 @@ int main(int argc,
      */
     read_cfg(lynx_cfg_file, "main program", 1, (FILE *) 0);
 
+    {
+	static char *client_keyfile = NULL;
+	static char *client_certfile = NULL;
+
+	if ((client_keyfile = LYGetEnv("SSL_CLIENT_KEY_FILE")) != NULL) {
+	    CTRACE((tfp,
+		    "HTGetSSLHandle: client keyfile is set to %s by SSL_CLIENT_KEY_FILE\n",
+		    client_keyfile));
+	    StrAllocCopy(SSL_client_key_file, client_keyfile);
+
+	}
+
+	if ((client_certfile = LYGetEnv("SSL_CLIENT_CERT_FILE")) != NULL) {
+	    CTRACE((tfp,
+		    "HTGetSSLHandle: client certfile is set to %s by SSL_CLIENT_CERT_FILE\n",
+		    client_certfile));
+	    StrAllocCopy(SSL_client_cert_file, client_certfile);
+	}
+    }
+
 #if defined(USE_COLOR_STYLE)
     if (!dump_output_immediately) {
 	init_color_styles(&lynx_lss_file2, default_color_styles);
diff --git a/src/LYOptions.c b/src/LYOptions.c
index 5e7415eb..76815bb2 100644
--- a/src/LYOptions.c
+++ b/src/LYOptions.c
@@ -1,4 +1,4 @@
-/* $LynxId: LYOptions.c,v 1.165 2014/12/21 21:27:45 tom Exp $ */
+/* $LynxId: LYOptions.c,v 1.166 2015/10/08 08:52:00 Simon.Kainz Exp $ */
 #include <HTUtils.h>
 #include <HTFTP.h>
 #include <HTTP.h>		/* 'reloading' flag */
@@ -2444,6 +2444,9 @@ static const char *preferred_doc_lang_string = RC_PREFERRED_LANGUAGE;
 static const char *send_user_agent_string = RC_SEND_USERAGENT;
 static const char *user_agent_string = RC_USERAGENT;
 
+static const char *ssl_client_certificate_file = RC_SSL_CLIENT_CERT_FILE;
+static const char *ssl_client_key_file = RC_SSL_CLIENT_KEY_FILE;
+
 #define PutHeader(fp, Name) \
 	fprintf(fp, "\n%s<em>%s</em>\n", MARGIN_STR, LYEntifyTitle(&buffer, Name));
 
@@ -3260,6 +3263,16 @@ int postoptions(DocInfo *newdoc)
 	    LYSendUserAgent = (BOOLEAN) !strcasecomp(data[i].value, "ON");
 	}
 
+	if (!strcmp(data[i].tag, ssl_client_certificate_file)) {
+	    FREE(SSL_client_cert_file);
+	    StrAllocCopy(SSL_client_cert_file, data[i].value);
+	}
+
+	if (!strcmp(data[i].tag, ssl_client_key_file)) {
+	    FREE(SSL_client_key_file);
+	    StrAllocCopy(SSL_client_key_file, data[i].value);
+	}
+
 	/* User Agent: INPUT */
 	if (!strcmp(data[i].tag, user_agent_string) && (!no_useragent)) {
 	    if (strcmp(LYUserAgent, data[i].value)) {
@@ -3729,6 +3742,15 @@ static int gen_options(char **newfile)
     BeginSelect(fp0, ssl_prompt_string);
     PutOptValues(fp0, ssl_noprompt, prompt_values);
     EndSelect(fp0);
+
+    PutLabel(fp0, gettext("SSL client certificate file"), ssl_client_certificate_file);
+    PutTextInput(fp0, ssl_client_certificate_file,
+		 NonNull(SSL_client_cert_file), text_len, "");
+
+    PutLabel(fp0, gettext("SSL client key file"), ssl_client_key_file);
+    PutTextInput(fp0, ssl_client_key_file,
+		 NonNull(SSL_client_key_file), text_len, "");
+
 #endif
 
     PutHeader(fp0, gettext("Keyboard Input"));
diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c
index 6266ff98..6dd1e306 100644
--- a/src/LYReadCFG.c
+++ b/src/LYReadCFG.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYReadCFG.c,v 1.184 2014/02/12 23:59:11 tom Exp $
+ * $LynxId: LYReadCFG.c,v 1.185 2015/10/08 08:51:26 Simon.Kainz Exp $
  */
 #ifndef NO_RULES
 #include <HTRules.h>
@@ -1719,6 +1719,8 @@ static Config_Type Config_Table [] =
      PARSE_ENU(RC_SOURCE_CACHE_FOR_ABORTED, LYCacheSourceForAborted, tbl_abort_source_cache),
 #endif
      PARSE_STR(RC_SSL_CERT_FILE,        SSL_cert_file),
+     PARSE_STR(RC_SSL_CLIENT_CERT_FILE,        SSL_client_cert_file),
+     PARSE_STR(RC_SSL_CLIENT_KEY_FILE,        SSL_client_key_file),
      PARSE_FUN(RC_STARTFILE,            startfile_fun),
      PARSE_FUN(RC_STATUS_BUFFER_SIZE,   status_buffer_size_fun),
      PARSE_SET(RC_STRIP_DOTDOT_URLS,    LYStripDotDotURLs),
diff --git a/src/LYrcFile.h b/src/LYrcFile.h
index 5c8a4e1f..6cd00658 100644
--- a/src/LYrcFile.h
+++ b/src/LYrcFile.h
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYrcFile.h,v 1.45 2014/02/12 23:42:24 tom Exp $
+ * $LynxId: LYrcFile.h,v 1.46 2015/10/08 08:51:26 Simon.Kainz Exp $
  */
 #ifndef LYRCFILE_H
 #define LYRCFILE_H
@@ -234,6 +234,8 @@
 #define RC_SOURCE_CACHE                 "source_cache"
 #define RC_SOURCE_CACHE_FOR_ABORTED     "source_cache_for_aborted"
 #define RC_SSL_CERT_FILE                "ssl_cert_file"
+#define RC_SSL_CLIENT_CERT_FILE         "ssl_client_cert_file"
+#define RC_SSL_CLIENT_KEY_FILE          "ssl_client_key_file"
 #define RC_STARTFILE                    "startfile"
 #define RC_STATUS_BUFFER_SIZE           "status_buffer_size"
 #define RC_STRIP_DOTDOT_URLS            "strip_dotdot_urls"
diff --git a/src/tidy_tls.c b/src/tidy_tls.c
index 5dca26c3..559dca06 100644
--- a/src/tidy_tls.c
+++ b/src/tidy_tls.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: tidy_tls.c,v 1.28 2015/09/02 00:16:04 Simon.Kainz Exp $
+ * $LynxId: tidy_tls.c,v 1.29 2015/10/08 08:51:26 Simon.Kainz Exp $
  * Copyright 2008-2014,2015 Thomas E. Dickey
  * with fix Copyright 2008 by Thomas Viehmann
  *
@@ -429,11 +429,11 @@ SSL *SSL_new(SSL_CTX * ctx)
 		gnutls_certificate_set_x509_trust_file(ssl->gnutls_cred,
 						       ctx->certfile,
 						       ctx->certfile_type);
-	    if (ctx->keyfile)
+	    if (ctx->client_keyfile)
 		gnutls_certificate_set_x509_key_file(ssl->gnutls_cred,
-						     ctx->certfile,
-						     ctx->keyfile,
-						     ctx->keyfile_type);
+						     ctx->client_certfile,
+						     ctx->client_keyfile,
+						     ctx->client_keyfile_type);
 	    ssl->verify_mode = ctx->verify_mode;
 	    ssl->verify_callback = ctx->verify_callback;
 
-08-20 04:39:07 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2017-08-20 04:39:07 -0700 3974' href='/akkartik/mu/commit/html/046check_type_by_name.cc.html?h=main&id=c5e4a41aa590f355ce4b6b9f0beb6936526d9e1e'>c5e4a41a ^
204dae92 ^

c5e4a41a ^
c0f84b1f ^
204dae92 ^

2c678a4e ^
9e751bb8 ^
2c678a4e ^
850822ff ^
c0f84b1f ^
9e751bb8 ^
2c678a4e ^
850822ff ^
c0f84b1f ^
9e751bb8 ^
204dae92 ^


850822ff ^
c0f84b1f ^





















fa708f55 ^
c0f84b1f ^











































































































76755b28 ^


a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237