1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/ossl.c: surpress warning: shorten-64-to-32.

* ext/openssl/ossl.h: ditto.

* ext/openssl/ossl_asn1.c: ditto.

* ext/openssl/ossl_bio.c: ditto.

* ext/openssl/ossl_bn.c: ditto.

* ext/openssl/ossl_cipher.c: ditto.

* ext/openssl/ossl_hmac.c: ditto.

* ext/openssl/ossl_ns_spki.c: ditto.

* ext/openssl/ossl_ocsp.c: ditto.

* ext/openssl/ossl_pkcs5.c: ditto.

* ext/openssl/ossl_pkey.c: ditto.

* ext/openssl/ossl_pkey_dh.c: ditto.

* ext/openssl/ossl_pkey_dsa.c: ditto.

* ext/openssl/ossl_pkey_ec.c: ditto.

* ext/openssl/ossl_pkey_rsa.c: ditto.

* ext/openssl/ossl_rand.c: ditto.

* ext/openssl/ossl_ssl.c: ditto.

* ext/openssl/ossl_x509ext.c: ditto.

* ext/openssl/ossl_x509name.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-03-24 07:29:21 +00:00
parent 643f90d8db
commit 3a16cc24e8
20 changed files with 110 additions and 71 deletions

View file

@ -217,7 +217,7 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
else memcpy(iv, RSTRING_PTR(init_v), sizeof(iv));
}
EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), EVP_md5(), iv,
(unsigned char *)RSTRING_PTR(pass), RSTRING_LEN(pass), 1, key, NULL);
(unsigned char *)RSTRING_PTR(pass), RSTRING_LENINT(pass), 1, key, NULL);
p_key = key;
p_iv = iv;
}
@ -300,7 +300,7 @@ ossl_cipher_pkcs5_keyivgen(int argc, VALUE *argv, VALUE self)
digest = NIL_P(vdigest) ? EVP_md5() : GetDigestPtr(vdigest);
GetCipher(self, ctx);
EVP_BytesToKey(EVP_CIPHER_CTX_cipher(ctx), digest, salt,
(unsigned char *)RSTRING_PTR(vpass), RSTRING_LEN(vpass), iter, key, iv);
(unsigned char *)RSTRING_PTR(vpass), RSTRING_LENINT(vpass), iter, key, iv);
if (EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, -1) != 1)
ossl_raise(eCipherError, NULL);
OPENSSL_cleanse(key, sizeof key);
@ -330,7 +330,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)
if ((in_len = RSTRING_LENINT(data)) == 0)
rb_raise(rb_eArgError, "data must not be empty");
GetCipher(self, ctx);
out_len = in_len+EVP_CIPHER_CTX_block_size(ctx);