diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-core/dropbear | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/dropbear')
15 files changed, 764 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 @@ | |||
1 | Fix various linkage errors for LibTomCrypt library in order to run tests | ||
2 | using ANSI-C PRNG algorithm. Also check that XCLOCKS_PER_SEC is larger than 1000000 | ||
3 | so that there may be a valid PRNG (Pseudo Random Number Generator). | ||
4 | Customize the tests output to be ptest-compliant <result: testname>. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Dorin Gheorghe<dorin.gheorghe@enea.com> | ||
8 | |||
9 | diff -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 | ||
40 | diff -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 | } | ||
76 | diff -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. | ||
133 | diff -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 { | ||
144 | diff -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 */ | ||
165 | diff -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 $ */ | ||
185 | diff -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 | |||
197 | diff -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 | |||
209 | diff -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 | ||
218 | diff -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..947a491679 --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear.inc | |||
@@ -0,0 +1,106 @@ | |||
1 | SUMMARY = "A lightweight SSH and SCP implementation" | ||
2 | HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html" | ||
3 | SECTION = "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 | ||
7 | LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4d290ce0ac102c828dfc9ce836784688" | ||
9 | |||
10 | DEPENDS = "zlib" | ||
11 | RPROVIDES_${PN} = "ssh sshd" | ||
12 | |||
13 | DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
14 | |||
15 | SRC_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 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} " | ||
25 | |||
26 | PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \ | ||
27 | file://0006-dropbear-configuration-file.patch \ | ||
28 | file://dropbear" | ||
29 | |||
30 | PAM_PLUGINS = "libpam-runtime \ | ||
31 | pam-plugin-deny \ | ||
32 | pam-plugin-permit \ | ||
33 | pam-plugin-unix \ | ||
34 | " | ||
35 | RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}" | ||
36 | |||
37 | inherit autotools update-rc.d systemd | ||
38 | |||
39 | INITSCRIPT_NAME = "dropbear" | ||
40 | INITSCRIPT_PARAMS = "defaults 10" | ||
41 | |||
42 | SYSTEMD_SERVICE_${PN} = "dropbear.socket" | ||
43 | |||
44 | CFLAGS_prepend = " -I. " | ||
45 | LD = "${CC}" | ||
46 | |||
47 | SBINCOMMANDS = "dropbear dropbearkey dropbearconvert" | ||
48 | BINCOMMANDS = "dbclient ssh scp" | ||
49 | EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"' | ||
50 | EXTRA_OECONF += "\ | ||
51 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}" | ||
52 | CFLAGS += "-DSFTPSERVER_PATH=\\"${libdir}/openssh/sftp-server\\"" | ||
53 | |||
54 | do_install() { | ||
55 | install -d ${D}${sysconfdir} \ | ||
56 | ${D}${sysconfdir}/init.d \ | ||
57 | ${D}${sysconfdir}/default \ | ||
58 | ${D}${sysconfdir}/dropbear \ | ||
59 | ${D}${bindir} \ | ||
60 | ${D}${sbindir} \ | ||
61 | ${D}${localstatedir} | ||
62 | |||
63 | install -m 0755 dropbearmulti ${D}${sbindir}/ | ||
64 | ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient | ||
65 | |||
66 | for i in ${SBINCOMMANDS} | ||
67 | do | ||
68 | ln -s ./dropbearmulti ${D}${sbindir}/$i | ||
69 | done | ||
70 | sed -e 's,/etc,${sysconfdir},g' \ | ||
71 | -e 's,/usr/sbin,${sbindir},g' \ | ||
72 | -e 's,/var,${localstatedir},g' \ | ||
73 | -e 's,/usr/bin,${bindir},g' \ | ||
74 | -e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear | ||
75 | chmod 755 ${D}${sysconfdir}/init.d/dropbear | ||
76 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then | ||
77 | install -d ${D}${sysconfdir}/pam.d | ||
78 | install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/ | ||
79 | fi | ||
80 | |||
81 | # deal with systemd unit files | ||
82 | install -d ${D}${systemd_unitdir}/system | ||
83 | install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system | ||
84 | install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system | ||
85 | install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system | ||
86 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
87 | -e 's,@BINDIR@,${bindir},g' \ | ||
88 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
89 | ${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service | ||
90 | } | ||
91 | |||
92 | inherit update-alternatives | ||
93 | |||
94 | ALTERNATIVE_PRIORITY = "20" | ||
95 | ALTERNATIVE_${PN} = "scp ssh" | ||
96 | |||
97 | ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti" | ||
98 | |||
99 | pkg_postrm_append_${PN} () { | ||
100 | if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then | ||
101 | rm ${sysconfdir}/dropbear/dropbear_rsa_host_key | ||
102 | fi | ||
103 | if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then | ||
104 | rm ${sysconfdir}/dropbear/dropbear_dss_host_key | ||
105 | fi | ||
106 | } | ||
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 @@ | |||
1 | Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | --- | ||
5 | options.h | 2 +- | ||
6 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
7 | |||
8 | diff --git a/options.h b/options.h | ||
9 | index 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 | -- | ||
22 | 1.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..c53ab01ddd --- /dev/null +++ b/meta/recipes-core/dropbear/dropbear/0003-configure.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From c5f5c5054c1b15539dccf866e2c3faba7ed68456 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com> | ||
3 | Date: Thu, 25 Apr 2013 00:27:25 +0200 | ||
4 | Subject: [PATCH 3/6] configure: add a variable to allow openpty check to be cached | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | --- | ||
9 | configure.ac | 11 ++++++++--- | ||
10 | 1 file changed, 8 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/configure.ac b/configure.ac | ||
13 | index 05461f3..9c16d90 100644 | ||
14 | --- a/configure.ac | ||
15 | +++ b/configure.ac | ||
16 | @@ -166,15 +166,20 @@ AC_ARG_ENABLE(openpty, | ||
17 | AC_MSG_NOTICE(Not using openpty) | ||
18 | else | ||
19 | AC_MSG_NOTICE(Using openpty if available) | ||
20 | - AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)]) | ||
21 | + AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes]) | ||
22 | fi | ||
23 | ], | ||
24 | [ | ||
25 | AC_MSG_NOTICE(Using openpty if available) | ||
26 | - AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)]) | ||
27 | + AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes]) | ||
28 | ] | ||
29 | ) | ||
30 | - | ||
31 | + | ||
32 | +if test "x$dropbear_cv_func_have_openpty" = "xyes"; then | ||
33 | + AC_DEFINE(HAVE_OPENPTY,,Have openpty() function) | ||
34 | + no_ptc_check=yes | ||
35 | + no_ptmx_check=yes | ||
36 | +fi | ||
37 | |||
38 | AC_ARG_ENABLE(syslog, | ||
39 | [ --disable-syslog Don't include syslog support], | ||
40 | -- | ||
41 | 1.7.11.7 | ||
42 | |||
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 @@ | |||
1 | Subject: [PATCH 4/6] fix 2kb keys | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | --- | ||
5 | kex.h | 2 +- | ||
6 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
7 | |||
8 | diff --git a/kex.h b/kex.h | ||
9 | index 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 | -- | ||
21 | 1.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 @@ | |||
1 | Subject: [PATCH 5/6] dropbear enable pam | ||
2 | |||
3 | dropbear: We need modify file option.h besides enabling pam in \ | ||
4 | configure if we want dropbear to support pam. | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> | ||
9 | --- | ||
10 | options.h | 4 ++-- | ||
11 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | Index: 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 @@ | |||
1 | Subject: [PATCH 6/6] dropbear configuration file | ||
2 | |||
3 | dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \ | ||
4 | to "/etc/pam.d/dropbear for dropbear when enabling pam supporting" | ||
5 | |||
6 | Upstream-Status: Inappropriate [configuration] | ||
7 | |||
8 | Signed-off-by: Maxin B. John <maxin.john@enea.com> | ||
9 | Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com> | ||
10 | --- | ||
11 | diff -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 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | The dropbearkey utility built in x32 abi format, when generating ssh | ||
4 | keys, was getting lost in the infinite loop. | ||
5 | |||
6 | This patch fixes the issue by fixing types of variables and | ||
7 | parameters of functions used in the code, which were getting | ||
8 | undesired size, when compiled with the x32 abi toolchain. | ||
9 | |||
10 | 2013/05/23 | ||
11 | Received this fix from H J Lu. | ||
12 | |||
13 | Signed-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 | ||
20 | Typdef mp_digit to unsigned long long for MP_64BIT | ||
21 | |||
22 | When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned | ||
23 | long long instead of unsigned long since for x32, unsigned long is | ||
24 | 32-bit and unsigned long long is 64-bit and it is safe to use unsigned | ||
25 | long long for 64-bit integer with GCC. | ||
26 | |||
27 | diff -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 | ||
44 | Cast to mp_digit when updating *rho | ||
45 | |||
46 | There is | ||
47 | |||
48 | int | ||
49 | mp_montgomery_setup (mp_int * n, mp_digit * rho) | ||
50 | |||
51 | We 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 | ||
53 | may be different from unsigned long, like in x32. | ||
54 | |||
55 | diff -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 | ||
72 | Define LTC_FAST_TYPE to unsigned long long for __x86_64__ | ||
73 | |||
74 | We should define LTC_FAST_TYPE to unsigned long long instead of unsigned | ||
75 | long if __x86_64__ to support x32 where unsigned long long is 64-bit | ||
76 | and unsigned long is 32-bit. | ||
77 | |||
78 | diff -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 | ||
95 | Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC | ||
96 | |||
97 | We should use unsigned long long instead of unsigned long as unsigned | ||
98 | 64-bit integer for x86-64 GCC to support x32 where unsigned long is | ||
99 | 32-bit. | ||
100 | |||
101 | diff -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 | |||
3 | auth include common-auth | ||
4 | account 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] | ||
2 | Conflicts=dropbear.service | ||
3 | |||
4 | [Socket] | ||
5 | ListenStream=22 | ||
6 | Accept=yes | ||
7 | |||
8 | [Install] | ||
9 | WantedBy=sockets.target | ||
10 | Also=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] | ||
2 | Description=SSH Per-Connection Server | ||
3 | Wants=dropbearkey.service | ||
4 | After=syslog.target dropbearkey.service | ||
5 | |||
6 | [Service] | ||
7 | EnvironmentFile=-/etc/default/dropbear | ||
8 | ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS | ||
9 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
10 | StandardInput=socket | ||
11 | KillMode=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] | ||
2 | Description=SSH Key Generation | ||
3 | ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key | ||
8 | RemainAfterExit=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 | |||
14 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
15 | DAEMON=/usr/sbin/dropbear | ||
16 | NAME=dropbear | ||
17 | DESC="Dropbear SSH server" | ||
18 | PIDFILE=/var/run/dropbear.pid | ||
19 | |||
20 | DROPBEAR_PORT=22 | ||
21 | DROPBEAR_EXTRA_ARGS= | ||
22 | NO_START=0 | ||
23 | |||
24 | set -e | ||
25 | |||
26 | test ! -r /etc/default/dropbear || . /etc/default/dropbear | ||
27 | test "$NO_START" = "0" || exit 0 | ||
28 | test -x "$DAEMON" || exit 0 | ||
29 | test ! -h /var/service/dropbear || exit 0 | ||
30 | |||
31 | readonly_rootfs=0 | ||
32 | for 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 | ||
38 | done | ||
39 | |||
40 | if [ $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" | ||
44 | else | ||
45 | DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key" | ||
46 | DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key" | ||
47 | fi | ||
48 | |||
49 | test -z "$DROPBEAR_BANNER" || \ | ||
50 | DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER" | ||
51 | test -n "$DROPBEAR_RSAKEY" || \ | ||
52 | DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT | ||
53 | test -n "$DROPBEAR_DSSKEY" || \ | ||
54 | DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT | ||
55 | test -n "$DROPBEAR_KEYTYPES" || \ | ||
56 | DROPBEAR_KEYTYPES="rsa" | ||
57 | |||
58 | gen_keys() { | ||
59 | for 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 | ||
74 | done | ||
75 | } | ||
76 | |||
77 | case "$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 | ;; | ||
111 | esac | ||
112 | |||
113 | exit 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 | ||
2 | cd 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 @@ | |||
1 | require dropbear.inc | ||
2 | |||
3 | SRC_URI[md5sum] = "7066bb9a2da708f3ed06314fdc9c47fd" | ||
4 | SRC_URI[sha256sum] = "595992de432ba586a0e7e191bbb1ad587727678bb3e345b018c395b8c55b57ae" | ||