commit 99a66135a4e7f00c4181e9b86313fbd41d7b1e74
parent 8190c79dd3e8d23e871b99ff9541b12d953b2c83
Author: lash <dev@holbrook.no>
Date: Mon, 22 Apr 2024 21:27:33 +0100
Fix wrong key length for pubkey name lookup
Diffstat:
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/gtk/kee-entry-store.c b/src/gtk/kee-entry-store.c
@@ -67,18 +67,15 @@ static gpointer kee_entry_store_get_item(GListModel *list, guint index) {
KeeEntry *o;
KeeEntryStore *store;
- //kee_entry_load(o, list->db);
store = KEE_ENTRY_STORE(list);
o = kee_entry_new(store->db);
kee_entry_set_resolver(o, &store->resolver);
kee_entry_store_seek(store, index);
- //kee_entry_deserialize(o, store->last_key, 9, store->last_value, store->last_value_length);
r = kee_entry_deserialize(o, store->last_value, store->last_value_length);
if (r) {
- return NULL;
+ g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "entry index %d malformed", index);
}
- //return o;
kee_entry_apply_list_item_widget(o);
return o;
diff --git a/src/gtk/kee-entry.c b/src/gtk/kee-entry.c
@@ -39,7 +39,7 @@ struct _KeeEntry {
int state;
char header[1024];
struct kee_dn_t bob_dn;
- char current_id[128];
+ char current_id[64];
struct kee_ledger_t ledger;
struct Cadiz *resolver;
int alice_credit_balance;
@@ -152,7 +152,7 @@ int kee_entry_deserialize(KeeEntry *o, const char *data, size_t data_len) {
last_value_length = 2048;
*last_key = DbKeyDN;
memcpy(last_key+1, o->ledger.pubkey_bob, 32);
- key_len = 33;
+ key_len = 32;
r = db_next(o->db, DbKeyDN, &last_key, &key_len, &last_value, &last_value_length);
if (r) {
return ERR_FAIL;
diff --git a/src/ledger.c b/src/ledger.c
@@ -360,7 +360,6 @@ int kee_ledger_parse(struct kee_ledger_t *ledger, const char *data, size_t data_
return r;
}
-
c = 64;
r = asn1_read_value(item, "body", content_key, &c);
if (r != ASN1_SUCCESS) {