* genkey.c (check_passphrase_constraints): Get ngettext call right.
This commit is contained in:
Werner Koch 2007-01-25 09:15:10 +00:00
parent 6cee3e66c2
commit 39fbda4e3c
5 changed files with 41 additions and 35 deletions

View File

@ -1,5 +1,7 @@
2007-01-25 Werner Koch <wk@g10code.com> 2007-01-25 Werner Koch <wk@g10code.com>
* genkey.c (check_passphrase_constraints): Get ngettext call right.
* protect-tool.c (get_passphrase): New arg OPT_CHECK. * protect-tool.c (get_passphrase): New arg OPT_CHECK.
(get_new_passphrase): Enable OTP_CHECK on the first call. (get_new_passphrase): Enable OTP_CHECK on the first call.
* command.c (cmd_get_passphrase): Implement option --check. * command.c (cmd_get_passphrase): Implement option --check.

View File

@ -87,12 +87,12 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw)
if (strlen (pw) < minlen ) /* FIXME: should be an utf-8 length. */ if (strlen (pw) < minlen ) /* FIXME: should be an utf-8 length. */
{ {
char *desc = xtryasprintf char *desc = xtryasprintf
( ngettext (_("Warning: You have entered a passphrase that%%0A" ( ngettext ("Warning: You have entered a passphrase that%%0A"
"is obviously not secure. A passphrase should%%0A" "is obviously not secure. A passphrase should%%0A"
"be at least %u character long."), "be at least %u character long.",
_("Warning: You have entered a passphrase that%%0A" "Warning: You have entered a passphrase that%%0A"
"is obviously not secure. A passphrase should%%0A" "is obviously not secure. A passphrase should%%0A"
"be at least %u characters long."), minlen), minlen ); "be at least %u characters long.", minlen), minlen );
if (!desc) if (!desc)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();

View File

@ -426,17 +426,19 @@ copy_and_escape (char *buffer, const char *text)
/* Ask the gpg-agent for a passphrase and present the user with a /* Ask the gpg-agent for a passphrase and present the user with a
DESCRIPTION, a PROMPT and optiaonlly with a TRYAGAIN extra text. DESCRIPTION, a PROMPT and optionally with a TRYAGAIN extra text.
If a CACHEID is not NULL it is used to locate the passphrase in in If a CACHEID is not NULL it is used to locate the passphrase in in
the cache and store it under this ID. If ERRORCODE is not NULL it the cache and store it under this ID. If OPT_CHECK is true
should point a variable receiving an errorcode; thsi errocode might gpg-agent is asked to apply some checks on the passphrase security.
be 0 if the user canceled the operation. The function returns NULL If ERRORCODE is not NULL it should point a variable receiving an
to indicate an error. */ errorcode; this errocode might be 0 if the user canceled the
operation. The function returns NULL to indicate an error. */
char * char *
simple_pwquery (const char *cacheid, simple_pwquery (const char *cacheid,
const char *tryagain, const char *tryagain,
const char *prompt, const char *prompt,
const char *description, const char *description,
int opt_check,
int *errorcode) int *errorcode)
{ {
int fd = -1; int fd = -1;
@ -463,7 +465,7 @@ simple_pwquery (const char *cacheid,
char *line; char *line;
/* We allocate 3 times the needed space so that there is enough /* We allocate 3 times the needed space so that there is enough
space for escaping. */ space for escaping. */
line = spwq_malloc (15 line = spwq_malloc (15 + 10
+ 3*strlen (cacheid) + 1 + 3*strlen (cacheid) + 1
+ 3*strlen (tryagain) + 1 + 3*strlen (tryagain) + 1
+ 3*strlen (prompt) + 1 + 3*strlen (prompt) + 1
@ -476,6 +478,8 @@ simple_pwquery (const char *cacheid,
} }
strcpy (line, "GET_PASSPHRASE "); strcpy (line, "GET_PASSPHRASE ");
p = line+15; p = line+15;
if (opt_check)
p = stpcpy (p, "--check ");
p = copy_and_escape (p, cacheid); p = copy_and_escape (p, cacheid);
*p++ = ' '; *p++ = ' ';
p = copy_and_escape (p, tryagain); p = copy_and_escape (p, tryagain);

View File

@ -48,14 +48,16 @@
/* Ask the gpg-agent for a passphrase and present the user with a /* Ask the gpg-agent for a passphrase and present the user with a
DESCRIPTION, a PROMPT and optiaonlly with a TRYAGAIN extra text. DESCRIPTION, a PROMPT and optiaonlly with a TRYAGAIN extra text.
If a CACHEID is not NULL it is used to locate the passphrase in in If a CACHEID is not NULL it is used to locate the passphrase in in
the cache and store it under this ID. If ERRORCODE is not NULL it the cache and store it under this ID. If OPT_CHECK is true
should point a variable receiving an errorcode; this errocode might gpg-agent is asked to apply some checks on the passphrase security.
be 0 if the user canceled the operation. The function returns NULL If ERRORCODE is not NULL it should point a variable receiving an
to indicate an error. */ errorcode; this errocode might be 0 if the user canceled the
operation. The function returns NULL to indicate an error. */
char *simple_pwquery (const char *cacheid, char *simple_pwquery (const char *cacheid,
const char *tryagain, const char *tryagain,
const char *prompt, const char *prompt,
const char *description, const char *description,
int opt_check,
int *errorcode); int *errorcode);
/* Ask the gpg-agent to clear the passphrase for the cache ID CACHEID. */ /* Ask the gpg-agent to clear the passphrase for the cache ID CACHEID. */

View File

@ -9,13 +9,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gnupg-1.9.90\n" "Project-Id-Version: gnupg-1.9.90\n"
"Report-Msgid-Bugs-To: translations@gnupg.org\n" "Report-Msgid-Bugs-To: translations@gnupg.org\n"
"POT-Creation-Date: 2007-01-24 19:08+0100\n" "POT-Creation-Date: 2007-01-25 09:30+0100\n"
"PO-Revision-Date: 2007-01-24 19:16+0100\n" "PO-Revision-Date: 2007-01-25 09:33+0100\n"
"Last-Translator: Walter Koch <koch@u32.de>\n" "Last-Translator: Walter Koch <koch@u32.de>\n"
"Language-Team: German <de@li.org>\n" "Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
#: agent/call-pinentry.c:193 #: agent/call-pinentry.c:193
#, c-format #, c-format
@ -166,14 +167,11 @@ msgstr "Bitte geben Sie die PIN%s%s%s ein um die Karte zu entsperren"
msgid "" msgid ""
"Warning: You have entered a passphrase that%%0Ais obviously not secure. A " "Warning: You have entered a passphrase that%%0Ais obviously not secure. A "
"passphrase should%%0Abe at least %u character long." "passphrase should%%0Abe at least %u character long."
msgstr "WARNUNG: Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben. Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein." msgid_plural ""
#: agent/genkey.c:93
#, c-format
msgid ""
"Warning: You have entered a passphrase that%%0Ais obviously not secure. A " "Warning: You have entered a passphrase that%%0Ais obviously not secure. A "
"passphrase should%%0Abe at least %u characters long." "passphrase should%%0Abe at least %u characters long."
msgstr "WARNUNG: Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben. Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein." msgstr[0] "WARNUNG: Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben. Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein."
msgstr[1] "WARNUNG: Sie haben eine offensichtlich unsichere%%0APassphrase eingegeben. Eine Passphrase sollte%%0A mindestens %u Zeichen lang sein."
#: agent/genkey.c:100 #: agent/genkey.c:100
msgid "Take this one anyway" msgid "Take this one anyway"
@ -188,11 +186,11 @@ msgstr "Neue Passphrase eingeben"
msgid "Please enter the passphrase to%0Ato protect your new key" msgid "Please enter the passphrase to%0Ato protect your new key"
msgstr "Bitte geben Sie die Passphrase ein%0Aum Ihren Schlüssel zu schützen" msgstr "Bitte geben Sie die Passphrase ein%0Aum Ihren Schlüssel zu schützen"
#: agent/genkey.c:148 agent/genkey.c:266 agent/protect-tool.c:1215 #: agent/genkey.c:148 agent/genkey.c:266 agent/protect-tool.c:1216
msgid "Please re-enter this passphrase" msgid "Please re-enter this passphrase"
msgstr "Bitte geben Sie die Passphrase noch einmal ein:" msgstr "Bitte geben Sie die Passphrase noch einmal ein:"
#: agent/genkey.c:175 agent/genkey.c:293 agent/protect-tool.c:1221 #: agent/genkey.c:175 agent/genkey.c:293 agent/protect-tool.c:1222
#: tools/symcryptrun.c:487 #: tools/symcryptrun.c:487
msgid "does not match - try again" msgid "does not match - try again"
msgstr "Keine Übereinstimmung - bitte nochmal versuchen" msgstr "Keine Übereinstimmung - bitte nochmal versuchen"
@ -481,16 +479,16 @@ msgstr ""
"Syntax: gpg-protect-tool [Optionen] [Argumente]\n" "Syntax: gpg-protect-tool [Optionen] [Argumente]\n"
"Werkzeug zum Bearbeiten von geheimen Schlüsseln\n" "Werkzeug zum Bearbeiten von geheimen Schlüsseln\n"
#: agent/protect-tool.c:1206 #: agent/protect-tool.c:1207
msgid "Please enter the passphrase to unprotect the PKCS#12 object." msgid "Please enter the passphrase to unprotect the PKCS#12 object."
msgstr "Bitte geben Sie die Passphrase zum Entsperren des PKCS#12 Objekts ein" msgstr "Bitte geben Sie die Passphrase zum Entsperren des PKCS#12 Objekts ein"
#: agent/protect-tool.c:1209 #: agent/protect-tool.c:1210
msgid "Please enter the passphrase to protect the new PKCS#12 object." msgid "Please enter the passphrase to protect the new PKCS#12 object."
msgstr "" msgstr ""
"Bitte geben Sie die Passphrase zum Schützen des neuen PKCS#12 Objekts ein" "Bitte geben Sie die Passphrase zum Schützen des neuen PKCS#12 Objekts ein"
#: agent/protect-tool.c:1212 #: agent/protect-tool.c:1213
msgid "" msgid ""
"Please enter the passphrase to protect the imported object within the GnuPG " "Please enter the passphrase to protect the imported object within the GnuPG "
"system." "system."
@ -498,7 +496,7 @@ msgstr ""
"Bitte geben Sie die Passphrase ein, um das importierte Objekt im GnuPG " "Bitte geben Sie die Passphrase ein, um das importierte Objekt im GnuPG "
"System zu schützen." "System zu schützen."
#: agent/protect-tool.c:1217 #: agent/protect-tool.c:1218
msgid "" msgid ""
"Please enter the passphrase or the PIN\n" "Please enter the passphrase or the PIN\n"
"needed to complete this operation." "needed to complete this operation."
@ -506,16 +504,16 @@ msgstr ""
"Die Eingabe der Passphrase bzw. der PIN\n" "Die Eingabe der Passphrase bzw. der PIN\n"
"wird benötigt um diese Aktion auszuführen." "wird benötigt um diese Aktion auszuführen."
#: agent/protect-tool.c:1222 tools/symcryptrun.c:488 #: agent/protect-tool.c:1223 tools/symcryptrun.c:488
msgid "Passphrase:" msgid "Passphrase:"
msgstr "Passphrase:" msgstr "Passphrase:"
#: agent/protect-tool.c:1235 tools/symcryptrun.c:501 #: agent/protect-tool.c:1236 tools/symcryptrun.c:501
#, c-format #, c-format
msgid "error while asking for the passphrase: %s\n" msgid "error while asking for the passphrase: %s\n"
msgstr "Fehler bei der Abfrage der Passphrase: %s\n" msgstr "Fehler bei der Abfrage der Passphrase: %s\n"
#: agent/protect-tool.c:1238 tools/symcryptrun.c:505 #: agent/protect-tool.c:1239 tools/symcryptrun.c:505
msgid "cancelled\n" msgid "cancelled\n"
msgstr "Vom Benutzer abgebrochen\n" msgstr "Vom Benutzer abgebrochen\n"
@ -677,11 +675,11 @@ msgstr "Kommunikationsproblem mit GPG-Agent\n"
msgid "problem setting the gpg-agent options\n" msgid "problem setting the gpg-agent options\n"
msgstr "Beim setzen der gpg-agent Optionen ist ein problem aufgetreten\n" msgstr "Beim setzen der gpg-agent Optionen ist ein problem aufgetreten\n"
#: common/simple-pwquery.c:527 common/simple-pwquery.c:615 #: common/simple-pwquery.c:531 common/simple-pwquery.c:619
msgid "canceled by user\n" msgid "canceled by user\n"
msgstr "Vom Benutzer abgebrochen\n" msgstr "Vom Benutzer abgebrochen\n"
#: common/simple-pwquery.c:534 common/simple-pwquery.c:621 #: common/simple-pwquery.c:538 common/simple-pwquery.c:625
msgid "problem with the agent\n" msgid "problem with the agent\n"
msgstr "Problem mit dem Agenten\n" msgstr "Problem mit dem Agenten\n"