s3-rpc_client: use netlogon_creds_arcfour_crypt() in init_netr_CryptPassword.
authorGünther Deschner <gd@samba.org>
Thu, 29 Nov 2012 20:30:24 +0000 (21:30 +0100)
committerStefan Metzmacher <metze@samba.org>
Sun, 9 Dec 2012 18:39:07 +0000 (19:39 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_client/cli_netlogon.c
source3/rpc_client/init_netlogon.c
source3/rpc_client/init_netlogon.h

index bbcca06a601088ad74fdc1e3dc1fd65e92e66e10..463741ac05059133081c3dc96139033678a05c22 100644 (file)
@@ -628,7 +628,7 @@ NTSTATUS rpccli_netlogon_set_trust_password(struct rpc_pipe_client *cli,
                uint32_t old_timeout;
 
                init_netr_CryptPassword(new_trust_pwd_cleartext,
-                                       cli->dc->session_key,
+                                       cli->dc,
                                        &new_password);
 
                old_timeout = dcerpc_binding_handle_set_timeout(b, 600000);
index 445108a7d332212b250b241d701ee3e5363fe720..0d33d6fdd6afb873aac798744096db20aadbc237 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Unix SMB/CIFS implementation.
  *  RPC Pipe client / server routines
- *  Copyright (C) Guenther Deschner                  2008.
+ *  Copyright (C) Guenther Deschner                  2008,2012
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *************************************************************************/
 
 void init_netr_CryptPassword(const char *pwd,
-                            unsigned char session_key[16],
+                            struct netlogon_creds_CredentialState *creds,
                             struct netr_CryptPassword *pwd_buf)
 {
        struct samr_CryptPassword password_buf;
 
        encode_pw_buffer(password_buf.data, pwd, STR_UNICODE);
 
-       arcfour_crypt(password_buf.data, session_key, 516);
+       netlogon_creds_arcfour_crypt(creds, password_buf.data, 516);
        memcpy(pwd_buf->data, password_buf.data, 512);
        pwd_buf->length = IVAL(password_buf.data, 512);
 }
index 826d0c56bb4ffa2af7d150892fcf3f06ca4cbf13..bb4496b4cd9e9e2604e773a0c6f003e342eb7b82 100644 (file)
@@ -23,7 +23,7 @@
 /* The following definitions come from rpc_client/init_netlogon.c  */
 
 void init_netr_CryptPassword(const char *pwd,
-                            unsigned char session_key[16],
+                            struct netlogon_creds_CredentialState *creds,
                             struct netr_CryptPassword *pwd_buf);
 
 #endif /* _RPC_CLIENT_INIT_NETLOGON_H_ */