diff options
author | Jay Berkenbilt <ejb@ql.org> | 2013-12-16 22:03:54 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2013-12-16 22:21:28 +0100 |
commit | 235d8f28f8b7de0f1fea3f8fecc5af6c3917c650 (patch) | |
tree | 519f2f91f021a5fa20794fe9b3bc3ace611a3513 /libqpdf/QUtil.cc | |
parent | b8b273d14d86e44101ffa73cecd38e49d1d775a5 (diff) | |
download | qpdf-235d8f28f8b7de0f1fea3f8fecc5af6c3917c650.tar.zst |
Increase random data provider support
Add a method to get the current random data provider, and document and
test the method for resetting it.
Diffstat (limited to 'libqpdf/QUtil.cc')
-rw-r--r-- | libqpdf/QUtil.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index c5fe535c..39ce4088 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -423,6 +423,8 @@ initialize_random_data_provider() random_data_provider = insecure_random_data_provider; } } + // QUtil.hh has comments indicating that getRandomDataProvider(), + // which calls this method, never returns null. if (random_data_provider == 0) { throw std::logic_error("QPDF has no random data provider"); @@ -435,6 +437,13 @@ QUtil::setRandomDataProvider(RandomDataProvider* p) random_data_provider = p; } +RandomDataProvider* +QUtil::getRandomDataProvider() +{ + initialize_random_data_provider(); + return random_data_provider; +} + void QUtil::initializeWithRandomBytes(unsigned char* data, size_t len) { |