--- tensorflow-1.12.0/tensorflow/core/platform/cloud/oauth_client.cc.old 2019-01-01 16:14:58.444432721 +0100 +++ tensorflow-1.12.0/tensorflow/core/platform/cloud/oauth_client.cc 2019-01-01 16:18:22.886812378 +0100 @@ -31,6 +31,14 @@ limitations under the License. #include "tensorflow/core/platform/cloud/curl_http_request.h" #include "tensorflow/core/platform/env.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +static void EVP_MD_CTX_free(EVP_MD_CTX *ctx) +{ + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} +#endif + namespace tensorflow { namespace { @@ -119,7 +127,7 @@ Status CreateSignature(RSA* private_key, if (EVP_DigestSignFinal(md_ctx.get(), sig.get(), &sig_len) != 1) { return errors::Internal("DigestFinal (signature compute) failed."); } - EVP_MD_CTX_cleanup(md_ctx.get()); + EVP_MD_CTX_free(md_ctx.get()); return Base64Encode(StringPiece(reinterpret_cast(sig.get()), sig_len), signature); } --- tensorflow-1.12.0/tensorflow/core/platform/cloud/oauth_client_test.cc.old 2019-01-01 16:15:12.794611041 +0100 +++ tensorflow-1.12.0/tensorflow/core/platform/cloud/oauth_client_test.cc 2019-01-01 16:18:36.246958623 +0100 @@ -26,6 +26,14 @@ limitations under the License. #include "tensorflow/core/platform/env.h" #include "tensorflow/core/platform/test.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +static void EVP_MD_CTX_free(EVP_MD_CTX *ctx) +{ + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} +#endif + namespace tensorflow { namespace { @@ -166,7 +174,7 @@ TEST(OAuthClientTest, GetTokenFromServic const_cast( reinterpret_cast(signature.data())), signature.size())); - EVP_MD_CTX_cleanup(md_ctx); + EVP_MD_CTX_free(md_ctx); // Free all the crypto-related resources. EVP_PKEY_free(key);