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 */
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)
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 */
} while(0);
/* http://www.openssl.org/docs/crypto/buffer.html */
- if(NULL != buff1)
+ if(buff1)
OPENSSL_free(buff1);
return result;