diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | auth-options.h | 11 | ||||
-rw-r--r-- | auth.h | 60 | ||||
-rw-r--r-- | authfd.h | 85 | ||||
-rw-r--r-- | authfile.h | 21 | ||||
-rw-r--r-- | bufaux.h | 26 | ||||
-rw-r--r-- | buffer.h | 55 | ||||
-rw-r--r-- | canohost.h | 33 | ||||
-rw-r--r-- | channels.h | 123 | ||||
-rw-r--r-- | cipher.h | 22 | ||||
-rw-r--r-- | clientloop.h | 4 | ||||
-rw-r--r-- | compat.h | 11 | ||||
-rw-r--r-- | compress.h | 36 | ||||
-rw-r--r-- | crc32.h | 8 | ||||
-rw-r--r-- | deattack.h | 4 | ||||
-rw-r--r-- | dh.h | 8 | ||||
-rw-r--r-- | dispatch.h | 10 | ||||
-rw-r--r-- | groupaccess.c | 13 | ||||
-rw-r--r-- | groupaccess.h | 21 | ||||
-rw-r--r-- | hostfile.h | 19 | ||||
-rw-r--r-- | kex.h | 14 | ||||
-rw-r--r-- | key.h | 23 | ||||
-rw-r--r-- | log.c | 6 | ||||
-rw-r--r-- | log.h | 40 | ||||
-rw-r--r-- | mac.h | 6 | ||||
-rw-r--r-- | misc.c | 40 | ||||
-rw-r--r-- | misc.h | 58 | ||||
-rw-r--r-- | mpaux.h | 10 | ||||
-rw-r--r-- | packet.h | 232 | ||||
-rw-r--r-- | radix.h | 6 | ||||
-rw-r--r-- | readconf.h | 46 | ||||
-rw-r--r-- | readpass.h | 3 | ||||
-rw-r--r-- | rsa.h | 9 | ||||
-rw-r--r-- | servconf.h | 18 | ||||
-rw-r--r-- | serverloop.h | 7 | ||||
-rw-r--r-- | session.h | 12 | ||||
-rw-r--r-- | sftp-common.c | 8 | ||||
-rw-r--r-- | sftp-common.h | 19 | ||||
-rw-r--r-- | sftp-glob.h | 3 | ||||
-rw-r--r-- | sftp-int.h | 4 | ||||
-rw-r--r-- | ssh-dss.h | 7 | ||||
-rw-r--r-- | ssh-rsa.h | 7 | ||||
-rw-r--r-- | sshconnect.h | 14 | ||||
-rw-r--r-- | sshlogin.h | 35 | ||||
-rw-r--r-- | sshpty.h | 31 | ||||
-rw-r--r-- | sshtty.h | 25 | ||||
-rw-r--r-- | tildexpand.h | 8 | ||||
-rw-r--r-- | uidswap.h | 22 | ||||
-rw-r--r-- | uuencode.h | 8 | ||||
-rw-r--r-- | xmalloc.h | 17 |
50 files changed, 412 insertions, 911 deletions
@@ -62,7 +62,18 @@ - markus@cvs.openbsd.org 2001/06/26 17:25:34 [ssh.1] document SSH_ASKPASS; fubob@MIT.EDU - + - markus@cvs.openbsd.org 2001/06/26 17:27:25 + [authfd.h authfile.h auth.h auth-options.h bufaux.h buffer.h + canohost.h channels.h cipher.h clientloop.h compat.h compress.h + crc32.h deattack.h dh.h dispatch.h groupaccess.c groupaccess.h + hostfile.h kex.h key.h log.c log.h mac.h misc.c misc.h mpaux.h + packet.h radix.h readconf.h readpass.h rsa.h servconf.h serverloop.h + session.h sftp-common.c sftp-common.h sftp-glob.h sftp-int.h + sshconnect.h ssh-dss.h sshlogin.h sshpty.h ssh-rsa.h sshtty.h + tildexpand.h uidswap.h uuencode.h xmalloc.h] + remove comments from .h, since they are cut&paste from the .c files + and out of sync + 20010629 - (bal) Removed net_aton() since we don't use it any more - (bal) Fixed _DISABLE_VPOSIX in readpassphrase.c. @@ -5889,4 +5900,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1359 2001/07/04 04:31:38 mouring Exp $ +$Id: ChangeLog,v 1.1360 2001/07/04 04:46:56 mouring Exp $ diff --git a/auth-options.h b/auth-options.h index db0e6e8f..3b2ce344 100644 --- a/auth-options.h +++ b/auth-options.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* $OpenBSD: auth-options.h,v 1.9 2001/06/26 06:32:47 itojun Exp $ */ +/* $OpenBSD: auth-options.h,v 1.10 2001/06/26 17:27:22 markus Exp $ */ #ifndef AUTH_OPTIONS_H #define AUTH_OPTIONS_H @@ -30,14 +30,7 @@ extern int no_pty_flag; extern char *forced_command; extern struct envstring *custom_environment; -/* - * return 1 if access is granted, 0 if not. - * side effect: sets key option flags - */ -int -auth_parse_options(struct passwd *, char *, char *, u_long); - -/* reset options flags */ +int auth_parse_options(struct passwd *, char *, char *, u_long); void auth_clear_options(void); #endif @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $OpenBSD: auth.h,v 1.21 2001/06/26 16:15:23 dugsong Exp $ + * $OpenBSD: auth.h,v 1.22 2001/06/26 17:27:22 markus Exp $ */ #ifndef AUTH_H #define AUTH_H @@ -87,70 +87,29 @@ struct KbdintDevice void (*free_ctx) __P((void *ctx)); }; -/* - * Tries to authenticate the user using the .rhosts file. Returns true if - * authentication succeeds. If ignore_rhosts is non-zero, this will not - * consider .rhosts and .shosts (/etc/hosts.equiv will still be used). - */ int auth_rhosts(struct passwd *, const char *); - -/* extended interface similar to auth_rhosts() */ int auth_rhosts2(struct passwd *, const char *, const char *, const char *); -/* - * Tries to authenticate the user using the .rhosts file and the host using - * its host key. Returns true if authentication succeeds. - */ -int -auth_rhosts_rsa(struct passwd *, const char *, RSA *); - -/* - * Tries to authenticate the user using password. Returns true if - * authentication succeeds. - */ -int auth_password(Authctxt *, const char *); - -/* - * Performs the RSA authentication dialog with the client. This returns 0 if - * the client could not be authenticated, and 1 if authentication was - * successful. This may exit if there is a serious protocol violation. - */ -int auth_rsa(struct passwd *, BIGNUM *); - -/* - * Parses an RSA key (number of bits, e, n) from a string. Moves the pointer - * over the key. Skips any whitespace at the beginning and at end. - */ -int auth_rsa_read_key(char **, u_int *, BIGNUM *, BIGNUM *); - -/* - * Performs the RSA authentication challenge-response dialog with the client, - * and returns true (non-zero) if the client gave the correct answer to our - * challenge; returns zero if the client gives a wrong answer. - */ -int auth_rsa_challenge_dialog(RSA *); +int auth_rhosts_rsa(struct passwd *, const char *, RSA *); +int auth_password(Authctxt *, const char *); +int auth_rsa(struct passwd *, BIGNUM *); +int auth_rsa_read_key(char **, u_int *, BIGNUM *, BIGNUM *); +int auth_rsa_challenge_dialog(RSA *); #ifdef KRB4 #include <krb.h> -/* - * Performs Kerberos v4 mutual authentication with the client. This returns 0 - * if the client could not be authenticated, and 1 if authentication was - * successful. This may exit if there is a serious protocol violation. - */ int auth_krb4(Authctxt *, KTEXT, char **); int auth_krb4_password(Authctxt *, const char *); void krb4_cleanup_proc(void *); #ifdef AFS #include <kafs.h> - -/* Accept passed Kerberos v4 ticket-granting ticket and AFS tokens. */ int auth_krb4_tgt(Authctxt *, const char *); int auth_afs_token(Authctxt *, const char *); -#endif /* AFS */ +#endif /* AFS */ -#endif /* KRB4 */ +#endif /* KRB4 */ #ifdef KRB5 int auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client); @@ -179,16 +138,13 @@ int verify_response(Authctxt *, const char *); struct passwd * auth_get_user(void); -/* expand a filename - return buffer is allocated by xmalloc */ char *expand_filename(const char *, struct passwd *); char *authorized_keys_file(struct passwd *); char *authorized_keys_file2(struct passwd *); -/* check a file and the path to it */ int secure_filename(FILE *, const char *, struct passwd *, char *, size_t); -/* helper for hostbased auth */ HostStatus check_key_in_hostfiles(struct passwd *, Key *, const char *, const char *, const char *); @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: authfd.h,v 1.18 2001/06/26 06:32:47 itojun Exp $"); */ +/* RCSID("$OpenBSD: authfd.h,v 1.19 2001/06/26 17:27:22 markus Exp $"); */ #ifndef AUTHFD_H #define AUTHFD_H @@ -43,96 +43,35 @@ #define SSH_AGENTC_REMOVE_SMARTCARD_KEY 21 /* additional error code for ssh.com's ssh-agent2 */ -#define SSH_COM_AGENT2_FAILURE 102 +#define SSH_COM_AGENT2_FAILURE 102 #define SSH_AGENT_OLD_SIGNATURE 0x01 - typedef struct { int fd; Buffer identities; int howmany; } AuthenticationConnection; -/* Returns the number of the authentication fd, or -1 if there is none. */ -int ssh_get_authentication_socket(void); - -/* - * This should be called for any descriptor returned by - * ssh_get_authentication_socket(). Depending on the way the descriptor was - * obtained, this may close the descriptor. - */ -void ssh_close_authentication_socket(int); +int ssh_get_authentication_socket(void); +void ssh_close_authentication_socket(int); -/* - * Opens and connects a private socket for communication with the - * authentication agent. Returns NULL if an error occurred and the - * connection could not be opened. The connection should be closed by the - * caller by calling ssh_close_authentication_connection(). - */ AuthenticationConnection *ssh_get_authentication_connection(void); - -/* - * Closes the connection to the authentication agent and frees any associated - * memory. - */ -void ssh_close_authentication_connection(AuthenticationConnection *); - -/* - * Returns the number authentication identity held by the agent. - */ -int ssh_get_num_identities(AuthenticationConnection *, int); - -/* - * Returns the first authentication identity held by the agent or NULL if - * no identies are available. Caller must free comment and key. - * Note that you cannot mix calls with different versions. - */ +void ssh_close_authentication_connection(AuthenticationConnection *); +int ssh_get_num_identities(AuthenticationConnection *, int); Key *ssh_get_first_identity(AuthenticationConnection *, char **, int); - -/* - * Returns the next authentication identity for the agent. Other functions - * can be called between this and ssh_get_first_identity or two calls of this - * function. This returns NULL if there are no more identities. The caller - * must free key and comment after a successful return. - */ Key *ssh_get_next_identity(AuthenticationConnection *, char **, int); +int ssh_add_identity(AuthenticationConnection *, Key *, const char *); +int ssh_remove_identity(AuthenticationConnection *, Key *); +int ssh_remove_all_identities(AuthenticationConnection *, int); +int ssh_update_card(AuthenticationConnection *, int, int); -/* - * Requests the agent to decrypt the given challenge. Returns true if the - * agent claims it was able to decrypt it. - */ int ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16], u_int, u_char[16]); -/* Requests the agent to sign data using key */ -int -ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, int *, - u_char *, int); - -/* - * Adds an identity to the authentication server. This call is not meant to - * be used by normal applications. This returns true if the identity was - * successfully added. - */ int -ssh_add_identity(AuthenticationConnection *, Key *, const char *); - -/* - * Removes the identity from the authentication server. This call is not - * meant to be used by normal applications. This returns true if the - * identity was successfully added. - */ -int ssh_remove_identity(AuthenticationConnection *, Key *); - -/* - * Removes all identities from the authentication agent. This call is not - * meant to be used by normal applications. This returns true if the - * operation was successful. - */ -int ssh_remove_all_identities(AuthenticationConnection *, int); - -int ssh_update_card(AuthenticationConnection *, int, int); +ssh_agent_sign(AuthenticationConnection *, Key *, u_char **, int *, u_char *, + int); #endif /* AUTHFD_H */ @@ -10,24 +10,15 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* $OpenBSD: authfile.h,v 1.7 2001/06/26 06:32:48 itojun Exp $ */ +/* $OpenBSD: authfile.h,v 1.8 2001/06/26 17:27:22 markus Exp $ */ #ifndef AUTHFILE_H #define AUTHFILE_H -int -key_save_private(Key *, const char *, const char *, const char *); - -Key * -key_load_public(const char *, char **); - -Key * -key_load_public_type(int, const char *, char **); - -Key * -key_load_private(const char *, const char *, char **); - -Key * -key_load_private_type(int, const char *, const char *, char **); +int key_save_private(Key *, const char *, const char *, const char *); +Key *key_load_public(const char *, char **); +Key *key_load_public_type(int, const char *, char **); +Key *key_load_private(const char *, const char *, char **); +Key *key_load_private_type(int, const char *, const char *, char **); #endif @@ -10,7 +10,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: bufaux.h,v 1.12 2001/06/26 06:32:48 itojun Exp $"); */ +/* RCSID("$OpenBSD: bufaux.h,v 1.13 2001/06/26 17:27:22 markus Exp $"); */ #ifndef BUFAUX_H #define BUFAUX_H @@ -18,46 +18,26 @@ #include "buffer.h" #include <openssl/bn.h> -/* - * Stores an BIGNUM in the buffer with a 2-byte msb first bit count, followed - * by (bits+7)/8 bytes of binary data, msb first. - */ void buffer_put_bignum(Buffer *, BIGNUM *); void buffer_put_bignum2(Buffer *, BIGNUM *); -/* Retrieves an BIGNUM from the buffer. */ int buffer_get_bignum(Buffer *, BIGNUM *); int buffer_get_bignum2(Buffer *, BIGNUM *); -/* Returns an integer from the buffer (4 bytes, msb first). */ u_int buffer_get_int(Buffer *); -#ifdef HAVE_U_INT64_T -u_int64_t buffer_get_int64(Buffer *); -#endif - -/* Stores an integer in the buffer in 4 bytes, msb first. */ void buffer_put_int(Buffer *, u_int); + #ifdef HAVE_U_INT64_T +u_int64_t buffer_get_int64(Buffer *); void buffer_put_int64(Buffer *, u_int64_t); #endif -/* Returns a character from the buffer (0 - 255). */ int buffer_get_char(Buffer *); -/* Stores a character in the buffer. */ void buffer_put_char(Buffer *, int); -/* - * Returns an arbitrary binary string from the buffer. The string cannot be - * longer than 256k. The returned value points to memory allocated with - * xmalloc; it is the responsibility of the calling function to free the - * data. If length_ptr is non-NULL, the length of the returned data will be - * stored there. A null character will be automatically appended to the - * returned string, and is not counted in length. - */ char *buffer_get_string(Buffer *, u_int *); -/* Stores and arbitrary binary string in the buffer. */ void buffer_put_string(Buffer *, const void *, u_int); void buffer_put_cstring(Buffer *, const char *); @@ -11,56 +11,33 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: buffer.h,v 1.8 2001/06/26 06:32:48 itojun Exp $"); */ +/* RCSID("$OpenBSD: buffer.h,v 1.9 2001/06/26 17:27:23 markus Exp $"); */ #ifndef BUFFER_H #define BUFFER_H typedef struct { - char *buf; /* Buffer for data. */ - u_int alloc; /* Number of bytes allocated for data. */ - u_int offset; /* Offset of first byte containing data. */ - u_int end; /* Offset of last byte containing data. */ + char *buf; /* Buffer for data. */ + u_int alloc; /* Number of bytes allocated for data. */ + u_int offset; /* Offset of first byte containing data. */ + u_int end; /* Offset of last byte containing data. */ } Buffer; -/* Initializes the buffer structure. */ -void buffer_init(Buffer *); -/* Frees any memory used for the buffer. */ -void buffer_free(Buffer *); +void buffer_init(Buffer *); +void buffer_clear(Buffer *); +void buffer_free(Buffer *); -/* Clears any data from the buffer, making it empty. This does not actually - zero the memory. */ -void buffer_clear(Buffer *); +u_int buffer_len(Buffer *); +char *buffer_ptr(Buffer *); -/* Appends data to the buffer, expanding it if necessary. */ -void buffer_append(Buffer *, const char *, u_int); +void buffer_append(Buffer *, const char *, u_int); +void buffer_append_space(Buffer *, char **, u_int); -/* - * Appends space to the buffer, expanding the buffer if necessary. This does - * not actually copy the data into the buffer, but instead returns a pointer - * to the allocated region. - */ -void buffer_append_space(Buffer *, char **, u_int); - -/* Returns the number of bytes of data in the buffer. */ -u_int buffer_len(Buffer *); - -/* Gets data from the beginning of the buffer. */ -void buffer_get(Buffer *, char *, u_int); +void buffer_get(Buffer *, char *, u_int); -/* Consumes the given number of bytes from the beginning of the buffer. */ -void buffer_consume(Buffer *, u_int); +void buffer_consume(Buffer *, u_int); +void buffer_consume_end(Buffer *, u_int); -/* Consumes the given number of bytes from the end of the buffer. */ -void buffer_consume_end(Buffer *, u_int); - -/* Returns a pointer to the first used byte in the buffer. */ -char *buffer_ptr(Buffer *); - -/* - * Dumps the contents of the buffer to stderr in hex. This intended for - * debugging purposes only. - */ -void buffer_dump(Buffer *); +void buffer_dump(Buffer *); #endif /* BUFFER_H */ @@ -1,4 +1,4 @@ -/* $OpenBSD: canohost.h,v 1.7 2001/06/26 06:32:49 itojun Exp $ */ +/* $OpenBSD: canohost.h,v 1.8 2001/06/26 17:27:23 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -12,27 +12,14 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* - * Return the canonical name of the host in the other side of the current - * connection (as returned by packet_get_connection). The host name is - * cached, so it is efficient to call this several times. - */ -const char *get_canonical_hostname(int); - -/* - * Returns the IP-address of the remote host as a string. The returned - * string is cached and must not be freed. - */ -const char *get_remote_ipaddr(void); - -const char *get_remote_name_or_ip(u_int, int); +const char *get_canonical_hostname(int); +const char *get_remote_ipaddr(void); +const char *get_remote_name_or_ip(u_int, int); -/* Returns the ipaddr/port number of the peer of the socket. */ -char * get_peer_ipaddr(int); -int get_peer_port(int); -char * get_local_ipaddr(int); -char * get_local_name(int); +char *get_peer_ipaddr(int); +int get_peer_port(int); +char *get_local_ipaddr(int); +char *get_local_name(int); -/* Returns the port number of the remote/local host. */ -int get_remote_port(void); -int get_local_port(void); +int get_remote_port(void); +int get_local_port(void); @@ -32,7 +32,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* RCSID("$OpenBSD: channels.h,v 1.41 2001/06/26 06:32:49 itojun Exp $"); */ +/* RCSID("$OpenBSD: channels.h,v 1.42 2001/06/26 17:27:23 markus Exp $"); */ #ifndef CHANNEL_H #define CHANNEL_H @@ -58,10 +58,6 @@ #define SSH_CHANNEL_PATH_LEN 30 -/* - * Data structure for channel data. This is initialized in channel_new - * and cleared in channel_free. - */ struct Channel; typedef struct Channel Channel; @@ -139,87 +135,87 @@ struct Channel { #define CHAN_CLOSE_SENT 0x01 #define CHAN_CLOSE_RCVD 0x02 - /* channel management */ Channel *channel_lookup(int); Channel *channel_new(char *, int, int, int, int, int, int, int, char *, int); -void channel_set_fds(int, int, int, int, int, int); -void channel_free(Channel *); -void channel_free_all(void); - -void channel_send_open(int); -void channel_request(int, char *, int); -void channel_request_start(int, char *, int); -void channel_register_callback(int, int mtype, channel_callback_fn *, void *); -void channel_register_cleanup(int, channel_callback_fn *); -void channel_register_filter(int, channel_filter_fn *); -void channel_cancel_cleanup(int); +void channel_set_fds(int, int, int, int, int, int); +void channel_free(Channel *); +void channel_free_all(void); + +void channel_send_open(int); +void channel_request(int, char *, int); +void channel_request_start(int, char *, int); +void channel_register_callback(int, int mtype, channel_callback_fn *, void *); +void channel_register_cleanup(int, channel_callback_fn *); +void channel_register_filter(int, channel_filter_fn *); +void channel_cancel_cleanup(int); /* protocol handler */ -void channel_input_channel_request(int, int, void *); -void channel_input_close(int, int, void *); -void channel_input_close_confirmation(int, int, void *); -void channel_input_data(int, int, void *); -void channel_input_extended_data(int, int, void *); -void channel_input_ieof(int, int, void *); -void channel_input_oclose(int, int, void *); -void channel_input_open_confirmation(int, int, void *); -void channel_input_open_failure(int, int, void *); -void channel_input_port_open(int, int, void *); -void channel_input_window_adjust(int, int, void *); +void channel_input_channel_request(int, int, void *); +void channel_input_close(int, int, void *); +void channel_input_close_confirmation(int, int, void *); +void channel_input_data(int, int, void *); +void channel_input_extended_data(int, int, void *); +void channel_input_ieof(int, int, void *); +void channel_input_oclose(int, int, void *); +void channel_input_open_confirmation(int, int, void *); +void channel_input_open_failure(int, int, void *); +void channel_input_port_open(int, int, void *); +void channel_input_window_adjust(int, int, void *); /* file descriptor handling (read/write) */ -void -channel_prepare_select(fd_set **, fd_set **, int *, int); -void channel_after_select(fd_set *, fd_set *); -void channel_output_poll(void); +void channel_prepare_select(fd_set **, fd_set **, int *, int); +void channel_after_select(fd_set *, fd_set *); +void channel_output_poll(void); -int channel_not_very_much_buffered_data(void); -void channel_close_all(void); -void channel_free_all(void); -int channel_still_open(void); -char *channel_open_message(void); -int channel_find_open(void); +int channel_not_very_much_buffered_data(void); +void channel_close_all(void); +void channel_free_all(void); +int channel_still_open(void); +char *channel_open_message(void); +int channel_find_open(void); /* channel_tcpfwd.c */ -int -channel_request_local_forwarding(u_short, const char *, u_short, int); +void channel_permit_all_opens(void); +void cha |