mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Compare commits
10 Commits
DROPBEAR_0
...
DROPBEAR_0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3c8bb2bce | ||
|
|
ee23b01f0b | ||
|
|
3cacc54b78 | ||
|
|
4657ed1446 | ||
|
|
4a52217ed4 | ||
|
|
954a8dce0f | ||
|
|
6ec8183750 | ||
|
|
eb1f647c9c | ||
|
|
029ae35058 | ||
|
|
fdfc95df8b |
20
CHANGES
20
CHANGES
@@ -1,4 +1,22 @@
|
||||
0.44test1 - Sun Aug 16 2004 17:43:54 +0800
|
||||
0.44test2 - Tues Aug 17 2004 17:43:54 +0800
|
||||
|
||||
- Fix up dropbearmulti targets in the Makefile - symlinks are now created
|
||||
|
||||
- Compile fake-rfc2553 even with dropbearconvert/dropbearkey - this
|
||||
allows them to work on platforms without a native getaddrinfo()
|
||||
|
||||
- Create ~/.ssh/known_hosts properly if it doesn't exist
|
||||
|
||||
- Fix basename() function prototype
|
||||
|
||||
- Backport some local changes (more #ifdefs for termcodes.c, a fix for missing
|
||||
defines on AIX).
|
||||
|
||||
- Let dbclient be run as "ssh"
|
||||
|
||||
- Initialise mp_ints by default
|
||||
|
||||
0.44test1 - Sun Aug 16 2005 17:43:54 +0800
|
||||
|
||||
- TESTING RELEASE - this is the first public release of the client codebase,
|
||||
so there are sure to be bugs to be found. In addition, if you're just using
|
||||
|
||||
63
Makefile.in
63
Makefile.in
@@ -3,11 +3,10 @@
|
||||
# invocation:
|
||||
# make PROGRAMS="dropbear dbclient scp" MULTI=1 STATIC=1 SCPPROGRESS=1
|
||||
#
|
||||
# to make a single multiple statically linked binary "staticdropbearmulti",
|
||||
# which includes dropbear, scp and dbclient functionality, and includes the
|
||||
# progress-bar functionality in scp. Hopefully that seems intuitive.
|
||||
|
||||
# This makefile is quite evil.
|
||||
# to make a multiple-program statically linked binary "staticdropbearmulti".
|
||||
# This example will include dropbear, scp, dropbearkey, dropbearconvert, and
|
||||
# dbclient functionality, and includes the progress-bar functionality in scp.
|
||||
# Hopefully that seems intuitive.
|
||||
|
||||
ifndef PROGRAMS
|
||||
PROGRAMS=dropbear dbclient dropbearkey dropbearconvert
|
||||
@@ -20,7 +19,7 @@ COMMONOBJS=dbutil.o buffer.o \
|
||||
dss.o bignum.o \
|
||||
signkey.o rsa.o random.o \
|
||||
queue.o \
|
||||
atomicio.o compat.o
|
||||
atomicio.o compat.o fake-rfc2553.o
|
||||
|
||||
SVROBJS=svr-kex.o svr-algo.o svr-auth.o sshpty.o \
|
||||
svr-authpasswd.o svr-authpubkey.o svr-session.o svr-service.o \
|
||||
@@ -34,7 +33,7 @@ CLIOBJS=cli-algo.o cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o \
|
||||
CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \
|
||||
common-channel.o common-chansession.o termcodes.o loginrec.o \
|
||||
tcp-accept.o listener.o process-packet.o \
|
||||
common-runopts.o fake-rfc2553.o
|
||||
common-runopts.o
|
||||
|
||||
KEYOBJS=dropbearkey.o gendss.o genrsa.o
|
||||
|
||||
@@ -115,25 +114,36 @@ all: $(TARGETS)
|
||||
strip: $(TARGETS)
|
||||
$(STRIP) $(addsuffix $(EXEEXT), $(addprefix $(SPREFIX), $(TARGETS)))
|
||||
|
||||
install: $(addprefix install, $(TARGETS))
|
||||
install: $(addprefix inst, $(TARGETS))
|
||||
|
||||
installdropbearmulti: insdbmulti $(addprefix insmulti, $(PROGRAMS))
|
||||
|
||||
insdbmulti: dropbearmulti
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -m 755 $(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)
|
||||
-chown root $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT)
|
||||
-chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT)
|
||||
|
||||
insmultidropbear: dropbearmulti
|
||||
-rm -f $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
|
||||
-ln -s $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
|
||||
|
||||
insmulti%: dropbearmulti
|
||||
-rm -f $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
|
||||
-ln -s $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
|
||||
|
||||
# dropbear should go in sbin, so it needs a seperate rule
|
||||
installdropbear: dropbear
|
||||
instdropbear: dropbear
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(sbindir)
|
||||
$(INSTALL) -m 755 $(SPREFIX)dropbear$(EXEEXT) $(DESTDIR)$(sbindir)
|
||||
-chown root $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
|
||||
-chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
|
||||
|
||||
install%: $*
|
||||
inst%: $*
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
|
||||
$(INSTALL) -m 755 $(SPREFIX)$*$(EXEEXT) $(DESTDIR)$(bindir)
|
||||
-chown root $(DESTDIR)$(sbindir)/$(SPREFIX)$*$(EXEEXT)
|
||||
-chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)$*$(EXEEXT)
|
||||
ifeq ($(MULTI), 1)
|
||||
@echo
|
||||
@echo "You must manually create links for $*"
|
||||
endif
|
||||
|
||||
-chown root $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
|
||||
-chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
|
||||
|
||||
|
||||
# for some reason the rule further down doesn't like $($@objs) as a prereq.
|
||||
@@ -158,11 +168,16 @@ ifeq ($(MULTI),1)
|
||||
CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI
|
||||
endif
|
||||
|
||||
dropbearmulti: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile
|
||||
$(LD) $(LDFLAGS) -o $(SPREFIX)$@$(EXEEXT) $(MULTIOBJS) $(LIBS)
|
||||
@echo
|
||||
@echo "You should now create symlinks to the programs you have included"
|
||||
@echo "ie 'ln -s dropbearmulti dropbear'"
|
||||
dropbearmulti: multilink
|
||||
|
||||
multibinary: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile
|
||||
$(LD) $(LDFLAGS) -o $(SPREFIX)dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
|
||||
|
||||
multilink: multibinary $(addprefix link, $(PROGRAMS))
|
||||
|
||||
link%:
|
||||
-rm -f $(SPREFIX)$*$(EXEEXT)
|
||||
-ln -s $(SPREFIX)dropbearmulti$(EXEEXT) $(SPREFIX)$*$(EXEEXT)
|
||||
|
||||
$(LTC): options.h
|
||||
cd libtomcrypt && $(MAKE) clean && $(MAKE)
|
||||
@@ -179,7 +194,9 @@ ltm-clean:
|
||||
sizes: dropbear
|
||||
objdump -t dropbear|grep ".text"|cut -d "." -f 2|sort -rn
|
||||
|
||||
clean: ltc-clean ltm-clean
|
||||
clean: ltc-clean ltm-clean thisclean
|
||||
|
||||
thisclean:
|
||||
-rm -f dropbear dbclient dropbearkey dropbearconvert scp scp-progress
|
||||
-rm -f staticdropbear staticdropbearkey staticdropbearconvert staticscp
|
||||
-rm -f dropbearmulti staticdropbearmulti
|
||||
|
||||
17
README
17
README
@@ -17,7 +17,7 @@ matt@ucc.asn.au
|
||||
In the absence of detailed documentation, some notes follow:
|
||||
============================================================================
|
||||
|
||||
Public key auth:
|
||||
Server public key auth:
|
||||
|
||||
You can use ~/.ssh/authorized_keys in the same way as with OpenSSH, just put
|
||||
the key entries in that file. They should be of the form:
|
||||
@@ -32,6 +32,21 @@ OpenSSH sshd manpage, and will not allow a login for these keys.
|
||||
|
||||
============================================================================
|
||||
|
||||
Client public key auth:
|
||||
|
||||
Dropbear can do public key auth as a client, but you will have to convert
|
||||
OpenSSH style keys to Dropbear format, or use dropbearkey to create them.
|
||||
|
||||
If you have an OpenSSH-style private key ~/.ssh/id_rsa, you need to do:
|
||||
|
||||
dropbearconvert openssh dropbear ~/.ssh/id_rsa ~/.ssh/id_rsa.db
|
||||
dbclient -i ~/.ssh/id_rsa.db <hostname>
|
||||
|
||||
Currently encrypted keys aren't supported, neither is agent forwarding. At some
|
||||
stage both hopefully will be.
|
||||
|
||||
============================================================================
|
||||
|
||||
If you want to get the public-key portion of a Dropbear private key, look at
|
||||
dropbearkey's '-y' option.
|
||||
|
||||
|
||||
2
TODO
2
TODO
@@ -8,6 +8,8 @@ Things which might need doing:
|
||||
|
||||
- fix agent fwd problems
|
||||
|
||||
- handle /etc/environment in AIX
|
||||
|
||||
- improve channel window adjustment algorithm (circular buffering)
|
||||
|
||||
- check that there aren't timing issues with valid/invalid user authentication
|
||||
|
||||
28
cli-kex.c
28
cli-kex.c
@@ -45,8 +45,8 @@ void send_msg_kexdh_init() {
|
||||
|
||||
cli_ses.dh_e = (mp_int*)m_malloc(sizeof(mp_int));
|
||||
cli_ses.dh_x = (mp_int*)m_malloc(sizeof(mp_int));
|
||||
|
||||
m_mp_init_multi(cli_ses.dh_e, cli_ses.dh_x, NULL);
|
||||
|
||||
gen_kexdh_vals(cli_ses.dh_e, cli_ses.dh_x);
|
||||
|
||||
CHECKCLEARTOWRITE();
|
||||
@@ -59,13 +59,18 @@ void send_msg_kexdh_init() {
|
||||
/* Handle a diffie-hellman key exchange reply. */
|
||||
void recv_msg_kexdh_reply() {
|
||||
|
||||
mp_int dh_f;
|
||||
DEF_MP_INT(dh_f);
|
||||
sign_key *hostkey = NULL;
|
||||
unsigned int type, keybloblen;
|
||||
unsigned char* keyblob = NULL;
|
||||
|
||||
|
||||
TRACE(("enter recv_msg_kexdh_reply"));
|
||||
|
||||
if (cli_ses.kex_state != KEXDH_INIT_SENT) {
|
||||
dropbear_exit("Received out-of-order kexdhreply");
|
||||
}
|
||||
m_mp_init(&dh_f);
|
||||
type = ses.newkeys->algo_hostkey;
|
||||
TRACE(("type is %d", type));
|
||||
|
||||
@@ -83,7 +88,6 @@ void recv_msg_kexdh_reply() {
|
||||
dropbear_exit("Bad KEX packet");
|
||||
}
|
||||
|
||||
m_mp_init(&dh_f);
|
||||
if (buf_getmpint(ses.payload, &dh_f) != DROPBEAR_SUCCESS) {
|
||||
TRACE(("failed getting mpint"));
|
||||
dropbear_exit("Bad KEX packet");
|
||||
@@ -91,6 +95,9 @@ void recv_msg_kexdh_reply() {
|
||||
|
||||
kexdh_comb_key(cli_ses.dh_e, cli_ses.dh_x, &dh_f, hostkey);
|
||||
mp_clear(&dh_f);
|
||||
mp_clear_multi(cli_ses.dh_e, cli_ses.dh_x, NULL);
|
||||
m_free(cli_ses.dh_e);
|
||||
m_free(cli_ses.dh_x);
|
||||
|
||||
if (buf_verify(ses.payload, hostkey, ses.hash, SHA1_HASH_SIZE)
|
||||
!= DROPBEAR_SUCCESS) {
|
||||
@@ -147,21 +154,27 @@ static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
|
||||
/* Check that ~/.ssh exists - easiest way is just to mkdir */
|
||||
if (mkdir(filename, S_IRWXU) != 0) {
|
||||
if (errno != EEXIST) {
|
||||
dropbear_log(LOG_INFO, "Warning: failed creating ~/.ssh: %s",
|
||||
strerror(errno));
|
||||
TRACE(("mkdir didn't work: %s", strerror(errno)));
|
||||
ask_to_confirm(keyblob, keybloblen);
|
||||
goto out; /* only get here on success */
|
||||
}
|
||||
}
|
||||
|
||||
snprintf(filename, len+18, "%s/.ssh/known_hosts", pw->pw_dir);
|
||||
hostsfile = fopen(filename, "r+");
|
||||
hostsfile = fopen(filename, "a+");
|
||||
fseek(hostsfile, 0, SEEK_SET);
|
||||
|
||||
/* We mightn't have been able to open it if it was read-only */
|
||||
if (hostsfile == NULL && (errno == EACCES || errno == EROFS)) {
|
||||
TRACE(("trying readonly: %s", strerror(errno)));
|
||||
readonly = 1;
|
||||
hostsfile = fopen(filename, "r");
|
||||
}
|
||||
|
||||
if (hostsfile == NULL) {
|
||||
TRACE(("hostsfile didn't open: %s", strerror(errno)));
|
||||
ask_to_confirm(keyblob, keybloblen);
|
||||
goto out; /* We only get here on success */
|
||||
}
|
||||
@@ -228,11 +241,12 @@ static void checkhostkey(unsigned char* keyblob, unsigned int keybloblen) {
|
||||
/* If we get here, they said yes */
|
||||
|
||||
if (readonly) {
|
||||
TRACE(("readonly"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* put the new entry in the file */
|
||||
fseek(hostsfile, 0, SEEK_END);
|
||||
fseek(hostsfile, 0, SEEK_END); /* In case it wasn't opened append */
|
||||
buf_setpos(line, 0);
|
||||
buf_setlen(line, 0);
|
||||
buf_putbytes(line, ses.remotehost, hostlen);
|
||||
@@ -255,5 +269,7 @@ out:
|
||||
fclose(hostsfile);
|
||||
}
|
||||
m_free(filename);
|
||||
buf_free(line);
|
||||
if (line != NULL) {
|
||||
buf_free(line);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,15 +464,18 @@ void recv_msg_kexinit() {
|
||||
|
||||
/* Initialises and generate one side of the diffie-hellman key exchange values.
|
||||
* See the ietf-secsh-transport draft, section 6, for details */
|
||||
/* dh_pub and dh_priv MUST be already initialised */
|
||||
void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv) {
|
||||
|
||||
mp_int dh_p, dh_q, dh_g;
|
||||
DEF_MP_INT(dh_p);
|
||||
DEF_MP_INT(dh_q);
|
||||
DEF_MP_INT(dh_g);
|
||||
unsigned char randbuf[DH_P_LEN];
|
||||
int dh_q_len;
|
||||
|
||||
TRACE(("enter send_msg_kexdh_reply"));
|
||||
|
||||
m_mp_init_multi(&dh_g, &dh_p, &dh_q, dh_priv, dh_pub, NULL);
|
||||
m_mp_init_multi(&dh_g, &dh_p, &dh_q, NULL);
|
||||
|
||||
/* read the prime and generator*/
|
||||
if (mp_read_unsigned_bin(&dh_p, (unsigned char*)dh_p_val, DH_P_LEN)
|
||||
|
||||
2
compat.c
2
compat.c
@@ -190,7 +190,7 @@ int daemon(int nochdir, int noclose) {
|
||||
|
||||
#ifndef HAVE_BASENAME
|
||||
|
||||
char *basename(char *path) {
|
||||
char *basename(const char *path) {
|
||||
|
||||
char *foo = strrchr(path, '/');
|
||||
return ++foo;
|
||||
|
||||
@@ -44,7 +44,8 @@ int main(int argc, char ** argv) {
|
||||
}
|
||||
#endif
|
||||
#ifdef DBMULTI_dbclient
|
||||
if (strcmp(progname, "dbclient") == 0) {
|
||||
if (strcmp(progname, "dbclient") == 0
|
||||
|| strcmp(progname, "ssh") == 0) {
|
||||
return cli_main(argc, argv);
|
||||
}
|
||||
#endif
|
||||
|
||||
6
debian/changelog
vendored
6
debian/changelog
vendored
@@ -1,3 +1,9 @@
|
||||
dropbear (0.44test2-1) unstable; urgency=low
|
||||
|
||||
* New upstream beta, various minor fixes.
|
||||
|
||||
-- Matt Johnston <matt@ucc.asn.au> Tues, 17 August 2004 19:00:00 +0800
|
||||
|
||||
dropbear (0.44test1-1) unstable; urgency=low
|
||||
|
||||
* Upstream beta 0.44test1
|
||||
|
||||
@@ -47,10 +47,8 @@ static void printhelp(char * progname) {
|
||||
"dropbear\n"
|
||||
"\n"
|
||||
"Example:\n"
|
||||
"dropbearconvert openssh dropbear /etc/ssh/ssh_host_rsa_key /etc/dropbear_rsa_host_key\n"
|
||||
"\n"
|
||||
"The inputfile and outputfile can be '-' to specify\n"
|
||||
"standard input or standard output.\n", progname);
|
||||
"dropbearconvert openssh dropbear /etc/ssh/ssh_host_rsa_key /etc/dropbear_rsa_host_key\n",
|
||||
progname);
|
||||
}
|
||||
|
||||
#if defined(DBMULTI_dropbearconvert) || !defined(DROPBEAR_MULTI)
|
||||
|
||||
16
dss.c
16
dss.c
@@ -164,7 +164,10 @@ int buf_dss_verify(buffer* buf, dss_key *key, const unsigned char* data,
|
||||
unsigned char msghash[SHA1_HASH_SIZE];
|
||||
hash_state hs;
|
||||
int ret = DROPBEAR_FAILURE;
|
||||
mp_int val1, val2, val3, val4;
|
||||
DEF_MP_INT(val1);
|
||||
DEF_MP_INT(val2);
|
||||
DEF_MP_INT(val3);
|
||||
DEF_MP_INT(val4);
|
||||
char * string = NULL;
|
||||
int stringlen;
|
||||
|
||||
@@ -281,13 +284,16 @@ void buf_put_dss_sign(buffer* buf, dss_key *key, const unsigned char* data,
|
||||
unsigned char privkeyhash[SHA512_HASH_SIZE];
|
||||
unsigned char *privkeytmp;
|
||||
unsigned char proto_k[SHA512_HASH_SIZE];
|
||||
mp_int dss_protok;
|
||||
DEF_MP_INT(dss_protok);
|
||||
#else
|
||||
unsigned char kbuf[SHA1_HASH_SIZE];
|
||||
#endif
|
||||
mp_int dss_k, dss_m;
|
||||
mp_int dss_temp1, dss_temp2;
|
||||
mp_int dss_r, dss_s;
|
||||
DEF_MP_INT(dss_k);
|
||||
DEF_MP_INT(dss_m);
|
||||
DEF_MP_INT(dss_temp1);
|
||||
DEF_MP_INT(dss_temp2);
|
||||
DEF_MP_INT(dss_r);
|
||||
DEF_MP_INT(dss_s);
|
||||
hash_state hs;
|
||||
|
||||
TRACE(("enter buf_put_dss_sign"));
|
||||
|
||||
11
gendss.c
11
gendss.c
@@ -89,7 +89,10 @@ static void getq(dss_key *key) {
|
||||
|
||||
static void getp(dss_key *key, unsigned int size) {
|
||||
|
||||
mp_int tempX, tempC, tempP, temp2q;
|
||||
DEF_MP_INT(tempX);
|
||||
DEF_MP_INT(tempC);
|
||||
DEF_MP_INT(tempP);
|
||||
DEF_MP_INT(temp2q);
|
||||
int result;
|
||||
unsigned char *buf;
|
||||
|
||||
@@ -148,7 +151,9 @@ static void getp(dss_key *key, unsigned int size) {
|
||||
static void getg(dss_key * key) {
|
||||
|
||||
char printbuf[1000];
|
||||
mp_int div, h, val;
|
||||
DEF_MP_INT(div);
|
||||
DEF_MP_INT(h);
|
||||
DEF_MP_INT(val);
|
||||
|
||||
m_mp_init_multi(&div, &h, &val, NULL);
|
||||
|
||||
@@ -185,7 +190,7 @@ static void getg(dss_key * key) {
|
||||
|
||||
static void getx(dss_key *key) {
|
||||
|
||||
mp_int val;
|
||||
DEF_MP_INT(val);
|
||||
char buf[QSIZE];
|
||||
|
||||
m_mp_init(&val);
|
||||
|
||||
6
genrsa.c
6
genrsa.c
@@ -40,7 +40,9 @@ static void getrsaprime(mp_int* prime, mp_int *primeminus,
|
||||
rsa_key * gen_rsa_priv_key(unsigned int size) {
|
||||
|
||||
rsa_key * key;
|
||||
mp_int pminus, qminus, lcm;
|
||||
DEF_MP_INT(pminus);
|
||||
DEF_MP_INT(qminus);
|
||||
DEF_MP_INT(lcm);
|
||||
|
||||
key = (rsa_key*)m_malloc(sizeof(rsa_key));
|
||||
|
||||
@@ -95,7 +97,7 @@ static void getrsaprime(mp_int* prime, mp_int *primeminus,
|
||||
mp_int* rsa_e, unsigned int size) {
|
||||
|
||||
unsigned char *buf;
|
||||
mp_int temp_gcd;
|
||||
DEF_MP_INT(temp_gcd);
|
||||
|
||||
buf = (unsigned char*)m_malloc(size+1);
|
||||
|
||||
|
||||
@@ -108,13 +108,10 @@ int import_write(const char *filename, sign_key *key, char *passphrase,
|
||||
static sign_key *dropbear_read(const char* filename) {
|
||||
|
||||
buffer * buf = NULL;
|
||||
int len, maxlen;
|
||||
FILE *fp = NULL;
|
||||
sign_key *ret = NULL;
|
||||
int type;
|
||||
|
||||
buf = buf_new(MAX_PRIVKEY_SIZE);
|
||||
/* buf_readfile knows about "-" */
|
||||
if (buf_readfile(buf, filename) == DROPBEAR_FAILURE) {
|
||||
goto error;
|
||||
}
|
||||
@@ -163,11 +160,7 @@ static int dropbear_write(const char*filename, sign_key * key) {
|
||||
buf = buf_new(MAX_PRIVKEY_SIZE);
|
||||
buf_put_priv_key(buf, key, keytype);
|
||||
|
||||
if (strlen(filename) == 1 && filename[0] == '-') {
|
||||
fp = stdout;
|
||||
} else {
|
||||
fp = fopen(filename, "w");
|
||||
}
|
||||
fp = fopen(filename, "w");
|
||||
if (!fp) {
|
||||
ret = 0;
|
||||
goto out;
|
||||
|
||||
28
options.h
28
options.h
@@ -1,26 +1,6 @@
|
||||
/*
|
||||
* Dropbear - a SSH2 server
|
||||
*
|
||||
/* Dropbear SSH
|
||||
* Copyright (c) 2002,2003 Matt Johnston
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE. */
|
||||
* All rights reserved. See LICENSE for the license. */
|
||||
|
||||
#ifndef _OPTIONS_H_
|
||||
#define _OPTIONS_H_
|
||||
@@ -139,7 +119,7 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */
|
||||
#define ENABLE_CLI_PUBKEY_AUTH
|
||||
|
||||
/* Random device to use - you must specify _one only_.
|
||||
* DEV_RANDOM is recommended on hosts with a good /dev/urandom, otherwise use
|
||||
* DEV_URANDOM is recommended on hosts with a good /dev/urandom, otherwise use
|
||||
* PRNGD and run prngd, specifying the socket. This device must be able to
|
||||
* produce a large amount of random data, so using /dev/random or Entropy
|
||||
* Gathering Daemon (egd) may result in halting, as it waits for more random
|
||||
@@ -193,7 +173,7 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef DROPBEAR_VERSION
|
||||
#define DROPBEAR_VERSION "0.44test1"
|
||||
#define DROPBEAR_VERSION "0.44test2"
|
||||
#endif
|
||||
|
||||
#define LOCAL_IDENT "SSH-2.0-dropbear_" DROPBEAR_VERSION
|
||||
|
||||
5
rsa.c
5
rsa.c
@@ -201,7 +201,8 @@ int buf_rsa_verify(buffer * buf, rsa_key *key, const unsigned char* data,
|
||||
unsigned int len) {
|
||||
|
||||
unsigned int slen;
|
||||
mp_int rsa_s, rsa_mdash;
|
||||
DEF_MP_INT(rsa_s);
|
||||
DEF_MP_INT(rsa_mdash);
|
||||
mp_int *rsa_em = NULL;
|
||||
int ret = DROPBEAR_FAILURE;
|
||||
|
||||
@@ -262,7 +263,7 @@ void buf_put_rsa_sign(buffer* buf, rsa_key *key, const unsigned char* data,
|
||||
|
||||
unsigned int nsize, ssize;
|
||||
unsigned int i;
|
||||
mp_int rsa_s;
|
||||
DEF_MP_INT(rsa_s);
|
||||
mp_int *rsa_em = NULL;
|
||||
|
||||
TRACE(("enter buf_put_rsa_sign"));
|
||||
|
||||
@@ -92,6 +92,8 @@ static void sesssigchild_handler(int dummy) {
|
||||
chansess->exitsignal = WTERMSIG(status);
|
||||
#ifndef AIX
|
||||
chansess->exitcore = WCOREDUMP(status);
|
||||
#else
|
||||
chansess->exitcore = 0;
|
||||
#endif
|
||||
} else {
|
||||
/* we use this to determine how pid exited */
|
||||
|
||||
@@ -44,7 +44,7 @@ static void send_msg_kexdh_reply(mp_int *dh_e);
|
||||
* that function, then brings the new keys into use */
|
||||
void recv_msg_kexdh_init() {
|
||||
|
||||
mp_int dh_e;
|
||||
DEF_MP_INT(dh_e);
|
||||
|
||||
TRACE(("enter recv_msg_kexdh_init"));
|
||||
if (!ses.kexstate.recvkexinit) {
|
||||
@@ -71,9 +71,11 @@ void recv_msg_kexdh_init() {
|
||||
* See the ietf-secsh-transport draft, section 6, for details */
|
||||
static void send_msg_kexdh_reply(mp_int *dh_e) {
|
||||
|
||||
mp_int dh_y, dh_f;
|
||||
DEF_MP_INT(dh_y);
|
||||
DEF_MP_INT(dh_f);
|
||||
|
||||
TRACE(("enter send_msg_kexdh_reply"));
|
||||
m_mp_init_multi(&dh_y, &dh_f, NULL);
|
||||
|
||||
gen_kexdh_vals(&dh_f, &dh_y);
|
||||
|
||||
|
||||
@@ -131,7 +131,11 @@ const struct TermCode termcodes[MAX_TERMCODE+1] = {
|
||||
{IEXTEN, TERMCODE_LOCAL},
|
||||
{ECHOCTL, TERMCODE_LOCAL},
|
||||
{ECHOKE, TERMCODE_LOCAL},
|
||||
#ifdef PENDIN
|
||||
{PENDIN, TERMCODE_LOCAL},
|
||||
#else
|
||||
{0, 0},
|
||||
#endif
|
||||
{0, 0}, /* 63 */
|
||||
{0, 0},
|
||||
{0, 0},
|
||||
|
||||
Reference in New Issue
Block a user