From 3548428432d86d072333b369df2f3622b653b4c4 Mon Sep 17 00:00:00 2001 From: damien Date: Sun, 16 Apr 2000 02:31:48 +0000 Subject: [PATCH] - Reduce diff against OpenBSD source - All OpenSSL includes are now unconditionally referenced as openssl/foo.h - Pick up formatting changes - Other minor changed (typecasts, etc) that I missed --- ChangeLog | 7 +++++++ acconfig.h | 3 --- atomicio.c | 2 +- auth-rh-rsa.c | 13 ++----------- auth-rsa.c | 6 ------ auth-skey.c | 9 +-------- authfd.c | 5 ----- authfile.c | 6 ------ bufaux.c | 19 ++++++------------- buffer.h | 12 ++++++------ cipher.c | 5 ----- cipher.h | 10 ---------- configure.in | 21 --------------------- entropy.c | 10 ++-------- fingerprint.c | 5 ----- hostfile.c | 13 ++----------- includes.h | 3 +++ kex.h | 11 ----------- key.c | 13 +------------ md5crypt.c | 7 ------- mpaux.c | 8 +------- packet.c | 14 +++----------- packet.h | 5 ----- rsa.h | 11 ----------- session.c | 6 ++++-- ssh-agent.c | 5 ----- sshconnect.c | 17 +++++------------ sshd.c | 19 +++++-------------- 28 files changed, 49 insertions(+), 216 deletions(-) diff --git a/ChangeLog b/ChangeLog index f23250ed..e921e227 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +20000416 + - Reduce diff against OpenBSD source + - All OpenSSL includes are now unconditionally referenced as + openssl/foo.h + - Pick up formatting changes + - Other minor changed (typecasts, etc) that I missed + 20000415 - OpenBSD CVS updates. [ssh.1 ssh.c] diff --git a/acconfig.h b/acconfig.h index cbb3a97c..b0420e7f 100644 --- a/acconfig.h +++ b/acconfig.h @@ -30,9 +30,6 @@ /* Define if you want to install preformatted manpages.*/ #undef MANTYPE -/* Define if your ssl headers are included with #include */ -#undef HAVE_SSL - /* Define if your ssl headers are included with #include */ #undef HAVE_OPENSSL diff --git a/atomicio.c b/atomicio.c index f9a36487..1060dc0e 100644 --- a/atomicio.c +++ b/atomicio.c @@ -43,7 +43,7 @@ atomicio(f, fd, _s, n) ssize_t res, pos = 0; while (n > pos) { - res = (f) (fd, (char*)s + pos, n - pos); + res = (f) (fd, s + pos, n - pos); switch (res) { case -1: if (errno == EINTR || errno == EAGAIN) diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c index b2730d6b..52ce688c 100644 --- a/auth-rh-rsa.c +++ b/auth-rh-rsa.c @@ -17,23 +17,14 @@ #include "includes.h" RCSID("$Id$"); -#ifdef HAVE_OPENSSL -#include -#include -#include -#endif -#ifdef HAVE_SSL -#include -#include -#include -#endif - #include "packet.h" #include "ssh.h" #include "xmalloc.h" #include "uidswap.h" #include "servconf.h" +#include +#include #include "key.h" #include "hostfile.h" diff --git a/auth-rsa.c b/auth-rsa.c index 5fcdae4c..1e8c947f 100644 --- a/auth-rsa.c +++ b/auth-rsa.c @@ -27,14 +27,8 @@ RCSID("$Id$"); #include "match.h" #include "servconf.h" -#ifdef HAVE_OPENSSL #include #include -#endif -#ifdef HAVE_SSL -#include -#include -#endif /* Flags that may be set in authorized_keys options. */ extern int no_port_forwarding_flag; diff --git a/auth-skey.c b/auth-skey.c index 7082d0c8..16b06bf3 100644 --- a/auth-skey.c +++ b/auth-skey.c @@ -1,17 +1,10 @@ #include "includes.h" - #ifdef SKEY RCSID("$Id$"); #include "ssh.h" #include "packet.h" - -#ifdef HAVE_OPENSSL -#include -#endif -#ifdef HAVE_SSL -#include -#endif +#include /* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */ diff --git a/authfd.c b/authfd.c index 52a0ee5b..bea66557 100644 --- a/authfd.c +++ b/authfd.c @@ -24,12 +24,7 @@ RCSID("$Id$"); #include "xmalloc.h" #include "getput.h" -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif /* Returns the number of the authentication fd, or -1 if there is none. */ diff --git a/authfile.c b/authfile.c index 79c14d22..2998cc59 100644 --- a/authfile.c +++ b/authfile.c @@ -17,13 +17,7 @@ #include "includes.h" RCSID("$Id$"); -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif - #include "xmalloc.h" #include "buffer.h" #include "bufaux.h" diff --git a/bufaux.c b/bufaux.c index def645fc..29ff477f 100644 --- a/bufaux.c +++ b/bufaux.c @@ -20,14 +20,7 @@ RCSID("$Id$"); #include "ssh.h" - -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif - #include "bufaux.h" #include "xmalloc.h" #include "getput.h" @@ -131,7 +124,7 @@ buffer_get_bignum2(Buffer *buffer, BIGNUM *value) /* * Returns an integer from the buffer (4 bytes, msb first). */ -unsigned int +unsigned int buffer_get_int(Buffer *buffer) { unsigned char buf[4]; @@ -142,7 +135,7 @@ buffer_get_int(Buffer *buffer) /* * Stores an integer in the buffer in 4 bytes, msb first. */ -void +void buffer_put_int(Buffer *buffer, unsigned int value) { char buf[4]; @@ -182,13 +175,13 @@ buffer_get_string(Buffer *buffer, unsigned int *length_ptr) /* * Stores and arbitrary binary string in the buffer. */ -void +void buffer_put_string(Buffer *buffer, const void *buf, unsigned int len) { buffer_put_int(buffer, len); buffer_append(buffer, buf, len); } -void +void buffer_put_cstring(Buffer *buffer, const char *s) { buffer_put_string(buffer, s, strlen(s)); @@ -197,7 +190,7 @@ buffer_put_cstring(Buffer *buffer, const char *s) /* * Returns a character from the buffer (0 - 255). */ -int +int buffer_get_char(Buffer *buffer) { char ch; @@ -208,7 +201,7 @@ buffer_get_char(Buffer *buffer) /* * Stores a character in the buffer. */ -void +void buffer_put_char(Buffer *buffer, int value) { char ch = value; diff --git a/buffer.h b/buffer.h index 4cdd2f91..ecab2add 100644 --- a/buffer.h +++ b/buffer.h @@ -1,16 +1,16 @@ /* - * + * * buffer.h - * + * * Author: Tatu Ylonen - * + * * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland * All rights reserved - * + * * Created: Sat Mar 18 04:12:25 1995 ylo - * + * * Code for manipulating FIFO buffers. - * + * */ /* RCSID("$Id$"); */ diff --git a/cipher.c b/cipher.c index 7122dfa8..361da070 100644 --- a/cipher.c +++ b/cipher.c @@ -18,12 +18,7 @@ RCSID("$Id$"); #include "cipher.h" #include "xmalloc.h" -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif /* * This is used by SSH1: diff --git a/cipher.h b/cipher.h index 37ca2517..9f7c8fdd 100644 --- a/cipher.h +++ b/cipher.h @@ -16,20 +16,10 @@ #ifndef CIPHER_H #define CIPHER_H -#include "config.h" - -#ifdef HAVE_OPENSSL #include #include #include #include -#endif -#ifdef HAVE_SSL -#include -#include -#include -#include -#endif /* Cipher types. New types can be added, but old types should not be removed for compatibility. The maximum allowed value is 31. */ diff --git a/configure.in b/configure.in index 3c26e3d7..b676193d 100644 --- a/configure.in +++ b/configure.in @@ -213,27 +213,6 @@ for ssldir in "" $tryssldir /usr/local/openssl /usr/lib/openssl /usr/local/ssl / break; ], [] ) - AC_TRY_RUN( - [ - #include - #include - #include - int main(void) - { - RSA *key; char a[2048],b[2048];; - memset(a, 0, sizeof(a));memset(b, 0, sizeof(b)); - RAND_seed(a, sizeof(a)); - key=RSA_generate_key(32,3,NULL,NULL); - if (key==NULL) return(1); - return(-1==RSA_private_decrypt(RSA_size(key),a,b,key,RSA_NO_PADDING)); - } - ], - [ - AC_DEFINE(HAVE_SSL) - found_crypto=1 - break; - ], [] - ) done if test ! -z "$found_crypto" ; then diff --git a/entropy.c b/entropy.c index dc01a595..f3a16419 100644 --- a/entropy.c +++ b/entropy.c @@ -32,14 +32,8 @@ #include "ssh.h" #include "xmalloc.h" -#ifdef HAVE_OPENSSL -# include -# include -#endif -#ifdef HAVE_SSL -# include -# include -#endif +#include +#include RCSID("$Id$"); diff --git a/fingerprint.c b/fingerprint.c index 57728482..88d99bfc 100644 --- a/fingerprint.c +++ b/fingerprint.c @@ -32,12 +32,7 @@ RCSID("$Id$"); #include "ssh.h" #include "xmalloc.h" -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif #define FPRINT "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x" diff --git a/hostfile.c b/hostfile.c index b027075a..29efe565 100644 --- a/hostfile.c +++ b/hostfile.c @@ -16,20 +16,11 @@ #include "includes.h" RCSID("$OpenBSD: hostfile.c,v 1.16 2000/04/14 10:30:31 markus Exp $"); -#ifdef HAVE_OPENSSL -#include -#include -#include -#endif -#ifdef HAVE_SSL -#include -#include -#include -#endif - #include "packet.h" #include "match.h" #include "ssh.h" +#include +#include #include "key.h" #include "hostfile.h" diff --git a/includes.h b/includes.h index 51226676..1a0e76f3 100644 --- a/includes.h +++ b/includes.h @@ -108,6 +108,9 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #include "fake-getnameinfo.h" #include "fake-socket.h" +/* Entropy collection */ +#include "entropy.h" + /* Define this to be the path of the xauth program. */ #ifndef XAUTH_PATH #define XAUTH_PATH "/usr/X11R6/bin/xauth" diff --git a/kex.h b/kex.h index 29e1e887..5395ebc3 100644 --- a/kex.h +++ b/kex.h @@ -29,17 +29,6 @@ #ifndef KEX_H #define KEX_H -#include "config.h" - -#ifdef HAVE_OPENSSL -# include -# include -#endif -#ifdef HAVE_SSL -# include -# include -#endif - #define KEX_DH1 "diffie-hellman-group1-sha1" #define KEX_DSS "ssh-dss" diff --git a/key.c b/key.c index 437a5e24..872313ab 100644 --- a/key.c +++ b/key.c @@ -32,21 +32,10 @@ */ #include "includes.h" - -#ifdef HAVE_OPENSSL -#include +#include "ssh.h" #include #include #include -#endif -#ifdef HAVE_SSL -#include -#include -#include -#include -#endif - -#include "ssh.h" #include "xmalloc.h" #include "key.h" diff --git a/md5crypt.c b/md5crypt.c index 16bcf33a..a9f0f26d 100644 --- a/md5crypt.c +++ b/md5crypt.c @@ -21,14 +21,7 @@ #include #include - -#ifdef HAVE_OPENSSL #include -#endif - -#ifdef HAVE_SSL -#include -#endif static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; diff --git a/mpaux.c b/mpaux.c index 21109083..4c8ee5ab 100644 --- a/mpaux.c +++ b/mpaux.c @@ -17,17 +17,11 @@ #include "includes.h" RCSID("$Id$"); +#include #include "getput.h" #include "xmalloc.h" -#ifdef HAVE_OPENSSL -#include #include -#endif -#ifdef HAVE_SSL -#include -#include -#endif void compute_session_id(unsigned char session_id[16], diff --git a/packet.c b/packet.c index 4000698c..6ff6417a 100644 --- a/packet.c +++ b/packet.c @@ -19,17 +19,6 @@ #include "includes.h" RCSID("$Id$"); -#ifdef HAVE_OPENSSL -# include -# include -# include -#endif /* HAVE_OPENSSL */ -#ifdef HAVE_SSL -# include -# include -# include -#endif /* HAVE_SSL */ - #include "xmalloc.h" #include "buffer.h" #include "packet.h" @@ -46,6 +35,9 @@ RCSID("$Id$"); #include "compat.h" #include "ssh2.h" +#include +#include +#include #include "buffer.h" #include "kex.h" #include "hmac.h" diff --git a/packet.h b/packet.h index 19d96274..86647f6a 100644 --- a/packet.h +++ b/packet.h @@ -18,12 +18,7 @@ #ifndef PACKET_H #define PACKET_H -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif /* * Sets the socket used for communication. Disables encryption until diff --git a/rsa.h b/rsa.h index 252a910c..bbe19cfa 100644 --- a/rsa.h +++ b/rsa.h @@ -18,19 +18,8 @@ #ifndef RSA_H #define RSA_H -#include "config.h" - -#ifdef HAVE_OPENSSL #include #include -#include -#endif - -#ifdef HAVE_SSL -#include -#include -#include -#endif /* Calls SSL RSA_generate_key, only copies to prv and pub */ void rsa_generate_key(RSA * prv, RSA * pub, unsigned int bits); diff --git a/session.c b/session.c index 8d8ff223..24bc25c6 100644 --- a/session.c +++ b/session.c @@ -1247,6 +1247,8 @@ session_pty_req(Session *s) /* Get window size from the packet. */ pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); + /* XXX parse and set terminal modes */ + xfree(term_modes); return 1; } @@ -1286,6 +1288,7 @@ session_input_channel_req(int id, void *arg) success = 1; } else if (strcmp(rtype, "exec") == 0) { char *command = packet_get_string(&len); + packet_done(); if (s->ttyfd == -1) do_exec_no_pty(s, command, s->pw); else @@ -1293,8 +1296,7 @@ session_input_channel_req(int id, void *arg) xfree(command); success = 1; } else if (strcmp(rtype, "pty-req") == 0) { - if (session_pty_req(s) > 0) - success = 1; + success = session_pty_req(s); } } if (strcmp(rtype, "window-change") == 0) { diff --git a/ssh-agent.c b/ssh-agent.c index 66439461..fac2a2c3 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -21,12 +21,7 @@ RCSID("$OpenBSD: ssh-agent.c,v 1.28 2000/04/14 10:30:33 markus Exp $"); #include "getput.h" #include "mpaux.h" -#ifdef HAVE_OPENSSL #include -#endif -#ifdef HAVE_SSL -#include -#endif typedef struct { int fd; diff --git a/sshconnect.c b/sshconnect.c index bca0bf43..3c5c990f 100644 --- a/sshconnect.c +++ b/sshconnect.c @@ -12,19 +12,7 @@ #include "includes.h" RCSID("$OpenBSD: sshconnect.c,v 1.68 2000/04/14 10:30:33 markus Exp $"); -#ifdef HAVE_OPENSSL #include -#include -#include -#include -#endif -#ifdef HAVE_SSL -#include -#include -#include -#include -#endif - #include "xmalloc.h" #include "rsa.h" #include "ssh.h" @@ -38,8 +26,13 @@ RCSID("$OpenBSD: sshconnect.c,v 1.68 2000/04/14 10:30:33 markus Exp $"); #include "readconf.h" #include "bufaux.h" +#include +#include #include "ssh2.h" +#include +#include +#include #include "kex.h" #include "myproposal.h" #include "key.h" diff --git a/sshd.c b/sshd.c index cc6bee96..c8508e93 100644 --- a/sshd.c +++ b/sshd.c @@ -29,21 +29,12 @@ RCSID("$OpenBSD: sshd.c,v 1.105 2000/04/14 10:30:33 markus Exp $"); #include "buffer.h" #include "ssh2.h" -#ifdef HAVE_OPENSSL -# include -# include -# include -# include -# include -#endif -#ifdef HAVE_SSL -# include -# include -# include -# include -# include -#endif +#include +#include +#include #include "kex.h" +#include +#include #include "key.h" #include "dsa.h" -- 2.45.1