From f472818dbd4776623983e221752ec18aa17afe85 Mon Sep 17 00:00:00 2001 From: jbasney Date: Tue, 7 Mar 2006 21:53:09 +0000 Subject: [PATCH] minimize diffs with Simon's patch --- openssh/Makefile.in | 3 ++- openssh/channels.c | 2 +- openssh/gss-genr.c | 7 +------ openssh/kexgssc.c | 18 ++++++------------ openssh/kexgsss.c | 5 ++--- openssh/readconf.c | 3 ++- 6 files changed, 14 insertions(+), 24 deletions(-) diff --git a/openssh/Makefile.in b/openssh/Makefile.in index 4a6c1e5..4d7f6e8 100644 --- a/openssh/Makefile.in +++ b/openssh/Makefile.in @@ -85,7 +85,8 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ auth2-none.o auth2-passwd.o auth2-pubkey.o \ monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o \ auth-krb5.o \ - auth2-gss.o gss-serv.o gss-serv-krb5.o gss-serv-gsi.o kexgsss.o \ + auth2-gss.o gss-serv.o gss-serv-krb5.o kexgsss.o\ + gss-serv-gsi.o \ loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ audit.o audit-bsm.o diff --git a/openssh/channels.c b/openssh/channels.c index b7f36d0..eead4bd 100644 --- a/openssh/channels.c +++ b/openssh/channels.c @@ -749,7 +749,7 @@ static void channel_pre_open(Channel *c, fd_set * readset, fd_set * writeset) { u_int limit = compat20 ? c->remote_window : packet_get_maxsize(); - + /* check buffer limits */ limit = MIN(limit, (BUFFER_MAX_HPN_LEN - BUFFER_MAX_CHUNK - CHAN_RBUF)); diff --git a/openssh/gss-genr.c b/openssh/gss-genr.c index 12ceb04..9bc2a84 100644 --- a/openssh/gss-genr.c +++ b/openssh/gss-genr.c @@ -29,13 +29,8 @@ #ifdef GSSAPI #include "xmalloc.h" -#include "buffer.h" #include "bufaux.h" -#include "compat.h" -#include -#include "kex.h" #include "log.h" -#include "monitor_wrap.h" #include "canohost.h" #include "ssh2.h" #include @@ -90,7 +85,7 @@ ssh_gssapi_kex_mechs(gss_OID_set gss_supported, ssh_gssapi_check_fn *check, size_t i; int oidpos, enclen; char *mechs, *encoded; - unsigned char digest[EVP_MAX_MD_SIZE]; + u_char digest[EVP_MAX_MD_SIZE]; char deroid[2]; const EVP_MD *evp_md = EVP_md5(); EVP_MD_CTX md; diff --git a/openssh/kexgssc.c b/openssh/kexgssc.c index f5a769c..8793f40 100644 --- a/openssh/kexgssc.c +++ b/openssh/kexgssc.c @@ -46,24 +46,20 @@ kexgss_client(Kex *kex) { gss_buffer_desc recv_tok, gssbuf, msg_tok, *token_ptr; Gssctxt *ctxt; OM_uint32 maj_status, min_status, ret_flags; - unsigned int klen, kout; + u_int klen, kout, slen = 0, hashlen, strlen; DH *dh; BIGNUM *dh_server_pub = NULL; BIGNUM *shared_secret = NULL; BIGNUM *p = NULL; BIGNUM *g = NULL; - unsigned char *kbuf; - unsigned char *hash; - unsigned int hashlen; - unsigned char *serverhostkey = NULL; + u_char *kbuf, *hash; + u_char *serverhostkey = NULL; char *msg; char *lang; int type = 0; int first = 1; - unsigned int slen = 0; int gex = 0; - int nbits = -1, min = -1, max = -1; - u_int strlen; + int nbits = 0, min = DH_GRP_MIN, max = DH_GRP_MAX; /* Initialise our GSSAPI world */ ssh_gssapi_build_ctx(&ctxt); @@ -76,8 +72,6 @@ kexgss_client(Kex *kex) { if (gex) { debug("Doing group exchange\n"); nbits = dh_estimate(kex->we_need * 8); - min = DH_GRP_MIN; - max = DH_GRP_MAX; packet_start(SSH2_MSG_KEXGSS_GROUPREQ); packet_put_int(min); packet_put_int(nbits); @@ -274,7 +268,7 @@ kexgss_client(Kex *kex) { } gssbuf.value = hash; - gssbuf.length = 20; + gssbuf.length = hashlen; /* Verify that the hash matches the MIC we just got. */ if (GSS_ERROR(ssh_gssapi_checkmic(ctxt, &gssbuf, &msg_tok))) @@ -289,7 +283,7 @@ kexgss_client(Kex *kex) { /* save session id */ if (kex->session_id == NULL) { - kex->session_id_len = 20; + kex->session_id_len = hashlen; kex->session_id = xmalloc(kex->session_id_len); memcpy(kex->session_id, hash, kex->session_id_len); } diff --git a/openssh/kexgsss.c b/openssh/kexgsss.c index a860409..4e93cb8 100644 --- a/openssh/kexgsss.c +++ b/openssh/kexgsss.c @@ -58,15 +58,14 @@ kexgss_server(Kex *kex) gss_buffer_desc gssbuf, recv_tok, msg_tok; gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER; Gssctxt *ctxt = NULL; - unsigned int klen, kout, hashlen; - unsigned char *kbuf, *hash; + u_int slen, klen, kout, hashlen; + u_char *kbuf, *hash; DH *dh; int min = -1, max = -1, nbits = -1; BIGNUM *shared_secret = NULL; BIGNUM *dh_client_pub = NULL; int type = 0; int gex; - u_int slen; gss_OID oid; /* Initialise GSSAPI */ diff --git a/openssh/readconf.c b/openssh/readconf.c index 1585570..2377bb1 100644 --- a/openssh/readconf.c +++ b/openssh/readconf.c @@ -108,7 +108,8 @@ typedef enum { oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, oClearAllForwardings, oNoHostAuthenticationForLocalhost, oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout, - oAddressFamily, oGssAuthentication, oGssKeyEx, oGssDelegateCreds, + oAddressFamily, oGssAuthentication, oGssDelegateCreds, + oGssKeyEx, oGssTrustDns, oServerAliveInterval, oServerAliveCountMax, oIdentitiesOnly, oSendEnv, oControlPath, oControlMaster, oHashKnownHosts, -- 2.45.2