From 47be1efbd6cf7bac497778f261e5e7adc81f49b1 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 22 Oct 2016 09:41:45 +0200 Subject: 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. --- tests/set_x509_key_file.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/set_x509_key_file.c') diff --git a/tests/set_x509_key_file.c b/tests/set_x509_key_file.c index b76e6d6377..504e6dc609 100644 --- a/tests/set_x509_key_file.c +++ b/tests/set_x509_key_file.c @@ -21,6 +21,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/* This test checks the behavior of gnutls_certificate_set_x509_key_file2() + * when the GNUTLS_CERTIFICATE_API_V2 is set */ + #ifdef HAVE_CONFIG_H #include #endif @@ -136,6 +139,8 @@ void doit(void) assert(gnutls_certificate_allocate_credentials(&xcred) >= 0); assert(gnutls_certificate_allocate_credentials(&clicred) >= 0); + gnutls_certificate_set_flags(xcred, GNUTLS_CERTIFICATE_API_V2); + ret = gnutls_certificate_set_x509_trust_mem(clicred, &subca3_cert, GNUTLS_X509_FMT_PEM); if (ret < 0) fail("set_x509_trust_file failed: %s\n", gnutls_strerror(ret)); -- cgit v1.2.1