aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r--g10/trustdb.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 743d9c771..be8835807 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -205,23 +205,31 @@ release_key_array ( struct key_array *keys )
* FIXME: Should be replaced by a function to add those keys to the trustdb.
*/
void
-register_trusted_key( const char *string )
+register_trusted_keyid(u32 *keyid)
{
- KEYDB_SEARCH_DESC desc;
struct key_item *k;
- if (classify_user_id (string, &desc) != KEYDB_SEARCH_MODE_LONG_KID ) {
- log_error(_("`%s' is not a valid long keyID\n"), string );
- return;
- }
-
k = new_key_item ();
- k->kid[0] = desc.u.kid[0];
- k->kid[1] = desc.u.kid[1];
+ k->kid[0] = keyid[0];
+ k->kid[1] = keyid[1];
k->next = user_utk_list;
user_utk_list = k;
}
+void
+register_trusted_key( const char *string )
+{
+ KEYDB_SEARCH_DESC desc;
+
+ if (classify_user_id (string, &desc) != KEYDB_SEARCH_MODE_LONG_KID )
+ {
+ log_error(_("`%s' is not a valid long keyID\n"), string );
+ return;
+ }
+
+ register_trusted_keyid(desc.u.kid);
+}
+
/*
* Helper to add a key to the global list of ultimately trusted keys.
* Retruns: true = inserted, false = already in in list.