mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Fix the encrypt+sign hash algo preference selection for ECDSA.
* g10/keydb.h (pref_hint): Change from union to struct and add field 'exact'. Adjust callers. * g10/pkclist.c (algo_available): Take care of the exact hint. * g10/sign.c (sign_file): Fix indentation. Rework the hash from recipient prefs. -- This fixes a encrypt+sign case like: One recipient key has SHA512 as highest ranked hash preference but the the signing key is a 256 bit curve. Because we don't want to use a truncated hash with ECDSA, we need to have an exact match - this is in particular important for smartcard which check that the hash matches the curves. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
f400ff4e7d
commit
aeed0b93ff
3 changed files with 57 additions and 37 deletions
|
@ -128,9 +128,10 @@ struct pubkey_find_info {
|
|||
|
||||
|
||||
/* Helper type for preference functions. */
|
||||
union pref_hint
|
||||
struct pref_hint
|
||||
{
|
||||
int digest_length;
|
||||
int digest_length; /* We want at least this digest length. */
|
||||
int exact; /* We need to use exactly this length. */
|
||||
};
|
||||
|
||||
|
||||
|
@ -262,9 +263,9 @@ gpg_error_t find_and_check_key (ctrl_t ctrl,
|
|||
pk_list_t *pk_list_addr);
|
||||
|
||||
int algo_available( preftype_t preftype, int algo,
|
||||
const union pref_hint *hint );
|
||||
const struct pref_hint *hint );
|
||||
int select_algo_from_prefs( PK_LIST pk_list, int preftype,
|
||||
int request, const union pref_hint *hint);
|
||||
int request, const struct pref_hint *hint);
|
||||
int select_mdc_from_pklist (PK_LIST pk_list);
|
||||
void warn_missing_mdc_from_pklist (PK_LIST pk_list);
|
||||
void warn_missing_aes_from_pklist (PK_LIST pk_list);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue