diff options
author | Jose Alf <josealf@rocketmail.com> | 2014-08-13 08:47:56 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-08-13 08:49:19 +0200 |
commit | fc5a5a4f073eda85ead58c5b36f88eddcffba749 (patch) | |
tree | 5b829830a6e3070ab80b9c0583ac2d25a08e047f | |
parent | 01368d395ccdd8cae450c053f6275617850da60f (diff) |
openssl: fix version report for the 0.9.8 branch
Fixed libcurl to correctly output the newer versions of OpenSSL 0.9.8,
starting from openssl-0.9.8za.
-rw-r--r-- | lib/vtls/openssl.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 62d86c017..10f13385c 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2824,8 +2824,9 @@ size_t Curl_ossl_version(char *buffer, size_t size) #if(SSLEAY_VERSION_NUMBER >= 0x905000) { - char sub[2]; + char sub[3]; unsigned long ssleay_value; + sub[2]='\0'; sub[1]='\0'; ssleay_value=SSLeay(); if(ssleay_value < 0x906000) { @@ -2834,7 +2835,14 @@ size_t Curl_ossl_version(char *buffer, size_t size) } else { if(ssleay_value&0xff0) { - sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1); + int minor = (ssleay_value >> 4) & 0xff; + if(minor > 26) { /* handle extended version introduced for 0.9.8za */ + sub[1] = (char) ((minor - 1) % 26 + 'a' + 1); + sub[0] = 'z'; + } + else { + sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1); + } } else sub[0]='\0'; |