summaryrefslogtreecommitdiff
path: root/lib/gnutls_cipher_int.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-12 20:08:07 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-01-12 20:08:07 +0100
commitf379890f2e62b3134d3909849595044eaa4b4c3a (patch)
treeb92c7966de29edf71118aa866a9d22bb764265e9 /lib/gnutls_cipher_int.c
parent92ce5034ada4aa57ab3cc4ff7ddce0eab3aaa2b0 (diff)
downloadgnutls-f379890f2e62b3134d3909849595044eaa4b4c3a.tar.gz
Only list algorithms if they are implemented.
Diffstat (limited to 'lib/gnutls_cipher_int.c')
-rw-r--r--lib/gnutls_cipher_int.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gnutls_cipher_int.c b/lib/gnutls_cipher_int.c
index 5814d5127c..1a5346b82b 100644
--- a/lib/gnutls_cipher_int.c
+++ b/lib/gnutls_cipher_int.c
@@ -34,6 +34,21 @@
goto cleanup; \
}
+/* Returns true(non-zero) or false(0) if the
+ * provided cipher exists
+ */
+int _gnutls_cipher_exists(gnutls_cipher_algorithm_t cipher)
+{
+ const gnutls_crypto_cipher_st *cc;
+ int ret;
+
+ cc = _gnutls_get_crypto_cipher (cipher);
+ if (cc != NULL) return 1;
+
+ ret = _gnutls_cipher_ops.exists(cipher);
+ return ret;
+}
+
int
_gnutls_cipher_init (cipher_hd_st * handle, gnutls_cipher_algorithm_t cipher,
const gnutls_datum_t * key, const gnutls_datum_t * iv, int enc)