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
be62be0f
Commit
be62be0f
authored
Nov 08, 2013
by
Chris Busbey
Committed by
Chris Busbey
Apr 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gss encode/decode 'more' flag
parent
778c72b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
gssapi_mechanism_base.cpp
src/gssapi_mechanism_base.cpp
+17
-4
No files found.
src/gssapi_mechanism_base.cpp
View file @
be62be0f
...
...
@@ -62,8 +62,17 @@ int zmq::gssapi_mechanism_base_t::encode_message (msg_t *msg_)
int
state
;
gss_buffer_desc
plaintext
;
gss_buffer_desc
wrapped
;
plaintext
.
value
=
msg_
->
data
();
plaintext
.
length
=
msg_
->
size
();
uint8_t
flags
=
0
;
if
(
msg_
->
flags
()
&
msg_t
::
more
)
flags
|=
0x01
;
uint8_t
*
plaintext_buffer
=
static_cast
<
uint8_t
*>
(
malloc
(
msg_
->
size
()
+
1
));
plaintext_buffer
[
0
]
=
flags
;
memcpy
(
plaintext_buffer
+
1
,
msg_
->
data
(),
msg_
->
size
());
plaintext
.
value
=
plaintext_buffer
;
plaintext
.
length
=
msg_
->
size
()
+
1
;
maj_stat
=
gss_wrap
(
&
min_stat
,
context
,
1
,
GSS_C_QOP_DEFAULT
,
&
plaintext
,
&
state
,
&
wrapped
);
...
...
@@ -148,10 +157,14 @@ int zmq::gssapi_mechanism_base_t::decode_message (msg_t *msg_)
int
rc
=
msg_
->
close
();
zmq_assert
(
rc
==
0
);
rc
=
msg_
->
init_size
(
plaintext
.
length
);
rc
=
msg_
->
init_size
(
plaintext
.
length
-
1
);
zmq_assert
(
rc
==
0
);
const
uint8_t
flags
=
static_cast
<
char
*>
(
plaintext
.
value
)[
0
];
if
(
flags
&
0x01
)
msg_
->
set_flags
(
msg_t
::
more
);
memcpy
(
msg_
->
data
(),
plaintext
.
value
,
plaintext
.
length
);
memcpy
(
msg_
->
data
(),
static_cast
<
char
*>
(
plaintext
.
value
)
+
1
,
plaintext
.
length
-
1
);
gss_release_buffer
(
&
min_stat
,
&
plaintext
);
gss_release_buffer
(
&
min_stat
,
&
wrapped
);
...
...
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