Commit 24759fc8 authored by Mingtao Yang's avatar Mingtao Yang Committed by Facebook GitHub Bot

portability/OpenSSL: Don't assume 1.1.1 implies blake2 availability

Reviewed By: yfeldblum

Differential Revision: D31414552

fbshipit-source-id: 0a814de998d88950f5e6e61c23b20f40c2eb0a37
parent cb895545
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
#include <openssl/opensslv.h> #include <openssl/opensslv.h>
// The OpenSSL public header that describes build time configuration and
// availability (or lack of availability) of certain optional ciphers.
#include <openssl/opensslconf.h>
#include <openssl/asn1.h> #include <openssl/asn1.h>
#include <openssl/bio.h> #include <openssl/bio.h>
#include <openssl/bn.h> #include <openssl/bn.h>
...@@ -91,10 +95,22 @@ ...@@ -91,10 +95,22 @@
#define FOLLY_OPENSSL_HAS_ALPN 0 #define FOLLY_OPENSSL_HAS_ALPN 0
#endif #endif
// OpenSSL 1.1.1 and above have TLS 1.3 and BLAKE2B support /**
* OpenSSL 1.1.1 specific checks.
*/
#if OPENSSL_VERSION_NUMBER >= 0x1010100fL #if OPENSSL_VERSION_NUMBER >= 0x1010100fL
// TLS 1.3 was introduced in OpenSSL 1.1.1
#define FOLLY_OPENSSL_HAS_TLS13 1 #define FOLLY_OPENSSL_HAS_TLS13 1
// OpenSSL 1.1.1 introduced several new ciphers and digests. Unless they are
// explicitly compiled out, they are assumed to be present
#if !defined(OPENSSL_NO_BLAKE2)
#define FOLLY_OPENSSL_HAS_BLAKE2B 1 #define FOLLY_OPENSSL_HAS_BLAKE2B 1
#else
#define FOLLY_OPENSSL_HAS_BLAKE2B 0
#endif
#else #else
#define FOLLY_OPENSSL_HAS_TLS13 0 #define FOLLY_OPENSSL_HAS_TLS13 0
#define FOLLY_OPENSSL_HAS_BLAKE2B 0 #define FOLLY_OPENSSL_HAS_BLAKE2B 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment