Add CRYPTO_has_asm. This function will return whether BoringSSL was built with OPENSSL_NO_ASM. This will allow us to write a test in our internal codebase which asserts that normal builds should always have assembly code included. Change-Id: Ib226bf63199022f0039d590edd50c0cc823927b9 Reviewed-on: https://boringssl-review.googlesource.com/7960 Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/crypto.c b/crypto/crypto.c index e98e249..c9f2bc8 100644 --- a/crypto/crypto.c +++ b/crypto/crypto.c
@@ -131,6 +131,14 @@ #endif } +int CRYPTO_has_asm(void) { +#if defined(OPENSSL_NO_ASM) + return 0; +#else + return 1; +#endif +} + const char *SSLeay_version(int unused) { return "BoringSSL"; }
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 3fd299f..80d7196 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h
@@ -50,6 +50,10 @@ * internal version of BoringSSL. */ OPENSSL_EXPORT int CRYPTO_is_confidential_build(void); +/* CRYPTO_has_asm returns one unless BoringSSL was built with OPENSSL_NO_ASM, + * in which case it returns zero. */ +OPENSSL_EXPORT int CRYPTO_has_asm(void); + /* Deprecated functions. */