mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 23:05:33 +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");
|
File file = new File(getFilesDir() + "/.ssh_key");
|
||||||
FileOutputStream out = new FileOutputStream(file, false);
|
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");
|
file = new File(getFilesDir() + "/.ssh_key.pub");
|
||||||
out = new FileOutputStream(file, false);
|
out = new FileOutputStream(file, false);
|
||||||
|
Reference in New Issue
Block a user