ENCRYPT. WE ARE APPLE! :-)

This commit is contained in:
Stefan `Sec` Zehl 2011-08-05 19:55:29 +02:00
parent 07675caeb2
commit 019fa4ac88
4 changed files with 46 additions and 0 deletions

1
firmware/.gitignore vendored
View File

@ -6,3 +6,4 @@ lcd/allfonts.h
Makefile.dep
table.c
table.h
SECRETS.release

View File

@ -1,6 +1,8 @@
#ifndef _SECRETS_
#define _SECRETS_
#undef ENCRYPT_L0DABLE
static uint32_t const meshkey[4] = {
0x00000042, 0x000005ec, 0x00000023, 0x00000005
};

23
firmware/getkey.pl Executable file
View File

@ -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(<F>){
chomp;s///;
if($good){
s/0x//g;y/ ,;//d;
print $_,"\n";
exit;
};
if(/$search/){
$good=1;
};
};

View File

@ -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