Skip to content

Commit 2c68e3b

Browse files
committed
multi: fix rebase issues, update release notes
1 parent 62e4ce2 commit 2c68e3b

File tree

9 files changed

+76
-196
lines changed

9 files changed

+76
-196
lines changed

docs/release-notes/release-notes-0.14.3.md

+29
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@
1515
A bug in the remote signer health check was also fixed that lead to too many
1616
open connections.
1717

18+
* [Added signature length
19+
validation](https://github.com/lightningnetwork/lnd/pull/6314) when calling
20+
`NewSigFromRawSignature`.
21+
22+
* [Fixed deadlock in invoice
23+
registry](https://github.com/lightningnetwork/lnd/pull/6332).
24+
25+
* [Fixed an issue that would cause wallet UTXO state to be incorrect if a 3rd
26+
party sweeps our anchor
27+
output](https://github.com/lightningnetwork/lnd/pull/6274).
28+
29+
## Code Health
30+
31+
### Code cleanup, refactor, typo fixes
32+
33+
* [A refactor of
34+
`SelectHopHints`](https://github.com/lightningnetwork/lnd/pull/6182) allows
35+
code external to lnd to call the function, where previously it would require
36+
access to lnd's internals.
37+
38+
## Misc
39+
40+
* [Make etcd leader election session
41+
TTL](https://github.com/lightningnetwork/lnd/pull/6342) configurable.
42+
1843
# Contributors (Alphabetical Order)
1944

45+
* Andras Banki-Horvath
46+
* Carla Kirk-Cohen
47+
* Olaoluwa Osuntokun
2048
* Oliver Gugger
49+
* Yong Yu

docs/release-notes/release-notes-0.15.0.md

-189
This file was deleted.

lntest/itest/lnd_onchain_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import (
77
"strings"
88
"time"
99

10+
"github.com/btcsuite/btcd/chaincfg/chainhash"
1011
"github.com/btcsuite/btcd/txscript"
12+
"github.com/btcsuite/btcd/wire"
1113
"github.com/btcsuite/btcutil"
1214
"github.com/lightningnetwork/lnd/lnrpc"
1315
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"

lntest/itest/lnd_signer_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import (
66
"fmt"
77

88
"github.com/btcsuite/btcd/btcec"
9+
"github.com/btcsuite/btcd/txscript"
10+
"github.com/btcsuite/btcd/wire"
11+
"github.com/btcsuite/btcutil"
912
"github.com/lightningnetwork/lnd/keychain"
1013
"github.com/lightningnetwork/lnd/lnrpc"
1114
"github.com/lightningnetwork/lnd/lnrpc/signrpc"
@@ -219,7 +222,7 @@ func runSignOutputRaw(t *harnessTest, net *lntest.NetworkHarness,
219222
require.NoError(t.t, err)
220223
require.Equal(t.t, int32(0), keyDesc.KeyLoc.KeyIndex)
221224

222-
targetPubKey, err := btcec.ParsePubKey(keyDesc.RawKeyBytes)
225+
targetPubKey, err := btcec.ParsePubKey(keyDesc.RawKeyBytes, btcec.S256())
223226
require.NoError(t.t, err)
224227

225228
// First, try with a key descriptor that only sets the public key.
@@ -251,7 +254,7 @@ func runSignOutputRaw(t *harnessTest, net *lntest.NetworkHarness,
251254
require.NoError(t.t, err)
252255
require.Equal(t.t, int32(1), keyDesc.KeyLoc.KeyIndex)
253256

254-
targetPubKey, err = btcec.ParsePubKey(keyDesc.RawKeyBytes)
257+
targetPubKey, err = btcec.ParsePubKey(keyDesc.RawKeyBytes, btcec.S256())
255258
require.NoError(t.t, err)
256259

257260
// First, try with a key descriptor that only sets the public key.

lntest/itest/utils.go

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"time"
99

10+
"github.com/btcsuite/btcd/chaincfg/chainhash"
1011
"github.com/btcsuite/btcd/rpcclient"
1112
"github.com/btcsuite/btcd/txscript"
1213
"github.com/btcsuite/btcd/wire"

lnwallet/rpcwallet/rpcwallet.go

+2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ import (
1010
"time"
1111

1212
"github.com/btcsuite/btcd/btcec"
13+
"github.com/btcsuite/btcd/chaincfg"
1314
"github.com/btcsuite/btcd/txscript"
1415
"github.com/btcsuite/btcd/wire"
1516
"github.com/btcsuite/btcutil"
1617
"github.com/btcsuite/btcutil/hdkeychain"
1718
"github.com/btcsuite/btcutil/psbt"
19+
"github.com/btcsuite/btcwallet/waddrmgr"
1820
basewallet "github.com/btcsuite/btcwallet/wallet"
1921
"github.com/lightningnetwork/lnd/input"
2022
"github.com/lightningnetwork/lnd/keychain"

lnwire/ping_test.go

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package lnwire
2+
3+
import (
4+
"bytes"
5+
"math"
6+
"testing"
7+
)
8+
9+
// TestMaxPongBytes tests that we'll fail to decode a Ping message that wants
10+
// more pong bytes that we can actually encode while adhering to the max
11+
// message limit.
12+
func TestMaxPongBytes(t *testing.T) {
13+
t.Parallel()
14+
15+
msg := Ping{
16+
NumPongBytes: math.MaxUint16,
17+
}
18+
19+
var b bytes.Buffer
20+
if _, err := WriteMessage(&b, &msg, 0); err != nil {
21+
t.Fatalf("unable to write msg: %v", err)
22+
}
23+
24+
_, err := ReadMessage(&b, 0)
25+
if err != ErrMaxPongBytesExceeded {
26+
t.Fatalf("incorrect error: %v, expected "+
27+
"ErrMaxPongBytesExceeded", err)
28+
}
29+
}

lnwire/signature.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ var (
1919
errBadLength = errors.New("malformed signature: bad length")
2020
errBadRLength = errors.New("malformed signature: bogus R length")
2121
errBadSLength = errors.New("malformed signature: bogus S length")
22-
errRTooLong = errors.New("R is over 32 bytes long without padding")
23-
errSTooLong = errors.New("S is over 32 bytes long without padding")
22+
errRTooLong = errors.New("element R is over 32 bytes long without " +
23+
"padding")
24+
errSTooLong = errors.New("element S is over 32 bytes long without " +
25+
"padding")
2426
)
2527

2628
// NewSigFromRawSignature returns a Sig from a Bitcoin raw signature encoded in
@@ -29,7 +31,7 @@ func NewSigFromRawSignature(sig []byte) (Sig, error) {
2931
var b Sig
3032

3133
// Check the total length is above the minimal.
32-
if len(sig) < ecdsa.MinSigLen {
34+
if len(sig) < 8 {
3335
return b, errSigTooShort
3436
}
3537

@@ -45,7 +47,7 @@ func NewSigFromRawSignature(sig []byte) (Sig, error) {
4547

4648
// siglen should be less than the entire message and greater than
4749
// the minimal message size.
48-
if sigLen+2 > len(sig) || sigLen+2 < ecdsa.MinSigLen {
50+
if sigLen+2 > len(sig) || sigLen+2 < 8 {
4951
return b, errBadLength
5052
}
5153

lnwire/signature_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"testing"
77

88
"github.com/btcsuite/btcd/btcec"
9+
"github.com/stretchr/testify/require"
910
)
1011

1112
func TestSignatureSerializeDeserialize(t *testing.T) {
@@ -83,7 +84,7 @@ func TestSignatureSerializeDeserialize(t *testing.T) {
8384
sig.R.Mul(btcec.S256().N, big.NewInt(2))
8485
sig.S.Set(big.NewInt(127))
8586
err = signatureSerializeDeserialize(sig)
86-
if err.Error() != "R is over 32 bytes long without padding" {
87+
if err.Error() != "element R is over 32 bytes long without padding" {
8788
t.Fatalf("R = 2N, S = 128, R should be over 32 bytes: %s",
8889
err.Error())
8990
}

0 commit comments

Comments
 (0)