Skip to content

Commit 22b739d

Browse files
committed
Comments
1 parent 77e4465 commit 22b739d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

keystore/kms/asn1.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"errors"
88
"fmt"
99
"math/big"
10+
"slices"
1011

1112
"github.com/ethereum/go-ethereum/crypto"
1213
"github.com/ethereum/go-ethereum/crypto/secp256k1"
@@ -110,7 +111,7 @@ func SEC1ToASN1PublicKey(sec1PubKey []byte) ([]byte, error) {
110111
// Create the public key as a BitString
111112
// KMS includes the 0x04 prefix in the BitString (65 bytes: 0x04 || X || Y)
112113
// This matches the SEC1 uncompressed format
113-
pubKeyBytes := append([]byte{0x04}, append(x, y...)...)
114+
pubKeyBytes := slices.Concat([]byte{0x04}, x, y)
114115

115116
// OID for ecPublicKey: 1.2.840.10045.2.1
116117
ecPublicKeyOID := asn1.ObjectIdentifier{1, 2, 840, 10045, 2, 1}

0 commit comments

Comments
 (0)