summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-01-31 11:28:02 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-06-27 12:54:23 +0000
commitf825fa6d90f165c26df46e2420dbeaf64144466d (patch)
treee4a08071dec375dda6fadda1d6781e63adf5ba49 /libcli
parentad4505624e07f7a31c27a92c3867d343f2d9e9c3 (diff)
downloadsamba-f825fa6d90f165c26df46e2420dbeaf64144466d.tar.gz
libcli:auth: Use GnuTLS RC4 for netlogon credentials
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/auth/credentials.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/libcli/auth/credentials.c b/libcli/auth/credentials.c
index 0b1d84b9799..1a8e9ad10f0 100644
--- a/libcli/auth/credentials.c
+++ b/libcli/auth/credentials.c
@@ -264,11 +264,24 @@ void netlogon_creds_des_decrypt(struct netlogon_creds_CredentialState *creds, st
*/
void netlogon_creds_arcfour_crypt(struct netlogon_creds_CredentialState *creds, uint8_t *data, size_t len)
{
- DATA_BLOB session_key = data_blob(creds->session_key, 16);
-
- arcfour_crypt_blob(data, len, &session_key);
+ gnutls_cipher_hd_t cipher_hnd = NULL;
+ gnutls_datum_t session_key = {
+ .data = creds->session_key,
+ .size = sizeof(creds->session_key),
+ };
+ int rc;
- data_blob_free(&session_key);
+ rc = gnutls_cipher_init(&cipher_hnd,
+ GNUTLS_CIPHER_ARCFOUR_128,
+ &session_key,
+ NULL);
+ if (rc < 0) {
+ return;
+ }
+ gnutls_cipher_encrypt(cipher_hnd,
+ data,
+ len);
+ gnutls_cipher_deinit(cipher_hnd);
}
/*