なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2014/10/24)

2014/10/24分のコミットです。

CHANGELOGへの追加はありませんでした。


Add AS::SecurityUtils.secure_compare for constant time string comparison

activesupport/lib/active_support/security_utils.rbの修正です。

ActiveSupport::SecurityUtils.secure_compareメソッドを新規に作成しています。

元々MessageVerifierクラスのprivateメソッドとしてsecure_compareメソッドがあったのですが、他のクラスでも使用出来るよう、切り出した形ですね。

タイミング攻撃対策として、バイト毎の比較処理を行っています。


Use AS secure_compare in AS::MessageVerifier

activesupport/lib/active_support/message_verifier.rbの修正です。

ActiveSupport#MessageVerifierで先に作成したsecure_compareメソッドを使用するよう修正しています。


Use AS secure_compare for CSRF token comparison

actionpack/lib/action_controller/metal/request_forgery_protection.rbの修正です。

CSRF tokenの比較処理に、secure_compareメソッドを使用するよう修正しています。


Reword documentation for uncountable [ci skip]

activesupport/lib/active_support/inflector/inflections.rbのdocの修正です。

uncountableメソッドの説明を修正しています。


DRY up try/try!

activesupport/lib/active_support/core_ext/object/try.rbの修正です。

try/try!メソッドリファクタリングを行っています。

tryメソッドで行っていた処理をtry!メソッドに移動し、trytry!メソッドを呼び出すよう修正しています。これにより、重複していたpublic_send呼び出しが減らせています。


AR Migrations Guide#Foreign Keys: fix wrong table

rails guideのActive Record Migrationsの修正です。

Foreign Keysの項で、説明対象のテーブル名に誤りがあったのを修正しています。