* pubkey-enc.c (get_session_key, get_it), keyedit.c
authorDavid Shaw <dshaw@jabberwocky.com>
Thu, 20 May 2004 02:51:23 +0000 (02:51 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Thu, 20 May 2004 02:51:23 +0000 (02:51 +0000)
(show_key_with_all_names, show_basic_key_info): --keyid-format conversion.

g10/ChangeLog
g10/keyedit.c
g10/pubkey-enc.c

index 8aae030..96d663b 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-19  David Shaw  <dshaw@jabberwocky.com>
+
+       * pubkey-enc.c (get_session_key, get_it), keyedit.c
+       (show_key_with_all_names, show_basic_key_info): --keyid-format
+       conversion.
+
 2004-05-18  David Shaw  <dshaw@jabberwocky.com>
 
        * sign.c (update_keysig_packet): Policies and notations should be
index 9b7638b..ba5020e 100644 (file)
@@ -2109,18 +2109,20 @@ show_key_with_all_names( KBNODE keyblock, int only_marked, int with_revoker,
              }
        }
        else if( node->pkt->pkttype == PKT_SECRET_KEY
-           || (with_subkeys && node->pkt->pkttype == PKT_SECRET_SUBKEY) ) {
+           || (with_subkeys && node->pkt->pkttype == PKT_SECRET_SUBKEY) )
+         {
            PKT_secret_key *sk = node->pkt->pkt.secret_key;
-           tty_printf(_("%s%c %4u%c/%08lX  created: %s expires: %s"),
-                         node->pkt->pkttype == PKT_SECRET_KEY? "sec":"ssb",
-                         (node->flag & NODFLG_SELKEY)? '*':' ',
-                         nbits_from_sk( sk ),
-                         pubkey_letter( sk->pubkey_algo ),
-                         (ulong)keyid_from_sk(sk,NULL),
-                         datestr_from_sk(sk),
-                         expirestr_from_sk(sk) );
+           tty_printf("%s%c %4u%c/%s  ",
+                      node->pkt->pkttype == PKT_SECRET_KEY? "sec":"ssb",
+                      (node->flag & NODFLG_SELKEY)? '*':' ',
+                      nbits_from_sk( sk ),
+                      pubkey_letter( sk->pubkey_algo ),
+                      keystr_from_sk(sk));
+           tty_printf(_("created: %s"),datestr_from_sk(sk));
+           tty_printf("  ");
+           tty_printf(_("expires: %s"),expirestr_from_sk(sk));
            tty_printf("\n");
-       }
+         }
        else if( with_subkeys && node->pkt->pkttype == PKT_SIGNATURE
                 && node->pkt->pkt.signature->sig_class == 0x28       ) {
            PKT_signature *sig = node->pkt->pkt.signature;
@@ -2214,14 +2216,14 @@ show_basic_key_info ( KBNODE keyblock )
           
           /* Note, we use the same format string as in other show
              functions to make the translation job easier. */
-          tty_printf (_("%s%c %4u%c/%08lX  created: %s expires: %s"),
+          tty_printf ("%s  %4u%c/%s  ",
                       node->pkt->pkttype == PKT_PUBLIC_KEY? "pub":"sub",
-                      ' ',
                       nbits_from_pk( pk ),
                       pubkey_letter( pk->pubkey_algo ),
-                      (ulong)keyid_from_pk(pk,NULL),
-                      datestr_from_pk(pk),
-                      expirestr_from_pk(pk) );
+                      keystr_from_pk(pk));
+         tty_printf(_("created: %s"),datestr_from_pk(pk));
+         tty_printf("  ");
+         tty_printf(_("expires: %s"),expirestr_from_pk(pk));
           tty_printf("\n");
           print_fingerprint ( pk, NULL, 3 );
           tty_printf("\n");
@@ -2229,14 +2231,14 @@ show_basic_key_info ( KBNODE keyblock )
       else if (node->pkt->pkttype == PKT_SECRET_KEY)
         {
           PKT_secret_key *sk = node->pkt->pkt.secret_key;
-          tty_printf(_("%s%c %4u%c/%08lX  created: %s expires: %s"),
+          tty_printf("%s  %4u%c/%s",
                      node->pkt->pkttype == PKT_SECRET_KEY? "sec":"ssb",
-                     ' ',
                      nbits_from_sk( sk ),
                      pubkey_letter( sk->pubkey_algo ),
-                     (ulong)keyid_from_sk(sk,NULL),
-                     datestr_from_sk(sk),
-                     expirestr_from_sk(sk) );
+                     keystr_from_sk(sk));
+         tty_printf(_("created: %s"),datestr_from_sk(sk));
+         tty_printf("  ");
+         tty_printf(_("expires: %s"),expirestr_from_sk(sk));
           tty_printf("\n");
           print_fingerprint (NULL, sk, 3 );
           tty_printf("\n");
index d61bd01..02a0913 100644 (file)
@@ -100,8 +100,8 @@ get_session_key( PKT_pubkey_enc *k, DEK *dek )
            if( sk->pubkey_algo != k->pubkey_algo )
                continue;
            keyid_from_sk( sk, keyid );
-           log_info(_("anonymous recipient; trying secret key %08lX ...\n"),
-                     (ulong)keyid[1] );
+           log_info(_("anonymous recipient; trying secret key %s ...\n"),
+                     keystr(keyid));
 
            if(!opt.try_all_secrets && !is_status_enabled())
              {
@@ -283,8 +283,8 @@ get_it( PKT_pubkey_enc *enc, DEK *dek, PKT_secret_key *sk, u32 *keyid )
             if (!pk)
                 BUG ();
             if ( pk->expiredate && pk->expiredate <= make_timestamp() ) {
-                log_info(_("NOTE: secret key %08lX expired at %s\n"),
-                         (ulong)keyid[1], asctimestamp( pk->expiredate) );
+                log_info(_("NOTE: secret key %s expired at %s\n"),
+                         keystr(keyid), asctimestamp( pk->expiredate) );
             }
         }