jirka-h / haveged

Entropy daemon ![Continuous Integration](https://github.com/jirka-h/haveged/workflows/Continuous%20Integration/badge.svg)
GNU General Public License v3.0
273 stars 34 forks source link

Fix haveged diagnostics capture mode #10

Closed erahn closed 5 years ago

erahn commented 5 years ago

This change resolves #9 by fixing the variable that haveged checks during the rng warmup. Previously it was checking hctxt->havege_tic but h_ctxt->havege_tics[i>>3] is what actually gets updated when in diagnostics mode. HTICK1 correctly references the right variable in both modes.

Testing was done by checking an output can be obtained:

> src/haveged -r 2 -n 100
havege_diagnostic: listening socket at 3
Writing 100  output to sample
jirka-h commented 5 years ago

Thanks for fixing this!