diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 98b10356d53e48ffa482d72a36ec267ae5ea1dcc (patch) | |
tree | 2614896c983fb46c8ba31da5cb9a8aff2e9892a5 | |
parent | 29698e296e3fd1474a362fbd229bca888175bb66 (diff) | |
download | dropbear-98b10356d53e48ffa482d72a36ec267ae5ea1dcc.tar.gz |
Initial Contributionandroid-1.0release-1.0cdma-import
-rw-r--r-- | Android.mk | 56 | ||||
-rw-r--r-- | MODULE_LICENSE_BSD_LIKE | 0 | ||||
-rw-r--r-- | NOTICE | 89 | ||||
-rw-r--r-- | config.h | 413 | ||||
-rw-r--r-- | libtomcrypt/Android.mk | 71 | ||||
-rw-r--r-- | libtommath/Android.mk | 34 | ||||
-rw-r--r-- | netbsd_getpass.c | 114 | ||||
-rw-r--r-- | options.h | 10 | ||||
-rw-r--r-- | progressmeter.c | 2 | ||||
-rw-r--r-- | scp.c | 11 |
10 files changed, 794 insertions, 6 deletions
diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..b95d5dd --- /dev/null +++ b/Android.mk @@ -0,0 +1,56 @@ +ifneq ($(TARGET_SIMULATOR),true) + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:=\ + dbutil.c buffer.c \ + dss.c bignum.c \ + signkey.c rsa.c random.c \ + queue.c \ + atomicio.c compat.c fake-rfc2553.c +LOCAL_SRC_FILES+=\ + common-session.c packet.c common-algo.c common-kex.c \ + common-channel.c common-chansession.c termcodes.c \ + tcp-accept.c listener.c process-packet.c \ + common-runopts.c circbuffer.c +# loginrec.c +LOCAL_SRC_FILES+=\ + cli-algo.c cli-main.c cli-auth.c cli-authpasswd.c cli-kex.c \ + cli-session.c cli-service.c cli-runopts.c cli-chansession.c \ + cli-authpubkey.c cli-tcpfwd.c cli-channel.c cli-authinteract.c +LOCAL_SRC_FILES+=netbsd_getpass.c + +LOCAL_STATIC_LIBRARIES := libtommath libtomcrypt + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) +LOCAL_MODULE_TAGS := eng +LOCAL_MODULE := ssh +LOCAL_C_INCLUDES += $(LOCAL_PATH)/libtommath +LOCAL_C_INCLUDES += $(LOCAL_PATH)/libtomcrypt/src/headers +LOCAL_CFLAGS += -DDROPBEAR_CLIENT + +include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES:=\ + scp.c progressmeter.c atomicio.c scpmisc.c + +LOCAL_STATIC_LIBRARIES := libtommath libtomcrypt + +LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) + +LOCAL_MODULE_TAGS := debug + +LOCAL_MODULE := scp +LOCAL_C_INCLUDES += $(LOCAL_PATH)/libtommath +LOCAL_C_INCLUDES += $(LOCAL_PATH)/libtomcrypt/src/headers +LOCAL_CFLAGS += -DDROPBEAR_CLIENT -DPROGRESS_METER + +include $(BUILD_EXECUTABLE) + +endif # TARGET_SIMULATOR != true + + +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/MODULE_LICENSE_BSD_LIKE b/MODULE_LICENSE_BSD_LIKE new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_BSD_LIKE @@ -0,0 +1,89 @@ +Dropbear contains a number of components from different sources, hence there +are a few licenses and authors involved. All licenses are fairly +non-restrictive. + + +The majority of code is written by Matt Johnston, under the license below. + +Portions of the client-mode work are (c) 2004 Mihnea Stoenescu, under the +same license: + +Copyright (c) 2002-2006 Matt Johnston +Portions copyright (c) 2004 Mihnea Stoenescu +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. + +===== + +LibTomCrypt and LibTomMath are written by Tom St Denis, and are Public Domain. + +===== + +sshpty.c is taken from OpenSSH 3.5p1, + Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland + All rights reserved + "As far as I am concerned, the code I have written for this software + can be used freely for any purpose. Any derived versions of this + software must be clearly marked as such, and if the derived work is + incompatible with the protocol description in the RFC file, it must be + called by a name other than "ssh" or "Secure Shell". " + +===== + +loginrec.c +loginrec.h +atomicio.h +atomicio.c +and strlcat() (included in util.c) are from OpenSSH 3.6.1p2, and are licensed +under the 2 point BSD license. + +loginrec is written primarily by Andre Lucas, atomicio.c by Theo de Raadt. + +strlcat() is (c) Todd C. Miller + +===== + +Import code in keyimport.c is modified from PuTTY's import.c, licensed as +follows: + +PuTTY is copyright 1997-2003 Simon Tatham. + +Portions copyright Robert de Bath, Joris van Rantwijk, Delian +Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, +Justin Bradford, and CORE SDI S.A. + +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 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. diff --git a/config.h b/config.h new file mode 100644 index 0000000..5c67988 --- /dev/null +++ b/config.h @@ -0,0 +1,413 @@ +/* config.h. Generated by configure. */ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Using AIX */ +/* #undef AIX */ + +/* Broken getaddrinfo */ +/* #undef BROKEN_GETADDRINFO */ + +/* lastlog file location */ +/* #undef CONF_LASTLOG_FILE */ + +/* utmpx file location */ +/* #undef CONF_UTMPX_FILE */ + +/* utmp file location */ +/* #undef CONF_UTMP_FILE */ + +/* wtmpx file location */ +/* #undef CONF_WTMPX_FILE */ + +/* wtmp file location */ +/* #undef CONF_WTMP_FILE */ + +/* Disable use of lastlog() */ +/* #undef DISABLE_LASTLOG */ + +/* Use PAM */ +#define DISABLE_PAM + +/* Disable use of pututline() */ +/* #undef DISABLE_PUTUTLINE */ + +/* Disable use of pututxline() */ +/* #undef DISABLE_PUTUTXLINE */ + +/* Using syslog */ +/* #undef DISABLE_SYSLOG */ + +/* Disable use of utmp */ +/* #undef DISABLE_UTMP */ + +/* Disable use of utmpx */ +#define DISABLE_UTMPX 1 + +/* Disable use of wtmp */ +/* #undef DISABLE_WTMP */ + +/* Disable use of wtmpx */ +#define DISABLE_WTMPX 1 + +/* Use zlib */ +#define DISABLE_ZLIB 1 + +/* Define to 1 if you have the `basename' function. */ +#define HAVE_BASENAME 1 + +/* Define to 1 if you have the `clearenv' function. */ +#define HAVE_CLEARENV 1 + +/* Define if gai_strerror() returns const char * */ +#define HAVE_CONST_GAI_STRERROR_PROTO 1 + +/* Define to 1 if you have the <crypt.h> header file. */ +/* #define HAVE_CRYPT_H */ + +/* Define to 1 if you have the `daemon' function. */ +#define HAVE_DAEMON 1 + +/* Use /dev/ptc & /dev/pts */ +/* #undef HAVE_DEV_PTS_AND_PTC */ + +/* Define to 1 if you have the `dup2' function. */ +#define HAVE_DUP2 1 + +/* Define to 1 if you have the `endutent' function. */ +#define HAVE_ENDUTENT 1 + +/* Define to 1 if you have the `endutxent' function. */ +#define HAVE_ENDUTXENT 1 + +/* Define to 1 if you have the <fcntl.h> header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the `freeaddrinfo' function. */ +#define HAVE_FREEADDRINFO 1 + +/* Define to 1 if you have the `gai_strerror' function. */ +#define HAVE_GAI_STRERROR 1 + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `getnameinfo' function. */ +#define HAVE_GETNAMEINFO 1 + +/* Define to 1 if you have the `getspnam' function. */ +#define HAVE_GETSPNAM 1 + +/* Define to 1 if you have the `getusershell' function. */ +#define HAVE_GETUSERSHELL 1 + +/* Define to 1 if you have the `getutent' function. */ +#define HAVE_GETUTENT 1 + +/* Define to 1 if you have the `getutid' function. */ +#define HAVE_GETUTID 1 + +/* Define to 1 if you have the `getutline' function. */ +#define HAVE_GETUTLINE 1 + +/* Define to 1 if you have the `getutxent' function. */ +#define HAVE_GETUTXENT 1 + +/* Define to 1 if you have the `getutxid' function. */ +#define HAVE_GETUTXID 1 + +/* Define to 1 if you have the `getutxline' function. */ +#define HAVE_GETUTXLINE 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <ioctl.h> header file. */ +/* #undef HAVE_IOCTL_H */ + +/* Define to 1 if you have the <lastlog.h> header file. */ +#define HAVE_LASTLOG_H 1 + +/* Define to 1 if you have the <libgen.h> header file. */ +/* #define HAVE_LIBGEN_H */ + +/* Define to 1 if you have the `pam' library (-lpam). */ +/* #undef HAVE_LIBPAM */ + +/* Define to 1 if you have the <libutil.h> header file. */ +/* #undef HAVE_LIBUTIL_H */ + +/* Define to 1 if you have the `z' library (-lz). */ +/* #define HAVE_LIBZ XXX?*/ + +/* Define to 1 if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Have login() function */ +#define HAVE_LOGIN + +/* Define to 1 if you have the `logout' function. */ +#define HAVE_LOGOUT 1 + +/* Define to 1 if you have the `logwtmp' function. */ +#define HAVE_LOGWTMP 1 + +/* Define to 1 if you have the <memory.h> header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +#define HAVE_MEMSET 1 + +/* Define to 1 if you have the <netdb.h> header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the <netinet/in_systm.h> header file. */ +/* #define HAVE_NETINET_IN_SYSTM_H */ + +/* Define to 1 if you have the <netinet/tcp.h> header file. */ +#define HAVE_NETINET_TCP_H 1 + +/* Have openpty() function */ +#define HAVE_OPENPTY 1 + +/* Define to 1 if you have the <pam/pam_appl.h> header file. */ +/* #undef HAVE_PAM_PAM_APPL_H */ + +/* Define to 1 if you have the <paths.h> header file. */ +#define HAVE_PATHS_H 1 + +/* Define to 1 if you have the <pty.h> header file. */ +#define HAVE_PTY_H 1 + +/* Define to 1 if you have the `putenv' function. */ +#define HAVE_PUTENV 1 + +/* Define to 1 if you have the `pututline' function. */ +#define HAVE_PUTUTLINE 1 + +/* Define to 1 if you have the `pututxline' function. */ +#define HAVE_PUTUTXLINE 1 + +/* Define to 1 if you have the <security/pam_appl.h> header file. */ +/* #undef HAVE_SECURITY_PAM_APPL_H */ + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `setutent' function. */ +#define HAVE_SETUTENT 1 + +/* Define to 1 if you have the `setutxent' function. */ +#define HAVE_SETUTXENT 1 + +/* Define to 1 if you have the <shadow.h> header file. */ +/* #define HAVE_SHADOW_H */ + +/* Define to 1 if you have the `socket' function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the <stdlib.h> header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the <strings.h> header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +/* #undef HAVE_STRLCAT */ + +/* Define to 1 if you have the `strlcpy' function. */ +/* #undef HAVE_STRLCPY */ + +/* Define to 1 if you have the <stropts.h> header file. */ +#define HAVE_STROPTS_H 1 + +/* Have struct addrinfo */ +#define HAVE_STRUCT_ADDRINFO + +/* Have struct in6_addr */ +#define HAVE_STRUCT_IN6_ADDR + +/* Have struct sockaddr_in6 */ +#define HAVE_STRUCT_SOCKADDR_IN6 + +/* Define to 1 if the system has the type `struct sockaddr_storage'. */ +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 + +/* Define to 1 if `ss_family' is member of `struct sockaddr_storage'. */ +#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1 + +/* Define to 1 if `ut_addr' is member of `struct utmpx'. */ +/* #undef HAVE_STRUCT_UTMPX_UT_ADDR */ + +/* Define to 1 if `ut_addr_v6' is member of `struct utmpx'. */ +#define HAVE_STRUCT_UTMPX_UT_ADDR_V6 1 + +/* Define to 1 if `ut_host' is member of `struct utmpx'. */ +#define HAVE_STRUCT_UTMPX_UT_HOST 1 + +/* Define to 1 if `ut_id' is member of `struct utmpx'. */ +#define HAVE_STRUCT_UTMPX_UT_ID 1 + +/* Define to 1 if `ut_syslen' is member of `struct utmpx'. */ +/* #undef HAVE_STRUCT_UTMPX_UT_SYSLEN */ + +/* Define to 1 if `ut_time' is member of `struct utmpx'. */ +/* #undef HAVE_STRUCT_UTMPX_UT_TIME */ + +/* Define to 1 if `ut_tv' is member of `struct utmpx'. */ +#define HAVE_STRUCT_UTMPX_UT_TV 1 + +/* Define to 1 if `ut_type' is member of `struct utmpx'. */ +#define HAVE_STRUCT_UTMPX_UT_TYPE 1 + +/* Define to 1 if `ut_addr' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_ADDR 1 + +/* Define to 1 if `ut_addr_v6' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_ADDR_V6 1 + +/* Define to 1 if `ut_exit' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_EXIT 1 + +/* Define to 1 if `ut_host' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_HOST 1 + +/* Define to 1 if `ut_id' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_ID 1 + +/* Define to 1 if `ut_pid' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_PID 1 + +/* Define to 1 if `ut_time' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_TIME 1 + +/* Define to 1 if `ut_tv' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_TV 1 + +/* Define to 1 if `ut_type' is member of `struct utmp'. */ +#define HAVE_STRUCT_UTMP_UT_TYPE 1 + +/* Define to 1 if you have the <sys/select.h> header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the <sys/types.h> header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#define HAVE_SYS_WAIT_H 1 + +/* Define to 1 if you have the <termios.h> header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if the system has the type `uint16_t'. */ +#define HAVE_UINT16_T 1 + +/* Define to 1 if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `updwtmp' function. */ +#define HAVE_UPDWTMP 1 + +/* Define to 1 if you have the <util.h> header file. */ +/* #undef HAVE_UTIL_H */ + +/* Define to 1 if you have the `utmpname' function. */ +/* #define HAVE_UTMPNAME */ + +/* Define to 1 if you have the `utmpxname' function. */ +/* #define HAVE_UTMPXNAME */ + +/* Define to 1 if you have the <utmpx.h> header file. */ +/* #define HAVE_UTMPX_H */ + +/* Define to 1 if you have the <utmp.h> header file. */ +#define HAVE_UTMP_H 1 + +/* Define to 1 if the system has the type `u_int16_t'. */ +#define HAVE_U_INT16_T 1 + +/* Define to 1 if you have the `_getpty' function. */ +/* #undef HAVE__GETPTY */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "" + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to the type of arg 1 for `select'. */ +#define SELECT_TYPE_ARG1 int + +/* Define to the type of args 2, 3 and 4 for `select'. */ +#define SELECT_TYPE_ARG234 (fd_set *) + +/* Define to the type of arg 5 for `select'. */ +#define SELECT_TYPE_ARG5 (struct timeval *) + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#define TIME_WITH_SYS_TIME 1 + +/* Use /dev/ptmx */ +/* #undef USE_DEV_PTMX */ + +/* Number of bits in a file offset, on hosts where this is settable. */ +#define _FILE_OFFSET_BITS 64 + +/* Define for large files, on AIX-style hosts. */ +/* #undef _LARGE_FILES */ + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `int' if <sys/types.h> doesn't define. */ +/* #undef gid_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef mode_t */ + +/* Define to `int' if <sys/types.h> does not define. */ +/* #undef pid_t */ + +/* Define to `unsigned' if <sys/types.h> does not define. */ +/* #undef size_t */ + +/* type to use in place of socklen_t if not defined */ +/* #undef socklen_t */ + +/* Define to `int' if <sys/types.h> doesn't define. */ +/* #undef uid_t */ diff --git a/libtomcrypt/Android.mk b/libtomcrypt/Android.mk new file mode 100644 index 0000000..edf0651 --- /dev/null +++ b/libtomcrypt/Android.mk @@ -0,0 +1,71 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := libtomcrypt +LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/headers $(LOCAL_PATH)/.. + +LOCAL_CFLAGS += -DDROPBEAR_CLIENT +LOCAL_SRC_FILES := \ +src/ciphers/aes/aes.c src/ciphers/anubis.c src/ciphers/blowfish.c \ +src/ciphers/cast5.c src/ciphers/des.c src/ciphers/kasumi.c src/ciphers/khazad.c src/ciphers/kseed.c \ +src/ciphers/noekeon.c src/ciphers/rc2.c src/ciphers/rc5.c src/ciphers/rc6.c src/ciphers/safer/safer.c \ +src/ciphers/safer/safer_tab.c src/ciphers/safer/saferp.c src/ciphers/skipjack.c \ +src/ciphers/twofish/twofish.c src/ciphers/xtea.c src/encauth/ccm/ccm_memory.c \ +src/encauth/ccm/ccm_test.c src/encauth/eax/eax_addheader.c src/encauth/eax/eax_decrypt.c \ +src/encauth/eax/eax_decrypt_verify_memory.c src/encauth/eax/eax_done.c src/encauth/eax/eax_encrypt.c \ +src/encauth/eax/eax_encrypt_authenticate_memory.c src/encauth/eax/eax_init.c \ +src/encauth/eax/eax_test.c src/encauth/gcm/gcm_add_aad.c src/encauth/gcm/gcm_add_iv.c \ +src/encauth/gcm/gcm_done.c src/encauth/gcm/gcm_gf_mult.c src/encauth/gcm/gcm_init.c \ +src/encauth/gcm/gcm_memory.c src/encauth/gcm/gcm_mult_h.c src/encauth/gcm/gcm_process.c \ +src/encauth/gcm/gcm_reset.c src/encauth/gcm/gcm_test.c src/encauth/ocb/ocb_decrypt.c \ +src/encauth/ocb/ocb_decrypt_verify_memory.c src/encauth/ocb/ocb_done_decrypt.c \ +src/encauth/ocb/ocb_done_encrypt.c src/encauth/ocb/ocb_encrypt.c \ +src/encauth/ocb/ocb_encrypt_authenticate_memory.c src/encauth/ocb/ocb_init.c src/encauth/ocb/ocb_ntz.c \ +src/encauth/ocb/ocb_shift_xor.c src/encauth/ocb/ocb_test.c src/encauth/ocb/s_ocb_done.c \ +src/hashes/chc/chc.c src/hashes/helper/hash_file.c src/hashes/helper/hash_filehandle.c \ +src/hashes/helper/hash_memory.c src/hashes/helper/hash_memory_multi.c src/hashes/md2.c src/hashes/md4.c \ +src/hashes/md5.c src/hashes/rmd128.c src/hashes/rmd160.c src/hashes/rmd256.c src/hashes/rmd320.c \ +src/hashes/sha1.c src/hashes/sha2/sha256.c src/hashes/sha2/sha512.c src/hashes/tiger.c \ +src/hashes/whirl/whirl.c src/mac/f9/f9_done.c src/mac/f9/f9_file.c src/mac/f9/f9_init.c \ +src/mac/f9/f9_memory.c src/mac/f9/f9_memory_multi.c src/mac/f9/f9_process.c src/mac/f9/f9_test.c \ +src/mac/hmac/hmac_done.c src/mac/hmac/hmac_file.c src/mac/hmac/hmac_init.c src/mac/hmac/hmac_memory.c \ +src/mac/hmac/hmac_memory_multi.c src/mac/hmac/hmac_process.c src/mac/hmac/hmac_test.c \ +src/mac/omac/omac_done.c src/mac/omac/omac_file.c src/mac/omac/omac_init.c src/mac/omac/omac_memory.c \ +src/mac/omac/omac_memory_multi.c src/mac/omac/omac_process.c src/mac/omac/omac_test.c \ +src/mac/pelican/pelican.c src/mac/pelican/pelican_memory.c src/mac/pelican/pelican_test.c \ +src/mac/pmac/pmac_done.c src/mac/pmac/pmac_file.c src/mac/pmac/pmac_init.c src/mac/pmac/pmac_memory.c \ +src/mac/pmac/pmac_memory_multi.c src/mac/pmac/pmac_ntz.c src/mac/pmac/pmac_process.c \ +src/mac/pmac/pmac_shift_xor.c src/mac/pmac/pmac_test.c src/mac/xcbc/xcbc_done.c \ +src/mac/xcbc/xcbc_file.c src/mac/xcbc/xcbc_init.c src/mac/xcbc/xcbc_memory.c \ +src/mac/xcbc/xcbc_memory_multi.c src/mac/xcbc/xcbc_process.c src/mac/xcbc/xcbc_test.c \ +src/math/fp/ltc_ecc_fp_mulmod.c src/math/gmp_desc.c src/math/ltm_desc.c src/math/multi.c \ +src/math/rand_prime.c src/math/tfm_desc.c src/misc/base64/base64_decode.c \ +src/misc/base64/base64_encode.c src/misc/burn_stack.c src/misc/crypt/crypt.c \ +src/misc/crypt/crypt_argchk.c src/misc/crypt/crypt_cipher_descriptor.c \ +src/misc/crypt/crypt_cipher_is_valid.c src/misc/crypt/crypt_find_cipher.c \ +src/misc/crypt/crypt_find_cipher_any.c src/misc/crypt/crypt_find_cipher_id.c \ +src/misc/crypt/crypt_find_hash.c src/misc/crypt/crypt_find_hash_any.c \ +src/misc/crypt/crypt_find_hash_id.c src/misc/crypt/crypt_find_hash_oid.c \ +src/misc/crypt/crypt_find_prng.c src/misc/crypt/crypt_fsa.c src/misc/crypt/crypt_hash_descriptor.c \ +src/misc/crypt/crypt_hash_is_valid.c src/misc/crypt/crypt_ltc_mp_descriptor.c \ +src/misc/crypt/crypt_prng_descriptor.c src/misc/crypt/crypt_prng_is_valid.c \ +src/misc/crypt/crypt_register_cipher.c src/misc/crypt/crypt_register_hash.c \ +src/misc/crypt/crypt_register_prng.c src/misc/crypt/crypt_unregister_cipher.c \ +src/misc/crypt/crypt_unregister_hash.c src/misc/crypt/crypt_unregister_prng.c \ +src/misc/error_to_string.c src/misc/pkcs5/pkcs_5_1.c src/misc/pkcs5/pkcs_5_2.c src/misc/zeromem.c \ +src/modes/cbc/cbc_decrypt.c src/modes/cbc/cbc_done.c src/modes/cbc/cbc_encrypt.c \ +src/modes/cbc/cbc_getiv.c src/modes/cbc/cbc_setiv.c src/modes/cbc/cbc_start.c \ +src/modes/cfb/cfb_decrypt.c src/modes/cfb/cfb_done.c src/modes/cfb/cfb_encrypt.c \ +src/modes/cfb/cfb_getiv.c src/modes/cfb/cfb_setiv.c src/modes/cfb/cfb_start.c \ +src/modes/ctr/ctr_decrypt.c src/modes/ctr/ctr_done.c src/modes/ctr/ctr_encrypt.c \ +src/modes/ctr/ctr_getiv.c src/modes/ctr/ctr_setiv.c src/modes/ctr/ctr_start.c src/modes/ctr/ctr_test.c \ +src/modes/ecb/ecb_decrypt.c src/modes/ecb/ecb_done.c src/modes/ecb/ecb_encrypt.c \ +src/modes/ecb/ecb_start.c src/modes/f8/f8_decrypt.c src/modes/f8/f8_done.c src/modes/f8/f8_encrypt.c \ +src/modes/f8/f8_getiv.c src/modes/f8/f8_setiv.c src/modes/f8/f8_start.c src/modes/f8/f8_test_mode.c \ +src/modes/lrw/lrw_decrypt.c src/modes/lrw/lrw_done.c src/modes/lrw/lrw_encrypt.c \ +src/modes/lrw/lrw_getiv.c src/modes/lrw/lrw_process.c src/modes/lrw/lrw_setiv.c \ +src/modes/lrw/lrw_start.c src/modes/lrw/lrw_test.c src/modes/ofb/ofb_decrypt.c src/modes/ofb/ofb_done.c \ +src/modes/ofb/ofb_encrypt.c src/modes/ofb/ofb_getiv.c src/modes/ofb/ofb_setiv.c \ +src/modes/ofb/ofb_start.c + +include $(BUILD_STATIC_LIBRARY) diff --git a/libtommath/Android.mk b/libtommath/Android.mk new file mode 100644 index 0000000..fed8e39 --- /dev/null +++ b/libtommath/Android.mk @@ -0,0 +1,34 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := libtommath +LOCAL_SRC_FILES := \ +bncore.c bn_mp_init.c bn_mp_clear.c bn_mp_exch.c bn_mp_grow.c bn_mp_shrink.c \ +bn_mp_clamp.c bn_mp_zero.c bn_mp_set.c bn_mp_set_int.c bn_mp_init_size.c bn_mp_copy.c \ +bn_mp_init_copy.c bn_mp_abs.c bn_mp_neg.c bn_mp_cmp_mag.c bn_mp_cmp.c bn_mp_cmp_d.c \ +bn_mp_rshd.c bn_mp_lshd.c bn_mp_mod_2d.c bn_mp_div_2d.c bn_mp_mul_2d.c bn_mp_div_2.c \ +bn_mp_mul_2.c bn_s_mp_add.c bn_s_mp_sub.c bn_fast_s_mp_mul_digs.c bn_s_mp_mul_digs.c \ +bn_fast_s_mp_mul_high_digs.c bn_s_mp_mul_high_digs.c bn_fast_s_mp_sqr.c bn_s_mp_sqr.c \ +bn_mp_add.c bn_mp_sub.c bn_mp_karatsuba_mul.c bn_mp_mul.c bn_mp_karatsuba_sqr.c \ +bn_mp_sqr.c bn_mp_div.c bn_mp_mod.c bn_mp_add_d.c bn_mp_sub_d.c bn_mp_mul_d.c \ +bn_mp_div_d.c bn_mp_mod_d.c bn_mp_expt_d.c bn_mp_addmod.c bn_mp_submod.c \ +bn_mp_mulmod.c bn_mp_sqrmod.c bn_mp_gcd.c bn_mp_lcm.c bn_fast_mp_invmod.c bn_mp_invmod.c \ +bn_mp_reduce.c bn_mp_montgomery_setup.c bn_fast_mp_montgomery_reduce.c bn_mp_montgomery_reduce.c \ +bn_mp_exptmod_fast.c bn_mp_exptmod.c bn_mp_2expt.c bn_mp_n_root.c bn_mp_jacobi.c bn_reverse.c \ +bn_mp_count_bits.c bn_mp_read_unsigned_bin.c bn_mp_read_signed_bin.c bn_mp_to_unsigned_bin.c \ +bn_mp_to_signed_bin.c bn_mp_unsigned_bin_size.c bn_mp_signed_bin_size.c \ +bn_mp_xor.c bn_mp_and.c bn_mp_or.c bn_mp_rand.c bn_mp_montgomery_calc_normalization.c \ +bn_mp_prime_is_divisible.c bn_prime_tab.c bn_mp_prime_fermat.c bn_mp_prime_miller_rabin.c \ +bn_mp_prime_is_prime.c bn_mp_prime_next_prime.c bn_mp_dr_reduce.c \ +bn_mp_dr_is_modulus.c bn_mp_dr_setup.c bn_mp_reduce_setup.c \ +bn_mp_toom_mul.c bn_mp_toom_sqr.c bn_mp_div_3.c bn_s_mp_exptmod.c \ +bn_mp_reduce_2k.c bn_mp_reduce_is_2k.c bn_mp_reduce_2k_setup.c \ +bn_mp_reduce_2k_l.c bn_mp_reduce_is_2k_l.c bn_mp_reduce_2k_setup_l.c \ +bn_mp_radix_smap.c bn_mp_read_radix.c bn_mp_toradix.c bn_mp_radix_size.c \ +bn_mp_fread.c bn_mp_fwrite.c bn_mp_cnt_lsb.c bn_error.c \ +bn_mp_init_multi.c bn_mp_clear_multi.c bn_mp_exteuclid.c bn_mp_toradix_n.c \ +bn_mp_prime_random_ex.c bn_mp_get_int.c bn_mp_sqrt.c bn_mp_is_square.c bn_mp_init_set.c \ +bn_mp_init_set_int.c bn_mp_invmod_slow.c bn_mp_prime_rabin_miller_trials.c \ +bn_mp_to_signed_bin_n.c bn_mp_to_unsigned_bin_n.c + +include $(BUILD_STATIC_LIBRARY) diff --git a/netbsd_getpass.c b/netbsd_getpass.c new file mode 100644 index 0000000..4e79ed6 --- /dev/null +++ b/netbsd_getpass.c @@ -0,0 +1,114 @@ +/* $NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $ */ + +/* + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if 0 +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)getpass.c 8.1 (Berkeley) 6/4/93"; +#else +__RCSID("$NetBSD: getpass.c,v 1.15 2003/08/07 16:42:50 agc Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" +#endif + +#include <assert.h> +#include <paths.h> +#include <pwd.h> +#include <signal.h> +#include <stdio.h> +#include <termios.h> +#include <unistd.h> + +#if 0 +#ifdef __weak_alias +__weak_alias(getpass,_getpass) +#endif +#endif + +char * +getpass(prompt) + const char *prompt; +{ + struct termios term; + int ch; + char *p; + FILE *fp, *outfp; + int echo; + static char buf[_PASSWORD_LEN + 1]; + sigset_t oset, nset; + +#if 0 + _DIAGASSERT(prompt != NULL); +#endif + + /* + * read and write to /dev/tty if possible; else read from + * stdin and write to stderr. + */ + if ((outfp = fp = fopen(_PATH_TTY, "w+")) == NULL) { + outfp = stderr; + fp = stdin; + } + + /* + * note - blocking signals isn't necessarily the + * right thing, but we leave it for now. + */ + sigemptyset(&nset); + sigaddset(&nset, SIGINT); + sigaddset(&nset, SIGTSTP); + (void)sigprocmask(SIG_BLOCK, &nset, &oset); + + (void)tcgetattr(fileno(fp), &term); + if ((echo = (term.c_lflag & ECHO)) != 0) { + term.c_lflag &= ~ECHO; + (void)tcsetattr(fileno(fp), TCSAFLUSH /*|TCSASOFT*/, &term); + } + if (prompt != NULL) + (void)fputs(prompt, outfp); + rewind(outfp); /* implied flush */ + for (p = buf; (ch = getc(fp)) != EOF && ch != '\n';) + if (p < buf + _PASSWORD_LEN) + *p++ = ch; + *p = '\0'; + (void)write(fileno(outfp), "\n", 1); + if (echo) { + term.c_lflag |= ECHO; + (void)tcsetattr(fileno(fp), TCSAFLUSH/*|TCSASOFT*/, &term); + } + (void)sigprocmask(SIG_SETMASK, &oset, NULL); + if (fp != stdin) + (void)fclose(fp); + return(buf); +} @@ -72,10 +72,10 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */ * (eg AES256 as well as AES128) will result in a minimal size increase.*/ #define DROPBEAR_AES128_CBC #define DROPBEAR_3DES_CBC -#define DROPBEAR_AES256_CBC -#define DROPBEAR_BLOWFISH_CBC -#define DROPBEAR_TWOFISH256_CBC -#define DROPBEAR_TWOFISH128_CBC +//#define DROPBEAR_AES256_CBC +//#define DROPBEAR_BLOWFISH_CBC +//#define DROPBEAR_TWOFISH256_CBC +//#define DROPBEAR_TWOFISH128_CBC /* Message Integrity - at least one required. * RFC Draft requires sha1 and recommends sha1-96. @@ -203,7 +203,7 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */ /* This is used by the scp binary when used as a client binary. If you're * not using the Dropbear client, you'll need to change it */ -#define _PATH_SSH_PROGRAM "/usr/bin/dbclient" +#define _PATH_SSH_PROGRAM "/system/bin/ssh" /* Whether to log commands executed by a client. This only logs the * (single) command sent to the server, not what a user did in a diff --git a/progressmeter.c b/progressmeter.c index 2038fd3..a3f6cb5 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -30,7 +30,7 @@ #include "atomicio.h" #include "scpmisc.h" -#define DEFAULT_WINSIZE 80 +#define DEFAULT_WINSIZE 40 #define MAX_WINSIZE 512 #define PADDING 1 /* padding between the progress indicators */ #define UPDATE_INTERVAL 1 /* update the progress meter every second */ @@ -70,6 +70,9 @@ * */ +#define S_IWRITE 0200 +#define HAVE_BWLIMIT 0 + #include "includes.h" /*RCSID("$OpenBSD: scp.c,v 1.130 2006/01/31 10:35:43 djm Exp $");*/ @@ -308,10 +311,12 @@ main(int argc, char **argv) memset(&args, '\0', sizeof(args)); args.list = NULL; addargs(&args, "%s", ssh_program); +#if 0 /* dropbear ssh client doesn't understand these */ addargs(&args, "-x"); addargs(&args, "-oForwardAgent no"); addargs(&args, "-oPermitLocalCommand no"); addargs(&args, "-oClearAllForwardings yes"); +#endif fflag = tflag = 0; while ((ch = getopt(argc, argv, "dfl:prtvBCc:i:P:q1246S:o:F:")) != -1) @@ -681,8 +686,10 @@ next: if (fd != -1) { haderr = errno; statbytes += result; } +#if HAVE_BWLIMIT if (limit_rate) bwlimit(amt); +#endif } #ifdef PROGRESS_METER if (showprogress) @@ -755,6 +762,7 @@ rsource(char *name, struct stat *statp) (void) response(); } +#if HAVE_BWLIMIT void bwlimit(int amount) { @@ -808,6 +816,7 @@ bwlimit(int amount) lamt = 0; gettimeofday(&bwstart, NULL); } +#endif void sink(int argc, char **argv) @@ -1013,8 +1022,10 @@ bad: run_err("%s: %s", np, strerror(errno)); statbytes += j; } while (amt > 0); +#if HAVE_BWLIMIT if (limit_rate) bwlimit(4096); +#endif if (count == bp->cnt) { /* Keep reading so we stay sync'd up. */ |