Commit a495b7da authored by Niels Möller's avatar Niels Möller

* Merged experimental branch. Also:

* src/testsuite/server-config-test.c: New file (merged manually
from experimental branch).

* src/lshd.c (make_lshd_config): Initialize werror_config.
(lshd_config_handler): Pass self->werror_config to child parser.
(main): Merged new daemonic handling from main branch.

* src/testsuite/functions.sh (spawn_lshd): Use --daemonic option.

* Merged experimental branch. Also:

Rev: ChangeLog:1.894
Rev: configure.ac:1.65
Rev: make_am:1.8(DEAD)
Rev: misc/make-am:1.3
Rev: src/.cvsignore:1.35
Rev: src/.dist_classes:1.17
Rev: src/.dist_headers:1.15
Rev: src/Makefile.am:1.29
Rev: src/abstract_crypto.c:1.25(DEAD)
Rev: src/abstract_crypto.h:1.44(DEAD)
Rev: src/abstract_io.c:1.6(DEAD)
Rev: src/abstract_io.h:1.38(DEAD)
Rev: src/algorithms.c:1.38
Rev: src/algorithms.h:1.13
Rev: src/arglist.c:1.2
Rev: src/arglist.h:1.2
Rev: src/atoms.c:1.14
Rev: src/atoms.h:1.10
Rev: src/atoms.in:1.39
Rev: src/channel.c:1.126
Rev: src/channel.h:1.78
Rev: src/channel_commands.c:1.31(DEAD)
Rev: src/channel_commands.h:1.22(DEAD)
Rev: src/channel_forward.c:1.15
Rev: src/channel_forward.h:1.9
Rev: src/channel_io.c:1.2
Rev: src/channel_io.h:1.2
Rev: src/charset.c:1.15
Rev: src/client.c:1.169
Rev: src/client.h:1.62
Rev: src/client_escape.c:1.10
Rev: src/client_keyexchange.c:1.69
Rev: src/client_keyexchange.h:1.20(DEAD)
Rev: src/client_pty.c:1.28
Rev: src/client_session.c:1.22
Rev: src/client_tcpforward.c:1.2
Rev: src/client_userauth.c:1.62(DEAD)
Rev: src/client_userauth.h:1.9(DEAD)
Rev: src/client_x11.c:1.27
Rev: src/combinators.c:1.20
Rev: src/command.c:1.51
Rev: src/command.h:1.64
Rev: src/compress.h:1.7
Rev: src/connection.c:1.84
Rev: src/connection.h:1.77
Rev: src/connection_commands.c:1.44(DEAD)
Rev: src/connection_commands.h:1.20(DEAD)
Rev: src/crypto.c:1.38
Rev: src/crypto.h:1.36
Rev: src/debug.c:1.42(DEAD)
Rev: src/dh_exchange.c:1.21
Rev: src/dsa.c:1.43
Rev: src/encrypt.c:1.28
Rev: src/environ.h.in:1.6
Rev: src/exception.c:1.19
Rev: src/exception.h:1.32
Rev: src/format.c:1.55
Rev: src/format.h:1.46
Rev: src/gateway.c:1.11
Rev: src/gateway.h:1.4
Rev: src/gateway_channel.c:1.19
Rev: src/gateway_channel.h:1.8(DEAD)
Rev: src/gateway_commands.c:1.25(DEAD)
Rev: src/gateway_commands.h:1.7(DEAD)
Rev: src/gc.c:1.34
Rev: src/handshake.c:1.29(DEAD)
Rev: src/handshake.h:1.10(DEAD)
Rev: src/io.c:1.217
Rev: src/io.h:1.111
Rev: src/io_commands.c:1.67
Rev: src/io_commands.h:1.35
Rev: src/keyexchange.c:1.96
Rev: src/keyexchange.h:1.61
Rev: src/list.c:1.11
Rev: src/lock_file.c:1.9
Rev: src/lock_file.h:1.4
Rev: src/lookup_verifier.c:1.5(DEAD)
Rev: src/lookup_verifier.h:1.9(DEAD)
Rev: src/lsh-decode-key.c:1.24
Rev: src/lsh-decrypt-key.c:1.3
Rev: src/lsh-execuv.c:1.7(DEAD)
Rev: src/lsh-export-key.c:1.21
Rev: src/lsh-keygen.c:1.21
Rev: src/lsh-make-seed.c:1.17
Rev: src/lsh-transport.c:1.2
Rev: src/lsh-writekey.c:1.41
Rev: src/lsh.c:1.202
Rev: src/lsh.h:1.34
Rev: src/lsh_process.h:1.2
Rev: src/lsh_proxy.c:1.38(DEAD)
Rev: src/lsh_string.c:1.4
Rev: src/lsh_string.h:1.5
Rev: src/lshd-connection.c:1.2
Rev: src/lshd-pty-helper.c:1.2
Rev: src/lshd-userauth.c:1.2
Rev: src/lshd.c:1.174
Rev: src/lshd_read.c:1.2
Rev: src/lshg.c:1.28(DEAD)
Rev: src/nettle/ChangeLog:1.393
Rev: src/nettle/Makefile.in:1.34
Rev: src/nettle/examples/Makefile.in:1.14
Rev: src/nettle/testsuite/Makefile.in:1.23
Rev: src/nettle/tools/Makefile.in:1.17
Rev: src/parse.c:1.44
Rev: src/parse.h:1.31
Rev: src/parse_config.c:1.8
Rev: src/parse_config.h:1.4
Rev: src/process_atoms:1.16
Rev: src/proxy.c:1.21(DEAD)
Rev: src/proxy.h:1.8(DEAD)
Rev: src/proxy_agentforward.c:1.7(DEAD)
Rev: src/proxy_agentforward.h:1.3(DEAD)
Rev: src/proxy_session.c:1.12(DEAD)
Rev: src/proxy_session.h:1.6(DEAD)
Rev: src/proxy_tcpforward.c:1.9(DEAD)
Rev: src/proxy_tcpforward.h:1.3(DEAD)
Rev: src/proxy_userauth.c:1.17(DEAD)
Rev: src/proxy_userauth.h:1.4(DEAD)
Rev: src/proxy_x11forward.c:1.9(DEAD)
Rev: src/proxy_x11forward.h:1.3(DEAD)
Rev: src/pty-helper.c:1.2
Rev: src/pty-helper.h:1.2
Rev: src/publickey_crypto.c:1.49(DEAD)
Rev: src/publickey_crypto.h:1.54(DEAD)
Rev: src/queue.c:1.14
Rev: src/queue.h:1.15
Rev: src/randomness.h:1.17
Rev: src/read_data.c:1.38(DEAD)
Rev: src/read_data.h:1.17(DEAD)
Rev: src/read_file.c:1.9(DEAD)
Rev: src/read_line.c:1.35(DEAD)
Rev: src/read_line.h:1.19(DEAD)
Rev: src/read_packet.c:1.61(DEAD)
Rev: src/read_packet.h:1.12(DEAD)
Rev: src/reaper.c:1.28
Rev: src/reaper.h:1.13
Rev: src/resource.c:1.28
Rev: src/resource.h:1.16
Rev: src/rsa.c:1.30
Rev: src/scm/gaba.scm:1.19
Rev: src/server.c:1.80
Rev: src/server.h:1.22
Rev: src/server_authorization.c:1.24(DEAD)
Rev: src/server_authorization.h:1.7(DEAD)
Rev: src/server_config.c:1.2
Rev: src/server_config.h:1.2
Rev: src/server_keyexchange.c:1.59
Rev: src/server_keyexchange.h:1.14(DEAD)
Rev: src/server_password.c:1.36(DEAD)
Rev: src/server_pty.c:1.31
Rev: src/server_pty.h:1.15
Rev: src/server_publickey.c:1.28(DEAD)
Rev: src/server_session.c:1.104
Rev: src/server_session.h:1.21
Rev: src/server_tcpforward.c:1.2
Rev: src/server_userauth.c:1.45(DEAD)
Rev: src/server_userauth.h:1.25(DEAD)
Rev: src/server_x11.c:1.22
Rev: src/server_x11.h:1.8
Rev: src/service.h:1.20
Rev: src/service_read.c:1.2
Rev: src/sexp.c:1.50
Rev: src/sexp.h:1.41
Rev: src/socks.c:1.6
Rev: src/spki.c:1.59
Rev: src/spki.h:1.33
Rev: src/srp-gen.c:1.25
Rev: src/srp.h:1.9
Rev: src/srp_exchange.c:1.22
Rev: src/ssh.h:1.13
Rev: src/ssh_read.c:1.2
Rev: src/ssh_read.h:1.2
Rev: src/ssh_write.c:1.2
Rev: src/ssh_write.h:1.2
Rev: src/string_buffer.c:1.12(DEAD)
Rev: src/string_buffer.h:1.7(DEAD)
Rev: src/tcpforward.c:1.70
Rev: src/tcpforward.h:1.21
Rev: src/tcpforward_commands.c:1.48(DEAD)
Rev: src/testsuite/.cvsignore:1.23
Rev: src/testsuite/Makefile.am:1.76
Rev: src/testsuite/config/lshd-connection.conf:1.2
Rev: src/testsuite/config/lshd-userauth.conf:1.2
Rev: src/testsuite/config/lshd.conf:1.2
Rev: src/testsuite/conv-1-test:1.5
Rev: src/testsuite/conv-2-test:1.7
Rev: src/testsuite/conv-3-test:1.5
Rev: src/testsuite/export-1-test:1.5
Rev: src/testsuite/functions.sh:1.41
Rev: src/testsuite/lcp-test:1.4
Rev: src/testsuite/login-auth-test:1.4
Rev: src/testsuite/lsh-10-test:1.2
Rev: src/testsuite/lsh-cat-test:1.6
Rev: src/testsuite/lsh-encrypted-key-test:1.5
Rev: src/testsuite/lshd-no-auth-test:1.4
Rev: src/testsuite/lshd-random-input-test:1.2
Rev: src/testsuite/lshg-1-test:1.6
Rev: src/testsuite/lshg-cat-2-test:1.6
Rev: src/testsuite/lshg-cat-test:1.7
Rev: src/testsuite/lshg-tcpip-local-test:1.6
Rev: src/testsuite/parse-config-test.c:1.3
Rev: src/testsuite/rapid7-lsh-test:1.7
Rev: src/testsuite/rapid7-lshd-test:1.6
Rev: src/testsuite/server-config-test.c:1.1
Rev: src/testsuite/setup-env:1.3
Rev: src/tokenize_config.c:1.2
Rev: src/tokenize_config.h:1.2
Rev: src/transport.c:1.7
Rev: src/transport.h:1.8
Rev: src/transport_forward.c:1.2
Rev: src/transport_forward.h:1.2
Rev: src/transport_read.c:1.2
Rev: src/transport_write.c:1.2
Rev: src/unix_interact.c:1.30
Rev: src/unix_process.c:1.17
Rev: src/unix_random.c:1.19
Rev: src/userauth.c:1.8(DEAD)
Rev: src/userauth.h:1.39(DEAD)
Rev: src/werror.c:1.75
Rev: src/werror.h:1.36
Rev: src/write_buffer.c:1.29(DEAD)
Rev: src/write_buffer.h:1.27(DEAD)
Rev: src/write_packet.c:1.4
Rev: src/xalloc.c:1.35
Rev: src/xalloc.h:1.32
Rev: src/xauth.c:1.13
Rev: src/zlib.c:1.38
parents 7f48a966 3acd2a6c
This diff is collapsed.
dnl Process this file with autoconf to produce a configure script.
AC_INIT([lsh], [2.0.4], [bug-lsh@gnu.org])
AC_INIT([lsh], [2x1], [bug-lsh@gnu.org])
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR([src/lsh.c])
# Needed to stop autoconf from looking for files in parent directories.
......@@ -569,6 +569,7 @@ if test x$lsh_cv_sys_ai_numerichost = xyes ; then
AC_DEFINE(HAVE_AI_NUMERICHOST)
fi
# Used only by lsh-make-seed, the rest of te code uses liboop
AC_CHECK_FUNCS(poll,,[AC_LIBOBJ([jpoll])])
# Test if the libc includes a good enough argp.
......@@ -737,6 +738,8 @@ AH_TEMPLATE([HAVE_UNIX98_PTYS],
[Define if a we have working UNIX98 pty handling])
if test x$lsh_cv_sys_unix98_ptys = xyes; then
AC_DEFINE(HAVE_UNIX98_PTYS)
else
AC_MSG_WARN([No support for UNIX98 PTYs. PTY support disabled.])
fi
LSH_GCC_ATTRIBUTES
......@@ -791,6 +794,7 @@ if test x$GCC = xyes ; then
CFLAGS="$CFLAGS -ggdb3"
fi
# FIXME: It would be better to actually test if this option works and/or is needed.
# Or perhaps use -funsigned-char.
if "$CC" --version | grep 'gcc.* 4\.' 1>/dev/null 2>&1; then
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
......@@ -805,6 +809,7 @@ if test x$GCC = xyes ; then
fi
# Used by contrib/solpkg.sh.in.
AC_SUBST(BUILD_ARCH, `uname -p`)
AC_SUBST(BUILD_OSSYS,`uname -s`)
AC_SUBST(BUILD_OSREV,`uname -r`)
......
#! /bin/bash
# This program wants to recieve a list of needed headers on stdin. It
# reads Makefile.am.in and creates Makefile.am.
# How do we run this script again?
if [ -z "$BASH" ]; then
BASH=bash
fi
if [ -z "$SELF" ]; then
SELF="$BASH make_am"
fi
rethink=no
options=''
function werror () {
echo 1>&2 "$@"
}
while true; do
case $1 in
--rethink)
rethink=yes
;;
--*)
echo make_am: Unknown option $1
exit 1
;;
*)
break
esac
options="$options $1"
shift
done
if [ $# != 0 ]; then
dir=$1
top=no
else
dir=.
top=yes
fi
werror "make_am: dir='$dir', top=$top, rethink=$rethink"
# Input file on fd 3
if [ -f $dir/Makefile.am.in ]; then
exec 3<$dir/Makefile.am.in
else
# echo 1>&2 "make_am: No Makefile.am.in in $dir"
exit 0
fi
# Output file on fd 4
exec 4>$dir/Makefile.am
echo 1>&4 '##' "Automatically generated by make_am, `date`"
echo 1>&4 '##' "Process this file with automake to produce Makefile.in"
echo 1>&4
function get_header () {
keyword=''
while [ x$keyword = x ]; do
read <&3 keyword args
if [ $? != 0 ]; then
werror "make_am: Unexpected end of file"
exit 1
fi
case $keyword in
\#*)
keyword=''
;;
*:)
keyword=`echo $keyword | sed 's/^\(.*\):$/\1/'`
;;
esac ;
done
werror "get_header: '$keyword'"
}
# # Run commands with the same data on stdin
# commands=""
#
# function add_command {
# commands="$commands tee >($1 ; cat >/dev/null) |"
# }
#
# function run_commands {
# echo 1>&2 "run_commands: $commands cat >/dev/null"
# bash -c "$commands cat >/dev/null"
# }
subdirs=''
function all_used_headers () {
werror all_used_headers
if [ $rethink = yes ]; then
werror rethink
# Determining the list of used headers is a global
# operation, so use find to recurse in all the
# subdirs.
$BASH src/used_headers .h . `find . -type d`
else
cat /dev/null
fi
}
while true; do
get_header;
case $keyword in
CVS_HEADERS)
# automake expands "foo \\\n\nbar" -> "foo \\\nbar". So
# put all the files on one line, for simplicity.
# comm -12 - <($BASH src/cvs_headers $dir) | sed 's/\$/ \\\\/';
if [ $rethink = yes ]; then
( (echo $args = .dist_headers;
all_used_headers \
| comm -12 - <( $BASH src/cvs_headers $dir ) \
| tee $dir/.dist_headers) | tr '\n' ' ';
echo) 1>&4
else
( (echo $args = .dist_headers ' '
cat $dir/.dist_headers) | tr '\n' ' '
echo) 1>&4
fi
;;
CLASS_FILES)
( ( echo $args = .dist_classes;
if [ $rethink = yes ]; then
$BASH src/used_headers .x $dir | tee $dir/.dist_classes
else
cat $dir/.dist_classes
fi) | tr '\n' ' '
echo) 1>&4
;;
SUBDIRS)
subdirs=$args
echo 1>&4 "SUBDIRS = $args"
for d in $args; do
if [ x$d != x. ] ; then
$SELF $options $dir/$d || exit 1
fi
done
;;
BODY)
# if [ $top = yes ]; then
# if [ $rethink = yes ]; then
# # Determining the list of used headers is a global
# # operation, so use find to recurse in all the
# # subdirs.
# $BASH src/used_headers .h . `find $subdirs -type d` | run_commands
# else
# run_commands </dev/null
# fi
# else
# run_commands
# fi && cat <&3 >&4
cat <&3 >&4
exit 0
;;
*)
werror "make_am: Unknown keyword '$keyword'"
exit 1
;;
esac
done
#! /bin/bash
export LC_ALL=C
used_headers () {
(
extension=${1:-h}
......
......@@ -32,9 +32,13 @@ lsh-keygen
lsh-krb-checkpw
lsh-make-seed
lsh-pam-checkpw
lsh-transport
lsh-writekey
lsh_proxy
lshd
lshd-connection
lshd-pty-helper
lshd-userauth
lshg
packet_types.h
pkcs5-test
......
dist_classes = \
abstract_crypto.h.x \
abstract_io.h.x \
algorithms.h.x \
alist.c.x \
alist.h.x \
channel.c.x \
channel.h.x \
channel_commands.c.x \
channel_commands.h.x \
channel_forward.h.x \
channel_io.h.x \
client.c.x \
client.h.x \
client_escape.c.x \
client_keyexchange.c.x \
client_pty.c.x \
client_session.c.x \
client_userauth.c.x \
client_x11.c.x \
client_tcpforward.c.x \
combinators.c.x \
command.c.x \
command.h.x \
compress.h.x \
connection.c.x \
connection.h.x \
connection_commands.h.x \
crypto.c.x \
debug.c.x \
crypto.h.x \
dsa.c.x \
exception.c.x \
exception.h.x \
gateway.h.x \
gateway_channel.c.x \
gateway_channel.h.x \
gateway_commands.c.x \
handshake.c.x \
handshake.h.x \
interact.h.x \
io.c.x \
io.h.x \
......@@ -43,52 +32,44 @@ dist_classes = \
list.h.x \
lock_file.c.x \
lock_file.h.x \
lookup_verifier.h.x \
lsh-decode-key.c.x \
lsh-decrypt-key.c.x \
lsh-export-key.c.x \
lsh-keygen.c.x \
lsh-make-seed.c.x \
lsh-transport.c.x \
lsh-writekey.c.x \
lsh.c.x \
lsh_process.h.x \
lshd-connection.c.x \
lshd-userauth.c.x \
lshd.c.x \
lshg.c.x \
parse_config.c.x \
publickey_crypto.h.x \
queue.h.x \
randomness.h.x \
read_data.c.x \
read_file.c.x \
read_line.c.x \
read_line.h.x \
read_packet.c.x \
reaper.c.x \
reaper.h.x \
resource.h.x \
rsa.c.x \
server.c.x \
server_authorization.c.x \
server.h.x \
server_keyexchange.c.x \
server_password.c.x \
server_pty.h.x \
server_publickey.c.x \
server_session.c.x \
server_userauth.c.x \
server_userauth.h.x \
server_x11.c.x \
server_tcpforward.c.x \
server_x11.h.x \
service_read.c.x \
socks.c.x \
spki.h.x \
srp-gen.c.x \
srp.h.x \
ssh_read.h.x \
ssh_write.h.x \
tcpforward.c.x \
tcpforward.h.x \
tcpforward_commands.c.x \
transport.c.x \
transport.h.x \
transport_forward.h.x \
transport_read.c.x \
unix_interact.c.x \
unix_process.c.x \
unix_random.c.x \
unix_user.c.x \
userauth.h.x \
write_buffer.h.x \
write_packet.c.x \
werror.h.x \
zlib.c.x
dist_headers = \
abstract_crypto.h \
abstract_io.h \
algorithms.h \
alist.h \
arglist.h \
atoms.h \
channel.h \
channel_commands.h \
channel_forward.h \
channel_io.h \
charset.h \
client.h \
client_keyexchange.h \
client_userauth.h \
command.h \
compress.h \
connection.h \
connection_commands.h \
crypto.h \
daemon.h \
exception.h \
format.h \
gateway.h \
gateway_channel.h \
gateway_commands.h \
gc.h \
handshake.h \
interact.h \
io.h \
io_commands.h \
keyexchange.h \
list.h \
lock_file.h \
lookup_verifier.h \
lsh.h \
lsh_argp.h \
lsh_process.h \
lsh_string.h \
parse.h \
parse_config.h \
parse_macros.h \
publickey_crypto.h \
pty-helper.h \
queue.h \
randomness.h \
read_data.h \
read_line.h \
read_packet.h \
reaper.h \
resource.h \
server.h \
server_authorization.h \
server_keyexchange.h \
server_config.h \
server_pty.h \
server_session.h \
server_userauth.h \
server_x11.h \
service.h \
sexp.h \
spki.h \
srp.h \
ssh.h \
string_buffer.h \
ssh_read.h \
ssh_write.h \
suspend.h \
tcpforward.h \
tokenize_config.h \
translate_signal.h \
transport.h \
transport_forward.h \
tty.h \
userauth.h \
version.h \
werror.h \
write_buffer.h \
xalloc.h \
xauth.h
......@@ -32,9 +32,13 @@
/lsh-krb-checkpw
/lsh-make-seed
/lsh-pam-checkpw
/lsh-transport
/lsh-writekey
/lsh_proxy
/lshd
/lshd-connection
/lshd-pty-helper
/lshd-userauth
/lshg
/packet_types.h
/pkcs5-test
......
......@@ -14,11 +14,14 @@ SCHEME = $(SCHEME_PROGRAM) -l $(srcdir)/scm/$(SCHEME_NAME)-compat.scm
EXTRA_PROGRAMS = lsh-krb-checkpw lsh-pam-checkpw srp-gen
bin_PROGRAMS = lsh lshg lsh-keygen lsh-writekey lsh-decrypt-key \
lsh-decode-key lsh-export-key lsh-make-seed \
@SRP_PROGRAM@
# @SRP_PROGRAM@ are broken at the moment
bin_PROGRAMS = lsh lsh-transport lsh-keygen lsh-writekey lsh-decrypt-key \
lsh-decode-key lsh-export-key lsh-make-seed
sbin_PROGRAMS = lshd lshd-userauth lshd-connection lshd-pty-helper \
@KRB_PROGRAM@ @PAM_PROGRAM@
sbin_PROGRAMS = lshd lsh-execuv @KRB_PROGRAM@ @PAM_PROGRAM@
bin_SCRIPTS = lsh-authorize ssh-conv lsh-upgrade lsh-upgrade-key lcp
noinst_LIBRARIES = liblsh.a
......@@ -34,44 +37,58 @@ generated_sources = atoms_defines.h atoms_gperf.c atoms_table.c \
bootstrap: $(generated_sources) $(dist_classes)
(cd spki && $(MAKE) bootstrap)
liblsh_a_SOURCES = abstract_io.c abstract_crypto.c \
algorithms.c alist.c atoms.c \
channel.c channel_commands.c channel_forward.c \
# Old files:
#
# client_keyexchange.c client_userauth.c connection_commands.c
#
# read_packet.c write_packet.c
# client_x11.c server_x11.c tcpforward_commands.c
# Obsoleted files: read_data.c read_file.c read_line.c abstract_io.c
# write_buffer.c channel_commands.c string_buffer.c handshake.c
# lshd_keyexchange.c debug.c gateway_commands.c lshg.c
liblsh_a_SOURCES = algorithms.c alist.c arglist.c atoms.c \
channel.c channel_io.c channel_forward.c \
charset.c \
client.c client_escape.c client_keyexchange.c \
client_pty.c client_session.c client_userauth.c client_x11.c \
client.c client_escape.c \
client_pty.c client_session.c client_tcpforward.c \
combinators.c command.c compress.c \
parse_config.c connection.c connection_commands.c \
connection.c \
crypto.c \
daemon.c \
debug.c dh_exchange.c \
dh_exchange.c \
dsa.c \
encrypt.c \
exception.c \
format.c gc.c \
gateway.c gateway_channel.c gateway_commands.c \
handshake.c \
interact.c io.c io_commands.c \
gateway.c gateway_channel.c \
keyexchange.c \
list.c lookup_verifier.c \
list.c \
lock_file.c \
lsh_string.c parse.c \
parse_config.c \
pkcs5.c \
publickey_crypto.c queue.c \
pty-helper.c \
queue.c \
randomness.c \
read_data.c read_file.c read_line.c read_packet.c \
reaper.c resource.c \
rsa.c \
server.c server_authorization.c server_keyexchange.c \
server_password.c server_publickey.c \
server_pty.c server_session.c server_userauth.c \
server_x11.c sexp.c socks.c \
server.c \
server_pty.c server_session.c server_tcpforward.c \
server_config.c \
service_read.c \
sexp.c socks.c \
spki.c srp_exchange.c \
string_buffer.c suspend.c \
tcpforward.c tcpforward_commands.c \
ssh_read.c ssh_write.c \
suspend.c \
tcpforward.c \
tokenize_config.c \
translate_signal.c tty.c \
unix_interact.c unix_process.c unix_random.c unix_user.c \
userauth.c \
werror.c write_buffer.c write_packet.c \
unix_interact.c unix_process.c unix_random.c \
werror.c \
xalloc.c xauth.c zlib.c
liblsh_a_LIBADD = @LIBOBJS@
......@@ -114,20 +131,22 @@ packet_types.h: ssh.h invert-defs
lsh_krb_checkpw_LDADD=@KRB_LIBS@
lsh_execuv_LDADD=
LDADD = liblsh.a spki/libspki.a nettle/libnettle.a @LIBARGP@
# To avoid having to link lshg with nettle, link with dummy.o.
# FIXME: We still link with gmp and zlib, to avoid that we'd need to
# remove them from LIBS. The only libraries really needed for lshg is
# liboop and perhaps libXau.
# remove them from LIBS. The only libraries really needed by
# non-transport programs are liboop and perhaps libXau.
lshd_pty_helper_SOURCES = lshd-pty-helper.c pty-helper.c
lshd_pty_helper_LDADD =
lshd_SOURCES = lshd.c transport.c transport_read.c transport_write.c \
transport_forward.c server_keyexchange.c
lshg_SOURCES = lshg.c dummy.c
lshg_LDADD = liblsh.a @LIBARGP@
lsh_transport_SOURCES = lsh-transport.c transport.c transport_read.c transport_write.c \
transport_forward.c client_keyexchange.c
class-map: $(srcdir)/make-class-map $(dist_classes)
class-map: $(srcdir)/make-class-map .dist_classes $(dist_classes)
cat $(dist_classes) | grep '^CLASS:' \
| sort | awk -f $(srcdir)/make-class-map > $@
......
/* abstract_crypto.c
*
*/
/* lsh, an implementation of the ssh protocol
*
* Copyright (C) 1998 Niels Möller
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <string.h>
#include "abstract_crypto.h"
#include "crypto.h"
#include "format.h"
#include "lsh_string.h"
#include "werror.h"
#include "xalloc.h"
#define GABA_DEFINE
#include "abstract_crypto.h.x"
#undef GABA_DEFINE
struct lsh_string *
hash_string(const struct hash_algorithm *a,
const struct lsh_string *in,
int free)
{
struct hash_instance *hash = make_hash(a);
struct lsh_string *out;
hash_update(hash, STRING_LD(in));
out = hash_digest_string(hash);
KILL(hash);
if (free)
lsh_string_free(in);
return out;
}
struct lsh_string *
mac_string(struct mac_algorithm *a,
const struct lsh_string *key,
int kfree,
const struct lsh_string *in,
int ifree)
{
struct lsh_string *out;
struct mac_instance *mac
= MAKE_MAC(a, lsh_string_length(key), lsh_string_data(key));
MAC_UPDATE(mac, lsh_string_length(in), lsh_string_data(in));
out = MAC_DIGEST_STRING(mac);
KILL(mac);
if (kfree)
lsh_string_free(key);
if (ifree)
lsh_string_free(in);
return out;
}
struct lsh_string *
crypt_string(struct crypto_instance *c,
const struct lsh_string *in,
int free)
{
struct lsh_string *out;
uint32_t length = lsh_string_length(in);
if (c->block_size && (length % c->block_size))
return NULL;
if (free)
{
/* Do the encryption in place. The type cast is permissible
* because we're conceptually freeing the string and reusing the
* storage. */
out = (struct lsh_string *) in;
}
else
/* Allocate fresh storage. */
out = lsh_string_alloc(length);
CRYPT(c, length, out, 0, in, 0);
return out;
}
/* FIXME: Missing testcases. This is only used for encrypted private
* keys */
struct lsh_string *
crypt_string_pad(struct crypto_instance *c,