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

Are index hash-files necessary ? #272

Open
TinCanTech opened this issue Feb 21, 2022 · 2 comments
Open

Are index hash-files necessary ? #272

TinCanTech opened this issue Feb 21, 2022 · 2 comments
Assignees
Milestone

Comments

@TinCanTech
Copy link
Owner

TinCanTech commented Feb 21, 2022

Master-hash is probably sufficient but need to test rigorously ..

@TinCanTech TinCanTech added the undecided This issue may be nothing label Feb 21, 2022
@TinCanTech TinCanTech added this to the Version 2.8.0 (The forth) milestone Feb 21, 2022
@TinCanTech TinCanTech self-assigned this Feb 21, 2022
TinCanTech referenced this issue Feb 22, 2022
@TinCanTech
Copy link
Owner Author

Hashing the various index files has been disabled, both during an update of the index and when building Master hash. So far the results seem ok, manual changes are still noticed.

TinCanTech referenced this issue Feb 22, 2022
Use $request_fixed_hash to cause the final OpenSSL function to return
a fixed hash and not hash either files or data.

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Feb 22, 2022
Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Feb 24, 2022
* Add required update_master_hash=1 flags

* Disable hash -save for:
  - Config-hash
  - inline-index-hash
  - tlskey-index-hash
  - disabled-list-hash

* Move disabled_list_save_hash() up one function level
  and disable the function

* Add a comment about validating Master-Hash
  Validation is already done during match_two_hashes()
  Todo: Rename match_two_hashes() to validate_and_match_two_hashes()

* Add a helpful note when Master-Hash match fails

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Feb 24, 2022
The old Master-hash will cat the file-list in one instance of cat
and then pipe the output to SSL for single hash. This requires one
subshell.

The new Master-hash opens the entire file-list one instance of SSL
and hashes each file to a hash-list.  This hash-list hashed by piping
it to a second SSL.  This requires one subsell.

Open hash-files with read instead of cat. Requires one less subshell.

Re-instate master_verify_hash_block=1 to block excess use.

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Feb 24, 2022
Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Feb 25, 2022
Repeated testing proves that old_master_hash() is at least as fast
as new_master_hash() and possibly even faster.

new_master_hash() input file-names are not reliable, the path varies
between full-path for unit-tests and partial-path for command line.
This results in a failed master-hash at command line after unit-test
completion.  This is simply not acceptable.

Trying to control the input for hashing is much easier by using cat
to copy the files as-is, directly to hashing.  This also uses less
external binaries: Old:cat->openssl vs New:openssl->sed->openssl

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 1, 2022
TinCanTech referenced this issue Mar 1, 2022
Separate hash files are not necessary, so disable them.
This patch serves as a template to disabling the others.

For EASYTLS_DISABLED_HASH:
1. Remove the file as an initial requirement.
2. Create the file with the fixed hash.
3. Make the file an exception to save_file_hash():valid_targets.
   The exception: If the file exists then succeed without change.

Add some other command comments that need to be enabled.

Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech TinCanTech removed the undecided This issue may be nothing label Mar 1, 2022
TinCanTech referenced this issue Mar 2, 2022
* skip_master_hash=1
Introduce secondary layer of protection:
All commands which make no changes MUST use skip_master_hash.
All commands which make changes MUST use update_master_hash.
skip_master_hash and update_master_hash are mutually exclusive.

* Restyle save_master_hash(), minor improvement.

* Add check for empty input list to generate the master hash.

* easytls_create_layout() prints fixed-hashes to default hash-files.

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 2, 2022
TinCanTech referenced this issue Mar 2, 2022
This bug was discovered by the double-guard of save_master_hash()

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 3, 2022
TinCanTech referenced this issue Mar 3, 2022
TinCanTech referenced this issue Mar 4, 2022
Simply use parameter 1.

Add comments for validate_hash_block

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 4, 2022
validate_hash() only uses shell built-in tests, not crypto.
Therefore, this guard is of limited benefit, none-the-less..

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 4, 2022
These files are all protected by master-hash.

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 4, 2022
disable_validate_hash does as its name suggests.

After Master-hash has been fully verified then ALL subsequent hashes
are considered to be valid.
* disable_validate_hash=1

The one exception being Master-hash, which is still validated.
* unset disable_validate_hash

Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 4, 2022
Signed-off-by: Richard T Bonhomme <[email protected]>
TinCanTech referenced this issue Mar 8, 2022
Signed-off-by: Richard T Bonhomme <[email protected]>
@TinCanTech
Copy link
Owner Author

Status: Permanently disabled all verify and save functions for all hash files except Master hash.

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

No branches or pull requests

1 participant