mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 23:17:13 +03:00
[CSE] Store the sharing keys in memory
This commit is contained in:
parent
fc73ad7476
commit
0347cf4e9e
2 changed files with 12 additions and 2 deletions
|
@ -1149,9 +1149,18 @@ void FolderMetadata::setupExistingMetadata()
|
|||
|
||||
// Cool, We actually have the key, we can decrypt the rest of the metadata.
|
||||
qDebug() << "Sharing: " << sharing;
|
||||
QByteArray sharingDecrypted = decryptJsonObject(sharing, _metadataKeys.last());
|
||||
auto sharingDecrypted = QByteArray::fromBase64(decryptJsonObject(sharing, _metadataKeys.last()));
|
||||
qDebug() << "Sharing Decrypted" << sharingDecrypted;
|
||||
qDebug() << "Sharing B64 Decrypted" << QByteArray::fromBase64(sharingDecrypted);
|
||||
|
||||
//Sharing is also a JSON object, so extract it and populate.
|
||||
auto sharingDoc = QJsonDocument::fromJson(sharingDecrypted);
|
||||
auto sharingObj = sharingDoc.object();
|
||||
for (auto it = sharingObj.constBegin(), end = sharingObj.constEnd(); it != end; it++) {
|
||||
_sharing.push_back({it.key(), it.value().toString()});
|
||||
}
|
||||
|
||||
// Retrieve the stored files, right now the metadata produced by this client doesn't have files, we should append one.
|
||||
// TODO: Parse the "files" part.
|
||||
}
|
||||
|
||||
// RSA/ECB/OAEPWithSHA-256AndMGF1Padding using private / public key.
|
||||
|
|
|
@ -118,6 +118,7 @@ private:
|
|||
QVector<QByteArray> _metadataKeys;
|
||||
AccountPtr _account;
|
||||
QByteArray _metadata;
|
||||
QVector<QPair<QString, QString>> _sharing;
|
||||
};
|
||||
|
||||
class FileEncryptionJob : public QObject
|
||||
|
|
Loading…
Reference in a new issue