Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
94 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class ZeroMQ < FPM::Cookery::Recipe | ||
description 'The Intelligent Transport Layer' | ||
|
||
name 'zeromq' | ||
version '4.1.3' | ||
revision '1' | ||
|
||
homepage 'http://www.zeromq.org' | ||
source "http://download.zeromq.org/zeromq-#{version}.tar.gz" | ||
sha256 '61b31c830db377777e417235a24d3660a4bcc3f40d303ee58df082fcd68bf411' | ||
|
||
conflicts 'libzmq1' | ||
replaces 'libzmq1' | ||
|
||
build_depends 'pkg-config', 'libsodium' | ||
|
||
def build | ||
patch workdir('patches/libsodium-1.0.6.diff') | ||
|
||
configure :prefix => prefix | ||
|
||
make | ||
end | ||
|
||
def install | ||
make :install, 'DESTDIR' => destdir | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
Fix compatibility with libsodium 1.0.6. | ||
|
||
See: | ||
https://github.com/zeromq/zeromq4-1/commit/89d4e995ef92d5cb3d0f0373ec7d80c2ad7fa0d3 | ||
|
||
diff --git a/src/curve_client.cpp b/src/curve_client.cpp | ||
index 842e504..0b25b32 100644 | ||
--- src/curve_client.cpp | ||
+++ src/curve_client.cpp | ||
@@ -48,6 +48,7 @@ zmq::curve_client_t::curve_client_t (const options_t &options_) : | ||
cn_peer_nonce(1), | ||
sync() | ||
{ | ||
+ int rc; | ||
memcpy (public_key, options_.curve_public_key, crypto_box_PUBLICKEYBYTES); | ||
memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES); | ||
memcpy (server_key, options_.curve_server_key, crypto_box_PUBLICKEYBYTES); | ||
@@ -57,12 +58,12 @@ zmq::curve_client_t::curve_client_t (const options_t &options_) : | ||
unsigned char tmpbytes[4]; | ||
randombytes(tmpbytes, 4); | ||
#else | ||
- // todo check return code | ||
- sodium_init(); | ||
+ rc = sodium_init (); | ||
+ zmq_assert (rc != -1); | ||
#endif | ||
|
||
// Generate short-term key pair | ||
- const int rc = crypto_box_keypair (cn_public, cn_secret); | ||
+ rc = crypto_box_keypair (cn_public, cn_secret); | ||
zmq_assert (rc == 0); | ||
} | ||
|
||
diff --git a/src/curve_server.cpp b/src/curve_server.cpp | ||
index 7bdd8a9..e85b10b 100644 | ||
--- src/curve_server.cpp | ||
+++ src/curve_server.cpp | ||
@@ -52,6 +52,7 @@ zmq::curve_server_t::curve_server_t (session_base_t *session_, | ||
cn_peer_nonce(1), | ||
sync() | ||
{ | ||
+ int rc; | ||
// Fetch our secret key from socket options | ||
memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES); | ||
scoped_lock_t lock (sync); | ||
@@ -60,12 +61,12 @@ zmq::curve_server_t::curve_server_t (session_base_t *session_, | ||
unsigned char tmpbytes[4]; | ||
randombytes(tmpbytes, 4); | ||
#else | ||
- // todo check return code | ||
- sodium_init(); | ||
+ rc = sodium_init (); | ||
+ zmq_assert (rc != -1); | ||
#endif | ||
|
||
// Generate short-term key pair | ||
- const int rc = crypto_box_keypair (cn_public, cn_secret); | ||
+ rc = crypto_box_keypair (cn_public, cn_secret); | ||
zmq_assert (rc == 0); | ||
} | ||
|