return false;
}
if (user_sess_key != NULL) {
- *user_sess_key = data_blob_talloc(mem_ctx, NULL, 16);
+ *user_sess_key = data_blob_talloc_s(mem_ctx, NULL, 16);
if (user_sess_key->data == NULL) {
DBG_ERR("data_blob_talloc failed\n");
ZERO_ARRAY(p24);
return false;
}
- client_key_data = data_blob_talloc(mem_ctx, ntv2_response->data+16, ntv2_response->length-16);
+ client_key_data = data_blob_talloc_s(mem_ctx,
+ ntv2_response->data + 16,
+ ntv2_response->length - 16);
/*
todo: should we be checking this for anything? We can't for LMv2,
but for NTLMv2 it is meant to contain the current time etc.
return false;
}
if (user_sess_key != NULL) {
- *user_sess_key = data_blob_talloc(mem_ctx, NULL, 16);
+ *user_sess_key = data_blob_talloc_s(mem_ctx, NULL, 16);
if (user_sess_key->data == NULL) {
DBG_ERR("data_blob_talloc failed\n");
ZERO_ARRAY(kr);
return false;
}
- client_key_data = data_blob_talloc(mem_ctx, ntv2_response->data+16, ntv2_response->length-16);
+ client_key_data = data_blob_talloc_s(mem_ctx,
+ ntv2_response->data + 16,
+ ntv2_response->length - 16);
if (!ntv2_owf_gen(part_passwd, user, domain, kr)) {
ZERO_ARRAY(kr);
ZERO_ARRAY(value_from_encryption);
return false;
}
- *user_sess_key = data_blob_talloc(mem_ctx, NULL, 16);
+ *user_sess_key = data_blob_talloc_s(mem_ctx, NULL, 16);
if (user_sess_key->data == NULL) {
DBG_ERR("data_blob_talloc failed\n");
ZERO_ARRAY(kr);
client_domain,
user_sess_key)) {
if (user_sess_key->length) {
- *lm_sess_key = data_blob_talloc(mem_ctx, user_sess_key->data, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ user_sess_key->data,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
}
upper_client_domain,
user_sess_key)) {
if (user_sess_key->length) {
- *lm_sess_key = data_blob_talloc(mem_ctx, user_sess_key->data, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ user_sess_key->data,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
}
"",
user_sess_key)) {
if (user_sess_key->length) {
- *lm_sess_key = data_blob_talloc(mem_ctx, user_sess_key->data, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ user_sess_key->data,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
} else {
so use it only if we otherwise allow LM authentication */
if (lanman_auth && stored_lanman) {
- *lm_sess_key = data_blob_talloc(mem_ctx, stored_lanman->hash, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ stored_lanman->hash,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
} else {
uint8_t first_8_lm_hash[16];
memcpy(first_8_lm_hash, stored_lanman->hash, 8);
memset(first_8_lm_hash + 8, '\0', 8);
- *user_sess_key = data_blob_talloc(mem_ctx, first_8_lm_hash, 16);
- *lm_sess_key = data_blob_talloc(mem_ctx, stored_lanman->hash, 8);
+ *user_sess_key = data_blob_talloc_s(
+ mem_ctx, first_8_lm_hash, 16);
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx, stored_lanman->hash, 8);
ZERO_ARRAY(first_8_lm_hash);
}
return NT_STATUS_OK;
*user_sess_key = tmp_sess_key;
}
if (user_sess_key->length) {
- *lm_sess_key = data_blob_talloc(mem_ctx, user_sess_key->data, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ user_sess_key->data,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
}
*user_sess_key = tmp_sess_key;
}
if (user_sess_key->length) {
- *lm_sess_key = data_blob_talloc(mem_ctx, user_sess_key->data, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ user_sess_key->data,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
}
*user_sess_key = tmp_sess_key;
}
if (user_sess_key->length) {
- *lm_sess_key = data_blob_talloc(mem_ctx, user_sess_key->data, MIN(8, user_sess_key->length));
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx,
+ user_sess_key->data,
+ MIN(8, user_sess_key->length));
}
return NT_STATUS_OK;
}
uint8_t first_8_lm_hash[16];
memcpy(first_8_lm_hash, stored_lanman->hash, 8);
memset(first_8_lm_hash + 8, '\0', 8);
- *user_sess_key = data_blob_talloc(mem_ctx, first_8_lm_hash, 16);
- *lm_sess_key = data_blob_talloc(mem_ctx, stored_lanman->hash, 8);
+ *user_sess_key = data_blob_talloc_s(
+ mem_ctx, first_8_lm_hash, 16);
+ *lm_sess_key = data_blob_talloc_s(
+ mem_ctx, stored_lanman->hash, 8);
ZERO_ARRAY(first_8_lm_hash);
}
return NT_STATUS_OK;
if (blob->length < 8) {
return NULL;
}
-
- out = data_blob_talloc(mem_ctx, NULL, blob->length);
+
+ out = data_blob_talloc_s(mem_ctx, NULL, blob->length);
if (!out.data) {
return NULL;
}
int dlen = (blob_in->length+7) & ~7;
int rc;
- src = data_blob_talloc(mem_ctx, NULL, 8+dlen);
+ src = data_blob_talloc_s(mem_ctx, NULL, 8 + dlen);
if (!src.data) {
return data_blob(NULL, 0);
}
- ret = data_blob_talloc(mem_ctx, NULL, 8+dlen);
+ ret = data_blob_talloc_s(mem_ctx, NULL, 8 + dlen);
if (!ret.data) {
data_blob_free(&src);
return data_blob(NULL, 0);
(int)blob->length));
return NT_STATUS_INVALID_PARAMETER;
}
-
- out = data_blob_talloc(mem_ctx, NULL, blob->length);
+
+ out = data_blob_talloc_s(mem_ctx, NULL, blob->length);
if (!out.data) {
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_WRONG_PASSWORD;
}
- *ret = data_blob_talloc(mem_ctx, out.data+8, slen);
+ *ret = data_blob_talloc_s(mem_ctx, out.data + 8, slen);
if (slen && !ret->data) {
return NT_STATUS_NO_MEMORY;
}
return data_blob(NULL, 0);
}
- final_response = data_blob_talloc(out_mem_ctx, NULL, sizeof(ntlmv2_response) + ntlmv2_client_data.length);
+ final_response = data_blob_talloc_s(out_mem_ctx,
+ NULL,
+ sizeof(ntlmv2_response) +
+ ntlmv2_client_data.length);
memcpy(final_response.data, ntlmv2_response, sizeof(ntlmv2_response));
const DATA_BLOB *server_chal)
{
uint8_t lmv2_response[16];
- DATA_BLOB lmv2_client_data = data_blob_talloc(mem_ctx, NULL, 8);
- DATA_BLOB final_response = data_blob_talloc(mem_ctx, NULL,24);
+ DATA_BLOB lmv2_client_data = data_blob_talloc_s(mem_ctx, NULL, 8);
+ DATA_BLOB final_response = data_blob_talloc_s(mem_ctx, NULL, 24);
NTSTATUS status;
/* LMv2 */
*nttime,
names_blob);
if (user_session_key) {
- *user_session_key = data_blob_talloc(mem_ctx, NULL, 16);
+ *user_session_key = data_blob_talloc_s(mem_ctx,
+ NULL,
+ 16);
/* The NTLMv2 calculations also provide a session key, for signing etc later */
/* use only the first 16 bytes of nt_response for session key */
server_chal);
}
if (lm_session_key) {
- *lm_session_key = data_blob_talloc(mem_ctx, NULL, 16);
+ *lm_session_key = data_blob_talloc_s(mem_ctx,
+ NULL,
+ 16);
/* The NTLMv2 calculations also provide a session key, for signing etc later */
/* use only the first 16 bytes of lm_response for session key */
}
blob1 = data_blob_const(bytes+16, num_bytes-16);
- blob2 = data_blob_dup_talloc(state, blob1);
+ blob2 = data_blob_dup_talloc_s(state, blob1);
if (blob1.length > 0 &&
tevent_req_nomem(blob2.data, req)) {
return;
return;
}
- conn->smb2.server.gss_blob = data_blob_talloc(conn,
- iov[2].iov_base,
- security_length);
+ conn->smb2.server.gss_blob = data_blob_talloc_s(conn,
+ iov[2].iov_base,
+ security_length);
if (tevent_req_nomem(conn->smb2.server.gss_blob.data, req)) {
return;
}
return NT_STATUS_NO_USER_SESSION_KEY;
}
- *key = data_blob_dup_talloc(mem_ctx, sig->blob);
+ *key = data_blob_dup_talloc_s(mem_ctx, sig->blob);
if (key->data == NULL) {
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_USER_SESSION_KEY;
}
- *key = data_blob_dup_talloc(mem_ctx, session->smb2->encryption_key->blob);
+ *key = data_blob_dup_talloc_s(mem_ctx,
+ session->smb2->encryption_key->blob);
if (key->data == NULL) {
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_USER_SESSION_KEY;
}
- *key = data_blob_dup_talloc(mem_ctx, session->smb2->decryption_key->blob);
+ *key = data_blob_dup_talloc_s(mem_ctx,
+ session->smb2->decryption_key->blob);
if (key->data == NULL) {
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_USER_SESSION_KEY;
}
- *key = data_blob_dup_talloc(mem_ctx, *application_key);
+ *key = data_blob_dup_talloc_s(mem_ctx, *application_key);
if (key->data == NULL) {
return NT_STATUS_NO_MEMORY;
}
memcpy(session_key, _session_key.data,
MIN(_session_key.length, sizeof(session_key)));
- session->smb1.application_key = data_blob_talloc(session,
- session_key,
- sizeof(session_key));
+ session->smb1.application_key = data_blob_talloc_s(
+ session, session_key, sizeof(session_key));
ZERO_STRUCT(session_key);
if (session->smb1.application_key.data == NULL) {
return NT_STATUS_NO_MEMORY;
memcpy(channel_key, _channel_key.data,
MIN(_channel_key.length, sizeof(channel_key)));
- session->smb2_channel.signing_key->blob =
- data_blob_talloc(session->smb2_channel.signing_key,
- channel_key,
- sizeof(channel_key));
+ session->smb2_channel.signing_key->blob = data_blob_talloc_s(
+ session->smb2_channel.signing_key,
+ channel_key,
+ sizeof(channel_key));
if (!smb2_signing_key_valid(session->smb2_channel.signing_key)) {
ZERO_STRUCT(channel_key);
return NT_STATUS_NO_MEMORY;
if (password == NULL) {
password = "";
}
- state->setup.nt1.in.password1 = data_blob_talloc(state, password, strlen(password));
+ state->setup.nt1.in.password1 = data_blob_talloc_s(
+ state, password, strlen(password));
state->setup.nt1.in.password2 = data_blob(NULL, 0);
} else {
/* could match windows client and return 'cannot logon from this workstation', but it just confuses everybody */