Skip to content

Conversation

simo5
Copy link
Contributor

@simo5 simo5 commented Apr 3, 2019

Currently on Basic Auth mag_complete was basically always being called with an empty mech_type.
This will allow in future to consistently query via mech_type for both Negotiate and Basic Auth paths.

simo5 added 3 commits April 3, 2019 16:06
Signed-off-by: Simo Sorce <simo@redhat.com>
In order to respect the API we'd have to return nech_type as a copy of
the mech found to correctly complete authentication.
It would need to be a copy because the actual_mechs variable is an array
of statically copied OIDs not an array of pointers.

Instead change mag_auth_basic to directly call mag_complete() and
mag_cache_basic on success. This is easier than attempting to handle
copying out OIDs and then freeing them in the caller as GSSAPI does not
offer standard APIs for copying OIDs.

As a side-effect we reduce the number of arguments to mag_auth_gssapi,
which is good, to the slight detriment of legibility in the main
function as now you need to know mag_auth_basic() is already calling
mag_complete(). The trade off is worth it though.

Signed-off-by: Simo Sorce <simo@redhat.com>
There are a few paths that lead to the done label being reached with a
success status (ret = OK) so the check for sending the persistent header
should probably be done after the done label to catch those other paths
too.

Signed-off-by: Simo Sorce <simo@redhat.com>
@frozencemetery frozencemetery merged commit 4a22af7 into gssapi:master Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants