diff options
Diffstat (limited to 'hash-ecdsa.patch')
-rw-r--r-- | hash-ecdsa.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/hash-ecdsa.patch b/hash-ecdsa.patch new file mode 100644 index 000000000000..c451a18b80e7 --- /dev/null +++ b/hash-ecdsa.patch @@ -0,0 +1,48 @@ +From: Werner Koch <wk@gnupg.org> +Date: Wed, 19 Nov 2014 09:34:32 +0000 (+0100) +Subject: gpg: Fix hash detection for ECDSA. +X-Git-Url: http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commitdiff_plain;h=f80c2dd78d522f12b2c7afbd5c0763a97d87d2bd;hp=cd2c6f36fe5d1d1d45546f5168aead5cbe6487e0 + +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> +--- + +diff --git a/g10/sign.c b/g10/sign.c +index e7d4a68..2e62f04 100644 +--- a/g10/sign.c ++++ b/g10/sign.c +@@ -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 ) + { + if (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_DSA +- || (sk_rover->pk->pubkey_algo == PUBKEY_ALGO_EDDSA +- && !openpgp_oid_is_ed25519 (sk_rover->pk->pkey[1]))) ++ || sk_rover->pk->pubkey_algo == PUBKEY_ALGO_ECDSA) + { + int temp_hashlen = (gcry_mpi_get_nbits + (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 = (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) + 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 */ + /* && sk_rover->pk->protect.s2k.mode == 1002) */ + /* smartcard = 1; */ |