File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ A: Probably a disk full, or permission error.
133
133
Via [clojars](http://clojars.org ) and
134
134
[Leiningen](http://github.com/technomancy/leiningen ).
135
135
136
- :dependencies [clj-ssh " 0.5.0 " ]
136
+ :dependencies [clj-ssh " 0.5.1 " ]
137
137
138
138
or your favourite maven repository aware tool.
139
139
Original file line number Diff line number Diff line change 1
1
# Release Notes
2
2
3
- Current release is 0.5.0
3
+ Current release is 0.5.1
4
+
5
+ ## 0.5.1
6
+
7
+ - Fix adding key string identities for ssh-agent
8
+ Adding string based ssh keys to an ssh-agent was broken.
4
9
5
10
## 0.5.0
6
11
Original file line number Diff line number Diff line change 1
- (defproject clj-ssh " 0.5.0 "
1
+ (defproject clj-ssh " 0.5.1 "
2
2
:description " Library for using SSH from clojure."
3
3
:url " https://github.com/hugoduncan/clj-ssh"
4
4
:license {:name " Eclipse Public License"
Original file line number Diff line number Diff line change 84
84
(keyword? arg) (name arg)
85
85
:else (str arg)))
86
86
87
+ (def ^java.nio.charset.Charset ascii
88
+ (java.nio.charset.Charset/forName " US-ASCII" ))
89
+
90
+ (defn- ^{:tag (Class/forName " [B" )} as-bytes
91
+ " Return arg as a byte array. arg must be a string or a byte array."
92
+ [arg]
93
+ (if (string? arg)
94
+ (.getBytes ^String arg ascii)
95
+ arg))
96
+
87
97
(defn ssh-agent?
88
98
" Predicate to test for an ssh-agent."
89
99
[object] (instance? JSch object))
149
159
identity
150
160
(.addIdentity agent identity passphrase)
151
161
152
- ( and public-key private-key)
162
+ private-key
153
163
(let [^com.jcraft.jsch.IdentityRepository id-repo (id-repository )]
154
164
(if (local-repo? id-repo)
155
165
(.addIdentity agent name private-key public-key passphrase)
156
- (let [keypair (KeyPair/load agent private-key-path public-key-path)]
166
+ (let [^KeyPair keypair
167
+ (KeyPair/load
168
+ agent (as-bytes private-key) (as-bytes public-key))]
157
169
(when passphrase
158
170
(.decrypt keypair passphrase))
159
171
(.add id-repo (.forSSHAgent keypair)))))
You can’t perform that action at this time.
0 commit comments