diff options
author | Matthew Wong <wongma@protonmail.ch> | 2015-07-19 22:46:39 -0400 |
---|---|---|
committer | Matthew Wong <wongma@protonmail.ch> | 2015-07-19 22:46:39 -0400 |
commit | 3b12c79a6cbf86889e3c430f35669cfbeea99679 (patch) | |
tree | aea3303a8847e0950f08ee407670fc269de70ad2 /app/src/main/java/com | |
parent | 7e0b860816cdea00ad717ef294bbf7ed91393d4e (diff) |
ssh keys with empty passphrase should not be written as "encrypted" (said keys still worked)
Diffstat (limited to 'app/src/main/java/com')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java b/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java index 11db75b4..40c44065 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java +++ b/app/src/main/java/com/zeapo/pwdstore/SshKeyGen.java @@ -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); |