diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-05-03 23:43:07 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-05-04 00:31:22 +0200 |
commit | 59f3e09edfc71556208a866bb97ed9e173bd827f (patch) | |
tree | d182b59b18bae5214dab05e9f6a318f88e035ac3 /libqpdf/QPDF_encryption.cc | |
parent | d55c7ac570a2852547caaa78b73b9fab5494aea1 (diff) | |
download | qpdf-59f3e09edfc71556208a866bb97ed9e173bd827f.tar.zst |
Make Pipeline::write take an unsigned char const* (API change)
Diffstat (limited to 'libqpdf/QPDF_encryption.cc')
-rw-r--r-- | libqpdf/QPDF_encryption.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc index 6a9ad871..5fb1e808 100644 --- a/libqpdf/QPDF_encryption.cc +++ b/libqpdf/QPDF_encryption.cc @@ -207,7 +207,7 @@ iterate_rc4( key[j] = static_cast<unsigned char>(okey[j] ^ xor_value); } RC4 rc4(key, QIntC::to_int(key_len)); - rc4.process(data, data_len); + rc4.process(data, data_len, data); } } @@ -1163,7 +1163,8 @@ QPDF::decryptString(std::string& str, int objid, int generation) // be freed even if rc4.process throws an exception. auto tmp = QUtil::make_unique_cstr(str); RC4 rc4(QUtil::unsigned_char_pointer(key), toI(key.length())); - rc4.process(QUtil::unsigned_char_pointer(tmp.get()), vlen); + auto data = QUtil::unsigned_char_pointer(tmp.get()); + rc4.process(data, vlen, data); str = std::string(tmp.get(), vlen); } } catch (QPDFExc&) { |