aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls/cyassl.c
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2015-03-30 19:09:26 -0400
committerDaniel Stenberg <daniel@haxx.se>2015-04-01 08:10:58 +0200
commitb121633402b3ee8a370d456b2f0ddeb546024a70 (patch)
treece8ede6811d7893ced94064389d068eb3af980d5 /lib/vtls/cyassl.c
parentc84f0250e32823b3065a661ea4159380241ed011 (diff)
cyassl: Fix library initialization return value
(Curl_cyassl_init) - Return 1 on success, 0 in failure. Prior to this change the fail path returned an incorrect value and the evaluation to determine whether CyaSSL_Init had succeeded was incorrect. Ironically that combined with the way curl_global_init tests SSL library initialization (!Curl_ssl_init()) meant that CyaSSL having been successfully initialized would be seen as that even though the code path and return value in Curl_cyassl_init were wrong.
Diffstat (limited to 'lib/vtls/cyassl.c')
-rw-r--r--lib/vtls/cyassl.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c
index a8c1ba5f3..583930cf4 100644
--- a/lib/vtls/cyassl.c
+++ b/lib/vtls/cyassl.c
@@ -496,10 +496,7 @@ size_t Curl_cyassl_version(char *buffer, size_t size)
int Curl_cyassl_init(void)
{
- if(CyaSSL_Init() == 0)
- return 1;
-
- return -1;
+ return (CyaSSL_Init() == SSL_SUCCESS);
}