diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-05-21 13:43:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-03 08:37:21 -0400 |
commit | e23389841c7797615b09ee6457e841b4ed13ea75 (patch) | |
tree | 5303cc276c4888567b883f3fec70209a2b5de2fa /src/or/torcert.c | |
parent | 4ef42e7c529a95b69d3e830e115e5d0453d38dfb (diff) | |
download | tor-e23389841c7797615b09ee6457e841b4ed13ea75.tar.gz tor-e23389841c7797615b09ee6457e841b4ed13ea75.zip |
Migrate certificates into a sub-structure of or_handshake_state
This will help us do cert-checking in the background in the future,
perhaps.
Diffstat (limited to 'src/or/torcert.c')
-rw-r--r-- | src/or/torcert.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/or/torcert.c b/src/or/torcert.c index a6a33c675a..e8bee54d52 100644 --- a/src/or/torcert.c +++ b/src/or/torcert.c @@ -8,6 +8,7 @@ * protocol. */ +#include "or.h" #include "crypto.h" #include "torcert.h" #include "ed25519_cert.h" @@ -295,3 +296,22 @@ tor_make_rsa_ed25519_crosscert(const ed25519_public_key_t *ed_key, return sz; } +or_handshake_certs_t * +or_handshake_certs_new(void) +{ + return tor_malloc_zero(sizeof(or_handshake_certs_t)); +} + +/** DODCDOC */ +void +or_handshake_certs_free(or_handshake_certs_t *certs) +{ + if (!certs) + return; + + tor_x509_cert_free(certs->auth_cert); + tor_x509_cert_free(certs->id_cert); + + memwipe(certs, 0xBD, sizeof(*certs)); + tor_free(certs); +} |