From 63ee8c1b73e5f1c5e5388e4a3af7bf16cfdf9d08 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Thu, 27 Jul 2017 15:21:25 +0100 Subject: [PATCH] Check threshold for POLARSSL_X509_MAX_INTERMEDIATE_CA in X509 tests The X509 test suite assumes that POLARSSL_X509_MAX_INTERMEDIATE_CA is below the hardcoded threshold 20 used in the long certificate chain generating script tests/data_files/dir-max/long.sh. This commit adds a compile-time check for that. --- tests/suites/test_suite_x509parse.function | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index 82e459603..dd7079026 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -7,6 +7,12 @@ #include "polarssl/oid.h" #include "polarssl/base64.h" +#if POLARSSL_X509_MAX_INTERMEDIATE_CA >= 19 +#error "The value of POLARSSL_X509_MAX_INTERMEDIATE_C is larger \ +than the current threshold 19. To test larger values, please \ +adapt the script tests/data_files/dir-max/long.sh." +#endif + int verify_none( void *data, x509_crt *crt, int certificate_depth, int *flags ) { ((void) data);