summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-02-10 21:37:51 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-03-01 06:29:03 +0100
commit9900aa4fb40321de3d78d499ac5694541db39af0 (patch)
treedaa8589e0249e84f35473419c6c32152dbeaf738 /source3
parent47369370a1525e8a02db6e9e8deb2ac6364679d9 (diff)
downloadsamba-9900aa4fb40321de3d78d499ac5694541db39af0.tar.gz
samba-9900aa4fb40321de3d78d499ac5694541db39af0.tar.bz2
samba-9900aa4fb40321de3d78d499ac5694541db39af0.zip
s3-rpc_server Handle session key as a constant buffer
This way, we don't have to check for memory allocation failures. Andrew Bartlett
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_pipe.c32
1 files changed, 4 insertions, 28 deletions
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index bb10902e4e..e062e63a30 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -88,7 +88,7 @@ static void dump_pdu_region(const char *name, int v,
static DATA_BLOB generic_session_key(void)
{
- return data_blob("SystemLibraryDTC", 16);
+ return data_blob_const("SystemLibraryDTC", 16);
}
/*******************************************************************
@@ -460,7 +460,6 @@ static bool pipe_schannel_auth_bind(struct pipes_struct *p,
bool ret;
NTSTATUS status;
struct netlogon_creds_CredentialState *creds;
- DATA_BLOB session_key;
enum ndr_err_code ndr_err;
struct schannel_state *schannel_auth;
@@ -519,16 +518,7 @@ static bool pipe_schannel_auth_bind(struct pipes_struct *p,
* anymore.
*/
- session_key = generic_session_key();
- if (session_key.data == NULL) {
- DEBUG(0, ("pipe_schannel_auth_bind: Could not alloc session"
- " key\n"));
- return false;
- }
-
- ret = session_info_set_session_key(p->session_info, session_key);
-
- data_blob_free(&session_key);
+ ret = session_info_set_session_key(p->session_info, generic_session_key());
if (!ret) {
DEBUG(0, ("session_info_set_session_key failed\n"));
@@ -624,7 +614,6 @@ static bool pipe_ntlmssp_verify_final(TALLOC_CTX *mem_ctx,
struct ndr_syntax_id *syntax,
struct auth_serversupplied_info **session_info)
{
- DATA_BLOB session_key;
NTSTATUS status;
bool ret;
@@ -668,13 +657,7 @@ static bool pipe_ntlmssp_verify_final(TALLOC_CTX *mem_ctx,
* does. See the RPC-SAMBA3SESSIONKEY.
*/
- session_key = generic_session_key();
- if (session_key.data == NULL) {
- return false;
- }
-
- ret = session_info_set_session_key((*session_info), session_key);
- data_blob_free(&session_key);
+ ret = session_info_set_session_key((*session_info), generic_session_key());
if (!ret) {
DEBUG(0, ("Failed to set session key!\n"));
return false;
@@ -730,7 +713,6 @@ static NTSTATUS pipe_gssapi_verify_final(TALLOC_CTX *mem_ctx,
struct client_address *client_id,
struct auth_serversupplied_info **session_info)
{
- DATA_BLOB session_key;
NTSTATUS status;
bool bret;
@@ -770,13 +752,7 @@ static NTSTATUS pipe_gssapi_verify_final(TALLOC_CTX *mem_ctx,
* does. See the RPC-SAMBA3SESSIONKEY.
*/
- session_key = generic_session_key();
- if (session_key.data == NULL) {
- return NT_STATUS_ACCESS_DENIED;
- }
-
- bret = session_info_set_session_key((*session_info), session_key);
- data_blob_free(&session_key);
+ bret = session_info_set_session_key((*session_info), generic_session_key());
if (!bret) {
return NT_STATUS_ACCESS_DENIED;
}