7e290869e7
Includes69ecbb4d6d
(forward-port of8b5121be2f
), which fixes CVE-2020-7919: - Panic in crypto/x509 certificate parsing and golang.org/x/crypto/cryptobyte On 32-bit architectures, a malformed input to crypto/x509 or the ASN.1 parsing functions of golang.org/x/crypto/cryptobyte can lead to a panic. The malformed certificate can be delivered via a crypto/tls connection to a client, or to a server that accepts client certificates. net/http clients can be made to crash by an HTTPS server, while net/http servers that accept client certificates will recover the panic and are unaffected. Thanks to Project Wycheproof for providing the test cases that led to the discovery of this issue. The issue is CVE-2020-7919 and Go issue golang.org/issue/36837. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
28 lines
566 B
Go
28 lines
566 B
Go
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build go1.12
|
|
|
|
package acme
|
|
|
|
import "runtime/debug"
|
|
|
|
func init() {
|
|
// Set packageVersion if the binary was built in modules mode and x/crypto
|
|
// was not replaced with a different module.
|
|
info, ok := debug.ReadBuildInfo()
|
|
if !ok {
|
|
return
|
|
}
|
|
for _, m := range info.Deps {
|
|
if m.Path != "golang.org/x/crypto" {
|
|
continue
|
|
}
|
|
if m.Replace == nil {
|
|
packageVersion = m.Version
|
|
}
|
|
break
|
|
}
|
|
}
|