aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorDean Scarff <deanscarff@google.com>2020-07-02 11:42:36 +0200
committerJay Berkenbilt <ejb@ql.org>2020-10-17 02:04:36 +0200
commit9a3791c53b5c48516af5825302a5145397cb65e5 (patch)
tree7cfbf5d3558272452dd6b4a790b1bba107f83f90 /libqpdf
parenta99ad2b9007d1775e9598bc78698cbc5d5ba0f60 (diff)
downloadqpdf-9a3791c53b5c48516af5825302a5145397cb65e5.tar.zst
Properly detect OPENSSL_IS_BORINGSSL
OPENSSL_IS_BORINGSSL is not actually set by configure, so it will be undefined until a BoringSSL header is included. Hence the #ifdef logic in QPDFCrypto_openssl.h would usually never apply. This still worked because evp.h transitively included BoringSSL's cipher.h and digest.h, but the latter are the correct (documented) headers. By re-ordering the includes, we can ensure the macro is defined when we use it. Also: fix case in the header guards.
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/qpdf/QPDFCrypto_openssl.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/libqpdf/qpdf/QPDFCrypto_openssl.hh b/libqpdf/qpdf/QPDFCrypto_openssl.hh
index a56e490f..58f54c3f 100644
--- a/libqpdf/qpdf/QPDFCrypto_openssl.hh
+++ b/libqpdf/qpdf/QPDFCrypto_openssl.hh
@@ -1,15 +1,15 @@
-#ifndef QPDFCRYPTO_openssl_HH
-#define QPDFCRYPTO_openssl_HH
+#ifndef QPDFCRYPTO_OPENSSL_HH
+#define QPDFCRYPTO_OPENSSL_HH
#include <qpdf/QPDFCryptoImpl.hh>
#include <string>
+#include <openssl/rand.h>
#ifdef OPENSSL_IS_BORINGSSL
#include <openssl/cipher.h>
#include <openssl/digest.h>
#else
#include <openssl/evp.h>
#endif
-#include <openssl/rand.h>
class QPDFCrypto_openssl: public QPDFCryptoImpl
{
@@ -50,4 +50,4 @@ class QPDFCrypto_openssl: public QPDFCryptoImpl
size_t sha2_bits;
};
-#endif // QPDFCRYPTO_openssl_HH
+#endif // QPDFCRYPTO_OPENSSL_HH