Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable Curve and Libsodium support #682

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,10 @@ jobs:
vcpkg: true
architecture: ${{ matrix.cpp_arch }}

- name: Install Mac-OS x86_64 Dependencies
if: ${{ contains(matrix.os, 'macos') && matrix.node_arch == 'x64' }}
- name: Install Mac-OS Dependencies
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install libsodium gnutls

- name: Install Mac-OS arm64 Dependencies
if: ${{ contains(matrix.os, 'macos') && matrix.node_arch == 'arm64' }}
run: |
brew uninstall libsodium --force --ignore-dependencies
source ./script/macos-arm-deps.sh
echo "PATH=$PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
brew install gnutls autoconf automake libtool

- uses: pnpm/action-setup@v4
if: ${{ !matrix.docker }}
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@ endmacro()
option(ZMQ_DRAFT "Build and install draft APIs" OFF)
set_option_from_env(ZMQ_DRAFT)

option(ZMQ_CURVE "Enable CURVE security" OFF)
option(ZMQ_CURVE "Enable CURVE security" ON)
set_option_from_env(ZMQ_CURVE)

option(ZMQ_SODIUM "Using libsodium for CURVE security" OFF)
option(ZMQ_SODIUM "Using libsodium for CURVE security" ON)
set_option_from_env(ZMQ_SODIUM)

if(ZMQ_SODIUM AND APPLE)
message(STATUS "building libsodium requires running `brew install autoconf automake libtool`")
endif()

option(ZMQ_WEBSOCKETS "Enable WebSocket transport" OFF)
set_option_from_env(ZMQ_WEBSOCKETS)

Expand Down
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
- [Prebuilt binaries](#prebuilt-binaries)
- [Building from source](#building-from-source)
- [Available Build Options](#available-build-options)
- [Curve support](#curve-support)
- [Libsodium for Curve](#libsodium-for-curve)
- [Curve with Libsodium support](#curve-with-libsodium-support)
- [Draft support](#draft-support)
- [Websocket support](#websocket-support)
- [Secure Websocket support](#secure-websocket-support)
Expand Down Expand Up @@ -117,25 +116,17 @@ When building from source, you can also specify additional build options in a
<details>
<summary>👉🏻 Options</summary>

### Curve support
### Curve with Libsodium support

Enables CURVE security for encrypted communications. To enable CURVE support,
add the following to your .npmrc:
Enables CURVE security for encrypted communications. Zeromq uses libsodium for CURVE security. To enable CURVE support, add the following to your .npmrc:

```ini
zmq_curve="true"
```

### Libsodium for Curve

Enable libsodium for CURVE security instead of the built-in tweetnacl
implementation. This can provide better performance for CURVE operations. To use
libsodium, add the following to your .npmrc:

```ini
zmq_sodium="true"
```

Building libsodium requires running `brew install autoconf automake libtool`

#### Draft support

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