summaryrefslogtreecommitdiff
path: root/tests/set_x509_key_file.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_file.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_file.c')
-rw-r--r--tests/set_x509_key_file.c5
1 files changed, 5 insertions, 0 deletions
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 <config.h>
#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));