<div dir="ltr"><div>Hi,</div><div>I was facing a problem when adding OCSP verification to existing TLS cert verification mechanism. <br></div><div>We register a callback of the form</div><div>int ocsp_status_response_cb(SSL *, void *) via</div><div> SSL_CTX_set_tlsext_status_cb()</div><div><br></div><div>My intention is to call the certificate verification function callback as a normal function inside the OCSP callback (the reason why this is done is due to a separate issue with callback ordering)</div><div>The certificate verification function is set through</div><div>SSL_CTX_set_cert_verify_cb(), and the callback is of the form</div><div>int (*cert_verify_cb) (X509_STORE_CTX *, void *)</div><div><br></div><div>So to be able to call this inside the OCSP callback, I'd need to reconstruct the</div><div>X509_STORE_CTX argument. I'm not very familiar with openssl internals, so forgive me if this is silly.</div><div>
1)Is it conceptually right to do so?

</div><div>2)Is it possible to construct x509_store_ctx from ssl? <br></div><div>3)I could extract the peer cert chain from SSL through SSL_get_peer_cert_stack() and create a x509_store_ctx. But this wouldn't be identical to how it's created originally and might lack information. If it's correct to do so and possible, what's the right method to create it?</div><div><br></div><div>Do you see any alternative to overall approach?</div><div>(For the original problem, please have a look at thread named "Stapled OCSP Response")</div><div><br></div><div>Any leads would be helpful</div><div><br></div><div>Thanks</div><div>Akshath<br></div><div>
<pre><code><br><br></code></pre><pre><code><br></code></pre>

</div></div>