mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* packet.h, trustdb.h, trustdb.c (trust_string): New. Return a string
like "fully trusted", "marginally trusted", etc. (get_min_ownertrust): New. Return minimum ownertrust. (update_min_ownertrust): New. Set minimum ownertrust. (check_regexp): New. Check a regular epression against a user ID. (ask_ownertrust): Allow specifying a minimum value. (get_ownertrust_info): Follow the minimum ownertrust when returning a letter. (clear_validity): Remove minimum ownertrust when a key becomes invalid. (release_key_items): Release regexp along with the rest of the info. (validate_one_keyblock, validate_keys): Build a trust sig chain while validating. Call check_regexp for regexps. Use the minimum ownertrust if the user does not specify a genuine ownertrust. * pkclist.c (do_edit_ownertrust): Only allow user to select a trust level greater than the minimum value. * parse-packet.c (can_handle_critical): Can handle critical trust and regexp subpackets. * trustdb.h, trustdb.c (clear_ownertrusts), delkey.c (do_delete_key), import.c (import_one): Rename clear_ownertrust to clear_ownertrusts and have it clear the min_ownertrust value as well. * keylist.c (list_keyblock_print): Indent uid to match pub and sig.
This commit is contained in:
parent
de9c6b3169
commit
09158d1e99
9 changed files with 334 additions and 37 deletions
|
@ -245,7 +245,18 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
|
|||
int changed=0;
|
||||
int quit=0;
|
||||
int show=0;
|
||||
int min_num;
|
||||
int did_help=defer_help;
|
||||
unsigned int minimum=get_min_ownertrust(pk);
|
||||
|
||||
switch(minimum)
|
||||
{
|
||||
default: min_num=0; break;
|
||||
case TRUST_UNDEFINED: min_num=1; break;
|
||||
case TRUST_NEVER: min_num=2; break;
|
||||
case TRUST_MARGINAL: min_num=3; break;
|
||||
case TRUST_FULLY: min_num=4; break;
|
||||
}
|
||||
|
||||
keyid_from_pk (pk, keyid);
|
||||
for(;;) {
|
||||
|
@ -299,10 +310,14 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
|
|||
"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"));
|
||||
tty_printf (_(" %d = Don't know\n"), 1);
|
||||
tty_printf (_(" %d = I do NOT trust\n"), 2);
|
||||
tty_printf (_(" %d = I trust marginally\n"), 3);
|
||||
tty_printf (_(" %d = I trust fully\n"), 4);
|
||||
if(min_num<=1)
|
||||
tty_printf (_(" %d = I don't know\n"), 1);
|
||||
if(min_num<=2)
|
||||
tty_printf (_(" %d = I do NOT trust\n"), 2);
|
||||
if(min_num<=3)
|
||||
tty_printf (_(" %d = I trust marginally\n"), 3);
|
||||
if(min_num<=4)
|
||||
tty_printf (_(" %d = I trust fully\n"), 4);
|
||||
if (mode)
|
||||
tty_printf (_(" %d = I trust ultimately\n"), 5);
|
||||
#if 0
|
||||
|
@ -317,6 +332,9 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
|
|||
tty_printf(_(" q = quit\n"));
|
||||
}
|
||||
tty_printf("\n");
|
||||
if(minimum)
|
||||
tty_printf(_("The minimum trust level for this key is: %s\n\n"),
|
||||
trust_string(minimum));
|
||||
did_help = 1;
|
||||
}
|
||||
if( strlen(ans) != 8 )
|
||||
|
@ -328,7 +346,7 @@ do_edit_ownertrust (PKT_public_key *pk, int mode,
|
|||
did_help = 0;
|
||||
else if( *p && p[1] )
|
||||
;
|
||||
else if( !p[1] && (*p >= '1' && *p <= (mode?'5':'4')) )
|
||||
else if( !p[1] && ((*p >= '0'+min_num) && *p <= (mode?'5':'4')) )
|
||||
{
|
||||
unsigned int trust;
|
||||
switch( *p )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue