diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-11-14 20:01:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-11-14 20:01:12 +0000 |
commit | d483d3144aa20b316578a37cf6a8b74343ca7dba (patch) | |
tree | 70b867f30db38a077e466775dd2008326d047564 /src/common | |
parent | bbb34846b4df194e25304a84a3fe95634e01bc0d (diff) | |
download | tor-d483d3144aa20b316578a37cf6a8b74343ca7dba.tar.gz tor-d483d3144aa20b316578a37cf6a8b74343ca7dba.zip |
r16669@catbus: nickm | 2007-11-14 14:50:03 -0500
When we complete an OR handshake, set up all the internal fields and mark the connection as open.
svn:r12495
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/tortls.c | 12 | ||||
-rw-r--r-- | src/common/tortls.h | 1 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 5b902c9e9a..87e2f3aea6 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -933,6 +933,7 @@ tor_tls_verify_certs_v2(int severity, tor_tls_t *tls, const char *id_cert_str, size_t id_cert_len, crypto_pk_env_t **cert_key_out, char *conn_cert_digest_out, + crypto_pk_env_t **id_key_out, char *id_digest_out) { X509 *cert = NULL, *id_cert = NULL; @@ -942,6 +943,7 @@ tor_tls_verify_certs_v2(int severity, tor_tls_t *tls, tor_assert(cert_key_out); tor_assert(conn_cert_digest_out); + tor_assert(id_key_out); tor_assert(id_digest_out); *cert_key_out = NULL; @@ -996,13 +998,9 @@ tor_tls_verify_certs_v2(int severity, tor_tls_t *tls, goto done; } - { - crypto_pk_env_t *i = _crypto_new_pk_env_evp_pkey(id_pkey); - if (!i) - goto done; - crypto_pk_get_digest(i, id_digest_out); - crypto_free_pk_env(i); - } + if (!(*id_key_out = _crypto_new_pk_env_evp_pkey(id_pkey))) + goto done; + crypto_pk_get_digest(*id_key_out, id_digest_out); if (!(cert_pkey = X509_get_pubkey(cert))) goto done; if (!(*cert_key_out = _crypto_new_pk_env_evp_pkey(cert_pkey))) diff --git a/src/common/tortls.h b/src/common/tortls.h index d30a154fa2..63380f54eb 100644 --- a/src/common/tortls.h +++ b/src/common/tortls.h @@ -67,6 +67,7 @@ int tor_tls_verify_certs_v2(int severity, tor_tls_t *tls, const char *id_cert_str, size_t id_cert_len, crypto_pk_env_t **cert_key_out, char *conn_cert_digest_out, + crypto_pk_env_t **id_key_out, char *id_digest_out); int tor_tls_check_lifetime(tor_tls_t *tls, int tolerance); int tor_tls_read(tor_tls_t *tls, char *cp, size_t len); |