Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump scionproto and rains dependencies #246

Merged
merged 15 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _examples/hellodrkey/hellodrkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"net"
"time"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/daemon"
"github.com/scionproto/scion/go/lib/drkey"
"github.com/scionproto/scion/go/lib/drkey/fetcher"
"github.com/scionproto/scion/go/lib/scrypto/cppki"
cppb "github.com/scionproto/scion/go/pkg/proto/control_plane"
dkpb "github.com/scionproto/scion/go/pkg/proto/drkey"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/daemon"
"github.com/scionproto/scion/pkg/drkey"
"github.com/scionproto/scion/pkg/drkey/fetcher"
"github.com/scionproto/scion/pkg/scrypto/cppki"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/timestamppb"
)
Expand Down
2 changes: 1 addition & 1 deletion bwtester/bwtestserver/bwtestserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func (c connectedPacketConn) RemoteAddr() net.Addr {

// initializedReplySelector creates a pan.DefaultReplySelector, initialized with path for dst.
func initializedReplySelector(remote pan.UDPAddr, path *pan.Path) pan.ReplySelector {
if path != nil && path.Destination != remote.IA {
if path != nil && path.Destination() != remote.IA {
panic("path destination should match address")
}
selector := pan.NewDefaultReplySelector()
Expand Down
18 changes: 10 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ require (
github.com/gorilla/handlers v1.5.1
github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec
github.com/kormat/fmt15 v0.0.0-20181112140556-ee69fecb2656
github.com/mattn/go-sqlite3 v1.14.4
github.com/mattn/go-sqlite3 v1.14.17
github.com/msteinert/pam v0.0.0-20190215180659-f29b9f28d6f9
github.com/netsec-ethz/rains v0.5.0
github.com/pelletier/go-toml v1.9.4
github.com/quic-go/quic-go v0.34.0
github.com/scionproto/scion v0.6.1-0.20220202161514-5883c725f748
github.com/smartystreets/goconvey v1.6.7
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.4.0
golang.org/x/term v0.5.0
github.com/pelletier/go-toml v1.9.5
github.com/quic-go/quic-go v0.38.1
github.com/scionproto/scion v0.8.1-0.20231010074308-1774cbfccb4c
github.com/smartystreets/goconvey v1.7.2
github.com/stretchr/testify v1.8.3
golang.org/x/crypto v0.9.0
golang.org/x/term v0.8.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a
)

// replace github.com/netsec-ethz/rains => ../rains/
1,735 changes: 1,439 additions & 296 deletions go.sum

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/integration/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"testing"
"time"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/serrors"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/log"
"github.com/scionproto/scion/pkg/private/serrors"
"github.com/scionproto/scion/pkg/snet"

"github.com/netsec-ethz/scion-apps/pkg/integration/sintegration"
)
Expand Down
10 changes: 5 additions & 5 deletions pkg/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
"testing"
"time"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/daemon"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/go/lib/snet/addrutil"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/daemon"
"github.com/scionproto/scion/pkg/log"
"github.com/scionproto/scion/pkg/snet"
"github.com/scionproto/scion/pkg/snet/addrutil"

"github.com/netsec-ethz/scion-apps/pkg/integration/sintegration"
)
Expand Down
14 changes: 7 additions & 7 deletions pkg/integration/sintegration/sintegration.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/*
Package sintegration simplifies the creation of integration tests.

NOTE: this is a copy of github.com/scionproto/scion/go/lib/integration, with some omissions and modifications
NOTE: this is a copy of github.com/scionproto/scion/pkg/integration, with some omissions and modifications
*/
package sintegration

Expand All @@ -32,11 +32,11 @@ import (
"strings"
"time"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/daemon"
"github.com/scionproto/scion/go/lib/log"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/go/lib/util"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/daemon"
"github.com/scionproto/scion/pkg/log"
"github.com/scionproto/scion/pkg/snet"
"github.com/scionproto/scion/tools/integration"
)

const (
Expand Down Expand Up @@ -133,7 +133,7 @@ func validateFlags() error {
os.Exit(2)
}
var err error
asList, err := util.LoadASList(GenFile("as_list.yml"))
asList, err := integration.LoadASList(GenFile("as_list.yml"))
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/pan/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"strconv"
"strings"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/snet"
"inet.af/netaddr"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/pan/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type InteractiveSelection struct {
}

func (p *InteractiveSelection) Filter(paths []*Path) []*Path {
dstIA := paths[0].Destination
dstIA := paths[0].destination
choice, ok := p.choices[dstIA]
if !ok {
chosenPaths := p.Prompter.Prompt(paths, dstIA)
Expand Down
18 changes: 9 additions & 9 deletions pkg/pan/internal/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import (
"net"
"time"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/common"
"github.com/scionproto/scion/go/lib/serrors"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/go/lib/snet/path"
"github.com/scionproto/scion/go/lib/sock/reliable"
"github.com/scionproto/scion/go/lib/topology/underlay"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/private/common"
"github.com/scionproto/scion/pkg/private/serrors"
"github.com/scionproto/scion/pkg/snet"
"github.com/scionproto/scion/pkg/snet/path"
"github.com/scionproto/scion/pkg/sock/reliable"
"github.com/scionproto/scion/private/topology/underlay"
)

type Pinger struct {
Expand Down Expand Up @@ -220,11 +220,11 @@ func pack(local, remote *snet.UDPAddr, req snet.SCMPEchoRequest) (*snet.Packet,
PacketInfo: snet.PacketInfo{
Destination: snet.SCIONAddress{
IA: remote.IA,
Host: addr.HostFromIP(remote.Host.IP),
Host: addr.MustParseHost(remote.Host.IP.String()),
},
Source: snet.SCIONAddress{
IA: local.IA,
Host: addr.HostFromIP(local.Host.IP),
Host: addr.MustParseHost(local.Host.IP.String()),
},
Path: remote.Path,
Payload: req,
Expand Down
26 changes: 17 additions & 9 deletions pkg/pan/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,36 @@ import (
"strings"
"time"

"github.com/scionproto/scion/go/lib/slayers/path"
"github.com/scionproto/scion/go/lib/slayers/path/scion"
"github.com/scionproto/scion/go/lib/snet"
snetpath "github.com/scionproto/scion/go/lib/snet/path"
"github.com/scionproto/scion/pkg/slayers/path"
"github.com/scionproto/scion/pkg/slayers/path/scion"
"github.com/scionproto/scion/pkg/snet"
snetpath "github.com/scionproto/scion/pkg/snet/path"
"inet.af/netaddr"
)

// TODO: revisit: pointer or value type? what goes where? should ForwardingPath be exported?
type Path struct {
Source IA
Destination IA
source IA
destination IA
ForwardingPath ForwardingPath
Metadata *PathMetadata // optional
Fingerprint PathFingerprint
Expiry time.Time
}

func (p *Path) Source() IA {
return p.source
}

func (p *Path) Destination() IA {
return p.destination
}

func (p *Path) String() string {
if p.Metadata != nil {
return p.Metadata.fmtInterfaces()
} else {
return fmt.Sprintf("%s %s %s", p.Source, p.Destination, p.Fingerprint)
return fmt.Sprintf("%s %s %s", p.source, p.destination, p.Fingerprint)
}
}

Expand Down Expand Up @@ -111,8 +119,8 @@ func reversePathFromForwardingPath(src, dst IA, fwPath ForwardingPath) (*Path, e
}
fingerprint := pathSequence{InterfaceIDs: fpi.interfaceIDs}.Fingerprint()
return &Path{
Source: dst,
Destination: src,
source: dst,
destination: src,
ForwardingPath: fwPath,
Expiry: fpi.expiry,
Fingerprint: fingerprint,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pan/path_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strings"
"time"

"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/pkg/snet"
)

type IfID uint64
Expand Down
2 changes: 1 addition & 1 deletion pkg/pan/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"
"time"

"github.com/scionproto/scion/go/lib/slayers/path/scion"
"github.com/scionproto/scion/pkg/slayers/path/scion"
"github.com/stretchr/testify/assert"
)

Expand Down
13 changes: 8 additions & 5 deletions pkg/pan/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
"net"
"sort"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/common"
"github.com/scionproto/scion/go/lib/pathpol"
"github.com/scionproto/scion/go/lib/snet"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/private/common"
"github.com/scionproto/scion/pkg/snet"
"github.com/scionproto/scion/private/path/pathpol"
)

// Policy is a stateless filter / sorter for paths.
Expand Down Expand Up @@ -184,7 +184,10 @@ func (p snetPathWrapper) UnderlayNextHop() *net.UDPAddr { panic("not implemented

func (p snetPathWrapper) Dataplane() snet.DataplanePath { panic("not implemented") }
func (p snetPathWrapper) Destination() addr.IA { panic("not implemented") }
func (p snetPathWrapper) Copy() snet.Path { panic("not implemented") }

// TODO: I'm not sure if it's fine to panic here...
func (p snetPathWrapper) Source() addr.IA { panic("not implemented") }
func (p snetPathWrapper) Copy() snet.Path { panic("not implemented") }

func (p snetPathWrapper) Metadata() *snet.PathMetadata {
if p.wrapped.Metadata == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/pan/quic_dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func DialQUIC(ctx context.Context,
// set receive buffer size (it's not a UDPConn, we know).
silenceLog()
defer unsilenceLog()
session, err := quic.DialContext(ctx, pconn, remote, host, tlsConf, quicConf)
session, err := quic.Dial(ctx, pconn, remote, tlsConf, quicConf)
if err != nil {
return nil, err
}
Expand All @@ -86,7 +86,7 @@ func DialQUICEarly(ctx context.Context,
// set receive buffer size (it's not a UDPConn, we know).
silenceLog()
defer unsilenceLog()
session, err := quic.DialEarlyContext(ctx, pconn, remote, host, tlsConf, quicConf)
session, err := quic.DialEarly(ctx, pconn, remote, tlsConf, quicConf)
if err != nil {
return nil, err
}
Expand Down
15 changes: 8 additions & 7 deletions pkg/pan/quic_listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (
// closerListener is a wrapper around quic.Listener that always closes the
// underlying conn when closing the session.
type closerListener struct {
quic.Listener
*quic.Listener
conn net.PacketConn
}

func (l closerListener) Close() error {
func (l *closerListener) Close() error {
err := l.Listener.Close()
l.conn.Close()
return err
Expand All @@ -40,7 +40,7 @@ func (l closerListener) Close() error {
//
// See note on wildcard addresses in the package documentation.
func ListenQUIC(ctx context.Context, local netaddr.IPPort, selector ReplySelector,
tlsConf *tls.Config, quicConfig *quic.Config) (quic.Listener, error) {
tlsConf *tls.Config, quicConfig *quic.Config) (*quic.Listener, error) {

conn, err := ListenUDP(ctx, local, selector)
if err != nil {
Expand All @@ -55,8 +55,9 @@ func ListenQUIC(ctx context.Context, local netaddr.IPPort, selector ReplySelecto
conn.Close()
return nil, err
}
return closerListener{
Listener: listener,
conn: conn,
}, nil
//return closerListener{
// Listener: listener,
// conn: conn,
//}, nil
return listener, nil
}
26 changes: 13 additions & 13 deletions pkg/pan/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"sync"
"time"

"github.com/scionproto/scion/go/lib/addr"
"github.com/scionproto/scion/go/lib/common"
"github.com/scionproto/scion/go/lib/slayers"
"github.com/scionproto/scion/go/lib/snet"
snetpath "github.com/scionproto/scion/go/lib/snet/path"
"github.com/scionproto/scion/go/lib/topology/underlay"
"github.com/scionproto/scion/pkg/addr"
"github.com/scionproto/scion/pkg/private/common"
"github.com/scionproto/scion/pkg/slayers"
"github.com/scionproto/scion/pkg/snet"
snetpath "github.com/scionproto/scion/pkg/snet/path"
"github.com/scionproto/scion/private/topology/underlay"
"inet.af/netaddr"
)

Expand Down Expand Up @@ -80,10 +80,10 @@ func (c *baseUDPConn) writeMsg(src, dst UDPAddr, path *Path, b []byte) (int, err
if src.IA != dst.IA && path == nil {
panic("writeMsg: need path when src.IA != dst.IA")
}
if path != nil && src.IA != path.Source {
if path != nil && src.IA != path.Source() {
panic("writeMsg: src.IA != path.Source")
}
if path != nil && dst.IA != path.Destination {
if path != nil && dst.IA != path.Destination() {
panic("writeMsg: dst.IA != path.Destination")
}

Expand All @@ -107,11 +107,11 @@ func (c *baseUDPConn) writeMsg(src, dst UDPAddr, path *Path, b []byte) (int, err
PacketInfo: snet.PacketInfo{
Source: snet.SCIONAddress{
IA: addr.IA(src.IA),
Host: addr.HostFromIP(src.IP.IPAddr().IP),
Host: addr.MustParseHost(src.IP.IPAddr().IP.String()),
},
Destination: snet.SCIONAddress{
IA: addr.IA(dst.IA),
Host: addr.HostFromIP(dst.IP.IPAddr().IP),
Host: addr.MustParseHost(dst.IP.IPAddr().IP.String()),
},
Path: dataplanePath,
Payload: snet.UDPPayload{
Expand Down Expand Up @@ -152,8 +152,8 @@ func (c *baseUDPConn) readMsg(b []byte) (int, UDPAddr, ForwardingPath, error) {
if !ok {
continue // ignore non-UDP packet
}
srcIP, ok := netaddr.FromStdIP(pkt.Source.Host.IP())
if !ok {
srcIP, err := netaddr.ParseIP(pkt.Source.Host.IP().String())
if err != nil {
continue // ignore non-IP destination
}
remote := UDPAddr{
Expand Down Expand Up @@ -209,7 +209,7 @@ func (h scmpHandler) Handle(pkt *snet.Packet) error {
stats.NotifyPathDown(pf, pi)
return nil
default:
ip, _ := netaddr.FromStdIP(pkt.Source.Host.IP())
ip, _ := netaddr.ParseIP(pkt.Source.Host.IP().String())
return SCMPError{
typeCode: slayers.CreateSCMPTypeCode(scmp.Type(), scmp.Code()),
ErrorIA: IA(pkt.Source.IA),
Expand Down
Loading