Skip to content

Commit 2402a5d

Browse files
committed
feat: enable Curve and Libsodium support
1 parent 9f1172d commit 2402a5d

File tree

4 files changed

+14
-27
lines changed

4 files changed

+14
-27
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,10 @@ jobs:
9292
vcpkg: true
9393
architecture: ${{ matrix.cpp_arch }}
9494

95-
- name: Install Mac-OS x86_64 Dependencies
96-
if: ${{ contains(matrix.os, 'macos') && matrix.node_arch == 'x64' }}
95+
- name: Install Mac-OS Dependencies
96+
if: ${{ contains(matrix.os, 'macos') }}
9797
run: |
98-
brew install libsodium gnutls
99-
100-
- name: Install Mac-OS arm64 Dependencies
101-
if: ${{ contains(matrix.os, 'macos') && matrix.node_arch == 'arm64' }}
102-
run: |
103-
brew uninstall libsodium --force --ignore-dependencies
104-
source ./script/macos-arm-deps.sh
105-
echo "PATH=$PATH" >> $GITHUB_ENV
106-
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
98+
brew install gnutls autoconf automake libtool
10799
108100
- uses: pnpm/action-setup@v4
109101
if: ${{ !matrix.docker }}

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ endmacro()
3131
option(ZMQ_DRAFT "Build and install draft APIs" OFF)
3232
set_option_from_env(ZMQ_DRAFT)
3333

34-
option(ZMQ_CURVE "Enable CURVE security" OFF)
34+
option(ZMQ_CURVE "Enable CURVE security" ON)
3535
set_option_from_env(ZMQ_CURVE)
3636

37-
option(ZMQ_SODIUM "Using libsodium for CURVE security" OFF)
37+
option(ZMQ_SODIUM "Using libsodium for CURVE security" ON)
3838
set_option_from_env(ZMQ_SODIUM)
3939

40+
if(ZMQ_SODIUM AND APPLE)
41+
message(STATUS "building libsodium requires running `brew install autoconf automake libtool`")
42+
endif()
43+
4044
option(ZMQ_WEBSOCKETS "Enable WebSocket transport" OFF)
4145
set_option_from_env(ZMQ_WEBSOCKETS)
4246

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929
- [Prebuilt binaries](#prebuilt-binaries)
3030
- [Building from source](#building-from-source)
3131
- [Available Build Options](#available-build-options)
32-
- [Curve support](#curve-support)
33-
- [Libsodium for Curve](#libsodium-for-curve)
32+
- [Curve with Libsodium support](#curve-with-libsodium-support)
3433
- [Draft support](#draft-support)
3534
- [Websocket support](#websocket-support)
3635
- [Secure Websocket support](#secure-websocket-support)
@@ -117,25 +116,17 @@ When building from source, you can also specify additional build options in a
117116
<details>
118117
<summary>👉🏻 Options</summary>
119118

120-
### Curve support
119+
### Curve with Libsodium support
121120

122-
Enables CURVE security for encrypted communications. To enable CURVE support,
123-
add the following to your .npmrc:
121+
Enables CURVE security for encrypted communications. Zeromq uses libsodium for CURVE security. To enable CURVE support, add the following to your .npmrc:
124122

125123
```ini
126124
zmq_curve="true"
127-
```
128-
129-
### Libsodium for Curve
130-
131-
Enable libsodium for CURVE security instead of the built-in tweetnacl
132-
implementation. This can provide better performance for CURVE operations. To use
133-
libsodium, add the following to your .npmrc:
134-
135-
```ini
136125
zmq_sodium="true"
137126
```
138127

128+
Building libsodium requires running `brew install autoconf automake libtool`
129+
139130
#### Draft support
140131

141132
By default `libzmq` is built with support for `Draft` patterns (e.g.
File renamed without changes.

0 commit comments

Comments
 (0)