summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_pkey_dsa.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 20:29:02 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-30 20:29:02 +0000
commit07083767e9cf500b31670fe0d5dd55a162f0c520 (patch)
treeb07a240feb01d09e41dd01d4d7a72fea7e7f95c5 /ext/openssl/ossl_pkey_dsa.c
parent86caaefc1ff89e8d0c97572661f70f55052bc0ce (diff)
* ext/openssl/ossl_rand.c (ossl_rand_bytes): RAND_bytes could
be return -1 as an error. Therefore, added error handling. * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey_dsa.c')
-rw-r--r--ext/openssl/ossl_pkey_dsa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index d5d55ee..04900cc 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -110,7 +110,7 @@ dsa_generate(int size)
unsigned long h;
if (!dsa) return 0;
- if (!RAND_bytes(seed, seed_len)) {
+ if (RAND_bytes(seed, seed_len) <= 0) {
DSA_free(dsa);
return 0;
}
@@ -144,7 +144,7 @@ dsa_generate(int size)
int seed_len = 20, counter;
unsigned long h;
- if (!RAND_bytes(seed, seed_len)) {
+ if (RAND_bytes(seed, seed_len) <= 0) {
return 0;
}
dsa = DSA_generate_parameters(size, seed, seed_len, &counter, &h,