From: Andreas Schneider Date: Mon, 2 Aug 2021 13:41:23 +0000 (+0200) Subject: s3:rpcclient: Implement setuserinfo2 level 31 X-Git-Tag: samba-4.17.0rc1~226 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91121071670ee40b64041a1443359a62782e0cca;p=thirdparty%2Fsamba.git s3:rpcclient: Implement setuserinfo2 level 31 Manually tested against Windows Server 2022. Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 5760ab6c1ff..319e3546e10 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -3128,6 +3128,7 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli, union samr_UserInfo info; struct samr_CryptPassword pwd_buf; struct samr_CryptPasswordEx pwd_buf_ex; + struct samr_EncryptedPasswordAES pwd_buf_aes; uint8_t nt_hash[16]; uint8_t lm_hash[16]; DATA_BLOB session_key; @@ -3176,6 +3177,15 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli, goto done; } break; + case 31: + status = init_samr_CryptPasswordAES(frame, + param, + &session_key, + &pwd_buf_aes); + if (!NT_STATUS_IS_OK(status)) { + goto done; + } + break; default: break; } @@ -3307,6 +3317,10 @@ static NTSTATUS cmd_samr_setuserinfo_int(struct rpc_pipe_client *cli, info.info26.password = pwd_buf_ex; info.info26.password_expired = password_expired; + break; + case 31: + info.info31.password = pwd_buf_aes; + info.info31.password_expired = password_expired; break; default: status = NT_STATUS_INVALID_INFO_CLASS;