Solve empty password issue #2

This commit is contained in:
J-Jamet committed 2018-04-20 15:48:53 +02:00
1 parent 7f5138b08b
commit e62f8bf56b
7 files changed
+28 -31

No files matched your search

@@ -338,15 +338,14 @@ public class PwDatabaseV4 extends PwDatabase<PwGroupV4, PwEntryV4> {
@Override
public byte[] getMasterKey(String key, InputStream keyInputStream)
throws InvalidKeyFileException, IOException {
assert(key != null);
byte[] fKey = new byte[]{};
if ( key.length() > 0 && keyInputStream != null) {
if (key != null && keyInputStream != null) {
return getCompositeKey(key, keyInputStream);
} else if ( key.length() > 0 ) {
} else if (key != null) { // key.length() >= 0
fKey = getPasswordKey(key);
} else if ( keyInputStream != null) {
} else if (keyInputStream != null) { // key == null
fKey = getFileKey(keyInputStream);
}