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
8bfc44e7
Commit
8bfc44e7
authored
Oct 29, 1998
by
Niels Möller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call make_client_startup properly. Bug fixes.
Rev: src/lsh.c:1.17
parent
319efc4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
4 deletions
+36
-4
src/lsh.c
src/lsh.c
+36
-4
No files found.
src/lsh.c
View file @
8bfc44e7
...
...
@@ -29,6 +29,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "getopt.h"
#include "alist.h"
...
...
@@ -43,14 +45,15 @@
#include "randomness.h"
#include "service.h"
/* #include "session.h" */
#include "ssh.h"
#include "userauth.h"
#include "werror.h"
#include "xalloc.h"
/* Block size for stdout and stderr buffers */
#define BLOCK_SIZE 32768
/* Global variable */
struct
io_backend
backend
;
struct
io_backend
backend
=
{
STATIC_HEADER
};
void
usage
(
void
)
NORETURN
;
...
...
@@ -97,6 +100,9 @@ int main(int argc, char **argv)
struct
sockaddr_in
remote
;
/* STATIC, because the object exists at gc time */
struct
io_backend
backend
=
{
STATIC_HEADER
};
struct
lsh_string
*
random_seed
;
struct
randomness
*
r
;
struct
diffie_hellman_method
*
dh
;
...
...
@@ -106,6 +112,8 @@ int main(int argc, char **argv)
struct
packet_handler
*
kexinit_handler
;
struct
lookup_verifier
*
lookup
;
struct
ssh_service
*
service
;
int
in
,
out
,
err
;
/* For filtering messages. Could perhaps also be used when converting
* strings to and from UTF8. */
...
...
@@ -155,6 +163,8 @@ int main(int argc, char **argv)
exit
(
1
);
}
init_backend
(
&
backend
);
random_seed
=
ssh_format
(
"%z"
,
"gazonk"
);
r
=
make_poor_random
(
&
sha_algorithm
,
random_seed
);
dh
=
make_dh1
(
r
);
...
...
@@ -168,10 +178,32 @@ int main(int argc, char **argv)
ATOM_SSH_DSS
,
make_dss_algorithm
(
r
),
-
1
);
make_kexinit
=
make_test_kexinit
(
r
);
/* Dup stdio file descriptors, so that they can be closed without
* confusing the c library. */
if
(
(
in
=
dup
(
STDIN_FILENO
)
<
0
))
{
werror
(
"Can't dup stdin: %s
\n
"
,
strerror
(
errno
));
return
EXIT_FAILURE
;
}
if
(
(
out
=
dup
(
STDOUT_FILENO
)
<
0
))
{
werror
(
"Can't dup stdout: %s
\n
"
,
strerror
(
errno
));
return
EXIT_FAILURE
;
}
if
(
(
err
=
dup
(
STDERR_FILENO
)
<
0
))
{
werror
(
"Can't dup stderr: %s
\n
"
,
strerror
(
errno
));
return
EXIT_FAILURE
;
}
service
=
make_connection_service
(
make_alist
(
0
,
-
1
),
make_alist
(
0
,
-
1
),
make_client_startup
(
1
));
make_client_startup
(
io_read
(
&
backend
,
in
,
NULL
,
NULL
),
io_write
(
&
backend
,
out
,
BLOCK_SIZE
,
NULL
),
io_write
(
&
backend
,
err
,
BLOCK_SIZE
,
NULL
),
ATOM_SHELL
,
ssh_format
(
""
)));
kexinit_handler
=
make_kexinit_handler
(
CONNECTION_CLIENT
,
...
...
@@ -184,7 +216,7 @@ int main(int argc, char **argv)
if
(
!
io_connect
(
&
backend
,
&
remote
,
NULL
,
make_client_callback
(
&
backend
,
"lsh - a free ssh"
,
BLOCK_SIZE
,
SSH_MAX_PACKET
,
r
,
make_kexinit
,
kexinit_handler
)))
{
...
...
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