diff --git a/doc/api/cli.md b/doc/api/cli.md index c2c2efbcc0eef8..af1d6a7ad09751 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -848,6 +848,40 @@ Enables report to be generated on uncaught exceptions. Useful when inspecting the JavaScript stack in conjunction with native stack and other runtime environment data. +### `--secure-heap=n` + + +Initializes an OpenSSL secure heap of `n` bytes. When initialized, the +secure heap is used for selected types of allocations within OpenSSL +during key generation and other operations. This is useful, for instance, +to prevent sensitive information from leaking due to pointer overruns +or underruns. + +The secure heap is a fixed size and cannot be resized at runtime so, +if used, it is important to select a large enough heap to cover all +application uses. + +The heap size given must be a power of two. Any value less than 2 +will disable the secure heap. + +The secure heap is disabled by default. + +The secure heap is not available on Windows. + +See [`CRYPTO_secure_malloc_init`][] for more details. + +### `--secure-heap-min=n` + + +When using `--secure-heap`, the `--secure-heap-min` flag specifies the +minimum allocation from the secure heap. The minimum value is `2`. +The maximum value is the lesser of `--secure-heap` or `2147483647`. +The value given must be a power of two. + ### `--throw-deprecation` + +* Returns: {Object} + * `total` {number} The total allocated secure heap size as specified + using the `--secure-heap=n` command-line flag. + * `min` {number} The minimum allocation from the secure heap as + specified using the `--secure-heap-min` command-line flag. + * `used` {number} The total number of bytes currently allocated from + the secure heap. + * `utilization` {number} The calculated ratio of `used` to `total` + allocated bytes. + ### `crypto.setEngine(engine[, flags])`