diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-01-16 17:45:08 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-01-16 17:45:08 +0000 |
commit | b3b4786990e94216bc5319621ad7b36602a6f704 (patch) | |
tree | f4b6ca1c6b160ee0ba888ae20bad2dabaa6081c2 | |
parent | fbe29075990218a02a0dab4dd65e3e0c93a38d86 (diff) |
Kevin Roth's SSLeay() patch, slight edited by me. Works with OpenSSL 0.9.5
now.
-rw-r--r-- | lib/version.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/version.c b/lib/version.c index ac30bf105..ecaec67c8 100644 --- a/lib/version.c +++ b/lib/version.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2000, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 2002, Daniel Stenberg, <daniel@haxx.se>, et al. * * In order to be useful for every potential user, curl and libcurl are * dual-licensed under the MPL and the MIT/X-derivate licenses. @@ -38,20 +38,28 @@ char *curl_version(void) #ifdef USE_SSLEAY -#if (SSLEAY_VERSION_NUMBER >= 0x906000) +#if (SSLEAY_VERSION_NUMBER >= 0x905000) { char sub[2]; + unsigned long ssleay_value; sub[1]='\0'; - if(SSLEAY_VERSION_NUMBER&0xff0) { - sub[0]=((SSLEAY_VERSION_NUMBER>>4)&0xff) + 'a' -1; - } - else + ssleay_value=SSLeay(); + if(ssleay_value < 0x906000) { + ssleay_value=SSLEAY_VERSION_NUMBER; sub[0]='\0'; + } + else { + if(ssleay_value&0xff0) { + sub[0]=((ssleay_value>>4)&0xff) + 'a' -1; + } + else + sub[0]='\0'; + } sprintf(ptr, " (OpenSSL %lx.%lx.%lx%s)", - (SSLEAY_VERSION_NUMBER>>28)&0xf, - (SSLEAY_VERSION_NUMBER>>20)&0xff, - (SSLEAY_VERSION_NUMBER>>12)&0xff, + (ssleay_value>>28)&0xf, + (ssleay_value>>20)&0xff, + (ssleay_value>>12)&0xff, sub); } |