diff options
Diffstat (limited to 'libqpdf/QPDFWriter.cc')
-rw-r--r-- | libqpdf/QPDFWriter.cc | 8 |
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(); |