summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2016-08-22 17:08:10 +0000
committerjsing <>2016-08-22 17:08:10 +0000
commitbcc6bdfd072b978bd3c76d5d543cb0053aef595d (patch)
treeadd80fc9521459b0a4ae75c7d44feb06f962d12f
parentbc8daaa54fcae91a1edfd7b0ee12e9e77df180e7 (diff)
downloadopenbsd-bcc6bdfd072b978bd3c76d5d543cb0053aef595d.tar.gz
openbsd-bcc6bdfd072b978bd3c76d5d543cb0053aef595d.tar.bz2
openbsd-bcc6bdfd072b978bd3c76d5d543cb0053aef595d.zip
Stick with the usual 'if NULL return NULL' idiom.
ok beck@
-rw-r--r--src/lib/libtls/tls_peer.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libtls/tls_peer.c b/src/lib/libtls/tls_peer.c
index 8a74613ef8..802a9c2780 100644
--- a/src/lib/libtls/tls_peer.c
+++ b/src/lib/libtls/tls_peer.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_peer.c,v 1.5 2015/10/07 23:33:38 beck Exp $ */ 1/* $OpenBSD: tls_peer.c,v 1.6 2016/08/22 17:08:10 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2015 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2015 Bob Beck <beck@openbsd.org>
@@ -26,24 +26,24 @@
26const char * 26const char *
27tls_peer_cert_hash(struct tls *ctx) 27tls_peer_cert_hash(struct tls *ctx)
28{ 28{
29 if (ctx->conninfo) 29 if (ctx->conninfo == NULL)
30 return (ctx->conninfo->hash); 30 return (NULL);
31 return NULL; 31 return (ctx->conninfo->hash);
32} 32}
33const char * 33const char *
34tls_peer_cert_issuer(struct tls *ctx) 34tls_peer_cert_issuer(struct tls *ctx)
35{ 35{
36 if (ctx->conninfo) 36 if (ctx->conninfo == NULL)
37 return (ctx->conninfo->issuer); 37 return (NULL);
38 return NULL; 38 return (ctx->conninfo->issuer);
39} 39}
40 40
41const char * 41const char *
42tls_peer_cert_subject(struct tls *ctx) 42tls_peer_cert_subject(struct tls *ctx)
43{ 43{
44 if (ctx->conninfo) 44 if (ctx->conninfo == NULL)
45 return (ctx->conninfo->subject); 45 return (NULL);
46 return NULL; 46 return (ctx->conninfo->subject);
47} 47}
48 48
49int 49int