mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 23:17:13 +03:00
[CSE] Convert the base64 data to raw, for the decyrption
This commit is contained in:
parent
3628f3739d
commit
4bb7ebb6aa
1 changed files with 6 additions and 2 deletions
|
@ -776,9 +776,7 @@ std::string FolderMetadata::decryptMetadataKeys(const std::string& encryptedMeta
|
|||
{
|
||||
qCInfo(lcCse()) << "Starting to decrypt the metadata key";
|
||||
unsigned char *out;
|
||||
unsigned char *in;
|
||||
size_t outlen;
|
||||
size_t inlen;
|
||||
int err = -1;
|
||||
|
||||
auto path = privateKeyPath(_account);
|
||||
|
@ -786,6 +784,12 @@ std::string FolderMetadata::decryptMetadataKeys(const std::string& encryptedMeta
|
|||
auto pkeyFile = fopen(pathC, "r");
|
||||
auto key = PEM_read_PrivateKey(pkeyFile, NULL, NULL, NULL);
|
||||
|
||||
// Data is base64 encoded.
|
||||
auto raw = QByteArray(encryptedMetadata.c_str(), encryptedMetadata.length());
|
||||
auto b64d = QByteArray::fromBase64(raw);
|
||||
auto in = (unsigned char *) b64d.constData();
|
||||
size_t inlen = b64d.length();
|
||||
|
||||
/* NB: assumes key in, inlen are already set up
|
||||
* and that key is an RSA private key
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue