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
87834dd6
Commit
87834dd6
authored
Nov 21, 2013
by
Chris Busbey
Committed by
Chris Busbey
Apr 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed up comments from pr
parent
5441db3d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
13 deletions
+31
-13
gssapi_client.cpp
src/gssapi_client.cpp
+14
-1
gssapi_mechanism_base.cpp
src/gssapi_mechanism_base.cpp
+1
-10
gssapi_server.cpp
src/gssapi_server.cpp
+15
-1
options.cpp
src/options.cpp
+1
-1
No files found.
src/gssapi_client.cpp
View file @
87834dd6
...
...
@@ -39,9 +39,22 @@ zmq::gssapi_client_t::gssapi_client_t (const options_t &options_) :
security_context_established
(
false
)
{
const
std
::
string
::
size_type
service_size
=
options_
.
gss_service_principle
.
size
();
service_name
=
new
char
[
service_size
+
1
];
service_name
=
static_cast
<
char
*>
(
malloc
(
service_size
+
1
));
assert
(
service_name
);
memcpy
(
service_name
,
options_
.
gss_service_principle
.
c_str
(),
service_size
+
1
);
maj_stat
=
GSS_S_COMPLETE
;
if
(
!
options_
.
gss_principle
.
empty
())
{
const
std
::
string
::
size_type
principle_size
=
options_
.
gss_principle
.
size
();
principle_name
=
static_cast
<
char
*>
(
malloc
(
principle_size
+
1
));
assert
(
principle_name
);
memcpy
(
principle_name
,
options_
.
gss_principle
.
c_str
(),
principle_size
+
1
);
if
(
acquire_credentials
(
principle_name
,
&
cred
)
!=
0
)
maj_stat
=
GSS_S_FAILURE
;
}
mechs
.
elements
=
NULL
;
mechs
.
count
=
0
;
}
...
...
src/gssapi_mechanism_base.cpp
View file @
87834dd6
...
...
@@ -38,7 +38,7 @@ zmq::gssapi_mechanism_base_t::gssapi_mechanism_base_t (const options_t & options
/// FIXME remove? in_buf (),
target_name
(
GSS_C_NO_NAME
),
principle_name
(
NULL
),
maj_stat
(
GSS_S_CO
NTINUE_NEEDED
),
maj_stat
(
GSS_S_CO
MPLETE
),
min_stat
(
0
),
init_sec_min_stat
(
0
),
ret_flags
(
0
),
...
...
@@ -46,15 +46,6 @@ zmq::gssapi_mechanism_base_t::gssapi_mechanism_base_t (const options_t & options
cred
(
GSS_C_NO_CREDENTIAL
),
context
(
GSS_C_NO_CONTEXT
)
{
if
(
!
options_
.
gss_principle
.
empty
())
{
const
std
::
string
::
size_type
principle_size
=
options_
.
gss_principle
.
size
();
principle_name
=
new
char
[
principle_size
+
1
];
memcpy
(
principle_name
,
options_
.
gss_principle
.
c_str
(),
principle_size
+
1
);
if
(
acquire_credentials
(
principle_name
,
&
cred
)
!=
0
)
maj_stat
=
GSS_S_FAILURE
;
}
}
zmq
::
gssapi_mechanism_base_t
::~
gssapi_mechanism_base_t
()
...
...
src/gssapi_server.cpp
View file @
87834dd6
...
...
@@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "platform.hpp"
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
...
...
@@ -42,12 +43,26 @@ zmq::gssapi_server_t::gssapi_server_t (session_base_t *session_,
state
(
recv_next_token
),
security_context_established
(
false
)
{
maj_stat
=
GSS_S_CONTINUE_NEEDED
;
if
(
!
options_
.
gss_principle
.
empty
())
{
const
std
::
string
::
size_type
principle_size
=
options_
.
gss_principle
.
size
();
principle_name
=
static_cast
<
char
*>
(
malloc
(
principle_size
+
1
));
assert
(
principle_name
);
memcpy
(
principle_name
,
options_
.
gss_principle
.
c_str
(),
principle_size
+
1
);
if
(
acquire_credentials
(
principle_name
,
&
cred
)
!=
0
)
maj_stat
=
GSS_S_FAILURE
;
}
}
zmq
::
gssapi_server_t
::~
gssapi_server_t
()
{
if
(
cred
)
gss_release_cred
(
&
min_stat
,
&
cred
);
if
(
target_name
)
gss_release_name
(
&
min_stat
,
&
target_name
);
}
int
zmq
::
gssapi_server_t
::
next_handshake_command
(
msg_t
*
msg_
)
...
...
@@ -72,7 +87,6 @@ int zmq::gssapi_server_t::next_handshake_command (msg_t *msg_)
return
-
1
;
if
(
maj_stat
==
GSS_S_COMPLETE
)
{
gss_release_name
(
&
min_stat
,
&
target_name
);
security_context_established
=
true
;
}
...
...
src/options.cpp
View file @
87834dd6
...
...
@@ -422,7 +422,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
if
(
optvallen_
>
0
&&
optvallen_
<
256
&&
optval_
!=
NULL
)
{
gss_service_principle
.
assign
((
const
char
*
)
optval_
,
optvallen_
);
mechanism
=
ZMQ_GSSAPI
;
as_server
=
1
;
as_server
=
0
;
return
0
;
}
break
;
...
...
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