]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Modernize the hash module
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Sat, 24 Feb 2024 01:19:18 +0000 (19:19 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Sat, 24 Feb 2024 01:19:18 +0000 (19:19 -0600)
commit154742c3fa1bf14f92ac0b42d02ed8d1d5010a05
treedce879359df2adbbf6d4ad60994c7c76121a1e68
parent6d7985b72fa3462d311aa9421e1342fcaa2deef6
Modernize the hash module

It seems nowadays libcrypto wants us to

- perform "explicit [algorithm] fetching,"
- cache algorithms to improve performance,
- and stop hardcoding algorithms in the code (which largely doesn't
  really apply in our RFC-bound situation).

https://www.openssl.org/docs/man3.0/man7/crypto.html#ALGORITHM-FETCHING

So fetch explicitely, cache algorithms and try to keep hardcoding at a
minimum.

Also, the code was seemingly unaware that hash size depends on
algorithm, so this was often validated weakly.
19 files changed:
src/asn1/signed_data.c
src/crypto/hash.c
src/crypto/hash.h
src/extension.c
src/extension.h
src/main.c
src/object/certificate.c
src/object/manifest.c
src/rrdp.c
src/slurm/db_slurm.h
src/slurm/slurm_loader.c
test/Makefile.am
test/crypto/hash_test.c [new file with mode: 0644]
test/line_file_test.c
test/resources/line_file/core.txt [moved from test/line_file/core.txt with 100% similarity]
test/resources/line_file/empty.txt [moved from test/line_file/empty.txt with 100% similarity]
test/resources/line_file/error.txt [moved from test/line_file/error.txt with 100% similarity]
test/resources/lorem-ipsum.txt [new file with mode: 0644]
test/rrdp_test.c