summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-03-08 18:40:06 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-03-08 18:49:39 +0100
commit193ca48ab984c900d5a4b350fb235668b3d99ac3 (patch)
treea3f4d65bfed886da6e8b6725c227e69d89438f47
parent9ac39d0c2e50b101812d5607f93c11144d8b14f2 (diff)
downloadgnutls-193ca48ab984c900d5a4b350fb235668b3d99ac3.tar.gz
return unimplemented feature on encounter of a known but unsupported url
-rw-r--r--lib/gnutls_x509.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index afac31a1da..3efe111bc0 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -774,6 +774,9 @@ cleanup:
gnutls_free (ccert);
return ret;
}
+#else
+# define read_cert_url(x,y) gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE)
+# define read_cas_url(x,y) gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE)
#endif
/* Reads a certificate file
@@ -786,12 +789,10 @@ read_cert_file (gnutls_certificate_credentials_t res,
size_t size;
char *data;
-#ifdef ENABLE_PKCS11
if (strncmp (certfile, "pkcs11:", 7) == 0)
{
return read_cert_url (res, certfile);
}
-#endif /* ENABLE_PKCS11 */
data = read_binary_file (certfile, &size);
@@ -821,12 +822,14 @@ read_key_file (gnutls_certificate_credentials_t res,
size_t size;
char *data;
-#ifdef ENABLE_PKCS11
if (strncmp (keyfile, "pkcs11:", 7) == 0)
{
+#ifdef ENABLE_PKCS11
return read_key_url (res, keyfile);
- }
+#else
+ return gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE);
#endif /* ENABLE_PKCS11 */
+ }
data = read_binary_file (keyfile, &size);
@@ -1562,12 +1565,10 @@ gnutls_certificate_set_x509_trust_file (gnutls_certificate_credentials_t cred,
gnutls_datum_t cas;
size_t size;
-#ifdef ENABLE_PKCS11
if (strncmp (cafile, "pkcs11:", 7) == 0)
{
return read_cas_url (cred, cafile);
}
-#endif
cas.data = (void*)read_binary_file (cafile, &size);
if (cas.data == NULL)