Skip to content

crypto: add missing rand.h includes

Before https://github.com/nodejs/node/pull/35093 this include was explicitly there but it was remove in the refactor - without this Electron fails to compile with:

../../third_party/electron_node/src/crypto/crypto_util.cc:65:18: error: use of undeclared identifier 'RAND_status'
    int status = RAND_status();
                 ^
../../third_party/electron_node/src/crypto/crypto_util.cc:71:9: error: use of undeclared identifier 'RAND_poll'
    if (RAND_poll() == 0)
        ^
../../third_party/electron_node/src/crypto/crypto_util.cc:82:10: error: use of undeclared identifier 'RAND_bytes'
  return RAND_bytes(buffer, length) != -1;
         ^
3 errors generated.
ninja: build stopped: subcommand failed.

If there's another preferred approach let me know!

cc @jasnell

Merge request reports

Loading