2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-03 15:17:29 +00:00

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.
This commit is contained in:
Dean Scarff 2020-07-02 19:42:36 +10:00 committed by Jay Berkenbilt
parent a99ad2b900
commit 9a3791c53b

View File

@ -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