Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • BIND BIND
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 603
    • Issues 603
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 87
    • Merge requests 87
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • BINDBIND
  • Merge requests
  • !325

Change isc_random() to be just PRNG, and add isc_nonce_buf() that uses CSPRNG

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Ondřej Surý requested to merge 289-add-non-cs-prng into master May 28, 2018
  • Overview 16
  • Commits 3
  • Pipelines 18
  • Changes 43

As discovered by @each and our QA, the (SYS_)getrandom() is very slow due syscalls. And even though using CSPRNG is better, we actually don't need CSPRNG at many places (only for generating nonces at few places).

This MR changes isc_random() API to use xoroshiro128** and adds isc_nonce_buf() function; therefore isc_random() family of functions MUST NOT be used for generating secrets.

The MR also makes more extensive use of isc_random_uniform() in places where the code looked like isc_random() % n. The isc_random_uniform() might be (randomly) slower than using plain modulo, but it has better (uniform) distribution of random numbers. This needs to be carefully reviewed.

Closes #289 (closed)

Edited May 29, 2018 by Ondřej Surý
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 289-add-non-cs-prng