Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Short answer</strong>: The Boost callback function, from the link you cited, doesn't verify anything. It returns whatever preliminary verification result was supplied to it by OpenSSL (via <code>bool preverified</code>). If there is any fine grained verification required (like the CN match, etc.), it has to be done explicitly by the callback.</p> <p><strong>Long answer</strong>: By the time the OpenSSL (or the Boost wrapper for OpenSSL) calls the verification function, in this case, <code>bool verify_certificate(bool preverified, boost::asio::ssl::verify_context&amp; ctx)</code>, a set of preliminary (or mandatory) verification is already done by OpenSSL. This is explained in the <a href="http://www.openssl.org/docs/ssl/SSL_CTX_set_verify.html">documentation</a>.</p> <blockquote> <p>The certificate chain is checked starting with the deepest nesting level (the root CA certificate) and worked upward to the peer's certificate. At each level signatures and issuer attributes are checked. Whenever a verification error is found, the error number is stored in x509_ctx and verify_callback is called with preverify_ok=0. By applying X509_CTX_store_* functions verify_callback can locate the certificate in question and perform additional steps (see EXAMPLES). If no error is found for a certificate, verify_callback is called with preverify_ok=1 before advancing to the next level.</p> </blockquote> <p>The documentation also cites an example of how a more fine-grained verification callback could be written. You can draw inspiration from that depending on what your needs are.</p> <p><strong>EDIT:</strong> To be sure that Boost's internal callback function doesn't do anything special other than calling the application callback function, I took a look at <a href="http://www.boost.org/doc/libs/1_51_0_beta1/boost/asio/ssl/detail/impl/engine.ipp">engine.ipp</a>, the C++ module that invokes OpenSSL's <code>SSL_set_verify</code> to set up callback functions. Take a look at how <code>verify_callback_function</code> is implemented. It simply invokes the application callback.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload