Skip to content

Commit 97911e6

Browse files
authored
Merge pull request #863 from junaruga/wip/fix-aws-lc-test
Improve AWS-LC tests
2 parents 5ee118c + 446ff3e commit 97911e6

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
with:
9494
path: ~/openssl
9595
key: openssl-${{ runner.os }}-${{ matrix.openssl }}-${{ matrix.append-configure || 'default' }}
96-
if: matrix.openssl != 'openssl-master' && matrix.openssl != 'libressl-master'
96+
if: matrix.openssl != 'openssl-master' && matrix.openssl != 'libressl-master' && matrix.openssl != 'aws-lc-latest'
9797

9898
- name: Compile OpenSSL library
9999
if: steps.cache-openssl.outputs.cache-hit != 'true'
@@ -127,7 +127,7 @@ jobs:
127127
git clone https://github.com/aws/aws-lc.git .
128128
AWS_LC_RELEASE=$(git tag --sort=-creatordate --list "v*" | head -1)
129129
git checkout $AWS_LC_RELEASE
130-
cmake -DCMAKE_INSTALL_PREFIX=$HOME/openssl
130+
cmake -DCMAKE_INSTALL_PREFIX=$HOME/openssl -DCMAKE_INSTALL_LIBDIR=lib
131131
make -j4 && make install
132132
;;
133133
*)

test/openssl/test_pkey_dh.rb

+11-16
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,20 @@ def test_new_generate
1818
assert_key(dh)
1919
end if ENV["OSSL_TEST_ALL"]
2020

21-
def test_new_break_on_non_fips
22-
omit_on_fips if !aws_lc?
23-
24-
assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
25-
assert_raise(RuntimeError) do
26-
OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise }
21+
def test_new_break
22+
unless openssl? && OpenSSL.fips_mode
23+
assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
24+
assert_raise(RuntimeError) do
25+
OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise }
26+
end
27+
else
28+
# The block argument is not executed in FIPS case.
29+
# See https://github.com/ruby/openssl/issues/692 for details.
30+
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
31+
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise })
2732
end
2833
end
2934

30-
def test_new_break_on_fips
31-
omit_on_non_fips
32-
return unless openssl? # This behavior only applies to OpenSSL.
33-
34-
# The block argument is not executed in FIPS case.
35-
# See https://github.com/ruby/openssl/issues/692 for details.
36-
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
37-
assert(OpenSSL::PKey::DH.new(NEW_KEYLEN) { raise })
38-
end
39-
4035
def test_derive_key
4136
params = Fixtures.pkey("dh2048_ffdhe2048")
4237
dh1 = OpenSSL::PKey.generate_key(params)

0 commit comments

Comments
 (0)