diff options
Diffstat (limited to 'entropy.c')
-rw-r--r-- | entropy.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -209,6 +209,18 @@ seed_rng(void) | |||
209 | #ifndef OPENSSL_PRNG_ONLY | 209 | #ifndef OPENSSL_PRNG_ONLY |
210 | unsigned char buf[RANDOM_SEED_SIZE]; | 210 | unsigned char buf[RANDOM_SEED_SIZE]; |
211 | #endif | 211 | #endif |
212 | /* | ||
213 | * OpenSSL version numbers: MNNFFPPS: major minor fix patch status | ||
214 | * We match major, minor, fix and status (not patch) for <1.0.0. | ||
215 | * After that, we acceptable compatible fix versions (so we | ||
216 | * allow 1.0.1 to work with 1.0.0). Going backwards is only allowed | ||
217 | * within a patch series. | ||
218 | */ | ||
219 | u_long version_mask = SSLeay() >= 0x1000000f ? ~0xffff0L : ~0xff0L; | ||
220 | if (((SSLeay() ^ OPENSSL_VERSION_NUMBER) & version_mask) || | ||
221 | (SSLeay() >> 12) < (OPENSSL_VERSION_NUMBER >> 12)) | ||
222 | fatal("OpenSSL version mismatch. Built against %lx, you " | ||
223 | "have %lx", (u_long)OPENSSL_VERSION_NUMBER, SSLeay()); | ||
212 | 224 | ||
213 | #ifndef OPENSSL_PRNG_ONLY | 225 | #ifndef OPENSSL_PRNG_ONLY |
214 | if (RAND_status() == 1) { | 226 | if (RAND_status() == 1) { |