Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftpm #7054

Closed
wants to merge 27 commits into from
Closed

Ftpm #7054

wants to merge 27 commits into from

Commits on Oct 16, 2024

  1. tee_api_types.h: default alignment for TEE_BigIntFMMContext

    Remove the custom alignment from TEE_BigIntFMMContext.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    c4c22f0 View commit details
    Browse the repository at this point in the history
  2. libmbedtls: mbedtls_config_uta.h: enable SHA-384 and SHA-512 support

    Enable SHA-384 and SHA-512 support for user TAs.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    9e9a472 View commit details
    Browse the repository at this point in the history
  3. mk/subdir.mk: refactor process-subdir-{srcs-y,gensrcs-helper}

    Moves the common parts of the two make macros process-subdir-srcs-y and
    process-subdir-gensrcs-helper into a new macro, process-file-vars.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
    Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    472fcb2 View commit details
    Browse the repository at this point in the history
  4. ta_dev_kit.mk: use spec-srcs and spec-out-dir

    The commit cfa34d9 ("Add support for compiling in-tree TAs") added
    spec-srcs and spec-out-dir for special handling of user_ta_header.c when
    compiling in-tree TAs.
    
    However, these variables are just as relevant for out-of-tree TAs
    compiled via ta/mk/ta_dev_kit.mk. So as a simplification switch to use
    spec-srcs and spec-out-dir in that file too.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
    Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    f9f61da View commit details
    Browse the repository at this point in the history
  5. mk: introduce global-incdirs_ext-y

    Introduce the global-incdirs_ext-y variable to deal with including
    header files from outside of this git (optee_os.git).
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
    Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    d9517f8 View commit details
    Browse the repository at this point in the history
  6. mk/subdir.mk: introduce srcs_ext-y and srcs_ext_base-y

    Introduce two new variables srcs_ext-y and srcs_ext_base-y to deal with
    compiling source code outside of this git (optee_os.git).
    
    srcs_ext_base-y assigns the root directory of the external source files
    to compile. srcs_ext-y works as srcs-y except that it's relative to the
    $(srcs_ext_base-y) directory.
    
    Introduce the per source file variable oname-<file name>-y to override
    the default output object file name. This helps to shorten and make a
    more sane name for the output object file name when the source file is
    outside optee_os source tree, for instance, a third-party library.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    2d6d835 View commit details
    Browse the repository at this point in the history
  7. ta: ftpm: import initial source

    Import initial source from https://github.com/microsoft/ms-tpm-20-ref
    
    copy initial source code from Samples/ARM32-FirmwareTPM/optee_ta/fTPM
    commit e9fc7b89d865 ("Fix conflicting types for `ReadVarBytes`. (OP-TEE#102)")
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    bace052 View commit details
    Browse the repository at this point in the history
  8. ftpm: import TEE crypto API wrappers

    Import TEE crypto API wrappers from
    https://github.com/zeschg/ms-tpm-20-ref/ from commit ea7f4b3c3f82
    ("feat: exchange wolfcrypt backend with op-tee crypto api") with the
    exception of src/crypt/tee/TpmToTEEHash.c and
    include/TEE/TpmToTEEHash.h.
    
    Samples/ARM32-FirmwareTPM/optee_ta/fTPM/reference/include/TpmProfile.h to
    ta/ftpm/reference/include/TpmProfile.h
    
    Source directory TPMCmd/tpm to destination directory ta/ftpm
    src/crypt/tee/TpmToTEEMath.c    -> tee/TpmToTEEMath.c
    src/crypt/tee/TpmToTEESupport.c -> tee/TpmToTEESupport.c
    src/crypt/tee/TpmToTEESym.c     -> tee/TpmToTEESym.c
    include/TEE/TpmToTEEMath.h      -> include/TEE/TpmToTEEMath.h
    include/TEE/TpmToTEESym.h       -> include/TEE/TpmToTEESym.h
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    e282593 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. ftpm: fixup TEE crypto API wrappers

    Refactors the imported TEE crypto API wrappers to better follow the
    OP-TEE coding style.
    
    On touched files, set Microsoft copyright year to 2018 based on git
    history in the reference source. Add Linaro copyright.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    aaf5a95 View commit details
    Browse the repository at this point in the history
  2. ftpm: implement hashlib using mbedtls

    Add and use hashlib wrappers for MbedTLS. Disabling ALG_SM3_256 since
    it's not supported by MbedTLS.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    9fa7212 View commit details
    Browse the repository at this point in the history
  3. ftpm: build the in-tree TA

    Build the in-tree fTPM TA if CFG_MS_TPM_20_REF is supplied as a
    non-empty path.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    67d099e View commit details
    Browse the repository at this point in the history
  4. ftpm: add secure storage TA flag

    Add TA_FLAG_DEVICE_ENUM_TEE_STORAGE_PRIVATE to TA_FLAGS to enumerate the
    TA once secure storage is available.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    aed2671 View commit details
    Browse the repository at this point in the history
  5. ftpm: PlatformData: remove redundant s_NV*

    Removes the redundant or invalid s_NV* declarations
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    2d8527f View commit details
    Browse the repository at this point in the history
  6. ftpm: _plat__Fail() fix __noreturn

    _plat__Fail() is declared with a __noreturn since it's guaranteed to not
    return, but it only calls TEE_Panic() which doesn't have the same
    attribute. TEE_Panic() does indeed never return so add a while(true)
    after the TEE_Panic() so silence the warning.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    fd99d4a View commit details
    Browse the repository at this point in the history
  7. ftpm: fix conflicting types for _plat__NvMemoryWrite()

    Fix conflicting types for _plat__NvMemoryWrite() by adding the return
    type used in the declaration. _plat__NvMemoryWrite() is updated to
    always return TRUE since that's the expectation of success in NvWrite in
    TPMCmd/tpm/src/subsystem/NvReserved.c in the reference implementation
    (ms-tpm-20-ref).
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    6b902d4 View commit details
    Browse the repository at this point in the history
  8. ftpm: remove _plat__Signal_PowerOn() from fTPM.h

    Remove the mismatching _plat__Signal_PowerOn() prototype from fTPM.h.
    The real prototype is in ta/ftpm/platform/include/Platform_fp.h.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    b0dfcf8 View commit details
    Browse the repository at this point in the history
  9. ftpm: remove TA_ALL_PARAM_TYPE() from fTPM.c

    Remove the redefinition of TA_ALL_PARAM_TYPE() from fTPM.c, it's
    originally defined in ta/ftpm/include/fTPM.h.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    d0dcb63 View commit details
    Browse the repository at this point in the history
  10. ftpm: move user_ta_header_defines.h to include

    Move user_ta_header_defines.h to the common include directory for fTPM.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    d5f77af View commit details
    Browse the repository at this point in the history
  11. ftpm: remove redundant to{upp,low}er() declarations

    lib/libutils/isoc/include/ctype.h already declares toupper() and
    tolower() so remove the redundant declarations from RuntimeSupport.h.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    10a516e View commit details
    Browse the repository at this point in the history
  12. ftpm: provide and use ftpm_ta.h

    Separate TA_FTPM_UUID and the command IDs into ftpm_ta.h. Update
    user_ta_header_defines.h to include ftpm_ta.h instead of the old fTPM.h
    to minimize the include file dependencies.
    
    Set Microsoft copyright year to 2018 based on git history in the
    reference source. Add missing SPDX-License-Identifier and Linaro
    copyright.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    ab498ff View commit details
    Browse the repository at this point in the history
  13. ftpm: remove TpmProfile.h

    Remove TpmProfile.h overriding the version in the reference source.
    
    The old TpmProfile.h included a few .h files not included in the
    reference TpmProfile.h, so add the missing includes the affected source
    files.
    
    Add SPDX-License-Identifier and add Linaro copyright for all modified
    files. Set Microsoft copyright year based on git history in the
    reference source.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    fee31fc View commit details
    Browse the repository at this point in the history
  14. ftpm: update sub.mk to make it compile

    Updates the fTPM sub.mk file to make it compile the source files.
    Many warnings are disabled
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    052109c View commit details
    Browse the repository at this point in the history
  15. ftpm: remove unused RuntimeSupport.c

    Remove the unused file RuntimeSupport.c.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    d6bdcf5 View commit details
    Browse the repository at this point in the history
  16. ftpm: remove unused wolfssl crypto wrappers

    Remove the now unused wolfssl crypto wrapper.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    85d1819 View commit details
    Browse the repository at this point in the history
  17. ftpm: remove unused sub.mk files

    Remove the now unused sub.mk files.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    4b7e1e6 View commit details
    Browse the repository at this point in the history
  18. ftpm: Makefile: update for building externally

    Update the fTPM Makefile to support building externally. Remove WolfSSL
    leftovers.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    b0a3d15 View commit details
    Browse the repository at this point in the history
  19. ftpm: disable PPI emulation by default

    Add the configuration variable CFG_FTPM_EMULATE_PPI, default disabled,
    to control whether PPI emulation is enabled.
    
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    jenswi-linaro committed Oct 17, 2024
    Configuration menu
    Copy the full SHA
    6b5c2d0 View commit details
    Browse the repository at this point in the history