Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
LSH
lsh
Commits
f69dc9be
Commit
f69dc9be
authored
Oct 03, 2001
by
Niels Möller
Browse files
(options2keys): New command, that uses read_host_key,
and replaces options2keyfile. Rev: src/lshd.c:1.130
parent
3733632f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lshd.c
View file @
f69dc9be
...
...
@@ -65,12 +65,14 @@
struct
command
options2local
;
#define OPTIONS2LOCAL (&options2local.super)
struct
command
options2key
file
;
#define OPTIONS2KEY
FILE
(&options2key
file
.super)
struct
command
options2key
s
;
#define OPTIONS2KEY
S
(&options2key
s
.super)
#if 0
struct command options2signature_algorithms;
#define OPTIONS2SIGNATURE_ALGORITHMS \
(&options2signature_algorithms.super)
#endif
#include
"lshd.c.x"
...
...
@@ -286,28 +288,20 @@ DEFINE_COMMAND(options2signature_algorithms)
COMMAND_RETURN
(
c
,
options
->
signature_algorithms
);
}
/* Read server's private key */
DEFINE_COMMAND
(
options2keyfile
)
/* FIXME: Call read_host_key directly from main instead. */
DEFINE_COMMAND
(
options2keys
)
(
struct
command
*
ignored
UNUSED
,
struct
lsh_object
*
a
,
struct
command_continuation
*
c
,
struct
exception_handler
*
e
)
struct
exception_handler
*
e
UNUSED
)
{
CAST
(
lshd_options
,
options
,
a
);
struct
lsh_fd
*
f
;
f
=
io_read_file
(
options
->
hostkey
,
e
);
struct
alist
*
keys
=
make_alist
(
0
,
-
1
);
read_host_key
(
options
->
hostkey
,
options
->
signature_algorithms
,
keys
);
if
(
f
)
COMMAND_RETURN
(
c
,
f
);
else
{
werror
(
"Failed to open '%z' (errno = %i): %z.
\n
"
,
options
->
hostkey
,
errno
,
STRERROR
(
errno
));
EXCEPTION_RAISE
(
e
,
make_io_exception
(
EXC_IO_OPEN_READ
,
NULL
,
errno
,
NULL
));
}
COMMAND_RETURN
(
c
,
keys
);
}
...
...
@@ -700,9 +694,7 @@ main_argp =
(init object make_kexinit)
(services object command) )
(expr (lambda (options)
(let ((keys
(spki_read_hostkeys (options2signature_algorithms options)
(options2keyfile options))))
(let ((keys (options2keys options)))
(listen_callback
(lambda (lv)
(services (connection_handshake
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment