~jocave/checkbox/hybrid-amd-gpu-mods

« back to all changes in this revision

Viewing changes to providers/plainbox-provider-tpm2/bin/test_algs_tpm2_sign.sh

  • Committer: Sylvain Pineau
  • Author(s): Sylvain Pineau
  • Date: 2016-05-09 22:02:27 UTC
  • mfrom: (4323.2.1 launchpad/tpm2-provider)
  • Revision ID: sylvain_pineau-20160509220227-wt2e8boo9ktitvzl
"automatic merge of lp:~sylvain-pineau/checkbox/tpm2-provider/ by tarmac [r=sylvain-pineau][bug=][author=sylvain-pineau]"

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
##before this script, you should make sure all kinds of context already loaded 
 
4
 
 
5
context_p=
 
6
halg=
 
7
 
 
8
ctx_count=`ls |grep -c context_load`
 
9
if [ $ctx_count -le 1 ];then
 
10
        echo "we should execute test_algs.sh first!"
 
11
        wait 5
 
12
    ./test_algs.sh
 
13
fi
 
14
 
 
15
rm test_algs_sign_*.log sign_*
 
16
 
 
17
#for  halg_p in 0x0004 0x000B 0x000C 0x000D 0x0012  
 
18
for  context_p in `ls context_load*`   
 
19
  do
 
20
   for halg in 0x0004 0x000B 0x000C
 
21
     do
 
22
        
 
23
   tpm2_sign -c $context_p  -g $halg  -m secret.data -s sign_"$context_p"_"$halg_h"_"$halg"
 
24
        if [ $? != 0 ];then
 
25
        echo "sign for sign_"$context_p"_"$halg"  fail, please check the environment or parameters!"
 
26
        echo " sign for sign_"$context_p"_"$halg" fail" >>test_algs_sign_error.log
 
27
        else
 
28
        echo "sign for sign_"$context_p"_"$halg"  pass" >>test_algs_sign_pass.log
 
29
   fi
 
30
 
 
31
 done
 
32
done