upstream commit

refactor activation of rekeying

This makes automatic rekeying internal to the packet code (previously
the server and client loops needed to assist). In doing to it makes
application of rekey limits more accurate by accounting for packets
about to be sent as well as packets queued during rekeying events
themselves.

Based on a patch from dtucker@ which was in turn based on a patch
Aleksander Adamowski in bz#2521; ok markus@

Upstream-ID: a441227fd64f9739850ca97b4cf794202860fcd8
7 files changed
tree: a87286b290fcd540635890856fbcafef74341ec0
  1. .cvsignore
  2. CREDITS
  3. INSTALL
  4. LICENCE
  5. Makefile.in
  6. OVERVIEW
  7. PROTOCOL
  8. PROTOCOL.agent
  9. PROTOCOL.certkeys
  10. PROTOCOL.chacha20poly1305
  11. PROTOCOL.key
  12. PROTOCOL.krl
  13. PROTOCOL.mux
  14. README
  15. README.dns
  16. README.platform
  17. README.privsep
  18. README.tun
  19. TODO
  20. aclocal.m4
  21. addrmatch.c
  22. atomicio.c
  23. atomicio.h
  24. audit-bsm.c
  25. audit-linux.c
  26. audit.c
  27. audit.h
  28. auth-bsdauth.c
  29. auth-chall.c
  30. auth-krb5.c
  31. auth-options.c
  32. auth-options.h
  33. auth-pam.c
  34. auth-pam.h
  35. auth-passwd.c
  36. auth-rh-rsa.c
  37. auth-rhosts.c
  38. auth-rsa.c
  39. auth-shadow.c
  40. auth-sia.c
  41. auth-sia.h
  42. auth-skey.c
  43. auth.c
  44. auth.h
  45. auth1.c
  46. auth2-chall.c
  47. auth2-gss.c
  48. auth2-hostbased.c
  49. auth2-kbdint.c
  50. auth2-none.c
  51. auth2-passwd.c
  52. auth2-pubkey.c
  53. auth2.c
  54. authfd.c
  55. authfd.h
  56. authfile.c
  57. authfile.h
  58. bitmap.c
  59. bitmap.h
  60. blocks.c
  61. bufaux.c
  62. bufbn.c
  63. bufec.c
  64. buffer.c
  65. buffer.h
  66. buildpkg.sh.in
  67. canohost.c
  68. canohost.h
  69. chacha.c
  70. chacha.h
  71. channels.c
  72. channels.h
  73. cipher-3des1.c
  74. cipher-aes.c
  75. cipher-aesctr.c
  76. cipher-aesctr.h
  77. cipher-bf1.c
  78. cipher-chachapoly.c
  79. cipher-chachapoly.h
  80. cipher-ctr.c
  81. cipher.c
  82. cipher.h
  83. cleanup.c
  84. clientloop.c
  85. clientloop.h
  86. compat.c
  87. compat.h
  88. config.guess
  89. config.sub
  90. configure.ac
  91. contrib/
  92. crc32.c
  93. crc32.h
  94. crypto_api.h
  95. deattack.c
  96. deattack.h
  97. defines.h
  98. dh.c
  99. dh.h
  100. digest-libc.c
  101. digest-openssl.c
  102. digest.h
  103. dispatch.c
  104. dispatch.h
  105. dns.c
  106. dns.h
  107. ed25519.c
  108. entropy.c
  109. entropy.h
  110. fatal.c
  111. fe25519.c
  112. fe25519.h
  113. fixalgorithms
  114. fixpaths
  115. fixprogs
  116. ge25519.c
  117. ge25519.h
  118. ge25519_base.data
  119. groupaccess.c
  120. groupaccess.h
  121. gss-genr.c
  122. gss-serv-krb5.c
  123. gss-serv.c
  124. hash.c
  125. hmac.c
  126. hmac.h
  127. hostfile.c
  128. hostfile.h
  129. includes.h
  130. install-sh
  131. kex.c
  132. kex.h
  133. kexc25519.c
  134. kexc25519c.c
  135. kexc25519s.c
  136. kexdh.c
  137. kexdhc.c
  138. kexdhs.c
  139. kexecdh.c
  140. kexecdhc.c
  141. kexecdhs.c
  142. kexgex.c
  143. kexgexc.c
  144. kexgexs.c
  145. key.c
  146. key.h
  147. krl.c
  148. krl.h
  149. log.c
  150. log.h
  151. loginrec.c
  152. loginrec.h
  153. logintest.c
  154. mac.c
  155. mac.h
  156. match.c
  157. match.h
  158. md-sha256.c
  159. md5crypt.c
  160. md5crypt.h
  161. mdoc2man.awk
  162. misc.c
  163. misc.h
  164. mkinstalldirs
  165. moduli
  166. moduli.5
  167. moduli.c
  168. monitor.c
  169. monitor.h
  170. monitor_fdpass.c
  171. monitor_fdpass.h
  172. monitor_mm.c
  173. monitor_mm.h
  174. monitor_wrap.c
  175. monitor_wrap.h
  176. msg.c
  177. msg.h
  178. mux.c
  179. myproposal.h
  180. nchan.c
  181. nchan.ms
  182. nchan2.ms
  183. opacket.c
  184. opacket.h
  185. openbsd-compat/
  186. openssh.xml.in
  187. opensshd.init.in
  188. packet.c
  189. packet.h
  190. pathnames.h
  191. pkcs11.h
  192. platform-pledge.c
  193. platform.c
  194. platform.h
  195. poly1305.c
  196. poly1305.h
  197. progressmeter.c
  198. progressmeter.h
  199. readconf.c
  200. readconf.h
  201. readpass.c
  202. regress/
  203. rijndael.c
  204. rijndael.h
  205. roaming.h
  206. rsa.c
  207. rsa.h
  208. sandbox-capsicum.c
  209. sandbox-darwin.c
  210. sandbox-null.c
  211. sandbox-pledge.c
  212. sandbox-rlimit.c
  213. sandbox-seccomp-filter.c
  214. sandbox-solaris.c
  215. sandbox-systrace.c
  216. sc25519.c
  217. sc25519.h
  218. scard/
  219. scp.1
  220. scp.c
  221. servconf.c
  222. servconf.h
  223. serverloop.c
  224. serverloop.h
  225. session.c
  226. session.h
  227. sftp-client.c
  228. sftp-client.h
  229. sftp-common.c
  230. sftp-common.h
  231. sftp-glob.c
  232. sftp-server-main.c
  233. sftp-server.8
  234. sftp-server.c
  235. sftp.1
  236. sftp.c
  237. sftp.h
  238. smult_curve25519_ref.c
  239. ssh-add.1
  240. ssh-add.c
  241. ssh-agent.1
  242. ssh-agent.c
  243. ssh-dss.c
  244. ssh-ecdsa.c
  245. ssh-ed25519.c
  246. ssh-gss.h
  247. ssh-keygen.1
  248. ssh-keygen.c
  249. ssh-keyscan.1
  250. ssh-keyscan.c
  251. ssh-keysign.8
  252. ssh-keysign.c
  253. ssh-pkcs11-client.c
  254. ssh-pkcs11-helper.8
  255. ssh-pkcs11-helper.c
  256. ssh-pkcs11.c
  257. ssh-pkcs11.h
  258. ssh-rsa.c
  259. ssh-sandbox.h
  260. ssh.1
  261. ssh.c
  262. ssh.h
  263. ssh1.h
  264. ssh2.h
  265. ssh_api.c
  266. ssh_api.h
  267. ssh_config
  268. ssh_config.5
  269. sshbuf-getput-basic.c
  270. sshbuf-getput-crypto.c
  271. sshbuf-misc.c
  272. sshbuf.c
  273. sshbuf.h
  274. sshconnect.c
  275. sshconnect.h
  276. sshconnect1.c
  277. sshconnect2.c
  278. sshd.8
  279. sshd.c
  280. sshd_config
  281. sshd_config.5
  282. ssherr.c
  283. ssherr.h
  284. sshkey.c
  285. sshkey.h
  286. sshlogin.c
  287. sshlogin.h
  288. sshpty.c
  289. sshpty.h
  290. sshtty.c
  291. survey.sh.in
  292. ttymodes.c
  293. ttymodes.h
  294. uidswap.c
  295. uidswap.h
  296. umac.c
  297. umac.h
  298. uuencode.c
  299. uuencode.h
  300. verify.c
  301. version.h
  302. xmalloc.c
  303. xmalloc.h