aboutsummaryrefslogtreecommitdiffstats
path: root/g10/status.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-01-30 20:16:28 +0000
committerWerner Koch <[email protected]>2007-01-30 20:16:28 +0000
commit7eec2efa66b55eab51e20d0fcc606763081d0024 (patch)
tree87dae67ea711626b9831caa374a3763ce2b7bf14 /g10/status.c
parentjnlib/ (diff)
downloadgnupg-7eec2efa66b55eab51e20d0fcc606763081d0024.tar.gz
gnupg-7eec2efa66b55eab51e20d0fcc606763081d0024.zip
Added LIBINTL to more Makefile targets.
doc/ * com-certs.pem: Added the current root certifcates of D-Trust and S-Trust. g10/ * status.c (write_status_begin_signing): New. * sign.c (sign_file, sign_symencrypt_file): Call it. * textfilter.c (copy_clearsig_text): Call it. * call-agent.c (agent_scd_pksign): Pass --hash-rmd160 to SCD if required. * gpg.c (main): Let --no-use-agent and --gpg-agent-info print a warning. * misc.c (obsolete_option): New.
Diffstat (limited to '')
-rw-r--r--g10/status.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/g10/status.c b/g10/status.c
index b0d0cd74c..83a28cda4 100644
--- a/g10/status.c
+++ b/g10/status.c
@@ -323,6 +323,39 @@ write_status_buffer ( int no, const char *buffer, size_t len, int wrap )
}
+/* Print the BEGIN_SIGNING status message. If MD is not NULL it is
+ used retrieve the hash algorithms used for the message. */
+void
+write_status_begin_signing (gcry_md_hd_t md)
+{
+ if (md)
+ {
+ char buf[100];
+ size_t buflen;
+ int i;
+
+ /* We use a hard coded list of possible algorithms. Using other
+ algorithms than specified by OpenPGP does not make sense
+ anyway. We do this out of performance reasons: Walking all
+ the 110 allowed Ids is not a good idea given the way the
+ check is implemented in libgcrypt. Recall that the only use
+ of this status code is to create the micalg algorithm for
+ PGP/MIME. */
+ buflen = 0;
+ for (i=1; i <= 11; i++)
+ if (i < 4 || i > 7)
+ if ( gcry_md_is_enabled (md, i) && buflen < DIM(buf) )
+ {
+ snprintf (buf+buflen, DIM(buf) - buflen - 1,
+ "%sH%d", buflen? " ":"",i);
+ buflen += strlen (buf+buflen);
+ }
+ write_status_text ( STATUS_BEGIN_SIGNING, buf );
+ }
+ else
+ write_status ( STATUS_BEGIN_SIGNING );
+}
+
static int
myread(int fd, void *buf, size_t count)