diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFJob_argv.cc | 1 | ||||
-rw-r--r-- | libqpdf/QPDFJob_config.cc | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libqpdf/QPDFJob_argv.cc b/libqpdf/QPDFJob_argv.cc index 56acd7a9..3875474b 100644 --- a/libqpdf/QPDFJob_argv.cc +++ b/libqpdf/QPDFJob_argv.cc @@ -163,6 +163,7 @@ ArgParser::argShowCrypto() void ArgParser::argEncrypt() { + this->c_enc = c_main->encrypt(0, "", ""); this->accumulated_args.clear(); this->ap.selectOptionTable(O_ENCRYPTION); } diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc index 834de9ab..4798ce9b 100644 --- a/libqpdf/QPDFJob_config.cc +++ b/libqpdf/QPDFJob_config.cc @@ -1042,6 +1042,9 @@ QPDFJob::EncConfig::EncConfig(Config* c) : QPDFJob::Config* QPDFJob::EncConfig::endEncrypt() { + if (config->o.m->keylen == 0) { + usage("encryption key length is required"); + } config->o.m->encrypt = true; config->o.m->decrypt = false; config->o.m->copy_encryption = false; |