summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-08 00:29:26 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-02-08 00:29:26 +0000
commitaa3854e33d898885d067b5055d7e0f0db38a9c0d (patch)
treeb8474e8f3f25113c3bf6e4571605b5a3a4a4e0d5
parent89a2a1050863dfa7b3adbf39db3a92b8320deaa6 (diff)
* ext/openssl/ossl_cipher.c: Add warning about key as IV.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/openssl/ossl_cipher.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 547d3a7..987d277 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Feb 08 09:19:00 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * ext/openssl/ossl_cipher.c: Add warning about key as IV.
+
Tue Feb 7 20:08:12 2012 Ayumu AIZAWA <ayumu.aizawa@gmail.com>
* error.c (exc_inspect): Fix typo. patch from Trent Ogren
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index 101ea05..4e758b6 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -686,6 +686,12 @@ Init_ossl_cipher(void)
* key = cipher.random_key
* iv = cipher.random_iv # also sets the generated IV on the Cipher
*
+ * Although the key is generally a random value, too, it is a bad choice
+ * as an IV. There are elaborate ways how an attacker can take advantage
+ * of such an IV. As a general rule of thumb, exposing the key directly
+ * or indirectly should be avoided at all cost and exceptions only be
+ * made with good reason.
+ *
* === Calling Cipher#final
*
* ECB (which should not be used) and CBC are both block-based modes.