Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
f4848ddb
Commit
f4848ddb
authored
Jun 22, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prints message and exits if app tries to use CURVE without libsodium
parent
675bd464
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
options.cpp
src/options.cpp
+16
-0
No files found.
src/options.cpp
View file @
f4848ddb
...
@@ -286,6 +286,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
...
@@ -286,6 +286,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
break
;
break
;
case
ZMQ_CURVE_SERVER
:
case
ZMQ_CURVE_SERVER
:
# ifndef HAVE_LIBSODIUM
puts
(
"E: libzmq was not built using libsodium, CURVE not available"
);
assert
(
false
);
# endif
if
(
is_int
&&
(
value
==
0
||
value
==
1
))
{
if
(
is_int
&&
(
value
==
0
||
value
==
1
))
{
as_server
=
value
;
as_server
=
value
;
mechanism
=
value
?
ZMQ_CURVE
:
ZMQ_NULL
;
mechanism
=
value
?
ZMQ_CURVE
:
ZMQ_NULL
;
...
@@ -294,6 +298,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
...
@@ -294,6 +298,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
break
;
break
;
case
ZMQ_CURVE_PUBLICKEY
:
case
ZMQ_CURVE_PUBLICKEY
:
# ifndef HAVE_LIBSODIUM
puts
(
"E: libzmq was not built using libsodium, CURVE not available"
);
assert
(
false
);
# endif
if
(
optvallen_
==
CURVE_KEYSIZE
)
{
if
(
optvallen_
==
CURVE_KEYSIZE
)
{
memcpy
(
curve_public_key
,
optval_
,
CURVE_KEYSIZE
);
memcpy
(
curve_public_key
,
optval_
,
CURVE_KEYSIZE
);
mechanism
=
ZMQ_CURVE
;
mechanism
=
ZMQ_CURVE
;
...
@@ -302,6 +310,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
...
@@ -302,6 +310,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
break
;
break
;
case
ZMQ_CURVE_SECRETKEY
:
case
ZMQ_CURVE_SECRETKEY
:
# ifndef HAVE_LIBSODIUM
puts
(
"E: libzmq was not built using libsodium, CURVE not available"
);
assert
(
false
);
# endif
if
(
optvallen_
==
CURVE_KEYSIZE
)
{
if
(
optvallen_
==
CURVE_KEYSIZE
)
{
memcpy
(
curve_secret_key
,
optval_
,
CURVE_KEYSIZE
);
memcpy
(
curve_secret_key
,
optval_
,
CURVE_KEYSIZE
);
mechanism
=
ZMQ_CURVE
;
mechanism
=
ZMQ_CURVE
;
...
@@ -310,6 +322,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
...
@@ -310,6 +322,10 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
break
;
break
;
case
ZMQ_CURVE_SERVERKEY
:
case
ZMQ_CURVE_SERVERKEY
:
# ifndef HAVE_LIBSODIUM
puts
(
"E: libzmq was not built using libsodium, CURVE not available"
);
assert
(
false
);
# endif
if
(
optvallen_
==
CURVE_KEYSIZE
)
{
if
(
optvallen_
==
CURVE_KEYSIZE
)
{
memcpy
(
curve_server_key
,
optval_
,
CURVE_KEYSIZE
);
memcpy
(
curve_server_key
,
optval_
,
CURVE_KEYSIZE
);
as_server
=
0
;
as_server
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment