diff options
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 22 | ||||
-rw-r--r-- | source3/rpcclient/cmd_netlogon.c | 9 | ||||
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 1 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 1 |
4 files changed, 16 insertions, 17 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 722a0a3832..cf2b1ae563 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -22,6 +22,7 @@ #include "includes.h" #include "rpcclient.h" +#include "../libcli/auth/libcli_auth.h" /* useful function to allow entering a name instead of a SID and * looking it up automatically */ @@ -947,27 +948,22 @@ static NTSTATUS cmd_lsa_query_secobj(struct rpc_pipe_client *cli, } static void display_trust_dom_info_4(struct lsa_TrustDomainInfoPassword *p, - uint8_t nt_hash[16]) + uint8_t session_key[16]) { char *pwd, *pwd_old; - DATA_BLOB data = data_blob(NULL, p->password->length); - DATA_BLOB data_old = data_blob(NULL, p->old_password->length); + DATA_BLOB data = data_blob_const(p->password->data, p->password->length); + DATA_BLOB data_old = data_blob_const(p->old_password->data, p->old_password->length); + DATA_BLOB session_key_blob = data_blob_const(session_key, sizeof(session_key)); - memcpy(data.data, p->password->data, p->password->length); - memcpy(data_old.data, p->old_password->data, p->old_password->length); - - pwd = decrypt_trustdom_secret(nt_hash, &data); - pwd_old = decrypt_trustdom_secret(nt_hash, &data_old); + pwd = sess_decrypt_string(talloc_tos(), &data, &session_key_blob); + pwd_old = sess_decrypt_string(talloc_tos(), &data_old, &session_key_blob); d_printf("Password:\t%s\n", pwd); d_printf("Old Password:\t%s\n", pwd_old); - SAFE_FREE(pwd); - SAFE_FREE(pwd_old); - - data_blob_free(&data); - data_blob_free(&data_old); + talloc_free(pwd); + talloc_free(pwd_old); } static void display_trust_dom_info(TALLOC_CTX *mem_ctx, diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c index 45df488018..aa493214d7 100644 --- a/source3/rpcclient/cmd_netlogon.c +++ b/source3/rpcclient/cmd_netlogon.c @@ -21,6 +21,7 @@ #include "includes.h" #include "rpcclient.h" +#include "../libcli/auth/libcli_auth.h" static WERROR cmd_netlogon_logon_ctrl2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, @@ -584,7 +585,7 @@ static NTSTATUS cmd_netlogon_sam_sync(struct rpc_pipe_client *cli, do { struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL; - netlogon_creds_client_step(cli->dc, &credential); + netlogon_creds_client_authenticator(cli->dc, &credential); result = rpccli_netr_DatabaseSync2(cli, mem_ctx, logon_server, @@ -647,7 +648,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli, do { struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL; - netlogon_creds_client_step(cli->dc, &credential); + netlogon_creds_client_authenticator(cli->dc, &credential); result = rpccli_netr_DatabaseDeltas(cli, mem_ctx, logon_server, @@ -1082,7 +1083,7 @@ static NTSTATUS cmd_netlogon_database_redo(struct rpc_pipe_client *cli, return status; } - netlogon_creds_client_step(cli->dc, &clnt_creds); + netlogon_creds_client_authenticator(cli->dc, &clnt_creds); ZERO_STRUCT(e); @@ -1127,7 +1128,7 @@ static NTSTATUS cmd_netlogon_capabilities(struct rpc_pipe_client *cli, } #if 0 - netlogon_creds_client_step(cli->dc, &credential); + netlogon_creds_client_authenticator(cli->dc, &credential); #else ZERO_STRUCT(credential); #endif diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 428984db13..83cec72318 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -24,6 +24,7 @@ #include "includes.h" #include "rpcclient.h" +#include "../libcli/auth/libcli_auth.h" extern DOM_SID domain_sid; diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index a202dcc5f3..6fd6b4f6d9 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -21,6 +21,7 @@ #include "includes.h" #include "rpcclient.h" +#include "../libcli/auth/libcli_auth.h" DOM_SID domain_sid; |