summaryrefslogtreecommitdiff
blob: cd9673d7fbe4d65bca7a37bbf193480ba41a9211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From 580c82cbe8629b0848b30a4a4ed659c558dc42c7 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sun, 24 Aug 2014 21:19:26 +0300
Subject: [PATCH] build: condition pkcs11 block

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 lib/gnutls_privkey.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c
index 24ed6f2..647777e 100644
--- a/lib/gnutls_privkey.c
+++ b/lib/gnutls_privkey.c
@@ -198,6 +198,7 @@ _gnutls_privkey_get_mpis(gnutls_privkey_t key, gnutls_pk_params_st * params)
 	case GNUTLS_PRIVKEY_X509:
 		ret = _gnutls_pk_params_copy(params, &key->key.x509->params);
 		break;
+#ifdef ENABLE_PKCS11
 	case GNUTLS_PRIVKEY_PKCS11: {
 		gnutls_pubkey_t pubkey;
 
@@ -210,6 +211,7 @@ _gnutls_privkey_get_mpis(gnutls_privkey_t key, gnutls_pk_params_st * params)
 
 		break;
 		}
+#endif
 	default:
 		gnutls_assert();
 		return GNUTLS_E_INVALID_REQUEST;
-- 
1.8.5.5

From 95cf32756f65d945dff17458a89a0bdf7fc81f41 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sun, 24 Aug 2014 21:49:55 +0300
Subject: [PATCH] build: tests: x509cert-tl: support separate builddir

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 tests/Makefile.am   | 1 +
 tests/x509cert-tl.c | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6638fce..3ad6c67 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -128,6 +128,7 @@ TESTS_ENVIRONMENT =						\
 	PKCS12FILE_2=$(srcdir)/pkcs12-decode/pkcs12_2certs.p12	\
 	PKCS12PASSWORD_2=""					\
 	PKCS12PATH=$(srcdir)/pkcs12-decode/			\
+	X509CERTDIR=$(srcdir)/x509cert-dir/			\
 	EXEEXT=$(EXEEXT)					\
 	top_builddir="$(top_builddir)"				\
 	srcdir="$(srcdir)"
diff --git a/tests/x509cert-tl.c b/tests/x509cert-tl.c
index dad7860..5ecc03e 100644
--- a/tests/x509cert-tl.c
+++ b/tests/x509cert-tl.c
@@ -189,6 +189,7 @@ static time_t mytime(time_t * t)
 void doit(void)
 {
 	int ret;
+	const char *path;
 	gnutls_datum_t data;
 	gnutls_x509_crt_t server_crt, ca_crt2;
 	gnutls_x509_trust_list_t tl;
@@ -209,7 +210,10 @@ void doit(void)
 	gnutls_x509_crt_init(&server_crt);
 	gnutls_x509_crt_init(&ca_crt2);
 
-	ret = gnutls_x509_trust_list_add_trust_dir(tl, "./x509cert-dir", NULL, GNUTLS_X509_FMT_PEM, 0, 0);
+	path = getenv("X509CERTDIR");
+	if (!path)
+		path = "./x509cert-dir";
+	ret = gnutls_x509_trust_list_add_trust_dir(tl, path, NULL, GNUTLS_X509_FMT_PEM, 0, 0);
 	if (ret != 1)
 		fail("gnutls_x509_trust_list_add_trust_dir: %d\n", ret);
 
-- 
1.8.5.5