@@ -69,14 +69,17 @@ char *mag_error(request_rec *req, const char *msg, uint32_t maj, uint32_t min)
6969}
7070
7171enum mag_err_code {
72- MAG_GSS_ERR = 1 ,
72+ MAG_NO_AUTH = 1 ,
73+ MAG_GSS_ERR ,
7374 MAG_INTERNAL ,
7475 MAG_AUTH_NOT_ALLOWED
7576};
7677
7778static const char * mag_err_text (enum mag_err_code err )
7879{
7980 switch (err ) {
81+ case MAG_NO_AUTH :
82+ return "NO AUTH DATA" ;
8083 case MAG_GSS_ERR :
8184 return "GSS ERROR" ;
8285 case MAG_INTERNAL :
@@ -948,10 +951,18 @@ static int mag_auth(request_rec *req)
948951 }
949952
950953 /* We can proceed only if we do have an auth header */
951- if (!auth_header ) goto done ;
954+ if (!auth_header ) {
955+ mag_post_error (req , cfg , MAG_NO_AUTH , 0 , 0 ,
956+ "Client did not send any authentication headers" );
957+ goto done ;
958+ }
952959
953960 auth_header_type = ap_getword_white (req -> pool , & auth_header );
954- if (!auth_header_type ) goto done ;
961+ if (!auth_header_type ) {
962+ mag_post_error (req , cfg , MAG_NO_AUTH , 0 , 0 ,
963+ "Client sent malformed authentication headers" );
964+ goto done ;
965+ }
955966
956967 /* We got auth header, sending auth header would mean re-auth */
957968 send_auth_header = !cfg -> negotiate_once ;
@@ -1028,6 +1039,8 @@ static int mag_auth(request_rec *req)
10281039 break ;
10291040
10301041 default :
1042+ mag_post_error (req , cfg , MAG_NO_AUTH , 0 , 0 ,
1043+ "Client sent unknown authentication headers" );
10311044 goto done ;
10321045 }
10331046
0 commit comments