diff options
author | Kazuki Yamaguchi <[email protected]> | 2021-09-27 13:32:03 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <[email protected]> | 2021-10-25 00:40:42 +0900 |
commit | 32d49e93cf958adf85eb12fa361f49f26d9559b7 (patch) | |
tree | ca62a7ece785a529ab98bb9e5767b60c67e82a31 /ext/openssl/ossl.h | |
parent | 1ea53253606600c4f115d9acde9e858fd74f4851 (diff) |
[ruby/openssl] ext/openssl/ossl.h: add helper macros for OpenSSL/LibreSSL versions
Add following convenient macros:
- OSSL_IS_LIBRESSL
- OSSL_OPENSSL_PREREQ(maj, min, pat)
- OSSL_LIBRESSL_PREREQ(maj, min, pat)
https://github.com/ruby/openssl/commit/00abee791d
Diffstat (limited to 'ext/openssl/ossl.h')
-rw-r--r-- | ext/openssl/ossl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h index be9dcbdff1..3a0ab1e593 100644 --- a/ext/openssl/ossl.h +++ b/ext/openssl/ossl.h @@ -42,6 +42,18 @@ #include <openssl/evp.h> #include <openssl/dh.h> +#ifndef LIBRESSL_VERSION_NUMBER +# define OSSL_IS_LIBRESSL 0 +# define OSSL_OPENSSL_PREREQ(maj, min, pat) \ + (OPENSSL_VERSION_NUMBER >= (maj << 28) | (min << 20) | (pat << 12)) +# define OSSL_LIBRESSL_PREREQ(maj, min, pat) 0 +#else +# define OSSL_IS_LIBRESSL 1 +# define OSSL_OPENSSL_PREREQ(maj, min, pat) 0 +# define OSSL_LIBRESSL_PREREQ(maj, min, pat) \ + (LIBRESSL_VERSION_NUMBER >= (maj << 28) | (min << 20) | (pat << 12)) +#endif + /* * Common Module */ |