diff --git a/cmd/tools/modules/testing/common.v b/cmd/tools/modules/testing/common.v index 75134adb9a..901201ff5e 100644 --- a/cmd/tools/modules/testing/common.v +++ b/cmd/tools/modules/testing/common.v @@ -54,9 +54,6 @@ pub const is_python_present = os.execute('python --version').exit_code == 0 pub const is_sqlite3_present = os.execute('sqlite3 --version').exit_code == 0 && os.execute('pkg-config sqlite3 --libs').exit_code == 0 -pub const is_openssl_present = os.execute('openssl --version').exit_code == 0 - && os.execute('pkg-config openssl --libs').exit_code == 0 - pub const all_processes = get_all_processes() pub const header_bytes_to_search_for_module_main = 500 @@ -881,6 +878,18 @@ fn get_max_header_len() int { return cols } +fn check_openssl_present() bool { + $if openbsd { + return os.execute('eopenssl34 --version').exit_code == 0 + && os.execute('pkg-config eopenssl34 --libs').exit_code == 0 + } $else { + return os.execute('openssl --version').exit_code == 0 + && os.execute('pkg-config openssl --libs').exit_code == 0 + } +} + +pub const is_openssl_present = check_openssl_present() + // is_started_mysqld is true, when the test runner determines that there is a running mysql server pub const is_started_mysqld = find_started_process('mysqld') or { '' } diff --git a/vlib/crypto/ecdsa/ecdsa.c.v b/vlib/crypto/ecdsa/ecdsa.c.v index 38a20a5ba3..36c8c088e1 100644 --- a/vlib/crypto/ecdsa/ecdsa.c.v +++ b/vlib/crypto/ecdsa/ecdsa.c.v @@ -15,6 +15,9 @@ module ecdsa #flag linux -I/usr/local/include/openssl #flag linux -L/usr/local/lib64/ +#flag openbsd -I/usr/local/include/eopenssl34 +#flag openbsd -L/usr/local/lib/eopenssl34 -Wl,-rpath,/usr/local/lib/eopenssl34 + // Installed through choco: #flag windows -IC:/Program Files/OpenSSL-Win64/include #flag windows -LC:/Program Files/OpenSSL-Win64/lib/VC/x64/MD diff --git a/vlib/crypto/ecdsa/ecdsa_test.v b/vlib/crypto/ecdsa/ecdsa_test.v index f2a565704c..c336b99ff5 100644 --- a/vlib/crypto/ecdsa/ecdsa_test.v +++ b/vlib/crypto/ecdsa/ecdsa_test.v @@ -1,4 +1,4 @@ -// vtest build: present_openssl? && !(sanitize-memory-clang || docker-ubuntu-musl) +// vtest build: present_openssl? && !(openbsd && gcc) && !(sanitize-memory-clang || docker-ubuntu-musl) module ecdsa fn test_ecdsa() { diff --git a/vlib/crypto/ecdsa/example/ecdsa_seed_test.v b/vlib/crypto/ecdsa/example/ecdsa_seed_test.v index 122d8e94ee..b04be65c78 100644 --- a/vlib/crypto/ecdsa/example/ecdsa_seed_test.v +++ b/vlib/crypto/ecdsa/example/ecdsa_seed_test.v @@ -1,4 +1,4 @@ -// vtest build: present_openssl? && !(sanitize-memory-clang || docker-ubuntu-musl) +// vtest build: present_openssl? && !(openbsd && gcc) && !(sanitize-memory-clang || docker-ubuntu-musl) import rand import crypto.ecdsa import encoding.hex diff --git a/vlib/crypto/ecdsa/example/ensure_compatibility_with_net_openssl_test.v b/vlib/crypto/ecdsa/example/ensure_compatibility_with_net_openssl_test.v index acc470216f..4119225180 100644 --- a/vlib/crypto/ecdsa/example/ensure_compatibility_with_net_openssl_test.v +++ b/vlib/crypto/ecdsa/example/ensure_compatibility_with_net_openssl_test.v @@ -1,4 +1,4 @@ -// vtest build: present_openssl? && !(sanitize-memory-clang || docker-ubuntu-musl) +// vtest build: present_openssl? && !(openbsd && gcc) && !(sanitize-memory-clang || docker-ubuntu-musl) import net.openssl import crypto.ecdsa diff --git a/vlib/crypto/ecdsa/util_test.v b/vlib/crypto/ecdsa/util_test.v index 20a5207d18..278b387b1d 100644 --- a/vlib/crypto/ecdsa/util_test.v +++ b/vlib/crypto/ecdsa/util_test.v @@ -1,4 +1,4 @@ -// vtest build: present_openssl? && !(sanitize-memory-clang || docker-ubuntu-musl) +// vtest build: present_openssl? && !(openbsd && gcc) && !(sanitize-memory-clang || docker-ubuntu-musl) module ecdsa import encoding.hex @@ -90,7 +90,7 @@ fn test_load_privkey_from_string_sign_and_verify() ! { expected_pvkey_bytes := '30ce3da288965ac6093f0ba9a9a15b2476bea3eda925e1b3c1f094674f52795cd6cb3cafe235dfc15bec542448ffa715' assert pvkey.bytes()!.hex() == expected_pvkey_bytes - // public key part + // public key part pbkey := pvkey.public_key()! pbkey_bytes := pbkey.bytes()! expected_pubkey_bytes := '04f8fdeb845913d5f5c761b6370a9701761eb14c2ef831017171fb4d543df310f573a3ffce6a52156ad635eb692c83cb9158176f145b8767d38c55791b8f05b085c5cfeea988f6b3922d1dc019495dcbe6c1a55da74f7d3aa8223081400c78e24f' @@ -133,7 +133,7 @@ UHhnmmVRraSwrVkPdYIeXhH/Ob4+8OLcwrQBMv4RXsD1GVFsgkvEYDTEb/vnMA== fn test_key_signing_verifying_with_custom_hash() ! { // privatekey_sample was P-384 key pvkey := privkey_from_string(privatekey_sample)! - // public key part + // public key part pbkey := pvkey.public_key()! pbk := pubkey_from_string(public_key_sample)!