From fe5d2477aabbf06c940c33a266d6ebb3a7b19fe1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 30 Sep 2014 23:36:47 -0400 Subject: Implement ed25519-signed descriptors Now that we have ed25519 keys, we can sign descriptors with them and check those signatures as documented in proposal 220. --- src/or/torcert.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/or/torcert.c') diff --git a/src/or/torcert.c b/src/or/torcert.c index 478ec4d5ac..8fe9c12000 100644 --- a/src/or/torcert.c +++ b/src/or/torcert.c @@ -206,3 +206,13 @@ tor_cert_checksig(tor_cert_t *cert, } } +/** Return a new copy of cert */ +tor_cert_t * +tor_cert_dup(const tor_cert_t *cert) +{ + tor_cert_t *newcert = tor_memdup(cert, sizeof(tor_cert_t)); + if (cert->encoded) + newcert->encoded = tor_memdup(cert->encoded, cert->encoded_len); + return newcert; +} + -- cgit v1.2.3-54-g00ecf