tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
163 stars 36 forks source link

build: link against tss2-mu #31

Closed diabonas closed 5 years ago

diabonas commented 5 years ago

Currently the linking of libtpm2-totp relies on the fact that the upstream tpm2-tss pkg-config file explicitly requires tss2-mu. Since this is wrong and will be changed upstream, but we need access to the marshalling functions, explicitly link against tss2-mu. See https://github.com/tpm2-software/tpm2-tss/pull/1417 for a more detailed discussion.

codecov[bot] commented 5 years ago

Codecov Report

Merging #31 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #31   +/-   ##
=======================================
  Coverage   80.46%   80.46%           
=======================================
  Files           5        5           
  Lines         819      819           
=======================================
  Hits          659      659           
  Misses        160      160

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b7f2932...a0dccc7. Read the comment docs.

dilyanpalauzov commented 5 years ago

$(TSS2_MU_CFLAGS) is always used together with $(TSS2_ESYS_CFLAGS) and $(TSS2_ESYS_LIBS) is always used together with $(TSS2_MU_LIBS).

One can replace both calls to PKG_CHECK_MODULES([TSS2_ESYS],[tss2-esys]) and PKG_CHECK_MODULES([TSS2_MU],[tss2-mu]) with a single PKG_CHECK_MODULES([TSS2_X],[tss2-esys tss2-mu]) and then use $(TSS2_X_CFLAGS) instead of $(TSS2_MU_CFLAGS) $(TSS2_ESYS_CFLAGS) and $(TSS2_X_LIBS) instead of $(TSS2_ESYS_LIBS) $(TSS2_MU_LIBS).