[gnutls-help] Problem with OCSP status in gnutls-cli

Nikos Mavrogiannopoulos n.mavrogiannopoulos at gmail.com
Wed Dec 13 07:46:46 CET 2017


On Tue, 2017-12-12 at 13:21 +0100, Johannes Bauer wrote:
> Hi list,
> 
> I'm currently writing some software for pentesting. It includes an
> OCSP
> and TLS server that both are based on OpenSSL. With Ubuntu 17.04, I
> added some integration tests that featured the gnutls-cli TLS client.
> Yesterday I updated to Ubuntu 17.10 and now the gnutls tests are
> broken;
> gnuTLS rejects the OCSP responses from my server as invalid.
> 
> Let me stress that it is *very* possible that the fault is not
> gnuTLS,
> but my software. However, OpenSSL doesn't show any issue with the
> OCSP
> response and from the error message I'm getting from gnuTLS I find
> myself unable to debug the root cause of this issue. Here's the
> certificates first:
[...]
> With more debugging:
> > <4>| HSK[0x55a19fda5a00]: CERTIFICATE STATUS (22) was received.
> > Length
> 
> 283[283], frag offset 0, frag length: 283, sequence: 0
> - Certificate type: X.509
> - Got a certificate list of 1 certificates.
> - Certificate[0] info:
>  - subject `CN=127.0.0.1', issuer `OU=ratched,CN=Evil root
> certificate',
> serial 0x23486e2dcfc15e02a489d2bb0bcf0512, EC/ECDSA key 256 bits,
> signed
> using ECDSA-SHA256, activated `2017-12-11 12:09:27 UTC', expires
> `2018-12-12 12:09:27 UTC',
> pin-sha256="a0SEAr7c1914pYZhUR9m1gvT+KMbx6/TY6gdWZ+JoXg="
> 	Public Key ID:
> 		sha1:fcfa19101266ef624aa968f13b30641038d03e32
> 		sha256:6b448402bedcd7dd78a58661511f66d60bd3f8a31bc7afd3
> 63a81d599f89a178
> 	Public Key PIN:
> 		pin-sha256:a0SEAr7c1914pYZhUR9m1gvT+KMbx6/TY6gdWZ+JoXg=
> 
> > <3>| ASSERT: common.c[_gnutls_x509_get_raw_field2]:1558
> > <3>| ASSERT: ocsp.c[find_signercert]:1913
> > <3>| ASSERT: common.c[_gnutls_x509_der_encode]:864
> > <3>| ASSERT: ocsp.c[find_signercert]:2008
> > <3>| ASSERT: common.c[_gnutls_x509_get_raw_field2]:1558
> > <3>| ASSERT: ocsp.c[gnutls_ocsp_resp_verify]:2269
> > <3>| ASSERT: x509.c[check_ocsp_response]:153
> > <3>| ASSERT:
> > name_constraints.c[gnutls_x509_crt_get_name_constraints]:470
> 
> - Status: The certificate is NOT trusted. The received OCSP status
> response is invalid.

What I can see from the code involved in the asserts above is that the
signer of the OCSP response cannot be found either in the chain sent by
the server, or in the trusted store.

The message "Got a certificate list of 1 certificates" further suggests
that the server didn't include root.crt in its chain. Is that correct?


regards,
Nikos




More information about the Gnutls-help mailing list