Skip to content
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

Old SSL Version Fixes And Changelog #931

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## 2.7

* Fix bug where X509 OSCP errors were not being handled properly and could
cause Lua overflow errors.
* Fix bug where certificate dates would return errors if after the 32-bit
apocalypse.
pamaddox marked this conversation as resolved.
Show resolved Hide resolved

### 2.7.3

* Update `configure.ac` to look for `epoll.h` when checking for epoll.
Expand Down
11 changes: 9 additions & 2 deletions src/eventer/eventer_SSL_fd_opset.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@
#define DEFAULT_LAYER_STRING "tlsv1:all,!sslv2,!sslv3"
#endif
#endif
#if OPENSSL_VERSION_NUMBER < _OPENSSL_VERSION_1_1_0
#define _X509_GET_NOTBEFORE X509_get_notBefore
#define _X509_GET_NOTAFTER X509_get_notAfter
#else
#define _X509_GET_NOTBEFORE X509_get0_notBefore
#define _X509_GET_NOTAFTER X509_get0_notAfter
#endif
/* ERR_error_string(3): buf must be at least 120 bytes... */
#define MIN_ERRSTR_LEN 120

Expand Down Expand Up @@ -246,10 +253,10 @@ eventer_ssl_verify_dates(eventer_ssl_ctx_t *ctx, int ok,
if(!x509ctx) return X509_V_ERR_APPLICATION_VERIFICATION;
const X509 *peer = X509_STORE_CTX_get_current_cert(x509ctx);
time(&now);
const ASN1_TIME *t = X509_get0_notBefore(peer);
const ASN1_TIME *t = _X509_GET_NOTBEFORE(peer);
ctx->start_time = OETS_ASN1_TIME_get(t, &err);
if(X509_cmp_time(t, &now) > 0) return X509_V_ERR_CERT_NOT_YET_VALID;
t = X509_get0_notAfter(peer);
t = _X509_GET_NOTAFTER(peer);
ctx->end_time = OETS_ASN1_TIME_get(t, &err);
if(X509_cmp_time(t, &now) < 0) return X509_V_ERR_CERT_HAS_EXPIRED;
return 0;
Expand Down