<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt>Hi all,<br>
      <br>
      We noticed that the depth limit check seems to behave differently
      between 1.0.2 and 1.1.0.<br>
      <br>
      In particular, with a (1.1.0)<br>
      <br>
      openssl/test$ ../util/shlib_wrap.sh ../apps/openssl s_server -port
      8080 -cert certs/ee-cert.pem -certform PEM -key certs/ee-key.pem
      -keyform PEM -no-CApath -CAfile certs/root-cert.pem -chainCAfile
      certs/ca-cert.pem<br>
      <br>
      running, I can then go poke at it with s_client and look for the
      'Verify return code' output from:<br>
      <br>
      openssl s_client -connect localhost:8080 -CAfile
      teset/certs/root-cert.pem -verify_depth N<br>
      <br>
      for N equal to 0, 1, or 2.<br>
      <br>
      With a 1.0.2 s_client,<br>
      <br>
      N=0 --> "Verify return code: 21 (unable to verify the first
      certificate)"<br>
      N=1 --> "Verify return code: 20 (unable to get local issuer
      certificate)"<br>
      N=2 --> "Verify return code: 0 (ok)"<br>
      <br>
      But the 1.1.0 s_client shows:<br>
      <br>
      N=0 --> "Verify return code: 22 (certificate chain too long)"<br>
      N=1 --> "Verify return code: 0 (ok)"<br>
      N=2 --> "Verify return code: 0 (ok)"<br>
      <br>
      The new behavior (which does not consider the root to be part of
      the chain for purposes of verification) seems to be intentional,
      and is explicitly tested in test/recipes/25-test_verify.t:<br>
      <br>
      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
      # Depth tests, note the depth limit bounds the number of CA
      certificates<br>
      # between the trust-anchor and the leaf, so, for example, with a
      root->ca->leaf<br>
      # chain, depth = 1 is sufficient, but depth == 0 is not.<br>
      #<br>
      ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"],
      "-verify_depth", "2"),<br>
         "accept chain with verify_depth 2");<br>
      ok(verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"],
      "-verify_depth", "1"),<br>
         "accept chain with verify_depth 1");<br>
      ok(!verify("ee-cert", "sslserver", ["root-cert"], ["ca-cert"],
      "-verify_depth", "0"),<br>
         "accept chain with verify_depth 0");<br>
    </tt><tt>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br>
      <br>
      There was a fair amount of churn in x509_vfy.c with the inclusion
      of the DANE stuff and whatnot, so it's not immediately clear to me
      when this change actually happened.  I think there are good
      arguments for the current 1.1.0 behavior and it doesn't really
      make sense to try to change back to the historical behavior, but
      it would be good to know when the change actually happened and
      that it is/was a known change.  Ideally we could also document the
      different behavior between 1.0.x and 1.1.0 better; any thoughts
      about where to do so?<br>
      <br>
      Thanks,<br>
      <br>
      Ben<br>
    </tt>
  </body>
</html>