aboutsummaryrefslogtreecommitdiffstats
path: root/test/openssl/test_cipher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_cipher.rb')
-rw-r--r--test/openssl/test_cipher.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index 088dbc140d..156fa2a9c9 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -187,7 +187,8 @@ class OpenSSL::TestCipher < Test::Unit::TestCase
tag = cipher.auth_tag
decipher = new_decryptor('aes-128-gcm', key, iv)
- decipher.auth_tag = tag[0..-2] << tag[-1].succ
+ tag.setbyte(-1, (tag.getbyte(-1) + 1) & 0xff)
+ decipher.auth_tag = tag
decipher.auth_data = "aad"
assert_raise OpenSSL::Cipher::CipherError do