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

Diff of /trunk/Src/wptVerifyList.cpp

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

revision 285 by twoaday, Mon Jan 15 22:02:04 2007 UTC revision 286 by twoaday, Fri Mar 9 19:34:17 2007 UTC
# Line 182  verlist_delete (verlist_ctrl_t vlv) Line 182  verlist_delete (verlist_ctrl_t vlv)
182  }  }
183    
184    
185    /* Handy function to extract the real key ID from a signature. */
186    const char *
187    sig_get_real_keyid (gpgme_signature_t sig, winpt_key_t key)
188    {
189        const char *keyid;
190        
191         /* We still need an extra check for RSA:MD5 keys because we
192            cannot derrive the keyid directly from the fingerprint. */
193        if (strlen (sig->fpr) == 32) {
194            if (key->ext != NULL)
195                keyid = key->ext->key->subkeys->keyid+8;
196            else /* show the fingerprint if the key is not in the keyring. */
197                keyid = sig->fpr;
198        }
199        else
200            keyid = get_keyid_from_fpr (sig->fpr);
201        return keyid;
202    }
203    
204        
205  /* Add the given signature in @sig to the verify control @lv.  /* Add the given signature in @sig to the verify control @lv.
206     Return value: 0 on success. */     Return value: 0 on success. */
207  int  int
# Line 222  verlist_add_sig (verlist_ctrl_t vlv, gpg Line 242  verlist_add_sig (verlist_ctrl_t vlv, gpg
242      }      }
243      listview_add_sub_item (lv, 0, VER_COL_TRUST, (char *)attr);      listview_add_sub_item (lv, 0, VER_COL_TRUST, (char *)attr);
244            
245      attr = get_keyid_from_fpr (sig->fpr);            attr = sig_get_real_keyid (sig, &key);
246      _snprintf (keyid, DIM (keyid) -1, "0x%s", attr);      _snprintf (keyid, DIM (keyid) -1, "0x%s", attr);
247      listview_add_sub_item (lv, 0, VER_COL_KEYID, keyid);      listview_add_sub_item (lv, 0, VER_COL_KEYID, keyid);
248            
# Line 285  verlist_add_sig_log (verlist_ctrl_t vlv, Line 305  verlist_add_sig_log (verlist_ctrl_t vlv,
305          attr = _("Unknown");          attr = _("Unknown");
306      listview_add_sub_item (lv, 0, VER_COL_TRUST, attr);      listview_add_sub_item (lv, 0, VER_COL_TRUST, attr);
307    
308      attr = get_keyid_from_fpr (sig->fpr);  
309        attr = sig_get_real_keyid (sig, &key);
310      _snprintf (t, DIM (t)-1, "0x%s", attr);      _snprintf (t, DIM (t)-1, "0x%s", attr);
311      listview_add_sub_item (lv, 0, VER_COL_KEYID, t);      listview_add_sub_item (lv, 0, VER_COL_KEYID, t);
312      listview_add_sub_item (lv, 0, VER_COL_UID,      listview_add_sub_item (lv, 0, VER_COL_UID,

Legend:
Removed from v.285  
changed lines
  Added in v.286

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26