mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-01 16:33:02 +01:00
* import.c (import_keys_internal): s/inp/inp2/ to avoid shadowing
warning. * passphrase.c (agent_get_passphrase): Fixed signed/unsigned char problem in %-escaping. Noted by Ingo Kl�cker.
This commit is contained in:
parent
8c48fbd0e2
commit
d68fe4f73d
@ -1,3 +1,11 @@
|
|||||||
|
2002-10-04 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* import.c (import_keys_internal): s/inp/inp2/ to avoid shadowing
|
||||||
|
warning.
|
||||||
|
|
||||||
|
* passphrase.c (agent_get_passphrase): Fixed signed/unsigned char
|
||||||
|
problem in %-escaping. Noted by Ingo Klöcker.
|
||||||
|
|
||||||
2002-10-03 David Shaw <dshaw@jabberwocky.com>
|
2002-10-03 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* options.h, g10.c (main): Add --strict and --no-strict to switch
|
* options.h, g10.c (main): Add --strict and --no-strict to switch
|
||||||
|
@ -193,14 +193,14 @@ import_keys_internal( IOBUF inp, char **fnames, int nnames,
|
|||||||
|
|
||||||
for(i=0; i < nnames; i++ ) {
|
for(i=0; i < nnames; i++ ) {
|
||||||
const char *fname = fnames? fnames[i] : NULL;
|
const char *fname = fnames? fnames[i] : NULL;
|
||||||
IOBUF inp = iobuf_open(fname);
|
IOBUF inp2 = iobuf_open(fname);
|
||||||
if( !fname )
|
if( !fname )
|
||||||
fname = "[stdin]";
|
fname = "[stdin]";
|
||||||
if( !inp )
|
if( !inp )
|
||||||
log_error(_("can't open `%s': %s\n"), fname, strerror(errno) );
|
log_error(_("can't open `%s': %s\n"), fname, strerror(errno) );
|
||||||
else {
|
else {
|
||||||
rc = import( inp, fname, stats, options );
|
rc = import( inp2, fname, stats, options );
|
||||||
iobuf_close(inp);
|
iobuf_close(inp2);
|
||||||
if( rc )
|
if( rc )
|
||||||
log_error("import from `%s' failed: %s\n", fname,
|
log_error("import from `%s' failed: %s\n", fname,
|
||||||
g10_errstr(rc) );
|
g10_errstr(rc) );
|
||||||
|
@ -732,6 +732,7 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text )
|
|||||||
else
|
else
|
||||||
{ /* The new Assuan protocol */
|
{ /* The new Assuan protocol */
|
||||||
char *line, *p;
|
char *line, *p;
|
||||||
|
const unsigned char *s;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!tryagain_text)
|
if (!tryagain_text)
|
||||||
@ -751,33 +752,33 @@ agent_get_passphrase ( u32 *keyid, int mode, const char *tryagain_text )
|
|||||||
else
|
else
|
||||||
*p++ = 'X'; /* no caching */
|
*p++ = 'X'; /* no caching */
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
for (i=0; tryagain_text[i]; i++)
|
for (i=0, s=tryagain_text; *s; s++)
|
||||||
{
|
{
|
||||||
if (tryagain_text[i] < ' ' || tryagain_text[i] == '+')
|
if (*s < ' ' || *s == '+')
|
||||||
{
|
{
|
||||||
sprintf (p, "%%%02X", tryagain_text[i]);
|
sprintf (p, "%%%02X", *s);
|
||||||
p += 3;
|
p += 3;
|
||||||
}
|
}
|
||||||
else if (tryagain_text[i] == ' ')
|
else if (*s == ' ')
|
||||||
*p++ = '+';
|
*p++ = '+';
|
||||||
else
|
else
|
||||||
*p++ = tryagain_text[i];
|
*p++ = *s;
|
||||||
}
|
}
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
*p++ = 'X'; /* Use the standard prompt */
|
*p++ = 'X'; /* Use the standard prompt */
|
||||||
*p++ = ' ';
|
*p++ = ' ';
|
||||||
/* copy description */
|
/* copy description */
|
||||||
for (i=0; atext[i]; i++)
|
for (i=0, s= atext; *s; s++)
|
||||||
{
|
{
|
||||||
if (atext[i] < ' ' || atext[i] == '+')
|
if (*s < ' ' || *s == '+')
|
||||||
{
|
{
|
||||||
sprintf (p, "%%%02X", atext[i]);
|
sprintf (p, "%%%02X", *s);
|
||||||
p += 3;
|
p += 3;
|
||||||
}
|
}
|
||||||
else if (atext[i] == ' ')
|
else if (*s == ' ')
|
||||||
*p++ = '+';
|
*p++ = '+';
|
||||||
else
|
else
|
||||||
*p++ = atext[i];
|
*p++ = *s;
|
||||||
}
|
}
|
||||||
*p++ = '\n';
|
*p++ = '\n';
|
||||||
i = writen (fd, line, p - line);
|
i = writen (fd, line, p - line);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user