2 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * Opens a TCP/IP connection to the remote server on the given host. If port
28 * is 0, the default port will be used. If anonymous is zero, a privileged
29 * port will be allocated to make the connection. This requires super-user
30 * privileges if anonymous is false. Connection_attempts specifies the
31 * maximum number of tries, one per second. This returns true on success,
32 * and zero on failure. If the connection is successful, this calls
33 * packet_set_connection for the connection.
36 ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
37 u_short port, int connection_attempts,
38 int anonymous, uid_t original_real_uid,
39 const char *proxy_command);
42 * Starts a dialog with the server, and authenticates the current user on the
43 * server. This does not need any extra privileges. The basic connection to
44 * the server must already have been established before this is called. If
45 * login fails, this function prints an error and never returns. This
46 * initializes the random state, and leaves it initialized (it will also have
47 * references from the packet module).
51 ssh_login(int host_key_valid, RSA * host_key, const char *host,
52 struct sockaddr * hostaddr, uid_t original_real_uid);
56 check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
57 const char *user_hostfile, const char *system_hostfile);
59 void ssh_kex(char *host, struct sockaddr *hostaddr);
61 ssh_userauth(const char * local_user, const char * server_user, char *host,
62 int host_key_valid, RSA *own_host_key);
64 void ssh_kex2(char *host, struct sockaddr *hostaddr);
65 void ssh_userauth2(const char *server_user, char *host);