summaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-10-26 14:14:37 +0200
committerWerner Koch <wk@gnupg.org>1999-10-26 14:14:37 +0200
commitcf70ca8d68eb836b952f2c234f064b1afc205962 (patch)
treeaa33afbc79efd1f8538e5286b13d900321a8f14b /g10/misc.c
parentChanged the way it works - now needs an extra program to to most tasks. (diff)
downloadgnupg2-cf70ca8d68eb836b952f2c234f064b1afc205962.tar.xz
gnupg2-cf70ca8d68eb836b952f2c234f064b1afc205962.zip
See ChangeLog: Tue Oct 26 14:10:21 CEST 1999 Werner Koch
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index 61f104a01..fb9d62f1f 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -31,6 +31,7 @@
#include <sys/time.h>
#include <sys/resource.h>
#endif
+#include <gcrypt.h>
#include "util.h"
#include "main.h"
#include "options.h"
@@ -265,3 +266,32 @@ map_gcry_rc( int rc )
}
}
+
+/****************
+ * Wrapper around the libgcrypt function with addional checks on
+ * openPGP contrainst for the algo ID.
+ */
+int
+openpgp_cipher_test_algo( int algo )
+{
+ if( algo < 0 || algo > 110 )
+ return GCRYERR_INV_ALGO;
+ return gcry_cipher_test_algo(algo);
+}
+
+int
+openpgp_pk_test_algo( int algo )
+{
+ if( algo < 0 || algo > 110 )
+ return GCRYERR_INV_ALGO;
+ return gcry_pk_test_algo(algo);
+}
+
+int
+openpgp_md_test_algo( int algo )
+{
+ if( algo < 0 || algo > 110 )
+ return GCRYERR_INV_ALGO;
+ return gcry_md_test_algo(algo);
+}
+