[svn] GnuPG - r5424 - in branches/STABLE-BRANCH-2-0: . g10
svn author wk
cvs at cvs.gnupg.org
Tue Sep 28 10:29:14 CEST 2010
Author: wk
Date: 2010-09-28 10:29:13 +0200 (Tue, 28 Sep 2010)
New Revision: 5424
Modified:
branches/STABLE-BRANCH-2-0/NEWS
branches/STABLE-BRANCH-2-0/g10/ChangeLog
branches/STABLE-BRANCH-2-0/g10/call-agent.c
Log:
Allow more hash algorithms with the OpenPGP card.
Modified: branches/STABLE-BRANCH-2-0/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/ChangeLog 2010-09-24 13:06:56 UTC (rev 5423)
+++ branches/STABLE-BRANCH-2-0/g10/ChangeLog 2010-09-28 08:29:13 UTC (rev 5424)
@@ -1,3 +1,8 @@
+2010-09-28 Werner Koch <wk at g10code.com>
+
+ * call-agent.c (hash_algo_option): New.
+ (agent_scd_pksign): Use it.
+
2010-07-20 Werner Koch <wk at g10code.com>
* mainproc.c (print_pkenc_list): Print a STATUS_ERROR. Fixes
Modified: branches/STABLE-BRANCH-2-0/NEWS
===================================================================
--- branches/STABLE-BRANCH-2-0/NEWS 2010-09-24 13:06:56 UTC (rev 5423)
+++ branches/STABLE-BRANCH-2-0/NEWS 2010-09-28 08:29:13 UTC (rev 5424)
@@ -5,7 +5,9 @@
* gpg-agent now tests for a newly created gpg-agent.conf after a HUP.
+ * Allow more hash algorithms with the OpenPGP v2 card.
+
Noteworthy changes in version 2.0.16 (2010-07-19)
-------------------------------------------------
Modified: branches/STABLE-BRANCH-2-0/g10/call-agent.c
===================================================================
--- branches/STABLE-BRANCH-2-0/g10/call-agent.c 2010-09-24 13:06:56 UTC (rev 5423)
+++ branches/STABLE-BRANCH-2-0/g10/call-agent.c 2010-09-28 08:29:13 UTC (rev 5424)
@@ -892,6 +892,25 @@
return 0;
}
+
+/* Helper returning a command option to describe the used hash
+ algorithm. See scd/command.c:cmd_pksign. */
+static const char *
+hash_algo_option (int algo)
+{
+ switch (algo)
+ {
+ case GCRY_MD_RMD160: return "--hash=rmd160";
+ case GCRY_MD_SHA1 : return "--hash=sha1";
+ case GCRY_MD_SHA224: return "--hash=sha224";
+ case GCRY_MD_SHA256: return "--hash=sha256";
+ case GCRY_MD_SHA384: return "--hash=sha384";
+ case GCRY_MD_SHA512: return "--hash=sha512";
+ case GCRY_MD_MD5 : return "--hash=md5";
+ default: return "";
+ }
+}
+
/* Send a sign command to the scdaemon via gpg-agent's pass thru
mechanism. */
int
@@ -938,8 +957,7 @@
else
#endif
snprintf (line, DIM(line)-1, "SCD PKSIGN %s%s",
- hashalgo == GCRY_MD_RMD160? "--hash=rmd160 " : "",
- serialno);
+ hash_algo_option (hashalgo), serialno);
line[DIM(line)-1] = 0;
rc = assuan_transact (agent_ctx, line, membuf_data_cb, &data,
default_inq_cb, NULL, NULL, NULL);
More information about the Gnupg-commits
mailing list