aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkcs5.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_pkcs5.c')
-rw-r--r--ext/openssl/ossl_pkcs5.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkcs5.c b/ext/openssl/ossl_pkcs5.c
index 18d166d1ca..7abcebfeb3 100644
--- a/ext/openssl/ossl_pkcs5.c
+++ b/ext/openssl/ossl_pkcs5.c
@@ -36,7 +36,10 @@ ossl_pkcs5_pbkdf2_hmac(VALUE self, VALUE pass, VALUE salt, VALUE iter, VALUE key
str = rb_str_new(0, len);
- if (PKCS5_PBKDF2_HMAC(RSTRING_PTR(pass), RSTRING_LEN(pass), RSTRING_PTR(salt), RSTRING_LEN(salt), NUM2INT(iter), md, len, RSTRING_PTR(str)) != 1)
+ if (PKCS5_PBKDF2_HMAC(RSTRING_PTR(pass), RSTRING_LEN(pass),
+ (unsigned char *)RSTRING_PTR(salt), RSTRING_LEN(salt),
+ NUM2INT(iter), md, len,
+ (unsigned char *)RSTRING_PTR(str)) != 1)
ossl_raise(ePKCS5, "PKCS5_PBKDF2_HMAC");
return str;