From: Felix Fietkau Date: Fri, 4 Jan 2013 17:27:05 +0000 (+0100) Subject: return -1/0 instead of ssl specific return codes when setting crt/key files X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=87dcf54de2470c4a9dac63b7bac74e98ba7743e6;p=oweals%2Fustream-ssl.git return -1/0 instead of ssl specific return codes when setting crt/key files Signed-off-by: Felix Fietkau --- diff --git a/ustream-ssl.c b/ustream-ssl.c index 471e29c..ce32eb5 100644 --- a/ustream-ssl.c +++ b/ustream-ssl.c @@ -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)