aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssh
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2017-03-07 12:42:31 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-03-23 16:50:49 +0000
commitadecf80bc8f761eaf58245d98a41801e5b62c3d9 (patch)
tree524775b07e22752313b9e5b5392fd966a8135231 /main/openssh
parentd92d0c148dfe07c0dd08351fe7a72d5004e123ea (diff)
downloadaports-adecf80bc8f761eaf58245d98a41801e5b62c3d9.tar.bz2
aports-adecf80bc8f761eaf58245d98a41801e5b62c3d9.tar.xz
main/openssh: fix patches
fix hpn patches which was unintentionally disabled with commit 756f181a5 (main/openssh: support cross building and use default_prepare) rename *.diff to *.patch because *.diff are ignored by default_prepare
Diffstat (limited to 'main/openssh')
-rw-r--r--main/openssh/APKBUILD46
-rw-r--r--main/openssh/fix-utmp.patch (renamed from main/openssh/openssh-fix-utmp.diff)0
-rw-r--r--main/openssh/openssh7.4-dynwindows.patch (renamed from main/openssh/openssh7.1-dynwindows.diff)204
-rw-r--r--main/openssh/openssh7.4-peaktput.patch (renamed from main/openssh/openssh6.5-peaktput.diff)16
-rw-r--r--main/openssh/sftp-interactive.patch (renamed from main/openssh/openssh-sftp-interactive.diff)0
5 files changed, 103 insertions, 163 deletions
diff --git a/main/openssh/APKBUILD b/main/openssh/APKBUILD
index 1827764e6b..a7f1623a29 100644
--- a/main/openssh/APKBUILD
+++ b/main/openssh/APKBUILD
@@ -3,7 +3,7 @@
pkgname=openssh
pkgver=7.4_p1
_myver=${pkgver%_*}${pkgver#*_}
-pkgrel=1
+pkgrel=2
pkgdesc="Port of OpenBSD's free SSH release"
url="http://www.openssh.org/portable.html"
arch="all"
@@ -21,13 +21,13 @@ subpackages="$pkgname-doc
$pkgname-server
"
source="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar.gz
- openssh6.5-peaktput.diff
- openssh7.1-dynwindows.diff
- openssh-fix-utmp.diff
+ openssh7.4-peaktput.patch
+ openssh7.4-dynwindows.patch
+ fix-utmp.patch
bsd-compatible-realpath.patch
sshd.initd
sshd.confd
- openssh-sftp-interactive.diff
+ sftp-interactive.patch
"
# secfixes:
# 7.4_p1:
@@ -37,15 +37,9 @@ source="http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/$pkgname-$_myver.tar
# - CVE-2016-10012
# https://bugs.alpinelinux.org/issues/6583
-# HPN patches are from: http://www.psc.edu/index.php/hpn-ssh
+# HPN patches are from: http://hpnssh.sourceforge.net/
builddir="$srcdir"/$pkgname-$_myver
-prepare() {
- cd "$builddir"
- default_prepare
- sed -i -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
- pathnames.h || return 1
-}
build() {
cd "$builddir"
@@ -55,16 +49,16 @@ build() {
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc/ssh \
- --datadir=/usr/share/openssh \
--libexecdir=/usr/lib/ssh \
--mandir=/usr/share/man \
--with-pid-dir=/run \
--with-mantype=man \
--with-ldflags="${LDFLAGS}" \
- --disable-strip \
--disable-lastlog \
+ --disable-strip \
--disable-wtmp \
--with-privsep-path=/var/empty \
+ --with-xauth=/usr/bin/xauth \
--with-privsep-user=sshd \
--with-md5-passwords \
--with-ssl-engine \
@@ -146,27 +140,11 @@ server() {
}
-md5sums="b2db2a83caf66a208bb78d6d287cdaa3 openssh-7.4p1.tar.gz
-cd52fe99cb4b7d0d847bf5d710d93564 openssh6.5-peaktput.diff
-6337ad8a38783c8f1285cf4f97fc451f openssh7.1-dynwindows.diff
-37fbfe9cfb9a5e2454382ea8c79ed2e1 openssh-fix-utmp.diff
-e21243d6ddff1bb929eed3676b4b9a2a bsd-compatible-realpath.patch
-8ae02e304db5d42790b7269b03a8985f sshd.initd
-ccff4ede2075bcdaa070940cb4eadba2 sshd.confd
-2dd7e366607e95f9762273067309fd6e openssh-sftp-interactive.diff"
-sha256sums="1b1fc4a14e2024293181924ed24872e6f2e06293f3e8926a376b8aec481f19d1 openssh-7.4p1.tar.gz
-bf49212e47a86d10650f739532cea514a310925e6445b4f8011031b6b55f3249 openssh6.5-peaktput.diff
-861132af07c18f5e0ac7b64f389a929e61a051887bf44bda770a97e3afd9bfb6 openssh7.1-dynwindows.diff
-1c85437fd94aa4fc269e6297e4eb790baa98c39949ec0410792c09ee31ba9782 openssh-fix-utmp.diff
-a843cacd7002a68e9d09b5d8ea1466c9980fa35fa3ccd8d9357ac793017de2a6 bsd-compatible-realpath.patch
-18521d52f5e38d5820732356d210fb45922f7b848b7c9ca0bb3823de9e088e1d sshd.initd
-3342d2fc9b174f898f887237002f04fa9bc01c31e9a851e063ca7de8825ad0eb sshd.confd
-4ce1ad5f767c0f4e854a0cfeef0e2e400f333c649e552df1ecc317e6a6557376 openssh-sftp-interactive.diff"
sha512sums="4f3256f461f01366c5d5e0e45285eec65016e2643b3284b407f48f53d81087bf2c1caf7d5f7530d307a15c91c64de91446e1cba948e8fc68f82098290fe3b292 openssh-7.4p1.tar.gz
-e041398e177674f698480e23be037160bd07b751c754956a3ddf1b964da24c85e826fb75e7c23c9826d36761da73d08db9583c047d58a08dc7b2149a949075b1 openssh6.5-peaktput.diff
-72a7dc21d18388c635d14dda762ac50caeefd38f0153d8ea36d18e9d7c982e104f7b7a3af8c18fd479c31201fbdee1639f3a1ec60d035d4ca8721a8563fa11a0 openssh7.1-dynwindows.diff
-f35fffcd26635249ce5d820e7b3e406e586f2d2d7f6a045f221e2f9fb53aebc1ab1dd1e603b3389462296ed77921a1d08456e7aaa3825cbed08f405b381a58e1 openssh-fix-utmp.diff
+398096a89aa104abeff31aa043ac406a6348e0fdd4d313b7888ee0b931d38fd71fc21bceee46145e88f03bc27e00890e068442faee2d33f86cfbc04d58ffa4b6 openssh7.4-peaktput.patch
+b9d736eae9b43de91fa3eb277ba8abc6290a8436b0fb00ae3b0f1b2eabba9983e4d2a1e3c68f5514247d0a3f120037f0795fd88fbf302aabd2d1b54a325a04ee openssh7.4-dynwindows.patch
+f35fffcd26635249ce5d820e7b3e406e586f2d2d7f6a045f221e2f9fb53aebc1ab1dd1e603b3389462296ed77921a1d08456e7aaa3825cbed08f405b381a58e1 fix-utmp.patch
f2b8daa537ea3f32754a4485492cc6eb3f40133ed46c0a5a29a89e4bcf8583d82d891d94bf2e5eb1c916fa68ec094abf4e6cd641e9737a6c05053808012b3a73 bsd-compatible-realpath.patch
394a420a36880bb0dd37dfd8727cea91fd9de6534050169e21212a46513ef3aaafe2752c338699b3d4ccd14871b26cf01a152df8060cd37f86ce0665fd53c63f sshd.initd
ce0abddbd2004891f88efd8522c4b37a4989290269fab339c0fa9aacc051f7fd3b20813e192e92e0e64315750041cb74012d4321260f4865ff69d7a935b259d4 sshd.confd
-c1d09c65dbc347f0904edc30f91aa9a24b0baee50309536182455b544f1e3f85a8cecfa959e32be8b101d8282ef06dde3febbbc3f315489339dcf04155c859a9 openssh-sftp-interactive.diff"
+c1d09c65dbc347f0904edc30f91aa9a24b0baee50309536182455b544f1e3f85a8cecfa959e32be8b101d8282ef06dde3febbbc3f315489339dcf04155c859a9 sftp-interactive.patch"
diff --git a/main/openssh/openssh-fix-utmp.diff b/main/openssh/fix-utmp.patch
index 275e80590d..275e80590d 100644
--- a/main/openssh/openssh-fix-utmp.diff
+++ b/main/openssh/fix-utmp.patch
diff --git a/main/openssh/openssh7.1-dynwindows.diff b/main/openssh/openssh7.4-dynwindows.patch
index 933623ab2c..45c42159ea 100644
--- a/main/openssh/openssh7.1-dynwindows.diff
+++ b/main/openssh/openssh7.4-dynwindows.patch
@@ -1,5 +1,3 @@
-diff --git a/buffer.h b/buffer.h
-index df1aebc..898ecef 100644
--- a/buffer.h
+++ b/buffer.h
@@ -16,6 +16,9 @@
@@ -12,11 +10,9 @@ index df1aebc..898ecef 100644
/* Emulation wrappers for legacy OpenSSH buffer API atop sshbuf */
#ifndef BUFFER_H
-diff --git a/channels.c b/channels.c
-index a84b487..d4568ae 100644
--- a/channels.c
+++ b/channels.c
-@@ -186,8 +186,14 @@ static void port_open_helper(Channel *c, char *rtype);
+@@ -191,8 +191,14 @@
static int connect_next(struct channel_connect *);
static void channel_connect_ctx_free(struct channel_connect *);
@@ -31,7 +27,7 @@ index a84b487..d4568ae 100644
Channel *
channel_by_id(int id)
{
-@@ -336,6 +342,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
+@@ -356,6 +362,7 @@
c->local_window_max = window;
c->local_consumed = 0;
c->local_maxpacket = maxpack;
@@ -39,7 +35,7 @@ index a84b487..d4568ae 100644
c->remote_id = -1;
c->remote_name = xstrdup(remote_name);
c->remote_window = 0;
-@@ -840,11 +847,35 @@ channel_pre_open_13(Channel *c, fd_set *readset, fd_set *writeset)
+@@ -904,11 +911,35 @@
FD_SET(c->sock, writeset);
}
@@ -75,7 +71,7 @@ index a84b487..d4568ae 100644
if (c->istate == CHAN_INPUT_OPEN &&
limit > 0 &&
buffer_len(&c->input) < limit &&
-@@ -1862,14 +1893,21 @@ channel_check_window(Channel *c)
+@@ -1926,14 +1957,21 @@
c->local_maxpacket*3) ||
c->local_window < c->local_window_max/2) &&
c->local_consumed > 0) {
@@ -99,7 +95,7 @@ index a84b487..d4568ae 100644
c->local_consumed = 0;
}
return 1;
-@@ -2813,6 +2851,15 @@ channel_fwd_bind_addr(const char *listen_addr, int *wildcardp,
+@@ -3179,6 +3217,15 @@
return addr;
}
@@ -115,7 +111,7 @@ index a84b487..d4568ae 100644
static int
channel_setup_fwd_listener_tcpip(int type, struct Forward *fwd,
int *allocated_listen_port, struct ForwardOptions *fwd_opts)
-@@ -2941,9 +2988,15 @@ channel_setup_fwd_listener_tcpip(int type, struct Forward *fwd,
+@@ -3307,9 +3354,15 @@
}
/* Allocate a channel number for the socket. */
@@ -131,7 +127,7 @@ index a84b487..d4568ae 100644
c->path = xstrdup(host);
c->host_port = fwd->connect_port;
c->listening_addr = addr == NULL ? NULL : xstrdup(addr);
-@@ -3975,10 +4028,17 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
+@@ -4313,10 +4366,17 @@
*chanids = xcalloc(num_socks + 1, sizeof(**chanids));
for (n = 0; n < num_socks; n++) {
sock = socks[n];
@@ -149,11 +145,9 @@ index a84b487..d4568ae 100644
nc->single_connection = single_connection;
(*chanids)[n] = nc->self;
}
-diff --git a/channels.h b/channels.h
-index 9d76c9d..ecece7f 100644
--- a/channels.h
+++ b/channels.h
-@@ -134,8 +134,10 @@ struct Channel {
+@@ -135,8 +135,10 @@
u_int local_window_max;
u_int local_consumed;
u_int local_maxpacket;
@@ -164,7 +158,7 @@ index 9d76c9d..ecece7f 100644
char *ctype; /* type */
-@@ -171,8 +173,10 @@ struct Channel {
+@@ -173,8 +175,10 @@
/* default window/packet sizes for tcp/x11-fwd-channel */
#define CHAN_SES_PACKET_DEFAULT (32*1024)
#define CHAN_SES_WINDOW_DEFAULT (64*CHAN_SES_PACKET_DEFAULT)
@@ -175,19 +169,18 @@ index 9d76c9d..ecece7f 100644
#define CHAN_X11_PACKET_DEFAULT (16*1024)
#define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT)
-@@ -312,4 +316,7 @@ void chan_rcvd_ieof(Channel *);
+@@ -318,5 +322,8 @@
+ void chan_rcvd_ieof(Channel *);
void chan_write_failed(Channel *);
void chan_obuf_empty(Channel *);
-
++
+/* hpn handler */
+void channel_set_hpn(int, int);
-+
+
#endif
-diff --git a/clientloop.c b/clientloop.c
-index 87ceb3d..33c59cc 100644
--- a/clientloop.c
+++ b/clientloop.c
-@@ -1923,9 +1923,15 @@ client_request_x11(const char *request_type, int rchan)
+@@ -1990,9 +1990,15 @@
sock = x11_connect_display();
if (sock < 0)
return NULL;
@@ -203,7 +196,7 @@ index 87ceb3d..33c59cc 100644
c->force_drain = 1;
return c;
}
-@@ -1948,10 +1954,16 @@ client_request_agent(const char *request_type, int rchan)
+@@ -2015,10 +2021,16 @@
__func__, ssh_err(r));
return NULL;
}
@@ -221,7 +214,7 @@ index 87ceb3d..33c59cc 100644
c->force_drain = 1;
return c;
}
-@@ -1978,10 +1990,18 @@ client_request_tun_fwd(int tun_mode, int local_tun, int remote_tun)
+@@ -2045,9 +2057,17 @@
return -1;
}
@@ -235,14 +228,11 @@ index 87ceb3d..33c59cc 100644
+ options.hpn_buffer_size, CHAN_TCP_PACKET_DEFAULT,
+ 0, "tun", 1);
c->datagram = 1;
-
+
+
+
#if defined(SSH_TUN_FILTER)
if (options.tun_open == SSH_TUNMODE_POINTOPOINT)
- channel_register_filter(c->self, sys_tun_infilter,
-diff --git a/compat.c b/compat.c
-index 5583804..9b3d672 100644
--- a/compat.c
+++ b/compat.c
@@ -40,7 +40,7 @@
@@ -295,21 +285,19 @@ index 2be290a..453c85e 100644
-extern int datafellows;
+extern unsigned int datafellows;
#endif
-diff --git a/readconf.c b/readconf.c
-index 1d03bdf..78d815a 100644
--- a/readconf.c
+++ b/readconf.c
-@@ -158,6 +158,7 @@ typedef enum {
- oStreamLocalBindMask, oStreamLocalBindUnlink, oRevokedHostKeys,
- oFingerprintHash, oUpdateHostkeys, oHostbasedKeyTypes,
- oPubkeyAcceptedKeyTypes,
+@@ -154,6 +154,7 @@
+ oCompressionLevel, oTCPKeepAlive, oNumberOfPasswordPrompts,
+ oUsePrivilegedPort, oLogLevel, oCiphers, oProtocol, oMacs,
+ oPubkeyAuthentication,
+ oTcpRcvBufPoll, oTcpRcvBuf, oHPNDisabled, oHPNBufferSize,
- oIgnoredUnknownOption, oDeprecated, oUnsupported
- } OpCodes;
-
-@@ -279,6 +280,11 @@ static struct {
- { "pubkeyacceptedkeytypes", oPubkeyAcceptedKeyTypes },
+ oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias,
+ oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
+ oHostKeyAlgorithms, oBindAddress, oPKCS11Provider,
+@@ -297,6 +298,11 @@
{ "ignoreunknown", oIgnoreUnknown },
+ { "proxyjump", oProxyJump },
+ { "tcprcvbufpoll", oTcpRcvBufPoll },
+ { "tcprcvbuf", oTcpRcvBuf },
@@ -319,7 +307,7 @@ index 1d03bdf..78d815a 100644
{ NULL, oBadOption }
};
-@@ -906,6 +912,18 @@ parse_time:
+@@ -973,6 +979,18 @@
intptr = &options->check_host_ip;
goto parse_flag;
@@ -338,7 +326,7 @@ index 1d03bdf..78d815a 100644
case oVerifyHostKeyDNS:
intptr = &options->verify_host_key_dns;
multistate_ptr = multistate_yesnoask;
-@@ -1069,6 +1087,10 @@ parse_int:
+@@ -1165,6 +1183,10 @@
intptr = &options->connection_attempts;
goto parse_int;
@@ -349,7 +337,7 @@ index 1d03bdf..78d815a 100644
case oCipher:
intptr = &options->cipher;
arg = strdelim(&s);
-@@ -1665,6 +1687,10 @@ initialize_options(Options * options)
+@@ -1845,6 +1867,10 @@
options->ip_qos_interactive = -1;
options->ip_qos_bulk = -1;
options->request_tty = -1;
@@ -360,7 +348,7 @@ index 1d03bdf..78d815a 100644
options->proxy_use_fdpass = -1;
options->ignored_unknown = NULL;
options->num_canonical_domains = 0;
-@@ -1817,6 +1843,28 @@ fill_default_options(Options * options)
+@@ -2008,6 +2034,28 @@
options->server_alive_interval = 0;
if (options->server_alive_count_max == -1)
options->server_alive_count_max = 3;
@@ -389,8 +377,6 @@ index 1d03bdf..78d815a 100644
if (options->control_master == -1)
options->control_master = 0;
if (options->control_persist == -1) {
-diff --git a/readconf.h b/readconf.h
-index bb2d552..6aec47e 100644
--- a/readconf.h
+++ b/readconf.h
@@ -57,6 +57,10 @@ typedef struct {
@@ -404,11 +390,9 @@ index bb2d552..6aec47e 100644
int ip_qos_interactive; /* IP ToS/DSCP/class for interactive */
int ip_qos_bulk; /* IP ToS/DSCP/class for bulk traffic */
LogLevel log_level; /* Level for logging. */
-diff --git a/scp.c b/scp.c
-index 593fe89..c6922ee 100644
--- a/scp.c
+++ b/scp.c
-@@ -750,7 +750,7 @@ source(int argc, char **argv)
+@@ -763,7 +763,7 @@
off_t i, statbytes;
size_t amt, nr;
int fd = -1, haderr, indx;
@@ -417,20 +401,18 @@ index 593fe89..c6922ee 100644
int len;
for (indx = 0; indx < argc; ++indx) {
-@@ -919,7 +919,7 @@ sink(int argc, char **argv)
+@@ -931,7 +931,7 @@
off_t size, statbytes;
unsigned long long ull;
int setimes, targisdir, wrerrno = 0;
-- char ch, *cp, *np, *targ, *why, *vect[1], buf[2048];
-+ char ch, *cp, *np, *targ, *why, *vect[1], buf[16384];
+- char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048];
++ char ch, *cp, *np, *targ, *why, *vect[1], buf[16384], visbuf[16384];
struct timeval tv[2];
#define atime tv[0]
-diff --git a/servconf.c b/servconf.c
-index 6c7a91e..1499b6f 100644
--- a/servconf.c
+++ b/servconf.c
-@@ -165,6 +165,9 @@ initialize_server_options(ServerOptions *options)
+@@ -159,6 +159,9 @@
options->authorized_principals_file = NULL;
options->authorized_principals_command = NULL;
options->authorized_principals_command_user = NULL;
@@ -440,7 +422,7 @@ index 6c7a91e..1499b6f 100644
options->ip_qos_interactive = -1;
options->ip_qos_bulk = -1;
options->version_addendum = NULL;
-@@ -181,6 +184,7 @@ option_clear_or_none(const char *o)
+@@ -190,6 +193,7 @@
void
fill_default_server_options(ServerOptions *options)
{
@@ -448,7 +430,7 @@ index 6c7a91e..1499b6f 100644
int i;
/* Portable-specific options */
-@@ -329,6 +333,41 @@ fill_default_server_options(ServerOptions *options)
+@@ -319,6 +323,41 @@
}
if (options->permit_tun == -1)
options->permit_tun = SSH_TUNMODE_NO;
@@ -490,7 +472,7 @@ index 6c7a91e..1499b6f 100644
if (options->ip_qos_interactive == -1)
options->ip_qos_interactive = IPTOS_LOWDELAY;
if (options->ip_qos_bulk == -1)
-@@ -418,6 +457,7 @@ typedef enum {
+@@ -413,6 +452,7 @@
sHostCertificate,
sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
sAuthorizedPrincipalsCommand, sAuthorizedPrincipalsCommandUser,
@@ -498,7 +480,7 @@ index 6c7a91e..1499b6f 100644
sKexAlgorithms, sIPQoS, sVersionAddendum,
sAuthorizedKeysCommand, sAuthorizedKeysCommandUser,
sAuthenticationMethods, sHostKeyAgent, sPermitUserRC,
-@@ -549,6 +589,9 @@ static struct {
+@@ -548,6 +588,9 @@
{ "revokedkeys", sRevokedKeys, SSHCFG_ALL },
{ "trustedusercakeys", sTrustedUserCAKeys, SSHCFG_ALL },
{ "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL },
@@ -508,7 +490,7 @@ index 6c7a91e..1499b6f 100644
{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
{ "ipqos", sIPQoS, SSHCFG_ALL },
{ "authorizedkeyscommand", sAuthorizedKeysCommand, SSHCFG_ALL },
-@@ -587,6 +630,7 @@ parse_token(const char *cp, const char *filename,
+@@ -587,6 +630,7 @@
for (i = 0; keywords[i].name; i++)
if (strcasecmp(cp, keywords[i].name) == 0) {
@@ -516,10 +498,11 @@ index 6c7a91e..1499b6f 100644
*flags = keywords[i].flags;
return keywords[i].opcode;
}
-@@ -1165,6 +1209,19 @@ process_server_config_line(ServerOptions *options, char *line,
+@@ -1148,6 +1192,19 @@
+ if (*activep && *intptr == -1)
*intptr = value;
break;
-
++
+
+ case sTcpRcvBufPoll:
+ intptr = &options->tcp_rcv_buf_poll;
@@ -532,15 +515,12 @@ index 6c7a91e..1499b6f 100644
+ case sHPNBufferSize:
+ intptr = &options->hpn_buffer_size;
+ goto parse_int;
-+
+
case sIgnoreUserKnownHosts:
intptr = &options->ignore_user_known_hosts;
- goto parse_flag;
-diff --git a/servconf.h b/servconf.h
-index f4137af..cd6e8ad 100644
--- a/servconf.h
+++ b/servconf.h
-@@ -172,6 +172,9 @@ typedef struct {
+@@ -166,6 +166,9 @@
char *adm_forced_command;
int use_pam; /* Enable auth via PAM */
@@ -550,11 +530,9 @@ index f4137af..cd6e8ad 100644
int permit_tun;
-diff --git a/serverloop.c b/serverloop.c
-index 306ac36..2fd1ad5 100644
--- a/serverloop.c
+++ b/serverloop.c
-@@ -1051,8 +1051,12 @@ server_request_tun(void)
+@@ -526,8 +526,12 @@
sock = tun_open(tun, mode);
if (sock < 0)
goto done;
@@ -567,7 +545,7 @@ index 306ac36..2fd1ad5 100644
c->datagram = 1;
#if defined(SSH_TUN_FILTER)
if (mode == SSH_TUNMODE_POINTOPOINT)
-@@ -1088,6 +1092,8 @@ server_request_session(void)
+@@ -563,6 +567,8 @@
c = channel_new("session", SSH_CHANNEL_LARVAL,
-1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
0, "server-session", 1);
@@ -576,11 +554,9 @@ index 306ac36..2fd1ad5 100644
if (session_open(the_authctxt, c->self) != 1) {
debug("session open failed, free channel %d", c->self);
channel_free(c);
-diff --git a/session.c b/session.c
-index 5a64715..00856ea 100644
--- a/session.c
+++ b/session.c
-@@ -220,6 +220,7 @@ auth_input_request_forwarding(struct passwd * pw)
+@@ -220,6 +220,7 @@
goto authsock_err;
/* Allocate a channel for the authentication agent socket. */
@@ -588,7 +564,7 @@ index 5a64715..00856ea 100644
nc = channel_new("auth socket",
SSH_CHANNEL_AUTH_SOCKET, sock, sock, -1,
CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
-@@ -2329,10 +2330,16 @@ session_set_fds(Session *s, int fdin, int fdout, int fderr, int ignore_fderr,
+@@ -2121,10 +2122,16 @@
*/
if (s->chanid == -1)
fatal("no channel for session %d", s->self);
@@ -605,11 +581,9 @@ index 5a64715..00856ea 100644
}
/*
-diff --git a/sftp.1 b/sftp.1
-index 214f011..55d6eec 100644
--- a/sftp.1
+++ b/sftp.1
-@@ -263,7 +263,8 @@ diagnostic messages from
+@@ -266,7 +266,8 @@
Specify how many requests may be outstanding at any one time.
Increasing this may slightly improve file transfer speed
but will increase memory usage.
@@ -619,11 +593,9 @@ index 214f011..55d6eec 100644
.It Fl r
Recursively copy entire directories when uploading and downloading.
Note that
-diff --git a/sftp.c b/sftp.c
-index 788601a..e749945 100644
--- a/sftp.c
+++ b/sftp.c
-@@ -71,7 +71,7 @@ typedef void EditLine;
+@@ -72,7 +72,7 @@
#include "sftp-client.h"
#define DEFAULT_COPY_BUFLEN 32768 /* Size of buffer for up/download */
@@ -632,11 +604,9 @@ index 788601a..e749945 100644
/* File to read commands from */
FILE* infile;
-diff --git a/ssh.c b/ssh.c
-index 59c1f93..9eab41f 100644
--- a/ssh.c
+++ b/ssh.c
-@@ -1814,6 +1814,9 @@ ssh_session2_open(void)
+@@ -1910,6 +1910,9 @@
{
Channel *c;
int window, packetmax, in, out, err;
@@ -646,7 +616,7 @@ index 59c1f93..9eab41f 100644
if (stdin_null_flag) {
in = open(_PATH_DEVNULL, O_RDONLY);
-@@ -1834,9 +1837,74 @@ ssh_session2_open(void)
+@@ -1930,9 +1933,74 @@
if (!isatty(err))
set_nonblock(err);
@@ -722,7 +692,7 @@ index 59c1f93..9eab41f 100644
window >>= 1;
packetmax >>= 1;
}
-@@ -1845,6 +1913,10 @@ ssh_session2_open(void)
+@@ -1941,6 +2009,10 @@
window, packetmax, CHAN_EXTENDED_WRITE,
"client-session", /*nonblock*/0);
@@ -733,11 +703,9 @@ index 59c1f93..9eab41f 100644
debug3("ssh_session2_open: channel_new: %d", c->self);
channel_send_open(c->self);
-diff --git a/sshconnect.c b/sshconnect.c
-index 17fbe39..a965d7a 100644
--- a/sshconnect.c
+++ b/sshconnect.c
-@@ -267,6 +267,31 @@ ssh_kill_proxy_command(void)
+@@ -267,6 +267,31 @@
}
/*
@@ -769,7 +737,7 @@ index 17fbe39..a965d7a 100644
* Creates a (possibly privileged) socket for use as the ssh connection.
*/
static int
-@@ -282,6 +307,9 @@ ssh_create_socket(int privileged, struct addrinfo *ai)
+@@ -282,6 +307,9 @@
}
fcntl(sock, F_SETFD, FD_CLOEXEC);
@@ -779,7 +747,7 @@ index 17fbe39..a965d7a 100644
/* Bind the socket to an alternative local IP address */
if (options.bind_address == NULL && !privileged)
return sock;
-@@ -524,10 +552,10 @@ send_client_banner(int connection_out, int minor1)
+@@ -526,10 +554,10 @@
/* Send our own protocol version identification. */
if (compat20) {
xasprintf(&client_version_string, "SSH-%d.%d-%.100s\r\n",
@@ -790,22 +758,11 @@ index 17fbe39..a965d7a 100644
- PROTOCOL_MAJOR_1, minor1, SSH_VERSION);
+ PROTOCOL_MAJOR_1, minor1, SSH_RELEASE);
}
- if (roaming_atomicio(vwrite, connection_out, client_version_string,
+ if (atomicio(vwrite, connection_out, client_version_string,
strlen(client_version_string)) != strlen(client_version_string))
-diff --git a/sshd.c b/sshd.c
-index 65ef7e8..893a0ab 100644
--- a/sshd.c
+++ b/sshd.c
-@@ -432,7 +432,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
- }
-
- xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s",
-- major, minor, SSH_VERSION,
-+ major, minor, SSH_RELEASE,
- *options.version_addendum == '\0' ? "" : " ",
- options.version_addendum, newline);
-
-@@ -1155,6 +1155,8 @@ server_listen(void)
+@@ -1020,6 +1020,8 @@
int ret, listen_sock, on = 1;
struct addrinfo *ai;
char ntop[NI_MAXHOST], strport[NI_MAXSERV];
@@ -814,7 +771,7 @@ index 65ef7e8..893a0ab 100644
for (ai = options.listen_addrs; ai; ai = ai->ai_next) {
if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
-@@ -1195,6 +1197,11 @@ server_listen(void)
+@@ -1060,6 +1062,11 @@
debug("Bind to port %s on %s.", strport, ntop);
@@ -826,24 +783,34 @@ index 65ef7e8..893a0ab 100644
/* Bind the socket to the desired port. */
if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) {
error("Bind to port %s on %s failed: %.200s.",
-@@ -2145,6 +2152,9 @@ main(int ac, char **av)
- remote_ip, remote_port, laddr, get_local_port());
+@@ -1977,6 +1984,9 @@
+ verbose("Connection from %s port %d on %s port %d",
+ remote_ip, remote_port, laddr, ssh_local_port(ssh));
free(laddr);
-
++
+ /* set the HPN options for the child */
+ channel_set_hpn(options.hpn_disabled, options.hpn_buffer_size);
-+
+
/*
* We don't want to listen forever unless the other side
- * successfully authenticates itself. So we set up an alarm which is
-diff --git a/sshd_config b/sshd_config
-index 4d77f05..3153ffc 100644
--- a/sshd_config
+++ b/sshd_config
-@@ -125,6 +125,17 @@ UsePrivilegeSeparation sandbox # Default for new installations.
- # override default of no subsystems
- Subsystem sftp /usr/libexec/sftp-server
+@@ -99,7 +99,7 @@
+ #ClientAliveInterval 0
+ #ClientAliveCountMax 3
+ #UseDNS no
+-#PidFile /var/run/sshd.pid
++#PidFile /run/sshd.pid
+ #MaxStartups 10:30:100
+ #PermitTunnel no
+ #ChrootDirectory none
+@@ -109,7 +109,18 @@
+ #Banner none
+ # override default of no subsystems
+-Subsystem sftp /usr/libexec/sftp-server
++Subsystem sftp /usr/lib/ssh/sftp-server
++
+# the following are HPN related configuration options
+# tcp receive buffer polling. disable in non autotuning kernels
+#TcpRcvBufPoll yes
@@ -854,18 +821,15 @@ index 4d77f05..3153ffc 100644
+# buffer size for hpn to non-hpn connections
+#HPNBufferSize 2048
+
-+
+
# Example of overriding settings on a per-user basis
#Match User anoncvs
- # X11Forwarding no
-diff --git a/version.h b/version.h
-index d917ca1..41a6023 100644
--- a/version.h
+++ b/version.h
@@ -3,4 +3,5 @@
- #define SSH_VERSION "OpenSSH_7.2"
+ #define SSH_VERSION "OpenSSH_7.4"
- #define SSH_PORTABLE "p2"
+ #define SSH_PORTABLE "p1"
-#define SSH_RELEASE SSH_VERSION SSH_PORTABLE
-+#define SSH_HPN "-hpn14v4"
++#define SSH_HPN "-hpn14v4"
+#define SSH_RELEASE SSH_VERSION SSH_PORTABLE SSH_HPN
diff --git a/main/openssh/openssh6.5-peaktput.diff b/main/openssh/openssh7.4-peaktput.patch
index 7307563783..6fc6140a6e 100644
--- a/main/openssh/openssh6.5-peaktput.diff
+++ b/main/openssh/openssh7.4-peaktput.patch
@@ -1,8 +1,6 @@
-diff --git a/progressmeter.c b/progressmeter.c
-index bbbc706..02e5d6d 100644
--- a/progressmeter.c
+++ b/progressmeter.c
-@@ -69,6 +69,8 @@ static char *file; /* name of the file being transferred */
+@@ -69,6 +69,8 @@
static off_t start_pos; /* initial position of transfer */
static off_t end_pos; /* ending position of transfer */
static off_t cur_pos; /* transfer position as of last refresh */
@@ -11,7 +9,7 @@ index bbbc706..02e5d6d 100644
static volatile off_t *counter; /* progress counter */
static long stalled; /* how long we have been stalled */
static int bytes_per_second; /* current speed in bytes per second */
-@@ -129,12 +131,17 @@ refresh_progress_meter(void)
+@@ -128,12 +130,17 @@
int hours, minutes, seconds;
int i, len;
int file_len;
@@ -19,17 +17,17 @@ index bbbc706..02e5d6d 100644
transferred = *counter - (cur_pos ? cur_pos : start_pos);
cur_pos = *counter;
- now = monotime();
+ now = monotime_double();
bytes_left = end_pos - cur_pos;
+ delta_pos = cur_pos - last_pos;
-+ if (delta_pos > max_delta_pos)
++ if (delta_pos > max_delta_pos)
+ max_delta_pos = delta_pos;
+
if (bytes_left > 0)
elapsed = now - last_update;
else {
-@@ -159,7 +166,7 @@ refresh_progress_meter(void)
+@@ -158,7 +165,7 @@
/* filename */
buf[0] = '\0';
@@ -38,7 +36,7 @@ index bbbc706..02e5d6d 100644
if (file_len > 0) {
len = snprintf(buf, file_len + 1, "\r%s", file);
if (len < 0)
-@@ -189,6 +196,15 @@ refresh_progress_meter(void)
+@@ -188,6 +195,15 @@
(off_t)bytes_per_second);
strlcat(buf, "/s ", win_size);
@@ -54,7 +52,7 @@ index bbbc706..02e5d6d 100644
/* ETA */
if (!transferred)
stalled += elapsed;
-@@ -225,6 +241,7 @@ refresh_progress_meter(void)
+@@ -224,6 +240,7 @@
atomicio(vwrite, STDOUT_FILENO, buf, win_size - 1);
last_update = now;
diff --git a/main/openssh/openssh-sftp-interactive.diff b/main/openssh/sftp-interactive.patch
index ab14f3a6ba..ab14f3a6ba 100644
--- a/main/openssh/openssh-sftp-interactive.diff
+++ b/main/openssh/sftp-interactive.patch