@@ -632,7 +632,10 @@ class ServerAuth : public GlobalStorage, public ServerAuthBase
632632 }
633633
634634 // if we asked for more data but received nothing switch to next plugin
635- const bool forceNext = (flags & AUTH_CONTINUE) && (!authPort->port_srv_auth_block ->hasDataForPlugin ());
635+ const bool forceNext = (flags & AUTH_CONTINUE) &&
636+ (!authPort->port_srv_auth_block ->hasDataForPlugin ()) &&
637+ (!authPort->port_srv_auth_block ->authCompleted ());
638+
636639 HANDSHAKE_DEBUG (fprintf (stderr, " Srv: authenticate: ServerAuth calls plug %s\n " ,
637640 forceNext ? " forced-NEXT" : authItr->name ()));
638641 int authResult = forceNext ? IAuth::AUTH_CONTINUE :
@@ -661,6 +664,11 @@ class ServerAuth : public GlobalStorage, public ServerAuthBase
661664 authServer = NULL ;
662665 continue ;
663666
667+ case IAuth::AUTH_SUCCESS_WITH_DATA:
668+ HANDSHAKE_DEBUG (fprintf (stderr, " Srv: authenticate: success with data\n " ));
669+ fb_assert (!authPort->port_srv_auth_block ->authCompleted ());
670+ // fall thru
671+
664672 case IAuth::AUTH_MORE_DATA:
665673 HANDSHAKE_DEBUG (fprintf (stderr, " Srv: authenticate: plugin wants more data\n " ));
666674 if (authPort->port_protocol < PROTOCOL_VERSION11)
@@ -714,6 +722,13 @@ class ServerAuth : public GlobalStorage, public ServerAuthBase
714722 if (send->p_acpt .p_acpt_type & pflag_compress)
715723 authPort->port_flags |= PORT_compressed;
716724 memset (&send->p_auth_cont , 0 , sizeof send->p_auth_cont );
725+
726+ if (authResult == IAuth::AUTH_SUCCESS_WITH_DATA)
727+ {
728+ authPort->port_srv_auth_block ->authCompleted (true );
729+ HANDSHAKE_DEBUG (fprintf (stderr, " Srv: authenticate: success with data, completed\n " ));
730+ }
731+
717732 return false ;
718733
719734 case IAuth::AUTH_FAILED:
0 commit comments