From 3e69aacbe24bfcdc65a5949f239ef19826d10438 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Wed, 1 Jan 2020 11:25:16 +1100 Subject: [PATCH] gss: harmonize SPNEGO with [MS-SPNG] In [MS-SPNG], the Microsoft extension is defined as NegTokenInit2 rather than NegTokenInitWin. Harmonize with the specification. --- lib/gssapi/Makefile.am | 4 ++-- lib/gssapi/spnego/accept_sec_context.c | 12 ++++++------ lib/gssapi/spnego/spnego.asn1 | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/gssapi/Makefile.am b/lib/gssapi/Makefile.am index aacb080ae..58470397f 100644 --- a/lib/gssapi/Makefile.am +++ b/lib/gssapi/Makefile.am @@ -270,10 +270,10 @@ spnego_files = \ asn1_MechType.x \ asn1_MechTypeList.x \ asn1_NegotiationToken.x \ - asn1_NegotiationTokenWin.x \ + asn1_NegotiationToken2.x \ asn1_NegHints.x \ asn1_NegTokenInit.x \ - asn1_NegTokenInitWin.x \ + asn1_NegTokenInit2.x \ asn1_NegTokenResp.x \ asn1_NegResultEnum.x diff --git a/lib/gssapi/spnego/accept_sec_context.c b/lib/gssapi/spnego/accept_sec_context.c index 0e0cc9d2b..53e1e2972 100644 --- a/lib/gssapi/spnego/accept_sec_context.c +++ b/lib/gssapi/spnego/accept_sec_context.c @@ -120,14 +120,14 @@ send_supported_mechs (OM_uint32 *minor_status, gss_const_cred_id_t acceptor_cred, gss_buffer_t output_token) { - NegotiationTokenWin nt; + NegotiationToken2 nt; size_t buf_len = 0; gss_buffer_desc data; OM_uint32 ret; memset(&nt, 0, sizeof(nt)); - nt.element = choice_NegotiationTokenWin_negTokenInit; + nt.element = choice_NegotiationToken2_negTokenInit; nt.u.negTokenInit.reqFlags = NULL; nt.u.negTokenInit.mechToken = NULL; nt.u.negTokenInit.negHints = NULL; @@ -142,23 +142,23 @@ send_supported_mechs (OM_uint32 *minor_status, ALLOC(nt.u.negTokenInit.negHints, 1); if (nt.u.negTokenInit.negHints == NULL) { *minor_status = ENOMEM; - free_NegotiationTokenWin(&nt); + free_NegotiationToken2(&nt); return GSS_S_FAILURE; } ALLOC(nt.u.negTokenInit.negHints->hintName, 1); if (nt.u.negTokenInit.negHints->hintName == NULL) { *minor_status = ENOMEM; - free_NegotiationTokenWin(&nt); + free_NegotiationToken2(&nt); return GSS_S_FAILURE; } *nt.u.negTokenInit.negHints->hintName = strdup("not_defined_in_RFC4178@please_ignore"); nt.u.negTokenInit.negHints->hintAddress = NULL; - ASN1_MALLOC_ENCODE(NegotiationTokenWin, + ASN1_MALLOC_ENCODE(NegotiationToken2, data.value, data.length, &nt, &buf_len, ret); - free_NegotiationTokenWin(&nt); + free_NegotiationToken2(&nt); if (ret) { *minor_status = ret; return GSS_S_FAILURE; diff --git a/lib/gssapi/spnego/spnego.asn1 b/lib/gssapi/spnego/spnego.asn1 index 79ac038a0..fc6cd0c1e 100644 --- a/lib/gssapi/spnego/spnego.asn1 +++ b/lib/gssapi/spnego/spnego.asn1 @@ -22,7 +22,7 @@ NegHints ::= SEQUENCE { hintAddress [1] OCTET STRING OPTIONAL } -NegTokenInitWin ::= SEQUENCE { +NegTokenInit2 ::= SEQUENCE { mechTypes [0] MechTypeList, reqFlags [1] ContextFlags OPTIONAL, mechToken [2] OCTET STRING OPTIONAL, @@ -59,8 +59,8 @@ NegotiationToken ::= CHOICE { negTokenResp[1] NegTokenResp } -NegotiationTokenWin ::= CHOICE { - negTokenInit[0] NegTokenInitWin +NegotiationToken2 ::= CHOICE { + negTokenInit[0] NegTokenInit2 } END