summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/dropbear
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/dropbear')
-rw-r--r--meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch229
-rw-r--r--meta/recipes-core/dropbear/dropbear.inc99
-rw-r--r--meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch23
-rw-r--r--meta/recipes-core/dropbear/dropbear/0003-configure.patch40
-rw-r--r--meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch22
-rw-r--r--meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch28
-rw-r--r--meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch22
-rw-r--r--meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch140
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear4
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear.socket10
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbear@.service11
-rw-r--r--meta/recipes-core/dropbear/dropbear/dropbearkey.service8
-rwxr-xr-xmeta/recipes-core/dropbear/dropbear/init113
-rw-r--r--meta/recipes-core/dropbear/dropbear/run-ptest2
-rw-r--r--meta/recipes-core/dropbear/dropbear_2014.63.bb4
15 files changed, 755 insertions, 0 deletions
diff --git a/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch b/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch
new file mode 100644
index 0000000000..6f828cfc51
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear-2013.58/build_test.patch
@@ -0,0 +1,229 @@
1Fix various linkage errors for LibTomCrypt library in order to run tests
2using ANSI-C PRNG algorithm. Also check that XCLOCKS_PER_SEC is larger than 1000000
3so that there may be a valid PRNG (Pseudo Random Number Generator).
4Customize the tests output to be ptest-compliant <result: testname>.
5
6Upstream-Status: Pending
7Signed-off-by: Dorin Gheorghe<dorin.gheorghe@enea.com>
8
9diff -Naur dropbear-2012.55/libtomcrypt/Makefile.in dropbear-2012.55.modified/libtomcrypt/Makefile.in
10--- dropbear-2012.55/libtomcrypt/Makefile.in 2013-04-16 14:20:45.270448945 +0200
11+++ dropbear-2012.55.modified/libtomcrypt/Makefile.in 2013-04-16 11:00:06.517614900 +0200
12@@ -19,7 +19,7 @@
13
14 # Compilation flags. Note the += does not write over the user's CFLAGS!
15 # The rest of the flags come from the parent Dropbear makefile
16-CFLAGS += -c -I$(srcdir)/src/headers/ -I$(srcdir)/../
17+CFLAGS += -c -I$(srcdir)/src/headers/ -I$(srcdir)/../ -I./testprof
18
19 # additional warnings (newer GCC 3.4 and higher)
20 ifdef GCC_34
21@@ -175,6 +175,7 @@
22 MULTIS=demos/multi.o
23 TIMINGS=demos/timing.o
24 TESTS=demos/test.o
25+YARROW=src/prngs/yarrow.o src/prngs/rng_make_prng.o src/prngs/rng_get_bytes.o
26
27 #Files left over from making the crypt.pdf.
28 LEFTOVERS=*.dvi *.log *.aux *.toc *.idx *.ilg *.ind *.out
29@@ -227,8 +228,8 @@
30 timing: library testprof/$(LIBTEST) $(TIMINGS)
31 $(CC) $(LDFLAGS) $(TIMINGS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TIMING)
32
33-test: library testprof/$(LIBTEST) $(TESTS)
34- $(CC) $(LDFLAGS) $(TESTS) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST)
35+test: library testprof/$(LIBTEST) $(TESTS) $(YARROW)
36+ $(CC) $(LDFLAGS) $(TESTS) $(YARROW) testprof/$(LIBTEST) $(LIBNAME) $(EXTRALIBS) -o $(TEST)
37
38 #This rule installs the library and the header files. This must be run
39 #as root in order to have a high enough permission to write to the correct
40diff -Naur dropbear-2012.55/libtomcrypt/demos/test.c dropbear-2012.55.modified/libtomcrypt/demos/test.c
41--- dropbear-2012.55/libtomcrypt/demos/test.c 2012-02-23 14:47:05.000000000 +0100
42+++ dropbear-2012.55.modified/libtomcrypt/demos/test.c 2013-04-18 14:30:44.519839797 +0200
43@@ -12,21 +12,21 @@
44 #elif defined(USE_GMP)
45 ltc_mp = gmp_desc;
46 #else
47- extern ltc_math_descriptor EXT_MATH_LIB;
48+ ltc_math_descriptor EXT_MATH_LIB;
49 ltc_mp = EXT_MATH_LIB;
50 #endif
51
52 printf("build == \n%s\n", crypt_build_settings);
53- printf("\nstore_test...."); fflush(stdout); x = store_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
54- printf("\ncipher_test..."); fflush(stdout); x = cipher_hash_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
55- printf("\nmodes_test...."); fflush(stdout); x = modes_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
56- printf("\nder_test......"); fflush(stdout); x = der_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
57- printf("\nmac_test......"); fflush(stdout); x = mac_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
58- printf("\npkcs_1_test..."); fflush(stdout); x = pkcs_1_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
59- printf("\nrsa_test......"); fflush(stdout); x = rsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
60- printf("\necc_test......"); fflush(stdout); x = ecc_tests(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
61- printf("\ndsa_test......"); fflush(stdout); x = dsa_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
62- printf("\nkatja_test...."); fflush(stdout); x = katja_test(); printf(x ? "failed" : "passed");if (x) exit(EXIT_FAILURE);
63+ fflush(stdout); x = store_test(); printf(x ? "FAIL: " : "PASS: "); printf("store_test\n"); if (x) exit(EXIT_FAILURE);
64+ fflush(stdout); x = cipher_hash_test(); printf(x ? "FAIL: " : "PASS: "); printf("cipher_test\n"); if (x) exit(EXIT_FAILURE);
65+ fflush(stdout); x = modes_test(); printf(x ? "FAIL: " : "PASS: "); printf("modes_test\n"); if (x) exit(EXIT_FAILURE);
66+ fflush(stdout); x = der_tests(); printf(x ? "FAIL: " : "PASS: "); printf("der_test\n"); if (x) exit(EXIT_FAILURE);
67+ fflush(stdout); x = mac_test(); printf(x ? "FAIL: " : "PASS: "); printf("mac_test\n"); if (x) exit(EXIT_FAILURE);
68+ fflush(stdout); x = pkcs_1_test(); printf(x ? "FAIL: " : "PASS: "); printf("pkcs_1_test\n"); if (x) exit(EXIT_FAILURE);
69+ fflush(stdout); x = rsa_test(); printf(x ? "FAIL: " : "PASS: "); printf("rsa_test\n"); if (x) exit(EXIT_FAILURE);
70+ fflush(stdout); x = ecc_tests(); printf(x ? "FAIL: " : "PASS: "); printf("ecc_test\n"); if (x) exit(EXIT_FAILURE);
71+ fflush(stdout); x = dsa_test(); printf(x ? "FAIL: " : "PASS: "); printf("dsa_test\n"); if (x) exit(EXIT_FAILURE);
72+ fflush(stdout); x = katja_test(); printf(x ? "FAIL: " : "PASS: "); printf("katja_test\n"); if (x) exit(EXIT_FAILURE);
73 printf("\n");
74 return EXIT_SUCCESS;
75 }
76diff -Naur dropbear-2012.55/libtomcrypt/src/ciphers/des.c dropbear-2012.55.modified/libtomcrypt/src/ciphers/des.c
77--- dropbear-2012.55/libtomcrypt/src/ciphers/des.c 2012-02-23 14:47:05.000000000 +0100
78+++ dropbear-2012.55.modified/libtomcrypt/src/ciphers/des.c 2013-04-16 11:05:46.171309548 +0200
79@@ -20,7 +20,7 @@
80 #define EN0 0
81 #define DE1 1
82
83-#if 0
84+#if 1
85 const struct ltc_cipher_descriptor des_desc =
86 {
87 "des",
88@@ -1520,7 +1520,7 @@
89 }
90 #endif
91
92-#if 0
93+#if 1
94 /**
95 Initialize the DES block cipher
96 @param key The symmetric key you wish to pass
97@@ -1581,7 +1581,7 @@
98 return CRYPT_OK;
99 }
100
101-#if 0
102+#if 1
103 /**
104 Encrypts a block of text with DES
105 @param pt The input plaintext (8 bytes)
106@@ -1672,7 +1672,7 @@
107 return CRYPT_OK;
108 }
109
110-#if 0
111+#if 1
112 /**
113 Performs a self-test of the DES block cipher
114 @return CRYPT_OK if functional, CRYPT_NOP if self-test has been disabled
115@@ -1857,7 +1857,7 @@
116 #endif
117 }
118
119-#if 0
120+#if 1
121 /** Terminate the context
122 @param skey The scheduled key
123 */
124@@ -1874,7 +1874,7 @@
125 }
126
127
128-#if 0
129+#if 1
130 /**
131 Gets suitable key size
132 @param keysize [in/out] The length of the recommended key (in bytes). This function will store the suitable size back in this variable.
133diff -Naur dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_cipher.h dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_cipher.h
134--- dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_cipher.h 2012-02-23 14:47:05.000000000 +0100
135+++ dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_cipher.h 2013-04-16 10:41:21.916943343 +0200
136@@ -187,6 +187,7 @@
137 void *data;
138 } symmetric_key;
139
140+#define LTC_ECB_MODE
141 #ifdef LTC_ECB_MODE
142 /** A block cipher ECB structure */
143 typedef struct {
144diff -Naur dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_custom.h dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_custom.h
145--- dropbear-2012.55/libtomcrypt/src/headers/tomcrypt_custom.h 2012-02-23 14:47:05.000000000 +0100
146+++ dropbear-2012.55.modified/libtomcrypt/src/headers/tomcrypt_custom.h 2013-04-16 14:02:10.794122645 +0200
147@@ -72,13 +72,15 @@
148
149 /* Enable self-test test vector checking */
150 /* Not for dropbear */
151-/*#define LTC_TEST*/
152+#define LTC_TEST
153+
154+#define YARROW
155
156 /* clean the stack of functions which put private information on stack */
157 /* #define LTC_CLEAN_STACK */
158
159 /* disable all file related functions */
160-#define LTC_NO_FILE
161+//#define LTC_NO_FILE
162
163 /* disable all forms of ASM */
164 /* #define LTC_NO_ASM */
165diff -Naur dropbear-2012.55/libtomcrypt/src/misc/crypt/crypt.c dropbear-2012.55.modified/libtomcrypt/src/misc/crypt/crypt.c
166--- dropbear-2012.55/libtomcrypt/src/misc/crypt/crypt.c 2012-02-23 14:47:06.000000000 +0100
167+++ dropbear-2012.55.modified/libtomcrypt/src/misc/crypt/crypt.c 2013-04-16 10:46:33.359842595 +0200
168@@ -15,7 +15,6 @@
169 Build strings, Tom St Denis
170 */
171
172-/*
173 const char *crypt_build_settings =
174 "LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n"
175 "LibTomCrypt is public domain software.\n"
176@@ -358,7 +357,7 @@
177 "\n"
178 "\n\n\n"
179 ;
180- */
181+
182
183
184 /* $Source: /cvs/libtom/libtomcrypt/src/misc/crypt/crypt.c,v $ */
185diff -Naur dropbear-2012.55/libtomcrypt/src/prngs/rng_get_bytes.c dropbear-2012.55.modified/libtomcrypt/src/prngs/rng_get_bytes.c
186--- dropbear-2012.55/libtomcrypt/src/prngs/rng_get_bytes.c 2012-02-23 14:47:06.000000000 +0100
187+++ dropbear-2012.55.modified/libtomcrypt/src/prngs/rng_get_bytes.c 2013-04-18 14:20:03.974930313 +0200
188@@ -60,7 +60,7 @@
189 clock_t t1;
190 int l, acc, bits, a, b;
191
192- if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 10000) {
193+ if (XCLOCKS_PER_SEC < 100 || XCLOCKS_PER_SEC > 1000000) {
194 return 0;
195 }
196
197diff -Naur dropbear-2012.55/libtomcrypt/testprof/cipher_hash_test.c dropbear-2012.55.modified/libtomcrypt/testprof/cipher_hash_test.c
198--- dropbear-2012.55/libtomcrypt/testprof/cipher_hash_test.c 2012-02-23 14:47:06.000000000 +0100
199+++ dropbear-2012.55.modified/libtomcrypt/testprof/cipher_hash_test.c 2013-04-16 14:08:22.042234657 +0200
200@@ -11,6 +11,8 @@
201
202 /* test ciphers */
203 for (x = 0; cipher_descriptor[x].name != NULL; x++) {
204+ /* md5 test is failing with segfault */
205+ if (!strcmp(cipher_descriptor[x].name, "md5")) break;
206 DO(cipher_descriptor[x].test());
207 }
208
209diff -Naur dropbear-2012.55/libtomcrypt/testprof/makefile dropbear-2012.55.modified/libtomcrypt/testprof/makefile
210--- dropbear-2012.55/libtomcrypt/testprof/makefile 2012-02-23 14:47:06.000000000 +0100
211+++ dropbear-2012.55.modified/libtomcrypt/testprof/makefile 2013-04-16 10:35:21.200110690 +0200
212@@ -1,4 +1,4 @@
213-CFLAGS += -I../src/headers -I./ -Wall -W
214+CFLAGS += -I../src/headers -I./ -I./../../ -Wall -W
215
216 # ranlib tools
217 ifndef RANLIB
218diff -Naur dropbear-2012.55/libtomcrypt/testprof/modes_test.c dropbear-2012.55.modified/libtomcrypt/testprof/modes_test.c
219--- dropbear-2012.55/libtomcrypt/testprof/modes_test.c 2012-02-23 14:47:06.000000000 +0100
220+++ dropbear-2012.55.modified/libtomcrypt/testprof/modes_test.c 2013-04-16 10:50:53.820882559 +0200
221@@ -1,6 +1,8 @@
222 /* test CFB/OFB/CBC modes */
223 #include <tomcrypt_test.h>
224
225+extern unsigned long yarrow_read(unsigned char *out, unsigned long outlen, prng_state *prng);
226+
227 int modes_test(void)
228 {
229 unsigned char pt[64], ct[64], tmp[64], key[16], iv[16], iv2[16];
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
new file mode 100644
index 0000000000..40ed9d261d
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -0,0 +1,99 @@
1SUMMARY = "A lightweight SSH and SCP implementation"
2HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
3SECTION = "console/network"
4
5# some files are from other projects and have others license terms:
6# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
7LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=4d290ce0ac102c828dfc9ce836784688"
9
10DEPENDS = "zlib"
11RPROVIDES_${PN} = "ssh sshd"
12
13DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
14
15SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
16 file://0001-urandom-xauth-changes-to-options.h.patch \
17 file://0003-configure.patch \
18 file://0004-fix-2kb-keys.patch \
19 file://0007-dropbear-fix-for-x32-abi.patch \
20 file://init \
21 file://dropbearkey.service \
22 file://dropbear@.service \
23 file://dropbear.socket \
24 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
25
26PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
27 file://0006-dropbear-configuration-file.patch \
28 file://dropbear"
29
30inherit autotools update-rc.d systemd
31
32INITSCRIPT_NAME = "dropbear"
33INITSCRIPT_PARAMS = "defaults 10"
34
35SYSTEMD_SERVICE_${PN} = "dropbear.socket"
36
37CFLAGS_prepend = " -I. "
38LD = "${CC}"
39
40SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
41BINCOMMANDS = "dbclient ssh scp"
42EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
43EXTRA_OECONF += "\
44 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
45CFLAGS += "-DSFTPSERVER_PATH=\\"${libdir}/openssh/sftp-server\\""
46
47do_install() {
48 install -d ${D}${sysconfdir} \
49 ${D}${sysconfdir}/init.d \
50 ${D}${sysconfdir}/default \
51 ${D}${sysconfdir}/dropbear \
52 ${D}${bindir} \
53 ${D}${sbindir} \
54 ${D}${localstatedir}
55
56 install -m 0755 dropbearmulti ${D}${sbindir}/
57 ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
58
59 for i in ${SBINCOMMANDS}
60 do
61 ln -s ./dropbearmulti ${D}${sbindir}/$i
62 done
63 cat ${WORKDIR}/init | sed -e 's,/etc,${sysconfdir},g' \
64 -e 's,/usr/sbin,${sbindir},g' \
65 -e 's,/var,${localstatedir},g' \
66 -e 's,/usr/bin,${bindir},g' \
67 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/dropbear
68 chmod 755 ${D}${sysconfdir}/init.d/dropbear
69 if [ "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
70 install -d ${D}${sysconfdir}/pam.d
71 install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
72 fi
73
74 # deal with systemd unit files
75 install -d ${D}${systemd_unitdir}/system
76 install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
77 install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
78 install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
79 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
80 -e 's,@BINDIR@,${bindir},g' \
81 -e 's,@SBINDIR@,${sbindir},g' \
82 ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
83}
84
85inherit update-alternatives
86
87ALTERNATIVE_PRIORITY = "20"
88ALTERNATIVE_${PN} = "scp ssh"
89
90ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
91
92pkg_postrm_append_${PN} () {
93 if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
94 rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
95 fi
96 if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
97 rm ${sysconfdir}/dropbear/dropbear_dss_host_key
98 fi
99}
diff --git a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 0000000000..71a4666b5c
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
@@ -0,0 +1,23 @@
1Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
2
3Upstream-Status: Inappropriate [configuration]
4---
5 options.h | 2 +-
6 1 file changed, 1 insertion(+), 1 deletion(-)
7
8diff --git a/options.h b/options.h
9index 7d06322..71a21c2 100644
10--- a/options.h
11+++ b/options.h
12@@ -247,7 +247,7 @@ much traffic. */
13 /* The command to invoke for xauth when using X11 forwarding.
14 * "-q" for quiet */
15 #ifndef XAUTH_COMMAND
16-#define XAUTH_COMMAND "/usr/bin/X11/xauth -q"
17+#define XAUTH_COMMAND "xauth -q"
18 #endif
19
20 /* if you want to enable running an sftp server (such as the one included with
21--
221.7.11.7
23
diff --git a/meta/recipes-core/dropbear/dropbear/0003-configure.patch b/meta/recipes-core/dropbear/dropbear/0003-configure.patch
new file mode 100644
index 0000000000..2baf665ae4
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0003-configure.patch
@@ -0,0 +1,40 @@
1From c5f5c5054c1b15539dccf866e2c3faba7ed68456 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
3Date: Thu, 25 Apr 2013 00:27:25 +0200
4Subject: [PATCH 3/6] configure
5
6---
7 configure.ac | 11 ++++++++---
8 1 file changed, 8 insertions(+), 3 deletions(-)
9
10diff --git a/configure.ac b/configure.ac
11index 05461f3..9c16d90 100644
12--- a/configure.ac
13+++ b/configure.ac
14@@ -166,15 +166,20 @@ AC_ARG_ENABLE(openpty,
15 AC_MSG_NOTICE(Not using openpty)
16 else
17 AC_MSG_NOTICE(Using openpty if available)
18- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
19+ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
20 fi
21 ],
22 [
23 AC_MSG_NOTICE(Using openpty if available)
24- AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
25+ AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
26 ]
27 )
28-
29+
30+if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
31+ AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
32+ no_ptc_check=yes
33+ no_ptmx_check=yes
34+fi
35
36 AC_ARG_ENABLE(syslog,
37 [ --disable-syslog Don't include syslog support],
38--
391.7.11.7
40
diff --git a/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
new file mode 100644
index 0000000000..7539d2034f
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
@@ -0,0 +1,22 @@
1Subject: [PATCH 4/6] fix 2kb keys
2
3Upstream-Status: Inappropriate [configuration]
4---
5 kex.h | 2 +-
6 1 file changed, 1 insertion(+), 1 deletion(-)
7
8diff --git a/kex.h b/kex.h
9index 72430e9..375c677 100644
10--- a/kex.h
11+++ b/kex.h
12@@ -67,6 +67,6 @@ struct KEXState {
13 };
14
15
16-#define MAX_KEXHASHBUF 2000
17+#define MAX_KEXHASHBUF 3000
18
19 #endif /* _KEX_H_ */
20--
211.7.11.7
22
diff --git a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
new file mode 100644
index 0000000000..c408c571e6
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
@@ -0,0 +1,28 @@
1Subject: [PATCH 5/6] dropbear enable pam
2
3dropbear: We need modify file option.h besides enabling pam in \
4configure if we want dropbear to support pam.
5
6Upstream-Status: Pending
7
8Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
9---
10 options.h | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13Index: dropbear-2013.62/options.h
14===================================================================
15--- dropbear-2013.62.orig/options.h 2014-01-14 21:53:02.803262009 +0000
16+++ dropbear-2013.62/options.h 2014-01-14 21:53:56.119263462 +0000
17@@ -192,9 +192,9 @@
18 * PAM challenge/response.
19 * You can't enable both PASSWORD and PAM. */
20
21-#define ENABLE_SVR_PASSWORD_AUTH
22+/*#define ENABLE_SVR_PASSWORD_AUTH*/
23 /* PAM requires ./configure --enable-pam */
24-/*#define ENABLE_SVR_PAM_AUTH */
25+#define ENABLE_SVR_PAM_AUTH
26 #define ENABLE_SVR_PUBKEY_AUTH
27
28 /* Whether to take public key options in
diff --git a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
new file mode 100644
index 0000000000..fa4c8d0a67
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
@@ -0,0 +1,22 @@
1Subject: [PATCH 6/6] dropbear configuration file
2
3dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
4to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
5
6Upstream-Status: Inappropriate [configuration]
7
8Signed-off-by: Maxin B. John <maxin.john@enea.com>
9Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
10---
11diff -Naur dropbear-2013.60-orig/svr-authpam.c dropbear-2013.60/svr-authpam.c
12--- dropbear-2013.60-orig/svr-authpam.c 2013-10-16 16:34:53.000000000 +0200
13+++ dropbear-2013.60/svr-authpam.c 2013-10-21 17:04:04.969416055 +0200
14@@ -211,7 +211,7 @@
15 userData.passwd = password;
16
17 /* Init pam */
18- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
19+ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
20 dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
21 rc, pam_strerror(pamHandlep, rc));
22 goto cleanup;
diff --git a/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
new file mode 100644
index 0000000000..b4501211c3
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
@@ -0,0 +1,140 @@
1Upstream-Status: Pending
2
3The dropbearkey utility built in x32 abi format, when generating ssh
4keys, was getting lost in the infinite loop.
5
6This patch fixes the issue by fixing types of variables and
7parameters of functions used in the code, which were getting
8undesired size, when compiled with the x32 abi toolchain.
9
102013/05/23
11Received this fix from H J Lu.
12
13Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
14
15# HG changeset patch
16# User H.J. Lu <hjl.tools@gmail.com>
17# Date 1369344079 25200
18# Node ID a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
19# Parent e76614145aea67f66e4a4257685c771efba21aa1
20Typdef mp_digit to unsigned long long for MP_64BIT
21
22When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned
23long long instead of unsigned long since for x32, unsigned long is
2432-bit and unsigned long long is 64-bit and it is safe to use unsigned
25long long for 64-bit integer with GCC.
26
27diff -r e76614145aea -r a10a1c46b857 libtommath/tommath.h
28--- a/libtommath/tommath.h Thu Apr 18 22:57:47 2013 +0800
29+++ b/libtommath/tommath.h Thu May 23 14:21:19 2013 -0700
30@@ -73,7 +73,7 @@
31 typedef signed long long long64;
32 #endif
33
34- typedef unsigned long mp_digit;
35+ typedef unsigned long long mp_digit;
36 typedef unsigned long mp_word __attribute__ ((mode(TI)));
37
38 #define DIGIT_BIT 60
39# HG changeset patch
40# User H.J. Lu <hjl.tools@gmail.com>
41# Date 1369344241 25200
42# Node ID c7555a4cb7ded3a88409ba85f4027baa7af5f536
43# Parent a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
44Cast to mp_digit when updating *rho
45
46There is
47
48int
49mp_montgomery_setup (mp_int * n, mp_digit * rho)
50
51We should cast to mp_digit instead of unsigned long when updating
52*rho since mp_digit may be unsigned long long and unsigned long long
53may be different from unsigned long, like in x32.
54
55diff -r a10a1c46b857 -r c7555a4cb7de libtommath/bn_mp_montgomery_setup.c
56--- a/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:21:19 2013 -0700
57+++ b/libtommath/bn_mp_montgomery_setup.c Thu May 23 14:24:01 2013 -0700
58@@ -48,7 +48,7 @@
59 #endif
60
61 /* rho = -1/m mod b */
62- *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
63+ *rho = (mp_digit)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
64
65 return MP_OKAY;
66 }
67# HG changeset patch
68# User H.J. Lu <hjl.tools@gmail.com>
69# Date 1369344541 25200
70# Node ID 7c656e7071a6412688b2f30a529a9afac6c7bf5a
71# Parent c7555a4cb7ded3a88409ba85f4027baa7af5f536
72Define LTC_FAST_TYPE to unsigned long long for __x86_64__
73
74We should define LTC_FAST_TYPE to unsigned long long instead of unsigned
75long if __x86_64__ to support x32 where unsigned long long is 64-bit
76and unsigned long is 32-bit.
77
78diff -r c7555a4cb7de -r 7c656e7071a6 libtomcrypt/src/headers/tomcrypt_cfg.h
79--- a/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:24:01 2013 -0700
80+++ b/libtomcrypt/src/headers/tomcrypt_cfg.h Thu May 23 14:29:01 2013 -0700
81@@ -74,7 +74,7 @@
82 #define ENDIAN_LITTLE
83 #define ENDIAN_64BITWORD
84 #define LTC_FAST
85- #define LTC_FAST_TYPE unsigned long
86+ #define LTC_FAST_TYPE unsigned long long
87 #endif
88
89 /* detect PPC32 */
90# HG changeset patch
91# User H.J. Lu <hjl.tools@gmail.com>
92# Date 1369344730 25200
93# Node ID a7d4690158fae4ede2c4e5b56233e83730bf38ee
94# Parent 7c656e7071a6412688b2f30a529a9afac6c7bf5a
95Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC
96
97We should use unsigned long long instead of unsigned long as unsigned
9864-bit integer for x86-64 GCC to support x32 where unsigned long is
9932-bit.
100
101diff -r 7c656e7071a6 -r a7d4690158fa libtomcrypt/src/headers/tomcrypt_macros.h
102--- a/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:29:01 2013 -0700
103+++ b/libtomcrypt/src/headers/tomcrypt_macros.h Thu May 23 14:32:10 2013 -0700
104@@ -343,7 +343,7 @@
105 /* 64-bit Rotates */
106 #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
107
108-static inline unsigned long ROL64(unsigned long word, int i)
109+static inline unsigned long long ROL64(unsigned long long word, int i)
110 {
111 asm("rolq %%cl,%0"
112 :"=r" (word)
113@@ -351,7 +351,7 @@
114 return word;
115 }
116
117-static inline unsigned long ROR64(unsigned long word, int i)
118+static inline unsigned long long ROR64(unsigned long long word, int i)
119 {
120 asm("rorq %%cl,%0"
121 :"=r" (word)
122@@ -361,7 +361,7 @@
123
124 #ifndef LTC_NO_ROLC
125
126-static inline unsigned long ROL64c(unsigned long word, const int i)
127+static inline unsigned long long ROL64c(unsigned long long word, const int i)
128 {
129 asm("rolq %2,%0"
130 :"=r" (word)
131@@ -369,7 +369,7 @@
132 return word;
133 }
134
135-static inline unsigned long ROR64c(unsigned long word, const int i)
136+static inline unsigned long long ROR64c(unsigned long long word, const int i)
137 {
138 asm("rorq %2,%0"
139 :"=r" (word)
140
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear b/meta/recipes-core/dropbear/dropbear/dropbear
new file mode 100644
index 0000000000..47e787fb10
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear
@@ -0,0 +1,4 @@
1#%PAM-1.0
2
3auth include common-auth
4account include common-account
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.socket b/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 0000000000..e5c61b755e
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear.socket
@@ -0,0 +1,10 @@
1[Unit]
2Conflicts=dropbear.service
3
4[Socket]
5ListenStream=22
6Accept=yes
7
8[Install]
9WantedBy=sockets.target
10Also=dropbearkey.service
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear@.service b/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 0000000000..6fe9942090
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear@.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=SSH Per-Connection Server
3Wants=dropbearkey.service
4After=syslog.target dropbearkey.service
5
6[Service]
7EnvironmentFile=-/etc/default/dropbear
8ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
9ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
10StandardInput=socket
11KillMode=process
diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 0000000000..ccc21d5cca
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
@@ -0,0 +1,8 @@
1[Unit]
2Description=SSH Key Generation
3ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
4
5[Service]
6Type=oneshot
7ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
8RemainAfterExit=yes
diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init
new file mode 100755
index 0000000000..e8fed3f94d
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/init
@@ -0,0 +1,113 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: sshd
4# Required-Start: $remote_fs $syslog $networking
5# Required-Stop: $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 1
8# Short-Description: Dropbear Secure Shell server
9### END INIT INFO
10#
11# Do not configure this file. Edit /etc/default/dropbear instead!
12#
13
14PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15DAEMON=/usr/sbin/dropbear
16NAME=dropbear
17DESC="Dropbear SSH server"
18PIDFILE=/var/run/dropbear.pid
19
20DROPBEAR_PORT=22
21DROPBEAR_EXTRA_ARGS=
22NO_START=0
23
24set -e
25
26test ! -r /etc/default/dropbear || . /etc/default/dropbear
27test "$NO_START" = "0" || exit 0
28test -x "$DAEMON" || exit 0
29test ! -h /var/service/dropbear || exit 0
30
31readonly_rootfs=0
32for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
33 case $flag in
34 ro)
35 readonly_rootfs=1
36 ;;
37 esac
38done
39
40if [ $readonly_rootfs = "1" ]; then
41 mkdir -p /var/lib/dropbear
42 DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
43 DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
44else
45 DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
46 DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
47fi
48
49test -z "$DROPBEAR_BANNER" || \
50 DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
51test -n "$DROPBEAR_RSAKEY" || \
52 DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
53test -n "$DROPBEAR_DSSKEY" || \
54 DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
55test -n "$DROPBEAR_KEYTYPES" || \
56 DROPBEAR_KEYTYPES="rsa"
57
58gen_keys() {
59for t in $DROPBEAR_KEYTYPES; do
60 case $t in
61 rsa)
62 if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
63 rm $DROPBEAR_RSAKEY || true
64 fi
65 test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
66 ;;
67 dsa)
68 if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
69 rm $DROPBEAR_DSSKEY || true
70 fi
71 test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
72 ;;
73 esac
74done
75}
76
77case "$1" in
78 start)
79 echo -n "Starting $DESC: "
80 gen_keys
81 KEY_ARGS=""
82 test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
83 test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
84 start-stop-daemon -S -p $PIDFILE \
85 -x "$DAEMON" -- $KEY_ARGS \
86 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
87 echo "$NAME."
88 ;;
89 stop)
90 echo -n "Stopping $DESC: "
91 start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
92 echo "$NAME."
93 ;;
94 restart|force-reload)
95 echo -n "Restarting $DESC: "
96 start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
97 sleep 1
98 KEY_ARGS=""
99 test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
100 test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
101 start-stop-daemon -S -p $PIDFILE \
102 -x "$DAEMON" -- $KEY_ARGS \
103 -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
104 echo "$NAME."
105 ;;
106 *)
107 N=/etc/init.d/$NAME
108 echo "Usage: $N {start|stop|restart|force-reload}" >&2
109 exit 1
110 ;;
111esac
112
113exit 0
diff --git a/meta/recipes-core/dropbear/dropbear/run-ptest b/meta/recipes-core/dropbear/dropbear/run-ptest
new file mode 100644
index 0000000000..61f1e0c0dd
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/run-ptest
@@ -0,0 +1,2 @@
1#!/bin/sh
2cd libtomcrypt; ./test 2>&1 | sed 's/NOPPASS/SKIP/'
diff --git a/meta/recipes-core/dropbear/dropbear_2014.63.bb b/meta/recipes-core/dropbear/dropbear_2014.63.bb
new file mode 100644
index 0000000000..bb7e6178bc
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear_2014.63.bb
@@ -0,0 +1,4 @@
1require dropbear.inc
2
3SRC_URI[md5sum] = "7066bb9a2da708f3ed06314fdc9c47fd"
4SRC_URI[sha256sum] = "595992de432ba586a0e7e191bbb1ad587727678bb3e345b018c395b8c55b57ae"