mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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.
This commit is contained in:
parent
6f287d4e3f
commit
047d97e95e
14 changed files with 72 additions and 92 deletions
10
g10/encode.c
10
g10/encode.c
|
@ -1,6 +1,6 @@
|
|||
/* encode.c - encode data
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
* 2006 Free Software Foundation, Inc.
|
||||
* 2006, 2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* This file is part of GnuPG.
|
||||
*
|
||||
|
@ -86,7 +86,7 @@ encode_seskey( DEK *dek, DEK **seskey, byte *enckey )
|
|||
|
||||
/* We only pass already checked values to the following fucntion,
|
||||
thus we consider any failure as fatal. */
|
||||
if (gcry_cipher_open (&hd, dek->algo, GCRY_CIPHER_MODE_CFB, 1))
|
||||
if (openpgp_cipher_open (&hd, dek->algo, GCRY_CIPHER_MODE_CFB, 1))
|
||||
BUG ();
|
||||
if (gcry_cipher_setkey (hd, dek->key, dek->keylen))
|
||||
BUG ();
|
||||
|
@ -142,7 +142,7 @@ use_mdc(PK_LIST pk_list,int algo)
|
|||
|
||||
/* Last try. Use MDC for the modern ciphers. */
|
||||
|
||||
if (gcry_cipher_get_algo_blklen (algo) != 8)
|
||||
if (openpgp_cipher_get_algo_blklen (algo) != 8)
|
||||
return 1;
|
||||
|
||||
if (opt.verbose)
|
||||
|
@ -237,7 +237,7 @@ encode_simple( const char *filename, int mode, int use_seskey )
|
|||
{
|
||||
DEK *dek = NULL;
|
||||
|
||||
seskeylen = gcry_cipher_get_algo_keylen (default_cipher_algo ());
|
||||
seskeylen = openpgp_cipher_get_algo_keylen (default_cipher_algo ());
|
||||
encode_seskey( cfx.dek, &dek, enckey );
|
||||
xfree( cfx.dek ); cfx.dek = dek;
|
||||
}
|
||||
|
@ -411,7 +411,7 @@ setup_symkey(STRING2KEY **symkey_s2k,DEK **symkey_dek)
|
|||
static int
|
||||
write_symkey_enc(STRING2KEY *symkey_s2k,DEK *symkey_dek,DEK *dek,IOBUF out)
|
||||
{
|
||||
int rc, seskeylen = gcry_cipher_get_algo_keylen (dek->algo);
|
||||
int rc, seskeylen = openpgp_cipher_get_algo_keylen (dek->algo);
|
||||
|
||||
PKT_symkey_enc *enc;
|
||||
byte enckey[33];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue