summaryrefslogtreecommitdiff
path: root/source4/rpc_server/samr/samr_password.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-09-12 03:18:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:40 -0500
commit15a96c42985c9bb4778a16160290220a935d99bd (patch)
tree3ca0bd98be270465d8be1596ccd684d33ca60ad1 /source4/rpc_server/samr/samr_password.c
parent67c37a3b8ed9a0c9b5cc95ba03a921cf32e3cf3f (diff)
downloadsamba-15a96c42985c9bb4778a16160290220a935d99bd.tar.gz
samba-15a96c42985c9bb4778a16160290220a935d99bd.tar.bz2
samba-15a96c42985c9bb4778a16160290220a935d99bd.zip
r2290: Fix 'lsakey' for the server-side, it is static for
'authenticated' connections. Fix kerberos session key issues - we need to call the routine for extracting the session key, not just read the cache. Andrew Bartlett (This used to be commit b80d849b6b586869fc7d3d4153db1a316f2867a9)
Diffstat (limited to 'source4/rpc_server/samr/samr_password.c')
-rw-r--r--source4/rpc_server/samr/samr_password.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c
index 436a53b7d9..3347787425 100644
--- a/source4/rpc_server/samr/samr_password.c
+++ b/source4/rpc_server/samr/samr_password.c
@@ -679,15 +679,14 @@ NTSTATUS samr_set_password(struct dcesrv_call_state *dce_call,
struct ldb_message *msg,
struct samr_CryptPassword *pwbuf)
{
+ NTSTATUS nt_status;
char new_pass[512];
uint32_t new_pass_len;
DATA_BLOB session_key = data_blob(NULL, 0);
- session_key = dce_call->conn->transport_session_key;
-
- if (session_key.length == 0) {
- DEBUG(3,("Bad session key in samr_set_password\n"));
- return NT_STATUS_NO_USER_SESSION_KEY;
+ nt_status = dcesrv_fetch_session_key(dce_call->conn, &session_key);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ return nt_status;
}
arcfour_crypt_blob(pwbuf->data, 516, &session_key);
@@ -721,17 +720,16 @@ NTSTATUS samr_set_password_ex(struct dcesrv_call_state *dce_call,
struct ldb_message *msg,
struct samr_CryptPasswordEx *pwbuf)
{
+ NTSTATUS nt_status;
char new_pass[512];
uint32_t new_pass_len;
DATA_BLOB co_session_key;
DATA_BLOB session_key = data_blob(NULL, 0);
struct MD5Context ctx;
- session_key = dce_call->conn->transport_session_key;
-
- if (session_key.length == 0) {
- DEBUG(3,("Bad session key in samr_set_password\n"));
- return NT_STATUS_NO_USER_SESSION_KEY;
+ nt_status = dcesrv_fetch_session_key(dce_call->conn, &session_key);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ return nt_status;
}
co_session_key = data_blob_talloc(mem_ctx, NULL, 16);