summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/auth/auth.h4
-rw-r--r--source4/auth/auth_ntlmssp.c18
-rw-r--r--source4/libcli/auth/ntlmssp.c22
-rw-r--r--source4/libcli/auth/ntlmssp.h10
-rw-r--r--source4/libcli/auth/ntlmssp_sign.c18
-rw-r--r--source4/rpc_server/dcesrv_crypto.c10
6 files changed, 39 insertions, 43 deletions
diff --git a/source4/auth/auth.h b/source4/auth/auth.h
index 59e1629a0d..c6a025dba8 100644
--- a/source4/auth/auth.h
+++ b/source4/auth/auth.h
@@ -135,13 +135,13 @@ struct auth_init_function_entry {
struct auth_init_function_entry *prev, *next;
};
-typedef struct auth_ntlmssp_state
+struct auth_ntlmssp_state
{
TALLOC_CTX *mem_ctx;
struct auth_context *auth_context;
struct auth_serversupplied_info *server_info;
struct ntlmssp_state *ntlmssp_state;
-} AUTH_NTLMSSP_STATE;
+};
#define auth_ops __XXX_ERROR_BLA
struct auth_operations {
diff --git a/source4/auth/auth_ntlmssp.c b/source4/auth/auth_ntlmssp.c
index a1a5e4774b..7e854359e0 100644
--- a/source4/auth/auth_ntlmssp.c
+++ b/source4/auth/auth_ntlmssp.c
@@ -30,7 +30,8 @@
static const uint8_t *auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_state)
{
- AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context;
+ struct auth_ntlmssp_state *auth_ntlmssp_state = ntlmssp_state->auth_context;
+
return auth_ntlmssp_state->auth_context->get_ntlm_challenge(auth_ntlmssp_state->auth_context);
}
@@ -41,10 +42,9 @@ static const uint8_t *auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntl
*/
static BOOL auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_state)
{
- AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context;
- struct auth_context *auth_context = auth_ntlmssp_state->auth_context;
+ struct auth_ntlmssp_state *auth_ntlmssp_state = ntlmssp_state->auth_context;
- return auth_context->challenge_may_be_modified;
+ return auth_ntlmssp_state->auth_context->challenge_may_be_modified;
}
/**
@@ -53,7 +53,7 @@ static BOOL auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_s
*/
static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *challenge)
{
- AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context;
+ struct auth_ntlmssp_state *auth_ntlmssp_state = ntlmssp_state->auth_context;
struct auth_context *auth_context = auth_ntlmssp_state->auth_context;
SMB_ASSERT(challenge->length == 8);
@@ -77,7 +77,7 @@ static NTSTATUS auth_ntlmssp_set_challenge(struct ntlmssp_state *ntlmssp_state,
static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key)
{
- AUTH_NTLMSSP_STATE *auth_ntlmssp_state = ntlmssp_state->auth_context;
+ struct auth_ntlmssp_state *auth_ntlmssp_state = ntlmssp_state->auth_context;
auth_usersupplied_info *user_info = NULL;
NTSTATUS nt_status;
@@ -130,7 +130,7 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,
return nt_status;
}
-NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
+NTSTATUS auth_ntlmssp_start(struct auth_ntlmssp_state **auth_ntlmssp_state)
{
NTSTATUS nt_status;
TALLOC_CTX *mem_ctx;
@@ -166,7 +166,7 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
return NT_STATUS_OK;
}
-void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
+void auth_ntlmssp_end(struct auth_ntlmssp_state **auth_ntlmssp_state)
{
TALLOC_CTX *mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
@@ -195,7 +195,7 @@ void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
* or NT_STATUS_OK if the user is authenticated.
*/
-NTSTATUS auth_ntlmssp_update(AUTH_NTLMSSP_STATE *auth_ntlmssp_state,
+NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *auth_ntlmssp_state,
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
diff --git a/source4/libcli/auth/ntlmssp.c b/source4/libcli/auth/ntlmssp.c
index 5916faf513..dab8506b81 100644
--- a/source4/libcli/auth/ntlmssp.c
+++ b/source4/libcli/auth/ntlmssp.c
@@ -42,8 +42,8 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
*/
static const struct ntlmssp_callbacks {
- enum NTLMSSP_ROLE role;
- enum NTLM_MESSAGE_TYPE ntlmssp_command;
+ enum ntlmssp_role role;
+ enum ntlmssp_message_type ntlmssp_command;
NTSTATUS (*fn)(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *out_mem_ctx,
DATA_BLOB in, DATA_BLOB *out);
@@ -141,7 +141,7 @@ static NTSTATUS set_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB *ch
*
*/
-NTSTATUS ntlmssp_set_username(NTLMSSP_STATE *ntlmssp_state, const char *user)
+NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user)
{
ntlmssp_state->user = talloc_strdup(ntlmssp_state->mem_ctx, user);
if (!ntlmssp_state->user) {
@@ -154,7 +154,7 @@ NTSTATUS ntlmssp_set_username(NTLMSSP_STATE *ntlmssp_state, const char *user)
* Set a password on an NTLMSSP context - ensures it is talloc()ed
*
*/
-NTSTATUS ntlmssp_set_password(NTLMSSP_STATE *ntlmssp_state, const char *password)
+NTSTATUS ntlmssp_set_password(struct ntlmssp_state *ntlmssp_state, const char *password)
{
if (!password) {
ntlmssp_state->password = NULL;
@@ -171,7 +171,7 @@ NTSTATUS ntlmssp_set_password(NTLMSSP_STATE *ntlmssp_state, const char *password
* Set a domain on an NTLMSSP context - ensures it is talloc()ed
*
*/
-NTSTATUS ntlmssp_set_domain(NTLMSSP_STATE *ntlmssp_state, const char *domain)
+NTSTATUS ntlmssp_set_domain(struct ntlmssp_state *ntlmssp_state, const char *domain)
{
ntlmssp_state->domain = talloc_strdup(ntlmssp_state->mem_ctx, domain);
if (!ntlmssp_state->domain) {
@@ -184,7 +184,7 @@ NTSTATUS ntlmssp_set_domain(NTLMSSP_STATE *ntlmssp_state, const char *domain)
* Set a workstation on an NTLMSSP context - ensures it is talloc()ed
*
*/
-NTSTATUS ntlmssp_set_workstation(NTLMSSP_STATE *ntlmssp_state, const char *workstation)
+NTSTATUS ntlmssp_set_workstation(struct ntlmssp_state *ntlmssp_state, const char *workstation)
{
ntlmssp_state->workstation = talloc_strdup(ntlmssp_state->mem_ctx, workstation);
if (!ntlmssp_state->domain) {
@@ -198,7 +198,7 @@ NTSTATUS ntlmssp_set_workstation(NTLMSSP_STATE *ntlmssp_state, const char *works
* This copies the data blob
*/
-NTSTATUS ntlmssp_store_response(NTLMSSP_STATE *ntlmssp_state,
+NTSTATUS ntlmssp_store_response(struct ntlmssp_state *ntlmssp_state,
DATA_BLOB response)
{
ntlmssp_state->stored_response = data_blob_talloc(ntlmssp_state->mem_ctx,
@@ -217,7 +217,7 @@ NTSTATUS ntlmssp_store_response(NTLMSSP_STATE *ntlmssp_state,
* or NT_STATUS_OK if the user is authenticated.
*/
-NTSTATUS ntlmssp_update(NTLMSSP_STATE *ntlmssp_state,
+NTSTATUS ntlmssp_update(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
@@ -292,7 +292,7 @@ NTSTATUS ntlmssp_update(NTLMSSP_STATE *ntlmssp_state,
* @param ntlmssp_state NTLMSSP State, free()ed by this function
*/
-void ntlmssp_end(NTLMSSP_STATE **ntlmssp_state)
+void ntlmssp_end(struct ntlmssp_state **ntlmssp_state)
{
TALLOC_CTX *mem_ctx = (*ntlmssp_state)->mem_ctx;
@@ -878,7 +878,7 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state,
* @param ntlmssp_state NTLMSSP State, allocated by this function
*/
-NTSTATUS ntlmssp_server_start(NTLMSSP_STATE **ntlmssp_state)
+NTSTATUS ntlmssp_server_start(struct ntlmssp_state **ntlmssp_state)
{
TALLOC_CTX *mem_ctx;
@@ -1234,7 +1234,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
return NT_STATUS_MORE_PROCESSING_REQUIRED;
}
-NTSTATUS ntlmssp_client_start(NTLMSSP_STATE **ntlmssp_state)
+NTSTATUS ntlmssp_client_start(struct ntlmssp_state **ntlmssp_state)
{
TALLOC_CTX *mem_ctx;
diff --git a/source4/libcli/auth/ntlmssp.h b/source4/libcli/auth/ntlmssp.h
index 40592acf85..f1b87a7f9d 100644
--- a/source4/libcli/auth/ntlmssp.h
+++ b/source4/libcli/auth/ntlmssp.h
@@ -21,14 +21,14 @@
*/
/* NTLMSSP mode */
-enum NTLMSSP_ROLE
+enum ntlmssp_role
{
NTLMSSP_SERVER,
NTLMSSP_CLIENT
};
/* NTLMSSP message types */
-enum NTLM_MESSAGE_TYPE
+enum ntlmssp_message_type
{
NTLMSSP_INITIAL = 0 /* samba internal state */,
NTLMSSP_NEGOTIATE = 1,
@@ -71,11 +71,11 @@ enum NTLM_MESSAGE_TYPE
#define NTLMSSP_SIGN_VERSION 1
-typedef struct ntlmssp_state
+struct ntlmssp_state
{
TALLOC_CTX *mem_ctx;
uint_t ref_count;
- enum NTLMSSP_ROLE role;
+ enum ntlmssp_role role;
enum samr_Role server_role;
uint32_t expected_state;
@@ -184,5 +184,5 @@ typedef struct ntlmssp_state
Store it here, until we need it */
DATA_BLOB stored_response;
-} NTLMSSP_STATE;
+};
diff --git a/source4/libcli/auth/ntlmssp_sign.c b/source4/libcli/auth/ntlmssp_sign.c
index 6b41ad7185..924289cf26 100644
--- a/source4/libcli/auth/ntlmssp_sign.c
+++ b/source4/libcli/auth/ntlmssp_sign.c
@@ -27,7 +27,7 @@
#define SRV_SIGN "session key to server-to-client signing key magic constant"
#define SRV_SEAL "session key to server-to-client sealing key magic constant"
-static void NTLMSSPcalc_ap( uint8_t *hash, uint8_t *data, int len)
+static void NTLMSSPcalc_ap(uint8_t *hash, uint8_t *data, int len)
{
uint8_t index_i = hash[256];
uint8_t index_j = hash[257];
@@ -93,10 +93,6 @@ static void calc_hash(uint8_t hash[258], const char *key, size_t key_len)
* claiming to be the correct output of NTLM2 signature generation.
*
*/
-
-
-
-
static void calc_ntlmv2_hash(uint8_t hash[258], uint8_t subkey[16],
DATA_BLOB session_key,
const char *constant)
@@ -116,7 +112,7 @@ enum ntlmssp_direction {
NTLMSSP_RECEIVE
};
-static NTSTATUS ntlmssp_make_packet_signature(NTLMSSP_STATE *ntlmssp_state,
+static NTSTATUS ntlmssp_make_packet_signature(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *sig_mem_ctx,
const uint8_t *data, size_t length,
enum ntlmssp_direction direction,
@@ -172,7 +168,7 @@ static NTSTATUS ntlmssp_make_packet_signature(NTLMSSP_STATE *ntlmssp_state,
return NT_STATUS_OK;
}
-NTSTATUS ntlmssp_sign_packet(NTLMSSP_STATE *ntlmssp_state,
+NTSTATUS ntlmssp_sign_packet(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *sig_mem_ctx,
const uint8_t *data, size_t length,
DATA_BLOB *sig)
@@ -197,7 +193,7 @@ NTSTATUS ntlmssp_sign_packet(NTLMSSP_STATE *ntlmssp_state,
*
*/
-NTSTATUS ntlmssp_check_packet(NTLMSSP_STATE *ntlmssp_state,
+NTSTATUS ntlmssp_check_packet(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *sig_mem_ctx,
const uint8_t *data, size_t length,
const DATA_BLOB *sig)
@@ -263,7 +259,7 @@ NTSTATUS ntlmssp_check_packet(NTLMSSP_STATE *ntlmssp_state,
*
*/
-NTSTATUS ntlmssp_seal_packet(NTLMSSP_STATE *ntlmssp_state,
+NTSTATUS ntlmssp_seal_packet(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *sig_mem_ctx,
uint8_t *data, size_t length,
DATA_BLOB *sig)
@@ -333,7 +329,7 @@ NTSTATUS ntlmssp_seal_packet(NTLMSSP_STATE *ntlmssp_state,
*
*/
-NTSTATUS ntlmssp_unseal_packet(NTLMSSP_STATE *ntlmssp_state,
+NTSTATUS ntlmssp_unseal_packet(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *sig_mem_ctx,
uint8_t *data, size_t length,
DATA_BLOB *sig)
@@ -363,7 +359,7 @@ NTSTATUS ntlmssp_unseal_packet(NTLMSSP_STATE *ntlmssp_state,
/**
Initialise the state for NTLMSSP signing.
*/
-NTSTATUS ntlmssp_sign_init(NTLMSSP_STATE *ntlmssp_state)
+NTSTATUS ntlmssp_sign_init(struct ntlmssp_state *ntlmssp_state)
{
uint8_t p24[24];
ZERO_STRUCT(p24);
diff --git a/source4/rpc_server/dcesrv_crypto.c b/source4/rpc_server/dcesrv_crypto.c
index 64ff4ee30b..f9e109abd2 100644
--- a/source4/rpc_server/dcesrv_crypto.c
+++ b/source4/rpc_server/dcesrv_crypto.c
@@ -71,7 +71,7 @@ NTSTATUS dcesrv_crypto_update(struct dcesrv_auth *auth,
TALLOC_CTX *out_mem_ctx,
const DATA_BLOB in, DATA_BLOB *out)
{
- AUTH_NTLMSSP_STATE *ntlmssp = auth->crypto_state;
+ struct auth_ntlmssp_state *ntlmssp = auth->crypto_state;
return ntlmssp_update(ntlmssp->ntlmssp_state, out_mem_ctx, in, out);
}
@@ -83,7 +83,7 @@ NTSTATUS dcesrv_crypto_update(struct dcesrv_auth *auth,
NTSTATUS dcesrv_crypto_seal(struct dcesrv_auth *auth,
TALLOC_CTX *sig_mem_ctx, uint8_t *data, size_t length, DATA_BLOB *sig)
{
- AUTH_NTLMSSP_STATE *ntlmssp = auth->crypto_state;
+ struct auth_ntlmssp_state *ntlmssp = auth->crypto_state;
return ntlmssp_seal_packet(ntlmssp->ntlmssp_state, sig_mem_ctx, data, length, sig);
}
@@ -94,7 +94,7 @@ NTSTATUS dcesrv_crypto_seal(struct dcesrv_auth *auth,
NTSTATUS dcesrv_crypto_sign(struct dcesrv_auth *auth,
TALLOC_CTX *sig_mem_ctx, const uint8_t *data, size_t length, DATA_BLOB *sig)
{
- AUTH_NTLMSSP_STATE *ntlmssp = auth->crypto_state;
+ struct auth_ntlmssp_state *ntlmssp = auth->crypto_state;
return ntlmssp_sign_packet(ntlmssp->ntlmssp_state, sig_mem_ctx, data, length, sig);
}
@@ -105,7 +105,7 @@ NTSTATUS dcesrv_crypto_sign(struct dcesrv_auth *auth,
NTSTATUS dcesrv_crypto_check_sig(struct dcesrv_auth *auth,
TALLOC_CTX *sig_mem_ctx, const uint8_t *data, size_t length, const DATA_BLOB *sig)
{
- AUTH_NTLMSSP_STATE *ntlmssp = auth->crypto_state;
+ struct auth_ntlmssp_state *ntlmssp = auth->crypto_state;
return ntlmssp_check_packet(ntlmssp->ntlmssp_state, sig_mem_ctx, data, length, sig);
}
@@ -116,7 +116,7 @@ NTSTATUS dcesrv_crypto_check_sig(struct dcesrv_auth *auth,
NTSTATUS dcesrv_crypto_unseal(struct dcesrv_auth *auth,
TALLOC_CTX *sig_mem_ctx, uint8_t *data, size_t length, DATA_BLOB *sig)
{
- AUTH_NTLMSSP_STATE *ntlmssp = auth->crypto_state;
+ struct auth_ntlmssp_state *ntlmssp = auth->crypto_state;
return ntlmssp_unseal_packet(ntlmssp->ntlmssp_state, sig_mem_ctx, data, length, sig);
}