Skip to content

Commit

Permalink
refs #4553 fixed a bug building with openssl 3+ that could cause a ru…
Browse files Browse the repository at this point in the history
…ntime crash when encryption is used
  • Loading branch information
davidnich committed Jul 6, 2022
1 parent 34a7b76 commit e1e78ba
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions doxygen/lang/900_release_notes.dox.tmpl
Expand Up @@ -11,6 +11,8 @@
- <a href="../../modules/WebUtil/html/index.html">WebUtil</a> module updates:
- fixed a bug where files outside the root directory could be served with specially-formatted requests
(<a href="https://github.com/qorelanguage/qore/issues/4550">issue 4550</a>)
- fixed a bug building with openssl 3+ that could cause a runtime crash when encryption is used
(<a href="https://github.com/qorelanguage/qore/issues/4553">issue 4553</a>)
- fixed a bug where it was not possible to set the minimum TLS level to v1.3 for encrypted connections
(<a href="https://github.com/qorelanguage/qore/issues/4551">issue 4551</a>)

Expand Down
2 changes: 1 addition & 1 deletion include/qore/common.h
Expand Up @@ -165,7 +165,7 @@ typedef std::vector<std::pair<const QoreExternalGlobalVar*, const QoreNamespace*
typedef std::vector<std::pair<const QoreExternalConstant*, const QoreNamespace*>> const_vec_t;

//! functor template for calling free() on pointers
template <typename T> struct free_ptr : std::unary_function <T*, void> {
template <typename T> struct free_ptr {
DLLLOCAL void operator()(T* ptr) {
free(ptr);
}
Expand Down
4 changes: 3 additions & 1 deletion include/qore/intern/QoreLibIntern.h
Expand Up @@ -39,7 +39,9 @@
#include <cstdarg>
#include <sys/types.h>

#ifdef HAVE_EVP_MAC_CTX_NEW
#include <openssl/crypto.h>

#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
#define OPENSSL_3_PLUS
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/qore/intern/ql_crypto.h
Expand Up @@ -225,7 +225,7 @@ class DigestHelper : public BaseHelper {
}
};

#ifndef OPENSSL_3_PLUS
#if !defined(OPENSSL_VERSION_MAJOR) || OPENSSL_VERSION_MAJOR < 3
class QoreHmacHelper {
public:
DLLLOCAL QoreHmacHelper() {
Expand All @@ -242,7 +242,7 @@ class QoreHmacHelper {
#else
HMAC_CTX_cleanup(&ctx);
#endif
}
}

DLLLOCAL HMAC_CTX* operator*() {
#ifdef HAVE_OPENSSL_INIT_CRYPTO
Expand Down
2 changes: 1 addition & 1 deletion include/qore/vector_set
Expand Up @@ -47,7 +47,7 @@
#include <algorithm>
#include <iterator>

struct string_compare : public std::unary_function<const char*, bool> {
struct string_compare {
DLLLOCAL explicit string_compare(const char* const& baseline) : baseline(baseline) {
}

Expand Down

0 comments on commit e1e78ba

Please sign in to comment.