291 |
uid_hint += 16; /* skip keyid */ |
uid_hint += 16; /* skip keyid */ |
292 |
uid_hint += 1; /* space */ |
uid_hint += 1; /* space */ |
293 |
|
|
294 |
|
struct winpt_key_s skey; |
295 |
|
gpgme_subkey_t sk; |
296 |
|
if (winpt_get_seckey (mainkey, &skey)) |
297 |
|
BUG (0); |
298 |
|
for (sk = skey.ctx->subkeys; sk; sk = sk->next) { |
299 |
|
if (memcmp (sk->keyid, usedkey, 8) == 0) |
300 |
|
break; |
301 |
|
} |
302 |
uid = utf8_to_native (uid_hint); |
uid = utf8_to_native (uid_hint); |
303 |
if (strcmp (usedkey, mainkey)) |
if (strcmp (usedkey, mainkey)) |
304 |
_snprintf (desc, desc_size-1, |
_snprintf (desc, desc_size-1, |
305 |
_("You need a passphrase to unlock the secret key for user:\n" |
_("You need a passphrase to unlock the secret key for user:\n" |
306 |
"\"%s\"\n" |
"\"%s\"\n" |
307 |
"%s key, ID 0x%s (main key ID 0x%s)\n"), |
"%d-bit %s key, ID 0x%s, created %s (main key ID 0x%s)\n"), |
308 |
uid, get_key_pubalgo (algo), usedkey+8, mainkey+8); |
uid, sk->length, get_key_pubalgo (algo), |
309 |
|
usedkey+8, get_key_created (sk->timestamp), mainkey+8); |
310 |
else if (!strcmp (usedkey, mainkey)) |
else if (!strcmp (usedkey, mainkey)) |
311 |
_snprintf (desc, desc_size-1, |
_snprintf (desc, desc_size-1, |
312 |
_("You need a passphrase to unlock the secret key for user:\n" |
_("You need a passphrase to unlock the secret key for user:\n" |
313 |
"\"%s\"\n" |
"\"%s\"\n" |
314 |
"%s key, ID 0x%s\n"), |
"%d-bit %s key, created %s, ID 0x%s\n"), |
315 |
uid, get_key_pubalgo (algo), usedkey+8); |
uid, sk->length, get_key_pubalgo (algo), |
316 |
|
get_key_created (sk->timestamp), usedkey+8); |
317 |
safe_free (uid); |
safe_free (uid); |
318 |
return 0; |
return 0; |
319 |
} |
} |