envoyproxy / envoy-openssl

Envoy OpenSSL extensions
Apache License 2.0
44 stars 39 forks source link

OpenSSL Testing Errors #35

Closed twghu closed 3 years ago

twghu commented 3 years ago

Several errors arose in the testing phase due to missing openssl config on the bazel test.

twghu commented 3 years ago

Follow up comment as to the cause of the failure due to makeunique usage, no action required.

With the move to OpenSSL, free() calls where introduced in the return calls from verifiySignature() in source/extensions/common/crypto/utility_impl.cc

The original upstream BSSL code had no call to free().

The wrapper from include/envoy/common/crypto/crypto.h

template T getTyped(CryptoObject& crypto) { return dynamic_cast<T>(&crypto); }

wrapped the PublicKeyObject pointer, which when passed to verifySignature() in the TEST(UtilityTest, TestVerifySignature) case was free'd due to error test.

The implicit destructor being called in the smart pointer was attempting do delete() on memory already free'd.