87: def next_message
88: loop do
89: packet = transport.next_message
90:
91: case packet.type
92: when USERAUTH_BANNER
93: info { packet[:message] }
94:
95:
96: when USERAUTH_FAILURE
97: @allowed_auth_methods = packet[:authentications].split(/,/)
98: debug { "allowed methods: #{packet[:authentications]}" }
99: return packet
100:
101: when USERAUTH_METHOD_RANGE, SERVICE_ACCEPT
102: return packet
103:
104: when USERAUTH_SUCCESS
105: transport.hint :authenticated
106: return packet
107:
108: else
109: raise Net::SSH::Exception, "unexpected message #{packet.type} (#{packet})"
110: end
111: end
112: end