Skip to content

Commit

Permalink
Merge pull request #147 from hamann/jsch-fork
Browse files Browse the repository at this point in the history
Migrate to fork of JSch
  • Loading branch information
retrogradeorbit authored Mar 31, 2022
2 parents 7d3ebd7 + 7d36d3f commit a07f338
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 10 deletions.
169 changes: 165 additions & 4 deletions graal-configs/reflect-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.AES128GCM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.AES192CBC",
"allDeclaredConstructors": true,
Expand Down Expand Up @@ -191,6 +198,20 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.AES256GCM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.AESGCM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.ARCFOUR",
"allDeclaredConstructors": true,
Expand Down Expand Up @@ -219,6 +240,13 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.BlowfishCTR",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.DH",
"allDeclaredConstructors": true,
Expand Down Expand Up @@ -275,6 +303,20 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACMD596ETM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACMD5ETM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA1",
"allDeclaredConstructors": true,
Expand All @@ -289,20 +331,83 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA196ETM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA1ETM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA224SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA256",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA2562SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA256ETM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA256SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA384SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA512",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA512ETM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.HMACSHA512SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.KeyPairGenDSA",
"allDeclaredConstructors": true,
Expand Down Expand Up @@ -352,6 +457,13 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SHA224",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SHA256",
"allDeclaredConstructors": true,
Expand All @@ -367,28 +479,35 @@
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SHA256",
"name": "com.jcraft.jsch.jce.SHA512",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SHA384",
"name": "com.jcraft.jsch.jce.SignatureDSA",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SHA512",
"name": "com.jcraft.jsch.jce.SignatureECDSA256",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureDSA",
"name": "com.jcraft.jsch.jce.SignatureECDSA384",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureECDSA512",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
Expand All @@ -401,6 +520,48 @@
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureRSASHA224SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureRSASHA256",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureRSASHA256SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureRSASHA384SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureRSASHA512",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.SignatureRSASHA512SSHCOM",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "com.jcraft.jsch.jce.TripleDESCBC",
"allDeclaredConstructors": true,
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
[org.clojure/data.json "1.0.0"]
[cheshire "5.10.0"]

[com.jcraft/jsch "0.1.55"]
[com.github.mwiede/jsch "0.2.0"]

;; base64 and password crypt
[commons-codec/commons-codec "1.12"]
Expand Down
13 changes: 8 additions & 5 deletions src/clj/spire/ssh_agent.clj
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,18 @@
(throw (ex-info "improper response code from ssh-agent" {:code (first read)}))))))


(defn sign-request [sock blob data]
(defn sign-request [sock blob data algorithm]
;; write request query
(send-query
sock
(concat
(pack/pack-byte (codes :sign-request))
(pack/pack-data blob)
(pack/pack-data data)
(pack/pack-int 0)))
(pack/pack-int (case algorithm
"rsa-sha2-256" 0x2
"rsa-sha2-512" 0x4
0x0))))

;; read response
(let [read (byte-array 4)]
Expand Down Expand Up @@ -116,10 +119,10 @@
(getPublicKeyBlob []
(when debug (prn 'make-identity 'getPublicKeyBlob))
(byte-array blob))
(getSignature [data]
(when debug (prn 'make-identity 'getSignature data))
(getSignature [data algorithm]
(when debug (prn 'make-identity 'getSignature data algorithm))
(let [sock (open-auth-socket)
signature (sign-request sock blob data)]
signature (sign-request sock blob data algorithm)]
(close-auth-socket sock)
(byte-array signature)))
(getName []
Expand Down

0 comments on commit a07f338

Please sign in to comment.