openssl: Don't use deprecated RAND_pseudo_bytes()
authorTobias Brunner <tobias@strongswan.org>
Mon, 27 Jun 2016 15:27:54 +0000 (17:27 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 29 Jun 2016 09:09:38 +0000 (11:09 +0200)
src/libstrongswan/plugins/openssl/openssl_rng.c

index f8e98fc..a25b6b4 100644 (file)
@@ -49,13 +49,6 @@ struct private_openssl_rng_t {
 METHOD(rng_t, get_bytes, bool,
        private_openssl_rng_t *this, size_t bytes, uint8_t *buffer)
 {
-       if (this->quality == RNG_WEAK)
-       {
-               /* RAND_pseudo_bytes() returns 1 if returned bytes are strong,
-                * 0 if of not. Both is acceptable for RNG_WEAK. */
-               return RAND_pseudo_bytes((char*)buffer, bytes) != -1;
-       }
-       /* A 0 return value is a failure for RAND_bytes() */
        return RAND_bytes((char*)buffer, bytes) == 1;
 }