aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl_pkey_dsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_pkey_dsa.c')
-rw-r--r--ext/openssl/ossl_pkey_dsa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 6fc3a44bbc..d3e91f00e3 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -318,7 +318,10 @@ ossl_dsa_export(int argc, VALUE *argv, VALUE self)
if (!NIL_P(cipher)) {
ciph = GetCipherPtr(cipher);
if (!NIL_P(pass)) {
- passwd = StringValuePtr(pass);
+ StringValue(pass);
+ if (RSTRING_LENINT(pass) < OSSL_MIN_PWD_LEN)
+ ossl_raise(eOSSLError, "OpenSSL requires passwords to be at least four characters long");
+ passwd = RSTRING_PTR(pass);
}
}
if (!(out = BIO_new(BIO_s_mem()))) {