Signature verification failures when using a certificate chain #365
Replies: 2 comments 7 replies
-
Yes, please check out https://test.openquantumsafe.org whether that does what you want to achieve. Otherwise, please provide code (bug-reproducing PR would be ideal) to explain the problem (and eventually test a possible fix). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the report, @aerofeev2k . Very correct observation and a true bug. Created #367 to fix.
The OpenSSL command line level tests here and here cater for that (as well as testing that higher abstraction layer) -- admittedly only for a dynamically linked |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm unable to set up a TLS connection using certificate chain generated with falcon1024 (and other PQ algorithms too for that matter), OpenSSL is throwing a signature verification error on the connecting side:
(/build/oqsprovider/oqsprov/oqs_sig.c:438)error:06880006:asn1 encoding routines::EVP lib: (crypto/asn1/a_verify.c:216)error:0A000086:SSL routines::certificate verify failed: (ssl/statem/statem_clnt.c:2091)
Signature verification callback says that the certificate at depth 1, i.e. self-signed CA certificate, was verified OK, but the next certificate at depth 0, i.e. the one that was signed with the CA certificate, failed to verify.
I then went through the OpenSSL code and realized that by default it doesn't even check signatures on self-signed certs, to save CPU cycles. Checked oqs_test_tlssig.c that ships with oqs-provider, and found that it's only doing tests with a single self-signed certificate. OpenSSL doesn't do any certificate signature verifications in this case, and so if there's a problem, the test likely doesn't catch it. Finally I added a quick X509_self_signed(x509, 1) call to create_cert_key() in tlstest_helpers.c, and that gave me 0 back, meaning that the freshly generated self-signed certificate failed to verify.
My code works with "RSA" in place of "falcon1024", i.e. OpenSSL can verify signatures on both certificates in the chain, and TLS connection gets established successfully. test_oqs_tlssig("RSA") also produces a certificate, for which X509_self_signed(x509, 1) retuns 1, as it should.
Being new to Falcon, Sphincs, etc, I may be doing something terribly wrong here, but still would like to ask: has anybody tried opening TLS connections with a basic certificate chain? Any tricks in making it work?
This is openssl-3.2.1, liboqs-0.9.2 and oqsprovider-0.5.3.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions