aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-01-21 14:22:41 +0000
committerWerner Koch <[email protected]>2011-01-21 14:22:41 +0000
commit27929981fc23fabecf6af9fa1361361b821bb2fd (patch)
tree480f23530b3835705f5d68f50a412c5126b2b279 /g10
parentEditorial changes and allow building with old libgcrypts. (diff)
downloadgnupg-27929981fc23fabecf6af9fa1361361b821bb2fd.tar.gz
gnupg-27929981fc23fabecf6af9fa1361361b821bb2fd.zip
Make most of the selftests work.
Note that there is still a problem with tests/openpgp/sigs.test while using the option --digest-algo SHA256.
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog4
-rw-r--r--g10/misc.c20
-rw-r--r--g10/sign.c3
3 files changed, 8 insertions, 19 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 0c8cbd418..75415f466 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-21 Werner Koch <[email protected]>
+
+ * misc.c (openpgp_pk_algo_name): Always use the gcrypt function.
+
2010-12-09 Werner Koch <[email protected]>
* tdbio.c (tdbio_set_dbname) [W32CE]: Take care of missing errno.
diff --git a/g10/misc.c b/g10/misc.c
index 6f77119fe..bdd797c16 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -503,25 +503,7 @@ openpgp_pk_algo_usage ( int algo )
const char *
openpgp_pk_algo_name (int algo)
{
- /* We use fixed strings to have pretty names instead of those from
- libgcrypt. */
- switch (algo)
- {
- case PUBKEY_ALGO_RSA:
- case PUBKEY_ALGO_RSA_E:
- case PUBKEY_ALGO_RSA_S: return "rsa";
-
- case PUBKEY_ALGO_ELGAMAL:
- case PUBKEY_ALGO_ELGAMAL_E: return "elg";
-
- case PUBKEY_ALGO_DSA: return "dsa";
-
- case PUBKEY_ALGO_ECDSA:return "ecdsa";
-
- case PUBKEY_ALGO_ECDH: return "ecdh";
-
- default: gcry_pk_algo_name (map_pk_openpgp_to_gcry (algo));
- }
+ return gcry_pk_algo_name (map_pk_openpgp_to_gcry (algo));
}
diff --git a/g10/sign.c b/g10/sign.c
index 30dc66d5f..cbb3c62e8 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -298,6 +298,9 @@ do_sign (PKT_public_key *pksk, PKT_signature *sig,
{
PKT_public_key *pk = xmalloc_clear (sizeof *pk);
+ log_debug ("checking created signature algo=%d\n", mdalgo);
+ log_printhex ("md:", dp, gcry_md_get_algo_dlen (mdalgo));
+
if (get_pubkey (pk, sig->keyid ))
err = gpg_error (GPG_ERR_NO_PUBKEY);
else