vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Dmitry Belyavskiy 9fd698
diff --color -rup a/monitor.c b/monitor.c
Dmitry Belyavskiy 9fd698
--- a/monitor.c	2022-07-11 15:11:28.146863144 +0200
Dmitry Belyavskiy 9fd698
+++ b/monitor.c	2022-07-11 15:15:35.726655877 +0200
Dmitry Belyavskiy 9fd698
@@ -376,8 +376,15 @@ monitor_child_preauth(struct ssh *ssh, s
Dmitry Belyavskiy 9fd698
 		if (ent->flags & (MON_AUTHDECIDE|MON_ALOG)) {
Dmitry Belyavskiy 9fd698
 			auth_log(ssh, authenticated, partial,
Dmitry Belyavskiy 9fd698
 			    auth_method, auth_submethod);
Dmitry Belyavskiy 9fd698
-			if (!partial && !authenticated)
Dmitry Belyavskiy 9fd698
+			if (!partial && !authenticated) {
Dmitry Belyavskiy 9fd698
+#ifdef GSSAPI
Dmitry Belyavskiy 9fd698
+				/* If gssapi-with-mic failed, MONITOR_REQ_GSSCHECKMIC is disabled.
Dmitry Belyavskiy 9fd698
+				 * We have to reenable it to try again for gssapi-keyex */
Dmitry Belyavskiy 9fd698
+				if (strcmp(auth_method, "gssapi-with-mic") == 0 && options.gss_keyex)
Dmitry Belyavskiy 9fd698
+					monitor_permit(mon_dispatch, MONITOR_REQ_GSSCHECKMIC, 1);
Dmitry Belyavskiy 9fd698
+#endif
Dmitry Belyavskiy 9fd698
 				authctxt->failures++;
Dmitry Belyavskiy 9fd698
+			}
Dmitry Belyavskiy 9fd698
 			if (authenticated || partial) {
Dmitry Belyavskiy 9fd698
 				auth2_update_session_info(authctxt,
Dmitry Belyavskiy 9fd698
 				    auth_method, auth_submethod);