OpenSSL compilation errors in Windows

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

RE: OpenSSL compilation errors in Windows

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 <[hidden email]>
Sent: Tuesday, October 22, 2019 9:39 AM
To: Matt Caswell <[hidden email]>; Nagalakshmi V J <[hidden email]>; [hidden email]
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 <[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.
=====================================================

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

Kindly provide your inputs for the below mail.

Thanks & Regards,
Nagalakshmi V J
From: Nagalakshmi V J <[hidden email]>
Sent: 22 October 2019 10:41:40
To: Matt Caswell <[hidden email]>; [hidden email] <[hidden email]>
Cc: Nagalakshmi V J <[hidden email]>
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://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 <[hidden email]>
Sent: Tuesday, October 22, 2019 9:39 AM
To: Matt Caswell <[hidden email]>; Nagalakshmi V J <[hidden email]>; [hidden email]
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 <[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.
=====================================================

=====================================================
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 All,

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

Thanks & Regards,
Nagalakshmi V J

From: Nagalakshmi V J <[hidden email]>
Sent: 24 October 2019 03:29
To: Nagalakshmi V J <[hidden email]>; Matt Caswell <[hidden email]>; [hidden email] <[hidden email]>
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 <[hidden email]>
Sent: 22 October 2019 10:41:40
To: Matt Caswell <[hidden email]>; [hidden email] <[hidden email]>
Cc: Nagalakshmi V J <[hidden email]>
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://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 <[hidden email]>
Sent: Tuesday, October 22, 2019 9:39 AM
To: Matt Caswell <[hidden email]>; Nagalakshmi V J <[hidden email]>; [hidden email]
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 <[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.
=====================================================

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

Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

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?

Not sure if I can use the above link.


Thanks & Regards,
Nagalakshmi V J

From: Matt Caswell <[hidden email]>
Sent: 29 October 2019 10:47
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 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.
=====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

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 <[hidden email]>; Nagalakshmi V J <[hidden email]>; [hidden email]
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?

 

Not sure if I can use the above link.

 

 

Thanks & Regards,

Nagalakshmi V J


From: Matt Caswell <[hidden email]>
Sent: 29 October 2019 10:47
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 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.
=====================================================
Reply | Threaded
Open this post in threaded view
|

Re: OpenSSL compilation errors in Windows

Matt Caswell-2
In reply to this post by Nagalakshmi V J


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 <[hidden email]>
> *Sent:* 29 October 2019 10:47
> *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 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.
> =====================================================
Reply | Threaded
Open this post in threaded view
|

RE: OpenSSL compilation errors in Windows

Nagalakshmi V J
Hi Matt,

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

Thanks and regards,
Nagalakshmi

-----Original Message-----
From: Matt Caswell <[hidden email]>
Sent: Wednesday, October 30, 2019 7:55 PM
To: Nagalakshmi V J <[hidden email]>; [hidden email]
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&d=DwI
> D-g&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEG
> OnpA&m=mgmrDa8wrs1zaAUL-PLOcRGKsCoFwXg9ZmrJMt56Yso&s=GW6E7NE-6ODy28APY
> gBz7MYCKAuXh9wULiPQjZ-AMR0&e=

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&d=DwID-g&c=cxWN2QSDopt5SklNfbjIjg&r=zbjUR56YPF3jaTRTjX4KZlHM9-LmYAuR5atSqEGOnpA&m=mgmrDa8wrs1zaAUL-PLOcRGKsCoFwXg9ZmrJMt56Yso&s=rGqb0VAIAgD_dzrh6Cpv2AyI6wzAaog-HYn_OY_0mMU&e=

Matt

>
> Not sure if I can use the above link.
>
>
> /Thanks & Regards,/
> /Nagalakshmi V J/
> ----------------------------------------------------------------------
> --
> *From:* Matt Caswell <[hidden email]>
> *Sent:* 29 October 2019 10:47
> *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 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.
=====================================================
12