mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 22:05:19 +00:00
ssh keys with empty passphrase should not be written as "encrypted" (said keys still worked)
This commit is contained in:
@@ -175,7 +175,11 @@ public class SshKeyGen extends AppCompatActivity {
|
||||
|
||||
File file = new File(getFilesDir() + "/.ssh_key");
|
||||
FileOutputStream out = new FileOutputStream(file, false);
|
||||
kp.writePrivateKey(out, passphrase.getBytes());
|
||||
if (passphrase.length() > 0) {
|
||||
kp.writePrivateKey(out, passphrase.getBytes());
|
||||
} else {
|
||||
kp.writePrivateKey(out);
|
||||
}
|
||||
|
||||
file = new File(getFilesDir() + "/.ssh_key.pub");
|
||||
out = new FileOutputStream(file, false);
|
||||
|
Reference in New Issue
Block a user