/[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 205 by twoaday, Thu Apr 27 12:46:03 2006 UTC revision 214 by twoaday, Sun May 14 18:40:36 2006 UTC
# Line 155  count_subkeys (gpgme_key_t key) Line 155  count_subkeys (gpgme_key_t key)
155  /* Return the self signature of the key @keyid.  /* Return the self signature of the key @keyid.
156     If first is set, the first self sig will be returned. */     If first is set, the first self sig will be returned. */
157  gpgme_key_sig_t  gpgme_key_sig_t
158  get_selfsig (gpgme_user_id_t uid, const char *keyid, int first)  get_selfsig (gpgme_key_sig_t sigs, const char *keyid, int first)
159  {  {
160      gpgme_key_sig_t s, self_sig=NULL;      gpgme_key_sig_t s, self_sig=NULL;
161      long timestamp=0;      long timestamp=0;
# Line 164  get_selfsig (gpgme_user_id_t uid, const Line 164  get_selfsig (gpgme_user_id_t uid, const
164      if (strlen (keyid) == 8)      if (strlen (keyid) == 8)
165          off = 8;          off = 8;
166    
167      for (s = uid->signatures; s; s = s->next) {      for (s = sigs; s; s = s->next) {
168          if (!strcmp (s->keyid+off, keyid) && s->timestamp > timestamp) {          if (!strcmp (s->keyid+off, keyid) && s->timestamp > timestamp) {
169              self_sig = s;              self_sig = s;
170              timestamp = s->timestamp;              timestamp = s->timestamp;
# Line 176  get_selfsig (gpgme_user_id_t uid, const Line 176  get_selfsig (gpgme_user_id_t uid, const
176  }  }
177    
178    
   
179  const char*  const char*
180  get_key_algo (gpgme_key_t key, int keyidx)  get_key_algo (gpgme_key_t key, int keyidx)
181  {  {
# Line 195  get_key_algo (gpgme_key_t key, int keyid Line 194  get_key_algo (gpgme_key_t key, int keyid
194      strcpy (alg, get_key_pubalgo (key->subkeys->pubkey_algo));      strcpy (alg, get_key_pubalgo (key->subkeys->pubkey_algo));
195      n = count_subkeys (key);      n = count_subkeys (key);
196      if (n > 1) {      if (n > 1) {
197          k = get_nth_key (key, n-1);          do {
198                k = get_nth_key (key, --n);
199                if (k->revoked || k->expired)
200                    continue;
201                else
202                    break;
203            } while (n > 0);
204          subalg = get_key_pubalgo (k->pubkey_algo);          subalg = get_key_pubalgo (k->pubkey_algo);
205          _snprintf (algo_id, DIM (algo_id)-1, "%s/%s", alg, subalg);          if (k == key->subkeys)
206                _snprintf (algo_id, DIM (algo_id)-1, "%s", subalg);
207            else
208                _snprintf (algo_id, DIM (algo_id)-1, "%s/%s", alg, subalg);
209          return algo_id;          return algo_id;
210      }      }
211      return get_key_pubalgo (key->subkeys->pubkey_algo);      return get_key_pubalgo (key->subkeys->pubkey_algo);
# Line 375  get_key_trust2 (gpgme_key_t key, int val Line 383  get_key_trust2 (gpgme_key_t key, int val
383      case GPGME_VALIDITY_MARGINAL:      case GPGME_VALIDITY_MARGINAL:
384          return _("Marginal");          return _("Marginal");
385      case GPGME_VALIDITY_FULL:      case GPGME_VALIDITY_FULL:
     case GPGME_VALIDITY_ULTIMATE:  
386          return _("Full");          return _("Full");
387        case GPGME_VALIDITY_ULTIMATE:
388            return _("Ultimate");
389      }      }
390      return "";      return "";
391  }  }
# Line 586  keylist_build (listview_ctrl_t *r_lv, HW Line 595  keylist_build (listview_ctrl_t *r_lv, HW
595      listview_ctrl_t lv;      listview_ctrl_t lv;
596      listview_column_t col;      listview_column_t col;
597      int j, n = 0, ext_chk = 0;      int j, n = 0, ext_chk = 0;
     int rc = 0;  
       
     rc = listview_new (&lv);  
     if (rc)  
         return rc;  
598            
599      lv->ctrl = ctrl;      listview_new (&lv, ctrl);
600      if (mode & KEYLIST_ENCRYPT_MIN) {      if (mode & KEYLIST_ENCRYPT_MIN) {
601          col = klist_enc;          col = klist_enc;
602          n = (DIM(klist_enc) -1);          n = (DIM(klist_enc) -1);

Legend:
Removed from v.205  
changed lines
  Added in v.214

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26