diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-10-14 15:31:52 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-14 15:31:52 -0400 |
commit | 2dccef0eb490fa7d8fabc0d93e37d6635910f174 (patch) | |
tree | 65138098218cb4b11ffcbd3f6ac90501c45e2e99 /src/lib/tls/tortls.c | |
parent | 2c5c17510acf0cbd0eeb874a2f4c62203bf9392f (diff) | |
parent | 6925b61cfdf50a5686de02645b04b269c031f05d (diff) | |
download | tor-2dccef0eb490fa7d8fabc0d93e37d6635910f174.tar.gz tor-2dccef0eb490fa7d8fabc0d93e37d6635910f174.zip |
Merge branch 'bug27772_squashed'
Diffstat (limited to 'src/lib/tls/tortls.c')
-rw-r--r-- | src/lib/tls/tortls.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/lib/tls/tortls.c b/src/lib/tls/tortls.c index 3ae3a1a096..56f70bc371 100644 --- a/src/lib/tls/tortls.c +++ b/src/lib/tls/tortls.c @@ -71,13 +71,19 @@ tor_tls_get_my_certs(int server, const tor_x509_cert_t **id_cert_out) { tor_tls_context_t *ctx = tor_tls_context_get(server); - if (! ctx) - return -1; + int rv = -1; + const tor_x509_cert_t *link_cert = NULL; + const tor_x509_cert_t *id_cert = NULL; + if (ctx) { + rv = 0; + link_cert = server ? ctx->my_link_cert : ctx->my_auth_cert; + id_cert = ctx->my_id_cert; + } if (link_cert_out) - *link_cert_out = server ? ctx->my_link_cert : ctx->my_auth_cert; + *link_cert_out = link_cert; if (id_cert_out) - *id_cert_out = ctx->my_id_cert; - return 0; + *id_cert_out = id_cert; + return rv; } /** |