From: Andreas Schneider Date: Thu, 21 Feb 2019 10:06:23 +0000 (+0100) Subject: s4:torture: Use GnuTLS RC4 in rpc forest_trust test X-Git-Tag: ldb-2.0.5~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9920aefd4e12e66b5e43469202c05962fa44035f;p=thirdparty%2Fsamba.git s4:torture: Use GnuTLS RC4 in rpc forest_trust test Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Jun 27 14:11:39 UTC 2019 on sn-devel-184 --- diff --git a/source4/torture/rpc/forest_trust.c b/source4/torture/rpc/forest_trust.c index 215aa436c8d..118f0d27c53 100644 --- a/source4/torture/rpc/forest_trust.c +++ b/source4/torture/rpc/forest_trust.c @@ -30,7 +30,9 @@ #include "libcli/auth/libcli_auth.h" #include "torture/rpc/torture_rpc.h" #include "param/param.h" -#include "../lib/crypto/crypto.h" + +#include +#include #define TEST_DOM "torturedom" #define TEST_DOM_DNS "torturedom.samba.example.com" @@ -687,6 +689,8 @@ static bool test_setup_trust(struct torture_context *tctx, DATA_BLOB session_key; struct lsa_TrustDomainInfoAuthInfoInternal authinfo; NTSTATUS status; + gnutls_cipher_hd_t cipher_hnd = NULL; + gnutls_datum_t _session_key; if (!check_name(p, tctx, netbios_name)) { return false; @@ -709,8 +713,19 @@ static bool test_setup_trust(struct torture_context *tctx, } authinfo.auth_blob.size = auth_blob->length; - arcfour_crypt_blob(authinfo.auth_blob.data, authinfo.auth_blob.size, - &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, + authinfo.auth_blob.data, + authinfo.auth_blob.size); + gnutls_cipher_deinit(cipher_hnd); if (!test_create_trust_and_set_info(p, tctx, netbios_name, dns_name, sid, &authinfo)) {