summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls.h
diff options
context:
space:
mode:
authorjsing <>2015-09-11 11:28:01 +0000
committerjsing <>2015-09-11 11:28:01 +0000
commit0dd7e6b53207a35f05ffb30e367e39644d20f096 (patch)
tree122bc4c787f76caf0f4eb0c1dd4c691818a0adca /src/lib/libtls/tls.h
parentab250a383adcc228148d2bd9bb6245d78932a1c9 (diff)
downloadopenbsd-0dd7e6b53207a35f05ffb30e367e39644d20f096.tar.gz
openbsd-0dd7e6b53207a35f05ffb30e367e39644d20f096.tar.bz2
openbsd-0dd7e6b53207a35f05ffb30e367e39644d20f096.zip
Provide tls_peer_cert_hash() which returns a hash of the raw certificate
that was presented by the peer. The hash used is currently SHA256, however since we prefix the result with the hash name, we can change this in the future as the need arises. The same output can be generated by using: h=$(openssl x509 -outform der -in mycert.crt | sha256) printf "SHA256:${h}\n" ok beck@
Diffstat (limited to 'src/lib/libtls/tls.h')
-rw-r--r--src/lib/libtls/tls.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h
index f7c12920e0..3cb24f0ee5 100644
--- a/src/lib/libtls/tls.h
+++ b/src/lib/libtls/tls.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls.h,v 1.18 2015/09/10 10:26:49 beck Exp $ */ 1/* $OpenBSD: tls.h,v 1.19 2015/09/11 11:28:01 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -99,6 +99,8 @@ ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen);
99ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen); 99ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen);
100int tls_close(struct tls *_ctx); 100int tls_close(struct tls *_ctx);
101 101
102int tls_peer_cert_hash(struct tls *_ctx, char **_hash);
103
102uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); 104uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password);
103 105
104#ifdef __cplusplus 106#ifdef __cplusplus