Commit e8c47138 authored by Steven Allen's avatar Steven Allen

chore(dep): update libp2p & protobuf

and regenerate protobufs
parent 67f9e24f
...@@ -4,13 +4,12 @@ os: ...@@ -4,13 +4,12 @@ os:
language: go language: go
go: go:
- 1.11.x - 1.13.x
env: env:
global: global:
- GOTFLAGS="-race" - GOTFLAGS="-race"
matrix: matrix:
- BUILD_DEPTYPE=gx
- BUILD_DEPTYPE=gomod - BUILD_DEPTYPE=gomod
...@@ -24,7 +23,6 @@ script: ...@@ -24,7 +23,6 @@ script:
cache: cache:
directories: directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod - $GOPATH/pkg/mod
- $HOME/.cache/go-build - $HOME/.cache/go-build
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
pb "github.com/ipfs/go-ipns/pb" pb "github.com/ipfs/go-ipns/pb"
ipns "github.com/ipfs/go-ipns" ipns "github.com/ipfs/go-ipns"
crypto "github.com/libp2p/go-libp2p-crypto" crypto "github.com/libp2p/go-libp2p-core/crypto"
) )
// CreateEntryWithEmbed shows how you can create an IPNS entry // CreateEntryWithEmbed shows how you can create an IPNS entry
......
...@@ -4,7 +4,7 @@ import ( ...@@ -4,7 +4,7 @@ import (
"testing" "testing"
"github.com/ipfs/go-ipns/examples" "github.com/ipfs/go-ipns/examples"
crypto "github.com/libp2p/go-libp2p-crypto" crypto "github.com/libp2p/go-libp2p-core/crypto"
) )
var testPath = "/ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5" var testPath = "/ipfs/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5"
...@@ -43,9 +43,7 @@ func TestEmbeddedEntryCreation(t *testing.T) { ...@@ -43,9 +43,7 @@ func TestEmbeddedEntryCreation(t *testing.T) {
} }
func generateRSAKey() (crypto.PrivKey, error) { func generateRSAKey() (crypto.PrivKey, error) {
// DO NOT USE 1024 BITS IN PRODUCTION k, err := examples.GenerateRSAKeyPair(2048)
// THIS IS ONLY FOR TESTING PURPOSES
k, err := examples.GenerateRSAKeyPair(1024)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
package examples package examples
import ( import (
crypto "github.com/libp2p/go-libp2p-crypto" crypto "github.com/libp2p/go-libp2p-core/crypto"
) )
// GenerateRSAKeyPair is used to generate an RSA key pair // GenerateRSAKeyPair is used to generate an RSA key pair
......
This diff is collapsed.
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
pb "github.com/ipfs/go-ipns/pb" pb "github.com/ipfs/go-ipns/pb"
u "github.com/ipfs/go-ipfs-util" u "github.com/ipfs/go-ipfs-util"
ic "github.com/libp2p/go-libp2p-crypto" ic "github.com/libp2p/go-libp2p-core/crypto"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-core/peer"
) )
// Create creates a new IPNS entry and signs it with the given private key. // Create creates a new IPNS entry and signs it with the given private key.
......
...@@ -6,14 +6,14 @@ import ( ...@@ -6,14 +6,14 @@ import (
"time" "time"
u "github.com/ipfs/go-ipfs-util" u "github.com/ipfs/go-ipfs-util"
ci "github.com/libp2p/go-libp2p-crypto" ci "github.com/libp2p/go-libp2p-core/crypto"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-core/peer"
) )
func TestEmbedPublicKey(t *testing.T) { func TestEmbedPublicKey(t *testing.T) {
sr := u.NewTimeSeededRand() sr := u.NewTimeSeededRand()
priv, pub, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, sr) priv, pub, err := ci.GenerateKeyPairWithReader(ci.RSA, 2048, sr)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
{
"author": "stebalien",
"bugs": {
"url": "https://github.com/ipfs/go-ipns/issues"
},
"gx": {
"dvcsimport": "github.com/ipfs/go-ipns"
},
"gxDependencies": [
{
"author": "whyrusleeping",
"hash": "QmNohiVssaPw3KVLZik59DBVGTSm2dGvYT9eoXt5DQ36Yz",
"name": "go-ipfs-util",
"version": "1.2.9"
},
{
"hash": "QmbkT7eMTyXfpeyB3ZMxxcxg7XH8t6uXp49jqzz4HB7BGF",
"name": "go-log",
"version": "1.5.9"
},
{
"author": "whyrusleeping",
"hash": "QmTW4SdgBWq9GjsBsHeUx8WuGxzhgzAf88UMH2w62PC8yK",
"name": "go-libp2p-crypto",
"version": "2.0.7"
},
{
"author": "whyrusleeping",
"hash": "QmYVXrKrKHDC9FobgmcmshCDyWwdrfwfanNQN4oxJ9Fk3h",
"name": "go-libp2p-peer",
"version": "3.1.2"
},
{
"author": "whyrusleeping",
"hash": "QmaCTz9RkrU13bm9kMB54f7atgqM4qkjDZpRwRoJiWXEqs",
"name": "go-libp2p-peerstore",
"version": "2.0.19"
},
{
"hash": "QmbeHtaBy9nZsW4cHRcvgVY4CnDhXudE2Dr6qDxS7yg9rX",
"name": "go-libp2p-record",
"version": "4.1.15"
},
{
"author": "whyrusleeping",
"hash": "QmddjPSGZb3ieihSseFeCfVRpZzcqczPNsD2DvarSwnjJB",
"name": "gogo-protobuf",
"version": "1.2.1"
}
],
"gxVersion": "0.12.1",
"language": "go",
"license": "MIT",
"name": "go-ipns",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.1.23"
}
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
io "io" io "io"
math "math" math "math"
math_bits "math/bits"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
...@@ -20,7 +21,7 @@ var _ = math.Inf ...@@ -20,7 +21,7 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type IpnsEntry_ValidityType int32 type IpnsEntry_ValidityType int32
...@@ -91,7 +92,7 @@ func (m *IpnsEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { ...@@ -91,7 +92,7 @@ func (m *IpnsEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IpnsEntry.Marshal(b, m, deterministic) return xxx_messageInfo_IpnsEntry.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalTo(b) n, err := m.MarshalToSizedBuffer(b)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -187,7 +188,7 @@ var fileDescriptor_4d5b16fb32bfe8ea = []byte{ ...@@ -187,7 +188,7 @@ var fileDescriptor_4d5b16fb32bfe8ea = []byte{
func (m *IpnsEntry) Marshal() (dAtA []byte, err error) { func (m *IpnsEntry) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -195,67 +196,79 @@ func (m *IpnsEntry) Marshal() (dAtA []byte, err error) { ...@@ -195,67 +196,79 @@ func (m *IpnsEntry) Marshal() (dAtA []byte, err error) {
} }
func (m *IpnsEntry) MarshalTo(dAtA []byte) (int, error) { func (m *IpnsEntry) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *IpnsEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.Value == nil { if m.XXX_unrecognized != nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value") i -= len(m.XXX_unrecognized)
} else { copy(dAtA[i:], m.XXX_unrecognized)
dAtA[i] = 0xa
i++
i = encodeVarintIpns(dAtA, i, uint64(len(m.Value)))
i += copy(dAtA[i:], m.Value)
}
if m.Signature == nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("signature")
} else {
dAtA[i] = 0x12
i++
i = encodeVarintIpns(dAtA, i, uint64(len(m.Signature)))
i += copy(dAtA[i:], m.Signature)
} }
if m.ValidityType != nil { if m.PubKey != nil {
dAtA[i] = 0x18 i -= len(m.PubKey)
i++ copy(dAtA[i:], m.PubKey)
i = encodeVarintIpns(dAtA, i, uint64(*m.ValidityType)) i = encodeVarintIpns(dAtA, i, uint64(len(m.PubKey)))
i--
dAtA[i] = 0x3a
} }
if m.Validity != nil { if m.Ttl != nil {
dAtA[i] = 0x22 i = encodeVarintIpns(dAtA, i, uint64(*m.Ttl))
i++ i--
i = encodeVarintIpns(dAtA, i, uint64(len(m.Validity))) dAtA[i] = 0x30
i += copy(dAtA[i:], m.Validity)
} }
if m.Sequence != nil { if m.Sequence != nil {
dAtA[i] = 0x28
i++
i = encodeVarintIpns(dAtA, i, uint64(*m.Sequence)) i = encodeVarintIpns(dAtA, i, uint64(*m.Sequence))
i--
dAtA[i] = 0x28
} }
if m.Ttl != nil { if m.Validity != nil {
dAtA[i] = 0x30 i -= len(m.Validity)
i++ copy(dAtA[i:], m.Validity)
i = encodeVarintIpns(dAtA, i, uint64(*m.Ttl)) i = encodeVarintIpns(dAtA, i, uint64(len(m.Validity)))
i--
dAtA[i] = 0x22
} }
if m.PubKey != nil { if m.ValidityType != nil {
dAtA[i] = 0x3a i = encodeVarintIpns(dAtA, i, uint64(*m.ValidityType))
i++ i--
i = encodeVarintIpns(dAtA, i, uint64(len(m.PubKey))) dAtA[i] = 0x18
i += copy(dAtA[i:], m.PubKey)
} }
if m.XXX_unrecognized != nil { if m.Signature == nil {
i += copy(dAtA[i:], m.XXX_unrecognized) return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("signature")
} else {
i -= len(m.Signature)
copy(dAtA[i:], m.Signature)
i = encodeVarintIpns(dAtA, i, uint64(len(m.Signature)))
i--
dAtA[i] = 0x12
} }
return i, nil if m.Value == nil {
return 0, github_com_gogo_protobuf_proto.NewRequiredNotSetError("value")
} else {
i -= len(m.Value)
copy(dAtA[i:], m.Value)
i = encodeVarintIpns(dAtA, i, uint64(len(m.Value)))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
} }
func encodeVarintIpns(dAtA []byte, offset int, v uint64) int { func encodeVarintIpns(dAtA []byte, offset int, v uint64) int {
offset -= sovIpns(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *IpnsEntry) Size() (n int) { func (m *IpnsEntry) Size() (n int) {
if m == nil { if m == nil {
...@@ -295,14 +308,7 @@ func (m *IpnsEntry) Size() (n int) { ...@@ -295,14 +308,7 @@ func (m *IpnsEntry) Size() (n int) {
} }
func sovIpns(x uint64) (n int) { func sovIpns(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozIpns(x uint64) (n int) { func sozIpns(x uint64) (n int) {
return sovIpns(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovIpns(uint64((x << 1) ^ uint64((int64(x) >> 63))))
...@@ -569,6 +575,7 @@ func (m *IpnsEntry) Unmarshal(dAtA []byte) error { ...@@ -569,6 +575,7 @@ func (m *IpnsEntry) Unmarshal(dAtA []byte) error {
func skipIpns(dAtA []byte) (n int, err error) { func skipIpns(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
...@@ -600,10 +607,8 @@ func skipIpns(dAtA []byte) (n int, err error) { ...@@ -600,10 +607,8 @@ func skipIpns(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
...@@ -627,52 +632,27 @@ func skipIpns(dAtA []byte) (n int, err error) { ...@@ -627,52 +632,27 @@ func skipIpns(dAtA []byte) (n int, err error) {
if iNdEx < 0 { if iNdEx < 0 {
return 0, ErrInvalidLengthIpns return 0, ErrInvalidLengthIpns
} }
return iNdEx, nil
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowIpns
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipIpns(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
if iNdEx < 0 {
return 0, ErrInvalidLengthIpns
}
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupIpns
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthIpns = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthIpns = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowIpns = fmt.Errorf("proto: integer overflow") ErrIntOverflowIpns = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupIpns = fmt.Errorf("proto: unexpected end of group")
) )
...@@ -8,9 +8,9 @@ import ( ...@@ -8,9 +8,9 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
logging "github.com/ipfs/go-log" logging "github.com/ipfs/go-log"
ic "github.com/libp2p/go-libp2p-crypto" ic "github.com/libp2p/go-libp2p-core/crypto"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-core/peer"
pstore "github.com/libp2p/go-libp2p-peerstore" pstore "github.com/libp2p/go-libp2p-core/peerstore"
record "github.com/libp2p/go-libp2p-record" record "github.com/libp2p/go-libp2p-record"
) )
......
...@@ -10,7 +10,7 @@ import ( ...@@ -10,7 +10,7 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
u "github.com/ipfs/go-ipfs-util" u "github.com/ipfs/go-ipfs-util"
ci "github.com/libp2p/go-libp2p-crypto" ci "github.com/libp2p/go-libp2p-core/crypto"
) )
func shuffle(a []*pb.IpnsEntry) { func shuffle(a []*pb.IpnsEntry) {
...@@ -51,7 +51,7 @@ func TestOrdering(t *testing.T) { ...@@ -51,7 +51,7 @@ func TestOrdering(t *testing.T) {
// generate a key for signing the records // generate a key for signing the records
r := u.NewSeededRand(15) // generate deterministic keypair r := u.NewSeededRand(15) // generate deterministic keypair
priv, _, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, r) priv, _, err := ci.GenerateKeyPairWithReader(ci.RSA, 2048, r)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
...@@ -11,9 +11,9 @@ import ( ...@@ -11,9 +11,9 @@ import (
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
u "github.com/ipfs/go-ipfs-util" u "github.com/ipfs/go-ipfs-util"
ci "github.com/libp2p/go-libp2p-crypto" ci "github.com/libp2p/go-libp2p-core/crypto"
peer "github.com/libp2p/go-libp2p-peer" peer "github.com/libp2p/go-libp2p-core/peer"
pstore "github.com/libp2p/go-libp2p-peerstore" pstore "github.com/libp2p/go-libp2p-core/peerstore"
pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem"
) )
...@@ -162,7 +162,7 @@ func TestPeerIDPubKeyValidate(t *testing.T) { ...@@ -162,7 +162,7 @@ func TestPeerIDPubKeyValidate(t *testing.T) {
func genKeys(t *testing.T) (ci.PrivKey, peer.ID, string) { func genKeys(t *testing.T) (ci.PrivKey, peer.ID, string) {
sr := u.NewTimeSeededRand() sr := u.NewTimeSeededRand()
priv, _, err := ci.GenerateKeyPairWithReader(ci.RSA, 1024, sr) priv, _, err := ci.GenerateKeyPairWithReader(ci.RSA, 2048, sr)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment