]> the.earth.li Git - onak.git/blobdiff - keydb_db4.c
Check that signature data lengths do not exceed the available data
[onak.git] / keydb_db4.c
index 20a12fdc31f74c25d641c87dfa1bb29527282472..b36ce3f65dba9e18408c0b86c6e6f35c72600f6b 100644 (file)
@@ -772,7 +772,9 @@ static int db4_delete_key(struct onak_dbctx *dbctx,
        }
 
        if (db4_fetch_key_id(dbctx, keyid, &publickey, true) == 0) {
-               db4_endtrans(dbctx);
+               if (!intrans) {
+                       db4_endtrans(dbctx);
+               }
                return 1;
        }
 
@@ -1124,6 +1126,16 @@ static int db4_delete_key(struct onak_dbctx *dbctx,
        publickey = NULL;
 
        if (!deadlock) {
+               key.data = fingerprint.fp;
+               key.size = fingerprint.length;
+
+               keydb_fp(privctx, &fingerprint)->del(keydb_fp(privctx,
+                                       &fingerprint),
+                               privctx->txn,
+                               &key,
+                               0); /* flags */
+
+               /* Delete old style 64 bit keyid */
                key.data = &keyid;
                key.size = sizeof(keyid);