Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignatureCounterValidator and TimeStampValidator fail, when presented tar files, which are not sorted and disjoint #48

Open
dheldt opened this issue Apr 30, 2021 · 2 comments

Comments

@dheldt
Copy link
Collaborator

dheldt commented Apr 30, 2021

SignatureCounterValidator.validate() should be able to handle multiple tar files (i.e. instance of LogMessageArchive) one after another. This currently only works, if the tars are "sorted", i.e. the first tar contains all log messages up to a fixed point of time and the second contains all subsequent log messages. If the tars are "mixed" somewhat, the Validators fail and produce a lot of errors, which might be no errors.

Here I am unsure, what the best architecture is fix this issue.

@nils-tekampe
Copy link
Contributor

I would suggest an architecture where a validator (or a kind of meta-validator) can only be called once but would accept a list of tar files.

@dheldt
Copy link
Collaborator Author

dheldt commented May 3, 2021

I made a proposal in #50.

I create a LogMessageArchive, which contains a set of LogMessageArchives, that can be validated in one step.

It would look like:

AggregatedLogMessageArchive tarSet = new AggregatedLogMessageArchive();

tarSet.add(new LogMessageArchiveImplementation(tarFile1))
.add(new LogMessageArchiveImplementation(tarFile2))
.add(new LogMessageArchiveImplementation(tarFile3))
.add(new LogMessageArchiveImplementation(tarFile4));

Validator v = new WhatEverValidator();

v.validate(tarSet);

The AggregatedLogMessageArchive removes duplicate logmessages, which occur multiple times in the archives, which solves the original problem.

Still, AggregatedLogMessageArchive has two Hashmap<String, X509Certificate> to hold the tars certificates. Here I fear, that a Hashmap was not the right choice of datatype in the first place, which now starts to create a problem. We might have the same certificate with different file names here or even different certificates with the same file name, which would mean, that we "loose" one of them in the aggregation step. Maybe this should be better a Collection<Pair<String, X509Certificate>> in the first place (i.e. in LogMessageArchive, LogMessageArchiveImplementation, and AggregatedLogMessageArchive)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants