mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
auth:ntlmssp: Use GnuTLS RC4 in ntlmssp server
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
ba96534eb3
commit
0a8a1c9c78
@ -1033,12 +1033,32 @@ static NTSTATUS ntlmssp_server_postauth(struct gensec_security *gensec_security,
|
||||
ntlmssp_state->session_key = session_key;
|
||||
talloc_steal(ntlmssp_state, session_key.data);
|
||||
} else {
|
||||
gnutls_cipher_hd_t cipher_hnd;
|
||||
gnutls_datum_t enc_session_key = {
|
||||
.data = session_key.data,
|
||||
.size = session_key.length,
|
||||
};
|
||||
int rc;
|
||||
|
||||
dump_data_pw("KEY_EXCH session key (enc):\n",
|
||||
state->encrypted_session_key.data,
|
||||
state->encrypted_session_key.length);
|
||||
arcfour_crypt(state->encrypted_session_key.data,
|
||||
session_key.data,
|
||||
state->encrypted_session_key.length);
|
||||
|
||||
rc = gnutls_cipher_init(&cipher_hnd,
|
||||
GNUTLS_CIPHER_ARCFOUR_128,
|
||||
&enc_session_key,
|
||||
NULL);
|
||||
if (rc < 0) {
|
||||
return gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED);
|
||||
}
|
||||
rc = gnutls_cipher_encrypt(cipher_hnd,
|
||||
state->encrypted_session_key.data,
|
||||
state->encrypted_session_key.length);
|
||||
gnutls_cipher_deinit(cipher_hnd);
|
||||
if (rc < 0) {
|
||||
return gnutls_error_to_ntstatus(rc, NT_STATUS_NTLM_BLOCKED);
|
||||
}
|
||||
|
||||
ntlmssp_state->session_key = data_blob_talloc(ntlmssp_state,
|
||||
state->encrypted_session_key.data,
|
||||
state->encrypted_session_key.length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user