return -1/0 instead of ssl specific return codes when setting crt/key files
authorFelix Fietkau <nbd@openwrt.org>
Fri, 4 Jan 2013 17:27:05 +0000 (18:27 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 4 Jan 2013 17:27:13 +0000 (18:27 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-ssl.c

index 471e29c10cdf31c9401746312fcd06479fa25433..ce32eb5761dfaf9ff1c4ca08e1ab32f3c9c20e2f 100644 (file)
@@ -221,7 +221,10 @@ static int _ustream_ssl_context_set_crt_file(void *ctx, const char *file)
        if (ret < 1)
                ret = SSL_CTX_use_certificate_file(ctx, file, SSL_FILETYPE_ASN1);
 
-       return ret;
+       if (ret < 1)
+               return -1;
+
+       return 0;
 }
 
 static int _ustream_ssl_context_set_key_file(void *ctx, const char *file)
@@ -232,7 +235,10 @@ static int _ustream_ssl_context_set_key_file(void *ctx, const char *file)
        if (ret < 1)
                ret = SSL_CTX_use_PrivateKey_file(ctx, file, SSL_FILETYPE_ASN1);
 
-       return ret;
+       if (ret < 1)
+               return -1;
+
+       return 0;
 }
 
 static void _ustream_ssl_context_free(void *ctx)