Return type of SSL_ctrl

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Return type of SSL_ctrl

Ludwig, Mark
Greetings,

We're moving up to OpenSSL 1.0.2j from OpenSSL 0.9.8<something>, and noticed that the SSL
functions based on SSL_ctrl() changed from returning type int to returning type long.

It's not clear why this is necessary, by spot-checking the documented numerical domain of the
return values of the SSL functions (macros) deriving from SSL_ctrl().  Why was this done?

(I don't see mention of this in the CHANGES file.)

Thanks,

Mark Ludwig

Siemens Product Lifecycle Management Software Inc.
Communications and Government Affairs
Product Lifecycle Management
Lifecycle Coll
5939 Rice Creek Parkway
Shoreview, MN  55126 United States
Tel.      :+1 (651) 855-6140
Fax      :+1 (651) 855-6280
[hidden email]
www.siemens.com/plm

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Return type of SSL_ctrl

Salz, Rich
> We're moving up to OpenSSL 1.0.2j from OpenSSL 0.9.8<something>, and
> noticed that the SSL functions based on SSL_ctrl() changed from returning
> type int to returning type long.

The when and the why is probably lost to history.  Doing 'git log' and looking for SSL_ctrl doesn't show anything.

Oh well.

The "proper" answer is to not use long, but rather sized types, which we are slowly moving toward.
--  
Senior Architect, Akamai Technologies
Member, OpenSSL Dev Team
IM: [hidden email] Twitter: RichSalz

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Return type of SSL_ctrl

Ludwig, Mark
> From: Salz, Rich, Wednesday, November 30, 2016 9:38 AM
>
> > We're moving up to OpenSSL 1.0.2j from OpenSSL 0.9.8<something>, and
> > noticed that the SSL functions based on SSL_ctrl() changed from returning
> > type int to returning type long.
>
> The "proper" answer is to not use long, but rather sized types, which we are
> slowly moving toward.

Funny you should mention this, because this topic arose
internally after someone decided to change the return type
of SSL_ctrl() to intprt_t.  I have no idea why, since as far
as I can tell, all of the return values would fit in a
32-bit integer; thus my question about why it was changed to
long, which is either 32 bits or 64 bits, depending on
platform.  I suspect it was the use of long that tricked someone
into thinking it might be holding a pointer, and thus led to the
change to intptr_t, so it would fit on Windows.  (Blind/stupid
global replacement.)

(Does OpenSSL support any platform in which type int is 16 bits?)

Thanks,
Mark

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Return type of SSL_ctrl

Salz, Rich
> (Does OpenSSL support any platform in which type int is 16 bits?)

No.
--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Return type of SSL_ctrl

J. J. Farrell-2
In reply to this post by Ludwig, Mark
On 30/11/2016 17:38, Ludwig, Mark wrote:
From: Salz, Rich, Wednesday, November 30, 2016 9:38 AM

We're moving up to OpenSSL 1.0.2j from OpenSSL 0.9.8<something>, and
noticed that the SSL functions based on SSL_ctrl() changed from returning type int to returning type long.
The "proper" answer is to not use long, but rather sized types, which we are slowly moving toward.
Funny you should mention this, because this topic arose
internally after someone decided to change the return type
of SSL_ctrl() to intprt_t.  I have no idea why, since as far
as I can tell, all of the return values would fit in a
32-bit integer; thus my question about why it was changed to
long, which is either 32 bits or 64 bits, depending on
platform.  I suspect it was the use of long that tricked someone 
into thinking it might be holding a pointer, and thus led to the 
change to intptr_t, so it would fit on Windows.  (Blind/stupid
global replacement.)

(Does OpenSSL support any platform in which type int is 16 bits?)

Some confusion here. SSL_ctrl() was defined as returning long in 0.9.8a, and from what (little) I can see it looks like it was that way back in 0.6.4.

Regards,
                        jjf
-- 
J. J. Farrell
Not speaking for Oracle

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: Return type of SSL_ctrl

Ludwig, Mark
> From: Jeremy Farrell, Wednesday, November 30, 2016 12:25 PM

> Some confusion here. SSL_ctrl() was defined as returning long in 0.9.8a, and from what (little) I can see it looks like it was that way back in 0.6.4.

Right, I was confused by looking in derived internal source.
I had no idea we had modified it to change the return type from long to int.  (*Shrug*)

Thanks,
Mark

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users