From 9d64ab7d5a15b9271bef58cc19d65da151e6ceb0 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 13 Oct 2014 22:22:49 +0200
Subject: [PATCH] pinning: minor code style policing

---
 lib/vtls/gtls.c    | 9 ++++++---
 lib/vtls/openssl.c | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
index 6ffe29798a..6666104b9d 100644
--- a/lib/vtls/gtls.c
+++ b/lib/vtls/gtls.c
@@ -692,8 +692,11 @@ static CURLcode pkp_pin_peer_pubkey(gnutls_x509_crt_t cert,
   CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
 
   /* if a path wasn't specified, don't pin */
-  if(NULL == pinnedpubkey) return CURLE_OK;
-  if(NULL == cert) return result;
+  if(NULL == pinnedpubkey)
+    return CURLE_OK;
+
+  if(NULL == cert)
+    return result;
 
   do {
     /* Begin Gyrations to get the public key     */
@@ -705,7 +708,7 @@ static CURLcode pkp_pin_peer_pubkey(gnutls_x509_crt_t cert,
 
     ret = gnutls_pubkey_export(key, GNUTLS_X509_FMT_DER, NULL, &len1);
     if(ret != GNUTLS_E_SHORT_MEMORY_BUFFER || len1 == 0)
-        break; /* failed */
+      break; /* failed */
 
     buff1 = malloc(len1);
     if(NULL == buff1)
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 6bf7275a9a..29cc78cad3 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -2376,8 +2376,11 @@ static CURLcode pkp_pin_peer_pubkey(X509* cert, const char *pinnedpubkey)
   CURLcode result = CURLE_SSL_PINNEDPUBKEYNOTMATCH;
 
   /* if a path wasn't specified, don't pin */
-  if(NULL == pinnedpubkey) return CURLE_OK;
-  if(NULL == cert) return result;
+  if(NULL == pinnedpubkey)
+    return CURLE_OK;
+
+  if(NULL == cert)
+    return result;
 
   do {
     /* Begin Gyrations to get the subjectPublicKeyInfo     */
@@ -2412,7 +2415,7 @@ static CURLcode pkp_pin_peer_pubkey(X509* cert, const char *pinnedpubkey)
   } while(0);
 
   /* http://www.openssl.org/docs/crypto/buffer.html */
-  if(NULL != buff1)
+  if(buff1)
     OPENSSL_free(buff1);
 
   return result;
-- 
GitLab