diff options
Diffstat (limited to 'usr.bin')
66 files changed, 495 insertions, 495 deletions
diff --git a/usr.bin/ssh/auth-krb4.c b/usr.bin/ssh/auth-krb4.c index 21a9625e356..80e8f4292c1 100644 --- a/usr.bin/ssh/auth-krb4.c +++ b/usr.bin/ssh/auth-krb4.c @@ -28,7 +28,7 @@ #include "ssh.h" #include "servconf.h" -RCSID("$OpenBSD: auth-krb4.c,v 1.19 2000/10/03 18:03:02 markus Exp $"); +RCSID("$OpenBSD: auth-krb4.c,v 1.20 2000/12/19 23:17:54 markus Exp $"); #ifdef KRB4 char *ticket = NULL; @@ -46,7 +46,7 @@ auth_krb4_password(struct passwd * pw, const char *password) AUTH_DAT adata; KTEXT_ST tkt; struct hostent *hp; - unsigned long faddr; + u_long faddr; char localhost[MAXHOSTNAMELEN]; char phost[INST_SZ]; char realm[REALM_SZ]; diff --git a/usr.bin/ssh/auth-options.c b/usr.bin/ssh/auth-options.c index 181bf73215e..c598f70df4c 100644 --- a/usr.bin/ssh/auth-options.c +++ b/usr.bin/ssh/auth-options.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-options.c,v 1.6 2000/11/15 22:31:36 markus Exp $"); +RCSID("$OpenBSD: auth-options.c,v 1.7 2000/12/19 23:17:54 markus Exp $"); #include "ssh.h" #include "packet.h" @@ -54,7 +54,7 @@ auth_clear_options(void) /* return 1 if access is granted, 0 if not. side effect: sets key option flags */ int -auth_parse_options(struct passwd *pw, char *options, unsigned long linenum) +auth_parse_options(struct passwd *pw, char *options, u_long linenum) { const char *cp; if (!options) diff --git a/usr.bin/ssh/auth-options.h b/usr.bin/ssh/auth-options.h index 00fae22307d..76d420d2333 100644 --- a/usr.bin/ssh/auth-options.h +++ b/usr.bin/ssh/auth-options.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* $OpenBSD: auth-options.h,v 1.5 2000/10/16 09:38:44 djm Exp $ */ +/* $OpenBSD: auth-options.h,v 1.6 2000/12/19 23:17:55 markus Exp $ */ #ifndef AUTH_OPTIONS_H #define AUTH_OPTIONS_H @@ -24,7 +24,7 @@ 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 *pw, char *options, unsigned long linenum); +int auth_parse_options(struct passwd *pw, char *options, u_long linenum); /* reset options flags */ void auth_clear_options(void); diff --git a/usr.bin/ssh/auth-rhosts.c b/usr.bin/ssh/auth-rhosts.c index 8314e23a100..fb7dabe7aa3 100644 --- a/usr.bin/ssh/auth-rhosts.c +++ b/usr.bin/ssh/auth-rhosts.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rhosts.c,v 1.16 2000/10/03 18:03:03 markus Exp $"); +RCSID("$OpenBSD: auth-rhosts.c,v 1.17 2000/12/19 23:17:55 markus Exp $"); #include "packet.h" #include "ssh.h" @@ -152,7 +152,7 @@ auth_rhosts(struct passwd *pw, const char *client_user) const char *hostname, *ipaddr; struct stat st; static const char *rhosts_files[] = {".shosts", ".rhosts", NULL}; - unsigned int rhosts_file_index; + u_int rhosts_file_index; /* no user given */ if (pw == NULL) diff --git a/usr.bin/ssh/auth-rsa.c b/usr.bin/ssh/auth-rsa.c index 72cb909d746..3daf4d13c56 100644 --- a/usr.bin/ssh/auth-rsa.c +++ b/usr.bin/ssh/auth-rsa.c @@ -14,7 +14,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth-rsa.c,v 1.33 2000/11/14 23:42:40 markus Exp $"); +RCSID("$OpenBSD: auth-rsa.c,v 1.34 2000/12/19 23:17:55 markus Exp $"); #include "rsa.h" #include "packet.h" @@ -37,7 +37,7 @@ extern ServerOptions options; * Session identifier that is used to bind key exchange and authentication * responses to a particular session. */ -extern unsigned char session_id[16]; +extern u_char session_id[16]; /* * The .ssh/authorized_keys file contains public keys, one per line, in the @@ -60,9 +60,9 @@ auth_rsa_challenge_dialog(RSA *pk) { BIGNUM *challenge, *encrypted_challenge; BN_CTX *ctx; - unsigned char buf[32], mdbuf[16], response[16]; + u_char buf[32], mdbuf[16], response[16]; MD5_CTX md; - unsigned int i; + u_int i; int plen, len; encrypted_challenge = BN_new(); @@ -122,9 +122,9 @@ auth_rsa(struct passwd *pw, BIGNUM *client_n) { char line[8192], file[1024]; int authenticated; - unsigned int bits; + u_int bits; FILE *f; - unsigned long linenum = 0; + u_long linenum = 0; struct stat st; RSA *pk; diff --git a/usr.bin/ssh/auth1.c b/usr.bin/ssh/auth1.c index 15d6d542712..c98c2651b01 100644 --- a/usr.bin/ssh/auth1.c +++ b/usr.bin/ssh/auth1.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth1.c,v 1.7 2000/11/10 01:04:40 markus Exp $"); +RCSID("$OpenBSD: auth1.c,v 1.8 2000/12/19 23:17:55 markus Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -68,14 +68,14 @@ do_authloop(struct passwd * pw, char *luser) { int authenticated = 0; int attempt = 0; - unsigned int bits; + u_int bits; RSA *client_host_key; BIGNUM *n; char *client_user, *password; char user[1024]; - unsigned int dlen; + u_int dlen; int plen, nlen, elen; - unsigned int ulen; + u_int ulen; int type = 0; void (*authlog) (const char *fmt,...) = verbose; @@ -134,7 +134,7 @@ do_authloop(struct passwd * pw, char *luser) /* Try Kerberos v4 authentication. */ KTEXT_ST auth; char *tkt_user = NULL; - char *kdata = packet_get_string((unsigned int *) &auth.length); + char *kdata = packet_get_string((u_int *) &auth.length); packet_integrity_check(plen, 4 + auth.length, type); if (auth.length < MAX_KTXT_LEN) @@ -346,7 +346,7 @@ do_authentication() { struct passwd *pw, pwcopy; int plen; - unsigned int ulen; + u_int ulen; char *user; /* Get the name of the user that we wish to log in as. */ diff --git a/usr.bin/ssh/auth2-skey.c b/usr.bin/ssh/auth2-skey.c index 9de08fc09cf..26a01f840c8 100644 --- a/usr.bin/ssh/auth2-skey.c +++ b/usr.bin/ssh/auth2-skey.c @@ -1,5 +1,5 @@ #include "includes.h" -RCSID("$OpenBSD: auth2-skey.c,v 1.1 2000/10/11 20:14:38 markus Exp $"); +RCSID("$OpenBSD: auth2-skey.c,v 1.2 2000/12/19 23:17:55 markus Exp $"); #include "ssh.h" #include "ssh2.h" @@ -61,7 +61,7 @@ input_userauth_info_response(int type, int plen, void *ctxt) { Authctxt *authctxt = ctxt; int authenticated = 0; - unsigned int nresp, rlen; + u_int nresp, rlen; char *resp, *method; if (authctxt == NULL) diff --git a/usr.bin/ssh/auth2.c b/usr.bin/ssh/auth2.c index c4c12783cc1..8abe1006f0a 100644 --- a/usr.bin/ssh/auth2.c +++ b/usr.bin/ssh/auth2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: auth2.c,v 1.22 2000/12/03 11:15:02 markus Exp $"); +RCSID("$OpenBSD: auth2.c,v 1.23 2000/12/19 23:17:55 markus Exp $"); #include <openssl/dsa.h> #include <openssl/rsa.h> @@ -52,7 +52,7 @@ RCSID("$OpenBSD: auth2.c,v 1.22 2000/12/03 11:15:02 markus Exp $"); /* import */ extern ServerOptions options; -extern unsigned char *session_id2; +extern u_char *session_id2; extern int session_id2_len; static Authctxt *x_authctxt = NULL; @@ -138,7 +138,7 @@ void input_service_request(int type, int plen, void *ctxt) { Authctxt *authctxt = ctxt; - unsigned int len; + u_int len; int accept = 0; char *service = packet_get_string(&len); packet_done(); @@ -315,7 +315,7 @@ userauth_passwd(Authctxt *authctxt) char *password; int authenticated = 0; int change; - unsigned int len; + u_int len; change = packet_get_char(); if (change) log("password change not supported"); @@ -357,7 +357,7 @@ userauth_pubkey(Authctxt *authctxt) Buffer b; Key *key; char *pkalg, *pkblob, *sig; - unsigned int alen, blen, slen; + u_int alen, blen, slen; int have_sig, pktype; int authenticated = 0; @@ -467,7 +467,7 @@ char * authmethods_get(void) { Authmethod *method = NULL; - unsigned int size = 0; + u_int size = 0; char *list; for (method = authmethods; method->name != NULL; method++) { @@ -516,7 +516,7 @@ user_key_allowed(struct passwd *pw, Key *key) char line[8192], file[1024]; int found_key = 0; FILE *f; - unsigned long linenum = 0; + u_long linenum = 0; struct stat st; Key *found; diff --git a/usr.bin/ssh/authfd.c b/usr.bin/ssh/authfd.c index e48d8ff4773..7cc9dddcab2 100644 --- a/usr.bin/ssh/authfd.c +++ b/usr.bin/ssh/authfd.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.30 2000/11/12 19:50:37 markus Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.31 2000/12/19 23:17:55 markus Exp $"); #include "ssh.h" #include "rsa.h" @@ -268,9 +268,9 @@ ssh_get_first_identity(AuthenticationConnection *auth, char **comment, int versi Key * ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int version) { - unsigned int bits; - unsigned char *blob; - unsigned int blen; + u_int bits; + u_char *blob; + u_int blen; Key *key = NULL; /* Return failure if no more entries. */ @@ -318,9 +318,9 @@ ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int versio int ssh_decrypt_challenge(AuthenticationConnection *auth, Key* key, BIGNUM *challenge, - unsigned char session_id[16], - unsigned int response_type, - unsigned char response[16]) + u_char session_id[16], + u_int response_type, + u_char response[16]) { Buffer buffer; int success = 0; @@ -369,13 +369,13 @@ ssh_decrypt_challenge(AuthenticationConnection *auth, int ssh_agent_sign(AuthenticationConnection *auth, Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen) + u_char **sigp, int *lenp, + u_char *data, int datalen) { extern int datafellows; Buffer msg; - unsigned char *blob; - unsigned int blen; + u_char *blob; + u_int blen; int type, flags = 0; int ret = -1; @@ -498,8 +498,8 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key) { Buffer msg; int type; - unsigned char *blob; - unsigned int blen; + u_char *blob; + u_int blen; buffer_init(&msg); diff --git a/usr.bin/ssh/authfd.h b/usr.bin/ssh/authfd.h index 65471ad7c21..2900b6c4854 100644 --- a/usr.bin/ssh/authfd.h +++ b/usr.bin/ssh/authfd.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: authfd.h,v 1.14 2000/11/12 19:50:37 markus Exp $"); */ +/* RCSID("$OpenBSD: authfd.h,v 1.15 2000/12/19 23:17:55 markus Exp $"); */ #ifndef AUTHFD_H #define AUTHFD_H @@ -101,16 +101,16 @@ Key *ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int v int ssh_decrypt_challenge(AuthenticationConnection *auth, Key *key, BIGNUM * challenge, - unsigned char session_id[16], - unsigned int response_type, - unsigned char response[16]); + u_char session_id[16], + u_int response_type, + u_char response[16]); /* Requests the agent to sign data using key */ int ssh_agent_sign(AuthenticationConnection *auth, Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen); + u_char **sigp, int *lenp, + u_char *data, int datalen); /* * Adds an identity to the authentication server. This call is not meant to diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c index 5b04cb46c0e..fe1f8e64be7 100644 --- a/usr.bin/ssh/authfile.c +++ b/usr.bin/ssh/authfile.c @@ -36,7 +36,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfile.c,v 1.22 2000/12/19 22:43:44 markus Exp $"); +RCSID("$OpenBSD: authfile.c,v 1.23 2000/12/19 23:17:55 markus Exp $"); #include <openssl/bn.h> #include <openssl/dsa.h> @@ -131,8 +131,8 @@ save_private_key_rsa1(const char *filename, const char *passphrase, buffer_append_space(&encrypted, &cp, buffer_len(&buffer)); cipher_set_key_string(&ciphercontext, cipher, passphrase); - cipher_encrypt(&ciphercontext, (unsigned char *) cp, - (unsigned char *) buffer_ptr(&buffer), buffer_len(&buffer)); + cipher_encrypt(&ciphercontext, (u_char *) cp, + (u_char *) buffer_ptr(&buffer), buffer_len(&buffer)); memset(&ciphercontext, 0, sizeof(ciphercontext)); /* Destroy temporary data. */ @@ -258,7 +258,7 @@ load_public_key_rsa(const char *filename, RSA * pub, char **comment_return) * Make sure it begins with the id string. Consume the id string * from the buffer. */ - for (i = 0; i < (unsigned int) strlen(AUTHFILE_ID_STRING) + 1; i++) + for (i = 0; i < (u_int) strlen(AUTHFILE_ID_STRING) + 1; i++) if (buffer_get_char(&buffer) != (u_char) AUTHFILE_ID_STRING[i]) { debug3("Bad RSA1 key file %.200s.", filename); buffer_free(&buffer); @@ -348,7 +348,7 @@ load_private_key_rsa1(int fd, const char *filename, * Make sure it begins with the id string. Consume the id string * from the buffer. */ - for (i = 0; i < (unsigned int) strlen(AUTHFILE_ID_STRING) + 1; i++) + for (i = 0; i < (u_int) strlen(AUTHFILE_ID_STRING) + 1; i++) if (buffer_get_char(&buffer) != (u_char) AUTHFILE_ID_STRING[i]) { debug3("Bad RSA1 key file %.200s.", filename); buffer_free(&buffer); @@ -383,8 +383,8 @@ load_private_key_rsa1(int fd, const char *filename, /* Rest of the buffer is encrypted. Decrypt it using the passphrase. */ cipher_set_key_string(&ciphercontext, cipher, passphrase); - cipher_decrypt(&ciphercontext, (unsigned char *) cp, - (unsigned char *) buffer_ptr(&buffer), buffer_len(&buffer)); + cipher_decrypt(&ciphercontext, (u_char *) cp, + (u_char *) buffer_ptr(&buffer), buffer_len(&buffer)); memset(&ciphercontext, 0, sizeof(ciphercontext)); buffer_free(&buffer); diff --git a/usr.bin/ssh/bufaux.c b/usr.bin/ssh/bufaux.c index a3f220f89eb..5853ee6003d 100644 --- a/usr.bin/ssh/bufaux.c +++ b/usr.bin/ssh/bufaux.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: bufaux.c,v 1.13 2000/09/07 20:27:50 deraadt Exp $"); +RCSID("$OpenBSD: bufaux.c,v 1.14 2000/12/19 23:17:55 markus Exp $"); #include "ssh.h" #include <openssl/bn.h> @@ -54,7 +54,7 @@ buffer_put_bignum(Buffer *buffer, BIGNUM *value) { int bits = BN_num_bits(value); int bin_size = (bits + 7) / 8; - char unsigned *buf = xmalloc(bin_size); + u_char *buf = xmalloc(bin_size); int oi; char msg[2]; @@ -81,7 +81,7 @@ int buffer_get_bignum(Buffer *buffer, BIGNUM *value) { int bits, bytes; - unsigned char buf[2], *bin; + u_char buf[2], *bin; /* Get the number for bits. */ buffer_get(buffer, (char *) buf, 2); @@ -90,7 +90,7 @@ buffer_get_bignum(Buffer *buffer, BIGNUM *value) bytes = (bits + 7) / 8; if (buffer_len(buffer) < bytes) fatal("buffer_get_bignum: input buffer too small"); - bin = (unsigned char*) buffer_ptr(buffer); + bin = (u_char*) buffer_ptr(buffer); BN_bin2bn(bin, bytes, value); buffer_consume(buffer, bytes); @@ -104,7 +104,7 @@ void buffer_put_bignum2(Buffer *buffer, BIGNUM *value) { int bytes = BN_num_bytes(value) + 1; - unsigned char *buf = xmalloc(bytes); + u_char *buf = xmalloc(bytes); int oi; int hasnohigh = 0; buf[0] = '\0'; @@ -117,7 +117,7 @@ buffer_put_bignum2(Buffer *buffer, BIGNUM *value) if (value->neg) { /**XXX should be two's-complement */ int i, carry; - unsigned char *uc = buf; + u_char *uc = buf; log("negativ!"); for(i = bytes-1, carry = 1; i>=0; i--) { uc[i] ^= 0xff; @@ -135,7 +135,7 @@ buffer_get_bignum2(Buffer *buffer, BIGNUM *value) { /**XXX should be two's-complement */ int len; - unsigned char *bin = (unsigned char *)buffer_get_string(buffer, (unsigned int *)&len); + u_char *bin = (u_char *)buffer_get_string(buffer, (u_int *)&len); BN_bin2bn(bin, len, value); xfree(bin); return len; @@ -144,10 +144,10 @@ buffer_get_bignum2(Buffer *buffer, BIGNUM *value) /* * Returns an integer from the buffer (4 bytes, msb first). */ -unsigned int +u_int buffer_get_int(Buffer *buffer) { - unsigned char buf[4]; + u_char buf[4]; buffer_get(buffer, (char *) buf, 4); return GET_32BIT(buf); } @@ -156,7 +156,7 @@ buffer_get_int(Buffer *buffer) * Stores an integer in the buffer in 4 bytes, msb first. */ void -buffer_put_int(Buffer *buffer, unsigned int value) +buffer_put_int(Buffer *buffer, u_int value) { char buf[4]; PUT_32BIT(buf, value); @@ -172,9 +172,9 @@ buffer_put_int(Buffer *buffer, unsigned int value) * to the returned string, and is not counted in length. */ char * -buffer_get_string(Buffer *buffer, unsigned int *length_ptr) +buffer_get_string(Buffer *buffer, u_int *length_ptr) { - unsigned int len; + u_int len; char *value; /* Get the length. */ len = buffer_get_int(buffer); @@ -196,7 +196,7 @@ buffer_get_string(Buffer *buffer, unsigned int *length_ptr) * Stores and arbitrary binary string in the buffer. */ void -buffer_put_string(Buffer *buffer, const void *buf, unsigned int len) +buffer_put_string(Buffer *buffer, const void *buf, u_int len) { buffer_put_int(buffer, len); buffer_append(buffer, buf, len); @@ -215,7 +215,7 @@ buffer_get_char(Buffer *buffer) { char ch; buffer_get(buffer, &ch, 1); - return (unsigned char) ch; + return (u_char) ch; } /* diff --git a/usr.bin/ssh/bufaux.h b/usr.bin/ssh/bufaux.h index 4f53858f75b..6c73d4fb3c2 100644 --- a/usr.bin/ssh/bufaux.h +++ b/usr.bin/ssh/bufaux.h @@ -10,7 +10,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: bufaux.h,v 1.8 2000/09/07 20:27:50 deraadt Exp $"); */ +/* RCSID("$OpenBSD: bufaux.h,v 1.9 2000/12/19 23:17:55 markus Exp $"); */ #ifndef BUFAUX_H #define BUFAUX_H @@ -29,10 +29,10 @@ int buffer_get_bignum(Buffer * buffer, BIGNUM * value); int buffer_get_bignum2(Buffer *buffer, BIGNUM * value); /* Returns an integer from the buffer (4 bytes, msb first). */ -unsigned int buffer_get_int(Buffer * buffer); +u_int buffer_get_int(Buffer * buffer); /* Stores an integer in the buffer in 4 bytes, msb first. */ -void buffer_put_int(Buffer * buffer, unsigned int value); +void buffer_put_int(Buffer * buffer, u_int value); /* Returns a character from the buffer (0 - 255). */ int buffer_get_char(Buffer * buffer); @@ -48,10 +48,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, unsigned int *length_ptr); +char *buffer_get_string(Buffer * buffer, u_int *length_ptr); /* Stores and arbitrary binary string in the buffer. */ -void buffer_put_string(Buffer * buffer, const void *buf, unsigned int len); +void buffer_put_string(Buffer * buffer, const void *buf, u_int len); void buffer_put_cstring(Buffer *buffer, const char *s); #endif /* BUFAUX_H */ diff --git a/usr.bin/ssh/buffer.c b/usr.bin/ssh/buffer.c index d993c8bcdef..668c173839f 100644 --- a/usr.bin/ssh/buffer.c +++ b/usr.bin/ssh/buffer.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: buffer.c,v 1.8 2000/09/07 20:27:50 deraadt Exp $"); +RCSID("$OpenBSD: buffer.c,v 1.9 2000/12/19 23:17:55 markus Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -53,7 +53,7 @@ buffer_clear(Buffer *buffer) /* Appends data to the buffer, expanding it if necessary. */ void -buffer_append(Buffer *buffer, const char *data, unsigned int len) +buffer_append(Buffer *buffer, const char *data, u_int len) { char *cp; buffer_append_space(buffer, &cp, len); @@ -67,7 +67,7 @@ buffer_append(Buffer *buffer, const char *data, unsigned int len) */ void -buffer_append_space(Buffer *buffer, char **datap, unsigned int len) +buffer_append_space(Buffer *buffer, char **datap, u_int len) { /* If the buffer is empty, start using it from the beginning. */ if (buffer->offset == buffer->end) { @@ -100,7 +100,7 @@ restart: /* Returns the number of bytes of data in the buffer. */ -unsigned int +u_int buffer_len(Buffer *buffer) { return buffer->end - buffer->offset; @@ -109,7 +109,7 @@ buffer_len(Buffer *buffer) /* Gets data from the beginning of the buffer. */ void -buffer_get(Buffer *buffer, char *buf, unsigned int len) +buffer_get(Buffer *buffer, char *buf, u_int len) { if (len > buffer->end - buffer->offset) fatal("buffer_get: trying to get more bytes than in buffer"); @@ -120,7 +120,7 @@ buffer_get(Buffer *buffer, char *buf, unsigned int len) /* Consumes the given number of bytes from the beginning of the buffer. */ void -buffer_consume(Buffer *buffer, unsigned int bytes) +buffer_consume(Buffer *buffer, u_int bytes) { if (bytes > buffer->end - buffer->offset) fatal("buffer_consume: trying to get more bytes than in buffer"); @@ -130,7 +130,7 @@ buffer_consume(Buffer *buffer, unsigned int bytes) /* Consumes the given number of bytes from the end of the buffer. */ void -buffer_consume_end(Buffer *buffer, unsigned int bytes) +buffer_consume_end(Buffer *buffer, u_int bytes) { if (bytes > buffer->end - buffer->offset) fatal("buffer_consume_end: trying to get more bytes than in buffer"); @@ -151,7 +151,7 @@ void buffer_dump(Buffer *buffer) { int i; - unsigned char *ucp = (unsigned char *) buffer->buf; + u_char *ucp = (u_char *) buffer->buf; for (i = buffer->offset; i < buffer->end; i++) fprintf(stderr, " %02x", ucp[i]); diff --git a/usr.bin/ssh/buffer.h b/usr.bin/ssh/buffer.h index 522036a4144..f3c509dfadb 100644 --- a/usr.bin/ssh/buffer.h +++ b/usr.bin/ssh/buffer.h @@ -11,16 +11,16 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: buffer.h,v 1.6 2000/09/07 20:27:50 deraadt Exp $"); */ +/* RCSID("$OpenBSD: buffer.h,v 1.7 2000/12/19 23:17:55 markus Exp $"); */ #ifndef BUFFER_H #define BUFFER_H typedef struct { char *buf; /* Buffer for data. */ - unsigned int alloc; /* Number of bytes allocated for data. */ - unsigned int offset; /* Offset of first byte containing data. */ - unsigned int end; /* Offset of last byte containing 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 * buffer); @@ -33,26 +33,26 @@ void buffer_free(Buffer * buffer); void buffer_clear(Buffer * buffer); /* Appends data to the buffer, expanding it if necessary. */ -void buffer_append(Buffer * buffer, const char *data, unsigned int len); +void buffer_append(Buffer * buffer, const char *data, u_int len); /* * 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 * buffer, char **datap, unsigned int len); +void buffer_append_space(Buffer * buffer, char **datap, u_int len); /* Returns the number of bytes of data in the buffer. */ -unsigned int buffer_len(Buffer * buffer); +u_int buffer_len(Buffer * buffer); /* Gets data from the beginning of the buffer. */ -void buffer_get(Buffer * buffer, char *buf, unsigned int len); +void buffer_get(Buffer * buffer, char *buf, u_int len); /* Consumes the given number of bytes from the beginning of the buffer. */ -void buffer_consume(Buffer * buffer, unsigned int bytes); +void buffer_consume(Buffer * buffer, u_int bytes); /* Consumes the given number of bytes from the end of the buffer. */ -void buffer_consume_end(Buffer * buffer, unsigned int bytes); +void buffer_consume_end(Buffer * buffer, u_int bytes); /* Returns a pointer to the first used byte in the buffer. */ char *buffer_ptr(Buffer * buffer); diff --git a/usr.bin/ssh/canohost.c b/usr.bin/ssh/canohost.c index 1f4e9ad7c06..01823fb9167 100644 --- a/usr.bin/ssh/canohost.c +++ b/usr.bin/ssh/canohost.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: canohost.c,v 1.16 2000/10/21 17:04:22 markus Exp $"); +RCSID("$OpenBSD: canohost.c,v 1.17 2000/12/19 23:17:55 markus Exp $"); #include "packet.h" #include "xmalloc.h" @@ -112,7 +112,7 @@ check_ip_options: */ /* IP options -- IPv4 only */ if (from.ss_family == AF_INET) { - unsigned char options[200], *ucp; + u_char options[200], *ucp; char text[1024], *cp; socklen_t option_size; int ipproto; diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index 09659b0cedd..c8efc4969fc 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.76 2000/12/19 22:43:44 markus Exp $"); +RCSID("$OpenBSD: channels.c,v 1.77 2000/12/19 23:17:56 markus Exp $"); #include "ssh.h" #include "packet.h" @@ -95,14 +95,14 @@ char *x11_saved_proto = NULL; /* Saved X11 authentication data. This is the real data. */ char *x11_saved_data = NULL; -unsigned int x11_saved_data_len = 0; +u_int x11_saved_data_len = 0; /* * Fake X11 authentication data. This is what the server will be sending us; * we should replace any occurrences of this by the real data. */ char *x11_fake_data = NULL; -unsigned int x11_fake_data_len; +u_int x11_fake_data_len; /* * Data structure for storing which hosts are permitted for forward requests. @@ -436,15 +436,15 @@ channel_pre_output_draining(Channel *c, fd_set * readset, fd_set * writeset) int x11_open_helper(Channel *c) { - unsigned char *ucp; - unsigned int proto_len, data_len; + u_char *ucp; + u_int proto_len, data_len; /* Check if the fixed size part of the packet is in buffer. */ if (buffer_len(&c->output) < 12) return 0; /* Parse the lengths of variable-length fields. */ - ucp = (unsigned char *) buffer_ptr(&c->output); + ucp = (u_char *) buffer_ptr(&c->output); if (ucp[0] == 0x42) { /* Byte order MSB first. */ proto_len = 256 * ucp[6] + ucp[7]; data_len = 256 * ucp[8] + ucp[9]; @@ -1066,7 +1066,7 @@ channel_input_data(int type, int plen, void *ctxt) { int id; char *data; - unsigned int data_len; + u_int data_len; Channel *c; /* Get the channel number and verify it. */ @@ -1112,7 +1112,7 @@ channel_input_extended_data(int type, int plen, void *ctxt) int id; int tcode; char *data; - unsigned int data_len; + u_int data_len; Channel *c; /* Get the channel number and verify it. */ @@ -1155,7 +1155,7 @@ channel_input_extended_data(int type, int plen, void *ctxt) int channel_not_very_much_buffered_data() { - unsigned int i; + u_int i; Channel *c; for (i = 0; i < channels_alloc; i++) { @@ -1423,7 +1423,7 @@ channel_max_fd() int channel_still_open() { - unsigned int i; + u_int i; for (i = 0; i < channels_alloc; i++) switch (channels[i].type) { case SSH_CHANNEL_FREE: @@ -1780,7 +1780,7 @@ channel_input_port_open(int type, int plen, void *ctxt) u_short host_port; char *host, *originator_string; int remote_channel, sock = -1, newch, i, denied; - unsigned int host_len, originator_len; + u_int host_len, originator_len; /* Get remote channel number. */ remote_channel = packet_get_int(); @@ -1938,7 +1938,7 @@ x11_create_display_inet(int screen_number, int x11_display_offset) static int -connect_local_xsocket(unsigned int dnr) +connect_local_xsocket(u_int dnr) { static const char *const x_sockets[] = { X_UNIX_PATH "%u", @@ -2071,7 +2071,7 @@ x11_input_open(int type, int plen, void *ctxt) { int remote_channel, sock = 0, newch; char *remote_host; - unsigned int remote_len; + u_int remote_len; /* Get remote channel number. */ remote_channel = packet_get_int(); @@ -2142,8 +2142,8 @@ void x11_request_forwarding_with_spoofing(int client_session_id, const char *proto, const char *data) { - unsigned int data_len = (unsigned int) strlen(data) / 2; - unsigned int i, value; + u_int data_len = (u_int) strlen(data) / 2; + u_int i, value; char *new_data; int screen_number; const char *cp; @@ -2183,7 +2183,7 @@ x11_request_forwarding_with_spoofing(int client_session_id, /* Convert the fake data into hex. */ new_data = xmalloc(2 * data_len + 1); for (i = 0; i < data_len; i++) - sprintf(new_data + 2 * i, "%02x", (unsigned char) x11_fake_data[i]); + sprintf(new_data + 2 * i, "%02x", (u_char) x11_fake_data[i]); /* Send the request packet. */ if (compat20) { diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c index 788028c1353..89e3c279fcc 100644 --- a/usr.bin/ssh/cipher.c +++ b/usr.bin/ssh/cipher.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.40 2000/12/09 13:41:52 markus Exp $"); +RCSID("$OpenBSD: cipher.c,v 1.41 2000/12/19 23:17:56 markus Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -177,7 +177,7 @@ des3_ssh1_decrypt(CipherContext *cc, u_char *dest, const u_char *src, void blowfish_setkey(CipherContext *cc, const u_char *key, u_int keylen) { - BF_set_key(&cc->u.bf.key, keylen, (unsigned char *)key); + BF_set_key(&cc->u.bf.key, keylen, (u_char *)key); } void blowfish_setiv(CipherContext *cc, const u_char *iv, u_int ivlen) @@ -207,7 +207,7 @@ blowfish_cbc_decrypt(CipherContext *cc, u_char *dest, const u_char *src, * and after encryption/decryption. Thus the swap_bytes stuff (yuk). */ static void -swap_bytes(const unsigned char *src, unsigned char *dst, int n) +swap_bytes(const u_char *src, u_char *dst, int n) { char c[4]; @@ -260,7 +260,7 @@ arcfour_crypt(CipherContext *cc, u_char *dest, const u_char *src, u_int len) void cast_setkey(CipherContext *cc, const u_char *key, u_int keylen) { - CAST_set_key(&cc->u.cast.key, keylen, (unsigned char *) key); + CAST_set_key(&cc->u.cast.key, keylen, (u_char *) key); } void cast_setiv(CipherContext *cc, const u_char *iv, u_int ivlen) @@ -419,10 +419,10 @@ Cipher ciphers[] = { /*--*/ -unsigned int +u_int cipher_mask_ssh1(int client) { - unsigned int mask = 0; + u_int mask = 0; mask |= 1 << SSH_CIPHER_3DES; /* Mandatory */ mask |= 1 << SSH_CIPHER_BLOWFISH; if (client) { @@ -541,7 +541,7 @@ cipher_set_key_string(CipherContext *cc, Cipher *cipher, const char *passphrase) { MD5_CTX md; - unsigned char digest[16]; + u_char digest[16]; MD5_Init(&md); MD5_Update(&md, (const u_char *)passphrase, strlen(passphrase)); diff --git a/usr.bin/ssh/cipher.h b/usr.bin/ssh/cipher.h index 752d0347e13..6d929aaff2a 100644 --- a/usr.bin/ssh/cipher.h +++ b/usr.bin/ssh/cipher.h @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* RCSID("$OpenBSD: cipher.h,v 1.24 2000/12/09 13:41:52 markus Exp $"); */ +/* RCSID("$OpenBSD: cipher.h,v 1.25 2000/12/19 23:17:56 markus Exp $"); */ #ifndef CIPHER_H #define CIPHER_H @@ -103,7 +103,7 @@ struct Cipher { void (*decrypt)(CipherContext *, u_char *, const u_char *, u_int); }; -unsigned int cipher_mask_ssh1(int client); +u_int cipher_mask_ssh1(int client); Cipher *cipher_by_name(const char *name); Cipher *cipher_by_number(int id); int cipher_number(const char *name); diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 3a0f977b090..44a79d0e08d 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.41 2000/12/05 20:34:10 markus Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.42 2000/12/19 23:17:56 markus Exp $"); #include "xmalloc.h" #include "ssh.h" @@ -123,8 +123,8 @@ static int stdin_eof; /* EOF has been encountered on standard error. */ static Buffer stdin_buffer; /* Buffer for stdin data. */ static Buffer stdout_buffer; /* Buffer for stdout data. */ static Buffer stderr_buffer; /* Buffer for stderr data. */ -static unsigned long stdin_bytes, stdout_bytes, stderr_bytes; -static unsigned int buffer_high;/* Soft max buffer size. */ +static u_long stdin_bytes, stdout_bytes, stderr_bytes; +static u_int buffer_high;/* Soft max buffer size. */ static int max_fd; /* Maximum file descriptor number in select(). */ static int connection_in; /* Connection to server (input). */ static int connection_out; /* Connection to server (output). */ @@ -280,7 +280,7 @@ client_check_initial_eof_on_stdin() * and also process it as an escape character if * appropriate. */ - if ((unsigned char) buf[0] == escape_char) + if ((u_char) buf[0] == escape_char) escape_pending = 1; else { buffer_append(&stdin_buffer, buf, 1); @@ -300,7 +300,7 @@ client_check_initial_eof_on_stdin() void client_make_packets_from_stdin_data() { - unsigned int len; + u_int len; /* Send buffered stdin data to the server. */ while (buffer_len(&stdin_buffer) > 0 && @@ -522,8 +522,8 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len) char string[1024]; pid_t pid; int bytes = 0; - unsigned int i; - unsigned char ch; + u_int i; + u_char ch; char *s; for (i = 0; i < len; i++) { @@ -984,7 +984,7 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) void client_input_stdout_data(int type, int plen, void *ctxt) { - unsigned int data_len; + u_int data_len; char *data = packet_get_string(&data_len); packet_integrity_check(plen, 4 + data_len, type); buffer_append(&stdout_buffer, data, data_len); @@ -995,7 +995,7 @@ client_input_stdout_data(int type, int plen, void *ctxt) void client_input_stderr_data(int type, int plen, void *ctxt) { - unsigned int data_len; + u_int data_len; char *data = packet_get_string(&data_len); packet_integrity_check(plen, 4 + data_len, type); buffer_append(&stderr_buffer, data, data_len); @@ -1113,7 +1113,7 @@ client_input_channel_open(int type, int plen, void *ctxt) { Channel *c = NULL; char *ctype; - unsigned int len; + u_int len; int rchan; int rmaxpack; int rwindow; @@ -1213,7 +1213,7 @@ void client_input_channel_req(int id, void *arg) { Channel *c = NULL; - unsigned int len; + u_int len; int success = 0; int reply; char *rtype; diff --git a/usr.bin/ssh/compress.c b/usr.bin/ssh/compress.c index 93266ed9f35..3c05886e10a 100644 --- a/usr.bin/ssh/compress.c +++ b/usr.bin/ssh/compress.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: compress.c,v 1.9 2000/09/07 20:27:50 deraadt Exp $"); +RCSID("$OpenBSD: compress.c,v 1.10 2000/12/19 23:17:56 markus Exp $"); #include "ssh.h" #include "buffer.h" @@ -73,13 +73,13 @@ buffer_compress(Buffer * input_buffer, Buffer * output_buffer) return; /* Input is the contents of the input buffer. */ - outgoing_stream.next_in = (unsigned char *) buffer_ptr(input_buffer); + outgoing_stream.next_in = (u_char *) buffer_ptr(input_buffer); outgoing_stream.avail_in = buffer_len(input_buffer); /* Loop compressing until deflate() returns with avail_out != 0. */ do { /* Set up fixed-size output buffer. */ - outgoing_stream.next_out = (unsigned char *)buf; + outgoing_stream.next_out = (u_char *)buf; outgoing_stream.avail_out = sizeof(buf); /* Compress as much data into the buffer as possible. */ @@ -112,12 +112,12 @@ buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer) char buf[4096]; int status; - incoming_stream.next_in = (unsigned char *) buffer_ptr(input_buffer); + incoming_stream.next_in = (u_char *) buffer_ptr(input_buffer); incoming_stream.avail_in = buffer_len(input_buffer); for (;;) { /* Set up fixed-size output buffer. */ - incoming_stream.next_out = (unsigned char *) buf; + incoming_stream.next_out = (u_char *) buf; incoming_stream.avail_out = sizeof(buf); status = inflate(&incoming_stream, Z_PARTIAL_FLUSH); diff --git a/usr.bin/ssh/crc32.c b/usr.bin/ssh/crc32.c index a4e1f27b096..4774c8ba119 100644 --- a/usr.bin/ssh/crc32.c +++ b/usr.bin/ssh/crc32.c @@ -31,7 +31,7 @@ * tions for all combinations of data and CRC register values * * The values must be right-shifted by eight bits by the "updcrc - * logic; the shift must be unsigned (bring in zeroes). On some + * logic; the shift must be u_(bring in zeroes). On some * hardware you could probably optimize the shift in assembler by * using byte-swap instructions * polynomial $edb88320 @@ -39,11 +39,11 @@ #include "includes.h" -RCSID("$OpenBSD: crc32.c,v 1.7 2000/09/07 20:27:51 deraadt Exp $"); +RCSID("$OpenBSD: crc32.c,v 1.8 2000/12/19 23:17:56 markus Exp $"); #include "crc32.h" -static unsigned int crc32_tab[] = { +static u_int crc32_tab[] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, @@ -100,11 +100,11 @@ static unsigned int crc32_tab[] = { /* Return a 32-bit CRC of the contents of the buffer. */ -unsigned int -ssh_crc32(const unsigned char *s, unsigned int len) +u_int +ssh_crc32(const u_char *s, u_int len) { - unsigned int i; - unsigned int crc32val; + u_int i; + u_int crc32val; crc32val = 0; for (i = 0; i < len; i ++) { diff --git a/usr.bin/ssh/crc32.h b/usr.bin/ssh/crc32.h index 58c4fbacdac..88e7869893f 100644 --- a/usr.bin/ssh/crc32.h +++ b/usr.bin/ssh/crc32.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: crc32.h,v 1.8 2000/09/07 20:27:51 deraadt Exp $"); */ +/* RCSID("$OpenBSD: crc32.h,v 1.9 2000/12/19 23:17:56 markus Exp $"); */ #ifndef CRC32_H #define CRC32_H @@ -20,6 +20,6 @@ * This computes a 32 bit CRC of the data in the buffer, and returns the CRC. * The polynomial used is 0xedb88320. */ -unsigned int ssh_crc32(const unsigned char *buf, unsigned int len); +u_int ssh_crc32(const u_char *buf, u_int len); #endif /* CRC32_H */ diff --git a/usr.bin/ssh/deattack.c b/usr.bin/ssh/deattack.c index df1d2240993..c3c3f08d2eb 100644 --- a/usr.bin/ssh/deattack.c +++ b/usr.bin/ssh/deattack.c @@ -1,4 +1,4 @@ -/* $OpenBSD: deattack.c,v 1.10 2000/10/31 13:18:53 markus Exp $ */ +/* $OpenBSD: deattack.c,v 1.11 2000/12/19 23:17:56 markus Exp $ */ /* * Cryptographic attack detector for ssh - source code @@ -51,16 +51,16 @@ void crc_update(u_int32_t *a, u_int32_t b) { b ^= *a; - *a = ssh_crc32((unsigned char *) &b, sizeof(b)); + *a = ssh_crc32((u_char *) &b, sizeof(b)); } /* detect if a block is used in a particular pattern */ int -check_crc(unsigned char *S, unsigned char *buf, u_int32_t len, - unsigned char *IV) +check_crc(u_char *S, u_char *buf, u_int32_t len, + u_char *IV) { u_int32_t crc; - unsigned char *c; + u_char *c; crc = 0; if (IV && !CMP(S, IV)) { @@ -82,14 +82,14 @@ check_crc(unsigned char *S, unsigned char *buf, u_int32_t len, /* Detect a crc32 compensation attack on a packet */ int -detect_attack(unsigned char *buf, u_int32_t len, unsigned char *IV) +detect_attack(u_char *buf, u_int32_t len, u_char *IV) { static u_int16_t *h = (u_int16_t *) NULL; static u_int32_t n = HASH_MINSIZE / HASH_ENTRYSIZE; register u_int32_t i, j; u_int32_t l; - register unsigned char *c; - unsigned char *d; + register u_char *c; + u_char *d; if (len > (SSH_MAXBLOCKS * SSH_BLOCKSIZE) || len % SSH_BLOCKSIZE != 0) { diff --git a/usr.bin/ssh/deattack.h b/usr.bin/ssh/deattack.h index 6ce54dedb17..22930f6193a 100644 --- a/usr.bin/ssh/deattack.h +++ b/usr.bin/ssh/deattack.h @@ -24,5 +24,5 @@ #define DEATTACK_OK 0 #define DEATTACK_DETECTED 1 -int detect_attack(unsigned char *buf, u_int32_t len, unsigned char IV[8]); +int detect_attack(u_char *buf, u_int32_t len, u_char IV[8]); #endif diff --git a/usr.bin/ssh/getput.h b/usr.bin/ssh/getput.h index 19ff5e14b06..b8e83453a8b 100644 --- a/usr.bin/ssh/getput.h +++ b/usr.bin/ssh/getput.h @@ -11,20 +11,20 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: getput.h,v 1.5 2000/09/07 20:27:51 deraadt Exp $"); */ +/* RCSID("$OpenBSD: getput.h,v 1.6 2000/12/19 23:17:56 markus Exp $"); */ #ifndef GETPUT_H #define GETPUT_H /*------------ macros for storing/extracting msb first words -------------*/ -#define GET_32BIT(cp) (((unsigned long)(unsigned char)(cp)[0] << 24) | \ - ((unsigned long)(unsigned char)(cp)[1] << 16) | \ - ((unsigned long)(unsigned char)(cp)[2] << 8) | \ - ((unsigned long)(unsigned char)(cp)[3])) +#define GET_32BIT(cp) (((u_long)(u_char)(cp)[0] << 24) | \ + ((u_long)(u_char)(cp)[1] << 16) | \ + ((u_long)(u_char)(cp)[2] << 8) | \ + ((u_long)(u_char)(cp)[3])) -#define GET_16BIT(cp) (((unsigned long)(unsigned char)(cp)[0] << 8) | \ - ((unsigned long)(unsigned char)(cp)[1])) +#define GET_16BIT(cp) (((u_long)(u_char)(cp)[0] << 8) | \ + ((u_long)(u_char)(cp)[1])) #define PUT_32BIT(cp, value) do { \ (cp)[0] = (value) >> 24; \ @@ -39,14 +39,14 @@ /*------------ macros for storing/extracting lsb first words -------------*/ #define GET_32BIT_LSB_FIRST(cp) \ - (((unsigned long)(unsigned char)(cp)[0]) | \ - ((unsigned long)(unsigned char)(cp)[1] << 8) | \ - ((unsigned long)(unsigned char)(cp)[2] << 16) | \ - ((unsigned long)(unsigned char)(cp)[3] << 24)) + (((u_long)(u_char)(cp)[0]) | \ + ((u_long)(u_char)(cp)[1] << 8) | \ + ((u_long)(u_char)(cp)[2] << 16) | \ + ((u_long)(u_char)(cp)[3] << 24)) #define GET_16BIT_LSB_FIRST(cp) \ - (((unsigned long)(unsigned char)(cp)[0]) | \ - ((unsigned long)(unsigned char)(cp)[1] << 8)) + (((u_long)(u_char)(cp)[0]) | \ + ((u_long)(u_char)(cp)[1] << 8)) #define PUT_32BIT_LSB_FIRST(cp, value) do { \ (cp)[0] = (value); \ diff --git a/usr.bin/ssh/hmac.c b/usr.bin/ssh/hmac.c index 48a176304be..6c3883e67e5 100644 --- a/usr.bin/ssh/hmac.c +++ b/usr.bin/ssh/hmac.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: hmac.c,v 1.4 2000/09/07 20:27:51 deraadt Exp $"); +RCSID("$OpenBSD: hmac.c,v 1.5 2000/12/19 23:17:56 markus Exp $"); #include "xmalloc.h" #include "ssh.h" @@ -31,16 +31,16 @@ RCSID("$OpenBSD: hmac.c,v 1.4 2000/09/07 20:27:51 deraadt Exp $"); #include <openssl/hmac.h> -unsigned char * +u_char * hmac( EVP_MD *evp_md, - unsigned int seqno, - unsigned char *data, int datalen, - unsigned char *key, int keylen) + u_int seqno, + u_char *data, int datalen, + u_char *key, int keylen) { HMAC_CTX c; - static unsigned char m[EVP_MAX_MD_SIZE]; - unsigned char b[4]; + static u_char m[EVP_MAX_MD_SIZE]; + u_char b[4]; if (key == NULL) fatal("hmac: no key"); diff --git a/usr.bin/ssh/hmac.h b/usr.bin/ssh/hmac.h index 281300e25c4..9872b29f543 100644 --- a/usr.bin/ssh/hmac.h +++ b/usr.bin/ssh/hmac.h @@ -24,11 +24,11 @@ #ifndef HMAC_H #define HMAC_H -unsigned char * +u_char * hmac( EVP_MD *evp_md, - unsigned int seqno, - unsigned char *data, int datalen, - unsigned char *key, int len); + u_int seqno, + u_char *data, int datalen, + u_char *key, int len); #endif diff --git a/usr.bin/ssh/hostfile.c b/usr.bin/ssh/hostfile.c index 3b0f286fd6f..af060e40aa5 100644 --- a/usr.bin/ssh/hostfile.c +++ b/usr.bin/ssh/hostfile.c @@ -36,7 +36,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: hostfile.c,v 1.21 2000/11/12 19:50:37 markus Exp $"); +RCSID("$OpenBSD: hostfile.c,v 1.22 2000/12/19 23:17:56 markus Exp $"); #include "packet.h" #include "match.h" @@ -52,7 +52,7 @@ RCSID("$OpenBSD: hostfile.c,v 1.21 2000/11/12 19:50:37 markus Exp $"); */ int -hostfile_read_key(char **cpp, unsigned int *bitsp, Key *ret) +hostfile_read_key(char **cpp, u_int *bitsp, Key *ret) { char *cp; @@ -74,7 +74,7 @@ hostfile_read_key(char **cpp, unsigned int *bitsp, Key *ret) } int -auth_rsa_read_key(char **cpp, unsigned int *bitsp, BIGNUM * e, BIGNUM * n) +auth_rsa_read_key(char **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n) { Key *k = key_new(KEY_RSA1); int ret = hostfile_read_key(cpp, bitsp, k); @@ -112,7 +112,7 @@ check_host_in_hostfile(const char *filename, const char *host, Key *key, Key *fo FILE *f; char line[8192]; int linenum = 0; - unsigned int kbits, hostlen; + u_int kbits, hostlen; char *cp, *cp2; HostStatus end_return; @@ -149,7 +149,7 @@ check_host_in_hostfile(const char *filename, const char *host, Key *key, Key *fo ; /* Check if the host name matches. */ - if (match_hostname(host, cp, (unsigned int) (cp2 - cp)) != 1) + if (match_hostname(host, cp, (u_int) (cp2 - cp)) != 1) continue; /* Got a match. Skip host name. */ diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c index 3a74fdac420..015dae66839 100644 --- a/usr.bin/ssh/kex.c +++ b/usr.bin/ssh/kex.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kex.c,v 1.14 2000/12/15 17:30:14 provos Exp $"); +RCSID("$OpenBSD: kex.c,v 1.15 2000/12/19 23:17:56 markus Exp $"); #include "ssh.h" #include "ssh2.h" @@ -51,7 +51,7 @@ Buffer * kex_init(char *myproposal[PROPOSAL_MAX]) { int first_kex_packet_follows = 0; - unsigned char cookie[KEX_COOKIE_LEN]; + u_char cookie[KEX_COOKIE_LEN]; u_int32_t rand = 0; int i; Buffer *ki = xmalloc(sizeof(*ki)); @@ -204,7 +204,7 @@ dh_new_group1() } void -dump_digest(unsigned char *digest, int len) +dump_digest(u_char *digest, int len) { int i; for (i = 0; i< len; i++){ @@ -215,7 +215,7 @@ dump_digest(unsigned char *digest, int len) fprintf(stderr, "\n"); } -unsigned char * +u_char * kex_hash( char *client_version_string, char *server_version_string, @@ -227,7 +227,7 @@ kex_hash( BIGNUM *shared_secret) { Buffer b; - static unsigned char digest[EVP_MAX_MD_SIZE]; + static u_char digest[EVP_MAX_MD_SIZE]; EVP_MD *evp_md = EVP_sha1(); EVP_MD_CTX md; @@ -264,7 +264,7 @@ kex_hash( return digest; } -unsigned char * +u_char * kex_hash_gex( char *client_version_string, char *server_version_string, @@ -277,7 +277,7 @@ kex_hash_gex( BIGNUM *shared_secret) { Buffer b; - static unsigned char digest[EVP_MAX_MD_SIZE]; + static u_char digest[EVP_MAX_MD_SIZE]; EVP_MD *evp_md = EVP_sha1(); EVP_MD_CTX md; @@ -317,8 +317,8 @@ kex_hash_gex( return digest; } -unsigned char * -derive_key(int id, int need, char unsigned *hash, BIGNUM *shared_secret) +u_char * +derive_key(int id, int need, u_char *hash, BIGNUM *shared_secret) { Buffer b; EVP_MD *evp_md = EVP_sha1(); @@ -326,7 +326,7 @@ derive_key(int id, int need, char unsigned *hash, BIGNUM *shared_secret) char c = id; int have; int mdsz = evp_md->md_size; - unsigned char *digest = xmalloc(((need+mdsz-1)/mdsz)*mdsz); + u_char *digest = xmalloc(((need+mdsz-1)/mdsz)*mdsz); buffer_init(&b); buffer_put_bignum2(&b, shared_secret); @@ -512,12 +512,12 @@ kex_choose_conf(char *cprop[PROPOSAL_MAX], char *sprop[PROPOSAL_MAX], int server } int -kex_derive_keys(Kex *k, unsigned char *hash, BIGNUM *shared_secret) +kex_derive_keys(Kex *k, u_char *hash, BIGNUM *shared_secret) { int i; int mode; int ctos; - unsigned char *keys[NKEYS]; + u_char *keys[NKEYS]; for (i = 0; i < NKEYS; i++) keys[i] = derive_key('A'+i, k->we_need, hash, shared_secret); diff --git a/usr.bin/ssh/kex.h b/usr.bin/ssh/kex.h index b445cee6387..cfa3a9c82ba 100644 --- a/usr.bin/ssh/kex.h +++ b/usr.bin/ssh/kex.h @@ -62,15 +62,15 @@ struct Enc { char *name; Cipher *cipher; int enabled; - unsigned char *key; - unsigned char *iv; + u_char *key; + u_char *iv; }; struct Mac { char *name; int enabled; EVP_MD *md; int mac_len; - unsigned char *key; + u_char *key; int key_len; }; struct Comp { @@ -97,7 +97,7 @@ kex_exchange_kexinit( Kex * kex_choose_conf(char *cprop[PROPOSAL_MAX], char *sprop[PROPOSAL_MAX], int server); -int kex_derive_keys(Kex *k, unsigned char *hash, BIGNUM *shared_secret); +int kex_derive_keys(Kex *k, u_char *hash, BIGNUM *shared_secret); void packet_set_kex(Kex *k); int dh_pub_is_valid(DH *dh, BIGNUM *dh_pub); DH *dh_new_group_asc(const char *, const char *); @@ -105,7 +105,7 @@ DH *dh_new_group(BIGNUM *, BIGNUM *); void dh_gen_key(); DH *dh_new_group1(); -unsigned char * +u_char * kex_hash( char *client_version_string, char *server_version_string, @@ -116,7 +116,7 @@ kex_hash( BIGNUM *server_dh_pub, BIGNUM *shared_secret); -unsigned char * +u_char * kex_hash_gex( char *client_version_string, char *server_version_string, diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c index a6b25b7ae83..f9474b16be9 100644 --- a/usr.bin/ssh/key.c +++ b/usr.bin/ssh/key.c @@ -46,7 +46,7 @@ #include "buffer.h" #include "bufaux.h" -RCSID("$OpenBSD: key.c,v 1.12 2000/11/12 19:50:37 markus Exp $"); +RCSID("$OpenBSD: key.c,v 1.13 2000/12/19 23:17:56 markus Exp $"); Key * key_new(int type) @@ -163,7 +163,7 @@ char * key_fingerprint(Key *k) { static char retval[(EVP_MAX_MD_SIZE+1)*3]; - unsigned char *blob = NULL; + u_char *blob = NULL; int len = 0; int nlen, elen; @@ -190,7 +190,7 @@ key_fingerprint(Key *k) } if (blob != NULL) { int i; - unsigned char digest[EVP_MAX_MD_SIZE]; + u_char digest[EVP_MAX_MD_SIZE]; EVP_MD *md = EVP_md5(); EVP_MD_CTX ctx; EVP_DigestInit(&ctx, md); @@ -273,7 +273,7 @@ key_read(Key *ret, char **cpp) char *cp, *space; int len, n, type; u_int bits; - unsigned char *blob; + u_char *blob; cp = *cpp; @@ -380,7 +380,7 @@ int key_write(Key *key, FILE *f) { int success = 0; - unsigned int bits = 0; + u_int bits = 0; if (key->type == KEY_RSA1 && key->rsa != NULL) { /* size of modulus 'n' */ @@ -395,7 +395,7 @@ key_write(Key *key, FILE *f) } else if ((key->type == KEY_DSA && key->dsa != NULL) || (key->type == KEY_RSA && key->rsa != NULL)) { int len, n; - unsigned char *blob, *uu; + u_char *blob, *uu; key_to_blob(key, &blob, &len); uu = xmalloc(2*len); n = uuencode(blob, len, uu, 2*len); @@ -452,7 +452,7 @@ key_size(Key *k){ } RSA * -rsa_generate_private_key(unsigned int bits) +rsa_generate_private_key(u_int bits) { RSA *private; private = RSA_generate_key(bits, 35, NULL, NULL); @@ -462,7 +462,7 @@ rsa_generate_private_key(unsigned int bits) } DSA* -dsa_generate_private_key(unsigned int bits) +dsa_generate_private_key(u_int bits) { DSA *private = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, NULL, NULL); if (private == NULL) @@ -475,7 +475,7 @@ dsa_generate_private_key(unsigned int bits) } Key * -key_generate(int type, unsigned int bits) +key_generate(int type, u_int bits) { Key *k = key_new(KEY_UNSPEC); switch (type) { @@ -587,11 +587,11 @@ key_from_blob(char *blob, int blen) } int -key_to_blob(Key *key, unsigned char **blobp, unsigned int *lenp) +key_to_blob(Key *key, u_char **blobp, u_int *lenp) { Buffer b; int len; - unsigned char *buf; + u_char *buf; if (key == NULL) { error("key_to_blob: key == NULL"); @@ -630,8 +630,8 @@ key_to_blob(Key *key, unsigned char **blobp, unsigned int *lenp) int key_sign( Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen) + u_char **sigp, int *lenp, + u_char *data, int datalen) { switch(key->type){ case KEY_DSA: @@ -650,8 +650,8 @@ key_sign( int key_verify( Key *key, - unsigned char *signature, int signaturelen, - unsigned char *data, int datalen) + u_char *signature, int signaturelen, + u_char *data, int datalen) { switch(key->type){ case KEY_DSA: diff --git a/usr.bin/ssh/key.h b/usr.bin/ssh/key.h index b6c3eb0109e..91f4d005506 100644 --- a/usr.bin/ssh/key.h +++ b/usr.bin/ssh/key.h @@ -47,24 +47,24 @@ int key_write(Key *key, FILE *f); int key_read(Key *key, char **cpp); u_int key_size(Key *k); -Key *key_generate(int type, unsigned int bits); +Key *key_generate(int type, u_int bits); Key *key_from_private(Key *k); int key_type_from_name(char *name); Key *key_from_blob(char *blob, int blen); -int key_to_blob(Key *key, unsigned char **blobp, unsigned int *lenp); +int key_to_blob(Key *key, u_char **blobp, u_int *lenp); char *key_ssh_name(Key *k); int key_sign( Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen); + u_char **sigp, int *lenp, + u_char *data, int datalen); int key_verify( Key *key, - unsigned char *signature, int signaturelen, - unsigned char *data, int datalen); + u_char *signature, int signaturelen, + u_char *data, int datalen); #endif diff --git a/usr.bin/ssh/log.c b/usr.bin/ssh/log.c index ce89c59ba82..9cae37125e6 100644 --- a/usr.bin/ssh/log.c +++ b/usr.bin/ssh/log.c @@ -36,7 +36,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: log.c,v 1.11 2000/09/30 16:27:43 markus Exp $"); +RCSID("$OpenBSD: log.c,v 1.12 2000/12/19 23:17:57 markus Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -155,7 +155,7 @@ fatal_remove_cleanup(void (*proc) (void *context), void *context) } } fatal("fatal_remove_cleanup: no such cleanup function: 0x%lx 0x%lx\n", - (unsigned long) proc, (unsigned long) context); + (u_long) proc, (u_long) context); } /* Cleanup and exit */ @@ -172,7 +172,7 @@ fatal_cleanup(void) for (cu = fatal_cleanups; cu; cu = next_cu) { next_cu = cu->next; debug("Calling cleanup 0x%lx(0x%lx)", - (unsigned long) cu->proc, (unsigned long) cu->context); + (u_long) cu->proc, (u_long) cu->context); (*cu->proc) (cu->context); } exit(255); diff --git a/usr.bin/ssh/login.c b/usr.bin/ssh/login.c index 1d59cd825f7..06eb0611c81 100644 --- a/usr.bin/ssh/login.c +++ b/usr.bin/ssh/login.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: login.c,v 1.15 2000/09/07 20:27:52 deraadt Exp $"); +RCSID("$OpenBSD: login.c,v 1.16 2000/12/19 23:17:57 markus Exp $"); #include <util.h> #include <utmp.h> @@ -56,9 +56,9 @@ RCSID("$OpenBSD: login.c,v 1.15 2000/09/07 20:27:52 deraadt Exp $"); * is found). The name of the host used last time is returned in buf. */ -unsigned long +u_long get_last_login_time(uid_t uid, const char *logname, - char *buf, unsigned int bufsize) + char *buf, u_int bufsize) { struct lastlog ll; char *lastlog; diff --git a/usr.bin/ssh/match.c b/usr.bin/ssh/match.c index c373129b853..895ecab37a8 100644 --- a/usr.bin/ssh/match.c +++ b/usr.bin/ssh/match.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: match.c,v 1.9 2000/09/07 20:27:52 deraadt Exp $"); +RCSID("$OpenBSD: match.c,v 1.10 2000/12/19 23:17:57 markus Exp $"); #include "ssh.h" @@ -87,12 +87,12 @@ match_pattern(const char *s, const char *pattern) */ int -match_hostname(const char *host, const char *pattern, unsigned int len) +match_hostname(const char *host, const char *pattern, u_int len) { char sub[1024]; int negated; int got_positive; - unsigned int i, subi; + u_int i, subi; got_positive = 0; for (i = 0; i < len;) { diff --git a/usr.bin/ssh/match.h b/usr.bin/ssh/match.h index 564f5abf97b..5afbe326c95 100644 --- a/usr.bin/ssh/match.h +++ b/usr.bin/ssh/match.h @@ -26,6 +26,6 @@ int match_pattern(const char *s, const char *pattern); * indicate negation). Returns -1 if negation matches, 1 if there is * a positive match, 0 if there is no match at all. */ -int match_hostname(const char *host, const char *pattern, unsigned int len); +int match_hostname(const char *host, const char *pattern, u_int len); #endif diff --git a/usr.bin/ssh/mpaux.c b/usr.bin/ssh/mpaux.c index 1ee8df19482..6b586ec0414 100644 --- a/usr.bin/ssh/mpaux.c +++ b/usr.bin/ssh/mpaux.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: mpaux.c,v 1.14 2000/09/07 20:27:52 deraadt Exp $"); +RCSID("$OpenBSD: mpaux.c,v 1.15 2000/12/19 23:17:57 markus Exp $"); #include <openssl/bn.h> #include "getput.h" @@ -22,15 +22,15 @@ RCSID("$OpenBSD: mpaux.c,v 1.14 2000/09/07 20:27:52 deraadt Exp $"); #include <openssl/md5.h> void -compute_session_id(unsigned char session_id[16], - unsigned char cookie[8], +compute_session_id(u_char session_id[16], + u_char cookie[8], BIGNUM* host_key_n, BIGNUM* session_key_n) { - unsigned int host_key_bytes = BN_num_bytes(host_key_n); - unsigned int session_key_bytes = BN_num_bytes(session_key_n); - unsigned int bytes = host_key_bytes + session_key_bytes; - unsigned char *buf = xmalloc(bytes); + u_int host_key_bytes = BN_num_bytes(host_key_n); + u_int session_key_bytes = BN_num_bytes(session_key_n); + u_int bytes = host_key_bytes + session_key_bytes; + u_char *buf = xmalloc(bytes); MD5_CTX md; BN_bn2bin(host_key_n, buf); diff --git a/usr.bin/ssh/mpaux.h b/usr.bin/ssh/mpaux.h index 9de17276bba..b3f15e4a5fe 100644 --- a/usr.bin/ssh/mpaux.h +++ b/usr.bin/ssh/mpaux.h @@ -12,7 +12,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: mpaux.h,v 1.8 2000/09/07 20:27:52 deraadt Exp $"); */ +/* RCSID("$OpenBSD: mpaux.h,v 1.9 2000/12/19 23:17:57 markus Exp $"); */ #ifndef MPAUX_H #define MPAUX_H @@ -23,8 +23,8 @@ * representations of host_key_n, session_key_n, and the cookie. */ void -compute_session_id(unsigned char session_id[16], - unsigned char cookie[8], +compute_session_id(u_char session_id[16], + u_char cookie[8], BIGNUM * host_key_n, BIGNUM * session_key_n); diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index 9416509005d..12fb044e031 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: packet.c,v 1.39 2000/12/06 22:58:15 markus Exp $"); +RCSID("$OpenBSD: packet.c,v 1.40 2000/12/19 23:17:57 markus Exp $"); #include "xmalloc.h" #include "buffer.h" @@ -84,7 +84,7 @@ static int connection_out = -1; static int cipher_type = SSH_CIPHER_NONE; /* Protocol flags for the remote side. */ -static unsigned int remote_protocol_flags = 0; +static u_int remote_protocol_flags = 0; /* Encryption context for receiving data. This is only used for decryption. */ static CipherContext receive_context; @@ -167,8 +167,8 @@ packet_set_connection(int fd_in, int fd_out) connection_in = fd_in; connection_out = fd_out; cipher_type = SSH_CIPHER_NONE; - cipher_init(&send_context, none, (unsigned char *) "", 0, NULL, 0); - cipher_init(&receive_context, none, (unsigned char *) "", 0, NULL, 0); + cipher_init(&send_context, none, (u_char *) "", 0, NULL, 0); + cipher_init(&receive_context, none, (u_char *) "", 0, NULL, 0); if (!initialized) { initialized = 1; buffer_init(&input); @@ -281,7 +281,7 @@ packet_close() /* Sets remote side protocol flags. */ void -packet_set_protocol_flags(unsigned int protocol_flags) +packet_set_protocol_flags(u_int protocol_flags) { remote_protocol_flags = protocol_flags; channel_set_options((protocol_flags & SSH_PROTOFLAG_HOST_IN_FWD_OPEN) != 0); @@ -289,7 +289,7 @@ packet_set_protocol_flags(unsigned int protocol_flags) /* Returns the remote protocol flags set earlier by the above function. */ -unsigned int +u_int packet_get_protocol_flags() { return remote_protocol_flags; @@ -318,7 +318,7 @@ packet_start_compression(int level) void packet_encrypt(CipherContext * cc, void *dest, void *src, - unsigned int bytes) + u_int bytes) { cipher_encrypt(cc, dest, src, bytes); } @@ -329,7 +329,7 @@ packet_encrypt(CipherContext * cc, void *dest, void *src, */ void -packet_decrypt(CipherContext *context, void *dest, void *src, unsigned int bytes) +packet_decrypt(CipherContext *context, void *dest, void *src, u_int bytes) { /* * Cryptographic attack detector for ssh - Modifications for packet.c @@ -350,7 +350,7 @@ packet_decrypt(CipherContext *context, void *dest, void *src, unsigned int bytes */ void -packet_set_encryption_key(const unsigned char *key, unsigned int keylen, +packet_set_encryption_key(const u_char *key, u_int keylen, int number) { Cipher *cipher = cipher_by_number(number); @@ -410,7 +410,7 @@ packet_put_char(int value) /* Appends an integer to the packet data. */ void -packet_put_int(unsigned int value) +packet_put_int(u_int value) { buffer_put_int(&outgoing_packet, value); } @@ -418,7 +418,7 @@ packet_put_int(unsigned int value) /* Appends a string to packet data. */ void -packet_put_string(const char *buf, unsigned int len) +packet_put_string(const char *buf, u_int len) { buffer_put_string(&outgoing_packet, buf, len); } @@ -429,7 +429,7 @@ packet_put_cstring(const char *str) } void -packet_put_raw(const char *buf, unsigned int len) +packet_put_raw(const char *buf, u_int len) { buffer_append(&outgoing_packet, buf, len); } @@ -458,7 +458,7 @@ packet_send1() { char buf[8], *cp; int i, padding, len; - unsigned int checksum; + u_int checksum; u_int32_t rand = 0; /* @@ -493,7 +493,7 @@ packet_send1() buffer_consume(&outgoing_packet, 8 - padding); /* Add check bytes. */ - checksum = ssh_crc32((unsigned char *) buffer_ptr(&outgoing_packet), + checksum = ssh_crc32((u_char *) buffer_ptr(&outgoing_packet), buffer_len(&outgoing_packet)); PUT_32BIT(buf, checksum); buffer_append(&outgoing_packet, buf, 4); @@ -530,12 +530,12 @@ packet_send1() void packet_send2() { - unsigned char *macbuf = NULL; + u_char *macbuf = NULL; char *cp; - unsigned int packet_length = 0; - unsigned int i, padlen, len; + u_int packet_length = 0; + u_int i, padlen, len; u_int32_t rand = 0; - static unsigned int seqnr = 0; + static u_int seqnr = 0; int type; Enc *enc = NULL; Mac *mac = NULL; @@ -604,7 +604,7 @@ packet_send2() /* compute MAC over seqnr and packet(length fields, payload, padding) */ if (mac && mac->enabled) { macbuf = hmac( mac->md, seqnr, - (unsigned char *) buffer_ptr(&outgoing_packet), + (u_char *) buffer_ptr(&outgoing_packet), buffer_len(&outgoing_packet), mac->key, mac->key_len ); @@ -742,16 +742,16 @@ packet_read_expect(int *payload_len_ptr, int expected_type) int packet_read_poll1(int *payload_len_ptr) { - unsigned int len, padded_len; - unsigned char *ucp; + u_int len, padded_len; + u_char *ucp; char buf[8], *cp; - unsigned int checksum, stored_checksum; + u_int checksum, stored_checksum; /* Check if input size is less than minimum packet size. */ if (buffer_len(&input) < 4 + 8) return SSH_MSG_NONE; /* Get length of incoming packet. */ - ucp = (unsigned char *) buffer_ptr(&input); + ucp = (u_char *) buffer_ptr(&input); len = GET_32BIT(ucp); if (len < 1 + 2 + 2 || len > 256 * 1024) packet_disconnect("Bad packet length %d.", len); @@ -778,7 +778,7 @@ packet_read_poll1(int *payload_len_ptr) #endif /* Compute packet checksum. */ - checksum = ssh_crc32((unsigned char *) buffer_ptr(&incoming_packet), + checksum = ssh_crc32((u_char *) buffer_ptr(&incoming_packet), buffer_len(&incoming_packet) - 4); /* Skip padding. */ @@ -790,7 +790,7 @@ packet_read_poll1(int *payload_len_ptr) packet_disconnect("packet_read_poll: len %d != buffer_len %d.", len, buffer_len(&incoming_packet)); - ucp = (unsigned char *) buffer_ptr(&incoming_packet) + len - 4; + ucp = (u_char *) buffer_ptr(&incoming_packet) + len - 4; stored_checksum = GET_32BIT(ucp); if (checksum != stored_checksum) packet_disconnect("Corrupted check bytes on input."); @@ -811,18 +811,18 @@ packet_read_poll1(int *payload_len_ptr) *payload_len_ptr = buffer_len(&incoming_packet); /* Return type. */ - return (unsigned char) buf[0]; + return (u_char) buf[0]; } int packet_read_poll2(int *payload_len_ptr) { - unsigned int padlen, need; - unsigned char buf[8], *macbuf; - unsigned char *ucp; + u_int padlen, need; + u_char buf[8], *macbuf; + u_char *ucp; char *cp; - static unsigned int packet_length = 0; - static unsigned int seqnr = 0; + static u_int packet_length = 0; + static u_int seqnr = 0; int type; int maclen, block_size; Enc *enc = NULL; @@ -848,7 +848,7 @@ packet_read_poll2(int *payload_len_ptr) buffer_append_space(&incoming_packet, &cp, block_size); packet_decrypt(&receive_context, cp, buffer_ptr(&input), block_size); - ucp = (unsigned char *) buffer_ptr(&incoming_packet); + ucp = (u_char *) buffer_ptr(&incoming_packet); packet_length = GET_32BIT(ucp); if (packet_length < 1 + 4 || packet_length > 256 * 1024) { buffer_dump(&incoming_packet); @@ -883,7 +883,7 @@ packet_read_poll2(int *payload_len_ptr) */ if (mac && mac->enabled) { macbuf = hmac( mac->md, seqnr, - (unsigned char *) buffer_ptr(&incoming_packet), + (u_char *) buffer_ptr(&incoming_packet), buffer_len(&incoming_packet), mac->key, mac->key_len ); @@ -926,7 +926,7 @@ packet_read_poll2(int *payload_len_ptr) packet_length = 0; /* extract packet type */ - type = (unsigned char)buf[0]; + type = (u_char)buf[0]; if (type == SSH2_MSG_NEWKEYS) { if (kex==NULL || mac==NULL || enc==NULL || comp==NULL) @@ -949,7 +949,7 @@ packet_read_poll2(int *payload_len_ptr) fprintf(stderr, "read/plain[%d]:\r\n",type); buffer_dump(&incoming_packet); #endif - return (unsigned char)type; + return (u_char)type; } int @@ -1018,24 +1018,24 @@ packet_read_poll(int *payload_len_ptr) */ void -packet_process_incoming(const char *buf, unsigned int len) +packet_process_incoming(const char *buf, u_int len) { buffer_append(&input, buf, len); } /* Returns a character from the packet. */ -unsigned int +u_int packet_get_char() { char ch; buffer_get(&incoming_packet, &ch, 1); - return (unsigned char) ch; + return (u_char) ch; } /* Returns an integer from the packet data. */ -unsigned int +u_int packet_get_int() { return buffer_get_int(&incoming_packet); @@ -1081,7 +1081,7 @@ packet_remaining(void) */ char * -packet_get_string(unsigned int *length_ptr) +packet_get_string(u_int *length_ptr) { return buffer_get_string(&incoming_packet, length_ptr); } diff --git a/usr.bin/ssh/packet.h b/usr.bin/ssh/packet.h index 7a3935399e1..597fbb1514b 100644 --- a/usr.bin/ssh/packet.h +++ b/usr.bin/ssh/packet.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: packet.h,v 1.17 2000/09/07 20:27:52 deraadt Exp $"); */ +/* RCSID("$OpenBSD: packet.h,v 1.18 2000/12/19 23:17:57 markus Exp $"); */ #ifndef PACKET_H #define PACKET_H @@ -46,17 +46,17 @@ void packet_close(void); * encrypted independently of each other. Cipher types are defined in ssh.h. */ void -packet_set_encryption_key(const unsigned char *key, unsigned int keylen, +packet_set_encryption_key(const u_char *key, u_int keylen, int cipher_type); /* * Sets remote side protocol flags for the current connection. This can be * called at any time. */ -void packet_set_protocol_flags(unsigned int flags); +void packet_set_protocol_flags(u_int flags); /* Returns the remote protocol flags set earlier by the above function. */ -unsigned int packet_get_protocol_flags(void); +u_int packet_get_protocol_flags(void); /* Enables compression in both directions starting from the next packet. */ void packet_start_compression(int level); @@ -77,16 +77,16 @@ void packet_start(int type); void packet_put_char(int ch); /* Appends an integer to the packet data. */ -void packet_put_int(unsigned int value); +void packet_put_int(u_int value); /* Appends an arbitrary precision integer to packet data. */ void packet_put_bignum(BIGNUM * value); void packet_put_bignum2(BIGNUM * value); /* Appends a string to packet data. */ -void packet_put_string(const char *buf, unsigned int len); +void packet_put_string(const char *buf, u_int len); void packet_put_cstring(const char *str); -void packet_put_raw(const char *buf, unsigned int len); +void packet_put_raw(const char *buf, u_int len); /* * Finalizes and sends the packet. If the encryption key has been set, @@ -117,13 +117,13 @@ int packet_read_poll(int *packet_len_ptr); * Buffers the given amount of input characters. This is intended to be used * together with packet_read_poll. */ -void packet_process_incoming(const char *buf, unsigned int len); +void packet_process_incoming(const char *buf, u_int len); /* Returns a character (0-255) from the packet data. */ -unsigned int packet_get_char(void); +u_int packet_get_char(void); /* Returns an integer from the packet data. */ -unsigned int packet_get_int(void); +u_int packet_get_int(void); /* * Returns an arbitrary precision integer from the packet data. The integer @@ -139,7 +139,7 @@ char *packet_get_raw(int *length_ptr); * no longer needed. The length_ptr argument may be NULL, or point to an * integer into which the length of the string is stored. */ -char *packet_get_string(unsigned int *length_ptr); +char *packet_get_string(u_int *length_ptr); /* * Logs the error in syslog using LOG_INFO, constructs and sends a disconnect diff --git a/usr.bin/ssh/radix.c b/usr.bin/ssh/radix.c index 84292048482..939d0f7fc1c 100644 --- a/usr.bin/ssh/radix.c +++ b/usr.bin/ssh/radix.c @@ -25,14 +25,14 @@ #include "includes.h" #include "uuencode.h" -RCSID("$OpenBSD: radix.c,v 1.13 2000/09/07 20:27:52 deraadt Exp $"); +RCSID("$OpenBSD: radix.c,v 1.14 2000/12/19 23:17:57 markus Exp $"); #ifdef AFS #include <krb.h> -typedef unsigned char my_u_char; -typedef unsigned int my_u_int32_t; -typedef unsigned short my_u_short; +typedef u_char my_u_char; +typedef u_int my_u_int32_t; +typedef u_short my_u_short; /* Nasty macros from BIND-4.9.2 */ @@ -89,7 +89,7 @@ typedef unsigned short my_u_short; int -creds_to_radix(CREDENTIALS *creds, unsigned char *buf, size_t buflen) +creds_to_radix(CREDENTIALS *creds, u_char *buf, size_t buflen) { char *p, *s; int len; @@ -123,8 +123,8 @@ creds_to_radix(CREDENTIALS *creds, unsigned char *buf, size_t buflen) PUTLONG(creds->issue_date, p); { - unsigned int endTime; - endTime = (unsigned int) krb_life_to_time(creds->issue_date, + u_int endTime; + endTime = (u_int) krb_life_to_time(creds->issue_date, creds->lifetime); PUTLONG(endTime, p); } @@ -139,7 +139,7 @@ creds_to_radix(CREDENTIALS *creds, unsigned char *buf, size_t buflen) p += creds->ticket_st.length; len = p - temp; - return (uuencode((unsigned char *)temp, len, (char *)buf, buflen)); + return (uuencode((u_char *)temp, len, (char *)buf, buflen)); } int @@ -151,7 +151,7 @@ radix_to_creds(const char *buf, CREDENTIALS *creds) char version; char temp[2048]; - len = uudecode(buf, (unsigned char *)temp, sizeof(temp)); + len = uudecode(buf, (u_char *)temp, sizeof(temp)); if (len < 0) return 0; @@ -184,7 +184,7 @@ radix_to_creds(const char *buf, CREDENTIALS *creds) GETLONG(creds->issue_date, p); len -= 4; { - unsigned int endTime; + u_int endTime; GETLONG(endTime, p); len -= 4; creds->lifetime = krb_time_to_life(creds->issue_date, endTime); diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 51bf5776972..bb5277f1d93 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readconf.c,v 1.50 2000/11/12 19:50:37 markus Exp $"); +RCSID("$OpenBSD: readconf.c,v 1.51 2000/12/19 23:17:57 markus Exp $"); #include "ssh.h" #include "readconf.h" @@ -213,7 +213,7 @@ add_remote_forward(Options *options, u_short port, const char *host, static OpCodes parse_token(const char *cp, const char *filename, int linenum) { - unsigned int i; + u_int i; for (i = 0; keywords[i].name; i++) if (strcasecmp(cp, keywords[i].name) == 0) @@ -571,10 +571,10 @@ parse_int: if (!arg || *arg == '\0') fatal("%.200s line %d: Missing argument.", filename, linenum); if (arg[0] == '^' && arg[2] == 0 && - (unsigned char) arg[1] >= 64 && (unsigned char) arg[1] < 128) - value = (unsigned char) arg[1] & 31; + (u_char) arg[1] >= 64 && (u_char) arg[1] < 128) + value = (u_char) arg[1] & 31; else if (strlen(arg) == 1) - value = (unsigned char) arg[0]; + value = (u_char) arg[0]; else if (strcmp(arg, "none") == 0) value = -2; else { diff --git a/usr.bin/ssh/rijndael.h b/usr.bin/ssh/rijndael.h index c13f18c9590..276cc144fb9 100644 --- a/usr.bin/ssh/rijndael.h +++ b/usr.bin/ssh/rijndael.h @@ -3,9 +3,9 @@ /* 1. Standard types for AES cryptography source code */ -typedef u_int8_t u1byte; /* an 8 bit unsigned character type */ -typedef u_int16_t u2byte; /* a 16 bit unsigned integer type */ -typedef u_int32_t u4byte; /* a 32 bit unsigned integer type */ +typedef u_int8_t u1byte; /* an 8 bit u_character type */ +typedef u_int16_t u2byte; /* a 16 bit u_integer type */ +typedef u_int32_t u4byte; /* a 32 bit u_integer type */ typedef int8_t s1byte; /* an 8 bit signed character type */ typedef int16_t s2byte; /* a 16 bit signed integer type */ @@ -21,7 +21,7 @@ typedef struct _rijndael_ctx { /* 2. Standard interface for AES cryptographic routines */ -/* These are all based on 32 bit unsigned values and will therefore */ +/* These are all based on 32 bit u_values and will therefore */ /* require endian conversions for big-endian architectures */ rijndael_ctx *rijndael_set_key __P((rijndael_ctx *, const u4byte *, u4byte, int)); diff --git a/usr.bin/ssh/rsa.c b/usr.bin/ssh/rsa.c index 8ef7b22ce93..e5eea29f5e3 100644 --- a/usr.bin/ssh/rsa.c +++ b/usr.bin/ssh/rsa.c @@ -60,7 +60,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: rsa.c,v 1.17 2000/11/12 19:50:37 markus Exp $"); +RCSID("$OpenBSD: rsa.c,v 1.18 2000/12/19 23:17:57 markus Exp $"); #include "rsa.h" #include "ssh.h" @@ -69,7 +69,7 @@ RCSID("$OpenBSD: rsa.c,v 1.17 2000/11/12 19:50:37 markus Exp $"); void rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key) { - unsigned char *inbuf, *outbuf; + u_char *inbuf, *outbuf; int len, ilen, olen; if (BN_num_bits(key->e) < 2 || !BN_is_odd(key->e)) @@ -97,7 +97,7 @@ rsa_public_encrypt(BIGNUM *out, BIGNUM *in, RSA *key) void rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key) { - unsigned char *inbuf, *outbuf; + u_char *inbuf, *outbuf; int len, ilen, olen; olen = BN_num_bytes(key->n); diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 2b1d2df5009..dbcff5d3ccb 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.46 2000/12/16 09:53:57 markus Exp $"); +RCSID("$OpenBSD: scp.c,v 1.47 2000/12/19 23:17:57 markus Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -99,7 +99,7 @@ void addargs(char *fmt, ...) __attribute__((format(printf, 1, 2))); static struct timeval start; /* Number of bytes of current file transferred so far. */ -volatile unsigned long statbytes; +volatile u_long statbytes; /* Total size of current file. */ off_t totalbytes = 0; @@ -529,16 +529,16 @@ syserr: run_err("%s: %s", name, strerror(errno)); * versions expecting microseconds. */ (void) sprintf(buf, "T%lu 0 %lu 0\n", - (unsigned long) stb.st_mtime, - (unsigned long) stb.st_atime); + (u_long) stb.st_mtime, + (u_long) stb.st_atime); (void) atomicio(write, remout, buf, strlen(buf)); if (response() < 0) goto next; } #define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) sprintf(buf, "C%04o %lu %s\n", - (unsigned int) (stb.st_mode & FILEMODEMASK), - (unsigned long) stb.st_size, last); + (u_int) (stb.st_mode & FILEMODEMASK), + (u_long) stb.st_size, last); if (verbose_mode) { fprintf(stderr, "Sending file modes: %s", buf); fflush(stderr); @@ -606,8 +606,8 @@ rsource(name, statp) last++; if (pflag) { (void) sprintf(path, "T%lu 0 %lu 0\n", - (unsigned long) statp->st_mtime, - (unsigned long) statp->st_atime); + (u_long) statp->st_mtime, + (u_long) statp->st_atime); (void) atomicio(write, remout, path, strlen(path)); if (response() < 0) { closedir(dirp); @@ -615,7 +615,7 @@ rsource(name, statp) } } (void) sprintf(path, "D%04o %d %.1024s\n", - (unsigned int) (statp->st_mode & FILEMODEMASK), 0, last); + (u_int) (statp->st_mode & FILEMODEMASK), 0, last); if (verbose_mode) fprintf(stderr, "Entering directory: %s", path); (void) atomicio(write, remout, path, strlen(path)); diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 5da55de038d..8dd6e7d8897 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.54 2000/11/12 19:50:38 markus Exp $"); +RCSID("$OpenBSD: servconf.c,v 1.55 2000/12/19 23:17:57 markus Exp $"); #include "ssh.h" #include "servconf.h" @@ -269,7 +269,7 @@ static ServerOpCodes parse_token(const char *cp, const char *filename, int linenum) { - unsigned int i; + u_int i; for (i = 0; keywords[i].name; i++) if (strcasecmp(cp, keywords[i].name) == 0) diff --git a/usr.bin/ssh/servconf.h b/usr.bin/ssh/servconf.h index 3ecf6a00d52..7d5016662ca 100644 --- a/usr.bin/ssh/servconf.h +++ b/usr.bin/ssh/servconf.h @@ -11,7 +11,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: servconf.h,v 1.31 2000/11/12 19:50:38 markus Exp $"); */ +/* RCSID("$OpenBSD: servconf.h,v 1.32 2000/12/19 23:17:58 markus Exp $"); */ #ifndef SERVCONF_H #define SERVCONF_H @@ -26,8 +26,8 @@ #define MAX_HOSTKEYS 256 /* Max # hostkeys. */ typedef struct { - unsigned int num_ports; - unsigned int ports_from_cmdline; + u_int num_ports; + u_int ports_from_cmdline; u_short ports[MAX_PORTS]; /* Port number to listen on. */ char *listen_addr; /* Address on which the server listens. */ struct addrinfo *listen_addrs; /* Addresses on which the server listens. */ @@ -88,16 +88,16 @@ typedef struct { * passwords. */ int use_login; /* If true, login(1) is used */ int allow_tcp_forwarding; - unsigned int num_allow_users; + u_int num_allow_users; char *allow_users[MAX_ALLOW_USERS]; - unsigned int num_deny_users; + u_int num_deny_users; char *deny_users[MAX_DENY_USERS]; - unsigned int num_allow_groups; + u_int num_allow_groups; char *allow_groups[MAX_ALLOW_GROUPS]; - unsigned int num_deny_groups; + u_int num_deny_groups; char *deny_groups[MAX_DENY_GROUPS]; - unsigned int num_subsystems; + u_int num_subsystems; char *subsystem_name[MAX_SUBSYSTEMS]; char *subsystem_command[MAX_SUBSYSTEMS]; diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index ca9cdc99e43..9ff5777f405 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: serverloop.c,v 1.37 2000/12/11 20:16:22 deraadt Exp $"); +RCSID("$OpenBSD: serverloop.c,v 1.38 2000/12/19 23:17:58 markus Exp $"); #include "xmalloc.h" #include "ssh.h" @@ -70,7 +70,7 @@ static int fdout_eof = 0; /* EOF encountered reading from fdout. */ static int fderr_eof = 0; /* EOF encountered readung from fderr. */ static int connection_in; /* Connection to client (input). */ static int connection_out; /* Connection to client (output). */ -static unsigned int buffer_high;/* "Soft" max buffer size. */ +static u_int buffer_high;/* "Soft" max buffer size. */ static int max_fd; /* Max file descriptor number for select(). */ /* @@ -179,7 +179,7 @@ make_packets_from_stdout_data() */ void wait_until_can_do_something(fd_set * readset, fd_set * writeset, - unsigned int max_time_milliseconds) + u_int max_time_milliseconds) { struct timeval tv, *tvp; int ret; @@ -402,9 +402,9 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg) int wait_status; /* Status returned by wait(). */ pid_t wait_pid; /* pid returned by wait(). */ int waiting_termination = 0; /* Have displayed waiting close message. */ - unsigned int max_time_milliseconds; - unsigned int previous_stdout_buffer_bytes; - unsigned int stdout_buffer_bytes; + u_int max_time_milliseconds; + u_int previous_stdout_buffer_bytes; + u_int stdout_buffer_bytes; int type; debug("Entering interactive session."); @@ -681,7 +681,7 @@ void server_input_stdin_data(int type, int plen, void *ctxt) { char *data; - unsigned int data_len; + u_int data_len; /* Stdin data from the client. Append it to the buffer. */ /* Ignore any data if the client has closed stdin. */ @@ -787,7 +787,7 @@ server_input_channel_open(int type, int plen, void *ctxt) { Channel *c = NULL; char *ctype; - unsigned int len; + u_int len; int rchan; int rmaxpack; int rwindow; diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index 855f6d920e8..d3c20fcee9e 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.44 2000/11/14 23:44:19 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.45 2000/12/19 23:17:58 markus Exp $"); #include "xmalloc.h" #include "ssh.h" @@ -101,7 +101,7 @@ extern ServerOptions options; extern char *__progname; extern int log_stderr; extern int debug_flag; -extern unsigned int utmp_len; +extern u_int utmp_len; extern int startup_pipe; @@ -177,7 +177,7 @@ do_authenticated(struct passwd * pw) char *command; int n_bytes; int plen; - unsigned int proto_len, data_len, dlen; + u_int proto_len, data_len, dlen; /* * Cancel the alarm we set to limit the time taken for @@ -700,10 +700,10 @@ do_login(Session *s, const char *command) * already exists, its value is overriden. */ void -child_set_env(char ***envp, unsigned int *envsizep, const char *name, +child_set_env(char ***envp, u_int *envsizep, const char *name, const char *value) { - unsigned int i, namelen; + u_int i, namelen; char **env; /* @@ -741,7 +741,7 @@ child_set_env(char ***envp, unsigned int *envsizep, const char *name, * and assignments of the form name=value. No other forms are allowed. */ void -read_environment_file(char ***env, unsigned int *envsize, +read_environment_file(char ***env, u_int *envsize, const char *filename) { FILE *f; @@ -789,7 +789,7 @@ do_child(const char *command, struct passwd * pw, const char *term, char buf[256]; char cmd[1024]; FILE *f = NULL; - unsigned int envsize, i; + u_int envsize, i; char **env; extern char **environ; struct stat st; @@ -1253,7 +1253,7 @@ session_window_change_req(Session *s) int session_pty_req(Session *s) { - unsigned int len; + u_int len; char *term_modes; /* encoded terminal modes */ if (no_pty_flag) @@ -1302,7 +1302,7 @@ session_pty_req(Session *s) int session_subsystem_req(Session *s) { - unsigned int len; + u_int len; int success = 0; char *subsys = packet_get_string(&len); int i; @@ -1398,7 +1398,7 @@ session_shell_req(Session *s) int session_exec_req(Session *s) { - unsigned int len; + u_int len; char *command = packet_get_string(&len); packet_done(); if (forced_command) { @@ -1436,7 +1436,7 @@ session_auth_agent_req(Session *s) void session_input_channel_req(int id, void *arg) { - unsigned int len; + u_int len; int reply; int success = 0; char *rtype; diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c index ce32ffdc990..634b5cb140c 100644 --- a/usr.bin/ssh/sftp-server.c +++ b/usr.bin/ssh/sftp-server.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: sftp-server.c,v 1.8 2000/12/19 22:43:44 markus Exp $"); +RCSID("$OpenBSD: sftp-server.c,v 1.9 2000/12/19 23:17:58 markus Exp $"); #include "ssh.h" #include "buffer.h" @@ -932,13 +932,13 @@ process_rename(void) void process(void) { - unsigned int msg_len; - unsigned int type; - unsigned char *cp; + u_int msg_len; + u_int type; + u_char *cp; if (buffer_len(&iqueue) < 5) return; /* Incomplete message. */ - cp = (unsigned char *) buffer_ptr(&iqueue); + cp = (u_char *) buffer_ptr(&iqueue); msg_len = GET_32BIT(cp); if (msg_len > 256 * 1024) { error("bad message "); diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c index 8ea84de470a..97d131447e7 100644 --- a/usr.bin/ssh/ssh-agent.c +++ b/usr.bin/ssh/ssh-agent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-agent.c,v 1.44 2000/12/19 22:43:45 markus Exp $ */ +/* $OpenBSD: ssh-agent.c,v 1.45 2000/12/19 23:17:58 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.44 2000/12/19 22:43:45 markus Exp $"); +RCSID("$OpenBSD: ssh-agent.c,v 1.45 2000/12/19 23:17:58 markus Exp $"); #include "ssh.h" #include "rsa.h" @@ -66,7 +66,7 @@ typedef struct { Buffer output; } SocketEntry; -unsigned int sockets_alloc = 0; +u_int sockets_alloc = 0; SocketEntry *sockets = NULL; typedef struct { @@ -147,8 +147,8 @@ process_request_identities(SocketEntry *e, int version) buffer_put_bignum(&msg, id->key->rsa->e); buffer_put_bignum(&msg, id->key->rsa->n); } else { - unsigned char *blob; - unsigned int blen; + u_char *blob; + u_int blen; key_to_blob(id->key, &blob, &blen); buffer_put_string(&msg, blob, blen); xfree(blob); @@ -169,8 +169,8 @@ process_authentication_challenge1(SocketEntry *e) int i, len; Buffer msg; MD5_CTX md; - unsigned char buf[32], mdbuf[16], session_id[16]; - unsigned int response_type; + u_char buf[32], mdbuf[16], session_id[16]; + u_int response_type; buffer_init(&msg); key = key_new(KEY_RSA1); @@ -231,8 +231,8 @@ process_sign_request2(SocketEntry *e) { extern int datafellows; Key *key, *private; - unsigned char *blob, *data, *signature = NULL; - unsigned int blen, dlen, slen = 0; + u_char *blob, *data, *signature = NULL; + u_int blen, dlen, slen = 0; int flags; Buffer msg; int ok = -1; @@ -275,9 +275,9 @@ void process_remove_identity(SocketEntry *e, int version) { Key *key = NULL, *private; - unsigned char *blob; - unsigned int blen; - unsigned int bits; + u_char *blob; + u_int blen; + u_int bits; int success = 0; switch(version){ @@ -335,7 +335,7 @@ process_remove_identity(SocketEntry *e, int version) void process_remove_all_identities(SocketEntry *e, int version) { - unsigned int i; + u_int i; Idtab *tab = idtab_lookup(version); /* Loop over all identities and clear the keys. */ @@ -459,12 +459,12 @@ send: void process_message(SocketEntry *e) { - unsigned int msg_len; - unsigned int type; - unsigned char *cp; + u_int msg_len; + u_int type; + u_char *cp; if (buffer_len(&e->input) < 5) return; /* Incomplete message. */ - cp = (unsigned char *) buffer_ptr(&e->input); + cp = (u_char *) buffer_ptr(&e->input); msg_len = GET_32BIT(cp); if (msg_len > 256 * 1024) { shutdown(e->fd, SHUT_RDWR); @@ -523,7 +523,7 @@ process_message(SocketEntry *e) void new_socket(int type, int fd) { - unsigned int i, old_alloc; + u_int i, old_alloc; if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0) error("fcntl O_NONBLOCK: %s", strerror(errno)); @@ -555,7 +555,7 @@ new_socket(int type, int fd) void prepare_select(fd_set *readset, fd_set *writeset) { - unsigned int i; + u_int i; for (i = 0; i < sockets_alloc; i++) switch (sockets[i].type) { case AUTH_SOCKET: @@ -575,7 +575,7 @@ prepare_select(fd_set *readset, fd_set *writeset) void after_select(fd_set *readset, fd_set *writeset) { - unsigned int i; + u_int i; int len, sock; socklen_t slen; char buf[1024]; diff --git a/usr.bin/ssh/ssh-dss.c b/usr.bin/ssh/ssh-dss.c index fea1fe2d5d0..96b1565d232 100644 --- a/usr.bin/ssh/ssh-dss.c +++ b/usr.bin/ssh/ssh-dss.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-dss.c,v 1.1 2000/11/12 19:50:38 markus Exp $"); +RCSID("$OpenBSD: ssh-dss.c,v 1.2 2000/12/19 23:17:58 markus Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -44,18 +44,18 @@ RCSID("$OpenBSD: ssh-dss.c,v 1.1 2000/11/12 19:50:38 markus Exp $"); int ssh_dss_sign( Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen) + u_char **sigp, int *lenp, + u_char *data, int datalen) { - unsigned char *digest; - unsigned char *ret; + u_char *digest; + u_char *ret; DSA_SIG *sig; EVP_MD *evp_md = EVP_sha1(); EVP_MD_CTX md; - unsigned int rlen; - unsigned int slen; - unsigned int len; - unsigned char sigblob[SIGBLOB_LEN]; + u_int rlen; + u_int slen; + u_int len; + u_char sigblob[SIGBLOB_LEN]; Buffer b; if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) { @@ -113,17 +113,17 @@ ssh_dss_sign( int ssh_dss_verify( Key *key, - unsigned char *signature, int signaturelen, - unsigned char *data, int datalen) + u_char *signature, int signaturelen, + u_char *data, int datalen) { Buffer b; - unsigned char *digest; + u_char *digest; DSA_SIG *sig; EVP_MD *evp_md = EVP_sha1(); EVP_MD_CTX md; - unsigned char *sigblob; + u_char *sigblob; char *txt; - unsigned int len, dlen; + u_int len, dlen; int rlen; int ret; @@ -159,7 +159,7 @@ ssh_dss_verify( buffer_free(&b); return -1; } - sigblob = (unsigned char *)buffer_get_string(&b, &len); + sigblob = (u_char *)buffer_get_string(&b, &len); rlen = buffer_len(&b); if(rlen != 0) { error("remaining bytes in signature %d", rlen); diff --git a/usr.bin/ssh/ssh-dss.h b/usr.bin/ssh/ssh-dss.h index 7b376e82f1f..4252f394210 100644 --- a/usr.bin/ssh/ssh-dss.h +++ b/usr.bin/ssh/ssh-dss.h @@ -27,13 +27,13 @@ int ssh_dss_sign( Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen); + u_char **sigp, int *lenp, + u_char *data, int datalen); int ssh_dss_verify( Key *key, - unsigned char *signature, int signaturelen, - unsigned char *data, int datalen); + u_char *signature, int signaturelen, + u_char *data, int datalen); #endif diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c index bfa68e428f3..f3d512cb92a 100644 --- a/usr.bin/ssh/ssh-keygen.c +++ b/usr.bin/ssh/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.35 2000/11/25 17:19:33 markus Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.36 2000/12/19 23:17:58 markus Exp $"); #include <openssl/evp.h> #include <openssl/pem.h> @@ -133,7 +133,7 @@ do_convert_to_ssh2(struct passwd *pw) { Key *k; int len; - unsigned char *blob; + u_char *blob; struct stat st; if (!have_identity) @@ -167,7 +167,7 @@ buffer_get_bignum_bits(Buffer *b, BIGNUM *value) int bytes = (bits + 7) / 8; if (buffer_len(b) < bytes) fatal("buffer_get_bignum_bits: input buffer too small"); - BN_bin2bn((unsigned char *)buffer_ptr(b), bytes, value); + BN_bin2bn((u_char *)buffer_ptr(b), bytes, value); buffer_consume(b, bytes); } @@ -271,7 +271,7 @@ do_convert_from_ssh2(struct passwd *pw) *p = '\0'; strlcat(encoded, line, sizeof(encoded)); } - blen = uudecode(encoded, (unsigned char *)blob, sizeof(blob)); + blen = uudecode(encoded, (u_char *)blob, sizeof(blob)); if (blen < 0) { fprintf(stderr, "uudecode failed.\n"); exit(1); @@ -328,7 +328,7 @@ do_fingerprint(struct passwd *pw) Key *public; char *comment = NULL, *cp, *ep, line[16*1024]; int i, skip = 0, num = 1, invalid = 1, success = 0; - unsigned int ignore; + u_int ignore; struct stat st; if (!have_identity) diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c index 5047c41411b..d66df82c5a4 100644 --- a/usr.bin/ssh/ssh-keyscan.c +++ b/usr.bin/ssh/ssh-keyscan.c @@ -8,7 +8,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.5 2000/12/19 22:48:08 markus Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.6 2000/12/19 23:17:58 markus Exp $"); #include <sys/queue.h> #include <errno.h> @@ -45,7 +45,7 @@ int ncon; * associated with file descriptor n is held in fdcon[n]. */ typedef struct Connection { - unsigned char c_status; /* State of connection on this file desc. */ + u_char c_status; /* State of connection on this file desc. */ #define CS_UNUSED 0 /* File descriptor unused */ #define CS_CON 1 /* Waiting to connect/read greeting */ #define CS_SIZE 2 /* Waiting to read initial packet size */ @@ -75,7 +75,7 @@ con *fdcon; typedef struct { char *buf; - unsigned int size; + u_int size; int lineno; const char *filename; FILE *stream; diff --git a/usr.bin/ssh/ssh-rsa.c b/usr.bin/ssh/ssh-rsa.c index cc31154d969..0f44051bcea 100644 --- a/usr.bin/ssh/ssh-rsa.c +++ b/usr.bin/ssh/ssh-rsa.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-rsa.c,v 1.1 2000/11/12 19:50:38 markus Exp $"); +RCSID("$OpenBSD: ssh-rsa.c,v 1.2 2000/12/19 23:17:58 markus Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -44,13 +44,13 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.1 2000/11/12 19:50:38 markus Exp $"); int ssh_rsa_sign( Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen) + u_char **sigp, int *lenp, + u_char *data, int datalen) { EVP_MD *evp_md = EVP_sha1(); EVP_MD_CTX md; - unsigned char *digest, *sig, *ret; - unsigned int slen, dlen, len; + u_char *digest, *sig, *ret; + u_int slen, dlen, len; int ok; Buffer b; @@ -109,15 +109,15 @@ ssh_rsa_sign( int ssh_rsa_verify( Key *key, - unsigned char *signature, int signaturelen, - unsigned char *data, int datalen) + u_char *signature, int signaturelen, + u_char *data, int datalen) { Buffer b; EVP_MD *evp_md = EVP_sha1(); EVP_MD_CTX md; char *ktype; - unsigned char *sigblob, *digest; - unsigned int len, dlen; + u_char *sigblob, *digest; + u_int len, dlen; int rlen; int ret; @@ -135,7 +135,7 @@ ssh_rsa_verify( return -1; } xfree(ktype); - sigblob = (unsigned char *)buffer_get_string(&b, &len); + sigblob = (u_char *)buffer_get_string(&b, &len); rlen = buffer_len(&b); buffer_free(&b); if(rlen != 0) { diff --git a/usr.bin/ssh/ssh-rsa.h b/usr.bin/ssh/ssh-rsa.h index 29a0c029c8e..fac96c72423 100644 --- a/usr.bin/ssh/ssh-rsa.h +++ b/usr.bin/ssh/ssh-rsa.h @@ -27,13 +27,13 @@ int ssh_rsa_sign( Key *key, - unsigned char **sigp, int *lenp, - unsigned char *data, int datalen); + u_char **sigp, int *lenp, + u_char *data, int datalen); int ssh_rsa_verify( Key *key, - unsigned char *signature, int signaturelen, - unsigned char *data, int datalen); + u_char *signature, int signaturelen, + u_char *data, int datalen); #endif diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 845df62b960..85e895136c4 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.77 2000/12/12 23:11:48 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.78 2000/12/19 23:17:58 markus Exp $"); #include <openssl/evp.h> #include <openssl/dsa.h> @@ -378,10 +378,10 @@ main(int ac, char **av) break; case 'e': if (optarg[0] == '^' && optarg[2] == 0 && - (unsigned char) optarg[1] >= 64 && (unsigned char) optarg[1] < 128) - options.escape_char = (unsigned char) optarg[1] & 31; + (u_char) optarg[1] >= 64 && (u_char) optarg[1] < 128) + options.escape_char = (u_char) optarg[1] & 31; else if (strlen(optarg) == 1) - options.escape_char = (unsigned char) optarg[0]; + options.escape_char = (u_char) optarg[0]; else if (strcmp(optarg, "none") == 0) options.escape_char = -2; else { diff --git a/usr.bin/ssh/ssh.h b/usr.bin/ssh/ssh.h index 67df3d43208..b3252639ecf 100644 --- a/usr.bin/ssh/ssh.h +++ b/usr.bin/ssh/ssh.h @@ -12,7 +12,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/* RCSID("$OpenBSD: ssh.h,v 1.55 2000/11/25 17:19:33 markus Exp $"); */ +/* RCSID("$OpenBSD: ssh.h,v 1.56 2000/12/19 23:17:58 markus Exp $"); */ #ifndef SSH_H #define SSH_H @@ -252,9 +252,9 @@ * information is not available. This must be called before record_login. * The host from which the user logged in is stored in buf. */ -unsigned long +u_long get_last_login_time(uid_t uid, const char *logname, - char *buf, unsigned int bufsize); + char *buf, u_int bufsize); /* * Records that the user has logged in. This does many things normally done @@ -333,7 +333,7 @@ int auth_rsa(struct passwd * pw, BIGNUM * client_n); * 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, unsigned int *bitsp, BIGNUM * e, BIGNUM * n); +int auth_rsa_read_key(char **cpp, u_int *bitsp, BIGNUM * e, BIGNUM * n); /* * Returns the name of the machine at the other end of the socket. The @@ -496,7 +496,7 @@ int auth_krb4_password(struct passwd * pw, const char *password); int auth_kerberos_tgt(struct passwd * pw, const char *string); int auth_afs_token(struct passwd * pw, const char *token_string); -int creds_to_radix(CREDENTIALS * creds, unsigned char *buf, size_t buflen); +int creds_to_radix(CREDENTIALS * creds, u_char *buf, size_t buflen); int radix_to_creds(const char *buf, CREDENTIALS * creds); #endif /* AFS */ diff --git a/usr.bin/ssh/sshconnect1.c b/usr.bin/ssh/sshconnect1.c index f95c031da7e..d6230529f2a 100644 --- a/usr.bin/ssh/sshconnect1.c +++ b/usr.bin/ssh/sshconnect1.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect1.c,v 1.12 2000/12/10 17:01:53 markus Exp $"); +RCSID("$OpenBSD: sshconnect1.c,v 1.13 2000/12/19 23:17:58 markus Exp $"); #include <openssl/bn.h> #include <openssl/dsa.h> @@ -34,8 +34,8 @@ RCSID("$OpenBSD: sshconnect1.c,v 1.12 2000/12/10 17:01:53 markus Exp $"); #include "authfile.h" /* Session id for the current session. */ -unsigned char session_id[16]; -unsigned int supported_authentications = 0; +u_char session_id[16]; +u_int supported_authentications = 0; extern Options options; extern char *__progname; @@ -50,8 +50,8 @@ try_agent_authentication() int type; char *comment; AuthenticationConnection *auth; - unsigned char response[16]; - unsigned int i; + u_char response[16]; + u_int i; int plen, clen; Key *key; BIGNUM *challenge; @@ -146,7 +146,7 @@ try_agent_authentication() void respond_to_rsa_challenge(BIGNUM * challenge, RSA * prv) { - unsigned char buf[32], response[16]; + u_char buf[32], response[16]; MD5_CTX md; int i, len; @@ -441,7 +441,7 @@ try_kerberos_authentication() debug("Kerberos V4 authentication accepted."); /* Get server's response. */ - reply = packet_get_string((unsigned int *) &auth.length); + reply = packet_get_string((u_int *) &auth.length); memcpy(auth.dat, reply, auth.length); xfree(reply); @@ -506,7 +506,7 @@ send_kerberos_tgt() debug("Kerberos V4 ticket expired: %s", TKT_FILE); return 0; } - creds_to_radix(creds, (unsigned char *)buffer, sizeof buffer); + creds_to_radix(creds, (u_char *)buffer, sizeof buffer); xfree(creds); packet_start(SSH_CMSG_HAVE_KERBEROS_TGT); @@ -545,10 +545,10 @@ send_afs_tokens(void) p = buf; /* Get secret token. */ - memcpy(&creds.ticket_st.length, p, sizeof(unsigned int)); + memcpy(&creds.ticket_st.length, p, sizeof(u_int)); if (creds.ticket_st.length > MAX_KTXT_LEN) break; - p += sizeof(unsigned int); + p += sizeof(u_int); memcpy(creds.ticket_st.dat, p, creds.ticket_st.length); p += creds.ticket_st.length; @@ -574,7 +574,7 @@ send_afs_tokens(void) creds.pinst[0] = '\0'; /* Encode token, ship it off. */ - if (creds_to_radix(&creds, (unsigned char*) buffer, sizeof buffer) <= 0) + if (creds_to_radix(&creds, (u_char*) buffer, sizeof buffer) <= 0) break; packet_start(SSH_CMSG_HAVE_AFS_TOKEN); packet_put_string(buffer, strlen(buffer)); @@ -603,7 +603,7 @@ try_skey_authentication() { int type, i; int payload_len; - unsigned int clen; + u_int clen; char prompt[1024]; char *challenge, *response; @@ -702,10 +702,10 @@ ssh_kex(char *host, struct sockaddr *hostaddr) Key k; int bits, rbits; int ssh_cipher_default = SSH_CIPHER_3DES; - unsigned char session_key[SSH_SESSION_KEY_LENGTH]; - unsigned char cookie[8]; - unsigned int supported_ciphers; - unsigned int server_flags, client_flags; + u_char session_key[SSH_SESSION_KEY_LENGTH]; + u_char cookie[8]; + u_int supported_ciphers; + u_int server_flags, client_flags; int payload_len, clen, sum_len = 0; u_int32_t rand = 0; diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c index ea03622f46a..d98f6be1e18 100644 --- a/usr.bin/ssh/sshconnect2.c +++ b/usr.bin/ssh/sshconnect2.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect2.c,v 1.31 2000/12/15 17:30:14 provos Exp $"); +RCSID("$OpenBSD: sshconnect2.c,v 1.32 2000/12/19 23:17:58 markus Exp $"); #include <openssl/bn.h> #include <openssl/rsa.h> @@ -63,7 +63,7 @@ extern Options options; * SSH2 key exchange */ -unsigned char *session_id2 = NULL; +u_char *session_id2 = NULL; int session_id2_len = 0; void @@ -151,17 +151,17 @@ ssh_dh1_client(Kex *kex, char *host, struct sockaddr *hostaddr, int i; #endif int plen, dlen; - unsigned int klen, kout; + u_int klen, kout; char *signature = NULL; - unsigned int slen; + u_int slen; char *server_host_key_blob = NULL; Key *server_host_key; - unsigned int sbloblen; + u_int sbloblen; DH *dh; BIGNUM *dh_server_pub = 0; BIGNUM *shared_secret = 0; - unsigned char *kbuf; - unsigned char *hash; + u_char *kbuf; + u_char *hash; debug("Sending SSH2_MSG_KEXDH_INIT."); /* generate and send 'e', client DH public key */ @@ -253,7 +253,7 @@ ssh_dh1_client(Kex *kex, char *host, struct sockaddr *hostaddr, fprintf(stderr, "%02x", (hash[i])&0xff); fprintf(stderr, "\n"); #endif - if (key_verify(server_host_key, (unsigned char *)signature, slen, hash, 20) != 1) + if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) fatal("key_verify failed for server_host_key"); key_free(server_host_key); @@ -295,18 +295,18 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr, int i; #endif int plen, dlen; - unsigned int klen, kout; + u_int klen, kout; char *signature = NULL; - unsigned int slen, nbits; + u_int slen, nbits; char *server_host_key_blob = NULL; Key *server_host_key; - unsigned int sbloblen; + u_int sbloblen; DH *dh; BIGNUM *dh_server_pub = 0; BIGNUM *shared_secret = 0; BIGNUM *p = 0, *g = 0; - unsigned char *kbuf; - unsigned char *hash; + u_char *kbuf; + u_char *hash; nbits = dh_estimate(kex->enc[MODE_OUT].cipher->key_len * 8); @@ -426,7 +426,7 @@ ssh_dhgex_client(Kex *kex, char *host, struct sockaddr *hostaddr, fprintf(stderr, "%02x", (hash[i])&0xff); fprintf(stderr, "\n"); #endif - if (key_verify(server_host_key, (unsigned char *)signature, slen, hash, 20) != 1) + if (key_verify(server_host_key, (u_char *)signature, slen, hash, 20) != 1) fatal("key_verify failed for server_host_key"); key_free(server_host_key); @@ -448,7 +448,7 @@ typedef struct Authmethod Authmethod; typedef int sign_cb_fn( Authctxt *authctxt, Key *key, - unsigned char **sigp, int *lenp, unsigned char *data, int datalen); + u_char **sigp, int *lenp, u_char *data, int datalen); struct Authctxt { const char *server_user; @@ -644,7 +644,7 @@ int sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback) { Buffer b; - unsigned char *blob, *signature; + u_char *blob, *signature; int bloblen, slen; int skip = 0; int ret = -1; @@ -725,8 +725,8 @@ sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback) } /* sign callback */ -int key_sign_cb(Authctxt *authctxt, Key *key, unsigned char **sigp, int *lenp, - unsigned char *data, int datalen) +int key_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, int *lenp, + u_char *data, int datalen) { return key_sign(key, sigp, lenp, data, datalen); } @@ -777,8 +777,8 @@ userauth_pubkey_identity(Authctxt *authctxt, char *filename) } /* sign callback */ -int agent_sign_cb(Authctxt *authctxt, Key *key, unsigned char **sigp, int *lenp, - unsigned char *data, int datalen) +int agent_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, int *lenp, + u_char *data, int datalen) { return ssh_agent_sign(authctxt->agent, key, sigp, lenp, data, datalen); } @@ -869,7 +869,7 @@ input_userauth_info_req(int type, int plen, void *ctxt) char *lang = NULL; char *prompt = NULL; char *response = NULL; - unsigned int num_prompts, i; + u_int num_prompts, i; int echo = 0; debug2("input_userauth_info_req"); diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 7e89dd057ba..0ba1dc677b2 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -40,7 +40,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.139 2000/12/15 17:30:14 provos Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.140 2000/12/19 23:17:59 markus Exp $"); #include "xmalloc.h" #include "rsa.h" @@ -153,14 +153,14 @@ int key_used = 0; int received_sighup = 0; /* session identifier, used by RSA-auth */ -unsigned char session_id[16]; +u_char session_id[16]; /* same for ssh2 */ -unsigned char *session_id2 = NULL; +u_char *session_id2 = NULL; int session_id2_len = 0; /* record remote hostname or ip */ -unsigned int utmp_len = MAXHOSTNAMELEN; +u_int utmp_len = MAXHOSTNAMELEN; /* Prototypes for various functions defined later in this file. */ void do_ssh1_kex(); @@ -864,7 +864,7 @@ main(int ac, char **av) */ f = fopen(options.pid_file, "w"); if (f) { - fprintf(f, "%u\n", (unsigned int) getpid()); + fprintf(f, "%u\n", (u_int) getpid()); fclose(f); } } @@ -1153,9 +1153,9 @@ do_ssh1_kex() int i, len; int plen, slen; BIGNUM *session_key_int; - unsigned char session_key[SSH_SESSION_KEY_LENGTH]; - unsigned char cookie[8]; - unsigned int cipher_type, auth_mask, protocol_flags; + u_char session_key[SSH_SESSION_KEY_LENGTH]; + u_char cookie[8]; + u_int cipher_type, auth_mask, protocol_flags; u_int32_t rand = 0; /* @@ -1412,12 +1412,12 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) #endif int payload_len, dlen; int slen; - unsigned char *signature = NULL; - unsigned char *server_host_key_blob = NULL; - unsigned int sbloblen; - unsigned int klen, kout; - unsigned char *kbuf; - unsigned char *hash; + u_char *signature = NULL; + u_char *server_host_key_blob = NULL; + u_int sbloblen; + u_int klen, kout; + u_char *kbuf; + u_char *hash; BIGNUM *shared_secret = 0; DH *dh; BIGNUM *dh_client_pub = 0; @@ -1541,12 +1541,12 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) #endif int payload_len, dlen; int slen, nbits; - unsigned char *signature = NULL; - unsigned char *server_host_key_blob = NULL; - unsigned int sbloblen; - unsigned int klen, kout; - unsigned char *kbuf; - unsigned char *hash; + u_char *signature = NULL; + u_char *server_host_key_blob = NULL; + u_int sbloblen; + u_int klen, kout; + u_char *kbuf; + u_char *hash; BIGNUM *shared_secret = 0; DH *dh; BIGNUM *dh_client_pub = 0; diff --git a/usr.bin/ssh/tildexpand.c b/usr.bin/ssh/tildexpand.c index f25f7d96b26..b091d51ec0b 100644 --- a/usr.bin/ssh/tildexpand.c +++ b/usr.bin/ssh/tildexpand.c @@ -11,7 +11,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: tildexpand.c,v 1.8 2000/09/07 20:27:55 deraadt Exp $"); +RCSID("$OpenBSD: tildexpand.c,v 1.9 2000/12/19 23:17:59 markus Exp $"); #include "xmalloc.h" #include "ssh.h" @@ -24,7 +24,7 @@ char * tilde_expand_filename(const char *filename, uid_t my_uid) { const char *cp; - unsigned int userlen; + u_int userlen; char *expanded; struct passwd *pw; char user[100]; diff --git a/usr.bin/ssh/uuencode.c b/usr.bin/ssh/uuencode.c index 38de418a26a..6ff29e9865f 100644 --- a/usr.bin/ssh/uuencode.c +++ b/usr.bin/ssh/uuencode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uuencode.c,v 1.7 2000/09/07 20:27:55 deraadt Exp $ */ +/* $OpenBSD: uuencode.c,v 1.8 2000/12/19 23:17:59 markus Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -29,17 +29,17 @@ #include <resolv.h> -RCSID("$OpenBSD: uuencode.c,v 1.7 2000/09/07 20:27:55 deraadt Exp $"); +RCSID("$OpenBSD: uuencode.c,v 1.8 2000/12/19 23:17:59 markus Exp $"); int -uuencode(unsigned char *src, unsigned int srclength, +uuencode(u_char *src, u_int srclength, char *target, size_t targsize) { return __b64_ntop(src, srclength, target, targsize); } int -uudecode(const char *src, unsigned char *target, size_t targsize) +uudecode(const char *src, u_char *target, size_t targsize) { int len; char *encoded, *p; @@ -59,9 +59,9 @@ uudecode(const char *src, unsigned char *target, size_t targsize) } void -dump_base64(FILE *fp, unsigned char *data, int len) +dump_base64(FILE *fp, u_char *data, int len) { - unsigned char *buf = xmalloc(2*len); + u_char *buf = xmalloc(2*len); int i, n; n = uuencode(data, len, buf, 2*len); for (i = 0; i < n; i++) { diff --git a/usr.bin/ssh/uuencode.h b/usr.bin/ssh/uuencode.h index dca80ec1adf..2972e2d0c7d 100644 --- a/usr.bin/ssh/uuencode.h +++ b/usr.bin/ssh/uuencode.h @@ -24,7 +24,7 @@ #ifndef UUENCODE_H #define UUENCODE_H -int uuencode(unsigned char *src, unsigned int srclength, char *target, size_t targsize); -int uudecode(const char *src, unsigned char *target, size_t targsize); -void dump_base64(FILE *fp, unsigned char *data, int len); +int uuencode(u_char *src, u_int srclength, char *target, size_t targsize); +int uudecode(const char *src, u_char *target, size_t targsize); +void dump_base64(FILE *fp, u_char *data, int len); #endif |