go-tpm-tools icon indicating copy to clipboard operation
go-tpm-tools copied to clipboard

Build noise from deprecated features when compiling against OpenSSL 3

Open azdagron opened this issue 3 years ago • 1 comments

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.

azdagron avatar Jan 24 '22 18:01 azdagron

We could manually patch the simulator code, the problem is that the TCG spec explicitly uses this function:

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.

josephlr avatar Jan 26 '22 02:01 josephlr

Looks like this was fixed recently in #244. Anybody know when the next release is?

azdagron avatar Nov 16 '22 23:11 azdagron