Merge commit 'origin/master' into libcli-auth-merge-without-netlogond
[sfrench/samba-autobuild/.git] / source3 / rpc_server / srv_samr_nt.c
index cc25dbb0c09964e8297d6679cae85d041315c980..b54ed717a304be54ef0b4da6b480a6e60eea2173 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include "includes.h"
+#include "../libcli/auth/libcli_auth.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
@@ -3773,7 +3774,7 @@ static NTSTATUS set_user_info_23(TALLOC_CTX *mem_ctx,
                                 struct samu *pwd)
 {
        char *plaintext_buf = NULL;
-       uint32 len = 0;
+       size_t len = 0;
        uint32_t acct_ctrl;
        NTSTATUS status;
 
@@ -3800,7 +3801,7 @@ static NTSTATUS set_user_info_23(TALLOC_CTX *mem_ctx,
                                      id23->password.data,
                                      &plaintext_buf,
                                      &len,
-                                     STR_UNICODE)) {
+                                     CH_UTF16)) {
                        return NT_STATUS_WRONG_PASSWORD;
                }
 
@@ -3862,7 +3863,7 @@ static NTSTATUS set_user_info_23(TALLOC_CTX *mem_ctx,
 
 static bool set_user_info_pw(uint8 *pass, struct samu *pwd)
 {
-       uint32 len = 0;
+       size_t len = 0;
        char *plaintext_buf = NULL;
        uint32 acct_ctrl;
 
@@ -3875,7 +3876,7 @@ static bool set_user_info_pw(uint8 *pass, struct samu *pwd)
                                pass,
                                &plaintext_buf,
                                &len,
-                               STR_UNICODE)) {
+                               CH_UTF16)) {
                return False;
        }
 
@@ -4174,8 +4175,8 @@ NTSTATUS _samr_SetUserInfo(pipes_struct *p,
                        if (!p->server_info->user_session_key.length) {
                                status = NT_STATUS_NO_USER_SESSION_KEY;
                        }
-                       SamOEMhashBlob(info->info23.password.data, 516,
-                                      &p->server_info->user_session_key);
+                       arcfour_crypt_blob(info->info23.password.data, 516,
+                                          &p->server_info->user_session_key);
 
                        dump_data(100, info->info23.password.data, 516);
 
@@ -4187,9 +4188,9 @@ NTSTATUS _samr_SetUserInfo(pipes_struct *p,
                        if (!p->server_info->user_session_key.length) {
                                status = NT_STATUS_NO_USER_SESSION_KEY;
                        }
-                       SamOEMhashBlob(info->info24.password.data,
-                                      516,
-                                      &p->server_info->user_session_key);
+                       arcfour_crypt_blob(info->info24.password.data,
+                                          516,
+                                          &p->server_info->user_session_key);
 
                        dump_data(100, info->info24.password.data, 516);