diff --git a/crypto/crypto.c b/crypto/crypto.c index 8ee4c822..f3ea9f7c 100644 --- a/crypto/crypto.c +++ b/crypto/crypto.c @@ -167,10 +167,20 @@ int CRYPTO_has_asm(void) { const char *SSLeay_version(int which) { return OpenSSL_version(which); } const char *OpenSSL_version(int which) { - if (which == OPENSSL_VERSION) { - return "BoringSSL"; + switch (which) { + case OPENSSL_VERSION: + return "BoringSSL"; + case OPENSSL_CFLAGS: + return "compiler: n/a"; + case OPENSSL_BUILT_ON: + return "built on: n/a"; + case OPENSSL_PLATFORM: + return "platform: n/a"; + case OPENSSL_DIR: + return "OPENSSLDIR: n/a"; + default: + return "not available"; } - return ""; } unsigned long SSLeay(void) { return OPENSSL_VERSION_NUMBER; } diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 6678f2a7..8e1a271c 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -76,7 +76,8 @@ OPENSSL_EXPORT int BORINGSSL_self_test(void); #define OPENSSL_DIR 4 // OpenSSL_version is a compatibility function that returns the string -// "BoringSSL" if |which| is |OPENSSL_VERSION| and "" otherwise. +// "BoringSSL" if |which| is |OPENSSL_VERSION| and placeholder strings +// otherwise. OPENSSL_EXPORT const char *OpenSSL_version(int which); #define SSLEAY_VERSION OPENSSL_VERSION