diff options
author | beck <> | 2015-09-12 21:00:38 +0000 |
---|---|---|
committer | beck <> | 2015-09-12 21:00:38 +0000 |
commit | 597a9dc18b943498a3f42065e756e1b0a648987c (patch) | |
tree | 926c057595ea50242eb49f4f725d0bf1a0488e65 /src/lib/libtls/tls_internal.h | |
parent | 5295709b8306b98ea97e2540c0e4dad875421ebe (diff) | |
download | openbsd-597a9dc18b943498a3f42065e756e1b0a648987c.tar.gz openbsd-597a9dc18b943498a3f42065e756e1b0a648987c.tar.bz2 openbsd-597a9dc18b943498a3f42065e756e1b0a648987c.zip |
Move connection info into it's own private structure allocated and filled in
at handshake time. change accessors to return const char * to remove need
for caller to free memory.
ok jsing@
Diffstat (limited to 'src/lib/libtls/tls_internal.h')
-rw-r--r-- | src/lib/libtls/tls_internal.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h index 34af0fb48a..e31c39a135 100644 --- a/src/lib/libtls/tls_internal.h +++ b/src/lib/libtls/tls_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_internal.h,v 1.20 2015/09/11 12:56:55 beck Exp $ */ | 1 | /* $OpenBSD: tls_internal.h,v 1.21 2015/09/12 21:00:38 beck Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
@@ -48,6 +48,14 @@ struct tls_config { | |||
48 | int verify_name; | 48 | int verify_name; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | struct tls_conninfo { | ||
52 | char *issuer; | ||
53 | char *subject; | ||
54 | char *hash; | ||
55 | char *serial; | ||
56 | char *fingerprint; | ||
57 | }; | ||
58 | |||
51 | #define TLS_CLIENT (1 << 0) | 59 | #define TLS_CLIENT (1 << 0) |
52 | #define TLS_SERVER (1 << 1) | 60 | #define TLS_SERVER (1 << 1) |
53 | #define TLS_SERVER_CONN (1 << 2) | 61 | #define TLS_SERVER_CONN (1 << 2) |
@@ -68,6 +76,7 @@ struct tls { | |||
68 | SSL *ssl_conn; | 76 | SSL *ssl_conn; |
69 | SSL_CTX *ssl_ctx; | 77 | SSL_CTX *ssl_ctx; |
70 | X509 *ssl_peer_cert; | 78 | X509 *ssl_peer_cert; |
79 | struct tls_conninfo *conninfo; | ||
71 | }; | 80 | }; |
72 | 81 | ||
73 | struct tls *tls_new(void); | 82 | struct tls *tls_new(void); |
@@ -89,5 +98,7 @@ int tls_set_errorx(struct tls *ctx, const char *fmt, ...) | |||
89 | __attribute__((__nonnull__ (2))); | 98 | __attribute__((__nonnull__ (2))); |
90 | int tls_ssl_error(struct tls *ctx, SSL *ssl_conn, int ssl_ret, | 99 | int tls_ssl_error(struct tls *ctx, SSL *ssl_conn, int ssl_ret, |
91 | const char *prefix); | 100 | const char *prefix); |
101 | int tls_get_conninfo(struct tls *ctx); | ||
102 | void tls_free_conninfo(struct tls_conninfo *conninfo); | ||
92 | 103 | ||
93 | #endif /* HEADER_TLS_INTERNAL_H */ | 104 | #endif /* HEADER_TLS_INTERNAL_H */ |