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).
This commit is contained in:
Luke Howard
2020-04-07 12:39:43 +10:00
committed by Nico Williams
parent 1c74afb01a
commit 3b7aae7fce
3 changed files with 98 additions and 1 deletions

View File

@@ -285,6 +285,7 @@ spnego_initial(OM_uint32 * minor_status,
sub = _gss_spnego_indicate_mechtypelist(&minor,
ctx->target_name,
req_flags,
initiator_approved,
&sel,
0,