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
c1fabf5c
Commit
c1fabf5c
authored
Sep 12, 2013
by
Ian Barber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #655 from hintjens/master
Fixed overwrite in zmq_getsockopt
parents
60f47045
345bf146
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
11 deletions
+25
-11
zmq_getsockopt.txt
doc/zmq_getsockopt.txt
+7
-5
options.cpp
src/options.cpp
+3
-3
options.hpp
src/options.hpp
+1
-1
z85_codec.hpp
src/z85_codec.hpp
+2
-1
Makefile.am
tools/Makefile.am
+10
-0
z85_codec.h
tools/z85_codec.h
+2
-1
No files found.
doc/zmq_getsockopt.txt
View file @
c1fabf5c
...
@@ -542,11 +542,13 @@ ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key
...
@@ -542,11 +542,13 @@ ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key
Retrieves the current long term public key for the socket. You can
Retrieves the current long term public key for the socket. You can
provide either a 32 byte buffer, to retrieve the binary key value, or
provide either a 32 byte buffer, to retrieve the binary key value, or
a 40 byte buffer, to retrieve the key in a printable Z85 format.
a 41 byte buffer, to retrieve the key in a printable Z85 format.
NOTE: to fetch a printable key, the buffer must be 41 bytes large
to hold the 40-char key value and one null byte.
[horizontal]
[horizontal]
Option value type:: binary data or Z85 text string
Option value type:: binary data or Z85 text string
Option value size:: 32 or 4
0
Option value size:: 32 or 4
1
Default value:: null
Default value:: null
Applicable socket types:: all, when using TCP transport
Applicable socket types:: all, when using TCP transport
...
@@ -556,11 +558,11 @@ ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key
...
@@ -556,11 +558,11 @@ ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key
Retrieves the current long term secret key for the socket. You can
Retrieves the current long term secret key for the socket. You can
provide either a 32 byte buffer, to retrieve the binary key value, or
provide either a 32 byte buffer, to retrieve the binary key value, or
a 4
0
byte buffer, to retrieve the key in a printable Z85 format.
a 4
1
byte buffer, to retrieve the key in a printable Z85 format.
[horizontal]
[horizontal]
Option value type:: binary data or Z85 text string
Option value type:: binary data or Z85 text string
Option value size:: 32 or 4
0
Option value size:: 32 or 4
1
Default value:: null
Default value:: null
Applicable socket types:: all, when using TCP transport
Applicable socket types:: all, when using TCP transport
...
@@ -574,7 +576,7 @@ a 40 byte buffer, to retrieve the key in a printable Z85 format.
...
@@ -574,7 +576,7 @@ a 40 byte buffer, to retrieve the key in a printable Z85 format.
[horizontal]
[horizontal]
Option value type:: binary data or Z85 text string
Option value type:: binary data or Z85 text string
Option value size:: 32 or 4
0
Option value size:: 32 or 4
1
Default value:: null
Default value:: null
Applicable socket types:: all, when using TCP transport
Applicable socket types:: all, when using TCP transport
...
...
src/options.cpp
View file @
c1fabf5c
...
@@ -590,7 +590,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
...
@@ -590,7 +590,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return
0
;
return
0
;
}
}
else
else
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
)
{
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
+
1
)
{
Z85_encode
((
char
*
)
optval_
,
curve_public_key
,
CURVE_KEYSIZE
);
Z85_encode
((
char
*
)
optval_
,
curve_public_key
,
CURVE_KEYSIZE
);
return
0
;
return
0
;
}
}
...
@@ -602,7 +602,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
...
@@ -602,7 +602,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return
0
;
return
0
;
}
}
else
else
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
)
{
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
+
1
)
{
Z85_encode
((
char
*
)
optval_
,
curve_secret_key
,
CURVE_KEYSIZE
);
Z85_encode
((
char
*
)
optval_
,
curve_secret_key
,
CURVE_KEYSIZE
);
return
0
;
return
0
;
}
}
...
@@ -614,7 +614,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
...
@@ -614,7 +614,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return
0
;
return
0
;
}
}
else
else
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
)
{
if
(
*
optvallen_
==
CURVE_KEYSIZE_Z85
+
1
)
{
Z85_encode
((
char
*
)
optval_
,
curve_server_key
,
CURVE_KEYSIZE
);
Z85_encode
((
char
*
)
optval_
,
curve_server_key
,
CURVE_KEYSIZE
);
return
0
;
return
0
;
}
}
...
...
src/options.hpp
View file @
c1fabf5c
...
@@ -53,7 +53,7 @@ namespace zmq
...
@@ -53,7 +53,7 @@ namespace zmq
unsigned
char
identity_size
;
unsigned
char
identity_size
;
unsigned
char
identity
[
256
];
unsigned
char
identity
[
256
];
// Maximum tranfer rate [kb/s]. Default 100kb/s.
// Maximum tran
s
fer rate [kb/s]. Default 100kb/s.
int
rate
;
int
rate
;
// Reliability time interval [ms]. Default 10 seconds.
// Reliability time interval [ms]. Default 10 seconds.
...
...
src/z85_codec.hpp
View file @
c1fabf5c
...
@@ -48,7 +48,8 @@ static uint8_t decoder [96] = {
...
@@ -48,7 +48,8 @@ static uint8_t decoder [96] = {
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Encode a binary frame as a string; destination string MUST be at least
// Encode a binary frame as a string; destination string MUST be at least
// size * 5 / 4 bytes long. Returns dest. Size must be a multiple of 4.
// size * 5 / 4 bytes long plus 1 byte for the null terminator. Returns
// dest. Size must be a multiple of 4.
char
*
char
*
Z85_encode
(
char
*
dest
,
uint8_t
*
data
,
size_t
size
)
Z85_encode
(
char
*
dest
,
uint8_t
*
data
,
size_t
size
)
...
...
tools/Makefile.am
View file @
c1fabf5c
EXTRA_DIST
=
curve_keygen.c z85_codec.h
EXTRA_DIST
=
curve_keygen.c z85_codec.h
INCLUDES
=
-I
$(top_builddir)
/include
\
-I
$(top_srcdir)
/include
# INCLUDES = -I$(top_srcdir)/include
bin_PROGRAMS
=
curve_keygen
curve_keygen_LDADD
=
$(top_builddir)
/src/libzmq.la
curve_keygen_SOURCES
=
curve_keygen.c
tools/z85_codec.h
View file @
c1fabf5c
...
@@ -50,7 +50,8 @@ static uint8_t decoder [96] = {
...
@@ -50,7 +50,8 @@ static uint8_t decoder [96] = {
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Encode a binary frame as a string; destination string MUST be at least
// Encode a binary frame as a string; destination string MUST be at least
// size * 5 / 4 bytes long. Returns dest. Size must be a multiple of 4.
// size * 5 / 4 bytes long plus 1 byte for the null terminator. Returns
// dest. Size must be a multiple of 4.
char
*
char
*
Z85_encode
(
char
*
dest
,
uint8_t
*
data
,
size_t
size
)
Z85_encode
(
char
*
dest
,
uint8_t
*
data
,
size_t
size
)
...
...
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