/[winpt]/trunk/Src/wptKeylist.cpp
ViewVC logotype

Diff of /trunk/Src/wptKeylist.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 105 by twoaday, Wed Nov 30 10:22:00 2005 UTC revision 128 by twoaday, Mon Dec 19 13:05:59 2005 UTC
# Line 18  Line 18 
18   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
19   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA   * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20   */   */
21    
22  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
23  #include <config.h>  #include <config.h>
24  #endif  #endif
# Line 168  get_selfsig (gpgme_user_id_t uid, const Line 169  get_selfsig (gpgme_user_id_t uid, const
169  }  }
170    
171    
172    const char*
173    get_key_pubalgo2 (gpgme_pubkey_algo_t alg)
174    {
175        switch (alg) {
176        case GPGME_PK_DSA: return "D";
177        case GPGME_PK_RSA: return "R";
178        case GPGME_PK_ELG: return "G";
179        default: return "?";
180        }
181        return "?";
182    }
183    
184  const char*  const char*
185  get_key_algo (gpgme_key_t key, int keyidx)  get_key_algo (gpgme_key_t key, int keyidx)
# Line 358  get_key_status (gpgme_key_t key, int uid Line 370  get_key_status (gpgme_key_t key, int uid
370          uididx = 0;          uididx = 0;
371      if (listmode) {      if (listmode) {
372          const char *s;          const char *s;
           
373          if (key->revoked)          if (key->revoked)
374              s = _("Revoked");              s = _("Revoked");
375          else if (key->expired)          else if (key->expired)
# Line 367  get_key_status (gpgme_key_t key, int uid Line 378  get_key_status (gpgme_key_t key, int uid
378              s = _("Disabled");              s = _("Disabled");
379          else          else
380              s = "";              s = "";
           
381          /* if the key has a special status, we don't continue to figure out          /* if the key has a special status, we don't continue to figure out
382             what any user-id validities. */             what any user-id validities. */
383          if (*s)          if (*s)
# Line 472  keylist_cmp_cb (LPARAM first, LPARAM sec Line 482  keylist_cmp_cb (LPARAM first, LPARAM sec
482  static const char*  static const char*
483  calc_validity (gpg_group_t grp)  calc_validity (gpg_group_t grp)
484  {  {
485      int valid=0;      int valid = 0;
486      gpg_member_t mbr;      gpg_member_t mbr;
487      gpgme_key_t key;      gpgme_key_t key;
488    
# Line 546  keylist_build (listview_ctrl_t *r_lv, HW Line 556  keylist_build (listview_ctrl_t *r_lv, HW
556      listview_ctrl_t lv;      listview_ctrl_t lv;
557      listview_column_t col;      listview_column_t col;
558      int j, n = 0;      int j, n = 0;
     int kl_nolist = 0;  
559      int rc = 0;      int rc = 0;
560            
561      rc = listview_new (&lv);      rc = listview_new (&lv);
# Line 676  do_addkey (listview_ctrl_t lv, gpgme_key Line 685  do_addkey (listview_ctrl_t lv, gpgme_key
685      /* we check the pubkey algorithm here to make sure that no ElGamal      /* we check the pubkey algorithm here to make sure that no ElGamal
686         sign+encrypt key is used in _any_ mode */         sign+encrypt key is used in _any_ mode */
687      if (list != 1 && key->subkeys->pubkey_algo == GPGME_PK_ELG) {      if (list != 1 && key->subkeys->pubkey_algo == GPGME_PK_ELG) {
688          log_debug ("ElGamal (E+S) key found: %s (%s)\n",          log_debug ("ElGamal (E+S) key found: %s (%s)\n",
689                     key->uids->name, key->subkeys->keyid);                     key->uids->name, key->subkeys->keyid);
690          return 0;          return 0;
691      }      }
692    
693                    
694      if (listview_add_item2 (lv, " ", (void *)key))            if (listview_add_item2 (lv, " ", (void *)key))
695          return WPTERR_GENERAL;          return WPTERR_GENERAL;
696            
697      attr = key->uids->uid;      attr = key->uids->uid;
698      memset (&lvi, 0, sizeof lvi);      memset (&lvi, 0, sizeof lvi);
699      lvi.mask = LVIF_TEXT | LVIF_PARAM;      lvi.mask = LVIF_TEXT | LVIF_PARAM;
700      lvi.pszText = (char *)attr;      lvi.pszText = (char *)attr;
701      lvi.lParam = (LPARAM )key;      lvi.lParam = (LPARAM )key;
702      if (ListView_SetItem( lv->ctrl, &lvi ) == FALSE)      if (ListView_SetItem (lv->ctrl, &lvi) == FALSE)
703          return WPTERR_GENERAL;          return WPTERR_GENERAL;
704                    
705      if (uididx == -1) { /* request the primary user-id of the key. */      if (uididx == -1) { /* request the primary user-id of the key. */
# Line 826  keylist_add_key (listview_ctrl_t lv, int Line 835  keylist_add_key (listview_ctrl_t lv, int
835          if (mode & KEYLIST_ALL) {          if (mode & KEYLIST_ALL) {
836              uids = count_userids (key);              uids = count_userids (key);
837              rc = do_addkey (lv, key, uids, i, 0);              rc = do_addkey (lv, key, uids, i, 0);
838              if( rc )              if (rc)
839                  return rc;                  return rc;
840          }          }
841          else if (mode & KEYLIST_LIST)          else if (mode & KEYLIST_LIST)
# Line 839  keylist_add_key (listview_ctrl_t lv, int Line 848  keylist_add_key (listview_ctrl_t lv, int
848                          return rc;                          return rc;
849                  }                  }
850                  else {                  else {
851                      for( uids = 0;  uids < count_userids (key); uids++ ) {                      for (uids = 0;  uids < count_userids (key); uids++) {
852                          rc = do_addkey( lv, key, uids, i, -1 );                          rc = do_addkey (lv, key, uids, i, -1);
853                          if( rc )                          if (rc)
854                              return rc;                              return rc;
855                      }                      }
856                  }                  }

Legend:
Removed from v.105  
changed lines
  Added in v.128

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26