diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-10-18 21:55:24 +1100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-10-21 08:43:38 +0200 |
commit | 0a0839821adb8a4e959e10128e9c103f82e0ff80 (patch) | |
tree | 89e62a0d47b74330cf735e61d9ca83b41a69f1a0 | |
parent | 3f079885b21f22ec4f27cccaa6f59ebce0e56067 (diff) | |
download | samba-0a0839821adb8a4e959e10128e9c103f82e0ff80.tar.gz samba-0a0839821adb8a4e959e10128e9c103f82e0ff80.tar.bz2 samba-0a0839821adb8a4e959e10128e9c103f82e0ff80.zip |
s3-ntlmssp Remove auth_ntlmssp_session_key()
We now just call the gensec_session_key() directly.
Andrew Bartlett
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/include/ntlmssp_wrap.h | 3 | ||||
-rw-r--r-- | source3/librpc/crypto/cli_spnego.c | 9 | ||||
-rw-r--r-- | source3/libsmb/ntlmssp_wrap.c | 11 | ||||
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 6 |
4 files changed, 12 insertions, 17 deletions
diff --git a/source3/include/ntlmssp_wrap.h b/source3/include/ntlmssp_wrap.h index ab1f9cb6aa..68032bbebc 100644 --- a/source3/include/ntlmssp_wrap.h +++ b/source3/include/ntlmssp_wrap.h @@ -40,9 +40,6 @@ NTSTATUS auth_ntlmssp_set_domain(struct auth_ntlmssp_state *ans, const char *domain); NTSTATUS auth_ntlmssp_set_password(struct auth_ntlmssp_state *ans, const char *password); -DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans, - TALLOC_CTX *mem_ctx); - NTSTATUS auth_ntlmssp_client_prepare(TALLOC_CTX *mem_ctx, struct auth_ntlmssp_state **_ans); NTSTATUS auth_ntlmssp_client_start(struct auth_ntlmssp_state *ans); diff --git a/source3/librpc/crypto/cli_spnego.c b/source3/librpc/crypto/cli_spnego.c index 31d0157069..c81b424af3 100644 --- a/source3/librpc/crypto/cli_spnego.c +++ b/source3/librpc/crypto/cli_spnego.c @@ -330,13 +330,18 @@ NTSTATUS spnego_get_negotiated_mech(struct spnego_context *sp_ctx, DATA_BLOB spnego_get_session_key(TALLOC_CTX *mem_ctx, struct spnego_context *sp_ctx) { + DATA_BLOB sk; + NTSTATUS status; switch (sp_ctx->mech) { case SPNEGO_KRB5: return gse_get_session_key(mem_ctx, sp_ctx->mech_ctx.gssapi_state); case SPNEGO_NTLMSSP: - return auth_ntlmssp_get_session_key( - sp_ctx->mech_ctx.ntlmssp_state, mem_ctx); + status = gensec_session_key(sp_ctx->mech_ctx.ntlmssp_state->gensec_security, mem_ctx, &sk); + if (!NT_STATUS_IS_OK(status)) { + return data_blob_null; + } + return sk; default: DEBUG(0, ("Unsupported type in request!\n")); return data_blob_null; diff --git a/source3/libsmb/ntlmssp_wrap.c b/source3/libsmb/ntlmssp_wrap.c index 557b6e02b3..5b11db0ee4 100644 --- a/source3/libsmb/ntlmssp_wrap.c +++ b/source3/libsmb/ntlmssp_wrap.c @@ -47,17 +47,6 @@ NTSTATUS auth_ntlmssp_set_password(struct auth_ntlmssp_state *ans, return NT_STATUS_OK; } -DATA_BLOB auth_ntlmssp_get_session_key(struct auth_ntlmssp_state *ans, TALLOC_CTX *mem_ctx) -{ - DATA_BLOB session_key; - NTSTATUS status = gensec_session_key(ans->gensec_security, mem_ctx, &session_key); - if (NT_STATUS_IS_OK(status)) { - return session_key; - } else { - return data_blob_null; - } -} - static NTSTATUS gensec_ntlmssp3_client_update(struct gensec_security *gensec_security, TALLOC_CTX *out_mem_ctx, struct tevent_context *ev, diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 9a2aa409a0..694a74cad1 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3201,6 +3201,7 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli, DATA_BLOB *session_key) { + NTSTATUS status; struct pipe_auth_data *a; struct schannel_state *schannel_auth; struct auth_ntlmssp_state *ntlmssp_ctx; @@ -3235,7 +3236,10 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, case DCERPC_AUTH_TYPE_NTLMSSP: ntlmssp_ctx = talloc_get_type_abort(a->auth_ctx, struct auth_ntlmssp_state); - sk = auth_ntlmssp_get_session_key(ntlmssp_ctx, mem_ctx); + status = gensec_session_key(ntlmssp_ctx->gensec_security, mem_ctx, &sk); + if (!NT_STATUS_IS_OK(status)) { + return status; + } make_dup = false; break; case DCERPC_AUTH_TYPE_KRB5: |