Skip to content

Commit d0732a6

Browse files
iboukrissimo5
authored andcommitted
Enforce GssapiAllowedMech over raw gssapi mechs
Implemented by aqcuiring creds only for allowed_mechs and by explicity adding spnego to the allowed_mechs set (while still restricting spengo only to the allowed mechanism as before).
1 parent 4b62c33 commit d0732a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mod_auth_gssapi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
#include "mod_auth_gssapi.h"
2626

27+
const gss_OID_desc gss_mech_spnego = {
28+
6, "\x2b\x06\x01\x05\x05\x02"
29+
};
30+
2731
const gss_OID_desc gss_mech_ntlmssp = {
2832
GSS_NTLMSSP_OID_LENGTH, GSS_NTLMSSP_OID_STRING
2933
};
@@ -530,6 +534,8 @@ static int mag_auth(request_rec *req)
530534
(void)gss_release_cred(&min, &server_cred);
531535
}
532536

537+
desired_mechs = cfg->allowed_mechs;
538+
533539
/* implicit auth for subrequests if main auth already happened */
534540
if (!ap_is_initial_req(req) && req->main != NULL) {
535541
type = ap_auth_type(req->main);
@@ -1009,6 +1015,9 @@ static const char *mag_allow_mech(cmd_parms *parms, void *mconfig,
10091015
sizeof(gss_OID_set_desc));
10101016
size = sizeof(gss_OID) * MAX_ALLOWED_MECHS;
10111017
cfg->allowed_mechs->elements = apr_palloc(parms->pool, size);
1018+
1019+
cfg->allowed_mechs->elements[0] = gss_mech_spnego;
1020+
cfg->allowed_mechs->count++;
10121021
}
10131022

10141023
if (strcmp(w, "krb5") == 0) {

0 commit comments

Comments
 (0)