未验证 提交 a8e5c41c 编写于 作者: A Andrew Selle 提交者: GitHub

Merge pull request #25125 from aselle/cp-20190123

Cherry pick openssl fix and R fix and update release notes.
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
* Enable nested dataset support in core `tf.data` transformations. * Enable nested dataset support in core `tf.data` transformations.
* For `tf.data.Dataset` implementers: Added `tf.data.Dataset._element_structured property` to replace `Dataset.output_{types,shapes,classes}`. * For `tf.data.Dataset` implementers: Added `tf.data.Dataset._element_structured property` to replace `Dataset.output_{types,shapes,classes}`.
* Toolchains * Toolchains
* Fixed OpenSSL compatibility by avoiding `EVP_MD_CTX_destroy`.
* Added bounds checking to printing deprecation warnings.
* Upgraded CUDA dependency to 10.0 * Upgraded CUDA dependency to 10.0
* To build with Android NDK r14b, add "#include <linux/compiler.h>" to android-ndk-r14b/platforms/android-14/arch-*/usr/include/linux/futex.h * To build with Android NDK r14b, add "#include <linux/compiler.h>" to android-ndk-r14b/platforms/android-14/arch-*/usr/include/linux/futex.h
* Removed `:android_tensorflow_lib_selective_registration*` targets, use `:android_tensorflow_lib_lite*` targets instead. * Removed `:android_tensorflow_lib_selective_registration*` targets, use `:android_tensorflow_lib_lite*` targets instead.
......
...@@ -95,6 +95,11 @@ Status CreateSignature(RSA* private_key, StringPiece to_sign, ...@@ -95,6 +95,11 @@ Status CreateSignature(RSA* private_key, StringPiece to_sign,
if (!md) { if (!md) {
return errors::Internal("Could not get a sha256 encryptor."); return errors::Internal("Could not get a sha256 encryptor.");
} }
// EVP_MD_CTX_destroy is renamed to EVP_MD_CTX_free in OpenSSL 1.1.0 but
// the old name is still retained as a compatibility macro.
// Keep this around until support is dropped for OpenSSL 1.0
// https://www.openssl.org/news/cl110.txt
std::unique_ptr<EVP_MD_CTX, std::function<void(EVP_MD_CTX*)>> md_ctx( std::unique_ptr<EVP_MD_CTX, std::function<void(EVP_MD_CTX*)>> md_ctx(
EVP_MD_CTX_create(), [](EVP_MD_CTX* ptr) { EVP_MD_CTX_destroy(ptr); }); EVP_MD_CTX_create(), [](EVP_MD_CTX* ptr) { EVP_MD_CTX_destroy(ptr); });
if (!md_ctx) { if (!md_ctx) {
...@@ -119,7 +124,6 @@ Status CreateSignature(RSA* private_key, StringPiece to_sign, ...@@ -119,7 +124,6 @@ Status CreateSignature(RSA* private_key, StringPiece to_sign,
if (EVP_DigestSignFinal(md_ctx.get(), sig.get(), &sig_len) != 1) { if (EVP_DigestSignFinal(md_ctx.get(), sig.get(), &sig_len) != 1) {
return errors::Internal("DigestFinal (signature compute) failed."); return errors::Internal("DigestFinal (signature compute) failed.");
} }
EVP_MD_CTX_cleanup(md_ctx.get());
return Base64Encode(StringPiece(reinterpret_cast<char*>(sig.get()), sig_len), return Base64Encode(StringPiece(reinterpret_cast<char*>(sig.get()), sig_len),
signature); signature);
} }
......
...@@ -166,7 +166,6 @@ TEST(OAuthClientTest, GetTokenFromServiceAccountJson) { ...@@ -166,7 +166,6 @@ TEST(OAuthClientTest, GetTokenFromServiceAccountJson) {
const_cast<unsigned char*>( const_cast<unsigned char*>(
reinterpret_cast<const unsigned char*>(signature.data())), reinterpret_cast<const unsigned char*>(signature.data())),
signature.size())); signature.size()));
EVP_MD_CTX_cleanup(md_ctx);
// Free all the crypto-related resources. // Free all the crypto-related resources.
EVP_PKEY_free(key); EVP_PKEY_free(key);
......
...@@ -100,7 +100,13 @@ def _validate_deprecation_args(date, instructions): ...@@ -100,7 +100,13 @@ def _validate_deprecation_args(date, instructions):
def _call_location(outer=False): def _call_location(outer=False):
"""Returns call location given level up from current call.""" """Returns call location given level up from current call."""
stack = tf_stack.extract_stack() stack = tf_stack.extract_stack()
frame = stack[-4 if outer else -3] length = len(stack)
if length == 0: # should never happen as we're in a function
return 'UNKNOWN'
index = length-4 if outer else length-3
if index < 0:
index = 0
frame = stack[index]
return '{filename}:{lineno}'.format(filename=frame[0], lineno=frame[1]) return '{filename}:{lineno}'.format(filename=frame[0], lineno=frame[1])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册