mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-15 18:02:58 +08:00
chore: upgrade jgit version
This commit is contained in:
@@ -105,6 +105,7 @@ dependencies {
|
|||||||
implementation(libs.jgit)
|
implementation(libs.jgit)
|
||||||
implementation(libs.jgit.sshd) { exclude(group = "*", module = "sshd-osgi") }
|
implementation(libs.jgit.sshd) { exclude(group = "*", module = "sshd-osgi") }
|
||||||
implementation(libs.jgit.agent) { exclude(group = "*", module = "sshd-osgi") }
|
implementation(libs.jgit.agent) { exclude(group = "*", module = "sshd-osgi") }
|
||||||
|
implementation(libs.eddsa)
|
||||||
implementation(libs.jnafilechooser)
|
implementation(libs.jnafilechooser)
|
||||||
implementation(libs.xodus.vfs)
|
implementation(libs.xodus.vfs)
|
||||||
implementation(libs.xodus.openAPI)
|
implementation(libs.xodus.openAPI)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ jsch = "0.2.21"
|
|||||||
okhttp = "4.12.0"
|
okhttp = "4.12.0"
|
||||||
sshj = "0.39.0"
|
sshj = "0.39.0"
|
||||||
sshd-core = "2.14.0"
|
sshd-core = "2.14.0"
|
||||||
jgit = "7.1.0.202411261347-r"
|
jgit = "7.2.0.202503040940-r"
|
||||||
commonmark = "0.24.0"
|
commonmark = "0.24.0"
|
||||||
jnafilechooser = "1.1.2"
|
jnafilechooser = "1.1.2"
|
||||||
xodus = "2.0.1"
|
xodus = "2.0.1"
|
||||||
@@ -39,6 +39,7 @@ mixpanel = "1.5.3"
|
|||||||
jSerialComm = "2.11.0"
|
jSerialComm = "2.11.0"
|
||||||
ini4j = "0.5.5-2"
|
ini4j = "0.5.5-2"
|
||||||
restart4j = "0.0.1"
|
restart4j = "0.0.1"
|
||||||
|
eddsa = "0.3.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
|
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
|
||||||
@@ -91,6 +92,7 @@ delight-rhino-sandbox = { module = "org.javadelight:delight-rhino-sandbox", vers
|
|||||||
colorpicker = { module = "org.drjekyll:colorpicker", version.ref = "colorpicker" }
|
colorpicker = { module = "org.drjekyll:colorpicker", version.ref = "colorpicker" }
|
||||||
mixpanel = { module = "com.mixpanel:mixpanel-java", version.ref = "mixpanel" }
|
mixpanel = { module = "com.mixpanel:mixpanel-java", version.ref = "mixpanel" }
|
||||||
jSerialComm = { module = "com.fazecast:jSerialComm", version.ref = "jSerialComm" }
|
jSerialComm = { module = "com.fazecast:jSerialComm", version.ref = "jSerialComm" }
|
||||||
|
eddsa = { module = "net.i2p.crypto:eddsa", version.ref = "eddsa" }
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package app.termora.keymgr
|
package app.termora.keymgr
|
||||||
|
|
||||||
import app.termora.*
|
import app.termora.*
|
||||||
import app.termora.AES.decodeBase64
|
|
||||||
import app.termora.actions.AnAction
|
import app.termora.actions.AnAction
|
||||||
import app.termora.actions.AnActionEvent
|
import app.termora.actions.AnActionEvent
|
||||||
import app.termora.native.FileChooser
|
import app.termora.native.FileChooser
|
||||||
@@ -13,7 +12,6 @@ import com.formdev.flatlaf.ui.FlatTextBorder
|
|||||||
import com.formdev.flatlaf.util.SystemInfo
|
import com.formdev.flatlaf.util.SystemInfo
|
||||||
import com.jgoodies.forms.builder.FormBuilder
|
import com.jgoodies.forms.builder.FormBuilder
|
||||||
import com.jgoodies.forms.layout.FormLayout
|
import com.jgoodies.forms.layout.FormLayout
|
||||||
import net.i2p.crypto.eddsa.EdDSAPublicKey
|
|
||||||
import org.apache.commons.codec.binary.Base64
|
import org.apache.commons.codec.binary.Base64
|
||||||
import org.apache.commons.io.IOUtils
|
import org.apache.commons.io.IOUtils
|
||||||
import org.apache.commons.io.file.PathUtils
|
import org.apache.commons.io.file.PathUtils
|
||||||
@@ -33,7 +31,6 @@ import java.io.File
|
|||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.security.KeyPair
|
import java.security.KeyPair
|
||||||
import java.security.spec.X509EncodedKeySpec
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.zip.ZipEntry
|
import java.util.zip.ZipEntry
|
||||||
import java.util.zip.ZipOutputStream
|
import java.util.zip.ZipOutputStream
|
||||||
@@ -313,15 +310,9 @@ class KeyManagerPanel : JPanel(BorderLayout()) {
|
|||||||
nameTextField.text = ohKeyPair.name
|
nameTextField.text = ohKeyPair.name
|
||||||
remarkTextField.text = ohKeyPair.remark
|
remarkTextField.text = ohKeyPair.remark
|
||||||
val baos = ByteArrayOutputStream()
|
val baos = ByteArrayOutputStream()
|
||||||
if (ohKeyPair.type == "RSA") {
|
val keyPair = OhKeyPairKeyPairProvider.generateKeyPair(ohKeyPair)
|
||||||
OpenSSHKeyPairResourceWriter.INSTANCE
|
OpenSSHKeyPairResourceWriter.INSTANCE
|
||||||
.writePublicKey(RSA.generatePublic(ohKeyPair.publicKey.decodeBase64()), null, baos)
|
.writePublicKey(keyPair.public, null, baos)
|
||||||
} else if (ohKeyPair.type == "ED25519") {
|
|
||||||
OpenSSHKeyPairResourceWriter.INSTANCE.writePublicKey(
|
|
||||||
EdDSAPublicKey(X509EncodedKeySpec(ohKeyPair.publicKey.decodeBase64())),
|
|
||||||
null, baos
|
|
||||||
)
|
|
||||||
}
|
|
||||||
publicKeyTextArea.text = baos.toString()
|
publicKeyTextArea.text = baos.toString()
|
||||||
savePublicKeyBtn.isEnabled = true
|
savePublicKeyBtn.isEnabled = true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ package app.termora.keymgr
|
|||||||
|
|
||||||
import app.termora.AES.decodeBase64
|
import app.termora.AES.decodeBase64
|
||||||
import app.termora.RSA
|
import app.termora.RSA
|
||||||
import net.i2p.crypto.eddsa.EdDSAPrivateKey
|
|
||||||
import net.i2p.crypto.eddsa.EdDSAPublicKey
|
|
||||||
import org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider
|
import org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider
|
||||||
import org.apache.sshd.common.session.SessionContext
|
import org.apache.sshd.common.session.SessionContext
|
||||||
|
import org.apache.sshd.common.util.security.eddsa.Ed25519PublicKeyDecoder
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import java.security.Key
|
import java.security.Key
|
||||||
import java.security.KeyPair
|
import java.security.KeyPair
|
||||||
@@ -25,7 +24,7 @@ class OhKeyPairKeyPairProvider(private val id: String) : AbstractResourceKeyPair
|
|||||||
val publicKey = cache.getOrPut(ohKeyPair.publicKey) {
|
val publicKey = cache.getOrPut(ohKeyPair.publicKey) {
|
||||||
when (ohKeyPair.type) {
|
when (ohKeyPair.type) {
|
||||||
"RSA" -> RSA.generatePublic(ohKeyPair.publicKey.decodeBase64())
|
"RSA" -> RSA.generatePublic(ohKeyPair.publicKey.decodeBase64())
|
||||||
"ED25519" -> EdDSAPublicKey(X509EncodedKeySpec(ohKeyPair.publicKey.decodeBase64()))
|
"ED25519" -> Ed25519PublicKeyDecoder.INSTANCE.generatePublicKey((X509EncodedKeySpec(ohKeyPair.publicKey.decodeBase64())))
|
||||||
else -> throw UnsupportedOperationException("${ohKeyPair.type} is not supported")
|
else -> throw UnsupportedOperationException("${ohKeyPair.type} is not supported")
|
||||||
}
|
}
|
||||||
} as PublicKey
|
} as PublicKey
|
||||||
@@ -33,7 +32,7 @@ class OhKeyPairKeyPairProvider(private val id: String) : AbstractResourceKeyPair
|
|||||||
val privateKey = cache.getOrPut(ohKeyPair.privateKey) {
|
val privateKey = cache.getOrPut(ohKeyPair.privateKey) {
|
||||||
when (ohKeyPair.type) {
|
when (ohKeyPair.type) {
|
||||||
"RSA" -> RSA.generatePrivate(ohKeyPair.privateKey.decodeBase64())
|
"RSA" -> RSA.generatePrivate(ohKeyPair.privateKey.decodeBase64())
|
||||||
"ED25519" -> EdDSAPrivateKey(PKCS8EncodedKeySpec(ohKeyPair.privateKey.decodeBase64()))
|
"ED25519" -> Ed25519PublicKeyDecoder.INSTANCE.generatePrivateKey(PKCS8EncodedKeySpec(ohKeyPair.privateKey.decodeBase64()))
|
||||||
else -> throw UnsupportedOperationException("${ohKeyPair.type} is not supported")
|
else -> throw UnsupportedOperationException("${ohKeyPair.type} is not supported")
|
||||||
}
|
}
|
||||||
} as PrivateKey
|
} as PrivateKey
|
||||||
|
|||||||
Reference in New Issue
Block a user