From 87dcf54de2470c4a9dac63b7bac74e98ba7743e6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 4 Jan 2013 18:27:05 +0100 Subject: [PATCH] return -1/0 instead of ssl specific return codes when setting crt/key files Signed-off-by: Felix Fietkau --- ustream-ssl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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) -- 2.30.2