diff options
author | Andreas Schneider <asn@samba.org> | 2019-02-20 15:52:49 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-07-26 01:48:25 +0000 |
commit | 811c412da5c24d7274f9aa4c7d653bbb1191e6a6 (patch) | |
tree | 6c6adaabefb9dab4e1f35022876f228a72c94f3d /source4 | |
parent | 4326e7de6ba0ce02ab23af7297d2f7242988daa4 (diff) | |
download | samba-811c412da5c24d7274f9aa4c7d653bbb1191e6a6.tar.gz |
s4:torture: Use GnuTLS RC4 for RAP SAM test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rap/sam.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source4/torture/rap/sam.c b/source4/torture/rap/sam.c index 4ca7b793dec..3c13849b398 100644 --- a/source4/torture/rap/sam.c +++ b/source4/torture/rap/sam.c @@ -26,10 +26,12 @@ #include "torture/util.h" #include "libcli/rap/rap.h" #include "torture/rap/proto.h" -#include "../lib/crypto/crypto.h" #include "../libcli/auth/libcli_auth.h" #include "torture/rpc/torture_rpc.h" +#include <gnutls/gnutls.h> +#include <gnutls/crypto.h> + #define TEST_RAP_USER "torture_rap_user" static char *samr_rand_pass(TALLOC_CTX *mem_ctx, int min_len) @@ -137,6 +139,11 @@ static bool test_oemchangepassword_args(struct torture_context *tctx, char *newpass = samr_rand_pass(tctx, 9); uint8_t old_pw_hash[16]; uint8_t new_pw_hash[16]; + gnutls_cipher_hd_t cipher_hnd = NULL; + gnutls_datum_t pw_key = { + .data = old_pw_hash, + .size = sizeof(old_pw_hash), + }; r.in.UserName = username; @@ -144,7 +151,15 @@ static bool test_oemchangepassword_args(struct torture_context *tctx, E_deshash(newpass, new_pw_hash); encode_pw_buffer(r.in.crypt_password, newpass, STR_ASCII); - arcfour_crypt(r.in.crypt_password, old_pw_hash, 516); + + gnutls_cipher_init(&cipher_hnd, + GNUTLS_CIPHER_ARCFOUR_128, + &pw_key, + NULL); + gnutls_cipher_encrypt(cipher_hnd, + r.in.crypt_password, + 516); + gnutls_cipher_deinit(cipher_hnd); E_old_pw_hash(new_pw_hash, old_pw_hash, r.in.password_hash); torture_comment(tctx, "Testing rap_NetOEMChangePassword(%s)\n", r.in.UserName); |