]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpcclient: Implement setuserinfo2 level 31
authorAndreas Schneider <asn@samba.org>
Mon, 2 Aug 2021 13:41:23 +0000 (15:41 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 Jul 2022 11:51:29 +0000 (11:51 +0000)
Manually tested against Windows Server 2022.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpcclient/cmd_samr.c

index 5760ab6c1ff4e7482342926a611bffb95bb4ad8c..319e3546e10a77a4e56014f4b050f6a5b89646c9 100644 (file)
@@ -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;