summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-17 09:46:14 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-17 09:46:14 +0200
commit885e4f61f7ecd9e8f16ef7a214d7520041cf59ae (patch)
treed21ece81518e40081237ecb05accefdb5987f42d /tests
parent98901d7c4bc5d2a143f4f19dc37bb377f821f8bd (diff)
downloadgnutls-885e4f61f7ecd9e8f16ef7a214d7520041cf59ae.tar.gz
use MAX_CHAIN definition to avoid overflow issues in the future
Diffstat (limited to 'tests')
-rw-r--r--tests/chainverify.c2
-rw-r--r--tests/suite/pkcs11-chainverify.c2
-rw-r--r--tests/test-chains.h2
3 files changed, 4 insertions, 2 deletions
diff --git a/tests/chainverify.c b/tests/chainverify.c
index 85487bc5fd..7761536a56 100644
--- a/tests/chainverify.c
+++ b/tests/chainverify.c
@@ -60,7 +60,7 @@ void doit(void)
int ret;
gnutls_x509_trust_list_t tl;
unsigned int verify_status, verify_status1;
- gnutls_x509_crt_t certs[10];
+ gnutls_x509_crt_t certs[MAX_CHAIN];
gnutls_x509_crt_t ca;
gnutls_datum_t tmp;
size_t j;
diff --git a/tests/suite/pkcs11-chainverify.c b/tests/suite/pkcs11-chainverify.c
index d990315f08..2aebcf5967 100644
--- a/tests/suite/pkcs11-chainverify.c
+++ b/tests/suite/pkcs11-chainverify.c
@@ -136,7 +136,7 @@ void doit(void)
for (i = 0; chains[i].chain; i++) {
gnutls_x509_trust_list_t tl;
unsigned int verify_status;
- gnutls_x509_crt_t certs[4];
+ gnutls_x509_crt_t certs[MAX_CHAIN];
gnutls_x509_crt_t ca;
gnutls_datum_t tmp;
size_t j;
diff --git a/tests/test-chains.h b/tests/test-chains.h
index 481f161dd5..fd6956140c 100644
--- a/tests/test-chains.h
+++ b/tests/test-chains.h
@@ -22,6 +22,8 @@
/* *INDENT-OFF* */
+#define MAX_CHAIN 10
+
static const char *nc_bad1[] = {
"-----BEGIN CERTIFICATE-----\n"
"MIIDiTCCAkGgAwIBAgIMUwS5Fgr3eOV9V76jMA0GCSqGSIb3DQEBCwUAMA8xDTAL\n"