mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-08 14:57:38 +02:00
lnwallet: populate resolution blob for incoming+outgoing HTLC resolutions
In this commit, we populate the resolution blobs for the incoming and outgoing HTLCs. We take care to populate the AuxSigDesc with the correct information, as we need to pass along the second-level aux signature and also sign desc along with it.
This commit is contained in:
51
macaroons/fuzz_test.go
Normal file
51
macaroons/fuzz_test.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package macaroons
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
|
||||
func FuzzUnmarshalMacaroon(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
mac := &macaroon.Macaroon{}
|
||||
_ = mac.UnmarshalBinary(data)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzAuthChecker(f *testing.F) {
|
||||
rootKeyStore := bakery.NewMemRootKeyStore()
|
||||
ctx := context.Background()
|
||||
|
||||
f.Fuzz(func(t *testing.T, location, entity, action, method string,
|
||||
rootKey, id []byte) {
|
||||
|
||||
macService, err := NewService(
|
||||
rootKeyStore, location, true, IPLockChecker,
|
||||
)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
requiredPermissions := []bakery.Op{{
|
||||
Entity: entity,
|
||||
Action: action,
|
||||
}}
|
||||
|
||||
mac, err := macaroon.New(rootKey, id, location, macaroon.V2)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
macBytes, err := mac.MarshalBinary()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_ = macService.CheckMacAuth(
|
||||
ctx, macBytes, requiredPermissions, method,
|
||||
)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user