зеркало из https://github.com/nextcloud/desktop.git
Remove unused methods on ClientSideEncryption
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Родитель
ce5edfdf4d
Коммит
580b36fe20
|
@ -830,12 +830,6 @@ void ClientSideEncryption::publicKeyFetched(Job *incoming) {
|
|||
job->start();
|
||||
}
|
||||
|
||||
void ClientSideEncryption::setFolderEncryptedStatus(const QString& folder, bool status)
|
||||
{
|
||||
qCDebug(lcCse) << "Setting folder" << folder << "as encrypted" << status;
|
||||
_folder2encryptedStatus[folder] = status;
|
||||
}
|
||||
|
||||
void ClientSideEncryption::privateKeyFetched(Job *incoming) {
|
||||
auto *readJob = static_cast<ReadPasswordJob *>(incoming);
|
||||
|
||||
|
@ -1091,17 +1085,6 @@ void ClientSideEncryption::generateCSR(EVP_PKEY *keyPair)
|
|||
job->start();
|
||||
}
|
||||
|
||||
void ClientSideEncryption::setTokenForFolder(const QByteArray& folderId, const QByteArray& token)
|
||||
{
|
||||
_folder2token[folderId] = token;
|
||||
}
|
||||
|
||||
QByteArray ClientSideEncryption::tokenForFolder(const QByteArray& folderId) const
|
||||
{
|
||||
Q_ASSERT(_folder2token.contains(folderId));
|
||||
return _folder2token[folderId];
|
||||
}
|
||||
|
||||
void ClientSideEncryption::encryptPrivateKey()
|
||||
{
|
||||
QStringList list = WordList::getRandomWords(12);
|
||||
|
@ -1548,29 +1531,6 @@ QVector<EncryptedFile> FolderMetadata::files() const {
|
|||
return _files;
|
||||
}
|
||||
|
||||
bool ClientSideEncryption::isFolderEncrypted(const QString& path) const {
|
||||
auto it = _folder2encryptedStatus.constFind(path);
|
||||
if (it == _folder2encryptedStatus.constEnd())
|
||||
return false;
|
||||
return (*it);
|
||||
}
|
||||
|
||||
bool ClientSideEncryption::isAnyParentFolderEncrypted(const QString &path) const
|
||||
{
|
||||
int slashPosition = 0;
|
||||
|
||||
while ((slashPosition = path.indexOf("/", slashPosition + 1)) != -1) {
|
||||
// Ignore the last slash
|
||||
if (slashPosition == path.length() - 1) break;
|
||||
|
||||
if (isFolderEncrypted(path.left(slashPosition + 1))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &iv, QFile *input, QFile *output, QByteArray& returnTag)
|
||||
{
|
||||
if (!input->open(QIODevice::ReadOnly)) {
|
||||
|
|
|
@ -80,15 +80,8 @@ public:
|
|||
void generateKeyPair();
|
||||
void generateCSR(EVP_PKEY *keyPair);
|
||||
void encryptPrivateKey();
|
||||
void setTokenForFolder(const QByteArray& folder, const QByteArray& token);
|
||||
QByteArray tokenForFolder(const QByteArray& folder) const;
|
||||
void fetchFolderEncryptedStatus();
|
||||
|
||||
// to be used together with FolderStatusModel::FolderInfo::_path.
|
||||
bool isFolderEncrypted(const QString& path) const;
|
||||
bool isAnyParentFolderEncrypted(const QString &path) const;
|
||||
void setFolderEncryptedStatus(const QString& path, bool status);
|
||||
|
||||
void forgetSensitiveData();
|
||||
|
||||
bool newMnemonicGenerated() const;
|
||||
|
@ -126,7 +119,6 @@ private:
|
|||
bool isInitialized = false;
|
||||
bool _refreshingEncryptionStatus = false;
|
||||
//TODO: Save this on disk.
|
||||
QHash<QByteArray, QByteArray> _folder2token;
|
||||
QHash<QString, bool> _folder2encryptedStatus;
|
||||
QVector<GetFolderEncryptStatusJob*> _folderStatusJobs;
|
||||
|
||||
|
|
|
@ -47,8 +47,6 @@ QString EncryptFolderJob::errorString() const
|
|||
|
||||
void EncryptFolderJob::slotEncryptionFlagSuccess(const QByteArray &fileId)
|
||||
{
|
||||
_account->e2e()->setFolderEncryptedStatus(_path + '/', true);
|
||||
|
||||
SyncJournalFileRecord rec;
|
||||
_journal->getFileRecord(_path, &rec);
|
||||
if (rec.isValid()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче