Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
#include <gpgme.h>
+#define PAKFIRE_KEY_FPR_MAXLEN 41
+
int pakfire_key_create(struct pakfire_key** key, struct pakfire* pakfire, gpgme_key_t gpgkey);
int pakfire_key_sign(struct pakfire_key* key, const char* buffer, const size_t buffer_length,
char metadata[PATH_MAX];
// Key fingerprint
- char* key;
+ char key[PAKFIRE_KEY_FPR_MAXLEN];
// Mirrorlist
char* mirrorlist_url;
if (dump)
DEBUG(repo->pakfire, "Imported key:\n%s\n", dump);
+
+ // Fetch the key's fingerprint
+ const char* fingerprint = pakfire_key_get_fingerprint(*key);
+ if (!fingerprint) {
+ r = 1;
+ goto ERROR;
+ }
+
+ // Store the fingerprint
+ r = pakfire_string_set(repo->appdata->key, fingerprint);
+ if (r)
+ goto ERROR;
}
ERROR: