summaryrefslogtreecommitdiff
path: root/src/common/tortls.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-09-13 11:37:15 -0400
committerNick Mathewson <nickm@torproject.org>2011-10-10 23:14:02 -0400
commitc0bbcf138fa4e7d8e1974ed91718025d0dd5cc7a (patch)
tree3b96688cc664ac8f37ae907444116e6db1e37417 /src/common/tortls.h
parentdcf69a9e12d013563575e50b7d6f547832f92f66 (diff)
downloadtor-c0bbcf138fa4e7d8e1974ed91718025d0dd5cc7a.tar.gz
tor-c0bbcf138fa4e7d8e1974ed91718025d0dd5cc7a.zip
Turn X509 certificates into a first-class type and add some functions
Diffstat (limited to 'src/common/tortls.h')
-rw-r--r--src/common/tortls.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/tortls.h b/src/common/tortls.h
index 9b8108b42b..c55da4afd2 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -17,6 +17,9 @@
/* Opaque structure to hold a TLS connection. */
typedef struct tor_tls_t tor_tls_t;
+/* Opaque structure to hold an X509 certificate. */
+typedef struct tor_cert_t tor_cert_t;
+
/* Possible return values for most tor_tls_* functions. */
#define _MIN_TOR_TLS_ERROR_VAL -9
#define TOR_TLS_ERROR_MISC -9
@@ -104,5 +107,13 @@ struct bufferevent *tor_tls_init_bufferevent(tor_tls_t *tls,
int filter);
#endif
+void tor_cert_free(tor_cert_t *cert);
+tor_cert_t *tor_cert_decode(const uint8_t *certificate, size_t certificate_len);
+void tor_cert_get_der(const tor_cert_t *cert,
+ const uint8_t **encoded_out, size_t *size_out);
+int tor_tls_get_my_certs(int server,
+ const tor_cert_t **link_cert_out,
+ const tor_cert_t **id_cert_out);
+
#endif