[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Apparently, ASN1 failures are not treated as SSL connection...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] Apparently, ASN1 failures are not treated as SSL connection...
- From: nickm@xxxxxxxx (Nick Mathewson)
- Date: Sat, 23 Apr 2005 16:35:40 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Sat, 23 Apr 2005 16:36:01 -0400
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv16892/src/common
Modified Files:
tortls.c
Log Message:
Apparently, ASN1 failures are not treated as SSL connection errors, but are just general OpenSSL errors. Or something. Anyway, bulletproof tor_tls_handshake.
Index: tortls.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- tortls.c 23 Apr 2005 14:34:41 -0000 1.92
+++ tortls.c 23 Apr 2005 20:35:38 -0000 1.93
@@ -528,12 +528,17 @@
tor_assert(tls);
tor_assert(tls->ssl);
tor_assert(tls->state == TOR_TLS_ST_HANDSHAKE);
+ check_no_tls_errors();
if (tls->isServer) {
r = SSL_accept(tls->ssl);
} else {
r = SSL_connect(tls->ssl);
}
r = tor_tls_get_error(tls,r,0, "handshaking", LOG_INFO);
+ if (ERR_peek_error() != 0) {
+ tls_log_errors(LOG_WARN, "handshaking");
+ return TOR_TLS_ERROR;
+ }
if (r == TOR_TLS_DONE) {
tls->state = TOR_TLS_ST_OPEN;
}