diff options
author | Niclas Eklund <[email protected]> | 2010-11-02 12:45:28 +0100 |
---|---|---|
committer | Niclas Eklund <[email protected]> | 2010-11-02 12:45:28 +0100 |
commit | f8ac585a7ba8b2d35bc24c6d7c2fa5d5df1e2f6e (patch) | |
tree | 262a3bc2e27a69b0536f0ed3e0973bd2369fd1c8 /lib/ssh/src | |
parent | f1a93fefc975f9ce7121dec156d853c2b0cde7d1 (diff) | |
parent | b93c12e8e0113862be038565fc04e170cfe3c12a (diff) | |
download | otp-f8ac585a7ba8b2d35bc24c6d7c2fa5d5df1e2f6e.tar.gz otp-f8ac585a7ba8b2d35bc24c6d7c2fa5d5df1e2f6e.tar.bz2 otp-f8ac585a7ba8b2d35bc24c6d7c2fa5d5df1e2f6e.zip |
Merge branch 'maint-r14' into dev
Diffstat (limited to 'lib/ssh/src')
-rw-r--r-- | lib/ssh/src/ssh.appup.src | 2 | ||||
-rwxr-xr-x | lib/ssh/src/ssh_file.erl | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 619b4b736f..9c806bcd03 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -19,9 +19,11 @@ {"%VSN%", [ + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ], [ + {"2.0.2", [{load_module, ssh_file, soft_purge, soft_purge, []}]}, {"2.0.1", [{restart_application, ssh}]} ] }. diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl index 5572349fe7..13722656db 100755 --- a/lib/ssh/src/ssh_file.erl +++ b/lib/ssh/src/ssh_file.erl @@ -198,12 +198,17 @@ read_public_key_v1(File) -> %% pem_type("ssh-rsa") -> "RSA". read_private_key_v2(File, Type) -> - case catch (public_key:pem_to_der(File)) of - {ok, [{_, Bin, not_encrypted}]} -> - decode_private_key_v2(Bin, Type); - Error -> %% Note we do not handle password encrypted keys at the moment - {error, Error} - end. + case file:read_file(File) of + {ok, PemBin} -> + case catch (public_key:pem_decode(PemBin)) of + [{_, Bin, not_encrypted}] -> + decode_private_key_v2(Bin, Type); + Error -> %% Note we do not handle password encrypted keys at the moment + {error, Error} + end; + {error, Reason} -> + {error, Reason} + end. %% case file:read_file(File) of %% {ok,Bin} -> %% case read_pem(binary_to_list(Bin), pem_type(Type)) of |