|
16 | 16 | #include <workerd/server/workerd-capnp-schema.embed.h> |
17 | 17 | #include <workerd/server/workerd.capnp.h> |
18 | 18 | #include <workerd/util/autogate.h> |
| 19 | +#include <workerd/util/entropy-source.h> |
19 | 20 |
|
20 | 21 | #include <fcntl.h> |
21 | | -#include <openssl/rand.h> |
22 | 22 | #include <sys/stat.h> |
23 | 23 |
|
24 | 24 | #include <capnp/dynamic.h> |
@@ -94,15 +94,6 @@ __lsan_default_suppressions() { |
94 | 94 | } |
95 | 95 | #endif |
96 | 96 |
|
97 | | -// ======================================================================================= |
98 | | - |
99 | | -class EntropySourceImpl: public kj::EntropySource { |
100 | | - public: |
101 | | - void generate(kj::ArrayPtr<kj::byte> buffer) override { |
102 | | - KJ_ASSERT(RAND_bytes(buffer.begin(), buffer.size()) == 1); |
103 | | - } |
104 | | -}; |
105 | | - |
106 | 97 | // ======================================================================================= |
107 | 98 | // Some generic CLI helpers so that we can throw exceptions rather than return |
108 | 99 | // kj::MainBuilder::Validity. Honestly I do not know how people put up with patterns like |
@@ -1475,7 +1466,7 @@ class CliMain final: public SchemaFileImpl::ErrorReporter { |
1475 | 1466 | kj::Own<kj::Filesystem> fs = kj::newDiskFilesystem(); |
1476 | 1467 | kj::AsyncIoContext io = kj::setupAsyncIo(); |
1477 | 1468 | NetworkWithLoopback network{io.provider->getNetwork(), *io.provider}; |
1478 | | - EntropySourceImpl entropySource; |
| 1469 | + BufferedEntropySource entropySource; |
1479 | 1470 |
|
1480 | 1471 | kj::Vector<kj::Path> importPath; |
1481 | 1472 | capnp::SchemaParser schemaParser; |
|
0 commit comments