mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +00:00
parent
3fc7c99d02
commit
2ff84aa2c9
@ -2,6 +2,9 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include <qpdf/QIntC.hh>
|
||||
|
||||
@ -18,8 +21,15 @@ check_openssl(int status)
|
||||
{
|
||||
if (status != 1)
|
||||
{
|
||||
throw std::runtime_error("openssl error");
|
||||
// OpenSSL creates a "queue" of errors; copy the first (innermost)
|
||||
// error to the exception message.
|
||||
char buf[256] = "";
|
||||
ERR_error_string_n(ERR_get_error(), buf, sizeof(buf));
|
||||
std::string what = "OpenSSL error: ";
|
||||
what += buf;
|
||||
throw std::runtime_error(what);
|
||||
}
|
||||
ERR_clear_error();
|
||||
}
|
||||
|
||||
QPDFCrypto_openssl::QPDFCrypto_openssl() :
|
||||
|
Loading…
Reference in New Issue
Block a user