# File lib/net/ssh/authentication/session.rb, line 92
 92:     def next_message
 93:       loop do
 94:         packet = transport.next_message
 95: 
 96:         case packet.type
 97:         when USERAUTH_BANNER
 98:           info { packet[:message] }
 99:           # TODO add a hook for people to retrieve the banner when it is sent
100: 
101:         when USERAUTH_FAILURE
102:           @allowed_auth_methods = packet[:authentications].split(/,/)
103:           debug { "allowed methods: #{packet[:authentications]}" }
104:           return packet
105: 
106:         when USERAUTH_METHOD_RANGE, SERVICE_ACCEPT
107:           return packet
108: 
109:         when USERAUTH_SUCCESS
110:           transport.hint :authenticated
111:           return packet
112: 
113:         else
114:           raise Net::SSH::Exception, "unexpected message #{packet.type} (#{packet})"
115:         end
116:       end
117:     end