ChangeLog 445 KB
Newer Older
Niels Möller's avatar
Niels Möller committed
1 2 3 4
2013-09-17  Niels Möller  <nisse@lysator.liu.se>

	* src/dsa.c (do_dsa_sign): Fixed failure message.

5 6 7 8 9
2013-09-02  Niels Möller  <nisse@lysator.liu.se>

	* src/gateway_channel.c (do_kill_gateway_channel): Fixed handling
	of MSG_CHANNEL_OPEN_FAILURE.

10 11 12 13 14
2013-06-27  Niels Möller  <nisse@lysator.liu.se>

	* src/testsuite/prgrp-timeout.c (handle_sigchld): Declare argument
	UNUSED.

15 16 17
2013-06-18  Niels Möller  <nisse@lysator.liu.se>

	From lsh-2.0.4 branch:
18 19
	* src/testsuite/mini-inetd.c (main): Clear O_NONBLOCK flag on
	accepted sockets.
20
	* src/testsuite/tcpconnect.c: Include netinet/in.h.
21
	(main): Set seen_remote_eof and seen_stdin_eof flags at EOF.
22

23 24 25 26 27
2013-06-27  Niels Möller  <nisse@lysator.liu.se>

	* src/testsuite/rapid7-lsh-test: Deleted use of need_tcputils.
	* src/testsuite/tcpip-local-in-use-test: Likewise.

Niels Möller's avatar
Niels Möller committed
28 29
2013-06-16  Niels Möller  <nisse@lysator.liu.se>

Niels Möller's avatar
Niels Möller committed
30 31
	* src/testsuite/tcpconnect.c (main): Check HAVE_IOCTL_FIONREAD.

Niels Möller's avatar
Niels Möller committed
32 33
	* configure.ac: Updated liboop URL.

34 35 36 37
2012-08-23  Niels Möller  <nisse@lysator.liu.se>

	* src/algorithms.c (list_kex_algorithms): Typo fix in message.

38 39 40 41
2012-07-14  Niels Möller  <nisse@lysator.liu.se>

	Copyright headers: Updated FSF address.

42 43
2012-07-13  Niels Möller  <nisse@lysator.liu.se>

Niels Möller's avatar
Niels Möller committed
44 45
	* nettle: Deleted the nettle subdirectory.

46 47 48 49 50 51 52 53 54 55 56 57
	Always use the installed nettle library, don't look for it in the
	build tree.
	* .bootstrap: Deleted all references to the nettle subdirectory.
	* configure.ac: Deleted --with-system-nettle option, and all setup
	for using a bundled nettle library. Use a regular AC_CHECK_LIB to
	check for libhogweed (nettle's public key library).
	* src/Makefile.in (LOCAL_NETTLE_DEP): Deleted variable, and all
	uses.
	(PRE_CPPFLAGS): Deleted nettle_builddir.
	(PRE_LDFLAGS): Likewise.
	* Makefile.in (SUBDIRS): Deleted nettle.

58 59 60 61 62 63 64 65 66 67 68 69
	* src/testsuite/functions.sh (need_tcputils): Deleted function.
	* src/testsuite/lshd-random-input-test: Use ./tcpconnect, rather
	than the possibly installed version from tcputils. Don't use
	need_tcputils.
	* src/testsuite/lshg-tcpip-local-test: Likewise.
	* src/testsuite/lshg-tcpip-remote-test: Likewise.
	* src/testsuite/rapid7-lshd-test: Likewise.
	* src/testsuite/socks4-test: Likewise.
	* src/testsuite/socks5-test: Likewise.
	* src/testsuite/tcpip-local-test: Likewise.
	* src/testsuite/tcpip-remote-test: Likewise.

70 71 72
	* src/testsuite/tcpconnect.c (main): Ignore SIGPIPE. Fixes to
	diagnostic printouts.

73 74 75
	* src/lsh.c (main_argp_parser): Pass on --hostkey-algorithm and
	new option --kex-algorithm to lsh-transport.

76 77
	* src/lsh-transport.c (main_argp_parser): Configure key exchange
	algorithms via algorithm_options.
78
	* src/lshd.c (lshd_config_handler): Likewise.
79

Niels Möller's avatar
Niels Möller committed
80 81
2012-07-12  Niels Möller  <nisse@lysator.liu.se>

82 83 84 85 86 87 88 89 90 91
	* src/algorithms.h (class algorithms_options): New attribute
	kex_algorithms.
	* src/algorithms.c (default_kex_algorithms): New function.
	(lookup_kex_algorithm): New function.
	(list_kex_algorithms): New function.
	(algorithms_options): Added --kex-algorithm.
	(init_algorithms_options): Initialize kex_algorithms.
	(algorithms_argp_parser): Handle --kex-algorithm, and default
	value. Use list_kex_algorithms for --list-algorithms.

Niels Möller's avatar
Niels Möller committed
92 93
	* doc/Makefile.in (.nroff.txt): Pass -Tutf8 to groff.

Niels Möller's avatar
Niels Möller committed
94 95
2012-07-10  Niels Möller  <nisse@lysator.liu.se>

96 97 98
	* src/testsuite/mini-inetd.c (usage): Take a FILE * as argument.
	Called with stdout in response to --help, and stderr otherwise.

Niels Möller's avatar
Niels Möller committed
99 100 101
	* src/testsuite/prgrp-timeout.c: Added missing include of
	config.h.

102 103 104 105 106 107 108
2012-07-08  Niels Möller  <nisse@lysator.liu.se>

	* src/testsuite/Makefile.in (TARGETS): Added tcpconnnect.

	* src/testsuite/tcpconnect.c: New file. Reimplemented the program
	with the same name in tcputils.

109 110 111 112 113
2012-06-19  Niels Möller  <nisse@lysator.liu.se>

	* src/transport.c (transport_process_packet): Disconnect on
	reception of an SSH_MSG_UNIMPLEMENTED message.

Niels Möller's avatar
Niels Möller committed
114 115
2012-02-03  Niels Möller  <nisse@lysator.liu.se>

116 117 118
	* doc/index.html: Updated to xhtml, and added charset declaration.
	Added git instructions.

Niels Möller's avatar
Niels Möller committed
119 120
	* doc/lsh.texinfo: Updated charset declaration.

Niels Möller's avatar
Niels Möller committed
121
2011-11-24  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
122 123 124 125 126

	* misc/run-tests (test_program): If EMULATOR is set in the
	environment, and the testprogram is not a script, use EMULATOR to
	run it. Typical use is EMULATUR=wine.

Niels Möller's avatar
Niels Möller committed
127
2011-09-21  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
128 129 130

	* src/Makefile.in (SOURCES): Added pidfile.c.

Niels Möller's avatar
Niels Möller committed
131
2011-09-07  Niels Möller  <nisse@lysator.liu.se>
132 133 134 135 136

	* config.guess: Upgraded to current version, timestamp 2011-08-20.
	Needed to recognize osx (darwin) on x86_64.
	* config.sub: Upgraded to current version, timestamp 2011-08-23.

Niels Möller's avatar
Niels Möller committed
137
2011-09-06  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
138 139 140 141 142 143 144 145 146 147 148

	* src/testsuite/Makefile.in (TS_SH): Added gateway-close-test.

	* src/gateway_channel.c (do_kill_gateway_channel): Arrange for the
	chained connection to be closed.
	(do_gateway_channel_event): Start by checking if the chained
	connection is alive. If it is not, we should only handle the
	CONFIRM event.

	* src/testsuite/gateway-close-test: New test case.

Niels Möller's avatar
Niels Möller committed
149
2011-09-05  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164

	* src/testsuite/gateway-stop-test: Check that the pidfile is
	deleted (indicating that the process has cleaned up and exited
	like it should).

	* src/testsuite/functions.sh (test_result): Use --pid-file option
	to lsh. Check for existence of file before killing the process.

	* src/Makefile.in (PIDFILE_SOURCES): Arrange so that both lsh and
	lshd are linked with pidfile.o.

	* src/lsh.c (main_options): New option --pid-file.
	(main): Moved writing of pid to child process. For --pid-file, use
	make_pid_file_resource.

Niels Möller's avatar
Niels Möller committed
165
2011-09-02  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
166

Niels Möller's avatar
Niels Möller committed
167
	* src/.dist_classes: Added pidfile.c.x.
Niels Möller's avatar
Niels Möller committed
168
	* src/.dist_headers: Added pidfile.h.
Niels Möller's avatar
Niels Möller committed
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188

	* src/daemon.c (daemon_pidfile): Deleted function. The
	functionality moved to pidfile.c.

	* src/lshd.c (main): make_pid_file_resource now also creates the
	file, so need to call daemon_pidfile.
	(make_pid_file_resource): Moved to src/pidfile.c
	(class pid_file_resource): Likewise.
	(do_kill_pid_file): Likewise.

	* src/Makefile.in (lshd_SOURCES): Added pidfile.c.

	* src/pidfile.h: New file.

	* src/pidfile.c: New file.
	(make_pid_file_resource): Moved function from lshd.c, and
	incorporate the writing of the file from daemon.c:daemon_pidfile.
	(class pid_file_resource): Moved from lshd.c.
	(do_kill_pid_file): Likewise.

Niels Möller's avatar
Niels Möller committed
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
	* src/testsuite/Makefile.in (TS_SH): Added gateway-stop-test.

	* src/testsuite/gateway-stop-test: New file.

	* src/testsuite/functions.sh (spawn_lsh): Check if pid-file exists
	before trying to kill the process.

	* src/lsh.c (main): Fixed --stop-gateway. Must read the hello
	message before we write the stop message.

	* src/gateway.c (kill_gateway_connection): Deleted loop to close
	channels.
	(gateway_packet_handler): When receiving LSH_GATEWAY_STOP message,
	call ssh_connection_pending_close to close the shared connection
	after all currently open channels are closed.

	* src/connection.c (ssh_connection_pending_close): Check
	channel_count, and kill connection immediately if zero.

Niels Möller's avatar
Niels Möller committed
208
2011-05-02  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
209 210 211 212

	* src/testsuite/serpent-test.c: Updated for correct serpent byte
	order.

Niels Möller's avatar
Niels Möller committed
213
2011-03-28  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
214 215 216 217

	* src/unix_random.c (random_init): Display errno when locking
	fails.

Niels Möller's avatar
Niels Möller committed
218
2011-03-23  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
219 220 221 222 223 224 225 226 227 228 229 230 231

	* doc/lsh.texinfo: Fixed "service ssh-userauth" and "service
	ssh-connection" examples.
	(Invoking lshd): Reviewed and updated.
	(Files and environment variables): Likewise.

	* src/lshd.c (lshd_options): New options --add-port,
	--add-interface and --no-syslog.
	(lshd_argp_parser): Implement them.

	* src/lshd-userauth.c (start_service): Pass on the
	LSHD_CONNECTION_CONF environment variable.

Niels Möller's avatar
Niels Möller committed
232
2011-02-21  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
233 234 235 236

	* src/lsh.c (parse_forward_arg): Support for optional brackets, to
	support IPv6 literal addresses.

Niels Möller's avatar
Niels Möller committed
237
2011-02-18  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
238

Niels Möller's avatar
Niels Möller committed
239 240 241
	* doc/Makefile.in (DISTFILES): Deleted srp-spec.txt, reverting
	change from 2011-02-10. It is already included, via $(TARGETS).

Niels Möller's avatar
Niels Möller committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
	* src/testsuite/Makefile.in (TS_SH): Added ipv4-test and
	ipv6-test.

	* src/testsuite/functions.sh (need_ipv6): New function.
	(LOCALHOST): New variable. Use it in all functions starting the
	lsh client.
	(at_connect): Use new --background option to mini-inetd, to
	improve robustness.

	* src/testsuite/tcpip-remote-test: Added a sleep call, to let the
	server side setup the port forwarding before we use it.

	* src/testsuite/mini-inetd.c (main): New --background option.

	* src/testsuite/ipv6-test: New file.
	* src/testsuite/ipv4-test: New file.

	* src/lshd.c (open_port): More info when getaddrinfo fails.
	(parse_interface): Allow optional brackets around ip address,
	needed for IPv6 literal addresses.

Niels Möller's avatar
Niels Möller committed
263
2011-02-14  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
264 265 266 267 268 269

	* src/testsuite/x11-3-test: Export DISPLAY before running
	exec_lsh.

	* src/testsuite/functions.sh (spawn_xvfb): Use rm -f.

Niels Möller's avatar
Niels Möller committed
270
2011-02-10  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
271 272 273 274

	* doc/Makefile.in (DISTFILES): Added srp-spec.txt, to avoid
	requiring groff.

Niels Möller's avatar
Niels Möller committed
275
2011-01-31  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
276 277 278 279 280 281 282 283 284

	* doc/lsh.texinfo (Server configuration): Describe all config options.

	* src/lshd-connection.c (main_argp_parser): Warn if shell, exec or
	subsystem requests are enabled, but session channels are disabled.

	* src/lshd-userauth.c (main_argp_parser): Add --helper-fd option
	to the default lshd-connection command line.

Niels Möller's avatar
Niels Möller committed
285
2011-01-07  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
286 287 288 289 290 291 292 293 294 295 296

	* src/lsh.c (OPT_HOST_DB_UPDATE): Rennamed, from...
	(OPT_CAPTURE_TO): ...old name.
	(main_argp_parser): For '-D' option, initialize socks_port.

	* src/lsh-transport.c (OPT_HOST_DB_UPDATE): Rennamed, from...
	(OPT_CAPTURE_TO): ...old name.

	* doc/lsh.texinfo (Hostauth options): Updated --host-db-update
	(used to be ---captured-to).

Niels Möller's avatar
Niels Möller committed
297
2010-12-14  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
298 299 300 301 302 303 304

	* doc/lsh.texinfo (Gateway options): New node.
	(Invoking lshg): Deleted node.

	* src/lsh.c (main_options): Moved gateway options to a new group,
	and updated the description of -G. Fixed --stop-gateway option.

Niels Möller's avatar
Niels Möller committed
305
2010-12-09  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
306 307 308 309

	* doc/lsh.texinfo (lshd basics): Rewrote node.
	(srp): Deleted node, and other references to SRP.

Niels Möller's avatar
Niels Möller committed
310
2010-11-17  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
311 312 313 314

	* misc/xenofarm.sh: Copy list of files in $pfx into result
	package.

Niels Möller's avatar
Niels Möller committed
315
2010-11-16  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
316 317 318

	* misc/xenofarm.sh: Improved crude gmp check to look for
	mpz_getlimbn.
Niels Möller's avatar
Niels Möller committed
319 320
	(cfgargs): Tweaked order for --with-include-path and
	--with-lib-path, to put $pfx before /usr/local.
Niels Möller's avatar
Niels Möller committed
321

Niels Möller's avatar
Niels Möller committed
322
2010-11-15  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
323

Niels Möller's avatar
Niels Möller committed
324 325 326 327
	* misc/xenofarm.sh (dotask): Display the correct status value when
	the step is skipped.
	(LIBGMPDIST): Initialize.

Niels Möller's avatar
Niels Möller committed
328 329 330 331 332 333 334 335
	* src/testsuite/Makefile.in (OTHER_SOURCES): Added getopt.c getopt1.c.
	(DISTFILES): Added getopt.h.
	(GETOPT_OBJS): New variable.
	(prgrp-timeout): Depend on and link with getopt files.
	(mini-inetd): Likewise.

	* .bootstrap: Link getopt files to the src/testsuite directory.

Niels Möller's avatar
Niels Möller committed
336 337 338 339
	* misc/xenofarm.sh: If a gmp dist is included in the build
	package, and gmp is not already installed on the system, install
	it in $pfx before trying to build lsh.

Niels Möller's avatar
Niels Möller committed
340 341 342
	* src/testsuite/mini-inetd.c: Include netinet/in.h, needed for
	IPPROTO_TCP on FreeBSD.

Niels Möller's avatar
Niels Möller committed
343 344 345 346 347 348 349 350 351 352 353
	* src/server_x11.c (do_kill_x11_listen_port): Close self->dir,
	even if lsh_pushd_fd fails.
	(open_x11_socket): Stop trying higher display numbers if bind
	fails with an error other then EADDRINUSE.

	* src/io.c (io_bind_sockaddr): Save and restore errno when
	returning failure.

	* src/server.c (service_config_option): Avoid using the
	non-standard strnlen function; plain strlen is good enough here.

Niels Möller's avatar
Niels Möller committed
354
2010-11-14  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
355

Niels Möller's avatar
Niels Möller committed
356
	* src/testsuite/Makefile.in (mini-inetd): Fixed typo with EXEEXT.
Niels Möller's avatar
Niels Möller committed
357

Niels Möller's avatar
Niels Möller committed
358 359 360 361
	* src/lshd-connection.c (make_lshd_connection): Warning message
	for attempt to enable features which were disabled at compile
	time.

Niels Möller's avatar
Niels Möller committed
362
2010-11-13  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409

	* src/testsuite/config/lshd-connection.conf: Use new config file
	options to enable all features.

	* src/lshd-connection.c (enum tcpforward_type): New enum.
	(class lshd_connection_config): Added attributes subsystem_config,
	allow_tcpforward, allow_session, allow_shell, allow_exec,
	allow_pty, allow_x11.
	(make_lshd_connection): Make all session and forwarding features
	configurable.
	(make_lshd_connection_config): Initialize new atttributes, and
	link to new lshd_connection_config_parser.
	(main_options): New command line options: --allow-tcpip-forward,
	--deny-tcpip-forward, --allow-session, --deny-session,
	--allow-shell, --deny-shell, --allow-exec, --deny-exec,
	--subsystem, and --add-subsystem.
	(CASE_FLAG): New macro.
	(main_argp_parser): Sanity check configuration at ARGP_KEY_END.
	Handle new command line options (see above).
	(lshd_connection_config_options): New list of config file options.
	(lshd_connection_config_handler): New function.
	(lshd_connection_config_parser): New config file parser.

	* src/server_session.c (class subsystem_request): Use
	service_config to represent subsystems.
	(quote_argument_length): New function.
	(quote_argument): New function.
	(subsystem_command_line): New function.
	(do_spawn_subsystem): Rewritten to use service_config_lookup and
	subsystem_command_line.
	(make_subsystem_handler): Changed argument type to const struct
	service_config *.

	* src/lshd-userauth.c (main): Use libexec_dir from the
	service_config class.
	(start_service): Propagate environment variable $LSHD_LIBEXEC_DIR.

	* src/lshd.c (lshd_service_request_handler): Use libexec_dir from
	the service_config class.

	* src/server.c (server_lookup_module): Deleted function.
	(make_service_config): Set libexec_dir, taking environment
	variable $LSHD_LIBEXEC_DIR into account.
	(service_config_lookup): Declare argument const.

	* src/server.h (class service_config): New attribute libexec_dir.

Niels Möller's avatar
Niels Möller committed
410
2010-11-12  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425

	* src/lshd-userauth.c (main_options): Fixed double ':' in header.
	(class lshd_userauth_config): Deleted werror_config attribute;
	this class is already inherited.
	(make_lshd_userauth_config): Deleted initialization of
	werror_config attribute.
	(CASE_FLAG): New macro.
	(main_argp_parser): Use CASE_FLAG.
	(lshd_userauth_config_handler): Updated child state initialization
	to point to inherited werror config.
	(lshd_userauth_config_handler): Added missing break.
	(main): Use trace, not werror, for startup message.

	* src/lshd.c (lshd_config_handler): Added missing break.

Niels Möller's avatar
Niels Möller committed
426
2010-11-10  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472

	* src/lsh.c (parse_arg_unsigned): New argument with expected
	terminator.
	(parse_forward_arg): Return targret address on success. Don't
	modify the input string, using updated parse_arg_unsigned. Don't
	use io_lookup_address; names are resolved later.
	(main_argp_parser): Use make_string. Updated to parse_forward_arg
	changes. When setting up tcp forwarding, use "" to denote any
	address, and "localhost" to denote any local addresses.

	* src/lshd.c (make_lshd_port): Use io_bind_sockaddr.
	(open_port): Unconditionally set AI_PASSIVE.

	* src/server_tcpforward.c (make_server_forward): Use
	tcpforward_listen, replacing calls to make_tcpforward_listen_port
	and io_listen.
	* src/client_tcpforward.c (do_forward_local_port): Likewise.

	* src/socks.c (make_socks_listen_port): Rewritten, analogously to
	tcpforward_listen, below.
	(do_make_socks_server): Updated to use new make_socks_listen_port.

	* src/tcpforward.c (tcpforward_listen): New function, replacing
	make_tcpforward_listen_port. Does address lookups via
	io_getaddrinfo, and may bind multiple interfaces using IPv4 or
	IPv6. Trace message with each bound interface. Call io_listen, not
	just io_bind_sockaddr.
	(make_tcpforward_listen_port): Deleted.
	(class io_connect_state): New ttributes to keep track of list of
	addresses.
	(tcpforward_connect_error): Try next address, if available.
	(tcpforward_connect): Use io_getaddrinfo, and attempt connection
	to each address on the list.

	* src/io.c (io_getaddrinfo): New helper function.
	(io_make_sockaddr): Deleted function.
	(io_lookup_address): Deleted function.
	(io_bind_sockaddr): Set IPV6_V6ONLY. Report errors using werror.

	* src/server_x11.c (do_x11_listen_port_accept): Fixed error
	message.
	(open_x11_socket): Use make_string.

	* src/queue.h (class addr_queue): Deleted unused class.
	* src/queue.c: Deleted all addr_queue related functions.

Niels Möller's avatar
Niels Möller committed
473
2010-11-09  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488

	* src/lshd-connection.c (oop_read_service): Use verbose, not
	werror, for message on EOF.
	(main): Use trace, not werror, for startup message.

	* src/lsh-decode-key.c (main_argp_parser): Use make_string.
	* src/lsh-keygen.c (main_argp_parser): Likewise.
	* src/srp-gen.c (srp_gen): Likewise.
	(main_argp_parser): Likewise.

	* src/testsuite/lshg-tcpip-remote-test: Deleted sleep.
	* src/testsuite/tcpip-remote-test: Likewise.

	* src/testsuite/lsh-encrypted-key-test: Reenabled test.

Niels Möller's avatar
Niels Möller committed
489
2010-11-08  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
490

Niels Möller's avatar
Niels Möller committed
491 492 493
	* src/testsuite/functions.sh (at_connect): Don't use -m flag to
	mini-inetd.

Niels Möller's avatar
Niels Möller committed
494 495 496
	* src/atoms.in: Deleted ssh-userauth and ssh-connection (no longer
	hardcoded).

Niels Möller's avatar
Niels Möller committed
497
2010-11-07  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513

	* src/testsuite/functions.sh (LSHD_CONNECTION): Deleted variable.
	(LSHD_PTY_HELPER): Deleted variable.

	* src/lshd-userauth.c (main_argp_parser): Use FILE_LSHD_CONNECTION
	directly, without consulting $LSHD_CONNECTION in the environment.
	$LSHD_LIBEXEC_DIR is consulted later.
	(main): Use FILE_LSHD_PTY_HELPER, also without cunsulting environment.
	* src/lshd.c (lshd_argp_parser): Analogous change to use
	FILE_LSHD_USERAUTH directly.

	* src/environ.h.in (ENV_LSHD_CONNECTION): Deleted,
	LSHD_LIBEXEC_DIR or service option should be sufficient.
	(ENV_LSHD_PTY_HELPER): Likewise.
	(ENV_LSHD_USERAUTH): Likewise.

Niels Möller's avatar
Niels Möller committed
514
2010-11-03  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572

	* src/testsuite/Makefile.in (TS_SH): Added lshd-example-config-test.

	* src/environ.h.in (FILE_LSHD_CONNECTION): Deleted directory part.
	(FILE_LSHD_PTY_HELPER): Likewise.

	* src/lshd.c (lshd_service_request_handler): Fixed error message
	for bad $LSHD_LIBEEXEC_DIR. Leave unrecognized "$(foo)" in the
	argument list untouched (previously, skipped the initial "$").
	(class server_config): New attributes ports_override_config_file
	and interfaces_override_config_file.
	(make_lshd_config): Initialize ports_override_config_file and
	interfaces_override_config_file.
	(OPT_NO, OPT_SETSID): Deleted constants.
	(lshd_options): Added --service and --add-service.
	(lshd_argp_children): Deleted service_argp.
	(lshd_argp_parser): Updated child init in ARGP_KEY_INIT.
	Set ports_override_config_file and interfaces_override_config_file
	if the corresponding option occurs on the command line.
	Handle --service and --add-service.
	(lshd_config_options): Added config option "service".
	(lshd_config_handler): Fixed child initialization. Check
	ports_override_config_file and interfaces_override_config_file.
	Handle "service" option.

	* src/lshd-userauth.c (handle_userauth): Use
	service_config_lookup, instead of hard-coding ssh-connection.
	Changed return type to return struct service_entry pointer.
	(main_options): Added --service and --add-service.
	(class server_config): Added service_config atttribute.
	(make_lshd_userauth_config): Call make_service_config.
	(main_argp_parser): Setup default service in ARGP_KEY_END case.
	Handle --service and --add-service.
	(lshd_userauth_config_options): New config option "service".
	(lshd_userauth_config_handler): Handle service option.
	(main): Take environment variable LSHD_LIBEXEC_DIR and compiled in
	LIBEXECDIR into account when interpreting the name of the hepler
	program and the service program. Use the service_entry returned
	from handle_userauth. Expand "$(helper_fd)" in the argument list,
	and spawn the helper program only if this expansion is used.

	* src/xalloc.h (lsh_space_free) [!DEBUG_ALLOC]: Defined to
	lsh_free rather then free, to avoid warnings when freeing const
	pointers.

	* src/server.c (service_config_lookup): Renamed and updated
	callers, from...
	(server_lookup_service): ... old name.
	(service_config_argp): New function, doing the main work for an
	argp service parser, without being one.
	(service_config_option): New function, analogous but for config
	file parsing.
	(service_argp): Deleted argp parser.
	(service_config_parser): Deleted config file parser.

	* src/server_config.c (list_append): Fixed broken indirection.
	(server_config_parse_example): Fixed CONFIG_TYPE_LIST case.

Niels Möller's avatar
Niels Möller committed
573
2010-11-01  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
574

Niels Möller's avatar
Niels Möller committed
575 576
	* src/testsuite/lshd-example-config-test: New test case.

Niels Möller's avatar
Niels Möller committed
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595
	* src/server_config.c (list_append): Deleted return value. Instead
	aborts if allocation fails. Call config_tokenizer_next to get
	first string. Use lsh_space_free rather than plain free.
	(parser_parse_option): Call config_tokenizer_next
	after config_tokenizer_looking_at. Separate error message for
	missing '='.
	(server_config_parse_example): Handle CONFIG_TYPE_LIST (not yet
	tested).

	* src/parse_config.c (parse_setting): Call config_tokenizer_next
	after config_tokenizer_looking_at.
	(parse_groups): Likewise.

	* src/tokenize_config.c (config_tokenizer_looking_at): Don't call
	config_tokenizer_next.

	* src/testsuite/functions.sh (LSHD_USERAUTH): Partly reverted
	previous change. Define, but don't export.

Niels Möller's avatar
Niels Möller committed
596
2010-10-29  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
597

Niels Möller's avatar
Niels Möller committed
598 599 600 601 602 603 604
	* src/testsuite/functions.sh (LSHD_LIBEXEC_DIR): Define and
	export.
	(LSHD_USERAUTH): Deleted.

	* src/server_config.c (parser_parse_option): Don't check for
	proper end of line if we already had a syntax error.

Niels Möller's avatar
Niels Möller committed
605 606 607 608 609 610 611 612
	* src/lshd.c (lshd_service_request_handler): Take
	environment variable LSHD_LIBEXEC_DIR and compiled in LIBEXECDIR
	into account when interpreting the program name. Added the
	resulting name to debug output. Also deleted local variable hex.

	* src/environ.h.in (FILE_LSHD_USERAUTH): Stripped directory part.
	(ENV_LSHD_LIBEXEC_DIR): New define.

Niels Möller's avatar
Niels Möller committed
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631
	* src/lshd.c (lshd_service_request_handler): Use
	server_lookup_service.
	(lshd_argp_parser): Updated handling of default service.
	(lshd_config_handler): Initialize service_config child.
	(lshd_config_children): Added service_config_parser.

	* src/server.c (make_service_entry): New function.
	(make_service_config): Updated initialization.
	(server_lookup_service): New function.
	(service_options): New option --service-add.
	(service_argp_parser): Support --service-add. Support multiple
	--service and --service-add options.
	(service_config_options): New config option "service".
	(service_config_handler): New function.
	(service_config_parser): New config file parser.

	* src/server.h (class service_entry): New class.
	(class service_config): Support multiple services.

Niels Möller's avatar
Niels Möller committed
632 633 634 635 636 637 638 639 640 641 642 643
	* src/tcpforward.c (make_tcpforward_listen_port): Trace output of
	requested port and the bound ip address.
	(tcpforward_connect_error): Convert error number to string.
	(tcpforward_connect): Trace output of target port.
	(tcpforward_connect): Fixed logging of errno when io_connect
	fails.

	* src/client_x11.c (x11_connect_error): Convert error number to
	string.

	* src/io.c (oop_io_connect): Use errno if getsockopt fails.

Niels Möller's avatar
Niels Möller committed
644
2010-10-28  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
645 646 647 648 649 650 651 652

	* src/testsuite/functions.sh (at_connect): Use our own mini-inetd.
	* src/testsuite/rapid7-lsh-test: Likewise.

	* src/testsuite/Makefile.in (TS_SH): Omit obsolete
	lshd-no-auth-test.
	(TARGETS): Added mini-inetd.
	(OTHER_SOURCES): Added mini-inetd.c.
Niels Möller's avatar
Niels Möller committed
653
	(mini-inetd): New rule.
Niels Möller's avatar
Niels Möller committed
654 655 656 657 658

	* src/testsuite/mini-inetd.c: New file. Reimplementation of
	mini-inetd, hopefully working better with IPv6 than the version in
	tcputils.

Niels Möller's avatar
Niels Möller committed
659
2010-10-26  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
660 661

	* src/werror.c (werror_format): Made static.
Niels Möller's avatar
Niels Möller committed
662

Niels Möller's avatar
Niels Möller committed
663 664
	* src/testsuite/server-config-test.c: Added '=' tokens in input.

Niels Möller's avatar
Niels Möller committed
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688
	* src/testsuite/config/lshd-connection.conf: Updated to new syntax
	with '=' tokens.
	* src/testsuite/config/lshd-userauth.conf: Likewise.
	* src/testsuite/config/lshd.conf: Likewise.

	* src/server_config.c (parser_init): Deleted unnecessary cast.
	(parser_finalize): Deleted err argument and return value. Updated
	callers.
	(list_append): New function.
	(parse_value_list): New function.
	(parser_parse_option): Recognize CONFIG_TYPE_LIST. Require '='
	token for all other types.
	(server_config_print_example): Output '=' tokens. Handle
	CONFIG_TYPE_LIST.

	* src/server_config.h (enum config_type): Renamed
	CONFIG_TYPE_UNSIGNED to CONFIG_TYPE_NUMBER. Added
	CONFIG_TYPE_LIST.

	* src/tokenize_config.c (char_class): Added '=' as separator.
	(config_tokenizer_next): Recognize '='.

	* src/tokenize_config.h (enum config_token_type): Added TOK_EQUAL.

Niels Möller's avatar
Niels Möller committed
689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
	* src/pkcs5-test.c (main): Added long options. Deleted -?, and
	fixed handling of bad options.
	* src/testsuite/prgrp-timeout.c (main): Likewise.

	* src/lshd-userauth.c (read_packet): Don't treat EOF at start of
	header as an error.
	(main): Deleted useless trace call before arpg_parse.

	* src/lshd-pty-helper.c (utmp_gettimeofday): New function, to work
	around ut_tv 32-bit backwards compatibility hack for 64-bit
	systems.

	* src/tcpforward.c (tcpforward_connect_error): Use STRERROR to
	display socket error code.
	(make_tcpforward_listen_port): Trace output of local and target
	ports.

	* src/client_x11.c (x11_connect_error): Use STRERROR to display
	socket error code.

Niels Möller's avatar
Niels Möller committed
709
2010-08-24  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
710 711 712 713 714 715

	* src/scm/guile-compat.scm: Use the rdelim module, for the
	read-line. Needed at least for guile-1.8.7.

	* doc/fixff.pl: Use regexp m modifier rather than the arcane $*.

Niels Möller's avatar
Niels Möller committed
716
2010-07-23  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
717 718 719 720

	* src/lshd-userauth.c (lookup_user): Set user->shell before use.
	(handle_userauth): More verbose output.

Niels Möller's avatar
Niels Möller committed
721
2010-07-20  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
722 723 724 725

	* src/crypto.c (make_des3_cbc_instance): Updated to Nettle's new
	DES interface.

Niels Möller's avatar
Niels Möller committed
726
2010-06-04  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
727

Niels Möller's avatar
Niels Möller committed
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757
	* src/testsuite/Makefile.in (TS_SH): Added passwd-1-test and
	passwd-2-test.
	(check): Don't pass on PASSWD_PRELOAD, leave that for
	functions.sh.

	* src/testsuite/passwd-1-test: New test, using dummy passwd
	database.
	* src/testsuite/passwd-2-test: New test, password authentication.

	* src/testsuite/setup-env: Fixed setup of test password.

	* src/testsuite/functions.sh (need_getpwnam_wrapper): New function.
	(ENV_PROGRAM, GETPWNAM_PRELOAD): New variables.

	* src/testsuite/getpwnam-wrapper.c (getpwnam): Added
	empty-passwd-testuser to the dummy passwd database.

	* src/lshd.c (lshd_service_request_handler): Don't hard code
	--session-id argument, instead substitute "$(session_id)" if
	appearing on the argument list.
	(lshd_argp_parser): For the default service, ssh-userauth, add
	--session-id $(session_id) to the argument list.

	* src/lshd-userauth.c (lookup_user): If there's no login shell,
	consider the account disabled. Improved check for missing home
	directory.

	* src/Makefile.in (stamp-h): Standard rule for config.h via
	stamp-h.

Niels Möller's avatar
Niels Möller committed
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
	* src/lshd.c (read_host_key): Recognize dsa-sha256.

	* src/lshd-userauth.c (get_verifier): Recognize ssh-dsa-sha256.

	* src/lsh-transport.c (read_user_key): Recognize dsa-sha256.
	(lsh_transport_lookup_verifier): Recognize ssh-dsa-sha256.

	* src/lsh-decode-key.c (lsh_decode_key): Recognise ssh-dsa-sha256.
	Also slight code cleanup.

	* src/dsa.c: Updated dsa-sha1 functions for renamed constants.
	(do_dsa_verify): Require signature blob to be precisely 40 octets.
	(do_dsa_sha256_verify): New function.
	(do_dsa_sha256_public_key): New function.
	(do_dsa_sha256_public_spki_key): New function.
	(init_dsa_sha256_verifier): New function.
	(parse_ssh_dsa_sha256_public): New function.
	(do_dsa_sha256_sign): New function.
	(do_dsa_sha256_get_verifier): New function.
	(make_dsa_sha256_verifier): New function.
	(make_dsa_sha256_signer): New function.
	(dsa_sha256_algorithm): New algorithm.
	(make_ssh_dsa_sha256_verifier): New function.

	* src/crypto.h: Declarations for dsa-sha256.

	* src/algorithms.c (lookup_hostkey_algorithm): Recognize
	dsa-sha256.

Niels Möller's avatar
Niels Möller committed
787
	* src/Makefile.in (GPERF_FLAGS): Tweaked positions, to distinguish
Niels Möller's avatar
Niels Möller committed
788 789 790 791 792
	between ssh-rsa and ssh-dsa.

	* src/atoms.in: Added ssh-dsa, ssh-dsa-sha256@lysator.liu.se,
	and dsa-sha256.

Niels Möller's avatar
Niels Möller committed
793
2010-06-03  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
794 795 796 797 798 799 800

	* src/lsh-keygen.c: Added support for dsa-sha256 keys.
	(main_options): Improved descriptions.
	(dsa_sha1_generate_key): Renamed, was dsa_generate_key.
	(dsa_sha256_generate_key): New function.
	(enum config_algorithm): New enum.

Niels Möller's avatar
Niels Möller committed
801
2010-06-02  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
802 803 804 805 806

	* src/testsuite/getpwnam-wrapper.c (getpwnam): Use
	GETWPWNAM_WRAPPER_DIR to locate configuration directory.

	* src/testsuite/setup-env: Create a password for testing.
Niels Möller's avatar
Niels Möller committed
807

Niels Möller's avatar
Niels Möller committed
808
2010-06-01  Niels Möller  <nisse@lysator.liu.se>
809 810 811 812 813

	* configure.ac (LOCAL_NETTLE_DEP): When building with the bundled
	nettle library, setup a dependency when linking.
	* src/Makefile.in (LOCAL_NETTLE_DEP): Use it here.

Niels Möller's avatar
Niels Möller committed
814
2010-05-25  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
815 816 817 818

	* src/lsh-keygen.c (dsa_generate_key): Updated call to
	dsa_generate_keypair to explicitly specify a 160 bit q.

Niels Möller's avatar
Niels Möller committed
819
2010-03-30  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
820

Niels Möller's avatar
Niels Möller committed
821 822 823 824 825
	* src/dsa.c (do_dsa_verify): Updated for Nettle's dsa_sha1_verify
	rename.
	(do_dsa_sign): Updated for Nettle's dsa_sha1_sign rename, and
	check return value.

Niels Möller's avatar
Niels Möller committed
826 827 828 829 830 831
	* src/server_session.c (stdin_eof): New function. If we have a
	pty, send EOF and ignore error.
	(oop_write_stdin): Use it.
	(do_receive): Use it.
	(do_server_session_event): Use it, replacing old code to send EOF.

Niels Möller's avatar
Niels Möller committed
832
2010-03-24  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
833 834 835 836 837 838 839

	* src/lsh-transport.c (start_userauth): Check return value from
	the SIGN method.
	* src/server_keyexchange.c (server_dh_handler): Likewise.

	* src/rsa.c (do_rsa_sign): Check return value from rsa_sha1_sign.

Niels Möller's avatar
Niels Möller committed
840
2010-03-23  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
841 842 843 844

	* src/client_x11.c (do_client_channel_x11_receive): Fixed broken,
	too short(!), allocation for X11 connection failure message.

Niels Möller's avatar
Niels Möller committed
845
2010-03-04  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
846

Niels Möller's avatar
Niels Möller committed
847 848 849 850
	* src/testsuite/functions.sh (spawn_xvfb): Explicitly setup the
	xauthority file using xauth add, don't rely on xauth generate and
	the X11 security extension.

Niels Möller's avatar
Niels Möller committed
851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869
	* src/lsh-keygen.c (main_argp_parser): Added --bit-length option,
	to replace the old --level option. Added sypport for -a symmetric,
	which generates random keys for use as a shared secret.
	(check_file): Allow file to be NULL.
	(process_private): Hex encode symmetric keys.
	(main): Use the value of the --bit-length option. New logic to
	handle generation of symmetric keys.
	(dsa_generate_key): Take bit size as input, not a NIST security
	level.
	(main_argp_parser): By default, don't encrypt symmetric keys.

	* src/lshd.c: Updated for service_config being a class.

	* src/server.c (make_service_config): New function, replacing
	init_service_config.

	* src/server.h (service_config): Make this into a class rather
	than a struct, for safer casting in service_argp_parser.

Niels Möller's avatar
Niels Möller committed
870
2010-02-23  Niels Möller  <nisse@lysator.liu.se>
871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890

	* src/lshd.c (lshd_context): Added service_config, deleted
	commented-out attributes.
	(lshd_service_request_handler): Made service configurable.
	(make_lshd_context): Use init_transport_context and
	init_service_config.
	(lshd_config): Deleted werror_config (it's inherited via
	server_config).
	(make_lshd_config): Deleted call to make_werror_config.
	(lshd_argp_children): Added service_argp.
	(lshd_argp_parser): Updated initialization of child_inputs. Setup
	default service, ssh-userauth.
	(lshd_config_handler): Fixed references to the inherited
	werror_config.

	* src/Makefile.in (COMMON_SOURCES): Added arglist.c.

	* src/server.h (service_config): New class.

	* src/server.c (init_service_config): New function.
Niels Möller's avatar
Niels Möller committed
891
	(service_argp, service_argp_parser): New parser för --service {
892 893
	... } argument.

Niels Möller's avatar
Niels Möller committed
894
2010-02-20  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
895 896 897 898 899 900 901 902 903 904

	* src/lsh-transport.c (make_lsh_transport_config): Use
	init_transport_context.
	(start_userauth): In verbose mode, display the user name we're
	trying to authenticate.
	(try_password_auth): Likewise.
	(try_keyboard_interactive_auth): Likewise.

	* src/transport.c (init_transport_context): New function.

Niels Möller's avatar
Niels Möller committed
905
2010-02-15  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
906

Niels Möller's avatar
Niels Möller committed
907 908 909
	* src/lshd.c (make_lshd_port): Check that IPV6_V6ONLY is defined
	before trying to setsockopt it.

Niels Möller's avatar
Niels Möller committed
910 911 912
	* src/testsuite/Makefile.in (OTHER_SOURCES): Added
	getpwnam-wrapper.c.

Niels Möller's avatar
Niels Möller committed
913
2010-02-11  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
914 915 916 917

	* src/lshd-userauth.c (main_options): Renamed options to start
	with --allow or --deny.

Niels Möller's avatar
Niels Möller committed
918
2010-02-08  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
919

Niels Möller's avatar
Niels Möller committed
920 921 922
	* configure.ac: When looking for a shared libc, look for the
	symlink /libc.so.* rather than the glibc-specific name libc-*.so.

Niels Möller's avatar
Niels Möller committed
923 924 925 926
	* src/lshd-userauth.c: Renamed configuration parameters and
	corresonding variables to allow-password, allow-publickey and
	allow-root-login.

Niels Möller's avatar
Niels Möller committed
927
2010-02-05  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
928 929 930 931 932 933 934 935 936 937 938 939 940 941

	* src/testsuite/config/lshd-userauth.conf: Added enable-publickey
	option.

	* src/testsuite/lsh-4-test: Added missing call to test_done.

	* src/lshd-userauth.c (lshd_userauth_config_handler): New
	function.
	(main_options): New options --password, --publickey, --root-login,
	and negated versions.
	(handle_userauth): Implement the the options.
	(handle_publickey, handle_password): Take the configuration as
	argument, and return 0 if the method is not enabled.

Niels Möller's avatar
Niels Möller committed
942
2010-02-04  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
943

Niels Möller's avatar
Niels Möller committed
944 945 946 947 948 949
	* src/server_config.c (parser_parse_option): Require new line at
	end of option-value pair, and warn for spurious tokens before the
	end of line.

	* src/tokenize_config.c (config_tokenizer_eolp): New function.

Niels Möller's avatar
Niels Möller committed
950 951
	* src/testsuite/Makefile.in (PASSWD_PRELOAD): New variable, set
	depending on IF_LD_PRELOAD, and passed to the environment of
Niels Möller's avatar
Niels Möller committed
952
	run-tests.
Niels Möller's avatar
Niels Möller committed
953 954 955 956 957 958 959 960 961 962
	(getpwnam-wrapper): Use $(CCPIC). Deleted -rdynamic when compiling
	and -Wl,-soname when linking.

	* configure.ac: Use LSH_CCPIC.
	(IF_LD_PRELOAD): New substituted variable, set if we apepar to
	use dynamic libraries.
	(KRB_PROGRAM, PAM_PROGRAM): Deleted.

	* src/config.make.in (CCPIC): New variable.

Niels Möller's avatar
Niels Möller committed
963
2010-02-02  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
964

Niels Möller's avatar
Niels Möller committed
965 966 967 968 969 970
	* src/testsuite/Makefile.in: Added rules for building
	getpwnam-wrapper.so. Needs to be configured.

	* src/testsuite/getpwnam-wrapper.c: New file, intended to be used
	for lshd test cases.

Niels Möller's avatar
Niels Möller committed
971 972 973
	* src/client.c (kill_client_connection): Use trace rather than
	werror.

Niels Möller's avatar
Niels Möller committed
974
2010-01-12  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
975 976 977 978 979

	* src/lshd-userauth.c (handle_password): New function, currently
	untested and #if:ed out.

	* src/crypto.h (hash_algorithm): Deleted class, just use the
980
	corresponding struct nettle_hash.
Niels Möller's avatar
Niels Möller committed
981

Niels Möller's avatar
Niels Möller committed
982
2009-10-25  Niels Möller  <nisse@lysator.liu.se>
983 984 985 986

	* configure.ac: Updated URL for liboop, it's now
	http://liboop.ofb.net.

Niels Möller's avatar
Niels Möller committed
987
2009-10-21  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
988 989 990 991

	* src/lshd.c (make_lshd_port): Set the IPPROTO_IPV6ONLY socket
	option when listening on an IPv6 socket.

Niels Möller's avatar
Niels Möller committed
992
2009-10-07  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
993 994 995 996

	* src/lshd-userauth.c (lookup_user): Added support for shadow
	passwords.

Niels Möller's avatar
Niels Möller committed
997
2009-09-22  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016

	* src/testsuite/lsh-6-test (ALGORITHMS): Updated list to include
	aes128 in cbc and ctr modes.

	* src/testsuite/aes-test.c: Added tests for aes128-cbc, aes128-ctr
	and aes256-ctr.

	* src/crypto.c (crypto_aes128_cbc_algorithm): New algorithm.
	(crypto_aes128_ctr_algorithm): Likewise.

	* src/algorithms.c (all_symmetric_algorithms): Added aes128-cbc
	and aes128-ctr.
	(all_crypto_algorithms): Likewise.
	(default_crypto_algorithms): Replaced aes256-cbc by aes128-ctr, as
	the preferred choice.
	(lookup_crypto): Added "aes128-cbc" with alias "aes-cbc", added
	"aes-128-ctr" with aliases "aes", "aes128", "aes-ctr". Removed
	some aliases for "aes256-cbc" and "aes256-ctr", including the old
	"rijndael" alias.
Niels Möller's avatar
Niels Möller committed
1017

Niels Möller's avatar
Niels Möller committed
1018
2009-09-05  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1019 1020 1021 1022

	* src/server_config.c (server_config_parse_example): Don't use
	options where the example is NULL.

Niels Möller's avatar
Niels Möller committed
1023
2009-09-01  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1024

Niels Möller's avatar
Niels Möller committed
1025 1026 1027 1028 1029 1030 1031 1032
	* src/testsuite/functions.sh (XAUTHORITY): Put xauthority file in
	$TEST_HOME.

	* src/Makefile.in (uninstall): Delete files in $(libexecdir).

	* doc/Makefile.in (DISTFILES): Removed explicit
	srp-spec.txt (already included via $(TARGETS)).

Niels Möller's avatar
Niels Möller committed
1033
	* src/Makefile.in: Added make rules for autoheader.
Niels Möller's avatar
Niels Möller committed
1034

Niels Möller's avatar
Niels Möller committed
1035
	* configure.ac: Test for $with_system_argp != no, rather than =
Niels Möller's avatar
Niels Möller committed
1036
	yes.
Niels Möller's avatar
Niels Möller committed
1037

Niels Möller's avatar
Niels Möller committed
1038
2009-08-31  Niels Möller  <nisse@lysator.liu.se>
1039

Niels Möller's avatar
Niels Möller committed
1040 1041 1042 1043
	* doc/Makefile.in (DISTFILES): Distribute TODO file.

	* Makefile.in (install uninstall): Recurse into sftp directory.

Niels Möller's avatar
Niels Möller committed
1044
2009-08-24  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1045 1046 1047

	* .bootstrap, Makefile.in, configure.ac: Reenable building of sftp.

Niels Möller's avatar
Niels Möller committed
1048
2009-05-30  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1049 1050 1051 1052

	* doc/Makefile.in (.texinfo.info): Don't use a temporary output file
	$@T, trust makeinfo to not remove output file on errors.

Niels Möller's avatar
Niels Möller committed
1053
2009-05-04  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1054 1055 1056

	* texinfo.tex: Upgrade to version 2009-03-22.17.

Niels Möller's avatar
Niels Möller committed
1057
2009-02-24  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1058

Niels Möller's avatar
Niels Möller committed
1059 1060 1061
	* src/server_pty.c (pty_open_slave): Work around Solaris problem
	with bogus definition of TIOCSCTTY.

Niels Möller's avatar
Niels Möller committed
1062 1063 1064
	* src/lshd-pty-helper.c (die, werror, process_request): Improved
	error messages.

Niels Möller's avatar
Niels Möller committed
1065
2009-02-23  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1066 1067 1068 1069 1070 1071 1072 1073 1074

	* src/testsuite/x11-4-test: Explicitly start /bin/sh at the remote
	end. Avoid recursive use of here-documents. Use $XAUTH, $XMODMAP
	and friends.

	* src/client_x11.c (make_client_x11_display): Use KILL_RESOURCE on failure.
	(do_client_channel_x11_receive): Send "access denied" message back
	when a connection is refused.

Niels Möller's avatar
Niels Möller committed
1075
2009-02-16  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1076

Niels Möller's avatar
Niels Möller committed
1077 1078 1079 1080 1081 1082 1083 1084 1085
	* src/testsuite/x11-2-test: Use lsh, not lshg, for this test. Also
	export DISPLAY.

	* src/testsuite/x11-1-test: export DISPLAY.
	* src/testsuite/x11-5-test: Likewise.

	* src/testsuite/functions.sh: Unset DISPLAY, don't export it (the
	tests that need it should do that).

Niels Möller's avatar
Niels Möller committed
1086 1087 1088 1089 1090 1091
	* src/testsuite/x11-5-test: Use $XMODMAP.

	* src/testsuite/functions.sh (XAUTH, XMODMAP, XVFB): New
	variables.
	(need_xvfb, spawn_xvfb): Use $XVFB.

Niels Möller's avatar
Niels Möller committed
1092
2009-02-12  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1093

Niels Möller's avatar
Niels Möller committed
1094 1095 1096 1097 1098 1099
	* src/testsuite/x11-2-test: Use lshg, and also check that the
	X-forwarding is removed properly.

	* src/testsuite/functions.sh (test_result): Sleep 3 seconds before
	trying xauth generate.

Niels Möller's avatar
Niels Möller committed
1100 1101 1102
	* src/werror.c (werror_vformat): Don't output any punctuation for
	%e. Changed all callers to use it like "...: %e.\n".

Niels Möller's avatar
Niels Möller committed
1103
2009-02-11  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1104 1105 1106 1107 1108 1109 1110

	* src/pty-helper.c (pty_send_message): Clear the control area, to
	work around overly strict length validation in CMSG_NXTHDR.
	Problem present at least in glibc.
	(pty_send_message, pty_recv_message): Also clear the entire msghdr
	struct.

Niels Möller's avatar
Niels Möller committed
1111
2008-12-02  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1112 1113 1114 1115 1116 1117 1118

	* contrib/lshd.debian.init: Updated file names for host key. Use
	SIGHUP when stopping daemon.

	* src/lshd.c (lshd_config_options): Use FILE_LSHD_HOST_KEY.
	(open_interface): Fixed handling of default (NULL) interface.

Niels Möller's avatar
Niels Möller committed
1119
2008-11-27  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1120 1121 1122 1123

	* src/testsuite/x11-1-test: Set $DISPLAY and $LSH_FLAGS at
	top-level, not just locally for exec_lsh function.

Niels Möller's avatar
Niels Möller committed
1124
2008-11-26  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1125

Niels Möller's avatar
Niels Möller committed
1126 1127 1128 1129 1130
	* src/pty-helper.c (CMSG_LEN): Fallback definition now includes
	int alignment at the end of the header.
	(pty_recv_message): Check that msg_controllen is large enough
	before using CMSG_FIRSTHDR.

Niels Möller's avatar
Niels Möller committed
1131 1132 1133
	* src/server_x11.c (open_x11_socket): Try to create directory
	/tmp/.X11-unix.

Niels Möller's avatar
Niels Möller committed
1134
2008-11-22  Niels Möller  <nisse@lysator.liu.se>
1135 1136 1137 1138 1139 1140

	* src/lsh-make-seed.c (main): Reverted part of change from
	2008-11-01. Don't explicitly set the seeded flag in the yarrow
	ctx, as that results in calls to aes_encrypt before
	aes_set_encrypt_key.

Niels Möller's avatar
Niels Möller committed
1141
2008-11-12  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1142 1143 1144 1145

	* src/testsuite/functions.sh (XAUTHORITY): Use a separate export
	statement for XAUTHORITY.

Niels Möller's avatar
Niels Möller committed
1146
2008-11-10  Niels Möller  <nisse@lysator.liu.se>
1147

Niels Möller's avatar
Niels Möller committed
1148 1149 1150 1151 1152
	* src/server_x11.c (create_xauth): Added fallback when libXau is
	unavailable. Avoid using the Xauth type in the argument list. Use
	O_EXCL when creating files.
	(server_x11_setup): Updated for new create_xauth interface.
	(do_kill_x11_listen_port): Delete xauthority file.
Niels Möller's avatar
Niels Möller committed
1153

Niels Möller's avatar
Niels Möller committed
1154
	* doc/Makefile.in (DISTFILES): Added srp-spec.txt.
1155

1156 1157
	* configure.ac: Use AC_CHECK_LIB to check for libXau.

Niels Möller's avatar
Niels Möller committed
1158
2008-11-09  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1159 1160 1161

	* src/testsuite/functions.sh: Explicitly export DISPLAY.

Niels Möller's avatar
Niels Möller committed
1162
2008-11-07  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1163

1164 1165 1166
	* configure.ac: Try a different workaround for libXau on
	Solaris-5.8.

Niels Möller's avatar
Niels Möller committed
1167 1168 1169 1170 1171 1172
	* src/pty-helper.c (pty_send_message): Set msg_control to NULL if
	controllen is 0, to make FreeBSD happy.

	* src/lshd-pty-helper.c (main): Fixed error message when
	pty_send_message fails.

Niels Möller's avatar
Niels Möller committed
1173 1174 1175
	* configure.ac: Fixed check for credentials passing to work on
	FreeBSD.

Niels Möller's avatar
Niels Möller committed
1176
2008-11-06  Niels Möller  <nisse@lysator.liu.se>
1177

1178 1179 1180
	* configure.ac: Moved checks for -lnsl and -lsocket earlier.
	Updated GMP URL.

1181 1182 1183
	* configure.ac: Fixed spurious # in include section i test for
	utmp members.

Niels Möller's avatar
Niels Möller committed
1184
2008-11-05  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1185 1186 1187 1188 1189

	* configure.ac: Check for XauGetAuthByAddr in both libXau and
	libX11.
	(XAUTH_PROGRAM): Deleted check and configure option.

Niels Möller's avatar
Niels Möller committed
1190
2008-11-04  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1191

Niels Möller's avatar
Niels Möller committed
1192 1193
	* src/server_pty.h: Include <sys/termios.h>.

Niels Möller's avatar
Niels Möller committed
1194 1195 1196
	* src/pty-helper.c: Added support for FreeBSD style credentials
	passing, with SCM_CREDS and struct cmsgcred.

Niels Möller's avatar
Niels Möller committed
1197
2008-11-01  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1198 1199 1200 1201 1202 1203 1204

	* src/unix_random.c (update_seed_file): Mix in current seed file
	before overwriting it.
	(random_init): yarrow256_force_reseed replaced by
	yarrow256_slow_reseed.

	* src/lsh-make-seed.c (main): Updated for new yarrow interface in
Niels Möller's avatar
Niels Möller committed
1205
	nettle-2.0.
Niels Möller's avatar
Niels Möller committed
1206 1207 1208 1209 1210 1211
	* src/seed_file.c (seed_file_write): Likewise, generate seed file
	with yarrow256_random.

	* src/crypto.c: Updated (nettle_crypt_func *) casts, for
	nettle-2.0.

Niels Möller's avatar
Niels Möller committed
1212
2008-10-30  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1213 1214 1215 1216

	* src/lsh.c (main_argp_parser): Support user@host notation.
	(main_argp_parser): Count self->start_gateway as an action.

Niels Möller's avatar
Niels Möller committed
1217
2008-10-22  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237

	* src/transport.c (transport_send_kexinit): Use make_kexinit
	function.
	* src/transport.h (class transport_context): Type of kexinit
	attribute changed to struct kexinit_info *.

	* src/lsh-transport.c (main_argp_parser): Use make_kexinit_info.
	* src/lshd.c (lshd_config_handler): Likewise.

	* src/keyexchange.c (class kexinit_info): Renamed from
	simple_kexinit. Don't inherit make_kexinit.
	(make_kexinit_info): Renamed from make_simple_kexinit.
	(make_kexinit): New function, replacing the make method of
	the make_kexinit class.

	* src/keyexchange.h (class make_kexinit): Deleted abstract class.

	* src/dh_exchange.c (dh_hash_update): Deleted free argument.
	Updated all callers.

Niels Möller's avatar
Niels Möller committed
1238
2008-09-26  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265

	* src/Makefile.in (COMMON_SOURCES): Moved queue.c here, from
	CONNECTION_SOURCES.

	* src/lshd.c (open_ports): Replaced by three new functions, to
	support multiple listen ports.
	(open_port): Look up a port using getaddrinfo, and bind one or
	more sockets.
	(open_interface): Bind all appropriate ports for a given
	interface.
	(open_all_ports): Open all configured ports on all interfaces.
	(class lshd_interface): New class.
	(class lshd_config): Use queues to handle multiple ports and
	interfaces.
	(parse_interface): New function.
	(main_argp_parser): Handle --interface option. Accept multiple -p
	options.
	(lshd_config_handler): Likewise. Added default port logic.

	* src/testsuite/config/lshd.conf: Removed interface option, it is
	set to localhost on the command line.

	* src/testsuite/functions.sh: Set $INTERFACE.

	* src/channel.c (channel_open_new_v): Removed function, merged
	into channel_open_new_type.

Niels Möller's avatar
Niels Möller committed
1266
2008-09-03  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277

	* src/transport.c (transport_process_packet): Parse SSH_DISCONNECT
	message and display the description and reason code.

	* src/lsh-transport.c (lsh_transport_lookup_verifier): Fixed the
	code for writing out the ACL entry.
	(read_host_acls): Fixed error message for read errors.

	* src/io.c (lsh_popen_write): Close the pipe to the spawned
	process after the data is written.

Niels Möller's avatar
Niels Möller committed
1278
2008-09-02  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1279 1280 1281 1282 1283 1284 1285 1286

	* src/lsh-transport.c (lsh_transport_lookup_verifier):
	Reintroduced call to werror_quiet_p. --sloppy --quiet means that
	keys are accepted (but not stored in .lsh/host-acls), with no
	question asked.

	* src/atoms.in: Commented out or deleted unused symbols.

Niels Möller's avatar
Niels Möller committed
1287
2008-09-01  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315

	* src/testsuite/functions.sh: --capture-to option renamed to
	--host-db-update.
	* src/testsuite/lsh-9-test: Likewise.
	* src/testsuite/rapid7-lsh-test: Likewise.

	* src/lsh.c (main_options): --capture-to option renamed to
	--host-db-update. For backwards compatibility, old name kept as a
	hidden alias.
	(main_argp_parser): Pass on --host-db-update.

	* src/lsh-transport.c (lsh_transport_lookup_verifier): Ask before
	writing ACL. Add more details in the ACL comments. Use
	lsh_popen_write to pipe data through sexp-conv --lock.
	(read_host_acls): Added file name argument.
	(main_options): Renamed option --capture-to to --host-db-update.
	(main_argp_parser): Pass file name to read_host_acls. Make the
	--host-db-update option default to the file used for --host-db, by
	default ~/.lsh/host-acls.

	* src/unix_interact.c (interact_yes_or_no): Deleted argument free.
	Use werror_quiet_p and return default answer in quiet mode.
	Updated callers.

	* src/io.c (lsh_popen): Removed function, merged with
	lsh_popen_read.
	(lsh_popen_write): New function.

Niels Möller's avatar
Niels Möller committed
1316
2008-08-28  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358

	* src/unix_random.c (random_add): Don't associate any entropy with
	input of type RANDOM_SOURCE_SECRET.
	(random_init_system): Use GET_FILE_ENV, which uses FILE_SEED_FILE.

	* src/seed_file.c (seed_file_lock): Compare return value from
	fcntl to -1; according to the Solaris 10 man page, the return
	value on success not -1 but otherwise not specified at all.

	* src/lshd.c (lshd_config_handler): Use FILE_LSHD_PID and
	FILE_LSHD_HOST_KEY.

	* src/lsh-make-seed.c (main_argp_parser): Use FILE_SEED_FILE_DIR
	and FILE_SEED_FILE.

	* src/lsh-keygen.c (main_argp_parser): Use FILE_LSHD_CONFIG_DIR
	and FILE_LSHD_HOST_KEY. Create FILE_LSHD_CONFIG_DIR if it doesn't
	exist.

	* src/Makefile.in (LIBEXEC_PROGRAMS): New variable, listing
	programs that are moved to libexec, lsh-transport, lshd-userauth,
	lshd-connection and lshd-pty-helper.
	(environ.h): Substitute localstatedir.
	(install): Install $(LIBEXEC_PROGRAMS).
	(tags-here): Put TAGS file in source directory.

	* src/config.make.in (libexecdir): New variable.
	(sysconfdir): Likewise.
	(localstatedir): Likewise.

	* src/environ.h.in (LOCALSTATEDIR): New macro.
	(FILE_LSHD_HOST_KEY): New macro.
	(FILE_LSHD_PID): New macro.
	(FILE_SEED_FILE_DIR): New macro.
	(FILE_SEED_FILE): New macro.
	(FILE_LSHD_CONNECTION): Use LIBEXECDIR.
	(FILE_LSHD_PTY_HELPER): Likewise.
	(FILE_LSHD_USERAUTH): Likewise.
	(FILE_LSH_TRANSPORT): Likewise.

	* src/daemon.c (PID_DIR, PID_SUFFIX): Deleted unused macros.

Niels Möller's avatar
Niels Möller committed
1359
2008-08-26  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1360 1361 1362 1363 1364

	* src/testsuite/Makefile.in (tags): New target.

	* doc/Makefile.in (tags): New do nothing target.

Niels Möller's avatar
Niels Möller committed
1365
2008-08-20  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1366

Niels Möller's avatar
Niels Möller committed
1367
	* src/transport.c (transport_connection_kill): Cancel
Niels Möller's avatar
Niels Möller committed
1368
	oop_timer_retry.
Niels Möller's avatar
Niels Möller committed
1369 1370 1371
	(transport_stop_read): Likewise.
	(oop_timer_retry): Assert that the connection is alive.

Niels Möller's avatar
Niels Möller committed
1372 1373 1374 1375 1376 1377 1378 1379
	* src/lshd.c (class lshd_port): Inherit io_listen_port.
	(kill_port): Deleted function, it was identical with
	kill_io_fd_resource.
	(lshd_port_accept): Converted from an oop callback to an accept
	method for the io_listen_port class. Use SERVER_VERSION_LINE.
	(make_lshd_port): Changed return type to struct resource *. Take a
	sockaddr as argument, rather than an fd. Create and initialize the
	socket. Use io_listen.
Niels Möller's avatar
Niels Möller committed
1380
	(open_ports): Creation of socket moved to make_lshd_port.
Niels Möller's avatar
Niels Möller committed
1381 1382 1383 1384 1385 1386 1387 1388
	(main): Simplified logic slightly for the daemon mode.

	* src/version.h (SERVER_PROTOCOL_VERSION): Deleted constant.
	(CLIENT_PROTOCOL_VERSION): Likewise.
	(SERVER_VERSION_LINE): New constant.
	(CLIENT_VERSION_LINE): Likewise.
	Updated all users.

Niels Möller's avatar
Niels Möller committed
1389
2008-08-19  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1390 1391

	* src/lshd.c (class lshd_port): Inherit io_listen_port.
Niels Möller's avatar
Niels Möller committed
1392
	(kill_port): Deleted function.
Niels Möller's avatar
Niels Möller committed
1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419

	* src/io.c (kill_io_fd_resource): New function, replacing
	kill_io_connect_state and kill_io_listen_port.
	(init_io_connect_state): Updated for new super class
	io_fd_resource.
	(oop_io_connect): Likewise.
	(io_connect): Likewise.
	(init_io_listen_port): Likewise.
	(oop_io_accept): Likewise.
	(io_listen): Likewise.
	* src/client_tcpforward.c (do_forward_local_port): Likewise.
	* src/client_x11.c (x11_connect): Likewise.
	* src/gateway.c (do_gateway_port_accept): Likewise.
	(make_gateway_port): Likewise.
	* src/server_session.c (do_kill_server_session): Likewise.
	* src/server_tcpforward.c (make_server_forward): Likewise.
	* src/server_x11.c (do_kill_x11_listen_port): Likewise.
	(do_x11_listen_port_accept): Likewise.
	(make_x11_listen_port): Likewise.
	(server_x11_setup): Likewise.
	* src/socks.c (do_make_socks_server): Likewise.
	* src/tcpforward.c (tcpforward_connect): Likewise.

	* src/io.h (class io_fd_resource): New class.
	(class io_connect_state): Inherit io_fd_resource.
	(class io_listen_port): Likewise.

Niels Möller's avatar
Niels Möller committed
1420
2008-08-11  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1421 1422 1423

	* src/spki.c (spki_pkcs5_encrypt): Handle the case of no IV.

Niels Möller's avatar
Niels Möller committed
1424
2008-08-04  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1425

Niels Möller's avatar
Niels Möller committed
1426 1427
	* src/lsh-writekey.c: Deleted program.

Niels Möller's avatar
Niels Möller committed
1428 1429 1430
	* src/client_x11.c (x11_connect_error): Fixed call to
	channel_open_deny.

Niels Möller's avatar
Niels Möller committed
1431
2008-07-27  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1432 1433 1434

	Merged lsh-writekey into lsh-keygen. Old lsh-keygen behavior is
	enabled with --write-raw, old lsh-writekey behaviour is enabled by
Niels Möller's avatar
Niels Möller committed
1435 1436
	--read-raw.

Niels Möller's avatar
Niels Möller committed
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457
	* src/testsuite/write-key-1-test: Use lsh-keygen --write-raw.
	* src/testsuite/write-key-2-test: Likewise.

	* src/testsuite/rapid7-lsh-test: Silence output.

	* src/testsuite/lsh-decrypt-key-test: Use the --read-raw and
	--write-raw flags to lsh-keygen.

	* src/testsuite/keygen-1-test: Don't use lsh-writekey.
	* src/testsuite/keygen-2-test: Likewise.
	* src/testsuite/lsh-encrypted-key-test: Likewise.
	* src/testsuite/setup-env: Likewise.

	* src/Makefile.in (BIN_PROGRAMS): Removed lsh-writekey.
	(INTERACT_RANDOM_SOURCES): New variable.
	(CRYPTO_SOURCES): Removed lock_file.c and randomness.c. Added
	seed_file.c.
	(CONNECTION_SOURCES): Removed command.c and exception.c.
	(lsh_SOURCES): Removed xauth.c.
	(lsh_writekey_SOURCES): Deleted.
	(lsh_writekey_OBJS): Deleted.
Niels Möller's avatar
Niels Möller committed
1458
	(lsh-writekey): Deleted target.
Niels Möller's avatar
Niels Möller committed
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479
	(lsh_transport_OBJS): Added $(INTERACT_RANDOM_OBJS).
	(lsh_keygen_OBJS): Likewise.

	* src/lsh-keygen.c: New constants OPT_READ_RAW, OPT_WRITE_RAW,
	OPT_LABEL and OPT_PASSPHRASE.
	(class lsh_keygen_options): New flags read_raw and write_raw.
	Merged configuration attributes from lsh-writekey.
	(make_lsh_keygen_options): Initialize new attributes.
	(main_options): Merged lsh-writekey options.
	(main_argp_parser): Merged option handling from lsh-writekey.
	(main_argp): New shorter description.
	(dsa_generate_key): Adapted to new randomness interface. Deleted
	randomness argument.
	(rsa_generate_key): Likewise.
	(check_file): Moved from lsh-writekey.c.
	(open_file): Likewise.
	(process_private): Likewise.
	(process_public): Likewise.
	(main): Adapted to new randomness interface. Aded code to split
	key into private and public parts, stored in different files.

Niels Möller's avatar
Niels Möller committed
1480
2008-07-07  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1481 1482

	Reorganized client actions.
Niels Möller's avatar
Niels Möller committed
1483

Niels Möller's avatar
Niels Möller committed
1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525
	* src/lsh.h: Deleted forward declarations of obsolete classes.

	* src/channel.c (make_channel_open_exception): Deleted function.

	* src/command.c: Deleted file.
	* src/command.h: Deleted file.
	* src/exception.c: Deleted file.
	* src/exception.h: Deleted file.

	* src/lsh.c (class lsh_options): Deleted handler attribute. Added
	detach flag.
	(make_options): Deleted handler argrment.
	(add_action): Changed argument type to client_connection_action.
	(make_client_session): Deleted handler argument in call to
	make_client_session_channel.
	(client_shell_session): Changed return type to
	client_connection_action. Use make_open_session_action.
	(client_subsystem_session): Likewise.
	(client_command_session): Likewise.
	(main_argp_parser): Changeed handling of -B, just set detach flag.
	(class lsh_default_handler): Deleted class.
	(do_lsh_default_handler): Deleted function.
	(make_lsh_default_handler): Deleted function.
	(main): Actions are now handled using the client_connection_action
	class, not as commands. This was the last use of the command and
	exception abstractions.
	(main): Handle detach (-B flag) here.

	* src/tcpforward.c (tcpforward_remove): Use CAST_SUBTYPE.

	* src/socks.c (SOCKS_HANDSHAKE): Deleted macro.
	(class make_socks_server_action): Replaces class
	make_socks_server_command.
	(make_socks_server): Changed return type to
	client_connection_action.

	* src/channel_forward.c (forward_start_io_command): Deleted unused
	command.

	* src/client_tcpforward.c (class forward_local_port_action):
	Replaces class forward_local_port_command.
	(class request_tcpip_forward_action): Replaces class
Niels Möller's avatar
Niels Möller committed
1526
	request_tcpip_forward_command.
Niels Möller's avatar
Niels Möller committed
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543
	(forward_local_port): Changed return type to
	client_connection_action.
	(forward_remote_port): Likewise.

	* src/client_session.c (do_client_session_event): No special error
	handling for CHANNEL_EVENT_DENY.
	(make_client_session_channel): Deleted exception handler argument.

	* src/client.c (class session_open_action): Replaces class
	session_open_command.
	(class background_process_command): Deleted class.

	* src/client.h (class client_connection_action): New class.
	(class client_session): Deleted exception handler attribute.

	* src/server_tcpforward.c (OPEN_FORWARDED_TCPIP): Deleted unused
	macro.
Niels Möller's avatar
Niels Möller committed
1544

Niels Möller's avatar
Niels Möller committed
1545
2008-07-06  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578

	Simplified interface to the randomness generator.

	* src/testsuite/Makefile.in (TEST_OBJS): Removed lock_file.o,
	randomness.o and unix_random.o.

	* src/testsuite/testutils.c (bad_random): New global variable.
	(random_generate): New fake randomness generator, replacing the
	real generator for the testcases.
	(lsh_random): Likewise.
	(test_sign): Initialize the fake randomness generator.

	* src/testsuite/functions.sh: Set $LSH_MAKE_SEED to /bin/false.

	* src/environ.h.in (FILE_LSH_MAKE_SEED): New macro.
	(ENV_LSH_MAKE_SEED): Likewise.

	* src/unix_random_user.c: New file.
	(random_init_user): New function. Replaces make_user_random. Tries
	to create the seed file automatically, if missing.

	* src/unix_random.c: Use globals for the generator state.
	(unix_random): Deleted class.
	(read_initial_seed_file): Simplified. Permission check moved to
	random_init. Seeking is done by read_seed_file.
	(update_seed_file): Deleted argument. Use seed_file.h interface.
	(trivia_source): Renamed from do_trivia_source. Use globals.
	(device_source): Renamed from do_device_source. Use globals.
	(random_generate): Replaces method do_unix_random.
	(random_add): Replaces method do_unix_random_add.
	(random_init): Use seed_file.h interface. Initialize all globals,
	including the sources'.
	(make_user_random): Deleted, replaced by random_init_user in
Niels Möller's avatar
Niels Möller committed
1579
	unix_random_user.c.
Niels Möller's avatar
Niels Möller committed
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640
	(random_init_system): Replaces make_system_random.
	(lsh_random): Moved definition here, from randomness.c.

	* src/lsh-make-seed.c (enum source_type): Deleted type
	SOURCE_DEV_MEM.
	(main): Use seed_file.h interface for locking and writing to the
	seed file.

	* src/lsh-writekey.c: Adapted to new randomness interface.

	* src/lsh-transport.c (make_lsh_transport_config): No argument to
	all_signature_algorithms. Deleted call to make_user_random.
	(lsh_transport_service_packet_handler): No randomness argument to
	lsh_string_write_random.
	(try_password_auth): Use random_add to mix the secret password
	into the randomness generator.
	(main): Use random_init_user.

	* src/lsh-export-key.c: No argument to all_signature_algorithms.

	* src/client_x11.c (channel_open_x11): Deleted old #if:ed out
	code.
	(xauth_lookup): Function moved here, from xauth.c.
	* xauth.c, xauth.h: Deleted files.

	* src/gateway_tcpforward.c (do_kill_gateway_forward): Fixed typo
	in prototype.

	* src/client_keyexchange.c (client_dh_init): Updated for new
	dh_generate_secret, with no randomness argument.
	* src/server_keyexchange.c (server_dh_init): Likewise.

	* src/lock_file.c, src/lock_file.h: Deleted, replaced by
	seed_file.c and seed_file.h
	* src/seed_file.h: New file.
	* src/seed_file.c: New file.

	* src/transport.c (oop_write_ssh): Updated call to
	transport_write_flush.
	(transport_send_packet): Updated calls to transport_write_packet
	and transport_write_flush.
	(transport_send_kexinit): Updated to new make_kexinit interface.

	* src/transport_write.c (make_ignore_packet): Deleted randomness
	argument.
	(transport_write_packet): Likewise.
	(transport_write_flush): Likewise.

	* src/transport_read.c (decode_packet): Use random_add, to mix the
	received random padding into the pool.

	* src/transport.h (class transport_context): Deleted randomness
	attribute.

	* src/spki.c (spki_pkcs5_encrypt): Deleted randomness argument.

	* src/lshd.c (make_lshd_context): No randomness attribute.
	(lshd_config_handler): Adapted to new randomness interface.
	(main): Likewise.

	* src/dsa.c (class dsa_algorithm): Deleted class, randomness
Niels Möller's avatar
Niels Möller committed
1641
	attribute no longer needed.
Niels Möller's avatar
Niels Möller committed
1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670
	(class dsa_signer): Deleted randomness attribute.
	(do_dsa_sign): Adapted to new randomness interface.
	(make_dsa_signer): No randomness attribute.
	(make_dsa_algorithm): Deleted function. Replaced by...
	(dsa_algorithm): New static object.

	* src/encrypt.c (encrypt_packet): Deleted randomness argument.

	* src/dh_exchange.c (dh_generate_secret): Deleted randomness
	argument.

	* src/algorithms.c (all_signature_algorithms): Deleted randomness
	argument.

	* src/randomness.c: Deleted file.

	* src/lsh_string.c (lsh_string_random): Adapted to new randomness
	interface, and deleted randomness argument.
	(lsh_string_write_random): Likewise.

	* src/keyexchange.h (class make_kexinit): Deleted randomness
	argument from the make method.
	(MAKE_KEXINIT): Deleted macro.

	* src/keyexchange.c (do_make_simple_kexinit): Adapted to new
	randomness interface, and deleted randomness argument.

	* src/randomness.h: Deleted randomness class. New interface using
	plain functions random_generate and random_add.
Niels Möller's avatar
Niels Möller committed
1671

Niels Möller's avatar
Niels Möller committed
1672
2008-06-17  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1673

Niels Möller's avatar
Niels Möller committed
1674 1675
	* src/.dist_classes (dist_classes): Deleted channel.c.x,
	combinators.c.x, gateway_channel.c.x, io_commands.c.x. Added
Niels Möller's avatar
Niels Möller committed
1676 1677 1678 1679 1680
	gateway_tcpforward.c.x.

	* src/.dist_headers (dist_headers): Deleted io_commands.h and
	suspend.h.

Niels Möller's avatar
Niels Möller committed
1681
2008-06-16  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693

	* src/testsuite/Makefile.in (TS_SH): Added lshg-tcpip-remote-test.

	* src/testsuite/lshg-tcpip-remote-test: New test case.

	* src/Makefile.in (lsh_SOURCES): Added gateway_tcpforward.c.

	* src/gateway.h (gateway_tcpip_forward_handler): New declaration.

	* src/gateway.c (make_gateway_connection): Add handler for
	GLOBAL_REQUEST tcpip-forward.

Niels Möller's avatar
Niels Möller committed
1694
2008-06-15  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1695 1696 1697

	* src/gateway_tcpforward.c: New file.

Niels Möller's avatar
Niels Möller committed
1698
2008-06-14  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1699 1700 1701 1702 1703 1704 1705 1706 1707

	* src/Makefile.in (lsh_SOURCES): Added gateway_x11.c.

	* src/testsuite/Makefile.in (TS_SH): Added x11-5-test.

	* src/testsuite/x11-5-test: New test for x11 forwarding over a
	gateway.

	* src/lsh.c (main): When we're starting a gateway, enable channel
Niels Möller's avatar
Niels Möller committed
1708
	open handler for x11 and forwrded-tcp channels.
Niels Möller's avatar
Niels Möller committed
1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728

	* src/gateway_x11.c (gateway_x11_request_handler): Put the handler
	on the connection's resource list. Record the number of pending
	replies *including* the one for the x11-req.

	* src/gateway_channel.c (class gateway_channel): Moved to
	gateway.h. Adapted to changed type of chain.
	(do_kill_gateway_channel): Kill x11
	handler, if present.
	(do_gateway_channel_event): Check for the reply to x11-req, and
	install x11 handler.
	(gateway_forward_channel_open): Install handler for x11-req on the
	originating channel.

	* src/gateway.h (class gateway_channel): Moved definition here,
	from gateway_chanel.h. Changed type of chain attribute to
	gateway_channel.

	* src/gateway_x11.c: New file.

Niels Möller's avatar
Niels Möller committed
1729
2008-06-09  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780

	* src/xalloc.c (lsh_object_check_subtype): Removed support for
	LSH_ALLOC_STACK.

	* src/server_tcpforward.c (remove_server_forward): Deleted.
	(do_tcpip_forward_handler): Adapted to new convention. Use
	global_request_reply.
	(do_tcpip_cancel_forward): Adapted to new convention. Use
	global_request_reply, and tcpforward_remove.

	* src/pty-helper.c (pty_send_message): Moved declaration of creds.

	* src/lshd-pty-helper.c (process_request): Deleted werror messages
	for each request.

	* src/client_x11.c (channel_open_x11): Use CAST_SUBTYPE, since
	client_x11_handler has subclasses.

	* src/tcpforward.c (tcpforward_remove): New function.

	* src/client_tcpforward.c (class remote_port): Inherit
	client_tcpforward_handler.
	(do_remote_port_open): New function
	(make_remote_port): Initialize open method.
	(channel_open_forwarded_tcpip): Look up a
	client_tcpforward_handler for the port, and invoke its open
	method. Code for actual connecting is moved to
	do_remote_port_open.
	(class remote_port_state): New class, replacing
	remote_port_continuation and remote_port_exception_handler.
	(do_remote_port_state_done): New function.
	(class remote_port_continuation): Deleted.
	(do_remote_port_continuation): Deleted.
	(make_remote_port_continuation): Deleted.
	(class remote_port_exception_handler): Deleted.
	(do_remote_port_exception_handler): Deleted.
	(make_remote_port_exception_handler): Deleted.
	(do_request_tcpip_forward): Adapted to new
	channel_send_global_request convention, and use
	make_remote_port_state.

	* src/client_session.c (handle_exit_status): struct
	channel_request_info renamed to request_info.
	(handle_exit_signal): Likewise.
	* src/server_session.c (shell_request_handler): struct
	channel_request_info renamed to request_info.
	(exec_request_handler): Likewise.
	(do_spawn_subsystem): Likewise.
	(pty_request_handler): Likewise.
	(window_change_request_handler): Likewise.
	(x11_request_handler): Likewise.
Niels Möller's avatar
Niels Möller committed
1781 1782
	* src/gateway_channel.c (gateway_forward_channel_request): struct
	channel_request_info renamed to request_info.
Niels Möller's avatar
Niels Möller committed
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820

	* src/client.h (class client_tcpforward_handler): New class.

	* src/channel.c (class request_status): Deleted.
	(make_request_status): Deleted.
	(class global_request_continuation): Deleted.
	(send_global_request_responses): Deleted.
	(do_global_request_response): Deleted.
	(make_global_request_response): Deleted.
	(class global_request_exception_handler): Deleted.
	(do_exc_global_request_handler): Deleted.
	(make_global_request_exception_handler): Deleted.
	(handle_global_request): New simplified handler convention, with
	no continuation or exception_handler.
	(global_request_reply): New function.
	(handle_global_success): Use new global_request_state class.
	(handle_global_failure): Likewise.
	(handle_channel_request): struct channel_request_info renamed to
	request_info.
	(channel_request_reply): Likewise.
	(channel_send_global_request): Use struct global_request_state
	instead of struct command_context.

	* src/channel.h (struct channel_request_info): Deleted.
	(class channel_request): Use struct request_info for the handler
	method.
	(class global_request_state): New class.

	* src/connection.c (init_ssh_connection): Deleted initialization
	of active_global_requests.

	* src/connection.h (struct request_info): New struct, replaces
	channel_request_info in channel.h. Used for both global requests
	and channel requests.
	(class ssh_connection): Deleted active_global_requests.
	(class global_request): The handler method now takes a struct
	request_info as argument, and no continuation or exception_handler.

Niels Möller's avatar
Niels Möller committed
1821
2008-05-30  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840

	* src/lsh.c (maybe_x11): Pass zero single_connection argument to
	make_x11_action.

	* src/client_x11.c (make_client_x11_handler): Deleted function.
	(class client_x11_display): Inherit client_x11_handler.
	(channel_open_x11): Invoke the handler's open method.
	(client_add_x11_handler): Take an argument of type
	client_x11_handler *, not resource *.
	(do_client_x11_display_open): New function.
	(make_client_x11_display): New argument single_connection.
	Initialize super class and open method.
	(do_action_x11_success): Updated for client_x11_display inheriting
	client_x11_handler.
	(make_x11_action): New argument single_connection.

	* src/client.h (class client_x11_handler): New class, replacing
	similar class in client_x11.c.

Niels Möller's avatar
Niels Möller committed
1841
2008-05-28  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1842

Niels Möller's avatar
Niels Möller committed
1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869
	* src/gateway_channel.c (do_gateway_channel_event): Pass on
	CHANNEL_SUCCESS and CHANNEL_FAILURE to the other channel.
	(do_gateway_channel_request): Deleted.
	(gateway_forward_channel_request): New channel request handler,
	replacing do_gateway_channel_request. Use channel_send_request.
	(do_gateway_channel_success): Deleted.
	(do_gateway_channel_failure): Deleted.
	(gateway_request_methods): Deleted.
	(gateway_forward_channel_open): Renamed, was gateway_forward_open.
	Updated all callers. Initialize request_fallback.

	* src/gateway.c (oop_read_gateway): Use verbose for message at EOF.
	(kill_gateway_connection): Use trace.

	* src/channel.c (handle_channel_request): Use request_fallback.
	(handle_channel_success): Deleted check for request_methods.
	(handle_channel_failure): Likewise.
	(init_channel): Initialize request_fallback.
	(channel_send_request): The type is now specified as length and
	pointer. Updated all callers.

	* src/channel.h (struct channel_request_methods): Deleted.
	(class ssh_channel): New attribute request_fallback, replacing
	request_methods.

	* src/scm/Makefile.am: Deleted obsolete file.

Niels Möller's avatar
Niels Möller committed
1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930
	* src/Makefile.in (CONNECTION_SOURCES): Removed combinators.c.

	* src/testsuite/Makefile.in (TS_SH): Added x11-3-test and x11-4-test.

	* src/testsuite/functions.sh (stdin_lsh): New function.

	* src/testsuite/testutils.c (test_sign): Use STATIC_HEADER, not
	STACK_HEADER.

	* src/testsuite/x11-2-test: Use xmodmap, not xdpyinfo to test
	connecting to the X server.

	* src/testsuite/x11-4-test: New test case, testing that bad
	cookies are rejected.

	* src/testsuite/x11-3-test: New test case, testing that fake and
	real cookie differs.

	* src/resource.c (resource_list_top): Corrected handling of empty
	list.

	* src/lsh.h (LSH_ALLOC_STACK): Deleted constant.
	(STACK_HEADER): Deleted macro.

	* src/gc.c (gc_mark): Removed support for LSH_ALLOC_STACK.

	* src/connection.c (connection_remember): Deleted command.

	* src/command.h: Deleted macros and declarations related to the
	combinator commands.

	* src/command.c (class command_apply): Deleted.
	(do_command_apply): Deleted function.
	(make_apply): Deleted function.
	(class gaba_continuation)): Deleted.
	(do_gaba_continuation): Deleted function.
	(gaba_apply): Deleted function.

	* src/client_x11.c (do_action_x11_success): Set session->x11.

	* src/client_session.c (do_kill_client_session): Kill pty and x11
	resources.
	(oop_read_stdin): When reading is finished, kill pty resource, and
	no other resources.
	(make_client_session_channel): Initialize pty and x11 attributes.
	Replaces initialization of the resource list.

	* src/client_pty.c (client_pty_resource): Reintroduced class.
	Previous incarnation was called client_tty_resource.
	(do_kill_client_pty_resource): Kill window change callback.
	(make_client_pty_resource): Renamed, was make_client_tty_resource.
	Added session argument. Install window change callback.
	(do_action_pty_success): Use new make_client_pty_resource, and
	store result in sesion->pty.

	* src/client.h (class client_session): Deleted resource list.
	Replaced by separate resources for pty and x11.

	* src/channel.c (channel_open_deny): Fixed assertion.
	(channel_open_confirm): Added assertion.

Niels Möller's avatar
Niels Möller committed
1931
2008-05-26  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031

	* src/combinators.c: Deleted file.

	* src/Makefile.in (CONNECTION_SOURCES): Deleted io_commands.c.

	* src/testsuite/Makefile.in (TS_SOURCES): Resurrected
	sockaddr2info-test.c.
	* src/testsuite/sockaddr2info-test.c: Resurrected file.

	* src/server_session.c (class server_session): x11 object now
	refers to the listen port. Deleted resources list.
	(x11_request_handler): Adapted to server_x11_setup changes.

	* src/server_x11.c (make_x11_server_info): Deleted function.
	(class server_x11_socket): Deleted class.
	(do_kill_x11_socket): Deleted function.
	(make_server_x11_socket): Deleted function.
	(do_kill_x11_listen_port): New function.
	(do_x11_listen_port_accept): New function.
	(make_x11_listen_port): New function.
	(open_x11_socket): Use make_x11_listen_port.
	(server_x11_setup): Use new io_listen. Return port object.

	* src/server_x11.h (class x11_listen_port): New class, merging
	server_x11_info and server_x11_socket.

	* src/socks.c (make_socks_channel): listen_value argument replaced
	by fd and peer info. Call io_register_fd.
	(socks_handshake): Deleted command.
	(socks_listen_port): New class.
	(do_socks_accept): New function.
	(make_socks_listen_port): New function.
	(class make_socks_server_command): New class.
	(do_make_socks_server): New function, wrapping
	make_socks_listen_port.
	(make_socks_server): New function, replacing the old
	expr-construction.

	* src/server_tcpforward.c (make_server_forward): Use
	make_tcpforward_listen_port and io-listen. New argument
	connection.
	(open_forwarded_tcpip_command): Deleted command.
	(expr tcpforward_forwarded_tcpip): Deleted.
	(class tcpip_forward_request_continuation): Deleted.
	(do_tcpip_forward_request_continuation): Deleted function.
	(make_tcpip_forward_request_continuation): Deleted function.
	(class tcpip_forward_request_exception_handler): Deleted.
	(do_tcpip_forward_request_exc): Deleted.
	(make_tcpip_forward_request_exc): Deleted.
	(do_tcpip_forward_handler): Simplified, letting
	make_server_forward to most of the work.

	* src/client_tcpforward.c (open_direct_tcpip_command): Deleted
	command.
	(class forward_local_port_command): New class.
	(do_forward_local_port): New function, wrapping
	make_tcpforward_listen_port.
	(forward_local_port): New function, replacing the old
	expr-construction.
	(forward_remote_port): Use const. Also affects other classes
	related to remote forwarding.

	* src/lsh.c (prepend_action): Deleted function.
	(main): Use new make_gateway_port.

	* src/gateway.c (command gateway_accept): Deleted.
	(class gateway_port): New class.
	(do_gateway_port_accept): New function.
	(expr make_gateway_setup): Deleted.
	(make_gateway_port): New function, replacing make_gateway_setup.

	* src/io.c (kill_io_connect_state): Simplified, io_close_fd
	ignores negative fd:s.
	(kill_io_listen_port): New function.
	(init_io_listen_port): New function.
	(oop_io_accept): New function.
	(io_listen): New function, replacing function in io_commands.c.
	(sockaddr2info): Resurrected function. Use const sockaddr *
	argument. Handle only AF_INET and AF_INET6.
	(io_bind_local): Use const argument.
	(io_connect_local): Likewise.

	* src/io.h (class listen_value): Deleted class.
	(class io_listen_port): New class.

	* src/io_commands.c, src/io_commands.h: Deleted files.

	* src/tcpforward.h (class forwarded_port): Use const.

	* src/tcpforward.c (tcpforward_connect): Use const for
	address_info argument.
	(tcpforward_listen_port): New class.
	(do_tcpforward_listen_port_accept): New function.
	(make_tcpforward_listen_port): New function.

	* src/client_x11.c (make_client_x11_channel): Use a write buffer
	size corresponding to a full window, and initialize
	rec_window_size to a smaller value corresponding to the initial
	X11 packet wth authentication data.

Niels Möller's avatar
Niels Möller committed
2032
2008-05-23  Niels Möller  <nisse@lysator.liu.se>
Niels Möller's avatar
Niels Möller committed
2033

Niels Möller's avatar
Niels Möller committed
2034 2035
	* src/io_commands.c (make_listen_value): Added missing break.

Niels Möller's avatar
Niels Möller committed
2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068
	* src/server_session.c (shell_request_handler): Updated to new
	channel_request interface.
	(exec_request_handler): Likewise.
	(do_spawn_subsystem): Likewise.
	(pty_request_handler): Likewise.
	(x11_request_handler): Likewise.
	(window_change_request_handler): Updated to new channel_request
	interface. Never send a reply. Write a warning if ioctl fails.

	* src/client_session.c (handle_exit_status): Updated to new
	channel_request interface. Never send a reply.
	(handle_exit_signal): Likewise.

	* src/channel.h (class ssh_channel): Deleted the active_requests
	queue.
	(class channel_request): Deleted contuniation and exception
	handler arguments to the handler method.
	(DEFINE_CHANNEL_REQUEST): Updated prototype.

	* src/channel.c (class channel_request_continuation): Deleted.
	(send_channel_request_responses): Deleted function.
	(do_channel_request_response): Deleted function.
	(make_channel_request_response): Deleted function.
	(class channel_request_exception_handler): Deleted.
	(do_exc_channel_request_handler): Deleted function.
	(make_channel_request_exception_handler): Deleted function.
	(handle_channel_request): Pass no continuation and exception
	handler to the request handler. Request handlers are expected to
	call channel_request_reply before returning, making unnecessary
	the old code for ensuring that requests are replied to in order.
	(channel_request_reply): New function.
	(init_channel): No initialization of active_requests.

Niels Möller's avatar
Niels Möller committed
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104
	* src/testsuite/Makefile.in (TS_SH): Added x11-1-test and
	x11-2-test.

	* src/testsuite/functions.sh (XAUTHORITY: New exported variables.
	(TEST_DISPLAY): New variable.
	(DISPLAY): Unset.

	* src/testsuite/x11-1-test: Use LSH_FLAGS to pass the --x11 flag to lsh.

	* src/testsuite/x11-2-test: New testcase, using an Xvfb X server.

	* src/Makefile.in (lshd_connection_SOURCES): Added server_x11.c.

	* src/server_x11.h (class server_x11_info): Use const strings.

	* src/server_x11.c (make_x11_server_info): New function.
	(class forwarded_x11_callback): New class, replacing
	channel_open_command_x11.
	(do_open_forwarded_x11): New function, replacing new_x11_channel.
	(make_forwarded_x11_callback): New function.
	(class open_forwarded_x11): Deleted.
	(expr server_x11_callback): Deleted.
	(class server_x11_socket): Replaced old lsh_fd pointer by an fd.
	This class should be merged with the corresponding port object.
	(make_server_x11_socket): New function.
	(open_x11_socket): Updated to new io_bind_sockaddr. Use
	make_server_x11_socket. Don't call io_listen, leave that to the
	caller.
	(class xauth_exit_callback): Deleted.
	(make_xauth_exit_callback): Deleted function.
	(bad_string): Deleted function.
	(create_xauth): New function using XauWriteAuth.
	(server_x11_setup): Support the single flag. Deleted code for
	spawnign an xauth process, use create_xauth and libXau instead.
	Use io_listen and make_forwarded_x11_callback. Deleted
	continuation and exception handling arguments. Changed DISPLAY to
Niels Möller's avatar
Niels Möller committed
2105
	unix:<number>:<screen>.
Niels Möller's avatar
Niels Möller committed
2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133

	* src/server_session.c (class server_session): New attribute
	resources.
	(do_kill_server_session): Kill additional resources.
	(make_server_session): Initialize resources.
	(x11_request_handler): Decode hex cookie. Deleted continuation
	and exception handler arguments to server_x11_setup.

	* src/lshd-userauth.c (main_argp_parser): Use lsh_string_hex_decode.
	(decode_hex): Deleted function.

	* src/lshd-connection.c (make_lshd_connection): Enable X11 forwarding.

	* src/lsh_string.c (lsh_string_hex_decode): New function.

	* src/io_commands.c (io_listen): New function.
	(listen_tcp_command): Use io_listen. Deallocate sockaddr also in the
	success case.
	(listen_local_command): Use io_listen.

	* src/io.h (class local_info): Use const strings.
	* src/io.c (make_local_info): Use const arguments.

	* src/xauth.c (xauth_process): Deleted function.
	(xauth_lookup): Set family correctly for IPv6. Use XauGetAuthByAddr.

	* src/scm/gaba.scm (process-class): Allow absent variable list.

Niels Möller's avatar
Niels Möller committed
2134
	* src/alist.h (class alist): Deleted size attribute.
Niels Möller's avatar
Niels Möller committed
2135 2136
	* src/alist.c: Deleted code to update size.