mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
See ChangeLog: Tue Jul 13 17:39:25 CEST 1999 Werner Koch
This commit is contained in:
parent
8caf2f7437
commit
68512418bd
4
NEWS
4
NEWS
@ -14,6 +14,10 @@
|
||||
* New commands --lsign-key and made --sign-key a shortcut for --edit
|
||||
and sign.
|
||||
|
||||
* New options (#122--124 ;-) --[no-]default-recipient[-self]. See the
|
||||
man page.
|
||||
|
||||
* Enhanced info output in case of multiple recipients and fixed exit code.
|
||||
|
||||
Noteworthy changes in version 0.9.8
|
||||
-----------------------------------
|
||||
|
3
THANKS
3
THANKS
@ -20,6 +20,7 @@ David Ellement ellement@sdd.hp.com
|
||||
Detlef Lannert lannert@lannert.rz.uni-duesseldorf.de
|
||||
Dirk Lattermann dlatt@t-online.de
|
||||
Ed Boraas ecxjo@esperanto.org
|
||||
Enzo Michelangeli em@MailAndNews.com
|
||||
Ernst Molitor ernst.molitor@uni-bonn.de
|
||||
Fabio Coatti cova@felix.unife.it
|
||||
Felix von Leitner leitner@amdiv.de
|
||||
@ -97,7 +98,7 @@ Wim Vandeputte bunbun@reptile.rug.ac.be
|
||||
nbecker@hns.com
|
||||
|
||||
Thanks to the German Unix User Group for providing FTP space,
|
||||
Martin Hamilton for hosting the mailing list and hsp for
|
||||
Martin Hamilton for hosting the mailing list and HSP for
|
||||
hosting gnupg.org.
|
||||
|
||||
Many thanks to my wife Gerlinde for having so much patience with
|
||||
|
2
TODO
2
TODO
@ -14,6 +14,8 @@
|
||||
* find a way to allow the import of non-self-signed keys. This is needed
|
||||
for the IN ENCR/SIGN hack.
|
||||
|
||||
* add an option to use a OpenPGP packet as input (and don't build a literal
|
||||
data packet)
|
||||
|
||||
Nice to have
|
||||
------------
|
||||
|
51
doc/gpg.sgml
51
doc/gpg.sgml
@ -464,6 +464,34 @@ values will be overwritten.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>--print-md <parameter>algo</parameter> &OptParmFiles;</term>
|
||||
<listitem><para>
|
||||
Print message digest og algorithm ALGO for all given files of stdin.
|
||||
If "*" is used for the algorithm, digests for all available algorithms
|
||||
are printed.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>--gen-random <parameter>0|1|2</parameter>
|
||||
<optional><parameter>count</parameter></optional></term>
|
||||
<listitem><para>
|
||||
Emit COUNT random bytes of the given quality level. If count is not given
|
||||
or zero, an endless sequenece of random bytes will be emitted.
|
||||
PLEASE, don't use this command unless you know waht you are doing, it may
|
||||
remove precious entropy from the system!
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--gen-prime <parameter>mode</parameter>
|
||||
<parameter>bits</parameter>
|
||||
<optional><parameter>qbits</parameter></optional></term>
|
||||
<listitem><para>
|
||||
Use the source, Luke :-). The output format is still subject to change.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>--version</term>
|
||||
<listitem><para>
|
||||
@ -544,9 +572,30 @@ found in the secret keyring.
|
||||
<term></term>
|
||||
<listitem><para>
|
||||
Encrypt for user id &ParmName;. If this option is not
|
||||
specified, GnuPG asks for the user id.
|
||||
specified, GnuPG asks for the user-id unless --default-recipient is given
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--default-recipient &ParmName;</term>
|
||||
<listitem><para>
|
||||
Use &ParmName; as default recipient if option --recipient is not used and
|
||||
don't ask if this is a valid one. &ParmName; must be a non empty.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--default-recipient-self</term>
|
||||
<listitem><para>
|
||||
Use the default key as default recipient if option --recipient is not used and
|
||||
don't ask if this is a valid one. The default key is the first one from the
|
||||
secret keyring or the one set with --default-key.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>--no-default-recipient</term>
|
||||
<listitem><para>
|
||||
Reset --default-recipient and --default-recipient-self.
|
||||
</para></listitem></varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>--encrypt-to &ParmName;</term>
|
||||
|
@ -1,3 +1,16 @@
|
||||
Tue Jul 13 17:39:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
|
||||
* pkclist.c (do_edit_ownertrust): Changed the way help works.
|
||||
(build_pk_list): Implemented default recipient stuff.
|
||||
* g10.c: New options --default-recipient[-self]
|
||||
(main): Suppress greeting in most cases, entering a passphrase or
|
||||
a missing value is not considered to be interactive use.
|
||||
Merged --print-md and --print-mds; the latter is now obsolete.
|
||||
Changed the way --gen-random works and documented it.
|
||||
Changed the way --gen-prime works and add a man entry.
|
||||
* g10.c (MAINTAINER_OPTIONS): Removed.
|
||||
|
||||
Mon Jul 12 18:45:57 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
|
||||
|
@ -19,13 +19,6 @@
|
||||
#-----------------------------------------------
|
||||
# With some exceptions, these cannot be combined
|
||||
|
||||
print-md algo
|
||||
# print the message digest of algorithm ALGO for stdin or all
|
||||
# given filenames
|
||||
|
||||
print-mds
|
||||
# print all message digests of all give filenames
|
||||
|
||||
store
|
||||
# simply packs the input data into a rfc1991 packet format
|
||||
|
||||
|
151
g10/g10.c
151
g10/g10.c
@ -26,7 +26,6 @@
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define MAINTAINER_OPTIONS
|
||||
|
||||
#include "packet.h"
|
||||
#include "iobuf.h"
|
||||
@ -112,6 +111,9 @@ enum cmd_and_opt_values { aNull = 0,
|
||||
oKeyring,
|
||||
oSecretKeyring,
|
||||
oDefaultKey,
|
||||
oDefRecipient,
|
||||
oDefRecipientSelf,
|
||||
oNoDefRecipient,
|
||||
oOptions,
|
||||
oDebug,
|
||||
oDebugAll,
|
||||
@ -217,17 +219,19 @@ static ARGPARSE_OPTS opts[] = {
|
||||
{ aDeArmor, "dearmor", 256, N_("De-Armor a file or stdin") },
|
||||
{ aEnArmor, "enarmor", 256, N_("En-Armor a file or stdin") },
|
||||
{ aPrintMD, "print-md" , 256, N_("|algo [files]|print message digests")},
|
||||
{ aPrintMDs, "print-mds" , 256, N_("print all message digests")},
|
||||
#ifdef MAINTAINER_OPTIONS
|
||||
{ aPrimegen, "gen-prime" , 256, "@" },
|
||||
{ aGenRandom, "gen-random" , 256, "@" },
|
||||
#endif
|
||||
|
||||
{ 301, NULL, 0, N_("@\nOptions:\n ") },
|
||||
|
||||
{ oArmor, "armor", 0, N_("create ascii armored output")},
|
||||
{ oRecipient, "recipient", 2, N_("|NAME|encrypt for NAME")},
|
||||
{ oRecipient, "remote-user", 2, "@"}, /* old option name */
|
||||
{ oDefRecipient, "default-recipient" ,2,
|
||||
N_("|NAME|use NAME as default recipient")},
|
||||
{ oDefRecipientSelf, "default-recipient-self" ,0,
|
||||
N_("use the default key as default recipient")},
|
||||
{ oNoDefRecipient, "no-default-recipient", 0, "@" },
|
||||
{ oEncryptTo, "encrypt-to", 2, "@" },
|
||||
{ oNoEncryptTo, "no-encrypt-to", 0, "@" },
|
||||
{ oUser, "local-user",2, N_("use this user-id to sign or decrypt")},
|
||||
@ -282,6 +286,7 @@ static ARGPARSE_OPTS opts[] = {
|
||||
|
||||
/* hidden options */
|
||||
{ aExportOwnerTrust, "list-ownertrust",0 , "@"}, /* alias */
|
||||
{ aPrintMDs, "print-mds" , 256, "@"}, /* old */
|
||||
{ aListTrustDB, "list-trustdb",0 , "@"},
|
||||
{ aListTrustPath, "list-trust-path",0, "@"},
|
||||
{ oKOption, NULL, 0, "@"},
|
||||
@ -520,7 +525,7 @@ main( int argc, char **argv )
|
||||
int parse_debug = 0;
|
||||
int default_config =1;
|
||||
int default_keyring = 1;
|
||||
int greeting = 1;
|
||||
int greeting = 0;
|
||||
enum cmd_and_opt_values cmd = 0;
|
||||
const char *trustdb_name = NULL;
|
||||
char *def_cipher_string = NULL;
|
||||
@ -654,26 +659,25 @@ main( int argc, char **argv )
|
||||
case aListKeys: set_cmd( &cmd, aListKeys); break;
|
||||
case aListSigs: set_cmd( &cmd, aListSigs); break;
|
||||
case aExportSecret: set_cmd( &cmd, aExportSecret); break;
|
||||
case aDeleteSecretKey: set_cmd( &cmd, aDeleteSecretKey); break;
|
||||
case aDeleteKey: set_cmd( &cmd, aDeleteKey); break;
|
||||
case aDeleteSecretKey: set_cmd( &cmd, aDeleteSecretKey);
|
||||
greeting=1; break;
|
||||
case aDeleteKey: set_cmd( &cmd, aDeleteKey); greeting=1; break;
|
||||
|
||||
case aDetachedSign: detached_sig = 1; set_cmd( &cmd, aSign ); break;
|
||||
case aSym: set_cmd( &cmd, aSym); break;
|
||||
case aDecrypt: set_cmd( &cmd, aDecrypt); break;
|
||||
case aEncr: set_cmd( &cmd, aEncr); break;
|
||||
case aSign: set_cmd( &cmd, aSign ); break;
|
||||
case aKeygen: set_cmd( &cmd, aKeygen); break;
|
||||
case aKeygen: set_cmd( &cmd, aKeygen); greeting=1; break;
|
||||
case aSignKey: set_cmd( &cmd, aSignKey); break;
|
||||
case aLSignKey: set_cmd( &cmd, aLSignKey); break;
|
||||
case aStore: set_cmd( &cmd, aStore); break;
|
||||
case aEditKey: set_cmd( &cmd, aEditKey); break;
|
||||
case aEditKey: set_cmd( &cmd, aEditKey); greeting=1; break;
|
||||
case aClearsign: set_cmd( &cmd, aClearsign); break;
|
||||
case aGenRevoke: set_cmd( &cmd, aGenRevoke); break;
|
||||
case aVerify: set_cmd( &cmd, aVerify); break;
|
||||
#ifdef MAINTAINER_OPTIONS
|
||||
case aPrimegen: set_cmd( &cmd, aPrimegen); break;
|
||||
case aGenRandom: set_cmd( &cmd, aGenRandom); break;
|
||||
#endif
|
||||
case aPrintMD: set_cmd( &cmd, aPrintMD); break;
|
||||
case aPrintMDs: set_cmd( &cmd, aPrintMDs); break;
|
||||
case aListTrustDB: set_cmd( &cmd, aListTrustDB); break;
|
||||
@ -681,8 +685,8 @@ main( int argc, char **argv )
|
||||
case aUpdateTrustDB: set_cmd( &cmd, aUpdateTrustDB); break;
|
||||
case aFixTrustDB: set_cmd( &cmd, aFixTrustDB); break;
|
||||
case aListTrustPath: set_cmd( &cmd, aListTrustPath); break;
|
||||
case aDeArmor: set_cmd( &cmd, aDeArmor); greeting = 0; break;
|
||||
case aEnArmor: set_cmd( &cmd, aEnArmor); greeting = 0; break;
|
||||
case aDeArmor: set_cmd( &cmd, aDeArmor); break;
|
||||
case aEnArmor: set_cmd( &cmd, aEnArmor); break;
|
||||
case aExportOwnerTrust: set_cmd( &cmd, aExportOwnerTrust); break;
|
||||
case aImportOwnerTrust: set_cmd( &cmd, aImportOwnerTrust); break;
|
||||
|
||||
@ -730,6 +734,18 @@ main( int argc, char **argv )
|
||||
case oMaxCertDepth: opt.max_cert_depth = pargs.r.ret_int; break;
|
||||
case oTrustDBName: trustdb_name = pargs.r.ret_str; break;
|
||||
case oDefaultKey: opt.def_secret_key = pargs.r.ret_str; break;
|
||||
case oDefRecipient:
|
||||
if( *pargs.r.ret_str )
|
||||
opt.def_recipient = make_username(pargs.r.ret_str);
|
||||
break;
|
||||
case oDefRecipientSelf:
|
||||
m_free(opt.def_recipient); opt.def_recipient = NULL;
|
||||
opt.def_recipient_self = 1;
|
||||
break;
|
||||
case oNoDefRecipient:
|
||||
m_free(opt.def_recipient); opt.def_recipient = NULL;
|
||||
opt.def_recipient_self = 0;
|
||||
break;
|
||||
case oNoOptions: break; /* no-options */
|
||||
case oHomedir: opt.homedir = pargs.r.ret_str; break;
|
||||
case oNoBatch: opt.batch = 0; break;
|
||||
@ -834,10 +850,11 @@ main( int argc, char **argv )
|
||||
fprintf(stderr, "%s %s; %s\n",
|
||||
strusage(11), strusage(13), strusage(14) );
|
||||
fprintf(stderr, "%s\n", strusage(15) );
|
||||
#ifdef IS_DEVELOPMENT_VERSION
|
||||
log_info("NOTE: this is a development version!\n");
|
||||
#endif
|
||||
}
|
||||
#ifdef IS_DEVELOPMENT_VERSION
|
||||
if( !opt.batch )
|
||||
log_info("NOTE: this is a development version!\n");
|
||||
#endif
|
||||
if( opt.batch )
|
||||
tty_batchmode( 1 );
|
||||
|
||||
@ -1191,68 +1208,70 @@ main( int argc, char **argv )
|
||||
break;
|
||||
|
||||
|
||||
#ifdef MAINTAINER_OPTIONS
|
||||
case aPrimegen:
|
||||
if( argc == 1 ) {
|
||||
mpi_print( stdout, generate_public_prime( atoi(argv[0]) ), 1);
|
||||
putchar('\n');
|
||||
}
|
||||
else if( argc == 2 ) {
|
||||
mpi_print( stdout, generate_elg_prime( 0, atoi(argv[0]),
|
||||
atoi(argv[1]), NULL,NULL ), 1);
|
||||
putchar('\n');
|
||||
}
|
||||
else if( argc == 3 ) {
|
||||
MPI g = mpi_alloc(1);
|
||||
mpi_print( stdout, generate_elg_prime( 0, atoi(argv[0]),
|
||||
atoi(argv[1]), g, NULL ), 1);
|
||||
printf("\nGenerator: ");
|
||||
mpi_print( stdout, g, 1 );
|
||||
putchar('\n');
|
||||
mpi_free(g);
|
||||
}
|
||||
else if( argc == 4 ) {
|
||||
mpi_print( stdout, generate_elg_prime( 1, atoi(argv[0]),
|
||||
atoi(argv[1]), NULL,NULL ), 1);
|
||||
putchar('\n');
|
||||
}
|
||||
else
|
||||
usage(1);
|
||||
break;
|
||||
#endif /* MAINTAINER OPTIONS */
|
||||
{ int mode = argc < 2 ? 0 : atoi(*argv);
|
||||
|
||||
if( mode == 1 && argc == 2 ) {
|
||||
mpi_print( stdout, generate_public_prime( atoi(argv[1]) ), 1);
|
||||
}
|
||||
else if( mode == 2 && argc == 3 ) {
|
||||
mpi_print( stdout, generate_elg_prime(
|
||||
0, atoi(argv[1]),
|
||||
atoi(argv[2]), NULL,NULL ), 1);
|
||||
}
|
||||
else if( mode == 3 && argc == 3 ) {
|
||||
MPI *factors;
|
||||
mpi_print( stdout, generate_elg_prime(
|
||||
1, atoi(argv[1]),
|
||||
atoi(argv[2]), NULL,&factors ), 1);
|
||||
putchar('\n');
|
||||
mpi_print( stdout, factors[0], 1 ); /* print q */
|
||||
}
|
||||
else if( mode == 4 && argc == 3 ) {
|
||||
MPI g = mpi_alloc(1);
|
||||
mpi_print( stdout, generate_elg_prime(
|
||||
0, atoi(argv[1]),
|
||||
atoi(argv[2]), g, NULL ), 1);
|
||||
putchar('\n');
|
||||
mpi_print( stdout, g, 1 );
|
||||
mpi_free(g);
|
||||
}
|
||||
else
|
||||
wrong_args("--gen-prime mode bits [qbits] ");
|
||||
putchar('\n');
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef MAINTAINER_OPTIONS
|
||||
case aGenRandom:
|
||||
if( argc < 1 || argc > 2 )
|
||||
wrong_args("--gen-random level [hex]");
|
||||
{
|
||||
int c;
|
||||
int level = atoi(*argv);
|
||||
for(;;) {
|
||||
int level = argc ? atoi(*argv):0;
|
||||
int count = argc > 1 ? atoi(argv[1]): 0;
|
||||
int endless = !count;
|
||||
|
||||
if( argc < 1 || argc > 2 || level < 0 || level > 2 || count < 0 )
|
||||
wrong_args("--gen-random 0|1|2 [count]");
|
||||
|
||||
while( endless || count ) {
|
||||
byte *p;
|
||||
if( argc == 2 ) {
|
||||
p = get_random_bits( 8, level, 0);
|
||||
printf("%02x", *p );
|
||||
fflush(stdout);
|
||||
}
|
||||
else {
|
||||
p = get_random_bits( 800, level, 0);
|
||||
for(c=0; c < 100; c++ )
|
||||
putchar( p[c] );
|
||||
}
|
||||
size_t n = !endless && count < 100? count : 100;
|
||||
|
||||
p = get_random_bits( n*8, level, 0);
|
||||
fwrite( p, n, 1, stdout );
|
||||
m_free(p);
|
||||
if( !endless )
|
||||
count -= n;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* MAINTAINER OPTIONS */
|
||||
|
||||
case aPrintMD:
|
||||
if( argc < 1)
|
||||
wrong_args("--print-md algo [file]");
|
||||
else {
|
||||
int algo = string_to_digest_algo(*argv);
|
||||
wrong_args("--print-md algo [files]");
|
||||
{
|
||||
int all_algos = (**argv=='*' && !(*argv)[1]);
|
||||
int algo = all_algos? 0 : string_to_digest_algo(*argv);
|
||||
|
||||
if( !algo )
|
||||
if( !algo && !all_algos )
|
||||
log_error(_("invalid hash algorithm `%s'\n"), *argv );
|
||||
else {
|
||||
argc--; argv++;
|
||||
@ -1266,7 +1285,7 @@ main( int argc, char **argv )
|
||||
}
|
||||
break;
|
||||
|
||||
case aPrintMDs:
|
||||
case aPrintMDs: /* old option */
|
||||
if( !argc )
|
||||
print_mds(NULL,0);
|
||||
else {
|
||||
|
@ -50,6 +50,8 @@ struct {
|
||||
int def_digest_algo;
|
||||
int def_compress_algo;
|
||||
const char *def_secret_key;
|
||||
char *def_recipient;
|
||||
int def_recipient_self;
|
||||
int no_comment;
|
||||
int no_version;
|
||||
int marginals_needed;
|
||||
|
@ -22,6 +22,15 @@ $Id$
|
||||
|
||||
# default-key 621CC013
|
||||
|
||||
# If you do not pass a recipient to gpg, it will ask for one.
|
||||
# Using this option you can encrypt to a default key. key validation
|
||||
# will not be done in this case.
|
||||
# The second form uses the default key as default recipient.
|
||||
|
||||
# default-recipient some-user-id
|
||||
# default-recipient-self
|
||||
|
||||
|
||||
# The next option is enabled because this one is needed for interoperation
|
||||
# with PGP 5 users. To enable full OpenPGP compliance you have to remove
|
||||
# this option.
|
||||
@ -52,8 +61,11 @@ escape-from-lines
|
||||
# every time it is needed - normally this is not needed.
|
||||
lock-once
|
||||
|
||||
# If you have configured GnuPG without a random gatherer,
|
||||
# you have to uncomment one of the following lines.
|
||||
# If you have configured GnuPG without a random gatherer
|
||||
# (./configure --enable-static-rnd=none), you have to
|
||||
# uncomment _one_ of the following lines. These
|
||||
# extensions won't get used if you have a random gatherer
|
||||
# compiled in (which is the default for GNU and xxxBSD systems)
|
||||
#load-extension rndlinux
|
||||
#load-extension rndunix
|
||||
#load-extension rndegd
|
||||
|
176
g10/pkclist.c
176
g10/pkclist.c
@ -108,7 +108,7 @@ show_paths( ulong lid, int only_first )
|
||||
* Returns true if an ownertrust has changed.
|
||||
*/
|
||||
static int
|
||||
do_edit_ownertrust( ulong lid, int mode, unsigned *new_trust )
|
||||
do_edit_ownertrust( ulong lid, int mode, unsigned *new_trust, int defer_help )
|
||||
{
|
||||
char *p;
|
||||
int rc;
|
||||
@ -118,6 +118,7 @@ do_edit_ownertrust( ulong lid, int mode, unsigned *new_trust )
|
||||
int changed=0;
|
||||
int quit=0;
|
||||
int show=0;
|
||||
int did_help=defer_help;
|
||||
|
||||
rc = keyid_from_lid( lid, keyid );
|
||||
if( rc ) {
|
||||
@ -133,17 +134,23 @@ do_edit_ownertrust( ulong lid, int mode, unsigned *new_trust )
|
||||
return 0;
|
||||
}
|
||||
|
||||
if( !mode ) {
|
||||
tty_printf(_("No trust value assigned to %lu:\n"
|
||||
"%4u%c/%08lX %s \""), lid,
|
||||
nbits_from_pk( pk ), pubkey_letter( pk->pubkey_algo ),
|
||||
(ulong)keyid[1], datestr_from_pk( pk ) );
|
||||
p = get_user_id( keyid, &n );
|
||||
tty_print_string( p, n ),
|
||||
m_free(p);
|
||||
tty_printf("\"\n\n");
|
||||
}
|
||||
tty_printf(_(
|
||||
|
||||
for(;;) {
|
||||
/* a string with valid answers */
|
||||
char *ans = _("sSmMqQ");
|
||||
|
||||
if( !did_help ) {
|
||||
if( !mode ) {
|
||||
tty_printf(_("No trust value assigned to %lu:\n"
|
||||
"%4u%c/%08lX %s \""), lid,
|
||||
nbits_from_pk( pk ), pubkey_letter( pk->pubkey_algo ),
|
||||
(ulong)keyid[1], datestr_from_pk( pk ) );
|
||||
p = get_user_id( keyid, &n );
|
||||
tty_print_string( p, n ),
|
||||
m_free(p);
|
||||
tty_printf("\"\n\n");
|
||||
}
|
||||
tty_printf(_(
|
||||
"Please decide how far you trust this user to correctly\n"
|
||||
"verify other users' keys (by looking at passports,\n"
|
||||
"checking fingerprints from different sources...)?\n\n"
|
||||
@ -152,22 +159,21 @@ do_edit_ownertrust( ulong lid, int mode, unsigned *new_trust )
|
||||
" 3 = I trust marginally\n"
|
||||
" 4 = I trust fully\n"
|
||||
" s = please show me more information\n") );
|
||||
if( mode )
|
||||
tty_printf(_(" m = back to the main menu\n"));
|
||||
else
|
||||
tty_printf(_(" q = quit\n"));
|
||||
tty_printf("\n");
|
||||
|
||||
for(;;) {
|
||||
/* a string with valid answers */
|
||||
char *ans = _("sSmMqQ");
|
||||
|
||||
if( mode )
|
||||
tty_printf(_(" m = back to the main menu\n"));
|
||||
else
|
||||
tty_printf(_(" q = quit\n"));
|
||||
tty_printf("\n");
|
||||
did_help = 1;
|
||||
}
|
||||
if( strlen(ans) != 6 )
|
||||
BUG();
|
||||
p = cpr_get("edit_ownertrust.value",_("Your decision? "));
|
||||
trim_spaces(p);
|
||||
cpr_kill_prompt();
|
||||
if( *p && p[1] )
|
||||
if( !*p )
|
||||
did_help = 0;
|
||||
else if( *p && p[1] )
|
||||
;
|
||||
else if( !p[1] && (*p >= '1' && *p <= '4') ) {
|
||||
unsigned trust;
|
||||
@ -207,13 +213,15 @@ int
|
||||
edit_ownertrust( ulong lid, int mode )
|
||||
{
|
||||
unsigned int trust;
|
||||
int no_help = 0;
|
||||
|
||||
for(;;) {
|
||||
switch( do_edit_ownertrust( lid, mode, &trust ) ) {
|
||||
switch( do_edit_ownertrust( lid, mode, &trust, no_help ) ) {
|
||||
case -1:
|
||||
return 0;
|
||||
case -2:
|
||||
show_paths( lid, 1 );
|
||||
no_help = 1;
|
||||
break;
|
||||
case 1:
|
||||
trust &= ~TRUST_FLAG_DISABLED;
|
||||
@ -231,7 +239,7 @@ static int
|
||||
add_ownertrust_cb( ulong lid )
|
||||
{
|
||||
unsigned trust;
|
||||
int rc = do_edit_ownertrust( lid, 0, &trust );
|
||||
int rc = do_edit_ownertrust( lid, 0, &trust, 0 );
|
||||
|
||||
if( rc == 1 )
|
||||
return trust & TRUST_MASK;
|
||||
@ -560,6 +568,42 @@ key_present_in_pk_list(PK_LIST pk_list, PKT_public_key *pk)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/****************
|
||||
* Return a malloced string with a default reciepient if there is any
|
||||
*/
|
||||
static char *
|
||||
default_recipient(void)
|
||||
{
|
||||
PKT_secret_key *sk;
|
||||
byte fpr[MAX_FINGERPRINT_LEN+1];
|
||||
size_t n;
|
||||
char *p;
|
||||
int i;
|
||||
|
||||
if( opt.def_recipient )
|
||||
return m_strdup( opt.def_recipient );
|
||||
if( !opt.def_recipient_self )
|
||||
return NULL;
|
||||
sk = m_alloc_clear( sizeof *sk );
|
||||
i = get_seckey_byname( sk, NULL, 0 );
|
||||
if( i ) {
|
||||
free_secret_key( sk );
|
||||
return NULL;
|
||||
}
|
||||
n = MAX_FINGERPRINT_LEN;
|
||||
fingerprint_from_sk( sk, fpr, &n );
|
||||
free_secret_key( sk );
|
||||
p = m_alloc( 2*n+3 );
|
||||
*p++ = '0';
|
||||
*p++ = 'x';
|
||||
for(i=0; i < n; i++ )
|
||||
sprintf( p+2*i, "%02X", fpr[i] );
|
||||
p -= 2;
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
|
||||
{
|
||||
@ -568,6 +612,7 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
|
||||
int rc=0;
|
||||
int any_recipients=0;
|
||||
STRLIST rov;
|
||||
char *def_rec = NULL;
|
||||
|
||||
/* check whether there are any recipients in the list and build the
|
||||
* list of the encrypt-to ones (we always trust them) */
|
||||
@ -608,16 +653,26 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
|
||||
|
||||
if( !any_recipients && !opt.batch ) { /* ask */
|
||||
char *answer=NULL;
|
||||
int have_def_rec;
|
||||
|
||||
tty_printf(_(
|
||||
def_rec = default_recipient();
|
||||
have_def_rec = !!def_rec;
|
||||
if( !have_def_rec )
|
||||
tty_printf(_(
|
||||
"You did not specify a user ID. (you may use \"-r\")\n\n"));
|
||||
for(;;) {
|
||||
rc = 0;
|
||||
m_free(answer);
|
||||
answer = cpr_get_utf8("pklist.user_id.enter",
|
||||
_("Enter the user ID: "));
|
||||
trim_spaces(answer);
|
||||
cpr_kill_prompt();
|
||||
if( have_def_rec ) {
|
||||
answer = def_rec;
|
||||
def_rec = NULL;
|
||||
}
|
||||
else {
|
||||
answer = cpr_get_utf8("pklist.user_id.enter",
|
||||
_("Enter the user ID: "));
|
||||
trim_spaces(answer);
|
||||
cpr_kill_prompt();
|
||||
}
|
||||
if( !*answer )
|
||||
break;
|
||||
if( pk )
|
||||
@ -628,20 +683,8 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
|
||||
if( rc )
|
||||
tty_printf(_("No such user ID.\n"));
|
||||
else if( !(rc=check_pubkey_algo2(pk->pubkey_algo, use)) ) {
|
||||
int trustlevel;
|
||||
|
||||
rc = check_trust( pk, &trustlevel, NULL, NULL, NULL );
|
||||
if( rc ) {
|
||||
log_error("error checking pk of `%s': %s\n",
|
||||
answer, g10_errstr(rc) );
|
||||
}
|
||||
else if( (trustlevel & TRUST_FLAG_DISABLED) ) {
|
||||
tty_printf(_("Public key is disabled.\n") );
|
||||
}
|
||||
else if( do_we_trust_pre( pk, trustlevel ) ) {
|
||||
PK_LIST r;
|
||||
|
||||
r = m_alloc( sizeof *r );
|
||||
if( have_def_rec ) {
|
||||
PK_LIST r = m_alloc( sizeof *r );
|
||||
r->pk = pk; pk = NULL;
|
||||
r->next = pk_list;
|
||||
r->mark = 0;
|
||||
@ -649,7 +692,32 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
|
||||
any_recipients = 1;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
int trustlevel;
|
||||
|
||||
rc = check_trust( pk, &trustlevel, NULL, NULL, NULL );
|
||||
if( rc ) {
|
||||
log_error("error checking pk of `%s': %s\n",
|
||||
answer, g10_errstr(rc) );
|
||||
}
|
||||
else if( (trustlevel & TRUST_FLAG_DISABLED) ) {
|
||||
tty_printf(_("Public key is disabled.\n") );
|
||||
}
|
||||
else if( do_we_trust_pre( pk, trustlevel ) ) {
|
||||
PK_LIST r;
|
||||
|
||||
r = m_alloc( sizeof *r );
|
||||
r->pk = pk; pk = NULL;
|
||||
r->next = pk_list;
|
||||
r->mark = 0;
|
||||
pk_list = r;
|
||||
any_recipients = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_free(def_rec); def_rec = NULL;
|
||||
have_def_rec = 0;
|
||||
}
|
||||
m_free(answer);
|
||||
if( pk ) {
|
||||
@ -657,6 +725,26 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
|
||||
pk = NULL;
|
||||
}
|
||||
}
|
||||
else if( !any_recipients && (def_rec = default_recipient()) ) {
|
||||
pk = m_alloc_clear( sizeof *pk );
|
||||
pk->pubkey_usage = use;
|
||||
rc = get_pubkey_byname( NULL, pk, def_rec, NULL );
|
||||
if( rc )
|
||||
log_error(_("unknown default recipient `s'\n"), def_rec );
|
||||
else if( !(rc=check_pubkey_algo2(pk->pubkey_algo, use)) ) {
|
||||
PK_LIST r = m_alloc( sizeof *r );
|
||||
r->pk = pk; pk = NULL;
|
||||
r->next = pk_list;
|
||||
r->mark = 0;
|
||||
pk_list = r;
|
||||
any_recipients = 1;
|
||||
}
|
||||
if( pk ) {
|
||||
free_public_key( pk );
|
||||
pk = NULL;
|
||||
}
|
||||
m_free(def_rec); def_rec = NULL;
|
||||
}
|
||||
else {
|
||||
any_recipients = 0;
|
||||
for(; remusr; remusr = remusr->next ) {
|
||||
|
@ -1624,7 +1624,7 @@ update_trustdb()
|
||||
ulong count=0, err_count=0, new_count=0;
|
||||
|
||||
while( !(rc = enum_keyblocks( 1, &kbpos, &keyblock )) ) {
|
||||
int modified;
|
||||
/*int modified;*/
|
||||
TRUSTREC drec;
|
||||
PKT_public_key *pk = find_kbnode( keyblock, PKT_PUBLIC_KEY )
|
||||
->pkt->pkt.public_key;
|
||||
|
@ -9,10 +9,8 @@ DISTCLEANFILES = mpih-add1.S mpih-mul1.S mpih-mul2.S mpih-mul3.S \
|
||||
mpih-lshift.S mpih-rshift.S mpih-sub1.S asm-syntax.h sysdep.h
|
||||
CLEANFILES = tmp-*.s
|
||||
|
||||
|
||||
noinst_LTLIBRARIES = libmpi.la
|
||||
|
||||
|
||||
libmpi_la_LDFLAGS =
|
||||
libmpi_la_SOURCES = longlong.h \
|
||||
mpi-add.c \
|
||||
|
@ -1,6 +1,10 @@
|
||||
Tue Jun 29 21:44:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
Tue Jul 13 17:39:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
|
||||
* de.po: Updated (Walter)
|
||||
|
||||
Tue Jun 29 21:44:25 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* it.po: Updated (Marco).
|
||||
|
||||
Sat Jun 26 12:15:59 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
Loading…
x
Reference in New Issue
Block a user