Commit Graph

42 Commits

Author SHA1 Message Date
surtur 795b9ffe54
add proper SeedFileManager implementation
All checks were successful
continuous-integration/drone/push Build is passing
a couple of fixes/necessary additions were made along the way, namely:
* add a default constructor for DoTask
* rework of the mutex/lock_guard/unique_lock logic in generator/fortuna
* add .fortuna.seed to the list of the ignored (.gitignore)
* add helper function to util for convertin bytes to blocks (16b==block)
* add a wrapper for around the SeedFileManager instance and a way to see
  if it's dead or alive (so that it can be restarted if needed)
* the timeout for saving of the seed file has been decreased to a more
  reasonable value than 10 minutes (I wouldn't want to lose potentially
  up to 10 minutes worth of entropy)
2022-01-09 11:58:38 +01:00
surtur e7cce999a0
ci: fix git submodule update --init race condition
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-14 04:41:43 +01:00
surtur ef418cf89c
fmt::fmt: header-only -> statically linked lib
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-13 05:50:56 +01:00
surtur 04e088c07f
cmake: reindent;add vim modeline
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-07 17:45:05 +01:00
surtur 5ad8e610a4
cmake: integrate iwyu, if/when present
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-07 06:20:26 +01:00
surtur d4c7c61ac4
cmake,makefile: think of clang++, too
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-07 05:14:56 +01:00
surtur 19d5ff0f22
cmake,makefile: SAN,TIDY,VALGRIND opts;clean turbo
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-07 03:42:42 +01:00
surtur 554030bbaa
cmake: a little refactor
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-04 05:33:14 +01:00
surtur 55cb3b6ec7
chore(cmake): improve legibility
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-01 07:11:21 +01:00
surtur 928011dd54
chore(cmake): record gcc switches for debugging
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-30 22:34:22 +01:00
surtur 6408b1ded7
add fmtlog library
All checks were successful
continuous-integration/drone/push Build is passing
"fmtlog is a performant fmtlib-style logging library with latency in nanoseconds."
ref: https://github.com/MengRao/fmtlog
2021-12-30 22:30:41 +01:00
surtur 129516a48f
add seed_file_management.h holding SeedFileManager
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-13 05:59:27 +01:00
surtur 65c476dbd6
add Util class + perform general refactor
All checks were successful
continuous-integration/drone/push Build is passing
* rm duplicate do_sha() code, consolidate in Util
* make reseed() public so that it can be called from outside
* rm reseed() from do_crypto() where it has no place
2021-12-13 05:10:07 +01:00
surtur da48e61cc2
add da_threading lib
All checks were successful
continuous-integration/drone/push Build is passing
retrieved from https://stackoverflow.com/a/46135882
original author LWimsey <https://stackoverflow.com/users/6651824/lwimsey> (c) 2017
edited and made into a header-only lib by wanderer <a_mirre at utb.cz> (c) 2021
2021-12-12 22:50:06 +01:00
surtur cf41d323a4
fortuna: add task runner "do_task"; link pthread
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-12 18:42:47 +01:00
surtur d0e9b08886
accumulator: add urandom_entropy_src
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-11 02:24:40 +01:00
surtur a5b988ba71
accumulator: add event_scheduler,entropy_src ifces
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-11 02:12:49 +01:00
surtur 801d605e2a
chore(clang-tidy): unify flags
All checks were successful
continuous-integration/drone/push Build is passing
also add a status message to CMake's output
2021-12-10 18:57:25 +01:00
surtur 872e6f7f9f
add event_adder_impl
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-08 03:58:18 +01:00
surtur bc5bb6e700
add EventAdder interface
All checks were successful
continuous-integration/drone/push Build is passing
will be used as a base implementations of sources of random events
2021-12-06 01:02:43 +01:00
surtur 7f05984946
integrate clang-tidy into cmake
All checks were successful
continuous-integration/drone/push Build is passing
* consolidate everything with the makefile, the "tidy" target now just
  sets the env var that is checked for in CMakeLists
* rm clang-tidy from pre-commit as it's run as part of the "test"
  makefile target later in the file anyway
2021-12-05 05:13:07 +01:00
surtur a1cbbb209e
handle PRNG state in R_state + accumulator basis
All checks were successful
continuous-integration/drone/push Build is passing
* handle the PRNG state with R_state nested class
* add a private property R holding PRNG state to Fortuna
* add R_state properties as defined in Cryptography Engineering:
  * a generator instance
  * a reseed counter
  * 32 pools that the collected entropy is to be distributed over

* add initial definition of the Pool object and its initialization

* attempt to initialize PRNG in Fortuna constructor. wrap the
  initialization call in a try-catch block like a cultured person
* erase the string used to print data from random_data() after it's been
  used
2021-12-04 00:40:39 +01:00
surtur 77f1fe4c56
cmake,makefile: sanitize!
All checks were successful
continuous-integration/drone/push Build is passing
as per #3
2021-12-02 18:34:07 +01:00
surtur e72aa06813
executable hardening v2
All checks were successful
continuous-integration/drone/push Build is passing
* enable PIE
* pass flags to linker based on the build type
* enable LTO
2021-12-02 18:25:15 +01:00
surtur bb12cf7b56
cmake: always set -Wall
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-02 14:50:39 +01:00
surtur b15e1e9a55
harden executable
All checks were successful
continuous-integration/drone/push Build is passing
* fortify source
* link with "-pie"
* split stack
* set stack-protector to all
2021-11-30 15:52:17 +01:00
surtur d942e06263
cmake: compile PIC with "-fPIC"
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-20 22:31:55 +01:00
surtur e531aa6289
cmake: print version
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-20 22:31:55 +01:00
surtur bd421295c4
feat: use fmt instead of iostreams
All checks were successful
continuous-integration/drone/push Build is passing
switch to fmt - "A modern formatting library" - for fun and profit,
currently in header-only configuration.

ref: https://github.com/fmtlib/fmt

closes #5
closes #4
2021-11-18 22:05:05 +01:00
surtur 9fd35eee93
cmake: require the declared cxx standard
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-18 19:49:15 +01:00
surtur b934b11aa9
cmake(release): harden the build
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-15 23:07:59 +01:00
surtur 0199fbd675
cmake: optimize for debugging with -Og
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-15 23:04:37 +01:00
surtur bad86c31df
refactor(-lcryptopp): use cmake's facilities
All checks were successful
continuous-integration/drone/push Build is passing
this means that all builds configured with cmake (not just those called
with our custom development makefile) are properly linked with cryptopp
2021-11-13 00:13:19 +01:00
surtur ea11801789
add fortuna class
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-10 23:58:42 +01:00
surtur 2bab9e7afa
cmake: use lld if available
All checks were successful
continuous-integration/drone/push Build is passing
the find "query" is a little naive but hey, we're looking at the usual
place. the purpose of this change is iteration speedup and as lld is the
quickest kid on the block, we're using it.
2021-11-02 04:40:07 +01:00
surtur 87b13e1e1e
chore(cmake): print compiler id
[skip ci]
2021-11-02 04:40:07 +01:00
surtur c968d8c4ba
chore(cmake): force compiler colours
I know, right...

[skip ci]
2021-11-02 04:40:07 +01:00
surtur 46a6cdba3a
cmake: add {-g3,-gsplit-dwarf} flags for debugging
All checks were successful
continuous-integration/drone/push Build is passing
cmake:
* check if we're being run for valgrind, in which case do not split
  dwarf information, valgrinds does not like it (see #1).

makefile:
* build for vagrant into a separate folder entirely.

ci:
* install gcc, cmake and ninja along with vagrant, since now we are
  building inside of the ci container as well.

close #1
2021-11-02 04:40:07 +01:00
surtur ebba54b940
chore(cmake): move CMAKE_CXX_FLAGS to CMakeLists
All checks were successful
continuous-integration/drone/push Build is passing
* use proper conditionals, should any overrides exist in the environment
* distinguish between debug and release builds and set flags accordingly
2021-11-01 08:54:55 +01:00
surtur 14eaaf98f7
cmake: specify project lang
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-31 23:08:41 +01:00
surtur bd9208a635
cmake: lower the required version 2021-10-24 21:29:59 +02:00
surtur c44fa825c4
initial commit 2021-10-24 21:29:49 +02:00