diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-04 18:27:05 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-04 18:27:13 +0100 |
commit | 87dcf54de2470c4a9dac63b7bac74e98ba7743e6 (patch) | |
tree | c4e32f054f91856d87b44bb92567051c95c580c0 | |
parent | 506b66018f6bd0eda3b7d31e1ac22bcb4fbd0720 (diff) | |
download | ustream-ssl-87dcf54de2470c4a9dac63b7bac74e98ba7743e6.tar.gz |
return -1/0 instead of ssl specific return codes when setting crt/key files
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | ustream-ssl.c | 10 |
1 files 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) |