summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-02-21 11:03:01 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-06-27 12:54:24 +0000
commit9767013b447174881d471f84bc93acd644f564cf (patch)
tree6574c2fcaa432dd8af270f3c794e58faa5918897 /source4
parent4f306a2fdd658d8319216f2d06515a0da97cfb1f (diff)
downloadsamba-9767013b447174881d471f84bc93acd644f564cf.tar.gz
s4:tortue: Use GnuTLS RC4 in rpc lsa test
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/lsa.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 6cdab54c6ca..5b16ed9a014 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -35,8 +35,11 @@
#include "source4/auth/kerberos/kerberos.h"
#include "source4/auth/kerberos/kerberos_util.h"
#include "lib/util/util_net.h"
-#include "../lib/crypto/crypto.h"
#include "libcli/resolve/resolve.h"
+
+#include <gnutls/gnutls.h>
+#include <gnutls/crypto.h>
+
#define TEST_MACHINENAME "lsatestmach"
#define TRUSTPW "12345678"
@@ -2648,6 +2651,8 @@ static bool gen_authinfo_internal(TALLOC_CTX *mem_ctx,
DATA_BLOB auth_blob;
enum ndr_err_code ndr_err;
bool ok;
+ gnutls_cipher_hd_t cipher_hnd = NULL;
+ gnutls_datum_t _session_key;
authinfo_internal = talloc_zero(mem_ctx, struct lsa_TrustDomainInfoAuthInfoInternal);
if (authinfo_internal == NULL) {
@@ -2717,7 +2722,19 @@ static bool gen_authinfo_internal(TALLOC_CTX *mem_ctx,
return false;
}
- arcfour_crypt_blob(auth_blob.data, auth_blob.length, &session_key);
+ _session_key = (gnutls_datum_t) {
+ .data = session_key.data,
+ .size = session_key.length,
+ };
+
+ gnutls_cipher_init(&cipher_hnd,
+ GNUTLS_CIPHER_ARCFOUR_128,
+ &_session_key,
+ NULL);
+ gnutls_cipher_encrypt(cipher_hnd,
+ auth_blob.data,
+ auth_blob.length);
+ gnutls_cipher_deinit(cipher_hnd);
authinfo_internal->auth_blob.size = auth_blob.length;
authinfo_internal->auth_blob.data = auth_blob.data;