Skip to content

crypto.ecdsa: add support for OpenSSL on OpenBSD#24772

Merged
spytheman merged 3 commits into
vlang:masterfrom
lcheylus:openbsd-openssl
Jun 22, 2025
Merged

crypto.ecdsa: add support for OpenSSL on OpenBSD#24772
spytheman merged 3 commits into
vlang:masterfrom
lcheylus:openbsd-openssl

Conversation

@lcheylus

@lcheylus lcheylus commented Jun 22, 2025

Copy link
Copy Markdown
Contributor

On OpenBSD, LibreSSL (https://www.libressl.org/) is used by default as TLS/crypto stack. This library is not fully compatible with OpenSSL v3.

OpenSSL v3.4 could be installed on OpenBSD via eopenssl34 package available in official ports tree.

This PR adds support for OpenSSL version 3.4 (more recent version available for 7.7 release) on OpenBSD :

  • cmd/tools/modules/testing/common.v: add special case for OpenBSD to check if OpenSSL is present
  • vlib/crypto/ecdsa/ecdsa.c.v: add flags for OpenSSL to find OpenSSL v3.4 includes/libs
  • disable tests for OpenBSD with gcc in crypto/ecdsa: issues to find OpenSSL symbols during link (unable to fix theses errors for now).

Tests OK on OpenBSD/amd64 with tcc, clang and gcc for vlib/crypto, vlib/net/ssl/ and vlib/net/openssl/

$ ./v -cc tcc -W test vlib/crypto/
(...)
Summary for all V _test.v files: 64 passed, 64 total. Elapsed time: 31790 ms, on 3 parallel jobs. Comptime: 65572 ms. Runtime: 28527 ms.

$ ./v -cc tcc -W test vlib/net/ssl/
---- Testing... ----------------------------------------------------------------------------------------------------------------------------
 OK       9.164 ms vlib/net/ssl/ssl_compiles_test.v
--------------------------------------------------------------------------------------------------------------------------------------------
Summary for all V _test.v files: 1 passed, 1 total. Elapsed time: 1221 ms, on 1 job. Comptime: 1206 ms. Runtime: 9 ms.

$ ./v -cc tcc -W test vlib/net/openssl/
---- Testing... ----------------------------------------------------------------------------------------------------------------------------
 OK       8.713 ms vlib/net/openssl/openssl_compiles_test.c.v
--------------------------------------------------------------------------------------------------------------------------------------------
Summary for all V _test.v files: 1 passed, 1 total. Elapsed time: 948 ms, on 1 job. Comptime: 935 ms. Runtime: 8 ms.

lcheylus added 3 commits June 22, 2025 09:54
Signed-off-by: Laurent Cheylus <foxy@free.fr>
Signed-off-by: Laurent Cheylus <foxy@free.fr>
On OpenBSD with gcc compiler, errors during tests => unable to find
symbols with OpenSSL 3.4.

Same tests OK on OpenBSD with tcc and clang (version 19).

Signed-off-by: Laurent Cheylus <foxy@free.fr>
@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-23189

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman merged commit e6a1983 into vlang:master Jun 22, 2025
74 of 75 checks passed
@lcheylus lcheylus deleted the openbsd-openssl branch June 22, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants