Skip to content

Instantly share code, notes, and snippets.

@maxiaodong97
maxiaodong97 / PredictableRNG.cpp
Created March 18, 2017 00:15
Force openssl to generate same traffic for testing purpose
/**
* The idea is to set RNG for openssl application, so it can generate replay-able traffic
*/
#include <openssl/rand.h>
static void predict_rand_cleanup() {}
static int predict_rand_status() { return 1; }
static void predict_rand_seed(const void *buf, int num) {}
static int predict_rand_bytes(unsigned char *buf, int num)
{