Commit Graph

5 Commits

Author SHA1 Message Date
Alexander Hughes cecd24ed38 Ensure cryptostrings contain all char types
This patch aims to:
1. Validate that generated cryptographic strings (salts and passphrases)
   contain at least one uppercase letter, lowercase letter, number and
   symbol before returning it to the user.
2. Add new unit tests for the cryptostring methods.
3. Move existing unit tests for cryptostring methods to new test file.
4. Rename test_generate_cryptostring to test_passphrases as this is
   more accurate of the tests contained in the file.

Change-Id: I669831fb515209467b236cca63502f64a9263d86
2019-04-11 13:22:58 -05:00
Alexander Hughes fce12add18 Set salt when generating genesis bundle
This patch:
1. Sets the salt in config when running genesis bundle
2. Updates the genesis bundle CLI method
3. Adds exception types for credentials
4. Updates unit tests to be compliant with new exceptions

Change-Id: I8869f897e2c25b98c30eaa6be52356aae4ac63b6
2019-03-14 15:45:53 -05:00
Lev Morgan 0252b71750 Search all scopes for catalogs
This patch revises pegleg to check all scopes for catalog files,
rather than just the site scope.

Change-Id: Icf03ce739968ef3ed5fd218ca0fe87e24451ba0d
2019-03-05 16:48:46 +00:00
Tin Lam aa241081c9 Fix exception handling and add tests
Per [0], fernet decrypt can never throw an InvalidSignature exception as that
is re-raised as InvalidToken. This patch set corrects the handling of the
exception, and added additional unit tests for coverage.

[0] https://cryptography.io/en/latest/fernet/#cryptography.fernet.Fernet.decrypt

Co-Authored-By: Drew Walters <drewwalters96@gmail.com>
Change-Id: Ic5ee7ef451a5657519c5397fc4b903b5adcb1d18
Signed-off-by: Tin Lam <tin@irrational.io>
2019-02-22 16:14:25 -06:00
Alexander Hughes 671b77f6a7 Add CLI generation of salt
Salts and Passphrases are both strings used in cryptography.  This patch:
1. Adds CLI generation of salt
2. Adds unit test for CLI generation of salt
3. Updates passphrase.py code to be more generic as it is used to generate
both a passphrase and a salt
4. Update name of passphrase.py to be more generic
5. Update all references to, and tests of passphrase.py
6. Add documentation for CLI generation of salt

Co-Authored-By: chittibabu <cg329x@att.com>

Change-Id: I71858d63a2846290d22be96686ccfea3ba8aa6c0
2019-02-20 16:51:01 +00:00