Page MenuHome GnuPG
Feed Advanced Search

Dec 17 2012

werner added a comment to T1446: hkps SRV lookup discards port from SRV.

Do we need to do something for 1.4?

Dec 17 2012, 10:51 PM · Bug Report, gnupg

Dec 15 2012

dshaw added a comment to T1446: hkps SRV lookup discards port from SRV.

Finishing things up now.

Dec 15 2012, 4:00 PM · Bug Report, gnupg
dshaw added a comment to T1447: TLS hostname selection uses insecure SRV data.

Note that this implies setting Host: properly as well

Dec 15 2012, 3:59 PM · Bug Report, gnupg
werner added a comment to T1446: hkps SRV lookup discards port from SRV.

David, what is the status?

Dec 15 2012, 10:01 AM · Bug Report, gnupg
werner set Due Date to Dec 17 2012, 1:00 AM on T1455: pubring.gpg corruption on invalid public key.
Dec 15 2012, 9:57 AM · Bug Report, gnupg

Dec 10 2012

bernhard set Version to 2.0.19 on T1457: Decryption of msg encrypted to expired smime certificate fails if local-user is set.
Dec 10 2012, 9:27 PM · Bug Report, gnupg, S/MIME
bernhard added projects to T1457: Decryption of msg encrypted to expired smime certificate fails if local-user is set: S/MIME, gnupg, Bug Report.
Dec 10 2012, 9:27 PM · Bug Report, gnupg, S/MIME

Dec 6 2012

kbs added projects to T1455: pubring.gpg corruption on invalid public key: gnupg, Bug Report.
Dec 6 2012, 7:07 PM · Bug Report, gnupg
kbs added a comment to T1455: pubring.gpg corruption on invalid public key.

Dec 6 2012, 7:07 PM · Bug Report, gnupg

Dec 3 2012

werner added a comment to T1447: TLS hostname selection uses insecure SRV data.

Note that the topic is currently under discussion on gnupg-devel.

Dec 3 2012, 2:01 PM · Bug Report, gnupg

Dec 2 2012

dshaw added a comment to T1446: hkps SRV lookup discards port from SRV.

Taking

Dec 2 2012, 4:17 PM · Bug Report, gnupg
dshaw added a project to T1446: hkps SRV lookup discards port from SRV: In Progress.
Dec 2 2012, 4:17 PM · Bug Report, gnupg
dshaw claimed T1446: hkps SRV lookup discards port from SRV.
Dec 2 2012, 4:17 PM · Bug Report, gnupg

Nov 21 2012

werner closed T1290: gnupg 2.0.16 fails with Gemalto USB Shell Token V2 as Resolved.
Nov 21 2012, 10:21 AM · Bug Report, gnupg
werner added a comment to T1290: gnupg 2.0.16 fails with Gemalto USB Shell Token V2.

That was fixed by
2010-11-11 Werner Koch <wk@g10code.com>

  • agent.h (opt): Add field SIGUSR2_ENABLED.
  • gpg-agent.c (handle_connections): Set that flag.
  • call-scd.c (start_scd): Enable events depending on this flag.

and thus 2.0.19 should work fine.

Thanks to gniibe for mentioning this.

Nov 21 2012, 10:21 AM · Bug Report, gnupg

Nov 8 2012

werner set Due Date to Nov 30 2012, 1:00 AM on T1396: Subkey expiring breaks other subkeys.
Nov 8 2012, 5:26 PM · Too Old, Bug Report, gnupg
werner added a comment to T1390: gnupg testsuite: failed test "armor" (bug#1179 is back in town).

Fixed for 1.4.13 (95347cf9).

Nov 8 2012, 5:21 PM · Bug Report, gnupg
werner closed T1390: gnupg testsuite: failed test "armor" (bug#1179 is back in town) as Resolved.
Nov 8 2012, 5:21 PM · Bug Report, gnupg
werner closed T1339: deleted keys reappearing as Resolved.
Nov 8 2012, 4:37 PM · Bug Report, Not A Bug, gnupg
werner added a project to T1289: OpenPGP card no longer accessible: Not A Bug.
Nov 8 2012, 4:36 PM · Not A Bug, Bug Report, gnupg
werner closed T1289: OpenPGP card no longer accessible as Resolved.
Nov 8 2012, 4:36 PM · Not A Bug, Bug Report, gnupg
werner added a comment to T1276: Typos in German translation.

Fixed for 1.4.13 (e3e5406)

Nov 8 2012, 4:35 PM · Documentation, gnupg (gpg14), Debian, Bug Report, gnupg
werner closed T1276: Typos in German translation as Resolved.
Nov 8 2012, 4:35 PM · Documentation, gnupg (gpg14), Debian, Bug Report, gnupg
werner added a comment to T1249: renaming '...\pubring.tmp' to '...\pubring.gpg failed: Permission denied during key creation.

Do you still have this problem with 1.4.12?

Nov 8 2012, 4:24 PM · Bug Report, gnupg
werner added a comment to T1230: card backup key generated with 1024 bit.

Fix for 1.4.13 (commit 64e7c23).

Nov 8 2012, 4:16 PM · Bug Report, gnupg, OpenPGP
werner closed T1230: card backup key generated with 1024 bit as Resolved.
Nov 8 2012, 4:16 PM · Bug Report, gnupg, OpenPGP
werner closed T1435: duplicate syms in libmpi as Resolved.
Nov 8 2012, 3:48 PM · clang, gnupg, Bug Report
werner removed a project from T1435: duplicate syms in libmpi: Won't Fix.
Nov 8 2012, 3:47 PM · clang, gnupg, Bug Report
werner added a comment to T1435: duplicate syms in libmpi.

Fixed in git for gnupg 1.4.13, Libgcrypt 1.5.1 and Libgcrypt 1.6.0.

The reason why I was not able to replicate this bug was that
I didn't use -std=c99 with gcc >= 4.3.

Nov 8 2012, 3:47 PM · clang, gnupg, Bug Report
werner changed Version from 1.4.10 to all on T1347: More informative error message for unusable keys.
Nov 8 2012, 2:46 PM · gnupg, Feature Request
werner added a comment to T1347: More informative error message for unusable keys.

We won't do this for 1.4.

Nov 8 2012, 2:46 PM · gnupg, Feature Request
werner removed a project from T1347: More informative error message for unusable keys: gnupg (gpg14).
Nov 8 2012, 2:46 PM · gnupg, Feature Request
werner added a comment to T1173: gpg has no easy way to view the reason and description of revocation sigs.

I would say this should go into 2.1.

Nov 8 2012, 2:44 PM · gnupg, Debian, Feature Request
werner closed T1238: scdaemon often needs restarting after removing OpenPGP smartcard as Resolved.
Nov 8 2012, 2:38 PM · backport, gnupg, Bug Report, scd
werner removed a project from T1238: scdaemon often needs restarting after removing OpenPGP smartcard: In Progress.
Nov 8 2012, 2:38 PM · backport, gnupg, Bug Report, scd
werner added a comment to T1238: scdaemon often needs restarting after removing OpenPGP smartcard.

Meanwhile gniibe fixed a lot more bugs and also ported them back to 2.0. Thus I
close this bug.

Nov 8 2012, 2:38 PM · backport, gnupg, Bug Report, scd
werner closed T1407: Segmentation fault as Resolved.
Nov 8 2012, 2:34 PM · Info Needed, Bug Report, gnupg
werner added a project to T1407: Segmentation fault: Info Needed.
Nov 8 2012, 2:34 PM · Info Needed, Bug Report, gnupg

Nov 7 2012

werner removed a project from T1377: gpg-agent ignores default-cache-ttl-ssh: Bug Report.
Nov 7 2012, 3:26 PM · Not A Bug, Debian, gnupg, gpgagent
werner closed T1377: gpg-agent ignores default-cache-ttl-ssh as Invalid.
Nov 7 2012, 3:26 PM · Not A Bug, Debian, gnupg, gpgagent
werner added a project to T1377: gpg-agent ignores default-cache-ttl-ssh: Not A Bug.
Nov 7 2012, 3:25 PM · Not A Bug, Debian, gnupg, gpgagent
werner added a comment to T1377: gpg-agent ignores default-cache-ttl-ssh.

This is not a bug. The description of --max-cache-ttl reads:

  Set the maximum time a cache entry is valid to @var{n} seconds.  After
  this time a cache entry will be expired even if it has been accessed
  recently.  The default is 2 hours (7200 seconds).

Thus even if you set the cache-ttl-ssh > max-cache-ttl, it will expire after
max-cache-ttl seconds.

Nov 7 2012, 3:25 PM · Not A Bug, Debian, gnupg, gpgagent

Nov 6 2012

werner set External Link to http://bugs.debian.org/606759 on T1377: gpg-agent ignores default-cache-ttl-ssh.
Nov 6 2012, 11:31 PM · Not A Bug, Debian, gnupg, gpgagent

Oct 20 2012

syscomet added a comment to T1446: hkps SRV lookup discards port from SRV.

The behaviour matches that observed in released versions; I was debugging a
problem observed in the released versions, not reviewing code looking for issues.

Whether or not it's used in the current development branch, this has caused an
interoperability issue in the real world for the keyserver operators, causing a
functionality deployment to be rolled back and resulting in filtered results,
reducing the pool of available keyservers.

Since Issue1447 is a security impacting issue which will need a CVE and a security
release to fix anyway, it would really be nice to try to get the fix for client
behaviour into a version which is likely to be pushed out widely. Not critical,
security comes first, but if we can leverage the security release to improve
interop, that would be helpful.

In practice, we (the keyserver operators and pool operators) are stuck not able to
use SRV to point to non-default ports for at least a couple of years. This is
very unfortunate, given the efforts currently being made to make deployments more
robust, with TLS more widely deployed.

Oct 20 2012, 8:08 AM · Bug Report, gnupg

Oct 19 2012

ralf added a comment to T1448: gpgconf lists options which break gpg1 when gpg2 is also installed.

So you are saying, every distribution supporting a co-installation should patch
GPG to fix this?
The user might not even know what gpg is, that several major versions exist, or
which options are available where. He just sees email encryption not working any
longer. In most cases, he won't have decided to install both versions - he just
has software installed which, indirectly, depends on both.

Oct 19 2012, 2:45 PM · Not A Bug, Bug Report, gnupg
werner added a comment to T1446: hkps SRV lookup discards port from SRV.

Well, it might still exists, but it is not used anymore. Remember that this is
the development branch.

Oct 19 2012, 11:45 AM · Bug Report, gnupg
werner added a comment to T1448: gpgconf lists options which break gpg1 when gpg2 is also installed.

The one who decided to install both versions while at the same time using an
option not available for gpg1. It might be caused by a package manager.

Oct 19 2012, 11:43 AM · Not A Bug, Bug Report, gnupg

Oct 11 2012

ralf added a comment to T1448: gpgconf lists options which break gpg1 when gpg2 is also installed.

Of course it can be fixed by changing the config files. However, the default
behaviour (if I start gpgconf as a new user) is to use the shared config file
for both versions. As I see it, programs are responsible to set up the
configuration in the user's home directory if they need one - at least, that's
common practice in my experience.
If this is not a bug in GnuPG, then whose installation problem is this?

Oct 11 2012, 9:54 PM · Not A Bug, Bug Report, gnupg
syscomet added a comment to T1446: hkps SRV lookup discards port from SRV.

% git remote -v
origin git://git.gnupg.org/gnupg.git (fetch)
origin git://git.gnupg.org/gnupg.git (push)
% git status

On branch master

nothing to commit (working directory clean)
%

I did the pull on the day I filed the bug, and as of the commit stated, the
directory exists. I just did a "git pull", no change. I didn't write "git current"
in this bug.

http://www.gnupg.org/download/cvs_access.en.html still points to the repo above, so
that's what I pulled. If that's no longer correct, I can pull another repo.

But still, if you check out the revision stated, you'll see the behaviour, which is
reflected in current releases of GnuPG.

Oct 11 2012, 8:23 PM · Bug Report, gnupg
werner lowered the priority of T1448: gpgconf lists options which break gpg1 when gpg2 is also installed from High to Normal.
Oct 11 2012, 6:03 PM · Not A Bug, Bug Report, gnupg
werner removed a project from T1448: gpgconf lists options which break gpg1 when gpg2 is also installed: Bug Report.
Oct 11 2012, 6:03 PM · Not A Bug, Bug Report, gnupg
werner closed T1448: gpgconf lists options which break gpg1 when gpg2 is also installed as Invalid.
Oct 11 2012, 6:03 PM · Not A Bug, Bug Report, gnupg
werner added a comment to T1448: gpgconf lists options which break gpg1 when gpg2 is also installed.

Gpgconf uses the configuration file as advertised by gpg.
For example:

  $ gpg2 --gpgconf-list | grep ^gpgconf-gpg.conf:
  gpgconf-gpg.conf:16:"/home/wk/.gnupg/gpg.conf
  $ gpg --gpgconf-list | grep ^gpgconf-gpg.conf:
  gpgconf-gpg.conf:16:"/home/wk/.gnupg/gpg.conf

  $ touch ~/.gnupg/gpg.conf-1

  $ gpg2 --gpgconf-list | grep ^gpgconf-gpg.conf:
  gpgconf-gpg.conf:16:"/home/wk/.gnupg/gpg.conf
  $ gpg --gpgconf-list | grep ^gpgconf-gpg.conf:
  gpgconf-gpg.conf:16:"/home/wk/.gnupg/gpg.conf-1

Thus you only need to create a gpg.conf-1 (or conf-2) and you are
done. This is an installation problem.

Oct 11 2012, 6:03 PM · Not A Bug, Bug Report, gnupg
werner added a comment to T1446: hkps SRV lookup discards port from SRV.

What do you mean by "git current"? The current "git master" has no keyserver/
stuff.

Oct 11 2012, 5:55 PM · Bug Report, gnupg

Oct 9 2012

ralf added projects to T1448: gpgconf lists options which break gpg1 when gpg2 is also installed: gnupg, Bug Report.
Oct 9 2012, 11:40 AM · Not A Bug, Bug Report, gnupg
syscomet added a comment to T1447: TLS hostname selection uses insecure SRV data.

Kristian has removed the SRV records at _pgpkey-https._tcp.hkps.sks-
keyservers.net, so the explanation in step 3 might seem to not match reality, but
that's a change, because of this Issue and Issue1446.

If you set up your own DNS pool for testing, I'm happy to send you a CSR for a new
vhost to help with debugging.

Oct 9 2012, 12:12 AM · Bug Report, gnupg

Oct 8 2012

syscomet added projects to T1447: TLS hostname selection uses insecure SRV data: gnupg, Bug Report.
Oct 8 2012, 11:06 PM · Bug Report, gnupg

Oct 7 2012

syscomet added projects to T1446: hkps SRV lookup discards port from SRV: gnupg, Bug Report.
Oct 7 2012, 4:31 AM · Bug Report, gnupg
syscomet set Version to git current on T1446: hkps SRV lookup discards port from SRV.
Oct 7 2012, 4:31 AM · Bug Report, gnupg

Sep 26 2012

werner added a comment to T1439: Windows: race condition on random_seed.

Yeah sure, I meant "NOT a problem".

Yes I know what you mean. But without locking you will never be able
to get it right.

As you noted there is actually a problem with Libgcrypt under
Windows. In Libgcrypt we lock the seed file and thus the fatal error
is the right thing to do. But.....

  #ifdef __GCC__
  #warning Check whether we can lock on Windows.
  #endif
  #if LOCK_SEED_FILE

Thus we should implement locking for Windows. The problem here is
that there is no portable advisory locking in Windows. And frankly our
fcntl locking approach does not work on all Unices either and worse it
does not work if the home partition is on certain remote file systems.

The only solution I see is to employ the new dotlock code from GnuPG
here. It is slower than fcntl locking but very portable.

I don't think we will fix this in gpg 1.4.

Sep 26 2012, 3:15 PM · libgcrypt, Bug Report
werner added a project to T1443: gpg always leaves files world-readable (security): Not A Bug.
Sep 26 2012, 2:57 PM · Bug Report, Not A Bug, gnupg
werner added a comment to T1443: gpg always leaves files world-readable (security).

Make sure your umask is setup properly. This is standard Unix behaviour and
nothing GPG can do about. Whether you use --output or the usual redirection
shall not make a difference.

In any case we can't change the behaviour of --output created files becuase that
would break all kind of users.

Sep 26 2012, 2:57 PM · Bug Report, Not A Bug, gnupg

Sep 19 2012

mweckbecker_suse.de added projects to T1443: gpg always leaves files world-readable (security): gnupg, Bug Report.
Sep 19 2012, 11:24 AM · Bug Report, Not A Bug, gnupg

Sep 18 2012

jegrp added a comment to T1439: Windows: race condition on random_seed.

This is known but a problem from a security POV.

I suppose you mean "NOT a problem"? I think it might be a problem in
opportunistic encryption scenarios if gpg encryption failures caused by
random_seed access conflicts are ignored like failures caused by missing keys.
But usually it's just a nuisance like any other randomly failing program.

The non-locking read is on purpose - if it works: okay. Otherwise we
re-generate a seed file.

I see that the code tries to tolerate access conflicts, but there's still a race
condition if the random_seed file is truncated between fstat() and read(). The
read() error handling is incomplete. Maybe this pseudo-patch explains best what
I mean:

diff -ru gnupg-1.4.12/cipher/random.c gnupg-1.4.12/cipher/random.c

  • gnupg-1.4.12/cipher/random.c 2012-01-24 09:45:41.000000000 +0100

+++ gnupg-1.4.12/cipher/random.c 2012-09-18 19:47:54.449578800 +0200
@@ -492,11 +492,17 @@

    do {
	n = read( fd, buffer, POOLSIZE );
    } while( n == -1 && errno == EINTR );
  • if( n != POOLSIZE ) {

+ if( n == -1 ) {

	log_fatal(_("can't read `%s': %s\n"), seed_file_name,strerror(errno) );
	close(fd);
	return 0;
    }

+ else if ( n == 0 ) {
+ ... handle like sb.st_size == 0
+ }
+ else if ( n != POOLSIZE ) {
+ ...
handle like sb.st_size != POOLSIZ
+ }

     close(fd);

Yes, we could do the file locking

Proper locking would be the ideal solution, but a better read() error handling
would already be sufficient to avoid the sporadic fatal errors on random_seed
accesses.

and iirc, we do this in libgcrypt (GnuPG-2).

I'm just checking this and ... sorry, no. The gpg2.exe from Gpg4win 2.1.0 shows
the very same error:

note: random_seed file is empty
note: random_seed file is empty
Fatal: can't read `C:/Dokumente und
Einstellungen/jechternach/Anwendungsdaten/GnuPG /random_seed': No such file or
directory

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
note: random_seed file is empty

Sep 18 2012, 7:52 PM · libgcrypt, Bug Report
mm added projects to T1442: tar and tar-args in gpg-zip not working correctly: gnupg, Bug Report.
Sep 18 2012, 6:18 PM · Bug Report, gnupg

Sep 17 2012

werner added a comment to T1439: Windows: race condition on random_seed.

This is known but a problem from a security POV. The seed file is a cache. If
the seed file can't be read a new one is created. Right, there might be a
performance issue but at least on Windows this is not as severe as on certain
Linux systems.

The non-locking read is on purpose - if it works: okay. Otherwise we
re-generate a seed file. Yes, we could do the file locking and iirc, we do this
in libgcrypt (GnuPG-2).

The error on short reads is also on purpose. We want those 600 bytes at once
and nothing else. If another process is writing the seed file we may see the
short reads. But in this case there is no clear answer waht to do - thus we
assume the "no seed file" case.

Sep 17 2012, 2:59 PM · libgcrypt, Bug Report
werner lowered the priority of T1439: Windows: race condition on random_seed from High to Normal.
Sep 17 2012, 2:59 PM · libgcrypt, Bug Report
werner added a project to T1439: Windows: race condition on random_seed: gnupg.
Sep 17 2012, 2:59 PM · libgcrypt, Bug Report

Aug 17 2012

gatuno added a comment to T1241: gnupg: need an option to automatically refuse signing photo-ids.

May I ask for the status of this bug?

Aug 17 2012, 9:10 PM · gnupg, Debian, Feature Request
gatuno added a comment to T807: encrypt-to-self option.

Is this going to be implemented in the gnupg 2.x series?

Aug 17 2012, 9:08 PM · gnupg, Feature Request
gatuno added a comment to T1098: Better ordering of "help" output in --edit-key mode.

May I ask what happen with this bug?

Just trying to keep track of these bugs in Debian Bug Tracking System.

Aug 17 2012, 9:06 PM · Documentation, gnupg, Debian, Feature Request

Aug 14 2012

werner added a project to T1392: export-secret-key does not work with EC keys: gnupg.
Aug 14 2012, 8:39 PM · gnupg, Bug Report
werner added a project to T1436: no-show-unusable-subkeys does not exclude revoked subkeys: gnupg.
Aug 14 2012, 8:38 PM · gnupg, Bug Report
werner removed a project from T1326: Compressed data packets with uncompressed data (algo=0): Restricted Project.
Aug 14 2012, 8:37 PM · Bug Report, gnupg
werner closed T1326: Compressed data packets with uncompressed data (algo=0) as Resolved.
Aug 14 2012, 8:37 PM · Bug Report, gnupg
werner added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

So you want to open /dev/tty (which gpg does anyway if needed; see
common/ttyio.c) and pass that to the agent so that the agent may pass
it on to Pinentry if he needs it. That may work.

However, I don't like it because you claim a resource of the tty and
send it to a different process to be used only if needed. With our
current system we use this resource only if we really needs it.

Although libassuan implements descriptor passing, it can't be used
with Pinentry, because that one uses a simple pipe and not a socket.
Yes, we could change that too, but then you can't use a shell script
instead of Pinentry anymore.

Aug 14 2012, 5:54 PM · Bug Report, gnupg

Aug 10 2012

tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Even in that case:

foo | gpg 2>gpg.log | bar

if the main gpg process opens "/dev/tty", then it will still get the user's
terminal. /dev/tty is strong magic -- it will work even if fds 0, 1, and 2 are
pointing elsewhere.

And if it then passes that file descriptor to an agent (I assume you're aware of
the ability to pass open file descriptors across unix-domain sockets, so that the
target process actually receives a copy of the same file descriptor) then the agent
will have the user's terminal also.

I reiterate my offer to help implement something like this, if you can point me to
the right place in the code (i.e. where *exactly* are these requests to the agent
that require user interaction happening? Where would be the best place to put file-
descriptor passing code?)

Aug 10 2012, 7:19 PM · Bug Report, gnupg
werner added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Your solution will not work either. It still depends that a standard fd is
connected to the tty. This is not the case

  foo | gpg 2>gpg.log | bar

is a common pattern. I don't see why you have such a problem to set a variable
for each new terminal. If you don't like GPG_TTY, you may contact the Open
Group to define a new standard variable to POSIX. FWIW, GPG_TTY is used for
more than a decade.

Aug 10 2012, 7:10 PM · Bug Report, gnupg

Aug 9 2012

tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

OK, here's what I hear you saying: Even if my patch would do the right thing in the common case
for 2.0.19, when 2.1 comes along it will stop helping.

I agree with you that *if you are using a long-lived agent*, then the patch I had proposed is not
sufficient. I had been discounting that case as "not the common case"; now I realize it is going
to be the common case soon.

I think, at this point, we're going to have to consider using file descriptor passing (SCM_RIGHTS)
from the gpg to the agent.

It *will* be the case that, even if someone has redirected stdin/stdout in the gpg process, that
the gpg process will be able to open its "/dev/tty" and get a useful file descriptor. I agree with
you that it can't (at least not portably) work backwards from that to find the *name* of its tty,
but it can at least open /dev/tty, itself.

If gpg then passes that open file descriptor across the unix-domain socket to the agent (at least
I assume unix-domain sockets are used for gpg/agent communication), then the agent will have a
copy of *that* file descriptor.

Can you point me to where the agent receives the set of data that makes up one "request" or "work
unit"? I can try to make a new patch that uses file-descriptor passing.

To reiterate: making the user *in the common case* set an environment variable is not acceptable.
Environment variables are a nice thing to be able to set to change behavior from the default; but
if the user is happy with the default behavior they should not have to set any environment
variables in order to use a piece of software. If I had to have one environment variable setting
for every program I used regularly, my .cshrc would be *huge*!

Thanks!

Aug 9 2012, 4:50 PM · Bug Report, gnupg
werner added a comment to T1435: duplicate syms in libmpi.

See my comments for T1406. It is clearly a clang bug.

Aug 9 2012, 3:55 PM · clang, gnupg, Bug Report
werner added projects to T1435: duplicate syms in libmpi: Won't Fix, clang.
Aug 9 2012, 3:55 PM · clang, gnupg, Bug Report
werner added a project to T1435: duplicate syms in libmpi: gnupg.
Aug 9 2012, 3:29 PM · clang, gnupg, Bug Report
werner added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Without having a controlling tty you can't get the name of the
controlling tty. That is why we need other ways to tell the
background process (i.e. gpg-agent) which tty a pinentry shall use.

It doesn't matter who calls the agent; if he has a tty in some
settings, that is not a fact we can rely upon. For example in 2.1
there will be no on-demand starting and stopping anymore; instead the
agent is started just once (you can even compile 2.0.19 with this
behaviour).

Your options are:

  • Set GPG_TTY for each new TTY.
  • Pass --ttyname=$(tty) on the GPG commandline.
  • Start the agent in advance and use --keep-tty --tyyname=$(tty) to lock the Pinentry to the tty the agent has been started.

BTW, it is common practice to dup fd 0 to /dev/null. Thus it does not
help to use ttyname (0) instead of ttyname (1) as the default.

Aug 9 2012, 3:08 PM · Bug Report, gnupg
werner closed T1429: Man page typo as Resolved.
Aug 9 2012, 2:49 PM · Bug Report, gnupg
werner added a comment to T1429: Man page typo.

Fixed in master (4ea37fe4). We use the docs for master for releases of all
branches - thus this fix will be applied to the next 2.0 and 1.4 release as well.

Thanks.

Aug 9 2012, 2:49 PM · Bug Report, gnupg

Aug 1 2012

tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

To restate: If you are starting the agent on demand, AND if you are feeding gpg
data on standard input, then initscr() will NOT do the right thing. At least on
FreeBSD. Are you saying that on your OS, initscr() will, internally to itself,
open "/dev/tty"?

If that's the case for you, then it's not the case for me on FreeBSD. The
initscr() on FreeBSD doesn't do any magic, it just uses fds 0 and 1. Hence the
fact that I am trying to get it to open /dev/tty in that case.

Aug 1 2012, 4:53 PM · Bug Report, gnupg
tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Yes, I saw the if (tty_name) in pinentry when I was looking through all of that
stuff. The problem for me is NOT that pinentry has no controlling terminal,
because I *am* starting the agent, as you say, on demand.

The problem for me is that pinentry has inherited file descriptor 0 from gpg,
and it is *not* a tty, it is the input file that I am asking gpg to process.

So no, the if (tty_name) thing doesn't really work too well if you are feeding
gpg something on its standard input, AND if you are starting gpg-agent on
demand.

Aug 1 2012, 4:47 PM · Bug Report, gnupg
werner added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

It does not work on glibc based systems either. Actually the correct
way would be to use ctermid(3) but that has the same problem as
ttyname - it even returns a fixed string without trying to find the
tty in /dev/ or /proc.

Pinentry actually defaults to the default tty if no GPG_TTY has been
passed to it from gpg-agent. Here is the code from the curses
pinentry:

/* Open the desired terminal if necessary.  */
if (tty_name)
  {
    ttyfi = fopen (tty_name, "r");
    if (!ttyfi)

return -1;

ttyfo = fopen (tty_name, "w");
if (!ttyfo)

{

	  int err = errno;
	  fclose (ttyfi);
	  errno = err;
	  return -1;

}

    screen = newterm (tty_type, ttyfo, ttyfi);
    set_term (screen);
  }
else
  {
    if (!init_screen)

{

	  init_screen = 1;
	  initscr ();

}

else

clear ();

    }

TTY_NAME has been set via an Assuan option which should have come from
GPG_TTY. If this has not been set (or any of the --ttyname options
used), Pinentry uses init_scr. The problem is that gpg-agent and thus
pinentry usually has no controlling terminal and thus there is no default tty.

It works for you because you started gpg-agent on demand. That is
something to be avoid because it won't be able to cache the
passphrase then.

I have not checked whether your patch may harm. However, I remember
that we had quite some problems calling pinentry from a background
process and the way we do it today works in almost all cases -
assuming your system has been properly configured.

Aug 1 2012, 9:15 AM · Bug Report, gnupg
tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Ugh. That trick doesn't work on Solaris, it looks like.

The basic place I'm trying to get to is... in the simple case... a user logs in,
and isn't using gpg-agent, gpgme, or anything like that... and just types:

some_command | gpg -a --clearsign > some_file

that it will work.

It seems *to me at least*, like defaulting to the literal filename "/dev/tty",
as in my patch, at least *does no harm*.

Maybe it doesn't solve the gpg-agent case or the gpgme case 100%. But at least
it makes the simple case work. And people can always override it by setting
GPG_TTY, if they need to.

Make sense?

Aug 1 2012, 8:01 AM · Bug Report, gnupg
tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

If I come up with a modified patch that opens /dev/tty, calls ttyname on *that*,
and gives *that* tty name to pinentry, will you consider it?

Thanks!!

(btw, I don't use the agent at all... my usage of gpg is very vanilla, just the
plain way of using it on the command line that has worked ever since gpg1, but
is now broken in gpg2)

Aug 1 2012, 7:43 AM · Bug Report, gnupg
tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Looks like calling ttyname() on a freshly open()ed "/dev/tty" works, at least on
FreeBSD:

cat ttyname.c

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc, char **argv)
{
int fd = open("/dev/tty", O_RDWR, 0);
char *s = ttyname(fd);
printf("%s\n", s ? s : "NULL");
return 0;
}

gcc -o ttyname ttyname.c
./ttyname

/dev/pts/9

./ttyname < /dev/null >& /tmp/foo
cat /tmp/foo

/dev/pts/9

Notice that even though the program's stdin was /dev/null, and the program's
stdout and stderr were both going to a file (I use tcsh, hence the >& syntax),
and yet it still managed to figure out what the terminal was.

Aug 1 2012, 7:41 AM · Bug Report, gnupg
werner added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Consider the case of GPGME. All standard descriptors are not connected to a tty.
I don't know a way to get the actual terminal name in a portable way. Thus we
need to rely on the shell to give use the name of the tty and pass it via an envvar.

In your case you may want to use gpg-agent’s --keep-tty option.

Aug 1 2012, 7:32 AM · Bug Report, gnupg
werner added a comment to T1420: gpg --edit-key silently does nothing.

Yes, we can do this for 2.1. In case there is an already translated string
available we can backport this also to 1.4 and 2.0.

Aug 1 2012, 7:27 AM · Bug Report, gnupg
werner added a comment to T1426: the way gpg updates the pubring files makes it impossible to symlink it.

So now, what shall we do proper file locking and make sure that the user has
permissions to both files? It will be quite some code to get this all done right.

Aug 1 2012, 7:25 AM · Won't Fix, gnupg, Feature Request
tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Another thought would be that ttyname(2) is possibly somewhat more likely to
give a useful result than either ttyname(0) or ttyname(1). That is, assuming
that people redirect stdin and stdout all the time, but rarely redirect stderr.

I'm just tossing out ideas here. My gut reaction is still "just use /dev/tty",
but I'm hoping that if I toss out some ideas that maybe one of them will be
helpful. :-)

Aug 1 2012, 7:20 AM · Bug Report, gnupg
tamino added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

Hmmmm.

Would it work to open /dev/tty, and then call ttyname on *that*? Rather than
calling ttyname on stdin always?

I really dislike the solution of "the user must set $GPG_TTY". That is broken,
period. If I'm not making use of any advanced functionality like the agent,
please don't penalize me (as a user) for the fact that such advanced
functionality *exists*.

I want the simple case -- i.e. I'm logged in, and I run gpg on a single tty --
to Just Work, without me having to set any environment variables to make it
work.

Aug 1 2012, 7:15 AM · Bug Report, gnupg
werner added a comment to T1433: gnupg adds extra hyphen when signing plaintext (changing original message!).

That is not a bug but required by the specs. Leading dashed are required to be
escaped by "- "; see RFC 4880. Use "--output FILE" to get the cleartext.

Aug 1 2012, 7:10 AM · gnupg
werner removed a project from T1433: gnupg adds extra hyphen when signing plaintext (changing original message!): Bug Report.
Aug 1 2012, 7:10 AM · gnupg
werner closed T1433: gnupg adds extra hyphen when signing plaintext (changing original message!) as Invalid.
Aug 1 2012, 7:10 AM · gnupg
werner added a comment to T1434: GPG_TTY needs to be defaulted in more places than currently.

That does not work.

For example: The GPG process may map /dev/tty to /dev/pts/4. Then it
passes the string "/dev/tty" via gpg-agent to pinentry. Pinentry is
called by gpg-agent but gpg-agent was started on different tty. Thus
for gpg-agent /dev/tty may map to /dev/pts/2. The pinentry will now
pop up at /dev/pts/2 - it is very likely that no terminal is attached
to it and thus you won't even see a pinentry on some other tty.

Agreed, the fallback we currently have does not work either in this
case. Printing a warning if GPG_TTY is not set would probably be the
better alternative.

Aug 1 2012, 7:08 AM · Bug Report, gnupg