From bc72a9c169dbaab1dd078e61c9cc1ee06e2b2995 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Sep 2011 21:17:02 +0200 Subject: s3:libsmb: make use of cli_state_server_gss_blob() metze --- source3/libsmb/cliconnect.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 865e03bde7..4963332c0d 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1774,15 +1774,21 @@ static ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, char *principal = NULL; char *OIDs[ASN1_MAX_OIDS]; int i; - DATA_BLOB blob; + DATA_BLOB *server_blob; + DATA_BLOB blob = data_blob_null; const char *p = NULL; char *account = NULL; NTSTATUS status; - DEBUG(3,("Doing spnego session setup (blob length=%lu)\n", (unsigned long)cli->secblob.length)); + server_blob = cli_state_server_gss_blob(cli); + if (server_blob) { + blob = data_blob(server_blob->data, server_blob->length); + } + + DEBUG(3,("Doing spnego session setup (blob length=%lu)\n", (unsigned long)blob.length)); /* the server might not even do spnego */ - if (cli->secblob.length == 0) { + if (blob.length == 0) { DEBUG(3,("server didn't supply a full spnego negprot\n")); goto ntlmssp; } @@ -1791,8 +1797,6 @@ static ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, file_save("negprot.dat", cli->secblob.data, cli->secblob.length); #endif - blob = data_blob(cli->secblob.data, cli->secblob.length); - /* The server sent us the first part of the SPNEGO exchange in the * negprot reply. It is WRONG to depend on the principal sent in the * negprot reply, but right now we do it. If we don't receive one, -- cgit