summaryrefslogtreecommitdiff
path: root/tests/set_x509_key.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-10-22 09:41:45 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-24 08:35:46 +0200
commit47be1efbd6cf7bac497778f261e5e7adc81f49b1 (patch)
treedc277a0d702078dadc212d65b75c4daee24b358e /tests/set_x509_key.c
parenta8c269964c2bd2a9edf9d6fe7b00481290fa9b13 (diff)
downloadgnutls-47be1efbd6cf7bac497778f261e5e7adc81f49b1.tar.gz
modified the gnutls_certificate_set_key* change
While the change was fully backwards compatible for applications that were adding a single certificate, and applications that were checking for negative errors codes, many applications do not. As this may cause incompatibility issues with software properly utilizing the previously documented API, the change is reverted, and applications need to explicitly enable a flag (GNUTLS_CERTIFICATE_API_V2) in the credentials structure for the set_key functions to return an index.
Diffstat (limited to 'tests/set_x509_key.c')
-rw-r--r--tests/set_x509_key.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/set_x509_key.c b/tests/set_x509_key.c
index 306bcd0809..6a189540d9 100644
--- a/tests/set_x509_key.c
+++ b/tests/set_x509_key.c
@@ -156,6 +156,8 @@ static void basic(void)
assert(gnutls_certificate_allocate_credentials(&clicred) >= 0);
assert(gnutls_certificate_allocate_credentials(&x509_cred)>=0);
+ gnutls_certificate_set_flags(x509_cred, GNUTLS_CERTIFICATE_API_V2);
+
ret = gnutls_certificate_set_x509_trust_mem(clicred, &ca_cert, GNUTLS_X509_FMT_PEM);
if (ret < 0)
fail("set_x509_trust_file failed: %s\n", gnutls_strerror(ret));