]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Ongoing rewrite of the local cache code
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 11 Jul 2023 23:00:46 +0000 (17:00 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Sat, 9 Sep 2023 00:04:37 +0000 (18:04 -0600)
commitc717043aad5bf8306a437ac0020bdfceeb8d2234
treed03c105ab486f3d6b8a2b1716cb709cbfaa9252c
parent2c6319ba77d272f704c41e2f68f4fb64222a56cd
Ongoing rewrite of the local cache code

It's a bit smarter now. Addresses a bunch of issues at once, though it
still needs several tweaks and testing:

- #78: Provide a dedicated namespace for each RRDP notification, to
  prevent malicious RPPs from overriding files from other RPPs.
- #79: RRDP session and serial are no longer cached in RAM; they're
  extracted from cached notification files as they are needed.
  This prevents all RRDP from being considered outdated during startup.
- #80: rsync-strategy has been removed.
- #81: The cache now retains RRDP files.

The refactor has been more intrusive than intended. I've been retouching
the core loop and rrdp/https code, which has yielded the following
further disinfections:

- #77: Refactor the HTTP code so 304 is handled as success, despite no
  file modifications having been made.
- It seems the old code was refusing to download RPPs via RRDP when said
  RPP wasn't also (unrelatedly) served via rsync. This seemed to stem
  from an old RFC misunderstanding from the previous developer.
- I've deprecated `rsync.priority` and `rrdp.priority`, mostly just to
  simplify the code. I haven't seen anyone using these config fields,
  and I think SIAs and/or randomness should be the ones to decide which
  protocol is preferred for a given RPP, not Fort's admin.
- However, I have also decided to deprecate `shuffle_tal_uris`, because
  I also suspect it's completely unused, and would like to hear some
  complaints otherwise.
- Deprecated `rsync.arguments-flat`, because non-recursive rsyncs are
  not needed anymore.
- Since RRDP files are no longer deleted immediately after use, the
  `DEBUG_RRDP` compilation has lost its purpose, so I deleted it.
- The code was using `HASH_ADD_STR` on strings contained outside of the
  node structure. This is illegal according to uthash's documentation,
  and might have induced some crashes in the past.
75 files changed:
.gitignore
deconf.sh
src/Makefile.am
src/abbreviations.txt
src/cache/local_cache.c [new file with mode: 0644]
src/cache/local_cache.h [new file with mode: 0644]
src/cache/tmp.c [new file with mode: 0644]
src/cache/tmp.h [new file with mode: 0644]
src/cert_stack.c
src/common.c
src/common.h
src/config.c
src/config.h
src/crypto/hash.c
src/data_structure/array_list.h
src/data_structure/path_builder.c [new file with mode: 0644]
src/data_structure/path_builder.h [new file with mode: 0644]
src/delete_dir_daemon.c [deleted file]
src/delete_dir_daemon.h [deleted file]
src/extension.c
src/file.c
src/file.h
src/http/http.c
src/http/http.h
src/internal_pool.c [deleted file]
src/internal_pool.h [deleted file]
src/line_file.c
src/log.c
src/main.c
src/object/certificate.c
src/object/manifest.c
src/object/name.c
src/object/tal.c
src/random.c [deleted file]
src/random.h [deleted file]
src/resource.c
src/rpp.h
src/rrdp/db/db_rrdp.c [deleted file]
src/rrdp/db/db_rrdp.h [deleted file]
src/rrdp/db/db_rrdp_uris.c [deleted file]
src/rrdp/db/db_rrdp_uris.h [deleted file]
src/rrdp/rrdp_loader.c
src/rrdp/rrdp_loader.h
src/rrdp/rrdp_objects.c
src/rrdp/rrdp_objects.h
src/rrdp/rrdp_parser.c
src/rrdp/rrdp_parser.h
src/rsync/rsync.c
src/rsync/rsync.h
src/rtr/db/db_table.c
src/rtr/db/db_table.h
src/rtr/db/vrps.c
src/rtr/pdu_handler.c
src/state.c
src/state.h
src/thread_var.c
src/types/uri.c
src/types/uri.h
src/validation_run.c
src/visited_uris.c [deleted file]
src/visited_uris.h [deleted file]
test/Makefile.am
test/cache/local_cache_test.c [new file with mode: 0644]
test/data_structure/path_builder_test.c [new file with mode: 0644]
test/data_structure/uthash_test.c
test/line_file_test.c
test/mock.c
test/mock.h
test/rrdp_objects_test.c
test/rsync_test.c [deleted file]
test/rtr/db/rtr_db_mock.c
test/rtr/db/vrps_test.c
test/rtr/pdu_handler_test.c
test/tal_test.c
test/types/uri_test.c