merge fixes from PuTTY import.c

toint() from misc.c

(revids are from hggit conversion)

changeset:   4620:60a336a6c85c
user:        Simon Tatham <anakin@pobox.com>
date:        Thu Feb 25 20:26:33 2016 +0000
files:       import.c
description:
Fix potential segfaults in reading OpenSSH's ASN.1 key format.

The length coming back from ber_read_id_len might have overflowed, so
treat it as potentially negative. Also, while I'm here, accumulate it
inside ber_read_id_len as an unsigned, so as to avoid undefined
behaviour on integer overflow, and toint() it before return.

Thanks to Hanno Böck for spotting this, with the aid of AFL.

(cherry picked from commit 5b7833cd474a24ec098654dcba8cb9509f3bf2c1)

Conflicts:
	import.c

(cherry-picker's note: resolving the conflict involved removing an
entire section of the original commit which fixed ECDSA code not
present on this branch)


changeset:   4619:9c6c638d98d8
user:        Simon Tatham <anakin@pobox.com>
date:        Sun Jul 14 10:45:54 2013 +0000
files:       import.c ssh.c sshdss.c sshpubk.c sshrsa.c
description:
Tighten up a lot of casts from unsigned to int which are read by one
of the GET_32BIT macros and then used as length fields. Missing bounds
checks against zero have been added, and also I've introduced a helper
function toint() which casts from unsigned to int in such a way as to
avoid C undefined behaviour, since I'm not sure I trust compilers any
more to do the obviously sensible thing.

[originally from svn r9918]


changeset:   4618:3957829f24d3
user:        Simon Tatham <anakin@pobox.com>
date:        Mon Jul 08 22:36:04 2013 +0000
files:       import.c sshdss.c sshrsa.c
description:
Add an assortment of extra safety checks.

[originally from svn r9896]


changeset:   4617:2cddee0bce12
user:        Jacob Nevins <jacobn@chiark.greenend.org.uk>
date:        Wed Dec 07 00:24:45 2005 +0000
files:       import.c
description:
Institutional failure to memset() things pointed at rather than pointers.
Things should now be zeroed and memory not leaked. Spotted by Brant Thomsen.

[originally from svn r6476]


changeset:   4616:24ac78a9c71d
user:        Simon Tatham <anakin@pobox.com>
date:        Wed Feb 11 13:58:27 2004 +0000
files:       import.c
description:
Jacob's last-minute testing found a couple of trivial bugs in
import.c, and my attempts to reproduce them in cmdgen found another
one there :-)

[originally from svn r3847]


changeset:   4615:088d39a73db0
user:        Simon Tatham <anakin@pobox.com>
date:        Thu Jan 22 18:52:49 2004 +0000
files:       import.c
description:
Placate some gcc warnings.

[originally from svn r3761]


changeset:   4614:e4288bad4d93
parent:      1758:108b8924593d
user:        Simon Tatham <anakin@pobox.com>
date:        Fri Oct 03 21:21:23 2003 +0000
files:       import.c
description:
My ASN.1 decoder returned wrong IDs for anything above 0x1E! Good
job it's never had to yet. Ahem.

[originally from svn r3479]
1 file changed
tree: 3b28afd6e7d263aa3a77a7045818331b37723cb1
  1. debian/
  2. libtomcrypt/
  3. libtommath/
  4. .hgsigs
  5. .hgtags
  6. .travis.yml
  7. agentfwd.h
  8. algo.h
  9. atomicio.c
  10. atomicio.h
  11. auth.h
  12. bignum.c
  13. bignum.h
  14. buffer.c
  15. buffer.h
  16. CHANGES
  17. channel.h
  18. chansession.h
  19. circbuffer.c
  20. circbuffer.h
  21. cli-agentfwd.c
  22. cli-auth.c
  23. cli-authinteract.c
  24. cli-authpasswd.c
  25. cli-authpubkey.c
  26. cli-channel.c
  27. cli-chansession.c
  28. cli-kex.c
  29. cli-main.c
  30. cli-runopts.c
  31. cli-session.c
  32. cli-tcpfwd.c
  33. common-algo.c
  34. common-channel.c
  35. common-chansession.c
  36. common-kex.c
  37. common-runopts.c
  38. common-session.c
  39. compat.c
  40. compat.h
  41. config.guess
  42. config.sub
  43. configure.ac
  44. crypto_desc.c
  45. crypto_desc.h
  46. curve25519-donna.c
  47. dbclient.1
  48. dbhelpers.c
  49. dbhelpers.h
  50. dbmulti.c
  51. dbrandom.c
  52. dbrandom.h
  53. dbutil.c
  54. dbutil.h
  55. debug.h
  56. dh_groups.c
  57. dh_groups.h
  58. dropbear.8
  59. dropbearconvert.1
  60. dropbearconvert.c
  61. dropbearkey.1
  62. dropbearkey.c
  63. dss.c
  64. dss.h
  65. ecc.c
  66. ecc.h
  67. ecdsa.c
  68. ecdsa.h
  69. fake-rfc2553.c
  70. fake-rfc2553.h
  71. filelist.txt
  72. gendss.c
  73. gendss.h
  74. genrsa.c
  75. genrsa.h
  76. gensignkey.c
  77. gensignkey.h
  78. includes.h
  79. INSTALL
  80. install-sh
  81. kex.h
  82. keyimport.c
  83. keyimport.h
  84. LICENSE
  85. list.c
  86. list.h
  87. listener.c
  88. listener.h
  89. loginrec.c
  90. loginrec.h
  91. ltc_prng.c
  92. ltc_prng.h
  93. Makefile.in
  94. MULTI
  95. netio.c
  96. netio.h
  97. options.h
  98. packet.c
  99. packet.h
  100. process-packet.c
  101. progressmeter.c
  102. progressmeter.h
  103. queue.c
  104. queue.h
  105. README
  106. release.sh
  107. rsa.c
  108. rsa.h
  109. runopts.h
  110. scp.c
  111. scpmisc.c
  112. scpmisc.h
  113. service.h
  114. session.h
  115. signkey.c
  116. signkey.h
  117. SMALL
  118. ssh.h
  119. sshpty.c
  120. sshpty.h
  121. svr-agentfwd.c
  122. svr-auth.c
  123. svr-authpam.c
  124. svr-authpasswd.c
  125. svr-authpubkey.c
  126. svr-authpubkeyoptions.c
  127. svr-chansession.c
  128. svr-kex.c
  129. svr-main.c
  130. svr-runopts.c
  131. svr-service.c
  132. svr-session.c
  133. svr-tcpfwd.c
  134. svr-x11fwd.c
  135. sysoptions.h
  136. tcp-accept.c
  137. tcpfwd.h
  138. termcodes.c
  139. termcodes.h
  140. TODO
  141. x11fwd.h