diff options
author | Andreas Schneider <asn@samba.org> | 2019-02-21 11:06:23 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-06-27 14:11:39 +0000 |
commit | 9920aefd4e12e66b5e43469202c05962fa44035f (patch) | |
tree | 0642afb3fc7ca571c002a1b9527423d51264a52d | |
parent | 9767013b447174881d471f84bc93acd644f564cf (diff) | |
download | samba-9920aefd4e12e66b5e43469202c05962fa44035f.tar.gz |
s4:torture: Use GnuTLS RC4 in rpc forest_trust test
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jun 27 14:11:39 UTC 2019 on sn-devel-184
-rw-r--r-- | source4/torture/rpc/forest_trust.c | 21 |
1 files changed, 18 insertions, 3 deletions
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 <gnutls/gnutls.h> +#include <gnutls/crypto.h> #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)) { |