aboutsummaryrefslogtreecommitdiff
path: root/standalone/android/dropbear.patch
blob: 84c7dfb6d623b62839a43b7e776c9628e963f52a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 014dadb02fd984828a6232534c47dba8e2f7818a Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Wed, 13 Feb 2013 15:29:52 -0400
Subject: [PATCH] android patch for dropbear

* Disable HOME override
* Use urandom to avoid blocking on every ssh connection.
* Enable use of netbsd_getpass.c
---
 cli-auth.c |    1 +
 cli-main.c |    2 --
 options.h  |    2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/cli-auth.c b/cli-auth.c
index 4c17a21..91dfdf8 100644
--- a/cli-auth.c
+++ b/cli-auth.c
@@ -31,6 +31,7 @@
 #include "ssh.h"
 #include "packet.h"
 #include "runopts.h"
+#include "netbsd_getpass.c"
 
 void cli_authinitialise() {
 
diff --git a/cli-main.c b/cli-main.c
index 106006b..68cf023 100644
--- a/cli-main.c
+++ b/cli-main.c
@@ -47,8 +47,6 @@ int main(int argc, char ** argv) {
 	_dropbear_exit = cli_dropbear_exit;
 	_dropbear_log = cli_dropbear_log;
 
-	putenv("HOME=/data/local");
-
 	disallow_core();
 
 	cli_getopts(argc, argv);
diff --git a/options.h b/options.h
index 7625151..48e404d 100644
--- a/options.h
+++ b/options.h
@@ -159,7 +159,7 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */
  * however significantly reduce the security of your ssh connections
  * if the PRNG state becomes guessable - make sure you know what you are
  * doing if you change this. */
-#define DROPBEAR_RANDOM_DEV "/dev/random"
+#define DROPBEAR_RANDOM_DEV "/dev/urandom"
 
 /* prngd must be manually set up to produce output */
 /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/
-- 
1.7.10.4