]> the.earth.li Git - onak.git/blobdiff - keydb_db4.c
Another deletion fix of 64 bit keys in DB4 backend
[onak.git] / keydb_db4.c
index 3e4a039e1cc0058a5512ecf17a37654fdbab4335..43f16741bad0d931dc36ad4e50d2eff778572236 100644 (file)
@@ -826,7 +826,7 @@ static int db4_delete_key(struct onak_dbctx *dbctx,
                                DB_GET_BOTH);
 
                        if (ret == 0) {
-                               ret = cursor->c_del(cursor, 0);
+                               cursor->c_del(cursor, 0);
                        }
 
                        /* New style just uses the fingerprint as the data */
@@ -898,7 +898,7 @@ static int db4_delete_key(struct onak_dbctx *dbctx,
                        DB_GET_BOTH);
 
                if (ret == 0) {
-                       ret = cursor->c_del(cursor, 0);
+                       cursor->c_del(cursor, 0);
                }
 
                /* New style mapping to fingerprint */
@@ -993,7 +993,7 @@ static int db4_delete_key(struct onak_dbctx *dbctx,
                                DB_GET_BOTH);
 
                        if (ret == 0) {
-                               ret = cursor->c_del(cursor, 0);
+                               cursor->c_del(cursor, 0);
                        }
 
                        /* Remove 32 bit keyid -> fingerprint mapping */
@@ -1085,7 +1085,7 @@ static int db4_delete_key(struct onak_dbctx *dbctx,
                                DB_GET_BOTH);
 
                        if (ret == 0) {
-                               ret = cursor->c_del(cursor, 0);
+                               cursor->c_del(cursor, 0);
                        }
 
                        /* Then delete new style fingerprint mapping */
@@ -1124,6 +1124,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);