diff options
author | Yusuke Nakamura <[email protected]> | 2022-11-23 21:05:49 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-12-13 18:07:41 +0900 |
commit | d4dce27d894f4889f29d779c94ba2d30c231f9f8 (patch) | |
tree | 0c0b589b1b6119b1cb4b446bb7bf7527f96a784b /ext/openssl/ossl_cipher.c | |
parent | d92f4fe4d74d929cec9ca36ec3dbec070b314902 (diff) |
[ruby/openssl] Allow empty string to OpenSSL::Cipher#update
For some reasons, plaintext may be empty string.
ref https://www.rfc-editor.org/rfc/rfc9001.html#section-5.8
https://github.com/ruby/openssl/commit/953592a29e
Diffstat (limited to 'ext/openssl/ossl_cipher.c')
-rw-r--r-- | ext/openssl/ossl_cipher.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c index d9c7891433..cb8fbc3ca2 100644 --- a/ext/openssl/ossl_cipher.c +++ b/ext/openssl/ossl_cipher.c @@ -384,8 +384,7 @@ ossl_cipher_update(int argc, VALUE *argv, VALUE self) StringValue(data); in = (unsigned char *)RSTRING_PTR(data); - if ((in_len = RSTRING_LEN(data)) == 0) - ossl_raise(rb_eArgError, "data must not be empty"); + in_len = RSTRING_LEN(data); GetCipher(self, ctx); out_len = in_len+EVP_CIPHER_CTX_block_size(ctx); if (out_len <= 0) { |