--- title: 第四次作業 --- # 目標 * 了解TA如何存在REE filesystem中的,與如何被載入TEE中執行 * 練習如何從CA傳入記憶體位址給TA * 練習如何使用secure storage ![image](https://hackmd.io/_uploads/HkCLL6Q_C.png) # 作業內容 * Q1:稍微描述一下REE filesystem TA是如何被載入安全記憶體中執行的 * 對TA進行簽名:optee_os/scripts/sign_encrypt.py * 這邊會用到key,通常有一組預設的,但OP-TEE有建議要換成自己的key來build TA * optee_os/core/kernel/ree_fs_ta.c:檢查TA簽名並load進RAM中 * [官方文件](https://optee.readthedocs.io/en/latest/architecture/trusted_applications.html)、[CSDN](https://blog.csdn.net/jackone12347/article/details/121973662) ![image](https://hackmd.io/_uploads/BycC0nXOA.png) > Hints:shdr、Digital Signature、shdr_verify_signature() * Q2:實作base64編碼 * Encode: 將記憶體位址和大小給TA,TA根據內容進行編碼後CA將編碼內容印出。 * Decode: 將記憶體位址和大小給TA,TA根據內容進行解碼後CA將解碼內容印出。 * 利用自己名字做base64 encode和decode ![image](https://hackmd.io/_uploads/ry1vepXdC.png) > Hints:參考optee_examples/random、中文字/英文字大小是幾byte * Secure Storage是TEE提供的一種用來存放敏感資料的功能,上層只要調用就能夠將資料進行加密並保存到檔案系统 * Q3:簡單敘述HUK、SSK、TSK、FEK這四把key * Q4:執行optee_example_secure_storage,並說明結果 > Hints:[Secure storage](https://optee.readthedocs.io/en/latest/architecture/secure_storage.html) 繳交方式 * 報告 * 截圖 >[!Warning] !!!檔名請讓我看得出來你是誰!!! [繳交連結](https://drive.google.com/drive/folders/1e7_MUhkKq4KGY6QFyD7MXXyKtzAcP2Q_?usp=drive_link)