1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-09 12:54:23 +01:00

Provide default strings for pinentry.

This commit is contained in:
Werner Koch 2010-02-17 19:00:04 +00:00
parent 0d9e56b13e
commit 3f99c91a42
4 changed files with 533 additions and 483 deletions

View File

@ -1,3 +1,8 @@
2010-02-17 Werner Koch <wk@g10code.com>
* call-pinentry.c (start_pinentry): Always free OPTSTR. Send
default-xxx strings.
2010-02-11 Marcus Brinkmann <marcus@g10code.de> 2010-02-11 Marcus Brinkmann <marcus@g10code.de>
From trunk 2009-09-23, 2009-11-02, 2009-11-04, 2009-11-05, 2009-11-25, From trunk 2009-09-23, 2009-11-02, 2009-11-04, 2009-11-05, 2009-11-25,

View File

@ -1,5 +1,6 @@
/* call-pinentry.c - fork of the pinentry to query stuff from the user /* call-pinentry.c - Spawn the pinentry to query stuff from the user
* Copyright (C) 2001, 2002, 2004, 2007, 2008 Free Software Foundation, Inc. * Copyright (C) 2001, 2002, 2004, 2007, 2008,
* 2010 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -361,6 +362,7 @@ start_pinentry (ctrl_t ctrl)
return unlock_pinentry (out_of_core ()); return unlock_pinentry (out_of_core ());
rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL, rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL); NULL);
xfree (optstr);
if (rc) if (rc)
return unlock_pinentry (rc); return unlock_pinentry (rc);
} }
@ -371,6 +373,7 @@ start_pinentry (ctrl_t ctrl)
return unlock_pinentry (out_of_core ()); return unlock_pinentry (out_of_core ());
rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL, rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL); NULL);
xfree (optstr);
if (rc) if (rc)
return unlock_pinentry (rc); return unlock_pinentry (rc);
} }
@ -381,10 +384,37 @@ start_pinentry (ctrl_t ctrl)
return unlock_pinentry (out_of_core ()); return unlock_pinentry (out_of_core ());
rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL, rc = assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL); NULL);
xfree (optstr);
if (rc) if (rc)
return unlock_pinentry (rc); return unlock_pinentry (rc);
} }
{
/* Provide a few default strings for use by the pinentries. This
may help a pinentry to avoid implementing localization code. */
static struct { const char *key, *value; } tbl[] = {
/* TRANSLATORS: These are labels for buttons etc used in
Pinentries. A underscore indicates that the next letter
should be used as an accelerator. The actual to be
translated text starts after the second vertical bar. */
{ "ok", N_("|pinentry-label|_OK") },
{ "cancel", N_("|pinentry-label|_Cancel") },
{ NULL, NULL}
};
char *optstr;
int idx;
for (idx=0; tbl[idx].key; idx++)
{
if (asprintf (&optstr, "OPTION default-ok=%s",
tbl[idx].key, _(tbl[idx].value)) < 0 )
return unlock_pinentry (out_of_core ());
assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
NULL);
xfree (optstr);
}
}
/* Tell the pinentry the name of a file it shall touch after having /* Tell the pinentry the name of a file it shall touch after having
messed with the tty. This is optional and only supported by messed with the tty. This is optional and only supported by
@ -923,7 +953,7 @@ agent_get_confirmation (ctrl_t ctrl,
if (notok) if (notok)
{ {
/* Try to use the newer NOTOK feature if a cancel button is /* Try to use the newer NOTOK feature if a cancel button is
requested. If no cacnel button is requested we keep on using requested. If no cancel button is requested we keep on using
the standard cancel. */ the standard cancel. */
if (with_cancel) if (with_cancel)
{ {

View File

@ -9,6 +9,7 @@ agent/preset-passphrase.c
agent/protect-tool.c agent/protect-tool.c
agent/trustlist.c agent/trustlist.c
agent/findkey.c agent/findkey.c
agent/call-pinentry.c
common/exechelp.c common/exechelp.c
common/http.c common/http.c

972
po/de.po

File diff suppressed because it is too large Load Diff