sanon: Fix flags and ctx export/import confusion
authorNicolas Williams <nico@twosigma.com>
Sun, 26 Apr 2020 05:53:29 +0000 (00:53 -0500)
committerNicolas Williams <nico@twosigma.com>
Sun, 26 Apr 2020 06:30:37 +0000 (01:30 -0500)
commit2cb40ed97c92b3c565aa18d97cfbd5f5327bc29c
treea545dde60c530910385669ba90f26d2a9f625670
parent51fdb4bc04a692ea4adffb13f57dcf58197a285f
sanon: Fix flags and ctx export/import confusion

We were passing SANON flags to _gss_mg_import_rfc4121_context(), which
wants GSS flags.  Meanwhile, I broke gss_inquire_context() on imported
SAnon contexts when I did my review of SAnon.

This commit fixes both issues and removes SANON_FLAG_*, which were only
ever needed because of a flag to track whether a context was locally
initiated or accepted.  Now we use a separate int field of the sanon_ctx
to track whether a context was locally initiated.  Once an SAnon context
is fully established, we rely on gss_inquire_context() on the rfc4121
sub-context for all metadata that isn't the initiator and acceptor names
nor the mechanism OID.
lib/gssapi/sanon/accept_sec_context.c
lib/gssapi/sanon/crypto.c
lib/gssapi/sanon/export_sec_context.c
lib/gssapi/sanon/init_sec_context.c
lib/gssapi/sanon/inquire_context.c
lib/gssapi/sanon/negoex.c
lib/gssapi/sanon/sanon_locl.h