tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
151 stars 100 forks source link

Support ossl engine config #182

Closed williamcroberts closed 4 years ago

williamcroberts commented 4 years ago

The library has two methods of controling the TCTI, one is via an env variable, the other is through the engine control interface. Unify these so the tpm2tss-genkey will support eithir method.

This patch series adds support for openssl config to be understood by this tool as well as exposing the tcti option via -t to override the config file. It also changes the other options to override only when set.

codecov[bot] commented 4 years ago

Codecov Report

Merging #182 into master will decrease coverage by 0.64%. The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
- Coverage   68.39%   67.74%   -0.65%     
==========================================
  Files           8        8              
  Lines        1098     1110      +12     
==========================================
+ Hits          751      752       +1     
- Misses        347      358      +11     
Impacted Files Coverage Δ
src/tpm2tss-genkey.c 56.96% <53.84%> (-0.83%) :arrow_down:
src/tpm2-tss-engine.c 58.91% <100.00%> (-3.59%) :arrow_down:

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 de8be9f...f1e3128. Read the comment docs.

AndreasFuchsTPM commented 4 years ago

LGTM, but does config.h.in need to be part of repo ? Ain't that generated by bootstrap ?

williamcroberts commented 4 years ago

config.h.in

Right you are, I need to drop that from the other projects I added it in.

williamcroberts commented 4 years ago

@tstruk or @AndreasFuchsSIT Build died building OSSL dependency have you been seeing:

rm -f test/enginetest
${LDCMD:-gcc} -pthread -m64 -Wa,--noexecstack -Wall -O3 -L.   \
    -o test/enginetest test/enginetest.o \
     test/libtestutil.a -lcrypto -ldl -pthread 
test/ectest.o: In function `custom_generator_test':
ectest.c:(.text+0x12e): undefined reference to `EC_GROUP_get_field_type'
ectest.c:(.text+0x22b): undefined reference to `EC_GROUP_get0_field'
collect2: error: ld returned 1 exit status
Makefile:8616: recipe for target 'test/ectest' failed
make[1]: *** [test/ectest] Error 1