/[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 48 by werner, Mon Oct 31 21:14:11 2005 UTC revision 73 by twoaday, Tue Nov 8 07:15:13 2005 UTC
# Line 297  get_key_pubalgo (gpgme_pubkey_algo_t alg Line 297  get_key_pubalgo (gpgme_pubkey_algo_t alg
297      case GPGME_PK_ELG:      case GPGME_PK_ELG:
298      case GPGME_PK_ELG_E: return "ELG";      case GPGME_PK_ELG_E: return "ELG";
299      case GPGME_PK_RSA: return "RSA";      case GPGME_PK_RSA: return "RSA";
300        default: return "???";
301      }      }
302      return "???";      return "???";
303  }  }
# Line 368  get_key_trust_str (int val) Line 369  get_key_trust_str (int val)
369  }  }
370    
371    
372    /* Return the status of the key @key. */
373  char*  char*
374  get_key_status (gpgme_key_t key, int uididx, int listmode)  get_key_status (gpgme_key_t key, int uididx, int listmode)
375  {  {
376      gpgme_user_id_t u;      gpgme_user_id_t u;
377      char * p;      const char *attr;
     const char * attr;  
     int i = 0;  
378      u32 key_attr =0;      u32 key_attr =0;
379    
380      if (uididx < 0 || count_userids (key) > uididx)      if (uididx < 0 || count_userids (key) > uididx)
# Line 399  get_key_status (gpgme_key_t key, int uid Line 399  get_key_status (gpgme_key_t key, int uid
399      u = get_nth_userid (key, uididx);      u = get_nth_userid (key, uididx);
400      key_attr = u->validity;      key_attr = u->validity;
401      attr = get_key_trust2 (NULL, key_attr, 0, 0);      attr = get_key_trust2 (NULL, key_attr, 0, 0);
402      /* FIXME: Why not just strdup and why does this function either      return m_strdup (attr);
403       * return a new allocated or an m_strdup allocated string?  This  }
      * is very dangerous!!! */  
     p = new char[strlen( attr ) + 2];  
     if (!p)  
         BUG (NULL);  
     strcpy (p, attr);  
     return p;  
 } /* get_key_status */  
404    
405    
406  /* Integer comparsion of @a and @b.  /* Integer comparsion of @a and @b.
# Line 502  keylist_cmp_cb (LPARAM first, LPARAM sec Line 495  keylist_cmp_cb (LPARAM first, LPARAM sec
495  static const char*  static const char*
496  calc_validity (gpg_group_t grp)  calc_validity (gpg_group_t grp)
497  {  {
498      int level = 0, valid;      int valid=0;
499      gpg_member_t mbr;      gpg_member_t mbr;
500      gpgme_key_t key;      gpgme_key_t key;
501    
# Line 555  keylist_build (listview_ctrl_t *r_lv, HW Line 548  keylist_build (listview_ctrl_t *r_lv, HW
548      listview_ctrl_t lv;      listview_ctrl_t lv;
549      listview_column_t col;      listview_column_t col;
550      int j, n = 0;      int j, n = 0;
551      int kl_nolist = 0, rc = 0;      int rc = 0;
552            
553      rc = listview_new (&lv);      rc = listview_new (&lv);
554      if( rc )      if( rc )
# Line 819  keylist_upd_key (listview_ctrl_t lv, int Line 812  keylist_upd_key (listview_ctrl_t lv, int
812  int  int
813  keylist_add_key (listview_ctrl_t lv, int mode, gpgme_key_t key)  keylist_add_key (listview_ctrl_t lv, int mode, gpgme_key_t key)
814  {  {
815      int uids, rc = 0, i, n = 0;      int uids, rc = 0, i;
816      gpgme_subkey_t k;      gpgme_subkey_t k;
817    
818      /* if the entire key is disabled, just return. */      /* if the entire key is disabled, just return. */

Legend:
Removed from v.48  
changed lines
  Added in v.73

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26