2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
4 # Monkeysphere authentication list-certifiers subcommand
6 # The monkeysphere scripts are written by:
7 # Jameson Rollins <jrollins@finestructure.net>
8 # Jamie McClelland <jm@mayfirst.org>
9 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
11 # They are Copyright 2008-2009, and are all released under the GPL,
14 # list the host certifiers
25 # find trusted keys in sphere keychain
26 log debug "finding trusted keys..."
28 # FIXME: this assumes that the keygrip (16 hex chars) is unique; we're
29 # only searching by keygrip at the moment.
31 authgrip=$(core_fingerprint | cut -b 25-40)
33 # We're walking the list of known signatures, and extracting all trust
34 # signatures made by the core fingerprint and known to the sphere
37 # for each one of these, we're printing (colon-delimited): the
38 # fingerprint, the trust depth, the trust level (60 == marginal, 120
39 # == full), and the domain regex (if any):
41 gpg_sphere "--fingerprint --with-colons --fixed-list-mode --check-sigs" | \
42 cut -f 1,2,5,8,9,10 -d: | \
43 egrep '^(fpr:::::|uat:|uid:|sig:!:'"$authgrip"':[[:digit:]]+ [[:digit:]]+:)' | \
44 while IFS=: read -r type validity grip trustparams trustdomain fpr ; do
46 'fpr') # this is a new key
51 'uid') # here comes a user id (if we don't have a key, or the
52 # uid has no calculated validity, we will not bother
54 if [ "$keyfpr" ] && [ "$validity" = 'f' ] ; then
60 'uat') # this is a user attribute. DETAILS.gz states that the
61 # 10th field is the number of user attribute
62 # subpackets, followed by the total number of bytes of
64 if [ "$keyfpr" ] && [ "$validity" = 'f' ] ; then
65 uid=$(printf "%d JPEG(?) image(s), total %d bytes" \
66 "${fpr%% *}" "${fpr##* }")
71 'sig') # print all trust signatures, including regexes if
72 # present, assuming that
73 if [ "$keyfpr" ] && [ "$uid" ] ; then
74 trustdepth=${trustparams%% *}
75 trustlevel=${trustparams##* }
76 if [ "$printedfpr" = no ] ; then
77 printf "%s:\n" "$keyfpr"
81 # FIXME: this is clumsy and not human-friendly. we should
82 # print out more human-readable information, if possible.
83 printf " :%s:%d:%d:%s\n" "$uid" "$trustdepth" "$trustlevel" "$trustdomain"