RAND_bytes/RAND_pseudo_bytes returns -1 if it is not supported by RAND method
authorMartin Willi <martin@revosec.ch>
Tue, 9 Apr 2013 09:12:16 +0000 (11:12 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 10 Apr 2013 16:10:30 +0000 (18:10 +0200)
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,