From: Jameson Graef Rollins Date: Tue, 17 Jun 2008 00:00:46 +0000 (-0400) Subject: Merge branch 'master' into no-cache X-Git-Tag: monkeysphere_0.1-1~19^2~4 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e619b23879fde5703da435141754324dcf7cfa53;p=monkeysphere.git Merge branch 'master' into no-cache Conflicts: src/common src/monkeysphere src/monkeysphere-ssh-proxycommand --- e619b23879fde5703da435141754324dcf7cfa53 diff --cc src/common index 8b078d6,d1554a6..64d28cb --- a/src/common +++ b/src/common @@@ -167,22 -167,22 +168,25 @@@ process_user_id() fi requiredPubCapability=$(echo "$requiredCapability" | tr "[:lower:]" "[:upper:]") - # fetch keys from keyserver, return 1 if none found - gpg_fetch_userid "$userID" || return 1 + # if CHECK_KEYSERVER variable set, check the keyserver + # for the user ID + if [ "$CHECK_KEYSERVER" = "true" ] ; then + gpg_fetch_userid "$userID" + fi # output gpg info for (exact) userid and store - gpgOut=$(gpg --fixed-list-mode --list-key --with-colons \ - ="$userID" 2> /dev/null) - - # return 1 if there only "tru" lines are output from gpg - if [ -z "$(echo "$gpgOut" | grep -v '^tru:')" ] ; then - log " key not found in keychain." - return 1 + gpgOut=$(gpg --list-key --fixed-list-mode --with-colon \ + --with-fingerprint --with-fingerprint \ + ="$userID" 2>/dev/null) + + # if the gpg query return code is not 0, return 1 + if [ "$?" -ne 0 ] ; then + log " key not found." + return 1 fi + echo "$gpgOut" + # loop over all lines in the gpg output and process. # need to do it this way (as opposed to "while read...") so that # variables set in loop will be visible outside of loop diff --cc src/monkeysphere index 91401b9,230de06..8e4c4eb --- a/src/monkeysphere +++ b/src/monkeysphere @@@ -157,7 -158,7 +158,7 @@@ case $COMMAND i failure "known_hosts file '$USER_KNOWN_HOSTS' is empty." fi log "processing known_hosts file..." - process_known_hosts "$USER_KNOWN_HOSTS" - process_known_hosts "$hostKeysCacheDir" ++ process_known_hosts fi ;; diff --cc src/monkeysphere-ssh-proxycommand index ec162ab,3887e48..4b90a0d --- a/src/monkeysphere-ssh-proxycommand +++ b/src/monkeysphere-ssh-proxycommand @@@ -40,11 -40,12 +40,14 @@@ f # check for the host key in the known_hosts file hostKey=$(ssh-keygen -F "$HOST") - # if the host key is not found in the known_hosts file, - # check the keyserver - if [ -z "$hostKey" ] ; then + # if the host key is found in the known_hosts file, + # don't check the keyserver + if [ "$hostKey" ] ; then + CHECK_KEYSERVER="false" ++else + CHECK_KEYSERVER="true" fi + export CHECK_KEYSERVER # update the known_hosts file for the host monkeysphere update-known-hosts "$HOST"