33 |
#include "wptVersion.h" |
#include "wptVersion.h" |
34 |
#include "wptKeyEdit.h" |
#include "wptKeyEdit.h" |
35 |
|
|
|
|
|
36 |
static void |
static void |
37 |
do_change_ownertrust (winpt_key_t k, const char *s) |
do_change_ownertrust (winpt_key_t k, const char *s) |
38 |
{ |
{ |
83 |
|
|
84 |
/* Load the photo from the key @key */ |
/* Load the photo from the key @key */ |
85 |
static int |
static int |
86 |
keyprops_load_photo (gpgme_key_t key) |
keyprops_load_photo (gpgme_key_t key, gpgme_validity_t *r_valid) |
87 |
{ |
{ |
88 |
winpt_key_s k; |
winpt_key_s k; |
89 |
FILE *f; |
FILE *f; |
93 |
|
|
94 |
winpt_get_pubkey (key->subkeys->keyid, &k); |
winpt_get_pubkey (key->subkeys->keyid, &k); |
95 |
img = k.ext->attrib.d; |
img = k.ext->attrib.d; |
96 |
imglen = k.ext->attrib.len; |
imglen = k.ext->attrib.len; |
97 |
|
if (!k.ext->attrib.validity) |
98 |
|
get_uat_validity (key->subkeys->keyid, &k.ext->attrib.validity); |
99 |
|
*r_valid = k.ext->attrib.validity; |
100 |
|
|
101 |
if (!img || !imglen) |
if (!img || !imglen) |
102 |
return -1; |
return -1; |
255 |
static winpt_key_t k; |
static winpt_key_t k; |
256 |
static gpgme_key_t key; |
static gpgme_key_t key; |
257 |
static int has_photo = 0; |
static int has_photo = 0; |
258 |
|
gpgme_validity_t valid; |
259 |
refresh_cache_s rcs = {0}; |
refresh_cache_s rcs = {0}; |
260 |
const char *inf; |
const char *inf; |
261 |
int cancel = 0; |
int cancel = 0; |
271 |
SetDlgItemText (dlg, IDC_KEYPROPS_OT_CHANGE, _("&Change")); |
SetDlgItemText (dlg, IDC_KEYPROPS_OT_CHANGE, _("&Change")); |
272 |
SetDlgItemText (dlg, IDC_KEYPROPS_REVOKERS, _("&Revokers")); |
SetDlgItemText (dlg, IDC_KEYPROPS_REVOKERS, _("&Revokers")); |
273 |
SetDlgItemText (dlg, IDC_KEYPROPS_CHANGE_PWD, _("Change &Passwd")); |
SetDlgItemText (dlg, IDC_KEYPROPS_CHANGE_PWD, _("Change &Passwd")); |
274 |
|
SetDlgItemText (dlg, IDC_KEYPROPS_OTINF, _("Ownertrust")); |
275 |
#endif |
#endif |
276 |
|
|
277 |
display_key_info (dlg, k, &key); |
display_key_info (dlg, k, &key); |
278 |
if (!keyprops_load_photo (key)) |
if (!keyprops_load_photo (key, &valid)) { |
279 |
has_photo = 1; |
has_photo = 1; |
280 |
|
if (valid != 0 && valid < GPGME_VALIDITY_MARGINAL) |
281 |
|
SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not checked.")); |
282 |
|
} |
283 |
if (k->key_pair) |
if (k->key_pair) |
284 |
EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE); |
EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE); |
285 |
if (check_for_desig_rev (key)) |
if (check_for_desig_rev (key)) |