diff options
author | Mike Looijmans <mike.looijmans@topic.nl> | 2016-08-09 14:19:00 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:39 +0100 |
commit | 23afc338f64cea40f0fd7ab350dc7c61a80ed5fd (patch) | |
tree | e8ae6e0f1b855dc46f0319bd05ba0b22860da079 /meta/recipes-core | |
parent | 4f9ddb6e90e5d49441406baefccd791556769013 (diff) | |
download | poky-23afc338f64cea40f0fd7ab350dc7c61a80ed5fd.tar.gz |
dropbear/init: Allow extra arguments for key generation
This patch adds DROPBEAR_RSAKEY_ARGS and DROPBEAR_DSSKEY_ARGS optional
parameters to /etc/default/dropbear. The contents are simply passed to
the 'dropbearkey' program when generating a host key.
The default keysize for RSA is currently 2048 bits. It takes a CortexA9
running at 700MHz between 4 and 10 seconds to calculate a keypair. The
board boots Linux in about a second, but you have to wait for several
seconds because of the keypair generation. This patch allows one to put
the line DROPBEAR_RSAKEY_ARGS="-s 1024" into /etc/default/dropbear, and
have a host key generated in about 0.2 seconds on the same CPU. This is
particulary useful for read-only rootfs systems which generate a key on
each boot.
(From OE-Core rev: c0efbcb47ab37c2d9c298fcd40ecaadd3ca050a7)
Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rwxr-xr-x | meta/recipes-core/dropbear/dropbear/init | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init index e8fed3f94d..434bd6b971 100755 --- a/meta/recipes-core/dropbear/dropbear/init +++ b/meta/recipes-core/dropbear/dropbear/init | |||
@@ -62,13 +62,13 @@ for t in $DROPBEAR_KEYTYPES; do | |||
62 | if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then | 62 | if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then |
63 | rm $DROPBEAR_RSAKEY || true | 63 | rm $DROPBEAR_RSAKEY || true |
64 | fi | 64 | fi |
65 | test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY | 65 | test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS |
66 | ;; | 66 | ;; |
67 | dsa) | 67 | dsa) |
68 | if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then | 68 | if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then |
69 | rm $DROPBEAR_DSSKEY || true | 69 | rm $DROPBEAR_DSSKEY || true |
70 | fi | 70 | fi |
71 | test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY | 71 | test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY $DROPBEAR_DSSKEY_ARGS |
72 | ;; | 72 | ;; |
73 | esac | 73 | esac |
74 | done | 74 | done |