diff options
-rwxr-xr-x | vchat-config.h | 1 | ||||
-rwxr-xr-x | vchat-ssl.c | 12 | ||||
-rwxr-xr-x | vchat.h | 9 |
3 files changed, 16 insertions, 6 deletions
diff --git a/vchat-config.h b/vchat-config.h index 0291100..9e10999 100755 --- a/vchat-config.h +++ b/vchat-config.h | |||
@@ -41,6 +41,7 @@ static volatile configoption configoptions[] = { | |||
41 | {CF_FINGERPRINT, CO_STR, "fingerprint","~/.vchat/fingerprint", NULL, { NULL } }, | 41 | {CF_FINGERPRINT, CO_STR, "fingerprint","~/.vchat/fingerprint", NULL, { NULL } }, |
42 | {CF_ENCODING, CO_STR, "encoding", NULL, NULL, { .pstr = &encoding }}, | 42 | {CF_ENCODING, CO_STR, "encoding", NULL, NULL, { .pstr = &encoding }}, |
43 | {CF_USESSL, CO_INT, "usessl", (char *) 1, (char *)-1, { NULL } }, | 43 | {CF_USESSL, CO_INT, "usessl", (char *) 1, (char *)-1, { NULL } }, |
44 | {CF_IGNSSL, CO_INT, "ignssl", (char *) 0, (char *)-1, { NULL } }, | ||
44 | {CF_VERIFYSSL, CO_INT, "verifyssl", (char *) 2, (char *)-1, { NULL } }, | 45 | {CF_VERIFYSSL, CO_INT, "verifyssl", (char *) 2, (char *)-1, { NULL } }, |
45 | {CF_USECERT, CO_INT, "usecert", (char *) 1, (char *)-1, { NULL } }, | 46 | {CF_USECERT, CO_INT, "usecert", (char *) 1, (char *)-1, { NULL } }, |
46 | {CF_USETIME, CO_INT, "usetime", (char *) 1, (char *)-1, { .pint = &usetime } }, | 47 | {CF_USETIME, CO_INT, "usetime", (char *) 1, (char *)-1, { .pint = &usetime } }, |
diff --git a/vchat-ssl.c b/vchat-ssl.c index 1a88b6c..91b25ba 100755 --- a/vchat-ssl.c +++ b/vchat-ssl.c | |||
@@ -163,7 +163,14 @@ int vc_connect_ssl( BIO **conn, vc_x509store_t *vc_store ) | |||
163 | /* Accept being connected, _if_ verification passed */ | 163 | /* Accept being connected, _if_ verification passed */ |
164 | if (sslp) { | 164 | if (sslp) { |
165 | long result = SSL_get_verify_result(sslp); | 165 | long result = SSL_get_verify_result(sslp); |
166 | 166 | #if 1 == 1 | |
167 | if (result == X509_V_OK) { | ||
168 | return 0; | ||
169 | } else if (getintoption(CF_IGNSSL)) { | ||
170 | writecf(FS_ERR, "[SSL VERIFY ERROR ] FAILURE IGNORED!!!"); | ||
171 | return 0; | ||
172 | } | ||
173 | #else | ||
167 | /* show & verify fingerprint */ | 174 | /* show & verify fingerprint */ |
168 | if (result == X509_V_OK) { | 175 | if (result == X509_V_OK) { |
169 | X509 *peercert = SSL_get_peer_certificate(sslp); | 176 | X509 *peercert = SSL_get_peer_certificate(sslp); |
@@ -227,6 +234,7 @@ int vc_connect_ssl( BIO **conn, vc_x509store_t *vc_store ) | |||
227 | } | 234 | } |
228 | } | 235 | } |
229 | } | 236 | } |
237 | #endif | ||
230 | } | 238 | } |
231 | } | 239 | } |
232 | } | 240 | } |
@@ -305,7 +313,7 @@ int vc_verify_callback(int ok, X509_STORE_CTX *store) | |||
305 | X509_verify_cert_error_string(store->error)); | 313 | X509_verify_cert_error_string(store->error)); |
306 | writecf(FS_ERR, tmpstr); | 314 | writecf(FS_ERR, tmpstr); |
307 | } | 315 | } |
308 | return ok; | 316 | return (ok | getintoption(CF_IGNSSL)); |
309 | } | 317 | } |
310 | 318 | ||
311 | void vc_x509store_setflags(vc_x509store_t *store, int flags) | 319 | void vc_x509store_setflags(vc_x509store_t *store, int flags) |
@@ -30,10 +30,11 @@ typedef struct servermessage servermessage; | |||
30 | /* configuration types and variable numbers */ | 30 | /* configuration types and variable numbers */ |
31 | typedef enum { CO_NIL, CO_STR, CO_INT } conftype; | 31 | typedef enum { CO_NIL, CO_STR, CO_INT } conftype; |
32 | typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT, | 32 | typedef enum { CF_NIL, CF_NICK, CF_FROM, CF_SERVERHOST, CF_SERVERPORT, |
33 | CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, CF_LOGINSCRIPT, CF_FINGERPRINT, | 33 | CF_CIPHERSUITE, CF_CONFIGFILE, CF_CERTFILE, CF_KEYFILE, CF_FORMFILE, |
34 | CF_USESSL, CF_VERIFYSSL, CF_USECERT, CF_PRIVHEIGHT, CF_PRIVCOLLAPS, CF_HSCROLL, CF_CHANNEL, CF_USETIME, | 34 | CF_LOGINSCRIPT, CF_FINGERPRINT, CF_USESSL, CF_IGNSSL, CF_VERIFYSSL, CF_USECERT, |
35 | CF_USETOPIC, CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, | 35 | CF_PRIVHEIGHT, CF_PRIVCOLLAPS, CF_HSCROLL, CF_CHANNEL, CF_USETIME, CF_USETOPIC, |
36 | CF_ENCODING, CF_BELLPRIV, CF_CASEFIRST, CF_AUTORECONN, CF_KEEPALIVE } confopt; | 36 | CF_SCROLLBPRIV, CF_SCROLLBACK, CF_SCROLLBPRIVT, CF_SCROLLBACKT, CF_ENCODING, |
37 | CF_BELLPRIV, CF_CASEFIRST, CF_AUTORECONN, CF_KEEPALIVE } confopt; | ||
37 | 38 | ||
38 | /* format strings */ | 39 | /* format strings */ |
39 | typedef enum { FS_PLAIN, FS_CHAN, FS_PRIV, FS_SERV, FS_GLOB, FS_DBG, FS_ERR, | 40 | typedef enum { FS_PLAIN, FS_CHAN, FS_PRIV, FS_SERV, FS_GLOB, FS_DBG, FS_ERR, |