diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-11-05 19:19:46 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-11-05 19:19:46 +0000 |
commit | 85654f4ab980fd91cae96e8f9c536a4cf31b2c6a (patch) | |
tree | e6f154d491f5127cd3e6204378d14233faa9434f /src/common/tortls.c | |
parent | 44eab517fce92b05614efc7f849ed54cee94463a (diff) | |
download | tor-85654f4ab980fd91cae96e8f9c536a4cf31b2c6a.tar.gz tor-85654f4ab980fd91cae96e8f9c536a4cf31b2c6a.zip |
r16432@catbus: nickm | 2007-11-05 14:18:57 -0500
Send and parse link_auth cells properly.
svn:r12386
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 6c04a362a8..1075de977e 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -47,6 +47,7 @@ typedef struct tor_tls_context_t { SSL_CTX *ctx; X509 *my_cert; X509 *my_id_cert; + crypto_pk_env_t *key; } tor_tls_context_t; /** Holds a SSL object and its associated data. Members are only @@ -355,6 +356,7 @@ tor_tls_context_decref(tor_tls_context_t *ctx) SSL_CTX_free(ctx->ctx); X509_free(ctx->my_cert); X509_free(ctx->my_id_cert); + crypto_free_pk_env(ctx->key); tor_free(ctx); } } @@ -410,6 +412,7 @@ tor_tls_context_new(crypto_pk_env_t *identity, const char *nickname, result->refcnt = 1; result->my_cert = X509_dup(cert); result->my_id_cert = X509_dup(idcert); + result->key = crypto_pk_dup_key(rsa); #ifdef EVERYONE_HAS_AES /* Tell OpenSSL to only use TLS1 */ @@ -735,6 +738,13 @@ tor_tls_get_cert_digests(tor_tls_t *tls, } /** DOCDOC */ +crypto_pk_env_t * +tor_tls_dup_private_key(tor_tls_t *tls) +{ + return crypto_pk_dup_key(tls->context->key); +} + +/** DOCDOC */ char * tor_tls_encode_my_certificate(tor_tls_t *tls, size_t *size_out, int conn_cert) |