Skip to content

Commit 1f6efc4

Browse files
author
Lauris Kaplinski
committed
Use label as autogenerated label field, not full label
1 parent 3594ec0 commit 1f6efc4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

client/CryptoDoc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ bool CryptoDoc::encrypt(const QString &filename, const QString& label, const QBy
472472
if (!secret.isEmpty()) {
473473
// NIST recommends at least 600000 iterations for PBKDF2 with SHA-256, see https://csrc.nist.gov/publications/detail/sp/800-132/final
474474
d->crypto.secret.assign(secret.cbegin(), secret.cend());
475-
enc_keys.push_back(libcdoc::Recipient::makeSymmetric(label.toStdString(), 600000));
475+
libcdoc::Recipient rcpt = libcdoc::Recipient::makeSymmetric({}, 600000);
476+
rcpt.setLabelValue(libcdoc::CDoc2::Label::LABEL, label.toStdString());
477+
enc_keys.push_back(rcpt);
476478
}
477479
StreamListSource slsrc(d->files);
478480
libcdoc::result_t result = writer->encrypt(slsrc, enc_keys);

0 commit comments

Comments
 (0)