1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-26 01:49:31 +03:00

auth/ntlmssp: add ntlmssp_version_blob()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
(cherry picked from commit a61ab398cc)
This commit is contained in:
Stefan Metzmacher
2015-11-24 14:05:17 +01:00
parent a575c5e81f
commit 9419ce654a
2 changed files with 36 additions and 0 deletions

View File

@ -61,6 +61,7 @@ NTSTATUS gensec_ntlmssp_update(struct gensec_security *gensec_security,
void debug_ntlmssp_flags(uint32_t neg_flags);
void ntlmssp_handle_neg_flags(struct ntlmssp_state *ntlmssp_state,
uint32_t neg_flags, bool allow_lm);
const DATA_BLOB ntlmssp_version_blob(void);
/* The following definitions come from auth/ntlmssp_server.c */

View File

@ -133,3 +133,38 @@ bool ntlmssp_blob_matches_magic(const DATA_BLOB *blob)
return false;
}
}
const DATA_BLOB ntlmssp_version_blob(void)
{
/*
* This is a simplified version of
*
* enum ndr_err_code err;
* struct ntlmssp_VERSION vers;
*
* ZERO_STRUCT(vers);
* vers.ProductMajorVersion = NTLMSSP_WINDOWS_MAJOR_VERSION_6;
* vers.ProductMinorVersion = NTLMSSP_WINDOWS_MINOR_VERSION_1;
* vers.ProductBuild = 0;
* vers.NTLMRevisionCurrent = NTLMSSP_REVISION_W2K3;
*
* err = ndr_push_struct_blob(&version_blob,
* ntlmssp_state,
* &vers,
* (ndr_push_flags_fn_t)ndr_push_ntlmssp_VERSION);
*
* if (!NDR_ERR_CODE_IS_SUCCESS(err)) {
* data_blob_free(&struct_blob);
* return NT_STATUS_NO_MEMORY;
* }
*/
static const uint8_t version_buffer[8] = {
NTLMSSP_WINDOWS_MAJOR_VERSION_6,
NTLMSSP_WINDOWS_MINOR_VERSION_1,
0x00, 0x00, /* product build */
0x00, 0x00, 0x00, /* reserved */
NTLMSSP_REVISION_W2K3
};
return data_blob_const(version_buffer, ARRAY_SIZE(version_buffer));
}