summaryrefslogtreecommitdiffstats
path: root/libtests/random.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-11-30 18:25:01 +0100
committerJay Berkenbilt <ejb@ql.org>2013-12-14 21:17:36 +0100
commit30287d2d655e1a9fe476477b6c74b62f816f37d6 (patch)
tree54b8088e9945e634d91060a413011e62ba35bb96 /libtests/random.cc
parent5e3bad2f86665b35155095b91a2d672fc7335870 (diff)
downloadqpdf-30287d2d655e1a9fe476477b6c74b62f816f37d6.tar.zst
Allow OS-provided secure random to be disabled
Diffstat (limited to 'libtests/random.cc')
-rw-r--r--libtests/random.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/libtests/random.cc b/libtests/random.cc
index 644fdd91..0099844b 100644
--- a/libtests/random.cc
+++ b/libtests/random.cc
@@ -1,4 +1,5 @@
#include <qpdf/QUtil.hh>
+#include <qpdf/qpdf-config.h>
#include <qpdf/InsecureRandomDataProvider.hh>
#include <qpdf/SecureRandomDataProvider.hh>
#include <iostream>
@@ -36,6 +37,7 @@ int main()
{
std::cout << "fail: two insecure randoms were the same\n";
}
+#ifndef SKIP_OS_SECURE_RANDOM
SecureRandomDataProvider srdp;
srdp.provideRandomData(reinterpret_cast<unsigned char*>(&r1), 4);
srdp.provideRandomData(reinterpret_cast<unsigned char*>(&r2), 4);
@@ -43,6 +45,7 @@ int main()
{
std::cout << "fail: two secure randoms were the same\n";
}
+#endif
BogusRandomDataProvider brdp;
QUtil::setRandomDataProvider(&brdp);
r1 = QUtil::random();