randomizing masterkeys is now a explicit task, so random numbers are not needed when loading a masterkey file from disk. trying to use an uninitialized cryptor results in runtime exceptions

This commit is contained in:
Sebastian Stenzel
2015-11-23 15:09:39 +01:00
parent 2fca4629b9
commit a7c19624ce
7 changed files with 36 additions and 15 deletions
@@ -22,6 +22,11 @@ public class AbstractCryptorDecorator implements Cryptor {
this.cryptor = cryptor;
}
@Override
public void randomizeMasterKey() {
cryptor.randomizeMasterKey();
}
@Override
public void encryptMasterKey(OutputStream out, CharSequence password) throws IOException {
cryptor.encryptMasterKey(out, password);
@@ -27,6 +27,11 @@ import org.cryptomator.crypto.exceptions.WrongPasswordException;
*/
public interface Cryptor extends Destroyable {
/**
* Assigns new random bytes to the keys in this Cryptor instance.
*/
void randomizeMasterKey();
/**
* Encrypts the current masterKey with the given password and writes the result to the given output stream.
*/