mirror of
git://git.gnupg.org/gnupg.git
synced 2025-03-02 21:11:05 +01:00
Some bug fixes of the last release
This commit is contained in:
parent
35c1054507
commit
b076ce3021
129
ABOUT-NLS
129
ABOUT-NLS
@ -137,8 +137,7 @@ Each translation team has its own mailing list, courtesy of Linux
|
|||||||
International. You may reach your translation team at the address
|
International. You may reach your translation team at the address
|
||||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||||
language. Language codes are *not* the same as the country codes given
|
language. Language codes are *not* the same as the country codes given
|
||||||
in ISO 3166. The following translation teams exist, as of December
|
in ISO 3166. The following translation teams exist, as of August 1998:
|
||||||
1997:
|
|
||||||
|
|
||||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||||
@ -173,42 +172,79 @@ Available Packages
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
Languages are not equally supported in all packages. The following
|
Languages are not equally supported in all packages. The following
|
||||||
matrix shows the current state of internationalization, as of December
|
matrix shows the current state of internationalization, as of August
|
||||||
1997. The matrix shows, in regard of each package, for which languages
|
1998. The matrix shows, in regard of each package, for which languages
|
||||||
PO files have been submitted to translation coordination.
|
PO files have been submitted to translation coordination.
|
||||||
|
|
||||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
Ready PO files cs da de el en es fi fr it
|
||||||
.----------------------------------------------------.
|
.----------------------------.
|
||||||
bash | [] [] [] | 3
|
bash | [] [] |
|
||||||
bison | [] [] [] | 3
|
bison | [] [] |
|
||||||
clisp | [] [] [] [] | 4
|
clisp | [] [] [] [] |
|
||||||
cpio | [] [] [] [] [] [] | 6
|
cpio | [] [] [] |
|
||||||
diffutils | [] [] [] [] [] | 5
|
diffutils | [] [] [] |
|
||||||
enscript | [] [] [] [] [] [] | 6
|
enscript | [] [] [] [] |
|
||||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
fileutils | [] [] [] [] |
|
||||||
findutils | [] [] [] [] [] [] [] [] [] | 9
|
findutils | [] [] [] [] |
|
||||||
flex | [] [] [] [] | 4
|
flex | [] [] |
|
||||||
gcal | [] [] [] [] [] | 5
|
gcal | [] [] |
|
||||||
gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
|
gettext | [] [] [] [] [] |
|
||||||
grep | [] [] [] [] [] [] [] [] [] [] | 10
|
grep | [] [] [] [] |
|
||||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 11
|
hello | [] [] [] [] [] |
|
||||||
id-utils | [] [] [] | 3
|
id-utils | [] [] |
|
||||||
indent | [] [] [] [] [] | 5
|
indent | [] [] |
|
||||||
libc | [] [] [] [] [] [] [] | 7
|
libc | [] [] [] |
|
||||||
m4 | [] [] [] [] [] [] | 6
|
m4 | [] [] |
|
||||||
make | [] [] [] [] [] [] | 6
|
make | [] [] [] |
|
||||||
music | [] [] | 2
|
music | [] |
|
||||||
ptx | [] [] [] [] [] [] [] [] | 8
|
ptx | [] [] [] |
|
||||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
recode | [] [] [] [] |
|
||||||
sh-utils | [] [] [] [] [] [] [] [] | 8
|
sed | |
|
||||||
sharutils | [] [] [] [] [] [] | 6
|
sh-utils | [] [] [] |
|
||||||
tar | [] [] [] [] [] [] [] [] [] [] [] | 11
|
sharutils | [] [] [] [] [] |
|
||||||
texinfo | [] [] [] | 3
|
tar | [] [] [] [] |
|
||||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
texinfo | [] [] [] |
|
||||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
textutils | [] [] [] [] |
|
||||||
`----------------------------------------------------'
|
wdiff | [] [] [] [] |
|
||||||
17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
wget | [] [] [] [] |
|
||||||
27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
|
`----------------------------'
|
||||||
|
cs da de el en es fi fr it
|
||||||
|
7 4 26 4 1 18 1 26 4
|
||||||
|
|
||||||
|
ja ko nl no pl pt ru sl sv
|
||||||
|
.----------------------------.
|
||||||
|
bash | [] | 3
|
||||||
|
bison | [] | 3
|
||||||
|
clisp | | 4
|
||||||
|
cpio | [] [] [] | 6
|
||||||
|
diffutils | [] [] | 5
|
||||||
|
enscript | [] [] | 6
|
||||||
|
fileutils | [] [] [] [] [] [] [] | 11
|
||||||
|
findutils | [] [] [] [] [] | 9
|
||||||
|
flex | [] [] | 4
|
||||||
|
gcal | [] [] [] | 5
|
||||||
|
gettext | [] [] [] [] [] [] [] | 13
|
||||||
|
grep | [] [] [] [] [] [] [] | 11
|
||||||
|
hello | [] [] [] [] [] [] [] | 12
|
||||||
|
id-utils | [] | 3
|
||||||
|
indent | [] [] [] | 5
|
||||||
|
libc | [] [] [] [] [] | 8
|
||||||
|
m4 | [] [] [] [] | 6
|
||||||
|
make | [] [] [] | 6
|
||||||
|
music | [] | 2
|
||||||
|
ptx | [] [] [] [] [] | 8
|
||||||
|
recode | [] [] [] [] [] | 9
|
||||||
|
sed | | 0
|
||||||
|
sh-utils | [] [] [] [] [] | 8
|
||||||
|
sharutils | [] [] | 7
|
||||||
|
tar | [] [] [] [] [] [] [] | 11
|
||||||
|
texinfo | [] | 4
|
||||||
|
textutils | [] [] [] [] [] | 9
|
||||||
|
wdiff | [] [] [] [] | 8
|
||||||
|
wget | [] | 5
|
||||||
|
`----------------------------'
|
||||||
|
18 teams ja ko nl no pl pt ru sl sv
|
||||||
|
29 domains 1 12 21 11 19 7 5 7 17 191
|
||||||
|
|
||||||
Some counters in the preceding matrix are higher than the number of
|
Some counters in the preceding matrix are higher than the number of
|
||||||
visible blocks let us expect. This is because a few extra PO files are
|
visible blocks let us expect. This is because a few extra PO files are
|
||||||
@ -221,6 +257,23 @@ distributed as such by its maintainer. There might be an observable
|
|||||||
lag between the mere existence a PO file and its wide availability in a
|
lag between the mere existence a PO file and its wide availability in a
|
||||||
distribution.
|
distribution.
|
||||||
|
|
||||||
If December 1997 seems to be old, you may fetch a more recent copy
|
If August 1998 seems to be old, you may fetch a more recent copy of
|
||||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
this `ABOUT-NLS' file on most GNU archive sites.
|
||||||
|
|
||||||
|
Using `gettext' in new packages
|
||||||
|
===============================
|
||||||
|
|
||||||
|
If you are writing a freely available program and want to
|
||||||
|
internationalize it you are welcome to use GNU `gettext' in your
|
||||||
|
package. Of course the GNU Public License applies to your sources from
|
||||||
|
then if you include `gettext' directly in your distribution on but
|
||||||
|
since you are writing free software anyway this is no restriction.
|
||||||
|
|
||||||
|
Once the sources are change appropriately and the setup can handle to
|
||||||
|
use of `gettext' the only thing missing are the translations. The Free
|
||||||
|
Translation Project is also available for packages which are not
|
||||||
|
developed inside the GNU project. Therefore the information given above
|
||||||
|
applies also for every other Free Software Project. Contact
|
||||||
|
`translation@iro.umontreal.ca' to make the `.pot' files available to
|
||||||
|
the translation teams.
|
||||||
|
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Tue Nov 10 13:44:53 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
|
* ABOUT-NLS: New
|
||||||
|
* configure-in (AC_REVISION): New.
|
||||||
|
|
||||||
Sun Nov 8 18:20:35 1998 Werner Koch (wk@isil.d.shuttle.de)
|
Sun Nov 8 18:20:35 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
* VERSION: Set to 0.4.3
|
* VERSION: Set to 0.4.3
|
||||||
|
8
NEWS
8
NEWS
@ -1,3 +1,11 @@
|
|||||||
|
This is NOT a released version!
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
* Add option --charset to support "koi8-r" encoding of user ids.
|
||||||
|
(Not yet tested).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Noteworthy changes in version 0.4.3
|
Noteworthy changes in version 0.4.3
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
|
8
PROJECTS
8
PROJECTS
@ -1,4 +1,12 @@
|
|||||||
|
|
||||||
|
* Urko Lusa <ulusa@lacueva.ddns.org> is working on es.po
|
||||||
|
|
||||||
|
|
||||||
|
* Check if an object (a message, detached sign, public key, or whatever)
|
||||||
|
is signed by definite user, i.e. define user
|
||||||
|
(userid, or any other unique identification) on command line.
|
||||||
|
|
||||||
|
|
||||||
* abstraction of the MPI
|
* abstraction of the MPI
|
||||||
|
|
||||||
* Add a way to override the current cipher/md implementations
|
* Add a way to override the current cipher/md implementations
|
||||||
|
2
THANKS
2
THANKS
@ -5,9 +5,11 @@ errors.
|
|||||||
|
|
||||||
Anand Kumria wildfire@progsoc.uts.edu.au
|
Anand Kumria wildfire@progsoc.uts.edu.au
|
||||||
Ariel T Glenn ariel@columbia.edu
|
Ariel T Glenn ariel@columbia.edu
|
||||||
|
Bryan Fullerton bryanf@samurai.com
|
||||||
Brian Moore bem@cmc.net
|
Brian Moore bem@cmc.net
|
||||||
Brian Warner warner@lothar.com
|
Brian Warner warner@lothar.com
|
||||||
Caskey L. Dickson caskey@technocage.com
|
Caskey L. Dickson caskey@technocage.com
|
||||||
|
Cees van de Griend cees-list@griend.xs4all.nl
|
||||||
Charles Levert charles@comm.polymtl.ca
|
Charles Levert charles@comm.polymtl.ca
|
||||||
Christian von Roques roques@pond.sub.org
|
Christian von Roques roques@pond.sub.org
|
||||||
Christopher Oliver oliver@fritz.traverse.net
|
Christopher Oliver oliver@fritz.traverse.net
|
||||||
|
21
TODO
21
TODO
@ -1,23 +1,23 @@
|
|||||||
|
|
||||||
|
* Update the keyring on ftp.ggug.de
|
||||||
|
|
||||||
|
* support for mpi/powerpc split is still combined or whatever
|
||||||
|
|
||||||
|
* add a note, that gettext 10.35 is needed (for gettext) - and install
|
||||||
|
it on tobold.
|
||||||
|
|
||||||
* use zlib 1.1.13 to avoid a bug with 13 bit windows
|
* use zlib 1.1.13 to avoid a bug with 13 bit windows
|
||||||
|
but there are more problems with large files
|
||||||
|
|
||||||
* FreeBSD:
|
* FreeBSD:
|
||||||
#define USE_DYNAMIC_LINKING
|
#define USE_DYNAMIC_LINKING
|
||||||
#define HAVE_DL_DLOPEN
|
#define HAVE_DL_DLOPEN
|
||||||
and the ld option -export-dynamic.
|
and the ld option -export-dynamic.
|
||||||
|
|
||||||
*
|
|
||||||
Well, there was one thing extra I needed to do. While configure found the
|
|
||||||
gdbm library, it didn't add the path the the include file list. I had to
|
|
||||||
re-run configure with CPPFLAGS set:
|
|
||||||
|
|
||||||
env CPPFLAGS='-I/usr/local/include' configure ...
|
|
||||||
|
|
||||||
|
|
||||||
* clearsig: keep lineendings as they are. Remember that trailings
|
* clearsig: keep lineendings as they are. Remember that trailings
|
||||||
blanks are not hashed.
|
blanks are not hashed.
|
||||||
|
|
||||||
* Fix ;) revocation and expire stuff.
|
* Check revocation and expire stuff.
|
||||||
|
|
||||||
* check preferences (cipher and compress)
|
* check preferences (cipher and compress)
|
||||||
|
|
||||||
@ -26,9 +26,6 @@
|
|||||||
|
|
||||||
* should we flush the getkey.c caches while doing an import?
|
* should we flush the getkey.c caches while doing an import?
|
||||||
|
|
||||||
* prefer a type 16 subkey for encryption because pgp cannot handle
|
|
||||||
type 20?
|
|
||||||
|
|
||||||
* The critical bit of signature subpackets is not yet supported; i.e.
|
* The critical bit of signature subpackets is not yet supported; i.e.
|
||||||
it is ignored.
|
it is ignored.
|
||||||
|
|
||||||
|
@ -10,6 +10,8 @@ else
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
LANG=
|
||||||
|
LANGUAGE=
|
||||||
|
|
||||||
|
|
||||||
expect - <<EOF
|
expect - <<EOF
|
||||||
@ -84,13 +86,13 @@ expect {
|
|||||||
-exact "o\r
|
-exact "o\r
|
||||||
\r \rYou need a Passphrase to protect your secret key.\r
|
\r \rYou need a Passphrase to protect your secret key.\r
|
||||||
\r
|
\r
|
||||||
Enter pass phrase: " { sleep 1; send -- "abc\r" }
|
Enter passphrase: " { sleep 1; send -- "abc\r" }
|
||||||
timeout { exit 1 } }
|
timeout { exit 1 } }
|
||||||
expect {
|
expect {
|
||||||
-ex "\r \rRepeat pass phrase: " { sleep 1; send -- "abc\r" }
|
-ex "\r \rRepeat passphrase: " { sleep 1; send -- "abc\r" }
|
||||||
timeout { exit 1 } }
|
timeout { exit 1 } }
|
||||||
expect {
|
expect {
|
||||||
-ex "\r \rWe need to generate a lot of random bytes. It is a good idea to perform\r
|
-ex "\r \rWe need to generate a lot of random bytes. It is a good idea to perform\r
|
||||||
some other action (work in another window, move the mouse, utilize the\r
|
some other action (work in another window, move the mouse, utilize the\r
|
||||||
network and the disks) during the prime generation; this gives the random\r
|
network and the disks) during the prime generation; this gives the random\r
|
||||||
number generator a better chance to gain enough entropy.\r" {}
|
number generator a better chance to gain enough entropy.\r" {}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
gpg: Good signature from
|
gpg: Good signature from
|
||||||
gpg: Signature made
|
gpg: Signature made
|
||||||
gpg: note: cipher algorithm 3 not found in preferences
|
gpg: NOTE: cipher algorithm 3 not found in preferences
|
||||||
gpg: note: cipher algorithm 4 not found in preferences
|
gpg: NOTE: cipher algorithm 4 not found in preferences
|
||||||
gpg: note: secret key 2E5FA4F4 is NOT protected.
|
gpg: NOTE: secret key 2E5FA4F4 is NOT protected.
|
||||||
gpg: note: secret key 439F02CA is NOT protected.
|
gpg: NOTE: secret key 439F02CA is NOT protected.
|
||||||
gpg: warning: using insecure random number generator
|
gpg: WARNING: using insecure random number generator
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
*
|
*
|
||||||
* According to the definition of DES in FIPS PUB 46-2 from December 1993.
|
* According to the definition of DES in FIPS PUB 46-2 from December 1993.
|
||||||
* For a description of triple encryption, see:
|
* For a description of triple encryption, see:
|
||||||
* Bruce Schneier: Applied Cryptography. Second Edition. John Wiley & Sons, 1996
|
* Bruce Schneier: Applied Cryptography. Second Edition.
|
||||||
* ISBN 0-471-12845-7. Pages 358 ff.
|
* John Wiley & Sons, 1996. ISBN 0-471-12845-7. Pages 358 ff.
|
||||||
*
|
*
|
||||||
* This file is part of GNUPG.
|
* This file is part of GNUPG.
|
||||||
*
|
*
|
||||||
|
@ -420,7 +420,7 @@ md_get_algo( MD_HANDLE a )
|
|||||||
|
|
||||||
if( (r=a->list) ) {
|
if( (r=a->list) ) {
|
||||||
if( r->next )
|
if( r->next )
|
||||||
log_error("warning: more than algorithm in md_get_algo()\n");
|
log_error("WARNING: more than algorithm in md_get_algo()\n");
|
||||||
return r->algo;
|
return r->algo;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -440,7 +440,7 @@ md_digest_length( int algo )
|
|||||||
return r->mdlen;
|
return r->mdlen;
|
||||||
}
|
}
|
||||||
} while( !r && load_digest_modules() );
|
} while( !r && load_digest_modules() );
|
||||||
log_error("warning: no length for md algo %d\n", algo);
|
log_error("WARNING: no length for md algo %d\n", algo);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -463,7 +463,7 @@ md_asn_oid( int algo, size_t *asnlen, size_t *mdlen )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while( !r && load_digest_modules() );
|
} while( !r && load_digest_modules() );
|
||||||
log_bug("warning: no asn for md algo %d\n", algo);
|
log_bug("no asn for md algo %d\n", algo);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ read_random_source( byte *buffer, size_t length, int level )
|
|||||||
static int initialized=0;
|
static int initialized=0;
|
||||||
|
|
||||||
if( !initialized ) {
|
if( !initialized ) {
|
||||||
log_info(_("warning: using insecure random number generator!!\n"));
|
log_info(_("WARNING: using insecure random number generator!!\n"));
|
||||||
tty_printf(_("The random number generator is only a kludge to let\n"
|
tty_printf(_("The random number generator is only a kludge to let\n"
|
||||||
"it compile - it is in no way a strong RNG!\n\n"
|
"it compile - it is in no way a strong RNG!\n\n"
|
||||||
"DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!\n\n"));
|
"DON'T USE ANY DATA GENERATED BY THIS PROGRAM!!\n\n"));
|
||||||
|
@ -2,6 +2,7 @@ dnl
|
|||||||
dnl Configure template for GNUPG
|
dnl Configure template for GNUPG
|
||||||
dnl
|
dnl
|
||||||
dnl (Process this file with autoconf to produce a configure script.)
|
dnl (Process this file with autoconf to produce a configure script.)
|
||||||
|
AC_REVISION($Revision$)dnl
|
||||||
|
|
||||||
dnl Must reset CDPATH so that bash's cd does not print to stdout
|
dnl Must reset CDPATH so that bash's cd does not print to stdout
|
||||||
CDPATH=
|
CDPATH=
|
||||||
|
@ -39,6 +39,8 @@ RFCs
|
|||||||
1423 Privacy Enhancement for Internet Electronic Mail:
|
1423 Privacy Enhancement for Internet Electronic Mail:
|
||||||
Part III: Algorithms, Modes, and Identifiers.
|
Part III: Algorithms, Modes, and Identifiers.
|
||||||
|
|
||||||
|
1489 Registration of a Cyrillic Character Set.
|
||||||
|
|
||||||
1750 Randomness Recommendations for Security.
|
1750 Randomness Recommendations for Security.
|
||||||
|
|
||||||
1991 PGP Message Exchange Formats.
|
1991 PGP Message Exchange Formats.
|
||||||
@ -47,6 +49,8 @@ RFCs
|
|||||||
|
|
||||||
2144 The CAST-128 Encryption Algorithm.
|
2144 The CAST-128 Encryption Algorithm.
|
||||||
|
|
||||||
|
2279 UTF-8, a transformation format of ISO 10646.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -293,6 +293,13 @@ B<--homedir> I<dir>
|
|||||||
not make sense to use this in a options file. This
|
not make sense to use this in a options file. This
|
||||||
also overrides the environment variable C<GNUPGHOME>.
|
also overrides the environment variable C<GNUPGHOME>.
|
||||||
|
|
||||||
|
B<--charset> I<name>
|
||||||
|
Set the name of the native character set. This is used
|
||||||
|
to convert some strings to proper UTF-8 encoding.
|
||||||
|
Valid values for I<name> are:
|
||||||
|
B<iso-8859-1> This is the default.
|
||||||
|
B<koi8-r> The usual Russian set (rfc1489).
|
||||||
|
|
||||||
B<--options> I<file>
|
B<--options> I<file>
|
||||||
Read options from I<file> and do not try to read
|
Read options from I<file> and do not try to read
|
||||||
them from the default options file in the homedir
|
them from the default options file in the homedir
|
||||||
|
@ -1,3 +1,27 @@
|
|||||||
|
Tue Nov 10 10:08:59 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
|
* g10.c (g10_exit): Now looks at the new g10_errors_seen.
|
||||||
|
* mainproc.c (check_sig_and_print): Sets g10_errors_seen.
|
||||||
|
|
||||||
|
* *.c : i18n many more strings.
|
||||||
|
|
||||||
|
* ringedit.c (locate_keyblock_by_keyid): Add HAVE_LIBGDBM
|
||||||
|
(locate_keyblock_by_fpr): Ditto.
|
||||||
|
|
||||||
|
* g10.c (main): removed unsused "int errors".
|
||||||
|
(main): Add new option --charset.
|
||||||
|
|
||||||
|
* g10.c (main): special message for the unix newbie.
|
||||||
|
|
||||||
|
Mon Nov 9 07:17:42 1998 Werner Koch <werner.koch@guug.de>
|
||||||
|
|
||||||
|
* getkey.c (finish_lookup): Kludge to prefere algo 16.
|
||||||
|
|
||||||
|
* trustdb.c (new_lid_table): Clear cached item.
|
||||||
|
|
||||||
|
* status.c (cpr_get_utf8): New.
|
||||||
|
* pkclist.c (build_pk_list): Uses this.
|
||||||
|
|
||||||
Sun Nov 8 17:20:39 1998 Werner Koch (wk@isil.d.shuttle.de)
|
Sun Nov 8 17:20:39 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
* mainproc.c (check_sig_and_print): Why did I use strlen()-1
|
* mainproc.c (check_sig_and_print): Why did I use strlen()-1
|
||||||
|
@ -152,7 +152,7 @@ encode_simple( const char *filename, int mode )
|
|||||||
}
|
}
|
||||||
if( filename ) {
|
if( filename ) {
|
||||||
if( !(filesize = iobuf_get_filelength(inp)) )
|
if( !(filesize = iobuf_get_filelength(inp)) )
|
||||||
log_info(_("%s: warning: empty file\n"), filename );
|
log_info(_("%s: WARNING: empty file\n"), filename );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
filesize = 0; /* stdin */
|
filesize = 0; /* stdin */
|
||||||
@ -266,7 +266,7 @@ encode_crypt( const char *filename, STRLIST remusr )
|
|||||||
}
|
}
|
||||||
if( filename ) {
|
if( filename ) {
|
||||||
if( !(filesize = iobuf_get_filelength(inp)) )
|
if( !(filesize = iobuf_get_filelength(inp)) )
|
||||||
log_info(_("%s: warning: empty file\n"), filename );
|
log_info(_("%s: WARNING: empty file\n"), filename );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
filesize = 0; /* stdin */
|
filesize = 0; /* stdin */
|
||||||
|
@ -56,9 +56,9 @@ decrypt_data( PKT_encrypted *ed, DEK *dek )
|
|||||||
if( opt.verbose ) {
|
if( opt.verbose ) {
|
||||||
const char *s = cipher_algo_to_string( dek->algo );
|
const char *s = cipher_algo_to_string( dek->algo );
|
||||||
if( s )
|
if( s )
|
||||||
log_info("%s encrypted data\n", s );
|
log_info(_("%s encrypted data\n"), s );
|
||||||
else
|
else
|
||||||
log_info("encrypted with unknown algorithm %d\n", dek->algo );
|
log_info(_("encrypted with unknown algorithm %d\n"), dek->algo );
|
||||||
}
|
}
|
||||||
if( (rc=check_cipher_algo(dek->algo)) )
|
if( (rc=check_cipher_algo(dek->algo)) )
|
||||||
return rc;
|
return rc;
|
||||||
@ -71,7 +71,7 @@ decrypt_data( PKT_encrypted *ed, DEK *dek )
|
|||||||
dfx.cipher_hd = cipher_open( dek->algo, CIPHER_MODE_AUTO_CFB, 1 );
|
dfx.cipher_hd = cipher_open( dek->algo, CIPHER_MODE_AUTO_CFB, 1 );
|
||||||
rc = cipher_setkey( dfx.cipher_hd, dek->key, dek->keylen );
|
rc = cipher_setkey( dfx.cipher_hd, dek->key, dek->keylen );
|
||||||
if( rc == G10ERR_WEAK_KEY )
|
if( rc == G10ERR_WEAK_KEY )
|
||||||
log_info(_("Warning: Message was encrypted with "
|
log_info(_("WARNING: Message was encrypted with "
|
||||||
"a weak key in the symmetric cipher.\n"));
|
"a weak key in the symmetric cipher.\n"));
|
||||||
else if( rc )
|
else if( rc )
|
||||||
log_error("key setup failed: %s\n", g10_errstr(rc) );
|
log_error("key setup failed: %s\n", g10_errstr(rc) );
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
static int do_export( STRLIST users, int secret );
|
static int do_export( STRLIST users, int secret );
|
||||||
|
|
||||||
@ -158,7 +159,7 @@ do_export( STRLIST users, int secret )
|
|||||||
else
|
else
|
||||||
iobuf_close(out);
|
iobuf_close(out);
|
||||||
if( !any )
|
if( !any )
|
||||||
log_info("warning: nothing exported\n");
|
log_info(_("WARNING: nothing exported\n"));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
26
g10/g10.c
26
g10/g10.c
@ -144,6 +144,7 @@ enum cmd_and_opt_values { aNull = 0,
|
|||||||
oS2KMode,
|
oS2KMode,
|
||||||
oS2KDigest,
|
oS2KDigest,
|
||||||
oS2KCipher,
|
oS2KCipher,
|
||||||
|
oCharset,
|
||||||
aTest };
|
aTest };
|
||||||
|
|
||||||
|
|
||||||
@ -220,6 +221,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")},
|
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")},
|
||||||
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")},
|
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")},
|
||||||
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")},
|
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")},
|
||||||
|
{ oCharset, "charset" , 2, N_("|NAME| set terminal charset to NAME") },
|
||||||
{ oOptions, "options" , 2, N_("read options from file")},
|
{ oOptions, "options" , 2, N_("read options from file")},
|
||||||
|
|
||||||
{ oDebug, "debug" ,4|16, N_("set debugging flags")},
|
{ oDebug, "debug" ,4|16, N_("set debugging flags")},
|
||||||
@ -295,6 +297,9 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int g10_errors_seen = 0;
|
||||||
|
|
||||||
|
|
||||||
static int maybe_setuid = 1;
|
static int maybe_setuid = 1;
|
||||||
|
|
||||||
static char *build_list( const char *text,
|
static char *build_list( const char *text,
|
||||||
@ -488,7 +493,6 @@ main( int argc, char **argv )
|
|||||||
unsigned configlineno;
|
unsigned configlineno;
|
||||||
int parse_debug = 0;
|
int parse_debug = 0;
|
||||||
int default_config =1;
|
int default_config =1;
|
||||||
int errors=0;
|
|
||||||
int default_keyring = 1;
|
int default_keyring = 1;
|
||||||
int greeting = 1;
|
int greeting = 1;
|
||||||
enum cmd_and_opt_values cmd = 0;
|
enum cmd_and_opt_values cmd = 0;
|
||||||
@ -599,7 +603,7 @@ main( int argc, char **argv )
|
|||||||
if( !configfp ) {
|
if( !configfp ) {
|
||||||
if( default_config ) {
|
if( default_config ) {
|
||||||
if( parse_debug )
|
if( parse_debug )
|
||||||
log_info(_("note: no default option file '%s'\n"),
|
log_info(_("NOTE: no default option file '%s'\n"),
|
||||||
configname );
|
configname );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -755,8 +759,13 @@ main( int argc, char **argv )
|
|||||||
case oNoSecmemWarn:
|
case oNoSecmemWarn:
|
||||||
break; /* dummies */
|
break; /* dummies */
|
||||||
#endif
|
#endif
|
||||||
|
case oCharset:
|
||||||
|
if( set_native_charset( pargs.r.ret_str ) )
|
||||||
|
log_error(_("%s is not a valid character set\n"),
|
||||||
|
pargs.r.ret_str);
|
||||||
|
break;
|
||||||
|
|
||||||
default : errors++; pargs.err = configfp? 1:2; break;
|
default : pargs.err = configfp? 1:2; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( configfp ) {
|
if( configfp ) {
|
||||||
@ -812,7 +821,7 @@ main( int argc, char **argv )
|
|||||||
log_error(_("marginals-needed must be greater than 1\n"));
|
log_error(_("marginals-needed must be greater than 1\n"));
|
||||||
switch( opt.s2k_mode ) {
|
switch( opt.s2k_mode ) {
|
||||||
case 0:
|
case 0:
|
||||||
log_info(_("note: simple S2K mode (0) is strongly discouraged\n"));
|
log_info(_("NOTE: simple S2K mode (0) is strongly discouraged\n"));
|
||||||
break;
|
break;
|
||||||
case 1: case 3: break;
|
case 1: case 3: break;
|
||||||
default:
|
default:
|
||||||
@ -1228,9 +1237,15 @@ main( int argc, char **argv )
|
|||||||
/* fixme: g10maint should do regular maintenace tasks here */
|
/* fixme: g10maint should do regular maintenace tasks here */
|
||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
wrong_args(_("[filename]"));
|
wrong_args(_("[filename]"));
|
||||||
|
/* Issue some output for the unix newbie */
|
||||||
|
if( !fname && !opt.outfile && isatty( fileno(stdin) )
|
||||||
|
&& isatty( fileno(stdout) ) && isatty( fileno(stderr) ) )
|
||||||
|
log_info(_("Go ahead and type your message ...\n"));
|
||||||
|
|
||||||
if( !(a = iobuf_open(fname)) )
|
if( !(a = iobuf_open(fname)) )
|
||||||
log_error(_("can't open '%s'\n"), print_fname_stdin(fname));
|
log_error(_("can't open '%s'\n"), print_fname_stdin(fname));
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if( !opt.no_armor ) {
|
if( !opt.no_armor ) {
|
||||||
if( use_armor_filter( a ) ) {
|
if( use_armor_filter( a ) ) {
|
||||||
memset( &afx, 0, sizeof afx);
|
memset( &afx, 0, sizeof afx);
|
||||||
@ -1263,7 +1278,8 @@ g10_exit( int rc )
|
|||||||
if( opt.debug )
|
if( opt.debug )
|
||||||
secmem_dump_stats();
|
secmem_dump_stats();
|
||||||
secmem_term();
|
secmem_term();
|
||||||
rc = rc? rc : log_get_errorcount(0)? 2:0;
|
rc = rc? rc : log_get_errorcount(0)? 2 :
|
||||||
|
g10_errors_seen? 1 : 0;
|
||||||
/*write_status( STATUS_LEAVE );*/
|
/*write_status( STATUS_LEAVE );*/
|
||||||
exit(rc );
|
exit(rc );
|
||||||
}
|
}
|
||||||
|
33
g10/getkey.c
33
g10/getkey.c
@ -160,7 +160,7 @@ cache_public_key( PKT_public_key *pk )
|
|||||||
if( pk_cache_entries >= MAX_PK_CACHE_ENTRIES ) {
|
if( pk_cache_entries >= MAX_PK_CACHE_ENTRIES ) {
|
||||||
/* fixme: use another algorithm to free some cache slots */
|
/* fixme: use another algorithm to free some cache slots */
|
||||||
pk_cache_disabled=1;
|
pk_cache_disabled=1;
|
||||||
log_info("too many entries in pk cache - disabled\n");
|
log_info(_("too many entries in pk cache - disabled\n"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pk_cache_entries++;
|
pk_cache_entries++;
|
||||||
@ -258,7 +258,7 @@ get_pubkey( PKT_public_key *pk, u32 *keyid )
|
|||||||
;
|
;
|
||||||
else if( ++unk_cache_entries > MAX_UNK_CACHE_ENTRIES ) {
|
else if( ++unk_cache_entries > MAX_UNK_CACHE_ENTRIES ) {
|
||||||
unk_cache_disabled = 1;
|
unk_cache_disabled = 1;
|
||||||
log_info("too many entries in unk cache - disabled\n");
|
log_info(_("too many entries in unk cache - disabled\n"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
keyid_list_t kl;
|
keyid_list_t kl;
|
||||||
@ -937,12 +937,29 @@ finish_lookup( KBNODE keyblock, PKT_public_key *pk, KBNODE k, byte *namehash,
|
|||||||
/* if the usage is not correct, try to use a subkey */
|
/* if the usage is not correct, try to use a subkey */
|
||||||
KBNODE save_k = k;
|
KBNODE save_k = k;
|
||||||
|
|
||||||
for( ; k; k = k->next ) {
|
k = NULL;
|
||||||
if( k->pkt->pkttype == PKT_PUBLIC_SUBKEY
|
/* kludge for pgp 5: which doesn't accept type 20:
|
||||||
&& !check_pubkey_algo2(
|
* try to use a type 16 subkey instead */
|
||||||
k->pkt->pkt.public_key->pubkey_algo,
|
if( pk->pubkey_usage == PUBKEY_USAGE_ENC ) {
|
||||||
pk->pubkey_usage ) )
|
for( k = save_k; k; k = k->next ) {
|
||||||
break;
|
if( k->pkt->pkttype == PKT_PUBLIC_SUBKEY
|
||||||
|
&& k->pkt->pkt.public_key->pubkey_algo
|
||||||
|
== PUBKEY_ALGO_ELGAMAL_E
|
||||||
|
&& !check_pubkey_algo2(
|
||||||
|
k->pkt->pkt.public_key->pubkey_algo,
|
||||||
|
pk->pubkey_usage ) )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !k ) {
|
||||||
|
for(k = save_k ; k; k = k->next ) {
|
||||||
|
if( k->pkt->pkttype == PKT_PUBLIC_SUBKEY
|
||||||
|
&& !check_pubkey_algo2(
|
||||||
|
k->pkt->pkt.public_key->pubkey_algo,
|
||||||
|
pk->pubkey_usage ) )
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if( !k )
|
if( !k )
|
||||||
k = save_k;
|
k = save_k;
|
||||||
|
@ -451,7 +451,8 @@ fix_keyblock( KBNODE keyblock )
|
|||||||
if( subkey ) {
|
if( subkey ) {
|
||||||
PKT_signature *sig = node->pkt->pkt.signature;
|
PKT_signature *sig = node->pkt->pkt.signature;
|
||||||
if( sig->sig_class >= 0x10 && sig->sig_class <= 0x13 ) {
|
if( sig->sig_class >= 0x10 && sig->sig_class <= 0x13 ) {
|
||||||
log_info("moving a key signature to the correct place\n");
|
log_info(_(
|
||||||
|
"moving a key signature to the correct place\n"));
|
||||||
last->next = node->next;
|
last->next = node->next;
|
||||||
node->next = subkey->next;
|
node->next = subkey->next;
|
||||||
subkey->next = node;
|
subkey->next = node;
|
||||||
|
@ -38,6 +38,8 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
/*-- g10.c --*/
|
/*-- g10.c --*/
|
||||||
|
extern int g10_errors_seen;
|
||||||
|
|
||||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
|
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
|
||||||
void g10_exit(int rc) __attribute__ ((noreturn));
|
void g10_exit(int rc) __attribute__ ((noreturn));
|
||||||
#else
|
#else
|
||||||
|
@ -195,7 +195,7 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
|
|||||||
;
|
;
|
||||||
else if( !result ) {
|
else if( !result ) {
|
||||||
if( opt.verbose > 1 )
|
if( opt.verbose > 1 )
|
||||||
log_info( "pubkey_enc packet: Good DEK\n" );
|
log_info( _("public key encrypted data: Good DEK\n") );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error(_("public key decryption failed: %s\n"), g10_errstr(result));
|
log_error(_("public key decryption failed: %s\n"), g10_errstr(result));
|
||||||
@ -225,7 +225,7 @@ proc_encrypted( CTX c, PACKET *pkt )
|
|||||||
;
|
;
|
||||||
else if( !result ) {
|
else if( !result ) {
|
||||||
if( opt.verbose > 1 )
|
if( opt.verbose > 1 )
|
||||||
log_info("decryption okay\n");
|
log_info(_("decryption okay\n"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error(_("decryption failed: %s\n"), g10_errstr(result));
|
log_error(_("decryption failed: %s\n"), g10_errstr(result));
|
||||||
@ -245,9 +245,9 @@ proc_plaintext( CTX c, PACKET *pkt )
|
|||||||
KBNODE n;
|
KBNODE n;
|
||||||
|
|
||||||
if( pt->namelen == 8 && !memcmp( pt->name, "_CONSOLE", 8 ) )
|
if( pt->namelen == 8 && !memcmp( pt->name, "_CONSOLE", 8 ) )
|
||||||
log_info(_("note: sender requested \"for-your-eyes-only\"\n"));
|
log_info(_("NOTE: sender requested \"for-your-eyes-only\"\n"));
|
||||||
else if( opt.verbose )
|
else if( opt.verbose )
|
||||||
log_info("original file name='%.*s'\n", pt->namelen, pt->name);
|
log_info(_("original file name='%.*s'\n"), pt->namelen, pt->name);
|
||||||
free_md_filter_context( &c->mfx );
|
free_md_filter_context( &c->mfx );
|
||||||
c->mfx.md = md_open( 0, 0);
|
c->mfx.md = md_open( 0, 0);
|
||||||
/* fixme: we may need to push the textfilter if we have sigclass 1
|
/* fixme: we may need to push the textfilter if we have sigclass 1
|
||||||
@ -833,7 +833,7 @@ check_sig_and_print( CTX c, KBNODE node )
|
|||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if( opt.skip_verify ) {
|
if( opt.skip_verify ) {
|
||||||
log_info("signature verification suppressed\n");
|
log_info(_("signature verification suppressed\n"));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -854,6 +854,8 @@ check_sig_and_print( CTX c, KBNODE node )
|
|||||||
putc('\n', stderr);
|
putc('\n', stderr);
|
||||||
if( !rc )
|
if( !rc )
|
||||||
rc = check_signatures_trust( sig );
|
rc = check_signatures_trust( sig );
|
||||||
|
if( rc )
|
||||||
|
g10_errors_seen = 1;
|
||||||
if( opt.batch && rc )
|
if( opt.batch && rc )
|
||||||
g10_exit(1);
|
g10_exit(1);
|
||||||
}
|
}
|
||||||
@ -932,12 +934,12 @@ proc_tree( CTX c, KBNODE node )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_info("old style signature\n");
|
log_info(_("old style (PGP 2.x) signature\n"));
|
||||||
|
|
||||||
check_sig_and_print( c, node );
|
check_sig_and_print( c, node );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_error("proc_tree: invalid root packet\n");
|
log_error(_("invalid root packet detected in proc_tree()\n"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
||||||
const char *g10m_revision_string(int);
|
const char *g10m_revision_string(int);
|
||||||
@ -84,9 +85,9 @@ disable_core_dumps()
|
|||||||
limit.rlim_cur = 0;
|
limit.rlim_cur = 0;
|
||||||
limit.rlim_max = 0;
|
limit.rlim_max = 0;
|
||||||
if( setrlimit( RLIMIT_CORE, &limit ) )
|
if( setrlimit( RLIMIT_CORE, &limit ) )
|
||||||
log_fatal("can't disable core dumps: %s\n", strerror(errno) );
|
log_fatal(_("can't disable core dumps: %s\n"), strerror(errno) );
|
||||||
#else
|
#else
|
||||||
log_info("WARNING: Program may create a core file!\n");
|
log_info(_("WARNING: Program may create a core file!\n"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,3 +35,9 @@ force-v3-sigs
|
|||||||
|
|
||||||
compress-algo 1
|
compress-algo 1
|
||||||
|
|
||||||
|
# If you do not use the Latin-1 (ISO-8859-1) charset, you should
|
||||||
|
# tell GnuPG which is the native character set. Please check
|
||||||
|
# the man page for supported character sets.
|
||||||
|
#charset koi8-r
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
static int mpi_print_mode = 0;
|
static int mpi_print_mode = 0;
|
||||||
static int list_mode = 0;
|
static int list_mode = 0;
|
||||||
@ -105,7 +106,7 @@ unknown_pubkey_warning( int algo )
|
|||||||
algo &= 0xff;
|
algo &= 0xff;
|
||||||
if( !unknown_pubkey_algos[algo] ) {
|
if( !unknown_pubkey_algos[algo] ) {
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("can't handle public key algorithm %d\n", algo );
|
log_info(_("can't handle public key algorithm %d\n"), algo );
|
||||||
unknown_pubkey_algos[algo] = 1;
|
unknown_pubkey_algos[algo] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,11 +171,11 @@ passphrase_to_dek( u32 *keyid, int cipher_algo, STRING2KEY *s2k, int mode )
|
|||||||
else if( opt.batch )
|
else if( opt.batch )
|
||||||
log_fatal("Can't query password in batchmode\n");
|
log_fatal("Can't query password in batchmode\n");
|
||||||
else {
|
else {
|
||||||
pw = cpr_get_hidden(N_("passphrase.enter"), _("Enter pass phrase: ") );
|
pw = cpr_get_hidden(N_("passphrase.enter"), _("Enter passphrase: ") );
|
||||||
tty_kill_prompt();
|
tty_kill_prompt();
|
||||||
if( mode == 2 && !cpr_enabled() ) {
|
if( mode == 2 && !cpr_enabled() ) {
|
||||||
char *pw2 = cpr_get_hidden(N_("passphrase.repeat"),
|
char *pw2 = cpr_get_hidden(N_("passphrase.repeat"),
|
||||||
_("Repeat pass phrase: ") );
|
_("Repeat passphrase: ") );
|
||||||
tty_kill_prompt();
|
tty_kill_prompt();
|
||||||
if( strcmp(pw, pw2) ) {
|
if( strcmp(pw, pw2) ) {
|
||||||
m_free(pw2);
|
m_free(pw2);
|
||||||
|
@ -180,7 +180,7 @@ do_we_trust( PKT_public_key *pk, int trustlevel )
|
|||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if( (trustlevel & TRUST_FLAG_REVOKED) ) {
|
if( (trustlevel & TRUST_FLAG_REVOKED) ) {
|
||||||
log_info("%08lX: key has been revoked!\n",
|
log_info(_("key %08lX: key has been revoked!\n"),
|
||||||
(ulong)keyid_from_pk( pk, NULL) );
|
(ulong)keyid_from_pk( pk, NULL) );
|
||||||
if( opt.batch )
|
if( opt.batch )
|
||||||
return 0;
|
return 0;
|
||||||
@ -208,12 +208,13 @@ do_we_trust( PKT_public_key *pk, int trustlevel )
|
|||||||
return do_we_trust( pk, trustlevel );
|
return do_we_trust( pk, trustlevel );
|
||||||
|
|
||||||
case TRUST_EXPIRED:
|
case TRUST_EXPIRED:
|
||||||
log_info("%08lX: key has expired\n", (ulong)keyid_from_pk( pk, NULL) );
|
log_info(_("%08lX: key has expired\n"),
|
||||||
|
(ulong)keyid_from_pk( pk, NULL) );
|
||||||
return 0; /* no */
|
return 0; /* no */
|
||||||
|
|
||||||
case TRUST_UNDEFINED:
|
case TRUST_UNDEFINED:
|
||||||
if( opt.batch || opt.answer_no )
|
if( opt.batch || opt.answer_no )
|
||||||
log_info("%08lX: no info to calculate a trust probability\n",
|
log_info(_("%08lX: no info to calculate a trust probability\n"),
|
||||||
(ulong)keyid_from_pk( pk, NULL) );
|
(ulong)keyid_from_pk( pk, NULL) );
|
||||||
else {
|
else {
|
||||||
rc = add_ownertrust( pk );
|
rc = add_ownertrust( pk );
|
||||||
@ -229,24 +230,24 @@ do_we_trust( PKT_public_key *pk, int trustlevel )
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case TRUST_NEVER:
|
case TRUST_NEVER:
|
||||||
log_info("%08lX: We do NOT trust this key\n",
|
log_info(_("%08lX: We do NOT trust this key\n"),
|
||||||
(ulong)keyid_from_pk( pk, NULL) );
|
(ulong)keyid_from_pk( pk, NULL) );
|
||||||
return 0; /* no */
|
return 0; /* no */
|
||||||
|
|
||||||
case TRUST_MARGINAL:
|
case TRUST_MARGINAL:
|
||||||
log_info("%08lX: I'm not sure whether this key really belongs to the owner\n"
|
log_info(
|
||||||
"but I proceed anyway\n",
|
_("%08lX: It is not sure taht this key really belongs to the owner\n"
|
||||||
(ulong)keyid_from_pk( pk, NULL) );
|
"but it is accepted anyway\n"), (ulong)keyid_from_pk( pk, NULL) );
|
||||||
return 1; /* yes */
|
return 1; /* yes */
|
||||||
|
|
||||||
case TRUST_FULLY:
|
case TRUST_FULLY:
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("This key probably belongs to the owner\n");
|
log_info(_("This key probably belongs to the owner\n"));
|
||||||
return 1; /* yes */
|
return 1; /* yes */
|
||||||
|
|
||||||
case TRUST_ULTIMATE:
|
case TRUST_ULTIMATE:
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("This key belongs to us (we have the secret key)\n");
|
log_info(_("This key belongs to us (we have the secret key)\n"));
|
||||||
return 1; /* yes */
|
return 1; /* yes */
|
||||||
|
|
||||||
default: BUG();
|
default: BUG();
|
||||||
@ -422,8 +423,8 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned usage )
|
|||||||
for(;;) {
|
for(;;) {
|
||||||
rc = 0;
|
rc = 0;
|
||||||
m_free(answer);
|
m_free(answer);
|
||||||
answer = cpr_get(N_("pklist.user_id.enter"),
|
answer = cpr_get_utf8(N_("pklist.user_id.enter"),
|
||||||
_("Enter the user ID: "));
|
_("Enter the user ID: "));
|
||||||
trim_spaces(answer);
|
trim_spaces(answer);
|
||||||
cpr_kill_prompt();
|
cpr_kill_prompt();
|
||||||
if( !*answer )
|
if( !*answer )
|
||||||
|
@ -233,7 +233,7 @@ ask_for_detached_datafile( md_filter_context_t *mfx, const char *inname )
|
|||||||
|
|
||||||
if( !fp ) {
|
if( !fp ) {
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("reading stdin ...\n");
|
log_info(_("reading stdin ...\n"));
|
||||||
while( (c = getchar()) != EOF ) {
|
while( (c = getchar()) != EOF ) {
|
||||||
if( mfx->md )
|
if( mfx->md )
|
||||||
md_putc(mfx->md, c );
|
md_putc(mfx->md, c );
|
||||||
|
@ -81,7 +81,7 @@ get_session_key( PKT_pubkey_enc *k, DEK *dek )
|
|||||||
if( !rc )
|
if( !rc )
|
||||||
rc = get_it( k, dek, sk, keyid );
|
rc = get_it( k, dek, sk, keyid );
|
||||||
if( !rc ) {
|
if( !rc ) {
|
||||||
log_info( _("okay, we are the anonymous receiver.\n") );
|
log_info(_("okay, we are the anonymous receiver.\n") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ get_it( PKT_pubkey_enc *k, DEK *dek, PKT_secret_key *sk, u32 *keyid )
|
|||||||
if( n + 7 > nframe )
|
if( n + 7 > nframe )
|
||||||
{ rc = G10ERR_WRONG_SECKEY; goto leave; }
|
{ rc = G10ERR_WRONG_SECKEY; goto leave; }
|
||||||
if( frame[n] == 1 && frame[nframe-1] == 2 ) {
|
if( frame[n] == 1 && frame[nframe-1] == 2 ) {
|
||||||
log_info("old encoding of DEK is not supported\n");
|
log_info(_("old encoding of the DEK is not supported\n"));
|
||||||
rc = G10ERR_CIPHER_ALGO;
|
rc = G10ERR_CIPHER_ALGO;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ get_it( PKT_pubkey_enc *k, DEK *dek, PKT_secret_key *sk, u32 *keyid )
|
|||||||
log_error("can't check algorithm against preferences\n");
|
log_error("can't check algorithm against preferences\n");
|
||||||
else if( dek->algo != CIPHER_ALGO_3DES
|
else if( dek->algo != CIPHER_ALGO_3DES
|
||||||
&& !is_algo_in_prefs( pk->local_id, PREFTYPE_SYM, dek->algo ) )
|
&& !is_algo_in_prefs( pk->local_id, PREFTYPE_SYM, dek->algo ) )
|
||||||
log_info(_("note: cipher algorithm %d not found in preferences\n"),
|
log_info(_("NOTE: cipher algorithm %d not found in preferences\n"),
|
||||||
dek->algo );
|
dek->algo );
|
||||||
free_public_key( pk );
|
free_public_key( pk );
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
@ -129,7 +129,7 @@ gen_revoke( const char *uname )
|
|||||||
rc = G10ERR_PUBKEY_ALGO;
|
rc = G10ERR_PUBKEY_ALGO;
|
||||||
break;
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
tty_printf(_("note: This key is not protected!\n"));
|
tty_printf(_("NOTE: This key is not protected!\n"));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
rc = check_secret_key( sk, 0 );
|
rc = check_secret_key( sk, 0 );
|
||||||
|
@ -274,12 +274,13 @@ add_keyblock_resource( const char *url, int force, int secret )
|
|||||||
|
|
||||||
iobuf = iobuf_create( filename );
|
iobuf = iobuf_create( filename );
|
||||||
if( !iobuf ) {
|
if( !iobuf ) {
|
||||||
log_error("%s: can't create keyring: %s\n", filename, strerror(errno));
|
log_error(_("%s: can't create keyring: %s\n"),
|
||||||
|
filename, strerror(errno));
|
||||||
rc = G10ERR_OPEN_FILE;
|
rc = G10ERR_OPEN_FILE;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_info("%s: keyring created\n", filename );
|
log_info(_("%s: keyring created\n"), filename );
|
||||||
}
|
}
|
||||||
#ifdef __MINGW32__
|
#ifdef __MINGW32__
|
||||||
/* must close it again */
|
/* must close it again */
|
||||||
@ -512,10 +513,12 @@ locate_keyblock_by_fpr( KBPOS *kbpos, const byte *fpr, int fprlen, int secret )
|
|||||||
if( rentry->used && !rentry->secret == !secret ) {
|
if( rentry->used && !rentry->secret == !secret ) {
|
||||||
kbpos->rt = rentry->rt;
|
kbpos->rt = rentry->rt;
|
||||||
switch( rentry->rt ) {
|
switch( rentry->rt ) {
|
||||||
|
#ifdef HAVE_LIBGDBM
|
||||||
case rt_GDBM:
|
case rt_GDBM:
|
||||||
any = 1;
|
any = 1;
|
||||||
rc = do_gdbm_locate( rentry->dbf, kbpos, fpr, fprlen );
|
rc = do_gdbm_locate( rentry->dbf, kbpos, fpr, fprlen );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
rc = G10ERR_UNSUPPORTED;
|
rc = G10ERR_UNSUPPORTED;
|
||||||
break;
|
break;
|
||||||
@ -551,10 +554,12 @@ locate_keyblock_by_keyid( KBPOS *kbpos, u32 *keyid, int shortkid, int secret )
|
|||||||
if( rentry->used && !rentry->secret == !secret ) {
|
if( rentry->used && !rentry->secret == !secret ) {
|
||||||
kbpos->rt = rentry->rt;
|
kbpos->rt = rentry->rt;
|
||||||
switch( rentry->rt ) {
|
switch( rentry->rt ) {
|
||||||
|
#ifdef HAVE_LIBGDBM
|
||||||
case rt_GDBM:
|
case rt_GDBM:
|
||||||
any = 1;
|
any = 1;
|
||||||
rc = do_gdbm_locate_by_keyid( rentry->dbf, kbpos, keyid );
|
rc = do_gdbm_locate_by_keyid( rentry->dbf, kbpos, keyid );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
rc = G10ERR_UNSUPPORTED;
|
rc = G10ERR_UNSUPPORTED;
|
||||||
break;
|
break;
|
||||||
@ -1049,8 +1054,6 @@ keyring_enum( KBPOS *kbpos, KBNODE *ret_root, int skipsigs )
|
|||||||
* a start packet; issue a warning if it is not a comment */
|
* a start packet; issue a warning if it is not a comment */
|
||||||
if( !root && pkt->pkttype != PKT_COMMENT
|
if( !root && pkt->pkttype != PKT_COMMENT
|
||||||
&& pkt->pkttype != PKT_OLD_COMMENT ) {
|
&& pkt->pkttype != PKT_OLD_COMMENT ) {
|
||||||
log_info("keyring_enum: skipped packet of type %d\n",
|
|
||||||
pkt->pkttype );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if( !root || (skipsigs && ( pkt->pkttype == PKT_SIGNATURE
|
if( !root || (skipsigs && ( pkt->pkttype == PKT_SIGNATURE
|
||||||
@ -1108,11 +1111,11 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root )
|
|||||||
/* insert: create a new file */
|
/* insert: create a new file */
|
||||||
newfp = iobuf_create( rentry->fname );
|
newfp = iobuf_create( rentry->fname );
|
||||||
if( !newfp ) {
|
if( !newfp ) {
|
||||||
log_error("%s: can't create: %s\n", rentry->fname, strerror(errno));
|
log_error(_("%s: can't create: %s\n"), rentry->fname, strerror(errno));
|
||||||
return G10ERR_OPEN_FILE;
|
return G10ERR_OPEN_FILE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log_info("%s: keyring created\n", rentry->fname );
|
log_info(_("%s: keyring created\n"), rentry->fname );
|
||||||
|
|
||||||
kbctx=NULL;
|
kbctx=NULL;
|
||||||
while( (node = walk_kbnode( root, &kbctx, 0 )) ) {
|
while( (node = walk_kbnode( root, &kbctx, 0 )) ) {
|
||||||
@ -1285,7 +1288,7 @@ keyring_copy( KBPOS *kbpos, int mode, KBNODE root )
|
|||||||
rc = G10ERR_RENAME_FILE;
|
rc = G10ERR_RENAME_FILE;
|
||||||
if( rentry->secret ) {
|
if( rentry->secret ) {
|
||||||
log_info(_(
|
log_info(_(
|
||||||
"Warning: 2 files with confidential information exists.\n"));
|
"WARNING: 2 files with confidential information exists.\n"));
|
||||||
log_info(_("%s is the unchanged one\n"), rentry->fname );
|
log_info(_("%s is the unchanged one\n"), rentry->fname );
|
||||||
log_info(_("%s is the new one\n"), tmpfname );
|
log_info(_("%s is the new one\n"), tmpfname );
|
||||||
log_info(_("Please fix this possible security flaw\n"));
|
log_info(_("Please fix this possible security flaw\n"));
|
||||||
@ -1469,7 +1472,7 @@ do_gdbm_locate_by_keyid( GDBM_FILE dbf, KBPOS *kbpos, u32 *keyid )
|
|||||||
return G10ERR_INV_KEYRING;
|
return G10ERR_INV_KEYRING;
|
||||||
}
|
}
|
||||||
if( content.dsize > 21 )
|
if( content.dsize > 21 )
|
||||||
log_info("gdbm_fetch: warning: more than one fingerprint\n" );
|
log_info("gdbm_fetch: WARNING: more than one fingerprint\n" );
|
||||||
|
|
||||||
rc = do_gdbm_locate( dbf, kbpos, content.dptr+1, 20 );
|
rc = do_gdbm_locate( dbf, kbpos, content.dptr+1, 20 );
|
||||||
free( content.dptr ); /* can't use m_free() here */
|
free( content.dptr ); /* can't use m_free() here */
|
||||||
|
@ -212,7 +212,7 @@ protect_secret_key( PKT_secret_key *sk, DEK *dek )
|
|||||||
cipher_hd = cipher_open( sk->protect.algo,
|
cipher_hd = cipher_open( sk->protect.algo,
|
||||||
CIPHER_MODE_AUTO_CFB, 1 );
|
CIPHER_MODE_AUTO_CFB, 1 );
|
||||||
if( cipher_setkey( cipher_hd, dek->key, dek->keylen ) )
|
if( cipher_setkey( cipher_hd, dek->key, dek->keylen ) )
|
||||||
log_info(_("Warning: Weak key detected"
|
log_info(_("WARNING: Weak key detected"
|
||||||
" - please change passphrase again.\n"));
|
" - please change passphrase again.\n"));
|
||||||
cipher_setiv( cipher_hd, NULL );
|
cipher_setiv( cipher_hd, NULL );
|
||||||
cipher_encrypt( cipher_hd, sk->protect.iv, sk->protect.iv, 8 );
|
cipher_encrypt( cipher_hd, sk->protect.iv, sk->protect.iv, 8 );
|
||||||
|
@ -167,7 +167,7 @@ do_check( PKT_public_key *pk, PKT_signature *sig, MD_HANDLE digest )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( pk->expiredate && pk->expiredate < cur_time ) {
|
if( pk->expiredate && pk->expiredate < cur_time ) {
|
||||||
log_info(_("warning: signature key expired %s\n"),
|
log_info(_("NOTE: signature key expired %s\n"),
|
||||||
asctimestamp( pk->expiredate ) );
|
asctimestamp( pk->expiredate ) );
|
||||||
write_status(STATUS_SIGEXPIRED);
|
write_status(STATUS_SIGEXPIRED);
|
||||||
}
|
}
|
||||||
|
19
g10/sign.c
19
g10/sign.c
@ -62,11 +62,11 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
|
|||||||
rc = pubkey_sign( sk->pubkey_algo, sig->data, frame, sk->skey );
|
rc = pubkey_sign( sk->pubkey_algo, sig->data, frame, sk->skey );
|
||||||
mpi_free(frame);
|
mpi_free(frame);
|
||||||
if( rc )
|
if( rc )
|
||||||
log_error("pubkey_sign failed: %s\n", g10_errstr(rc) );
|
log_error(_("signing failed: %s\n"), g10_errstr(rc) );
|
||||||
else {
|
else {
|
||||||
if( opt.verbose ) {
|
if( opt.verbose ) {
|
||||||
char *ustr = get_user_id_string( sig->keyid );
|
char *ustr = get_user_id_string( sig->keyid );
|
||||||
log_info("%s signature from: %s\n",
|
log_info(_("%s signature from: %s\n"),
|
||||||
pubkey_algo_to_string(sk->pubkey_algo), ustr );
|
pubkey_algo_to_string(sk->pubkey_algo), ustr );
|
||||||
m_free(ustr);
|
m_free(ustr);
|
||||||
}
|
}
|
||||||
@ -197,12 +197,12 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
|
|||||||
|
|
||||||
if( outfile ) {
|
if( outfile ) {
|
||||||
if( !(out = iobuf_create( outfile )) ) {
|
if( !(out = iobuf_create( outfile )) ) {
|
||||||
log_error("can't create %s: %s\n", outfile, strerror(errno) );
|
log_error(_("can't create %s: %s\n"), outfile, strerror(errno) );
|
||||||
rc = G10ERR_CREATE_FILE;
|
rc = G10ERR_CREATE_FILE;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else if( opt.verbose )
|
else if( opt.verbose )
|
||||||
log_info("writing to '%s'\n", outfile );
|
log_info(_("writing to '%s'\n"), outfile );
|
||||||
}
|
}
|
||||||
else if( (rc = open_outfile( fname, opt.armor? 1: detached? 2:0, &out )))
|
else if( (rc = open_outfile( fname, opt.armor? 1: detached? 2:0, &out )))
|
||||||
goto leave;
|
goto leave;
|
||||||
@ -293,12 +293,13 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
|
|||||||
STRLIST sl;
|
STRLIST sl;
|
||||||
|
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("signing:" );
|
log_info(_("signing:") );
|
||||||
/* must walk reverse trough this list */
|
/* must walk reverse trough this list */
|
||||||
for( sl = strlist_last(filenames); sl;
|
for( sl = strlist_last(filenames); sl;
|
||||||
sl = strlist_prev( filenames, sl ) ) {
|
sl = strlist_prev( filenames, sl ) ) {
|
||||||
if( !(inp = iobuf_open(sl->d)) ) {
|
if( !(inp = iobuf_open(sl->d)) ) {
|
||||||
log_error("can't open %s: %s\n", sl->d, strerror(errno) );
|
log_error(_("can't open %s: %s\n"),
|
||||||
|
sl->d, strerror(errno) );
|
||||||
rc = G10ERR_OPEN_FILE;
|
rc = G10ERR_OPEN_FILE;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -332,7 +333,7 @@ sign_file( STRLIST filenames, int detached, STRLIST locusr,
|
|||||||
}
|
}
|
||||||
if( fname ) {
|
if( fname ) {
|
||||||
if( !(filesize = iobuf_get_filelength(inp)) )
|
if( !(filesize = iobuf_get_filelength(inp)) )
|
||||||
log_info("warning: '%s' is an empty file\n", fname );
|
log_info(_("WARNING: '%s' is an empty file\n"), fname );
|
||||||
|
|
||||||
/* because the text_filter modifies the length of the
|
/* because the text_filter modifies the length of the
|
||||||
* data, it is not possible to know the used length
|
* data, it is not possible to know the used length
|
||||||
@ -538,12 +539,12 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
|
|||||||
|
|
||||||
if( outfile ) {
|
if( outfile ) {
|
||||||
if( !(out = iobuf_create( outfile )) ) {
|
if( !(out = iobuf_create( outfile )) ) {
|
||||||
log_error("can't create %s: %s\n", outfile, strerror(errno) );
|
log_error(_("can't create %s: %s\n"), outfile, strerror(errno) );
|
||||||
rc = G10ERR_CREATE_FILE;
|
rc = G10ERR_CREATE_FILE;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
else if( opt.verbose )
|
else if( opt.verbose )
|
||||||
log_info("writing to '%s'\n", outfile );
|
log_info(_("writing to '%s'\n"), outfile );
|
||||||
}
|
}
|
||||||
else if( (rc = open_outfile( fname, 1, &out )) )
|
else if( (rc = open_outfile( fname, 1, &out )) )
|
||||||
goto leave;
|
goto leave;
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "keydb.h"
|
#include "keydb.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "i18n.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -90,14 +91,14 @@ build_sk_list( STRLIST locusr, SK_LIST *ret_sk_list, int unlock,
|
|||||||
sk->pubkey_usage = usage;
|
sk->pubkey_usage = usage;
|
||||||
if( (rc = get_seckey_byname( sk, locusr->d, unlock )) ) {
|
if( (rc = get_seckey_byname( sk, locusr->d, unlock )) ) {
|
||||||
free_secret_key( sk ); sk = NULL;
|
free_secret_key( sk ); sk = NULL;
|
||||||
log_error("skipped '%s': %s\n", locusr->d, g10_errstr(rc) );
|
log_error(_("skipped '%s': %s\n"), locusr->d, g10_errstr(rc) );
|
||||||
}
|
}
|
||||||
else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, usage)) ) {
|
else if( !(rc=check_pubkey_algo2(sk->pubkey_algo, usage)) ) {
|
||||||
SK_LIST r;
|
SK_LIST r;
|
||||||
if( sk->version == 4 && (usage & PUBKEY_USAGE_SIG)
|
if( sk->version == 4 && (usage & PUBKEY_USAGE_SIG)
|
||||||
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
&& sk->pubkey_algo == PUBKEY_ALGO_ELGAMAL_E ) {
|
||||||
log_info("skipped '%s': this is a PGP generated "
|
log_info(_("skipped '%s': this is a PGP generated "
|
||||||
"ElGamal key which is not secure for signatures!\n",
|
"ElGamal key which is not secure for signatures!\n"),
|
||||||
locusr->d );
|
locusr->d );
|
||||||
free_secret_key( sk ); sk = NULL;
|
free_secret_key( sk ); sk = NULL;
|
||||||
}
|
}
|
||||||
|
15
g10/status.c
15
g10/status.c
@ -142,7 +142,7 @@ init_shm_coprocessing ( ulong requested_shm_size, int lock_mem )
|
|||||||
if ( shm_area == (char*)-1 )
|
if ( shm_area == (char*)-1 )
|
||||||
log_fatal("can't attach %uk shared memory: %s\n",
|
log_fatal("can't attach %uk shared memory: %s\n",
|
||||||
(unsigned)shm_size/1024, strerror(errno));
|
(unsigned)shm_size/1024, strerror(errno));
|
||||||
log_info("mapped %uk shared memory at %p, id=%d\n",
|
log_debug("mapped %uk shared memory at %p, id=%d\n",
|
||||||
(unsigned)shm_size/1024, shm_area, shm_id );
|
(unsigned)shm_size/1024, shm_area, shm_id );
|
||||||
if( lock_mem ) {
|
if( lock_mem ) {
|
||||||
#ifdef IPC_HAVE_SHM_LOCK
|
#ifdef IPC_HAVE_SHM_LOCK
|
||||||
@ -292,6 +292,19 @@ cpr_get( const char *keyword, const char *prompt )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
cpr_get_utf8( const char *keyword, const char *prompt )
|
||||||
|
{
|
||||||
|
char *p;
|
||||||
|
p = cpr_get( keyword, prompt );
|
||||||
|
if( p ) {
|
||||||
|
char *utf8 = native_to_utf8( p );
|
||||||
|
m_free( p );
|
||||||
|
p = utf8;
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
cpr_get_hidden( const char *keyword, const char *prompt )
|
cpr_get_hidden( const char *keyword, const char *prompt )
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,7 @@ void write_status_text ( int no, const char *text );
|
|||||||
|
|
||||||
int cpr_enabled(void);
|
int cpr_enabled(void);
|
||||||
char *cpr_get( const char *keyword, const char *prompt );
|
char *cpr_get( const char *keyword, const char *prompt );
|
||||||
|
char *cpr_get_utf8( const char *keyword, const char *prompt );
|
||||||
char *cpr_get_hidden( const char *keyword, const char *prompt );
|
char *cpr_get_hidden( const char *keyword, const char *prompt );
|
||||||
void cpr_kill_prompt(void);
|
void cpr_kill_prompt(void);
|
||||||
int cpr_get_answer_is_yes( const char *keyword, const char *prompt );
|
int cpr_get_answer_is_yes( const char *keyword, const char *prompt );
|
||||||
|
@ -215,8 +215,8 @@ put_record_into_cache( ulong recno, const char *data )
|
|||||||
/* but we can't do this while in a transaction
|
/* but we can't do this while in a transaction
|
||||||
* we increase the cache size instead */
|
* we increase the cache size instead */
|
||||||
if( cache_entries < MAX_CACHE_ENTRIES_HARD ) { /* no */
|
if( cache_entries < MAX_CACHE_ENTRIES_HARD ) { /* no */
|
||||||
if( !(cache_entries % 100) )
|
if( opt.debug && !(cache_entries % 100) )
|
||||||
log_info("increasing tdbio cache size\n");
|
log_debug("increasing tdbio cache size\n");
|
||||||
r = m_alloc( sizeof *r );
|
r = m_alloc( sizeof *r );
|
||||||
r->flags.used = 1;
|
r->flags.used = 1;
|
||||||
r->recno = recno;
|
r->recno = recno;
|
||||||
@ -228,7 +228,7 @@ put_record_into_cache( ulong recno, const char *data )
|
|||||||
cache_entries++;
|
cache_entries++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
log_info("hard cache size limit reached\n");
|
log_info(_("trustdb transaction to large\n"));
|
||||||
return G10ERR_RESOURCE_LIMIT;
|
return G10ERR_RESOURCE_LIMIT;
|
||||||
}
|
}
|
||||||
if( dirty_count ) {
|
if( dirty_count ) {
|
||||||
|
204
g10/trustdb.c
204
g10/trustdb.c
@ -42,6 +42,7 @@
|
|||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
#include "tdbio.h"
|
#include "tdbio.h"
|
||||||
|
|
||||||
|
#define MAX_CERT_DEPTH 5
|
||||||
|
|
||||||
#if MAX_FINGERPRINT_LEN > 20
|
#if MAX_FINGERPRINT_LEN > 20
|
||||||
#error Must change structure of trustdb
|
#error Must change structure of trustdb
|
||||||
@ -139,7 +140,7 @@ read_record( ulong recno, TRUSTREC *rec, int rectype )
|
|||||||
int rc = tdbio_read_record( recno, rec, rectype );
|
int rc = tdbio_read_record( recno, rec, rectype );
|
||||||
if( !rc )
|
if( !rc )
|
||||||
return;
|
return;
|
||||||
log_error("trust record %lu, req type %d: read failed: %s\n",
|
log_error(_("trust record %lu, req type %d: read failed: %s\n"),
|
||||||
recno, rectype, g10_errstr(rc) );
|
recno, rectype, g10_errstr(rc) );
|
||||||
die_invalid_db();
|
die_invalid_db();
|
||||||
}
|
}
|
||||||
@ -154,7 +155,7 @@ write_record( TRUSTREC *rec )
|
|||||||
int rc = tdbio_write_record( rec );
|
int rc = tdbio_write_record( rec );
|
||||||
if( !rc )
|
if( !rc )
|
||||||
return;
|
return;
|
||||||
log_error("trust record %lu, type %d: write failed: %s\n",
|
log_error(_("trust record %lu, type %d: write failed: %s\n"),
|
||||||
rec->recnum, rec->rectype, g10_errstr(rc) );
|
rec->recnum, rec->rectype, g10_errstr(rc) );
|
||||||
die_invalid_db();
|
die_invalid_db();
|
||||||
}
|
}
|
||||||
@ -168,7 +169,7 @@ delete_record( ulong recno )
|
|||||||
int rc = tdbio_delete_record( recno );
|
int rc = tdbio_delete_record( recno );
|
||||||
if( !rc )
|
if( !rc )
|
||||||
return;
|
return;
|
||||||
log_error("trust record %lu: delete failed: %s\n",
|
log_error(_("trust record %lu: delete failed: %s\n"),
|
||||||
recno, g10_errstr(rc) );
|
recno, g10_errstr(rc) );
|
||||||
die_invalid_db();
|
die_invalid_db();
|
||||||
}
|
}
|
||||||
@ -182,7 +183,7 @@ do_sync( )
|
|||||||
int rc = tdbio_sync();
|
int rc = tdbio_sync();
|
||||||
if( !rc )
|
if( !rc )
|
||||||
return;
|
return;
|
||||||
log_error("trust db: sync failed: %s\n", g10_errstr(rc) );
|
log_error(_("trust db: sync failed: %s\n"), g10_errstr(rc) );
|
||||||
g10_exit(2);
|
g10_exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +238,7 @@ new_lid_table(void)
|
|||||||
a = unused_lid_tables;
|
a = unused_lid_tables;
|
||||||
if( a ) {
|
if( a ) {
|
||||||
unused_lid_tables = a->next;
|
unused_lid_tables = a->next;
|
||||||
a->next = NULL;
|
memset( a, 0, sizeof *a );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
a = m_alloc_clear( sizeof *a );
|
a = m_alloc_clear( sizeof *a );
|
||||||
@ -311,24 +312,24 @@ keyid_from_lid( ulong lid, u32 *keyid )
|
|||||||
|
|
||||||
rc = tdbio_read_record( lid, &rec, 0 );
|
rc = tdbio_read_record( lid, &rec, 0 );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("error reading dir record for LID %lu: %s\n",
|
log_error(_("error reading dir record for LID %lu: %s\n"),
|
||||||
lid, g10_errstr(rc));
|
lid, g10_errstr(rc));
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
if( rec.rectype == RECTYPE_SDIR )
|
if( rec.rectype == RECTYPE_SDIR )
|
||||||
return 0;
|
return 0;
|
||||||
if( rec.rectype != RECTYPE_DIR ) {
|
if( rec.rectype != RECTYPE_DIR ) {
|
||||||
log_error("lid %lu: expected dir record, got type %d\n",
|
log_error(_("lid %lu: expected dir record, got type %d\n"),
|
||||||
lid, rec.rectype );
|
lid, rec.rectype );
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
if( !rec.r.dir.keylist ) {
|
if( !rec.r.dir.keylist ) {
|
||||||
log_error("no primary key for LID %lu\n", lid );
|
log_error(_("no primary key for LID %lu\n"), lid );
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
rc = tdbio_read_record( rec.r.dir.keylist, &rec, RECTYPE_KEY );
|
rc = tdbio_read_record( rec.r.dir.keylist, &rec, RECTYPE_KEY );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("error reading primary key for LID %lu: %s\n",
|
log_error(_("error reading primary key for LID %lu: %s\n"),
|
||||||
lid, g10_errstr(rc));
|
lid, g10_errstr(rc));
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
@ -444,7 +445,7 @@ verify_own_keys()
|
|||||||
log_debug("key %08lX: checking secret key\n", (ulong)keyid[1] );
|
log_debug("key %08lX: checking secret key\n", (ulong)keyid[1] );
|
||||||
|
|
||||||
if( is_secret_key_protected( sk ) < 1 )
|
if( is_secret_key_protected( sk ) < 1 )
|
||||||
log_info("note: secret key %08lX is NOT protected.\n",
|
log_info(_("NOTE: secret key %08lX is NOT protected.\n"),
|
||||||
(ulong)keyid[1] );
|
(ulong)keyid[1] );
|
||||||
|
|
||||||
/* see whether we can access the public key of this secret key */
|
/* see whether we can access the public key of this secret key */
|
||||||
@ -484,7 +485,7 @@ verify_own_keys()
|
|||||||
if( ins_lid_table_item( ultikey_table, pk->local_id, 0 ) )
|
if( ins_lid_table_item( ultikey_table, pk->local_id, 0 ) )
|
||||||
log_error(_("key %08lX: already in secret key table\n"),
|
log_error(_("key %08lX: already in secret key table\n"),
|
||||||
(ulong)keyid[1]);
|
(ulong)keyid[1]);
|
||||||
else if( opt.verbose )
|
else if( opt.verbose > 1 )
|
||||||
log_info(_("key %08lX: accepted as secret key.\n"),
|
log_info(_("key %08lX: accepted as secret key.\n"),
|
||||||
(ulong)keyid[1]);
|
(ulong)keyid[1]);
|
||||||
skip:
|
skip:
|
||||||
@ -492,7 +493,7 @@ verify_own_keys()
|
|||||||
release_public_key_parts( pk );
|
release_public_key_parts( pk );
|
||||||
}
|
}
|
||||||
if( rc != -1 )
|
if( rc != -1 )
|
||||||
log_error(_("enum_secret_keys failed: %s\n"), g10_errstr(rc) );
|
log_error(_("enumerate secret keys failed: %s\n"), g10_errstr(rc) );
|
||||||
else
|
else
|
||||||
rc = 0;
|
rc = 0;
|
||||||
|
|
||||||
@ -666,7 +667,8 @@ list_records( ulong lid )
|
|||||||
|
|
||||||
rc = tdbio_read_record( lid, &dr, RECTYPE_DIR );
|
rc = tdbio_read_record( lid, &dr, RECTYPE_DIR );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: read dir record failed: %s\n", lid, g10_errstr(rc));
|
log_error(_("lid %lu: read dir record failed: %s\n"),
|
||||||
|
lid, g10_errstr(rc));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
tdbio_dump_record( &dr, stdout );
|
tdbio_dump_record( &dr, stdout );
|
||||||
@ -674,7 +676,7 @@ list_records( ulong lid )
|
|||||||
for( recno=dr.r.dir.keylist; recno; recno = rec.r.key.next ) {
|
for( recno=dr.r.dir.keylist; recno; recno = rec.r.key.next ) {
|
||||||
rc = tdbio_read_record( recno, &rec, 0 );
|
rc = tdbio_read_record( recno, &rec, 0 );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: read key record failed: %s\n",
|
log_error(_("lid %lu: read key record failed: %s\n"),
|
||||||
lid, g10_errstr(rc));
|
lid, g10_errstr(rc));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -684,7 +686,7 @@ list_records( ulong lid )
|
|||||||
for( recno=dr.r.dir.uidlist; recno; recno = ur.r.uid.next ) {
|
for( recno=dr.r.dir.uidlist; recno; recno = ur.r.uid.next ) {
|
||||||
rc = tdbio_read_record( recno, &ur, RECTYPE_UID );
|
rc = tdbio_read_record( recno, &ur, RECTYPE_UID );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: read uid record failed: %s\n",
|
log_error(_("lid %lu: read uid record failed: %s\n"),
|
||||||
lid, g10_errstr(rc));
|
lid, g10_errstr(rc));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -693,7 +695,7 @@ list_records( ulong lid )
|
|||||||
for(recno=ur.r.uid.prefrec; recno; recno = rec.r.pref.next ) {
|
for(recno=ur.r.uid.prefrec; recno; recno = rec.r.pref.next ) {
|
||||||
rc = tdbio_read_record( recno, &rec, RECTYPE_PREF );
|
rc = tdbio_read_record( recno, &rec, RECTYPE_PREF );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: read pref record failed: %s\n",
|
log_error(_("lid %lu: read pref record failed: %s\n"),
|
||||||
lid, g10_errstr(rc));
|
lid, g10_errstr(rc));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -703,7 +705,7 @@ list_records( ulong lid )
|
|||||||
for(recno=ur.r.uid.siglist; recno; recno = rec.r.sig.next ) {
|
for(recno=ur.r.uid.siglist; recno; recno = rec.r.sig.next ) {
|
||||||
rc = tdbio_read_record( recno, &rec, RECTYPE_SIG );
|
rc = tdbio_read_record( recno, &rec, RECTYPE_SIG );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: read sig record failed: %s\n",
|
log_error(_("lid %lu: read sig record failed: %s\n"),
|
||||||
lid, g10_errstr(rc));
|
lid, g10_errstr(rc));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -893,15 +895,15 @@ static int
|
|||||||
do_check( TRUSTREC *dr, unsigned *trustlevel )
|
do_check( TRUSTREC *dr, unsigned *trustlevel )
|
||||||
{
|
{
|
||||||
if( !dr->r.dir.keylist ) {
|
if( !dr->r.dir.keylist ) {
|
||||||
log_error("Ooops, no keys\n");
|
log_error(_("Ooops, no keys\n"));
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
if( !dr->r.dir.uidlist ) {
|
if( !dr->r.dir.uidlist ) {
|
||||||
log_error("Ooops, no user ids\n");
|
log_error(_("Ooops, no user ids\n"));
|
||||||
return G10ERR_TRUSTDB;
|
return G10ERR_TRUSTDB;
|
||||||
}
|
}
|
||||||
|
|
||||||
*trustlevel = verify_key( 5, dr );
|
*trustlevel = verify_key( MAX_CERT_DEPTH, dr );
|
||||||
|
|
||||||
if( dr->r.dir.dirflags & DIRF_REVOKED )
|
if( dr->r.dir.dirflags & DIRF_REVOKED )
|
||||||
*trustlevel |= TRUST_FLAG_REVOKED;
|
*trustlevel |= TRUST_FLAG_REVOKED;
|
||||||
@ -955,25 +957,29 @@ list_trustdb( const char *username )
|
|||||||
ulong lid = atoi(username+1);
|
ulong lid = atoi(username+1);
|
||||||
|
|
||||||
if( (rc = list_records( lid)) )
|
if( (rc = list_records( lid)) )
|
||||||
log_error("user '%s' read problem: %s\n", username, g10_errstr(rc));
|
log_error(_("user '%s' read problem: %s\n"),
|
||||||
|
username, g10_errstr(rc));
|
||||||
else if( (rc = list_sigs( lid )) )
|
else if( (rc = list_sigs( lid )) )
|
||||||
log_error("user '%s' list problem: %s\n", username, g10_errstr(rc));
|
log_error(_("user '%s' list problem: %s\n"),
|
||||||
|
username, g10_errstr(rc));
|
||||||
}
|
}
|
||||||
else if( username ) {
|
else if( username ) {
|
||||||
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
|
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if( (rc = get_pubkey_byname( NULL, pk, username, NULL )) )
|
if( (rc = get_pubkey_byname( NULL, pk, username, NULL )) )
|
||||||
log_error("user '%s' not found: %s\n", username, g10_errstr(rc) );
|
log_error(_("user '%s' not found: %s\n"), username, g10_errstr(rc) );
|
||||||
else if( (rc=tdbio_search_dir_bypk( pk, &rec )) && rc != -1 )
|
else if( (rc=tdbio_search_dir_bypk( pk, &rec )) && rc != -1 )
|
||||||
log_error("problem finding '%s' in trustdb: %s\n",
|
log_error(_("problem finding '%s' in trustdb: %s\n"),
|
||||||
username, g10_errstr(rc));
|
username, g10_errstr(rc));
|
||||||
else if( rc == -1 )
|
else if( rc == -1 )
|
||||||
log_error("user '%s' not in trustdb\n", username);
|
log_error(_("user '%s' not in trustdb\n"), username);
|
||||||
else if( (rc = list_records( pk->local_id)) )
|
else if( (rc = list_records( pk->local_id)) )
|
||||||
log_error("user '%s' read problem: %s\n", username, g10_errstr(rc));
|
log_error(_("user '%s' read problem: %s\n"),
|
||||||
|
username, g10_errstr(rc));
|
||||||
else if( (rc = list_sigs( pk->local_id )) )
|
else if( (rc = list_sigs( pk->local_id )) )
|
||||||
log_error("user '%s' list problem: %s\n", username, g10_errstr(rc));
|
log_error(_("user '%s' list problem: %s\n"),
|
||||||
|
username, g10_errstr(rc));
|
||||||
free_public_key( pk );
|
free_public_key( pk );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1002,20 +1008,20 @@ export_ownertrust()
|
|||||||
byte *p;
|
byte *p;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
printf("# List of assigned trustvalues, created %s\n"
|
printf(_("# List of assigned trustvalues, created %s\n"
|
||||||
"# (Use \"gpgm --import-ownertrust\" to restore them)\n",
|
"# (Use \"gpgm --import-ownertrust\" to restore them)\n"),
|
||||||
asctimestamp( make_timestamp() ) );
|
asctimestamp( make_timestamp() ) );
|
||||||
for(recnum=0; !tdbio_read_record( recnum, &rec, 0); recnum++ ) {
|
for(recnum=0; !tdbio_read_record( recnum, &rec, 0); recnum++ ) {
|
||||||
if( rec.rectype == RECTYPE_DIR ) {
|
if( rec.rectype == RECTYPE_DIR ) {
|
||||||
if( !rec.r.dir.keylist ) {
|
if( !rec.r.dir.keylist ) {
|
||||||
log_error("Oops; directory record w/o primary key\n");
|
log_error(_("directory record w/o primary key\n"));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( !rec.r.dir.ownertrust )
|
if( !rec.r.dir.ownertrust )
|
||||||
continue;
|
continue;
|
||||||
rc = tdbio_read_record( rec.r.dir.keylist, &rec2, RECTYPE_KEY);
|
rc = tdbio_read_record( rec.r.dir.keylist, &rec2, RECTYPE_KEY);
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("error reading key record: %s\n", g10_errstr(rc));
|
log_error(_("error reading key record: %s\n"), g10_errstr(rc));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
p = rec2.r.key.fingerprint;
|
p = rec2.r.key.fingerprint;
|
||||||
@ -1055,7 +1061,7 @@ import_ownertrust( const char *fname )
|
|||||||
continue;
|
continue;
|
||||||
n = strlen(line);
|
n = strlen(line);
|
||||||
if( line[n-1] != '\n' ) {
|
if( line[n-1] != '\n' ) {
|
||||||
log_error_f(fname, "line to long\n" );
|
log_error_f(fname, _("line to long\n") );
|
||||||
/* ... or last line does not have a LF */
|
/* ... or last line does not have a LF */
|
||||||
break; /* can't continue */
|
break; /* can't continue */
|
||||||
}
|
}
|
||||||
@ -1063,16 +1069,16 @@ import_ownertrust( const char *fname )
|
|||||||
if( !isxdigit(*p) )
|
if( !isxdigit(*p) )
|
||||||
break;
|
break;
|
||||||
if( *p != ':' ) {
|
if( *p != ':' ) {
|
||||||
log_error_f(fname, "error: missing colon\n" );
|
log_error_f(fname, _("error: missing colon\n") );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fprlen = p - line;
|
fprlen = p - line;
|
||||||
if( fprlen != 32 && fprlen != 40 ) {
|
if( fprlen != 32 && fprlen != 40 ) {
|
||||||
log_error_f(fname, "error: invalid fingerprint\n" );
|
log_error_f(fname, _("error: invalid fingerprint\n") );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( sscanf(p, ":%u:", &otrust ) != 1 ) {
|
if( sscanf(p, ":%u:", &otrust ) != 1 ) {
|
||||||
log_error_f(fname, "error: no otrust value\n" );
|
log_error_f(fname, _("error: no ownertrust value\n") );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( !otrust )
|
if( !otrust )
|
||||||
@ -1086,10 +1092,10 @@ import_ownertrust( const char *fname )
|
|||||||
rc = tdbio_search_dir_byfpr( line, fprlen, 0, &rec );
|
rc = tdbio_search_dir_byfpr( line, fprlen, 0, &rec );
|
||||||
if( !rc ) { /* found: update */
|
if( !rc ) { /* found: update */
|
||||||
if( rec.r.dir.ownertrust )
|
if( rec.r.dir.ownertrust )
|
||||||
log_info("LID %lu: changing trust from %u to %u\n",
|
log_info(_("LID %lu: changing trust from %u to %u\n"),
|
||||||
rec.r.dir.lid, rec.r.dir.ownertrust, otrust );
|
rec.r.dir.lid, rec.r.dir.ownertrust, otrust );
|
||||||
else
|
else
|
||||||
log_info("LID %lu: setting trust to %u\n",
|
log_info(_("LID %lu: setting trust to %u\n"),
|
||||||
rec.r.dir.lid, otrust );
|
rec.r.dir.lid, otrust );
|
||||||
rec.r.dir.ownertrust = otrust;
|
rec.r.dir.ownertrust = otrust;
|
||||||
write_record( &rec );
|
write_record( &rec );
|
||||||
@ -1097,25 +1103,25 @@ import_ownertrust( const char *fname )
|
|||||||
else if( rc == -1 ) { /* not found; get the key from the ring */
|
else if( rc == -1 ) { /* not found; get the key from the ring */
|
||||||
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
|
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
|
||||||
|
|
||||||
log_info_f(fname, "key not in trustdb, searching ring.\n");
|
log_info_f(fname, _("key not in trustdb, searching ring.\n"));
|
||||||
rc = get_pubkey_byfprint( pk, line, fprlen );
|
rc = get_pubkey_byfprint( pk, line, fprlen );
|
||||||
if( rc )
|
if( rc )
|
||||||
log_info_f(fname, "key not in ring: %s\n", g10_errstr(rc));
|
log_info_f(fname, _("key not in ring: %s\n"), g10_errstr(rc));
|
||||||
else {
|
else {
|
||||||
rc = query_trust_record( pk ); /* only as assertion */
|
rc = query_trust_record( pk ); /* only as assertion */
|
||||||
if( rc != -1 )
|
if( rc != -1 )
|
||||||
log_error_f(fname, "Oops: key is now in trustdb???\n");
|
log_error_f(fname, _("Oops: key is now in trustdb???\n"));
|
||||||
else {
|
else {
|
||||||
rc = insert_trust_record( pk );
|
rc = insert_trust_record( pk );
|
||||||
if( !rc )
|
if( !rc )
|
||||||
goto repeat; /* update the ownertrust */
|
goto repeat; /* update the ownertrust */
|
||||||
log_error_f(fname, "insert trust record failed: %s\n",
|
log_error_f(fname, _("insert trust record failed: %s\n"),
|
||||||
g10_errstr(rc) );
|
g10_errstr(rc) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* error */
|
else /* error */
|
||||||
log_error_f(fname, "error finding dir record: %s\n",
|
log_error_f(fname, _("error finding dir record: %s\n"),
|
||||||
g10_errstr(rc));
|
g10_errstr(rc));
|
||||||
}
|
}
|
||||||
if( ferror(fp) )
|
if( ferror(fp) )
|
||||||
@ -1166,15 +1172,16 @@ list_trust_path( int max_depth, const char *username )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( (rc = get_pubkey_byname(NULL, pk, username, NULL )) )
|
if( (rc = get_pubkey_byname(NULL, pk, username, NULL )) )
|
||||||
log_error("user '%s' not found: %s\n", username, g10_errstr(rc) );
|
log_error(_("user '%s' not found: %s\n"), username, g10_errstr(rc) );
|
||||||
else if( (rc=tdbio_search_dir_bypk( pk, &rec )) && rc != -1 )
|
else if( (rc=tdbio_search_dir_bypk( pk, &rec )) && rc != -1 )
|
||||||
log_error("problem finding '%s' in trustdb: %s\n",
|
log_error(_("problem finding '%s' in trustdb: %s\n"),
|
||||||
username, g10_errstr(rc));
|
username, g10_errstr(rc));
|
||||||
else if( rc == -1 ) {
|
else if( rc == -1 ) {
|
||||||
log_info("user '%s' not in trustdb - inserting\n", username);
|
log_info(_("user '%s' not in trustdb - inserting\n"), username);
|
||||||
rc = insert_trust_record( pk );
|
rc = insert_trust_record( pk );
|
||||||
if( rc )
|
if( rc )
|
||||||
log_error("failed to put '%s' into trustdb: %s\n", username, g10_errstr(rc));
|
log_error(_("failed to put '%s' into trustdb: %s\n"),
|
||||||
|
username, g10_errstr(rc));
|
||||||
else {
|
else {
|
||||||
assert( pk->local_id );
|
assert( pk->local_id );
|
||||||
}
|
}
|
||||||
@ -1217,7 +1224,7 @@ check_trustdb( const char *username )
|
|||||||
if( !rc )
|
if( !rc )
|
||||||
rc = read_keyblock( &kbpos, &keyblock );
|
rc = read_keyblock( &kbpos, &keyblock );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("%s: keyblock read problem: %s\n",
|
log_error(_("%s: keyblock read problem: %s\n"),
|
||||||
username, g10_errstr(rc));
|
username, g10_errstr(rc));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1231,12 +1238,12 @@ check_trustdb( const char *username )
|
|||||||
|
|
||||||
}
|
}
|
||||||
if( rc )
|
if( rc )
|
||||||
log_error("%s: update failed: %s\n",
|
log_error(_("%s: update failed: %s\n"),
|
||||||
username, g10_errstr(rc) );
|
username, g10_errstr(rc) );
|
||||||
else if( modified )
|
else if( modified )
|
||||||
log_info("%s: updated\n", username );
|
log_info(_("%s: updated\n"), username );
|
||||||
else
|
else
|
||||||
log_info("%s: okay\n", username );
|
log_info(_("%s: okay\n"), username );
|
||||||
|
|
||||||
}
|
}
|
||||||
release_kbnode( keyblock ); keyblock = NULL;
|
release_kbnode( keyblock ); keyblock = NULL;
|
||||||
@ -1251,7 +1258,8 @@ check_trustdb( const char *username )
|
|||||||
int modified;
|
int modified;
|
||||||
|
|
||||||
if( !rec.r.dir.keylist ) {
|
if( !rec.r.dir.keylist ) {
|
||||||
log_info("lid %lu: dir record w/o key - skipped\n", recnum);
|
log_info(_("lid %lu: dir record w/o key - skipped\n"),
|
||||||
|
recnum);
|
||||||
count++;
|
count++;
|
||||||
skip_count++;
|
skip_count++;
|
||||||
continue;
|
continue;
|
||||||
@ -1263,7 +1271,7 @@ check_trustdb( const char *username )
|
|||||||
tmp.r.key.fingerprint,
|
tmp.r.key.fingerprint,
|
||||||
tmp.r.key.fingerprint_len );
|
tmp.r.key.fingerprint_len );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: keyblock not found: %s\n",
|
log_error(_("lid %lu: keyblock not found: %s\n"),
|
||||||
recnum, g10_errstr(rc) );
|
recnum, g10_errstr(rc) );
|
||||||
count++;
|
count++;
|
||||||
skip_count++;
|
skip_count++;
|
||||||
@ -1272,17 +1280,17 @@ check_trustdb( const char *username )
|
|||||||
|
|
||||||
rc = update_trust_record( keyblock, 0, &modified );
|
rc = update_trust_record( keyblock, 0, &modified );
|
||||||
if( rc ) {
|
if( rc ) {
|
||||||
log_error("lid %lu: update failed: %s\n",
|
log_error(_("lid %lu: update failed: %s\n"),
|
||||||
recnum, g10_errstr(rc) );
|
recnum, g10_errstr(rc) );
|
||||||
err_count++;
|
err_count++;
|
||||||
}
|
}
|
||||||
else if( modified ) {
|
else if( modified ) {
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("lid %lu: updated\n", recnum );
|
log_info(_("lid %lu: updated\n"), recnum );
|
||||||
upd_count++;
|
upd_count++;
|
||||||
}
|
}
|
||||||
else if( opt.verbose > 1 )
|
else if( opt.verbose > 1 )
|
||||||
log_info("lid %lu: okay\n", recnum );
|
log_info(_("lid %lu: okay\n"), recnum );
|
||||||
|
|
||||||
release_kbnode( keyblock ); keyblock = NULL;
|
release_kbnode( keyblock ); keyblock = NULL;
|
||||||
if( !(++count % 100) )
|
if( !(++count % 100) )
|
||||||
@ -1325,33 +1333,33 @@ update_trustdb( )
|
|||||||
) ->pkt->pkt.public_key;
|
) ->pkt->pkt.public_key;
|
||||||
rc = insert_trust_record( pk );
|
rc = insert_trust_record( pk );
|
||||||
if( rc && !pk->local_id ) {
|
if( rc && !pk->local_id ) {
|
||||||
log_error("lid ?: insert failed: %s\n",
|
log_error(_("lid ?: insert failed: %s\n"),
|
||||||
g10_errstr(rc) );
|
g10_errstr(rc) );
|
||||||
err_count++;
|
err_count++;
|
||||||
}
|
}
|
||||||
else if( rc ) {
|
else if( rc ) {
|
||||||
log_error("lid %lu: insert failed: %s\n",
|
log_error(_("lid %lu: insert failed: %s\n"),
|
||||||
pk->local_id, g10_errstr(rc) );
|
pk->local_id, g10_errstr(rc) );
|
||||||
err_count++;
|
err_count++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("lid %lu: inserted\n", pk->local_id );
|
log_info(_("lid %lu: inserted\n"), pk->local_id );
|
||||||
new_count++;
|
new_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( rc ) {
|
else if( rc ) {
|
||||||
log_error("lid %lu: update failed: %s\n",
|
log_error(_("lid %lu: update failed: %s\n"),
|
||||||
lid_from_keyblock(keyblock), g10_errstr(rc) );
|
lid_from_keyblock(keyblock), g10_errstr(rc) );
|
||||||
err_count++;
|
err_count++;
|
||||||
}
|
}
|
||||||
else if( modified ) {
|
else if( modified ) {
|
||||||
if( opt.verbose )
|
if( opt.verbose )
|
||||||
log_info("lid %lu: updated\n", lid_from_keyblock(keyblock));
|
log_info(_("lid %lu: updated\n"), lid_from_keyblock(keyblock));
|
||||||
upd_count++;
|
upd_count++;
|
||||||
}
|
}
|
||||||
else if( opt.verbose > 1 )
|
else if( opt.verbose > 1 )
|
||||||
log_info("lid %lu: okay\n", lid_from_keyblock(keyblock) );
|
log_info(_("lid %lu: okay\n"), lid_from_keyblock(keyblock) );
|
||||||
|
|
||||||
release_kbnode( keyblock ); keyblock = NULL;
|
release_kbnode( keyblock ); keyblock = NULL;
|
||||||
if( !(++count % 100) )
|
if( !(++count % 100) )
|
||||||
@ -1366,7 +1374,7 @@ update_trustdb( )
|
|||||||
log_info(_("\t%lu keys inserted\n"), new_count);
|
log_info(_("\t%lu keys inserted\n"), new_count);
|
||||||
}
|
}
|
||||||
if( rc && rc != -1 )
|
if( rc && rc != -1 )
|
||||||
log_error("enum_keyblocks failed: %s\n", g10_errstr(rc));
|
log_error(_("enumerate keyblocks failed: %s\n"), g10_errstr(rc));
|
||||||
|
|
||||||
enum_keyblocks( 2, &kbpos, &keyblock ); /* close */
|
enum_keyblocks( 2, &kbpos, &keyblock ); /* close */
|
||||||
release_kbnode( keyblock );
|
release_kbnode( keyblock );
|
||||||
@ -1411,7 +1419,7 @@ check_trust( PKT_public_key *pk, unsigned *r_trustlevel )
|
|||||||
}
|
}
|
||||||
else { /* no local_id: scan the trustdb */
|
else { /* no local_id: scan the trustdb */
|
||||||
if( (rc=tdbio_search_dir_bypk( pk, &rec )) && rc != -1 ) {
|
if( (rc=tdbio_search_dir_bypk( pk, &rec )) && rc != -1 ) {
|
||||||
log_error("check_trust: search dir record failed: %s\n",
|
log_error(_("check_trust: search dir record failed: %s\n"),
|
||||||
g10_errstr(rc));
|
g10_errstr(rc));
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -1501,8 +1509,46 @@ query_trust_info( PKT_public_key *pk )
|
|||||||
int
|
int
|
||||||
enum_trust_web( void **context, ulong *lid )
|
enum_trust_web( void **context, ulong *lid )
|
||||||
{
|
{
|
||||||
/* REPLACE THIS with a BETTER ONE */
|
#if 0
|
||||||
|
struct {
|
||||||
|
int init;
|
||||||
|
} *ctx;
|
||||||
|
int rc;
|
||||||
|
int wipe=0;
|
||||||
|
TRUSTREC rec;
|
||||||
|
TRUST_INFO *tmppath;
|
||||||
|
TRUST_SEG_LIST trust_seg_list, tsl, tsl2;
|
||||||
|
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
|
||||||
|
|
||||||
|
if( !*context ) {
|
||||||
|
asssert( *lid );
|
||||||
|
|
||||||
|
ctx = m_alloc_clear( sizeof *ctx );
|
||||||
|
*context = ctx;
|
||||||
|
/* collect the paths */
|
||||||
|
read_record( *lid, &rec, RECTYPE_DIR );
|
||||||
|
tmppath = m_alloc_clear( (MAX_CERT_DEPTH+1)* sizeof *tmppath );
|
||||||
|
trust_seg_list = NULL;
|
||||||
|
collect_paths( 0, MAX_CERT_DEPTH, 1, &rec, tmppath, &trust_seg_list );
|
||||||
|
m_free( tmppath );
|
||||||
|
/* and now print them */
|
||||||
|
for(tsl = trust_seg_list; tsl; tsl = tsl->next ) {
|
||||||
|
print_path( tsl->pathlen, tsl->path );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ctx = *context;
|
||||||
|
|
||||||
|
if( !lid ) { /* release the context */
|
||||||
|
if( *
|
||||||
|
/* release the list */
|
||||||
|
for(tsl = trust_seg_list; tsl; tsl = tsl2 ) {
|
||||||
|
tsl2 = tsl->next;
|
||||||
|
m_free( tsl );
|
||||||
|
}
|
||||||
|
trust_seg_list = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return -1; /* eof */
|
return -1; /* eof */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1552,7 +1598,7 @@ get_pref_data( ulong lid, const byte *namehash, size_t *ret_n )
|
|||||||
/* found the correct one or the first one */
|
/* found the correct one or the first one */
|
||||||
read_record( rec.r.uid.prefrec, &rec, RECTYPE_PREF );
|
read_record( rec.r.uid.prefrec, &rec, RECTYPE_PREF );
|
||||||
if( rec.r.pref.next )
|
if( rec.r.pref.next )
|
||||||
log_info("warning: can't yet handle long pref records\n");
|
log_info(_("WARNING: can't yet handle long pref records\n"));
|
||||||
buf = m_alloc( ITEMS_PER_PREF_RECORD );
|
buf = m_alloc( ITEMS_PER_PREF_RECORD );
|
||||||
memcpy( buf, rec.r.pref.data, ITEMS_PER_PREF_RECORD );
|
memcpy( buf, rec.r.pref.data, ITEMS_PER_PREF_RECORD );
|
||||||
*ret_n = ITEMS_PER_PREF_RECORD;
|
*ret_n = ITEMS_PER_PREF_RECORD;
|
||||||
@ -1581,7 +1627,7 @@ is_algo_in_prefs( ulong lid, int preftype, int algo )
|
|||||||
if( rec.r.uid.prefrec ) {
|
if( rec.r.uid.prefrec ) {
|
||||||
read_record( rec.r.uid.prefrec, &rec, RECTYPE_PREF );
|
read_record( rec.r.uid.prefrec, &rec, RECTYPE_PREF );
|
||||||
if( rec.r.pref.next )
|
if( rec.r.pref.next )
|
||||||
log_info("warning: can't yet handle long pref records\n");
|
log_info(_("WARNING: can't yet handle long pref records\n"));
|
||||||
pref = rec.r.pref.data;
|
pref = rec.r.pref.data;
|
||||||
for(i=0; i+1 < ITEMS_PER_PREF_RECORD; i+=2 ) {
|
for(i=0; i+1 < ITEMS_PER_PREF_RECORD; i+=2 ) {
|
||||||
if( pref[i] == preftype && pref[i+1] == algo )
|
if( pref[i] == preftype && pref[i+1] == algo )
|
||||||
@ -1603,7 +1649,7 @@ get_dir_record( PKT_public_key *pk, TRUSTREC *rec )
|
|||||||
}
|
}
|
||||||
else { /* no local_id: scan the trustdb */
|
else { /* no local_id: scan the trustdb */
|
||||||
if( (rc=tdbio_search_dir_bypk( pk, rec )) && rc != -1 )
|
if( (rc=tdbio_search_dir_bypk( pk, rec )) && rc != -1 )
|
||||||
log_error("get_dir_record: search_record failed: %s\n",
|
log_error(_("get_dir_record: search_record failed: %s\n"),
|
||||||
g10_errstr(rc));
|
g10_errstr(rc));
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
@ -1663,11 +1709,11 @@ check_hint_sig( ulong lid, KBNODE keyblock, u32 *keyid, byte *uidrec_hash,
|
|||||||
int revoke = 0;
|
int revoke = 0;
|
||||||
|
|
||||||
if( sigrec->r.sig.sig[sigidx].flag & SIGF_CHECKED )
|
if( sigrec->r.sig.sig[sigidx].flag & SIGF_CHECKED )
|
||||||
log_info(_("note: sig rec %lu[%d] in hintlist "
|
log_info(_("NOTE: sig rec %lu[%d] in hintlist "
|
||||||
"of %lu but marked as checked\n"),
|
"of %lu but marked as checked\n"),
|
||||||
sigrec->recnum, sigidx, hint_owner );
|
sigrec->recnum, sigidx, hint_owner );
|
||||||
if( !(sigrec->r.sig.sig[sigidx].flag & SIGF_NOPUBKEY) )
|
if( !(sigrec->r.sig.sig[sigidx].flag & SIGF_NOPUBKEY) )
|
||||||
log_info(_("note: sig rec %lu[%d] in hintlist "
|
log_info(_("NOTE: sig rec %lu[%d] in hintlist "
|
||||||
"of %lu but not marked\n"),
|
"of %lu but not marked\n"),
|
||||||
sigrec->recnum, sigidx, hint_owner );
|
sigrec->recnum, sigidx, hint_owner );
|
||||||
|
|
||||||
@ -1866,7 +1912,7 @@ create_shadow_dir( PKT_signature *sig, ulong lid )
|
|||||||
/* first see whether we already have such a record */
|
/* first see whether we already have such a record */
|
||||||
rc = tdbio_search_sdir( sig->keyid, sig->pubkey_algo, &sdir );
|
rc = tdbio_search_sdir( sig->keyid, sig->pubkey_algo, &sdir );
|
||||||
if( rc && rc != -1 ) {
|
if( rc && rc != -1 ) {
|
||||||
log_error("tdbio_search_dir failed: %s\n", g10_errstr(rc));
|
log_error(_("tdbio_search_dir failed: %s\n"), g10_errstr(rc));
|
||||||
die_invalid_db();
|
die_invalid_db();
|
||||||
}
|
}
|
||||||
if( rc == -1 ) { /* not found: create */
|
if( rc == -1 ) { /* not found: create */
|
||||||
@ -2283,7 +2329,7 @@ upd_pref_record( TRUSTREC *urec, u32 *keyid, PKT_signature *sig )
|
|||||||
if( n_prefs_rec >= DIM(prefs_rec)-1 ) {
|
if( n_prefs_rec >= DIM(prefs_rec)-1 ) {
|
||||||
log_info("uid %08lX.%lu/%02X%02X: %s\n",
|
log_info("uid %08lX.%lu/%02X%02X: %s\n",
|
||||||
(ulong)keyid[1], lid, uidhash[18], uidhash[19],
|
(ulong)keyid[1], lid, uidhash[18], uidhash[19],
|
||||||
_("Too many preferences items") );
|
_("Too many preference items") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
prefs_rec[n_prefs_rec++] = prec.r.pref.data[i];
|
prefs_rec[n_prefs_rec++] = prec.r.pref.data[i];
|
||||||
@ -2304,7 +2350,7 @@ upd_pref_record( TRUSTREC *urec, u32 *keyid, PKT_signature *sig )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( n_prefs_sig > ITEMS_PER_PREF_RECORD )
|
if( n_prefs_sig > ITEMS_PER_PREF_RECORD )
|
||||||
log_info("cannot yet handle long preferences");
|
log_info(_("WARNING: can't yet handle long pref records\n"));
|
||||||
|
|
||||||
memset( &prec, 0, sizeof prec );
|
memset( &prec, 0, sizeof prec );
|
||||||
prec.recnum = tdbio_new_recnum();
|
prec.recnum = tdbio_new_recnum();
|
||||||
@ -2452,7 +2498,7 @@ upd_cert_record( KBNODE keyblock, KBNODE signode, u32 *keyid,
|
|||||||
log_info("sig %08lX.%lu/%02X%02X/%08lX: %s\n",
|
log_info("sig %08lX.%lu/%02X%02X/%08lX: %s\n",
|
||||||
(ulong)keyid[1], lid, uidhash[18],
|
(ulong)keyid[1], lid, uidhash[18],
|
||||||
uidhash[19], (ulong)sig->keyid[1],
|
uidhash[19], (ulong)sig->keyid[1],
|
||||||
_("public key lost") );
|
_("Hmmm, public key lost?") );
|
||||||
rec.r.sig.sig[i].flag = SIGF_NOPUBKEY;
|
rec.r.sig.sig[i].flag = SIGF_NOPUBKEY;
|
||||||
if( revoke )
|
if( revoke )
|
||||||
rec.r.sig.sig[i].flag |= SIGF_REVOKED;
|
rec.r.sig.sig[i].flag |= SIGF_REVOKED;
|
||||||
@ -2477,8 +2523,8 @@ upd_cert_record( KBNODE keyblock, KBNODE signode, u32 *keyid,
|
|||||||
&& (!tmp.r.sdir.pubkey_algo
|
&& (!tmp.r.sdir.pubkey_algo
|
||||||
|| tmp.r.sdir.pubkey_algo == sig->pubkey_algo )) {
|
|| tmp.r.sdir.pubkey_algo == sig->pubkey_algo )) {
|
||||||
if( !(rec.r.sig.sig[i].flag & SIGF_NOPUBKEY) )
|
if( !(rec.r.sig.sig[i].flag & SIGF_NOPUBKEY) )
|
||||||
log_info("uid %08lX.%lu/%02X%02X: "
|
log_info(_("uid %08lX.%lu/%02X%02X: "
|
||||||
"has shadow dir %lu but not yet marked.\n",
|
"has shadow dir %lu but is not yet marked.\n"),
|
||||||
(ulong)keyid[1], lid,
|
(ulong)keyid[1], lid,
|
||||||
uidhash[18], uidhash[19], tmp.recnum );
|
uidhash[18], uidhash[19], tmp.recnum );
|
||||||
rec.r.sig.sig[i].flag = SIGF_NOPUBKEY;
|
rec.r.sig.sig[i].flag = SIGF_NOPUBKEY;
|
||||||
@ -2491,7 +2537,7 @@ upd_cert_record( KBNODE keyblock, KBNODE signode, u32 *keyid,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
log_error("sig record %lu[%d] points to wrong record.\n",
|
log_error(_("sig record %lu[%d] points to wrong record.\n"),
|
||||||
rec.r.sig.sig[i].lid, i );
|
rec.r.sig.sig[i].lid, i );
|
||||||
die_invalid_db();
|
die_invalid_db();
|
||||||
}
|
}
|
||||||
@ -2733,7 +2779,7 @@ insert_trust_record( PKT_public_key *pk )
|
|||||||
/* get the keyblock which has the key */
|
/* get the keyblock which has the key */
|
||||||
rc = get_keyblock_byfprint( &keyblock, fingerprint, fingerlen );
|
rc = get_keyblock_byfprint( &keyblock, fingerprint, fingerlen );
|
||||||
if( rc ) { /* that should never happen */
|
if( rc ) { /* that should never happen */
|
||||||
log_error( "insert_trust_record: keyblock not found: %s\n",
|
log_error( _("insert_trust_record: keyblock not found: %s\n"),
|
||||||
g10_errstr(rc) );
|
g10_errstr(rc) );
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -2751,7 +2797,7 @@ insert_trust_record( PKT_public_key *pk )
|
|||||||
keyid_from_pk( pk, bkid );
|
keyid_from_pk( pk, bkid );
|
||||||
|
|
||||||
if( akid[0] != bkid[0] || akid[1] != bkid[1] ) {
|
if( akid[0] != bkid[0] || akid[1] != bkid[1] ) {
|
||||||
log_error("did not use primary key for insert_trust_record()\n");
|
log_error(_("did not use primary key for insert_trust_record()\n"));
|
||||||
rc = G10ERR_GENERAL;
|
rc = G10ERR_GENERAL;
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
@ -2763,7 +2809,7 @@ insert_trust_record( PKT_public_key *pk )
|
|||||||
*/
|
*/
|
||||||
rc = tdbio_search_sdir( pk->keyid, pk->pubkey_algo, &shadow );
|
rc = tdbio_search_sdir( pk->keyid, pk->pubkey_algo, &shadow );
|
||||||
if( rc && rc != -1 ) {
|
if( rc && rc != -1 ) {
|
||||||
log_error("tdbio_search_dir failed: %s\n", g10_errstr(rc));
|
log_error(_("tdbio_search_dir failed: %s\n"), g10_errstr(rc));
|
||||||
die_invalid_db();
|
die_invalid_db();
|
||||||
}
|
}
|
||||||
memset( &dirrec, 0, sizeof dirrec );
|
memset( &dirrec, 0, sizeof dirrec );
|
||||||
|
@ -152,6 +152,7 @@ const char *memistr( const char *buf, size_t buflen, const char *sub );
|
|||||||
char *mem2str( char *, const void *, size_t);
|
char *mem2str( char *, const void *, size_t);
|
||||||
char *trim_spaces( char *string );
|
char *trim_spaces( char *string );
|
||||||
int string_count_chr( const char *string, int c );
|
int string_count_chr( const char *string, int c );
|
||||||
|
int set_native_charset( const char *newset );
|
||||||
char *native_to_utf8( const char *string );
|
char *native_to_utf8( const char *string );
|
||||||
char *utf8_to_native( const char *string );
|
char *utf8_to_native( const char *string );
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
Tue Nov 10 10:48:02 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
|
* it.po: Imported new version.
|
||||||
|
|
||||||
Fri Oct 30 20:03:17 1998 Werner Koch (wk@isil.d.shuttle.de)
|
Fri Oct 30 20:03:17 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
* fr.po: Imported new version
|
* fr.po: Imported new version
|
||||||
|
@ -22,19 +22,26 @@ g10/pkclist.c
|
|||||||
g10/keygen.c
|
g10/keygen.c
|
||||||
g10/decrypt.c
|
g10/decrypt.c
|
||||||
g10/encode.c
|
g10/encode.c
|
||||||
|
g10/export.c
|
||||||
g10/getkey.c
|
g10/getkey.c
|
||||||
g10/import.c
|
g10/import.c
|
||||||
g10/keyedit.c
|
g10/keyedit.c
|
||||||
g10/keylist.c
|
g10/keylist.c
|
||||||
g10/mainproc.c
|
g10/mainproc.c
|
||||||
|
g10/misc.c
|
||||||
|
g10/parse-packet.c
|
||||||
g10/passphrase.c
|
g10/passphrase.c
|
||||||
g10/plaintext.c
|
g10/plaintext.c
|
||||||
|
g10/pubkey-enc.c
|
||||||
g10/pref.c
|
g10/pref.c
|
||||||
g10/seckey-cert.c
|
g10/seckey-cert.c
|
||||||
g10/sig-check.c
|
g10/sig-check.c
|
||||||
g10/sign.c
|
g10/sign.c
|
||||||
|
g10/tdbio.c
|
||||||
g10/trustdb.c
|
g10/trustdb.c
|
||||||
g10/verify.c
|
g10/verify.c
|
||||||
|
g10/ringedit.c
|
||||||
|
g10/skclist.c
|
||||||
g10/status.c
|
g10/status.c
|
||||||
g10/pubkey-enc.c
|
g10/pubkey-enc.c
|
||||||
g10/openfile.c
|
g10/openfile.c
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Tue Nov 10 10:01:53 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
|
* strgutil.c (set_native_charset): New.
|
||||||
|
(native_to_utf8): Now handles koi8-r.
|
||||||
|
|
||||||
Tue Nov 3 16:17:56 1998 Werner Koch (wk@isil.d.shuttle.de)
|
Tue Nov 3 16:17:56 1998 Werner Koch (wk@isil.d.shuttle.de)
|
||||||
|
|
||||||
* strgutil.c (native_to_utf8): New.
|
* strgutil.c (native_to_utf8): New.
|
||||||
|
@ -65,6 +65,7 @@ log_get_errorcount( int clear)
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_prefix(const char *text)
|
print_prefix(const char *text)
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,28 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
|
|
||||||
|
static int use_koi8 = 0;
|
||||||
|
static ushort koi82unicode[128] = {
|
||||||
|
0x2500,0x2502,0x250c,0x2510,0x2514,0x2518,0x251c,0x2524,
|
||||||
|
0x252c,0x2534,0x253c,0x2580,0x2584,0x2588,0x258c,0x2590,
|
||||||
|
0x2591,0x2592,0x2593,0x2320,0x25a0,0x2219,0x221a,0x2248,
|
||||||
|
0x2264,0x2265,0x00a0,0x2321,0x00b0,0x00b2,0x00b7,0x00f7,
|
||||||
|
0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556,
|
||||||
|
0x2557,0x2558,0x2559,0x255a,0x255b,0x255c,0x255d,0x255e,
|
||||||
|
0x255f,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565,
|
||||||
|
0x2566,0x2567,0x2568,0x2569,0x256a,0x256b,0x256c,0x00a9,
|
||||||
|
0x044e,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433,
|
||||||
|
0x0445,0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e,
|
||||||
|
0x043f,0x044f,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,
|
||||||
|
0x044c,0x044b,0x0437,0x0448,0x044d,0x0449,0x0447,0x044a,
|
||||||
|
0x042e,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413,
|
||||||
|
0x0425,0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e,
|
||||||
|
0x041f,0x042f,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412,
|
||||||
|
0x042c,0x042b,0x0417,0x0428,0x042d,0x0429,0x0427,0x042a
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
free_strlist( STRLIST sl )
|
free_strlist( STRLIST sl )
|
||||||
{
|
{
|
||||||
@ -180,10 +202,21 @@ string_count_chr( const char *string, int c )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
set_native_charset( const char *newset )
|
||||||
|
{
|
||||||
|
if( !stricmp( newset, "iso-8859-1" ) )
|
||||||
|
use_koi8 = 0;
|
||||||
|
else if( !stricmp( newset, "koi8-r" ) )
|
||||||
|
use_koi8 = 1;
|
||||||
|
else
|
||||||
|
return G10ERR_GENERAL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/****************
|
/****************
|
||||||
* Convert string, which is in native encoding to UTF8 and return the
|
* Convert string, which is in native encoding to UTF8 and return the
|
||||||
* new allocated UTF8 string.
|
* new allocated UTF8 string.
|
||||||
* This code assumes that native is iso-8859-1.
|
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
native_to_utf8( const char *string )
|
native_to_utf8( const char *string )
|
||||||
@ -193,21 +226,48 @@ native_to_utf8( const char *string )
|
|||||||
byte *p;
|
byte *p;
|
||||||
size_t length=0;
|
size_t length=0;
|
||||||
|
|
||||||
for(s=string; *s; s++ ) {
|
if( use_koi8 ) {
|
||||||
length++;
|
for(s=string; *s; s++ ) {
|
||||||
if( *s & 0x80 )
|
|
||||||
length++;
|
length++;
|
||||||
}
|
if( *s & 0x80 )
|
||||||
buffer = m_alloc( length + 1 );
|
length += 2; /* we may need 3 bytes */
|
||||||
for(p=buffer, s=string; *s; s++ ) {
|
|
||||||
if( *s & 0x80 ) {
|
|
||||||
*p++ = 0xc0 | ((*s >> 6) & 3);
|
|
||||||
*p++ = 0x80 | ( *s & 0x3f );
|
|
||||||
}
|
}
|
||||||
else
|
buffer = m_alloc( length + 1 );
|
||||||
*p++ = *s;
|
for(p=buffer, s=string; *s; s++ ) {
|
||||||
|
if( *s & 0x80 ) {
|
||||||
|
ushort val = koi82unicode[ *s & 0x7f ];
|
||||||
|
if( val < 0x0800 ) {
|
||||||
|
*p++ = 0xc0 | ( (val >> 6) & 0x1f );
|
||||||
|
*p++ = 0x80 | ( val & 0x3f );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*p++ = 0xe0 | ( (val >> 12) & 0x0f );
|
||||||
|
*p++ = 0x80 | ( (val >> 6) & 0x3f );
|
||||||
|
*p++ = 0x80 | ( val & 0x3f );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*p++ = *s;
|
||||||
|
}
|
||||||
|
*p = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(s=string; *s; s++ ) {
|
||||||
|
length++;
|
||||||
|
if( *s & 0x80 )
|
||||||
|
length++;
|
||||||
|
}
|
||||||
|
buffer = m_alloc( length + 1 );
|
||||||
|
for(p=buffer, s=string; *s; s++ ) {
|
||||||
|
if( *s & 0x80 ) {
|
||||||
|
*p++ = 0xc0 | ((*s >> 6) & 3);
|
||||||
|
*p++ = 0x80 | ( *s & 0x3f );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*p++ = *s;
|
||||||
|
}
|
||||||
|
*p = 0;
|
||||||
}
|
}
|
||||||
*p = 0;
|
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user