Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
LSH
lsh
Commits
a9aefe4f
Commit
a9aefe4f
authored
Sep 17, 1998
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass a handler for KEXINIT-messages to the connection.
Rev: src/server.c:1.7 Rev: src/server.h:1.4
parent
848f2d2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
21 deletions
+26
-21
src/server.c
src/server.c
+16
-17
src/server.h
src/server.h
+10
-4
No files found.
src/server.c
View file @
a9aefe4f
...
...
@@ -25,15 +25,15 @@
#include "server.h"
#include "version.h"
#include "connection.h"
#include "abstract_io.h"
#include "read_line.h"
#include "read_packet.h"
#include "connection.h"
#include "debug.h"
#include "format.h"
#include "keyexchange.h"
#include "read_line.h"
#include "read_packet.h"
#include "version.h"
#include "werror.h"
#include "void.h"
#include "xalloc.h"
struct
read_handler
*
make_server_read_line
();
...
...
@@ -44,13 +44,15 @@ static int server_initiate(struct fd_callback **c,
{
struct
server_callback
*
closure
=
(
struct
server_callback
*
)
*
c
;
/* FIXME: Should pass a key exchange handler, not NULL! */
struct
ssh_connection
*
connection
=
make_ssh_connection
(
NULL
);
struct
ssh_connection
*
connection
=
make_ssh_connection
(
closure
->
kexinit_handler
);
struct
abstract_write
*
write
=
io_read_write
(
closure
->
backend
,
fd
,
make_server_read_line
(),
closure
->
block_size
,
make_server_close_handler
());
verbose
(
"server_initiate()
\n
"
);
connection
->
server_version
=
ssh_format
(
"SSH-%lz-%lz %lz"
,
...
...
@@ -130,13 +132,11 @@ struct read_handler *make_server_read_line(struct ssh_connection *s)
return
make_read_line
(
&
closure
->
super
);
}
struct
fd_callback
*
make_server_callback
(
struct
io_backend
*
b
,
char
*
comment
,
UINT32
block_size
,
struct
signer
*
secret
,
struct
lsh_string
*
host_key
,
struct
randomness
*
r
)
struct
fd_callback
*
make_server_callback
(
struct
io_backend
*
b
,
char
*
comment
,
UINT32
block_size
,
struct
packet_handler
*
kexinit_handler
)
{
struct
server_callback
*
connected
=
xalloc
(
sizeof
(
struct
server_callback
));
...
...
@@ -144,9 +144,8 @@ struct fd_callback *make_server_callback(struct io_backend *b,
connected
->
backend
=
b
;
connected
->
block_size
=
block_size
;
connected
->
id_comment
=
comment
;
connected
->
secret
=
secret
;
connected
->
host_key
=
host_key
;
connected
->
random
=
r
;
connected
->
kexinit_handler
=
kexinit_handler
;
return
&
connected
->
super
;
}
...
...
src/server.h
View file @
a9aefe4f
...
...
@@ -26,7 +26,10 @@
#ifndef LSH_SERVER_H_INCLUDED
#define LSH_SERVER_H_INCLUDED
#include "server.h"
#include "io.h"
#include "keyexchange.h"
struct
server_callback
{
...
...
@@ -35,13 +38,16 @@ struct server_callback
struct
signer
*
secret
;
/* secret key */
struct
lsh_string
*
host_key
;
/* public key */
struct
randomness
*
random
;
UINT32
block_size
;
char
*
id_comment
;
struct
packet_handler
*
kexinit_handler
;
};
struct
fd_callback
*
make_server_callback
(
struct
io_backend
*
b
,
char
*
comment
,
UINT32
block_size
);
struct
fd_callback
*
make_server_callback
(
struct
io_backend
*
b
,
char
*
comment
,
UINT32
block_size
,
struct
packet_handler
*
kexinit_handler
);
#endif
/* LSH_SERVER_H_INCLUDED */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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