OpenSSL compilation errors in Windows

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

OpenSSL compilation errors in Windows

Nagalakshmi V J

Hi,

I am using openssl 1.1.c from our product code. While compiling the code, I am getting the errors which can be suppressed as warnings using -fpermissive flag in Linux (gcc/g++). In windows, I am getting the same compilation errors in visual studio (2005). Would like to know the alternative of -fpermissive flag that can be used in visual studio to suppress the errors.

I tried adding the flags such as '/fpermissive' , '/Ze' in module properties->C/C++->command Line->Additional options. But it did not resolve the problem.

Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to pointer to non-'void' requires an explicit cast

 

Since it is giving error in Openssl code, we cannot make any code changes there. Has anyone faced this kind of issue?

Please let me know how to resolve this issue.

 

 

 

Thanks and regards,

Nagalakshmi

 

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

AW: OpenSSL compilation errors in Windows

Matthias St. Pierre
> Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to pointer to non-'void' requires an explicit cast

Is it possible that your error message was copied incorrectly? Line 429 is an assignment from 'void *' to 'unsigned char*', not to 'unsigned char'.

Such an assignment is allowed in C (and the type is implicitly converted), but not in C++. Is it possible, that you are including this header in a module compiled with a C++ compiler? Note that this is an internal header file and not meant to be included by third party software.

HTH,
Matthias




Von: openssl-users <[hidden email]> Im Auftrag von Nagalakshmi V J
Gesendet: Montag, 30. September 2019 08:44
An: [hidden email]
Cc: Umamaheswari Nagarajan <[hidden email]>
Betreff: OpenSSL compilation errors in Windows

Hi,
I am using openssl 1.1.c from our product code. While compiling the code, I am getting the errors which can be suppressed as warnings using -fpermissive flag in Linux (gcc/g++). In windows, I am getting the same compilation errors in visual studio (2005). Would like to know the alternative of -fpermissive flag that can be used in visual studio to suppress the errors.
I tried adding the flags such as '/fpermissive' , '/Ze' in module properties->C/C++->command Line->Additional options. But it did not resolve the problem.
Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to pointer to non-'void' requires an explicit cast

Since it is giving error in Openssl code, we cannot make any code changes there. Has anyone faced this kind of issue?
Please let me know how to resolve this issue.



Thanks and regards,
Nagalakshmi

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Michael Mueller
In reply to this post by Nagalakshmi V J
We compile using Visual Studio. We don't use 'warnings as errors' and selected a warning level that minimized warnings. The 'make test' runs cleanly.



On Mon, Sep 30, 2019, 3:16 AM Nagalakshmi V J <[hidden email]> wrote:

Hi,

I am using openssl 1.1.c from our product code. While compiling the code, I am getting the errors which can be suppressed as warnings using -fpermissive flag in Linux (gcc/g++). In windows, I am getting the same compilation errors in visual studio (2005). Would like to know the alternative of -fpermissive flag that can be used in visual studio to suppress the errors.

I tried adding the flags such as '/fpermissive' , '/Ze' in module properties->C/C++->command Line->Additional options. But it did not resolve the problem.

Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to pointer to non-'void' requires an explicit cast

 

Since it is giving error in Openssl code, we cannot make any code changes there. Has anyone faced this kind of issue?

Please let me know how to resolve this issue.

 

 

 

Thanks and regards,

Nagalakshmi

 

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J

Hi Michael,

 

OpenSSL code is compiling without any issues. When it is used from our product code and while compiling using C++ compiler, the issue is seen.

 

We also don’t use the ‘warning as errors’ and warning level 3 we are using currently.

 

Thanks and regards,

Nagalakshmi

 

From: Michael Mueller <[hidden email]>
Sent: Monday, September 30, 2019 4:05 PM
To: Nagalakshmi V J <[hidden email]>
Cc: [hidden email]; Umamaheswari Nagarajan <[hidden email]>
Subject: Re: OpenSSL compilation errors in Windows

 

** This mail has been sent from an external source **

 

We compile using Visual Studio. We don't use 'warnings as errors' and selected a warning level that minimized warnings. The 'make test' runs cleanly.

 

 

 

On Mon, Sep 30, 2019, 3:16 AM Nagalakshmi V J <[hidden email]> wrote:

Hi,

I am using openssl 1.1.c from our product code. While compiling the code, I am getting the errors which can be suppressed as warnings using -fpermissive flag in Linux (gcc/g++). In windows, I am getting the same compilation errors in visual studio (2005). Would like to know the alternative of -fpermissive flag that can be used in visual studio to suppress the errors.

I tried adding the flags such as '/fpermissive' , '/Ze' in module properties->C/C++->command Line->Additional options. But it did not resolve the problem.

Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to pointer to non-'void' requires an explicit cast

 

Since it is giving error in Openssl code, we cannot make any code changes there. Has anyone faced this kind of issue?

Please let me know how to resolve this issue.

 

 

 

Thanks and regards,

Nagalakshmi

 

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J
In reply to this post by Matthias St. Pierre

Hi Matthias,

 

Yes that's right. The error message is

 

..\..\OpenSSL\openssl-1.1.1c\crypto\../ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast

 

Sorry, it was missed by mistake. So how can we avoid this?

 

In our code, We included “ssl_locl.h” which in turn includes packet_locl.h. Any way to avoid this kind of error?

 

Thanks and regards,

Nagalakshmi

 

-----Original Message-----
From: Dr. Matthias St. Pierre <[hidden email]>
Sent: Monday, September 30, 2019 2:10 PM
To: Nagalakshmi V J <[hidden email]>; [hidden email]
Cc: Umamaheswari Nagarajan <[hidden email]>
Subject: AW: OpenSSL compilation errors in Windows

 

** This mail has been sent from an external source **

 

 

> Getting the errors like below. ssl/packet_locl.h(429) : error C2440:

> '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from

> 'void' to pointer to non-'void' requires an explicit cast

 

Is it possible that your error message was copied incorrectly? Line 429 is an assignment from 'void *' to 'unsigned char*', not to 'unsigned char'.

 

Such an assignment is allowed in C (and the type is implicitly converted), but not in C++. Is it possible, that you are including this header in a module compiled with a C++ compiler? Note that this is an internal header file and not meant to be included by third party software.

 

HTH,

Matthias

 

 

 

 

 

 

Dr. Matthias St. Pierre

Senior Software Engineer

[hidden email]

Phone: +49 911 9968-0

www.ncp-e.com

 

Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 • Nuremberg North American HQ: NCP engineering Inc. • 678 Georgia Ave. • Sunnyvale, CA 94085 East Coast Office: NCP engineering Inc. • 601 Cleveland Str., Suite 501-25 • Clearwater, FL 33755

 

Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich Registry Court: Lower District Court of Nuremberg Commercial register No.: HRB 7786 Nuremberg, VAT identification No.: DE 133557619

 

This e-mail message including any attachments is for the sole use of the intended recipient(s) and may contain privileged or confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately contact the sender by reply e-mail and delete the original message and destroy all copies thereof.

Von: openssl-users <[hidden email]> Im Auftrag von Nagalakshmi V J

Gesendet: Montag, 30. September 2019 08:44

An: [hidden email]

Cc: Umamaheswari Nagarajan <[hidden email]>

Betreff: OpenSSL compilation errors in Windows

 

Hi,

I am using openssl 1.1.c from our product code. While compiling the code, I am getting the errors which can be suppressed as warnings using -fpermissive flag in Linux (gcc/g++). In windows, I am getting the same compilation errors in visual studio (2005). Would like to know the alternative of -fpermissive flag that can be used in visual studio to suppress the errors.

I tried adding the flags such as '/fpermissive' , '/Ze' in module properties->C/C++->command Line->Additional options. But it did not resolve the problem.

Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to pointer to non-'void' requires an explicit cast

 

Since it is giving error in Openssl code, we cannot make any code changes there. Has anyone faced this kind of issue?

Please let me know how to resolve this issue.

 

 

 

Thanks and regards,

Nagalakshmi

 

=====================================================

Please refer to https://northamerica.altran.com/email-disclaimer

for important disclosures regarding this electronic communication.

=====================================================

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Matt Caswell-2


On 30/09/2019 11:56, Nagalakshmi V J wrote:

> In our code, We included “ssl_locl.h” which in turn includes packet_locl.h. Any
> way to avoid this kind of error?

Don't include "ssl_locl.h"!!! This is an internal header file and relying on it
is likely to cause problems for you. There are no stability guarantees if you
use internal stuff. For example commit b5acbf9148 just renamed that file to
ssl_local.h. That change will be in OpenSSL 1.1.1e - so your code will break at
that point if you upgrade.

Anything in your code that relies on that internal data will need to be
rewritten to use the public APIs instead.

Matt


>
>  
>
> Thanks and regards,
>
> Nagalakshmi
>
>  
>
> -----Original Message-----
> From: Dr. Matthias St. Pierre <[hidden email]>
> Sent: Monday, September 30, 2019 2:10 PM
> To: Nagalakshmi V J <[hidden email]>; [hidden email]
> Cc: Umamaheswari Nagarajan <[hidden email]>
> Subject: AW: OpenSSL compilation errors in Windows
>
>  
>
> ** This mail has been sent from an external source **
>
>  
>
>  
>
>> Getting the errors like below. ssl/packet_locl.h(429) : error C2440:
>
>> '=' : cannot convert from 'void *' to 'unsigned char 'Conversion from
>
>> 'void' to pointer to non-'void' requires an explicit cast
>
>  
>
> Is it possible that your error message was copied incorrectly? Line 429 is an
> assignment from 'void *' to 'unsigned char*', not to 'unsigned char'.
>
>  
>
> Such an assignment is allowed in C (and the type is implicitly converted), but
> not in C++. Is it possible, that you are including this header in a module
> compiled with a C++ compiler? Note that this is an internal header file and not
> meant to be included by third party software.
>
>  
>
> HTH,
>
> Matthias
>
>  
>
>  
>
>  
>
>  
>
>  
>
>  
>
> Dr. Matthias St. Pierre
>
> Senior Software Engineer
>
> [hidden email] <mailto:[hidden email]>
>
> Phone: +49 911 9968-0
>
> www.ncp-e.com <http://www.ncp-e.com>
>
>  
>
> Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 •
> Nuremberg North American HQ: NCP engineering Inc. • 678 Georgia Ave. •
> Sunnyvale, CA 94085 East Coast Office: NCP engineering Inc. • 601 Cleveland
> Str., Suite 501-25 • Clearwater, FL 33755
>
>  
>
> Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich
> Registry Court: Lower District Court of Nuremberg Commercial register No.: HRB
> 7786 Nuremberg, VAT identification No.: DE 133557619
>
>  
>
> This e-mail message including any attachments is for the sole use of the
> intended recipient(s) and may contain privileged or confidential information.
> Any unauthorized review, use, disclosure or distribution is prohibited. If you
> are not the intended recipient, please immediately contact the sender by reply
> e-mail and delete the original message and destroy all copies thereof.
>
> Von: openssl-users <[hidden email]
> <mailto:[hidden email]>> Im Auftrag von Nagalakshmi V J
>
> Gesendet: Montag, 30. September 2019 08:44
>
> An: [hidden email] <mailto:[hidden email]>
>
> Cc: Umamaheswari Nagarajan <[hidden email]
> <mailto:[hidden email]>>
>
> Betreff: OpenSSL compilation errors in Windows
>
>  
>
> Hi,
>
> I am using openssl 1.1.c from our product code. While compiling the code, I am
> getting the errors which can be suppressed as warnings using -fpermissive flag
> in Linux (gcc/g++). In windows, I am getting the same compilation errors in
> visual studio (2005). Would like to know the alternative of -fpermissive flag
> that can be used in visual studio to suppress the errors.
>
> I tried adding the flags such as '/fpermissive' , '/Ze' in module
> properties->C/C++->command Line->Additional options. But it did not resolve the
> problem.
>
> Getting the errors like below. ssl/packet_locl.h(429) : error C2440: '=' :
> cannot convert from 'void *' to 'unsigned char 'Conversion from 'void' to
> pointer to non-'void' requires an explicit cast
>
>  
>
> Since it is giving error in Openssl code, we cannot make any code changes there.
> Has anyone faced this kind of issue?
>
> Please let me know how to resolve this issue.
>
>  
>
>  
>
>  
>
> Thanks and regards,
>
> Nagalakshmi
>
>  
>
> =====================================================
>
> Please refer to https://northamerica.altran.com/email-disclaimer
>
> for important disclosures regarding this electronic communication.
>
> =====================================================
>
> =====================================================
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =====================================================
Reply | Threaded
Open this post in threaded view
|

AW: OpenSSL compilation errors in Windows

Matthias St. Pierre
In reply to this post by Nagalakshmi V J

> OpenSSL code is compiling without any issues. When it is used from our product code and while compiling using C++ compiler, the issue is seen.

 

As I wrote previously, the error you posted was caused  by the fact that you are compiling Ansi C (a.k.a ISO/IEC 9899:1990, a.k.a C90) source code

using a C++ compiler. While C permits a cast from ‘void *’ to ‘anytype *’, C++ doesn’t allow it without an explicit cast.

 

Only the *public* OpenSSL headers are guaranteed to be includable by a C++ compiler (they contain the necessary ` extern “C” ` blocks, etc.),

not the internal headers. Including *internal* headers is neither supported nor possible with a C++ compiler. And as Matt Caswell already told you,

there are no compatibility guarantees for those headers.

 

Matthias

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Sergio NNX
Ciao.

I haven't had a chance to compile the exact OpenSSL version using g++ compiler as stated by the user/poster.

If this user is using a modified or altered version of OpenSSL provided source code, is there support available? Don't get me wrong, I don't mind helping out but .....

I'll try to compile OpenSSL source code this evening and I'll post my findings here.

Regards.

Sergio.


From: openssl-users <[hidden email]> on behalf of Dr. Matthias St. Pierre <[hidden email]>
Sent: Tuesday, 1 October 2019 12:28 AM
To: Nagalakshmi V J <[hidden email]>; Michael Mueller <[hidden email]>
Cc: [hidden email] <[hidden email]>; Umamaheswari Nagarajan <[hidden email]>
Subject: AW: OpenSSL compilation errors in Windows
 

> OpenSSL code is compiling without any issues. When it is used from our product code and while compiling using C++ compiler, the issue is seen.

 

As I wrote previously, the error you posted was caused  by the fact that you are compiling Ansi C (a.k.a ISO/IEC 9899:1990, a.k.a C90) source code

using a C++ compiler. While C permits a cast from ‘void *’ to ‘anytype *’, C++ doesn’t allow it without an explicit cast.

 

Only the *public* OpenSSL headers are guaranteed to be includable by a C++ compiler (they contain the necessary ` extern “C” ` blocks, etc.),

not the internal headers. Including *internal* headers is neither supported nor possible with a C++ compiler. And as Matt Caswell already told you,

there are no compatibility guarantees for those headers.

 

Matthias

 

 

 

Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J

Hi Sergio,

 

We are using OpenSSL APIs in our product code. We are not making any changes in OpenSSL. Our product code is a C++ code and it makes use of openSSL APIs for some functionality.

 

This compilation error we are getting in Linux and windows platforms. But in Linux, we have a ‘-fpermissive’ flag which is suppressing those errors as warnings and so compilation is getting successful.

 

The issue here is in Windows , we are not able to find alternative flag for –‘fpermissive’ in Visual studio and due to that compilation is unsuccessful. It would be helpful if anyone suggests some option to get the compilation successful.

 

Thanks and regards,

Nagalakshmi

 

From: Sergio NNX <[hidden email]>
Sent: Monday, September 30, 2019 9:06 PM
To: Dr. Matthias St. Pierre <[hidden email]>; Nagalakshmi V J <[hidden email]>; Michael Mueller <[hidden email]>
Cc: [hidden email]; Umamaheswari Nagarajan <[hidden email]>
Subject: Re: OpenSSL compilation errors in Windows

 

** This mail has been sent from an external source **

 

Ciao.

 

I haven't had a chance to compile the exact OpenSSL version using g++ compiler as stated by the user/poster.

 

If this user is using a modified or altered version of OpenSSL provided source code, is there support available? Don't get me wrong, I don't mind helping out but .....

 

I'll try to compile OpenSSL source code this evening and I'll post my findings here.

 

Regards.

 

Sergio.

 


From: openssl-users <[hidden email]> on behalf of Dr. Matthias St. Pierre <[hidden email]>
Sent: Tuesday, 1 October 2019 12:28 AM
To: Nagalakshmi V J <[hidden email]>; Michael Mueller <[hidden email]>
Cc: [hidden email] <[hidden email]>; Umamaheswari Nagarajan <[hidden email]>
Subject: AW: OpenSSL compilation errors in Windows

 

> OpenSSL code is compiling without any issues. When it is used from our product code and while compiling using C++ compiler, the issue is seen.

 

As I wrote previously, the error you posted was caused  by the fact that you are compiling Ansi C (a.k.a ISO/IEC 9899:1990, a.k.a C90) source code

using a C++ compiler. While C permits a cast from ‘void *’ to ‘anytype *’, C++ doesn’t allow it without an explicit cast.

 

Only the *public* OpenSSL headers are guaranteed to be includable by a C++ compiler (they contain the necessary ` extern “C” ` blocks, etc.),

not the internal headers. Including *internal* headers is neither supported nor possible with a C++ compiler. And as Matt Caswell already told you,

there are no compatibility guarantees for those headers.

 

Matthias

 

 

 

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

AW: OpenSSL compilation errors in Windows

Matthias St. Pierre
> We are using OpenSSL APIs in our product code. We are not making any changes in OpenSSL.
> Our product code is a C++ code and it makes use of openSSL APIs for some functionality.

Local headers (like "ssl_locl.h" and "packet_locl.h") are *NOT* part of the official OpenSSL API.
Please don't expect any support w.r.t. compilation or compatibility problems if you do include
them in your application, even more if it's compiled using a C++ compiler.

It would be more helpful if you would tell us *why* you are including ssl_locl.h and what you
are trying to achieve. Then we might be able to tell you how you could achieve your goal using
the officially supported API.

Please note that many of the OpenSSL structures were made opaque in version 1.1.0. This means
that there are only forward declarations of the structures in the public headers and the compiler
does not get to  see the structure members. Instead of directly accessing the members, it is now
necessary to use accessor functions (a.k.a. getters and setters). If this is the reason why you are
including private OpenSSL headers then you should adopt you application to use the new
accessors instead, instead of forcing the impossible to circumvent the new policy.

For more information, see

        https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes

Matthias



Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

OpenSSL - User mailing list
In reply to this post by Nagalakshmi V J

Several people have told you the following:

                That is an *internal* openssl header file; do not use it. Remove the include statement from your code.  Your code is wrong.

                That file is a C file, not compatible with C++

 

Why do you not listen?

Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J
In reply to this post by Matthias St. Pierre
Thank you Matthias for the explanation. I am going through my code to understand why ssl_locl.h is included. I will check and get back on this ASAP. Also if there is other way to achieve that I will use the same.

Thanks and regards,
Nagalakshmi

-----Original Message-----
From: Dr. Matthias St. Pierre <[hidden email]>
Sent: Tuesday, October 1, 2019 4:43 PM
To: Nagalakshmi V J <[hidden email]>
Cc: [hidden email]; Umamaheswari Nagarajan <[hidden email]>
Subject: AW: OpenSSL compilation errors in Windows

** This mail has been sent from an external source **


> We are using OpenSSL APIs in our product code. We are not making any changes in OpenSSL.
> Our product code is a C++ code and it makes use of openSSL APIs for some functionality.

Local headers (like "ssl_locl.h" and "packet_locl.h") are *NOT* part of the official OpenSSL API.
Please don't expect any support w.r.t. compilation or compatibility problems if you do include them in your application, even more if it's compiled using a C++ compiler.

It would be more helpful if you would tell us *why* you are including ssl_locl.h and what you are trying to achieve. Then we might be able to tell you how you could achieve your goal using the officially supported API.

Please note that many of the OpenSSL structures were made opaque in version 1.1.0. This means that there are only forward declarations of the structures in the public headers and the compiler does not get to  see the structure members. Instead of directly accessing the members, it is now necessary to use accessor functions (a.k.a. getters and setters). If this is the reason why you are including private OpenSSL headers then you should adopt you application to use the new accessors instead, instead of forcing the impossible to circumvent the new policy.

For more information, see

https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.openssl.org_index.php_OpenSSL-5F1.1.0-5FChanges&d=DwIGaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=wpEV8Q2RDZjERhtJGZl9HajV9jd2dJFF10J30_YrPQo&s=sX1YilJaXloAQDzrjD3Lz-I6DOej3QduhsAanXOYxVM&e=

Matthias





Dr. Matthias St. Pierre
Senior Software Engineer
[hidden email]
Phone: +49 911 9968-0
 www.ncp-e.com

Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 • Nuremberg North American HQ: NCP engineering Inc. • 678 Georgia Ave. • Sunnyvale, CA 94085 East Coast Office: NCP engineering Inc. • 601 Cleveland Str., Suite 501-25 • Clearwater, FL 33755

Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich Registry Court: Lower District Court of Nuremberg Commercial register No.: HRB 7786 Nuremberg, VAT identification No.: DE 133557619

This e-mail message including any attachments is for the sole use of the intended recipient(s) and may contain privileged or confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately contact the sender by reply e-mail and delete the original message and destroy all copies thereof.
=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J
In reply to this post by OpenSSL - User mailing list

Hi Salz,

 

I am working on that only. I will try to not use those internal files as per the suggestions.

 

Thanks and regards,

Nagalakshmi

 

From: Salz, Rich <[hidden email]>
Sent: Tuesday, October 1, 2019 6:30 PM
To: Nagalakshmi V J <[hidden email]>; Sergio NNX <[hidden email]>; Dr. Matthias St. Pierre <[hidden email]>; Michael Mueller <[hidden email]>
Cc: [hidden email]; Umamaheswari Nagarajan <[hidden email]>
Subject: Re: OpenSSL compilation errors in Windows

 

** This mail has been sent from an external source **

 

Several people have told you the following:

                That is an *internal* openssl header file; do not use it. Remove the include statement from your code.  Your code is wrong.

                That file is a C file, not compatible with C++

 

Why do you not listen?

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J
In reply to this post by Nagalakshmi V J

Hi Matthias,

 

Please find my response for your queries below.

 

It would be more helpful if you would tell us *why* you are including ssl_locl.h and what you are trying to achieve. Then we might be able to tell you how you could achieve your goal using the officially supported API.

[Nagalakshmi]:

In our product code, we are using the structures 'ssl_st'  and 'ssl_session_st' which were defined in ssl.h file in Openssl 1.0.2.j version.

Since the structure definitions are made opaque in openssl 1.1.1c, we used ssl_locl.h where the structure definitions are available.

 

Please note that many of the OpenSSL structures were made opaque in version 1.1.0. This means that there are only forward declarations of the structures in the public headers and the compiler does not get to  see the structure members. Instead of directly accessing the members, it is now necessary to use accessor functions (a.k.a. getters and setters).

[Nagalakshmi]:

Regarding usage of accessor functions, I got the following APIs.

SSL_get_session(s)

SSL_SESSION_get_master_key().

 

If we use those APIs, I am again getting errors like the below.

.\odlibPrf_OSSL.h(164) : error C2027: use of undefined type 'ssl_session_st'

        ..\..\OpenSSL\openssl-1.1.1c\include\openssl/ssl.h(213) : see declaration of 'ssl_session_st'

.\odlibPrf_OSSL.h(164) : error C2227: left of '->SSL_SESSION_get_master_key' must point to class/struct/union

.\odlibPrf_OSSL.h(167) : error C2027: use of undefined type 'ssl_st'

        ..\..\OpenSSL\openssl-1.1.1c\include\openssl/ossl_typ.h(147) : see declaration of 'ssl_st'

.\odlibPrf_OSSL.h(167) : error C2227: left of '->session' must point to class/struct/union

.\odlibPrf_OSSL.h(167) : error C2227: left of '->master_key' must point to class/struct/union

.\odlibPrf_OSSL.h(168) : error C2027: use of undefined type 'ssl_st'

 

Can you help me to get the corresponding accessor functions for these 2 structures.

 

Thanks and regards,

Nagalakshmi

 

-----Original Message-----
From: Nagalakshmi V J <[hidden email]>
Sent: Tuesday, October 1, 2019 6:33 PM
To: Dr. Matthias St. Pierre <[hidden email]>; Nagalakshmi V J <[hidden email]>
Cc: [hidden email]; Umamaheswari Nagarajan <[hidden email]>
Subject: RE: OpenSSL compilation errors in Windows

 

Thank you Matthias for the explanation. I am going through my code to understand why ssl_locl.h is included. I will check and get back on this ASAP. Also if there is other way to achieve that I will use the same.

 

Thanks and regards,

Nagalakshmi

 

-----Original Message-----

From: Dr. Matthias St. Pierre <[hidden email]>

Sent: Tuesday, October 1, 2019 4:43 PM

To: Nagalakshmi V J <[hidden email]>

Cc: [hidden email]; Umamaheswari Nagarajan <[hidden email]>

Subject: AW: OpenSSL compilation errors in Windows

 

** This mail has been sent from an external source **

 

 

> We are using OpenSSL APIs in our product code. We are not making any changes in OpenSSL.

> Our product code is a C++ code and it makes use of openSSL APIs for some functionality.

 

Local headers (like "ssl_locl.h" and "packet_locl.h") are *NOT* part of the official OpenSSL API.

Please don't expect any support w.r.t. compilation or compatibility problems if you do include them in your application, even more if it's compiled using a C++ compiler.

 

It would be more helpful if you would tell us *why* you are including ssl_locl.h and what you are trying to achieve. Then we might be able to tell you how you could achieve your goal using the officially supported API.

 

Please note that many of the OpenSSL structures were made opaque in version 1.1.0. This means that there are only forward declarations of the structures in the public headers and the compiler does not get to  see the structure members. Instead of directly accessing the members, it is now necessary to use accessor functions (a.k.a. getters and setters). If this is the reason why you are including private OpenSSL headers then you should adopt you application to use the new accessors instead, instead of forcing the impossible to circumvent the new policy.

 

For more information, see

 

https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.openssl.org_index.php_OpenSSL-5F1.1.0-5FChanges&d=DwIGaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=wpEV8Q2RDZjERhtJGZl9HajV9jd2dJFF10J30_YrPQo&s=sX1YilJaXloAQDzrjD3Lz-I6DOej3QduhsAanXOYxVM&e=

 

Matthias

 

 

 

 

 

Dr. Matthias St. Pierre

Senior Software Engineer

[hidden email]

Phone: +49 911 9968-0

www.ncp-e.com

 

Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 • Nuremberg North American HQ: NCP engineering Inc. • 678 Georgia Ave. • Sunnyvale, CA 94085 East Coast Office: NCP engineering Inc. • 601 Cleveland Str., Suite 501-25 • Clearwater, FL 33755

 

Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich Registry Court: Lower District Court of Nuremberg Commercial register No.: HRB 7786 Nuremberg, VAT identification No.: DE 133557619

 

This e-mail message including any attachments is for the sole use of the intended recipient(s) and may contain privileged or confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please immediately contact the sender by reply e-mail and delete the original message and destroy all copies thereof.

=====================================================

Please refer to https://northamerica.altran.com/email-disclaimer

for important disclosures regarding this electronic communication.

=====================================================

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Matt Caswell-2


On 03/10/2019 11:10, Nagalakshmi V J wrote:

> Hi Matthias,
>
>  
>
> Please find my response for your queries below.
>
>  
>
> It would be more helpful if you would tell us *why* you are including ssl_locl.h
> and what you are trying to achieve. Then we might be able to tell you how you
> could achieve your goal using the officially supported API.
>
> [Nagalakshmi]:
>
> In our product code, we are using the structures 'ssl_st'  and 'ssl_session_st'
> which were defined in ssl.h file in Openssl 1.0.2.j version.
>
> Since the structure definitions are made opaque in openssl 1.1.1c, we used
> ssl_locl.h where the structure definitions are available.
>
>  
>
> Please note that many of the OpenSSL structures were made opaque in version
> 1.1.0. This means that there are only forward declarations of the structures in
> the public headers and the compiler does not get to  see the structure members.
> Instead of directly accessing the members, it is now necessary to use accessor
> functions (a.k.a. getters and setters).
>
> [Nagalakshmi]:
>
> Regarding usage of accessor functions, I got the following APIs.
>
> SSL_get_session(s)
>
> SSL_SESSION_get_master_key().
>
>  
>
> If we use those APIs, I am again getting errors like the below.
>
> /.\odlibPrf_OSSL.h(164) : error C2027: use of undefined type 'ssl_session_st'/
>
> /        ..\..\OpenSSL\openssl-1.1.1c\include\openssl/ssl.h(213) : see
> declaration of 'ssl_session_st'/
>
> /.\odlibPrf_OSSL.h(164) : error C2227: left of '->SSL_SESSION_get_master_key'
> must point to class/struct/union/

This at least looks like a syntax error.


>
> /.\odlibPrf_OSSL.h(167) : error C2027: use of undefined type 'ssl_st'/
>
> /        ..\..\OpenSSL\openssl-1.1.1c\include\openssl/ossl_typ.h(147) : see
> declaration of 'ssl_st'/
>
> /.\odlibPrf_OSSL.h(167) : error C2227: left of '->session' must point to
> class/struct/union/
>
> /.\odlibPrf_OSSL.h(167) : error C2227: left of '->master_key' must point to
> class/struct/union/

These suggest you're still trying to direct access structure members.


>
> /.\odlibPrf_OSSL.h(168) : error C2027: use of undefined type 'ssl_st'/


Please show us the source code for the lines these error message correspond to.

Matt

>
>  
>
> Can you help me to get the corresponding accessor functions for these 2 structures.
>
>  
>
> Thanks and regards,
>
> Nagalakshmi
>
>  
>
> -----Original Message-----
> From: Nagalakshmi V J <[hidden email]>
> Sent: Tuesday, October 1, 2019 6:33 PM
> To: Dr. Matthias St. Pierre <[hidden email]>; Nagalakshmi V J
> <[hidden email]>
> Cc: [hidden email]; Umamaheswari Nagarajan
> <[hidden email]>
> Subject: RE: OpenSSL compilation errors in Windows
>
>  
>
> Thank you Matthias for the explanation. I am going through my code to understand
> why ssl_locl.h is included. I will check and get back on this ASAP. Also if
> there is other way to achieve that I will use the same.
>
>  
>
> Thanks and regards,
>
> Nagalakshmi
>
>  
>
> -----Original Message-----
>
> From: Dr. Matthias St. Pierre <[hidden email]
> <mailto:[hidden email]>>
>
> Sent: Tuesday, October 1, 2019 4:43 PM
>
> To: Nagalakshmi V J <[hidden email] <mailto:[hidden email]>>
>
> Cc: [hidden email] <mailto:[hidden email]>; Umamaheswari
> Nagarajan <[hidden email]
> <mailto:[hidden email]>>
>
> Subject: AW: OpenSSL compilation errors in Windows
>
>  
>
> ** This mail has been sent from an external source **
>
>  
>
>  
>
>> We are using OpenSSL APIs in our product code. We are not making any changes
> in OpenSSL.
>
>> Our product code is a C++ code and it makes use of openSSL APIs for some
> functionality.
>
>  
>
> Local headers (like "ssl_locl.h" and "packet_locl.h") are *NOT* part of the
> official OpenSSL API.
>
> Please don't expect any support w.r.t. compilation or compatibility problems if
> you do include them in your application, even more if it's compiled using a C++
> compiler.
>
>  
>
> It would be more helpful if you would tell us *why* you are including ssl_locl.h
> and what you are trying to achieve. Then we might be able to tell you how you
> could achieve your goal using the officially supported API.
>
>  
>
> Please note that many of the OpenSSL structures were made opaque in version
> 1.1.0. This means that there are only forward declarations of the structures in
> the public headers and the compiler does not get to  see the structure members.
> Instead of directly accessing the members, it is now necessary to use accessor
> functions (a.k.a. getters and setters). If this is the reason why you are
> including private OpenSSL headers then you should adopt you application to use
> the new accessors instead, instead of forcing the impossible to circumvent the
> new policy.
>
>  
>
> For more information, see
>
>  
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.openssl.org_index.php_OpenSSL-5F1.1.0-5FChanges&d=DwIGaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=wpEV8Q2RDZjERhtJGZl9HajV9jd2dJFF10J30_YrPQo&s=sX1YilJaXloAQDzrjD3Lz-I6DOej3QduhsAanXOYxVM&e=
>
>  
>
> Matthias
>
>  
>
>  
>
>  
>
>  
>
>  
>
> Dr. Matthias St. Pierre
>
> Senior Software Engineer
>
> [hidden email] <mailto:[hidden email]>
>
> Phone: +49 911 9968-0
>
> www.ncp-e.com <http://www.ncp-e.com>
>
>  
>
> Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449 •
> Nuremberg North American HQ: NCP engineering Inc. • 678 Georgia Ave. •
> Sunnyvale, CA 94085 East Coast Office: NCP engineering Inc. • 601 Cleveland
> Str., Suite 501-25 • Clearwater, FL 33755
>
>  
>
> Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate Dietrich
> Registry Court: Lower District Court of Nuremberg Commercial register No.: HRB
> 7786 Nuremberg, VAT identification No.: DE 133557619
>
>  
>
> This e-mail message including any attachments is for the sole use of the
> intended recipient(s) and may contain privileged or confidential information.
> Any unauthorized review, use, disclosure or distribution is prohibited. If you
> are not the intended recipient, please immediately contact the sender by reply
> e-mail and delete the original message and destroy all copies thereof.
>
> =====================================================
>
> Please refer to https://northamerica.altran.com/email-disclaimer
>
> for important disclosures regarding this electronic communication.
>
> =====================================================
>
> =====================================================
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J
Hi Matt,

Sorry I missed your reply as all the conversations are jumbled in that mail.

Please find the sample code snippet. This is a small part.  Like the below sample, we are using SSL and SSL_SESSION structures in many places.

struct PRF_GENERATOR
{
    unsigned char master_secret[48];
    unsigned char server_random[32];
    unsigned char client_random[32];
};


int functionA(SSL* s, PRF_GENERATOR* pGenerator)
{

    if( s->session->master_key_length != sizeof(pGenerator->master_secret) )
        return -1;
    memcpy(pGenerator->master_secret, s->session->master_key, sizeof(pGenerator->master_secret));
    memcpy(pGenerator->server_random, s->s3->server_random, sizeof(pGenerator->server_random));
    memcpy(pGenerator->client_random, s->s3->client_random, sizeof(pGenerator->client_random));
    return 0;
}

In the above function, they are accessing the session from SSL structure as s->session (using openssl 1.0.2j). We cannot access like this 1.1.1c. So we need to use the accessor API which is SSL_get_session(s).
Referred this link (https://www.openssl.org/docs/man1.1.0/man7/ssl.html)

Now the issue is SSL_session structure is also having accessor APIs which I am not aware of. So I need to get the APIs for accessing the master_key_length,etc.. given in the above code. Those are not listed in the openssl link referred.

It would be helpful if I can get to know about the accessor APIs. If you know any documentation link which talks about accessor APIs or any files where all these details are there, you can refer me that.

Kindly let me know if you have any queries with respect to this sample code.

Thanks and regards,
Nagalakshmi

-----Original Message-----
From: openssl-users <[hidden email]> On Behalf Of Matt Caswell
Sent: Thursday, October 3, 2019 6:51 PM
To: [hidden email]
Subject: Re: OpenSSL compilation errors in Windows

** This mail has been sent from an external source **


On 03/10/2019 11:10, Nagalakshmi V J wrote:

> Hi Matthias,
>
>
>
> Please find my response for your queries below.
>
>
>
> It would be more helpful if you would tell us *why* you are including
> ssl_locl.h and what you are trying to achieve. Then we might be able
> to tell you how you could achieve your goal using the officially supported API.
>
> [Nagalakshmi]:
>
> In our product code, we are using the structures 'ssl_st'  and 'ssl_session_st'
> which were defined in ssl.h file in Openssl 1.0.2.j version.
>
> Since the structure definitions are made opaque in openssl 1.1.1c, we
> used ssl_locl.h where the structure definitions are available.
>
>
>
> Please note that many of the OpenSSL structures were made opaque in
> version 1.1.0. This means that there are only forward declarations of
> the structures in the public headers and the compiler does not get to  see the structure members.
> Instead of directly accessing the members, it is now necessary to use
> accessor functions (a.k.a. getters and setters).
>
> [Nagalakshmi]:
>
> Regarding usage of accessor functions, I got the following APIs.
>
> SSL_get_session(s)
>
> SSL_SESSION_get_master_key().
>
>
>
> If we use those APIs, I am again getting errors like the below.
>
> /.\odlibPrf_OSSL.h(164) : error C2027: use of undefined type
> 'ssl_session_st'/
>
> /        ..\..\OpenSSL\openssl-1.1.1c\include\openssl/ssl.h(213) : see
> declaration of 'ssl_session_st'/
>
> /.\odlibPrf_OSSL.h(164) : error C2227: left of '->SSL_SESSION_get_master_key'
> must point to class/struct/union/

This at least looks like a syntax error.


>
> /.\odlibPrf_OSSL.h(167) : error C2027: use of undefined type 'ssl_st'/
>
> /        ..\..\OpenSSL\openssl-1.1.1c\include\openssl/ossl_typ.h(147) : see
> declaration of 'ssl_st'/
>
> /.\odlibPrf_OSSL.h(167) : error C2227: left of '->session' must point
> to class/struct/union/
>
> /.\odlibPrf_OSSL.h(167) : error C2227: left of '->master_key' must
> point to class/struct/union/

These suggest you're still trying to direct access structure members.


>
> /.\odlibPrf_OSSL.h(168) : error C2027: use of undefined type 'ssl_st'/


Please show us the source code for the lines these error message correspond to.

Matt

>
>
>
> Can you help me to get the corresponding accessor functions for these 2 structures.
>
>
>
> Thanks and regards,
>
> Nagalakshmi
>
>
>
> -----Original Message-----
> From: Nagalakshmi V J <[hidden email]>
> Sent: Tuesday, October 1, 2019 6:33 PM
> To: Dr. Matthias St. Pierre <[hidden email]>;
> Nagalakshmi V J <[hidden email]>
> Cc: [hidden email]; Umamaheswari Nagarajan
> <[hidden email]>
> Subject: RE: OpenSSL compilation errors in Windows
>
>
>
> Thank you Matthias for the explanation. I am going through my code to
> understand why ssl_locl.h is included. I will check and get back on
> this ASAP. Also if there is other way to achieve that I will use the same.
>
>
>
> Thanks and regards,
>
> Nagalakshmi
>
>
>
> -----Original Message-----
>
> From: Dr. Matthias St. Pierre <[hidden email]
> <mailto:[hidden email]>>
>
> Sent: Tuesday, October 1, 2019 4:43 PM
>
> To: Nagalakshmi V J <[hidden email]
> <mailto:[hidden email]>>
>
> Cc: [hidden email] <mailto:[hidden email]>;
> Umamaheswari Nagarajan <[hidden email]
> <mailto:[hidden email]>>
>
> Subject: AW: OpenSSL compilation errors in Windows
>
>
>
> ** This mail has been sent from an external source **
>
>
>
>
>
>> We are using OpenSSL APIs in our product code. We are not making any
>> changes
> in OpenSSL.
>
>> Our product code is a C++ code and it makes use of openSSL APIs for
>> some
> functionality.
>
>
>
> Local headers (like "ssl_locl.h" and "packet_locl.h") are *NOT* part
> of the official OpenSSL API.
>
> Please don't expect any support w.r.t. compilation or compatibility
> problems if you do include them in your application, even more if it's
> compiled using a C++ compiler.
>
>
>
> It would be more helpful if you would tell us *why* you are including
> ssl_locl.h and what you are trying to achieve. Then we might be able
> to tell you how you could achieve your goal using the officially supported API.
>
>
>
> Please note that many of the OpenSSL structures were made opaque in
> version 1.1.0. This means that there are only forward declarations of
> the structures in the public headers and the compiler does not get to  see the structure members.
> Instead of directly accessing the members, it is now necessary to use
> accessor functions (a.k.a. getters and setters). If this is the reason
> why you are including private OpenSSL headers then you should adopt
> you application to use the new accessors instead, instead of forcing
> the impossible to circumvent the new policy.
>
>
>
> For more information, see
>
>
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.openssl.org_
> index.php_OpenSSL-5F1.1.0-5FChanges&d=DwIGaQ&c=cxWN2QSDopt5SklNfbjIjg&
> r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=wpEV8Q2RDZjERhtJGZl9Ha
> jV9jd2dJFF10J30_YrPQo&s=sX1YilJaXloAQDzrjD3Lz-I6DOej3QduhsAanXOYxVM&e=
>
>
>
> Matthias
>
>
>
>
>
>
>
>
>
>
>
> Dr. Matthias St. Pierre
>
> Senior Software Engineer
>
> [hidden email] <mailto:[hidden email]>
>
> Phone: +49 911 9968-0
>
> www.ncp-e.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.ncp-2De.com&d
> =DwIDaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5at
> SqEGOnpA&m=cDw8_L60-mZAOD-FHwthgUKK4jglLexW6Wpi6EEaKM4&s=XlNG1utFTM1jM
> -izig9lVO9BsRhW9nRWv3oqbsVCOmw&e= >
>
>
>
> Headquarters Germany: NCP engineering GmbH • Dombuehler Str. 2 • 90449
> • Nuremberg North American HQ: NCP engineering Inc. • 678 Georgia Ave.
> • Sunnyvale, CA 94085 East Coast Office: NCP engineering Inc. • 601
> Cleveland Str., Suite 501-25 • Clearwater, FL 33755
>
>
>
> Authorized representatives: Peter Soell, Patrick Oliver Graf, Beate
> Dietrich Registry Court: Lower District Court of Nuremberg Commercial
> register No.: HRB
> 7786 Nuremberg, VAT identification No.: DE 133557619
>
>
>
> This e-mail message including any attachments is for the sole use of
> the intended recipient(s) and may contain privileged or confidential information.
> Any unauthorized review, use, disclosure or distribution is
> prohibited. If you are not the intended recipient, please immediately
> contact the sender by reply e-mail and delete the original message and destroy all copies thereof.
>
> =====================================================
>
> Please refer to https://northamerica.altran.com/email-disclaimer
>
> for important disclosures regarding this electronic communication.
>
> =====================================================
>
> =====================================================
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =====================================================
=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Matt Caswell-2


On 18/10/2019 11:49, Nagalakshmi V J wrote:
> Now the issue is SSL_session structure is also having accessor APIs
> which I am not aware of. So I need to get the APIs for accessing the
> master_key_length,etc.. given in the above code. Those are not listed
> in the openssl link referred.

On this page look a the various functions beginning with "SSL_SESSION_"
in the name:

https://www.openssl.org/docs/man1.1.1/man3/

From the code sample you gave you are probably mostly interested in the
functions on this page:

https://www.openssl.org/docs/man1.1.1/man3/SSL_SESSION_get_master_key.html

Matt

Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Nagalakshmi V J
Hi Matt,

This link is having few APIS. But for getting master_key_length, I don't find any API. Not sure if we need to use getMasterKey API for that.

I will try to use these APIs and get back.

Thanks & Regards,
Nagalakshmi V J
From: Matt Caswell <[hidden email]>
Sent: 18 October 2019 14:48:33
To: Nagalakshmi V J <[hidden email]>; [hidden email] <[hidden email]>
Subject: Re: OpenSSL compilation errors in Windows
 
** This mail has been sent from an external source **


On 18/10/2019 11:49, Nagalakshmi V J wrote:
> Now the issue is SSL_session structure is also having accessor APIs
> which I am not aware of. So I need to get the APIs for accessing the
> master_key_length,etc.. given in the above code. Those are not listed
> in the openssl link referred.

On this page look a the various functions beginning with "SSL_SESSION_"
in the name:

https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_&d=DwICaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts&s=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4&e=

From the code sample you gave you are probably mostly interested in the
functions on this page:

https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_SSL-5FSESSION-5Fget-5Fmaster-5Fkey.html&d=DwICaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts&s=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI&e=

Matt

=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Matt Caswell-2


On 20/10/2019 08:43, Nagalakshmi V J wrote:
> Hi Matt,
>
> This link is having few APIS. But for getting master_key_length, I don't
> find any API. Not sure if we need to use getMasterKey API for that.

You can use SSL_SESSION_get_master_key() for this.

Note this comment in the RETURN VALUES section:

"For the other functions, if outlen is greater than 0 then these
functions return the number of bytes actually copied, which will be less
than or equal to outlen. If outlen is 0 then these functions return the
maximum number of bytes they would copy -- that is, the length of the
underlying field."

So to discover the master_key_length call the function with outlen to
zero. You can then allocate an appropriate sized buffer and call the
function again in order to get the actual master key.

Matt


>
> I will try to use these APIs and get back.
>
> Thanks & Regards,
> Nagalakshmi V J
> ------------------------------------------------------------------------
> *From:* Matt Caswell <[hidden email]>
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J <[hidden email]>;
> [hidden email] <[hidden email]>
> *Subject:* Re: OpenSSL compilation errors in Windows
>  
> ** This mail has been sent from an external source **
>
>
> On 18/10/2019 11:49, Nagalakshmi V J wrote:
>> Now the issue is SSL_session structure is also having accessor APIs
>> which I am not aware of. So I need to get the APIs for accessing the
>> master_key_length,etc.. given in the above code. Those are not listed
>> in the openssl link referred.
>
> On this page look a the various functions beginning with "SSL_SESSION_"
> in the name:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_&d=DwICaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts&s=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4&e=
>
> From the code sample you gave you are probably mostly interested in the
> functions on this page:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_SSL-5FSESSION-5Fget-5Fmaster-5Fkey.html&d=DwICaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts&s=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI&e=
>
> Matt
>
> =====================================================
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Nagalakshmi V J
Hi Matt,

Yes. Exactly we followed the same and able to resolve errors. Thank you so much for the support and guidance. I'll get back if any further errors.

Thanks & Regards,
Nagalakshmi V J
From: Matt Caswell <[hidden email]>
Sent: 21 October 2019 21:26:32
To: Nagalakshmi V J <[hidden email]>; [hidden email] <[hidden email]>
Subject: Re: OpenSSL compilation errors in Windows
 
** This mail has been sent from an external source **


On 20/10/2019 08:43, Nagalakshmi V J wrote:
> Hi Matt,
>
> This link is having few APIS. But for getting master_key_length, I don't
> find any API. Not sure if we need to use getMasterKey API for that.

You can use SSL_SESSION_get_master_key() for this.

Note this comment in the RETURN VALUES section:

"For the other functions, if outlen is greater than 0 then these
functions return the number of bytes actually copied, which will be less
than or equal to outlen. If outlen is 0 then these functions return the
maximum number of bytes they would copy -- that is, the length of the
underlying field."

So to discover the master_key_length call the function with outlen to
zero. You can then allocate an appropriate sized buffer and call the
function again in order to get the actual master key.

Matt


>
> I will try to use these APIs and get back.
>
> Thanks & Regards,
> Nagalakshmi V J
> ------------------------------------------------------------------------
> *From:* Matt Caswell <[hidden email]>
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J <[hidden email]>;
> [hidden email] <[hidden email]>
> *Subject:* Re: OpenSSL compilation errors in Windows
>
> ** This mail has been sent from an external source **
>
>
> On 18/10/2019 11:49, Nagalakshmi V J wrote:
>> Now the issue is SSL_session structure is also having accessor APIs
>> which I am not aware of. So I need to get the APIs for accessing the
>> master_key_length,etc.. given in the above code. Those are not listed
>> in the openssl link referred.
>
> On this page look a the various functions beginning with "SSL_SESSION_"
> in the name:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_&d=DwICaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts&s=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4&e=
>
> From the code sample you gave you are probably mostly interested in the
> functions on this page:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_SSL-5FSESSION-5Fget-5Fmaster-5Fkey.html&d=DwICaQ&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts&s=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI&e=
>
> Matt
>
> =====================================================
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =====================================================
=====================================================
Please refer to https://northamerica.altran.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
12