On 2/5/24 11:26, Philippe Mathieu-Daudé wrote:
On 2/5/24 10:26, Daniel P. Berrangé wrote:
On Thu, May 02, 2024 at 10:22:02AM +0200, Philippe Mathieu-Daudé wrote:
On 2/5/24 10:11, Philippe Mathieu-Daudé wrote:
We only use Libtasn1 in unit tests. As noted in commit d47b83b118
("tests: add migration tests of TLS with x509 credentials"), having
GnuTLS without Libtasn1 is a valid configuration, so do not require
Libtasn1, to avoid:

    Dependency gnutls found: YES 3.7.1 (cached)
    Run-time dependency libtasn1 found: NO (tried pkgconfig)

    ../meson.build:1914:10: ERROR: Dependency "libtasn1" not found, tried pkgconfig

Restrict the unit test pkix_asn1_tab[] variable to CONFIG_TASN1.

Otherwise we get:

   In file included from tests/unit/crypto-tls-psk-helpers.c:23:
   tests/unit/crypto-tls-x509-helpers.h:26:10: fatal error:
   libtasn1.h: No such file or directory
      26 | #include <libtasn1.h>
         |          ^~~~~~~~~~~~
   compilation terminated.

I'd say that crypto-tls-psk-helpers.c shouldn't be including
crypto-tls-x509-helpers.h at all, as PSK auth does not depend
on X509 code

I agree, I tried the "less code churn" path first :)

test_tls_init() calls asn1_array2tree(),
test_tls_cleanup() calls asn1_delete_structure() and
test_tls_generate_cert() calls:
        asn1_create_element(pkix_asn1, "PKIX1.BasicConstraints", ...
        asn1_write_value(ext, "cA", ...
        asn1_write_value(ext, "pathLenConstraint", ...


Reply via email to