K 10 svn:author V 8 woodsb02 K 8 svn:date V 27 2016-11-23T13:16:53.973907Z K 7 svn:log V 1346 security/trousers: Fix compilation with LibreSSL This was causing the build of security/gnutls to fail when the TPM option was enabled and make.conf contained DEFAULT_VERSIONS+=ssl=libressl. The gnutls configure script failed to successfully link against the libtspi.so library, and therefore determined the tss library was not suitable and disabled TPM. /usr/local/lib/libtspi.so: undefined reference to `RSA_set0_key' This caused the gnutls build to fail during staging due to an incorrect PLIST (missing bin/tpmtool). As of version 0.3.14, TrouSerS utilises the new OpenSSL function RSA_set0_key, which was only introduced in OpenSSL 1.1.0 and is not in LibreSSL (yet). The TrouSerS code utilises the OPENSSL_VERSION_NUMBER preprocessor macro to determine the version of OpenSSL which is it compiling against, and defines the RSA_set0_key function if the version of OpenSSL is older than 1.1.0. This causes an issue with LibreSSL, because it sets the OPENSSL_VERSION_NUMBER preprocessor macro to impersonate OpenSSL 2.0.0. The new patch-src_trspi_crypto_openssl_rsa.c causes TrouSerS to define the RSA_set0_key function on LibreSSL also. PR: 214660 Submitted by: David Z Reported by: Walter Schwarzenfeld Approved by: adamw (mentor, implicit) Approved by: portmgr (just-fix-it blanket) END