summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-01-15 20:43:10 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-01-15 20:57:18 +0100
commit4b6f8f1d86459e38b2c29ce7df38f52ac136ad45 (patch)
treede01eb1c9cede4db8aa328598a417a4bfed40f49 /tests
parent0a3285078d1a04311e9afb4b81e9efe5930a4416 (diff)
downloadgnutls-4b6f8f1d86459e38b2c29ce7df38f52ac136ad45.tar.gz
fixes in internal build with the new deprecated functions. We allow them to be used since they are inter-dependent.
Diffstat (limited to 'tests')
-rw-r--r--tests/crq_key_id.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/crq_key_id.c b/tests/crq_key_id.c
index da2461c645..2d7a9c455f 100644
--- a/tests/crq_key_id.c
+++ b/tests/crq_key_id.c
@@ -30,6 +30,7 @@
#include <gcrypt.h>
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
+#include <gnutls/abstract.h>
#include "utils.h"
@@ -43,6 +44,7 @@ void
doit (void)
{
gnutls_x509_privkey_t pkey;
+ gnutls_privkey_t abs_pkey;
gnutls_x509_crq_t crq;
size_t pkey_key_id_len;
@@ -75,6 +77,12 @@ doit (void)
fail ("gnutls_x509_privkey_init: %d\n", ret);
}
+ ret = gnutls_privkey_init (&abs_pkey);
+ if (ret < 0)
+ {
+ fail ("gnutls_privkey_init: %d\n", ret);
+ }
+
ret = gnutls_x509_privkey_generate (pkey, algorithm, 1024, 0);
if (ret < 0)
{
@@ -123,7 +131,13 @@ doit (void)
fail ("gnutls_x509_crq_set_dn_by_oid: %d\n", ret);
}
- ret = gnutls_x509_crq_sign (crq, pkey);
+ ret = gnutls_privkey_import_x509( abs_pkey, pkey, 0);
+ if (ret < 0)
+ {
+ fail ("gnutls_privkey_import_x509: %d\n", ret);
+ }
+
+ ret = gnutls_x509_crq_privkey_sign (crq, abs_pkey, GNUTLS_DIG_SHA1, 0);
if (ret)
{
fail ("gnutls_x509_crq_sign: %d\n", ret);
@@ -177,6 +191,7 @@ doit (void)
gnutls_x509_crq_deinit (crq);
gnutls_x509_privkey_deinit (pkey);
+ gnutls_privkey_deinit (abs_pkey);
}
gnutls_global_deinit ();