mirror of
git://git.gnupg.org/gnupg.git
synced 2024-06-17 00:39:50 +02:00
![Werner Koch](/assets/img/avatar_default.png)
* g10/dek.h (DEK): Turn fields use_mdc, algo_printed and symmetric into single bit vars. Make sure they are always set to 1 or 0. (DEK): New field use_aead. * g10/options.h (struct opt): New field force_aead. * g10/pkclist.c (select_aead_from_pklist): New. * g10/gpg.c (oForceAEAD): New const. (opts): New options "--force-aead". (main): Set new option. * g10/encrypt.c (use_aead): New. (encrypt_simple): Implement new flags DEK.use_aead. (encrypt_crypt): Ditto. (encrypt_filter): Ditto. * g10/sign.c (sign_symencrypt_file): Ditto. -- This patch should be enough to detect whether AEAD can be used. Not tested. Signed-off-by: Werner Koch <wk@gnupg.org>
53 lines
1.4 KiB
C
53 lines
1.4 KiB
C
/* dek.h - The data encryption key structure.
|
|
* Copyright (C) 2014, 2017 Werner Koch
|
|
*
|
|
* This file is part of GnuPG.
|
|
*
|
|
* GnuPG is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* GnuPG is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef G10_DEK_H
|
|
#define G10_DEK_H
|
|
|
|
|
|
typedef struct
|
|
{
|
|
/* The algorithm (e.g., CIPHER_ALGO_AES). */
|
|
int algo;
|
|
/* The length of the key (in bytes). */
|
|
int keylen;
|
|
|
|
/* Whether we've already printed information about this key. This
|
|
* is currently only used in decrypt_data() and only if we are in
|
|
* verbose mode. */
|
|
int algo_info_printed : 1;
|
|
|
|
/* AEAD shall be used. */
|
|
int use_aead : 1;
|
|
|
|
/* MDC shall be used. */
|
|
int use_mdc : 1;
|
|
|
|
/* This key was read from a SK-ESK packet (see proc_symkey_enc). */
|
|
int symmetric : 1;
|
|
|
|
/* This is the largest used keylen (256 bit). */
|
|
byte key[32];
|
|
|
|
/* The cacheid for the S2K. */
|
|
char s2k_cacheid[1+16+1];
|
|
} DEK;
|
|
|
|
|
|
#endif /*G10_DEK_H*/
|