-
Notifications
You must be signed in to change notification settings - Fork 846
Remove dependency on OpenSSL's OCSP API #9624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| #endif | ||
| #include <openssl/x509v3.h> | ||
| #include <openssl/asn1.h> | ||
| #include <openssl/asn1t.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is all this code copied from openssl 3.0? If not, do we need to display this license somewhere? https://www.openssl.org/source/license-openssl-ssleay.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All code copied is from OpenSSL 3.0 or 3.1 (the both are Apache License), but we may still need some note about it. @zwoop What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added comments.
| #define MAX_STAPLING_DER 10240 | ||
|
|
||
| extern ClassAllocator<FetchSM> FetchSMAllocator; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can' t the anonymous namespace start here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember the exact error, but it was probably considered as a different thing if it's in a namespace because the actual FetchSMAllocator is not in any namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the anonymous namespace should start after that declaration, not include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CXX OCSPStapling.o
OCSPStapling.cc:230:1: error: no template named 'StackTraits'; did you mean '::bssl::internal::StackTraits'?
DEFINE_STACK_OF(TS_OCSP_ONEREQ)
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:100:31: note: expanded from macro 'DEFINE_STACK_OF'
#define DEFINE_STACK_OF(type) DEFINE_NAMED_STACK_OF(type, type)
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:94:3: note: expanded from macro 'DEFINE_NAMED_STACK_OF'
BORINGSSL_DEFINE_STACK_TRAITS(name, type, false)
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:357:10: note: expanded from macro 'BORINGSSL_DEFINE_STACK_TRAITS'
struct StackTraits<STACK_OF(name)> { \
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:347:8: note: '::bssl::internal::StackTraits' declared here
struct StackTraits {};
^
OCSPStapling.cc:230:1: error: class template specialization of 'StackTraits' not in a namespace enclosing 'internal'
DEFINE_STACK_OF(TS_OCSP_ONEREQ)
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:100:31: note: expanded from macro 'DEFINE_STACK_OF'
#define DEFINE_STACK_OF(type) DEFINE_NAMED_STACK_OF(type, type)
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:94:3: note: expanded from macro 'DEFINE_NAMED_STACK_OF'
BORINGSSL_DEFINE_STACK_TRAITS(name, type, false)
^
/Users/mkitajo/opt/boringssl/include/openssl/stack.h:357:10: note: expanded from macro 'BORINGSSL_DEFINE_STACK_TRAITS'
struct StackTraits<STACK_OF(name)> { \
^
blah blah blah
The configure script fails to detect OCSP support when building ATS with OpenSSL 3.0. This isn't a problem in the `master` branch, which copied OpenSSL's OCSP code into ATS itself in apache#9624. However, this remains a problem on existing releases and downstream packages seem to be affected by it. Here's a list of the few I checked: - Alpine - Debian 12 - Fedora 37 - Homebrew - Nixpkgs This happens because OpenSSL 3.0 made changes to its APIs that affected how ATS detects OCSP support. ATS checks the existence of a few functions, including `OCSP_REQ_CTX_add1_header` and `OCSP_REQ_CTX_set1_req`, by attempting to link to them using `AC_CHECK_FUNCS`. In OpenSSL 3.0, these functions were turned into macros making them uneligible for detection with `AC_CHECK_FUNCS`. This change fixes that problem by instead using `AC_LANG_PROGRAM` to check that code using the aforementioned functions compile. This approach works for OpenSSL both before and after 3.0.
The configure script fails to detect OCSP support when building ATS with OpenSSL 3.0. This isn't a problem in the `master` branch, which copied OpenSSL's OCSP code into ATS itself in apache#9624. However, this remains a problem on existing releases and downstream packages seem to be affected by it. Here's a list of the few I checked: - Alpine - Debian 12 - Fedora 37 - Homebrew - Nixpkgs This happens because OpenSSL 3.0 made changes to its APIs that affected how ATS detects OCSP support. ATS checks the existence of a few functions, including `OCSP_REQ_CTX_add1_header` and `OCSP_REQ_CTX_set1_req`, by attempting to link to them using `AC_CHECK_FUNCS`. In OpenSSL 3.0, these functions were turned into macros making them uneligible for detection with `AC_CHECK_FUNCS`. This change fixes that problem by instead using `AC_LANG_PROGRAM` to check that code using the aforementioned functions compile. This approach works for OpenSSL both before and after 3.0.
The configure script fails to detect OCSP support when building ATS with OpenSSL 3.0. This isn't a problem in the `master` branch, which copied OpenSSL's OCSP code into ATS itself in #9624. However, this remains a problem on existing releases and downstream packages seem to be affected by it. Here's a list of the few I checked: - Alpine - Debian 12 - Fedora 37 - Homebrew - Nixpkgs This happens because OpenSSL 3.0 made changes to its APIs that affected how ATS detects OCSP support. ATS checks the existence of a few functions, including `OCSP_REQ_CTX_add1_header` and `OCSP_REQ_CTX_set1_req`, by attempting to link to them using `AC_CHECK_FUNCS`. In OpenSSL 3.0, these functions were turned into macros making them uneligible for detection with `AC_CHECK_FUNCS`. This change fixes that problem by instead using `AC_LANG_PROGRAM` to check that code using the aforementioned functions compile. This approach works for OpenSSL both before and after 3.0.
Changes: