summaryrefslogtreecommitdiff
path: root/remote.go
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2021-09-05 17:04:40 -0700
committerGitHub <[email protected]>2021-09-05 17:04:40 -0700
commit70e5e419cf0cab31553b106267a0296f3cd672d9 (patch)
treeb8bed08c5cc6236e542f09c18d3823e34e161968 /remote.go
parentb983e1daebf528443e2a3954cd595fa3664ec93f (diff)
Add support for managed SSH transport #minor (#814)
This change drops the (hard) dependency on libssh2 and instead uses Go's implementation of SSH when libgit2 is not built with it.
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/remote.go b/remote.go
index 3a435d1..275d4d9 100644
--- a/remote.go
+++ b/remote.go
@@ -17,6 +17,8 @@ import (
"strings"
"sync"
"unsafe"
+
+ "golang.org/x/crypto/ssh"
)
// RemoteCreateOptionsFlag is Remote creation options flags
@@ -257,21 +259,25 @@ type Certificate struct {
Hostkey HostkeyCertificate
}
+// HostkeyKind is a bitmask of the available hashes in HostkeyCertificate.
type HostkeyKind uint
const (
HostkeyMD5 HostkeyKind = C.GIT_CERT_SSH_MD5
HostkeySHA1 HostkeyKind = C.GIT_CERT_SSH_SHA1
HostkeySHA256 HostkeyKind = C.GIT_CERT_SSH_SHA256
+ HostkeyRaw HostkeyKind = 1 << 3
)
// Server host key information. A bitmask containing the available fields.
-// Check for combinations of: HostkeyMD5, HostkeySHA1, HostkeySHA256.
+// Check for combinations of: HostkeyMD5, HostkeySHA1, HostkeySHA256, HostkeyRaw.
type HostkeyCertificate struct {
- Kind HostkeyKind
- HashMD5 [16]byte
- HashSHA1 [20]byte
- HashSHA256 [32]byte
+ Kind HostkeyKind
+ HashMD5 [16]byte
+ HashSHA1 [20]byte
+ HashSHA256 [32]byte
+ Hostkey []byte
+ SSHPublicKey ssh.PublicKey
}
type PushOptions struct {