Skip to content

Commit

Permalink
change inclusion of library files to a more general solution
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPawn committed Nov 18, 2016
1 parent 8bda954 commit 6b284cf
Show file tree
Hide file tree
Showing 14 changed files with 212 additions and 14 deletions.
6 changes: 6 additions & 0 deletions encryption/b32_to_hex.sh
@@ -0,0 +1,6 @@
#! /bin/sh
. ${YF_SCRIPT_DIR:-.}/yf_helpers
while read length enc_length encoded; do
hex=$(echo -n "$encoded" | base32.py decode | yf_bin2hex)
echo -e "$length\t$(( ${#hex} / 2 ))\t$hex"
done
106 changes: 106 additions & 0 deletions encryption/hex_105.txt

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions eva_tools/eva_discover
Expand Up @@ -117,8 +117,7 @@ discovery_interval=1
# #
# include YourFritz shell library functions # include YourFritz shell library functions
# #
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
# #
# debug output # debug output
# #
Expand Down
8 changes: 8 additions & 0 deletions helpers/sync_lib.sh
@@ -0,0 +1,8 @@
#! /bin/sh
[ "$1" = do ] && n="" || n="n"
printf "Sync to FB7490 ...\n"
rsync -a${n}P functions/ /ssh/fb7490/var/media/ftp/root/bin/functions/
printf "Sync to modfs repository ...\n"
rsync -a${n}P functions/ ../../modfs/bin/scripts/functions/
printf "creating archive to deploy ...\n"
tar -c -v -f shell_lib.tar yf_helpers functions
17 changes: 17 additions & 0 deletions mitmproxy-ca.pem
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE-----
MIICnzCCAgigAwIBAgIGDMvBfzHgMA0GCSqGSIb3DQEBBQUAMCgxEjAQBgNVBAMM
CW1pdG1wcm94eTESMBAGA1UECgwJbWl0bXByb3h5MB4XDTE0MDgwMTIwNTM0M1oX
DTE2MDcyMTIwNTM0M1owKDESMBAGA1UEAwwJbWl0bXByb3h5MRIwEAYDVQQKDAlt
aXRtcHJveHkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAN/jZY0V1IHXX9fD
Z+GfLlb0Q2m7jGZh5OBMKTvrqh32t1mhhMOMMjcPkEbBswDRNvB0vBoSfKLo6Jbq
8FVgO/2PutEgoL3EA3u43HZHRZSKX5Q7Kd6jpnxAstK/psLnUrOA3Kli/seIi8Io
r+t+lC/sJKgD8bgI5ZZBA1PNgPRxAgMBAAGjgdMwgdAwDwYDVR0TAQH/BAUwAwEB
/zAUBglghkgBhvhCAQEBAf8EBAMCAgQwewYDVR0lAQH/BHEwbwYIKwYBBQUHAwEG
CCsGAQUFBwMCBggrBgEFBQcDBAYIKwYBBQUHAwgGCisGAQQBgjcCARUGCisGAQQB
gjcCARYGCisGAQQBgjcKAwEGCisGAQQBgjcKAwMGCisGAQQBgjcKAwQGCWCGSAGG
+EIEATALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFIqmFUYQeKMyL5SYu6fJO64b4PEQ
MA0GCSqGSIb3DQEBBQUAA4GBANyD2tqAESKk9SUNIZg+ngIzeWoJRNMMPMv8DGuC
Eq12VR6qu8uFPihsaDT7Zo789K5CcKjnCBMXQz9pPyyLtUG7juBVY0RTi+kvZ5tM
SryHn2axHRxFnGwzpZ3zAVmufMMC7dho7C9/TrMlq06+uyvloCBTdTV726gOiOIs
b5Ry
-----END CERTIFICATE-----
3 changes: 1 addition & 2 deletions tffs/build_tffs_image
Expand Up @@ -20,8 +20,7 @@
# helper functions # helper functions
# #
################################################################################## ##################################################################################
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
################################################################################## ##################################################################################
# #
# create the image now # create the image now
Expand Down
68 changes: 68 additions & 0 deletions tffs/build_wrong_tffs_image
@@ -0,0 +1,68 @@
#! /bin/sh
##################################################################################
#
# prepare a full TFFS image containing the name table, the environment settings
# and the counters
#
# Parameters:
#
# $1 - path to name table file
# $2 - path to environment file
# $3 - path to counters file
# $n - additional file(s) to be included; the TFFS node ID is determined by the
# name of the file (that means, it has to be the 4-character hexadecimal ID
# to be used, e.g. 001d for "provider_addtive.tar") and the content has to be
# the (zlib) deflated text (or binary data); the name may carry any suffix
# as "extension" - "001d.bin" is a valid one.
#
##################################################################################
#
# helper functions
#
##################################################################################
. ${YF_SCRIPT_DIR:-.}/yf_helpers
##################################################################################
#
# create the image now
#
##################################################################################
#
# segment header with the earliest value, will be incremented with each new
# version written to TFFS
#
yf_pack B16 1 B16 4 8 255 8 255 8 255 8 254
#
# add name table
#
cat $4
#
# add environment
#
environment_to_tffs "$1" <"$2"
#
# add counters
#
counter_to_tffs <"$3"
#
# add optional files
#
shift 4
for name in $*; do
id="${name##*/}"
id="${id%%.*}"
content="$(cat "$name" | yf_bin2hex)"
len=$(( ${#content} / 2 ))
out="$id$(yf_dec2hex $len 2)$content"
fill=$(( ( ( len + 3 ) & ~3 ) - len ))
while [ $fill -gt 0 ]; do
out="${out}00"
fill=$(( fill - 1 ))
done
yf_hex2bin "$out"
done
##################################################################################
#
# regular end of script reached
#
##################################################################################
exit 0
3 changes: 1 addition & 2 deletions tffs/counter_to_tffs
Expand Up @@ -36,8 +36,7 @@ cntfile=$tmpdir/counter
# helper functions # helper functions
# #
################################################################################## ##################################################################################
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
################################################################################## ##################################################################################
# #
# cleanup at exit # cleanup at exit
Expand Down
3 changes: 1 addition & 2 deletions tffs/dissect_tffs_dump
Expand Up @@ -42,8 +42,7 @@ tffsdump=$tmpdir/tffsdump
# helper functions # helper functions
# #
################################################################################## ##################################################################################
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
################################################################################## ##################################################################################
# #
# create temporary directory and store stdin (it contains our TFFS dump file) # create temporary directory and store stdin (it contains our TFFS dump file)
Expand Down
3 changes: 1 addition & 2 deletions tffs/environment_to_tffs
Expand Up @@ -39,8 +39,7 @@ envfile=$tmpdir/environment
# helper functions # helper functions
# #
################################################################################## ##################################################################################
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
################################################################################## ##################################################################################
# #
# check, if our name table is present # check, if our name table is present
Expand Down
Binary file added tffs/malformed_name_table
Binary file not shown.
Binary file added tffs/malformed_tffs_image.bin
Binary file not shown.
3 changes: 1 addition & 2 deletions tffs/nametable_to_tffs
Expand Up @@ -25,8 +25,7 @@
# helper functions # helper functions
# #
################################################################################## ##################################################################################
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
################################################################################## ##################################################################################
# #
# fixed identifiers # fixed identifiers
Expand Down
3 changes: 1 addition & 2 deletions tffs/tffs_add_file
Expand Up @@ -10,8 +10,7 @@
# include shell library # # include shell library #
# # # #
####################################################################################### #######################################################################################
YF_SCRIPT_DIR="." . ${YF_SCRIPT_DIR:-.}/yf_helpers
. yf_helpers
####################################################################################### #######################################################################################
# # # #
# constants # # constants #
Expand Down

0 comments on commit 6b284cf

Please sign in to comment.