lib/em-ssh/authentication-session.rb
# Returns once an acceptable auth packet is received.
Returns once an acceptable auth packet is received.
Returns once an acceptable auth packet is received .
def next_message
        packet = transport.next_message
        case packet.type
        when USERAUTH_BANNER
          info { packet[:message] }
          transport.fire(:auth_banner, packet[:message])
          return next_message
        when USERAUTH_FAILURE
          @allowed_auth_methods = packet[:authentications].split(/,/)
          debug { "allowed methods: #{packet[:authentications]}" }
          return packet
        when USERAUTH_METHOD_RANGE, SERVICE_ACCEPT
          return packet
        when USERAUTH_SUCCESS
          transport.hint :authenticated
          return packet
        else
          raise SshError, "unexpected message #{packet.type} (#{packet})"
        end
      end
def next_message packet = transport . next_message case packet . type when USERAUTH_BANNER info { packet [ :message ] } transport . fire ( :auth_banner , packet [ :message ] ) return next_message when USERAUTH_FAILURE @allowed_auth_methods = packet [ :authentications ] . split ( / , / ) debug { "allowed methods: #{packet[:authentications]}" } return packet when USERAUTH_METHOD_RANGE , SERVICE_ACCEPT return packet when USERAUTH_SUCCESS transport . hint :authenticated return packet else raise SshError , "unexpected message #{packet.type} (#{packet})" end end
Returns once an acceptable auth packet is received.
Returns once an acceptable auth packet is received .