summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/signing.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/signing.c')
-rw-r--r--lib/libalpm/signing.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 92f34b56..fbb6b134 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -17,8 +17,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
-
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -270,6 +268,28 @@ static int key_search(alpm_handle_t *handle, const char *fpr,
pgpkey->email = key->uids->email;
pgpkey->created = key->subkeys->timestamp;
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: