diff options
author | David Shaw <[email protected]> | 2009-06-05 14:11:03 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2009-06-05 14:11:03 +0000 |
commit | 047d97e95e1df831d699fb77cd58c269a13a5c5c (patch) | |
tree | 1aba8b3a366cbf6bfe543401009358b079ef3673 /g10/misc.c | |
parent | * defs.inc: Improved all_cipher_algos and all_hash_algos to work when (diff) | |
download | gnupg-047d97e95e1df831d699fb77cd58c269a13a5c5c.tar.gz gnupg-047d97e95e1df831d699fb77cd58c269a13a5c5c.zip |
Add full Camellia support.
* configure.ac: Remove Camellia restriction.
* gpg.c (main), misc.c (openpgp_cipher_test_algo): Remove Camellia
restriction.
* misc.c (map_cipher_openpgp_to_gcry), main.h: Add macros for
openpgp_cipher_open, openpgp_cipher_get_algo_keylen, and
openpgp_cipher_get_algo_blklen to wrap around the corresponding gcry_*
functions, but pass the algorithm number through
map_cipher_openpgp_to_gcry. This is needed in case the gcry algorithm
number doesn't match the OpenPGP number (c.f. Camellia).
* encr-data.c, pubkey-enc.c, mainproc.c, cipher.c, encode.c, seskey.c,
passphrase.c, seckey-cert.c: Use new openpgp_cipher_* macros here.
Diffstat (limited to 'g10/misc.c')
-rw-r--r-- | g10/misc.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/g10/misc.c b/g10/misc.c index 80a8a74ca..5b9e652ab 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -1,6 +1,6 @@ /* misc.c - miscellaneous functions * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - * 2008 Free Software Foundation, Inc. + * 2008, 2009 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -340,7 +340,7 @@ print_digest_algo_note( int algo ) /* Map OpenPGP algo numbers to those used by Libgcrypt. We need to do this for algorithms we implemented in Libgcrypt after they become part of OpenPGP. */ -static int +int map_cipher_openpgp_to_gcry (int algo) { switch (algo) @@ -400,15 +400,6 @@ openpgp_cipher_test_algo( int algo ) if ( algo < 0 || algo > 110 || algo == 5 || algo == 6 ) return gpg_error (GPG_ERR_CIPHER_ALGO); - /* Camellia is not yet defined for OpenPGP thus only allow it if - requested. */ -#ifndef USE_CAMELLIA - if (algo == CIPHER_ALGO_CAMELLIA128 - || algo == CIPHER_ALGO_CAMELLIA192 - || algo == CIPHER_ALGO_CAMELLIA256) - return gpg_error (GPG_ERR_CIPHER_ALGO); -#endif - return gcry_cipher_test_algo (map_cipher_openpgp_to_gcry (algo)); } |