diff options
author | 2018-02-10 04:48:44 +0000 | |
---|---|---|
committer | 2018-02-10 04:48:44 +0000 | |
commit | f385e3b3c8cc473dedd28375400f112b72ea9b42 (patch) | |
tree | d111de2fa215b3dfb4b11d55febb20150a0696f1 /lib/libtls/tls_conninfo.c | |
parent | Remove NULL check from tls_conninfo_cert_pem() - all of the other conninfo (diff) | |
download | wireguard-openbsd-f385e3b3c8cc473dedd28375400f112b72ea9b42.tar.xz wireguard-openbsd-f385e3b3c8cc473dedd28375400f112b72ea9b42.zip |
Tidy/standardise some code.
Diffstat (limited to 'lib/libtls/tls_conninfo.c')
-rw-r--r-- | lib/libtls/tls_conninfo.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libtls/tls_conninfo.c b/lib/libtls/tls_conninfo.c index 208d1e10626..8e479ed84c1 100644 --- a/lib/libtls/tls_conninfo.c +++ b/lib/libtls/tls_conninfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_conninfo.c,v 1.19 2018/02/10 04:48:17 jsing Exp $ */ +/* $OpenBSD: tls_conninfo.c,v 1.20 2018/02/10 04:48:44 jsing Exp $ */ /* * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> * Copyright (c) 2015 Bob Beck <beck@openbsd.org> @@ -244,8 +244,7 @@ tls_conninfo_populate(struct tls *ctx) if ((tmp = SSL_get_cipher(ctx->ssl_conn)) == NULL) goto err; - ctx->conninfo->cipher = strdup(tmp); - if (ctx->conninfo->cipher == NULL) + if ((ctx->conninfo->cipher = strdup(tmp)) == NULL) goto err; if (ctx->servername != NULL) { @@ -256,8 +255,7 @@ tls_conninfo_populate(struct tls *ctx) if ((tmp = SSL_get_version(ctx->ssl_conn)) == NULL) goto err; - ctx->conninfo->version = strdup(tmp); - if (ctx->conninfo->version == NULL) + if ((ctx->conninfo->version = strdup(tmp)) == NULL) goto err; if (tls_get_peer_cert_info(ctx) == -1) @@ -337,4 +335,3 @@ tls_conn_version(struct tls *ctx) return (NULL); return (ctx->conninfo->version); } - |