summaryrefslogtreecommitdiff
path: root/source4/libcli/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-06-04 07:46:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:25 -0500
commit8f84a98e299e63b7fb7fdd797e8e7969b68a106f (patch)
tree5ee006ad2a8a827f81f2850dedc7098d1f14a918 /source4/libcli/auth
parent8087d844ef59a82617be51f7c887b9bafe362f80 (diff)
downloadsamba-8f84a98e299e63b7fb7fdd797e8e7969b68a106f.tar.gz
samba-8f84a98e299e63b7fb7fdd797e8e7969b68a106f.tar.bz2
samba-8f84a98e299e63b7fb7fdd797e8e7969b68a106f.zip
r1001: in samba4 we don't(shouldn't) use typedef's anymore...
metze (This used to be commit ac5f6f7e511a730448012c8a709887827aea2281)
Diffstat (limited to 'source4/libcli/auth')
-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
3 files changed, 23 insertions, 27 deletions
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);