1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-08 12:28:00 -05:00

add key algo to import msg

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Florian Pritz 2011-10-20 20:39:28 +02:00 committed by Dan McGee
parent 2f96067fe7
commit 2141b7112d
3 changed files with 25 additions and 2 deletions

View File

@ -228,6 +228,7 @@ typedef struct _alpm_pgpkey_t {
alpm_time_t expires;
unsigned int length;
unsigned int revoked;
char pubkey_algo;
} alpm_pgpkey_t;
/** Signature result. Contains the key, status, and validity of a given

View File

@ -272,6 +272,26 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
pgpkey->expires = key->subkeys->expires;
pgpkey->length = key->subkeys->length;
pgpkey->revoked = key->subkeys->revoked;
switch (key->subkeys->pubkey_algo) {
case GPGME_PK_RSA:
case GPGME_PK_RSA_E:
case GPGME_PK_RSA_S:
pgpkey->pubkey_algo = 'R';
break;
case GPGME_PK_DSA:
pgpkey->pubkey_algo = 'D';
break;
case GPGME_PK_ELG_E:
case GPGME_PK_ELG:
case GPGME_PK_ECDSA:
case GPGME_PK_ECDH:
pgpkey->pubkey_algo = 'E';
break;
}
ret = 1;
error:

View File

@ -350,11 +350,13 @@ void cb_question(alpm_question_t event, void *data1, void *data2,
const char *revoked = "";
time_t time = (time_t)key->created;
strftime(created, 12, "%Y-%m-%d", localtime(&time));
if (key->revoked) {
revoked = " (revoked)";
}
*response = yesno(_(":: Import PGP key %d/%s, \"%s\", created: %s%s?"),
key->length, key->fingerprint, key->uid, created, revoked);
*response = yesno(_(":: Import PGP key %d%c/%s, \"%s\", created: %s%s?"),
key->length, key->pubkey_algo, key->fingerprint, key->uid, created, revoked);
}
break;
}