gss: order SPNEGO proposed mechs by req_flags
authorLuke Howard <lukeh@padl.com>
Tue, 7 Apr 2020 02:39:43 +0000 (12:39 +1000)
committerNico Williams <nico@cryptonector.com>
Sun, 12 Apr 2020 18:25:09 +0000 (13:25 -0500)
commit3b7aae7fce15de0bd9fd7334ed41f4782ee51b50
tree0548773fcc92d7042298a4073145938ba3191bca
parent1c74afb01a070134446fb73d77f4f720627afd5a
gss: order SPNEGO proposed mechs by req_flags

Sort the list of mechanisms proposed by the initiator so that mechanisms are
preferred by their advertised support for GSS flags. For example, if
GSS_C_MUTUAL_FLAG is requested, a mechanism that offers GSS_C_MA_AUTH_TARG will
be preferred over one that doesn't. The flag/mechanism attribute combinations
are also assigned a weight (mutual trumps anonymous, for example).
lib/gssapi/spnego/accept_sec_context.c
lib/gssapi/spnego/compat.c
lib/gssapi/spnego/init_sec_context.c