go-tpm-tools
go-tpm-tools copied to clipboard
Build noise from deprecated features when compiling against OpenSSL 3
When cgo picks up OpenSSL 3.0 (for example via brew on macOS), compilation outputs quite a few deprecation warnings similar to the following:
/redacted/go/pkg/mod/github.com/google/[email protected]/simulator/ms-tpm-20-ref/TPMCmd/tpm/src/crypt/ossl/TpmToOsslMath.c:600:9: warning: 'EC_POINTs_mul' is deprecated [-Wdeprecated-declarations]
/usr/local/opt/openssl/include/openssl/ec.h:857:1: note: 'EC_POINTs_mul' has been explicitly marked deprecated here
/usr/local/opt/openssl/include/openssl/macros.h:182:49: note: expanded from macro 'OSSL_DEPRECATEDIN_3_0'
/usr/local/opt/openssl/include/openssl/macros.h:62:52: note: expanded from macro 'OSSL_DEPRECATED'
One route is to disable deprecation warnings, assuming openssl 3.0 support is off the table for now.
We could manually patch the simulator code, the problem is that the TCG spec explicitly uses this function:
- https://trustedcomputinggroup.org/resource/tpm-library-specification/
- Specifically Line
442, SectionB.2.3.2.3.17.of Version 1.59, Part 4 of the TPM 2.0 Spec
This means the the C libraries (which conform to the spec) also use this deprecated function:
I think it would be reasonable to just add a -Wno-deprecated-declarations flag to internal_cgo.go.
Also, see https://github.com/stefanberger/libtpms/issues/215 for OpenSSL 3.0 support progress in libtpms. We will likely also need to remove library use of deprecated functions if we ever want this to build w/ OpenSSL.
Looks like this was fixed recently in #244. Anybody know when the next release is?