Skip to content

Commit

Permalink
prototype pedant. not very creative...
Browse files Browse the repository at this point in the history
- () -> (void)
- no variable names
  • Loading branch information
itojun committed Jun 26, 2001
1 parent 0bd3d15 commit 09e5720
Show file tree
Hide file tree
Showing 49 changed files with 356 additions and 426 deletions.
4 changes: 2 additions & 2 deletions ssh/atomicio.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $OpenBSD: atomicio.h,v 1.3 2001/03/02 18:54:30 deraadt Exp $ */
/* $OpenBSD: atomicio.h,v 1.4 2001/06/26 06:32:46 itojun Exp $ */

/*
* Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
Expand Down Expand Up @@ -28,4 +28,4 @@
/*
* Ensure all of data on socket comes through. f==read || f==write
*/
ssize_t atomicio(ssize_t (*f)(), int fd, void *s, size_t n);
ssize_t atomicio(ssize_t (*)(), int, void *, size_t);
5 changes: 2 additions & 3 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.8 2001/01/21 19:05:42 markus Exp $ */
/* $OpenBSD: auth-options.h,v 1.9 2001/06/26 06:32:47 itojun Exp $ */

#ifndef AUTH_OPTIONS_H
#define AUTH_OPTIONS_H
Expand All @@ -35,8 +35,7 @@ extern struct envstring *custom_environment;
* side effect: sets key option flags
*/
int
auth_parse_options(struct passwd *pw, char *options, char *file,
u_long linenum);
auth_parse_options(struct passwd *, char *, char *, u_long);

/* reset options flags */
void auth_clear_options(void);
Expand Down
56 changes: 27 additions & 29 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.19 2001/06/25 17:54:49 provos Exp $
* $OpenBSD: auth.h,v 1.20 2001/06/26 06:32:47 itojun Exp $
*/
#ifndef AUTH_H
#define AUTH_H
Expand Down Expand Up @@ -79,45 +79,44 @@ struct KbdintDevice
* 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 * pw, const char *client_user);
int auth_rhosts(struct passwd *, const char *);

/* extended interface similar to auth_rhosts() */
int
auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
const char *ipaddr);
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 * pw, const char *client_user, RSA* client_host_key);
auth_rhosts_rsa(struct passwd *, const char *, RSA *);

/*
* Tries to authenticate the user using password. Returns true if
* authentication succeeds.
*/
int auth_password(Authctxt *authctxt, const char *password);
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 * pw, BIGNUM * client_n);
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 **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n);
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 *pk);
int auth_rsa_challenge_dialog(RSA *);

#ifdef KRB4
#include <krb.h>
Expand All @@ -126,17 +125,17 @@ int auth_rsa_challenge_dialog(RSA *pk);
* 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(const char *server_user, KTEXT auth, char **client);
int krb4_init(uid_t uid);
void krb4_cleanup_proc(void *ignore);
int auth_krb4_password(struct passwd * pw, const char *password);
int auth_krb4(const char *, KTEXT, char **);
int krb4_init(uid_t);
void krb4_cleanup_proc(void *);
int auth_krb4_password(struct passwd *, const char *);

#ifdef AFS
#include <kafs.h>

/* Accept passed Kerberos v4 ticket-granting ticket and AFS tokens. */
int auth_kerberos_tgt(struct passwd * pw, const char *string);
int auth_afs_token(struct passwd * pw, const char *token_string);
int auth_kerberos_tgt(struct passwd *, const char *);
int auth_afs_token(struct passwd *, const char *);
#endif /* AFS */

#endif /* KRB4 */
Expand All @@ -145,33 +144,32 @@ void do_authentication(void);
void do_authentication2(void);

Authctxt *authctxt_new(void);
void auth_log(Authctxt *authctxt, int authenticated, char *method, char *info);
void userauth_finish(Authctxt *authctxt, int authenticated, char *method);
int auth_root_allowed(char *method);
void auth_log(Authctxt *, int, char *, char *);
void userauth_finish(Authctxt *, int, char *);
int auth_root_allowed(char *);

int auth2_challenge(Authctxt *authctxt, char *devs);
int auth2_challenge(Authctxt *, char *);

int allowed_user(struct passwd * pw);
int allowed_user(struct passwd *);

char *get_challenge(Authctxt *authctxt);
int verify_response(Authctxt *authctxt, const char *response);
char *get_challenge(Authctxt *);
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 *template, struct passwd *pw);
char *authorized_keys_file(struct passwd *pw);
char *authorized_keys_file2(struct passwd *pw);
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 *f, const char *file, struct passwd *pw,
char *err, size_t errlen);
secure_filename(FILE *, const char *, struct passwd *, char *, size_t);

/* helper for hostbased auth */
HostStatus
check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host,
const char *sysfile, const char *userfile);
check_key_in_hostfiles(struct passwd *, Key *, const char *,
const char *, const char *);

#define AUTH_FAIL_MAX 6
#define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2)
Expand Down
34 changes: 14 additions & 20 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.17 2001/06/26 04:59:59 markus Exp $"); */
/* RCSID("$OpenBSD: authfd.h,v 1.18 2001/06/26 06:32:47 itojun Exp $"); */

#ifndef AUTHFD_H
#define AUTHFD_H
Expand Down Expand Up @@ -62,7 +62,7 @@ int ssh_get_authentication_socket(void);
* ssh_get_authentication_socket(). Depending on the way the descriptor was
* obtained, this may close the descriptor.
*/
void ssh_close_authentication_socket(int authfd);
void ssh_close_authentication_socket(int);

/*
* Opens and connects a private socket for communication with the
Expand All @@ -76,69 +76,63 @@ AuthenticationConnection *ssh_get_authentication_connection(void);
* Closes the connection to the authentication agent and frees any associated
* memory.
*/
void ssh_close_authentication_connection(AuthenticationConnection *auth);
void ssh_close_authentication_connection(AuthenticationConnection *);

/*
* Returns the number authentication identity held by the agent.
*/
int ssh_get_num_identities(AuthenticationConnection *auth, int version);
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.
*/
Key *ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int version);
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 *auth, char **comment, int version);
Key *ssh_get_next_identity(AuthenticationConnection *, char **, 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 *auth,
Key *key, BIGNUM * challenge,
u_char session_id[16],
u_int response_type,
u_char response[16]);
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 *auth,
Key *key,
u_char **sigp, int *lenp,
u_char *data, int datalen);
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 *auth, Key *key,
const char *comment);
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 *auth, Key *key);
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 *auth, int version);
int ssh_remove_all_identities(AuthenticationConnection *, int);

int ssh_update_card(AuthenticationConnection *auth, int add, int reader_id);
int ssh_update_card(AuthenticationConnection *, int, int);

#endif /* AUTHFD_H */
15 changes: 6 additions & 9 deletions ssh/authfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,24 @@
* called by a name other than "ssh" or "Secure Shell".
*/

/* $OpenBSD: authfile.h,v 1.6 2001/03/26 08:07:08 markus Exp $ */
/* $OpenBSD: authfile.h,v 1.7 2001/06/26 06:32:48 itojun Exp $ */

#ifndef AUTHFILE_H
#define AUTHFILE_H

int
key_save_private(Key *key, const char *filename, const char *passphrase,
const char *comment);
key_save_private(Key *, const char *, const char *, const char *);

Key *
key_load_public(const char *filename, char **commentp);
key_load_public(const char *, char **);

Key *
key_load_public_type(int type, const char *filename, char **commentp);
key_load_public_type(int, const char *, char **);

Key *
key_load_private(const char *filename, const char *passphrase,
char **commentp);
key_load_private(const char *, const char *, char **);

Key *
key_load_private_type(int type, const char *filename, const char *passphrase,
char **commentp);
key_load_private_type(int, const char *, const char *, char **);

#endif
28 changes: 14 additions & 14 deletions ssh/bufaux.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* called by a name other than "ssh" or "Secure Shell".
*/

/* RCSID("$OpenBSD: bufaux.h,v 1.11 2001/01/21 19:05:45 markus Exp $"); */
/* RCSID("$OpenBSD: bufaux.h,v 1.12 2001/06/26 06:32:48 itojun Exp $"); */

#ifndef BUFAUX_H
#define BUFAUX_H
Expand All @@ -22,26 +22,26 @@
* 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 * buffer, BIGNUM * value);
void buffer_put_bignum2(Buffer * buffer, BIGNUM * value);
void buffer_put_bignum(Buffer *, BIGNUM *);
void buffer_put_bignum2(Buffer *, BIGNUM *);

/* Retrieves an BIGNUM from the buffer. */
int buffer_get_bignum(Buffer * buffer, BIGNUM * value);
int buffer_get_bignum2(Buffer *buffer, BIGNUM * value);
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 * buffer);
u_int64_t buffer_get_int64(Buffer *buffer);
u_int buffer_get_int(Buffer *);
u_int64_t buffer_get_int64(Buffer *);

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

/* Returns a character from the buffer (0 - 255). */
int buffer_get_char(Buffer * buffer);
int buffer_get_char(Buffer *);

/* Stores a character in the buffer. */
void buffer_put_char(Buffer * buffer, int value);
void buffer_put_char(Buffer *, int);

/*
* Returns an arbitrary binary string from the buffer. The string cannot be
Expand All @@ -51,10 +51,10 @@ void buffer_put_char(Buffer * buffer, int value);
* stored there. A null character will be automatically appended to the
* returned string, and is not counted in length.
*/
char *buffer_get_string(Buffer * buffer, u_int *length_ptr);
char *buffer_get_string(Buffer *, u_int *);

/* Stores and arbitrary binary string in the buffer. */
void buffer_put_string(Buffer * buffer, const void *buf, u_int len);
void buffer_put_cstring(Buffer *buffer, const char *s);
void buffer_put_string(Buffer *, const void *, u_int);
void buffer_put_cstring(Buffer *, const char *);

#endif /* BUFAUX_H */
Loading

0 comments on commit 09e5720

Please sign in to comment.