aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFWriter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2012-12-28 03:37:57 +0100
committerJay Berkenbilt <ejb@ql.org>2012-12-31 11:36:50 +0100
commit9b42f526dffd5e1518ff3d83564eb09111ac5f0d (patch)
treede79d55730d0d58d31a1e4fc3babd696f9d98587 /libqpdf/QPDFWriter.cc
parent774584163ff3d310e7c932e2a6f63b590cb736ac (diff)
downloadqpdf-9b42f526dffd5e1518ff3d83564eb09111ac5f0d.tar.zst
Update AES classes to work with 256-bit keys
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r--libqpdf/QPDFWriter.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 963f9627..cde76af9 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -815,13 +815,14 @@ QPDFWriter::pushEncryptionFilter()
{
p = new Pl_AES_PDF(
"aes stream encryption", this->pipeline, true,
- (unsigned char*) this->cur_data_key.c_str());
+ (unsigned char*) this->cur_data_key.c_str(),
+ (unsigned int)this->cur_data_key.length());
}
else
{
p = new Pl_RC4("rc4 stream encryption", this->pipeline,
(unsigned char*) this->cur_data_key.c_str(),
- (int)this->cur_data_key.length());
+ (unsigned int)this->cur_data_key.length());
}
pushPipeline(p);
}
@@ -1415,7 +1416,8 @@ QPDFWriter::unparseObject(QPDFObjectHandle object, int level,
{
Pl_Buffer bufpl("encrypted string");
Pl_AES_PDF pl("aes encrypt string", &bufpl, true,
- (unsigned char const*)this->cur_data_key.c_str());
+ (unsigned char const*)this->cur_data_key.c_str(),
+ (unsigned int)this->cur_data_key.length());
pl.write((unsigned char*) val.c_str(), val.length());
pl.finish();
Buffer* buf = bufpl.getBuffer();