gss_accept_sec_context: support reassembling split tokens.

Microsoft will sometimes split GSS tokens when they exceed a certain
size in some protocols.  This is specified in

	[MS-SPNG]: Simple and Protected GSS-API Negotiation
	Mechanism (SPNEGO) Extension

https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SPNG/%5bMS-SPNG%5d.pdf

sections 3.1.5.4 to 3.1.5.9.

We extend gss_accept_sec_context() to recognise partial tokens and
to accumulate the fragments until an entire token is available to
be processed.  If the entire token is not yet available,
GSS_S_CONTINUE_NEEDED is returned with a zero length output token.
This is specified in RFC2744 page 25-26 to indicate that no reply
need be sent.

We include updates to the test framework to test split tokens when
using SPNEGO.
This commit is contained in:
Roland C. Dowdeswell
2021-08-02 22:55:47 +01:00
committed by Luke Howard
parent 80f3194a76
commit 3a6229f64a
7 changed files with 543 additions and 213 deletions

View File

@@ -138,6 +138,16 @@ ${context} \
host@host.test.h5l.se || \
{ exitcode=1 ; echo test failed; }
echo "spnego (split tokens)"
${context} \
--token-split=128 \
--client-ccache="${cache}" \
--mech-type=spnego \
--ret-mech-type=krb5 \
--name-type=hostbased-service \
host@host.test.h5l.se || \
{ exitcode=1 ; echo test failed; }
echo "test failure cases"
${context} --mech-type=ntlm --ret-mech-type=krb5 \
--client-ccache="${cache}" \