Skip to content

Commit c27219c

Browse files
committed
Properly check return error when filtering mechs
We need to fail only if the input was an actual set and instead we get back GSS_C_NO_OID_SET. In all other cases we are fine. Signed-off-by: Simo Sorce <[email protected]>
1 parent d6d8a6b commit c27219c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mod_auth_gssapi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ gss_OID_set mag_filter_unwanted_mechs(gss_OID_set src)
349349
uint32_t maj, min;
350350
int present = 0;
351351

352+
if (src == GSS_C_NO_OID_SET) return GSS_C_NO_OID_SET;
353+
352354
for (int i = 0; unwanted_mechs[i] != GSS_C_NO_OID; i++) {
353355
maj = gss_test_oid_set_member(&min,
354356
discard_const(unwanted_mechs[i]),
@@ -459,7 +461,8 @@ static bool mag_auth_basic(request_rec *req,
459461
* multiple times uselessly.
460462
*/
461463
filtered_mechs = mag_filter_unwanted_mechs(allowed_mechs);
462-
if (filtered_mechs == GSS_C_NO_OID_SET) {
464+
if ((allowed_mechs != GSS_C_NO_OID_SET) &&
465+
(filtered_mechs == GSS_C_NO_OID_SET)) {
463466
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, req, "Fatal "
464467
"failure while filtering mechs, aborting");
465468
goto done;

0 commit comments

Comments
 (0)