RAND_bytes/RAND_pseudo_bytes returns -1 if it is not supported by RAND method
[strongswan.git] / src / libstrongswan / plugins / openssl / openssl_rng.c
index d3d64f5..10db629 100644 (file)
@@ -57,7 +57,7 @@ METHOD(rng_t, get_bytes, bool,
        {
                ret = RAND_pseudo_bytes((char*)buffer, bytes);
        }
-       return ret != 0;
+       return ret == 1;
 }
 
 METHOD(rng_t, allocate_bytes, bool,