<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">   <br>
Hi Matt<br>
<br>
   The return type of <span style="background-color:rgb(255, 255, 255);display:inline !important">ctx->verify_cb(0,  ctx) is int and the return type of  <span style="background-color:rgb(255, 255, 255);display:inline !important">X509_STORE_get_verify_cb() 
      is <span style="background-color:rgb(255, 255, 255);display:inline !important">X509_STORE_CTX_verify_cb in this case how do i match/replace</span></span></span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:16px;background-color:rgb(255, 255, 255);display:inline !important"> 
  </span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important; color: rgb(147, 69, 17);"> int ok=1;</span><span style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:16px;background-color:rgb(255, 255, 255);display:inline !important"><br>
</span><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important; color: rgb(147, 69, 17);">    ok = ctx->verify_cb(0,  ctx);</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px; background-color: rgb(255, 255, 255); display: inline !important; color: rgb(147, 69, 17);"><br>
</span></span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">    X509_STORE_CTX_verify_cb
 verify_cb;</span><br style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255)">
<span style="font-family:"Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;font-size:14.6667px;background-color:rgb(255, 255, 255);display:inline !important">    verify_cb = X509_STORE_get_verify_cb(ctx);</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
Thanks<br>
Shiva kumar<br>
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Matt Caswell <matt@openssl.org><br>
<b>Sent:</b> Friday, October 8, 2021 8:41 PM<br>
<b>To:</b> Shivakumar Poojari <Shivakumar.Poojari@rbbn.com>; openssl-users@openssl.org <openssl-users@openssl.org><br>
<b>Cc:</b> Paramashivaiah, Sunil <Sunil.Paramashivaiah@rbbn.com>; Kumar Mishra, Sanjeev <Sanjeev.Kumar-Mishra@rbbn.com>; Bhattacharjee, Debapriyo (c) <dbhattacharjee@rbbn.com><br>
<b>Subject:</b> Re: [EXTERNAL] Re: Alternative for structure opaque X509 & X509_STORE_CTX</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
On 08/10/2021 11:07, Shivakumar Poojari wrote:<br>
> HI Matt,<br>
> <br>
> For below error i tried your suggestion but return type are different, <br>
> so facing issue in replacing, remaining suggestion are worked absolutely <br>
> fine<br>
>><br>
>> error: invalid use  of incomplete type 'X509_STORE_CTX' {aka 'struct<br>
>> x509_store_ctx_st'}<br>
>>           ok = ctx->verify_cb(0,  ctx);<br>
> <br>
> X509_STORE_get_verify_cb()<br>
> <br>
<br>
I'm not sure what you mean by the return types are different <br>
X509_STORE_get_verify_cb, is declared as follows:<br>
<br>
     X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE <br>
*ctx);<br>
<br>
Where X509_STORE_CTX_verify_cb is declared as:<br>
<br>
     typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);<br>
<br>
So, this code is equivalent to your original code above:<br>
<br>
     X509_STORE_CTX_verify_cb verify_cb;<br>
<br>
     verify_cb = X509_STORE_get_verify_cb(ctx);<br>
     ok = verify_cb(0, ctx);<br>
<br>
Matt<br>
<br>
<br>
> please suggest.<br>
> <br>
> Thanks,<br>
> shivakumar<br>
> ------------------------------------------------------------------------<br>
> *From:* Matt Caswell <matt@openssl.org><br>
> *Sent:* Tuesday, October 5, 2021 1:20 PM<br>
> *To:* Shivakumar Poojari <Shivakumar.Poojari@rbbn.com>; <br>
> openssl-users@openssl.org <openssl-users@openssl.org><br>
> *Cc:* Paramashivaiah, Sunil <Sunil.Paramashivaiah@rbbn.com>; Kumar <br>
> Mishra, Sanjeev <Sanjeev.Kumar-Mishra@rbbn.com>; Bhattacharjee, <br>
> Debapriyo (c) <dbhattacharjee@rbbn.com><br>
> *Subject:* [EXTERNAL] Re: Alternative for structure opaque X509 & <br>
> X509_STORE_CTX<br>
> <br>
> <br>
> On 05/10/2021 05:24, Shivakumar Poojari wrote:<br>
>> :error: invalid use of incomplete type 'X509' {aka 'struct x509_st'}<br>
>>       if (x->ocsp && x->ocsp->ocsp_url)<br>
> <br>
> Strangely there is no ocsp field in an x509_st even in 1.0.2 that I can see.<br>
> <br>
> <br>
>> <br>
>> :error: invalid use of incomplete type 'X509' {aka 'struct x509_st'}<br>
>>           if(cert->sig_alg)<br>
>> <br>
>> :types.h:157:16: note: forward declaration of 'X509' {aka 'struct x509_st'}<br>
>>   typedef struct x509_st X509;<br>
>> <br>
>> error: invalid use of incomplete type 'X509' {aka 'struct x509_st'}<br>
>>               sigAlg = OBJ_obj2nid((cert)->sig_alg->algorithm);<br>
> <br>
> <br>
> sig_alg is an X509_ALGOR structure which you get can using<br>
> X509_get0_signature().<br>
> <br>
>> <br>
>>   error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       x = ctx->cert;<br>
> <br>
> X509_STORE_CTX_get_current_cert()<br>
> <br>
>>              ^~<br>
>> types.h:165:16: note: forward declaration of 'X509_STORE_CTX' {aka <br>
>> 'struct x509_store_ctx_st'}<br>
>>   typedef struct x509_store_ctx_st X509_STORE_CTX;<br>
>>                  ^~~~~~~~~~~~~~~~~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       ctx->current_cert = x;<br>
> <br>
> X509_STORE_CTX_set_current_cert()<br>
> <br>
>>          ^~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       ctx->current_issuer = NULL;<br>
>>          ^~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       ctx->current_crl_score = 0;<br>
>>          ^~<br>
>> <br>
>> types.h:165:16: note: forward declaration of 'X509_STORE_CTX' {aka <br>
>> 'struct x509_store_ctx_st'}<br>
>>   typedef struct x509_store_ctx_st X509_STORE_CTX;<br>
>>                  ^~~~~~~~~~~~~~~~~<br>
>> <br>
>> types.h:165:16: note: forward declaration of 'X509_STORE_CTX' {aka <br>
>> 'struct x509_store_ctx_st'}<br>
>>   typedef struct x509_store_ctx_st X509_STORE_CTX;<br>
>>                  ^~~~~~~~~~~~~~~~~<br>
>> /sonus/p4/ws/spoojari/openssl3/marlin/SIPCM/sipCmOpenSSL.c:3268:8: <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       ctx->current_reasons = 0;<br>
> <br>
> <br>
> <br>
> These fields can't be set individually. You have to reset the whole<br>
> X509_STORE_CTX, e.g. via X509_STORE_CTX_init.<br>
> <br>
> <br>
>>          ^~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       ctx->error = 0;<br>
> <br>
> <br>
> X509_STORE_CTX_set_error()<br>
> <br>
>>          ^~<br>
>> error: invalid use of incomplete type 'X509' {aka 'struct x509_st'}<br>
>>               if (px->ocsp && (px->ocsp->ocsp_validate == <br>
>> X509_OCSP_VALIDATE_DISABLED))<br>
>>                     ^~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>           if (!ctx->ctx->ocsp_process_responder)<br>
>>                   ^~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>       store = ctx->ctx;<br>
>> <br>
> <br>
> Use X509_STORE_CTX_get0_store() to get ctx->ctx. I can't find the field<br>
> "ocsp_process_responder"<br>
> <br>
> <br>
>                    ^~<br>
>> <br>
>> error: invalid use of incomplete type 'X509_STORE_CTX' {aka 'struct <br>
>> x509_store_ctx_st'}<br>
>>           ok = ctx->verify_cb(0, ctx);<br>
> <br>
> X509_STORE_get_verify_cb()<br>
> <br>
> <br>
>>                   ^~<br>
>> Getting above error in the code, Please provide the document that which <br>
>> function i can use to resolve this errors.<br>
>> <br>
>> Thanks,<br>
>> Shiva kumar<br>
>> <br>
>> Notice: This e-mail together with any attachments may contain <br>
>> information of Ribbon Communications Inc. and its Affiliates that is <br>
>> confidential and/or proprietary for the sole use of the intended <br>
>> recipient. Any review, disclosure, reliance or distribution by others or <br>
>> forwarding without express permission is strictly prohibited. If you are <br>
>> not the intended recipient, please notify the sender immediately and <br>
>> then delete all copies, including any attachments.<br>
> <br>
> Notice: This e-mail together with any attachments may contain <br>
> information of Ribbon Communications Inc. and its Affiliates that is <br>
> confidential and/or proprietary for the sole use of the intended <br>
> recipient. Any review, disclosure, reliance or distribution by others or <br>
> forwarding without express permission is strictly prohibited. If you are <br>
> not the intended recipient, please notify the sender immediately and <br>
> then delete all copies, including any attachments.<br>
</div>
</span></font></div>
<br clear="both">
Notice: This e-mail together with any attachments may contain information of Ribbon Communications Inc. and its Affiliates that is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and then delete all copies, including any attachments.<BR>
</body>
</html>