From 07675caeb28c45d4c2bae13554db463d1c7ff9bf Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Fri, 5 Aug 2011 19:24:58 +0200 Subject: [PATCH 1/2] Make lcdBacklight changes work --- firmware/basic/config.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/basic/config.c b/firmware/basic/config.c index b315cc3..e085228 100644 --- a/firmware/basic/config.c +++ b/firmware/basic/config.c @@ -44,7 +44,10 @@ char nickl0[FILENAMELEN]; void applyConfig(){ if(GLOBAL(lcdcontrast)>0) lcdSetContrast(GLOBAL(lcdcontrast)); - enableConfig(CFG_TYPE_DEVEL,GLOBAL(develmode)); + if(GLOBAL(develmode)) + enableConfig(CFG_TYPE_DEVEL,1); + if(isNight()) + backlightSetBrightness(GLOBAL(lcdbacklight)); }; int saveConfig(void){ From 019fa4ac88f394aa1b8325b277f2dd04b43d7352 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Fri, 5 Aug 2011 19:55:29 +0200 Subject: [PATCH 2/2] ENCRYPT. WE ARE APPLE! :-) --- firmware/.gitignore | 1 + firmware/SECRETS | 2 ++ firmware/getkey.pl | 23 +++++++++++++++++++++++ firmware/release-all | 20 ++++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100755 firmware/getkey.pl diff --git a/firmware/.gitignore b/firmware/.gitignore index 5323c83..d2d2dd6 100644 --- a/firmware/.gitignore +++ b/firmware/.gitignore @@ -6,3 +6,4 @@ lcd/allfonts.h Makefile.dep table.c table.h +SECRETS.release diff --git a/firmware/SECRETS b/firmware/SECRETS index 3f5f8c2..3ea9057 100644 --- a/firmware/SECRETS +++ b/firmware/SECRETS @@ -1,6 +1,8 @@ #ifndef _SECRETS_ #define _SECRETS_ +#undef ENCRYPT_L0DABLE + static uint32_t const meshkey[4] = { 0x00000042, 0x000005ec, 0x00000023, 0x00000005 }; diff --git a/firmware/getkey.pl b/firmware/getkey.pl new file mode 100755 index 0000000..4611ed9 --- /dev/null +++ b/firmware/getkey.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl +# +# vim:set ts=4 sw=4: + +use strict; + +my $good; + +my $search=shift; + +open(F,"<","SECRETS") || die; + +while(){ + chomp;s///; + if($good){ + s/0x//g;y/ ,;//d; + print $_,"\n"; + exit; + }; + if(/$search/){ + $good=1; + }; +}; diff --git a/firmware/release-all b/firmware/release-all index 46d34be..e54b5c2 100755 --- a/firmware/release-all +++ b/firmware/release-all @@ -69,8 +69,28 @@ mv l0dable/*.c0d $TARG/files/ mv l0dable/*.int $TARG/files/ mv l0dable/*.nik $TARG/files/ +skey=`./getkey.pl l0dable_sign` +ekey=`./getkey.pl l0dable_crypt` + +if [ -z "$ekey" ] ; then + echo E-Key fail + exit 1 +fi + +if [ -z "$skey" ] ; then + echo S-Key fail + exit 1 +fi + +for a in $TARG/files/*.c0d $TARG/files/*.int $TARG/files/*.nik ; do + echo Crypting $a + ../tools/crypto/xxtea -e -k $ekey -s -k $skey $a +done + + echo "###" echo "### Done. Yay!" echo "###" git checkout SECRETS +git checkout filesystem/ffconf.h