From efbf103388dfcce490522c86e8746a8a098734cc Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Fri, 15 Apr 2005 19:16:18 +0000 Subject: * ext/openssl/extconf.rb: check for OPENSSL_cleanse. * ext/openssl/openssl_missing.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/extconf.rb | 1 + ext/openssl/openssl_missing.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'ext/openssl') diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb index 4517ec82fb..2ced7f62ce 100644 --- a/ext/openssl/extconf.rb +++ b/ext/openssl/extconf.rb @@ -89,6 +89,7 @@ have_func("X509_CRL_set_version") have_func("X509_CRL_sort") have_func("X509_STORE_get_ex_data") have_func("X509_STORE_set_ex_data") +have_func("OPENSSL_cleanse") if try_compile("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n") $defs.push("-DHAVE_VA_ARGS_MACRO") end diff --git a/ext/openssl/openssl_missing.h b/ext/openssl/openssl_missing.h index 2a082f3fe0..e8c75ca42c 100644 --- a/ext/openssl/openssl_missing.h +++ b/ext/openssl/openssl_missing.h @@ -103,6 +103,10 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in); # define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted) #endif +#if !defined(HAVE_OPENSSL_CLEANSE) +#define OPENSSL_cleanse(p, l) memset(p, 0, l) +#endif + void *X509_STORE_get_ex_data(X509_STORE *str, int idx); int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data); int X509_CRL_set_version(X509_CRL *x, long version); -- cgit v1.2.3