ruby-changes:26441
From: emboss <ko1@a...>
Date: Thu, 20 Dec 2012 16:43:06 +0900 (JST)
Subject: [ruby-changes:26441] emboss:r38492 (trunk): * ext/openssl/ossl_cipher.c: fix errors for installations that do not
emboss 2012-12-20 16:42:56 +0900 (Thu, 20 Dec 2012) New Revision: 38492 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38492 Log: * ext/openssl/ossl_cipher.c: fix errors for installations that do not feature Authenticated Encryption. * ext/openssl/extconf.rb: detect presence of EVP_CTRL_GCM_GET_TAG to determine whether Authenticated Encryption can be used. [Feature #6980] [ruby-core:47426] Modified files: trunk/ChangeLog trunk/ext/openssl/extconf.rb trunk/ext/openssl/ossl_cipher.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38491) +++ ChangeLog (revision 38492) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Dec 20 16:39:04 2012 Martin Bosslet <Martin.Bosslet@g...> + + * ext/openssl/ossl_cipher.c: fix errors for installations that do not + feature Authenticated Encryption. + * ext/openssl/extconf.rb: detect presence of EVP_CTRL_GCM_GET_TAG to + determine whether Authenticated Encryption can be used. + [Feature #6980] [ruby-core:47426] + Thu Dec 20 15:55:46 2012 Martin Bosslet <Martin.Bosslet@g...> * ext/openssl/ossl.c: do not use FIPS_mode_set if not available. Index: ext/openssl/ossl_cipher.c =================================================================== --- ext/openssl/ossl_cipher.c (revision 38491) +++ ext/openssl/ossl_cipher.c (revision 38492) @@ -482,6 +482,7 @@ ossl_cipher_set_iv(VALUE self, VALUE iv) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_cipher.c#L482 return iv; } +#ifdef HAVE_AUTHENTICATED_ENCRYPTION /* * call-seq: * cipher.auth_data = string -> string @@ -644,6 +645,12 @@ ossl_cipher_is_authenticated(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/openssl/ossl_cipher.c#L645 return Qfalse; } } +#else +#define ossl_cipher_set_auth_data rb_f_notimplement +#define ossl_cipher_get_auth_tag rb_f_notimplement +#define ossl_cipher_set_auth_tag rb_f_notimplement +#define ossl_cipher_is_authenticated rb_f_notimplement +#endif /* * call-seq: Index: ext/openssl/extconf.rb =================================================================== --- ext/openssl/extconf.rb (revision 38491) +++ ext/openssl/extconf.rb (revision 38492) @@ -148,6 +148,7 @@ have_struct_member("EVP_CIPHER_CTX", "fl https://github.com/ruby/ruby/blob/trunk/ext/openssl/extconf.rb#L148 have_struct_member("EVP_CIPHER_CTX", "engine", "openssl/evp.h") have_struct_member("X509_ATTRIBUTE", "single", "openssl/x509.h") have_macro("OPENSSL_FIPS", ['openssl/opensslconf.h']) && $defs.push("-DHAVE_OPENSSL_FIPS") +have_macro("EVP_CTRL_GCM_GET_TAG", ['openssl/evp.h']) && $defs.push("-DHAVE_AUTHENTICATED_ENCRYPTION") Logging::message "=== Checking done. ===\n" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/