Skip to content
Snippets Groups Projects
Select Git revision
  • ff68c47c0c47d84f1b5ca6886edb7659af6ebd95
  • master default
  • wip-slh-dsa-sha2-128s
  • master-updates
  • release-3.10-fixes
  • getopt-prototype
  • fix-bcrypt-warning
  • refactor-hmac
  • wip-use-alignas
  • trim-sha3-context
  • fix-gitlab-ci
  • check-fat-emulate
  • delete-digest_func-size
  • slh-dsa-shake-128f-nettle
  • slh-dsa-shake-128s-nettle
  • slh-dsa-shake-128s
  • delete-openpgp
  • ppc64-sha512
  • delete-md5-compat
  • cleanup-hmac-tests
  • ppc64-sha256
  • nettle_3.10.2_release_20250626
  • nettle_3.10.1_release_20241230
  • nettle_3.10_release_20240616
  • nettle_3.10rc2
  • nettle_3.10rc1
  • nettle_3.9.1_release_20230601
  • nettle_3.9_release_20230514
  • nettle_3.8.1_release_20220727
  • nettle_3.8_release_20220602
  • nettle_3.7.3_release_20210606
  • nettle_3.7.2_release_20210321
  • nettle_3.7.1_release_20210217
  • nettle_3.7_release_20210104
  • nettle_3.7rc1
  • nettle_3.6_release_20200429
  • nettle_3.6rc3
  • nettle_3.6rc2
  • nettle_3.6rc1
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
41 results

config.make.in

Blame
  • proxy_session.c 2.56 KiB
    /* proxy_session.c
     *
     * $Id$ */
    
    /* lsh, an implementation of the ssh protocol
     *
     * Copyright (C) 1999 Balázs Scheidler
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License as
     * published by the Free Software Foundation; either version 2 of the
     * License, or (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but
     * WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     * General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     */
    
    #include "proxy_session.h"
    
    #include "channel_commands.h"
    #include "format.h"
    #include "gateway_channel.h"
    #include "ssh.h"
    #include "werror.h"
    #include "xalloc.h"
    
    #include "proxy_session.c.x"
    
    #define WINDOW_SIZE 10000
    
    
    /* GABA:
       (class
         (name proxy_open_session)
         (super channel_open)
         (vars
           ; requests to accept from server -> client
           (server_requests object alist)
           ; requests to accept from client -> server
           (client_requests object alist)))
    
    */
    
    static void
    do_proxy_open_session(struct channel_open *s,
    		      struct ssh_connection *connection,
    		      UINT32 type,
    		      UINT32 send_window_size,
    		      UINT32 send_max_packet,
    		      struct simple_buffer *args,
    		      struct command_continuation *c,
    		      struct exception_handler *e)
    {
      CAST(proxy_open_session, closure, s);
    
      debug("server.c: do_proxy_open_session()\n");
    
      if (parse_eod(args))
        {
          struct gateway_channel *server
    	= make_gateway_channel(closure->server_requests);
    
          /* NOTE: The origin's rec_window_size and rec_max_packet becomes the target's
           * send_window_size and send_max_packet. */
          struct command *o =
    	make_gateway_channel_open_command(type, send_window_size, send_max_packet,
    					  ssh_format(""), closure->client_requests);
    
          COMMAND_CALL(o,
    		   connection->chain,
    		   make_gateway_channel_open_continuation(c, server),
    		   e);
    
        }
      else
        {
          PROTOCOL_ERROR(e, "Trailing garbage in open message");
        }
    }
    
    struct channel_open *
    make_proxy_open_session(struct alist *server_requests,
    			struct alist *client_requests)
    {
      NEW(proxy_open_session, self);
    
      self->super.handler = do_proxy_open_session;
      self->server_requests = server_requests;
      self->client_requests = client_requests;
      return &self->super;
    }