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 <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/include/openssl/sha.h b/include/openssl/sha.h
index f4253ec..42875f1 100644
--- a/include/openssl/sha.h
+++ b/include/openssl/sha.h
@@ -98,11 +98,8 @@
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 @@
uint32_t h4;
};
};
-#endif
+
uint32_t Nl, Nh;
uint32_t data[16];
unsigned int num;