* options.h, g10.c (main), keyserver.c (keyserver_refresh): Maintain and
authorDavid Shaw <dshaw@jabberwocky.com>
Tue, 2 Jul 2002 22:13:00 +0000 (22:13 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Tue, 2 Jul 2002 22:13:00 +0000 (22:13 +0000)
use the original keyserver URI for cosmetics rather than trying to
recreate it when needed.

* mainproc.c (check_sig_and_print): Properly disregard expired uids.
Make sure that the first uid listed is a real uid and not an attribute
(attributes should only be listed in the "aka" section).  When there are
no valid textual userids, try for an invalid textual userid before using
any attribute uid.

g10/ChangeLog
g10/g10.c
g10/keyserver.c
g10/mainproc.c
g10/options.h

index 800af35..d959c51 100644 (file)
@@ -1,3 +1,15 @@
+2002-07-02  David Shaw  <dshaw@jabberwocky.com>
+
+       * options.h, g10.c (main), keyserver.c (keyserver_refresh):
+       Maintain and use the original keyserver URI for cosmetics rather
+       than trying to recreate it when needed.
+
+       * mainproc.c (check_sig_and_print): Properly disregard expired
+       uids.  Make sure that the first uid listed is a real uid and not
+       an attribute (attributes should only be listed in the "aka"
+       section).  When there are no valid textual userids, try for an
+       invalid textual userid before using any attribute uid.
+
 2002-07-01  David Shaw  <dshaw@jabberwocky.com>
 
        * options.skel: Fix a few typos, clarify "group", and remove
index b8cae1b..641cde6 100644 (file)
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -1322,6 +1322,7 @@ main( int argc, char **argv )
 #endif /* __riscos__ */
             break;
          case oKeyServer:
+           opt.keyserver_uri=m_strdup(pargs.r.ret_str);
            if(parse_keyserver_uri(pargs.r.ret_str,configname,configlineno))
              log_error(_("could not parse keyserver URI\n"));
            break;
index 9338bfb..df7ef48 100644 (file)
@@ -905,9 +905,9 @@ keyserver_refresh(STRLIST users)
     return rc;
 
   if(count==1)
-    log_info(_("%d key to refresh\n"),count);
+    log_info(_("refreshing 1 key from %s\n"),opt.keyserver_uri);
   else
-    log_info(_("%d keys to refresh\n"),count);
+    log_info(_("refreshing %d keys from %s\n"),count,opt.keyserver_uri);
 
   if(count>0)
     rc=keyserver_work(GET,NULL,desc,count);
index bcd1c1c..d700033 100644 (file)
@@ -1333,8 +1333,13 @@ check_sig_and_print( CTX c, KBNODE node )
                continue;
             if ( un->pkt->pkt.user_id->is_revoked )
                 continue;
-            if ( !un->pkt->pkt.user_id->is_primary )
+            if ( un->pkt->pkt.user_id->is_expired )
                 continue;
+           if ( !un->pkt->pkt.user_id->is_primary )
+               continue;
+           /* We want the textual user ID here */
+           if ( un->pkt->pkt.user_id->attrib_data )
+               continue;
             
             keyid_str[17] = 0; /* cut off the "[uncertain]" part */
             write_status_text_and_buffer (statno, keyid_str,
@@ -1350,12 +1355,23 @@ check_sig_and_print( CTX c, KBNODE node )
            fputs("\"\n", log_stream() );
             count++;
        }
-       if( !count ) {  /* just in case that we have no userid */
+       if( !count ) {  /* just in case that we have no valid textual
+                           userid */
+           /* Try for an invalid textual userid */
             for( un=keyblock; un; un = un->next ) {
-                if( un->pkt->pkttype == PKT_USER_ID )
+                if( un->pkt->pkttype == PKT_USER_ID &&
+                   !un->pkt->pkt.user_id->attrib_data )
                     break;
             }
 
+           /* Try for any userid at all */
+           if(!un) {
+               for( un=keyblock; un; un = un->next ) {
+                    if( un->pkt->pkttype == PKT_USER_ID )
+                        break;
+               }
+           }
+
             if (opt.always_trust || !un)
                 keyid_str[17] = 0; /* cut off the "[uncertain]" part */
 
@@ -1384,9 +1400,13 @@ check_sig_and_print( CTX c, KBNODE node )
                 if( un->pkt->pkttype != PKT_USER_ID )
                     continue;
                 if ( un->pkt->pkt.user_id->is_revoked )
-                    continue; 
-                if ( un->pkt->pkt.user_id->is_primary )
                     continue;
+                if ( un->pkt->pkt.user_id->is_expired )
+                    continue;
+               /* Only skip textual primaries */
+                if ( un->pkt->pkt.user_id->is_primary &&
+                    !un->pkt->pkt.user_id->attrib_data )
+                   continue;
 
                log_info(    _("                aka \""));
                 print_utf8_string( log_stream(), un->pkt->pkt.user_id->name,
index 74cebe5..c1e131f 100644 (file)
@@ -111,6 +111,7 @@ struct {
     int not_dash_escaped;
     int escape_from;
     int lock_once;
+    char *keyserver_uri;
     char *keyserver_scheme;
     char *keyserver_host;
     char *keyserver_port;