From 37b346c2e119559e40c08f43e1a8f54353e7ad59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Hern=C3=A1ndez?= Date: Wed, 11 Nov 2020 09:10:07 +0100 Subject: [PATCH] Add TODO to update nodekeys The update of nodekeys requires API changes, so it will be address in a near future, in a different branch. --- include/mega/transferslot.h | 1 - src/transferslot.cpp | 33 ++------------------------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/include/mega/transferslot.h b/include/mega/transferslot.h index 29dcbb078c..1f0576fb4e 100644 --- a/include/mega/transferslot.h +++ b/include/mega/transferslot.h @@ -141,7 +141,6 @@ struct MEGA_API TransferSlot bool tryRaidRecoveryFromHttpGetError(unsigned i); bool checkDownloadTransferFinished(DBTableTransactionCommitter& committer, MegaClient* client); bool checkMetaMacWithMissingLateEntries(); - void updateMacInKey(int64_t correctMac); }; } // namespace diff --git a/src/transferslot.cpp b/src/transferslot.cpp index f711a5bcf7..53c0e2847d 100644 --- a/src/transferslot.cpp +++ b/src/transferslot.cpp @@ -370,7 +370,7 @@ bool TransferSlot::checkMetaMacWithMissingLateEntries() auto correctMac = macsmac(&transfer->chunkmacs); transfer->currentmetamac = correctMac; transfer->metamac = correctMac; - updateMacInKey(correctMac); + // TODO: update the Node's key to be correct (needs some API additions before enabling) return true; } } @@ -394,7 +394,7 @@ bool TransferSlot::checkMetaMacWithMissingLateEntries() auto correctMac = macsmac(&transfer->chunkmacs); transfer->currentmetamac = correctMac; transfer->metamac = correctMac; - updateMacInKey(correctMac); + // TODO: update the Node's key to be correct (needs some API additions before enabling) return true; } } @@ -404,35 +404,6 @@ bool TransferSlot::checkMetaMacWithMissingLateEntries() return false; } -void TransferSlot::updateMacInKey(int64_t correctMac) -{ - // Update the Node's key to be correct (needs some API additions before enabling) - //for (file_list::iterator it = transfer->files.begin(); it != transfer->files.end(); it++) - //{ - // if ((*it)->hprivate && !(*it)->hforeign) - // { - // if (Node* n = transfer->client->nodebyhandle((*it)->h)) - // { - // if (n->type == FILENODE && n->nodekey().size() == FILENODEKEYLENGTH) - // { - // auto k1 = (byte*)n->nodekey().data(); - // auto k2 = k1 + SymmCipher::KEYLENGTH; - // if (transfer->metamac == MemAccess::get((const char*)k2 + sizeof(int64_t))) - // { - // SymmCipher::xorblock(k2, k1); - // MemAccess::set(k2 + sizeof(int64_t), correctMac); - // SymmCipher::xorblock(k2, k1); - - // handle_vector hv; - // hv.push_back(n->nodehandle); - // transfer->client->reqs.add(new CommandNodeKeyUpdate(transfer->client, &hv)); - // } - // } - // } - // } - //} -} - bool TransferSlot::checkDownloadTransferFinished(DBTableTransactionCommitter& committer, MegaClient* client) { if (transfer->progresscompleted == transfer->size)