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

Ssl version 3 #1097

Closed
wants to merge 4 commits into from
Closed
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
25 changes: 0 additions & 25 deletions .github/workflows/nightly-macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,17 @@ jobs:
fail-fast: false
matrix:
boost:
- version: 1.71.0
- version: 1.76.0

build_type:
- type: Debug
warn_as_err: ON
- type: Release
warn_as_err: OFF

shared_libs:
- toggle: OFF
name: Static
- toggle: ON
name: Shared

with_openssl:
- toggle: OFF
name: 'noSSL'
- toggle: ON
name: 'SSL'

Expand Down Expand Up @@ -68,21 +61,3 @@ jobs:
-DBUILD_TESTS=ON \
-DBUILD_EXAMPLES=OFF

- name: Test
if: ${{ inputs.run_tests || github.event_name == 'schedule' }}
env:
BUILD_DIR: build
HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
run: |
./scripts/test-unix.sh

- name: Verify Installation
env:
BUILD_DIR: build-examples
run: |
./scripts/verify-installation-unix.sh \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/destination \
-DWITH_OPENSSL=${{ matrix.with_openssl.toggle }}
13 changes: 13 additions & 0 deletions hazelcast/src/hazelcast/client/discovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ ec2_request_signer::hmac_sh_a256_bytes(const void* key_buffer,
size_t data_len,
unsigned char* hash) const
{

#if OPENSSL_VERSION_NUMBER >= 0x30000000L
//https://www.openssl.org/docs/man3.0/man7/migration_guide.html
unsigned int len = 32;
EVP_MD_CTX *mdctx;
mdctx = EVP_MD_CTX_new();
EVP_MD_CTX_init(mdctx);
EVP_DigestInit_ex(mdctx, EVP_sha256(), nullptr);
EVP_DigestUpdate(mdctx, data, data_len);
EVP_DigestFinal_ex(mdctx, hash, &len);
EVP_MD_CTX_free(mdctx);
#else
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
HMAC_CTX* hmac = HMAC_CTX_new();
#else
Expand All @@ -279,6 +291,7 @@ ec2_request_signer::hmac_sh_a256_bytes(const void* key_buffer,
#else
HMAC_CTX_cleanup(hmac);
delete hmac;
#endif
#endif

return len;
Expand Down
9 changes: 9 additions & 0 deletions hazelcast/test/src/HazelcastTests7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1569,9 +1569,13 @@ TEST_P(AwsClientTest, testClientAwsMemberWithSecurityGroupDefaultIamRole)

TEST_P(AwsClientTest, testFipsEnabledAwsDiscovery)
{
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
GTEST_SKIP();
#else
if (GetParam() && !std::getenv("INSIDE_AWS")) {
GTEST_SKIP();
}
#endif

client_config clientConfig = get_config();

Expand All @@ -1587,8 +1591,13 @@ TEST_P(AwsClientTest, testFipsEnabledAwsDiscovery)
clientConfig.get_network_config().get_aws_config().set_inside_aws(
GetParam());

#if OPENSSL_VERSION_NUMBER >= 0x30000000L
// FIPS mode can be enabled over SSL conf
//https://wiki.openssl.org/index.php/OpenSSL_3.0
#else
// Turn Fips mode on
FIPS_mode_set(1);
#endif

auto hazelcastClient = new_client(std::move(clientConfig)).get();
auto map = hazelcastClient.get_map("myMap").get();
Expand Down