diff --git a/README.md b/README.md index 751356ed9..96e5c3fd6 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,8 @@ The directory _examples contains examples for the usage of the SCION libraries. Example for the use of QUIC over SCION. * [_examples/hellodrkey](_examples/hellodrkey/README.md): Example for the the use of DRKey. +* [_examples/sgrpc](_examples/sgrpc/README.md): + Example for using gRPC over SCION/QUIC with the PAN library. * [_examples/shttp](_examples/shttp/README.md): Examples for using HTTP over SCION/QUIC, examples for servers, proxies, and clients. diff --git a/_examples/.golangci.yml b/_examples/.golangci.yml new file mode 100644 index 000000000..932aa2a4b --- /dev/null +++ b/_examples/.golangci.yml @@ -0,0 +1,50 @@ +# Configuration for golangci-lint for scion-apps. +# See https://github.com/golangci/golangci-lint#config-file + +linters: + enable: + # enabled by default: + #- deadcode + #- errcheck + #- gosimple + #- govet + #- ineffassign + #- staticcheck + #- structcheck + #- typecheck + #- unused + #- varcheck + - asciicheck + - bidichk + - contextcheck + - dupl + - durationcheck + - errname + - errorlint + - exportloopref + - gci + - gofmt + - ifshort + - importas + - makezero + - misspell + - nilerr + - nilnil + - nolintlint + - prealloc + - stylecheck + - thelper + - wastedassign + - tenv + +issues: + max-same-issues: 0 + +linters-settings: + gci: + local-prefixes: examples + exhaustive: + default-signifies-exhaustive: true + +run: + build-tags: integration \ No newline at end of file diff --git a/_examples/go.mod b/_examples/go.mod index a31030dde..0e88ff88a 100644 --- a/_examples/go.mod +++ b/_examples/go.mod @@ -1,16 +1,67 @@ module examples -go 1.16 +go 1.20 require ( + github.com/golang/protobuf v1.5.2 github.com/gorilla/handlers v1.5.1 - github.com/lucas-clemente/quic-go v0.23.0 - github.com/netsec-ethz/scion-apps v0.5.1-0.20220504120040-79211109ed3f + github.com/netsec-ethz/scion-apps v0.0.0-00010101000000-000000000000 + github.com/quic-go/quic-go v0.34.0 github.com/scionproto/scion v0.6.1-0.20220202161514-5883c725f748 google.golang.org/grpc v1.40.0 - inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e + google.golang.org/protobuf v1.28.0 + inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a ) -replace github.com/scionproto/scion => github.com/netsec-ethz/scion v0.6.1-0.20220422080039-25976708fd6b +require ( + github.com/antlr/antlr4 v0.0.0-20181218183524-be58ebffde8e // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/britram/borat v0.0.0-20181011130314-f891bcfcfb9b // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/dchest/cmac v0.0.0-20150527144652-62ff55a1048c // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/google/gopacket v1.1.16-0.20190123011826-102d5ca2098c // indirect + github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect + github.com/inconshreveable/log15 v2.16.0+incompatible // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/netsec-ethz/rains v0.5.0 // indirect + github.com/onsi/ginkgo/v2 v2.2.0 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/quic-go/qpack v0.4.0 // indirect + github.com/quic-go/qtls-go1-19 v0.3.2 // indirect + github.com/quic-go/qtls-go1-20 v0.2.2 // indirect + github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect + github.com/uber/jaeger-lib v2.0.0+incompatible // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.17.0 // indirect + go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect + go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect + golang.org/x/crypto v0.9.0 // indirect + golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect + golang.org/x/mod v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + golang.org/x/tools v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect +) + +replace github.com/scionproto/scion => github.com/netsec-ethz/scion v0.6.1-0.20220929101513-2408583f35d1 replace github.com/netsec-ethz/scion-apps => ../ diff --git a/_examples/go.sum b/_examples/go.sum index 0516adedd..83928ef56 100644 --- a/_examples/go.sum +++ b/_examples/go.sum @@ -89,11 +89,9 @@ github.com/buildkite/go-buildkite/v2 v2.8.1/go.mod h1:kRCClqF2FuCFK42+Jk8ggYUMMA github.com/cenkalti/backoff v1.1.1-0.20171020064038-309aa717adbf/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -117,7 +115,6 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -157,7 +154,6 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -259,8 +255,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -286,6 +282,7 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -345,8 +342,9 @@ github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365 h1:ECW73yc9MY79 github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec h1:CGkYB1Q7DSsH/ku+to+foV4agt2F2miquaLUgF6L178= github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= +github.com/inconshreveable/log15 v2.16.0+incompatible h1:6nvMKxtGcpgm7q0KiGs+Vc+xDvUXaBqsPKHWKsinccw= +github.com/inconshreveable/log15 v2.16.0+incompatible/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= @@ -369,7 +367,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kormat/fmt15 v0.0.0-20181112140556-ee69fecb2656/go.mod h1:8fpYQL5jskFnAq4zE2UpspqEVHuTjurptCxHPpdoBgM= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -394,7 +391,6 @@ github.com/lestrrat-go/httpcc v1.0.0/go.mod h1:tGS/u00Vh5N6FHNkExqGGNId8e0Big+++ github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= github.com/lestrrat-go/jwx v1.2.7/go.mod h1:bw24IXWbavc0R2RsOtpXL7RtMyP589yZ1+L7kd09ZGA= github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/lucas-clemente/quic-go v0.23.0 h1:5vFnKtZ6nHDFsc/F3uuiF4T3y/AXaQdxjUqiVw26GZE= github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -408,9 +404,7 @@ github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= -github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= -github.com/marten-seemann/qtls-go1-17 v0.1.0 h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk= github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -428,8 +422,8 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= @@ -454,7 +448,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/msteinert/pam v0.0.0-20190215180659-f29b9f28d6f9/go.mod h1:np1wUFZ6tyoke22qDJZY40URn9Ae51gX7ljIWXN5TJs= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -462,11 +455,10 @@ github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJE github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= github.com/netsec-ethz/rains v0.5.0 h1:5x+C7aIVZNLtlonyA5JWUXR+MQXMuJzxK8PwnLWQV1E= github.com/netsec-ethz/rains v0.5.0/go.mod h1:+H9/DeJoYmFtcpLqFUJFQgALVWO675XdBZJdALL5ltU= -github.com/netsec-ethz/scion v0.6.1-0.20220422080039-25976708fd6b h1:cLQzuQ51QiGVdwGgUZdFh6QyoXAM64YkdWqdGjBgfSg= -github.com/netsec-ethz/scion v0.6.1-0.20220422080039-25976708fd6b/go.mod h1:9EyDb3Bfn7kDmy6v+gHKwl2eIxFo3Reod4TwDaKY5zo= +github.com/netsec-ethz/scion v0.6.1-0.20220929101513-2408583f35d1 h1:6u2UB/od3ZQFQpHYsf/ZsJssrGlXMCmlwqbT0sIXLLw= +github.com/netsec-ethz/scion v0.6.1-0.20220929101513-2408583f35d1/go.mod h1:9EyDb3Bfn7kDmy6v+gHKwl2eIxFo3Reod4TwDaKY5zo= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -476,15 +468,16 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.2.0 h1:3ZNA3L1c5FYDFTTxbFeVGGD8jYvjYauHD30YgLxVsNI= +github.com/onsi/ginkgo/v2 v2.2.0/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= +github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -495,8 +488,9 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/patrickmn/go-cache v2.1.1-0.20180815053127-5633e0862627+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -535,6 +529,14 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= +github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc86Z5U= +github.com/quic-go/qtls-go1-19 v0.3.2/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= +github.com/quic-go/qtls-go1-20 v0.2.2 h1:WLOPx6OY/hxtTxKV1Zrq20FtXtDEkeY00CGQm8GEa3E= +github.com/quic-go/qtls-go1-20 v0.2.2/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/quic-go v0.34.0 h1:OvOJ9LFjTySgwOTYUZmNoq0FzVicP8YujpV0kB7m2lU= +github.com/quic-go/quic-go v0.34.0/go.mod h1:+4CVgVppm0FNjpG3UcX8Joi/frKOH7/ciD5yGcwOO1g= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -609,8 +611,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -663,13 +665,15 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -go4.org/intern v0.0.0-20210108033219-3eb7198706b2 h1:VFTf+jjIgsldaz/Mr00VaCSswHJrI2hIjQygE/W4IMg= go4.org/intern v0.0.0-20210108033219-3eb7198706b2/go.mod h1:vLqJ+12kCw61iCWsPto0EOHhBS+o4rO5VIucbc9g2Cc= +go4.org/intern v0.0.0-20211027215823-ae77deb06f29 h1:UXLjNohABv4S58tHmeuIZDO6e3mHpW2Dx33gaNt03LE= +go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA= go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222175341-b30ae309168e/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063 h1:1tk03FUNpulq2cuWpXZWj649rwJpk0d20rxWiopKRmc= go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 h1:WJhcL4p+YeDxmZWg141nRm7XC8IDmhz7lk5GpadO1Sg= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -688,8 +692,9 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -700,6 +705,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o= +golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -725,8 +732,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -778,8 +786,9 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -809,8 +818,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -891,11 +900,14 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -904,8 +916,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -982,12 +995,12 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -1134,8 +1147,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1151,7 +1165,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1165,8 +1178,8 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1177,8 +1190,9 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e h1:tvgqez5ZQoBBiBAGNU/fmJy247yB/7++kcLOEoMYup0= inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls= +inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a h1:1XCVEdxrvL6c0TGOhecLuB7U9zYNdxZEjvOqJreKZiM= +inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a/go.mod h1:e83i32mAQOW1LAqEIweALsuK2Uw4mhQadA5r7b0Wobo= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/_examples/hellodrkey/README.md b/_examples/hellodrkey/README.md index 057aa87f0..d45b7c625 100644 --- a/_examples/hellodrkey/README.md +++ b/_examples/hellodrkey/README.md @@ -8,14 +8,14 @@ The application mimics the behavior using DRKey that would be observed by both a The client uses the slow path to obtain a DRKey, and the server uses the fast path. Slow path (client): -1. Obtain a connection to the designated `sciondForClient` and encapsulate it in the `Client` class. +1. Obtain a connection to the designated Control Service and encapsulate it in the `Client` class. 1. Obtain the metadata for the DRKey. 1. Request the DRKey with that metadata. Fast path (server): -1. Obtain a connection to the designated `sciondForServer` and encapsulate it in the `Server` class. -1. Obtain the Secret Value (SV) for the designated protocol. -1. Derive the DRKey with the SV and the metadata. +1. Obtain a connection to the designated Control Service and encapsulate it in the `Server` class. +1. Obtain the Secret Value for that metadata. The Secret Value does not change with the destination host. +1. Derive the DRKey with the SecretValue and the metadata. Both slow and fast paths should obtain the same key. And both slow and fast path are measured for performance and their times displayed at the end. @@ -26,12 +26,9 @@ For this example to work, you must configure your devel SCION with an appropriat Follow these steps: 1. Create a local topology with the `tiny.topo` description: `./scion.sh topology -c ./topology/tiny.topo`. -1. Allow the server of the example setup to obtain the Secret Value (SV) for the DNS protocol. - Edit `gen/ASff00_0_111/cs1-ff00_0_111-1.toml` and include an entry for `dns` under `drkey.delegation`: - - ```toml - [drkey.delegation] - dns = [ "127.0.0.1",] - ``` - -1. Start scion with `./scion.sh start` and run hellodrkey. +1. Add the following entry to `gen/ASff00_0_111/cs1-ff00_0_111-1.toml`: +``` +[drkey.delegation] +scmp = [ "",] (e.g., scmp = [ "127.0.0.1",] ) +``` +1. Restart scion with `./scion.sh stop; ./scion.sh start nobuild` and run hellodrkey. diff --git a/_examples/hellodrkey/hellodrkey.go b/_examples/hellodrkey/hellodrkey.go index 857ce77fe..f99a2d202 100644 --- a/_examples/hellodrkey/hellodrkey.go +++ b/_examples/hellodrkey/hellodrkey.go @@ -18,14 +18,18 @@ import ( "context" "encoding/hex" "fmt" + "net" "time" "github.com/scionproto/scion/go/lib/addr" - drkeyctrl "github.com/scionproto/scion/go/lib/ctrl/drkey" "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" "google.golang.org/grpc" + "google.golang.org/protobuf/types/known/timestamppb" ) // check just ensures the error is nil, or complains and quits @@ -35,21 +39,42 @@ func check(e error) { } } -type Client struct { +type dialer struct { daemon daemon.Connector } +func (d *dialer) Dial(ctx context.Context, _ net.Addr) (*grpc.ClientConn, error) { + // Obtain CS address from scion daemon + svcs, err := d.daemon.SVCInfo(ctx, nil) + check(err) + cs := svcs[addr.SvcCS] + if len(cs) == 0 { + panic("no CS svc address") + } + + // Contact CS directly for SV + return grpc.DialContext(ctx, cs, grpc.WithInsecure()) +} + +type Client struct { + fetcher *fetcher.FromCS +} + func NewClient(ctx context.Context, sciondPath string) Client { daemon, err := daemon.NewService(sciondPath).Connect(ctx) check(err) return Client{ - daemon: daemon, + fetcher: &fetcher.FromCS{ + Dialer: &dialer{ + daemon: daemon, + }, + }, } } func (c Client) HostHostKey(ctx context.Context, meta drkey.HostHostMeta) drkey.HostHostKey { // get L2 key: (slow path) - key, err := c.daemon.DRKeyGetHostHostKey(ctx, meta) + key, err := c.fetcher.DRKeyGetHostHostKey(ctx, meta) check(err) return key } @@ -68,36 +93,47 @@ func NewServer(ctx context.Context, sciondPath string) Server { // fetchSV obtains the Secret Value (SV) for the selected protocol/epoch. // From this SV, all keys for this protocol/epoch can be derived locally. -// The IP address of the server must be explicitly allowed to abtain this SV +// The IP address of the server must be explicitly allowed to obtain this SV // from the the control server. func (s Server) fetchSV(ctx context.Context, meta drkey.SVMeta) drkey.SV { - // Obtain CS address from scion daemon + // Obtain CS address from scion daemon. Note there's no need to use + // the daemon as long as a valid address could be passed to the dialing + // function. svcs, err := s.daemon.SVCInfo(ctx, nil) check(err) cs := svcs[addr.SvcCS] + if len(cs) == 0 { + panic("no CS svc address") + } // Contact CS directly for SV conn, err := grpc.DialContext(ctx, cs, grpc.WithInsecure()) check(err) defer conn.Close() client := cppb.NewDRKeyIntraServiceClient(conn) - protoReq, err := drkeyctrl.SVMetaToProtoRequest(meta) - check(err) - rep, err := client.SV(ctx, protoReq) + + rep, err := client.SV(ctx, &dkpb.SVRequest{ + ValTime: timestamppb.New(meta.Validity), + ProtocolId: dkpb.Protocol(meta.ProtoId), + }) check(err) - key, err := drkeyctrl.GetSVFromReply(meta.ProtoId, rep) + key, err := getSecretFromReply(meta.ProtoId, rep) check(err) return key } func (s Server) HostHostKey(sv drkey.SV, meta drkey.HostHostMeta) drkey.HostHostKey { - var deriver drkey.SpecificDeriver + deriver := (&drkey.SpecificDeriver{}) lvl1, err := deriver.DeriveLvl1(drkey.Lvl1Meta{ - DstIA: meta.DstIA, + Validity: meta.Validity, + ProtoId: meta.ProtoId, + SrcIA: meta.SrcIA, + DstIA: meta.DstIA, }, sv.Key) check(err) asHost, err := deriver.DeriveHostAS(drkey.HostASMeta{ - SrcHost: meta.SrcHost, + Lvl2Meta: meta.Lvl2Meta, + SrcHost: meta.SrcHost, }, lvl1) check(err) hosthost, err := deriver.DeriveHostToHost(meta.DstHost, asHost) @@ -122,7 +158,7 @@ func main() { const sciondForClient = "[fd00:f00d:cafe::7f00:c]:30255" clientIA, err := addr.ParseIA("1-ff00:0:112") check(err) - const clientIP = "fd00:f00d:cafe::7f00:c" + const clientIP = "fd00:f00d:cafe::7f00:b" ctx, cancelF := context.WithTimeout(context.Background(), 4*time.Second) defer cancelF() @@ -130,7 +166,7 @@ func main() { // meta describes the key that both client and server derive meta := drkey.HostHostMeta{ Lvl2Meta: drkey.Lvl2Meta{ - ProtoId: drkey.DNS, + ProtoId: drkey.SCMP, // Validity timestamp; both sides need to use the same time stamp when deriving the key // to ensure they derive keys for the same epoch. // Usually this is coordinated by means of a timestamp in the message. @@ -168,3 +204,30 @@ func main() { fmt.Printf("Server,\thost key = %s\tduration = %s\n", hex.EncodeToString(serverKey.Key[:]), durationServer) } + +func getSecretFromReply( + proto drkey.Protocol, + rep *dkpb.SVResponse, +) (drkey.SV, error) { + + err := rep.EpochBegin.CheckValid() + if err != nil { + return drkey.SV{}, err + } + err = rep.EpochEnd.CheckValid() + if err != nil { + return drkey.SV{}, err + } + epoch := drkey.Epoch{ + Validity: cppki.Validity{ + NotBefore: rep.EpochBegin.AsTime(), + NotAfter: rep.EpochEnd.AsTime(), + }, + } + returningKey := drkey.SV{ + ProtoId: proto, + Epoch: epoch, + } + copy(returningKey.Key[:], rep.Key) + return returningKey, nil +} diff --git a/_examples/helloquic/README.md b/_examples/helloquic/README.md index 919ed1340..240e98c24 100644 --- a/_examples/helloquic/README.md +++ b/_examples/helloquic/README.md @@ -6,7 +6,7 @@ entire stream content and echos it back to the client. Server: ``` -go run helloquic.go -port 1234 +go run helloquic.go -listen 127.0.0.1:1234 ``` Client: diff --git a/_examples/helloquic/helloquic.go b/_examples/helloquic/helloquic.go index 0772ed690..d209e8eeb 100644 --- a/_examples/helloquic/helloquic.go +++ b/_examples/helloquic/helloquic.go @@ -24,11 +24,10 @@ import ( "os" "time" - "github.com/lucas-clemente/quic-go" - "inet.af/netaddr" - "github.com/netsec-ethz/scion-apps/pkg/pan" "github.com/netsec-ethz/scion-apps/pkg/quicutil" + "github.com/quic-go/quic-go" + "inet.af/netaddr" ) func main() { @@ -81,7 +80,7 @@ func runServer(listen netaddr.IPPort) error { } } -func workSession(session quic.Session) error { +func workSession(session quic.Connection) error { for { stream, err := session.AcceptStream(context.Background()) if err != nil { @@ -106,7 +105,7 @@ func workSession(session quic.Session) error { } func runClient(address string, count int) error { - addr, err := pan.ResolveUDPAddr(address) + addr, err := pan.ResolveUDPAddr(context.TODO(), address) if err != nil { return err } diff --git a/_examples/helloworld/README.md b/_examples/helloworld/README.md index 29613befd..c7e4f1d38 100644 --- a/_examples/helloworld/README.md +++ b/_examples/helloworld/README.md @@ -5,7 +5,7 @@ which replies back. Server: ``` -go run helloworld.go -port 1234 +go run helloworld.go -listen 127.0.0.1:1234 ``` Client: diff --git a/_examples/helloworld/helloworld.go b/_examples/helloworld/helloworld.go index 9e52840aa..64711fc0d 100644 --- a/_examples/helloworld/helloworld.go +++ b/_examples/helloworld/helloworld.go @@ -22,9 +22,8 @@ import ( "os" "time" - "inet.af/netaddr" - "github.com/netsec-ethz/scion-apps/pkg/pan" + "inet.af/netaddr" ) func main() { @@ -75,7 +74,7 @@ func runServer(listen netaddr.IPPort) error { } func runClient(address string, count int) error { - addr, err := pan.ResolveUDPAddr(address) + addr, err := pan.ResolveUDPAddr(context.TODO(), address) if err != nil { return err } diff --git a/_examples/sgrpc/README.md b/_examples/sgrpc/README.md new file mode 100644 index 000000000..da74fdb90 --- /dev/null +++ b/_examples/sgrpc/README.md @@ -0,0 +1,46 @@ +# Example for gRPC over SCION/QUIC + +This directory contains a small example program that shows how gRPC can be used over SCION/QUIC with the PAN library. +The example consists of an echo server and a client that sends a message to the service. + +## Running + +The example requires a running SCION endhost stack, i.e. a running SCION dispatcher and SCION daemon. Please refer to '[Running](../../README.md#Running)' in this repository's main README and the [SCIONLab tutorials](https://docs.scionlab.org) to get started. +See '[Environment](../../README.md#Environment)' on how to set the dispatcher and sciond environment variables when e.g. running multiple local ASes. + +To test the server and client, run the SCION tiny test topology. + +Open a shell and run the server in the AS `1-ff00:0:111`: +```bash +# Server in 1-ff00:0:111 +SCION_DAEMON_ADDRESS="127.0.0.20:30255" \ +go run server/main.go --server-address 127.0.0.1:5000 +``` + +Open a shell and run the client in the AS `1-ff00:0:112` and send a message to the server: +```bash +# Client in 1-ff00:0:112 +SCION_DAEMON_ADDRESS="127.0.0.28:30255" \ +go run client/main.go --server-address "1-ff00:0:111,127.0.0.1:5000" --message "gRPC over SCION/QUIC" +``` + +## Protobuf +Tutorial: https://grpc.io/docs/languages/go/basics/ + +Requirements: +```bash +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest +``` + +The compiler plugin protoc-gen-go will be installed in $GOBIN, defaulting to $GOPATH/bin. It must be in your $PATH for the protocol compiler protoc to find it. +```bash +export GO_PATH=~/go +export PATH=$PATH:/$GO_PATH/bin +``` + +The generation of the gRPC client and server interface is performed as follows: +```bash +protoc --go_out=. --go_opt=paths=source_relative \ + --go-grpc_out=. --go-grpc_opt=paths=source_relative \ + proto/*.proto +``` diff --git a/_examples/sgrpc/client/main.go b/_examples/sgrpc/client/main.go new file mode 100644 index 000000000..414471b62 --- /dev/null +++ b/_examples/sgrpc/client/main.go @@ -0,0 +1,75 @@ +package main + +import ( + "context" + "crypto/tls" + "flag" + "fmt" + "log" + "net" + "time" + + "github.com/netsec-ethz/scion-apps/pkg/pan" + "github.com/netsec-ethz/scion-apps/pkg/quicutil" + "github.com/quic-go/quic-go" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "inet.af/netaddr" + + pb "examples/sgrpc/proto" +) + +var ( + Message = flag.String("message", "", "Message to send to the gRPC echo server") + ServerAddr = flag.String("server-addr", "1-ff00:0:111,127.0.0.1:5000", "Address of the echo server") +) + +func NewPanQuicDialer(tlsCfg *tls.Config) func(context.Context, string) (net.Conn, error) { + dialer := func(ctx context.Context, addr string) (net.Conn, error) { + panAddr, err := pan.ResolveUDPAddr(ctx, addr) + if err != nil { + return nil, err + } + + clientQuicConfig := &quic.Config{KeepAlive: true} + session, err := pan.DialQUIC(ctx, netaddr.IPPort{}, panAddr, nil, nil, "", tlsCfg, clientQuicConfig) + if err != nil { + return nil, fmt.Errorf("did not dial: %w", err) + } + return quicutil.NewSingleStream(session) + } + + return dialer +} + +func main() { + flag.Parse() + + tlsCfg := &tls.Config{ + InsecureSkipVerify: true, + NextProtos: []string{"echo_service"}, + } + + ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) + defer cancel() + + grpcDial, err := grpc.DialContext(ctx, *ServerAddr, + grpc.WithContextDialer(NewPanQuicDialer(tlsCfg)), + grpc.WithTransportCredentials(insecure.NewCredentials()), + ) + if err != nil { + log.Fatalf("failed to dial gRPC: %v", err) + } + + c := pb.NewEchoServiceClient(grpcDial) + + req := &pb.EchoRequest{ + Msg: *Message, + } + resp, err := c.Echo(ctx, req) + if err != nil { + log.Fatalf("gRPC did not connect: %v", err) + } + + fmt.Println(resp.Msg) +} diff --git a/_examples/sgrpc/proto/echo.pb.go b/_examples/sgrpc/proto/echo.pb.go new file mode 100644 index 000000000..f4120623c --- /dev/null +++ b/_examples/sgrpc/proto/echo.pb.go @@ -0,0 +1,122 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: proto/echo.proto + +package proto + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type EchoRequest struct { + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EchoRequest) Reset() { *m = EchoRequest{} } +func (m *EchoRequest) String() string { return proto.CompactTextString(m) } +func (*EchoRequest) ProtoMessage() {} +func (*EchoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4990368b046ea048, []int{0} +} + +func (m *EchoRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EchoRequest.Unmarshal(m, b) +} +func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EchoRequest.Marshal(b, m, deterministic) +} +func (m *EchoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoRequest.Merge(m, src) +} +func (m *EchoRequest) XXX_Size() int { + return xxx_messageInfo_EchoRequest.Size(m) +} +func (m *EchoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EchoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EchoRequest proto.InternalMessageInfo + +func (m *EchoRequest) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +type EchoResponse struct { + Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EchoResponse) Reset() { *m = EchoResponse{} } +func (m *EchoResponse) String() string { return proto.CompactTextString(m) } +func (*EchoResponse) ProtoMessage() {} +func (*EchoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4990368b046ea048, []int{1} +} + +func (m *EchoResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EchoResponse.Unmarshal(m, b) +} +func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) +} +func (m *EchoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EchoResponse.Merge(m, src) +} +func (m *EchoResponse) XXX_Size() int { + return xxx_messageInfo_EchoResponse.Size(m) +} +func (m *EchoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EchoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_EchoResponse proto.InternalMessageInfo + +func (m *EchoResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func init() { + proto.RegisterType((*EchoRequest)(nil), "proto.echo.EchoRequest") + proto.RegisterType((*EchoResponse)(nil), "proto.echo.EchoResponse") +} + +func init() { + proto.RegisterFile("proto/echo.proto", fileDescriptor_4990368b046ea048) +} + +var fileDescriptor_4990368b046ea048 = []byte{ + // 149 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x28, 0x28, 0xca, 0x2f, + 0xc9, 0xd7, 0x4f, 0x4d, 0xce, 0xc8, 0xd7, 0x03, 0x33, 0x85, 0xb8, 0xc0, 0x94, 0x1e, 0x48, 0x44, + 0x49, 0x9e, 0x8b, 0xdb, 0x35, 0x39, 0x23, 0x3f, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, + 0x80, 0x8b, 0x39, 0xb7, 0x38, 0x5d, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, 0x08, 0xc4, 0x54, 0x52, + 0xe0, 0xe2, 0x81, 0x28, 0x28, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0xc5, 0x54, 0x61, 0xe4, 0x05, 0x31, + 0x22, 0x38, 0xb5, 0xa8, 0x2c, 0x33, 0x39, 0x55, 0xc8, 0x9a, 0x8b, 0x05, 0xc4, 0x15, 0x12, 0xd7, + 0x43, 0x58, 0xa3, 0x87, 0x64, 0x87, 0x94, 0x04, 0xa6, 0x04, 0xc4, 0x6c, 0x25, 0x06, 0x27, 0xb1, + 0x28, 0x91, 0xd4, 0x8a, 0xc4, 0xdc, 0x82, 0x9c, 0xd4, 0x62, 0xfd, 0xe2, 0xf4, 0xa2, 0x82, 0x64, + 0x7d, 0xb0, 0xda, 0x24, 0x36, 0x30, 0x65, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x8a, 0xa7, 0xb2, + 0xc6, 0xcd, 0x00, 0x00, 0x00, +} diff --git a/_examples/sgrpc/proto/echo.proto b/_examples/sgrpc/proto/echo.proto new file mode 100644 index 000000000..0e6990f89 --- /dev/null +++ b/_examples/sgrpc/proto/echo.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package proto.echo; + +option go_package = "examples/sgrpc/proto"; + +service EchoService{ + rpc Echo(EchoRequest) returns (EchoResponse) {} +} + +message EchoRequest{ + string msg = 1; +} + +message EchoResponse{ + string msg = 1; +} diff --git a/_examples/sgrpc/proto/echo_grpc.pb.go b/_examples/sgrpc/proto/echo_grpc.pb.go new file mode 100644 index 000000000..a488472fd --- /dev/null +++ b/_examples/sgrpc/proto/echo_grpc.pb.go @@ -0,0 +1,105 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.12.4 +// source: proto/echo.proto + +package proto + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// EchoServiceClient is the client API for EchoService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type EchoServiceClient interface { + Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) +} + +type echoServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient { + return &echoServiceClient{cc} +} + +func (c *echoServiceClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { + out := new(EchoResponse) + err := c.cc.Invoke(ctx, "/proto.echo.EchoService/Echo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// EchoServiceServer is the server API for EchoService service. +// All implementations must embed UnimplementedEchoServiceServer +// for forward compatibility +type EchoServiceServer interface { + Echo(context.Context, *EchoRequest) (*EchoResponse, error) + mustEmbedUnimplementedEchoServiceServer() +} + +// UnimplementedEchoServiceServer must be embedded to have forward compatible implementations. +type UnimplementedEchoServiceServer struct { +} + +func (UnimplementedEchoServiceServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") +} +func (UnimplementedEchoServiceServer) mustEmbedUnimplementedEchoServiceServer() {} + +// UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to EchoServiceServer will +// result in compilation errors. +type UnsafeEchoServiceServer interface { + mustEmbedUnimplementedEchoServiceServer() +} + +func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer) { + s.RegisterService(&EchoService_ServiceDesc, srv) +} + +func _EchoService_Echo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EchoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EchoServiceServer).Echo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/proto.echo.EchoService/Echo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EchoServiceServer).Echo(ctx, req.(*EchoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var EchoService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "proto.echo.EchoService", + HandlerType: (*EchoServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Echo", + Handler: _EchoService_Echo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/echo.proto", +} diff --git a/_examples/sgrpc/server/main.go b/_examples/sgrpc/server/main.go new file mode 100644 index 000000000..1c0e40145 --- /dev/null +++ b/_examples/sgrpc/server/main.go @@ -0,0 +1,62 @@ +package main + +import ( + "context" + "crypto/tls" + "flag" + "log" + + "github.com/netsec-ethz/scion-apps/pkg/pan" + "github.com/netsec-ethz/scion-apps/pkg/quicutil" + "google.golang.org/grpc" + "inet.af/netaddr" + + pb "examples/sgrpc/proto" +) + +type echoServer struct { + pb.UnimplementedEchoServiceServer +} + +var _ pb.EchoServiceServer = &echoServer{} + +func (*echoServer) Echo(ctx context.Context, + req *pb.EchoRequest) (*pb.EchoResponse, error) { + resp := &pb.EchoResponse{ + Msg: req.Msg, + } + return resp, nil +} + +var ( + ServerAddr = flag.String("server-addr", "127.0.0.1:5000", "Address the server should listen on") +) + +func main() { + flag.Parse() + + addr, err := netaddr.ParseIPPort(*ServerAddr) + if err != nil { + log.Fatalf("failed to parse server address") + } + + echoServer := &echoServer{} + grpcServer := grpc.NewServer() + pb.RegisterEchoServiceServer(grpcServer, echoServer) + + tlsCfg := &tls.Config{ + Certificates: quicutil.MustGenerateSelfSignedCert(), + NextProtos: []string{"echo_service"}, + } + + quicListener, err := pan.ListenQUIC(context.Background(), addr, nil, tlsCfg, nil) + if err != nil { + log.Fatalf("failed to listen SCION QUIC on %s: %v", *ServerAddr, err) + } + lis := quicutil.SingleStreamListener{Listener: quicListener} + log.Println("listen on", quicListener.Addr()) + + if err := grpcServer.Serve(lis); err != nil { + log.Fatalf("failed to serve: %v", err) + } +} diff --git a/_examples/shttp/fileserver/main.go b/_examples/shttp/fileserver/main.go index b9bd18b70..4b783dc81 100644 --- a/_examples/shttp/fileserver/main.go +++ b/_examples/shttp/fileserver/main.go @@ -23,7 +23,6 @@ import ( "os" "github.com/gorilla/handlers" - "github.com/netsec-ethz/scion-apps/pkg/shttp" ) diff --git a/_examples/shttp/proxy/main.go b/_examples/shttp/proxy/main.go index 540e86cbb..dde4eb0aa 100644 --- a/_examples/shttp/proxy/main.go +++ b/_examples/shttp/proxy/main.go @@ -10,7 +10,6 @@ import ( "os" "github.com/gorilla/handlers" - "github.com/netsec-ethz/scion-apps/pkg/shttp" ) diff --git a/_examples/shttp/server/main.go b/_examples/shttp/server/main.go index 6c98dc216..aa0a477af 100644 --- a/_examples/shttp/server/main.go +++ b/_examples/shttp/server/main.go @@ -24,7 +24,6 @@ import ( "time" "github.com/gorilla/handlers" - "github.com/netsec-ethz/scion-apps/pkg/shttp" ) diff --git a/_examples/shttp3/client/main.go b/_examples/shttp3/client/main.go new file mode 100644 index 000000000..2bdef9242 --- /dev/null +++ b/_examples/shttp3/client/main.go @@ -0,0 +1,96 @@ +// Copyright 2018 ETH Zurich +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "crypto/tls" + "flag" + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + "strings" + "time" + + "github.com/netsec-ethz/scion-apps/pkg/shttp" + "github.com/netsec-ethz/scion-apps/pkg/shttp3" + "github.com/quic-go/quic-go/http3" +) + +func main() { + serverAddrStr := flag.String("s", "", "Server address ( or , optionally with appended <:port>)") + flag.Parse() + + if len(*serverAddrStr) == 0 { + flag.Usage() + os.Exit(2) + } + + transport := &http3.RoundTripper{Dial: shttp3.DefaultTransport.Dial} + transport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} + // Create a standard client with our custom Transport/Dialer + c := &http.Client{ + Transport: transport, + } + + // Make a get request + start := time.Now() + query := fmt.Sprintf("https://%s/hello", *serverAddrStr) + resp, err := c.Get(shttp.MangleSCIONAddrURL(query)) + if err != nil { + log.Fatal("GET request failed: ", err) + } + defer resp.Body.Close() + end := time.Now() + + log.Printf("\nGET request succeeded in %v seconds", end.Sub(start).Seconds()) + printResponse(resp) + + // (just for demonstration on how to use Close. Clients are safe for concurrent use and should be re-used) + c.CloseIdleConnections() + + start = time.Now() + query = fmt.Sprintf("https://%s/form", *serverAddrStr) + resp, err = c.Post( + shttp.MangleSCIONAddrURL(query), + "application/x-www-form-urlencoded", + strings.NewReader("surname=threepwood&firstname=guybrush"), + ) + if err != nil { + log.Fatal("POST request failed: ", err) + } + defer resp.Body.Close() + end = time.Now() + + log.Printf("POST request succeeded in %v seconds", end.Sub(start).Seconds()) + printResponse(resp) +} + +func printResponse(resp *http.Response) { + fmt.Println("\n***Printing Response***") + fmt.Println("Status: ", resp.Status) + fmt.Println("Protocol:", resp.Proto) + fmt.Println("Content-Length: ", resp.ContentLength) + fmt.Println("Content-Type: ", resp.Header.Get("Content-Type")) + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + log.Print(err) + } + if len(body) != 0 { + fmt.Println("Body: ", string(body)) + } + fmt.Print("\n\n") +} diff --git a/_examples/shttp3/server/main.go b/_examples/shttp3/server/main.go new file mode 100644 index 000000000..137845490 --- /dev/null +++ b/_examples/shttp3/server/main.go @@ -0,0 +1,149 @@ +// Copyright 2018 ETH Zurich +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "crypto/rand" + "crypto/rsa" + "crypto/tls" + "crypto/x509" + "encoding/json" + "encoding/pem" + "flag" + "fmt" + "log" + "math/big" + "net/http" + "os" + "time" + + "github.com/gorilla/handlers" + "github.com/netsec-ethz/scion-apps/pkg/shttp3" + "github.com/quic-go/quic-go/http3" +) + +func main() { + certFile := flag.String("cert", "", "Path to TLS server certificate ") + keyFile := flag.String("key", "", "Path to TLS server key ") + flag.Parse() + + m := http.NewServeMux() + + // handler that responds with a friendly greeting + m.HandleFunc("/hello", func(w http.ResponseWriter, r *http.Request) { + // Status 200 OK will be set implicitly + w.Header().Set("Content-Type", "text/plain") + _, _ = w.Write([]byte(`Oh, hello!`)) + }) + + // handler that responds with an image file + m.HandleFunc("/image", func(w http.ResponseWriter, r *http.Request) { + // serve the sample JPG file + // Status 200 OK will be set implicitly + // Content-Length will be inferred by server + // Content-Type will be detected by server + http.ServeFile(w, r, "dog.jpg") + }) + + // GET handler that responds with some json data + m.HandleFunc("/json", func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodGet { + data := struct { + Time string + Agent string + Proto string + Message string + }{ + Time: time.Now().Format("2006.01.02 15:04:05"), + Agent: r.UserAgent(), + Proto: r.Proto, + Message: "success", + } + resp, _ := json.Marshal(data) + w.Header().Set("Content-Type", "application/json") + fmt.Fprint(w, string(resp)) + } else { + http.Error(w, "wrong method: "+r.Method, http.StatusForbidden) + } + }) + + // POST handler that responds by parsing form values and returns them as string + m.HandleFunc("/form", func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodPost { + if err := r.ParseForm(); err != nil { + http.Error(w, "invalid form data", http.StatusBadRequest) + return + } + w.Header().Set("Content-Type", "text/plain") + fmt.Fprint(w, "received following data:\n") + for s := range r.PostForm { + fmt.Fprint(w, s, "=", r.PostFormValue(s), "\n") + } + } else { + http.Error(w, "wrong method: "+r.Method, http.StatusForbidden) + } + }) + + handler := handlers.LoggingHandler(os.Stdout, m) + if *certFile != "" && *keyFile != "" { + go func() { log.Fatal(shttp3.ListenAndServe(":443", *certFile, *keyFile, handler)) }() + } + // if no TLS cert specified + s := &shttp3.Server{ + Server: &http3.Server{ + Addr: ":443", + Handler: handler, + TLSConfig: generateTLSConfig(), + }, + } + + log.Fatal(s.ListenAndServe()) +} + +// Setup a bare-bones TLS config for the server +// from github.com/quic-go/quic-go/example/echo/echo.go +func generateTLSConfig() *tls.Config { + key, err := rsa.GenerateKey(rand.Reader, 1024) + if err != nil { + panic(err) + } + //var uris []*url.URL + //uris = append(uris, &url.URL{Host: "19-ffaa:1:1067,127.0.0.1"}) + var dnsnames []string + dnsnames = append(dnsnames, "19-ffaa:1:1067,127.0.0.1") + + template := x509.Certificate{SerialNumber: big.NewInt(1), + NotAfter: time.Now().Add(24 * time.Hour), + DNSNames: dnsnames, + + //URIs: uris, + } + // 19-ffaa:1:1067,127.0.0.1 + certDER, err := x509.CreateCertificate(rand.Reader, &template, &template, &key.PublicKey, key) + if err != nil { + panic(err) + } + keyPEM := pem.EncodeToMemory(&pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(key)}) + certPEM := pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: certDER}) + + tlsCert, err := tls.X509KeyPair(certPEM, keyPEM) + if err != nil { + panic(err) + } + return &tls.Config{ + Certificates: []tls.Certificate{tlsCert}, + NextProtos: []string{"http3-example"}, + } +} diff --git a/bwtester/bwtestserver/bwtestserver.go b/bwtester/bwtestserver/bwtestserver.go index de4c715f3..948110b72 100644 --- a/bwtester/bwtestserver/bwtestserver.go +++ b/bwtester/bwtestserver/bwtestserver.go @@ -22,7 +22,7 @@ import ( "net" "time" - "gopkg.in/alecthomas/kingpin.v2" + "github.com/alecthomas/kingpin/v2" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/bwtester/bwtest" diff --git a/go.mod b/go.mod index 913dded85..ab0494b6e 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,77 @@ module github.com/netsec-ethz/scion-apps -go 1.16 +go 1.20 require ( - github.com/creack/pty v1.1.17 + github.com/alecthomas/kingpin/v2 v2.3.2 + github.com/creack/pty v1.1.18 github.com/gorilla/handlers v1.5.1 - github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec + github.com/inconshreveable/log15 v2.16.0+incompatible github.com/kormat/fmt15 v0.0.0-20181112140556-ee69fecb2656 - github.com/lucas-clemente/quic-go v0.23.0 - github.com/mattn/go-sqlite3 v1.14.4 - github.com/msteinert/pam v0.0.0-20190215180659-f29b9f28d6f9 + github.com/mattn/go-sqlite3 v1.14.16 + github.com/msteinert/pam v1.1.0 github.com/netsec-ethz/rains v0.5.0 - github.com/pelletier/go-toml v1.9.4 + github.com/pelletier/go-toml v1.9.5 + 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.0.0-20210921155107-089bfa567519 - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 - gopkg.in/alecthomas/kingpin.v2 v2.2.6 - inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e + github.com/smartystreets/goconvey v1.8.0 + github.com/stretchr/testify v1.8.3 + golang.org/x/crypto v0.9.0 + golang.org/x/term v0.8.0 + inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a +) + +require ( + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/antlr/antlr4 v0.0.0-20181218183524-be58ebffde8e // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/britram/borat v0.0.0-20181011130314-f891bcfcfb9b // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/gopacket v1.1.16-0.20190123011826-102d5ca2098c // indirect + github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect + github.com/gopherjs/gopherjs v1.17.2 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect + github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect + github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365 // indirect + github.com/jtolds/gls v4.20.0+incompatible // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/onsi/ginkgo/v2 v2.2.0 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/quic-go/qpack v0.4.0 // indirect + github.com/quic-go/qtls-go1-19 v0.3.2 // indirect + github.com/quic-go/qtls-go1-20 v0.2.2 // indirect + github.com/smartystreets/assertions v1.13.1 // indirect + github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect + github.com/uber/jaeger-lib v2.0.0+incompatible // indirect + github.com/xhit/go-str2duration/v2 v2.1.0 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.17.0 // indirect + go4.org/intern v0.0.0-20211027215823-ae77deb06f29 // indirect + go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect + golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect + golang.org/x/mod v0.9.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/text v0.9.0 // indirect + golang.org/x/tools v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71 // indirect + google.golang.org/grpc v1.40.0 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 46248ad0b..19b3fd887 100644 --- a/go.sum +++ b/go.sum @@ -60,13 +60,15 @@ github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/alecthomas/kingpin/v2 v2.3.2 h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWrKI6ocU= +github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4 v0.0.0-20181218183524-be58ebffde8e h1:yxMh4HIdsSh2EqxUESWvzszYMNzOugRyYCeohfwNULM= @@ -81,7 +83,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -92,11 +93,9 @@ github.com/buildkite/go-buildkite/v2 v2.8.1/go.mod h1:kRCClqF2FuCFK42+Jk8ggYUMMA github.com/cenkalti/backoff v1.1.1-0.20171020064038-309aa717adbf/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -120,8 +119,8 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= -github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -161,7 +160,6 @@ github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -263,8 +261,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -290,6 +288,7 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -299,8 +298,9 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= +github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -350,8 +350,9 @@ github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365 h1:ECW73yc9MY79 github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec h1:CGkYB1Q7DSsH/ku+to+foV4agt2F2miquaLUgF6L178= github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= +github.com/inconshreveable/log15 v2.16.0+incompatible h1:6nvMKxtGcpgm7q0KiGs+Vc+xDvUXaBqsPKHWKsinccw= +github.com/inconshreveable/log15 v2.16.0+incompatible/go.mod h1:cOaXtrgN4ScfRrD9Bre7U1thNq5RtJ8ZoP4iXVGRj6o= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= @@ -401,7 +402,6 @@ github.com/lestrrat-go/httpcc v1.0.0/go.mod h1:tGS/u00Vh5N6FHNkExqGGNId8e0Big+++ github.com/lestrrat-go/iter v1.0.1/go.mod h1:zIdgO1mRKhn8l9vrZJZz9TUMMFbQbLeTsbqPDrJ/OJc= github.com/lestrrat-go/jwx v1.2.7/go.mod h1:bw24IXWbavc0R2RsOtpXL7RtMyP589yZ1+L7kd09ZGA= github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= -github.com/lucas-clemente/quic-go v0.23.0 h1:5vFnKtZ6nHDFsc/F3uuiF4T3y/AXaQdxjUqiVw26GZE= github.com/lucas-clemente/quic-go v0.23.0/go.mod h1:paZuzjXCE5mj6sikVLMvqXk8lJV2AsqtJ6bDhjEfxx0= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -413,12 +413,9 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/marten-seemann/qpack v0.2.1 h1:jvTsT/HpCn2UZJdP+UUB53FfUUgeOyG5K1ns0OJOGVs= github.com/marten-seemann/qpack v0.2.1/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= github.com/marten-seemann/qtls-go1-15 v0.1.4/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= -github.com/marten-seemann/qtls-go1-16 v0.1.4 h1:xbHbOGGhrenVtII6Co8akhLEdrawwB2iHl5yhJRpnco= github.com/marten-seemann/qtls-go1-16 v0.1.4/go.mod h1:gNpI2Ol+lRS3WwSOtIUUtRwZEQMXjYK+dQSBFbethAk= -github.com/marten-seemann/qtls-go1-17 v0.1.0 h1:P9ggrs5xtwiqXv/FHNwntmuLMNq3KaSIG93AtAZ48xk= github.com/marten-seemann/qtls-go1-17 v0.1.0/go.mod h1:fz4HIxByo+LlWcreM4CZOYNuz3taBQ8rN2X6FqvaWo8= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -436,8 +433,9 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-sqlite3 v1.14.4 h1:4rQjbDxdu9fSgI/r3KN72G3c2goxknAqHHgPWWs8UlI= github.com/mattn/go-sqlite3 v1.14.4/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= +github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= @@ -462,8 +460,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/msteinert/pam v0.0.0-20190215180659-f29b9f28d6f9 h1:ZivaaKmjs9q90zi6I4gTLW6tbVGtlBjellr3hMYaly0= -github.com/msteinert/pam v0.0.0-20190215180659-f29b9f28d6f9/go.mod h1:np1wUFZ6tyoke22qDJZY40URn9Ae51gX7ljIWXN5TJs= +github.com/msteinert/pam v1.1.0 h1:VhLun/0n0kQYxiRBJJvVpC2jR6d21SWJFjpvUVj20Kc= +github.com/msteinert/pam v1.1.0/go.mod h1:M4FPeAW8g2ITO68W8gACDz13NDJyOQM9IQsQhrR6TOI= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -473,7 +471,6 @@ github.com/netsec-ethz/rains v0.5.0 h1:5x+C7aIVZNLtlonyA5JWUXR+MQXMuJzxK8PwnLWQV github.com/netsec-ethz/rains v0.5.0/go.mod h1:+H9/DeJoYmFtcpLqFUJFQgALVWO675XdBZJdALL5ltU= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -483,15 +480,16 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.2.0 h1:3ZNA3L1c5FYDFTTxbFeVGGD8jYvjYauHD30YgLxVsNI= +github.com/onsi/ginkgo/v2 v2.2.0/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= +github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -502,8 +500,9 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/patrickmn/go-cache v2.1.1-0.20180815053127-5633e0862627+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -542,6 +541,14 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= +github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/qtls-go1-19 v0.3.2 h1:tFxjCFcTQzK+oMxG6Zcvp4Dq8dx4yD3dDiIiyc86Z5U= +github.com/quic-go/qtls-go1-19 v0.3.2/go.mod h1:ySOI96ew8lnoKPtSqx2BlI5wCpUVPT05RMAlajtnyOI= +github.com/quic-go/qtls-go1-20 v0.2.2 h1:WLOPx6OY/hxtTxKV1Zrq20FtXtDEkeY00CGQm8GEa3E= +github.com/quic-go/qtls-go1-20 v0.2.2/go.mod h1:JKtK6mjbAVcUTN/9jZpvLbGxvdWIKS8uT7EiStoU1SM= +github.com/quic-go/quic-go v0.34.0 h1:OvOJ9LFjTySgwOTYUZmNoq0FzVicP8YujpV0kB7m2lU= +github.com/quic-go/quic-go v0.34.0/go.mod h1:+4CVgVppm0FNjpG3UcX8Joi/frKOH7/ciD5yGcwOO1g= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -586,11 +593,13 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= +github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= +github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3hlSdrBH/b3SdnW/LMY= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.7 h1:I6tZjLXD2Q1kjvNbIzB1wvQBsXmKXiVrhpRE8ZjP5jY= github.com/smartystreets/goconvey v1.6.7/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL+JXWq3w= +github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/songgao/water v0.0.0-20190725173103-fd331bda3f4b/go.mod h1:P5HUIBuIWKbyjl083/loAegFkfbFNx5i2qEP4CNbm7E= github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= @@ -613,15 +622,16 @@ github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -644,6 +654,8 @@ github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1 github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= +github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -674,13 +686,15 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -go4.org/intern v0.0.0-20210108033219-3eb7198706b2 h1:VFTf+jjIgsldaz/Mr00VaCSswHJrI2hIjQygE/W4IMg= go4.org/intern v0.0.0-20210108033219-3eb7198706b2/go.mod h1:vLqJ+12kCw61iCWsPto0EOHhBS+o4rO5VIucbc9g2Cc= +go4.org/intern v0.0.0-20211027215823-ae77deb06f29 h1:UXLjNohABv4S58tHmeuIZDO6e3mHpW2Dx33gaNt03LE= +go4.org/intern v0.0.0-20211027215823-ae77deb06f29/go.mod h1:cS2ma+47FKrLPdXFpr7CuxiTW3eyJbWew4qx0qtQWDA= go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222175341-b30ae309168e/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= -go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063 h1:1tk03FUNpulq2cuWpXZWj649rwJpk0d20rxWiopKRmc= go4.org/unsafe/assume-no-moving-gc v0.0.0-20201222180813-1025295fd063/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 h1:WJhcL4p+YeDxmZWg141nRm7XC8IDmhz7lk5GpadO1Sg= +go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -699,8 +713,9 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -711,6 +726,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o= +golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -736,8 +753,9 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -789,8 +807,9 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -820,8 +839,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -902,12 +921,14 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211031064116-611d5d643895/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -916,8 +937,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -994,12 +1016,12 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -1146,9 +1168,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1164,7 +1186,6 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1178,8 +1199,9 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1190,8 +1212,9 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e h1:tvgqez5ZQoBBiBAGNU/fmJy247yB/7++kcLOEoMYup0= inet.af/netaddr v0.0.0-20210903134321-85fa6c94624e/go.mod h1:z0nx+Dh+7N7CC8V5ayHtHGpZpxLQZZxkIaaz6HN65Ls= +inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a h1:1XCVEdxrvL6c0TGOhecLuB7U9zYNdxZEjvOqJreKZiM= +inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a/go.mod h1:e83i32mAQOW1LAqEIweALsuK2Uw4mhQadA5r7b0Wobo= k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= diff --git a/netcat/quic.go b/netcat/quic.go index bbf72055d..3da20a1ce 100644 --- a/netcat/quic.go +++ b/netcat/quic.go @@ -18,12 +18,13 @@ import ( "context" "crypto/tls" "io" + "math" - "github.com/lucas-clemente/quic-go" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" "github.com/netsec-ethz/scion-apps/pkg/quicutil" + "github.com/quic-go/quic-go" ) var ( @@ -40,7 +41,7 @@ func DoListenQUIC(port uint16) (chan io.ReadWriteCloser, error) { Certificates: quicutil.MustGenerateSelfSignedCert(), NextProtos: nextProtos, }, - &quic.Config{KeepAlive: true}, + &quic.Config{KeepAlivePeriod: math.MaxInt64}, ) if err != nil { return nil, err @@ -65,7 +66,7 @@ func DoListenQUIC(port uint16) (chan io.ReadWriteCloser, error) { // DoDialQUIC dials with a QUIC socket func DoDialQUIC(remote string, policy pan.Policy) (io.ReadWriteCloser, error) { - remoteAddr, err := pan.ResolveUDPAddr(remote) + remoteAddr, err := pan.ResolveUDPAddr(context.TODO(), remote) if err != nil { return nil, err } @@ -80,7 +81,7 @@ func DoDialQUIC(remote string, policy pan.Policy) (io.ReadWriteCloser, error) { InsecureSkipVerify: true, NextProtos: nextProtos, }, - &quic.Config{KeepAlive: true}, + &quic.Config{KeepAlivePeriod: math.MaxInt64}, ) if err != nil { return nil, err diff --git a/netcat/udp.go b/netcat/udp.go index ec2736b07..ff0a35cc7 100644 --- a/netcat/udp.go +++ b/netcat/udp.go @@ -55,7 +55,7 @@ func (conn *udpListenConn) Close() error { // DoDialUDP dials with a UDP socket func DoDialUDP(remote string, policy pan.Policy) (io.ReadWriteCloser, error) { - remoteAddr, err := pan.ResolveUDPAddr(remote) + remoteAddr, err := pan.ResolveUDPAddr(context.TODO(), remote) if err != nil { return nil, err } diff --git a/pkg/pan/dns_txt.go b/pkg/pan/dns_txt.go new file mode 100644 index 000000000..c08c8eab3 --- /dev/null +++ b/pkg/pan/dns_txt.go @@ -0,0 +1,81 @@ +// Copyright 2022 ETH Zurich +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pan + +import ( + "context" + "errors" + "fmt" + "net" + "strings" +) + +type dnsResolver struct { + res dnsTXTResolver +} + +type dnsTXTResolver interface { + LookupTXT(context.Context, string) ([]string, error) +} + +var _ resolver = &dnsResolver{} + +const scionAddrTXTTag = "scion=" + +// Resolve the name via DNS to return one scionAddr or an error. +func (d *dnsResolver) Resolve(ctx context.Context, name string) (saddr scionAddr, err error) { + addresses, err := d.queryTXTRecord(ctx, name) + if err != nil { + return scionAddr{}, err + } + var perr error + for _, addr := range addresses { + saddr, perr = parseSCIONAddr(addr) + if perr == nil { + return saddr, nil + } + } + return scionAddr{}, fmt.Errorf("error parsing TXT SCION address records: %w", perr) +} + +// queryTXTRecord queries the DNS for DNS TXT record(s) specifying the SCION address(es) for host. +// Returns either at least one address, or else an error, of type HostNotFoundError if no matching record was found. +func (d *dnsResolver) queryTXTRecord(ctx context.Context, host string) (addresses []string, err error) { + if d.res == nil { + return addresses, fmt.Errorf("invalid DNS resolver: %v", d.res) + } + if !strings.HasSuffix(host, ".") { + host += "." + } + txtRecords, err := d.res.LookupTXT(ctx, host) + var errDNSError *net.DNSError + if errors.As(err, &errDNSError) { + if errDNSError.IsNotFound { + return addresses, HostNotFoundError{Host: host} + } + } + if err != nil { + return addresses, err + } + for _, txt := range txtRecords { + if strings.HasPrefix(txt, scionAddrTXTTag) { + addresses = append(addresses, strings.TrimPrefix(txt, scionAddrTXTTag)) + } + } + if len(addresses) == 0 { + return addresses, HostNotFoundError{Host: host} + } + return addresses, nil +} diff --git a/pkg/pan/dns_txt_test.go b/pkg/pan/dns_txt_test.go new file mode 100644 index 000000000..c30409249 --- /dev/null +++ b/pkg/pan/dns_txt_test.go @@ -0,0 +1,99 @@ +// Copyright 2022 ETH Zurich +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package pan + +import ( + "context" + "net" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestDNSResolver(t *testing.T) { + cases := []struct { + name string + assertErr assert.ErrorAssertionFunc + expected scionAddr + }{ + {"example.com", assert.NoError, mustParse("1-ff00:0:f00,[192.0.2.1]")}, + {"example.net", assert.NoError, mustParse("1-ff00:0:ba5,[192.0.2.38]")}, + {"example.org", assert.Error, scionAddr{}}, + {"noia.example.org", assert.Error, scionAddr{}}, + {"noip.example.org", assert.Error, scionAddr{}}, + {"trailing.example.org", assert.Error, scionAddr{}}, + {"example.edu", assertErrHostNotFound, scionAddr{}}, + {"empty.example.edu", assertErrHostNotFound, scionAddr{}}, + {"dummy4", assertErrHostNotFound, scionAddr{}}, + {"barbaz", assertErrHostNotFound, scionAddr{}}, + } + var m mockResolver + resolver := &dnsResolver{res: &m} + for _, c := range cases { + actual, err := resolver.Resolve(context.TODO(), c.name) + if !c.assertErr(t, err) { + continue + } + assert.Equal(t, c.expected, actual) + } +} + +func TestDNSResolverInvalid(t *testing.T) { + r := &dnsResolver{res: nil} + _, err := r.Resolve(context.TODO(), "example.com") + assert.Error(t, err) +} + +type mockResolver struct { + net.Resolver +} + +// LookupTXT mocks requesting the DNS TXT records for the given domain name. +func (r *mockResolver) LookupTXT(ctx context.Context, name string) ([]string, error) { + v, ok := map[string][]string{ + "example.com.": { + "NS=ns74430548", + "doodle-site-verification=t4SRCkhsSDk_Ec9BPAr4xWQvYqoYJSLuoMmWLBdKqS0", + "scion=1-ff00:0:f00,[192.0.2.1]", + }, + "example.net.": { + "scion=1-ff00:0:ba5,[192.0.2.38]", + "BOOM_verify_3ovqPKkST76TzF2c7b13YA", + "v=spf1 include:_id.example.net ip4:192.0.2.38 ip4:192.0.2.197 ~all", + }, + "example.org.": { + "scion=1-ff00:0:invalid,[192.0.2.1]", + }, + "noip.example.org.": { + "scion=1-ff00:0:f01", + }, + "noia.example.org.": { + "scion=192.0.2.100", + }, + "trailing.example.org.": { + "scion=1-ff00:0:f01,[192.0.2.100] something more", + }, + "example.edu.": { + "v=spf1 include:_id.example.org ip4:192.0.2.203 ip4:192.0.2.213 ~all", + }, + "empty.example.edu.": { + "", + }, + }[name] + if !ok { + return nil, &net.DNSError{IsNotFound: true} + } + return v, nil +} diff --git a/pkg/pan/hosts.go b/pkg/pan/hosts.go index adaf37474..99d5f36c7 100644 --- a/pkg/pan/hosts.go +++ b/pkg/pan/hosts.go @@ -15,7 +15,9 @@ package pan import ( + "context" "errors" + "fmt" "net" "strconv" ) @@ -24,13 +26,14 @@ var ( resolveEtcHosts resolver = &hostsfileResolver{"/etc/hosts"} resolveEtcScionHosts resolver = &hostsfileResolver{"/etc/scion/hosts"} resolveRains resolver = nil + resolveDNSTxt resolver = &dnsResolver{net.DefaultResolver} ) // resolveUDPAddrAt parses the address and resolves the hostname. // The address can be of the form of a SCION address (i.e. of the form "ISD-AS,[IP]:port") // or in the form of "hostname:port". // If the address is in the form of a hostname, resolver is used to resolve the name. -func resolveUDPAddrAt(address string, resolver resolver) (UDPAddr, error) { +func resolveUDPAddrAt(ctx context.Context, address string, resolver resolver) (UDPAddr, error) { raddr, err := ParseUDPAddr(address) if err == nil { return raddr, nil @@ -43,7 +46,7 @@ func resolveUDPAddrAt(address string, resolver resolver) (UDPAddr, error) { if err != nil { return UDPAddr{}, err } - host, err := resolver.Resolve(hostStr) + host, err := resolver.Resolve(ctx, hostStr) if err != nil { return UDPAddr{}, err } @@ -56,40 +59,55 @@ func resolveUDPAddrAt(address string, resolver resolver) (UDPAddr, error) { // // - /etc/hosts // - /etc/scion/hosts -// - RAINS, if a server is configured in /etc/scion/rains.cfg. -// Disabled if built with !norains. +// - RAINS, if a server is configured in /etc/scion/rains.cfg. Disabled if built with !norains. +// - DNS TXT records using the local DNS resolver (depending on OS config, see "Name Resolution" in net package docs) func defaultResolver() resolver { return resolverList{ resolveEtcHosts, resolveEtcScionHosts, resolveRains, + resolveDNSTxt, } } // resolver is the interface to resolve a host name to a SCION host address. -// Currently, this is implemented for reading a hosts file and RAINS +// Currently, this is implemented for reading the system hosts file, a SCION specific hosts file, +// RAINS, and DNS TXT records for SCION of the format "scion=ia,ip" type resolver interface { // Resolve finds an address for the name. // Returns a HostNotFoundError if the name was not found, but otherwise no // error occurred. - Resolve(name string) (scionAddr, error) + Resolve(ctx context.Context, name string) (scionAddr, error) } // resolverList represents a list of Resolvers that are processed in sequence // to return the first match. type resolverList []resolver -func (resolvers resolverList) Resolve(name string) (scionAddr, error) { +func (resolvers resolverList) Resolve(ctx context.Context, name string) (scionAddr, error) { var errHostNotFound HostNotFoundError + var rerr error for _, resolver := range resolvers { - if resolver != nil { - addr, err := resolver.Resolve(name) - if err == nil { - return addr, nil - } else if !errors.As(err, &errHostNotFound) { - return addr, err - } + if resolver == nil { + // skip RAINS resolver when disabled + continue } + // check ctx to avoid unnecessary calls with already expired context + if err := ctx.Err(); err != nil { + rerr = err + break + } + addr, err := resolver.Resolve(ctx, name) + if err == nil { + return addr, nil + } else if !errors.As(err, &errHostNotFound) { + // do not directly fail on first resolver error + rerr = err + } + } + if rerr != nil { + // fmt.Fprintf(os.Stderr, "pan library: resolver error: %w", rerr) + return scionAddr{}, fmt.Errorf("pan library: resolver error: %w", rerr) } return scionAddr{}, HostNotFoundError{name} } diff --git a/pkg/pan/hosts_test.go b/pkg/pan/hosts_test.go index 5ae0bc2c7..811cd7951 100644 --- a/pkg/pan/hosts_test.go +++ b/pkg/pan/hosts_test.go @@ -15,6 +15,7 @@ package pan import ( + "context" "fmt" "testing" @@ -53,7 +54,7 @@ func TestHostsfileResolver(t *testing.T) { {"foobar", assertErrHostNotFound, scionAddr{}}, } for _, c := range cases { - actual, err := resolver.Resolve(c.name) + actual, err := resolver.Resolve(context.TODO(), c.name) if !c.assertErr(t, err) { continue } @@ -63,7 +64,7 @@ func TestHostsfileResolver(t *testing.T) { func TestHostsfileResolverNonexisting(t *testing.T) { resolver := &hostsfileResolver{"non_existing_hosts_file"} - _, err := resolver.Resolve("something") + _, err := resolver.Resolve(context.TODO(), "something") assert.Error(t, err) } @@ -92,7 +93,7 @@ func TestResolverList(t *testing.T) { {"boo", assertErrHostNotFound, scionAddr{}}, } for _, c := range cases { - actual, err := resolver.Resolve(c.name) + actual, err := resolver.Resolve(context.TODO(), c.name) c.assertErr(t, err) assert.Equal(t, c.expected, actual) } @@ -107,7 +108,9 @@ type dummyResolver struct { hosts map[string]scionAddr } -func (r dummyResolver) Resolve(name string) (scionAddr, error) { +var _ resolver = &dummyResolver{} + +func (r dummyResolver) Resolve(ctx context.Context, name string) (scionAddr, error) { if h, ok := r.hosts[name]; ok { return h, nil } else { diff --git a/pkg/pan/hostsfile.go b/pkg/pan/hostsfile.go index bfe57cf13..040a4d43c 100644 --- a/pkg/pan/hostsfile.go +++ b/pkg/pan/hostsfile.go @@ -16,6 +16,7 @@ package pan import ( "bufio" + "context" "fmt" "os" "strings" @@ -29,7 +30,7 @@ type hostsfileResolver struct { path string } -func (r *hostsfileResolver) Resolve(name string) (scionAddr, error) { +func (r *hostsfileResolver) Resolve(ctx context.Context, name string) (scionAddr, error) { // Note: obviously not perfectly elegant to parse the entire file for // every query. However, properly caching this and still always provide // fresh results after changes to the hosts file seems like a bigger task and diff --git a/pkg/pan/pan.go b/pkg/pan/pan.go index 4e5b0ddee..11af19331 100644 --- a/pkg/pan/pan.go +++ b/pkg/pan/pan.go @@ -103,6 +103,7 @@ Notes package pan import ( + "context" "fmt" ) @@ -114,12 +115,12 @@ import ( // // - /etc/hosts // - /etc/scion/hosts -// - RAINS, if a server is configured in /etc/scion/rains.cfg. -// Disabled if built with !norains. +// - RAINS, if a server is configured in /etc/scion/rains.cfg. Disabled if built with !norains. +// - DNS TXT records using the local DNS resolver (depending on OS config, see "Name Resolution" in net package docs) // // Returns HostNotFoundError if none of the sources did resolve the hostname. -func ResolveUDPAddr(address string) (UDPAddr, error) { - return resolveUDPAddrAt(address, defaultResolver()) +func ResolveUDPAddr(ctx context.Context, address string) (UDPAddr, error) { + return resolveUDPAddrAt(ctx, address, defaultResolver()) } // HostNotFoundError is returned by ResolveUDPAddr when the name was not found, but diff --git a/pkg/pan/quic_dial.go b/pkg/pan/quic_dial.go index 88a6b37e3..e4458b20c 100644 --- a/pkg/pan/quic_dial.go +++ b/pkg/pan/quic_dial.go @@ -19,31 +19,31 @@ import ( "crypto/tls" "net" - "github.com/lucas-clemente/quic-go" + "github.com/quic-go/quic-go" "inet.af/netaddr" ) // QUICSession is a wrapper around quic.Session that always closes the // underlying conn when closing the session. type QUICSession struct { - quic.Session + quic.Connection Conn Conn } func (s *QUICSession) CloseWithError(code quic.ApplicationErrorCode, desc string) error { - err := s.Session.CloseWithError(code, desc) + err := s.Connection.CloseWithError(code, desc) s.Conn.Close() return err } // QUICEarlySession is a wrapper around quic.EarlySession, analogous to closerSession type QUICEarlySession struct { - quic.EarlySession + quic.EarlyConnection Conn Conn } func (s *QUICEarlySession) CloseWithError(code quic.ApplicationErrorCode, desc string) error { - err := s.EarlySession.CloseWithError(code, desc) + err := s.EarlyConnection.CloseWithError(code, desc) s.Conn.Close() return err } diff --git a/pkg/pan/quic_listen.go b/pkg/pan/quic_listen.go index 748034290..316ab5e74 100644 --- a/pkg/pan/quic_listen.go +++ b/pkg/pan/quic_listen.go @@ -19,7 +19,8 @@ import ( "crypto/tls" "net" - "github.com/lucas-clemente/quic-go" + //"github.com/netsec-ethz/scion-apps/pkg/pan" + "github.com/quic-go/quic-go" "inet.af/netaddr" ) @@ -30,6 +31,14 @@ type closerListener struct { conn net.PacketConn } +// Addr returns the local network addr that the server is listening on. +func (l closerListener) Addr() net.Addr { + if c, ok := l.conn.(ListenConn); ok { + return c.LocalAddr() + } + return quic.Listener.Addr(l) +} + func (l closerListener) Close() error { err := l.Listener.Close() l.conn.Close() @@ -60,3 +69,18 @@ func ListenQUIC(ctx context.Context, local netaddr.IPPort, selector ReplySelecto conn: conn, }, nil } + +func ListenQUIC2(conn net.PacketConn, tlsConf *tls.Config, quicConfig *quic.Config) (quic.Listener, error) { + // conn has to be a pan.ListenConn created by pan.ListenUDP + + listener, err := quic.Listen(conn, tlsConf, quicConfig) + if err != nil { + conn.Close() + return nil, err + } + return closerListener{ + Listener: listener, + conn: conn, + }, nil + +} diff --git a/pkg/pan/rains.go b/pkg/pan/rains.go index 48b65fc2e..cd488ab87 100644 --- a/pkg/pan/rains.go +++ b/pkg/pan/rains.go @@ -18,8 +18,10 @@ package pan import ( + "context" "fmt" "io/ioutil" + "net" "os" "strings" "time" @@ -35,7 +37,9 @@ func init() { type rainsResolver struct{} -func (r *rainsResolver) Resolve(name string) (scionAddr, error) { +var _ resolver = &rainsResolver{} + +func (r *rainsResolver) Resolve(ctx context.Context, name string) (scionAddr, error) { server, err := readRainsConfig() if err != nil { return scionAddr{}, err @@ -44,7 +48,7 @@ func (r *rainsResolver) Resolve(name string) (scionAddr, error) { // nobody to ask, so we won't get a reply return scionAddr{}, HostNotFoundError{name} } - return rainsQuery(server, name) + return rainsQuery(ctx, server, name) } func readRainsConfig() (UDPAddr, error) { @@ -61,24 +65,22 @@ func readRainsConfig() (UDPAddr, error) { return address, nil } -func rainsQuery(server UDPAddr, hostname string) (scionAddr, error) { +func rainsQuery(ctx context.Context, server UDPAddr, hostname string) (scionAddr, error) { const ( - ctx = "." // use global context - qType = rains.OTScionAddr // request SCION addresses - expire = 5 * time.Minute // sensible expiry date? - timeout = 500 * time.Millisecond // timeout for query + rainsCtx = "." // use global context + qType = rains.OTScionAddr // request SCION addresses + expire = 5 * time.Minute // sensible expiry date? + timeout = 500 * time.Millisecond // timeout for query ) qOpts := []rains.Option{} // no options - // TODO(matzf): check that this actually works - // - return error on timeout, network problems, invalid format, ... - // - return HostNotFoundError error if all went well, but host not found // TODO(chaehni): This call can sometimes cause a timeout even though the server is reachable (see issue #221) - // The timeout value has been decreased to counter this behavior until the problem is resolved. + // The (default) timeout value has been decreased to counter this behavior until the problem is resolved. srv := server.snetUDPAddr() - reply, err := rains.Query(hostname, ctx, []rains.Type{qType}, qOpts, expire, timeout, srv) + + reply, err := rainsQueryChecked(ctx, hostname, rainsCtx, []rains.Type{qType}, qOpts, expire, timeout, srv) if err != nil { - return scionAddr{}, fmt.Errorf("address for host %q not found: %w", hostname, err) + return scionAddr{}, err } addrStr, ok := reply[qType] if !ok { @@ -90,3 +92,30 @@ func rainsQuery(server UDPAddr, hostname string) (scionAddr, error) { } return addr, nil } + +func rainsQueryChecked(ctx context.Context, name, rainsCtx string, types []rains.Type, opts []rains.Option, + expire, timeout time.Duration, addr net.Addr) (res map[rains.Type]string, err error) { + + var contextTimeout time.Duration + deadline, finite := ctx.Deadline() + if finite { + contextTimeout = time.Until(deadline) + if contextTimeout < 0 { + return res, context.DeadlineExceeded + } + } else { + contextTimeout = timeout + } + + done := make(chan struct{}) + go func() { + defer close(done) + res, err = rains.Query(name, rainsCtx, types, opts, expire, contextTimeout, addr) + }() + select { + case <-ctx.Done(): + return res, ctx.Err() + case <-done: + } + return +} diff --git a/pkg/quicutil/single.go b/pkg/quicutil/single.go index 8b6fc0e3f..e775915e5 100644 --- a/pkg/quicutil/single.go +++ b/pkg/quicutil/single.go @@ -22,7 +22,7 @@ import ( "sync" "time" - "github.com/lucas-clemente/quic-go" + "github.com/quic-go/quic-go" ) var ( @@ -65,12 +65,12 @@ func (l SingleStreamListener) Accept() (net.Conn, error) { // intending to be a drop-in replacement for TCP. // A SingleStream is either created by // -// - on the client side: quic.Dial and then immediately NewSingleStream(sess) -// with the obtained session -// - on the listener side: quic.Listener wrapped in SingleStreamListener, which -// returns SingleStream from Accept. +// - on the client side: quic.Dial and then immediately NewSingleStream(sess) +// with the obtained session +// - on the listener side: quic.Listener wrapped in SingleStreamListener, which +// returns SingleStream from Accept. type SingleStream struct { - Session quic.Session + Session quic.Connection sendStream quic.SendStream receiveStream quic.ReceiveStream readDeadline time.Time @@ -78,7 +78,7 @@ type SingleStream struct { onceOK sync.Once } -func NewSingleStream(session quic.Session) (*SingleStream, error) { +func NewSingleStream(session quic.Connection) (*SingleStream, error) { sendStream, err := session.OpenUniStream() if err != nil { return nil, err diff --git a/pkg/shttp/transport.go b/pkg/shttp/transport.go index 85ed07fec..795d96357 100644 --- a/pkg/shttp/transport.go +++ b/pkg/shttp/transport.go @@ -23,11 +23,11 @@ import ( "regexp" "time" - "github.com/lucas-clemente/quic-go" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" "github.com/netsec-ethz/scion-apps/pkg/quicutil" + "github.com/quic-go/quic-go" ) // DefaultTransport is the default RoundTripper that can be used for HTTP over @@ -79,7 +79,7 @@ func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Con InsecureSkipVerify: true, } - remote, err := pan.ResolveUDPAddr(pan.UnmangleSCIONAddr(addr)) + remote, err := pan.ResolveUDPAddr(ctx, pan.UnmangleSCIONAddr(addr)) if err != nil { return nil, err } diff --git a/pkg/shttp3/server.go b/pkg/shttp3/server.go index b2b29a3ca..03abf7ff1 100644 --- a/pkg/shttp3/server.go +++ b/pkg/shttp3/server.go @@ -20,7 +20,7 @@ import ( "net" "net/http" - "github.com/lucas-clemente/quic-go/http3" + "github.com/quic-go/quic-go/http3" "github.com/netsec-ethz/scion-apps/pkg/pan" ) @@ -42,12 +42,10 @@ func ListenAndServe(addr string, certFile, keyFile string, handler http.Handler) } s := &Server{ Server: &http3.Server{ - Server: &http.Server{ - Addr: addr, - Handler: handler, - TLSConfig: &tls.Config{ - Certificates: certs, - }, + Addr: addr, + Handler: handler, + TLSConfig: &tls.Config{ + Certificates: certs, }, }, } diff --git a/pkg/shttp3/transport.go b/pkg/shttp3/transport.go index dbe73076d..b5690999b 100644 --- a/pkg/shttp3/transport.go +++ b/pkg/shttp3/transport.go @@ -20,8 +20,8 @@ import ( "context" "crypto/tls" - "github.com/lucas-clemente/quic-go" - "github.com/lucas-clemente/quic-go/http3" + "github.com/quic-go/quic-go" + "github.com/quic-go/quic-go/http3" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" @@ -32,7 +32,7 @@ import ( var DefaultTransport = &http3.RoundTripper{ Dial: (&Dialer{ Policy: nil, - }).Dial, + }).DialContext, } // Dialer dials a QUIC connection over SCION. @@ -44,14 +44,14 @@ type Dialer struct { } // Dial dials a QUIC connection over SCION. -func (d *Dialer) Dial(network, addr string, tlsCfg *tls.Config, - cfg *quic.Config) (quic.EarlySession, error) { +func (d *Dialer) DialContext(ctx context.Context, addr string, tlsCfg *tls.Config, + cfg *quic.Config) (quic.EarlyConnection, error) { - remote, err := pan.ResolveUDPAddr(pan.UnmangleSCIONAddr(addr)) + remote, err := pan.ResolveUDPAddr(ctx, pan.UnmangleSCIONAddr(addr)) if err != nil { return nil, err } - session, err := pan.DialQUICEarly(context.TODO(), d.Local, remote, d.Policy, nil, addr, tlsCfg, cfg) + session, err := pan.DialQUICEarly(ctx, d.Local, remote, d.Policy, nil, addr, tlsCfg, cfg) if err != nil { return nil, err } diff --git a/sensorapp/sensorfetcher/sensorfetcher.go b/sensorapp/sensorfetcher/sensorfetcher.go index 00524edeb..67c11fc28 100644 --- a/sensorapp/sensorfetcher/sensorfetcher.go +++ b/sensorapp/sensorfetcher/sensorfetcher.go @@ -53,7 +53,7 @@ func main() { policy, err := pan.PolicyFromCommandline(*sequence, *preference, *interactive) check(err) - serverAddr, err := pan.ResolveUDPAddr(*serverAddrStr) + serverAddr, err := pan.ResolveUDPAddr(context.TODO(), *serverAddrStr) check(err) conn, err := pan.DialUDP(context.Background(), netaddr.IPPort{}, serverAddr, policy, nil) check(err) diff --git a/skip/main.go b/skip/main.go index 05d139859..0bbe49dee 100644 --- a/skip/main.go +++ b/skip/main.go @@ -28,13 +28,15 @@ import ( "log" "net" "net/http" + "net/url" "os" "regexp" "strings" "text/template" + "time" + "github.com/alecthomas/kingpin/v2" "github.com/gorilla/handlers" - "gopkg.in/alecthomas/kingpin.v2" "github.com/netsec-ethz/scion-apps/pkg/pan" "github.com/netsec-ethz/scion-apps/pkg/shttp" @@ -80,6 +82,9 @@ func main() { apiMux := http.NewServeMux() apiMux.HandleFunc("/skip.pac", handleWPAD) apiMux.HandleFunc("/scionHosts", handleHostListRequest) + apiMux.HandleFunc("/r", handleRedirectBackOrError) + + apiMux.HandleFunc("/resolve", handleHostResolutionRequest) apiMux.Handle("/setPolicy", policyHandler) mux.Handle("localhost/", apiMux) @@ -126,6 +131,88 @@ func handleHostListRequest(w http.ResponseWriter, req *http.Request) { _, _ = w.Write(buf.Bytes()) } +func handleRedirectBackOrError(w http.ResponseWriter, req *http.Request) { + + if req.Method != http.MethodGet { + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + return + } + + // We need this here, it's required for redirecting properly + // We may set localhost here but this would stop us from + // running one skip for multiple clients later... + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + q := req.URL.Query() + + urls, ok := q["url"] + if !ok || len(urls) != 1 { + http.Error(w, "Bad request", http.StatusBadRequest) + return + } + url, err := url.Parse(urls[0]) + if err != nil { + fmt.Println(err) + http.Error(w, "Bad request", http.StatusBadRequest) + return + } + + hostPort := url.Host + ":0" + + w.Header().Set("Location", url.String()) + _, err = pan.ResolveUDPAddr(req.Context(), hostPort) + if err != nil { + fmt.Println("verbose: ", err.Error()) + http.Error(w, "Internal error", http.StatusInternalServerError) + return + } + + http.Redirect(w, req, url.String(), http.StatusMovedPermanently) +} + +// handleHostResolutionRequest parses requests in the form: /resolve?host=XXX +// If the PAN lib cannot resolve the host, it sends back an empty response. +func handleHostResolutionRequest(w http.ResponseWriter, req *http.Request) { + if req.Method != http.MethodGet { + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + return + } + buf := &bytes.Buffer{} + q := req.URL.Query() + hosts, ok := q["host"] + if !ok || len(hosts) > 1 { + http.Error(w, "Bad request", http.StatusBadRequest) + return + } + hostPort := hosts[0] + ":0" + + res, err := pan.ResolveUDPAddr(req.Context(), hostPort) + if err != nil { + fmt.Println("verbose: ", err.Error()) + ok := errors.As(err, &pan.HostNotFoundError{}) + if !ok { + http.Error(w, "Internal error", http.StatusInternalServerError) + } + return + } + buf.WriteString(strings.TrimRight(res.String(), ":0")) + w.WriteHeader(http.StatusOK) + _, _ = w.Write(buf.Bytes()) +} + +func isSCIONEnabled(ctx context.Context, host string) (bool, error) { + _, err := pan.ResolveUDPAddr(ctx, host) + if err != nil { + fmt.Println("verbose: ", err.Error()) + ok := errors.As(err, &pan.HostNotFoundError{}) + if !ok { + return false, err + } + return false, nil + } + return true, nil +} + type policyHandler struct { output interface{ SetPolicy(pan.Policy) } } @@ -201,11 +288,20 @@ type tunnelHandler struct { } func (h *tunnelHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { - destConn, err := h.dialer.DialContext(context.Background(), "", req.Host) + hostPort := req.Host + var destConn net.Conn + var err error + enabled, _ := isSCIONEnabled(req.Context(), hostPort) + if !enabled { + // CONNECT via TCP/IP + destConn, err = net.DialTimeout("tcp", req.Host, 10*time.Second) + } else { + // CONNECT via SCION + destConn, err = h.dialer.DialContext(context.Background(), "", req.Host) + } if err != nil { fmt.Println("verbose: ", err.Error()) http.Error(w, err.Error(), http.StatusServiceUnavailable) - return } w.WriteHeader(http.StatusOK) @@ -225,6 +321,7 @@ func (h *tunnelHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { } go transfer(destConn, clientConn) go transfer(clientConn, destConn) + } func transfer(dst io.WriteCloser, src io.ReadCloser) { diff --git a/ssh/client/main.go b/ssh/client/main.go index 2a0272f02..88cec504a 100644 --- a/ssh/client/main.go +++ b/ssh/client/main.go @@ -24,9 +24,9 @@ import ( "strconv" "strings" + "github.com/alecthomas/kingpin/v2" log "github.com/inconshreveable/log15" "golang.org/x/term" - "gopkg.in/alecthomas/kingpin.v2" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" diff --git a/ssh/client/ssh/scion.go b/ssh/client/ssh/scion.go index 0108b9d98..a1b6f2e5a 100644 --- a/ssh/client/ssh/scion.go +++ b/ssh/client/ssh/scion.go @@ -17,13 +17,14 @@ package ssh import ( "context" "crypto/tls" + "math" - "github.com/lucas-clemente/quic-go" "golang.org/x/crypto/ssh" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" "github.com/netsec-ethz/scion-apps/pkg/quicutil" + "github.com/quic-go/quic-go" ) // dialSCION starts a client connection to the given SSH server over SCION using QUIC. @@ -33,7 +34,7 @@ func dialSCION(ctx context.Context, selector string, config *ssh.ClientConfig) (*ssh.Client, error) { - remote, err := pan.ResolveUDPAddr(addr) + remote, err := pan.ResolveUDPAddr(ctx, addr) if err != nil { return nil, err } @@ -46,7 +47,7 @@ func dialSCION(ctx context.Context, InsecureSkipVerify: true, } quicConf := &quic.Config{ - KeepAlive: true, + KeepAlivePeriod: math.MaxInt64, } sess, err := pan.DialQUIC(ctx, netaddr.IPPort{}, remote, policy, sel, "", tlsConf, quicConf) if err != nil { diff --git a/ssh/server/main.go b/ssh/server/main.go index 5c19eb2af..eb83b5ecd 100644 --- a/ssh/server/main.go +++ b/ssh/server/main.go @@ -21,8 +21,8 @@ import ( "os" "strconv" + "github.com/alecthomas/kingpin/v2" log "github.com/inconshreveable/log15" - "gopkg.in/alecthomas/kingpin.v2" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" diff --git a/ssh/server/ssh/tunnelchannel.go b/ssh/server/ssh/tunnelchannel.go index 1ff8a4c6f..afda08fa0 100644 --- a/ssh/server/ssh/tunnelchannel.go +++ b/ssh/server/ssh/tunnelchannel.go @@ -83,7 +83,7 @@ func handleSCIONQUICTunnel(perms *ssh.Permissions, newChannel ssh.NewChannel) er go ssh.DiscardRequests(requests) ctx := context.Background() - remote, err := pan.ResolveUDPAddr(address) + remote, err := pan.ResolveUDPAddr(context.TODO(), address) if err != nil { return fmt.Errorf("could not resolve remote address: %w", err) } diff --git a/web-gateway/main.go b/web-gateway/main.go index f02232a1a..9f70756f4 100644 --- a/web-gateway/main.go +++ b/web-gateway/main.go @@ -28,9 +28,9 @@ import ( "os" "time" + "github.com/alecthomas/kingpin/v2" "github.com/gorilla/handlers" - "github.com/lucas-clemente/quic-go" - "gopkg.in/alecthomas/kingpin.v2" + "github.com/quic-go/quic-go" "inet.af/netaddr" "github.com/netsec-ethz/scion-apps/pkg/pan" @@ -101,7 +101,7 @@ func forwardTLS(hosts map[string]struct{}) error { // forwardTLS forwards traffic for sess to the corresponding TCP/IP host // identified by SNI. -func forwardTLSSession(hosts map[string]struct{}, sess quic.Session) { +func forwardTLSSession(hosts map[string]struct{}, sess quic.Connection) { clientConn, err := quicutil.NewSingleStream(sess) if err != nil { return