diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-09 14:43:09 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-03 08:39:31 -0400 |
commit | 67e66898d2b77940199fe23843e148ab836ff431 (patch) | |
tree | 7a2ddcd3a1f896acbaa85c099abcf1182e353a68 /src/common/tortls.c | |
parent | 88c2a6b9361d7d624f9d34dc855b940554a05fb3 (diff) | |
download | tor-67e66898d2b77940199fe23843e148ab836ff431.tar.gz tor-67e66898d2b77940199fe23843e148ab836ff431.zip |
For testing: add a tor_x509_cert_dup().
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 33bd334a12..0315398946 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -683,6 +683,13 @@ MOCK_IMPL(STATIC tor_x509_cert_t *, return cert; } +/** Return a copy of <b>cert</b> */ +tor_x509_cert_t * +tor_x509_cert_dup(const tor_x509_cert_t *cert) +{ + return tor_x509_cert_new(X509_dup(cert->cert)); +} + /** Read a DER-encoded X509 cert, of length exactly <b>certificate_len</b>, * from a <b>certificate</b>. Return a newly allocated tor_x509_cert_t on * success and NULL on failure. */ |