TPM test fail with CDTS for Ubuntu Hardware Certification
HI ubuntu member
We do a CDTS test then the TPM test item occused some errors.
Please refer the fail items and how to fix it?
tpm2_clockratea
tpm2_createprimary
tpm2_import
tpm2_loadexternal
=======
Test Configure:
=======
Kernel: 5.13.0-1008-intel x86_64
Distro: Ubuntu 20.04.3 LTS (Focal Fossa)
Memory 3.4 GiB
Audio Intel
Graphics Intel
Network Intel
Drives MMC64G 58.27 GiB
=======
=======
tpm2_clockratea
=======
+ source helpers.sh
++ set -E
++ tpm2_test_
++ tpm2_test_cwd=
++ tpm2_sim_pid=
++ tpm2_abrmd_pid=
++ tpm2_tcti_opts=
++ tpm2tools_tcti=
++ sock_tool=unknown
+++ uname
++ OS=Linux
++ '[' Linux == Linux ']'
++ sock_tool='ss -lntp4'
++ trap shut_down EXIT
++ trap onerror ERR
+ trap cleanup EXIT
+ start_up
+ switch_to_test_dir
++ pwd
+ tpm2_test_
++ mktemp -d /tmp/tpm2_
+ tpm2_test_
+ echo 'creating simulator working dir: /tmp/tpm2_
+ pushd /tmp/tpm2_
creating simulator working dir: /tmp/tpm2_
/tmp/tpm2_
++ pwd
+ echo 'Switched to CWD: /tmp/tpm2_
+ run_startup=true
+ export TPM2TOOLS_
+ TPM2TOOLS_
+ '[' true = true ']'
+ tpm2_startup -c
Switched to CWD: /tmp/tpm2_
+ tpm2_clear
+ tpm2_clockratea
WARNING:
ERROR:esys:
ERROR: Esys_ClockRateA
ERROR: Unable to run tpm2_clockratea
++ onerror
++ echo 'tpm2_clockrate
++ exit 1
tpm2_clockratea
+ cleanup
+ tpm2_changeauth -c o -p newowner
+ true
+ tpm2_changeauth -c p -p newplatform
+ true
+ rm -f clock.yaml
+ '[' '' '!=' no-shut-down ']'
+ shut_down
+ switch_
+ popd
+ fail=0
+ '[' -n '' ']'
+ tpm2_abrmd_pid=
+ '[' -n '' ']'
+ tpm2_sim_pid=
+ rm -rf /tmp/tpm2_
/var/snap/cdts/180
+ '[' 0 -ne 0 ']'
=======
=======
tpm2_createprimary fail
=======
+ source helpers.sh
++ set -E
++ tpm2_test_
++ tpm2_test_cwd=
++ tpm2_sim_pid=
++ tpm2_abrmd_pid=
++ tpm2_tcti_opts=
++ tpm2tools_tcti=
++ sock_tool=unknown
+++ uname
++ OS=Linux
++ '[' Linux == Linux ']'
++ sock_tool='ss -lntp4'
++ trap shut_down EXIT
++ trap onerror ERR
+ start_up
+ switch_to_test_dir
++ pwd
+ tpm2_test_
++ mktemp -d /tmp/tpm2_
+ tpm2_test_
+ echo 'creating simulator working dir: /tmp/tpm2_
+ pushd /tmp/tpm2_
creating simulator working dir: /tmp/tpm2_
/tmp/tpm2_
++ pwd
Switched to CWD: /tmp/tpm2_
+ echo 'Switched to CWD: /tmp/tpm2_
+ run_startup=true
+ export TPM2TOOLS_
+ TPM2TOOLS_
+ '[' true = true ']'
+ tpm2_startup -c
+ tpm2_clear
+ trap cleanup EXIT
+ cleanup no-shut-down
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context
++ local n=2
++ local value=keep-context
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 2 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ rm -f context.out
++ ina no-shut-down no-shut-down
++ local n=2
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ populate_hash_algs 'and alg != "keyedhash"'
++ populate_algs 'details[
+++ mktemp
++ algs=/tmp/
++ tpm2_getcap algorithms
++ filter_algs_by /tmp/tmp.fERv3FX4JY 'details[
++ python3
++ rm /tmp/tmp.fERv3FX4JY
+ for gAlg in `populate_hash_algs 'and alg != "keyedhash"'`
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha1 -G rsa -c context.out
+ tpm2_createprimary -Q -g sha1 -G rsa -c context.out
tpm2_createprimary -Q -g sha1 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha1 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha1 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha1 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha1 -G xor -c context.out
+ tpm2_createprimary -Q -g sha1 -G xor -c context.out
tpm2_createprimary -Q -g sha1 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha1 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha1 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha1 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha1 -G ecc -c context.out
+ tpm2_createprimary -Q -g sha1 -G ecc -c context.out
tpm2_createprimary -Q -g sha1 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha1 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha1 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha1 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha1 -G aes -c context.out
+ tpm2_createprimary -Q -g sha1 -G aes -c context.out
tpm2_createprimary -Q -g sha1 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha1 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha1 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha1 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for gAlg in `populate_hash_algs 'and alg != "keyedhash"'`
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha256 -G rsa -c context.out
+ tpm2_createprimary -Q -g sha256 -G rsa -c context.out
tpm2_createprimary -Q -g sha256 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha256 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha256 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha256 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha256 -G xor -c context.out
+ tpm2_createprimary -Q -g sha256 -G xor -c context.out
tpm2_createprimary -Q -g sha256 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha256 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha256 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha256 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
tpm2_createprimary -Q -g sha256 -G ecc -c context.out
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha256 -G ecc -c context.out
+ tpm2_createprimary -Q -g sha256 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha256 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha256 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha256 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
tpm2_createprimary -Q -g sha256 -G aes -c context.out
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha256 -G aes -c context.out
+ tpm2_createprimary -Q -g sha256 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha256 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha256 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha256 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for gAlg in `populate_hash_algs 'and alg != "keyedhash"'`
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha384 -G rsa -c context.out
+ tpm2_createprimary -Q -g sha384 -G rsa -c context.out
tpm2_createprimary -Q -g sha384 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha384 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha384 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha384 -G rsa -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha384 -G xor -c context.out
+ tpm2_createprimary -Q -g sha384 -G xor -c context.out
tpm2_createprimary -Q -g sha384 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha384 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha384 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha384 -G xor -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
tpm2_createprimary -Q -g sha384 -G ecc -c context.out
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha384 -G ecc -c context.out
+ tpm2_createprimary -Q -g sha384 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha384 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha384 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha384 -G ecc -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
tpm2_createprimary -Q -g sha384 -G aes -c context.out
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sha384 -G aes -c context.out
+ tpm2_createprimary -Q -g sha384 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C o -g sha384 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C e -g sha384 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for Atype in o e n
+ tpm2_createprimary -Q -C n -g sha384 -G aes -c context.out
+ cleanup no-shut-down keep-context
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina no-shut-down keep-context keep-context
++ local n=3
++ local value=keep-context
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == keep-context ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' keep-context == keep-context ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina no-shut-down keep-context no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for gAlg in `populate_hash_algs 'and alg != "keyedhash"'`
+ for GAlg in rsa xor ecc aes
+ echo tpm2_createprimary -Q -g sm3_256 -G rsa -c context.out
+ tpm2_createprimary -Q -g sm3_256 -G rsa -c context.out
tpm2_createprimary -Q -g sm3_256 -G rsa -c context.out
ERROR:esys_
ERROR:esys:
ERROR:esys:
ERROR:esys:
ERROR: Esys_CreatePrim
ERROR:esys:
ERROR:esys:
ERROR: Esys_FlushConte
ERROR: Unable to run tpm2_createprimary
++ onerror
++ echo 'tpm2_createprimary -Q -g $gAlg -G $GAlg -c context.out on line 28 failed: 1'
tpm2_createprimary -Q -g $gAlg -G $GAlg -c context.out on line 28 failed: 1
++ exit 1
+ cleanup
+ rm -f policy.bin obj.pub pub.out primary.ctx
++ ina keep-context
++ local n=1
++ local value=keep-context
++ (( i=1 ))
++ (( i < 1 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ rm -f context.out
++ ina no-shut-down
++ local n=1
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 1 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ shut_down
+ switch_
+ popd
+ fail=0
+ '[' -n '' ']'
+ tpm2_abrmd_pid=
+ '[' -n '' ']'
+ tpm2_sim_pid=
+ rm -rf /tmp/tpm2_
/var/snap/cdts/180
+ '[' 0 -ne 0 ']'
=======
=======
tpm2_import fail
=======
+ source helpers.sh
++ set -E
++ tpm2_test_
++ tpm2_test_cwd=
++ tpm2_sim_pid=
++ tpm2_abrmd_pid=
++ tpm2_tcti_opts=
++ tpm2tools_tcti=
++ sock_tool=unknown
+++ uname
++ OS=Linux
++ '[' Linux == Linux ']'
++ sock_tool='ss -lntp4'
++ trap shut_down EXIT
++ trap onerror ERR
+ trap cleanup EXIT
+ start_up
+ switch_to_test_dir
++ pwd
+ tpm2_test_
++ mktemp -d /tmp/tpm2_
+ tpm2_test_
+ echo 'creating simulator working dir: /tmp/tpm2_
+ pushd /tmp/tpm2_
creating simulator working dir: /tmp/tpm2_
/tmp/tpm2_
++ pwd
+ echo 'Switched to CWD: /tmp/tpm2_
Switched to CWD: /tmp/tpm2_
+ run_startup=true
+ export TPM2TOOLS_
+ TPM2TOOLS_
+ '[' true = true ']'
+ tpm2_startup -c
+ tpm2_clear
+ parent_
++ populate_hash_algs 'and alg != "sha1"'
++ populate_algs 'details[
+++ mktemp
++ algs=/tmp/
++ tpm2_getcap algorithms
++ filter_algs_by /tmp/tmp.qxwTcyDC3l 'details[
++ python3
++ rm /tmp/tmp.qxwTcyDC3l
+ halgs='sha256
sha384
sm3_256'
+ echo 'halgs: sha256
sha384
sm3_256'
halgs: sha256
sha384
sm3_256
+ for pa in "${parent_algs[@]}"
+ for name in $halgs
+ is_alg_supported rsa2048:aes128cfb
+ tpm2_testparms rsa2048:aes128cfb
+ return 0
rsa2048:aes128cfb - sha256
+ echo 'rsa2048:aes128cfb - sha256'
+ run_test rsa2048:aes128cfb sha256
+ cleanup no-shut-down
+ rm -f import_key.ctx import_key.name import_key.priv import_key.pub parent.ctx plain.dec.ssl plain.enc plain.txt sym.key import_rsa_key.pub import_rsa_key.priv import_rsa_key.ctx import_rsa_key.name private.pem public.pem plain.rsa.enc plain.rsa.dec public.pem data.in.raw data.in.digest data.out.signed ticket.out ecc.pub ecc.priv ecc.name ecc.ctx private.ecc.pem public.ecc.pem passfile aes.key policy.dat aes.priv aes.pub
+ tpm2_flushcontext -s
+ '[' no-shut-down '!=' no-shut-down ']'
+ parent_
+ name_alg=sha256
+ tpm2_createprimary -Q -G rsa2048:aes128cfb -g sha256 -C o -c parent.ctx
+ is_alg_supported aes128
+ tpm2_testparms aes128
+ return 0
+ run_aes_import_test parent.ctx aes-128-cfb 16
+ dd if=/dev/urandom of=sym.key bs=1 count=16
+ echo 'tpm2_import -Q -G aes -g sha256 -i sym.key -C parent.ctx -u import_key.pub -r import_key.priv'
+ tpm2_import -Q -G aes -g sha256 -i sym.key -C parent.ctx -u import_key.pub -r import_key.priv
tpm2_import -Q -G aes -g sha256 -i sym.key -C parent.ctx -u import_key.pub -r import_key.priv
+ tpm2_load -Q -C parent.ctx -u import_key.pub -r import_key.priv -n import_key.name -c import_key.ctx
+ echo plaintext
+ is_cmd_supported EncryptDecrypt
+ tpm2_getcap commands
+ grep -i EncryptDecrypt:
+ return 0
+ tpm2_encryptdecrypt -c import_key.ctx -o plain.enc plain.txt
WARN: Using a weak IV, try specifying an IV
++ xxd -c 256 -p sym.key
+ openssl enc -in plain.enc -out plain.dec.ssl -d -K 9e3ddb42a58a233
hex string is too short, padding with zero bytes to length
+ diff plain.txt plain.dec.ssl
+ rm import_key.ctx
+ is_alg_supported aes256
+ tpm2_testparms aes256
+ return 0
+ run_aes_import_test parent.ctx aes-256-cfb 32
+ dd if=/dev/urandom of=sym.key bs=1 count=32
+ echo 'tpm2_import -Q -G aes -g sha256 -i sym.key -C parent.ctx -u import_key.pub -r import_key.priv'
+ tpm2_import -Q -G aes -g sha256 -i sym.key -C parent.ctx -u import_key.pub -r import_key.priv
tpm2_import -Q -G aes -g sha256 -i sym.key -C parent.ctx -u import_key.pub -r import_key.priv
+ tpm2_load -Q -C parent.ctx -u import_key.pub -r import_key.priv -n import_key.name -c import_key.ctx
+ echo plaintext
+ is_cmd_supported EncryptDecrypt
+ tpm2_getcap commands
+ grep -i EncryptDecrypt:
+ return 0
+ tpm2_encryptdecrypt -c import_key.ctx -o plain.enc plain.txt
WARN: Using a weak IV, try specifying an IV
++ xxd -c 256 -p sym.key
+ openssl enc -in plain.enc -out plain.dec.ssl -d -K 570fdee788c7b79
hex string is too short, padding with zero bytes to length
+ diff plain.txt plain.dec.ssl
+ rm import_key.ctx
+ run_rsa_import_test parent.ctx 1024
+ openssl genrsa -out private.pem 1024
Generating RSA private key, 1024 bit long modulus (2 primes)
.......
..............+++++
e is 65537 (0x010001)
+ openssl rsa -in private.pem -pubout
writing RSA key
+ tpm2_import -Q -G rsa -g sha256 -i private.pem -C parent.ctx -u import_rsa_key.pub -r import_rsa_key.priv
WARNING:
ERROR:esys:
ERROR: Esys_HMAC(0x2C4) - tpm:parameter(
ERROR: Unable to run tpm2_import
++ onerror
++ echo 'tpm2_import -Q -G rsa -g "$name_alg" -i private.pem -C $1 -u import_rsa_key.pub -r import_rsa_key.priv on line 68 failed: 1'
tpm2_import -Q -G rsa -g "$name_alg" -i private.pem -C $1 -u import_rsa_key.pub -r import_rsa_key.priv on line 68 failed: 1
++ exit 1
+ cleanup
+ rm -f import_key.ctx import_key.name import_key.priv import_key.pub parent.ctx plain.dec.ssl plain.enc plain.txt sym.key import_rsa_key.pub import_rsa_key.priv import_rsa_key.ctx import_rsa_key.name private.pem public.pem plain.rsa.enc plain.rsa.dec public.pem data.in.raw data.in.digest data.out.signed ticket.out ecc.pub ecc.priv ecc.name ecc.ctx private.ecc.pem public.ecc.pem passfile aes.key policy.dat aes.priv aes.pub
+ tpm2_flushcontext -s
+ '[' '' '!=' no-shut-down ']'
+ shut_down
+ switch_
+ popd
+ fail=0
+ '[' -n '' ']'
+ tpm2_abrmd_pid=
+ '[' -n '' ']'
+ tpm2_sim_pid=
+ rm -rf /tmp/tpm2_
/var/snap/cdts/180
+ '[' 0 -ne 0 ']'
=======
=======
tpm2_loadexternal fail
=======
+ source helpers.sh
++ set -E
++ tpm2_test_
++ tpm2_test_cwd=
++ tpm2_sim_pid=
++ tpm2_abrmd_pid=
++ tpm2_tcti_opts=
++ tpm2tools_tcti=
++ sock_tool=unknown
+++ uname
++ OS=Linux
++ '[' Linux == Linux ']'
++ sock_tool='ss -lntp4'
++ trap shut_down EXIT
++ trap onerror ERR
+ alg_primary_
+ alg_primary_key=rsa
+ alg_create_
+ alg_create_key=hmac
+ file_primary_
+ file_loadextern
+ file_loadextern
+ file_loadextern
+ file_loadextern
+ file_loadextern
+ Handle_
+ trap cleanup EXIT
+ start_up
+ switch_to_test_dir
++ pwd
+ tpm2_test_
++ mktemp -d /tmp/tpm2_
+ tpm2_test_
+ echo 'creating simulator working dir: /tmp/tpm2_
creating simulator working dir: /tmp/tpm2_
+ pushd /tmp/tpm2_
/tmp/tpm2_
++ pwd
+ echo 'Switched to CWD: /tmp/tpm2_
Switched to CWD: /tmp/tpm2_
+ run_startup=true
+ export TPM2TOOLS_
+ TPM2TOOLS_
+ '[' true = true ']'
+ tpm2_startup -c
+ tpm2_clear
+ cleanup no-shut-down
+ rm -f context.
++ ina no-shut-down keep_handle
++ local n=2
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == keep_handle ']'
++ (( i++ ))
++ (( i < 2 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ tpm2_evictcontrol -Q -Co -c 0x81010019
+ true
++ ina no-shut-down no-shut-down
++ local n=2
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ tpm2_clear
+ run_tss_test
+ tpm2_createprimary -Q -C e -g sha256 -G rsa -c context.
+ tpm2_create -Q -g sha256 -G hmac -u opu_sha256_hmac -r opr_sha256_hmac -C context.
+ tpm2_loadexternal -Q -C n -u opu_sha256_hmac -c ctx_loadexterna
+ tpm2_evictcontrol -Q -C o -c context.
+ cleanup keep_handle no-shut-down
+ rm -f context.
++ ina keep_handle no-shut-down keep_handle
++ local n=3
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 3 ))
++ '[' keep_handle == keep_handle ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina keep_handle no-shut-down no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' keep_handle == no-shut-down ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ tpm2_create -Q -C 0x81010019 -g sha256 -G hmac -u opu_sha256_hmac -r opr_sha256_hmac
+ tpm2_loadexternal -Q -C n -u opu_sha256_hmac -c ctx_loadexterna
+ cleanup keep_handle no-shut-down
+ rm -f context.
++ ina keep_handle no-shut-down keep_handle
++ local n=3
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 3 ))
++ '[' keep_handle == keep_handle ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
++ ina keep_handle no-shut-down no-shut-down
++ local n=3
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 3 ))
++ '[' keep_handle == no-shut-down ']'
++ (( i++ ))
++ (( i < 3 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ tpm2_create -Q -C 0x81010019 -g sha256 -G hmac -u opu_sha256_hmac -r opr_sha256_hmac
+ tpm2_loadexternal -Q -u opu_sha256_hmac -c ctx_loadexterna
+ cleanup no-shut-down
+ rm -f context.
++ ina no-shut-down keep_handle
++ local n=2
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == keep_handle ']'
++ (( i++ ))
++ (( i < 2 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ tpm2_evictcontrol -Q -Co -c 0x81010019
++ ina no-shut-down no-shut-down
++ local n=2
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ for len in "1024 2048"
+ is_alg_supported 'rsa1024 2048'
+ tpm2_testparms rsa1024 2048
+ is_simulator
+ tpm2_getcap properties-fixed
+ grep -zP 'TPM2_PT_
+ echo 'SKIP: Testing on a non-simulator TPM. Skipping unsupported algorithm rsa1024 2048'
+ return 1
+ for len in "128 256"
+ is_alg_supported 'aes128 256'
+ tpm2_testparms aes128 256
SKIP: Testing on a non-simulator TPM. Skipping unsupported algorithm rsa1024 2048
+ return 0
+ run_aes_test 128 256
+ dd if=/dev/urandom of=sym.key bs=1 count=16
+ tpm2_loadexternal -G aes -r sym.key -n name.bin -c key.ctx
++ yaml_get_kv stdout.yaml name
++ third_arg=
++ '[' 2 -eq 3 ']'
++ python3
+ local name1=000b84e35
++ xxd -c 256 -p name.bin
+ local name2=000b84e35
+ test 000b84e352f05b8
+ echo plaintext
+ is_cmd_supported EncryptDecrypt
+ tpm2_getcap commands
+ grep -i EncryptDecrypt:
+ return 0
+ tpm2_encryptdecrypt -c key.ctx -o plain.enc plain.txt
WARN: Using a weak IV, try specifying an IV
++ xxd -c 256 -p sym.key
+ openssl enc -in plain.enc -out plain.dec.ssl -d -K ba9b5a253d96330
hex string is too short, padding with zero bytes to length
+ diff plain.txt plain.dec.ssl
+ cleanup no-shut-down
+ rm -f context.
++ ina no-shut-down keep_handle
++ local n=2
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == keep_handle ']'
++ (( i++ ))
++ (( i < 2 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ tpm2_evictcontrol -Q -Co -c 0x81010019
+ true
++ ina no-shut-down no-shut-down
++ local n=2
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ is_alg_supported ecc256
+ tpm2_testparms ecc256
+ return 0
+ run_ecc_test prime256v1
+ openssl ecparam -name prime256v1 -genkey -noout -out private.ecc.pem
+ openssl ec -in private.ecc.pem -out public.ecc.pem -pubout
read EC key
writing EC key
+ echo 'data to sign'
+ shasum -a 256 data.in.raw
+ awk '{ print "000000 " $1 }'
+ xxd -r -c 32
+ tpm2_loadexternal -Q -G ecc -r private.ecc.pem -c key.ctx
+ tpm2_sign -Q -c key.ctx -g sha256 -d -f plain -o data.out.signed data.in.digest
+ openssl dgst -verify public.ecc.pem -keyform pem -sha256 -signature data.out.signed data.in.raw
Verified OK
+ tpm2_loadexternal -Q -G ecc -u public.ecc.pem -c key.ctx
+ openssl dgst -sha256 -sign private.ecc.pem -out data.out.signed data.in.raw
+ tpm2_verifysign
+ cleanup no-shut-down
+ rm -f context.
++ ina no-shut-down keep_handle
++ local n=2
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == keep_handle ']'
++ (( i++ ))
++ (( i < 2 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ tpm2_evictcontrol -Q -Co -c 0x81010019
+ true
++ ina no-shut-down no-shut-down
++ local n=2
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 2 ))
++ '[' no-shut-down == no-shut-down ']'
++ echo 0
++ return
+ '[' 0 -ne 0 ']'
+ run_rsa_passin_test private.pem pass:mypassword
+ openssl genrsa -aes128 -passout pass:mypassword -out private.pem 1024
Generating RSA private key, 1024 bit long modulus (2 primes)
........+++++
..............+++++
e is 65537 (0x010001)
+ '[' pass:mypassword '!=' stdin ']'
+ cmd='tpm2_
+ eval tpm2_loadexternal -Q -G rsa -r private.pem -c key.ctx --passin pass:mypassword
++ tpm2_loadexternal -Q -G rsa -r private.pem -c key.ctx --passin pass:mypassword
WARNING:
ERROR:esys:
ERROR: Esys_LoadExtern
ERROR: Unable to run tpm2_loadexternal
+++ onerror
+++ echo 'tpm2_loadexternal -Q -G rsa -r private.pem -c key.ctx --passin pass:mypassword on line 197 failed: 1'
+++ exit 1
+ cleanup
+ rm -f context.
tpm2_loadexternal -Q -G rsa -r private.pem -c key.ctx --passin pass:mypassword on line 197 failed: 1
++ ina keep_handle
++ local n=1
++ local value=keep_handle
++ (( i=1 ))
++ (( i < 1 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ tpm2_evictcontrol -Q -Co -c 0x81010019
+ true
++ ina no-shut-down
++ local n=1
++ local value=no-shut-down
++ (( i=1 ))
++ (( i < 1 ))
++ echo 1
+ '[' 1 -ne 0 ']'
+ shut_down
+ switch_
+ popd
/var/snap/cdts/180
+ fail=0
+ '[' -n '' ']'
+ tpm2_abrmd_pid=
+ '[' -n '' ']'
+ tpm2_sim_pid=
+ rm -rf /tmp/tpm2_
+ '[' 0 -ne 0 ']'
=======
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Allumallu Susmitha for more information if necessary.