42 |
static int |
static int |
43 |
do_check_key (gpgme_key_t key) |
do_check_key (gpgme_key_t key) |
44 |
{ |
{ |
45 |
int invalid = 0; |
int invalid; |
46 |
|
|
47 |
invalid = key->expired; |
invalid = key->expired; |
48 |
if (!invalid) |
if (!invalid) |
221 |
} |
} |
222 |
|
|
223 |
|
|
224 |
|
/* Return extended algorithm information. */ |
225 |
|
const char* |
226 |
|
props_get_key_algo (gpgme_key_t key, int idx) |
227 |
|
{ |
228 |
|
/* PGP calls the old RSAv3 keys 'RSA Legacy' and because this |
229 |
|
is a good method to differ between OpenPGP v4 cert-only keys |
230 |
|
and v3 RSA keys, we use the same notation. */ |
231 |
|
if (key->subkeys != NULL && strlen (key->subkeys->fpr) == 32) |
232 |
|
return "RSA Legacy"; |
233 |
|
return get_key_algo (key, idx); |
234 |
|
} |
235 |
|
|
236 |
|
|
237 |
/* Display the key information for key @k. |
/* Display the key information for key @k. |
238 |
Return value: gpgme key on success. */ |
Return value: gpgme key on success. */ |
264 |
"%s\r\n"), |
"%s\r\n"), |
265 |
get_key_type (key), |
get_key_type (key), |
266 |
k->keyid, |
k->keyid, |
267 |
get_key_algo (key, 0), |
props_get_key_algo (key, 0), |
268 |
get_key_size (key, 0), |
get_key_size (key, 0), |
269 |
get_key_created (created), |
get_key_created (created), |
270 |
get_key_expire_date (expires), |
get_key_expire_date (expires), |
302 |
k->has_photo = 1; |
k->has_photo = 1; |
303 |
if (valid < GPGME_VALIDITY_MARGINAL) |
if (valid < GPGME_VALIDITY_MARGINAL) |
304 |
SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not validated.")); |
SetDlgItemText (dlg, IDC_KEYPROPS_IMGINF, _("Photo-ID not validated.")); |
305 |
} |
} |
306 |
if (k->key_pair) |
if (k->key_pair) |
307 |
EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE); |
EnableWindow (GetDlgItem (dlg, IDC_KEYPROPS_CHANGE_PWD), TRUE); |
308 |
if (check_for_desig_rev (k->ctx)) |
if (check_for_desig_rev (k->ctx)) |
363 |
return TRUE; |
return TRUE; |
364 |
|
|
365 |
case IDC_KEYPROPS_OT_CHANGE: |
case IDC_KEYPROPS_OT_CHANGE: |
|
if (do_check_key (prop->key->ctx)) { |
|
|
msg_box (dlg, _("The status of this key is 'revoked' or 'expired'.\n" |
|
|
"You cannot change the ownertrust of such keys."), |
|
|
_("WinPT Warning"), MB_ERR); |
|
|
return TRUE; |
|
|
} |
|
366 |
if (!prop->key->key_pair && !key_is_valid (prop->key->ctx)) { |
if (!prop->key->key_pair && !key_is_valid (prop->key->ctx)) { |
367 |
rc = msg_box (dlg, _("This is a non-valid key.\n" |
rc = msg_box (dlg, _("This is a non-valid key.\n" |
368 |
"Modifying the ownertrust has no effect on such keys.\n\n" |
"Modifying the ownertrust has no effect on such keys.\n\n" |