Changes between Version 11 and Version 12 of SCU


Ignore:
Timestamp:
Oct 5, 2010, 4:53:36 PM (14 years ago)
Author:
fornasiero
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SCU

    v11 v12  
    196196where <untagged file> usually is the application binary file, and <tagged file> is the file obtained using the SecurityTaggerV0 tool.
    197197This tool simply calculates the difference between the size of these two files, to obtain the size of the security tags. This size can then be used as the parameter to provide to the FlashManager tool.
     198
     199
     200==== Complete example
     201
     202The following script (containing pseudocode instructions) executes all the operations necessary for the network deployment, and for a subsequent Secure Code update operation.
     203
     204{{{
     205
     206source init_variables_scu.sh
     207
     208# Compile tools
     209
     210cd scu-contrib/apps/KeyVolumeManager/
     211make telosb
     212cd -
     213
     214cd scu-contrib/apps/FlashManager/
     215make telosb
     216cd -
     217
     218# Generate keys
     219
     220java net.tinyos.signet.SynapseKeyStorage -generate 80 30 128 128 $HOME/synapse-secret-keys.xml
     221java net.tinyos.signet.SynapseKeyStorage -get-public $HOME/synapse-secret-keys.xml $HOME/synapse-public-keys.bin
     222
     223# Store keys on nodes
     224
     225foreach node; do
     226        cd scu-contrib/apps/KeyVolumeManager/
     227        make telosb reinstall.$NODE_ID bsl,$NODE_LOCATION
     228        cd -
     229
     230        java net.tinyos.signet.KeyVolumeManagerClient -comm serial@$NODE_LOCATION:telosb -progress -upload $HOME/synapse-public-keys.bin
     231done
     232
     233# Install Synapse on nodes
     234cd scu-contrib/apps/Synapse/
     235make SECURITY_BITS=80 SECURITY_BITS_LOG=7 IS_NODE=TRUE USE_AUTHENTICATION=TRUE USE_ENCRYPTION=TRUE USE_DOS_PROTECTION=TRUE telosb
     236foreach node; do
     237        make telosb reinstall.$NODE_ID bsl,$NODE_LOCATION
     238done
     239cd -
     240
     241# Extract binary from ihex
     242scu-contrib/tos/lib/signet/synapse/scripts/ihex_to_binary.sh $APPLICATION_PATH/main.ihex
     243
     244# Encrypt binary
     245java net.tinyos.signet.SecurityEncrypterV0 $HOME/synapse-secret-keys.xml $APPLICATION_PATH/main.ihex.compact.binary $APPLICATION_PATH/main.encrypted
     246
     247# Generate authentication tags
     248java net.tinyos.signet.SecurityTaggerV0 -sign $HOME/synapse-secret-keys.xml 800 $APPLICATION_PATH/main.encrypted $APPLICATION_PATH/main.signed [-update-keys [-low-overhead]] [-use-key-refresh] ]
     249
     250# Upload on Base station, formatting flash
     251cd scu-contrib/apps/FlashManager/
     252make telosb reinstall.$BS_ID bsl,$BS_LOCATION
     253cd -
     254java net.tinyos.signet.FlashManagerClient -comm serial@$NODE_LOCATION:telosb -progress -print-table -format -writefile $APP_ID $APPLICATION_PATH/main.signed $(scu-contrib/tos/lib/signet/synapse/scripts/get_tags_size.sh $APPLICATION_PATH/main.signed $APPLICATION_PATH/main.ihex.compact.binary)
     255
     256# Install Synapse on Base station
     257cd scu-contrib/apps/Synapse/
     258make SECURITY_BITS=80 SECURITY_BITS_LOG=7 IS_BASESTATION=TRUE USE_AUTHENTICATION=TRUE USE_ENCRYPTION=TRUE USE_DOS_PROTECTION=TRUE telosb
     259make telosb reinstall.$BS_ID bsl,$BS_LOCATION
     260cd -
     261
     262# Format network
     263java net.tinyos.signet.Suino -comm serial@$BS_LOCATION:telosb --prepare
     264java net.tinyos.signet.Suino -comm serial@$BS_LOCATION:telosb --format
     265sleep 80000 # Wait 80s for format execution
     266
     267# Disseminate application
     268java net.tinyos.signet.Suino -comm serial@$BS_LOCATION:telosb --transfer $APP_ID
     269
     270# Load disseminated application
     271java net.tinyos.signet.Suino -comm serial@$BS_LOCATION:telosb --prepare
     272java net.tinyos.signet.Suino -comm serial@$BS_LOCATION:telosb --load $APP_ID
     273
     274}}}