Skip to content

Commit

Permalink
remove comments from .h, since they are cut&paste from the .c files
Browse files Browse the repository at this point in the history
and out of sync
  • Loading branch information
mfriedl committed Jun 26, 2001
1 parent 42244e1 commit 0ba7494
Show file tree
Hide file tree
Showing 50 changed files with 405 additions and 900 deletions.
11 changes: 2 additions & 9 deletions ssh/auth-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
60 changes: 8 additions & 52 deletions ssh/auth.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -176,16 +135,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 *);
Expand Down
85 changes: 12 additions & 73 deletions ssh/authfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
21 changes: 6 additions & 15 deletions ssh/authfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 4 additions & 25 deletions ssh/bufaux.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,29 @@
* 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

#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 *);
u_int64_t buffer_get_int64(Buffer *);

/* Stores an integer in the buffer in 4 bytes, msb first. */
u_int buffer_get_int(Buffer *);
void buffer_put_int(Buffer *, u_int);

u_int64_t buffer_get_int64(Buffer *);
void buffer_put_int64(Buffer *, u_int64_t);

/* 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 *);

Expand Down
Loading

0 comments on commit 0ba7494

Please sign in to comment.