mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
protobuf: remove gogoproto
Removes gogo/protobuf from buildx and updates to a version of moby/buildkit where gogo is removed. This also changes how the proto files are generated. This is because newer versions of protobuf are more strict about name conflicts. If two files have the same name (even if they are relative paths) and are used in different protoc commands, they'll conflict in the registry. Since protobuf file generation doesn't work very well with `paths=source_relative`, this removes the `go:generate` expression and just relies on the dockerfile to perform the generation. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
2
vendor/golang.org/x/crypto/ssh/agent/client.go
generated
vendored
2
vendor/golang.org/x/crypto/ssh/agent/client.go
generated
vendored
@ -10,7 +10,7 @@
|
||||
// References:
|
||||
//
|
||||
// [PROTOCOL.agent]: https://tools.ietf.org/html/draft-miller-ssh-agent-00
|
||||
package agent // import "golang.org/x/crypto/ssh/agent"
|
||||
package agent
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
9
vendor/golang.org/x/crypto/ssh/agent/keyring.go
generated
vendored
9
vendor/golang.org/x/crypto/ssh/agent/keyring.go
generated
vendored
@ -175,6 +175,15 @@ func (r *keyring) Add(key AddedKey) error {
|
||||
p.expire = &t
|
||||
}
|
||||
|
||||
// If we already have a Signer with the same public key, replace it with the
|
||||
// new one.
|
||||
for idx, k := range r.keys {
|
||||
if bytes.Equal(k.signer.PublicKey().Marshal(), p.signer.PublicKey().Marshal()) {
|
||||
r.keys[idx] = p
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
r.keys = append(r.keys, p)
|
||||
|
||||
return nil
|
||||
|
4
vendor/golang.org/x/crypto/ssh/client_auth.go
generated
vendored
4
vendor/golang.org/x/crypto/ssh/client_auth.go
generated
vendored
@ -71,6 +71,10 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error {
|
||||
for auth := AuthMethod(new(noneAuth)); auth != nil; {
|
||||
ok, methods, err := auth.auth(sessionID, config.User, c.transport, config.Rand, extensions)
|
||||
if err != nil {
|
||||
// On disconnect, return error immediately
|
||||
if _, ok := err.(*disconnectMsg); ok {
|
||||
return err
|
||||
}
|
||||
// We return the error later if there is no other method left to
|
||||
// try.
|
||||
ok = authFailure
|
||||
|
2
vendor/golang.org/x/crypto/ssh/doc.go
generated
vendored
2
vendor/golang.org/x/crypto/ssh/doc.go
generated
vendored
@ -20,4 +20,4 @@ References:
|
||||
This package does not fall under the stability promise of the Go language itself,
|
||||
so its API may be changed when pressing needs arise.
|
||||
*/
|
||||
package ssh // import "golang.org/x/crypto/ssh"
|
||||
package ssh
|
||||
|
52
vendor/golang.org/x/crypto/ssh/keys.go
generated
vendored
52
vendor/golang.org/x/crypto/ssh/keys.go
generated
vendored
@ -488,7 +488,49 @@ func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error {
|
||||
h := hash.New()
|
||||
h.Write(data)
|
||||
digest := h.Sum(nil)
|
||||
return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, sig.Blob)
|
||||
|
||||
// Signatures in PKCS1v15 must match the key's modulus in
|
||||
// length. However with SSH, some signers provide RSA
|
||||
// signatures which are missing the MSB 0's of the bignum
|
||||
// represented. With ssh-rsa signatures, this is encouraged by
|
||||
// the spec (even though e.g. OpenSSH will give the full
|
||||
// length unconditionally). With rsa-sha2-* signatures, the
|
||||
// verifier is allowed to support these, even though they are
|
||||
// out of spec. See RFC 4253 Section 6.6 for ssh-rsa and RFC
|
||||
// 8332 Section 3 for rsa-sha2-* details.
|
||||
//
|
||||
// In practice:
|
||||
// * OpenSSH always allows "short" signatures:
|
||||
// https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ssh-rsa.c#L526
|
||||
// but always generates padded signatures:
|
||||
// https://github.com/openssh/openssh-portable/blob/V_9_8_P1/ssh-rsa.c#L439
|
||||
//
|
||||
// * PuTTY versions 0.81 and earlier will generate short
|
||||
// signatures for all RSA signature variants. Note that
|
||||
// PuTTY is embedded in other software, such as WinSCP and
|
||||
// FileZilla. At the time of writing, a patch has been
|
||||
// applied to PuTTY to generate padded signatures for
|
||||
// rsa-sha2-*, but not yet released:
|
||||
// https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a5bcf3d384e1bf15a51a6923c3724cbbee022d8e
|
||||
//
|
||||
// * SSH.NET versions 2024.0.0 and earlier will generate short
|
||||
// signatures for all RSA signature variants, fixed in 2024.1.0:
|
||||
// https://github.com/sshnet/SSH.NET/releases/tag/2024.1.0
|
||||
//
|
||||
// As a result, we pad these up to the key size by inserting
|
||||
// leading 0's.
|
||||
//
|
||||
// Note that support for short signatures with rsa-sha2-* may
|
||||
// be removed in the future due to such signatures not being
|
||||
// allowed by the spec.
|
||||
blob := sig.Blob
|
||||
keySize := (*rsa.PublicKey)(r).Size()
|
||||
if len(blob) < keySize {
|
||||
padded := make([]byte, keySize)
|
||||
copy(padded[keySize-len(blob):], blob)
|
||||
blob = padded
|
||||
}
|
||||
return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), hash, digest, blob)
|
||||
}
|
||||
|
||||
func (r *rsaPublicKey) CryptoPublicKey() crypto.PublicKey {
|
||||
@ -904,6 +946,10 @@ func (k *skECDSAPublicKey) Verify(data []byte, sig *Signature) error {
|
||||
return errors.New("ssh: signature did not verify")
|
||||
}
|
||||
|
||||
func (k *skECDSAPublicKey) CryptoPublicKey() crypto.PublicKey {
|
||||
return &k.PublicKey
|
||||
}
|
||||
|
||||
type skEd25519PublicKey struct {
|
||||
// application is a URL-like string, typically "ssh:" for SSH.
|
||||
// see openssh/PROTOCOL.u2f for details.
|
||||
@ -1000,6 +1046,10 @@ func (k *skEd25519PublicKey) Verify(data []byte, sig *Signature) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (k *skEd25519PublicKey) CryptoPublicKey() crypto.PublicKey {
|
||||
return k.PublicKey
|
||||
}
|
||||
|
||||
// NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey,
|
||||
// *ecdsa.PrivateKey or any other crypto.Signer and returns a
|
||||
// corresponding Signer instance. ECDSA keys must use P-256, P-384 or
|
||||
|
30
vendor/golang.org/x/crypto/ssh/server.go
generated
vendored
30
vendor/golang.org/x/crypto/ssh/server.go
generated
vendored
@ -462,6 +462,24 @@ func (p *PartialSuccessError) Error() string {
|
||||
// It is returned in ServerAuthError.Errors from NewServerConn.
|
||||
var ErrNoAuth = errors.New("ssh: no auth passed yet")
|
||||
|
||||
// BannerError is an error that can be returned by authentication handlers in
|
||||
// ServerConfig to send a banner message to the client.
|
||||
type BannerError struct {
|
||||
Err error
|
||||
Message string
|
||||
}
|
||||
|
||||
func (b *BannerError) Unwrap() error {
|
||||
return b.Err
|
||||
}
|
||||
|
||||
func (b *BannerError) Error() string {
|
||||
if b.Err == nil {
|
||||
return b.Message
|
||||
}
|
||||
return b.Err.Error()
|
||||
}
|
||||
|
||||
func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) {
|
||||
sessionID := s.transport.getSessionID()
|
||||
var cache pubKeyCache
|
||||
@ -734,6 +752,18 @@ userAuthLoop:
|
||||
config.AuthLogCallback(s, userAuthReq.Method, authErr)
|
||||
}
|
||||
|
||||
var bannerErr *BannerError
|
||||
if errors.As(authErr, &bannerErr) {
|
||||
if bannerErr.Message != "" {
|
||||
bannerMsg := &userAuthBannerMsg{
|
||||
Message: bannerErr.Message,
|
||||
}
|
||||
if err := s.transport.writePacket(Marshal(bannerMsg)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if authErr == nil {
|
||||
break userAuthLoop
|
||||
}
|
||||
|
Reference in New Issue
Block a user