mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
gpg: Fix hash detection for ECDSA.
* g10/sign.c (sign_file): Use DSA or ECDSA and not DSA|EdDSA. -- This error was introduced with commit b7f8dec6325f1c80640f878ed3080bbc194fbc78 while separating EdDSA from ECDSA. Found due to a related bug report from Brian Minton. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
cd2c6f36fe
commit
f80c2dd78d
@ -899,13 +899,12 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
|
|||||||
for (sk_rover = sk_list; sk_rover; sk_rover = sk_rover->next )
|
for (sk_rover = sk_list; sk_rover; sk_rover = sk_rover->next )
|
||||||
{
|
{
|
||||||
if (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_DSA
|
if (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_DSA
|
||||||
|| (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_EDDSA
|
|| sk_rover->pk->pubkey_algo == PUBKEY_ALGO_ECDSA)
|
||||||
&& !openpgp_oid_is_ed25519 (sk_rover->pk->pkey[1])))
|
|
||||||
{
|
{
|
||||||
int temp_hashlen = (gcry_mpi_get_nbits
|
int temp_hashlen = (gcry_mpi_get_nbits
|
||||||
(sk_rover->pk->pkey[1]));
|
(sk_rover->pk->pkey[1]));
|
||||||
|
|
||||||
if (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_EDDSA)
|
if (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_ECDSA)
|
||||||
temp_hashlen = ecdsa_qbits_from_Q (temp_hashlen);
|
temp_hashlen = ecdsa_qbits_from_Q (temp_hashlen);
|
||||||
temp_hashlen = (temp_hashlen+7)/8;
|
temp_hashlen = (temp_hashlen+7)/8;
|
||||||
|
|
||||||
@ -915,7 +914,7 @@ sign_file (ctrl_t ctrl, strlist_t filenames, int detached, strlist_t locusr,
|
|||||||
if (hint.digest_length<temp_hashlen)
|
if (hint.digest_length<temp_hashlen)
|
||||||
hint.digest_length=temp_hashlen;
|
hint.digest_length=temp_hashlen;
|
||||||
}
|
}
|
||||||
/* FIXME: need toall gpg-agent */
|
/* FIXME: need to check gpg-agent for this. */
|
||||||
/* else if (sk_rover->pk->is_protected */
|
/* else if (sk_rover->pk->is_protected */
|
||||||
/* && sk_rover->pk->protect.s2k.mode == 1002) */
|
/* && sk_rover->pk->protect.s2k.mode == 1002) */
|
||||||
/* smartcard = 1; */
|
/* smartcard = 1; */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user