author | Pengguang Zhu <pengguang.zhu@amlogic.com> | 2017-05-03 05:29:37 (GMT) |
---|---|---|
committer | Pengguang Zhu <pengguang.zhu@amlogic.com> | 2017-05-16 02:45:47 (GMT) |
commit | fb90c6707306080b11964c8b62c2963057766394 (patch) | |
tree | 93a008248a4747e0f3f0fcbc9a5aa775650f0850 | |
parent | 05179277ff9a7c18953a513b3f7c4ac64cf6e01d (diff) | |
download | tdk-fb90c6707306080b11964c8b62c2963057766394.zip tdk-fb90c6707306080b11964c8b62c2963057766394.tar.gz tdk-fb90c6707306080b11964c8b62c2963057766394.tar.bz2 |
update ta_export, ca_export, bl32
bl32 commit: 0179df88b6e5cb3025845a675e9cd57b0d4dbf86
Change-Id: I68017d07b792d45aec74a26cfa36fdd6303e5327
59 files changed, 11554 insertions, 10057 deletions
diff --git a/ca_export_arm/bin/tee-supplicant b/ca_export_arm/bin/tee-supplicant index 8ab9fee..6678a62 100755 --- a/ca_export_arm/bin/tee-supplicant +++ b/ca_export_arm/bin/tee-supplicant @@ -1,55 +1,71 @@ -ELF - - -#sFFpG +ELF + + + +#sFFpG +#sFFpG +#sFFpG +K{DFK{DFn"K{D@{hh`{h3FohFF +K{DFK{DFz"
K{D{hhZ{h`{hh`{h3F=hFF +K{Dh{h`K{Dzh`K{DF K{D -JzD`{i -F -K{DF!@#DO3 +JzD`{i +F +K{DF!@# F -F -K{DF!Or#O3 +F +K{DF!Or#z +xhVF۲ ++eQ# DG- +#s0 F -F -`` -FOQnK{DF#hT\ -h`Rh -;h -K{Dpxa{i -;FS`RhFWF -Sh -;FLS`RhFWF] -JzDFFiF -#s -Sh#s;h@RhF# - -*rP"D -{h[hFhF#sFFx`K{Dh?K{Dzh`K{Dh{hBK{D -!Or# -F -F;h!xh9h"fFx`9`{h -+@ɀi#FFi#F{a{i1FF{{;+aQ# DG -F -F -F -F +F +FJzD +`` +FOQnK{DF#hb\ +h`Rh +;h +K{D~xa{i +;FS`RhFWF +Sh +;FTS`RhFWF] +JzDFFF +#s +Shz#s5Rh2K{DFShVR`Rh +ShR#s
;Fh@RhF# + +*\P"D +!Or# ++@ɀi#FFi#F{a{i1FF{{;+aQ# DG + +F +F +F +F a;h[ -a;j[Fxa{i -Z@@14S 0@1 +a;j[Fxa{i +Z@@14S 0@1 Ҳyhrh;hҲyhrh;hҲyhr{h3xhF:i_ -Ҳp{i -`:F`Fhh:;FFhhF@D#MwF -= -F F +Ҳp{i +`:F`Fhh:;FFhhF@D#MwF += +F F - + + + + + + + + + - - - - + + + @@ -66,32 +82,27 @@ F F - - + + '8!.m,M
8STs e jv.,r迢KfpK£Ql$օ5pjl7LwH'49JNOʜ[o.htocxxȄnjlPxqGCC: (crosstool-NG linaro-1.13.1-4.7-2013.02-01-20130221 - Linaro GCC 2013.02) 4.7.3 20130205 (prerelease) A -", - - - - - - - - - - - - - - - - - - - - - - +", + + + + + + + + + + + + + + + + + diff --git a/ca_export_arm/bin_android/tee-supplicant b/ca_export_arm/bin_android/tee-supplicant index 0b41854..9878607 100755 --- a/ca_export_arm/bin_android/tee-supplicant +++ b/ca_export_arm/bin_android/tee-supplicant @@ -1,79 +1,88 @@ -ELF - - -03/K -xD -(" -B - phO3O3!hC - -J{DzD -(F"F*j, -8 -@T( -Fh - - p*j!"FA@JA -(F. -HzDyD -$ -x:` -HxD -FB -SO h -O0x -ѲHFOQ -@F#R@F!HF?xD -HF#8HF!.F?xD +ELF + +03/K +FxD +(" + phO3O3!hC +1 +J{DzD + +0, +0F + + Gp +FA +B +@, + P +@𧀘 +F +F +5I7K5JyD{DzD +x:` +hB +HxD +H!O+r#xD +H!@"#xD +D +VH8UO +ѲHFOQ + FOB@ @ -O - +O + 0F@ @ -O -" - +O )$܀)6А)OР)@ "1O@ 6 A - - - -xD -!F -(FoBF -HxD - GpGF + + + +xD +!F +(FoBF +HxD + GpGF h)F2Fi FG? Nreu h -
- е?D - -pJ -OT - FoG + +pJ +OT + FoG p bh^h B& -xD +xD
dxDpGp($ -HxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpG}HxDpG{HxDpGxHxDpGvHxDpGsHxDpGqHxDpGnHxDpGlHxDpGiHxDpGgHxDpGdHxDpGbHxDpG_HxDpG]HxDpGZHxDpGXHxDpGUHxDpGSHxDpGPHxDpGMHxDpGJHxDpGHHxDpGEHxDpGCHxDpG@HxDpG>HxDpG;HxDpG9HxDpG6HxDpG4HxDpG1HxDpG/HxDpG,HxDpG*HxDpG'HxDpG%HxDpG"HxDpG HxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpG HxDpGHxDpGHxDpGHxDpG -0l - +HxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpG}HxDpG{HxDpGxHxDpGvHxDpGsHxDpGqHxDpGnHxDpGlHxDpGiHxDpGgHxDpGdHxDpGbHxDpG_HxDpG]HxDpGZHxDpGXHxDpGUHxDpGSHxDpGPHxDpGMHxDpGJHxDpGHHxDpGEHxDpGCHxDpG@HxDpG>HxDpG;HxDpG9HxDpG6HxDpG4HxDpG1HxDpG/HxDpG,HxDpG*HxDpG'HxDpG%HxDpG"HxDpG HxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpGHxDpG HxDpGHxDpGHxDpGHxDpG + +L + + + - - - + + + + + + + + - - + + @@ -84,7 +93,10 @@ B& - - + + + A -"&Dtee-supplicant +"&Dtee-supplicant + + diff --git a/ca_export_arm/lib_android/libteec.so b/ca_export_arm/lib_android/libteec.so index 24f17dd..c83b539 100644 --- a/ca_export_arm/lib_android/libteec.so +++ b/ca_export_arm/lib_android/libteec.so @@ -1,4 +1,4 @@ -ELF +ELF @@ -60,4 +60,4 @@ B& A -"&Dlibteec.so +"&Dlibteec.so diff --git a/ca_export_arm64/bin/tee-supplicant b/ca_export_arm64/bin/tee-supplicant index 547ad01..5bcef87 100755 --- a/ca_export_arm64/bin/tee-supplicant +++ b/ca_export_arm64/bin/tee-supplicant @@ -1,39 +1,58 @@ -ELF -C - - -BB ְ - - - - - - - - - - +ELF + + + ְ + ְ + ְ + ְ + ְ + ְ + ְ + ְ +BB + + + + + + + + + + + + + + S! ;@ *C@` -@ +@ +@3@` B @ - -@ + +@ 9_3@ -R +R - + + + + + + + + + + - - - - + + + - + @@ -48,32 +67,26 @@ B - -@ - + + '8!.m,M
8STs e -jv.,r迢KfpK£Ql$օ5pjl7LwH'49JNOʜ[o.htocxxȄnjlPxqGCC: (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease) -@ - -@ - - - - - - - - - - - - - - - - - - - - +jv.,r迢KfpK£Ql$օ5pjl7LwH'49JNOʜ[o.htocxxȄnjlPxqGCC: (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease) + + + + + + + + + + + + + + + + + + diff --git a/ca_export_arm64/bin_android/tee-supplicant b/ca_export_arm64/bin_android/tee-supplicant index a7c2689..3e289e9 100644 --- a/ca_export_arm64/bin_android/tee-supplicant +++ b/ca_export_arm64/bin_android/tee-supplicant @@ -1,52 +1,67 @@ -ELF - -@@ -@@ -@@ -@@ -@@ -@@ -@) -@ - -@ - -}Sa3 }SA3!3 - - - -G - - -a -k -? -跀W@j-@{- - -
-k -b -+@OA9 -* -x4" - - - -7 +ELF + + {¨_{ +@@ +@@ +@@ +@@ +@@ +@@ +@a + + + +@ + +@ +@ +}Sa3 }SA3!3& + +
+ +@9 + + + + + + + + +@_ +@_ + +* + c +@_i +@i + + c22K + + c22K +? +7 DyHI - - - - + + + + + + - - - + + + + + + + + - - + + @@ -56,19 +71,24 @@ DyHI - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/ca_export_arm64/lib_android/libteec.so b/ca_export_arm64/lib_android/libteec.so index 98b871f..4a2e3b0 100644 --- a/ca_export_arm64/lib_android/libteec.so +++ b/ca_export_arm64/lib_android/libteec.so @@ -1,4 +1,4 @@ -ELF +ELF @@ -28,4 +28,4 @@ _ k - + diff --git a/secureos/gx/bl32.img b/secureos/gx/bl32.img index c14453b..dca5e62 100644 --- a/secureos/gx/bl32.img +++ b/secureos/gx/bl32.img @@ -1,40 +1,45 @@ e4' -o| - +o' + # -# -& -"#PF! g"#&#F - F - -I8Fڲ -I -۲F - -< -Kca -KZh"b4`\`HH +# + + +" + +" +xNE F +vN? +YI +SI +۲F +FF|BKhBK +'#J +F +.iJa (F"k +Kka +KZh*b5`]`HH BohXXP K" -H@( - -;` -!F2FL -+ F9Fj +H@( + +;` +!F2F ++ F9Fj Q Q -Q -KEsa#a +Q +KEsa#a -A!# F3`K+` +A!# F3`K+` -E +E , -E""@ -CB`V" B3B`pG - -p +E""@ +CB`V" B3B`pG + +p @@ -43,374 +48,382 @@ CB`V" B3B`pG / / / -/ -Zh:x"p -Z` +/F FF +Zh:x"p +Z` K SBSL B3S -FF20F
KBS,BSL:B -#
?'wF?
?K -*O +FF20F
KBS,BSL:B +#
'wF?
?K +*O P 5 AF - -PCFSS, -CCL - -QHTT, -h8F!CDhi\pkhCDhh -kZhB - 4=h8bihMD!ikiBh+i -%e%F%aO -F - -WETLEsiBCsaW#L\U -C` - R -KhB - + +PCFSS, +CCL + +H@V!J +K"!H + +k@F!hhر +BS8/ "h8XB&`hhzhBhbhyhB4FF h{`B, +0`#ahEd +iQ"b!eYq%!a-!" # +F3h +@h+0 + + JE!UEE0iB@R L\CCP`LMB``a + +:*,Q *Ih8! + +C`jeck c83-GFFFF + +kBYCh8FIFh@pk + +kXYZQhFk@F![h@k]hCD +KB + ?O 2?#?#P?@j -KFhYh`Z`Fh +KFhYh`Z`Fh K Mh -K$2*Y`F`FJK`0 -M
-. !F*FeP - -K"! H(FvK``cb -!!{h"+F
#JF{aa4` -J@3H - - -#hG8" -p2*
јi -FiF\2[۲Bp -F%8 - -F7K -Hh -(` +K$2*Y`F`FJK`0 + +M
+ +K"! H(FXK``cb +FG + + Eѝ +0 +|a# +JOq
H + + +#hG8" + +K" +H! + +H[ (JhK
"`JhK`pGJKh -pYp p p -K -
K -K -K -K -K -K -K +pYp p p +K +
K +K +K +K +K +K +K K -H! -"!cd"Add 22kF:* K +H! +"!cd"Add? 22kF:* K *( -@j@h -K`0FK`Zh"p""?B +@j@h +K`0FK`Zh"p""?B J``KhB `"h dbhJdhdhdL -"i+J`bi`٣iBJ`iS`k+ѣl=J`#jbcjcjScjc+6K "` jG5K``jB3K`j=2K`j80K`k#lak -H(FIF2F! -! ! -K@b -5 - -HhF@ K" Hb! -HD IF" FKH;0 F)F"8@@8! -H!F HFP0F9-4*F" O4 F! -HAFF:F(F -HI+h3K`Kh2`KhBє,0%ei - - F9FO2 -J -F)Fhh$iG8$38FK -F)FhhdiG8$3KXh - +"i+J`bi`٣iBJ`iS`k+ѣl=J`#jbcjcjScjc+6K "` j +(FIF2F +! ! +K@b +5 + +H!F@ K" Hb! +H IF" FH0 F)F"8@8! +HF HFP0F9-4*F"O4 F! +HAFF:F(F +HI+h3K`Kh2`KhBє,0%ei +HF3h+`'x F0 F:FhGFHFeMO + ` F +J +F)Fhh$iG8"38FK +F)FhhdiG8"3KXh + FB!
<B @@# - + "FHF -k1F - +1F + -! O - -kGFx@FeF 5F + O + +kGFx@FeF 5F OF9(F!F KFG - -=F O=F O + +=F O=F O ?(F 1FG -@#G`*$ -JFT%OD%E -IF F*F - - - - -: - - O "h" :*/إihhRCHh@F7@h2" -@Fihh2 - -6 +@#G`*$ +JF%OD%E +IF FF + + +@ + +* +O0!XFF * -)))ih0Fjh:$0o`WDB`VD aH -
,
#iˎ -SF ++++h0F4й` +
,
#iˎ +SF - FY= -6FEKFK + FY +6FEKFK -KKF -GKGHhZh
#B% -FF #FF$F4 F F -@+"i QF +KKF +GKGHhZh
#B% +FF #FF$F4 F F +@+"id QF h +ED3BO OF# -1FX +1FX E B -FFFFUFWF6"h#KB/FAF +FFFFUFWF6"h#KB/FAF? -4Eѳh JB2Bѥb +4Eѳh JB2Bѥb - -h
FChB100+h -OO h34ڈj rRiGzBӽo2-CFjӱhF -OO h34ڈj riGzBӽo2 + +h
FChB10+h +OO h34ڈj rRiGzBӽr2-CFjӱhF +OO h34ڈj riGzBӽr2 Hh! -3ڈj9FBFG04zBH +3ڈj9FBFG04zBH Ohj 3ڈj@YiG -)KB -8( -K[nKnKoK[o{)FGO3`5a - - +)KB +8( +K[nKnKoK[o{)FGO3`5a + + -3CEрLYF -t`hhGFȹ(F1FJ(F1FJ(F1FJJ(F1FLL - -L L)FF - -**JhiGiipj JjkLhihGH +3CEрLYF +t`hhGFȹ(F1FJ(F1FJ(F1FJJ(F1FLL + +L L)FF + +**JhiGiipNj JjkLhihGH ** -Ji JVkFi*F#FGFH -FFFF -1hiaF -uAF(FJF#F +Ji JVkFi*F#FGFH +FFFF +1hiaF +uAF(FJF#F{F RB@7! OqOq@ ! -jGF`YFO@B - 2h+< - -2hFYF - -AF"F -pF +jGF`YFO@B + 2h+< + +2hFYF + +(K(F!F1G>s2-FFFFFx +AF"F +pF KB -" -uF +" +F AF F,GF)@;Iph+z9F2F(F5KFp @ F,CF0(XB3+I - F - - -F + F + + +F +F N N -N(FN - -^F -`bFL +N(FN + +F +`bF +L +F/#;F"#" KB -E)F +E)F) L -L -(cKhAD1F -$xH04GF}Hl -bsicah`F -O -IF -F -`k
h#icihj0GF0QF`k -GFhaV F02F`kGF -0PFG -)F@ -ZF[Fmi`k$1GFP!F%i8FG'FF -L0F(F -"`+` -0F +L + +F +O +F +!i$#c
ai.Kh$#jk +N o F N +$h +. *F +"`+` +0F !h+1 !h[ 1!+i[h1!! -!ii!p"iڱ +!ii!p"Liڱ Kh:F3F*F - -# -K!O + +# +K!O !"0#F"jF -LkLK"h@ > F&p(%3p2 - +LLK"h@ > F&p<"3s2 +L + PO 3E -[k +[k 03CD -0F -!"` 0*SFF -FFF& -O - -LH?(FQ F 3 %3 -<F&F -/ *F -#FAFS2FS -JH@FF - -5C +0 F +!"` 0*SFF +FFF& +O +TPH + +LH5(F= F 38"3 +F ++FIFS:F@D +IFh +W(h + + +7O*9_D?%_4]FOU_IF"FU +V!F(hJF3FF +
+(,D#2`!F!B"(Fw!>#XCC7B#7` +A +#F +l0F!FhBI0F!*FKFnh5QFB"00B)L+F + " -# -# -F $YF#E#:F< -$# -#Fxph8F@_sp` -^J!^H_L, - -#GH -" -GF0k0FI:F #GF0FL -,j -K1GF(!F@_KFp2 - (F!F"?"6 FPK"HOq( -("F -F -#GF0eiPF9I #GFPF -iI)GFPF - +# +# +E +$ +EF@_@F5)FF@#@F%pd +GF0k0FI:F #GF0F{L +[F +#GF0eiPF9I #GFPFq +iI)GFPF +"0, B + Oc@DcOHsOhs` KBOsOss` - -hch
#ihMKBSBSB@0@@F + +hch
#ihMKBSBSB@0@@F @FlG -@FyG -"KB"KB !H!H!H!H!H - -F -lGB.(FFPK"H@Q - - - -hch`Hh
#iciii-KBS(F5 -L F"0( -hkh`Hh
+ikiii>KB"أ@SBЌ:K -khWF -#h`h -+KlG+h(`B(LH0FZF -
K"L@A -H5 F -L(ر(("JOaH -*I"F -3h2`BL!)F(F -K L" -KL" -p023 -Gih
Gi)iG0F8F - -p3 - -p3 -GiiG0Fr8F -KBsBHH - - - +@FyG +"KB"KB !H!H!H!H!H + +=F +lGB.(FFPK"H@Q + + + +hch`Hh
#iciii-KBS(F5 +L F"0( +hkh`Hh
+ikiii>KB"أ@SBЌ:K +khF ++KlG+h(`B(LH0FZF +
K"L@A +H F +6(ر(("J@.AH +*I"F +3h2`BL!)F0(F] +K" +K L" +KL" +pH23 +Gih
Gi)iG0F8F + +p3 + +p3 +GiiG0F8F +KBsBHH + + -
-KB%ңsBO3B3BIaE $KB@aE-!KB8)F2F#F@*')F2F#F, )F2F#FR4c -A - -@FlG -@FqG +
-KB%ңsBO3B3BIaE $KB@aE-!KB8)F2F#F**')F2F#F )F2F#F4c +A + +*hiFK@F`jh[m"aJFGhQF:Fz>hFh'I + i`ii% +L(+ F, -FFKBsB% - -(F - +FFKBsB% + +(F + --KBPJF*F +-KBPJF*F -KB%PAq)KB3B3B F@Ѻ@w@ -F( - -1H1H0H0H>/H;/H8.H5.H2-H/-HXhhF0)H-Sx3'N -2-+1q2r2$r2s2\t2t2,u2v2v2Ă2 - - -*hiFK@F`jh[m"aJFGhQF:F>hFh'I -L(+ - -o?L -khh -y5LT -K H@UK" -?@F9F2FF`K@]
H" -*L - B1 +KB%PAq)KB3B3B F@ߺ@@' +F( + +)H&(H#(H 'HM'HJ&HG&HD%HA%H>$HghhF0V3xO + + +@FlG +@FqG + +o?L +khh +5LT + H@KK" +@F9F2FF`K@S
H" +L +Q B1 zOj O -O
x2xixBH +O
x2xixBHE zOj O -O
x3xixBH(Fȱ 1"9F#O FCF 0F" +O
x3xixBHFȱ 1"+9F#O FCF0F" zOj O -O
x3xixBHIF -ٱӱϱH6@w# -ٱӱϱH -@w# +O
x3xixBHIF +ٱӱϱH@w# +ٱӱϱH@w# 03 -"F +"F CC<# -҂"<#=#S@=3#!C<#=#C=#>#b>#?#B?#@#"@#A#S@A3# 3$#SCL3 -JOp3FR#0"FiG -l#c\2l#\32l# #*#OpFY" i"FG #52< # +҂"<#=#S@=3#!C<#=#C=#>#b>#?#B?#@#"@#A#S@A3# 3$#SCL3 +JOp3FR#0"FiG +l#c\2l#\32l# #*#OpFY" i"FG #52< # '' 7''7' '' -3F' -T'5J@ 3+:hB;`0F! F4-GFFF -%DOS +3F' +T'5J@ 3+:hB;`0F! F4-GFFF +%DOS F F@
H @q@ T@L Z#@ LLD]3+ hFDF F!F @
HT@LDY#@\D7L3 + f.F F!F4FZ#`^D
Hu `3V@l0+ 5DeF&D!F4F.FddP
Hf U@\DZ#PMD8 P3@+ b -F5D +F5D K Fհ F*F#F8LOe,M@e @@ -440,7 +453,7 @@ Kb KCbFpG pG FF;FZFOU pU - + Kb` K` Ka @@ -462,51 +475,52 @@ CckCs{Cs#O OHEh A OBjJOCjJ Eg G -E -2BE +E +2BE O -viHFYF -_J@! - - +viHFYF +_J@! + + + 4 ,
J -KC$PH 4 ,HO4 +KC$PH k 4 ,HO4 b 4 ,J -KC$PH 4 ,HO4 +KC$PH > 4 ,HO4 5 4 ,J -KC$PH z 4 ,HO4 q -ah -G - - -IQ" )FjFG - +KC$PH 4 ,HO4 +ah +G + + +IQ" )FjFG + -Eѻ -IQ" )FiFGFPF\\J@T3+0F Fp4-OFFFF { -AF"6?B
(i@FYFG +Eѻ +IQ" )FiFGFPF\\J@T3+0F Fp4-OFFFF { +AF"6?
(i@FYFG Eѹ JAFR#0FrjG!8F +FoйF;|\#T34tLE\U4,1F -+FW ++FW i
bi -1F
d -hi +1F
d +hi iIF
ci"3F@FF -ci
3FW&`F;#iO -l iGch +ci
3FW&`F;#iO +l iGch qH 0 -QF -& CF - +mq%QGF - F -!CZF" - .i
nii.ji#F"F@T KhkG -l'm(FG1(FADGF$ -@i*iGF -i
IF8FCFF[i
GG#40!hGh"ah8F +QF +& CF += +mq%QGF + F +!CZF" + .i
nii.ji#F"F@T KhkG +rl'm(FG1(FADGF$ +@i*iGF +i
IF8FCFF[i
GG#40!hGh"ah8F +F F QFZFKFF GF @@ -517,61 +531,60 @@ IQ" )FiFGFPF\\J@T3+0F Fp4-OFFFF { FGF GF *jGF0iGFpi)iGF@iiiGF#+`+j - -78FIFBF( + m O
-
< d ! "()+ ,lxhG gF -bF8F!h2SFB - -J+@XF}F -F --FB?P{B?LXF43F@h K[iG -@:F -4JUmFGF -kk F9FG -: +
< d ! "()+ ,lxhG F +F8F!h2SFB + +J+@XF}F +F +F +-FB?P{B?LXF43F@h K[iG +@:F +4JUmFGF +: GF GF -GF +GF F -Qi"GF +Qi"GF LlGF#mGF (`h` .0;@<EAF``,u,a(bke
cg*clc0 -<@c0PeBed@,fx@@@ @@@ -F -PFC +<@c0PeBed@,fx@@@ @@@ +cF +PFC - - }$Ꭽ!#)``b:+c -`,u,ablc<@cȃCD - + + $Ꭽ!#)``b:+c +`,u,ablc<@cȃCD + - -2`"bB"b5k`F`*cbOcje" + +2`"bB"b5k`F`*cbOcje" - -j`FbObbB#`+cke#e0tc<@c + +j`FbObbB#`+cke#e0tc<@c - - - -9 -w -Z F)F( F!F*F;hEXhF!F8F + + + + + + F)Fc( F!F*F;hXhF!F8F Kh+F -! F -" + F + OepS%`%UiFu@FS&`u@&S&`Fu@.qq.Nq. =qS%`_*%iFu@FS&` 'Prih@P@S$ P@S* B ssJs -s +s OepS%`%eiFu@FS&`u@&S&`Fu@.qq.Nq. =GqS%`ղ%iFu@FS&`*u@&S&`Fu@.rr.Nr. S"P rE ssJs -s +s ? ?\'pX+'FMOW+pGFIOjW+pEOW* 'V'pGU'piT)ph3h1_@? X* @@ -581,226 +594,238 @@ X* BU" gT'p $J'R'p"J GR'piJ -R)pBOr1K@J@Os$b@$33Z@AK@A2S@C`` +R)pBOr1K@J@Os$b@$33Z@AK@A2S@C`` @% @$ 2* 7 28* @$?~p?P%`Q"pG -@%2*3+ - - +@%2*3+ + + 40 F9FG8O B80 FGC6F.O+pnp.#pkp5?҂#pkp3 p5 ҃#.qkp3p3 p5 F -GFk FGEѳk FGFNAF3lG K[iG!FmFG -3 +GFk FGEѳk FGFNAF3lG K[iG!FmFG +3 +FhF#F"FT'FTTp u -a(1"0F -$$ -F +a(1"0F +\$$ +1F V<VṾ+M -@]J@BP1`6%u%a(4$
#8F -d$$ -?FXFF -#8F - -F -F F -Xcx -XF!F5FO -:Fy - +@]J@BP1`6%u%a(4$
#8F +$$ +FXFF +#8F + +F +pF F +]Xcx +XF!F5FO +:F + + +U< E0F -| F -yOO
@F=.208 (KVpGd pG -!(h -!p\ -!p(hp\ -!phh -!p\ -! qhhp\ -!`qh -!p\ -!qhp\ -!qh -!p\ -! rhp\ -!`r(il -!zp\ -!r(irp\ -!rhiY -!gp\ -! shi_p\x`s+jiiN -!si9 -!Gp\` -!si?p\X -! t(j& -!4p\M -!`t(j,p\E#tZ ?#sbp + + F +OO
@Fc1208 (KVpGd pG +!(h, +!:p\ +!p(h2p\ +!phh +!'p\ +! qhhp\ +!`qh +!p\ +!qhp\ +!qh + +!p\ +! rh +p\ +!`r(i + +! +p\ +!r(i +p\ +!rhi + +! +p\ +! shi +p\x`s+jiiN +!si + +! +p\` +!si +p\X +! t(j + +! +p\M +!`t(j +p\E#tZ ?#sbp $p҃#,qkp#p# -$pV8(O -(FHF -$F F - F%h(F --8F -) -#YF"F 8 +$pV^8(O +FHF +F F +F%h(F +8F + +YF"F 8 O -aBFYD(F - - +oaBFYD(F +i + +]b `i -#`O0FF -8F -(F -O +#`O0FF +8F +(F +O O O
-PF +PF E -!F0F -F@F -F$h F -&8F -" -Cm +F0F +F@F +F$h F +8F + +Cm -
# +# 0D - +U (F:KAFS"0[iG@EFQ!FZF;F9 hB`# -!F -D2 +!F +D2 ` -8F - F -## -+F0F -'F0F -#0F -F4 F -((F -$F - -<+# F:RFYF -@F +8F + F +## +F0F +F0F +0F +F4 F +(F +F + +<+# F:RFYF +a@F JF - +[ BoF E -`.['0[mGF +`.['0[mGF aFmGF['0)FmGFH(FAFJF -zI`@F -z -w(F -t F -q# -F(F -(F -F(F - -FF -F - - - -[' RmGF +I`@F + +(F + F +# +F(F +(F +F(F +FF +F + + + +[' RmGF 1Fm"GF m GF IFmBFGF QFmGF -"IFX 0BF -8FQFoFD -dKQF -^K"U -x@Lp` -^HF -[ -X0F -U$$ ++"IFX 0BF +8FQFoFD +KQF +K"U +x@Lp` # BTPF - - +h +; 0GF 0F8ZF 0F HFZF HF -Y +Y PFQFZF PFQFZF PF[FR@RFPGF FFJRiGJ - G + G FGF FGF FnGF FGF FGF OFFmGF -!FKFmGF +!FKFmGF OF;nGF ~OFFmGF qOFmGF -NF3nGF +NF3nGF QO!hFmGF CO FnGF -OmFGF +OmFGF uOFmGF -`h)FmFGF +`h)FmFGF i AF
"0F#` -0F -K(F*F@KFGF -7pZ( RmG -FGF -/gI0F_z1F O#F{OO +0F +K(F*F@KFGF +7pZ( RmG +FGF +gI0F_z1F O#F{OO -!@F - 7OE - -!F!F!F -ch" -FcPFIF( - -@6K FfF -+I*H -x0F -Jh0`JBZ` -FJ`Y`h```h`KhQ` F)F -Q2$ -زBؕBشB3B +!F + 7OE + +!F!F!F +ch" +FPFIFo( + +@6K FF ++I*H +x0F +D` IX`h```h`F4F +Q2$ +زBؕBشB3B ȿ$,($+U -+, ++, ; ܸ#fи*fи @X.jи0и-@_U 3h6C{j -`H`" -FO +`H`" +FO AEq0 -" -" Fx<F
F " +" +" F<F
F " #x( ! AqFFT
ZF -U22N2=2H1@@8@Bddhl +2222H1@@8@Bddhl ;< E պ @@ -810,112 +835,101 @@ Jh0`JBZ` : 2ZE{ #a -;9 -#pk;`AFY<"h]j#GF - j`jj F@F -(F8@8Fa@@`h -O3 -(F!F:Fsih4 -< - - -PFK - B7<0ZhB
8FFRFRF8(F"F8@ 88)FF -) - - - -C -` +;9 + +Xn`vh`mh`42,88Fi + +(F!F:Fsih4 +k$4h +) + + +C +` FFFsi[i -:*+$$**V<hFhp`2`h +:*+$$**V<hF,hp`2`h zhh -7 -!F -+h ,` +7 +!LF " -cj##jFCF62 -F!B -F -F FȿF -F Fj8L - -FH +cj##jFipFF OqPF85 +F FF +F F8Fh\ FZah +h!q2FQ@BF php qCqˈ -qˈ1q0Kx +qˈ1q0~Kx xCcxCxC#` -yKyC#yy1C#"À0 -i9F2F +yKyC#yy1C#"À0dF +i9F2F ¼ pG | pG C pG - pG-AFFFF{)F@p"(F9F2F#FA -AFFFF۱)F@p"t)FBp"n)FDp"h(F9F2F#FAi F - + pG-AFFFF{)F@p"r(F9F2F#FA -AFFFF۱)F@p"W)FBp"Q)FDp"K(F9F2F#FAi F + '' 'T74',T7 -Tu8F)F +Tu8F)F 73T+7T8FYF - -O -wa + +O +wa wa YW V -U )F +U )F Z \ ] -^ )F -pbJphO"php +^ ;)F +pbJphO"php f,h i -j )F -pbJphO"php +j )F +pbJphO"php L - 4)F + 4})F pJpbhO"pbhpx -qbJq"hO"qT+q -` 8kh --GFFF -萇Fpi -FBO --GFFFF@:7. -7 !-Fp +qbJq"hO"qT+q +` 8kh +-GFFF +萇Fpi +FBO +-GFFFF@:7. +7 !*Fp ~2Ҳ -v3+pG pG - +v3+pG pG h - -E" F FIF&F F-F FIF "FX FIFF(5 -Ob:` F0Fh + +E" Ft FIF&F FF FIF "FX FIFF(5 -Ob:` F0Fo *ah?+VF -6[ F -%D
iFR0FHFiFBF FuYX BFIF0FZ Fe -BF0F F\HF ! -*)(F"F -*4..2 F*F +6[ F +%D
iFR0F2HFiFBF FuYX BFIF0FZ Fe +BF0F F\HF ! +*)(F"F +*4..2 F*F pq"qbq -q +q pq"qbq -q +q pq"qbq -q +q pq"qbq -q -FFUFZ +q +FFUFZ ( EѨ
- ?+߀k"hB#`
+1#0#-3pOup#-#psp#?҂#psp+ p# ҃#5qsp+p+ p#"h -#`;hhxh - +#`;hhxh + "FF -3 -%F +3 +%F - a -%aF -+8(x0lxвB$ + a +%aF ++8(x0lxвB$ ?҂"pbp* p" ?҂"pbp* @@ -927,18 +941,19 @@ ZO O LɲѡT2 -D +D &p҃#%qcp+&p+ -p -=F<F C -p#(!rh 3h ;#*FFO +p +=F<F C +p#(!rh 3h ;#*FFO p҃#,qkp#!p# -p\T2Bъ2`(0(0?00` +p\T2Bъ2`(0(0?00` &p҃#%qcp+&p+ -p -Jh01 +p +FP+ +Jh01 F - B FAFh + B FAFh )F D; O @@ -958,32 +973,32 @@ F DEмB *Fch -FHhFhR<R`R,FhS`i`HiGp -R#F -O +FHhFhR<R`R,FhS`i`HiGp +R#F +O T!8 B T! - Bت + Bت gE5T% -F +F Y' &v OD - *F6MFW -@BF + *F6MFW +@BF 74 50_( ( (
(а HBHApG pGShF -B - 0\>HFQ2F +B + 0\>HFQ2F 1 FFF!F9FBF#F1F FFF!F9FBF#F}1F -FFF!F9FBF#FN1F +FFF!F9FBF#FN1F ڰG Z6:h 8X'O (F OI @@ -992,38 +1007,35 @@ h`:`9F"F3F""?GE 6:h JZEZF BEBF -3FE !FXF - - -Fx1BxFF3x - +3FE !FXF + + +Fx1BxFF3x + GoQcpn g))/F '&&\8!.*Zm,M߳
8ScTs ew< jvG.;5,rdL迢0BKfpK0TQlReU$* qW5ѻ2pjҸSAQl7LwH'Hᵼ4cZų9ˊAJNscwOʜ[o.h]t`/CocxrxȄ9dnj(c#齂lPyƲ+SrxqƜa&>'!Ǹ}xnO}orgȢ}c
?G5q}#w($@{2 -<L
gCB>˾L*~e)Y:o_XGJDl11[1.01%111 -2 - - -2.1-1I-1 11 2}'1'1&1e&1%1%%1=/1$1y$1#1U#1y"1:1I"1 -2Y -211!111A1)1A19,191991) -21i1y111 2 21m+1-+1z2 - - +<L
gCB>˾L*~e)Y:o_XGJDl111u1011c111 + +22 +2Q0%020000y0222 + + '8!.m,M
8STs e -jv.,r迢KfpK£Ql$օ5pjl7LwH'49JNOʜ[o.htocxxȄnjlPxq 2 - - - - - - - - +jv.,r迢KfpK£Ql$օ5pjl7LwH'49JNOʜ[o.htocxxȄnjlPxqu2 + + +2 + + + + + + |B| !\hT[:.6$g WҖO aiKwZ @@ -1043,8 +1055,8 @@ IIII$$$$\\\\Ӭbbbbyyyy7777mmmmNNNN - -o/Dyeڜ + +o/Dyeڜ SiJJ) A @@ 4!R "A !@h@2l @@ -1062,21 +1074,20 @@ o/Dyeڜ - + + + - - - - + - + - + @@ -1085,78 +1096,31 @@ o/Dyeڜ FSR 0x%x PC 0x%x TTBR0 0x%X CONTEXIDR 0x%X -CPUID 0x%x CPSR 0x%x (read from SPSR) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +CPUID 0x%x CPSR 0x%x (read from SPSR) + - + - - + + - + - + - + @@ -1171,7 +1135,7 @@ CPUID 0x%x CPSR 0x%x (read from SPSR) - + @@ -1182,4 +1146,4 @@ CPUID 0x%x CPSR 0x%x (read from SPSR) SECP112R1 ;3+#>6.&=5-%
<4,$
- + diff --git a/ta_export/host_include/__tee_ipsocket.h b/ta_export/host_include/__tee_ipsocket.h new file mode 100644 index 0000000..7c33666 --- a/dev/null +++ b/ta_export/host_include/__tee_ipsocket.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_IPSOCKET_H +#define ____TEE_IPSOCKET_H + +typedef enum TEE_ipSocket_ipVersion_e { + TEE_IP_VERSION_DC = 0, /* don’t care */ + TEE_IP_VERSION_4 = 1, + TEE_IP_VERSION_6 = 2 +} TEE_ipSocket_ipVersion; + +#endif /*____TEE_IPSOCKET_H*/ diff --git a/ta_export/host_include/__tee_isocket_defines.h b/ta_export/host_include/__tee_isocket_defines.h new file mode 100644 index 0000000..b38457a --- a/dev/null +++ b/ta_export/host_include/__tee_isocket_defines.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef ____TEE_ISOCKET_DEFINES_H +#define ____TEE_ISOCKET_DEFINES_H + +#define TEE_ISOCKET_VERSION 0x01000000 + +#define TEE_ISOCKET_ERROR_PROTOCOL 0xF1007001 +#define TEE_ISOCKET_ERROR_REMOTE_CLOSED 0xF1007002 +#define TEE_ISOCKET_ERROR_TIMEOUT 0xF1007003 +#define TEE_ISOCKET_ERROR_OUT_OF_RESOURCES 0xF1007004 +#define TEE_ISOCKET_ERROR_LARGE_BUFFER 0xF1007005 +#define TEE_ISOCKET_WARNING_PROTOCOL 0xF1007006 +#define TEE_ISOCKET_ERROR_HOSTNAME 0xF1007007 + +#endif /*____TEE_ISOCKET_DEFINES_H*/ diff --git a/ta_export/host_include/__tee_tcpsocket_defines.h b/ta_export/host_include/__tee_tcpsocket_defines.h new file mode 100644 index 0000000..21853e0 --- a/dev/null +++ b/ta_export/host_include/__tee_tcpsocket_defines.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_TCPSOCKET_DEFINES_H +#define ____TEE_TCPSOCKET_DEFINES_H + +/* Protocol identifier */ +#define TEE_ISOCKET_PROTOCOLID_TCP 0x65 + +/* Instance specific errors */ +#define TEE_ISOCKET_TCP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1010002 + +#endif /*____TEE_TCPSOCKET_DEFINES_H*/ diff --git a/ta_export/host_include/__tee_tcpsocket_defines_extensions.h b/ta_export/host_include/__tee_tcpsocket_defines_extensions.h new file mode 100644 index 0000000..3a03a2c --- a/dev/null +++ b/ta_export/host_include/__tee_tcpsocket_defines_extensions.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H +#define ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H + +/* Instance and implementation specific ioctl functions */ +#define TEE_TCP_SET_RECVBUF 0x65f00000 +#define TEE_TCP_SET_SENDBUF 0x65f00001 + +#endif /*____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H*/ diff --git a/ta_export/host_include/__tee_udpsocket_defines.h b/ta_export/host_include/__tee_udpsocket_defines.h new file mode 100644 index 0000000..64ec09c --- a/dev/null +++ b/ta_export/host_include/__tee_udpsocket_defines.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_UDPSOCKET_DEFINES_H +#define ____TEE_UDPSOCKET_DEFINES_H + +/* Protocol identifier */ +#define TEE_ISOCKET_PROTOCOLID_UDP 0x66 + +/* Instance specific errors */ +#define TEE_ISOCKET_UDP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1020002 + +/* Instance specific ioctl functions */ +#define TEE_UDP_CHANGEADDR 0x66000001 +#define TEE_UDP_CHANGEPORT 0x66000002 + +#endif /*____TEE_UDPSOCKET_DEFINES_H*/ diff --git a/ta_export/host_include/compiler.h b/ta_export/host_include/compiler.h index bb275bf..c1bd6a4 100644 --- a/ta_export/host_include/compiler.h +++ b/ta_export/host_include/compiler.h @@ -93,6 +93,9 @@ #ifndef __early_bss #define __early_bss __section(".early_bss") #endif +#ifndef __noprof +#define __noprof __attribute__((no_instrument_function)) +#endif #define __compiler_bswap64(x) __builtin_bswap64((x)) #define __compiler_bswap32(x) __builtin_bswap32((x)) diff --git a/ta_export/host_include/conf.h b/ta_export/host_include/conf.h index 3962bee..3e99f36 100644 --- a/ta_export/host_include/conf.h +++ b/ta_export/host_include/conf.h @@ -7,7 +7,7 @@ #define CFG_CORE_HEAP_SIZE 65536 /* CFG_CORE_SANITIZE_KADDRESS is not set */ /* CFG_CORE_SANITIZE_UNDEFINED is not set */ -#define CFG_CORE_TZSRAM_EMUL_SIZE 307200 +#define CFG_CORE_TZSRAM_EMUL_SIZE 368640 #define CFG_CRYPTO 1 #define CFG_CRYPTO_AES 1 #define CFG_CRYPTO_AES_AML 1 @@ -46,31 +46,35 @@ /* CFG_DT is not set */ #define CFG_DTB_MAX_SIZE 0x10000 #define CFG_EFUSE 1 -#define CFG_ENC_FS_ALG_AES_CTR_AND_HMAC 1 +#define CFG_ENCRYPT_TA 1 #define CFG_GENERIC_BOOT 1 +/* CFG_GP_SOCKETS is not set */ #define CFG_KERN_LINKER_ARCH arm #define CFG_KERN_LINKER_FORMAT elf32-littlearm #define CFG_LIBUTILS_WITH_ISOC 1 +#define CFG_LPAE_ADDR_SPACE_SIZE (1ull << 32) #define CFG_LTC_OPTEE_THREAD 1 +#define CFG_MAP_VMEM 1 #define CFG_MESON_UART 1 #define CFG_MMU_V7_TTB 1 #define CFG_MSG_LONG_PREFIX_THRESHOLD 3 #define CFG_NUM_THREADS 4 #define CFG_OPTEE_REVISION_MAJOR 2 -#define CFG_OPTEE_REVISION_MINOR 3 +#define CFG_OPTEE_REVISION_MINOR 4 #define CFG_OTP_SUPPORT 1 /* CFG_PAGED_USER_TA is not set */ #define CFG_PM_STUBS 1 #define CFG_REE_FS 1 -/* CFG_REE_FS_BLOCK_CACHE is not set */ -#define CFG_RPMB_FS 1 #define CFG_RPMB_FS_DEV_ID 0 +/* CFG_RPMB_WRITE_KEY is not set */ +/* CFG_SECURE_DATA_PATH is not set */ #define CFG_SECURE_STORAGE 1 /* CFG_SECURE_TIME_SOURCE_REE is not set */ #define CFG_SECURE_TIME_SOURCE_TEE 1 #define CFG_SMALL_PAGE_USER_TA 1 /* CFG_SQL_FS is not set */ #define CFG_TA_FLOAT_SUPPORT 1 +/* CFG_TA_GPROF_SUPPORT is not set */ #define CFG_TEE_API_VERSION GPD-1.1-dev /* CFG_TEE_CORE_DEBUG is not set */ #define CFG_TEE_CORE_EMBED_INTERNAL_TESTS 1 @@ -85,12 +89,11 @@ #define CFG_TEE_PANIC_DEBUG 1 #define CFG_TEE_TA_LOG_LEVEL 1 /* CFG_TEE_TA_MALLOC_DEBUG is not set */ +/* CFG_ULIBS_GPROF is not set */ #define CFG_WITH_ARM_TRUSTED_FW 1 -#define CFG_WITH_DEBUG 1 /* CFG_WITH_PAGER is not set */ #define CFG_WITH_SOFTWARE_PRNG 1 #define CFG_WITH_STACK_CANARIES 1 -#define CFG_WITH_STATS 1 #define CFG_WITH_USER_TA 1 #define CFG_WITH_VFP 1 #define PLATFORM_FLAVOR gxbb diff --git a/ta_export/host_include/conf.mk b/ta_export/host_include/conf.mk index 218c4c9..b6c13cb 100644 --- a/ta_export/host_include/conf.mk +++ b/ta_export/host_include/conf.mk @@ -1,5 +1,5 @@ # auto-generated TEE configuration file -# TEE version ATOS-V2.3 +# TEE version 2.3.0-194-g0179df8 ARCH=arm PLATFORM=meson PLATFORM_FLAVOR=gxbb @@ -10,7 +10,7 @@ CFG_CACHE_API=y CFG_CORE_HEAP_SIZE=65536 CFG_CORE_SANITIZE_KADDRESS=n CFG_CORE_SANITIZE_UNDEFINED=n -CFG_CORE_TZSRAM_EMUL_SIZE=307200 +CFG_CORE_TZSRAM_EMUL_SIZE=368640 CFG_CRYPTO=y CFG_CRYPTO_AES=y CFG_CRYPTO_AES_AML=y @@ -49,31 +49,35 @@ CFG_CRYPTO_XTS=y CFG_DT=n CFG_DTB_MAX_SIZE=0x10000 CFG_EFUSE=y -CFG_ENC_FS_ALG_AES_CTR_AND_HMAC=y +CFG_ENCRYPT_TA=y CFG_GENERIC_BOOT=y +CFG_GP_SOCKETS=n CFG_KERN_LINKER_ARCH=arm CFG_KERN_LINKER_FORMAT=elf32-littlearm CFG_LIBUTILS_WITH_ISOC=y +CFG_LPAE_ADDR_SPACE_SIZE=(1ull << 32) CFG_LTC_OPTEE_THREAD=y +CFG_MAP_VMEM=y CFG_MESON_UART=y CFG_MMU_V7_TTB=y CFG_MSG_LONG_PREFIX_THRESHOLD=3 CFG_NUM_THREADS=4 CFG_OPTEE_REVISION_MAJOR=2 -CFG_OPTEE_REVISION_MINOR=3 +CFG_OPTEE_REVISION_MINOR=4 CFG_OTP_SUPPORT=y CFG_PAGED_USER_TA=n CFG_PM_STUBS=y CFG_REE_FS=y -CFG_REE_FS_BLOCK_CACHE=n -CFG_RPMB_FS=y CFG_RPMB_FS_DEV_ID=0 +CFG_RPMB_WRITE_KEY=n +CFG_SECURE_DATA_PATH=n CFG_SECURE_STORAGE=y CFG_SECURE_TIME_SOURCE_REE=n CFG_SECURE_TIME_SOURCE_TEE=y CFG_SMALL_PAGE_USER_TA=y CFG_SQL_FS=n CFG_TA_FLOAT_SUPPORT=y +CFG_TA_GPROF_SUPPORT=n CFG_TEE_API_VERSION=GPD-1.1-dev CFG_TEE_CORE_DEBUG=n CFG_TEE_CORE_EMBED_INTERNAL_TESTS=y @@ -88,11 +92,10 @@ CFG_TEE_MANUFACTURER=LINARO CFG_TEE_PANIC_DEBUG=y CFG_TEE_TA_LOG_LEVEL=1 CFG_TEE_TA_MALLOC_DEBUG=n +CFG_ULIBS_GPROF=n CFG_WITH_ARM_TRUSTED_FW=y -CFG_WITH_DEBUG=y CFG_WITH_PAGER=n CFG_WITH_SOFTWARE_PRNG=y CFG_WITH_STACK_CANARIES=y -CFG_WITH_STATS=y CFG_WITH_USER_TA=y CFG_WITH_VFP=y diff --git a/ta_export/host_include/fs_htree.h b/ta_export/host_include/fs_htree.h new file mode 100644 index 0000000..3d280db --- a/dev/null +++ b/ta_export/host_include/fs_htree.h @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_FS_HTREE_H +#define __TEE_FS_HTREE_H + +/* + * The purpose of this API is to provide file integrity and confidentiality + * in order to implement secure storage. On-disk data structures are + * duplicated to make updates atomic, an update is finalized to disk with + * tee_fs_htree_sync_to_storage(). + * + * This implementation doesn't provide rollback protection, it only + * guarantees the integrity and confidentiality of the file. + */ + +#include <tee_api_types.h> +#include <utee_defines.h> + +#define TEE_FS_HTREE_HASH_SIZE TEE_SHA256_HASH_SIZE +#define TEE_FS_HTREE_IV_SIZE 16 +#define TEE_FS_HTREE_FEK_SIZE 16 +#define TEE_FS_HTREE_TAG_SIZE 16 + +/* Internal struct provided to let the rpc callbacks know the size if needed */ +struct tee_fs_htree_node_image { + /* Note that calc_node_hash() depends on hash first in struct */ + uint8_t hash[TEE_FS_HTREE_HASH_SIZE]; + uint8_t iv[TEE_FS_HTREE_IV_SIZE]; + uint8_t tag[TEE_FS_HTREE_TAG_SIZE]; + uint16_t flags; +}; + +/* + * This struct is not interpreted by the hash tree, it's up to the user of + * the interface to update etc if needed. + */ +struct tee_fs_htree_meta { + uint64_t length; +}; + +/* Internal struct needed by struct tee_fs_htree_image */ +struct tee_fs_htree_imeta { + struct tee_fs_htree_meta meta; + uint32_t max_node_id; +}; + +/* Internal struct provided to let the rpc callbacks know the size if needed */ +struct tee_fs_htree_image { + uint8_t iv[TEE_FS_HTREE_IV_SIZE]; + uint8_t tag[TEE_FS_HTREE_TAG_SIZE]; + uint8_t enc_fek[TEE_FS_HTREE_FEK_SIZE]; + uint8_t imeta[sizeof(struct tee_fs_htree_imeta)]; + uint32_t counter; +}; + +/** + * enum tee_fs_htree_type - type of hash tree element + * @TEE_FS_HTREE_TYPE_HEAD: indicates a struct tee_fs_htree_image + * @TEE_FS_HTREE_TYPE_NODE: indicates a struct tee_fs_htree_node_image + * @TEE_FS_HTREE_TYPE_BLOCK: indicates a data block + */ +enum tee_fs_htree_type { + TEE_FS_HTREE_TYPE_HEAD, + TEE_FS_HTREE_TYPE_NODE, + TEE_FS_HTREE_TYPE_BLOCK, +}; + +struct tee_fs_rpc_operation; + +/** + * struct tee_fs_htree_storage - storage description supplied by user of + * this interface + * @block_size: size of data blocks + * @rpc_read_init: initialize a struct tee_fs_rpc_operation for an RPC read + * operation + * @rpc_write_init: initialize a struct tee_fs_rpc_operation for an RPC + * write operation + * + * The @idx arguments starts counting from 0. The @vers arguments are either + * 0 or 1. The @data arguments is a pointer to a buffer in non-secure shared + * memory where the encrypted data is stored. + */ +struct tee_fs_htree_storage { + size_t block_size; + TEE_Result (*rpc_read_init)(void *aux, struct tee_fs_rpc_operation *op, + enum tee_fs_htree_type type, size_t idx, + uint8_t vers, void **data); + TEE_Result (*rpc_read_final)(struct tee_fs_rpc_operation *op, + size_t *bytes); + TEE_Result (*rpc_write_init)(void *aux, struct tee_fs_rpc_operation *op, + enum tee_fs_htree_type type, size_t idx, + uint8_t vers, void **data); + TEE_Result (*rpc_write_final)(struct tee_fs_rpc_operation *op); +}; + +struct tee_fs_htree; + +/** + * tee_fs_htree_open() - opens/creates a hash tree + * @create: true if a new hash tree is to be created, else the hash tree + * is read in and verified + * @stor: storage description + * @stor_aux: auxilary pointer supplied to callbacks in struct + * tee_fs_htree_storage + * @ht: returned hash tree on success + */ +TEE_Result tee_fs_htree_open(bool create, + const struct tee_fs_htree_storage *stor, + void *stor_aux, struct tee_fs_htree **ht); +/** + * tee_fs_htree_close() - close a hash tree + * @ht: hash tree + */ +void tee_fs_htree_close(struct tee_fs_htree **ht); + +/** + * tee_fs_htree_get_meta() - get a pointer to associated struct + * tee_fs_htree_meta + * @ht: hash tree + */ +struct tee_fs_htree_meta *tee_fs_htree_get_meta(struct tee_fs_htree *ht); + +/** + * tee_fs_htree_sync_to_storage() - synchronize hash tree to storage + * @ht: hash tree + * + * Frees the hash tree and sets *ht to NULL on failure and returns an error code + */ +TEE_Result tee_fs_htree_sync_to_storage(struct tee_fs_htree **ht); + +/** + * tee_fs_htree_truncate() - truncate a hash tree + * @ht: hash tree + * @block_num: the number of nodes to truncate to + * + * Frees the hash tree and sets *ht to NULL on failure and returns an error code + */ +TEE_Result tee_fs_htree_truncate(struct tee_fs_htree **ht, size_t block_num); + +/** + * tee_fs_htree_write_block() - encrypt and write a data block to storage + * @ht: hash tree + * @block_num: block number + * @block: pointer to a block of stor->block_size size + * + * Frees the hash tree and sets *ht to NULL on failure and returns an error code + */ +TEE_Result tee_fs_htree_write_block(struct tee_fs_htree **ht, size_t block_num, + const void *block); +/** + * tee_fs_htree_write_block() - read and decrypt a data block from storage + * @ht: hash tree + * @block_num: block number + * @block: pointer to a block of stor->block_size size + * + * Frees the hash tree and sets *ht to NULL on failure and returns an error code + */ +TEE_Result tee_fs_htree_read_block(struct tee_fs_htree **ht, size_t block_num, + void *block); + +#endif /*__TEE_FS_HTREE_H*/ diff --git a/ta_export/host_include/pta_gprof.h b/ta_export/host_include/pta_gprof.h new file mode 100644 index 0000000..9e95fb0 --- a/dev/null +++ b/ta_export/host_include/pta_gprof.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __PTA_GPROF_H +#define __PTA_GPROF_H + +/* + * Interface to the gprof pseudo-TA, which is used by libutee to control TA + * profiling and forward data to tee-supplicant. + */ + +#define PTA_GPROF_UUID { 0x2f6e0d48, 0xc574, 0x426d, { \ + 0x82, 0x4e, 0x40, 0x19, 0x8c, 0xde, 0x5c, 0xac } } + +/* + * Send TA profiling data (gmon.out format) to tee-supplicant + * Data may be sent in several chunks: first set id to 0, then re-use the + * allocated value in subsequent calls. + * + * [in/out] value[0].a: id + * [in] memref[1]: profiling data + */ +#define PTA_GPROF_SEND 0 + +/* + * Start PC sampling of a user TA session + * + * [in/out] memref[0]: sampling buffer + * [in] value[1].a: offset: the lowest PC value in the TA + * [in] value[1].b: scale: histogram scaling factor + */ +#define PTA_GPROF_START_PC_SAMPLING 1 + +/* + * Stop PC sampling of a user TA session and retrieve data + * + * [out] value[0].a: sampling frequency + */ +#define PTA_GPROF_STOP_PC_SAMPLING 2 + +#endif /* __PTA_GPROF_H */ diff --git a/ta_export/host_include/pta_invoke_tests.h b/ta_export/host_include/pta_invoke_tests.h new file mode 100644 index 0000000..1667af8 --- a/dev/null +++ b/ta_export/host_include/pta_invoke_tests.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __PTA_INVOKE_TESTS_H +#define __PTA_INVOKE_TESTS_H + +#define PTA_INVOKE_TESTS_UUID \ + { 0xd96a5b40, 0xc3e5, 0x21e3, \ + { 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } } + +/* Trace some hello string. Parameters are not used/checked. */ +#define PTA_INVOKE_TESTS_CMD_TRACE 0 + +/* + * Types of parameter drives the test sequences: + * - test on value parameters + * - test on SHM memory reference parameters + * - test on SDP memory reference parameters + */ +#define PTA_INVOKE_TESTS_CMD_PARAMS 1 + +/* Run some core internal tests. Parameters are not used/checked. */ +#define PTA_INVOKE_TESTS_CMD_SELF_TESTS 2 + +/* + * Secure data path: check that pTA can copy data from non-secure shared memory + * to SDP secure memory + * + * [in] memref[0] source (non-secure shared memory) + * [out] memref[1] destination (SDP secure memory) + */ +#define PTA_INVOKE_TESTS_CMD_COPY_NSEC_TO_SEC 3 + +/* + * Secure data path: check that pTA can read data from SDP secure memory and + * write it back. Data are processed so that client check the expected + * read/write sequence succeed. + * + * [in/out] memref[0] SDP secure buffer to read from and write to + */ +#define PTA_INVOKE_TESTS_CMD_READ_MODIFY_SEC 4 + +/* + * Secure data path: check that pTA can copy data from SDP secure memory to + * non-secure shared memory + * + * [in] memref[0] source (SDP secure memory) + * [out] memref[1] destination (non-secure shared memory) + */ +#define PTA_INVOKE_TESTS_CMD_COPY_SEC_TO_NSEC 5 + +/* + * Tests FS hash-tree corner cases in error handling + */ +#define PTA_INVOKE_TESTS_CMD_FS_HTREE 6 + +#endif /*__PTA_INVOKE_TESTS_H*/ + diff --git a/ta_export/host_include/pta_socket.h b/ta_export/host_include/pta_socket.h new file mode 100644 index 0000000..b39aa52 --- a/dev/null +++ b/ta_export/host_include/pta_socket.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __PTA_SOCKET +#define __PTA_SOCKET + +#define PTA_SOCKET_UUID { 0x3b996a7d, 0x2c2b, 0x4a49, { \ + 0xa8, 0x96, 0xe1, 0xfb, 0x57, 0x66, 0xd2, 0xf4 } } + +/* + * [in] value[0].a ip version TEE_IP_VERSION_* from tee_ipsocket.h + * [in] value[0].b server port number + * [in] memref[1] server address + * [in] value[2].a protocol, TEE_ISOCKET_PROTOCOLID_* + * [out] value[3].a socket handle + */ +#define PTA_SOCKET_OPEN 1 + +/* + * [in] value[0].a socket handle + */ +#define PTA_SOCKET_CLOSE 2 + +#define PTA_SOCKET_TIMEOUT_NONBLOCKING 0 +#define PTA_SOCKET_TIMEOUT_BLOCKING 0xffffffff + +/* + * [in] value[0].a socket handle + * [in] value[0].b timeout ms or TEE_TIMEOUT_INFINITE + * [in] memref[1] buffer to transmit + * [out] value[2].a number of transmitted bytes + */ +#define PTA_SOCKET_SEND 3 + +/* + * [in] value[0].a socket handle + * [in] value[0].b timeout ms or TEE_TIMEOUT_INFINITE + * [out] memref[1] buffer + */ +#define PTA_SOCKET_RECV 4 + +/* + * [in] value[0].a socket handle + * [in] value[0].b ioctl command + * [in/out] memref[1] buffer + */ +#define PTA_SOCKET_IOCTL 5 + +#endif /*__PTA_SOCKET*/ diff --git a/ta_export/host_include/signed_hdr.h b/ta_export/host_include/signed_hdr.h index 034ce68..c6e61e7 100644 --- a/ta_export/host_include/signed_hdr.h +++ b/ta_export/host_include/signed_hdr.h @@ -37,6 +37,18 @@ enum shdr_img_type { #define SHDR_MAGIC 0x4f545348 +enum img_key_type { + IMG_KEY_NONE = 0, + IMG_KEY_AES256, + IMG_KEY_AES256_ENCRYPT, +}; + +#define TA_SIGN_RSA_PUB_KEY_SIZE (256) +#define TA_SIGN_SHA_DIGEST_SIZE (32) +#define TA_ENC_AES_KEY_SIZE (32) +#define TA_ENC_AES_IV_SIZE (16) +#define TA_ENC_AES_BLOCK_SIZE (16) + /** * struct shdr - signed header * @magic: magic number must match SHDR_MAGIC @@ -52,17 +64,16 @@ enum shdr_img_type { struct shdr { uint32_t magic; uint32_t version; + uint32_t flags; + uint32_t algo; + uint32_t arb_cvn; uint32_t img_type; uint32_t img_size; - uint32_t algo; - uint32_t reserve1; - uint32_t reserve2; - uint16_t hash_size; - uint16_t sig_size; - uint16_t pub_key_size; - uint16_t sig_key_size; - uint16_t reserve3_size; - uint16_t reserve4_size; + uint32_t key_type; + uint32_t rsv[8]; + + uint8_t aes_key[TA_ENC_AES_KEY_SIZE]; + uint8_t aes_iv[TA_ENC_AES_IV_SIZE]; /* * Commented out element used to visualize the layout dynamic part @@ -76,12 +87,17 @@ struct shdr { */ }; -#define SHDR_GET_SIZE(x) (sizeof(struct shdr) + (x)->hash_size + \ - (x)->sig_size + (x)->pub_key_size + (x)->sig_key_size + \ - (x)->reserve3_size + (x)->reserve4_size) -#define SHDR_GET_HASH(x) (uint8_t *)(((struct shdr *)(x)) + 1) -#define SHDR_GET_SIG(x) (SHDR_GET_HASH(x) + (x)->hash_size) -#define SHDR_GET_PUB_KEY(x) (SHDR_GET_SIG(x) + (x)->sig_size) -#define SHDR_GET_SIG_KEY(x) (SHDR_GET_PUB_KEY(x) + (x)->pub_key_size) +#define TA_HEADER_INFO_SIZE (sizeof(struct shdr)) + +#define SHDR_GET_SIZE(x) ((((struct shdr *)(x))->img_type == \ + SHDR_TA_SIGNED)?(TA_HEADER_INFO_SIZE + TA_SIGN_SHA_DIGEST_SIZE +\ + 3*TA_SIGN_RSA_PUB_KEY_SIZE) : (TA_HEADER_INFO_SIZE + TA_SIGN_SHA_DIGEST_SIZE)) +#define SHDR_GET_HASH(x) ((uint8_t *)(x) + TA_HEADER_INFO_SIZE) +#define SHDR_GET_SIG(x) ((uint8_t *)(x) + TA_HEADER_INFO_SIZE +\ + TA_SIGN_SHA_DIGEST_SIZE) +#define SHDR_GET_PUB_KEY(x) ((uint8_t *)(x) + TA_HEADER_INFO_SIZE +\ + TA_SIGN_SHA_DIGEST_SIZE + TA_SIGN_RSA_PUB_KEY_SIZE) +#define SHDR_GET_SIG_KEY(x) ((uint8_t *)(x) + TA_HEADER_INFO_SIZE +\ + TA_SIGN_SHA_DIGEST_SIZE + TA_SIGN_RSA_PUB_KEY_SIZE + TA_SIGN_RSA_PUB_KEY_SIZE) #endif /*SIGNED_HDR_H*/ diff --git a/ta_export/host_include/tee_api.h b/ta_export/host_include/tee_api.h index db42f9f..b535f0a 100644 --- a/ta_export/host_include/tee_api.h +++ b/ta_export/host_include/tee_api.h @@ -41,24 +41,24 @@ /* Property access functions */ TEE_Result TEE_GetPropertyAsString(TEE_PropSetHandle propsetOrEnumerator, - char *name, char *valueBuffer, + const char *name, char *valueBuffer, uint32_t *valueBufferLen); TEE_Result TEE_GetPropertyAsBool(TEE_PropSetHandle propsetOrEnumerator, - char *name, bool *value); + const char *name, bool *value); TEE_Result TEE_GetPropertyAsU32(TEE_PropSetHandle propsetOrEnumerator, - char *name, uint32_t *value); + const char *name, uint32_t *value); TEE_Result TEE_GetPropertyAsBinaryBlock(TEE_PropSetHandle propsetOrEnumerator, - char *name, void *valueBuffer, + const char *name, void *valueBuffer, uint32_t *valueBufferLen); TEE_Result TEE_GetPropertyAsUUID(TEE_PropSetHandle propsetOrEnumerator, - char *name, TEE_UUID *value); + const char *name, TEE_UUID *value); TEE_Result TEE_GetPropertyAsIdentity(TEE_PropSetHandle propsetOrEnumerator, - char *name, TEE_Identity *value); + const char *name, TEE_Identity *value); TEE_Result TEE_AllocatePropertyEnumerator(TEE_PropSetHandle *enumerator); @@ -115,13 +115,13 @@ bool TEE_MaskCancellation(void); TEE_Result TEE_CheckMemoryAccessRights(uint32_t accessFlags, void *buffer, uint32_t size); -void TEE_SetInstanceData(void *instanceData); +void TEE_SetInstanceData(const void *instanceData); -void *TEE_GetInstanceData(void); +const void *TEE_GetInstanceData(void); void *TEE_Malloc(uint32_t size, uint32_t hint); -void *TEE_Realloc(void *buffer, uint32_t newSize); +void *TEE_Realloc(const void *buffer, uint32_t newSize); void TEE_Free(void *buffer); @@ -160,11 +160,11 @@ void TEE_FreeTransientObject(TEE_ObjectHandle object); void TEE_ResetTransientObject(TEE_ObjectHandle object); TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object, - TEE_Attribute *attrs, + const TEE_Attribute *attrs, uint32_t attrCount); void TEE_InitRefAttribute(TEE_Attribute *attr, uint32_t attributeID, - void *buffer, uint32_t length); + const void *buffer, uint32_t length); void TEE_InitValueAttribute(TEE_Attribute *attr, uint32_t attributeID, uint32_t a, uint32_t b); @@ -176,15 +176,15 @@ TEE_Result TEE_CopyObjectAttributes1(TEE_ObjectHandle destObject, TEE_ObjectHandle srcObject); TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize, - TEE_Attribute *params, uint32_t paramCount); + const TEE_Attribute *params, uint32_t paramCount); /* Data and Key Storage API - Persistent Object Functions */ -TEE_Result TEE_OpenPersistentObject(uint32_t storageID, void *objectID, +TEE_Result TEE_OpenPersistentObject(uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle *object); -TEE_Result TEE_CreatePersistentObject(uint32_t storageID, void *objectID, +TEE_Result TEE_CreatePersistentObject(uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle attributes, const void *initialData, @@ -219,7 +219,7 @@ TEE_Result TEE_GetNextPersistentObject(TEE_ObjectEnumHandle objectEnumerator, TEE_Result TEE_ReadObjectData(TEE_ObjectHandle object, void *buffer, uint32_t size, uint32_t *count); -TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, void *buffer, +TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, const void *buffer, uint32_t size); TEE_Result TEE_TruncateObjectData(TEE_ObjectHandle object, uint32_t size); @@ -256,77 +256,78 @@ void TEE_CopyOperation(TEE_OperationHandle dstOperation, /* Cryptographic Operations API - Message Digest Functions */ void TEE_DigestUpdate(TEE_OperationHandle operation, - void *chunk, uint32_t chunkSize); + const void *chunk, uint32_t chunkSize); -TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, void *chunk, +TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, const void *chunk, uint32_t chunkLen, void *hash, uint32_t *hashLen); /* Cryptographic Operations API - Symmetric Cipher Functions */ -void TEE_CipherInit(TEE_OperationHandle operation, void *IV, +void TEE_CipherInit(TEE_OperationHandle operation, const void *IV, uint32_t IVLen); -TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, void *srcData, +TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_CipherUpdateWithoutBuffering(TEE_OperationHandle operation, void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_CipherDoFinal(TEE_OperationHandle operation, - void *srcData, uint32_t srcLen, void *destData, - uint32_t *destLen); + const void *srcData, uint32_t srcLen, + void *destData, uint32_t *destLen); /* Cryptographic Operations API - MAC Functions */ -void TEE_MACInit(TEE_OperationHandle operation, void *IV, uint32_t IVLen); +void TEE_MACInit(TEE_OperationHandle operation, const void *IV, + uint32_t IVLen); -void TEE_MACUpdate(TEE_OperationHandle operation, void *chunk, +void TEE_MACUpdate(TEE_OperationHandle operation, const void *chunk, uint32_t chunkSize); TEE_Result TEE_MACComputeFinal(TEE_OperationHandle operation, - void *message, uint32_t messageLen, + const void *message, uint32_t messageLen, void *mac, uint32_t *macLen); TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, - void *message, uint32_t messageLen, - void *mac, uint32_t macLen); + const void *message, uint32_t messageLen, + const void *mac, uint32_t macLen); /* Cryptographic Operations API - Authenticated Encryption Functions */ -TEE_Result TEE_AEInit(TEE_OperationHandle operation, void *nonce, +TEE_Result TEE_AEInit(TEE_OperationHandle operation, const void *nonce, uint32_t nonceLen, uint32_t tagLen, uint32_t AADLen, uint32_t payloadLen); -void TEE_AEUpdateAAD(TEE_OperationHandle operation, void *AADdata, +void TEE_AEUpdateAAD(TEE_OperationHandle operation, const void *AADdata, uint32_t AADdataLen); -TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, void *srcData, +TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_AEUpdateWithoutBuffering(TEE_OperationHandle operation, void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, - void *srcData, uint32_t srcLen, + const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen, void *tag, uint32_t *tagLen); TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, - void *srcData, uint32_t srcLen, + const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen, void *tag, uint32_t tagLen); /* Cryptographic Operations API - Asymmetric Functions */ TEE_Result TEE_AsymmetricEncrypt(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *srcData, + const TEE_Attribute *params, + uint32_t paramCount, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_AsymmetricDecrypt(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *srcData, + const TEE_Attribute *params, + uint32_t paramCount, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); @@ -343,15 +344,15 @@ TEE_Result TEE_AsymmetricVerify(TEE_OperationHandle operation, uint32_t signatureLen); TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *digest, + const TEE_Attribute *params, + uint32_t paramCount, const void *digest, uint32_t digestLen, void *signature, uint32_t *signatureLen); TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *digest, - uint32_t digestLen, void *signature, + const TEE_Attribute *params, + uint32_t paramCount, const void *digest, + uint32_t digestLen, const void *signature, uint32_t signatureLen); /* Cryptographic Operations API - Key Derivation Functions */ @@ -393,101 +394,101 @@ uint32_t TEE_BigIntFMMContextSizeInU32(uint32_t modulusSizeInBits); void TEE_BigIntInit(TEE_BigInt *bigInt, uint32_t len); void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext *context, uint32_t len, - TEE_BigInt *modulus); + const TEE_BigInt *modulus); void TEE_BigIntInitFMM(TEE_BigIntFMM *bigIntFMM, uint32_t len); /* TEE Arithmetical API - Converter functions */ TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt *dest, - uint8_t *buffer, + const uint8_t *buffer, uint32_t bufferLen, int32_t sign); TEE_Result TEE_BigIntConvertToOctetString(uint8_t *buffer, uint32_t *bufferLen, - TEE_BigInt *bigInt); + const TEE_BigInt *bigInt); void TEE_BigIntConvertFromS32(TEE_BigInt *dest, int32_t shortVal); -TEE_Result TEE_BigIntConvertToS32(int32_t *dest, TEE_BigInt *src); +TEE_Result TEE_BigIntConvertToS32(int32_t *dest, const TEE_BigInt *src); /* TEE Arithmetical API - Logical operations */ -int32_t TEE_BigIntCmp(TEE_BigInt *op1, TEE_BigInt *op2); +int32_t TEE_BigIntCmp(const TEE_BigInt *op1, const TEE_BigInt *op2); -int32_t TEE_BigIntCmpS32(TEE_BigInt *op, int32_t shortVal); +int32_t TEE_BigIntCmpS32(const TEE_BigInt *op, int32_t shortVal); -void TEE_BigIntShiftRight(TEE_BigInt *dest, TEE_BigInt *op, +void TEE_BigIntShiftRight(TEE_BigInt *dest, const TEE_BigInt *op, size_t bits); -bool TEE_BigIntGetBit(TEE_BigInt *src, uint32_t bitIndex); +bool TEE_BigIntGetBit(const TEE_BigInt *src, uint32_t bitIndex); -uint32_t TEE_BigIntGetBitCount(TEE_BigInt *src); +uint32_t TEE_BigIntGetBitCount(const TEE_BigInt *src); -void TEE_BigIntAdd(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2); +void TEE_BigIntAdd(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2); -void TEE_BigIntSub(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2); +void TEE_BigIntSub(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2); -void TEE_BigIntNeg(TEE_BigInt *dest, TEE_BigInt *op); +void TEE_BigIntNeg(TEE_BigInt *dest, const TEE_BigInt *op); -void TEE_BigIntMul(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2); +void TEE_BigIntMul(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2); -void TEE_BigIntSquare(TEE_BigInt *dest, TEE_BigInt *op); +void TEE_BigIntSquare(TEE_BigInt *dest, const TEE_BigInt *op); void TEE_BigIntDiv(TEE_BigInt *dest_q, TEE_BigInt *dest_r, - TEE_BigInt *op1, TEE_BigInt *op2); + const TEE_BigInt *op1, const TEE_BigInt *op2); /* TEE Arithmetical API - Modular arithmetic operations */ -void TEE_BigIntMod(TEE_BigInt *dest, TEE_BigInt *op, - TEE_BigInt *n); +void TEE_BigIntMod(TEE_BigInt *dest, const TEE_BigInt *op, + const TEE_BigInt *n); -void TEE_BigIntAddMod(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2, TEE_BigInt *n); +void TEE_BigIntAddMod(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2, const TEE_BigInt *n); -void TEE_BigIntSubMod(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2, TEE_BigInt *n); +void TEE_BigIntSubMod(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2, const TEE_BigInt *n); -void TEE_BigIntMulMod(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2, TEE_BigInt *n); +void TEE_BigIntMulMod(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2, const TEE_BigInt *n); -void TEE_BigIntSquareMod(TEE_BigInt *dest, TEE_BigInt *op, - TEE_BigInt *n); +void TEE_BigIntSquareMod(TEE_BigInt *dest, const TEE_BigInt *op, + const TEE_BigInt *n); -void TEE_BigIntInvMod(TEE_BigInt *dest, TEE_BigInt *op, - TEE_BigInt *n); +void TEE_BigIntInvMod(TEE_BigInt *dest, const TEE_BigInt *op, + const TEE_BigInt *n); /* TEE Arithmetical API - Other arithmetic operations */ -bool TEE_BigIntRelativePrime(TEE_BigInt *op1, TEE_BigInt *op2); +bool TEE_BigIntRelativePrime(const TEE_BigInt *op1, const TEE_BigInt *op2); void TEE_BigIntComputeExtendedGcd(TEE_BigInt *gcd, TEE_BigInt *u, - TEE_BigInt *v, TEE_BigInt *op1, - TEE_BigInt *op2); + TEE_BigInt *v, const TEE_BigInt *op1, + const TEE_BigInt *op2); -int32_t TEE_BigIntIsProbablePrime(TEE_BigInt *op, +int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt *op, uint32_t confidenceLevel); /* TEE Arithmetical API - Fast modular multiplication operations */ -void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, TEE_BigInt *src, - TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, const TEE_BigInt *src, + const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); -void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, TEE_BigIntFMM *src, - TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, const TEE_BigIntFMM *src, + const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); -void TEE_BigIntFMMConvertToBigInt(TEE_BigInt *dest, TEE_BigIntFMM *src, - TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntFMMConvertToBigInt(TEE_BigInt *dest, const TEE_BigIntFMM *src, + const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); -void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, TEE_BigIntFMM *op1, - TEE_BigIntFMM *op2, TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, const TEE_BigIntFMM *op1, + const TEE_BigIntFMM *op2, const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); typedef struct { paddr_t pa; diff --git a/ta_export/host_include/tee_fs_key_manager.h b/ta_export/host_include/tee_fs_key_manager.h index 71f766e..b7259aa 100644 --- a/ta_export/host_include/tee_fs_key_manager.h +++ b/ta_export/host_include/tee_fs_key_manager.h @@ -33,70 +33,17 @@ #define TEE_FS_KM_CHIP_ID_LENGTH 32 #define TEE_FS_KM_HMAC_ALG TEE_ALG_HMAC_SHA256 -#ifdef CFG_ENC_FS_ALG_AES_CTR_AND_HMAC -#define TEE_FS_KM_AUTH_ENC_ALG TEE_ALG_AES_CTR -#else -#define TEE_FS_KM_AUTH_ENC_ALG TEE_ALG_AES_GCM -#endif #define TEE_FS_KM_ENC_FEK_ALG TEE_ALG_AES_ECB_NOPAD #define TEE_FS_KM_SSK_SIZE TEE_SHA256_HASH_SIZE #define TEE_FS_KM_TSK_SIZE TEE_SHA256_HASH_SIZE #define TEE_FS_KM_FEK_SIZE 16 /* bytes */ -#ifdef CFG_ENC_FS_ALG_AES_CTR_AND_HMAC -#define TEE_FS_KM_IV_LEN 16 /* bytes */ -#else -#define TEE_FS_KM_IV_LEN 12 /* bytes */ -#endif -#define TEE_FS_KM_MAX_TAG_LEN 16 /* bytes */ - - -#define BLOCK_FILE_SHIFT 12 - -#define BLOCK_FILE_SIZE (1 << BLOCK_FILE_SHIFT) - -#define NUM_BLOCKS_PER_FILE 1024 - -enum tee_fs_file_type { - META_FILE, - BLOCK_FILE -}; -struct tee_fs_file_info { - uint64_t length; - uint32_t backup_version_table[NUM_BLOCKS_PER_FILE / 32]; -}; - -struct tee_fs_file_meta { - struct tee_fs_file_info info; - uint8_t encrypted_fek[TEE_FS_KM_FEK_SIZE]; - uint32_t counter; -}; - -struct common_header { - uint8_t iv[TEE_FS_KM_IV_LEN]; - uint8_t tag[TEE_FS_KM_MAX_TAG_LEN]; -}; - -struct meta_header { - uint8_t encrypted_key[TEE_FS_KM_FEK_SIZE]; - struct common_header common; -}; - -struct block_header { - struct common_header common; -}; - -size_t tee_fs_get_header_size(enum tee_fs_file_type type); TEE_Result tee_fs_generate_fek(uint8_t *encrypted_fek, int fek_size); -TEE_Result tee_fs_encrypt_file(enum tee_fs_file_type file_type, - const uint8_t *plaintext, size_t plaintext_size, - uint8_t *ciphertext, size_t *ciphertext_size, - const uint8_t *encrypted_fek); -TEE_Result tee_fs_decrypt_file(enum tee_fs_file_type file_type, - const uint8_t *data_in, size_t data_in_size, - uint8_t *plaintext, size_t *plaintext_size, - uint8_t *encrypted_fek); TEE_Result tee_fs_crypt_block(uint8_t *out, const uint8_t *in, size_t size, uint16_t blk_idx, const uint8_t *encrypted_fek, TEE_OperationMode mode); + +TEE_Result tee_fs_fek_crypt(TEE_OperationMode mode, const uint8_t *in_key, + size_t size, uint8_t *out_key); + #endif diff --git a/ta_export/host_include/tee_internal_api.h b/ta_export/host_include/tee_internal_api.h index e3eba8b..2c050e3 100644 --- a/ta_export/host_include/tee_internal_api.h +++ b/ta_export/host_include/tee_internal_api.h @@ -34,9 +34,4 @@ #include <tee_api_types.h> #include <tee_ta_api.h> -#define SLogTrace(...) -#define SLogError(...) -#define SLogWarning(...) -#define S_VAR_NOT_USED(x) - #endif diff --git a/ta_export/host_include/tee_isocket.h b/ta_export/host_include/tee_isocket.h new file mode 100644 index 0000000..15b5a97 --- a/dev/null +++ b/ta_export/host_include/tee_isocket.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_ISOCKET_H +#define __TEE_ISOCKET_H + +#include <stdint.h> +#include <tee_api_types.h> +#include <__tee_isocket_defines.h> + +typedef void *TEE_iSocketHandle; + +typedef const struct TEE_iSocket_s { + uint32_t TEE_iSocketVersion; + uint8_t protocolID; + TEE_Result (*open)(TEE_iSocketHandle *ctx, void *setup, + uint32_t *protocolError); + + TEE_Result (*close)(TEE_iSocketHandle ctx); + + TEE_Result (*send)(TEE_iSocketHandle ctx, const void *buf, + uint32_t *length, uint32_t timeout); + + TEE_Result (*recv)(TEE_iSocketHandle ctx, void *buf, uint32_t *length, + uint32_t timeout); + + uint32_t (*error)(TEE_iSocketHandle ctx); + + TEE_Result (*ioctl)(TEE_iSocketHandle ctx, uint32_t commandCode, + void *buf, uint32_t *length); +} TEE_iSocket; + +#endif /*__TEE_ISOCKET_H*/ diff --git a/ta_export/host_include/tee_tcpsocket.h b/ta_export/host_include/tee_tcpsocket.h new file mode 100644 index 0000000..f40cfcf --- a/dev/null +++ b/ta_export/host_include/tee_tcpsocket.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_TCPSOCKET_H +#define __TEE_TCPSOCKET_H + +#include <tee_isocket.h> +#include <__tee_ipsocket.h> +#include <__tee_tcpsocket_defines.h> + +typedef struct TEE_tcpSocket_Setup_s { + TEE_ipSocket_ipVersion ipVersion; + char *server_addr; + uint16_t server_port; +} TEE_tcpSocket_Setup; + +extern TEE_iSocket *const TEE_tcpSocket; + +#endif /*__TEE_TCPSOCKET_H*/ diff --git a/ta_export/host_include/tee_udpsocket.h b/ta_export/host_include/tee_udpsocket.h new file mode 100644 index 0000000..ae5e968 --- a/dev/null +++ b/ta_export/host_include/tee_udpsocket.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_UDPSOCKET_H +#define __TEE_UDPSOCKET_H + +#include <tee_isocket.h> +#include <__tee_ipsocket.h> +#include <__tee_udpsocket_defines.h> + +typedef struct TEE_udpSocket_Setup_s { + TEE_ipSocket_ipVersion ipVersion; + char *server_addr; + uint16_t server_port; +} TEE_udpSocket_Setup; + +extern TEE_iSocket *const TEE_udpSocket; + +#endif /*__TEE_UDPSOCKET_H*/ diff --git a/ta_export/host_include/user_ta_header.h b/ta_export/host_include/user_ta_header.h index aef5500..6691ebc 100644 --- a/ta_export/host_include/user_ta_header.h +++ b/ta_export/host_include/user_ta_header.h @@ -36,11 +36,7 @@ #define TA_FLAG_SINGLE_INSTANCE (1 << 2) #define TA_FLAG_MULTI_SESSION (1 << 3) #define TA_FLAG_INSTANCE_KEEP_ALIVE (1 << 4) /* remains after last close */ -/* - * TA_FLAG_UNSAFE_NW_PARAMS: May manipulate some secure memory based on - * physical pointers from non-secure world - */ -#define TA_FLAG_UNSAFE_NW_PARAMS (1 << 5) +#define TA_FLAG_SECURE_DATA_PATH (1 << 5) /* accesses SDP memory */ #define TA_FLAG_REMAP_SUPPORT (1 << 6) /* use map/unmap syscalls */ #define TA_FLAG_CACHE_MAINTENANCE (1 << 7) /* use cache flush syscall */ diff --git a/ta_export/host_include/utee_syscalls.h b/ta_export/host_include/utee_syscalls.h index b82ee3e..63af5f4 100644 --- a/ta_export/host_include/utee_syscalls.h +++ b/ta_export/host_include/utee_syscalls.h @@ -62,7 +62,8 @@ TEE_Result utee_get_property(unsigned long prop_set, unsigned long index, void *name, uint32_t *name_len, void *buf, uint32_t *blen, uint32_t *prop_type); -TEE_Result utee_get_property_name_to_index(unsigned long prop_set, void *name, +TEE_Result utee_get_property_name_to_index(unsigned long prop_set, + const void *name, unsigned long name_len, uint32_t *index); @@ -172,7 +173,8 @@ TEE_Result utee_asymm_verify(unsigned long state, /* Persistant Object Functions */ /* obj is of type TEE_ObjectHandle */ -TEE_Result utee_storage_obj_open(unsigned long storage_id, void *object_id, +TEE_Result utee_storage_obj_open(unsigned long storage_id, + const void *object_id, size_t object_id_len, unsigned long flags, uint32_t *obj); @@ -180,10 +182,11 @@ TEE_Result utee_storage_obj_open(unsigned long storage_id, void *object_id, * attr is of type TEE_ObjectHandle * obj is of type TEE_ObjectHandle */ -TEE_Result utee_storage_obj_create(unsigned long storage_id, void *object_id, - size_t object_id_len, unsigned long flags, - unsigned long attr, const void *data, - size_t len, uint32_t *obj); +TEE_Result utee_storage_obj_create(unsigned long storage_id, + const void *object_id, + size_t object_id_len, unsigned long flags, + unsigned long attr, const void *data, + size_t len, uint32_t *obj); /* obj is of type TEE_ObjectHandle */ TEE_Result utee_storage_obj_del(unsigned long obj); @@ -295,6 +298,8 @@ TEE_Result utee_se_channel_close(unsigned long c); /* op is of type enum utee_cache_operation */ TEE_Result utee_cache_operation(void *va, size_t l, unsigned long op); +TEE_Result utee_gprof_send(void *buf, size_t size, uint32_t *id); + TEE_Result utee_extend_func(uint32_t id, unsigned long param); #endif /* UTEE_SYSCALLS_H */ diff --git a/ta_export/host_include/util.h b/ta_export/host_include/util.h index f56649f..3a1e8a6 100644 --- a/ta_export/host_include/util.h +++ b/ta_export/host_include/util.h @@ -79,4 +79,15 @@ #endif #define BIT(nr) BIT32(nr) +/* + * Create a contiguous bitmask starting at bit position @l and ending at + * position @h. For example + * GENMASK_64(39, 21) gives us the 64bit vector 0x000000ffffe00000. + */ +#define GENMASK_32(h, l) \ + (((~UINT32_C(0)) << (l)) & (~UINT32_C(0) >> (32 - 1 - (h)))) + +#define GENMASK_64(h, l) \ + (((~UINT64_C(0)) << (l)) & (~UINT64_C(0) >> (64 - 1 - (h)))) + #endif /*UTIL_H*/ diff --git a/ta_export/include/__tee_ipsocket.h b/ta_export/include/__tee_ipsocket.h new file mode 100644 index 0000000..7c33666 --- a/dev/null +++ b/ta_export/include/__tee_ipsocket.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_IPSOCKET_H +#define ____TEE_IPSOCKET_H + +typedef enum TEE_ipSocket_ipVersion_e { + TEE_IP_VERSION_DC = 0, /* don’t care */ + TEE_IP_VERSION_4 = 1, + TEE_IP_VERSION_6 = 2 +} TEE_ipSocket_ipVersion; + +#endif /*____TEE_IPSOCKET_H*/ diff --git a/ta_export/include/__tee_isocket_defines.h b/ta_export/include/__tee_isocket_defines.h new file mode 100644 index 0000000..b38457a --- a/dev/null +++ b/ta_export/include/__tee_isocket_defines.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef ____TEE_ISOCKET_DEFINES_H +#define ____TEE_ISOCKET_DEFINES_H + +#define TEE_ISOCKET_VERSION 0x01000000 + +#define TEE_ISOCKET_ERROR_PROTOCOL 0xF1007001 +#define TEE_ISOCKET_ERROR_REMOTE_CLOSED 0xF1007002 +#define TEE_ISOCKET_ERROR_TIMEOUT 0xF1007003 +#define TEE_ISOCKET_ERROR_OUT_OF_RESOURCES 0xF1007004 +#define TEE_ISOCKET_ERROR_LARGE_BUFFER 0xF1007005 +#define TEE_ISOCKET_WARNING_PROTOCOL 0xF1007006 +#define TEE_ISOCKET_ERROR_HOSTNAME 0xF1007007 + +#endif /*____TEE_ISOCKET_DEFINES_H*/ diff --git a/ta_export/include/__tee_tcpsocket_defines.h b/ta_export/include/__tee_tcpsocket_defines.h new file mode 100644 index 0000000..21853e0 --- a/dev/null +++ b/ta_export/include/__tee_tcpsocket_defines.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_TCPSOCKET_DEFINES_H +#define ____TEE_TCPSOCKET_DEFINES_H + +/* Protocol identifier */ +#define TEE_ISOCKET_PROTOCOLID_TCP 0x65 + +/* Instance specific errors */ +#define TEE_ISOCKET_TCP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1010002 + +#endif /*____TEE_TCPSOCKET_DEFINES_H*/ diff --git a/ta_export/include/__tee_tcpsocket_defines_extensions.h b/ta_export/include/__tee_tcpsocket_defines_extensions.h new file mode 100644 index 0000000..3a03a2c --- a/dev/null +++ b/ta_export/include/__tee_tcpsocket_defines_extensions.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H +#define ____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H + +/* Instance and implementation specific ioctl functions */ +#define TEE_TCP_SET_RECVBUF 0x65f00000 +#define TEE_TCP_SET_SENDBUF 0x65f00001 + +#endif /*____TEE_TCPSOCKET_DEFINES_EXTENSIONS_H*/ diff --git a/ta_export/include/__tee_udpsocket_defines.h b/ta_export/include/__tee_udpsocket_defines.h new file mode 100644 index 0000000..64ec09c --- a/dev/null +++ b/ta_export/include/__tee_udpsocket_defines.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ____TEE_UDPSOCKET_DEFINES_H +#define ____TEE_UDPSOCKET_DEFINES_H + +/* Protocol identifier */ +#define TEE_ISOCKET_PROTOCOLID_UDP 0x66 + +/* Instance specific errors */ +#define TEE_ISOCKET_UDP_WARNING_UNKNOWN_OUT_OF_BAND 0xF1020002 + +/* Instance specific ioctl functions */ +#define TEE_UDP_CHANGEADDR 0x66000001 +#define TEE_UDP_CHANGEPORT 0x66000002 + +#endif /*____TEE_UDPSOCKET_DEFINES_H*/ diff --git a/ta_export/include/compiler.h b/ta_export/include/compiler.h index bb275bf..c1bd6a4 100644 --- a/ta_export/include/compiler.h +++ b/ta_export/include/compiler.h @@ -93,6 +93,9 @@ #ifndef __early_bss #define __early_bss __section(".early_bss") #endif +#ifndef __noprof +#define __noprof __attribute__((no_instrument_function)) +#endif #define __compiler_bswap64(x) __builtin_bswap64((x)) #define __compiler_bswap32(x) __builtin_bswap32((x)) diff --git a/ta_export/include/pta_gprof.h b/ta_export/include/pta_gprof.h new file mode 100644 index 0000000..9e95fb0 --- a/dev/null +++ b/ta_export/include/pta_gprof.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __PTA_GPROF_H +#define __PTA_GPROF_H + +/* + * Interface to the gprof pseudo-TA, which is used by libutee to control TA + * profiling and forward data to tee-supplicant. + */ + +#define PTA_GPROF_UUID { 0x2f6e0d48, 0xc574, 0x426d, { \ + 0x82, 0x4e, 0x40, 0x19, 0x8c, 0xde, 0x5c, 0xac } } + +/* + * Send TA profiling data (gmon.out format) to tee-supplicant + * Data may be sent in several chunks: first set id to 0, then re-use the + * allocated value in subsequent calls. + * + * [in/out] value[0].a: id + * [in] memref[1]: profiling data + */ +#define PTA_GPROF_SEND 0 + +/* + * Start PC sampling of a user TA session + * + * [in/out] memref[0]: sampling buffer + * [in] value[1].a: offset: the lowest PC value in the TA + * [in] value[1].b: scale: histogram scaling factor + */ +#define PTA_GPROF_START_PC_SAMPLING 1 + +/* + * Stop PC sampling of a user TA session and retrieve data + * + * [out] value[0].a: sampling frequency + */ +#define PTA_GPROF_STOP_PC_SAMPLING 2 + +#endif /* __PTA_GPROF_H */ diff --git a/ta_export/include/pta_invoke_tests.h b/ta_export/include/pta_invoke_tests.h new file mode 100644 index 0000000..1667af8 --- a/dev/null +++ b/ta_export/include/pta_invoke_tests.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __PTA_INVOKE_TESTS_H +#define __PTA_INVOKE_TESTS_H + +#define PTA_INVOKE_TESTS_UUID \ + { 0xd96a5b40, 0xc3e5, 0x21e3, \ + { 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } } + +/* Trace some hello string. Parameters are not used/checked. */ +#define PTA_INVOKE_TESTS_CMD_TRACE 0 + +/* + * Types of parameter drives the test sequences: + * - test on value parameters + * - test on SHM memory reference parameters + * - test on SDP memory reference parameters + */ +#define PTA_INVOKE_TESTS_CMD_PARAMS 1 + +/* Run some core internal tests. Parameters are not used/checked. */ +#define PTA_INVOKE_TESTS_CMD_SELF_TESTS 2 + +/* + * Secure data path: check that pTA can copy data from non-secure shared memory + * to SDP secure memory + * + * [in] memref[0] source (non-secure shared memory) + * [out] memref[1] destination (SDP secure memory) + */ +#define PTA_INVOKE_TESTS_CMD_COPY_NSEC_TO_SEC 3 + +/* + * Secure data path: check that pTA can read data from SDP secure memory and + * write it back. Data are processed so that client check the expected + * read/write sequence succeed. + * + * [in/out] memref[0] SDP secure buffer to read from and write to + */ +#define PTA_INVOKE_TESTS_CMD_READ_MODIFY_SEC 4 + +/* + * Secure data path: check that pTA can copy data from SDP secure memory to + * non-secure shared memory + * + * [in] memref[0] source (SDP secure memory) + * [out] memref[1] destination (non-secure shared memory) + */ +#define PTA_INVOKE_TESTS_CMD_COPY_SEC_TO_NSEC 5 + +/* + * Tests FS hash-tree corner cases in error handling + */ +#define PTA_INVOKE_TESTS_CMD_FS_HTREE 6 + +#endif /*__PTA_INVOKE_TESTS_H*/ + diff --git a/ta_export/include/pta_socket.h b/ta_export/include/pta_socket.h new file mode 100644 index 0000000..b39aa52 --- a/dev/null +++ b/ta_export/include/pta_socket.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __PTA_SOCKET +#define __PTA_SOCKET + +#define PTA_SOCKET_UUID { 0x3b996a7d, 0x2c2b, 0x4a49, { \ + 0xa8, 0x96, 0xe1, 0xfb, 0x57, 0x66, 0xd2, 0xf4 } } + +/* + * [in] value[0].a ip version TEE_IP_VERSION_* from tee_ipsocket.h + * [in] value[0].b server port number + * [in] memref[1] server address + * [in] value[2].a protocol, TEE_ISOCKET_PROTOCOLID_* + * [out] value[3].a socket handle + */ +#define PTA_SOCKET_OPEN 1 + +/* + * [in] value[0].a socket handle + */ +#define PTA_SOCKET_CLOSE 2 + +#define PTA_SOCKET_TIMEOUT_NONBLOCKING 0 +#define PTA_SOCKET_TIMEOUT_BLOCKING 0xffffffff + +/* + * [in] value[0].a socket handle + * [in] value[0].b timeout ms or TEE_TIMEOUT_INFINITE + * [in] memref[1] buffer to transmit + * [out] value[2].a number of transmitted bytes + */ +#define PTA_SOCKET_SEND 3 + +/* + * [in] value[0].a socket handle + * [in] value[0].b timeout ms or TEE_TIMEOUT_INFINITE + * [out] memref[1] buffer + */ +#define PTA_SOCKET_RECV 4 + +/* + * [in] value[0].a socket handle + * [in] value[0].b ioctl command + * [in/out] memref[1] buffer + */ +#define PTA_SOCKET_IOCTL 5 + +#endif /*__PTA_SOCKET*/ diff --git a/ta_export/include/tee_api.h b/ta_export/include/tee_api.h index db42f9f..b535f0a 100644 --- a/ta_export/include/tee_api.h +++ b/ta_export/include/tee_api.h @@ -41,24 +41,24 @@ /* Property access functions */ TEE_Result TEE_GetPropertyAsString(TEE_PropSetHandle propsetOrEnumerator, - char *name, char *valueBuffer, + const char *name, char *valueBuffer, uint32_t *valueBufferLen); TEE_Result TEE_GetPropertyAsBool(TEE_PropSetHandle propsetOrEnumerator, - char *name, bool *value); + const char *name, bool *value); TEE_Result TEE_GetPropertyAsU32(TEE_PropSetHandle propsetOrEnumerator, - char *name, uint32_t *value); + const char *name, uint32_t *value); TEE_Result TEE_GetPropertyAsBinaryBlock(TEE_PropSetHandle propsetOrEnumerator, - char *name, void *valueBuffer, + const char *name, void *valueBuffer, uint32_t *valueBufferLen); TEE_Result TEE_GetPropertyAsUUID(TEE_PropSetHandle propsetOrEnumerator, - char *name, TEE_UUID *value); + const char *name, TEE_UUID *value); TEE_Result TEE_GetPropertyAsIdentity(TEE_PropSetHandle propsetOrEnumerator, - char *name, TEE_Identity *value); + const char *name, TEE_Identity *value); TEE_Result TEE_AllocatePropertyEnumerator(TEE_PropSetHandle *enumerator); @@ -115,13 +115,13 @@ bool TEE_MaskCancellation(void); TEE_Result TEE_CheckMemoryAccessRights(uint32_t accessFlags, void *buffer, uint32_t size); -void TEE_SetInstanceData(void *instanceData); +void TEE_SetInstanceData(const void *instanceData); -void *TEE_GetInstanceData(void); +const void *TEE_GetInstanceData(void); void *TEE_Malloc(uint32_t size, uint32_t hint); -void *TEE_Realloc(void *buffer, uint32_t newSize); +void *TEE_Realloc(const void *buffer, uint32_t newSize); void TEE_Free(void *buffer); @@ -160,11 +160,11 @@ void TEE_FreeTransientObject(TEE_ObjectHandle object); void TEE_ResetTransientObject(TEE_ObjectHandle object); TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object, - TEE_Attribute *attrs, + const TEE_Attribute *attrs, uint32_t attrCount); void TEE_InitRefAttribute(TEE_Attribute *attr, uint32_t attributeID, - void *buffer, uint32_t length); + const void *buffer, uint32_t length); void TEE_InitValueAttribute(TEE_Attribute *attr, uint32_t attributeID, uint32_t a, uint32_t b); @@ -176,15 +176,15 @@ TEE_Result TEE_CopyObjectAttributes1(TEE_ObjectHandle destObject, TEE_ObjectHandle srcObject); TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize, - TEE_Attribute *params, uint32_t paramCount); + const TEE_Attribute *params, uint32_t paramCount); /* Data and Key Storage API - Persistent Object Functions */ -TEE_Result TEE_OpenPersistentObject(uint32_t storageID, void *objectID, +TEE_Result TEE_OpenPersistentObject(uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle *object); -TEE_Result TEE_CreatePersistentObject(uint32_t storageID, void *objectID, +TEE_Result TEE_CreatePersistentObject(uint32_t storageID, const void *objectID, uint32_t objectIDLen, uint32_t flags, TEE_ObjectHandle attributes, const void *initialData, @@ -219,7 +219,7 @@ TEE_Result TEE_GetNextPersistentObject(TEE_ObjectEnumHandle objectEnumerator, TEE_Result TEE_ReadObjectData(TEE_ObjectHandle object, void *buffer, uint32_t size, uint32_t *count); -TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, void *buffer, +TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, const void *buffer, uint32_t size); TEE_Result TEE_TruncateObjectData(TEE_ObjectHandle object, uint32_t size); @@ -256,77 +256,78 @@ void TEE_CopyOperation(TEE_OperationHandle dstOperation, /* Cryptographic Operations API - Message Digest Functions */ void TEE_DigestUpdate(TEE_OperationHandle operation, - void *chunk, uint32_t chunkSize); + const void *chunk, uint32_t chunkSize); -TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, void *chunk, +TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, const void *chunk, uint32_t chunkLen, void *hash, uint32_t *hashLen); /* Cryptographic Operations API - Symmetric Cipher Functions */ -void TEE_CipherInit(TEE_OperationHandle operation, void *IV, +void TEE_CipherInit(TEE_OperationHandle operation, const void *IV, uint32_t IVLen); -TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, void *srcData, +TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_CipherUpdateWithoutBuffering(TEE_OperationHandle operation, void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_CipherDoFinal(TEE_OperationHandle operation, - void *srcData, uint32_t srcLen, void *destData, - uint32_t *destLen); + const void *srcData, uint32_t srcLen, + void *destData, uint32_t *destLen); /* Cryptographic Operations API - MAC Functions */ -void TEE_MACInit(TEE_OperationHandle operation, void *IV, uint32_t IVLen); +void TEE_MACInit(TEE_OperationHandle operation, const void *IV, + uint32_t IVLen); -void TEE_MACUpdate(TEE_OperationHandle operation, void *chunk, +void TEE_MACUpdate(TEE_OperationHandle operation, const void *chunk, uint32_t chunkSize); TEE_Result TEE_MACComputeFinal(TEE_OperationHandle operation, - void *message, uint32_t messageLen, + const void *message, uint32_t messageLen, void *mac, uint32_t *macLen); TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, - void *message, uint32_t messageLen, - void *mac, uint32_t macLen); + const void *message, uint32_t messageLen, + const void *mac, uint32_t macLen); /* Cryptographic Operations API - Authenticated Encryption Functions */ -TEE_Result TEE_AEInit(TEE_OperationHandle operation, void *nonce, +TEE_Result TEE_AEInit(TEE_OperationHandle operation, const void *nonce, uint32_t nonceLen, uint32_t tagLen, uint32_t AADLen, uint32_t payloadLen); -void TEE_AEUpdateAAD(TEE_OperationHandle operation, void *AADdata, +void TEE_AEUpdateAAD(TEE_OperationHandle operation, const void *AADdata, uint32_t AADdataLen); -TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, void *srcData, +TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_AEUpdateWithoutBuffering(TEE_OperationHandle operation, void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, - void *srcData, uint32_t srcLen, + const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen, void *tag, uint32_t *tagLen); TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, - void *srcData, uint32_t srcLen, + const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen, void *tag, uint32_t tagLen); /* Cryptographic Operations API - Asymmetric Functions */ TEE_Result TEE_AsymmetricEncrypt(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *srcData, + const TEE_Attribute *params, + uint32_t paramCount, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); TEE_Result TEE_AsymmetricDecrypt(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *srcData, + const TEE_Attribute *params, + uint32_t paramCount, const void *srcData, uint32_t srcLen, void *destData, uint32_t *destLen); @@ -343,15 +344,15 @@ TEE_Result TEE_AsymmetricVerify(TEE_OperationHandle operation, uint32_t signatureLen); TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *digest, + const TEE_Attribute *params, + uint32_t paramCount, const void *digest, uint32_t digestLen, void *signature, uint32_t *signatureLen); TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation, - TEE_Attribute *params, - uint32_t paramCount, void *digest, - uint32_t digestLen, void *signature, + const TEE_Attribute *params, + uint32_t paramCount, const void *digest, + uint32_t digestLen, const void *signature, uint32_t signatureLen); /* Cryptographic Operations API - Key Derivation Functions */ @@ -393,101 +394,101 @@ uint32_t TEE_BigIntFMMContextSizeInU32(uint32_t modulusSizeInBits); void TEE_BigIntInit(TEE_BigInt *bigInt, uint32_t len); void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext *context, uint32_t len, - TEE_BigInt *modulus); + const TEE_BigInt *modulus); void TEE_BigIntInitFMM(TEE_BigIntFMM *bigIntFMM, uint32_t len); /* TEE Arithmetical API - Converter functions */ TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt *dest, - uint8_t *buffer, + const uint8_t *buffer, uint32_t bufferLen, int32_t sign); TEE_Result TEE_BigIntConvertToOctetString(uint8_t *buffer, uint32_t *bufferLen, - TEE_BigInt *bigInt); + const TEE_BigInt *bigInt); void TEE_BigIntConvertFromS32(TEE_BigInt *dest, int32_t shortVal); -TEE_Result TEE_BigIntConvertToS32(int32_t *dest, TEE_BigInt *src); +TEE_Result TEE_BigIntConvertToS32(int32_t *dest, const TEE_BigInt *src); /* TEE Arithmetical API - Logical operations */ -int32_t TEE_BigIntCmp(TEE_BigInt *op1, TEE_BigInt *op2); +int32_t TEE_BigIntCmp(const TEE_BigInt *op1, const TEE_BigInt *op2); -int32_t TEE_BigIntCmpS32(TEE_BigInt *op, int32_t shortVal); +int32_t TEE_BigIntCmpS32(const TEE_BigInt *op, int32_t shortVal); -void TEE_BigIntShiftRight(TEE_BigInt *dest, TEE_BigInt *op, +void TEE_BigIntShiftRight(TEE_BigInt *dest, const TEE_BigInt *op, size_t bits); -bool TEE_BigIntGetBit(TEE_BigInt *src, uint32_t bitIndex); +bool TEE_BigIntGetBit(const TEE_BigInt *src, uint32_t bitIndex); -uint32_t TEE_BigIntGetBitCount(TEE_BigInt *src); +uint32_t TEE_BigIntGetBitCount(const TEE_BigInt *src); -void TEE_BigIntAdd(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2); +void TEE_BigIntAdd(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2); -void TEE_BigIntSub(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2); +void TEE_BigIntSub(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2); -void TEE_BigIntNeg(TEE_BigInt *dest, TEE_BigInt *op); +void TEE_BigIntNeg(TEE_BigInt *dest, const TEE_BigInt *op); -void TEE_BigIntMul(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2); +void TEE_BigIntMul(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2); -void TEE_BigIntSquare(TEE_BigInt *dest, TEE_BigInt *op); +void TEE_BigIntSquare(TEE_BigInt *dest, const TEE_BigInt *op); void TEE_BigIntDiv(TEE_BigInt *dest_q, TEE_BigInt *dest_r, - TEE_BigInt *op1, TEE_BigInt *op2); + const TEE_BigInt *op1, const TEE_BigInt *op2); /* TEE Arithmetical API - Modular arithmetic operations */ -void TEE_BigIntMod(TEE_BigInt *dest, TEE_BigInt *op, - TEE_BigInt *n); +void TEE_BigIntMod(TEE_BigInt *dest, const TEE_BigInt *op, + const TEE_BigInt *n); -void TEE_BigIntAddMod(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2, TEE_BigInt *n); +void TEE_BigIntAddMod(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2, const TEE_BigInt *n); -void TEE_BigIntSubMod(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2, TEE_BigInt *n); +void TEE_BigIntSubMod(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2, const TEE_BigInt *n); -void TEE_BigIntMulMod(TEE_BigInt *dest, TEE_BigInt *op1, - TEE_BigInt *op2, TEE_BigInt *n); +void TEE_BigIntMulMod(TEE_BigInt *dest, const TEE_BigInt *op1, + const TEE_BigInt *op2, const TEE_BigInt *n); -void TEE_BigIntSquareMod(TEE_BigInt *dest, TEE_BigInt *op, - TEE_BigInt *n); +void TEE_BigIntSquareMod(TEE_BigInt *dest, const TEE_BigInt *op, + const TEE_BigInt *n); -void TEE_BigIntInvMod(TEE_BigInt *dest, TEE_BigInt *op, - TEE_BigInt *n); +void TEE_BigIntInvMod(TEE_BigInt *dest, const TEE_BigInt *op, + const TEE_BigInt *n); /* TEE Arithmetical API - Other arithmetic operations */ -bool TEE_BigIntRelativePrime(TEE_BigInt *op1, TEE_BigInt *op2); +bool TEE_BigIntRelativePrime(const TEE_BigInt *op1, const TEE_BigInt *op2); void TEE_BigIntComputeExtendedGcd(TEE_BigInt *gcd, TEE_BigInt *u, - TEE_BigInt *v, TEE_BigInt *op1, - TEE_BigInt *op2); + TEE_BigInt *v, const TEE_BigInt *op1, + const TEE_BigInt *op2); -int32_t TEE_BigIntIsProbablePrime(TEE_BigInt *op, +int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt *op, uint32_t confidenceLevel); /* TEE Arithmetical API - Fast modular multiplication operations */ -void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, TEE_BigInt *src, - TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntConvertToFMM(TEE_BigIntFMM *dest, const TEE_BigInt *src, + const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); -void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, TEE_BigIntFMM *src, - TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntConvertFromFMM(TEE_BigInt *dest, const TEE_BigIntFMM *src, + const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); -void TEE_BigIntFMMConvertToBigInt(TEE_BigInt *dest, TEE_BigIntFMM *src, - TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntFMMConvertToBigInt(TEE_BigInt *dest, const TEE_BigIntFMM *src, + const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); -void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, TEE_BigIntFMM *op1, - TEE_BigIntFMM *op2, TEE_BigInt *n, - TEE_BigIntFMMContext *context); +void TEE_BigIntComputeFMM(TEE_BigIntFMM *dest, const TEE_BigIntFMM *op1, + const TEE_BigIntFMM *op2, const TEE_BigInt *n, + const TEE_BigIntFMMContext *context); typedef struct { paddr_t pa; diff --git a/ta_export/include/tee_internal_api.h b/ta_export/include/tee_internal_api.h index e3eba8b..2c050e3 100644 --- a/ta_export/include/tee_internal_api.h +++ b/ta_export/include/tee_internal_api.h @@ -34,9 +34,4 @@ #include <tee_api_types.h> #include <tee_ta_api.h> -#define SLogTrace(...) -#define SLogError(...) -#define SLogWarning(...) -#define S_VAR_NOT_USED(x) - #endif diff --git a/ta_export/include/tee_isocket.h b/ta_export/include/tee_isocket.h new file mode 100644 index 0000000..15b5a97 --- a/dev/null +++ b/ta_export/include/tee_isocket.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_ISOCKET_H +#define __TEE_ISOCKET_H + +#include <stdint.h> +#include <tee_api_types.h> +#include <__tee_isocket_defines.h> + +typedef void *TEE_iSocketHandle; + +typedef const struct TEE_iSocket_s { + uint32_t TEE_iSocketVersion; + uint8_t protocolID; + TEE_Result (*open)(TEE_iSocketHandle *ctx, void *setup, + uint32_t *protocolError); + + TEE_Result (*close)(TEE_iSocketHandle ctx); + + TEE_Result (*send)(TEE_iSocketHandle ctx, const void *buf, + uint32_t *length, uint32_t timeout); + + TEE_Result (*recv)(TEE_iSocketHandle ctx, void *buf, uint32_t *length, + uint32_t timeout); + + uint32_t (*error)(TEE_iSocketHandle ctx); + + TEE_Result (*ioctl)(TEE_iSocketHandle ctx, uint32_t commandCode, + void *buf, uint32_t *length); +} TEE_iSocket; + +#endif /*__TEE_ISOCKET_H*/ diff --git a/ta_export/include/tee_tcpsocket.h b/ta_export/include/tee_tcpsocket.h new file mode 100644 index 0000000..f40cfcf --- a/dev/null +++ b/ta_export/include/tee_tcpsocket.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_TCPSOCKET_H +#define __TEE_TCPSOCKET_H + +#include <tee_isocket.h> +#include <__tee_ipsocket.h> +#include <__tee_tcpsocket_defines.h> + +typedef struct TEE_tcpSocket_Setup_s { + TEE_ipSocket_ipVersion ipVersion; + char *server_addr; + uint16_t server_port; +} TEE_tcpSocket_Setup; + +extern TEE_iSocket *const TEE_tcpSocket; + +#endif /*__TEE_TCPSOCKET_H*/ diff --git a/ta_export/include/tee_udpsocket.h b/ta_export/include/tee_udpsocket.h new file mode 100644 index 0000000..ae5e968 --- a/dev/null +++ b/ta_export/include/tee_udpsocket.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016-2017, Linaro Limited + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __TEE_UDPSOCKET_H +#define __TEE_UDPSOCKET_H + +#include <tee_isocket.h> +#include <__tee_ipsocket.h> +#include <__tee_udpsocket_defines.h> + +typedef struct TEE_udpSocket_Setup_s { + TEE_ipSocket_ipVersion ipVersion; + char *server_addr; + uint16_t server_port; +} TEE_udpSocket_Setup; + +extern TEE_iSocket *const TEE_udpSocket; + +#endif /*__TEE_UDPSOCKET_H*/ diff --git a/ta_export/include/user_ta_header.h b/ta_export/include/user_ta_header.h index aef5500..6691ebc 100644 --- a/ta_export/include/user_ta_header.h +++ b/ta_export/include/user_ta_header.h @@ -36,11 +36,7 @@ #define TA_FLAG_SINGLE_INSTANCE (1 << 2) #define TA_FLAG_MULTI_SESSION (1 << 3) #define TA_FLAG_INSTANCE_KEEP_ALIVE (1 << 4) /* remains after last close */ -/* - * TA_FLAG_UNSAFE_NW_PARAMS: May manipulate some secure memory based on - * physical pointers from non-secure world - */ -#define TA_FLAG_UNSAFE_NW_PARAMS (1 << 5) +#define TA_FLAG_SECURE_DATA_PATH (1 << 5) /* accesses SDP memory */ #define TA_FLAG_REMAP_SUPPORT (1 << 6) /* use map/unmap syscalls */ #define TA_FLAG_CACHE_MAINTENANCE (1 << 7) /* use cache flush syscall */ diff --git a/ta_export/include/utee_syscalls.h b/ta_export/include/utee_syscalls.h index b82ee3e..63af5f4 100644 --- a/ta_export/include/utee_syscalls.h +++ b/ta_export/include/utee_syscalls.h @@ -62,7 +62,8 @@ TEE_Result utee_get_property(unsigned long prop_set, unsigned long index, void *name, uint32_t *name_len, void *buf, uint32_t *blen, uint32_t *prop_type); -TEE_Result utee_get_property_name_to_index(unsigned long prop_set, void *name, +TEE_Result utee_get_property_name_to_index(unsigned long prop_set, + const void *name, unsigned long name_len, uint32_t *index); @@ -172,7 +173,8 @@ TEE_Result utee_asymm_verify(unsigned long state, /* Persistant Object Functions */ /* obj is of type TEE_ObjectHandle */ -TEE_Result utee_storage_obj_open(unsigned long storage_id, void *object_id, +TEE_Result utee_storage_obj_open(unsigned long storage_id, + const void *object_id, size_t object_id_len, unsigned long flags, uint32_t *obj); @@ -180,10 +182,11 @@ TEE_Result utee_storage_obj_open(unsigned long storage_id, void *object_id, * attr is of type TEE_ObjectHandle * obj is of type TEE_ObjectHandle */ -TEE_Result utee_storage_obj_create(unsigned long storage_id, void *object_id, - size_t object_id_len, unsigned long flags, - unsigned long attr, const void *data, - size_t len, uint32_t *obj); +TEE_Result utee_storage_obj_create(unsigned long storage_id, + const void *object_id, + size_t object_id_len, unsigned long flags, + unsigned long attr, const void *data, + size_t len, uint32_t *obj); /* obj is of type TEE_ObjectHandle */ TEE_Result utee_storage_obj_del(unsigned long obj); @@ -295,6 +298,8 @@ TEE_Result utee_se_channel_close(unsigned long c); /* op is of type enum utee_cache_operation */ TEE_Result utee_cache_operation(void *va, size_t l, unsigned long op); +TEE_Result utee_gprof_send(void *buf, size_t size, uint32_t *id); + TEE_Result utee_extend_func(uint32_t id, unsigned long param); #endif /* UTEE_SYSCALLS_H */ diff --git a/ta_export/include/util.h b/ta_export/include/util.h index f56649f..3a1e8a6 100644 --- a/ta_export/include/util.h +++ b/ta_export/include/util.h @@ -79,4 +79,15 @@ #endif #define BIT(nr) BIT32(nr) +/* + * Create a contiguous bitmask starting at bit position @l and ending at + * position @h. For example + * GENMASK_64(39, 21) gives us the 64bit vector 0x000000ffffe00000. + */ +#define GENMASK_32(h, l) \ + (((~UINT32_C(0)) << (l)) & (~UINT32_C(0) >> (32 - 1 - (h)))) + +#define GENMASK_64(h, l) \ + (((~UINT64_C(0)) << (l)) & (~UINT64_C(0) >> (64 - 1 - (h)))) + #endif /*UTIL_H*/ diff --git a/ta_export/keys/ta_rsa_pub_key.pem b/ta_export/keys/ta_rsa_pub_key.pem new file mode 100644 index 0000000..ccef603 --- a/dev/null +++ b/ta_export/keys/ta_rsa_pub_key.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6kcZdQXbUhz+yA0TV1Cl +gL74bIAumZ9W4ecOVnzXL9p3XxWQ4D9ltHhaRihaK/P+XtOW2LPg1rEMSJobzJW9 +ji8YJujm1M96dZIA+ciHwdIOK9jbjBXqLfVNXi8UCGHsNssUW3KXOxCoV5Qvd+Ud +IWFclvxCS512b08mioZxI0TpuXEYLhLz++gU0Kq+YQDurpzNk3uKPKz+ThSpWIVm +3kULnT60x5mU/aLuPz0EUoKV9R+qd7/2zu3j1iXTZwu5eKwBZKSR6E4Mu5TQpr0b +MvoCIPjyovM1E2rbkIWfrz5JNvi3Tv/ngWGaE6d/ilHB7IYSfuJp9OITXrd5aIe8 +2wIDAQAB +-----END PUBLIC KEY-----
\ No newline at end of file diff --git a/ta_export/lib/libmpa.a b/ta_export/lib/libmpa.a index bfc8de2..504a8ed 100644 --- a/ta_export/lib/libmpa.a +++ b/ta_export/lib/libmpa.a @@ -1,14 +1,14 @@ !<arch> -/ 1490594119 0 0 0 1582 ` - +/ 1494843290 0 0 0 1582 ` + mpa_montgomery.o/ mpa_mem_static.o/ -mpa_misc.o/ 1490594117 7574 7000 100644 38624 ` -ELF -Jh01 - - - +mpa_misc.o/ 1494843288 7574 7000 100644 38384 ` +ELF +Jh01 + + + @@ -18,44 +18,45 @@ mpa_misc.o/ 1490594117 7574 7000 100644 38624 ` B B - - - - - - -< - - - - -G - -. #[!)2/V# Y`"D + +0 + + + + + + + +I + + + + +8 + +. #[!)2/V# Y`"D A -*D - - - - - -F -I -H - -ELF +*D + + + + +C +F +E + +ELF F - B FAFh - - -K -. - - - - - - + B FAFh +B + + +D +' + + + + @@ -71,82 +72,84 @@ F - - - - - -% - - - - - - -f#> + + + + + +" +@ + + + + + +5 + +f#> A -*D - - - -H -E -E -I -K -L -M -N -O -O -P -Q +*D + + + +E +B +B +F +H +I +J +K +L +L +M +N -R -S -S -O -G -W -S - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ELF +O +P +P +L +D +T +P + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ELF 8A0F_z1F O#F{OO !F @@ -171,57 +174,39 @@ S -o/Dyeڜ - - - -@ -# - -a - -O!Pv - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +o/Dyeڜ + + + +9 + + +Z +O!Pv + + + + + + + + + + + + + + + + + + + + + + + + @@ -235,71 +220,75 @@ O!Pv - -"(
- - - -& - - - -- - - -B -thKhi!K=2%!/].t/hKKKLK~X4.$F%uK!< <
+ +"I
+ + + + + + + + +< + + + + +thKhi!K=2%!/].t/hKKKLK~X4.$F%uK!< <
A -*D - - - -K -L -M -N -N -O -N -N -N -N -P -Q -R -S -K -T -P -Q -U -V -V -W -M -P -W -X -X -X +*D + + + +H +I +J +K +K +L +K +K +K +K +M +N +O +P +H +Q +M +N +R +S +S +T +J +M +T +U +U +U -X -X -X -N -Y -M -X - - - - - - -ELF - - -7 +U +U +U +K +V +J +U + + + + + + + + +ELF + + +7 @@ -307,29 +296,30 @@ X B -B - - - - - - -; - - -B -A - - - - -X +B + + +E + + + + + + +j + +B +A + + + +X A -*D - - - -ELF +*D + + + +ELF D; O GYh @@ -345,57 +335,58 @@ X : ? E; O -DEмB - - - -V -9 - - - - -f - - - - - - - - - - - - - - - - - +DEмB + + +O +2 + + + + +f + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + + + - - - - + + + + - - - - - + + + + + - + @@ -410,99 +401,98 @@ X - - - - - -% -E& - - -6 - - - - + + + + + +, + + + + + + += A -*D +*D - - - -D -G -E -G -H -G -C -J -G -G -K -K -H -K -H -L -L -M -N -O -C -P -P -Q -Q -R -S -O -T -U -H -V -V -V -F -G -H -K -K -I -H -V -H -V - - - - - - - + + + +A +D +B +D +E +D +@ +G +D +D +H +H +E +H +E +I +I +J +K +L +@ +M +M +N +N +O +P +L +Q +R +E +S +S +S +C +D +E +H +H +F +E +S +E +S + + + + + + + + + - -ELF + +ELF *Fch - - - -@ -# - - - - - - - - + + + +9 + + + + + + + @@ -516,138 +506,139 @@ V - - - - - -- -& - -G - -, - - - + + + + + + + + + +E + + + + +2 + + -XgggLggdf!J!K!KZKKKKKKKC..r../KKL1!/9PzX f;j;[hg/[0r<JYKKK..4z 5$ggMZ//? !-!W +XgggLggdf!J!K!KZKKKKKKKC..r../KKL1!/9PzX f;j;[hg/[0r<JYKKK..4z 5$ggMZ//? !-!W A -*D - - -E -E -F -G -F -G -F -H -G -F -F -G -E -G -E -G -E -G -E -H -H -I -J -H -H -H -I -J -H -H -K -J -J -J -J -J -F -F -L -M -M -M -M -M -M -M -G -F -G -F -H -G -H -H -H -J -K -F -L -M -M -M -K -F -N -K -F -E -E -F -M -G - - - - - - - - - - +*D + + + +B +B +C +D +C +D +C +E +D +C +C +D +B +D +B +D +B +D +B +E +E +F +G +E +E +E +F +G +E +E +H +G +G +G +G +G +C +C +I +J +J +J +J +J +J +J +D +C +D +C +E +D +E +E +E +G +H +C +I +J +J +J +H +C +K +H +C +B +B +C +J +D + + + + + + + + + + + - - - - - - - - - - - - - - - - - -ELF -FHhFhR<R`R,FhS`i`HiG - - - -a -D - - -$ - - + + + + + + + + + + + + + + + +ELF +FHhFhR<R`R,FhS`i`HiG + +Z += + + + + + @@ -660,39 +651,43 @@ FHhFhR<R`R,FhS`i`HiG B - - - - - - - -r) - - - - - - + + + + + + + + + + + + + + + +/ A -*D - - -N - -ELF +*D + + +K + + + +ELF R#F -O - - -K -. - - - - - - +O + + +D +' + + + + + + @@ -702,46 +697,45 @@ N B - - - - - - -% - - -9 - - - - + + + + + + + + + + +5 + + A -*D - - - -F -F -D -I -J -G -K -L -I -J -E -K -L - - - -ELF -ch" -: - -< +*D + + + + +C +C +A +F +G +D +H +I +F +G +B +H +I + + +ELF +ch" + + +5 @@ -750,44 +744,42 @@ L B - -"" - - - -Z -@ - - - - - -< - - -. - -\ -.$ + +" + + +X +Y +* + + + +| + + + + + +.$ A -*D - +*D + - - -P -Q -R - -ELF + + +M +N +O + +ELF T!8 B T! Bت - gE5T% - - + gE5T% + + @@ -796,67 +788,61 @@ T!8 - - - -9 - -? - - -+ - - - -- -_< - - - - -.!; .x ; J!!!Yh!G<9.G:tF.;J0/DJ>. + + + + + + + + + + + + +2 + + +.!; .x ; J!!!Yh!G<9.G:tF.;J0/DJ>. A -*D - - - -C -G -H -C -G -H - -ELF +*D + + + +@ +D +E +@ +D +E + + +ELF F Y%:F5PFshB Y' &v OD - *F6MFW - -K -. - - + *F6MFW + +D +' + + - - -= - -= - - -= - - - - - -= - - - + + + + + + + + + + + + + @@ -868,143 +854,145 @@ Y%:F5PFshB B - - - - - - - - - - -}& - - - - - - - - - + + + +8 +D + + + + + + + + + + + + + fm !! <0!N/-!OgL\OgPK=NX5< <Rx w (MdM[ <//-!NNg]gk1Ir"@0NK=LX7< < !/ J<P!@=!3KMY=Z#0! - = + = A -*D +*D - - - -G -I -E -E -D -D -G -F -L -J -L -J -M -N -O -L -L -J -J -F -F -M -N -O -M -M -O -F -J -M -N -M -O -J -F -M -N - - - - - - - - - - - - - - - - - - - - -ELF -@BF -3 - + + + +D +F +B +B +A +A +D +C +I +G +I +G +J +K +L +I +I +G +G +C +C +J +K +L +J +J +L +C +G +J +K +J +L +G +C +J +K + + + + + + + + + + + + + + + + + + + + + + +ELF +@BF + B - - - - - - - -q< - - - - - - - -< y 5Y + + + + + + + + + + +P + + + + + + + +< y 5Y A -*D - - - - - - -B -B -B - -ELF +*D + + + + + + +? +? +? + +ELF FPFAF( - - - -@ -# - - - + + + +9 + + + + @@ -1012,46 +1000,46 @@ FPFAF( B - - - - - - - - -% - - - -- - + + + + + + + + + + + +# + + + A -*D - - - -D -D -D -E -F -G -G -H -E -I -E -E -F -J -J -J -ELF -! - -f -Q2$9 Q0Pu +*D + + + +A +A +A +B +C +D +D +E +B +F +B +B +C +G +G +G +ELF + +_ +Q2$9 Q0Pu @@ -1059,31 +1047,30 @@ J B - - - - - - - - -3< - - - - -2 - - - + + + + +F + + + + + +p + + + + + A -*D - - - -D - -ELF +*D + + + +A + +ELF 74 50_( @@ -1095,20 +1082,20 @@ D B 0\>HFQ2F1) 1 - - - + + + - -4 - - +@ +4 + + - -C -b - + +C +b + @@ -1118,13 +1105,13 @@ B -0 - +0 + - - - - + + + + | @@ -1145,65 +1132,70 @@ B - + - + - - - - - - - -: -( - -7 - - - - + + + + + + + + +A +` + + + + + + +7 + +# ./w. -. +. A -*D +*D - - - - - - - -_ -` -_ + + + + + + + +\ +] +\ -b -c +_ +` -_ -_ -f -g +\ +\ +c +d - -ELF + +ELF FFF!F9FBF#F1F FFF!F9FBF#F1F -FFF!F9FBF#F1F - - -@ -# - - - +FFF!F9FBF#F1F + + + +9 + + + + @@ -1213,53 +1205,57 @@ g - - - -: - - - - - -m% - - - - + + + + + + + + + +: + + + + +< +- + .M#>gvK ..M#>gvK -..M#>gvK .Pz &z 4K\Y=Z"LZ=gMP)L +..M#>gvK .Pz &z 4K\Y=Z"LZ=gMP)L A -*D +*D - - - - -C -E -F -C -G -E -I -C -G -E -K -C -G -M -N -E -E -O -M -P -G -G -F -M - + + + + +@ +B +C +@ +D +B +F +@ +D +B +H +@ +D +J +K +B +B +L +J +M +D +D +C +J + + diff --git a/ta_export/lib/libpng.a b/ta_export/lib/libpng.a index d4b8601..2942542 100644 --- a/ta_export/lib/libpng.a +++ b/ta_export/lib/libpng.a @@ -1,7 +1,7 @@ !<arch> -/ 1490594119 0 0 0 8436 ` - -ELF +/ 1494843290 0 0 0 8436 ` + +ELF CiHiBۀB̿ TT KF!hF{D FiF @@ -117,102 +117,109 @@ Copyright (c) 1996-1997 Andreas Dilger Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - - -a/ - - - + + + +/ + + + + + - - - - - - - k -wy + + + + + + + k +W +y - - - - - - - - - - - - - - - - - - - - - - -PS -Q~ -Uf -Vf -W -X$ -Zq -[ + + + + + + + + + + + + + + + + + + + + + + + +PS +Q~ +Uf +Vf +W +X$ +Zq +[ \$ -^e -_ -aH -bs -c< -e) +^e +_ +aH +bs +c< +e) f$ -g$ - -) +g$ + +) h -j - - +j +9 + +_ + #Py - - - + + + - - + + $#Py $#Qy#Pu -$#Q0#Py +$#Q0#Py #Q0#Pt - - - - + + + + #Pu #Q0 - - - + + + - + - + #Qt #Qu - - - + + + @@ -223,70 +230,71 @@ $#Q0#Py - - - + + + - - - - + + + + - + - - - - - -) -Y - -z - + + + + + +) +Y + +z + ) - + - -) -) -Y - -) - - + +) +) +Y + +) + + - - -& - - - - - - - - - - - + + +& + + + + +_ + + + + + + + $ - - - - - - - - - -@$ - -|) -!$ - - + + + + + + + + + +@$ + +|) +!$ + + & @@ -414,26 +422,26 @@ $ R$ - - - - -
- - - - - -$ - -V -G -: -Q - - - - + + + + +
+p +( + + + + + + +T +: +g + + + + .v.=>+=>6u. u.0 !%.YKf .(.O M9<s!M#j`q%11/G%
f !/h1,%1##>xX .%J " @@ -449,240 +457,239 @@ X!1u4z P!Rfjjf(Jc. <mk73?<`y .g n."=!,Y!,K4/y7 ." K#{. #+?. - v.Kft %) 1E < ... + v.Kft %) 1E < ... A -*D +*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! -" -$ -$ - - - - - -( -) -* -+ -& - -! -/ -( -1 -/ - - - - - - - - - - - - - - - - - - - - - - - - - -3 -( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +! +! + + + + + +% +& +' +( +# + + +, +% +. +, + + + + + + + + + + + + + + + + + + + + + + + + + +0 +% - + - + - + - + - + - + - + - + - + - + - + - -8 - -" -? -! -" - - - - + +5 + + +< + + + + + + - - - - - - - - - - -K - - -N -N -N - -N -N -N -N -N -N -N -N -N - - - - -R -R -$ -$ - -G -H -I -Q -N - -N -N -N -N -N -N -N -N -N -V -V -V -N -N -N -N -N -N -N -N -N -N -N -N -N -N -N -N -N -N - - - - -N -V -N -\ -[ - -N -^ -\ - -] - -[ - - - - - - - - - - -` -Z -V -V -N -^ -\ -] - -Z -V -V -d - -c + + + + + + + + + + +H + + +K +K +K + +K +K +K +K +K +K +K +K +K + + + + +O +O +! +! + +D +E +F +N +K + +K +K +K +K +K +K +K +K +K +S +S +S +K +K +K +K +K +K +K +K +K +K +K +K +K +K +K +K +K +K + + + + +K +S +K +Y +X + +K +[ +Y + +Z + +X + + + + + + + + + + +] +W +S +S +K +[ +Y +Z + +W +S +S +a + +` @@ -703,11 +710,10 @@ c / < S -W - +W - -ELF + +ELF !QHF !QDf |,4F&HF @@ -717,104 +723,103 @@ W #\ *3+G FF FF -F@ - - - - - - - - - - - - - -i - 3 -Ru - - - - - - - - - - - - - - -{ - - - - - - - - - - -P - -Q/ -U -V -W -X -Z" -[ -\ -^n -_E -a -b$ -c -e) -f -g - -E -) -hF - - - - - - - - - - - - - - - - - - - - - - - - - - -% - - -% - -& - - +F@ + + +K + + + + + + + + + + +Y + # + +u + + + + + + + + + + + +w + + +k + + + + + + + + + +P +Q +U +V +W +X +Z +[ +\ +^^ +_5 +a +b +c +e) +f +g + +5 +) +h6 + + + + + + + + + + + + + + + + + + + + + + + + + + +% + + +% + +& + + & @@ -840,94 +845,100 @@ hF - - - - J - - - - - - - - -j - -) -E - - - -h + + + G +F +& + + + + + + +: +K + + + +P +R + + + + + + + 1s./ z 0# .J v. q , Y l.#*+ j.j h<% <vJ .L0 -.5z4~. !-![ +.5z4~. !-![ A -*D - - - - - - -w -w -x -w -x -y -{ -y -{ -z -z - - - - - - -z +*D + + + + + + + +t +t +u +t +u +v +x +v +x +w +w +~ + + + + + +w - - - - - - -v - -v -v - -v - - + + + + + + +s + +s +s + +s +~ + - - - - - - - - - - - - + + + + + + + + + + + + - -ELF + +ELF J0FF @FOrF# F@FOrF# F@ @@ -939,121 +950,124 @@ m Hl` k`Kk;`k3`
k+`,l#`F hIr #h` - -O - - - - - + + + +W + + + + - - - + + + - - - -Bv + + + + +\v - - - - - - - - - -$ -RPt - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + +$ +RPt + + + + + + + +6 + + + + + + + + + + + + + + + + Pt - - - + + + Pt - - - - + + + + - -
- - - - - - - - - + + + + + + + + + + + - + - - -$ -% + + +$ +% - - - + + + - - - + + + - + - + - + - + - + - - - - - - - - - - - -) - - -+- + + + + + + + + + + + +) + + ++- & @@ -1077,44 +1091,48 @@ $ - - - -t -
- - - - -z - -) - -0: - - - -I -| - -.Z5YA + + + +` +, +' + + + + +{ +| +< + + +5 +9 + + + +F +y + +k + +.Z5YA A -*D - -c - - - - - -c -c -p -n -o -r -s - +*D + + + + + + +` +` +m +k +l +o +p + @@ -1134,54 +1152,56 @@ s " # ( -* - +* - -ELF + +ELF GF@FpFF I(FyDO0FB(Fp@ - -2, - - - - - - - - - -l - 6 -Yr + + ++ + + + + + + + + + + +l + 6 +r - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + $Qt -$Q0Pt - -9 - - -# +$Q0Pt + +9 + + + +# & @@ -1196,68 +1216,65 @@ $Q0Pt B - -M - - - -fH -* - - - - - - -^ - - -g - - -C - -C - -b -b - - + +M + + + +% + + +y + + + +m + +'h + + +P + + +j + + + J!001i!J -<#/ +<#/ A -*D - - - - - - - +*D + + + + + + + + - - - -q -o -q -o -m -s -t + + +n +l +n +l +j +p +q -m -q -u -t -m -q -m -y -s -t -| -~ +j +n +r +q +j +n +j +v +p +q +y +{ @@ -1275,11 +1292,10 @@ t - - + - -ELF + +ELF -!*-!* ؝-=$- UIB 2B?t F)FOIB @@ -1295,121 +1311,120 @@ t 2B? F)F$IB"B? F)FFKB2љB? F)FB?w F)F ҚI FyDBЗI FyDh1 @ F1 F=єi1+:%i1+ F - - -o -. - - -y - - - - - -T - -0x + + +{. + + + + + + + +T + +`x - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + +? + + + + - - + + - - - - - - + + + + + + - - - - + + + + ^r) - - - - - -Y* -~* -O* - -* - -+ - -\) - -Rb+ - -+ - -+ - -(+ - - - -79, - -d, - -2, - -F, - -, - + + + + + +Y* +~* +O* + +* + ++ + +\) + +Rb+ + ++ + ++ + +(+ + + + +79, + +d, + +2, + +F, + +, + -- - -#;- - -f- - -- - --- - -A- - -<. - -K=. - -h. - -. +- + +#;- + +f- + +- + +-- + +A- + +<. + +K=. + +h. + +. e. -. - -D/ -) -}/ - +. + +D/ +) +}/ + & @@ -1475,154 +1490,154 @@ e. - - - - -A -FL - -D -7 -l -T -N -G -K - - - - - + + + + + +' + + + +m +
+N +T +a + + + + fi,!!=YZ fgYY}fz &?/X !-$,5@F>0:>> t,<-?M0-/M"K[YK0>u>K|!A!.u./3K% --0!-/ /i.. !/$M- n /Xs ^<" /gK0/>?0!!!?+3?=!!:3!=3!=y.t. .3YKg=Y//k>0=^KL X XK9 ? -JM##6z.KA +JM##6z.KA A -*D - - - - - - - - - - - - - +*D + +Q + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -1646,11 +1661,10 @@ JM##6z.KA -" - +" - -ELF + +ELF O ԧBѻ# @@ -1747,77 +1761,76 @@ D)++ K F1FB FI FyDIyD #3SCB2Ӹ -IyDF -' -. - -o - - +IyDF +. + + + - - + + - - - - -I{ + + + + +}{ - - - - - - - - - -% - -9 - - - - - - - - -9 -U -P -Q -U -V -Wg -Xs -Z -[g + + + + + + + + + +% + +9 + + + + + + + + +9 +U +P +Q +U +V +Wg +Xs +Z +[g \s -^ -_ -a -b -c -e4 -fs -gs - -4 +^ +_ +a +b +c +e4 +fs +gs + +4 h -j - - - - +j + + + + + - - + + - - - + + + " $ %z "?%1$" @@ -1827,81 +1840,80 @@ j " $ %#Q1#Pv " $ %"<%1$" " $ % -x - - - +x + + + F - - - - -F -5 -i + + + + +F +. +i -F - - - - - -z -8 - -* - - - - - - - - - - - - - - +F + + + + + +z +8 + +* + + + + + + + + + + + + + + U -U - - - - -U - - - - - - - - - - - - - - - - - - - - - - - - - -4 - +U + + + + +U + + + + + + + + + + + + + + + + + + + + + + + + +4 + - - - + + + & @@ -1989,24 +2001,28 @@ $ - - - - - - - - -q -/ - -M -': -h -q - - - + + ¤ + +c +' + + + + +; + + + + +V +D +M +9 +~ + + + 106=0=>!?." ^J" 2[+X !"!"!"!" J? 3!z #"#t J!"/C=S6QQ @@ -2024,250 +2040,251 @@ J0 < / <0 <0 <0=^0B0B0C0C0B0 -<BNg<Y#+B+o.[+? +<BNg<Y#+B+o.[+? A -*D +*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -! - -" - -# - -$ - -% -& -' -( - - -) -* -+ -) -* -+ -, - - -- - - - - - - -( - - -) -* -+ -, - - - - - - -( - -0 -( - - -2 -3 - - - - -3 - -3 -4 - - - - - - - - - - + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +! + +" +# +$ +% + + +& +' +( +& +' +( +) + + +* + + + + + + +% + + +& +' +( +) + + + + + + +% + +- +% + + +/ +0 + + + + +0 + +0 +1 + + + + + + + + + + + + + - - - -
- - - - - -6 -6 -7 -, -, -, -, -, -8 -, -9 -, -, -, - - - -= -# - -> - -? -@ -% + + + +
+ + +3 +3 +4 +) +) +) +) +) +5 +) +6 +) +) +) + + + +: + + +; + +< += +" * -& -' -A - -" -( - -B -/ -* -* - -D -E -F -D -6 -5 -G -+ -G +# +$ +> + + +% + +? +, +' +' + +A +B +C +A +3 +2 +D +( +D -D -+ -+ -+ -K -G +A +( +( +( +H +D + @@ -2286,39 +2303,36 @@ G C D -H - +H - -ELF - - - - - - - - - - - - -M - -j -8r - - - - - - - - - - - - + +ELF + + +K + + + + + + + +M + + +Kr + + + + + + + + + + + + & @@ -2333,36 +2347,38 @@ j - - - - -H - - - - - - -P - -<, -+ -Ɛ -7 - -b - - + + +# +R% + + +@ + + + +u + + + ++ + +ߐ +_7 + ++ + + A -*D - - - - -d -f - +*D + + + + + +a +c + @@ -2378,11 +2394,10 @@ f - - + - -ELF + +ELF Eђ IyD @@ -2505,91 +2520,93 @@ OHHHOJ xAy8 -0+hҲ -. - - - - - - - - - - -w - - - - - - - - - - -2 - - - - - - - -z +0+hҲ +- + + + + + + + + + +w + + + + + + + + + + +2 +o + + + + + + + + +z + w -w +w - + -&Pt - -0 +&Pt + +0 - - - - - - -: - - - - - - - - - - - - - 0 -o> + + + + + + +: + + + + + + + + + + + + + 0 +o> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + D $ $ @@ -2604,32 +2621,32 @@ E -S +S d-P - - - - - - - - + + + + + + + + ^Q - -0 -0 - -. -* -WR -2wR -R -R -R -R + +0 +0 + +. +* +WR +2wR +R +R +R +R -S - +S + & @@ -2870,34 +2887,33 @@ $ . - - - -I -2 -_ -
- - - -] - - - - - - -O -Zk - -L -89 - -^ -F -} - - + + + +' + + + +S + + +J + + + +# +j +^ +% +k +t +L +9 +! + + + + w.&)=~.<" 26tuO<jgSf. $1Kd%$g^gd##_?-/N3#i,2/KL!M%t<[1[h .zXL0 @@ -2916,95 +2932,95 @@ Xi)'#YAYv#[KL=! .x..x .u<x .x ]"0><z.#<$v22v22vJz <]"1?<z.#"v22v22vJz <y,":X,"v-G
XrY//4I/Ihv5y.5yt"/1-<J{.HC],"v-GJv/0y X}J }.X } !0e1=/< .+"//KKz.<*"///KKK0,/Lu.<1>%y. .,#K*<*"////-0y.<kL> -f="="[# +f="="[# A -*D - - - - +*D + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3028,11 +3044,10 @@ f="="[# # & 6 -< - +< - -ELF + +ELF K "{D FiF 0-PF*F"F2 AF Fo @@ -3090,57 +3105,56 @@ v M}D M}DR4P$@FFFGp .l1+@ -k!*(@ (* *0 - -Ȉ - - - - - - - - - -{ +k!*(@ (* *0 + + + + + + + + + + + +( +;{ - - - - - - - - - - -V + + + + + + + + + ) -) +) - - - -) -%( - - - - + + + +) +%( + + + + - + - + - + - + @@ -3150,111 +3164,111 @@ V - - - - - -V + + + + + - - + + - - - - - - - - - - + + + + + + + + + + - -T -I -I - - - - -) - - - + +T +I +I + + + + +) + + + - - - -K -) -0 - - -WX - -x - - - - -Y -SY - + + + +K +) +0 + + +WX + +x + + + + +Y +SY + - - -Z + + +Z ;Z - + - + ) - + ) - -) - -=[ - + +) + +=[ + - -) - -) - - + +) + +) + + - - + + - + + - + - + - + - -) + +) - + - + <) - + ^g^ - -^ -n^ - + +^ +n^ + & @@ -3390,27 +3404,29 @@ $ + + - - - - - -$ - -t - - - -F -> -Ϫ - - -9 -Ⱥ - - - + + + + + +s' +G + +) + + + +٪ +8 + +h9 + + + + + +{ + < </?1![rJLJf@*.@2#/.0=3!..u.(1$%>w<Xw< .bf ?!2-4/Z![ X!-? @@ -3427,98 +3443,101 @@ J003!(0L3$##=(0v1!!! .Q>@*2/wXJ .Y0/+C(-4= J22"0#>gh - r.!/M/JKLf@"//6YZ + r.!/M/JKLf@"//6YZ A -*D +*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3529,239 +3548,239 @@ J22"0#>gh - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - -" - - - - - - - -$ -% - -& - - -' -( - - - - - -+ - - - - - - - - -) - -+ -, - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +! +" + +# + + +$ +% + + + + + +( + + + + + + + + +& + +( +) + - - - - - - - - - - - - -. - - - - - - - -0 - - - - - - - -2 - - - - - - - -4 - - - - - - - + + + + + + + + + + + + ++ + + + + + + + +- + + + + + + + +/ + + + + + + + +1 + + + + + + + -6 - - - - - - - - -8 - - - - - - - - - -: -: - -; - - - - - - -= - - - - - - -? -@ -+ - - - - - - - -@ - - - - - - - -@ - -D - - -E - - - - - -H - -F - -) - - - - +3 + + + + + + + + +5 + + + + + + + + + +7 +7 + +8 + + + + + + +: + + + + + + +< += +( + + + + + + + += + + + + + + + += + +A + + +B + + + + + +E + +C + +& + + + + - -G - - - - - - - + +D + + + + + + + * -L -O -) -) -Q -) - - - -R -S -S -O - - - +I +L +& +& +N +& + + + +O +P +P +L + + + @@ -3780,11 +3799,10 @@ O $ 2 -S - +S - -ELF + +ELF "hC `0FFjF# ,
(FQF @@ -3801,154 +3819,160 @@ S zFC'F 8FIF" IyD8@0B F) -74 .5F5F'FkN,,<; - -_. - - - - - - - - - - -v - - - - - - - - - - -5 - - - - -5 - - - - - - - - - - - - - - - - -) - - - - - - - - - - - +74 .5F5F'FkN,,<; + + +%. + + + + + + + + + + + + + + +T +Cw + + + + + + + + + + +5 + + + + + + + + + + + + + + + + +| + + +) + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - - - - - - - - - - - - - - - - -^4 - - -5 -) - -c5 - - -) - -5 - - - - - -6 - -) + + + + + + + + + + + + +0 + + + + +^4 + + + +) + +S5 + + +) + +5 + + + + + +u6 + +) -&7 - - -) - -) - -d7 - - -n8 - -x - - - - - - -^9 -8-9 -CW9 -Gv9 +7 + + +) + +) + +d7 + + + +n8 + +x + + + + + + + + +^8 +89 +CW9 +Gv9 & @@ -4026,190 +4050,186 @@ Gv9 - - -u - -J - -K - - -Y - -/ -I -k -` - - -9 -t - - - -~ -) + + + + +6 + +' + +g + + +Z +, +l +C +1 +9 + + + + + XA x !/////0LhK+. # <v<v. Xz[?!\,/0,"0 # <.Qy ' -<?;!/ +<?;!/ A -*D +*D - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4218,20 +4238,21 @@ Xz[?!\,/0,"0 # - - - - - - - - - -) - + + + + + + + + + + + +) - -ELF + +ELF xC+B@B Bh x<Sx2<B+F"r"rz*< @@ -4242,41 +4263,41 @@ hz@A[BSCJhi)f<eVeeeb% x:AO P@IyD0@ 00 J*jZ:zF&fV6vN.n^>~A!aQ1q I)iY9yE%eU5u
M-m]=}C#cS3sK+k[;{G'gW7wO/o_? JZ*j:zN^.n>~CS#c3sGW'g7wK[+k;{O_/o? -*:JZjz+;K[k{,<L\l|
-=M]m}.>N^n~/?O_opng_set_filler is invalid for low bit depth gray output - -, - - - - - - - - - -T - 5 -s +*:JZjz+;K[k{,<L\l|
-=M]m}.>N^n~/?O_opng_set_filler is invalid for low bit depth gray output + +, + + + + + + + + +T + 5 +t +6t - - - - - - + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + d & @@ -4301,39 +4322,37 @@ d - - -@ - - -YI - - - -/ - - - - - -, -
-ϒ -b8 - - - - + + + +% + + + + + + + +c + +p, + + +(8 +Ь + + + J#K{##/K` X0 -->- +->- A -*D - - -s -u +*D + + +p +r @@ -4353,37 +4372,39 @@ u - - + - -ELF - - - - - - - - - - -M - -Cr - - - - -U - - - - - - - - + +ELF + + +K + + +l + +Z +4 + + + + +M + + +jr + + + + + + + + + + + + & @@ -4398,38 +4419,34 @@ U - - - -H -6 - - - - - -& - - - - - -:, - -Ґ -7 - - - - + + +[% + + + + + + + +) ++ + + +r7 +ͪ +u + + +| A -*D - - - - -d - +*D + + + + +a + @@ -4445,11 +4462,10 @@ d - - + - -ELF + +ELF b~(F (F0C B(F6 @@ -4460,57 +4476,55 @@ D)++ F -F* F F( Fi F F F1Fp@p -d- - - - - -@ - - +F* F F( Fi F F F1Fp@p +1- + + + + + + - - - + + - - - - -;x + + + +x - - - - - - - - - + + + + + + + + + - - - - - - - - + + + + + + + + + - + 0 - -( + +( ) - + - + - - + + @@ -4520,50 +4534,50 @@ F* F F( Fi F F F1Fp@p - - - -v+ -+ + + + +v+ ++ ^+ - -
+ -+ - , -@, -p, - -, -!, -& - -A3- -Fq- -W- -L- -R- -. -69. -1c. -,. - -. + +
+ ++ + , +@, +p, + +, +!, +& - +A3- +Fq- +W- +L- +R- +. +69. +1c. +,. + +. - -`D/ -\_/ -/ -i/ -/ -/ -H0 -c0 -^0 - - -0 - + +`D/ +\_/ +/ +i/ +/ +/ +H0 +c0 +^0 + + +0 + dA1 - + & @@ -4644,160 +4658,161 @@ dA1 - - - - -' - -J - - - - - - -l -e -L -o9 - - - - + + + +& +j + + + +d + + + +l + +m +H +L +&9 +ʲ + + + . .c.PJ///!O/L`fe&.X # <=j=j==&==>YkX.r. < <=P -X / +X / A -*D +*D - -u - - - - - - - - - - + + + + + + + + + - + - + - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - - - - - - + + + + + + @@ -4817,45 +4832,47 @@ u -% - +% - -ELF + +ELF !iz6C,C jz*4ؔ1ih+* *+ Q ,Q QQ ,, QB -<,7E00TX*z@1*(jz)h*O - - - - - - - - - -H - - ) -Vr +<,7E00TX*z@1*(jz)h*O + + +K + + + + + + + + +H + + ) + +r - - - - - - - - - - - - -; + + + + + + + + + + + + +; @@ -4863,12 +4880,12 @@ u - - - - -! - + + + + +! + & @@ -4883,42 +4900,44 @@ u - - -| - -j -H - - - - -Y - - - - -, -> - -7 - - - + + + +} + +j +b% + + + + +Y + + + + ++ + + +7 + + + + .!=!Kk}X }.AL .v !#*%$*$!50!%0h-BC,"Q*K+ .} .}<9.} 2$91z.&z< .o.X$*&?Q1d ~ >!?z.&z<v..m.<~ >N11c/"+.~.!?z.&z<6!n..o<.O~X ~. ~."Cy. ."!!/! ~ <#!!!///"!" ~ <0Cy. .,#/-+X#!!!!! -.+#9Xy '/
<k +.+#9Xy '/
<k A -*D - - -` -a -b -^ -^ -c +*D + + +] +^ +_ +[ +[ +` @@ -4954,11 +4973,10 @@ c - - + - -ELF + +ELF ,m= + @@ -5025,29 +5043,30 @@ F#A FIF:F+FDa!ou FIF:F+FB H1DaD1HaF F9F*FDa F9F*FB H1DaD1HaF@ FIF:F+FDa @ FIF:F+FB H1DaD1HaF FIF:F+F Da FIF:F+FBH1DaD1Ha - -- - - - - -Y - - - - -u + +a +, + + + + + + + + + +!v - - - - - - - - - - + + + + + + + + + + @@ -5055,52 +5074,53 @@ Y - - - + + + - - - + + + - + - -
-$ -Y -( -) - - - -F -F - - - - - -cI -0 - -WJ -x - -.K -IK -nK - - - - + +
+ +$ +( +) +c + + + +F +F + + + + + +cI +0 + +WJ +x + +.K +IK +nK + + + + ^VL - - + + & @@ -5242,32 +5262,31 @@ x - - - - - - - - - - - - - - -+j - -WK -8 -U -d - - -r - - - + + + + + +Z +~ + +t& + + +U +E + +Yj + +kK +7 +k + + + +X +` + Jv.#/4"/-5 .u. .11u - @@ -5279,164 +5298,159 @@ J J v </>>/Z1>,N,04z ( -.v +.v A -*D +*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5456,7 +5470,6 @@ J & ) -6 - +6 - + diff --git a/ta_export/lib/libutee.a b/ta_export/lib/libutee.a index 0abad96..4f201a6 100644 --- a/ta_export/lib/libutee.a +++ b/ta_export/lib/libutee.a @@ -1,58 +1,87 @@ !<arch> -/ 1490594119 0 0 0 6958 ` - +/ 1494843290 0 0 0 7166 ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tee_api_property.o/ tee_api_objects.o/ tee_api_operations.o/ +tee_tcpudp_socket.o/ +tee_socket_pta.o/ utee_syscalls_a32.o/ default_regular.o/ - -/0 1490594116 7574 7000 100644 78624 ` -ELF +/0 1494843288 7574 7000 100644 79584 ` +ELF ## - + H K" -HOq{DxD -L -# - - - -| - -0 -` -{ -Y -"}t -. -A}u -R - - - - -\}u +H@{DxD +L +} +e + + + + +0 +f +-}t + +0 +L}u +R + + + + +g}u - + -x}u - - +}u + + -}u - -}u -}t -; -}u -7}u -%) - - +}u + +}u +}t +; +}u +B}u +%) + + B @@ -72,114 +101,118 @@ x}u - -' - - - -G - - - - - - -y - - -.##"3KL"2 + +) + + + + +v += + +v + + +c +| + + + + +.##"3KL"2 A *D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - -ELF -HxD - -len - -WP3} -B}u + + + + + + + + + + + + + + +ELF + +HxD + +len + +WP4} +B}u Pw Pw -Qw -}u - - +Qw +}u + + - + -Qu - - -"# +Qu + + +"# ! @@ -193,26 +226,28 @@ B}u B -)F - - - - - -f - - -g -e - -z - - -$K~.K=!.#m !-/J +F + + + + + + + + + +H + +| +8 + + + +$K~.K=!.#m !-/J A -*D +*D - + | | | @@ -252,51 +287,52 @@ z - - -ELF - - + + +ELF + + + B - - - - -: -> -N - - - -* -_ - - - - + + + + +N + + +l + + + + +g + + +u + + A -*D - - - - -C -D - - -ELF +*D + + +@ +A + + +ELF - - - + + + N \ p - + 4 1 B @@ -305,26 +341,26 @@ p - - -/@ - - - -r - -1 - - - - + + +l + + + + + + + + + + A -*D - +*D + - + B F A @@ -333,121 +369,111 @@ H E I J -E - -ELF -rE +E + +ELF +E B .?:;'< - - - -i - - - -B - - - -/ - -2 -m - -` - -w - -N + + + + + +p + + + +^ + + + +9 + + + A -*D - - - - -N -P - -ELF -5 - +*D + + + + +K +M + +ELF +4 +O 4 B - - - -% - - - - - -+ - - -- - - - - -.$#o !/<!@J.i .>ef.n f!K!"!Z!0b :#!"!Z!0X ) :#!"!Y!X + + + + + + + + + + + +' + + + + +.$#o !/<!@J.i .>ef.n f!K!"!Z!0b :#!"!Z!0X ) :#!"!Y!X A -*D +*D - + - + ) * - -ELF + +ELF K" H!{DxD F{D FpF
FF!F H LxD K" HA!{D - -" - - - - - - - - - - - - - - - - - - - - - - - - - + + + +u + + +u +u +u + + + + + + + + + + + + + -I - +I + B - + B @@ -462,110 +488,112 @@ H LxD K" HA!{D B - - - - -W - -[ - -pE -k - -n - - - + + + + + +x + + + + + +" + J/4=
.% <."?/$N" .$ . 565#/P#/./R/Q6/Q=` . -f'{<.> +f'{<.> A -*D +*D - - - - - - - - - - - - + +] + + + + + + + + + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - - - + + + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -599,39 +627,38 @@ f'{<.> - - -ELF + + +ELF O K" H!{DxD K" H!{DxD -FpGK{D`pG -K -H"@{DxD -KB K" H@{DxD -K -H"Oq{DxD +FpGK{D`pG +K" +H@{DxD +KB K" H@{DxD +K" +HOq{DxD a -b -buf -x - - - +b +buf +x + + + -}t - - -}t -$}t -2}t -<}t - -O -) +}t + + +}t +$}t + +2}t +<}t +O @@ -647,66 +674,66 @@ O B B B - -5@ - - - - -H -4 - - - - - - - -} - + +@ + + + + +S +_ + + + +h + +z + o ./K"/pJJ20B+!" -l q<J! <.37%/"P!0"01!!0/:0m<O7%/#Z!"1 +l q<J! <.37%/"P!0"01!!0/:0m<O7%/#Z!"1 A -*D - - - - - - -v -y -w -{ -| -v - -w -| -} - - -| -} - -| -} - - -| - -| -} - -| -} - -| -} - -| - +*D + + + + + + + + +s +v +t +x +y +s +| +t +y +z +~ + +y +z + +y +z + + +y + +y +z + +y +z + +y +z + +y + @@ -728,86 +755,95 @@ w - - -ELF + + +ELF +K" +H\!{DxD +K" +H@_{DxD + +KB K" -H\!{DxD -K -H"!{DxD - -!{DxD -i - - -R - - - - - - - -}t -}t -}t -}t -$}v -(}v -,}v -1}t -9}t -;}v -E}t -G}v -r}t -u}t -x}t -}t - -_}t - - - - - - - -}u - -}u - -}t +H@ +!{DxD +K" +H@S!{DxD +K" +HOq{DxD + +i + + +K + + + + + + + +}t +}t +}t +}t +$}u +(}u +,}u +1}t +9}t +;}v +E}t +G}v +r}t +u}t +x}t +}t + +_}t + + + + + + +}t + +}t +S + +}t -}u - - -}t - - - - - - --}u - - - - - -D}u - - -S}t -`}t -p}u -}u -}u -}u -}u -}u -1 - +}t + + +}t + + + + + + +-}t + + + + + +D}t + + + + +S}t +`}t + +p}t +}t +}t +}t +}t +}t :; @@ -820,255 +856,252 @@ p}u - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - -" - - -E -x -@D - - - -U -Y - - - + + +"x + + +p +B + +e + + + + . - #0/K/!!!!"w#0 - 1 -. + #0/K/!!!!"w#0 + 1 +. A -*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +*D + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - + - - - + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1083,714 +1116,664 @@ Y - - - - - -ELF -FFkgk1FjB4B(/F:Fkak8c -B=ckk<[BDZF -=FFO"#:F -k)F*F - -bib -FFxK"H@!{DxD( -BD#iCE? j`ji9F j##aFX`j1FFKB'iC#a!KB3B3BK -sB;BsBѨkik - -zD -kjkFp+lLELFSD3`i(# -H -;BKB3BK"H@a{DxD -H -;BKB3BK"HOa{DxD - 9`{`l{ala -H -;BK"H@Oq{DxD -LH"Oa{DxD -2H"@gq{DxD -(H"@iq{DxD - + + + +ELF +FFk˱gk1FjB4B(/F:Fkak8c +BDckk<[BD +1[BD1F +=FFO"#:F +k)F*F + +bib +FFxK"H@!{DxD( +BC#iCE> j`ji9F j##aFP`j1FFKB&iC#a KB3B3BK"H@!{DxD( +sB;BsBѨkik + + +zD + kjkF +,J(FX#F +H +;BKB3BK"H@a{DxD +H +;BKB3BK"H@a{DxD + 9`{`l{ala +H +;BK"H@Lq{DxD +LH"@^q{DxD +2H"@eq{DxD +(H"@gq{DxD + K" -HOa{DxD +H@q{DxD K" -HOa{DxD - -k -o - -$}w -$}y - - - +H@q{DxD + +k +o + +w$}v +$}w +$}y + + + -$}u - - +$}u + + -w$}t - - -b$}t - - - - -$}u -$}t - - - -$}t - -$}u -$}t -$}u - - - - - - - - -P$}t - - - - - -$}t -$}v -$}v -$}v -$}v -$}w -
-$}t -$}u - $}t -@$}u -L$}t -O$}u -S$}u -\$}u -$}u -3$}u -$}u -$}t -$}u -$}u -$}w -$}w -$}w -$}w -$}t -$}t - - - $}t - -W$}t - -c$}w -f$}w -i$}w -p$}t -$}t -$}t -7$}t -$}t -$}{ -$}x -$}{ -$}{ -$}{ -$}t -$}{ -$}x -$}{ -$}{ -$}{ -$}t -$}y -$}v -$}y -$}y -$}y -$}t - -p -$}x -$}v -$}x -$}x -$}x -+$}t -=$}{ -?$}v -A$}{ -D$}{ -F$}{ -O$}t -`$}z -b$}v -d$}z -g$}z -i$}z -p$}t -$}y -$}v -$}y -$}y -$}y -$}y -$}y -$}y -$}y -$}y -$}t -$}t -$}t -$}t -n -k -g -j -o -q -t -u -w -r - - - - - - -* - -{ - - +w$}t +b$}u + + + + +$}u +$}t + + + +$}u + + + + + +$}u + +$}t +$}u + + + + + + + +P$}u + + +$}u +$}v +$}v +$}v +$}v +$}w +$}t +$}u + $}t +@$}t +M$}t +P$}u +T$}u +]$}u +$}u +>$}t +$}t +$}t +$}u +$}u +$}w +$}w +$}w +$}w +$}t +$}t + +&$}t + +]$}t + +i$}w +l$}w +o$}w +v$}t +$}t +$}t +9$}t +$}t +$}{ +$}x +$}{ +$}{ +$}{ +$}t +$}{ +$}x +. +$}{ +$}{ +$}{ +$}t +$}y +$}v +$}y +$}y +$}y +$}t + +$}x +$}v +$}x +$}x +$}x +($}t +:$}{ +<$}v +>$}{ +A$}{ +C$}{ +L$}t +^$}z +`$}v +b$}z +e$}z +g$}z +n$}t +~$}y +$}v +$}y +$}y +$}y +$}y +$}y +$}y +$}y +$}y +$}t +$}t +$}t +$}t +o +l +h +k +p +r +u +v +x + + + + + + +/ + +| + + :; - - - + + + B - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - -
- - - - - - - - - - - -# -# -: -
-R -b - - - - - - - - -X -.!!/!2=?1//!h1/""VJ1 . -.Z=!!#=%"1 -.!!/"'Y0#=?1/=/-!!/#/""KJ< J -.!!/!!#=-/42;K2!L/"",A + + + + + + + + + + + + + +& +n + +4 + + + +) + + + + + + +X +.Z=!!#=%"1 +<!!/"'Y0#=?1/=/-!!/#/""PJ7 J +<!!/!!#=-/42;K2!L/"",A A -*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +*D + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + - + - + - - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -& - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -$ -7 - -ELF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +@ + +ELF 3#
p$K"$HY!{DxD h{"K h{"K -FFF'K"'H@{DxD - -D -J - - -! -< - - +FFF'K"'H@{DxD + +D +YJ + + + +9 + + -c - -y - -1 - - - + + +1y + +& +
+ + }u -}t - +}t + }t }u -}t +}t #}t -#}t - +#}t + .?:;'I@B @@ -1805,31 +1788,30 @@ $ - -\7 -! - - - - -, -Zf -F - - -- -S + +V7 + + + + + + + + + + - + A -*D - +*D + - - + + +Q - + x y z @@ -1935,40 +1917,194 @@ x - - -ELF -PP -PP + + +ELF +PP +PP B - - - - -> - - - -p - -T - - - + + + + +_ + + +^ + + +n + +` + + +& + A -*D +*D - + : : - - -ELF -pa -pa -va -pa + + +ELF + +p +3 +_ + +u + + + +x + + + + + + + + + +O +z +~@ + + + +B + + + + + + +; + + + + + +R + + + + + + +A +*D +& + + + + + + +n +o +n +o +p +q +r +n +o +p +q +r +n +o +s +n +o +t +u +r +n +o +v +n +o +n +o +v +n +o + + + + + + + + + + + + + + + + + + + + + + + + +ELF +F +, +a +b +Q!P1 +QP3 + + +
+ + +B + + + + + + + + + +; + + + + +.0#!0,"" zJ&/!E'[.'[;!/2. <w< 4"E1#/03.Dx<(4"71#/02.R^"z<$"#/0 +A +*D + + +R +S +U +V +U +U +U +U + + +ELF +pa +pa +va +pa @@ -1977,79 +2113,81 @@ pa B - - - - - - -\J - -! - -{ - - - - + + + + + + + + + +u + + +z + + +4 + A -*D +*D - + C C C C - - -ELF -BO -gB -N -xx -BO -gB -N -M + + +ELF +O +B +O +6y +O +B +O + B - -+ - - -h - -q - - - - -J -~ - - - -u - + ++ + + + + + + + + + + + + +A + +x + A -*D +*D - + C C - - -ELF -]> -R -8] -]> -R -8] + + +ELF +> +[S +<^ +> +[S +<^ @@ -2059,29 +2197,36 @@ C - -S+ - - - - -g - -J - - - - + ++ + + +* + + + + + + + + +q + + + +& +x +9 A -*D +*D - + C C - - -ELF -? + + +ELF + 4 @@ -2089,104 +2234,105 @@ C B - -!+ - - - - -[ - -pJ -N - - - - -G - + ++ + + + + + + +u + + + + +- + A -*D +*D - + C - - -ELF - - + + +ELF + + d -y& +& -4 - -c - - - - -+ - - -/ - - - +4 + +b + + + + + + + + + + + + + A -*D - +*D + - -ELF -hBhB -( + +ELF +hBhB +( B - - - - - - - - - - - - --( -4 - - - + + + + + + + + + + + +A + + +0 +" + A -*D - - -8 -8 -9 -9 -; -< -< -< -< - - - -ELF +*D + + + +5 +5 +6 +6 +8 +9 +9 +9 +9 + + +ELF K"(F3!{D - -y5 - + +`5 + @@ -2194,22 +2340,22 @@ K"(F3!{D - -O + +O - + - + - + - + - - - + + + & @@ -2221,70 +2367,77 @@ O - - - - -^ -]S - - - - - - - -^ -8 - -- -] - -b -; - - - + + + + +a + +5 + +
+ +!, + + + + + + +A +8 + + +] + +: + + + + +^ + A -*D +*D - - + + + -g -h -i +d +e +f -j -k -j -l -m -o -p -q -r -s -t -u -v -w -x -y -z -{ -| -} -~ - - - - - - - - -s +g +h +g +i +j +l +m +n +o +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ + + + + + +p @@ -2293,10 +2446,10 @@ s - + - -ELF + +ELF H"IKxDyD{D\B
bF@F
hB4B0FJ @@ -2304,16 +2457,14 @@ s hIh h SXFF !F0 B - - - -b - -= -W -h - -) + +b + +/ +W +Z +q +) #p @@ -2328,150 +2479,164 @@ h -B - - - - - - - - - -& - - -7 - - - -B +B + + + + + + + + + + +9 + + +0 + + + +& + <L//+$<<@!'x !]0kK-!""/$3!&0u"/ - u J + u J A -*D - +*D + - - -^ -_ -` + + +[ +\ +] -c -e -c -e - -ELF +` +b +` +b + + +ELF `HxDA`hF -` JzDh;`3@h - -A^ -, - - - - -W92z - - +` JzDh;`3@h + +Z +^ +, + + + + +[91. +E + + + + + + -
-B - -B +
+B + +B B - - - - - -_ - - - - - - -; -H^ - - - -n - - - -J>1< + + + + + + + + + + + +` + + + + + + + + +J>1< /.?fi#xX #/~.f<(.= A -*D - - - -f -j -k -l -m -n -o -p -q -r -s -p -t -r -u -v -w - - - - -ELF -PP +*D + + + + +e +i +j +k +l +m +n +o +p +q +r +o +s +q +t +u +v + + + + +ELF +PP QQ -PP +PP QP -PQ -PP +PQ +PP QQ -PP +PP B B B -B -# - -[ -7 -3> - - - - - - -t +B +# + +j + + + + + +H + + + + + A -*D - - - - - - +*D + + + + + + ELF p A *D -default_bold.o/ 1490594117 7574 7000 100644 42252 ` -ELF +gprof_a32.o/ 1494843288 7574 7000 100644 618 ` +ELF +A +*D +ELF @@ -2486,76 +2651,76 @@ default_bold.o/ 1490594117 7574 7000 100644 42252 ` - - - - - - - - - - - - - -B - - -) -) - -+ - - -* -4 -> -' -[ -e -6 -1 -] -5 - - - - - - - + +f +p +z + + + + + + + + + +J + +) +) + ++ + + + + +& +' +C +M + +1 +E +5 + + + + + + + 4 - - - - - - - - - - -3 - - - - + +i + + + + + +1 + + + + + + + + A -*D -0 +*D +0 - - -ELF + + +ELF @@ -2574,65 +2739,64 @@ e - - - -/ - - - - - - - - - - - - -- - - -) -) - -+ -7 -A -K -U -_ -' -| - -W -1 -~ - - - - - - - + + + + + + + + + + + + + + +5 + +) +) + ++ + +) +3 += +G +' +d +n +? +1 +f + + + + + + + 4 - -n - - - - -3 -= - - - + +T +2 + + + + +1 + + + + +1 A -*D -0 +*D +0 @@ -2640,5 +2804,5 @@ W - + diff --git a/ta_export/lib/libutils.a b/ta_export/lib/libutils.a index 5f64bec..a2ed727 100644 --- a/ta_export/lib/libutils.a +++ b/ta_export/lib/libutils.a @@ -1,18 +1,20 @@ !<arch> -/ 1490594119 0 0 0 3136 ` - -E| -E| -HH -HH -HH -HH -HH -HH -x -x - - +/ 1494843290 0 0 0 3080 ` + +0 +0 +3p +3p +3p +3p +3p +3p + + + + + + arm32_aeabi_divmod_a32.o/ arm32_aeabi_divmod.o/ arm32_aeabi_ldivmod_a32.o/ @@ -49,453 +51,176 @@ s_propagateNaNF64UI.o/ s_commonNaNToF32UI.o/ buf_compare_ct.o/ -bget_malloc.o/ 1490594118 7574 7000 100644 65936 ` -ELF -[h -l2 -d@VH@E2UIVKxDyD{DP, - -BIKxDyD{D`O -BlHOrkIlKxDyD{DB3&.gH@fIgKxDyD{DS,8S<AhB`HOr`I`KxDyD{DC`D<D,1FD,MWK{Dh -V5p -تBؑBبB3B - - -/ -: -' -3 -
- - - - -2 - - - -5 - - - - - - - - - - - - - - - -:; - - - - - - +bget_malloc.o/ 1494843290 7574 7000 100644 62412 ` +ELF +[h +BIKxDyD{D`O +V5p +تBؑBبB3B + +wA +! +
+ +2 + + + + + + + + + + + + + + + +:; + + + + B - - - -B - -B - - - - + + +B + +B + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" - - - - - - -) - -3 - -# - - - - - - /<?" -.= -X#",0!=//=! + + + + + + + + + + + + + + + + + + + +f= + + + + +9 + +d + + + +B + + + + + + + /<?" +.= <<n.{.J=f y /v..10 -.
-A -*D - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ELF - -S - - - - - - - -g/ -5 - - - - - - -A -*D - - +.
+A +*D + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +ELF + + +C + + + + + + + + + + + +0 + + +A +*D +J +J + @@ -507,14 +232,13 @@ g/ - - - + + @@ -1127,128 +851,125 @@ g/ - - - -ELF + +ELF D -"F8F -2 -Pv +"F8F + +Pv Rx -Pw +Pw B - - - - - - - - -93 - - - - - - -A -*D - - -7 -8 -9 - -ELF + + + + + + + + +: + + + + + +A +*D + + +4 +5 +6 + +ELF -(
( (аXBXApG pGa+A8( -! +(
( (аXBXApG pGa+A8( + B .?:;'I@B B B -B - - - - - - - - - - -# - - -A -*D - +B +$ + + + + + + + + + + +, + + + +A +*D + - -ELF - - - + +ELF + + + 4 B - - - - - - - - - - - - -' - - - - -A -*D - - + + + +( + + + + + + + + + +! + + + +A +*D + + " " - -ELF - + +ELF + + B - - - - - - - - - - - -$ - -' -% -A -*D - - -ELF + + + + + + + + + + + + +A +*D + + +ELF ڰG Z6:h 8X'O (F OI @@ -1259,10 +980,11 @@ h`:`9F"F3F""?GE BEBF 3FE !FXF"FF(FE@F!F F - + + t - i - t + i + t B @@ -1276,507 +998,511 @@ h`:`9F"F3F""?GE - - - - - - - -# - - - -5 - - - - - - -< - -A -*D - - - -3 -4 -3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ELF -7 -Pv -Pt + + + + + +: + + + + + + + + + + + +A +*D + + + + + + + +0 +1 +0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ELF +Pv +Pt Rt Qv -Pu +Pu B - -& - - - - -C3 - - - - -
- - -A -*D - - - -4 -5 -6 - -ELF -' - + +& + + + + + + + + + + + + +A +*D + + + +1 +2 +3 + +ELF + + B 1 - -& - - - -# - - -2 - - - - -A -*D - - -4 -5 -6 - - -ELF - + +& + + + + + + + +6 + + + +7 + +3 +A +*D + + +1 +2 +3 + +ELF + B - - -' - - - - - -B* - - - -- - -A -*D - + + + +! + + + + + + + + + + +A +*D + - - -ELF - + + +ELF + -& - - - - - - - - - -s( - - - -A -*D - - -ELF - +& + + + + +# + + + + + +1 + +
+ +A +*D + + +ELF + - - - - - - - - - -( -% - - - - - -A -*D - - -ELF + + + + + + + + + +6 + + + + +A +*D + + +ELF + - + - - - - - -( -) - -* - - - - v .! -A -*D - - - -ELF - + + + + + + +\ + + + + + v .! +A +*D + + + +ELF + B - - - - - - -, -U( - - - - - -A -*D + + + + + + + +d + + + + +A +*D - - - + + + ELF -Fx1Bx - - - -, - - - - - - -) - - - - -A -*D +Fx1Bx + + + + +% + + + + +g + + + + +A +*D - + - - -ELF - - - - - - - - -) - - - - - - -A -*D - - - -ELF -B - - - - - - -) - - - - - -1 -A -*D + + +ELF + + + + + + +) +V + + + + + +A +*D + + + +ELF +B + + + + + +c + +/ + + + +A +*D - + - - -ELF - - - - - - - -( - - - - -A -*D - - -ELF -B -V' - - - - - -3 - - - - - -5 - -A -*D - - - - - -ELF + + +ELF + + + + + + + + + + +? + + +
+ + +A +*D + + +ELF + +B +g' +4 + + + + + + + + + + +A +*D + + + + + +ELF B - - - - - - -) - - - - -A -*D - + + + + + + +q + + + + +A +*D + - - -ELF + + +ELF B - - - - - - - - -* - - - - - -A -*D + + + + + + + + +I + + + + + +A +*D - + - - -ELF + + +ELF -& - - - - - - - - -
* - - - - -A -*D +& + + + + + + + + + +H + + +$ + + +A +*D - - - -ELF - - -+ - - - - - - -) - - - - -A -*D + + + +ELF + + +1 + + + + + + + + +D + + + + + +A +*D - + - - -ELF + + +ELF JOO;K? -&PF - -v -L +&PF + + + +L + & B - - - - - - - - - -5 - - - - - - - -A -*D - - - -6 -3 -4 -7 -8 -9 - + + ++ + + + + + + + + + + + + +A +*D + + + +3 +0 +1 +4 +5 +6 + ELF A *D -/26 1490594118 7574 7000 100644 24564 ` -ELF -l - -l - -l - -l - -l - -l - - -l - +/26 1494843290 7574 7000 100644 24564 ` +ELF + + + + + + + + + + + + + + + @@ -1785,28 +1511,29 @@ l B - - - - - - - - - - -$ - - - -.! /=/N./Z[?./Z[?./ZZK1./Z -A -*D + + + + + + + + + + +* + + +( + +.! /=/N./Z[?./Z[?./ZZK1./Z +A +*D - - + + @@ -1815,15 +1542,15 @@ l ! - + ELF A -*D +*D ELF - - + + i -q +q 4 @@ -1835,82 +1562,82 @@ q - - - - - - - - - - - -X$ - + + + + + + + + + + + + + <=0#/> -./u//tKK +./u//tKK A -*D +*D - -+ - + + - -ELF - -P) -P) -4 - - - - - - - - - -( -# - -A -*D - - - + +ELF + + +R) +R) +4 + + + + + + + + + + + + + +A +*D + + + ELF A *D -/119 1490594118 7574 7000 100644 41060 ` -ELF - -, -1 -1 -1 -1 - - +/119 1494843290 7574 7000 100644 41128 ` +ELF + +A +A +A +A + + - + - + - + - + B @@ -1922,21 +1649,21 @@ P) - - - - -( - - - - -/ - - - -A -*D + + + + + + + + + + + + + +A +*D @@ -1945,7 +1672,7 @@ P) - + @@ -1954,7 +1681,7 @@ P) - + % ' ) @@ -2018,159 +1745,169 @@ i - -ELF - - + +ELF + a -b +b - -/+ - - - -5 - -/ - - - - - -A -*D - - + +/* + + + + + +s + + + + + + +A +*D + + ELF ~SED<]RF F)F -EE2FFXF HO{@Op -Oe +EE2FFXF HO{@Op +Oe :; B - -&"< -3 - - - - - - - -4 - - - - -.u .Y 2//1!//A/A!!/="x!/{/,2@!//00! -A -*D + +&$< + + + + + + + + + + + +8 + + +.u .Y 2//1!//A/A!!/="x!/{/,2@!//00! +A +*D - + - . . + / 0 -- -ELF - +- +ELF + - +6 % -5 +5 ( B - - - - - - - - - -3 - - - -A -*D - + + +* + + + + + + + + + + + + + + +A +*D + , - -ELF -P + +ELF + +O - + + % -92 - +22 + ( B - - - - - - - - -R0 - - - -0 - -A -*D + + + + +2 + + + + + + + + + +A +*D - + ( - -ELF - - + +ELF + + - + % -2 +(2 ( B - - - - - - -0 - - - - - - -A -*D + + + + + + + + + + + + + + +A +*D - + ( - -ELF -Oe - + +ELF +Oe + +" + :; @@ -2178,60 +1915,58 @@ R0 B - - - -" - - - - - -4 - - - - -A -*D + + + + + + + + + + + + +A +*D - + , , - . / -0 -ELF - +0 +ELF + a -b +b - -/ - - - - - - - - - -/ - - - - -A -*D - - -ELF + +/ + + + + + + + + +# + +4 + + + +A +*D + + +ELF FI -FhF -M +FhF +g @@ -2239,199 +1974,202 @@ M B - - -4 - - - - - - -3 - - -8 - - - -A -*D + + + + + +9 +" + + + + +t + + + +A +*D , - -. -ELF - - +. +ELF + + + - + % -2 +2 ( B - - - - -' - -0 - - - - - -( - - -A -*D - -) -ELF + + + + + +/ + + +7 + + + +$ + + +A +*D + +) +ELF -KXxBpg@BaA - - - +KXxBpg@BaA + + 0 -e +d A -2 - - - +2 + + + ( B - - - - - - - - - -0 - - - - - - -A -*D - + + + +8 + + + + + +# + +2 + + + + +A +*D + * -( -ELF - +( +ELF + - + -R +Q -m2 +f2 ( B - - - - - - -q0 - - -+ - - - - - v.
:u.
! -A -*D - -) + + + +! + + + + + + + + + + +& + + v.
:u.
! +A +*D + +) ELF -KXxBp O0O1 - +KXxBp O0O1 + - + - + -(2 +!2 ( B - - -0 - - - - - - - -,0 -6 - - -* - - - 0t
.,0s
! -A -*D - + + + + + +2 + + + + + + + +0 + + + + 0t
.,0s
! +A +*D + ( -* -ELF -yDO -a +* +ELF +yDO +a B - -/ - - - - - - - -/ - - - - - -A -*D - + +/ + + + +1 +! + + + + + + + + + + +A +*D + ELF #O #e OyOxIi -#i O sOrCc - -OZ +#i O sOrCc +OZ + :; @@ -2441,116 +2179,113 @@ a B - -&'< - - - - - - - - -^4 - - - - - -A -*D + +&)< +" + + + + + + + + + + + + + +A +*D - . . + / 0 -- -ELF - +- +ELF + - + A -M5 +F5 ( B - - - - - - - - - - - -f3 - - - -. -A -*D - + + + + + + + + + + + + + +. +A +*D + , - -ELF - + +ELF + -j +i A -1 +1 ( B - - - - - - -/ - - - - - -A -*D + + + + +7 + + + + + + + + + +A +*D - -) -ELF - + +) +ELF + -m +l A -1 +1 ( B - - - - - - - - -/ - - - - - -
-A -*D + + + + + + + + + + + + +A +*D - -) + +) ELF @@ -2558,9 +2293,9 @@ A CO :C I -IOs - -Ow +IOs + +Ow :; @@ -2571,467 +2306,476 @@ IOs B - - - - - - - - - -y4 - - - -A -*D + + + + + +. + +< + + + + + +: + + +A +*D - + , , - . / -0 -ELF -yDO +0 +ELF +yDO -a +a B - -/ - - - - - - -/ - -, - - - - -A -*D - -ELF - - + +/ +, + +0 + + + + + + + + +4 + + + + +A +*D + +ELF + + B - - - - - - - -3 - -3 - - -A -*D - + + + + + + + + + + + + + +" + +A +*D + , - . / - -ELF + +ELF O4D;@4 -KY0xBp6 - - +KY0xBp6 + + - + & - + ( B - - - - - - - -0 - - - - - -A -*D - - + + + + + +) + + + + + + + + +A +*D + + + ( -) -ELF +) +ELF
@t 4K -dBeEO4o - - +dBeEO4o + + D -u +t A -G2 +@2 ( B - - - - -" - -_0 - - - - -.
-A -*D - - + + + + + +7 + + + + + +.
+A +*D + + + ( ) -( +( ELF - K[0xBpTF - -} + K[0xBpTF + +| - + -F2 +?2 ( B - - - - - - - - - -^0 - - - - + + + +) + + + + + + + + + +1 + + .!-vJ .!/I0s.
.+/0! - + A -*D - - +*D + + + ( -) -ELF -
@t -
+) +ELF +
@t + - + -12 +*2 ( B - - - - - - - -50 - - - - - ht..,#,>s. L! -A -*D - + + + + + + + + + + + + + + ht..,#,>s. L! +A +*D + ( ) ( -+ -ELF - -a ++ +ELF + +a B - -/4 - -$ - - - - - - -/ - - - - -) -A -*D - + +/3 + + + + +, + + + + + + +A +*D + ( - -ELF - - -a + +ELF + + +a +! B - -/ - - - - - - -0 - - - - -.0 -A -*D - + +/ + +& + + + + + +' + +b +- + + + + +.0 +A +*D + ) ' - -ELF - - -a + +ELF + + +a B - -/ - - - - - - -50 - - - - - -A -*D -N -N - + +/ + ++ + + + + + + + + +" + + +A +*D + ( ) * - + ELF K"F+F -RBcC -a -<Pv +RBcC +a +<Pv B - -/ -. - - -+ -, - - - - -/ - - - - - -A -*D - -) -ELF - -a + +/ + + + + + + + + + + + + +A +*D + +) +ELF + +a B - -/7 - - - - - -0 -% - - - - - -A -*D - + +/6 + + + + + + + + + + + +A +*D + ( ) - -ELF - - - -a + +ELF + + +a B - -/ - - - - - - -0 - - -' - - - -A -*D - + +/ + +/ + + + + + + + + + +A +*D + ) ' - + ELF -TМ@ - - -a - +TМ@ + + +a + B - -/ - - -+ -0 - - - -x0 - - - - -A -*D - + +/ + + + + + + + + + + + + + +A +*D + ( ) * - -ELF + +ELF a =
Q0
Pt -<
Q0
} +<
Q0
} B - -/ - - -8 - -( - - -/ - - - - - -A -*D - + +/ + + + + + +, + + + + + + + + +A +*D + ( ) * - -ELF -& - -' -n% -K& - + +ELF +Q + +' +% +& + s - +) -! -Pu +<" +Pu ( @@ -3039,25 +2783,26 @@ s B - - - - - - - - -4 - - - -A -*D + + + + + + + + + + + + + +A +*D , - - . -/ +/ ELF TOPO:@ @@ -3065,20 +2810,20 @@ s ET@ eF"BZ%. -F
FKk2 -3 - -' -e% -J& - +F
FKk2 +^ + +' +% +& +( e - +4 u -! +" @$@& -@$@& +@$@& ( @@ -3102,31 +2847,35 @@ u - - - - - - - - -4 - - - - -A -*D + + +< + + + +- + + + +
+ + + +9 + + +A +*D , - - . -/ -ELF +/ +ELF uiA -uiB +uiB Pv -0)( +0)( @@ -3140,27 +2889,27 @@ uiB - - - - - - - - - - 4 - - - -A -*D - + + + + + + + + + + + + + +A +*D + + + , - - + ELF 0 \oGWOV O8Pf @@ -3168,9 +2917,8 @@ uiB E@
@Oq Ao CS -PFYF#FF - -uiA +PFYF#FF +uiA @@ -3183,137 +2931,140 @@ uiA - - - - - - - - -3 - - - -A -*D + + + + + + + + + + + + +/ + +A +*D , , - -. -ELF - +. +ELF + z -4 - - - - -/ - - - - - -A -*D +4 + + + + + + + + + + + + + +A +*D - + ) ' - -ELF - - -z + +ELF + + +& +z 4 B - - - - - - - - - - -/ - - - - - -A -*D + + + + + + + +x + + + + + +A +*D - + ( - -ELF + +ELF 8O + -dCOx!FDD` - -
-] - -Y -D -# -|$ -^ +dCOx!FDD` + +
+\ + +X +q +# +$ +] ) - + A - -Pt +! +Pt + ( B - - - - - - - - -t1 - - - - - -A -*D - + + + + + + + + + + + + + +A +*D + ) * -* +* ELF -@P_ - - -
- - - - -n# -8$ - +@P_ + + +
+ + + + +# +t$ + ) - + A - + ( @@ -3321,451 +3072,451 @@ A B - - - - -2 - - -1 - - - - - - -A -*D - - + + + + + + + + + + + + + +A +*D + + ) * -* -ELF +* +ELF - - - - - -( - - - -) - - - - -A -*D - + + +) + + + + + + +h + + + + +A +*D + - + ELF -KB @ +KB @ B - - - - - - -% - - - -() - - - -A -*D - - - -ELF - - - - + + + + +0 + + + + + +/ +: + + + +A +*D + + + +ELF + + + B - - - - - - - - -F0 - - -& - -A -*D - + + +" + + + + ++ + + + + + + + +A +*D + ( ) - -ELF -: - - + +ELF +: + + B - - - - - - -U0 - - - - - -A -*D - - - + + + + + + + + + + + + +A +*D + + + ) ' ' * - -ELF - - - -& - - - -( - - - - -A -*D + +ELF + + + +0 + + + + + + +/ +, + + + ++ + +A +*D - -ELF - - - - - - - -* - - - -/ - - -A -*D + +ELF + + + + + + + +] + + + + + +A +*D - + - -ELF - -* + +ELF + +!* B 4 - - - - - - - -* - - -- - - - - - - -A -*D + + + + + + + + +x + + + + + +A +*D - -ELF - - + +ELF + + B ! - - - - - - - -* - - - -( - -A -*D + + + + + + + + + + + + + + +A +*D - -ELF + +ELF 5DO -D EE - +D EE + a32 a0 -z +z mid 4 - - - -
- - - - - - -) - - - - -A -*D - - -ELF - -& - - - - - - - - - -3 - - -A -*D - + + + + + + + + + + + + + +A +*D + + +ELF + +& + + + + + + + + + + + +1 +7 +! +A +*D + - + - -ELF -B - - - - - - - - -b) - - - -A -*D - - - -ELF - -6 + +ELF +B + +# + + + + + + +& + +F + +, + + +A +*D + + + +ELF + +6 1 B - -& - - - - - - - - -/ - - - -3 - - - -A -*D - -, -ELF - - + +: +& + + + + + + + + + + + +2 +A +*D + +, +ELF + + .?:;'@B B - - - - - - - - -- -# - - - - -A -*D - + + + + + + + + +w + + +$ + +A +*D + & - -ELF - + +ELF +3 - - - - - - - -, - - - - - -A -*D - - + + + + + + + +a + + + + +A +*D + + ELF -
IO0 @)@P - -b +
IO0 @)@P + +| + .?:;'@B B - - - - - - - - - -X- - - - -A -*D - -& -ELF + +1 + + + + + + +3 +x + + +A +*D + +& +ELF O O FO - - - + + + 1 B - -&d - - - - - - - - - -3 - - - - -A -*D - -, -ELF -@p@@@ - + +&~ + + + + + + + + + + + + + + +A +*D + +, +ELF +@p@@@ + B - - - - - -! -& -3 - - -, - -# - -A -*D - - - - + + + + + + + + +G +( + + + +A +*D + + + + ELF ; ܸ#fи*fи @X.jи0и-@_U @@ -3787,18 +3538,18 @@ O 8 1YE{ # -;: - - - +;: + + +] @ - + - + 4 @@ -3818,24 +3569,27 @@ O - -"y - - - - -& - - - -2 - - - - -A -*D - + +"b + + + + + +8 + + + + + +W + + + + +A +*D + 2 3 4 @@ -3847,93 +3601,91 @@ O 1 5 - + ELF -F - - -PQ +F + + + +PQ B - - -! - - - - - -/ - - -$ - - -A -*D - + + +!Y + + + + +4 + + + + + + +A +*D + - + . - -ELF - + +ELF + -& - -!] - - - - - - -/ - - - - - - - -A -*D +& + +!) + + + + +' + + + + + + + + + +A +*D - - -ELF - + + +ELF + -& - - - - - - - - - - -& - -$ - - -A -*D - - -ELF +& + + + + + + + + + + + + +A +*D + + +ELF q1JzD ȿ$,($+U -+, - - ++, + + @@ -3943,7 +3695,7 @@ $ } - + 4 B @@ -3954,23 +3706,25 @@ $ B - - - - - - -" - - -; - - - -A -*D + + + + + + + + + + +
+9 + + + +A +*D - + P Q P @@ -3978,7 +3732,7 @@ P P P R -S +S ELF A *D diff --git a/ta_export/lib/libzlib.a b/ta_export/lib/libzlib.a index 82f3024..4d0f60f 100644 --- a/ta_export/lib/libzlib.a +++ b/ta_export/lib/libzlib.a @@ -1,15 +1,15 @@ !<arch> -/ 1490594119 0 0 0 1050 ` +/ 1494843290 0 0 0 1050 ` - + ELF -DD{DwDD8wDA8A3B FOqF(FFOq
FARB;F - -rem - +DD{DwDD8wDA8A3B FOqF(FFOq
FARB;F + +rem + 4 B @@ -24,23 +24,24 @@ rem 4 " -[ - - - - - - - - - -, - - - +[ + + + + + + + + + + + + + +( A -*D - +*D + ' ( ( @@ -49,15 +50,15 @@ rem ( ( - -ELF + +ELF 5lBɻ@l2u\E
Y=ѫ0&: |
<qPA' %hWo fa^)"а=Y
.;\l ұt9Gwҝ≻d>jm
Zjz ' }Dңhi]Wbgeq6lknv+ӉZzJgo߹ホCՎ`~ѡ8ROggW?K6H+
L J6`zA`Ugn1yiFafo%6hRwG"/&U;(Z+j\1е,[d&c윣ju m ?6grW -
TN³9a&g`MGiIwn>JjѮZf@;7SŞϲG0º0S$6к)WTg#.zfJah]+o*7Z- - +
TN³9a&g`MGiIwn>JjѮZf@;7SŞϲG0º0S$6к)WTg#.zfJah]+o*7Z- + B .:;'@B B @@ -66,27 +67,22 @@ rem B B - - -% - - - - - - - - -, - - - - -# + + + + + + + + + + + + A -*D - - +*D + + ELF T\h3UCa-Opnjko|oeE < PiT @@ -118,29 +114,27 @@ Taa FF.l ThhPT3 ThhPTz3hPTca F F)(Fi`i -O c `!ZbBce d:Be - -7 -{ - - - -, - - +O c `!ZbBce d:Be + +{ + + + + + - - + + - + - - - + + + @@ -148,17 +142,16 @@ FF.l - - + + - -, + - -+Q1 + ++Q1 +Q1 -+Qv ++Qv ' @@ -211,17 +204,17 @@ FF.l - -1 - - - - - -" -% - - + +. +1 + + + + + + +N + ! .B)3 f?5w/?O#[KBy. ""=!K"Y=====!<.<.b <;v.= @@ -230,16 +223,16 @@ fXuJ= ."hE!$ J-/wJ=Y0A==!-!"$FYKYKYKh>^[$>L/=@//>=!/u -<M02"-V... +<M02"-V... A -*D +*D - + - + ? ? @ @@ -329,8 +322,8 @@ W - -ELF + +ELF C3f(82$nmB C " d5{DIfcmOl;;@[E5GF lL @@ -347,27 +340,22 @@ W - - -4 - -% - -" - -4 + + +,& + +# + { - -4 -!Q1 -4 - -t + +!Q1 + +t ' @@ -388,24 +376,24 @@ W - - - -" - - - -2 - - - - - + + + +. + + + + + + + + + . < o . -<!!+/0v!@":!/!A2 +<!!+/0v!@":!/!A2 A -*D - +*D + ? @ @ @@ -413,24 +401,25 @@ W A - + ELF &hmj 8>P* `xx4@2
->D - - - - - -x" - +>D + + + + + +" + - + - - + + +& ' @@ -440,24 +429,24 @@ A - - - - - - - - - -. - - + + + + + + + + + + + + A -*D - +*D + - -ELF + +ELF @-c0o cbB:={D " @@ -498,30 +487,28 @@ DOs+ - - -' - -M# + + +' + +# $ - - -$Q1 - - - - -$ -$ - + + +$Q1 + + + + + $Q1 -$Qu +$Qu ' @@ -627,27 +614,26 @@ $ - - - - - - - -$4 - - - - - + + + + + + + +T + + + + $!!!u/#:# w "!!!*&=/Lo .$ .4 //-5# X0KK>!/K<>-2/?!M!\= -<
.% +<
.% A -*D - +*D + I I I @@ -687,19 +673,19 @@ I - + ELF <O6 \FFO N7
E p6` q7YE8E, - + - - - - + + + + .?:;'I@B @@ -707,25 +693,23 @@ I - - - -. - -
- - - - -@, - - - - + + + + + + + + + + + + + A -*D - - +*D + + ELF ,ܰJ4JJ4J}BO @@ -785,26 +769,26 @@ CaizTO1hO.iaa
:A@21CaSi - - - - -| - - + + + + +| + + - - - - + + + + - + - + ' @@ -895,19 +879,23 @@ CaizTO1hO.iaa
:A@21CaSi 3% - - - - - - - - - -|# - - - + + + +1 + + + + + + + +& + + +7 + + .G600n .! .@ `XCy '\JX! q.!=g= @@ -915,14 +903,14 @@ CaizTO1hO.iaa
:A@21CaSi X!@ X>!'y<5 <-!Kg"v"&x C=e/;=-/XO - + A -*D +*D -f +f - + G @@ -956,66 +944,66 @@ G - -ELF - - + +ELF + + ' B - - - - -+ - - - - - - -) - - + + + + + + + + + + +{ + + + A -*D - - +*D + + " # $ $ - -ELF -err -len -s1 -len + +ELF +err +len +s1 +len B B B - - - - - - - - - - - - - -) - + + +2 + + + + + + + + + + + + A -*D - +*D + diff --git a/ta_export/mk/cleandirs.mk b/ta_export/mk/cleandirs.mk index e338343..39c1ab4 100644 --- a/ta_export/mk/cleandirs.mk +++ b/ta_export/mk/cleandirs.mk @@ -24,3 +24,5 @@ $(eval _O:=$(if $(O),$(O),.))$(wildcard $(addprefix $(_O)/,$(call _reverse, $(sort $(foreach d,$(patsubst $(_O)/%,%,$(dir $(cleanfiles))), $(call enum-parent-dirs,$(d))))))) endef + +RMDIR := rmdir --ignore-fail-on-non-empty diff --git a/ta_export/mk/ta_dev_kit.mk b/ta_export/mk/ta_dev_kit.mk index 0e0e367..fab5df0 100644 --- a/ta_export/mk/ta_dev_kit.mk +++ b/ta_export/mk/ta_dev_kit.mk @@ -74,9 +74,9 @@ include $(ta-dev-kit-dir)/mk/cleandirs.mk clean: @$(cmd-echo-silent) ' CLEAN $(out-dir)' ${q}rm -f $(cleanfiles) - ${q}dirs="$(call cleandirs-for-rmdir)"; if [ "$$dirs" ]; then rmdir $$dirs; fi + ${q}dirs="$(call cleandirs-for-rmdir)"; if [ "$$dirs" ]; then $(RMDIR) $$dirs; fi @$(cmd-echo-silent) ' CLEAN $(O)' - ${q}if [ -d "$(O)" ]; then rmdir --ignore-fail-on-non-empty $(O); fi + ${q}if [ -d "$(O)" ]; then $(RMDIR) $(O); fi subdirs = . include $(ta-dev-kit-dir)/mk/subdir.mk diff --git a/ta_export/scripts/gen_aes_key.py b/ta_export/scripts/gen_aes_key.py new file mode 100755 index 0000000..18dfe4e --- a/dev/null +++ b/ta_export/scripts/gen_aes_key.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# +# Copyright (c) 2015, Linaro Limited +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +def get_args(): + from argparse import ArgumentParser + + parser = ArgumentParser() + parser.add_argument('--out', required=True, help='Name of out file') + return parser.parse_args() + +def main(): + import uuid + from Crypto.Hash import SHA256 + + args = get_args() + + uuid = uuid.uuid4() + + h = SHA256.new() + h.update(uuid.bytes_le) + + f = open(args.out, 'wb') + f.write(h.digest()) + f.close() + +if __name__ == "__main__": + main() diff --git a/ta_export/scripts/gen_cert_key.py b/ta_export/scripts/gen_cert_key.py new file mode 100755 index 0000000..57b2fbe --- a/dev/null +++ b/ta_export/scripts/gen_cert_key.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# +# Copyright (C) 2016 Amlogic, Inc. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# + +def get_args(): + from argparse import ArgumentParser + + parser = ArgumentParser() + parser.add_argument('--root_rsa_key', required=True, help='Name of root private key file') + parser.add_argument('--ta_rsa_key', required=True, help='Name of TA public key file') + parser.add_argument('--uuid', required=True, help='Name of TA UUID') + parser.add_argument('--ta_rsa_key_sig', type=str, default='null', help='Name of TA key signature file') + + parser.add_argument('--root_aes_key', type=str, default='null', help='Name of root aes file') + parser.add_argument('--ta_aes_key', type=str, default='null', help='Name of ta aes file') + parser.add_argument('--ta_aes_key_enc', type=str, default='null', help='Name of encrypted ta aes key file') + + return parser.parse_args() + +def aes256_cbc_enc(key, text): + import struct + from Crypto.Cipher import AES + + iv = struct.pack('<IIII', \ + 0x0, 0x0, 0x0, 0x0) + + cipher = AES.new(key, AES.MODE_CBC, iv) + + #if text is not a multiple of 16, return + x = len(text) % 16 + if x != 0: + return 'null' + + msg = cipher.encrypt(text) + + return msg + +def main(): + import struct + import array + import uuid + from Crypto.Signature import PKCS1_v1_5 + from Crypto.Hash import SHA256 + from Crypto.PublicKey import RSA + from Crypto.Util.number import long_to_bytes + + # parse arguments + args = get_args() + + if args.root_aes_key != 'null' and args.ta_aes_key != 'null': + f = open(args.root_aes_key, 'rb') + root_aes_key = f.read() + f.close() + + f = open(args.ta_aes_key, 'rb') + ta_aes_key = f.read() + f.close() + + ta_aes_key_enc = aes256_cbc_enc(root_aes_key, ta_aes_key) + if (ta_aes_key_enc == 'null'): + sys.exit(1) + + f = open(args.ta_aes_key_enc, 'wb') + f.write(ta_aes_key_enc) + f.close() + + f = open(args.root_rsa_key, 'rb') + key_root = RSA.importKey(f.read()) + f.close() + + f = open(args.ta_rsa_key, 'rb') + key_ta = RSA.importKey(f.read()) + f.close() + + print 'Generate Custom Key...' + print ' Input: root_rsa_key.name = ' + args.root_rsa_key + print ' root_rsa_key.size = {}'.format(key_root.size() + 1) + print ' ta_rsa_key.name = ' + args.ta_rsa_key + print ' ta_rsa_key.size = {}'.format(key_ta.size() + 1) + print ' uuid = ' + args.uuid + print ' root_aes_key = ' + args.root_aes_key + print ' ta_aes_key = ' + args.ta_aes_key + print ' Output: ta_rsa_key.sig = ' + args.ta_rsa_key_sig + print ' ta_aes_key_enc = ' + args.ta_aes_key_enc + + h_key = SHA256.new() + for x in array.array("B", long_to_bytes(key_ta.publickey().n)): + pub_n_ta = struct.pack("B", x) + h_key.update(pub_n_ta) + + uuidStr = "{" + args.uuid + "}" + uuid = uuid.UUID(uuidStr) + h_key.update(uuid.bytes_le) + + signer_key = PKCS1_v1_5.new(key_root) + sig_key = signer_key.sign(h_key) + + f = open(args.ta_rsa_key_sig, 'wb') + f.write(sig_key) + f.close() + +if __name__ == "__main__": + main() diff --git a/ta_export/scripts/nosign.py b/ta_export/scripts/nosign.py index 7c59e4d..7a2b5f9 100755 --- a/ta_export/scripts/nosign.py +++ b/ta_export/scripts/nosign.py @@ -51,18 +51,23 @@ def main(): img_size = len(img) magic = 0x4f545348 # SHDR_MAGIC - version = 0x00000203# VERSION + version = 0x00000204# VERSION img_type = 1 # SHDR_TA algo = 0x70004830 # TEE_ALG_RSASSA_PKCS1_V1_5_SHA256 - shdr = struct.pack('<IIIIIIIHHHHHH', \ - magic, version, img_type, img_size, algo, 0, 0, \ - digest_len, 0, 0, 0, 0, 0) + shdr = struct.pack('<IIIIIIIIIIIIIIII', \ + magic, version, 0, algo, 0, img_type, img_size, 0,\ + 0, 0, 0, 0, 0, 0, 0, 0) - h.update(shdr) + aes_key = struct.pack('<IIIIIIII', \ + 0, 0, 0, 0, 0, 0, 0, 0) + aes_iv = struct.pack('<IIII', \ + 0, 0, 0, 0) h.update(img) f = open(args.out, 'wb') f.write(shdr) + f.write(aes_key) + f.write(aes_iv) f.write(h.digest()) f.write(img) f.close() diff --git a/ta_export/scripts/sign_ta.py b/ta_export/scripts/sign_ta.py index 1e028cd..cf1719f 100755 --- a/ta_export/scripts/sign_ta.py +++ b/ta_export/scripts/sign_ta.py @@ -17,48 +17,107 @@ def get_args(): from argparse import ArgumentParser parser = ArgumentParser() - parser.add_argument('--rootkey', required=True, help='Name of root key file') - parser.add_argument('--takey', required=True, help='Name of TA key file') + parser.add_argument('--ta_rsa_key', required=True, help='Name of TA rsa private key file') + parser.add_argument('--ta_rsa_key_sig', required=True, help='Name of TA rsa public key signature file') + parser.add_argument('--ta_aes_key', type=str, default='null', help='Name of aes key file') + parser.add_argument('--ta_aes_key_enc', type=str, default='null', help='Name of encryped aes key file') parser.add_argument('--in', required=True, dest='inf', help='Name of input file') parser.add_argument('--out', type=str, default='null', help='Name of output file') return parser.parse_args() +def aes256_cbc_enc(key, iv, text): + import struct + from Crypto.Cipher import AES + + cipher = AES.new(key, AES.MODE_CBC, iv) + + #if text is not a multiple of 16, padding + x = len(text) % 16 + if x != 0: + text_pad = text + '0'*(16 - x) + else: + text_pad = text + + msg = cipher.encrypt(text_pad) + + return msg + def main(): import sys + import os import struct import array + import uuid + import md5 + from Crypto.Hash import SHA256 from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA from Crypto.Util.number import long_to_bytes + import binascii # parse arguments args = get_args() if args.out == 'null': args.out = args.inf - f = open(args.rootkey, 'rb') - key_root = RSA.importKey(f.read()) + # aes key + if args.ta_aes_key == 'null': + aes_key_type = 0 + aes_key = struct.pack('<IIIIIIII', \ + 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0) + aes_iv = struct.pack('<IIII', \ + 0x0, 0x0, 0x0, 0x0) + enc_aes_key = aes_key + else: + h = md5.new() + h.update(uuid.uuid4().bytes_le) + aes_iv = h.digest() + if args.ta_aes_key_enc == "null": + aes_key_type = 1 + f = open(args.ta_aes_key, 'rb') + aes_key = f.read() + f.close() + enc_aes_key = aes_key + else: + aes_key_type = 2 + f = open(args.ta_aes_key, 'rb') + aes_key = f.read() + f.close() + f = open(args.ta_aes_key_enc, 'rb') + enc_aes_key = f.read() + f.close() + + # ta private key + f = open(args.ta_rsa_key, 'rb') + ta_key = RSA.importKey(f.read()) f.close() + key_len = (ta_key.size() + 1) / 8 - f = open(args.takey, 'rb') - key_ta = RSA.importKey(f.read()) + # ta public key signature + f = open(args.ta_rsa_key_sig, 'rb') + ta_key_sig = f.read() + sig_key_len = len(ta_key_sig) f.close() - key_len = (key_ta.size() + 1) / 8 - h = SHA256.new() - digest_len = h.digest_size - signer_ta = PKCS1_v1_5.new(key_ta) - sig_len = len(signer_ta.sign(h)) + h_hdr = SHA256.new() + digest_len = h_hdr.digest_size + signer_ta = PKCS1_v1_5.new(ta_key) + sig_len = len(signer_ta.sign(h_hdr)) f = open(args.inf, 'rb+') - shdr_len = struct.calcsize('<IIIIIIIHHHHHH') + shdr_len = struct.calcsize('<IIIIIIIIIIIIIIII') + aes_key_len = struct.calcsize('<IIIIIIII') + aes_iv_len = struct.calcsize('<IIII') shdr_check = f.read(shdr_len) - magic_check, version, img_type_check, img_size_check, algo_check, rsv1_check, rsv2_check, hash_size_check, sig_size_check, sig_key_check, pub_size_check, rsv3_check, rsv4_check = struct.unpack('<IIIIIIIHHHHHH', shdr_check) + magic_check, version, flags, algo_check, arb_cvn, img_type_check,\ + img_size_check,rsv0_check, rsv1_check, rsv2_check, rsv3_check, rsv4_check,\ + rsv5_check, rsv6_check, rsv7_check, rsv8_check = struct.unpack('<IIIIIIIIIIIIIIII', shdr_check) if img_type_check == 1: - skip_len = shdr_len+digest_len + skip_len = shdr_len+digest_len+aes_key_len+aes_iv_len elif img_type_check == 2: print 'TA has been signed, exit.' sys.exit(0) @@ -73,51 +132,61 @@ def main(): img_size = len(img) magic = 0x4f545348 # SHDR_MAGIC - version = 0x00000203# VERSION + version = 0x00000204# VERSION img_type = 2 # SHDR_TA_SIGNED algo = 0x70004830 # TEE_ALG_RSASSA_PKCS1_V1_5_SHA256 h_key = SHA256.new() - signer_key = PKCS1_v1_5.new(key_root) - sig_key_len = len(signer_key.sign(h_key)) - - shdr = struct.pack('<IIIIIIIHHHHHH', \ - magic, version, img_type, img_size, algo, 0, 0, \ - digest_len, sig_len, key_len, sig_key_len, 0, 0) - - h.update(shdr) - h.update(img) - sig_ta = signer_ta.sign(h) - shdr_len = struct.calcsize('<IIIIIIIHHHHHH') + shdr = struct.pack('<IIIIIIIIIIIIIIII', \ + magic, version, 0, algo, 0, img_type, img_size, aes_key_type,\ + 0, 0, 0, 0, 0, 0, 0, 0) + + h_elf = SHA256.new() + h_elf.update(img) + h_hdr.update(shdr) + h_hdr.update(enc_aes_key) + h_hdr.update(aes_iv) + h_hdr.update(h_elf.digest()) + sig_ta = signer_ta.sign(h_hdr) + shdr_len = struct.calcsize('<IIIIIIIIIIIIIIII') print 'Signing TA ...' - print ' Input: rootkey.name = ' + args.rootkey - print ' rootkey.size = {}'.format(key_root.size() + 1) - print ' Input: takey.name = ' + args.takey - print ' takey.size = {}'.format(key_ta.size() + 1) - print ' Input: ta.name = ' + args.inf - print ' Output: ta.name = ' + args.out + print ' Input: ta_rsa_key.name = ' + args.ta_rsa_key + print ' ta_rsa_key.size = {}'.format(ta_key.size() + 1) + print ' ta_rsa_key.sig = ' + args.ta_rsa_key_sig + print ' ta_aes_key.name = ' + args.ta_aes_key + print ' ta_aes_key_enc.name = ' + args.ta_aes_key_enc + print ' ta.name = ' + args.inf + print ' Output: ta.name = ' + args.out f = open(args.out, 'wb') f.write(shdr) - f.write(h.digest()) + f.write(enc_aes_key) + f.write(aes_iv) + f.write(h_elf.digest()) f.write(sig_ta) - skip_len = shdr_len + digest_len + sig_len + skip_len = shdr_len + aes_key_len + aes_iv_len + digest_len + sig_len f.seek(skip_len) - for x in array.array("B", long_to_bytes(key_ta.publickey().n)): + for x in array.array("B", long_to_bytes(ta_key.publickey().n)): pub_n_ta = struct.pack("B", x) h_key.update(pub_n_ta) f.write(pub_n_ta) - skip_len = shdr_len + digest_len + sig_len + key_len + uuidStr = "{" + os.path.basename(args.inf).split(".")[0] + "}" + uuid = uuid.UUID(uuidStr) + h_key.update(uuid.bytes_le) + + skip_len = shdr_len + aes_key_len + aes_iv_len + digest_len + sig_len + key_len f.seek(skip_len, 0) - sig_key = signer_key.sign(h_key) - f.write(sig_key) + f.write(ta_key_sig) - skip_len = shdr_len + digest_len + sig_len + key_len + sig_key_len + skip_len = shdr_len + aes_key_len + aes_iv_len + digest_len + sig_len + key_len + sig_key_len f.seek(skip_len, 0) - f.write(img) + if aes_key_type == 1 or aes_key_type == 2: + f.write(aes256_cbc_enc(aes_key, aes_iv, img)) + else: + f.write(img) f.close() if __name__ == "__main__": diff --git a/ta_export/src/ta.ld.S b/ta_export/src/ta.ld.S index 8a31840..b80abc3 100644 --- a/ta_export/src/ta.ld.S +++ b/ta_export/src/ta.ld.S @@ -1,10 +1,18 @@ #ifdef ARM32 OUTPUT_FORMAT("elf32-littlearm") OUTPUT_ARCH(arm) +#define MCOUNT_SYM __gnu_mcount_nc +/* + * This magic value corresponds to the size requested by + * libutee/arch/arm/gprof/gprof.c + */ +#define GPROF_BUF_MULT(x) ((x) * 136) / 100 #endif #ifdef ARM64 OUTPUT_FORMAT("elf64-littleaarch64") OUTPUT_ARCH(aarch64) +#define MCOUNT_SYM _mcount +#define GPROF_BUF_MULT(x) ((x) * 177) / 100 #endif PHDRS { @@ -24,6 +32,7 @@ SECTIONS { .ta_head : {*(.ta_head)} :exec .text : { + __text_start = .; *(.text .text.*) *(.stub) *(.glue_7) @@ -31,6 +40,8 @@ SECTIONS { *(.gnu.linkonce.t.*) /* Workaround for an erratum in ARM's VFP11 coprocessor */ *(.vfp11_veneer) + PROVIDE(MCOUNT_SYM = __utee_mcount); + __text_end = .; } .eh_frame : { *(.eh_frame) } :rodata .rodata : { @@ -77,7 +88,24 @@ SECTIONS { .data : { *(.data .data.* .gnu.linkonce.d.*) } :rwdata - .bss : { *(.bss .bss.* .gnu.linkonce.b.* COMMON) } + .bss : { + *(.bss .bss.* .gnu.linkonce.b.* COMMON) + + /* + * TA profiling with gprof + * Reserve some space for the profiling buffer, only if the + * TA is instrumented (i.e., some files were built with -pg). + * Note that PROVIDE() above defines a symbol only if it is + * referenced in the object files. + * This also provides a way to detect at runtime if the TA is + * instrumented or not. + */ + . = ALIGN(8); + __gprof_buf_start = .; + . += DEFINED(MCOUNT_SYM) ? + GPROF_BUF_MULT(__text_end - __text_start) : 0; + __gprof_buf_end = .; + } /DISCARD/ : { *(.interp) } } |