Skip to content

Commit

Permalink
feat: enable Curve and Libsodium support
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 23, 2024
1 parent 9f1172d commit 2402a5d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
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.

0 comments on commit 2402a5d

Please sign in to comment.