mirror of
https://github.com/samba-team/samba.git
synced 2025-12-12 12:23:50 +03:00
r2664: fixed the final server leak for normal operation. We now get a clean report from --leak-check
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
2662be3a2b
commit
1ff41bbcae
@@ -321,7 +321,8 @@ BOOL smbcli_request_check_sign_mac(struct smbcli_request *req)
|
|||||||
/***********************************************************
|
/***********************************************************
|
||||||
SMB signing - Simple implementation - setup the MAC key.
|
SMB signing - Simple implementation - setup the MAC key.
|
||||||
************************************************************/
|
************************************************************/
|
||||||
BOOL smbcli_simple_set_signing(struct smb_signing_context *sign_info,
|
BOOL smbcli_simple_set_signing(TALLOC_CTX *mem_ctx,
|
||||||
|
struct smb_signing_context *sign_info,
|
||||||
const DATA_BLOB *user_session_key,
|
const DATA_BLOB *user_session_key,
|
||||||
const DATA_BLOB *response)
|
const DATA_BLOB *response)
|
||||||
{
|
{
|
||||||
@@ -332,9 +333,9 @@ BOOL smbcli_simple_set_signing(struct smb_signing_context *sign_info,
|
|||||||
DEBUG(5, ("SMB signing enabled!\n"));
|
DEBUG(5, ("SMB signing enabled!\n"));
|
||||||
|
|
||||||
if (response && response->length) {
|
if (response && response->length) {
|
||||||
sign_info->mac_key = data_blob(NULL, response->length + user_session_key->length);
|
sign_info->mac_key = data_blob_talloc(mem_ctx, NULL, response->length + user_session_key->length);
|
||||||
} else {
|
} else {
|
||||||
sign_info->mac_key = data_blob(NULL, user_session_key->length);
|
sign_info->mac_key = data_blob_talloc(mem_ctx, NULL, user_session_key->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&sign_info->mac_key.data[0], user_session_key->data, user_session_key->length);
|
memcpy(&sign_info->mac_key.data[0], user_session_key->data, user_session_key->length);
|
||||||
@@ -365,7 +366,8 @@ BOOL smbcli_transport_simple_set_signing(struct smbcli_transport *transport,
|
|||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
return smbcli_simple_set_signing(&transport->negotiate.sign_info,
|
return smbcli_simple_set_signing(transport,
|
||||||
|
&transport->negotiate.sign_info,
|
||||||
&user_session_key,
|
&user_session_key,
|
||||||
&response);
|
&response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ BOOL srv_setup_signing(struct smbsrv_connection *smb_conn,
|
|||||||
if (!set_smb_signing_common(&smb_conn->signing)) {
|
if (!set_smb_signing_common(&smb_conn->signing)) {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
return smbcli_simple_set_signing(&smb_conn->signing, session_key, response);
|
return smbcli_simple_set_signing(smb_conn,
|
||||||
|
&smb_conn->signing, session_key, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
void srv_signing_restart(struct smbsrv_connection *smb_conn,
|
void srv_signing_restart(struct smbsrv_connection *smb_conn,
|
||||||
|
|||||||
Reference in New Issue
Block a user