mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
s3: Remove some calls to memset -- reduces text size by some bytes for me
This commit is contained in:
parent
96b12e0d59
commit
185815a647
@ -1267,7 +1267,7 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ser
|
||||
struct samu *sampass = NULL;
|
||||
DOM_SID guest_sid;
|
||||
bool ret;
|
||||
char zeros[16];
|
||||
static const char zeros[16] = {0, };
|
||||
fstring tmp;
|
||||
|
||||
if ( !(sampass = samu_new( NULL )) ) {
|
||||
@ -1302,7 +1302,6 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ser
|
||||
|
||||
/* annoying, but the Guest really does have a session key, and it is
|
||||
all zeros! */
|
||||
ZERO_STRUCT(zeros);
|
||||
(*server_info)->user_session_key = data_blob(zeros, sizeof(zeros));
|
||||
(*server_info)->lm_session_key = data_blob(zeros, sizeof(zeros));
|
||||
|
||||
@ -1622,7 +1621,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
|
||||
struct auth_serversupplied_info **server_info,
|
||||
struct netr_SamInfo3 *info3)
|
||||
{
|
||||
char zeros[16];
|
||||
static const char zeros[16] = {0, };
|
||||
|
||||
NTSTATUS nt_status = NT_STATUS_OK;
|
||||
char *found_username = NULL;
|
||||
@ -1838,8 +1837,6 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* ensure we are never given NULL session keys */
|
||||
|
||||
ZERO_STRUCT(zeros);
|
||||
|
||||
if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) {
|
||||
result->user_session_key = data_blob_null;
|
||||
} else {
|
||||
@ -1873,7 +1870,7 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
|
||||
const struct wbcAuthUserInfo *info,
|
||||
struct auth_serversupplied_info **server_info)
|
||||
{
|
||||
char zeros[16];
|
||||
static const char zeros[16] = {0, };
|
||||
|
||||
NTSTATUS nt_status = NT_STATUS_OK;
|
||||
char *found_username = NULL;
|
||||
@ -2083,8 +2080,6 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* ensure we are never given NULL session keys */
|
||||
|
||||
ZERO_STRUCT(zeros);
|
||||
|
||||
if (memcmp(info->user_session_key, zeros, sizeof(zeros)) == 0) {
|
||||
result->user_session_key = data_blob_null;
|
||||
} else {
|
||||
|
@ -803,8 +803,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
|
||||
session_key.data);
|
||||
DEBUG(10,("ntlmssp_server_auth: Created NTLM session key.\n"));
|
||||
} else {
|
||||
uint8 zeros[24];
|
||||
ZERO_STRUCT(zeros);
|
||||
static const uint8 zeros[24] = {0, };
|
||||
session_key = data_blob_talloc(
|
||||
ntlmssp_state, NULL, 16);
|
||||
if (session_key.data == NULL) {
|
||||
@ -1062,11 +1061,9 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
|
||||
}
|
||||
|
||||
if (!ntlmssp_state->nt_hash || !ntlmssp_state->lm_hash) {
|
||||
uchar zeros[16];
|
||||
static const uint8_t zeros[16] = {0, };
|
||||
/* do nothing - blobs are zero length */
|
||||
|
||||
ZERO_STRUCT(zeros);
|
||||
|
||||
/* session key is all zeros */
|
||||
session_key = data_blob_talloc(ntlmssp_state, zeros, 16);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user