diff options
author | Werner Koch <wk@gnupg.org> | 1999-10-26 14:14:37 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1999-10-26 14:14:37 +0200 |
commit | cf70ca8d68eb836b952f2c234f064b1afc205962 (patch) | |
tree | aa33afbc79efd1f8538e5286b13d900321a8f14b /g10/misc.c | |
parent | Changed the way it works - now needs an extra program to to most tasks. (diff) | |
download | gnupg2-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.c | 30 |
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); +} + |