From 34aa55c05e85d510c606274396c7236742c86607 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 4 Dec 2015 12:06:51 -0800 Subject: [PATCH] Support the SHA_CTX hack without ANDROID. wpa_supplicant needs access to the internals of SHA_CTX. We supported this only for builds with ANDROID defined previously but that's a pain for wpa_supplicant to deal with. Thus this change enables it unconditionally. Perhaps in the future we'll be able to get a function to do this into OpenSSL and BoringSSL. Change-Id: Ib5d088c586fe69249c87404adb45aab5a7d5cf80 Reviewed-on: https://boringssl-review.googlesource.com/6630 Reviewed-by: David Benjamin Reviewed-by: Adam Langley --- include/openssl/sha.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/openssl/sha.h b/include/openssl/sha.h index f4253ec4..42875f15 100644 --- a/include/openssl/sha.h +++ b/include/openssl/sha.h @@ -98,11 +98,8 @@ OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out); OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, const uint8_t *block); struct sha_state_st { -#if !defined(ANDROID) - uint32_t h[5]; -#else /* wpa_supplicant accesses |h0|..|h4| so we must support those names - * for compatibility with it until it can be updated. */ + * for compatibility. */ union { uint32_t h[5]; struct { @@ -113,7 +110,7 @@ struct sha_state_st { uint32_t h4; }; }; -#endif + uint32_t Nl, Nh; uint32_t data[16]; unsigned int num;