[svn] GnuPG - r5439 - in trunk: . agent doc g10 tools
svn author wk
cvs at cvs.gnupg.org
Wed Oct 6 13:29:12 CEST 2010
Author: wk
Date: 2010-10-06 13:29:10 +0200 (Wed, 06 Oct 2010)
New Revision: 5439
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/agent/ChangeLog
trunk/agent/cvt-openpgp.c
trunk/configure.ac
trunk/doc/gpg-agent.texi
trunk/g10/ChangeLog
trunk/g10/import.c
trunk/tools/ChangeLog
trunk/tools/watchgnupg.c
Log:
Import fixes.
new otion for watchgnupg
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/ChangeLog 2010-10-06 11:29:10 UTC (rev 5439)
@@ -1,3 +1,7 @@
+2010-10-06 Werner Koch <wk at g10code.com>
+
+ * configure.ac: Make --enable-standard-socket the default.
+
2010-10-04 Werner Koch <wk at g10code.com>
* configure.ac (GNUPG_CHECK_FAQPROG): Remove.
Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/agent/ChangeLog 2010-10-06 11:29:10 UTC (rev 5439)
@@ -1,3 +1,7 @@
+2010-10-06 Werner Koch <wk at g10code.com>
+
+ * cvt-openpgp.c (convert_secret_key): Add missing break.
+
2010-10-05 Werner Koch <wk at g10code.com>
* gpg-agent.c (main): Don't set SSH_AGENT_PID so that ssh-agent -k
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/g10/ChangeLog 2010-10-06 11:29:10 UTC (rev 5439)
@@ -1,3 +1,8 @@
+2010-10-06 Werner Koch <wk at g10code.com>
+
+ * import.c (transfer_secret_keys): Ignore missing key parameters.
+ Provide dummy IV. Ignore stub keys.
+
2010-10-01 Werner Koch <wk at g10code.com>
* export.c (do_export_stream): Rewrite to take the secret keys
Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/tools/ChangeLog 2010-10-06 11:29:10 UTC (rev 5439)
@@ -1,3 +1,7 @@
+2010-10-06 Werner Koch <wk at g10code.com>
+
+ * watchgnupg.c (print_version): Add option --time-only.
+
2010-10-05 Werner Koch <wk at g10code.com>
* watchgnupg.c (main): Support TCP and local socket listening.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/NEWS 2010-10-06 11:29:10 UTC (rev 5439)
@@ -26,8 +26,8 @@
* If the agent's --use-standard-socket option is active, all tools
try to start and daemonize the agent on the fly. In the past this
was only supported on W32; on non-W32 systems the new configure
- option --enable-standard-socket may now be used to use this feature
- by default.
+ option --disable-standard-socket may now be used to disable this
+ new default.
* Dirmngr is now a part of this package. Dirmngr is now also
expected to run as a system service and the configuration
Modified: trunk/agent/cvt-openpgp.c
===================================================================
--- trunk/agent/cvt-openpgp.c 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/agent/cvt-openpgp.c 2010-10-06 11:29:10 UTC (rev 5439)
@@ -126,6 +126,7 @@
"(private-key(rsa(n%m)(e%m)(d%m)(p%m)(q%m)(u%m)))",
skey[0], skey[1], skey[2], skey[3], skey[4],
skey[5]);
+ break;
default:
err = gpg_error (GPG_ERR_PUBKEY_ALGO);
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/configure.ac 2010-10-06 11:29:10 UTC (rev 5439)
@@ -79,7 +79,7 @@
use_exec=yes
disable_keyserver_path=no
use_ccid_driver=yes
-use_standard_socket=no
+use_standard_socket=yes
try_ks_ldap=no
@@ -657,8 +657,8 @@
#
AC_MSG_CHECKING([whether to use a standard socket by default])
AC_ARG_ENABLE(standard-socket,
- AC_HELP_STRING([--enable-standard-socket],
- [use a standard socket for the agent by default]),
+ AC_HELP_STRING([--disable-standard-socket],
+ [don't use a standard socket by default]),
use_standard_socket=$enableval)
tmp=""
if test "$use_standard_socket" != yes; then
Modified: trunk/doc/gpg-agent.texi
===================================================================
--- trunk/doc/gpg-agent.texi 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/doc/gpg-agent.texi 2010-10-06 11:29:10 UTC (rev 5439)
@@ -2,6 +2,11 @@
@c This is part of the GnuPG manual.
@c For copying conditions, see the file gnupg.texi.
+ at c Note that we use this texinfo file for all versions of GnuPG:
+ at c 2.0 and 2.1. The macro "gpgtwoone" controls parts which are only
+ at c valid for GnuPG 2.1 and later.
+
+
@node Invoking GPG-AGENT
@chapter Invoking GPG-AGENT
@cindex GPG-AGENT command options
@@ -438,8 +443,16 @@
environment variable @var{GPG_AGENT_INFO} and then fall back to this
socket. This option may not be used if the home directory is mounted on
a remote file system which does not support special files like fifos or
-sockets. Note, that @option{--use-standard-socket} is the default on
-Windows systems. The default may be changed at build time. It is
+sockets.
+ at ifset gpgtwoone
+Note, that @option{--use-standard-socket} is the default on all
+systems since GnuPG 2.1.
+ at end ifset
+ at ifclear gpgtwoone
+Note, that @option{--use-standard-socket} is the default on
+Windows systems.
+ at end ifclear
+The default may be changed at build time. It is
possible to test at runtime whether the agent has been configured for
use with the standard socket by issuing the command @command{gpg-agent
--use-standard-socket-p} which returns success if the standard socket
Modified: trunk/g10/import.c
===================================================================
--- trunk/g10/import.c 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/g10/import.c 2010-10-06 11:29:10 UTC (rev 5439)
@@ -1122,8 +1122,7 @@
if (!err)
err = gcry_cipher_setkey (cipherhd, kek, keklen);
if (err)
- goto leave;
- xfree (kek);
+ goto leave; xfree (kek);
kek = NULL;
main_pk = NULL;
@@ -1143,6 +1142,11 @@
stats->count++;
stats->secret_read++;
+ /* For now we ignore the stub keys becuase we don't have real
+ support for them in gpg-agent. */
+ if (ski->s2k.mode == 1001 || ski->s2k.mode == 1002)
+ continue;
+
/* Convert our internal secret key object into an S-expression. */
nskey = pubkey_get_nskey (pk->pubkey_algo);
if (!nskey || nskey > PUBKEY_MAX_NSKEY)
@@ -1156,7 +1160,9 @@
put_membuf_str (&mbuf, "(skey");
for (i=j=0; i < nskey; i++)
{
- if (gcry_mpi_get_flag (pk->pkey[i], GCRYMPI_FLAG_OPAQUE))
+ if (!pk->pkey[i])
+ ; /* Protected keys only have NPKEY+1 elements. */
+ else if (gcry_mpi_get_flag (pk->pkey[i], GCRYMPI_FLAG_OPAQUE))
{
put_membuf_str (&mbuf, " e %b");
format_args_buf_ptr[i] = gcry_mpi_get_opaque (pk->pkey[i], &n);
@@ -1189,7 +1195,10 @@
if (ski->is_protected)
{
char countbuf[35];
-
+
+ /* Note that the IVLEN may be zero if we are working on a
+ dummy key. We can't express that in an S-expression and
+ thus we send dummy data for the IV. */
snprintf (countbuf, sizeof countbuf, "%lu",
(unsigned long)ski->s2k.count);
err = gcry_sexp_build
@@ -1197,7 +1206,8 @@
" (protection %s %s %b %d %s %b %s)\n",
ski->sha1chk? "sha1":"sum",
openpgp_cipher_algo_name (ski->algo),
- (int)ski->ivlen, ski->iv,
+ ski->ivlen? (int)ski->ivlen:1,
+ ski->ivlen? ski->iv: (const unsigned char*)"X",
ski->s2k.mode,
openpgp_md_algo_name (ski->s2k.hash_algo),
(int)sizeof (ski->s2k.salt), ski->s2k.salt,
Modified: trunk/tools/watchgnupg.c
===================================================================
--- trunk/tools/watchgnupg.c 2010-10-05 19:05:43 UTC (rev 5438)
+++ trunk/tools/watchgnupg.c 2010-10-06 11:29:10 UTC (rev 5439)
@@ -52,8 +52,8 @@
static int verbose;
+static int time_only;
-
static void
die (const char *format, ...)
{
@@ -136,10 +136,15 @@
time_t atime = time (NULL);
tp = localtime (&atime);
- printf ("%3d - %04d-%02d-%02d %02d:%02d:%02d ",
- fd,
- 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
- tp->tm_hour, tp->tm_min, tp->tm_sec );
+ if (time_only)
+ printf ("%3d - %02d:%02d:%02d ",
+ fd,
+ tp->tm_hour, tp->tm_min, tp->tm_sec );
+ else
+ printf ("%3d - %04d-%02d-%02d %02d:%02d:%02d ",
+ fd,
+ 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday,
+ tp->tm_hour, tp->tm_min, tp->tm_sec );
}
@@ -262,6 +267,7 @@
" --tcp listen on a TCP port and optionally on a local socket\n"
" --force delete an already existing socket file\n"
" --verbose enable extra informational output\n"
+ " --time-only print only the time; not a full timestamp\n"
" --version print version of the program and exit\n"
" --help display this help and exit\n"
BUGREPORT_LINE, stdout );
@@ -306,6 +312,11 @@
verbose = 1;
argc--; argv++;
}
+ else if (!strcmp (*argv, "--time-only"))
+ {
+ time_only = 1;
+ argc--; argv++;
+ }
else if (!strcmp (*argv, "--force"))
{
force = 1;
More information about the Gnupg-commits
mailing list