summaryrefslogtreecommitdiffstats
path: root/src/crypto/clientcert.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/clientcert.c')
-rw-r--r--src/crypto/clientcert.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/crypto/clientcert.c b/src/crypto/clientcert.c
index 5ce1f6c1a..6f6bf1135 100644
--- a/src/crypto/clientcert.c
+++ b/src/crypto/clientcert.c
@@ -116,7 +116,6 @@ static int clientcert_apply_settings ( void ) {
static void *cert = NULL;
static void *key = NULL;
int len;
- int rc;
/* Allow client certificate to be overridden only if
* not explicitly specified at build time.
@@ -129,14 +128,8 @@ static int clientcert_apply_settings ( void ) {
/* Fetch new client certificate, if any */
free ( cert );
- len = fetch_setting_copy ( NULL, &cert_setting, &cert );
- if ( len < 0 ) {
- rc = len;
- DBGC ( &client_certificate, "CLIENTCERT cannot fetch "
- "client certificate: %s\n", strerror ( rc ) );
- return rc;
- }
- if ( cert ) {
+ if ( ( len = fetch_setting_copy ( NULL, &cert_setting,
+ &cert ) ) >= 0 ) {
client_certificate.data = cert;
client_certificate.len = len;
}
@@ -147,14 +140,8 @@ static int clientcert_apply_settings ( void ) {
/* Fetch new client private key, if any */
free ( key );
- len = fetch_setting_copy ( NULL, &privkey_setting, &key );
- if ( len < 0 ) {
- rc = len;
- DBGC ( &client_certificate, "CLIENTCERT cannot fetch "
- "client private key: %s\n", strerror ( rc ) );
- return rc;
- }
- if ( key ) {
+ if ( ( len = fetch_setting_copy ( NULL, &privkey_setting,
+ &key ) ) >= 0 ) {
client_private_key.data = key;
client_private_key.len = len;
}