Andreas Schneider
0c961b16f1
s4:libnet: Move code using RC4 into its own function
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
da0e0c8aeb
s4:libnet: Remove unused code in libnet_ChangePassword_samr()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
8733fabd58
s4:torture: Add test for dcerpc_samr_ChangePasswordUser4
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
1ca42e12ef
s3:rpc_server: Implement dcesrv_samr_ChangePasswordUser4()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
68b7863f19
s3:passdb: Correctly burn the plaintext_pw with samu_destroy()
...
memset() can be removed from the optimizer.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
16e97c5e2d
s3:passdb: Remove trailing whitespaces
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
85b7179a58
s4:rpc_server: Implement dcesrv_samr_ChangePasswordUser4()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
c4ef3dbf73
s4:dsdb: Burn the memory of hashes returned by samdb_result_hashes()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
56297449f9
s4:dsdb: Remove trailing whitespaces from util.c
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
fd4368797e
s3:rpcclient: Implement cmd chpasswd4
...
Manually tested against Windows Server 2022.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
c557259dd9
docs-xml: Remove trailing whitespaces in rpcclient.1.xml
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
c8daa5fb00
s3:rpc_client: Implement dcerpc_samr_chgpasswd_user4()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
b46064f8b5
s3:rpc_client: Fix trailing whitespaces in cli_samr.c
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
cc1cac9423
lib:util: Add generate_random_u64_range()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
9fcd1b7498
lib:util: Remove trailing whitespaces in samba_util.h
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
3d6b9ca852
lib:crypto: Add test for pbkdf2
...
This is just that we use the right parameters for gnutls_pbkdf2() and
reach the values from Windows.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
36b6be3ce1
waf: Check for gnutls_pbkdf2()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
d725e4ca9f
s4:torture: Implement test for SAMR SetUserInfo(2) level 32
...
make test TESTS="samba4.rpc.samr.passwords"
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
f904f41820
s3:rpc_server: Implement SAMR SetUserInfo(2) level 32
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
54766eed2e
s4:rpc_server: Implement support for SetUserInfo(2) level 32
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
5797d59bfc
s4:torture: Implement test for SAMR SetUserInfo(2) level 31
...
We can't apply this patch earlier as there are no individual tests we could
mark as knownfail. Reorganizing the whole test is a too big task for now.
However this test is working and also found some bugs.
make test TESTS="samba4.rpc.samr.passwords"
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
3f72918a16
s3:rpc_server: Implement support for SAMR SetUserInfo level 31
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
c26f696169
s3:rpc_server: Remove obosolete copy_id26_to_sam_passwd()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
c975394edf
s3:rpc_server: Use copy_pwd_expired_to_sam_passwd() in set_user_info_26()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
cb2d9429a8
s3:rpc_server: Add copy_pwd_expired_to_sam_passwd() for SAMR
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
b54188cbe3
s3:rpc_server: Set missing debug class for srv_samr_chgpasswd
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
63c4b16d2f
libcli:auth: Add test for decode_pwd_string_from_buffer514()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
2f4a80322b
libcli:auth: Add decode_pwd_string_from_buffer514()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
cef5bb0223
s4:rpc_server: Implement support for SAMR SetUserInfo(2) level 31
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
835de358ec
s4:rpc_server: Add samr_set_password_aes()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
1aa403517f
s4:rpc_server: Add transaction for dcesrv_samr_SetUserInfo()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
1b3d7f8116
s4:rpc_server: Use sam_ctx consistently in dcesrv_samr_SetUserInfo()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
a246ae993f
s3:rpc_server: Use a done goto label for dcesrv_samr_SetUserInfo()
...
This will be used in the following commits.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
2226806ce0
libcli:auth: Add test for extract_pwd_blob_from_buffer514()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
12f4bb9cc1
libcli:auth: Add extract_pwd_blob_from_buffer514()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
b39abe916d
libcli:auth: Implment a common create_pw_buffer_from_blob()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
626b0f4891
libcli:auth: Use extract_pw_from_buffer() in decode_pw_buffer()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
e87facfd89
libcli:auth: Keep data of extract_pw_from_buffer() secret
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
9112107167
s3:rpcclient: Implement setuserinfo2 level 31
...
Manually tested against Windows Server 2022.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
6f60c98c08
s3:rpcclient: Encrypt the password buffers only if really needed
...
If we are in FIPS mode certain ciphers like RC4 are not available, so
we should make sure we do not call them. We will add AES support in the
next patch.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
2454b86c88
s3:rpc_client: Implement init_samr_CryptPasswordAES()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
2ecdbe17e8
samr.idl: Add samr_ChangePasswordUser4()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:29 +00:00
Andreas Schneider
308f89ce6a
samr:idl: add samr_SupportedFeatures for samr_Connect5()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
e845afe11a
samr.idl: Add support for new AES encrypted password buffer
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
e181dd7b76
libcli:auth: Add test for encode_pwd_buffer514_from_str()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
1b142b72bd
libcli:auth: Add encode_pw_buffer_from_str()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
5da60573b5
libcli:auth: Implement a generic encode_pwd_buffer_from_str()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
ed22f0c43c
libcli:auth: Remove trailing spaces from proto.h
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
0813ea5bf8
lib:crypto: Add test for samba_gnutls_aead_aes_256_cbc_hmac_sha512_decrypt()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00
Andreas Schneider
0d059e4425
lib:crypto: Add samba_gnutls_aead_aes_256_cbc_hmac_sha512_decrypt()
...
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-07-28 11:51:28 +00:00