ssh keys with empty passphrase should not be written as "encrypted" (said keys still worked)
This commit is contained in:
parent
7e0b860816
commit
3b12c79a6c
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue