diff options
author | David Shaw <[email protected]> | 2002-10-30 03:11:57 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-10-30 03:11:57 +0000 |
commit | 09158d1e990cbd27e676f07c2381a1a586637d19 (patch) | |
tree | 3ff2290c91240f1bceb488679d2a82eeecbdd865 /g10/pkclist.c | |
parent | * configure.ac: Add --disable-regex in case some platform just can't (diff) | |
download | gnupg-09158d1e990cbd27e676f07c2381a1a586637d19.tar.gz gnupg-09158d1e990cbd27e676f07c2381a1a586637d19.zip |
* 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.
Diffstat (limited to 'g10/pkclist.c')
-rw-r--r-- | g10/pkclist.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/g10/pkclist.c b/g10/pkclist.c index cb1c506e3..e54d4d535 100644 --- a/g10/pkclist.c +++ b/g10/pkclist.c @@ -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 ) |