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
27591d2d
Commit
27591d2d
authored
Apr 23, 2014
by
Chris Busbey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMQ_GSSAPI_PLAINTEXT option for disabling encryption
parent
18da8a74
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
6 deletions
+47
-6
zmq.h
include/zmq.h
+1
-0
gssapi_client.cpp
src/gssapi_client.cpp
+10
-2
gssapi_mechanism_base.cpp
src/gssapi_mechanism_base.cpp
+2
-1
gssapi_mechanism_base.hpp
src/gssapi_mechanism_base.hpp
+3
-0
gssapi_server.cpp
src/gssapi_server.cpp
+10
-2
options.cpp
src/options.cpp
+18
-1
options.hpp
src/options.hpp
+3
-0
No files found.
include/zmq.h
View file @
27591d2d
...
...
@@ -299,6 +299,7 @@ ZMQ_EXPORT char *zmq_msg_gets (zmq_msg_t *msg, char *property);
#define ZMQ_GSSAPI_SERVER 62
#define ZMQ_GSSAPI_PRINCIPAL 63
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL 64
#define ZMQ_GSSAPI_PLAINTEXT 65
/* Message options */
#define ZMQ_MORE 1
...
...
src/gssapi_client.cpp
View file @
27591d2d
...
...
@@ -133,13 +133,21 @@ int zmq::gssapi_client_t::process_handshake_command (msg_t *msg_)
int
zmq
::
gssapi_client_t
::
encode
(
msg_t
*
msg_
)
{
zmq_assert
(
state
==
connected
);
return
encode_message
(
msg_
);
if
(
do_encryption
)
return
encode_message
(
msg_
);
return
0
;
}
int
zmq
::
gssapi_client_t
::
decode
(
msg_t
*
msg_
)
{
zmq_assert
(
state
==
connected
);
return
decode_message
(
msg_
);
if
(
do_encryption
)
return
decode_message
(
msg_
);
return
0
;
}
bool
zmq
::
gssapi_client_t
::
is_handshake_complete
()
const
...
...
src/gssapi_mechanism_base.cpp
View file @
27591d2d
...
...
@@ -44,7 +44,8 @@ zmq::gssapi_mechanism_base_t::gssapi_mechanism_base_t (const options_t & options
ret_flags
(
0
),
gss_flags
(
GSS_C_MUTUAL_FLAG
|
GSS_C_REPLAY_FLAG
),
cred
(
GSS_C_NO_CREDENTIAL
),
context
(
GSS_C_NO_CONTEXT
)
context
(
GSS_C_NO_CONTEXT
),
do_encryption
(
!
options_
.
gss_plaintext
)
{
}
...
...
src/gssapi_mechanism_base.hpp
View file @
27591d2d
...
...
@@ -104,6 +104,9 @@ namespace zmq
// Opaque GSSAPI representation of the security context
gss_ctx_id_t
context
;
// If true, use gss to encrypt messages. If false, only utilize gss for auth.
bool
do_encryption
;
};
}
...
...
src/gssapi_server.cpp
View file @
27591d2d
...
...
@@ -281,13 +281,21 @@ error:
int
zmq
::
gssapi_server_t
::
encode
(
msg_t
*
msg_
)
{
zmq_assert
(
state
==
connected
);
return
encode_message
(
msg_
);
if
(
do_encryption
)
return
encode_message
(
msg_
);
return
0
;
}
int
zmq
::
gssapi_server_t
::
decode
(
msg_t
*
msg_
)
{
zmq_assert
(
state
==
connected
);
return
decode_message
(
msg_
);
if
(
do_encryption
)
return
decode_message
(
msg_
);
return
0
;
}
int
zmq
::
gssapi_server_t
::
zap_msg_available
()
...
...
src/options.cpp
View file @
27591d2d
...
...
@@ -54,7 +54,8 @@ zmq::options_t::options_t () :
mechanism
(
ZMQ_NULL
),
as_server
(
0
),
socket_id
(
0
),
conflate
(
false
)
conflate
(
false
),
gss_plaintext
(
false
)
{
}
...
...
@@ -427,6 +428,14 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break
;
case
ZMQ_GSSAPI_PLAINTEXT
:
if
(
is_int
&&
(
value
==
0
||
value
==
1
))
{
gss_plaintext
=
(
value
!=
0
);
return
0
;
}
break
;
default
:
break
;
}
...
...
@@ -730,6 +739,14 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break
;
case
ZMQ_GSSAPI_PLAINTEXT
:
if
(
is_int
)
{
*
value
=
gss_plaintext
;
return
0
;
}
break
;
}
errno
=
EINVAL
;
return
-
1
;
...
...
src/options.hpp
View file @
27591d2d
...
...
@@ -160,6 +160,9 @@ namespace zmq
std
::
string
gss_principal
;
std
::
string
gss_service_principal
;
// If true, gss encryption will be disabled
bool
gss_plaintext
;
// ID of the socket.
int
socket_id
;
...
...
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