Check for patched go crypto lib at runtime (#4671)
Panic if the used crypto library is not being used for compiling
This commit is contained in:
parent
a9600a4bd6
commit
940f6f100f
1 changed files with 8 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ import (
|
|||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/evcc-io/evcc/util/machine"
|
||||
"github.com/libp2p/zeroconf/v2"
|
||||
"golang.org/x/crypto/cryptobyte"
|
||||
)
|
||||
|
||||
var EEBUSDetails = communication.ManufacturerDetails{
|
||||
|
|
@ -92,6 +93,13 @@ func NewEEBus(other map[string]interface{}) (*EEBus, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Test if go is patched for accepting the buggy Elli certificate
|
||||
var res bool
|
||||
b := cryptobyte.String([]byte{0x01, 0x01, 0x01})
|
||||
if ok := b.ReadASN1Boolean(&res); !ok {
|
||||
panic("EEBUS needs a patched go crypto library. Run `make patch-asn1` before compiling.")
|
||||
}
|
||||
|
||||
srv := &server.Server{
|
||||
Log: log.TRACE,
|
||||
Addr: cc.Uri,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue