mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
renaming AUTH VERIFIER to AUTH NTLMSSP VERIFIER. ready for adding
another RPC authentication system.
(This used to be commit 1a211bafeb
)
This commit is contained in:
parent
73a0c9f046
commit
f2e0bbffb5
@ -87,11 +87,11 @@ typedef struct pipes_struct
|
||||
RPC_HDR_AUTH auth_info;
|
||||
RPC_HDR_AUTHA autha_info;
|
||||
|
||||
RPC_AUTH_VERIFIER auth_verifier;
|
||||
RPC_AUTH_NTLMSSP_NEG ntlmssp_neg;
|
||||
RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal;
|
||||
RPC_AUTH_NTLMSSP_RESP ntlmssp_resp;
|
||||
RPC_AUTH_NTLMSSP_CHK ntlmssp_chk;
|
||||
RPC_AUTH_NTLMSSP_VERIFIER auth_verifier;
|
||||
RPC_AUTH_NTLMSSP_NEG ntlmssp_neg;
|
||||
RPC_AUTH_NTLMSSP_CHAL ntlmssp_chal;
|
||||
RPC_AUTH_NTLMSSP_RESP ntlmssp_resp;
|
||||
RPC_AUTH_NTLMSSP_CHK ntlmssp_chk;
|
||||
|
||||
BOOL ntlmssp_auth;
|
||||
BOOL ntlmssp_validated;
|
||||
|
@ -2393,11 +2393,11 @@ void make_rpc_hdr_auth(RPC_HDR_AUTH *rai,
|
||||
uint8 stub_type_len,
|
||||
uint32 ptr);
|
||||
void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int depth);
|
||||
BOOL rpc_auth_verifier_chk(RPC_AUTH_VERIFIER *rav,
|
||||
BOOL rpc_auth_ntlmssp_verifier_chk(RPC_AUTH_NTLMSSP_VERIFIER *rav,
|
||||
char *signature, uint32 msg_type);
|
||||
void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav,
|
||||
void make_rpc_auth_ntlmssp_verifier(RPC_AUTH_NTLMSSP_VERIFIER *rav,
|
||||
char *signature, uint32 msg_type);
|
||||
void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth);
|
||||
void smb_io_rpc_auth_ntlmssp_verifier(char *desc, RPC_AUTH_NTLMSSP_VERIFIER *rav, prs_struct *ps, int depth);
|
||||
void make_rpc_auth_ntlmssp_neg(RPC_AUTH_NTLMSSP_NEG *neg,
|
||||
uint32 neg_flgs,
|
||||
fstring myname, fstring domain);
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "rpc_misc.h" /* this only pulls in STRHDR */
|
||||
|
||||
|
||||
/* DCE/RPC packet types */
|
||||
|
||||
enum RPC_PKT_TYPE
|
||||
@ -218,13 +217,13 @@ typedef struct rpc_hdr_ba_info
|
||||
|
||||
} RPC_HDR_BA;
|
||||
|
||||
/* RPC_AUTH_VERIFIER */
|
||||
typedef struct rpc_auth_verif_info
|
||||
/* RPC_AUTH_NTLMSSP_VERIFIER */
|
||||
typedef struct rpc_auth_ntlmssp_verif_info
|
||||
{
|
||||
fstring signature; /* "NTLMSSP" */
|
||||
uint32 msg_type; /* NTLMSSP_MESSAGE_TYPE (1,2,3) */
|
||||
|
||||
} RPC_AUTH_VERIFIER;
|
||||
} RPC_AUTH_NTLMSSP_VERIFIER;
|
||||
|
||||
/* this is TEMPORARILY coded up as a specific structure */
|
||||
/* this structure comes after the bind request */
|
||||
|
@ -408,7 +408,7 @@ static BOOL create_rpc_bind_req(prs_struct *rhdr,
|
||||
RPC_HDR_RB hdr_rb;
|
||||
RPC_HDR hdr;
|
||||
RPC_HDR_AUTH hdr_auth;
|
||||
RPC_AUTH_VERIFIER auth_verifier;
|
||||
RPC_AUTH_NTLMSSP_VERIFIER auth_verifier;
|
||||
RPC_AUTH_NTLMSSP_NEG ntlmssp_neg;
|
||||
|
||||
/* create the bind request RPC_HDR_RB */
|
||||
@ -425,10 +425,10 @@ static BOOL create_rpc_bind_req(prs_struct *rhdr,
|
||||
smb_io_rpc_hdr_auth("hdr_auth", &hdr_auth, rhdr_auth, 0);
|
||||
mem_realloc_data(rhdr_auth->data, rhdr_auth->offset);
|
||||
|
||||
make_rpc_auth_verifier(&auth_verifier,
|
||||
make_rpc_auth_ntlmssp_verifier(&auth_verifier,
|
||||
"NTLMSSP", NTLMSSP_NEGOTIATE);
|
||||
|
||||
smb_io_rpc_auth_verifier("auth_verifier", &auth_verifier, auth_req, 0);
|
||||
smb_io_rpc_auth_ntlmssp_verifier("auth_verifier", &auth_verifier, auth_req, 0);
|
||||
mem_realloc_data(auth_req->data, auth_req->offset);
|
||||
|
||||
make_rpc_auth_ntlmssp_neg(&ntlmssp_neg,
|
||||
@ -493,19 +493,19 @@ static BOOL create_rpc_bind_resp(struct pwd_info *pwd,
|
||||
unsigned char lm_owf[24];
|
||||
unsigned char nt_owf[128];
|
||||
size_t nt_owf_len;
|
||||
RPC_HDR hdr;
|
||||
RPC_HDR_AUTHA hdr_autha;
|
||||
RPC_AUTH_VERIFIER auth_verifier;
|
||||
RPC_AUTH_NTLMSSP_RESP ntlmssp_resp;
|
||||
RPC_HDR hdr;
|
||||
RPC_HDR_AUTHA hdr_autha;
|
||||
RPC_AUTH_NTLMSSP_VERIFIER auth_verifier;
|
||||
RPC_AUTH_NTLMSSP_RESP ntlmssp_resp;
|
||||
|
||||
make_rpc_hdr_autha(&hdr_autha, 0x1630, 0x1630, 0x0a, 0x06, 0x00);
|
||||
smb_io_rpc_hdr_autha("hdr_autha", &hdr_autha, rhdr_autha, 0);
|
||||
mem_realloc_data(rhdr_autha->data, rhdr_autha->offset);
|
||||
|
||||
make_rpc_auth_verifier(&auth_verifier,
|
||||
make_rpc_auth_ntlmssp_verifier(&auth_verifier,
|
||||
"NTLMSSP", NTLMSSP_AUTH);
|
||||
|
||||
smb_io_rpc_auth_verifier("auth_verifier", &auth_verifier, auth_resp, 0);
|
||||
smb_io_rpc_auth_ntlmssp_verifier("auth_verifier", &auth_verifier, auth_resp, 0);
|
||||
mem_realloc_data(auth_resp->data, auth_resp->offset);
|
||||
|
||||
pwd_get_lm_nt_owf(pwd, lm_owf, nt_owf, &nt_owf_len);
|
||||
@ -876,10 +876,10 @@ static BOOL rpc_pipe_bind(struct cli_state *cli, uint16 nt_pipe_fnum,
|
||||
/* send data on \PIPE\. receive a response */
|
||||
if (rpc_api_pipe(cli, nt_pipe_fnum, 0x0026, NULL, &data, &rparam, &rdata))
|
||||
{
|
||||
RPC_HDR_BA hdr_ba;
|
||||
RPC_HDR_AUTH rhdr_auth;
|
||||
RPC_AUTH_VERIFIER rhdr_verf;
|
||||
RPC_AUTH_NTLMSSP_CHAL rhdr_chal;
|
||||
RPC_HDR_BA hdr_ba;
|
||||
RPC_HDR_AUTH rhdr_auth;
|
||||
RPC_AUTH_NTLMSSP_VERIFIER rhdr_verf;
|
||||
RPC_AUTH_NTLMSSP_CHAL rhdr_chal;
|
||||
|
||||
DEBUG(5, ("rpc_api_pipe: return OK\n"));
|
||||
|
||||
@ -904,7 +904,7 @@ static BOOL rpc_pipe_bind(struct cli_state *cli, uint16 nt_pipe_fnum,
|
||||
|
||||
if (valid_ack && ntlmssp_auth)
|
||||
{
|
||||
smb_io_rpc_auth_verifier("", &rhdr_verf, &rdata, 0);
|
||||
smb_io_rpc_auth_ntlmssp_verifier("", &rhdr_verf, &rdata, 0);
|
||||
if (rdata.offset == 0) valid_ack = False;
|
||||
}
|
||||
if (valid_ack && ntlmssp_auth)
|
||||
|
@ -505,7 +505,8 @@ checks an RPC_HDR_AUTH structure.
|
||||
********************************************************************/
|
||||
BOOL rpc_hdr_auth_chk(RPC_HDR_AUTH *rai)
|
||||
{
|
||||
return (rai->auth_type == 0x0a && rai->auth_level == 0x06);
|
||||
return ((rai->auth_type == 0x0a || rai->auth_type == 0x44) &&
|
||||
rai->auth_level == 0x06);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@ -545,18 +546,18 @@ void smb_io_rpc_hdr_auth(char *desc, RPC_HDR_AUTH *rai, prs_struct *ps, int dept
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
checks an RPC_AUTH_VERIFIER structure.
|
||||
checks an RPC_AUTH_NTLMSSP_VERIFIER structure.
|
||||
********************************************************************/
|
||||
BOOL rpc_auth_verifier_chk(RPC_AUTH_VERIFIER *rav,
|
||||
BOOL rpc_auth_ntlmssp_verifier_chk(RPC_AUTH_NTLMSSP_VERIFIER *rav,
|
||||
char *signature, uint32 msg_type)
|
||||
{
|
||||
return (strequal(rav->signature, signature) && rav->msg_type == msg_type);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
creates an RPC_AUTH_VERIFIER structure.
|
||||
creates an RPC_AUTH_NTLMSSP_VERIFIER structure.
|
||||
********************************************************************/
|
||||
void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav,
|
||||
void make_rpc_auth_ntlmssp_verifier(RPC_AUTH_NTLMSSP_VERIFIER *rav,
|
||||
char *signature, uint32 msg_type)
|
||||
{
|
||||
if (rav == NULL) return;
|
||||
@ -566,9 +567,9 @@ void make_rpc_auth_verifier(RPC_AUTH_VERIFIER *rav,
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
reads or writes an RPC_AUTH_VERIFIER structure.
|
||||
reads or writes an RPC_AUTH_NTLMSSP_VERIFIER structure.
|
||||
********************************************************************/
|
||||
void smb_io_rpc_auth_verifier(char *desc, RPC_AUTH_VERIFIER *rav, prs_struct *ps, int depth)
|
||||
void smb_io_rpc_auth_ntlmssp_verifier(char *desc, RPC_AUTH_NTLMSSP_VERIFIER *rav, prs_struct *ps, int depth)
|
||||
{
|
||||
if (rav == NULL) return;
|
||||
|
||||
|
@ -388,10 +388,10 @@ static BOOL api_pipe_bind_auth_resp(pipes_struct *p, prs_struct *pd)
|
||||
|
||||
if (!rpc_hdr_auth_chk(&(p->auth_info))) return False;
|
||||
|
||||
smb_io_rpc_auth_verifier("", &p->auth_verifier, pd, 0);
|
||||
smb_io_rpc_auth_ntlmssp_verifier("", &p->auth_verifier, pd, 0);
|
||||
if (pd->offset == 0) return False;
|
||||
|
||||
if (!rpc_auth_verifier_chk(&(p->auth_verifier), "NTLMSSP", NTLMSSP_AUTH)) return False;
|
||||
if (!rpc_auth_ntlmssp_verifier_chk(&(p->auth_verifier), "NTLMSSP", NTLMSSP_AUTH)) return False;
|
||||
|
||||
return api_pipe_ntlmssp(p, pd);
|
||||
}
|
||||
@ -436,7 +436,7 @@ static BOOL api_pipe_bind_and_alt_req(pipes_struct *p, prs_struct *pd, enum RPC_
|
||||
|
||||
if (p->ntlmssp_auth)
|
||||
{
|
||||
smb_io_rpc_auth_verifier("", &p->auth_verifier, pd, 0);
|
||||
smb_io_rpc_auth_ntlmssp_verifier("", &p->auth_verifier, pd, 0);
|
||||
if (pd->offset == 0) return False;
|
||||
|
||||
p->ntlmssp_auth = strequal(p->auth_verifier.signature, "NTLMSSP");
|
||||
@ -521,9 +521,9 @@ static BOOL api_pipe_bind_and_alt_req(pipes_struct *p, prs_struct *pd, enum RPC_
|
||||
|
||||
/*** NTLMSSP verifier ***/
|
||||
|
||||
make_rpc_auth_verifier(&p->auth_verifier,
|
||||
make_rpc_auth_ntlmssp_verifier(&p->auth_verifier,
|
||||
"NTLMSSP", NTLMSSP_CHALLENGE);
|
||||
smb_io_rpc_auth_verifier("", &p->auth_verifier, &p->rauth, 0);
|
||||
smb_io_rpc_auth_ntlmssp_verifier("", &p->auth_verifier, &p->rauth, 0);
|
||||
mem_realloc_data(p->rauth.data, p->rauth.offset);
|
||||
|
||||
/* NTLMSSP challenge ***/
|
||||
|
Loading…
Reference in New Issue
Block a user