mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r18773: Change negprot_spnego to return a blob
(This used to be commit 28fa772721
)
This commit is contained in:
parent
3bddf16b1f
commit
c209219d06
@ -169,7 +169,7 @@ static int reply_lanman2(char *inbuf, char *outbuf)
|
||||
Generate the spnego negprot reply blob. Return the number of bytes used.
|
||||
****************************************************************************/
|
||||
|
||||
static int negprot_spnego(char *p)
|
||||
static DATA_BLOB negprot_spnego(void)
|
||||
{
|
||||
DATA_BLOB blob;
|
||||
nstring dos_name;
|
||||
@ -180,7 +180,6 @@ static int negprot_spnego(char *p)
|
||||
OID_NTLMSSP,
|
||||
NULL};
|
||||
const char *OIDs_plain[] = {OID_NTLMSSP, NULL};
|
||||
int len;
|
||||
|
||||
global_spnego_negotiated = True;
|
||||
|
||||
@ -222,11 +221,7 @@ static int negprot_spnego(char *p)
|
||||
SAFE_FREE(host_princ_s);
|
||||
}
|
||||
|
||||
memcpy(p, blob.data, blob.length);
|
||||
len = blob.length;
|
||||
data_blob_free(&blob);
|
||||
|
||||
return len;
|
||||
return blob;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -332,10 +327,17 @@ static int reply_nt1(char *inbuf, char *outbuf)
|
||||
STR_UNICODE|STR_TERMINATE|STR_NOALIGN);
|
||||
DEBUG(3,("not using SPNEGO\n"));
|
||||
} else {
|
||||
int len = negprot_spnego(p);
|
||||
|
||||
DATA_BLOB spnego_blob = negprot_spnego();
|
||||
|
||||
if (spnego_blob.data == NULL) {
|
||||
return ERROR_NT(NT_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
||||
memcpy(p, spnego_blob.data, spnego_blob.length);
|
||||
p += spnego_blob.length;
|
||||
data_blob_free(&spnego_blob);
|
||||
|
||||
SCVAL(outbuf,smb_vwv16+1, 0);
|
||||
p += len;
|
||||
DEBUG(3,("using SPNEGO\n"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user