omq-curve 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4467d1bd382bc255adfa0bec74e9d3289c39b9c1799c9fc71d36f60679e5650d
4
- data.tar.gz: f7f9eab0b3de233277dc03ec765c67108e492b262bd0abdfd75ce58e54a768a8
3
+ metadata.gz: c188e290602cf8d0a6617f8a24fefe2da136363e9e17b88e0e16bd5659d9b2a5
4
+ data.tar.gz: 7759d2a5ff116303f32a485fc9eee129f8e0eb59fecdad52ccde023b3c545f29
5
5
  SHA512:
6
- metadata.gz: b4759daa38f709431323373a1cada55872bd2cf93cf77b947276fbf09496f3f94b1912f39285b9a5dd948b353162dbd3ce8e5371a2f3ed3f7241daa22cebc509
7
- data.tar.gz: 3d532560f8159b232e745c987b470f5c42e65bc0705cee25af4b5218c7a26e1c3b368dde7e798d0ecedaa815b5b41a28d679aead6d503abe5402e0a994b0240b
6
+ metadata.gz: 4c2aaed442fa7eab3b9cc46bc2dc5729fc939a88152e05d6427c64a393c6b4118eec9f4213f2f0de0d842c4084e6484dcc94826e5b2cc242e26df1a8364f21d2
7
+ data.tar.gz: ce7f61b12f62126353d4bf879fb7eaf5ee627b34cd0d75fb179ec4b46a24d97c3435c1987a94ed2058c3be03f375cec718b2f5920eece0432b82c3f9893c20fa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.4 — 2026-03-27
4
+
5
+ ### Fixed
6
+
7
+ - CURVE handshake deadlocks with buffered IO — missing `io.flush` after
8
+ greeting, HELLO, INITIATE (client) and greeting, WELCOME, READY
9
+ (server) writes caused both peers to block on read
10
+ - Tests used `minimum_write_size: 0` which bypassed IO buffering entirely,
11
+ masking the flush bug
12
+
3
13
  ## 0.2.3 — 2026-03-26
4
14
 
5
15
  ### Changed
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # OMQ-CURVE
2
2
 
3
- [![CI](https://github.com/paddor/omq-curve/actions/workflows/ci.yml/badge.svg)](https://github.com/paddor/omq-curve/actions/workflows/ci.yml)
3
+ [![CI](https://github.com/zeromq/omq-curve/actions/workflows/ci.yml/badge.svg)](https://github.com/zeromq/omq-curve/actions/workflows/ci.yml)
4
4
  [![Gem Version](https://img.shields.io/gem/v/omq-curve?color=e9573f)](https://rubygems.org/gems/omq-curve)
5
5
  [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE)
6
6
  [![Ruby](https://img.shields.io/badge/Ruby-%3E%3D%203.3-CC342D?logo=ruby&logoColor=white)](https://www.ruby-lang.org)
7
7
 
8
- CurveZMQ ([RFC 26](https://rfc.zeromq.org/spec/26/)) encryption for [OMQ](https://github.com/paddor/omq). Adds Curve25519 authenticated encryption to any OMQ socket over tcp or ipc.
8
+ CurveZMQ ([RFC 26](https://rfc.zeromq.org/spec/26/)) encryption for [OMQ](https://github.com/zeromq/omq). Adds Curve25519 authenticated encryption to any OMQ socket over tcp or ipc.
9
9
 
10
10
  Interoperates with libzmq, CZMQ, pyzmq, and any other ZMTP 3.1 peer that speaks CURVE.
11
11
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OMQ
4
- CURVE_VERSION = "0.2.3"
4
+ CURVE_VERSION = "0.2.4"
5
5
  end
@@ -194,6 +194,7 @@ module OMQ
194
194
 
195
195
  # --- Exchange greetings ---
196
196
  io.write(Codec::Greeting.encode(mechanism: MECHANISM_NAME, as_server: false))
197
+ io.flush
197
198
  peer_greeting = Codec::Greeting.decode(io.read_exactly(Codec::Greeting::SIZE))
198
199
  unless peer_greeting[:mechanism] == MECHANISM_NAME
199
200
  raise ProtocolError, "expected CURVE mechanism, got #{peer_greeting[:mechanism]}"
@@ -214,6 +215,7 @@ module OMQ
214
215
  hello << signature # 80 bytes (64 + 16 MAC)
215
216
 
216
217
  io.write(Codec::Frame.new(hello, command: true).to_wire)
218
+ io.flush
217
219
 
218
220
  # --- Read WELCOME ---
219
221
  welcome_frame = Codec::Frame.read_from(io)
@@ -272,6 +274,7 @@ module OMQ
272
274
  initiate << init_ciphertext
273
275
 
274
276
  io.write(Codec::Frame.new(initiate, command: true).to_wire)
277
+ io.flush
275
278
 
276
279
  # --- Read READY ---
277
280
  ready_frame = Codec::Frame.read_from(io)
@@ -310,6 +313,7 @@ module OMQ
310
313
  def server_handshake!(io, socket_type:, identity:)
311
314
  # --- Exchange greetings ---
312
315
  io.write(Codec::Greeting.encode(mechanism: MECHANISM_NAME, as_server: true))
316
+ io.flush
313
317
  peer_greeting = Codec::Greeting.decode(io.read_exactly(Codec::Greeting::SIZE))
314
318
  unless peer_greeting[:mechanism] == MECHANISM_NAME
315
319
  raise ProtocolError, "expected CURVE mechanism, got #{peer_greeting[:mechanism]}"
@@ -361,6 +365,7 @@ module OMQ
361
365
  welcome << w_ciphertext # 128 + 16 = 144 bytes
362
366
 
363
367
  io.write(Codec::Frame.new(welcome, command: true).to_wire)
368
+ io.flush
364
369
 
365
370
  # --- Read INITIATE ---
366
371
  # Server recovers cn_public and sn_secret from the cookie below.
@@ -457,6 +462,7 @@ module OMQ
457
462
  ready << r_ciphertext
458
463
 
459
464
  io.write(Codec::Frame.new(ready, command: true).to_wire)
465
+ io.flush
460
466
 
461
467
  props = Codec::Command.decode_properties(metadata_bytes)
462
468
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omq-curve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger
@@ -54,7 +54,7 @@ files:
54
54
  - lib/omq/curve/version.rb
55
55
  - lib/omq/z85.rb
56
56
  - lib/omq/zmtp/mechanism/curve.rb
57
- homepage: https://github.com/paddor/omq-curve
57
+ homepage: https://github.com/zeromq/omq-curve
58
58
  licenses:
59
59
  - ISC
60
60
  metadata: {}