[oe-commits] [openembedded-core] 04/62: dropbear/init: Allow extra arguments for key generation

git at git.openembedded.org git at git.openembedded.org
Wed Aug 17 09:36:21 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit c0efbcb47ab37c2d9c298fcd40ecaadd3ca050a7
Author: Mike Looijmans <mike.looijmans at topic.nl>
AuthorDate: Tue Aug 9 14:19:00 2016 +0200

    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.
    
    Signed-off-by: Mike Looijmans <mike.looijmans at topic.nl>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-core/dropbear/dropbear/init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init
index e8fed3f..434bd6b 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
         if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
                 rm $DROPBEAR_RSAKEY || true
         fi
-        test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
+        test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
 	;;
     dsa)
         if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
                 rm $DROPBEAR_DSSKEY || true
         fi
-        test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
+        test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY $DROPBEAR_DSSKEY_ARGS
 	;;
   esac
 done

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list