fuzz/brontide: fix fuzz_utils.go NewBrontideMachine callsites
This commit is contained in:
parent
98da919bf1
commit
6ba35238ef
@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/btcsuite/btcd/btcec"
|
"github.com/btcsuite/btcd/btcec"
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/lightningnetwork/lnd/brontide"
|
"github.com/lightningnetwork/lnd/brontide"
|
||||||
|
"github.com/lightningnetwork/lnd/keychain"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -114,8 +115,11 @@ func getBrontideMachines() (*brontide.Machine, *brontide.Machine) {
|
|||||||
respPriv, _ := btcec.NewPrivateKey(btcec.S256())
|
respPriv, _ := btcec.NewPrivateKey(btcec.S256())
|
||||||
respPub := (*btcec.PublicKey)(&respPriv.PublicKey)
|
respPub := (*btcec.PublicKey)(&respPriv.PublicKey)
|
||||||
|
|
||||||
initiator := brontide.NewBrontideMachine(true, initPriv, respPub)
|
initPrivECDH := &keychain.PrivKeyECDH{PrivKey: initPriv}
|
||||||
responder := brontide.NewBrontideMachine(false, respPriv, nil)
|
respPrivECDH := &keychain.PrivKeyECDH{PrivKey: respPriv}
|
||||||
|
|
||||||
|
initiator := brontide.NewBrontideMachine(true, initPrivECDH, respPub)
|
||||||
|
responder := brontide.NewBrontideMachine(false, respPrivECDH, nil)
|
||||||
|
|
||||||
return initiator, responder
|
return initiator, responder
|
||||||
}
|
}
|
||||||
@ -126,11 +130,14 @@ func getStaticBrontideMachines() (*brontide.Machine, *brontide.Machine) {
|
|||||||
initPriv, _ := btcec.PrivKeyFromBytes(btcec.S256(), initBytes)
|
initPriv, _ := btcec.PrivKeyFromBytes(btcec.S256(), initBytes)
|
||||||
respPriv, respPub := btcec.PrivKeyFromBytes(btcec.S256(), respBytes)
|
respPriv, respPub := btcec.PrivKeyFromBytes(btcec.S256(), respBytes)
|
||||||
|
|
||||||
|
initPrivECDH := &keychain.PrivKeyECDH{PrivKey: initPriv}
|
||||||
|
respPrivECDH := &keychain.PrivKeyECDH{PrivKey: respPriv}
|
||||||
|
|
||||||
initiator := brontide.NewBrontideMachine(
|
initiator := brontide.NewBrontideMachine(
|
||||||
true, initPriv, respPub, initEphemeral,
|
true, initPrivECDH, respPub, initEphemeral,
|
||||||
)
|
)
|
||||||
responder := brontide.NewBrontideMachine(
|
responder := brontide.NewBrontideMachine(
|
||||||
false, respPriv, nil, respEphemeral,
|
false, respPrivECDH, nil, respEphemeral,
|
||||||
)
|
)
|
||||||
|
|
||||||
return initiator, responder
|
return initiator, responder
|
||||||
|
Loading…
Reference in New Issue
Block a user