cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: FW: Maintainers of CURL,..., Heads up! (from cygwin-apps ML)

From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Wed, 16 Jan 2002 11:44:44 -0500

Here ya go. I have no idea if it's good code, but it should at least
give you a start. It works on *my* machine, of course I have very
up-to-date OpenSSL code. Unknown whether this will work on other
machines/build-environments/etc...

I did NOT alter it to use the "S" (status) indicator. I'll leave that up
to you guys if that's desired. A status of "f" is release, "0" is
initial-beta, and "1-e" would be in between.

I also didn't muck with any of the auto-config stuff. If a proper test
needs to be added for the existance of SSLeay() (over-and-above the test
that produces the value for USE_SSLEAY), could someone else please
volunteer? I haven't a clue how to create those.

--Kevin

$ diff -Nup lib/version.c.old lib/version.c
--- lib/version.c.old Thu Oct 11 05:35:54 2001
+++ lib/version.c Wed Jan 16 11:26:20 2002
@@ -41,17 +41,22 @@ char *curl_version(void)
 #if (SSLEAY_VERSION_NUMBER >= 0x906000)
   {
     char sub[2];
+ unsigned long ssleay_value;
     sub[1]='\0';
- if(SSLEAY_VERSION_NUMBER&0xff0) {
- sub[0]=((SSLEAY_VERSION_NUMBER>>4)&0xff) + 'a' -1;
+ ssleay_value=SSLeay();
+ if(ssleay_value < 0x906000) {
+ ssleay_value=SSLEAY_VERSION_NUMBER;
+ }
+ 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);
   }

Daniel Stenberg wrote:
>> The version of OpenSSL is returned by the function SSLeay(). It
returns a
>> hex number with the format
>>
>> MMNNFFPPS: M = major, N = minor, F = fix, p = patch, s = status.

> Seems easy enough. Anyone willing to help us make curl use this
function?
Received on 2002-01-16