Skip to content

Commit

Permalink
ntlm_auth: Remove two uses of hex_encode()
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
vlendec authored and jrasamba committed May 12, 2015
1 parent 7ceded5 commit c8e9574
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions source4/utils/ntlm_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,31 +796,29 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod
SAFE_FREE(error_string);
} else {
static char zeros[16];
char *hex_lm_key;
char *hex_user_session_key;

mux_printf(mux_id, "Authenticated: Yes\n");

if (ntlm_server_1_lm_session_key
&& lm_key.length
&& (memcmp(zeros, lm_key.data,
lm_key.length) != 0)) {
hex_encode(lm_key.data,
lm_key.length,
&hex_lm_key);
char hex_lm_key[lm_key.length*2+1];
hex_encode_buf(hex_lm_key, lm_key.data,
lm_key.length);
mux_printf(mux_id, "LANMAN-Session-Key: %s\n", hex_lm_key);
SAFE_FREE(hex_lm_key);
}

if (ntlm_server_1_user_session_key
&& user_session_key.length
&& (memcmp(zeros, user_session_key.data,
user_session_key.length) != 0)) {
hex_encode(user_session_key.data,
user_session_key.length,
&hex_user_session_key);
char hex_user_session_key[
user_session_key.length*2+1];
hex_encode_buf(hex_user_session_key,
user_session_key.data,
user_session_key.length);
mux_printf(mux_id, "User-Session-Key: %s\n", hex_user_session_key);
SAFE_FREE(hex_user_session_key);
}
}
}
Expand Down

0 comments on commit c8e9574

Please sign in to comment.