diff options
author | Sverker Eriksson <[email protected]> | 2012-08-30 15:37:05 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-08-30 15:37:42 +0200 |
commit | 07852bfc037ca748ca10049f47330fba80a54ad8 (patch) | |
tree | 603cbf5c9c665d4ce75c203bac72c496df5d62b1 /lib/crypto | |
parent | 261f8101567977491c6ca3adccf0d824b9ed9de6 (diff) | |
parent | d179fbc7d91729cae45ef72296bacc0d911972ab (diff) | |
download | otp-07852bfc037ca748ca10049f47330fba80a54ad8.tar.gz otp-07852bfc037ca748ca10049f47330fba80a54ad8.tar.bz2 otp-07852bfc037ca748ca10049f47330fba80a54ad8.zip |
Merge branch 'sverk/crypto-test-fix' into maint
* sverk/crypto-test-fix:
crypto: Skip some tests if openssl lib < 0.9.8
OTP-10249 Not related to this branch
Diffstat (limited to 'lib/crypto')
-rw-r--r-- | lib/crypto/test/crypto_SUITE.erl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 1b5bc44dde..7ac693f371 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -349,6 +349,14 @@ hmac_update_sha256(doc) -> hmac_update_sha256(suite) -> []; hmac_update_sha256(Config) when is_list(Config) -> + case openssl_version() of + V when V < 16#908000 -> + {skipped,"OpenSSL version too old"}; + _ -> + hmac_update_sha256_do() + end. + +hmac_update_sha256_do() -> ?line Key = hexstr2bin("00010203101112132021222330313233" "04050607141516172425262734353637" "08090a0b18191a1b28292a2b38393a3b" @@ -368,6 +376,14 @@ hmac_update_sha512(doc) -> hmac_update_sha512(suite) -> []; hmac_update_sha512(Config) when is_list(Config) -> + case openssl_version() of + V when V < 16#908000 -> + {skipped,"OpenSSL version too old"}; + _ -> + hmac_update_sha512_do() + end. + +hmac_update_sha512_do() -> ?line Key = hexstr2bin("00010203101112132021222330313233" "04050607141516172425262734353637" "08090a0b18191a1b28292a2b38393a3b" @@ -406,6 +422,14 @@ hmac_rfc4231(doc) -> hmac_rfc4231(suite) -> []; hmac_rfc4231(Config) when is_list(Config) -> + case openssl_version() of + V when V < 16#908000 -> + {skipped,"OpenSSL version too old"}; + _ -> + hmac_rfc4231_do() + end. + +hmac_rfc4231_do() -> %% Test Case 1 Case1Key = binary:copy(<<16#0b>>, 20), Case1Data = <<"Hi There">>, @@ -1927,3 +1951,11 @@ my_dss_sign(Data,Key) -> ?line S3 = crypto:dss_sign(none, crypto:sha(Raw), Key), [S1,S2,S3]. +openssl_version() -> + case crypto:info_lib() of + [{<<"OpenSSL">>,LibVer,_}] when is_integer(LibVer) -> + LibVer; + _ -> + undefined + end. + |