RE: OpenSSL compilation errors in Windows

2019-11-01 Thread Nagalakshmi V J
Hi Matt,

Thanks for your help. I am able to proceed now.

Thanks and regards,
Nagalakshmi

-Original Message-
From: Matt Caswell 
Sent: Wednesday, October 30, 2019 7:55 PM
To: Nagalakshmi V J ; openssl-users@openssl.org
Subject: Re: OpenSSL compilation errors in Windows

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


On 29/10/2019 11:55, Nagalakshmi V J wrote:
> Hi Matt,
>
> Thank you so much for your response. Those mentioned APIs resolved my
> errors.
>
> For the below code,
>
>  return  SSL_get_session(pConnection) != NULL &&
> pConnection->session->session_id_length != 0;
>
> Any reference for accessing session_id_length?
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_d
> ocs_man1.1.0_man3_SSL-5FCTX-5Fset-5Fgenerate-5Fsession-5Fid.html=DwI
> D-g=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEG
> OnpA=mgmrDa8wrs1zaAUL-PLOcRGKsCoFwXg9ZmrJMt56Yso=GW6E7NE-6ODy28APY
> gBz7MYCKAuXh9wULiPQjZ-AMR0=

You should use SSL_SESSION_get_id() to get hold of the length:

https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_SSL-5FSESSION-5Fget-5Fid.html=DwID-g=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=mgmrDa8wrs1zaAUL-PLOcRGKsCoFwXg9ZmrJMt56Yso=rGqb0VAIAgD_dzrh6Cpv2AyI6wzAaog-HYn_OY_0mMU=

Matt

>
> Not sure if I can use the above link.
>
>
> /Thanks & Regards,/
> /Nagalakshmi V J/
> --
> --
> *From:* Matt Caswell 
> *Sent:* 29 October 2019 10:47
> *To:* Nagalakshmi V J ;
> openssl-users@openssl.org 
> *Subject:* Re: OpenSSL compilation errors in Windows
>
> ** This mail has been sent from an external source **
>
>
> On 29/10/2019 10:34, Nagalakshmi V J wrote:
>>
>> tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),
>>
>>  pGenerator->master_secret,sizeof(pGenerator->master_secret),
>>
>>  km,tmp,num);
>
> It seems your code is replicating parts of libssl - which seems like a
> strange (and possibly dangerous) thing to do!
>
>> Struct ssl_ctx_st {
>>
>> ...
>>
>> constEVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */
>>
>> constEVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
>>
>> ...
>>
>> }
>
> You really don't need to access these things. They're just cached
> references to the value returned by EVP_get_digestbyname("ssl3-md5")
> and EVP_get_digestbyname("ssl3-sha1"). So you can call those functions
> directly anyway.
>
> 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.
=


Re: OpenSSL compilation errors in Windows

2019-10-30 Thread Matt Caswell



On 29/10/2019 11:55, Nagalakshmi V J wrote:
> Hi Matt,
> 
> Thank you so much for your response. Those mentioned APIs resolved my
> errors.
> 
> For the below code,
> 
>  return  SSL_get_session(pConnection) != NULL &&
>                 pConnection->session->session_id_length != 0;
> 
> Any reference for accessing session_id_length?
> https://www.openssl.org/docs/man1.1.0/man3/SSL_CTX_set_generate_session_id.html

You should use SSL_SESSION_get_id() to get hold of the length:

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

Matt

> 
> Not sure if I can use the above link.
> 
> 
> /Thanks & Regards,/
> /Nagalakshmi V J/
> 
> *From:* Matt Caswell 
> *Sent:* 29 October 2019 10:47
> *To:* Nagalakshmi V J ;
> openssl-users@openssl.org 
> *Subject:* Re: OpenSSL compilation errors in Windows
>  
> ** This mail has been sent from an external source **
> 
> 
> On 29/10/2019 10:34, Nagalakshmi V J wrote:
>>
>> tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),
>>
>>  pGenerator->master_secret,sizeof(pGenerator->master_secret),
>>
>>  km,tmp,num);
> 
> It seems your code is replicating parts of libssl - which seems like a
> strange (and possibly dangerous) thing to do!
> 
>> Struct ssl_ctx_st {
>>
>> …
>>
>> constEVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */
>>
>> constEVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
>>
>> …
>>
>> }
> 
> You really don't need to access these things. They're just cached
> references to the value returned by EVP_get_digestbyname("ssl3-md5") and
> EVP_get_digestbyname("ssl3-sha1"). So you can call those functions
> directly anyway.
> 
> Matt
> 
> =
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =


RE: OpenSSL compilation errors in Windows

2019-10-30 Thread Nagalakshmi V J
Hi Matt,

Any inputs on the below query?

Thanks and regards,
Nagalakshmi

From: Nagalakshmi V J
Sent: Tuesday, October 29, 2019 5:25 PM
To: Matt Caswell ; Nagalakshmi V J 
; openssl-users@openssl.org
Subject: Re: OpenSSL compilation errors in Windows

Hi Matt,

Thank you so much for your response. Those mentioned APIs resolved my errors.

For the below code,

 return  SSL_get_session(pConnection) != NULL &&
pConnection->session->session_id_length != 0;

Any reference for accessing session_id_length?
https://www.openssl.org/docs/man1.1.0/man3/SSL_CTX_set_generate_session_id.html

Not sure if I can use the above link.


Thanks & Regards,
Nagalakshmi V J

From: Matt Caswell mailto:m...@openssl.org>>
Sent: 29 October 2019 10:47
To: Nagalakshmi V J 
mailto:nagalakshm...@altran.com>>; 
openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
mailto:openssl-users@openssl.org>>
Subject: Re: OpenSSL compilation errors in Windows

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


On 29/10/2019 10:34, Nagalakshmi V J wrote:
>
> tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),
>
>  pGenerator->master_secret,sizeof(pGenerator->master_secret),
>
>  km,tmp,num);

It seems your code is replicating parts of libssl - which seems like a
strange (and possibly dangerous) thing to do!

> Struct ssl_ctx_st {
>
> ...
>
> constEVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */
>
> constEVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
>
> ...
>
> }

You really don't need to access these things. They're just cached
references to the value returned by EVP_get_digestbyname("ssl3-md5") and
EVP_get_digestbyname("ssl3-sha1"). So you can call those functions
directly anyway.

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


Re: OpenSSL compilation errors in Windows

2019-10-29 Thread Nagalakshmi V J
Hi Matt,

Thank you so much for your response. Those mentioned APIs resolved my errors.

For the below code,

 return  SSL_get_session(pConnection) != NULL &&
pConnection->session->session_id_length != 0;

Any reference for accessing session_id_length?
https://www.openssl.org/docs/man1.1.0/man3/SSL_CTX_set_generate_session_id.html

Not sure if I can use the above link.


Thanks & Regards,
Nagalakshmi V J

From: Matt Caswell 
Sent: 29 October 2019 10:47
To: Nagalakshmi V J ; openssl-users@openssl.org 

Subject: Re: OpenSSL compilation errors in Windows

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


On 29/10/2019 10:34, Nagalakshmi V J wrote:
>
> tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),
>
>  pGenerator->master_secret,sizeof(pGenerator->master_secret),
>
>  km,tmp,num);

It seems your code is replicating parts of libssl - which seems like a
strange (and possibly dangerous) thing to do!

> Struct ssl_ctx_st {
>
> …
>
> constEVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */
>
> constEVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
>
> …
>
> }

You really don't need to access these things. They're just cached
references to the value returned by EVP_get_digestbyname("ssl3-md5") and
EVP_get_digestbyname("ssl3-sha1"). So you can call those functions
directly anyway.

Matt

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


Re: OpenSSL compilation errors in Windows

2019-10-29 Thread Matt Caswell



On 29/10/2019 10:34, Nagalakshmi V J wrote:
> 
> tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),
> 
>  pGenerator->master_secret,sizeof(pGenerator->master_secret),
> 
>  km,tmp,num);

It seems your code is replicating parts of libssl - which seems like a
strange (and possibly dangerous) thing to do!

> Struct ssl_ctx_st {
> 
> …
> 
> constEVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */
> 
> constEVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
> 
> …
> 
> }

You really don't need to access these things. They're just cached
references to the value returned by EVP_get_digestbyname("ssl3-md5") and
EVP_get_digestbyname("ssl3-sha1"). So you can call those functions
directly anyway.

Matt



Re: OpenSSL compilation errors in Windows

2019-10-29 Thread Nagalakshmi V J
Hi All,

Appreciate the response for the below query. Anyone faced the same issue?

Thanks & Regards,
Nagalakshmi V J

From: Nagalakshmi V J 
Sent: 24 October 2019 03:29
To: Nagalakshmi V J ; Matt Caswell 
; openssl-users@openssl.org 
Subject: Re: OpenSSL compilation errors in Windows

Hi Matt,

Kindly provide your inputs for the below mail.

Thanks & Regards,
Nagalakshmi V J

From: Nagalakshmi V J 
Sent: 22 October 2019 10:41:40
To: Matt Caswell ; openssl-users@openssl.org 

Cc: Nagalakshmi V J 
Subject: RE: OpenSSL compilation errors in Windows


Hi Matt,



Could you please help to get any clue on the ACCESSOR APIs of the following.



I tried searching APIs. Not getting exact matches. Referred the below links.



https://www.openssl.org/docs/man1.1.1/man3/SSL_set_info_callback.html<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_SSL-5Fset-5Finfo-5Fcallback.html=DwMFAg=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=Njt4ya1WwfEyFfb0YIugFx24W8dsynF6tpT1_Km5mtI=-MNUo0TNpVbEaR7EYseQvOuqyaOVxpmsTxKxZnpJv7o=>

https://www.openssl.org/docs/man1.1.1/man3/EVP_md5.html<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_EVP-5Fmd5.html=DwMFAg=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=Njt4ya1WwfEyFfb0YIugFx24W8dsynF6tpT1_Km5mtI=mzU5jKWESsCh8cwObLKcthJRhdqflLMfP41CLfzqhWs=>



Getting similar error for the below code.



tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),

 pGenerator->master_secret,sizeof(pGenerator->master_secret),

 km,tmp,num);



Struct ssl_ctx_st {

…

const EVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */

const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */

…

}



struct evp_md_st {

int type;

int pkey_type;

int md_size;

unsigned long flags;

int (*init) (EVP_MD_CTX *ctx);

int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);

int (*final) (EVP_MD_CTX *ctx, unsigned char *md);

int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);

int (*cleanup) (EVP_MD_CTX *ctx);

int block_size;

int ctx_size;   /* how big does the ctx->md_data need to be */

/* control function */

int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);

} /* EVP_MD */ ;





Thanks and regards,

Nagalakshmi



From: Nagalakshmi V J 
Sent: Tuesday, October 22, 2019 9:39 AM
To: Matt Caswell ; Nagalakshmi V J 
; openssl-users@openssl.org
Subject: Re: OpenSSL compilation errors in Windows



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 mailto:m...@openssl.org>>
Sent: 21 October 2019 21:26:32
To: Nagalakshmi V J 
mailto:nagalakshm...@altran.com>>; 
openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
mailto:openssl-users@openssl.org>>
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 mailto:m...@openssl.org>>
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J 
> mailto:nagalakshm...@altran.com>>;
> openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
> mailto:openssl-users@openssl.org>>
> *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 openss

Re: OpenSSL compilation errors in Windows

2019-10-23 Thread Nagalakshmi V J
Hi Matt,

Kindly provide your inputs for the below mail.

Thanks & Regards,
Nagalakshmi V J

From: Nagalakshmi V J 
Sent: 22 October 2019 10:41:40
To: Matt Caswell ; openssl-users@openssl.org 

Cc: Nagalakshmi V J 
Subject: RE: OpenSSL compilation errors in Windows


Hi Matt,



Could you please help to get any clue on the ACCESSOR APIs of the following.



I tried searching APIs. Not getting exact matches. Referred the below links.



https://www.openssl.org/docs/man1.1.1/man3/SSL_set_info_callback.html<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_SSL-5Fset-5Finfo-5Fcallback.html=DwMFAg=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=Njt4ya1WwfEyFfb0YIugFx24W8dsynF6tpT1_Km5mtI=-MNUo0TNpVbEaR7EYseQvOuqyaOVxpmsTxKxZnpJv7o=>

https://www.openssl.org/docs/man1.1.1/man3/EVP_md5.html<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.openssl.org_docs_man1.1.1_man3_EVP-5Fmd5.html=DwMFAg=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=Njt4ya1WwfEyFfb0YIugFx24W8dsynF6tpT1_Km5mtI=mzU5jKWESsCh8cwObLKcthJRhdqflLMfP41CLfzqhWs=>



Getting similar error for the below code.



tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),

 pGenerator->master_secret,sizeof(pGenerator->master_secret),

 km,tmp,num);



Struct ssl_ctx_st {

…

const EVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */

const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */

…

}



struct evp_md_st {

int type;

int pkey_type;

int md_size;

unsigned long flags;

int (*init) (EVP_MD_CTX *ctx);

int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);

int (*final) (EVP_MD_CTX *ctx, unsigned char *md);

int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);

int (*cleanup) (EVP_MD_CTX *ctx);

int block_size;

int ctx_size;   /* how big does the ctx->md_data need to be */

/* control function */

int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);

} /* EVP_MD */ ;





Thanks and regards,

Nagalakshmi



From: Nagalakshmi V J 
Sent: Tuesday, October 22, 2019 9:39 AM
To: Matt Caswell ; Nagalakshmi V J 
; openssl-users@openssl.org
Subject: Re: OpenSSL compilation errors in Windows



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 mailto:m...@openssl.org>>
Sent: 21 October 2019 21:26:32
To: Nagalakshmi V J 
mailto:nagalakshm...@altran.com>>; 
openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
mailto:openssl-users@openssl.org>>
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 mailto:m...@openssl.org>>
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J 
> mailto:nagalakshm...@altran.com>>;
> openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
> mailto:openssl-users@openssl.org>>
> *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_=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1

RE: OpenSSL compilation errors in Windows

2019-10-22 Thread Nagalakshmi V J
Hi Matt,

Could you please help to get any clue on the ACCESSOR APIs of the following.

I tried searching APIs. Not getting exact matches. Referred the below links.

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

Getting similar error for the below code.

tls1_PRF(s->ctx->md5,s->ctx->sha1,buf,(int)(p-buf),
 pGenerator->master_secret,sizeof(pGenerator->master_secret),
 km,tmp,num);

Struct ssl_ctx_st {
...
const EVP_MD *md5;  /* For SSLv3/TLSv1 'ssl3-md5' */
const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */
...
}

struct evp_md_st {
int type;
int pkey_type;
int md_size;
unsigned long flags;
int (*init) (EVP_MD_CTX *ctx);
int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);
int (*final) (EVP_MD_CTX *ctx, unsigned char *md);
int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);
int (*cleanup) (EVP_MD_CTX *ctx);
int block_size;
int ctx_size;   /* how big does the ctx->md_data need to be */
/* control function */
int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
} /* EVP_MD */ ;


Thanks and regards,
Nagalakshmi

From: Nagalakshmi V J 
Sent: Tuesday, October 22, 2019 9:39 AM
To: Matt Caswell ; Nagalakshmi V J 
; openssl-users@openssl.org
Subject: Re: OpenSSL compilation errors in Windows

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 mailto:m...@openssl.org>>
Sent: 21 October 2019 21:26:32
To: Nagalakshmi V J 
mailto:nagalakshm...@altran.com>>; 
openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
mailto:openssl-users@openssl.org>>
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 mailto:m...@openssl.org>>
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J 
> mailto:nagalakshm...@altran.com>>;
> openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
> mailto:openssl-users@openssl.org>>
> *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_=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4=
>
> 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=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI=
>
> 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 regardin

Re: OpenSSL compilation errors in Windows

2019-10-21 Thread 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 
Sent: 21 October 2019 21:26:32
To: Nagalakshmi V J ; openssl-users@openssl.org 

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 
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J ;
> openssl-users@openssl.org 
> *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_=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4=
>
> 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=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI=
>
> 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.
=


Re: OpenSSL compilation errors in Windows

2019-10-21 Thread Matt Caswell



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 
> *Sent:* 18 October 2019 14:48:33
> *To:* Nagalakshmi V J ;
> openssl-users@openssl.org 
> *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_=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4=
> 
> 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=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI=
> 
> Matt
> 
> =
> Please refer to https://northamerica.altran.com/email-disclaimer
> for important disclosures regarding this electronic communication.
> =


Re: OpenSSL compilation errors in Windows

2019-10-20 Thread 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 
Sent: 18 October 2019 14:48:33
To: Nagalakshmi V J ; openssl-users@openssl.org 

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_=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=gE0JHTVoToRHQRu5h2amvKa5WzyXsortlw0IoQd3VG4=

>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=DwICaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=MZhYFrTAuuHOqAirPiGbT1CY6HDdH2U_CWYq12626Ts=XTuEzS7qyBvIHc_qWJYoh3JVC4zPCzvUzNPStW_SvLI=

Matt

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


Re: OpenSSL compilation errors in Windows

2019-10-18 Thread Matt Caswell



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



RE: OpenSSL compilation errors in Windows

2019-10-18 Thread 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  On Behalf Of Matt 
Caswell
Sent: Thursday, October 3, 2019 6:51 PM
To: openssl-users@openssl.org
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 
> Sent: Tuesday, October 1, 2019 6:33 PM
> To: Dr. Matthias St. Pierre ;
> Nagalakshmi V J 
> Cc: openssl-users@openssl.org; Umamaheswari Nagarajan
> 
> 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 inc

Re: OpenSSL compilation errors in Windows

2019-10-03 Thread Matt Caswell



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 
> Sent: Tuesday, October 1, 2019 6:33 PM
> To: Dr. Matthias St. Pierre ; Nagalakshmi V J
> 
> Cc: openssl-users@openssl.org; Umamaheswari Nagarajan
> 
> 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  <mailto:matthias.st.pie...@ncp-e.com>>
> 
> Sent: Tuesday, October 1, 2019 4:43 PM
> 
> To: Nagalakshmi V J  <mailto:nagalakshm...@altran.com>>
> 
> Cc: openssl-users@openssl.org <mailto:openssl-users@openssl.org>; Umamaheswari
> Nagarajan  <mailto:umamaheswari.nagara...@altran.com>>
> 
> 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 o

RE: OpenSSL compilation errors in Windows

2019-10-03 Thread 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 
Sent: Tuesday, October 1, 2019 6:33 PM
To: Dr. Matthias St. Pierre ; Nagalakshmi V J 

Cc: openssl-users@openssl.org; Umamaheswari Nagarajan 

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 
mailto:matthias.st.pie...@ncp-e.com>>

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

To: Nagalakshmi V J mailto:nagalakshm...@altran.com>>

Cc: openssl-users@openssl.org<mailto:openssl-users@openssl.org>; Umamaheswari 
Nagarajan 
mailto:umamaheswari.nagara...@altran.com>>

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=DwIGaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=wpEV8Q2RDZjERhtJGZl9HajV9jd2dJFF10J30_YrPQo=sX1YilJaXloAQDzrjD3Lz-I6DOej3QduhsAanXOYxVM=



Matthias











Dr. Matthias St. Pierre

Senior Software Engineer

matthias.st.pie...@ncp-e.com<mailto:matthias.st.pie...@ncp-e.com>

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 
S

RE: OpenSSL compilation errors in Windows

2019-10-01 Thread Nagalakshmi V J
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 
Sent: Tuesday, October 1, 2019 6:30 PM
To: Nagalakshmi V J ; Sergio NNX 
; Dr. Matthias St. Pierre ; 
Michael Mueller 
Cc: openssl-users@openssl.org; Umamaheswari Nagarajan 

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.
=


RE: OpenSSL compilation errors in Windows

2019-10-01 Thread Nagalakshmi V J
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 
Sent: Tuesday, October 1, 2019 4:43 PM
To: Nagalakshmi V J 
Cc: openssl-users@openssl.org; Umamaheswari Nagarajan 

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=DwIGaQ=cxWN2QSDopt5SklNfbjIjg=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA=wpEV8Q2RDZjERhtJGZl9HajV9jd2dJFF10J30_YrPQo=sX1YilJaXloAQDzrjD3Lz-I6DOej3QduhsAanXOYxVM=

Matthias





Dr. Matthias St. Pierre
Senior Software Engineer
matthias.st.pie...@ncp-e.com
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.
=


Re: OpenSSL compilation errors in Windows

2019-10-01 Thread Salz, Rich via openssl-users
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?


RE: OpenSSL compilation errors in Windows

2019-09-30 Thread 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 
Sent: Monday, September 30, 2019 9:06 PM
To: Dr. Matthias St. Pierre ; Nagalakshmi V J 
; Michael Mueller 
Cc: openssl-users@openssl.org; Umamaheswari Nagarajan 

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 
mailto:openssl-users-boun...@openssl.org>> 
on behalf of Dr. Matthias St. Pierre 
mailto:matthias.st.pie...@ncp-e.com>>
Sent: Tuesday, 1 October 2019 12:28 AM
To: Nagalakshmi V J 
mailto:nagalakshm...@altran.com>>; Michael Mueller 
mailto:abaci@gmail.com>>
Cc: openssl-users@openssl.org<mailto:openssl-users@openssl.org> 
mailto:openssl-users@openssl.org>>; Umamaheswari 
Nagarajan 
mailto:umamaheswari.nagara...@altran.com>>
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.
=


Re: OpenSSL compilation errors in Windows

2019-09-30 Thread 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  on behalf of Dr. 
Matthias St. Pierre 
Sent: Tuesday, 1 October 2019 12:28 AM
To: Nagalakshmi V J ; Michael Mueller 

Cc: openssl-users@openssl.org ; Umamaheswari 
Nagarajan 
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








RE: OpenSSL compilation errors in Windows

2019-09-30 Thread 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 
Sent: Monday, September 30, 2019 4:05 PM
To: Nagalakshmi V J 
Cc: openssl-users@openssl.org; Umamaheswari Nagarajan 

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 
mailto:nagalakshm...@altran.com>> 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.
=


Re: OpenSSL compilation errors in Windows

2019-09-30 Thread Matt Caswell



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 
> Sent: Monday, September 30, 2019 2:10 PM
> To: Nagalakshmi V J ; openssl-users@openssl.org
> Cc: Umamaheswari Nagarajan 
> 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
> 
> matthias.st.pie...@ncp-e.com 
> 
> 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  > Im Auftrag von Nagalakshmi V J
> 
> Gesendet: Montag, 30. September 2019 08:44
> 
> An: openssl-users@openssl.org 
> 
> Cc: Umamaheswari Nagarajan  >
> 
> 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.
> =


RE: OpenSSL compilation errors in Windows

2019-09-30 Thread Nagalakshmi V J
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 
Sent: Monday, September 30, 2019 2:10 PM
To: Nagalakshmi V J ; openssl-users@openssl.org
Cc: Umamaheswari Nagarajan 
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

matthias.st.pie...@ncp-e.com

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 
mailto:openssl-users-boun...@openssl.org>> 
Im Auftrag von Nagalakshmi V J

Gesendet: Montag, 30. September 2019 08:44

An: openssl-users@openssl.org

Cc: Umamaheswari Nagarajan 
mailto:umamaheswari.nagara...@altran.com>>

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.
=


Re: OpenSSL compilation errors in Windows

2019-09-30 Thread Michael Mueller
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 
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.
> =
>