[git] GnuPG - branch, master, updated. gnupg-2.1.14-58-ge630f90
by Werner Koch
cvs at cvs.gnupg.org
Tue Aug 9 17:47:59 CEST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via e630f904993725c54ec63be00369589b7b7234d2 (commit)
via 16feb1e0ea9b5d3966f22f4ae047335b9d1b60e1 (commit)
from 49829c29e541546084950b8a153067db371d101a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e630f904993725c54ec63be00369589b7b7234d2
Author: Werner Koch <wk at gnupg.org>
Date: Tue Aug 9 17:44:54 2016 +0200
agent: Fix regression in recent ssh changes.
* agent/command-ssh.c (sexp_key_construct): Lowercase the algo name.
--
We need to use a lowercase version of the algo in S-expression.
Unfortunately Libgcrypt has no function for this, thus we need to
malloc and first.
Fixes-commit: ebf24e3
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index b01cc06..2def342 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -1685,7 +1685,7 @@ sexp_key_construct (gcry_sexp_t *r_sexp,
void *formatbuf = NULL;
void **arg_list = NULL;
estream_t format = NULL;
-
+ char *algo_name = NULL;
if ((key_spec.flags & SPEC_FLAG_IS_EdDSA))
{
@@ -1723,7 +1723,6 @@ sexp_key_construct (gcry_sexp_t *r_sexp,
const char *elems;
size_t elems_n;
unsigned int i, j;
- const char *algo_name;
if (secret)
elems = key_spec.elems_sexp_order;
@@ -1750,7 +1749,13 @@ sexp_key_construct (gcry_sexp_t *r_sexp,
es_fputs ("(%s(%s", format);
arg_list[arg_idx++] = &key_identifier[secret];
- algo_name = gcry_pk_algo_name (key_spec.algo);
+ algo_name = xtrystrdup (gcry_pk_algo_name (key_spec.algo));
+ if (!algo_name)
+ {
+ err = gpg_error_from_syserror ();
+ goto out;
+ }
+ strlwr (algo_name);
arg_list[arg_idx++] = &algo_name;
if (curve_name)
{
@@ -1798,6 +1803,7 @@ sexp_key_construct (gcry_sexp_t *r_sexp,
es_fclose (format);
xfree (arg_list);
xfree (formatbuf);
+ xfree (algo_name);
return err;
}
commit 16feb1e0ea9b5d3966f22f4ae047335b9d1b60e1
Author: Werner Koch <wk at gnupg.org>
Date: Tue Aug 9 16:22:24 2016 +0200
gpg: Extend the PROGRESS line to give the used unit.
* g10/progress.c (write_status_progress): Print the units parameter.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/doc/DETAILS b/doc/DETAILS
index 02f9bad..0139fdb 100644
--- a/doc/DETAILS
+++ b/doc/DETAILS
@@ -929,7 +929,7 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB:
- 3 :: Ambigious specification
- 4 :: Key is stored on a smartcard.
-*** PROGRESS <what> <char> <cur> <total>
+*** PROGRESS <what> <char> <cur> <total> [<units>]
Used by the primegen and Public key functions to indicate
progress. <char> is the character displayed with no --status-fd
enabled, with the linefeed replaced by an 'X'. <cur> is the
@@ -953,6 +953,9 @@ pkd:0:1024:B665B1435F4C2 .... FF26ABB:
the data of a smartcard.
- card_busy :: A smartcard is still working
+ <units> is sometines used to describe the units for <current> and
+ <total>. For example "B", "KiB", or "MiB".
+
*** BACKUP_KEY_CREATED <fingerprint> <fname>
A backup of a key identified by <fingerprint> has been writte to
the file <fname>; <fname> is percent-escaped.
diff --git a/g10/progress.c b/g10/progress.c
index a1027b8..efc3b3a 100644
--- a/g10/progress.c
+++ b/g10/progress.c
@@ -75,7 +75,9 @@ static void
write_status_progress (const char *what,
unsigned long current, unsigned long total)
{
- char buffer[50];
+ char buffer[60];
+ char units[] = "BKMGTPEZY?";
+ int unitidx = 0;
/* Although we use an unsigned long for the values, 32 bit
* applications using GPGME will use an "int" and thus are limited
@@ -98,6 +100,7 @@ write_status_progress (const char *what,
{
total /= 1024;
current /= 1024;
+ unitidx++;
}
}
else
@@ -105,11 +108,17 @@ write_status_progress (const char *what,
while (current > 1024*1024)
{
current /= 1024;
+ unitidx++;
}
}
- snprintf (buffer, sizeof buffer, "%.20s ? %lu %lu",
- what? what : "?", current, total);
+ if (unitidx > 9)
+ unitidx = 9;
+
+ snprintf (buffer, sizeof buffer, "%.20s ? %lu %lu %c%s",
+ what? what : "?", current, total,
+ units[unitidx],
+ unitidx? "iB" : "");
write_status_text (STATUS_PROGRESS, buffer);
}
-----------------------------------------------------------------------
Summary of changes:
agent/command-ssh.c | 12 +++++++++---
doc/DETAILS | 5 ++++-
g10/progress.c | 15 ++++++++++++---
3 files changed, 25 insertions(+), 7 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list