diff options
author | Matt Caswell <matt@openssl.org> | 2016-02-09 10:39:07 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-02-09 16:11:38 +0100 |
commit | 498abff0ae907dce08f37a1353976755e8c8120e (patch) | |
tree | 523033d5c005cbe95a4c56c57c8f25a5f452932b /ssl/ssl_init.c | |
parent | Provide a thread stop API (diff) | |
download | openssl-498abff0ae907dce08f37a1353976755e8c8120e.tar.xz openssl-498abff0ae907dce08f37a1353976755e8c8120e.zip |
Add an OPENSSL_NO_AUTOERRINIT option
This option disables automatic loading of the crypto/ssl error strings in
order to keep statically linked executable file size down
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'ssl/ssl_init.c')
-rw-r--r-- | ssl/ssl_init.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c index f1014135a1..1bccba1cd8 100644 --- a/ssl/ssl_init.c +++ b/ssl/ssl_init.c @@ -253,11 +253,17 @@ static OPENSSL_INIT_ONCE ssl_strings = OPENSSL_INIT_ONCE_STATIC_INIT; static int ssl_strings_inited = 0; static void ossl_init_load_ssl_strings(void) { -#ifdef OPENSSL_INIT_DEBUG + /* + * OPENSSL_NO_AUTOERRINIT is provided here to prevent at compile time + * pulling in all the error strings during static linking + */ +#if !defined(OPENSSL_NO_ERR) && !defined(OPENSSL_NO_AUTOERRINIT) +# ifdef OPENSSL_INIT_DEBUG fprintf(stderr, "OPENSSL_INIT: ossl_init_load_ssl_strings: " "ERR_load_SSL_strings()\n"); -#endif +# endif ERR_load_SSL_strings(); +#endif ssl_strings_inited = 1; } |