diff --git a/Gopkg.lock b/Gopkg.lock index e66f3aa..51b4526 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -37,20 +37,20 @@ "internal", "redis" ] - revision = "d1ed5c67e5794de818ea85e6b522fda02623a484" - version = "v1.4.0" + revision = "a69d19351219b6dd56f274f96d85a7014a2ec34e" + version = "v1.6.0" [[projects]] branch = "master" name = "github.com/gin-contrib/multitemplate" packages = ["."] - revision = "bbc6daf6024bc4c48f334a0490321cd48a24da3d" + revision = "d2d1ac3f563eac04b11ba01db7ac9f0eb9dc3a94" [[projects]] branch = "master" name = "github.com/gin-contrib/sessions" packages = ["."] - revision = "cccdeef56346e7037ca92de250c2b55ef5e7ffe3" + revision = "fda3be6efa2da56e31a1a72bffd65279191e8009" [[projects]] branch = "master" @@ -69,10 +69,10 @@ version = "v1.2" [[projects]] - branch = "master" name = "github.com/golang/protobuf" packages = ["proto"] - revision = "1e59b77b52bf8e4b449a57e6f79f21226d571845" + revision = "925541529c1fa6821df4e44ce2723319eb2be768" + version = "v1.0.0" [[projects]] name = "github.com/gorilla/context" @@ -83,8 +83,8 @@ [[projects]] name = "github.com/gorilla/securecookie" packages = ["."] - revision = "667fe4e3466a040b780561fe9b51a83a3753eefc" - version = "v1.1" + revision = "e59506cc896acb7f7bf732d4fdf5e25f7ccd8983" + version = "v1.1.1" [[projects]] name = "github.com/gorilla/sessions" @@ -102,7 +102,7 @@ branch = "master" name = "github.com/kidstuff/mongostore" packages = ["."] - revision = "256d65ac5b0e35e7c5ebb3f175c0bed1e5c2b253" + revision = "db2a8b4fac1f737c75e7fb84cb3fdb07dfc8fbc9" [[projects]] name = "github.com/mattn/go-isatty" @@ -114,13 +114,13 @@ branch = "master" name = "github.com/microcosm-cc/bluemonday" packages = ["."] - revision = "542fd4642604d0d0c26112396ce5b1a9d01eee0b" + revision = "995366fdf961d03629cd17361bddd32745718e2c" [[projects]] name = "github.com/russross/blackfriday" packages = ["."] - revision = "4048872b16cc0fc2c5fd9eacf0ed2c2fedaa0c8c" - version = "v1.5" + revision = "55d61fa8aa702f59229e6cff85793c22e580eaf5" + version = "v1.5.1" [[projects]] branch = "master" @@ -129,16 +129,16 @@ revision = "dcd61c7d42a11660da3789311050e961c0a5be55" [[projects]] - branch = "master" name = "github.com/schollz/versionedtext" packages = ["."] revision = "1cef32a305b7272d4df0454533de5e4ba67adfc1" + version = "v1.0.0" [[projects]] - branch = "master" name = "github.com/sergi/go-diff" packages = ["diffmatchpatch"] revision = "1744e2970ca51c86172c8190fadad617561ed6e7" + version = "v1.0.0" [[projects]] branch = "master" @@ -155,7 +155,7 @@ "reflectfind", "reflectsource" ] - revision = "004faa6b0118cf52635363b72b51cdcc297800a2" + revision = "47fa5b7ceee66c60ac3a281416089035bf526a3c" [[projects]] branch = "master" @@ -167,7 +167,7 @@ branch = "master" name = "github.com/shurcooL/graphql" packages = ["ident"] - revision = "d0549edd16dceb6939e538fdb1b4f2ec7ee816cc" + revision = "3d276b9dcc6b1e0adf19557a8de5cb8632c07697" [[projects]] branch = "master" @@ -208,8 +208,8 @@ [[projects]] name = "github.com/ugorji/go" packages = ["codec"] - revision = "9831f2c3ac1068a78f50999a30db84270f647af6" - version = "v1.1" + revision = "b4c50a2b199d93b13dc15e78929cfb23bfdf21ab" + version = "v1.1.1" [[projects]] branch = "master" @@ -218,7 +218,7 @@ "bcrypt", "blowfish" ] - revision = "39efaea5da11abd5e2b90a435b1f338cdb94619c" + revision = "e73bf333ef8920dbb52ad18d4bd38ad9d9bc76d7" [[projects]] branch = "master" @@ -227,13 +227,13 @@ "html", "html/atom" ] - revision = "5ccada7d0a7ba9aeb5d3aca8d3501b4c2a509fec" + revision = "5f9ae10d9af5b1c89ae6904293b14b064d4ada23" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix"] - revision = "af50095a40f9041b3b38960738837185c26e9419" + revision = "79b0c6888797020a994db17c8510466c72fe75d9" [[projects]] name = "gopkg.in/go-playground/validator.v8" @@ -260,10 +260,10 @@ version = "v1.20.0" [[projects]] - branch = "v2" name = "gopkg.in/yaml.v2" packages = ["."] - revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" + revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" + version = "v2.2.1" [solve-meta] analyzer-name = "dep" diff --git a/bindata.go b/bindata.go index 5efc0ea..c3851b1 100644 --- a/bindata.go +++ b/bindata.go @@ -131,7 +131,7 @@ func staticCssBaseMinCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/css/base-min.css", size: 2195, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/css/base-min.css", size: 2195, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -151,7 +151,7 @@ func staticCssDefaultCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/css/default.css", size: 2476, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/css/default.css", size: 2476, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -171,7 +171,7 @@ func staticCssDropzoneCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/css/dropzone.css", size: 12587, mode: os.FileMode(436), modTime: time.Unix(1524034905, 0)} + info := bindataFileInfo{name: "static/css/dropzone.css", size: 12587, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -191,7 +191,7 @@ func staticCssGithubMarkdownCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/css/github-markdown.css", size: 11557, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/css/github-markdown.css", size: 11557, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -211,7 +211,7 @@ func staticCssHighlightCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/css/highlight.css", size: 776, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/css/highlight.css", size: 776, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -231,7 +231,7 @@ func staticCssMenusMinCss() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/css/menus-min.css", size: 2471, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/css/menus-min.css", size: 2471, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -251,7 +251,7 @@ func staticImgCowyoAndroidIcon144x144Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/android-icon-144x144.png", size: 6819, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/android-icon-144x144.png", size: 6819, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -271,7 +271,7 @@ func staticImgCowyoAndroidIcon192x192Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/android-icon-192x192.png", size: 8200, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/android-icon-192x192.png", size: 8200, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -291,7 +291,7 @@ func staticImgCowyoAndroidIcon36x36Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/android-icon-36x36.png", size: 1952, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/android-icon-36x36.png", size: 1952, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -311,7 +311,7 @@ func staticImgCowyoAndroidIcon48x48Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/android-icon-48x48.png", size: 2451, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/android-icon-48x48.png", size: 2451, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -331,7 +331,7 @@ func staticImgCowyoAndroidIcon72x72Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/android-icon-72x72.png", size: 3317, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/android-icon-72x72.png", size: 3317, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -351,7 +351,7 @@ func staticImgCowyoAndroidIcon96x96Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/android-icon-96x96.png", size: 4296, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/android-icon-96x96.png", size: 4296, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -371,7 +371,7 @@ func staticImgCowyoAppleIcon114x114Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-114x114.png", size: 5015, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-114x114.png", size: 5015, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -391,7 +391,7 @@ func staticImgCowyoAppleIcon120x120Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-120x120.png", size: 5365, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-120x120.png", size: 5365, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -411,7 +411,7 @@ func staticImgCowyoAppleIcon144x144Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-144x144.png", size: 6819, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-144x144.png", size: 6819, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -431,7 +431,7 @@ func staticImgCowyoAppleIcon152x152Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-152x152.png", size: 7402, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-152x152.png", size: 7402, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -451,7 +451,7 @@ func staticImgCowyoAppleIcon180x180Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-180x180.png", size: 9390, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-180x180.png", size: 9390, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -471,7 +471,7 @@ func staticImgCowyoAppleIcon57x57Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-57x57.png", size: 2792, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-57x57.png", size: 2792, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -491,7 +491,7 @@ func staticImgCowyoAppleIcon60x60Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-60x60.png", size: 2900, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-60x60.png", size: 2900, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -511,7 +511,7 @@ func staticImgCowyoAppleIcon72x72Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-72x72.png", size: 3317, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-72x72.png", size: 3317, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -531,7 +531,7 @@ func staticImgCowyoAppleIcon76x76Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-76x76.png", size: 3474, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-76x76.png", size: 3474, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -551,7 +551,7 @@ func staticImgCowyoAppleIconPrecomposedPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon-precomposed.png", size: 8684, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon-precomposed.png", size: 8684, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -571,7 +571,7 @@ func staticImgCowyoAppleIconPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/apple-icon.png", size: 8684, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/apple-icon.png", size: 8684, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -591,7 +591,7 @@ func staticImgCowyoBrowserconfigXml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/browserconfig.xml", size: 281, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/browserconfig.xml", size: 281, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -611,7 +611,7 @@ func staticImgCowyoFavicon16x16Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/favicon-16x16.png", size: 381, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/favicon-16x16.png", size: 381, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -631,7 +631,7 @@ func staticImgCowyoFavicon32x32Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/favicon-32x32.png", size: 1793, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/favicon-32x32.png", size: 1793, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -651,7 +651,7 @@ func staticImgCowyoFavicon96x96Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/favicon-96x96.png", size: 4296, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/favicon-96x96.png", size: 4296, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -671,7 +671,7 @@ func staticImgCowyoFaviconIco() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/favicon.ico", size: 1150, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/favicon.ico", size: 1150, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -691,7 +691,7 @@ func staticImgCowyoManifestJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/manifest.json", size: 720, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/manifest.json", size: 720, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -711,7 +711,7 @@ func staticImgCowyoMsIcon144x144Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/ms-icon-144x144.png", size: 6819, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/ms-icon-144x144.png", size: 6819, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -731,7 +731,7 @@ func staticImgCowyoMsIcon150x150Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/ms-icon-150x150.png", size: 7255, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/ms-icon-150x150.png", size: 7255, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -751,7 +751,7 @@ func staticImgCowyoMsIcon310x310Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/ms-icon-310x310.png", size: 22194, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/ms-icon-310x310.png", size: 22194, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -771,7 +771,7 @@ func staticImgCowyoMsIcon70x70Png() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/cowyo/ms-icon-70x70.png", size: 3245, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/cowyo/ms-icon-70x70.png", size: 3245, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -791,7 +791,7 @@ func staticImgLogoPng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/img/logo.png", size: 1962, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/img/logo.png", size: 1962, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -811,7 +811,7 @@ func staticJsCowyoJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/js/cowyo.js", size: 13588, mode: os.FileMode(436), modTime: time.Unix(1524196382, 0)} + info := bindataFileInfo{name: "static/js/cowyo.js", size: 13588, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -831,7 +831,7 @@ func staticJsDropzoneJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/js/dropzone.js", size: 120533, mode: os.FileMode(436), modTime: time.Unix(1524034905, 0)} + info := bindataFileInfo{name: "static/js/dropzone.js", size: 120533, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -851,7 +851,7 @@ func staticJsHighlightMinJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/js/highlight.min.js", size: 45164, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/js/highlight.min.js", size: 45164, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -871,7 +871,7 @@ func staticJsHighlightPackJs() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/js/highlight.pack.js", size: 45229, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/js/highlight.pack.js", size: 45229, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -891,7 +891,7 @@ func staticJsJquery183Js() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/js/jquery-1.8.3.js", size: 266057, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/js/jquery-1.8.3.js", size: 266057, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -911,7 +911,7 @@ func staticTextAdjectives() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/adjectives", size: 153332, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/adjectives", size: 153332, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -931,7 +931,7 @@ func staticTextAdjectivesOld() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/adjectives.old", size: 3316, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/adjectives.old", size: 3316, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -951,7 +951,7 @@ func staticTextAnimals() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/animals", size: 7533, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/animals", size: 7533, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -971,7 +971,7 @@ func staticTextAnimalsAll() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/animals.all", size: 47655, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/animals.all", size: 47655, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -991,7 +991,7 @@ func staticTextHowmanyPy() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/howmany.py", size: 639, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/howmany.py", size: 639, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1011,7 +1011,7 @@ func staticTextRobotsTxt() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/robots.txt", size: 64, mode: os.FileMode(436), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/robots.txt", size: 64, mode: os.FileMode(436), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1031,7 +1031,7 @@ func staticTextSitemapXml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static/text/sitemap.xml", size: 293, mode: os.FileMode(509), modTime: time.Unix(1522131184, 0)} + info := bindataFileInfo{name: "static/text/sitemap.xml", size: 293, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1051,7 +1051,7 @@ func templatesIndexTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/index.tmpl", size: 13524, mode: os.FileMode(509), modTime: time.Unix(1524035341, 0)} + info := bindataFileInfo{name: "templates/index.tmpl", size: 13524, mode: os.FileMode(509), modTime: time.Unix(1524397701, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/vendor/github.com/garyburd/redigo/.travis.yml b/vendor/github.com/garyburd/redigo/.travis.yml index 158f161..25d6265 100644 --- a/vendor/github.com/garyburd/redigo/.travis.yml +++ b/vendor/github.com/garyburd/redigo/.travis.yml @@ -5,11 +5,12 @@ services: go: - 1.4 - - 1.5 - - 1.6 - - 1.7 - - 1.8 - - 1.9 + - 1.5.x + - 1.6.x + - 1.7.x + - 1.8.x + - 1.9.x + - 1.10.x - tip script: diff --git a/vendor/github.com/garyburd/redigo/redis/list_test.go b/vendor/github.com/garyburd/redigo/redis/list_test.go new file mode 100644 index 0000000..a1e9d33 --- /dev/null +++ b/vendor/github.com/garyburd/redigo/redis/list_test.go @@ -0,0 +1,85 @@ +// Copyright 2018 Gary Burd +// +// 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. + +// +build go1.9 + +package redis + +import "testing" + +func TestPoolList(t *testing.T) { + var idle idleList + var a, b, c idleConn + + check := func(ics ...*idleConn) { + if idle.count != len(ics) { + t.Fatal("idle.count != len(ics)") + } + if len(ics) == 0 { + if idle.front != nil { + t.Fatalf("front not nil") + } + if idle.back != nil { + t.Fatalf("back not nil") + } + return + } + if idle.front != ics[0] { + t.Fatal("front != ics[0]") + } + if idle.back != ics[len(ics)-1] { + t.Fatal("back != ics[len(ics)-1]") + } + if idle.front.prev != nil { + t.Fatal("front.prev != nil") + } + if idle.back.next != nil { + t.Fatal("back.next != nil") + } + for i := 1; i < len(ics)-1; i++ { + if ics[i-1].next != ics[i] { + t.Fatal("ics[i-1].next != ics[i]") + } + if ics[i+1].prev != ics[i] { + t.Fatal("ics[i+1].prev != ics[i]") + } + } + } + + idle.pushFront(&c) + check(&c) + idle.pushFront(&b) + check(&b, &c) + idle.pushFront(&a) + check(&a, &b, &c) + idle.popFront() + check(&b, &c) + idle.popFront() + check(&c) + idle.popFront() + check() + + idle.pushFront(&c) + check(&c) + idle.pushFront(&b) + check(&b, &c) + idle.pushFront(&a) + check(&a, &b, &c) + idle.popBack() + check(&a, &b) + idle.popBack() + check(&a) + idle.popBack() + check() +} diff --git a/vendor/github.com/garyburd/redigo/redis/pool.go b/vendor/github.com/garyburd/redigo/redis/pool.go index 5af97a0..3e6f426 100644 --- a/vendor/github.com/garyburd/redigo/redis/pool.go +++ b/vendor/github.com/garyburd/redigo/redis/pool.go @@ -16,13 +16,13 @@ package redis import ( "bytes" - "container/list" "crypto/rand" "crypto/sha1" "errors" "io" "strconv" "sync" + "sync/atomic" "time" "github.com/garyburd/redigo/internal" @@ -150,19 +150,13 @@ type Pool struct { // for a connection to be returned to the pool before returning. Wait bool - // mu protects fields defined below. - mu sync.Mutex - cond *sync.Cond - closed bool - active int + chInitialized uint32 // set to 1 when field ch is initialized - // Stack of idleConn with most recently used at the front. - idle list.List -} - -type idleConn struct { - c Conn - t time.Time + mu sync.Mutex // mu protects the following fields + closed bool // set to true when the pool is closed. + active int // the number of open connections in the pool + ch chan struct{} // limits open connections when p.Wait is true + idle idleList // idle connections } // NewPool creates a new pool. @@ -178,7 +172,7 @@ func NewPool(newFn func() (Conn, error), maxIdle int) *Pool { // getting an underlying connection, then the connection Err, Do, Send, Flush // and Receive methods return that error. func (p *Pool) Get() Conn { - c, err := p.get() + c, err := p.get(nil) if err != nil { return errorConnection{err} } @@ -187,7 +181,8 @@ func (p *Pool) Get() Conn { // PoolStats contains pool statistics. type PoolStats struct { - // ActiveCount is the number of connections in the pool. The count includes idle connections and connections in use. + // ActiveCount is the number of connections in the pool. The count includes + // idle connections and connections in use. ActiveCount int // IdleCount is the number of idle connections in the pool. IdleCount int @@ -198,14 +193,15 @@ func (p *Pool) Stats() PoolStats { p.mu.Lock() stats := PoolStats{ ActiveCount: p.active, - IdleCount: p.idle.Len(), + IdleCount: p.idle.count, } p.mu.Unlock() return stats } -// ActiveCount returns the number of connections in the pool. The count includes idle connections and connections in use. +// ActiveCount returns the number of connections in the pool. The count +// includes idle connections and connections in use. func (p *Pool) ActiveCount() int { p.mu.Lock() active := p.active @@ -216,7 +212,7 @@ func (p *Pool) ActiveCount() int { // IdleCount returns the number of idle connections in the pool. func (p *Pool) IdleCount() int { p.mu.Lock() - idle := p.idle.Len() + idle := p.idle.count p.mu.Unlock() return idle } @@ -224,132 +220,146 @@ func (p *Pool) IdleCount() int { // Close releases the resources used by the pool. func (p *Pool) Close() error { p.mu.Lock() - idle := p.idle - p.idle.Init() + if p.closed { + p.mu.Unlock() + return nil + } p.closed = true - p.active -= idle.Len() - if p.cond != nil { - p.cond.Broadcast() + p.active -= p.idle.count + ic := p.idle.front + p.idle.count = 0 + p.idle.front, p.idle.back = nil, nil + if p.ch != nil { + close(p.ch) } p.mu.Unlock() - for e := idle.Front(); e != nil; e = e.Next() { - e.Value.(idleConn).c.Close() + for ; ic != nil; ic = ic.next { + ic.c.Close() } return nil } -// release decrements the active count and signals waiters. The caller must -// hold p.mu during the call. -func (p *Pool) release() { - p.active -= 1 - if p.cond != nil { - p.cond.Signal() +func (p *Pool) lazyInit() { + // Fast path. + if atomic.LoadUint32(&p.chInitialized) == 1 { + return } + // Slow path. + p.mu.Lock() + if p.chInitialized == 0 { + p.ch = make(chan struct{}, p.MaxActive) + if p.closed { + close(p.ch) + } else { + for i := 0; i < p.MaxActive; i++ { + p.ch <- struct{}{} + } + } + atomic.StoreUint32(&p.chInitialized, 1) + } + p.mu.Unlock() } // get prunes stale connections and returns a connection from the idle list or // creates a new connection. -func (p *Pool) get() (Conn, error) { +func (p *Pool) get(ctx interface { + Done() <-chan struct{} + Err() error +}) (Conn, error) { + + // Handle limit for p.Wait == true. + if p.Wait && p.MaxActive > 0 { + p.lazyInit() + if ctx == nil { + <-p.ch + } else { + select { + case <-p.ch: + case <-ctx.Done(): + return nil, ctx.Err() + } + } + } + p.mu.Lock() - // Prune stale connections. - - if timeout := p.IdleTimeout; timeout > 0 { - for i, n := 0, p.idle.Len(); i < n; i++ { - e := p.idle.Back() - if e == nil { - break - } - ic := e.Value.(idleConn) - if ic.t.Add(timeout).After(nowFunc()) { - break - } - p.idle.Remove(e) - p.release() + // Prune stale connections at the back of the idle list. + if p.IdleTimeout > 0 { + n := p.idle.count + for i := 0; i < n && p.idle.back != nil && p.idle.back.t.Add(p.IdleTimeout).Before(nowFunc()); i++ { + c := p.idle.back.c + p.idle.popBack() p.mu.Unlock() - ic.c.Close() + c.Close() p.mu.Lock() + p.active-- } } - for { - // Get idle connection. - - for i, n := 0, p.idle.Len(); i < n; i++ { - e := p.idle.Front() - if e == nil { - break - } - ic := e.Value.(idleConn) - p.idle.Remove(e) - test := p.TestOnBorrow - p.mu.Unlock() - if test == nil || test(ic.c, ic.t) == nil { - return ic.c, nil - } - ic.c.Close() - p.mu.Lock() - p.release() + // Get idle connection from the front of idle list. + for p.idle.front != nil { + ic := p.idle.front + p.idle.popFront() + p.mu.Unlock() + if p.TestOnBorrow == nil || p.TestOnBorrow(ic.c, ic.t) == nil { + return ic.c, nil } - - // Check for pool closed before dialing a new connection. - - if p.closed { - p.mu.Unlock() - return nil, errors.New("redigo: get on closed pool") - } - - // Dial new connection if under limit. - - if p.MaxActive == 0 || p.active < p.MaxActive { - dial := p.Dial - p.active += 1 - p.mu.Unlock() - c, err := dial() - if err != nil { - p.mu.Lock() - p.release() - p.mu.Unlock() - c = nil - } - return c, err - } - - if !p.Wait { - p.mu.Unlock() - return nil, ErrPoolExhausted - } - - if p.cond == nil { - p.cond = sync.NewCond(&p.mu) - } - p.cond.Wait() + ic.c.Close() + p.mu.Lock() + p.active-- } + + // Check for pool closed before dialing a new connection. + if p.closed { + p.mu.Unlock() + return nil, errors.New("redigo: get on closed pool") + } + + // Handle limit for p.Wait == false. + if !p.Wait && p.MaxActive > 0 && p.active >= p.MaxActive { + p.mu.Unlock() + return nil, ErrPoolExhausted + } + + p.active++ + p.mu.Unlock() + c, err := p.Dial() + if err != nil { + c = nil + p.mu.Lock() + p.active-- + if p.ch != nil && !p.closed { + p.ch <- struct{}{} + } + p.mu.Unlock() + } + return c, err } func (p *Pool) put(c Conn, forceClose bool) error { - err := c.Err() p.mu.Lock() - if !p.closed && err == nil && !forceClose { - p.idle.PushFront(idleConn{t: nowFunc(), c: c}) - if p.idle.Len() > p.MaxIdle { - c = p.idle.Remove(p.idle.Back()).(idleConn).c + if !p.closed && !forceClose { + p.idle.pushFront(&idleConn{t: nowFunc(), c: c}) + if p.idle.count > p.MaxIdle { + c = p.idle.back.c + p.idle.popBack() } else { c = nil } } - if c == nil { - if p.cond != nil { - p.cond.Signal() - } + if c != nil { p.mu.Unlock() - return nil + c.Close() + p.mu.Lock() + p.active-- } - p.release() + if p.ch != nil && !p.closed { + p.ch <- struct{}{} + } p.mu.Unlock() - return c.Close() + return nil } type pooledConnection struct { @@ -409,7 +419,7 @@ func (pc *pooledConnection) Close() error { } } c.Do("") - pc.p.put(c, pc.state != 0) + pc.p.put(c, pc.state != 0 || c.Err() != nil) return nil } @@ -467,3 +477,51 @@ func (ec errorConnection) Close() error func (ec errorConnection) Flush() error { return ec.err } func (ec errorConnection) Receive() (interface{}, error) { return nil, ec.err } func (ec errorConnection) ReceiveWithTimeout(time.Duration) (interface{}, error) { return nil, ec.err } + +type idleList struct { + count int + front, back *idleConn +} + +type idleConn struct { + c Conn + t time.Time + next, prev *idleConn +} + +func (l *idleList) pushFront(ic *idleConn) { + ic.next = l.front + ic.prev = nil + if l.count == 0 { + l.back = ic + } else { + l.front.prev = ic + } + l.front = ic + l.count++ + return +} + +func (l *idleList) popFront() { + ic := l.front + l.count-- + if l.count == 0 { + l.front, l.back = nil, nil + } else { + ic.next.prev = nil + l.front = ic.next + } + ic.next, ic.prev = nil, nil +} + +func (l *idleList) popBack() { + ic := l.back + l.count-- + if l.count == 0 { + l.front, l.back = nil, nil + } else { + ic.prev.next = nil + l.back = ic.prev + } + ic.next, ic.prev = nil, nil +} diff --git a/vendor/github.com/garyburd/redigo/redis/pool17.go b/vendor/github.com/garyburd/redigo/redis/pool17.go new file mode 100644 index 0000000..57a2264 --- /dev/null +++ b/vendor/github.com/garyburd/redigo/redis/pool17.go @@ -0,0 +1,35 @@ +// Copyright 2018 Gary Burd +// +// 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. + +// +build go1.7 + +package redis + +import "context" + +// GetContext gets a connection using the provided context. +// +// The provided Context must be non-nil. If the context expires before the +// connection is complete, an error is returned. Any expiration on the context +// will not affect the returned connection. +// +// If the function completes without error, then the application must close the +// returned connection. +func (p *Pool) GetContext(ctx context.Context) (Conn, error) { + c, err := p.get(ctx) + if err != nil { + return errorConnection{err}, err + } + return &pooledConnection{p: p, c: c}, nil +} diff --git a/vendor/github.com/garyburd/redigo/redis/pool17_test.go b/vendor/github.com/garyburd/redigo/redis/pool17_test.go new file mode 100644 index 0000000..51ef4b6 --- /dev/null +++ b/vendor/github.com/garyburd/redigo/redis/pool17_test.go @@ -0,0 +1,58 @@ +// Copyright 2018 Gary Burd +// +// 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. + +// +build go1.7 + +package redis_test + +import ( + "context" + "testing" + + "github.com/garyburd/redigo/redis" +) + +func TestWaitPoolGetAfterClose(t *testing.T) { + d := poolDialer{t: t} + p := &redis.Pool{ + MaxIdle: 1, + MaxActive: 1, + Dial: d.dial, + Wait: true, + } + p.Close() + _, err := p.GetContext(context.Background()) + if err == nil { + t.Fatal("expected error") + } +} + +func TestWaitPoolGetCanceledContext(t *testing.T) { + d := poolDialer{t: t} + p := &redis.Pool{ + MaxIdle: 1, + MaxActive: 1, + Dial: d.dial, + Wait: true, + } + defer p.Close() + ctx, f := context.WithCancel(context.Background()) + f() + c := p.Get() + defer c.Close() + _, err := p.GetContext(ctx) + if err != context.Canceled { + t.Fatalf("got error %v, want %v", err, context.Canceled) + } +} diff --git a/vendor/github.com/garyburd/redigo/redis/pool_test.go b/vendor/github.com/garyburd/redigo/redis/pool_test.go index b1c5106..e8b5578 100644 --- a/vendor/github.com/garyburd/redigo/redis/pool_test.go +++ b/vendor/github.com/garyburd/redigo/redis/pool_test.go @@ -231,7 +231,7 @@ func TestPoolTimeout(t *testing.T) { d.check("1", p, 1, 1, 0) - now = now.Add(p.IdleTimeout) + now = now.Add(p.IdleTimeout + 1) c = p.Get() c.Do("PING") @@ -445,9 +445,6 @@ func startGoroutines(p *redis.Pool, cmd string, args ...interface{}) chan error }() } - // Wait for goroutines to block. - time.Sleep(time.Second / 4) - return errs } diff --git a/vendor/github.com/garyburd/redigo/redis/scan_test.go b/vendor/github.com/garyburd/redigo/redis/scan_test.go index 0c19561..7930c27 100644 --- a/vendor/github.com/garyburd/redigo/redis/scan_test.go +++ b/vendor/github.com/garyburd/redigo/redis/scan_test.go @@ -84,8 +84,8 @@ var scanConversionTests = []struct { {"1m", durationScan{Duration: time.Minute}}, {[]byte("1m"), durationScan{Duration: time.Minute}}, {time.Minute.Nanoseconds(), durationScan{Duration: time.Minute}}, - {[]interface{}{[]byte("1m")}, []durationScan{durationScan{Duration: time.Minute}}}, - {[]interface{}{[]byte("1m")}, []*durationScan{&durationScan{Duration: time.Minute}}}, + {[]interface{}{[]byte("1m")}, []durationScan{{Duration: time.Minute}}}, + {[]interface{}{[]byte("1m")}, []*durationScan{{Duration: time.Minute}}}, } func TestScanConversion(t *testing.T) { @@ -318,7 +318,7 @@ var scanSliceTests = []struct { []interface{}{[]byte("a1"), []byte("b1"), []byte("a2"), []byte("b2")}, nil, true, - []*struct{ A, B string }{{"a1", "b1"}, {"a2", "b2"}}, + []*struct{ A, B string }{{A: "a1", B: "b1"}, {A: "a2", B: "b2"}}, }, { []interface{}{[]byte("a1"), []byte("b1"), []byte("a2"), []byte("b2")}, diff --git a/vendor/github.com/gin-contrib/multitemplate/.travis.yml b/vendor/github.com/gin-contrib/multitemplate/.travis.yml index 3e77485..c4a37f7 100644 --- a/vendor/github.com/gin-contrib/multitemplate/.travis.yml +++ b/vendor/github.com/gin-contrib/multitemplate/.travis.yml @@ -6,6 +6,7 @@ go: - 1.7.x - 1.8.x - 1.9.x + - 1.10.x - tip install: diff --git a/vendor/github.com/gin-contrib/multitemplate/README.md b/vendor/github.com/gin-contrib/multitemplate/README.md index f4ded23..faa0a52 100644 --- a/vendor/github.com/gin-contrib/multitemplate/README.md +++ b/vendor/github.com/gin-contrib/multitemplate/README.md @@ -36,8 +36,8 @@ import ( "github.com/gin-gonic/gin" ) -func createMyRender() multitemplate.Render { - r := multitemplate.New() +func createMyRender() multitemplate.Renderer { + r := multitemplate.NewRenderer() r.AddFromFiles("index", "templates/base.html", "templates/index.html") r.AddFromFiles("article", "templates/base.html", "templates/index.html", "templates/article.html") return r @@ -86,8 +86,8 @@ func main() { router.Run(":8080") } -func loadTemplates(templatesDir string) multitemplate.Render { - r := multitemplate.New() +func loadTemplates(templatesDir string) multitemplate.Renderer { + r := multitemplate.NewRenderer() layouts, err := filepath.Glob(templatesDir + "/layouts/*.tmpl") if err != nil { diff --git a/vendor/github.com/gin-contrib/multitemplate/dynamic.go b/vendor/github.com/gin-contrib/multitemplate/dynamic.go new file mode 100644 index 0000000..8d56bad --- /dev/null +++ b/vendor/github.com/gin-contrib/multitemplate/dynamic.go @@ -0,0 +1,147 @@ +package multitemplate + +import ( + "fmt" + "html/template" + "path/filepath" + + "github.com/gin-gonic/gin" + "github.com/gin-gonic/gin/render" +) + +// DynamicRender type +type DynamicRender map[string]*templateBuilder + +var ( + _ render.HTMLRender = DynamicRender{} + _ Renderer = DynamicRender{} +) + +// NewDynamic is the constructor for Dynamic templates +func NewDynamic() DynamicRender { + return make(DynamicRender) +} + +// NewRenderer allows create an agnostic multitemplate renderer +// depending on enabled gin mode +func NewRenderer() Renderer { + if gin.IsDebugging() { + return NewDynamic() + } + return New() +} + +// Type of dynamic builder +type builderType int + +// Types of dynamic builders +const ( + templateType builderType = iota + filesTemplateType + globTemplateType + stringTemplateType + stringFuncTemplateType + filesFuncTemplateType +) + +// Builder for dynamic templates +type templateBuilder struct { + buildType builderType + tmpl *template.Template + templateName string + files []string + glob string + templateString string + funcMap template.FuncMap + templateStrings []string +} + +func (tb templateBuilder) buildTemplate() *template.Template { + switch tb.buildType { + case templateType: + return tb.tmpl + case filesTemplateType: + return template.Must(template.ParseFiles(tb.files...)) + case globTemplateType: + return template.Must(template.ParseGlob(tb.glob)) + case stringTemplateType: + return template.Must(template.New(tb.templateName).Parse(tb.templateString)) + case stringFuncTemplateType: + tmpl := template.New(tb.templateName).Funcs(tb.funcMap) + for _, ts := range tb.templateStrings { + tmpl = template.Must(tmpl.Parse(ts)) + } + return tmpl + case filesFuncTemplateType: + return template.Must(template.New(tb.templateName).Funcs(tb.funcMap).ParseFiles(tb.files...)) + default: + panic("Invalid builder type for dynamic template") + } +} + +// Add new template +func (r DynamicRender) Add(name string, tmpl *template.Template) { + if tmpl == nil { + panic("template cannot be nil") + } + if len(name) == 0 { + panic("template name cannot be empty") + } + builder := &templateBuilder{templateName: name, tmpl: tmpl} + builder.buildType = templateType + r[name] = builder +} + +// AddFromFiles supply add template from files +func (r DynamicRender) AddFromFiles(name string, files ...string) *template.Template { + builder := &templateBuilder{templateName: name, files: files} + builder.buildType = filesTemplateType + r[name] = builder + return builder.buildTemplate() +} + +// AddFromGlob supply add template from global path +func (r DynamicRender) AddFromGlob(name, glob string) *template.Template { + builder := &templateBuilder{templateName: name, glob: glob} + builder.buildType = globTemplateType + r[name] = builder + return builder.buildTemplate() +} + +// AddFromString supply add template from strings +func (r DynamicRender) AddFromString(name, templateString string) *template.Template { + builder := &templateBuilder{templateName: name, templateString: templateString} + builder.buildType = stringTemplateType + r[name] = builder + return builder.buildTemplate() +} + +// AddFromStringsFuncs supply add template from strings +func (r DynamicRender) AddFromStringsFuncs(name string, funcMap template.FuncMap, templateStrings ...string) *template.Template { + builder := &templateBuilder{templateName: name, funcMap: funcMap, + templateStrings: templateStrings} + builder.buildType = stringFuncTemplateType + r[name] = builder + return builder.buildTemplate() +} + +// AddFromFilesFuncs supply add template from file callback func +func (r DynamicRender) AddFromFilesFuncs(name string, funcMap template.FuncMap, files ...string) *template.Template { + tname := filepath.Base(files[0]) + builder := &templateBuilder{templateName: tname, funcMap: funcMap, files: files} + builder.buildType = filesFuncTemplateType + r[name] = builder + return builder.buildTemplate() +} + +// Instance supply render string +func (r DynamicRender) Instance(name string, data interface{}) render.Render { + builder, ok := r[name] + if !ok { + panic(fmt.Sprintf("Dynamic template with name %s not found", name)) + } + return render.HTML{ + Template: builder.buildTemplate(), + Data: data, + } +} diff --git a/vendor/github.com/gin-contrib/multitemplate/dynamic_test.go b/vendor/github.com/gin-contrib/multitemplate/dynamic_test.go new file mode 100644 index 0000000..8a02729 --- /dev/null +++ b/vendor/github.com/gin-contrib/multitemplate/dynamic_test.go @@ -0,0 +1,172 @@ +package multitemplate + +import ( + "html/template" + "testing" + + "github.com/gin-gonic/gin" + "github.com/stretchr/testify/assert" +) + +func createFromFileDynamic() Renderer { + r := NewRenderer() + r.AddFromFiles("index", "tests/base.html", "tests/article.html") + + return r +} + +func createFromGlobDynamic() Renderer { + r := NewRenderer() + r.AddFromGlob("index", "tests/global/*") + + return r +} + +func createFromStringDynamic() Renderer { + r := NewRenderer() + r.AddFromString("index", "Welcome to {{ .name }} template") + + return r +} + +func createFromStringsWithFuncsDynamic() Renderer { + r := NewRenderer() + r.AddFromStringsFuncs("index", template.FuncMap{}, `Welcome to {{ .name }} {{template "content"}}`, `{{define "content"}}template{{end}}`) + + return r +} + +func createFromFilesWithFuncsDynamic() Renderer { + r := NewRenderer() + r.AddFromFilesFuncs("index", template.FuncMap{}, "tests/welcome.html", "tests/content.html") + + return r +} + +func createFromTemplatesDynamic() Renderer { + tmpl := template.Must(template.New("test").Parse("Welcome to {{ .name }} template")) + r := NewRenderer() + r.Add("test", tmpl) + return r +} + +func TestMissingTemplateOrNameDynamic(t *testing.T) { + r := NewRenderer() + tmpl := template.Must(template.New("test").Parse("Welcome to {{ .name }} template")) + assert.Panics(t, func() { + r.Add("", tmpl) + }, "template name cannot be empty") + + assert.Panics(t, func() { + r.Add("test", nil) + }, "template can not be nil") +} + +func TestAddFromFilesDynamic(t *testing.T) { + router := gin.New() + router.HTMLRender = createFromFileDynamic() + router.GET("/", func(c *gin.Context) { + c.HTML(200, "index", gin.H{ + "title": "Test Multiple Template", + }) + }) + + w := performRequest(router, "GET", "/") + assert.Equal(t, 200, w.Code) + assert.Equal(t, "

Test Multiple Template

\nHi, this is article template\n", w.Body.String()) +} + +func TestAddFromGlobDynamic(t *testing.T) { + router := gin.New() + router.HTMLRender = createFromGlobDynamic() + router.GET("/", func(c *gin.Context) { + c.HTML(200, "index", gin.H{ + "title": "Test Multiple Template", + }) + }) + + w := performRequest(router, "GET", "/") + assert.Equal(t, 200, w.Code) + assert.Equal(t, "

Test Multiple Template

\nHi, this is login template\n", w.Body.String()) +} + +func TestAddFromStringDynamic(t *testing.T) { + router := gin.New() + router.HTMLRender = createFromStringDynamic() + router.GET("/", func(c *gin.Context) { + c.HTML(200, "index", gin.H{ + "name": "index", + }) + }) + + w := performRequest(router, "GET", "/") + assert.Equal(t, 200, w.Code) + assert.Equal(t, "Welcome to index template", w.Body.String()) +} + +func TestAddFromStringsFruncsDynamic(t *testing.T) { + router := gin.New() + router.HTMLRender = createFromStringsWithFuncsDynamic() + router.GET("/", func(c *gin.Context) { + c.HTML(200, "index", gin.H{ + "name": "index", + }) + }) + + w := performRequest(router, "GET", "/") + assert.Equal(t, 200, w.Code) + assert.Equal(t, "Welcome to index template", w.Body.String()) +} + +func TestAddFromFilesFruncsDynamic(t *testing.T) { + router := gin.New() + router.HTMLRender = createFromFilesWithFuncsDynamic() + router.GET("/", func(c *gin.Context) { + c.HTML(200, "index", gin.H{ + "name": "index", + }) + }) + + w := performRequest(router, "GET", "/") + assert.Equal(t, 200, w.Code) + assert.Equal(t, "Welcome to index template\n", w.Body.String()) +} + +func TestPanicInvalidTypeBuilder(t *testing.T) { + assert.Panics(t, func() { + var b = templateBuilder{} + b.buildType = 10 + b.buildTemplate() + }) +} + +func TestTemplateNotFound(t *testing.T) { + r := make(DynamicRender) + r.AddFromString("index", "This is a test template") + assert.Panics(t, func() { + r.Instance("NotFoundTemplate", nil) + }) +} + +func TestNotDynamicMode(t *testing.T) { + gin.SetMode("test") + TestAddFromFilesDynamic(t) + gin.SetMode("debug") +} + +func TestAddTemplate(t *testing.T) { + tmpl := template.Must(template.ParseFiles("tests/base.html", "tests/article.html")) + b := templateBuilder{} + b.buildType = templateType + b.tmpl = tmpl + tmpl = b.buildTemplate() + assert.NotPanics(t, func() { + b.buildTemplate() + }) +} + +func TestAddingTemplate(t *testing.T) { + assert.NotPanics(t, func() { + createFromTemplatesDynamic() + }) +} diff --git a/vendor/github.com/gin-contrib/multitemplate/example/example.go b/vendor/github.com/gin-contrib/multitemplate/example/example.go index 6c461e9..c7d076c 100644 --- a/vendor/github.com/gin-contrib/multitemplate/example/example.go +++ b/vendor/github.com/gin-contrib/multitemplate/example/example.go @@ -5,8 +5,8 @@ import ( "github.com/gin-gonic/gin" ) -func createMyRender() multitemplate.Render { - r := multitemplate.New() +func createMyRender() multitemplate.Renderer { + r := multitemplate.NewRenderer() r.AddFromFiles("index", "templates/base.html", "templates/index.html") r.AddFromFiles("article", "templates/base.html", "templates/index.html", "templates/article.html") return r diff --git a/vendor/github.com/gin-contrib/multitemplate/multitemplate.go b/vendor/github.com/gin-contrib/multitemplate/multitemplate.go index 9c583ed..0940aa8 100644 --- a/vendor/github.com/gin-contrib/multitemplate/multitemplate.go +++ b/vendor/github.com/gin-contrib/multitemplate/multitemplate.go @@ -1,6 +1,7 @@ package multitemplate import ( + "fmt" "html/template" "path/filepath" @@ -10,7 +11,10 @@ import ( // Render type type Render map[string]*template.Template -var _ render.HTMLRender = Render{} +var ( + _ render.HTMLRender = Render{} + _ Renderer = Render{} +) // New instance func New() Render { @@ -25,6 +29,9 @@ func (r Render) Add(name string, tmpl *template.Template) { if len(name) == 0 { panic("template name cannot be empty") } + if _, ok := r[name]; ok { + panic(fmt.Sprintf("template %s already exists", name)) + } r[name] = tmpl } @@ -43,14 +50,14 @@ func (r Render) AddFromGlob(name, glob string) *template.Template { } // AddFromString supply add template from strings -func (r *Render) AddFromString(name, templateString string) *template.Template { +func (r Render) AddFromString(name, templateString string) *template.Template { tmpl := template.Must(template.New(name).Parse(templateString)) r.Add(name, tmpl) return tmpl } // AddFromStringsFuncs supply add template from strings -func (r *Render) AddFromStringsFuncs(name string, funcMap template.FuncMap, templateStrings ...string) *template.Template { +func (r Render) AddFromStringsFuncs(name string, funcMap template.FuncMap, templateStrings ...string) *template.Template { tmpl := template.New(name).Funcs(funcMap) for _, ts := range templateStrings { diff --git a/vendor/github.com/gin-contrib/multitemplate/multitemplate_test.go b/vendor/github.com/gin-contrib/multitemplate/multitemplate_test.go index b2014d7..f8ceb40 100644 --- a/vendor/github.com/gin-contrib/multitemplate/multitemplate_test.go +++ b/vendor/github.com/gin-contrib/multitemplate/multitemplate_test.go @@ -140,3 +140,11 @@ func TestAddFromFilesFruncs(t *testing.T) { assert.Equal(t, 200, w.Code) assert.Equal(t, "Welcome to index template\n", w.Body.String()) } + +func TestDuplicateTemplate(t *testing.T) { + assert.Panics(t, func() { + r := New() + r.AddFromString("index", "Welcome to {{ .name }} template") + r.AddFromString("index", "Welcome to {{ .name }} template") + }) +} diff --git a/vendor/github.com/gin-contrib/multitemplate/renderer.go b/vendor/github.com/gin-contrib/multitemplate/renderer.go new file mode 100644 index 0000000..4e643e7 --- /dev/null +++ b/vendor/github.com/gin-contrib/multitemplate/renderer.go @@ -0,0 +1,18 @@ +package multitemplate + +import "html/template" +import "github.com/gin-gonic/gin/render" + +// Renderer type is the Agnostic Renderer for multitemplates. +// When gin is in debug mode then all multitemplates works with +// hot reloading allowing you modify file templates and seeing changes instantly. +// Renderer should be created using multitemplate.NewRenderer() constructor. +type Renderer interface { + render.HTMLRender + Add(name string, tmpl *template.Template) + AddFromFiles(name string, files ...string) *template.Template + AddFromGlob(name, glob string) *template.Template + AddFromString(name, templateString string) *template.Template + AddFromStringsFuncs(name string, funcMap template.FuncMap, templateStrings ...string) *template.Template + AddFromFilesFuncs(name string, funcMap template.FuncMap, files ...string) *template.Template +} diff --git a/vendor/github.com/gin-contrib/sessions/.travis.yml b/vendor/github.com/gin-contrib/sessions/.travis.yml index 4e9d98b..19a07b8 100644 --- a/vendor/github.com/gin-contrib/sessions/.travis.yml +++ b/vendor/github.com/gin-contrib/sessions/.travis.yml @@ -6,6 +6,7 @@ go: - 1.7.x - 1.8.x - 1.9.x + - 1.10.x - tip services: diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go index dfdfc5b..110ae13 100644 --- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go +++ b/vendor/github.com/golang/protobuf/jsonpb/jsonpb.go @@ -193,7 +193,8 @@ func (m *Marshaler) marshalObject(out *errWriter, v proto.Message, indent, typeU // "Generated output always contains 3, 6, or 9 fractional digits, // depending on required precision." s, ns := s.Field(0).Int(), s.Field(1).Int() - x := fmt.Sprintf("%d.%09d", s, ns) + d := time.Duration(s)*time.Second + time.Duration(ns)*time.Nanosecond + x := fmt.Sprintf("%.9f", d.Seconds()) x = strings.TrimSuffix(x, "000") x = strings.TrimSuffix(x, "000") out.write(`"`) diff --git a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go index 4fdbde1..2428d05 100644 --- a/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go +++ b/vendor/github.com/golang/protobuf/jsonpb/jsonpb_test.go @@ -407,7 +407,6 @@ var marshalingTests = []struct { {"Any with WKT", marshaler, anyWellKnown, anyWellKnownJSON}, {"Any with WKT and indent", marshalerAllOptions, anyWellKnown, anyWellKnownPrettyJSON}, {"Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 3}}, `{"dur":"3.000s"}`}, - {"Duration", marshaler, &pb.KnownTypes{Dur: &durpb.Duration{Seconds: 100000000, Nanos: 1}}, `{"dur":"100000000.000000001s"}`}, {"Struct", marshaler, &pb.KnownTypes{St: &stpb.Struct{ Fields: map[string]*stpb.Value{ "one": {Kind: &stpb.Value_StringValue{"loneliest number"}}, diff --git a/vendor/github.com/golang/protobuf/proto/discard.go b/vendor/github.com/golang/protobuf/proto/discard.go new file mode 100644 index 0000000..bd0e3bb --- /dev/null +++ b/vendor/github.com/golang/protobuf/proto/discard.go @@ -0,0 +1,151 @@ +// Go support for Protocol Buffers - Google's data interchange format +// +// Copyright 2017 The Go Authors. All rights reserved. +// https://github.com/golang/protobuf +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +package proto + +import ( + "fmt" + "reflect" + "strings" +) + +// DiscardUnknown recursively discards all unknown fields from this message +// and all embedded messages. +// +// When unmarshaling a message with unrecognized fields, the tags and values +// of such fields are preserved in the Message. This allows a later call to +// marshal to be able to produce a message that continues to have those +// unrecognized fields. To avoid this, DiscardUnknown is used to +// explicitly clear the unknown fields after unmarshaling. +// +// For proto2 messages, the unknown fields of message extensions are only +// discarded from messages that have been accessed via GetExtension. +func DiscardUnknown(m Message) { + discardLegacy(m) +} + +func discardLegacy(m Message) { + v := reflect.ValueOf(m) + if v.Kind() != reflect.Ptr || v.IsNil() { + return + } + v = v.Elem() + if v.Kind() != reflect.Struct { + return + } + t := v.Type() + + for i := 0; i < v.NumField(); i++ { + f := t.Field(i) + if strings.HasPrefix(f.Name, "XXX_") { + continue + } + vf := v.Field(i) + tf := f.Type + + // Unwrap tf to get its most basic type. + var isPointer, isSlice bool + if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 { + isSlice = true + tf = tf.Elem() + } + if tf.Kind() == reflect.Ptr { + isPointer = true + tf = tf.Elem() + } + if isPointer && isSlice && tf.Kind() != reflect.Struct { + panic(fmt.Sprintf("%T.%s cannot be a slice of pointers to primitive types", m, f.Name)) + } + + switch tf.Kind() { + case reflect.Struct: + switch { + case !isPointer: + panic(fmt.Sprintf("%T.%s cannot be a direct struct value", m, f.Name)) + case isSlice: // E.g., []*pb.T + for j := 0; j < vf.Len(); j++ { + discardLegacy(vf.Index(j).Interface().(Message)) + } + default: // E.g., *pb.T + discardLegacy(vf.Interface().(Message)) + } + case reflect.Map: + switch { + case isPointer || isSlice: + panic(fmt.Sprintf("%T.%s cannot be a pointer to a map or a slice of map values", m, f.Name)) + default: // E.g., map[K]V + tv := vf.Type().Elem() + if tv.Kind() == reflect.Ptr && tv.Implements(protoMessageType) { // Proto struct (e.g., *T) + for _, key := range vf.MapKeys() { + val := vf.MapIndex(key) + discardLegacy(val.Interface().(Message)) + } + } + } + case reflect.Interface: + // Must be oneof field. + switch { + case isPointer || isSlice: + panic(fmt.Sprintf("%T.%s cannot be a pointer to a interface or a slice of interface values", m, f.Name)) + default: // E.g., test_proto.isCommunique_Union interface + if !vf.IsNil() && f.Tag.Get("protobuf_oneof") != "" { + vf = vf.Elem() // E.g., *test_proto.Communique_Msg + if !vf.IsNil() { + vf = vf.Elem() // E.g., test_proto.Communique_Msg + vf = vf.Field(0) // E.g., Proto struct (e.g., *T) or primitive value + if vf.Kind() == reflect.Ptr { + discardLegacy(vf.Interface().(Message)) + } + } + } + } + } + } + + if vf := v.FieldByName("XXX_unrecognized"); vf.IsValid() { + if vf.Type() != reflect.TypeOf([]byte{}) { + panic("expected XXX_unrecognized to be of type []byte") + } + vf.Set(reflect.ValueOf([]byte(nil))) + } + + // For proto2 messages, only discard unknown fields in message extensions + // that have been accessed via GetExtension. + if em, ok := extendable(m); ok { + // Ignore lock since discardLegacy is not concurrency safe. + emm, _ := em.extensionsRead() + for _, mx := range emm { + if m, ok := mx.value.(Message); ok { + discardLegacy(m) + } + } + } +} diff --git a/vendor/github.com/gorilla/securecookie/.travis.yml b/vendor/github.com/gorilla/securecookie/.travis.yml index 24882fc..6f440f1 100644 --- a/vendor/github.com/gorilla/securecookie/.travis.yml +++ b/vendor/github.com/gorilla/securecookie/.travis.yml @@ -7,6 +7,7 @@ matrix: - go: 1.4 - go: 1.5 - go: 1.6 + - go: 1.7 - go: tip allow_failures: - go: tip diff --git a/vendor/github.com/gorilla/securecookie/README.md b/vendor/github.com/gorilla/securecookie/README.md index 5ed299e..aa7bd1a 100644 --- a/vendor/github.com/gorilla/securecookie/README.md +++ b/vendor/github.com/gorilla/securecookie/README.md @@ -1,6 +1,8 @@ securecookie ============ [![GoDoc](https://godoc.org/github.com/gorilla/securecookie?status.svg)](https://godoc.org/github.com/gorilla/securecookie) [![Build Status](https://travis-ci.org/gorilla/securecookie.png?branch=master)](https://travis-ci.org/gorilla/securecookie) +[![Sourcegraph](https://sourcegraph.com/github.com/gorilla/securecookie/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/securecookie?badge) + securecookie encodes and decodes authenticated and optionally encrypted cookie values. @@ -45,6 +47,8 @@ func SetCookieHandler(w http.ResponseWriter, r *http.Request) { Name: "cookie-name", Value: encoded, Path: "/", + Secure: true, + HttpOnly: true, } http.SetCookie(w, cookie) } diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/0.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/0.sc new file mode 100644 index 0000000..e42d3c1 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/0.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxjRDhCaG9WdS1IMUVoSVc0N0RRYVVMX0ZJcHlPNU9vZ0tLNnhaSm94U3dWVFRFUzBxZ3FTOEtnMWt5d1JsZnRvVFJSTy1VNEFqUXJfVGp0dVBKWTRpTHp0SjhyUlJWbEpMVlF2ZV9CdU5Vb2d0cEE9fFomN3uC7sVpjIiNqJ7nSmSW0OcB-1nXJndHHUK35Z_o \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/05a79f06cf3f67f726dae68d18a2290f6c9a50c9-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/05a79f06cf3f67f726dae68d18a2290f6c9a50c9-1 new file mode 100644 index 0000000..22ded55 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/05a79f06cf3f67f726dae68d18a2290f6c9a50c9-1 @@ -0,0 +1 @@ +: \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/05aefe7b48db1dcf464048449ac4fa6af2fbc73b-5 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/05aefe7b48db1dcf464048449ac4fa6af2fbc73b-5 new file mode 100644 index 0000000..65c6572 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/05aefe7b48db1dcf464048449ac4fa6af2fbc73b-5 @@ -0,0 +1,3 @@ + + +  \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/1.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/1.sc new file mode 100644 index 0000000..e3ec3af --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/1.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxURmd2SUVTenFSNDBMTU84ZDkxY01Kc1JhVTY2dnFqdjUtOFRQZ3p4N2FiN3ctMWVtSnVtZ1kxVjZkR24wdVVWWG9keHMwZXFXek9XTUs0QVo4dXNkZFdPQXRScUo5RzJLZG8teGVNLXFEMEJwcE1lTk9GeVprdjJ0SlpjRkVfbEZBLS1TNXlmTlFidWZCWkh5TEE2WE5YaERuenZjZTZWczFyV0xONFEyc0hWNjZ6RFBGUlFxaUdBcjlZOF9SMzBTV1ctb25NLWxxUWh5X2hhNk1jd3plaWZ0NFV0cGNRYWpqSjlWSjMzUU9QSHdMUUlYdVVQVHNHOEJsd2tra2h3ODJtWkVkRVhLQ0ZRNUJlZVdva0U3RWRyWk1NaTZjaEhOdkppejNnPXyQsRqNFNx_AMU6do1StnhxPHRr3HHtfu7dVvDF3qiDNQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/10.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/10.sc new file mode 100644 index 0000000..69f8960 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/10.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxROFk0ZzZkLTYwWWx1NlJOVFdRZS1YeEZkVGN3TkI5bXdlRkFtTkFTRXZKck1aSGI4TVJ3Vy1Sc2FVWFI4N3REYU9DYzdLb1JRQjBMemhtNHhaOUtMNnhlQjZhUExUeEVwOEJJXzNVcnhqMzZsc2ZyVDFPdlBrcVAxQjhwTE9JdFF2WG9FTWxqcjFWT1ZGZ20yVVdDckFVUE1QQW1EbURlU3lxcEJYRmh3RllhRkNaQnFDNXNGWGx1bm1vYWd3RFF3VWlxaVgtckhkTWZldktzWkZvcFpHTkxwd1Y1SENqdGFpbE9VOUpRZkhSN2RKcHJ4akhteFE4Z2xodVZRSWRyUk83WHpQbW04dEZFVi04Zkd5VHR2WFdGcUdvQWRlWWs4dnZGVUlNRjF1VT18Ylj4DXWIZQD6Tmf1UTA54iJj49qE2sUFzr69lsBdJXo= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/11.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/11.sc new file mode 100644 index 0000000..cfadb16 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/11.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxvY1g0WGhRNVNaRHVLX1lPODEyOGlRWXFIb2diNFd1Tmt0YWF0TWcyeXhKb1pDZE55Wk50MFlodmYzUWwtRnp1bkVHZ3ZoZlFWZnc4WGluVWNyaDhPTlRlaGlMWTNJcDV5dFJxSFJWQWIyYjM4V0RxaDVJQy1nREtiaGZHMUhQNzUzZ014SWtVU3p4QTdlV3NBclVzSHYtQ05CNVZrNGszb0VRbVphZTB5RG5QellrbjlpeTNZX0RXZGtQaXhZTnkzQ0ZNdXhCZlNLNENqTEZGSHkxNzBBV1ZpZHV0c0FGU1FSSDc5QXdIaDdJZlFrUFVUVGdOZmEyeGwxYTBUc1RUNzRQTC1uWmZlWUp1eV93dkQzMnZkZjdRMUE9PXyAdVeo7mS4I2iCVT_RBaAtFggrM1ATqiz1Qfl_yGMLdg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/12.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/12.sc new file mode 100644 index 0000000..067aa57 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/12.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxabVUwLTZRMUc2VXpoN2tLaC1uSlRUS0pUelplUFB5UHlrU194QUJfem1zZ0F6Q2ZxbU04dWhOWTB2RE42MUFIeDF0U3dVdzZtaHNXOFFTbmZxd1FIaEtTUk1HdnNZTGRaNHBLWE5JMkhlWDg0UGwwcnphZVFGc1Z5YVRISDB6bjZmZHNJaWJIbmdfR3ZKSTJCZjdVNlZaaVlPaFRFNURMLWlPNXFrWUYyaUc0U1FGQzlGS0FwS2NVcks4ZUVHUWc3QVo0OFA5ZzczYUhzYjY5cGZSbi1YLVI2RENnalZRZl96V3MxdUdTVkE9PXw8F0WJVogg9iGVRsENzrQyPuDs2ZiPEoax9PhGEuae8Q== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/13.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/13.sc new file mode 100644 index 0000000..50e478e --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/13.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnw4N3pMcHc3NlAzS2JwTHBzSGgxQ0k0cWtMOUZwc0JJSGVUVnJDTnE1MTh1WXpLZFB0MHFNejBXOGV1MGs0VHRzQVlrTWRnREpoZ214Qm1ldEJnNUkyVFc0U3pHbC1hc3JRbDRnLVpDNFhLcmNQaGM9fHfi4gFT970lAhbTpz5WB_N8a8ps0mDRnW-T9-5gUqur \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/14.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/14.sc new file mode 100644 index 0000000..4f6eb26 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/14.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxVSFpwR0lpMVVsQmF2bjNya1dVTTZfQW9McWk2dFhVSEkyWGZva1NNbE1uOWc4aVNBU0N0V3hLU1k0eGpDVEQ5dWtYZ3EwdldzZFM0eTQ4ZHRsS2Rjbmp2YjNUZkt4ejRtWThuUnY3UVR0SVE3dFFkMnBwaHdjR0VVS3o5N25NY0tiWllUTlgyNDc1MzVEN1dZSTQ0NVktWVlvNzlaMkYweVZndFFacmtxNVhmS2otN0FFRU1SWi1aX0kycUo3OEtkT0ZhbTliZ3J6cDZtUUhvVGdUQnZQRU1KaFNWWVJvNnp4MjFfOXlGSjlKc1VpZkxnRmV0WkNFZmM3ZGlOcG5NQnBGc2VwME5PemNpbFdxaG8tZHJtdVJvLTd2XzRvS05sVk1oTEswV0MxUmk1c0F6VUU5bVQxMHdPbVpzY0M1b3Q3dVNKUmh5b202TFVwQjBfdENNalB6N2hrcTR8xUFEKJ42IacQ7V72qt2NSe4yPms5fjuFSgAVnoIzTe4= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/15.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/15.sc new file mode 100644 index 0000000..1f38e37 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/15.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnw3X05zSEM3ekZZZW9iN0pwOW9MT25acVlJbGRTaWNNbEt6Y0RYaGpWRUo0dXVySjQtRm1ndFdGTEhyT2dNcE5laFJMZWluOUkySFVORzFlYzEtZ2xzU1NwU3RXSGdER2RoUmJsWWpERjl0d1BvTTJVbW9yZ2V6QkNiRy1ESnNwUVhpZmNsdEhyR0p4RVpCX2V3ZmxReVk4PXwxMDjJkXSAv2j7SOCkQI6DhctO1rmkfe5TLCemSgF5TQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/16.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/16.sc new file mode 100644 index 0000000..da7e774 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/16.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxVLUNuN1Bmb2owRVUwLWJHRUVwUGZPNmUxSDJkeDlBeE45NDIxLUZaVE16VU5tUF8tMEpZZlc0QmxFSmlJMVdNU0tfdWlGRDFadWNTb2ZBbjlJRng2bzAxa0hCY0cyM2R4SlhKZjZuV1dCdGFRdFRBS1ltaU5lMWtPdm9wcmVQZzZlT21UYWNMVGQwUjM1R0NBTVYyZHlldnlRPT18NfdAQbuBFXoRDB2lcBp3PsOZOoRyGXOD_5Vb5mOYfdk= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/169c3e89cd10efe9bce3a1fdb69a31229e618fc0 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/169c3e89cd10efe9bce3a1fdb69a31229e618fc0 new file mode 100644 index 0000000..c00af04 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/169c3e89cd10efe9bce3a1fdb69a31229e618fc0 @@ -0,0 +1 @@ +8Q=== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/17.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/17.sc new file mode 100644 index 0000000..b9e411c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/17.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxPSEJsU0FQMUh5OUYwTWRLRnFFckJXalVSSnNET1hmeV9Tb3IzRXlqS05IR0s3YnhmSkU5SVVYTlFzU09OcEpKcGpQaHd6NDU2ZWhoLXQ2ckpoM3cwSGJMMk9VbkpWX0ZVUlB1aFNnaWlSYXBzb2ViNXJMRjhBcF9WVmRSelhOaWtuODRHV1E2QjA3b2ZnQ19IUFdQS2x1Q0VuaWxHN21SLTVGZUs3MFVvTFhzZmdoSXZ5VTFJaXF5LUZLVUg3aXV3clFmfHWnnWaZO5H5ZBokfQp9DE0Vqo52hWUySU2Qb5dOis4X \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/18.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/18.sc new file mode 100644 index 0000000..291882c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/18.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx6UzgxOUtEd0RRVE9fUzIxVGdjV0xvZExBM25HSFU0R05BZ2FSVzFEX29hRzQyTEdSZHVOdGNBU1pJVk9fZ3hlU0toY3RHSjJiZjVXdGNXY095cVNqV2owWm9OdXJfY1BHMlFib3hWZ2dwQzFteVBWWTNJQU9TcWtTbjF5STJPQ2Z1RGsxbzJzSGpyYnBZR3gwSDc0VjJlYkxkVkswbjd1c01VWUdLR3RhWEFLd3p1RkNvV3F1QWVJNURtZXQtY3EyOVZ1WEdCN19lUFZibFV3WDhvb0JwNE5nMEVqbDRmdWloN1g1WWRTNWdNMDB6aUhTQkxvWFBzcFdka1R3N0p2Y3ROR0pyRmdCaU85cEgxVlhOYjhHbGJUdlFMNDlSVTlMbGFfZ09ZREhnPT18O_WDUgPOoZz_Tj8Xl5xmVh8MW4DNTlR1Z_RKXp25EgE= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/19.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/19.sc new file mode 100644 index 0000000..5e03246 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/19.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxWTzdmRjR5X0pDT2J0VVpEUlZuMkFhQTBUQUd5TG5fa2xSZndZTTB2SVdCcHpZaG4yRFdpSFRQamx2VW5RZlIwZ0h0MjRKTEdIb25RNFh1N0VGQjhBQzJSenl1d0V0d1NkNy1WU0FNaFB6cl9tWW9xQzJUOW5yelVicHAyVkJ5ekZuVnhRVVFTTTFDQmhFRHp6QVNkSjFMdndWd0tuamhTUEtEUTAyZHVCcWhiMFpsSHN2V19yby1tQ0lVQjlPTXcxaDZLa3BFTnkzYnlBTTlLTTZWdHFKbjVIejVwRjJKbFpGd2J3TXJwYnQxQ0gtTT18fWdsGgvMPIXZ2GFuTHyx7UEQxVQZ5kuLef2HuTWuMmc= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/2.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/2.sc new file mode 100644 index 0000000..85b7814 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/2.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxWZTY5Rmh6Tjctc2Q0LUNKS1JjckZCYlFrdTVHZDY1SGN5Y25yY21DTVhOaXMyVTZSeEVnZEhwd3hrOXpFdk1MZXRJM1lOY3BrQzM0eExFSUtsMG8zTVZGNV91SDI3cV9BRDAzVVpFNEg2WWljQk5kOHRFRVlya3J6Y1NuTWhqVnA0eDhLelY3MkVGZmdRbXdvS2VXSWxicWxiX2drOXZHQkVOY1VzQWdUNktheTZ2UC1hMHRFMEdubmF2RmNxLTF6cVZhM1VQTnJSR1RJVm1MSHRiX05XVkc1bEpjWGFLQ0dMS08xMm1QQTFtekFUNUlCZz09fDoYy22cGspOxGc5hXTDyuC2dUigy05-6F9jWgzcQAhq \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/20.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/20.sc new file mode 100644 index 0000000..c44b13c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/20.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxVWW9MekhaTFowaW9PdjkyUU9pX2M3WHNma1E0bXltbE54N3kyLVhuUU1ya3cyaG9FdFJGRkdIcEY0bmE3RkoyTkFUSlJBSEhmSDlLRW1qN0xUM2EyVEZPeTJyNHlFaERIMng2eWljeGNOaFNXVTZoUlJUbDdLMUExRmE0NW5qRzhZWlpreUdCMGh2QmpPcmEwYm1wam5UVzR2NnI0c2Z4dEdQZnlaZz18gq2BDyZoxUhCEdkDBJI-CKd_dBMqivkn0JPOWKVU5w0= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/202ad82e80f70c37f893e47d23f91b1de5067219-7 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/202ad82e80f70c37f893e47d23f91b1de5067219-7 new file mode 100644 index 0000000..cc21ded --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/202ad82e80f70c37f893e47d23f91b1de5067219-7 @@ -0,0 +1,3 @@ +8Q== + + = \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/21.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/21.sc new file mode 100644 index 0000000..b4dcc3d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/21.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxMXzFTTy10UHl2ejdOVnBtU3o0VmM0ZnRmN0dMbnk3Wlc1WVRlOXRZRTA5aVBOaHlxUDJWZ2gxcDRlZk50aGJNOUdqSlpyNmFBZGdmcUtiMEFZTFpPbTF5d1VfT1UzRHl4M19uelJBemgxYzVOU0lqYlI1Wnd0SW1MRGw0Tmw4ZUNOdWxWZF9fZlZVNnJUYVZXcDl4Q0JBSmJmd3N3Mnltam13UGtxQVBKTkkxcm5mUUNhWVprNUZYMXFPRG80aFhTODhfRXhVTU1uckJHYzJTQUhCeEFYVmVQSUpuWmFmSzFTaz180bgqBZn9nHXblgUiVtub8vMX5yoi0kbhENzp6sddMt8= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/21606782c65e44cac7afbb90977d8b6f82140e76-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/21606782c65e44cac7afbb90977d8b6f82140e76-1 new file mode 100644 index 0000000..851c75c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/21606782c65e44cac7afbb90977d8b6f82140e76-1 @@ -0,0 +1 @@ += \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/22.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/22.sc new file mode 100644 index 0000000..40296a0 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/22.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxTd180RjZHLWF5bjhuazNjQ1hmZXFIdlJMQnk3dDBDLTZpdUgzeHU2V0dFWFFUTnBhaEc1Y1ZHVllnUGROS1BjTGdnM2M1X3drSEotdGNCMEhwVE1tS19nMURTdDhCTUNGMjN1WHpFd25yc29XeWVzQkhvUXI1Qjlnb01fbkxZaEpsVVhsLTJhTFVaeEJjVGt1QjR6T3pNek9aeTRtQzlFQ2FTZDRRLWpTcjRaT1BHUFJRTFd2aUNXZmNlX29BRGgyWGFNUUhBRHJVSGpmVmlEbDVXTjlVcE1aR1JCM3lTZTNNMHdsbzNVVVdzUkt4aWV3c0cwenUtdFVaX0prOUZvTDFjTXwmW7ViLzDpDQ4HYcVtkyAja04RfLbwMybME8V1n2KnJQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/23.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/23.sc new file mode 100644 index 0000000..ba30140 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/23.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxxQkhqeVh5R1NmamdQVXVKcXpZa1UxWG1JdmxsZ192RDF5RmlXem1IaWU5cm1nVzhEWThJR05sQTJhTWFWOHhmZVNkWUFseUtNS2NVTlRaaFpFWElrS1hpZ1AzMFdkVUNEeklGT0lIUDNVQ0pMU3g3RjZJb2RkUnAzVkFRNDA5RzI1ekg4TFpUWU5KTDhsNGY4QVA2NVpmcTdYbWNXWEw2OGRtWWozQ1NhVlRzaW93VHl0RXR1VDBIMDBrRy1IZFBiZFNyVGU0bVEtQ1NPNVVkb0FHREM5UnR4Vi1LajdsclJzbnF3OTlMU09TdFBTcTM1eEo3WEVISFJwRlNhMC1lQTZiS0tlSDJjRTZMc1FKT0VrSWIzdXZtRkw5UHlQTTZxQT09fLEJ3Ff2tP3aJxgI5TrhzBOYMEF5guG6Lkn4PrPGh_uU \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/24.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/24.sc new file mode 100644 index 0000000..79b19c1 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/24.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxWQUVBX01zRWJrdkcwektCQU5FNWdJTmZmQkVvenRaTVVNTmFCcUtJS2gtWUM1MlltMExlcHFrVEdGNnQxbDNvOGFpSHQ3c1pQak1DbUw0Z29KT213QkJneTZrYTE0a3hpc2Q3SHNZV01LWGJqdWY2Q1p6TjlTX21pOU82Y2pVUTJzWE1ITElVLXZNUkxJT0hEVy1XalJmc1NNZGVYdlRFSjhPQUFBTEdTLUhYcldPQXJubWdXUnRNYkpkSmtJSklTZEhQajZVbGw1cWYwUmZPaEE9PXzAmHnGMLYEU2NdJfNpx0XFAoVqZEexvIbAIvvO1oggig== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/25.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/25.sc new file mode 100644 index 0000000..0271610 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/25.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxUUy1RMHhjTm5rM1hHWHRPT3prM0lUT2F4NGxERmNZMmdDbTJpdk1ObUpXZGZnSEZ6czQtWHRkNHFDVXBaREhYc2xIS1FnM0FjUzlBb1ItVVBRR0c4THRLaXJyOUVwTndCSzdpTGliR0xsQmpzX2FjRmhWaDdISGlYVFJFNmowZC1FYlpsbnNRVUtFei0xZVpUV3loUDluaGhQM2FNSlZaVmRwYThySm5RcVpEdm9rVVdMUkVpY0JuQ3g5RDNyUFZkQjVldzVQazdVZC1vemkxTjRGVTlwWlRsTGZZNURXU2IyeGVQV2JiNS04OVVFSW9QR1B1dUVtUXBRPT18YY5iRJLicxAb8HQ3ztH55VaIsETVU-ih8XWjqvUFdWc= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/25c648c4c5161116b9b3b883338ddae51f25a901-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/25c648c4c5161116b9b3b883338ddae51f25a901-1 new file mode 100644 index 0000000..8c7b9c3 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/25c648c4c5161116b9b3b883338ddae51f25a901-1 @@ -0,0 +1,2 @@ +8Q== + : \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/26.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/26.sc new file mode 100644 index 0000000..62a3d14 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/26.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxWckxCcURZVzN5ZXpGWUNKUU16LWN6eEwxeERyVERpeUFZQzJNOWhrN3ZPSV9HbTU0bnJmcm13dnNTSWFWdElnMlA3OTg2cDhubDctNGo2WklHS0dSZm1Oc3FuVk9TMDFzckN3WGEzRzNuNDNvd0hGMVNtS2hXNnVkbmg0Skx1MUhmTkU3dVd2TGUzaEV0TV9PdEdWcl9wNlNqbEZyTXcwRjAwc2NjOGJhUEp0b0Z5YzE3RWFCZV9JekdXSmhxWlQzdk5wblE3SjFoeVc5dXVlc0RGN3RSMD18GWFHfNiy-kbdyUHsI7sohnd2psiLzBQsh4EqtAkWNbw= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/27.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/27.sc new file mode 100644 index 0000000..e94851d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/27.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwxT2JtNzdGVGpFeEtTMDBtLVYwbDd1djEzbzJtbnJqU0hsNExlb2F1VkwteGY1VkJESGp1TEx2T1M4MWhfbndNN0tsSzJ5cXdyWEhrc1JnVEt2NWh4VnoxMHkwWF8yMlpOWnVLYnR1ZEJOWHEwUmpaRWI4Njd2Y21XN3JnYzd5d1RIeEtDU1YtdGdyX2tFN1AtY3JZZDRNdVVJSG9EWGEybEdGUDVENE1tWjYtNnE5UEpLYlJEYTNaN285LTVaeU98-s7M5tZwxQHP__ru0pr2s2RvJoHKw3UvrX5RySOdkyI= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/28.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/28.sc new file mode 100644 index 0000000..7bdff12 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/28.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxaZ0RRU3NQbkRQMEU2eE9IM0pPY3JKdnppcFJnVHhHZ2FiQmh1YWU0ZFh2eUREdmNkSmtmdTBueHJqWkJhS3ZJN2YxdGpWQUZQaXBZWlFMd3ZwUDlhZ2J4dlJhbGtCMmFmbmNGQTVlSmFZckh3T01oZUYyT1kwb0RvejJZMlg4QTZxaVJ4a2FoeE93U1QwU19BREo4SklicGxkYWZBY0FucE5VbXJkWnNwaXpjR1o1QUxQTzlZNl9Jam13Nm9IZmhsUFBfazBpcUNKMHdyOU13OWtMSThpYkJRZ25pbWhUaExxRzRUTlRBTjBjanVlZWc5WW1rSS1KdlpUSUo4YVEzeEN1VDhlc0stSFJ4YmRyVmNWdWRZZGZpM0hudEZ1aF8wV1hjMEFrWHJVTEhGdz09fNbtYysnGt4wf4hzwKO35zhSLDX9GXSzLkircCuJMmzK \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/29.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/29.sc new file mode 100644 index 0000000..742b8d4 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/29.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxNN2xITzVlekdrNzhMT1BPSmdZZnJuOFppblJjSWNpTDhfdXFiVEpIR1pqeFdnRHlnZEJrN0o1UDNLQm9MaC1lN1NLMVFiOWw5ekpKUktJaklZQWJKODZJUlZlZlBFZ2JObmpVVFZtUzI3R01HQ3RHNEI4RF9Hakw3bGMtUW1Ucll1Mjl2SXlJRDJmdnRaS2I3SENGSDA2U3hDbGZSZkVMQW9xRXEtREl3RzY4cklDSlZVV09mWm0tU0JwaGxKXzVWTU5GY0plZTBIY0RCOXh5cVI1dktGRy1XVGk3aWhJcllTX3cxa2RHVUZnLW45eUl0VFZRTHVrYUpMVWlrYlBSaTdOME5PWTVWYm9SeXFpM0dQUW1HOGFJWGFOWlllNV9fSG4wWktlNW5FNzZ8ZrFQcdFDl_-VscnBXTUhM2XvBRo4Ev0Ap24dqkH3jnI= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/2aad7069353f2b76fa70b9e0b22115bb42025ec0-2 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/2aad7069353f2b76fa70b9e0b22115bb42025ec0-2 new file mode 100644 index 0000000..9d69512 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/2aad7069353f2b76fa70b9e0b22115bb42025ec0-2 @@ -0,0 +1,2 @@ + + : \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/2b28c8193457fb5385d22ef4ca733c4e364f00e7-4 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/2b28c8193457fb5385d22ef4ca733c4e364f00e7-4 new file mode 100644 index 0000000..9ee09a3 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/2b28c8193457fb5385d22ef4ca733c4e364f00e7-4 @@ -0,0 +1,3 @@ +8Q== + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/3.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/3.sc new file mode 100644 index 0000000..d97d578 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/3.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnw0b1JaSmp2TWp5M1pFeUJVRVN1VDZBSmxFNXpMMGJ2LTU5aXM2N3g0Y2RRdGlyWEczT1ZoY01fZldvRWZhYXAtYm1OQ3FQUG1IY1N2M1dTZV8yeEpuMWtQeDdXcno2QjI4UUptYklOOHdQZnhTQkFJRmVmNF9tVHpHNUpJdWJ0cUVHZXdacWFabU1HaWdfcnMxX2RpTWNkbU4zRDBfMnlLUjYwTlRMa2NnajlkemxKNVpLTTJPNnRtcDIxNUJ1TU9Uczh6S2FmUGk0YVF2UVAzS2o5Y29IM1FYZz09fGpjKWy2IhR07BHKlkb0Zr7qxojZDZLU2AKB-1azftV0 \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/30.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/30.sc new file mode 100644 index 0000000..00953b7 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/30.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxZUHVVYmEyUHNRUFlDV3FLU2s5WDdIY3NYWlpYNENISEVta053YzFMQkp1M01pLW1Cck1neUVNZ3BpZ1A1UXNNVXcwQ0NYd1k3bkNtUV9hMDRlTDJHUFM3Sm1NLXREWUkweElOc0xHV0NYQW16dUU0QnQ2S3FQdGl3UnlxX3I5NGdwenVFajlXMDVON3VwZjVJYXh2cndSVFlicHNXY2NUOU9SU0ZDQm5ySFpGNVV4dnY0dWdQVFY2U2hJMmR5MDNRcmJickE9PXygp9rjsTBYaNuCDC0IRxtbTx47LZzJqOHHkfbe1LGNXA== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/31.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/31.sc new file mode 100644 index 0000000..78a6f42 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/31.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxGWHN6bWdhWlRTeHBJTGlJcVdkVXZVaUpjSkRxMDF6VzU1eDlDQmFUbjJFaU5RUzB6WUJ4c2cxUTAwMDAxZU0zNGR6REF4cG1CNzQ4QnJBVlZaT3dnOTBBTUVnYXFiaGFESUswMEtaQWNCUGNQQ3BwbmtMY21hUU5CaG1PdmtLY0VoMk1PaWNJd0VfLV9DZW93QXFjalhRZE1ieUZBUjF4QWhDeVBaUnQzMjV4SnFuZE1fOU9ra2ZOV0ppLTRHNXg3QzktLTVtYnlkRUJaTDRMbllxSW5kaHhxd1FZYWllLWZQUW11ZlhUVWhLMHZ3anNRUVVIbEVDd0F1cXFjNUFTQlZoNTJWT2RNVVJyM3hEY3IwZDZkQ1JuNThfT3pvUXVvbjZWOVNNTWY3X3hEbnM9fLxht7FvJD4a_FPtZFHY-Jty04388qOsUPtYAh_v7RzR \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/32.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/32.sc new file mode 100644 index 0000000..f273faa --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/32.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxDN1d0UkJ5Z295QWp2QmJEaXdUajBEelJRRDNGVEJDalR6Z05wUGpoeWc5TjdEZC0wTEljZUp5VVlHQmR3ZmRkWkM3SndCaGMwclQxSDJfVEpjSjlQVUxLQ01zZnV6TmVpVWZwelZrNGgyTHFKODFNZGt2LVVySDJ0RnlpQk40UWNFQ1BTTF83cjVBVGhzNDJCTnZycWk4Ulo2TnlxZ1RtXzlEMXJpel8xMDV3emc5aHFiN2dDS1NyV2FqcFVIci1OVVA0bGtlNXNaS1Q4dDdIaDVnY2lDeGdoUFk9fABSA5I3BIpmZmQgqbHgTAqVXIli2piNjBtxOxdjvqOo \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/33.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/33.sc new file mode 100644 index 0000000..e815509 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/33.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxTOXU3QS16QzVwMnA0cW9rYV9xOGJaSnd0TE9mU0ItTEhIaXp0OHpTVVBiZDllTlAzV2RrS2tzdDBzM3JSWkFCSWc3ZWxEZm5sLUVydnFVT2x0eFo0QWZYTTJUMDNsa3QxZldnUV9mX05pcklvSXpmX2c1bzdGLVdQdFd1U2VrTkdscHpJZVNyUkMtSGlwXzNnMFRZbnJZNmNrT1dCNjNiakpYNjl3QVF3bzJMMi1HRHzsH2Tt9rxpZH3zsEqJu4iMDx3b0HY_DG8ww5NHxWnf_g== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/34.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/34.sc new file mode 100644 index 0000000..2cbbe11 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/34.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxyYXZWSDBFYlhuT3dJd1RORjQyck9LU0RJcXFnNTNpVzlkNkliZzhJMUpOWnFfMW4wSmhpblZZRUpkMnZ5S01uUnZPd2ZROFZpcFduTXVzSDlHMVZyZmFqV09odm0xWkV5RXNoazEwbnNsOUdQV0hXQjNpVkIzWTFJUi1sQk9IZHluM0dubndmbkxLUnw71foKMZj5sjRaa8r9NSKLljA4s-sV3iSuUIDE-rhFeQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/35.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/35.sc new file mode 100644 index 0000000..000bbd0 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/35.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxwT0pPY3dJdDVuWVVwdzY2ZHhWS0xsemNXdDJnNkp6VWk0X2k5bS1ZMHUwdERuSmx4SFp6LVJ1R21IcDJRMnFlOVZVUHI4SFBoUWlZY0RQd1NkeTFzRDlnemNVSXVuMU1EZV9OLVNHcm1BRlQ1d2xXQ1AzTzN6dGNWdzgzTW9VbjJQU09CbkVZWVBXTHVHbTNFZ1BzbThGSzNFdmhqREpSS0FtVkhFbTBxV0RHUUpBPXyJHQBE0YGJZylQO-9FgF9v1AR1MQt9RRljMVjtSJWJrw== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/36.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/36.sc new file mode 100644 index 0000000..057e7fb --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/36.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxkZ0pabTA5S0VrZFFhTG5vbGx0NjVoai1pbkR0RmI4VWhVaG8yZGNabWJmRW1lajlRdmlkT3Q2dFhFZTFLNXFrMWtCamlEV25SeTYxTGJqWV83M1Y1STd2ei1vaXFqY19pWnlwU0I2STdOakhpd1ZGTGRKV3R3VE5VZ01EcldPUVZpaDgwUnN1Z3p3YkZGdHk0QkhxWWNTcGFranFhcTdCR1NteGZQb05jOWkzVTd3a0tnPT18_ii97jAl3_Q3XFaUY2r8Fk4bqBhysx1rSQw_ppe-oSw= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/366e3e0397c8ceca170311fb9db5ffcddf228b51-5 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/366e3e0397c8ceca170311fb9db5ffcddf228b51-5 new file mode 100644 index 0000000..927a20c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/366e3e0397c8ceca170311fb9db5ffcddf228b51-5 @@ -0,0 +1 @@ +8Q== T \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/37.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/37.sc new file mode 100644 index 0000000..a6cc973 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/37.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxNMEpYckdpU2JSV0VGS04tOXFGbFZmOFBxRnE0akZZZGZYazh5ZUxnYnhLU3g0YmNaU2RYQ1BUZUdaYXluTnZmQktleFY2WTQtWFhyblptOGk5Zkc1c0FhTkpjTmMtNmxjbEV0dkZNT203cWVUSXgzMFhscmxsQXpkd043cEQzU3Fpc0dXWk95Q213cTJGSUxoZjBWREQ2aVdfZXdyWHluMElmeWRHZnZzVFBDUE1ub2tCZTIxa011UDduc3hscEZjMHF0NHdRdnBtLTQxZF96c1h2WlZfbnV0V1B4ZjJwWTlodFpLOEU9fCETOj9CrLkOjHQ49IVc1S1yDcqlwQ4iVFaSZIiovrrN \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/38.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/38.sc new file mode 100644 index 0000000..472dbcf --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/38.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx6dWpVS3poT2ZaVDhwZVhGS3ZSa3hCckVuTkNPbWNiOGZtak92Rklrc0Y4dEZVbWlfNk9DZmNNMjZ6cEpaeHptNEdIWEp6dWo4YVBEbW1Da2VZMU5LX2FyelJlRmdzQkNwdXZGaDVLQXM1eVp2OVV5TjNBMUYtN0ExMlhMMkZCUklRPT18uOhvGznCMRvXlfsraWq4DfbciJOMOzHzoW7PMo0aIxo= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/39.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/39.sc new file mode 100644 index 0000000..b1ce72f --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/39.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxSUTlaRTRnVHkyMktVSWJCZHBCVzdWUDRtRlJ4TmV5OGFCd0pPNllNdEFJMk96RDdLOWtqN1hTNFR1MzA0cVd5M01KM2d1Z0Fud1BQcTQxaUJGTFNkd3lqZTFpMGxnbnVwdGFPX0x1Rm9aVWVyVHlxeUdoaWFRdUtPeEhyY3ZYQWF6eVFRSE41eFhIZmxkaWloeXlmN3Y2dFJya2tvNl9WZkhXaU9IdTdPcHMtXzQ4V2FHOGRwSFJ1ZjdES3VqMTFRRjZEalozWVpjOTFBY1FoeFc0VDhZdFdCeVJhS2JCc25PVGdIaFl4cFF6Yml0ZHlCSEk5c1NhSHppNUpEdF93bjRTUENoOFFrMjlUVU1yeHNhb0ViWEFwWFVWRnBfQkxhZmN3aE9XcTVyVkVvVkRWb09sRkFKMWpnbTZaa1pRSmxORTBVS2xVUEtvSm43MD18oCSPYwyWuG4Fi_L4i-Ck2AtkAP_DFNm2P25AONmh8PI= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/3916f239f9da91baa003ee6dc147cca7f7f95bd7-2 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/3916f239f9da91baa003ee6dc147cca7f7f95bd7-2 new file mode 100644 index 0000000..63ed914 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/3916f239f9da91baa003ee6dc147cca7f7f95bd7-2 @@ -0,0 +1 @@ +MT=` \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/3e70a0a4bb1ecd96f554cbef9f20c674ff43e2f6-10 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/3e70a0a4bb1ecd96f554cbef9f20c674ff43e2f6-10 new file mode 100644 index 0000000..4770f53 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/3e70a0a4bb1ecd96f554cbef9f20c674ff43e2f6-10 @@ -0,0 +1,9 @@ + + + + + + + + + = \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/4.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/4.sc new file mode 100644 index 0000000..d2d6ea8 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/4.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxBdWtBNGVWdUtUN2pwcFBUWGl0anpObmNRYmlkMkdZamxZTEotQk9UWHJpX19ydk51a0pkNklaRHN1SVVGYzdWSHRNRTRtZVdyT0VOTkZncUxPaWtZTkE5TzBOeTBOc0RyWEZuTzl6eEpHQ2lRSVh3MFNmc1JNekxfMzFkOVhmN0FldTdlMGFfbXh6bWRpYTZuQT09fIXGQXlpKRx2z84DdIjKzSaH-rt1LNVccss7Pok37t5R \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/40.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/40.sc new file mode 100644 index 0000000..5f8a783 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/40.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxzTl9JWlczZmFOeEltLU45SjQ5NDhkSEJkdnpBU091ODZPY04yQUJPV055cjJkaUVtdTJXbzd1WTZRdElzMlVBdUExeGVZZHo3ZHQ5SFRBZGs1cFhkVF8xRUxLOU5Tcm44Z1FyMm1INW9CeEFZbDJ2aUZyeHRfbTBlY3EzcXd2Vll1Q0tQQ2FkOHV2QmdUazdESXN0NWNqY0tILVBkd2FJbUhENVh4cXBPT1NhNG9LVlJUSWZ6eC00a1RLVmRXWUhBVFNjbUVDeWFHd0kyN2JDLVVrR0oyai1XRTJzQWdTZ1ZnMGNlVU1pTWtjc0VkQTNRdFJEdE1TdURyTnNCd0w2Mm5FV3Y3dUtpZ0J1eDhjQWVKWDJXSF9SR1pDS2s1Njk1OV9YSXNNbEg4Z0RQbW1lQnl3OVNRPT18xpN1Gzy5f8THuL4VpHgE6rkEAgP8s-JALzUMIdCy46s= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/41.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/41.sc new file mode 100644 index 0000000..a46dfd9 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/41.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx4XzhJbWhsRF8tNXhHWE40QkJqSC12dVNPQVRZcHJYcXhOSlp1MHRERlA4Y2Nhd1dpV3YwRktxMy1WRDRkSHhsOEJhMnFmMms0d080dG9NMlM2Y3NSbzZoOWpjeUFkZjRod0xFNTF0RzI4ZDJlZzRzUzhXSDU2ZHZfdlhnY2RfNGRqTzQ5VUJCaHVVOWNXczR4bnF3cU5XQURvdmFDSkJKVy1HT3dvZ1VPVzVDOFliMFhaazBYVkJfVk1oU3B4UExYcllOU3VUTnAwYi0wa0dvd0JvcFF6dzVuQ3ljdENIUHzmuNnj2ddk2WHZr5R7DCU110FZIt0WYBt2eswzaM4gug== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/42.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/42.sc new file mode 100644 index 0000000..980d902 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/42.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx4ekswcTZlZk1PZ01kMGxjbERUTERudFVIOWVRRzduU1FrZG5GRWdYN2VIcC1JRjllQjZnT2t0WWxFM3JxMmxHTExtazhfNU54eHNJNnlobFJoQjZreVFteUE4WkVrbFJ5MTluTlFyaEcxT0w2VUV2aUtaYWhvUUJ5WW55LUVHSFBpZGlwQXpRYWVZVVpXMElrWHJjYURqQVgzaHlhaERxNktwU3VLa19iVkY4QUp0WjlPTXcwNzNVNVRqTDFRVHBxYkZGc1ctU2plNWtqX0FvWDA0OWpkV0YwREk0MGNEM3AwQXcyT2FkNGVWeGtyWG1QMkUyTElZQWphYjl6ZTNVaGVEZHJZa1NneE9UamhnVGZkVnFFQmRGN2JfZGhKUnZCcE12THV1eFdpX090RDVrNThheGthUFlJSjJPTnEwSGZCNm9scC15TGRMVjk0YkNUOUE9fBemXTR7HKYdKtHj4eD9GyTuMPweT6BzKJORecQUOHiY \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/43.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/43.sc new file mode 100644 index 0000000..0db6df8 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/43.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxpdTBEREVHaWx6OW9YZ04xX2ZwYTh0bVY1UXZYY1dGSk9XM0NFZ2VKektIR0F0dVY0RVVYNC1lLWtaWFdXSDl4aXlhQnNqQ3pMYlNxRFhXeTZtTkJxcmhKckd3U2hMV2xGeEJ5WWxsNFNxSVhFdW4wek9XdDJNTWI5d01tLWxITkk1Tl9IRjRxZnJnY0JPZ0VBS2cwc0Fya29qNG13ZHRvb25ESUp1UTlQM2hYSnFvelZyLWpYNHJqSnRnaTRFbkhVVnZyc3Fhb2UyQ3NkdnpQVjBxZkFVOVoyVmVOVExDUXpHaXVMNlEzQkNzdzF0M2RGODk0U1VVX3lGcDViVHpPTF95bFhGaFJkU2ZORDFkaDBfem12Xy1FV1VSR3ZKTFpJdW5ZZFJWSHZhVHlqbWN0ejkyOWlKY08yYnllSnVITlZTeWdDMVFSckI3dHFsdDdDSDNFUzNHUWwxRm5JT0NqVHpFPXy6hn09Iaig1LeW5S8uecM1E6X9JRmTLzFDWXDDklk92Q== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/44.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/44.sc new file mode 100644 index 0000000..5aad2de --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/44.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxYdjBGa0xlZFhqMmlPMFgwQUxxbmtjRlRCMWJKWWV6dkNvWE85ZElQeUtKQjFfRzRMa2pqbE4tUTM4djFUV2lzNTBLa21XMXVMSEx6TTR4Qjk2WmhiejVic0ZiOEQ4UTAzSFU0Q21QWlp1SmRQVEhGMjZXdFFTRXBCNlpWZVlhVEdFbG1PYnNkSWpmSVRFcUZDT19ZUVBuaHRIUXpaNGFiQnBTOHVrMGVTdFFvb0ExS0pYbWp8Vj60yLafH82y8qhmu1BxIr3gUFi963hxiFAdnBspPXY= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/45.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/45.sc new file mode 100644 index 0000000..17ef829 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/45.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx2aGc2ZVB6blVXVmdKNWVXTjlkU3RvVlRNcTFqY3czVFRDMUlwVEVzX0p1UHlfRmpmWmdualRhZmo0LVh0THBPVUhmUDZoekFkZEVrcFRhVm83dnU1cmZPdktOcFJ6UTIyN1I0MjcyUkU1S3ZfMlVBSGx0MFU5TWRuRWotMGhiWmhELVV8610FbnSvRth9SdVC1Am-lp-2-VAR5tdLzBQL7kFPeKw= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/46.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/46.sc new file mode 100644 index 0000000..9645ef2 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/46.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxUY09CUnpyeFZzakpjOVg5d1VENEFnRzBUemZZM3VwUzZSZExXQXp3Qm51d3d0REV2OFdkS3NpTTFQVEtzRWdTSFBMdklSQVAzRk5yTzRKOUJhXzBIMm13MkxZSVB5VFZjclNXbWVTQnRCeWRrWVNjenl4R3FtUm80RkJwNTFNVWFjYUhlb0psUGowVC1EdU9fR2hLVE95SVgxak1QR0llU0JxWjRQcWc5WlQ3dUUxRGVaU255QVhGeHFGSmlFeks5Wk9TQnpnYURyZjYtMnQ5eGxiREhPMnQwQ0dGTDI3bkxBakY4LXVkT1BBM0Y1UnNRYV82QlVZNDRDYml4cVhFRjFBUHFmQy1Td1N3VWlEcjI4aGdqQjhId1lKQkZSdXd5eVVScWJPVXNBdWpPTUs2S2JzeDdBQzdDWkxMX2hENkVkeXhIUT09fFSsK7EVDyN-twBBPhUpAJbKWVJL3e3e-oryTS0Gptk_ \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/47.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/47.sc new file mode 100644 index 0000000..fa4494a --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/47.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxrNlhBSTJrN3dKeVc4SzltRGVDNDVUcVpjSldJRklfaGtQcjMyN0EwVVp5ZFJUakZVM1ZzSlktdXBXVHF3bVl2ZFU2Y0xDTFRuRGJ5bGFvZWZJQ05qd1d3YkNNaVk5d3R4Qk9lR0lFX3A3UmxHQnZEUEhZMjF5Uzhra1pZaGxsVXVxN1ZkVHU2SnpkbUtCSmZmZ1JjRU9STkNLSkxmeGFfQThERG52VjlnM2g4ZU5oSVdCM218tzuauoYyLqD78b9QoY073Z90G2zU4SVn4AShBcQiZdk= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/48.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/48.sc new file mode 100644 index 0000000..b85cb44 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/48.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx4WE0wVjZ5eXRsN0ZSdzRnMkY3aUhQZHRjTjRlRXNuRDkxU3ZDeFBGUl9UelZPSnNsTVJuX1pNUWx3RW5USGoxbUtKNU9sT0dSZTRybnU5NEFrSmVDYy1SMEItVmVZblZqVHN0el9BMTBaY2NHZVlkMGE4ZDFKNTk3NnFnc0NweTFZdG4yUVItVG1rWV9ZdjYwai1XQTBXem1RZVJ0WUtqYmtuXzZVTGQ4b0JibklublZEWWJsUVRYaTRRNURSNWJUSDVEUlFvSDR2aEhqX009fHDobPXrZ7PCnuoYwkWqQHmvqwG9flgTnby1RqAp0eEk \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/49.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/49.sc new file mode 100644 index 0000000..7583719 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/49.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxPUzdKazJFaWlTQmtNVFltQ1hmb2FBdzZIZ1NndnlHWmNRbjBkeFE2b2ZZaF94TnVka09sUXJjUmw5UlZmYXdZTl92clpVV3ZxSzhWajBSUWtkV015STNtak5SNDNkSXc5NnNJTkk3SjVJTkVaQVJpaXpOVXl1R2ZlMldZa0lIVnprMk93TEl4UEd3TUhTNl91QU1BZ1p6dlBqSFdrOTlvcW8wbTlKa25KenNFS2Q0T0RPcy11cEp0ZVdrbG5kNlBkUk8zWG03VmF6TFdBLVVVYzJlQ3lvSVQtbDEtNmUtQUVQY2dFSHZtYUtpT0t4ZDZQNUliM01LbjJQdF9wc0lWNkFaNWdPSnMydz09fCUtVdRsGfGjq0xST1F2G02INSyzVO-RQV82fZAx-tF8 \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/4b6a3b5efec9fd7ff70c713e135f825772ee0c5b-6 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/4b6a3b5efec9fd7ff70c713e135f825772ee0c5b-6 new file mode 100644 index 0000000..dc9ef02 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/4b6a3b5efec9fd7ff70c713e135f825772ee0c5b-6 @@ -0,0 +1,38 @@ +J + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/5.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/5.sc new file mode 100644 index 0000000..44df1b1 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/5.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx5UlRweXlJS0JZanJyRXNFeDBnVWNfUjhDb0dlWFVQNGpUSHdxSk81ZkRrRG1rTVppX3pSeEdFU0NGWnlJTnF5alJnT2lESDdRYnpxeWo3YU1aZVFuSkFYSlA4WjIwaVFQTFJrNTk2X0N0eHM1SURNbDR1Tkd0cmlXUEdzeDJFb2FSd2lfemN2NlJFOGt6TnJDRk9PejMzeWFFbzAwcUhzZTlXZVFpWmdEdEg1fKISvrG7Go5WiuNqKEVCmCg02rTvoDUJR1MDwNdR_a7Y \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/50.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/50.sc new file mode 100644 index 0000000..91d0c5e --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/50.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxIWG9SVjBHTFFaZ1hTX0RYemlZZ3VtWktBSTNsYi1QZ25YbTdOV1ZWNTVNd1Z1a2ZzOU9sZzFyVklKUjJfbjY1bHNjbHRHZnR5Q3h5TVR3MGNXMlRDT0FqLVNnaGNfYmlGSllsSENJS2Zac2p3RHRwcm1hWER6eDdrVEdaT0ZuTy1YWlRoR2tPb1hWY2Q1ZmNVd2o1Znc0SHo1N3BUV2tmVk4weEZEMnRXRWhtTjlNSGRBUzRBZDNCWWVPMm4wVlA5TFNRR3l3Z2lMd0xyWVlzdEM1cHdoZzBvUjlVcThBN2dfQWt0NU9vR0ctX2h1U0hiUVFMfKEklV7w5Qdw5B-zHGdc_8KwMCEaJaU93kfrkF0UlCO9 \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/51.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/51.sc new file mode 100644 index 0000000..7958561 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/51.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx4QmExOVdwZHNGcUxERzVObjVVcGwyS3BGQWwzbDRMSWVEU25MMllkUHhTWU94cHI2SFJ4VTBUOExZeVZpcXlTUXV1N1RfMWkySWVHallzRHNnY2Vqbm1QSzBuY1BWQURZT29fQ1NfZXFSaUEzY05xc0dzSmw3a3UyZlh3bDhlTUJMcmN8WV5M_DCWr0mpbvysNGaacX1PWwZukYRGCUd7zasT1Z0= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/5122906052326fb2d0f65fef576c1437b95256af-5 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/5122906052326fb2d0f65fef576c1437b95256af-5 new file mode 100644 index 0000000..2eb43ed --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/5122906052326fb2d0f65fef576c1437b95256af-5 @@ -0,0 +1,7 @@ +8Q== + + + + + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/52.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/52.sc new file mode 100644 index 0000000..070657d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/52.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxhWkw1N1lYaXhlYXd2ZmlIeXFKMGVwZWZrRG0tYmNBVzY5UG94U1lLTjlPcVNDS1JUR1NoNkd1cnpMbUQ3OHFmMVFMRDAwOUFBZzh1OGVJX2dPR3RlOWhUVVZXcEV1NGNBcGMtYlB0M2tidTNUWXpLTVlLMHAwZVRQN3JVcHk2QnVXSnJyRGVpWTEyREtEQ25KaUZmZGRsSTRtZzN6MFJKeFFjMVh4b1pvOXBOVFJTZDVhY3ZnaVJXa053bXRmSnRha3B6VkFxUFZrM1JtUWlLbWMxeXNuM0t4UmxGXzNBPXwxnzQayybnomVu9KKV09VJw2upuS6v6c1S3b0sJWkzYg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/53.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/53.sc new file mode 100644 index 0000000..c15bf39 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/53.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx1WVpMRXFVYXY1X2JmVkd2X292V1NyYzdRc0k1ZGIwYm41all0Sy1veU5IWHNXYjg2OGxGdFQxdHNRR3RqS0pYZU10bmNVOHBEOG9OYXRSSXpnZnlwX2hlUV9aaU53dUZJWUdkM0FBcE1mTHc5QXpRWU5jYkxHY01SbDk1Qi1OaWRidmkwMnI1OXRIM1BPN3ZNMkx4M1NHRTVGb3pGaHQ5bnQ3U2dVOS00SmJ4MGZndW50T1ZUQllCWHBnZ2dxcTRZS09sSkJjTnNTZ0EyU0NufLwPEP2PJ8RYQ9tckzQTz1lelud5sVzo6Jlpg8JkdBnE \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/54.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/54.sc new file mode 100644 index 0000000..d3245f4 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/54.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxlM0tBMGdMZnE4V3JLTHAxMFdIOEZTTDcxMzFhNlFaa21sYWlVV0dPc01ST2t3eElrd0pYSk4tMzZEUUVCekdYYWo0aXVxdlNHRXJZN19YR3g4MDd5ODd2OUpMb2c4bUM4TDJCWmVqdGFwd3VBVHFqXzZaNFpoQzNqcGZmMzI5RUpOX3p3N29HUjNtdHV3MDNLb1o5Ui1HaDhEOWxIVmp3ekE0eEMzZlpEQTFWaUlKQjl4UzBleVZXajlsOHpKQm5PcjUySF8zRC04RnF3dV95SWdfcm96VnZQMFlNUTIxMkh2dkpvRGgtM1dNa3hhRElCVEdTWGhqQlFnTndEbjZZVXFiRUVQNVpmNFg0Uks0cU8ta2tmLUxwSTlBZW5KZ3g1WGJpMUtVT2RXSmxIOU1fOEV4cFc1Snc1c2h5eGlqWTkzQT18oYMWx-zYrvIFzHtsBzkW0omgLkRlrOi2tV236JFCT_M= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/55.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/55.sc new file mode 100644 index 0000000..36c6f9c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/55.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxwNXNlWnV2cS03bDdrdTItdUxtRUZyMC1KRWFJd2padHFyS2hhY005a0szS3hkanY4RUp5TnJPMU9Cd1BJVlduSV91SFhKQnBnZktlTUgxdG5MRV9IcWJEQ19fZzZzNDIxaF9hQ0J2YV91Undnc21XMlduMUptSV81Rl8xdnY5NWN1aFdmaDFQUTlkWXlnd2NsY0pLSlZGemR5UFNyMHdCMWc9PXz_khLrMOYAvmm8TxPWewFz30kjj7NEr2ySyO_Tmifbew== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/56.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/56.sc new file mode 100644 index 0000000..c136dfc --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/56.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxFY3ZmNU0xdF9GUGZJQ0FvRU5JOXRlWEFpcGZxTXNhQUFhZlJPMzlaT0tNZzY4Y0VZZ1ZxWDRtUkJhZXo2M2d4TERXd1Q0Tngyb0J1czdrMGV4RWVfLTFWZXFTR0hYZExSMDVuSUVNZ19RPT18GQy_KUXhl6Dgc-_uGeJPfHdhznbqAKhEA0jEZq0wSKM= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/5601b416f11820e0203c84570e4068cf87acad17-4 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/5601b416f11820e0203c84570e4068cf87acad17-4 new file mode 100644 index 0000000..12127a1 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/5601b416f11820e0203c84570e4068cf87acad17-4 @@ -0,0 +1,2 @@ + +  \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/57.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/57.sc new file mode 100644 index 0000000..89b174a --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/57.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx2bVUtU0tHRFM4cTlKbXJ5Z01TdjFoTXE2VHM0eGlSQ2czV1h3aFM0Ym05YXVkWThqWWpwLWZMbVp2Tm52R0Q0QXhMVGNhQUh6YzVWc19fd2lVMUNGYmFZOHVJWkd5SXhlODhtMFp6dV9vc04xdkpVRDctcTBGUk1MSG4tTE5KNlZLQWQ3OXdqMTMzc3dMZXpza2lSVmdmX3lpejJZcHp1RVlFQXg2aEx3VTlyZl8xbmZxdkhpcHZySUVsNUR6eU51NEE5NUFaR0xSNG8tSk9OQjVRLUxsWldNdUF5M3RhQ3FGdjV0Qlk5Wl9hRzdkZndtTTd5QnBPcVNjV2xmOEg0QVJkSEFwZnRKOG03MjR6OEJIZjA5UEVvMTNHVHwcuDVKBM6I7Zpg7kt4Pk-iLloKwO8M8f1qNQH7qLp0sg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/58.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/58.sc new file mode 100644 index 0000000..78b8463 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/58.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxoMjc5X2Fyb1dtWUk2MmZlV0NyNWZMU3BZUl92ay15blBZWnNmQk1qWUlkOS1pLWxkUDIyLUZwY3R2X1lRQzZNMmJnZV9iYXdYNG9pMmVISjZsUHNMSUVwQnBHdHFoSXc4Mm8zcVY3UnpjYWZJaWdSelZWMEI1V2NqOWpFY01oUTVXR053TzlyRnB6LWFzQzJKckZ1cDJtZDJndGFPZFRxdWYtc0dGUGRhRkVsdGJ2WmptUmNlQnZONjAwOEdoamk2anItSzFWVXwHNj5MIcwy6_5z9_v4k_oCTN1AX7sFtrk25QICzUSuQQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/59.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/59.sc new file mode 100644 index 0000000..c48464a --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/59.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxsRmNtVjk1VXdqbnlWeDVDd0Q3QlZSaXdaWkx5Sks3QmVNb3hKVWU5cE0tdXBtQmJuSUkwNHJ6SlJwUmVjcjFhNWp3RDZNN293eGtTb19RU1Y2Q3NpcXFFQnhVdWR0eUFKYmNjT1dPNG1xZGQyeVMzYVFuOWROaTQ1allsRzloQ1NseVVzcDQxY0hGdVFGWnZyMzFWZkNuajBzbGZmY0M1WXZTckxSS0tYOGNJU1Rzay1WWXh3MHBhV3hQZmdFUnlpeTVUbXR5NzF1OW5CQ0h3SHhyLU15MzdhSmVMbVlNem50ODNxT1RmQTkyVEc4NksxVWk3SU4wbnNKY2xPdz09fEL3LkMkHs9AH_Kktdn22O9rjO5cdPayirCVWvy7NdFK \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/6.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/6.sc new file mode 100644 index 0000000..e27da3a --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/6.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxpUFhiYVl5dWhheFJxclp4RURnSWpUTnZLd1NDT0hLOW44bnRhc3dES3VZYVJsYzlBZkgySGhfTnJYcU02ZG5zY2M1TmFOZDhETTFqT0tMSklESmZTa2VRTmJYcm5UM005X2p3UE9aUmx1Uy03MEY2R3lMQjlqVFRGd1NHWXhGUXNLTkwwbFN3a0VFcTF1ZzZlbmtvQ3luRDRBd0x1dGZxZlIxUWhwWWZhcDlHS21jay1PeW5VV0hXSFAyRDlERGpTa0pwOHhXcU5yRkQ3NHRHOFFrZVBManJDRlFvRl9qZUJvR3Z4V2F2T3JDT0x1QUtScjlrMlZ6bmFlTzhtd2FId0xBekktS240ZHEwQTJ0TG03UmJFR2tPVVdpY3FiN0xuM01ib3Z4dy1HZEFOUzQtYi12WkIyOWxPV1QzMk03SG9RPT18Oy9xErnKlbCafCV5ZRcdNQ4oAkM6AS78DKMLRzE3Gp0= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/60.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/60.sc new file mode 100644 index 0000000..bf32a57 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/60.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxXZ0t5V0dfQnlNV3Y4d0dTN3JseVBuUTVsSTlYWGdyRE1XWGRNZ19ncUtZRFR0RWJMX2FaV2hxWVRwakx0VDdNQlBrOFlWdURTa09Jd1JSUlgxTV8yc0R1V3hmcXlwTmdyc2dXVDdBTjR4WUstZEV3TXdFU2Q0NUVzb1JKNnNzaTZBSnhweWhFZnoxV0Jta3hfQUtySE1ZLU5aWGQzcVlrbTJYNXlTOVNwbjFPMnNzYWZNTzRVWXpKSGFpejNrN3FUandSVVUtYml3d0pvSWVIQVFENV9TZUdvajdGSm94eDZBOGtWZFFPOWJfal9CR0dfaEI3bk5rbDVZX2ZPSnlJQlZBaFVXalllMDFQY3c0aWtoYkctQ1YtX1VKT2sydVVPUDg9fLemJf00wrx74T_1wH-isE4OGkygea21I7GLkI4X7udr \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/61.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/61.sc new file mode 100644 index 0000000..ac692a2 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/61.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwxaDl4VUR6MnlJNHU1alhmRi1tWGdabVowaEJsbzdWb0xIekw2SGdVS29Td1BWZjZrQ3Z2ZmQ5cF9SZ256Qkc4cHM0QVRXMWpVVm1yS25HRzdkY0hWM00zc2MwTVVfaWFDM0RBSzlqQ0VzVko3MkhJdXAydzY0VmRWQkdXQV9FeUI5ZER6VFhpSzBWVDlFcXNkM09QUUxUN0F1bmpKQ2VWWm5oUzVEalZLbC1oellOMUZzQjBnS2VxX3puOFdJdm45alhXVHBIZ0VZVEdkaVpmN2NHSGVwU0FlcTdzc2Y0amM4bnMzZTF6ZGtXLUR1TTdSZV9XaWZwZUdTMkp8GA8K9swZ2XKR0-0_JudwK_Qa4BiuzOOxvZWn6Gt1pBo= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/62.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/62.sc new file mode 100644 index 0000000..6e874b0 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/62.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxYaDYzWUFLYXh4VWJFVlM4eWMwcVpkWlZ2bEJxOFNYdk5sUTJfQ3RPYUxKT1ZOTGlfYmNIT2tzWUprUkFWQTdzdUgwQUpOcjgyYU5nYjFDRXIwUVhIaHpQbkVheXxTuTszScurs8XNj14TW9ZRbnD2xmn-zFDAIyc8ZUDrXg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/63.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/63.sc new file mode 100644 index 0000000..22fe4dc --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/63.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxEZHpBelhtbTZXUjQ1RGVsYmdvSEVCR3VtQk5vbEg0MDF5UUxwcmRGeEtjd2tqR2c0Y2VWMXlwanE5bnNndkllRTh0Yll2NU5aUXBSVTdwazE0bDZLNXF2bVZocHV4QVBpVlUxdjJJTWtHMy1VYTV1TXJvOGxPa3JXT3FFY3g2VDJiM2NEZ3ExTS1RUzB1SGgzVVl4el9hTkZycTZZU05vR1JSWVhocGNDeV8xT1dxNHViZndyS2VOeGJFbkxRPT18uzh6hDGbvGTPDjTotEtdXXbulR9ukML3n9YHQBzyX_U= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/64.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/64.sc new file mode 100644 index 0000000..90e3a4f --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/64.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnwwanp6eU51aGxsSEt0b0ZRNXhkUjU3YzZXWjJySnc2aXo2c2FYWFB3NjBnUDRnQUpPQ082bUZrTmJ5V1pvZVJXRi1JTzlsXy1KLVhpMzNidnlrV2xOT2RIVE5QalFqWklhSTU5c1BoSmQzY24yLUU3RFNMSXExTTE0djdyMDZqY0FIanhYWk14WUFERWk2a0pFbE9BYTgyOGJKalVCRm9SVWVYb2lvNW5pUkQwb09hUXo1bXBiUWRBRmx6cWpmU09NbWRLVWJsbnyekkTo3BRb4h8NxFsA-u3yJovwUt6YiFZRA6601AWliQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/65.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/65.sc new file mode 100644 index 0000000..fc436e1 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/65.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx6RXFNam1mMGdqdl9FdWdYbVhENlVnbElXVFVlVEloSWJFTFhQS1pqTzZONk90NDJIQ0pzTFdFMC1kdGlnaGJRR2lQTnZjVHVvbDd0SjlzUzhTdXJiNl9DMXl1eFN2Z2x6ZV9nSGJQNGxEQ1hDdHFoVGlSeGFmMzdsbG5ZcXZLbC0xMlJVOHJlU0E5WkFKcXBuVWNKbUQzRXhQdkswTlpNR1F5SFBndWs2dFZwRmNxS0Y2OVp2LWVvTmc9PXwa834Gqa_XEA5QQg7bVXgvdF3xnPxb8SYWMk2DYOmPfg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/66.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/66.sc new file mode 100644 index 0000000..a4887af --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/66.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwyUmFwak85TjIxOG16amY0bnVyLWJ2cVpmdHdGOFRERExoQk5PajRIM09KaVBjWEN0UHB3T0NCUGstUE9EOEwyRE4zNVZERkx3anBQWFhwTjk1MTNTRWxTRVA0eDhpMERxUFdfUlFxdEZDU1hFT0pCUGNtR1JUTHB8vOPKYBrn6hBxJVx8lm83klo8lEfuN5HNBE6iMfRcVUo= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/67.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/67.sc new file mode 100644 index 0000000..dfde3a6 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/67.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxCOXhFREpZaVJKem5Ec2lodER1RDd1Y3JsWngzQ0s3ZTE5RTAwRHVaRGhvWWpIa2wyWldaSHlUZXYzVGJ3eTRZa0oyNE83MGtxRl95SV9LdkRIQjlsYklwZjRYbzdKX3FpM1NkTnZNc0VlRi1kVTl3RGNjSXRkNFQ1ZkFJemJ0M2d5SG5QRmxiR1RwNkphUm52a01LQVlPSUZSaFl3aTlHbG42VlhnT0lwTHRUM1BkOUxKSjNKU1VEaWNNRVFna1FuY0dBQm1vemhWREpBaE5Na3JQWTV5WEtWZHRBWE96VFQ2RlljTlBkZnk3R25xQ1lXUHFEWjdPRXJMQ3pCOFFfS2hNcnUteWtDODA1WVVlZ182SDRQaUd2SFR6LUVnWnE2c2NXMldLX1ctQlpTV3RqUm1wclYxU25ZcnpvaUZpc3laTTVVcWw2RVZadFhYcE9sS0pmbEJLV216RUp81kEhfeuoPh7fasWg194BQUrNABxQRgO5E0UZhArboiA= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/68.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/68.sc new file mode 100644 index 0000000..06dec96 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/68.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnw4OGlmcDZDelEtZXJNQXBFSE92SXBFcjFGWVFYak5vTWRtX2oyclQwUmcteC1Bemx6bVktVTd6OUk3UVVkNGZ0TnZIOVlHRmRWbUVUeXNGSHBCbnNiQUpCcWZfa0Y3cmI2ZWMyd1ZST0puNE1qdmJXODlQa1JaVXhxQU9FcU51ZkpuaUFJZUV4ZW82YTVZUmEwZThfMUoweTFpYTBzWFlWMUlfZTJ6ZC1nc0hkNWcwR05nRWJYTjBkaXVLRVJaZ1lORnpNVGZ3SG10QVh1WWJuTzFnVFl3PT18NNpLAmbpk2NJ4nUzZwjMB67lvypX_GHa8s0CJ-ftV8A= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/68c721c56a20c85b4aefdffcd60437cf2902b0fa-10 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/68c721c56a20c85b4aefdffcd60437cf2902b0fa-10 new file mode 100644 index 0000000..ac94a21 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/68c721c56a20c85b4aefdffcd60437cf2902b0fa-10 @@ -0,0 +1,9 @@ += + + + + + + + + \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/69.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/69.sc new file mode 100644 index 0000000..e75e6bc --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/69.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxWc0FwTUN2ZFdZS1JuZHpjazFvYkluVUhrOERDLWo0TFNaSV85QnZ0N2x6b19TdEFYcWJOQU1XR1ZodVNubGNmUXN2UDdMeDB2OXdfV0s2a3JPb1k2STlwU1BZWnJ2ckZnaFVmdWlaMFRDMGxOaDNSTm03c3FpMEdvVWxhdFh2YTFtYXU1bElWZnpaeGJkQUJWVDdIazZsQUVlRl94TEtWeFE9PXx0Ao9dRKXodS2pdmdMxn4s2gqMdvIf0LyqafRO2A6Epg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/7.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/7.sc new file mode 100644 index 0000000..8f3d200 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/7.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxOUkxmblc1cnZBRUlKWDN0X2NZYzlwZmJwalBvdWVST1M1dnRFb2lKd1ZVelJ4ZHcwSFNyRGZobUMtMUlwcUdlcUxUdlRLc25ubWVJSk1qR3J3Ql9sVXNpeWpFU3h5Wmd2dm94SFEtU3pqWHpvUzl0YTFjOWtWMjRNRUw1NFh5SlRQa0tPV21pVXFieTc2cFZCOXYxblhsdW9WZVR5cmlZYmc9PXyOjmpasY0soiOXocnIfIjXzLBdvcIJSUf7MtnecEiumQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/70.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/70.sc new file mode 100644 index 0000000..4423068 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/70.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxONy13NV9kajB6Q2l0cEpZcS1oUGMzbTh3UEZqTUVGaTB5WVBTQ1lFNnhOS1I0OW1sLV9FRWZPNVdmRDBTakdlTzVLbXRfVFh0dTN2d09CekI0ckhCZlF1NC1PRHJpOXRyNkdPeUlQeWZ1WEhIenlodWRzeUJ0OERWOU9pQVYxRTZpTU1CQVBaMWtuRGJDSEtIeXpBajFweUhfNXZMbmE4WGNLQWZUYVJUQ1U5dGNQeGdNSlIxTUhiSVRvZDFxa2hVWUdxR3RVYnBzSWtrV2pEVjFhTmZFdE9DYkJiMWxmcVI2bC1PdDJnWHMxOEdoY0laQkdaMGEwUUYyb3NHMkhUOUYxOUMyQi1FTTQ0MXJqazlVRy05dz09fAeQr50BUvNembveqXWEGP7rlr5dtj67s9wqE6gHzaaC \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/7095a5454c9f66801f2b298e577a488a9cadf52d b/vendor/github.com/gorilla/securecookie/fuzz/corpus/7095a5454c9f66801f2b298e577a488a9cadf52d new file mode 100644 index 0000000..bea6e84 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/7095a5454c9f66801f2b298e577a488a9cadf52d @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxjMHF0NHdRdnBtLTQxZF96c1h2WlZfbnV0V1B4ZjJwWTlodFpLOEU9fCET \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/71.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/71.sc new file mode 100644 index 0000000..c332155 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/71.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxsLWpPOUZEdzRvVDY3OGRkMjNkNnFhV3lSYmVscS1SQlQ4X1FyZUU4NFFQaUp1cmxwSkFrZWRJc3BSSjhaeVlZalFxNnVNUHhGcWRGZzRvSFkyOE4xc2V2MHRxVHdMQ2RKVFk3UVJnZmxKSTZkRnBUYjZqTk1QMjBlVDhXN0dBYXA2b0hPSVRoNHZIYUkxeXRaZ3NzbzRLR1dEWE42ODVrTWhIUkJ6cXJvaW1GSDAwNDI4MUdlS0lIWXhncEVXVDJBSE13VkZaM0tyRT18W02jU9IYV9lzRqQQxfOLzy-8Bd9bDwNImCpHGH6rnF0= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/71853c6197a6a7f222db0f1978c7cb232b87c5ee-3 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/71853c6197a6a7f222db0f1978c7cb232b87c5ee-3 new file mode 100644 index 0000000..139597f --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/71853c6197a6a7f222db0f1978c7cb232b87c5ee-3 @@ -0,0 +1,2 @@ + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/72.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/72.sc new file mode 100644 index 0000000..6d2e42e --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/72.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxpZ3o4cWhqT2pvdDlFbDJkQXNadHBia0hOMUpIQXBCQVozVHNMRlFYZ280SkhGb1JZeUJORDloMVRWM09LUjRYeW92MF9qaHdJT3pua0hVMWNOVUhaYTdLTG5mQXpmX1NaMVNlaUhZPXxTJ2ptj0jydEz6XpNwmpmW61lddMyLC1R1pxzI1eELCw== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/73.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/73.sc new file mode 100644 index 0000000..ba1a772 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/73.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxpanVFSDVyc0RGd2JSQVdHaWl4TEdmQ2hKSzkwUnFPN2t1c0hSVUJ6OGtCREpsLWwxb29YaVY0azFIUzJmYUZCOXVxM1A3YlAwbVctM1FzR29JcUFYSV9qWEo0Q3hhZS1BNG1wTXJFUkg3czVfYkJmbG1FTUpYRWhuajRQUkVjVmo5MzUzUT09fBj3LQ__1HenyVLrv81zQEy48ViAGjoQY2cq3guJe9b3 \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/74.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/74.sc new file mode 100644 index 0000000..3cff9dd --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/74.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxaY002LVp3cmEzR2VReVRBUWhkZTBsVkRUQi0wcWRrYVVaNUMxNy1vdjZldVpwWjFIUnhsRjlHaDFnQm1TWm1fUFhQMlppaHppTks3T1RudGJfN24tclpsZGl1NEdiQjJxLUQ3dlFDbExoMmJnVVpGX05FZDF3STg3NzJuSkRMZ2xnN3lqY2xDM3NBN1poaDlzMzBhWS1tWHB1clhybWxHQUdJckVrdWhrQT09fFQeJmtO8msJrVC858xkw_S8fMoaOZMkHV1aI4Jh-IO- \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/75.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/75.sc new file mode 100644 index 0000000..5fa1dea --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/75.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxndjZkcXRUT25pNXdSRVY5bWRvbHNSemROWGJHZXBNZ2VXeUc2ZVcxSVpQa2pTcDVNU0h0aGdlcVZBeFFFcU5SMW5JVnUwakpfWjlOQmE3Ql8td1ExOTEzNXoxOXZ2RzlkclF6QnhTM1ZEYy0yc2xIUldRT2F3SUhacFJLYVhvPXw4CQ6cMxjmD2QJtJJz4nUnQIaNACfQALE6oAWm6m4r8g== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/76.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/76.sc new file mode 100644 index 0000000..a78f94d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/76.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwyNHNDMDlsaWw4ZG1MajRrTnNkcWxlV3BIMWZQWTdwZGJub043WU84T0FHQlBnc0NVZ0RsQzVTUEFDRi1JUU14X0pGV2JTUWVVWXFEd2JBNVFpbjlTYXNNM3huVmFNaEpsamdMWVNiX2xpZkUyWU1IbHJzaExCMzhKRHROWFotZGVWMEI1a09yNWNRbTkxM0FnNzkxeGRiSnliMTB0Vjd4eHoyc1ZDOFcyUExLeFZRTlVfWFF2YkdaRmtLNzVrdV84SGRWdU1NcmtnclQ1ODdHaVR5RExTR2xTUVFpQWJISmNpZzBRZ3VUX2wxeDFWLXgxa2RYVG8yVHdfWjFSYUhGc0ZPU3ZmRGFvNHdHNk5GLVZmUVJma0tLejFwMVlBPT18oNqBh6DhdbWHZytoN8fI9neyTMW05JckdFpJQVk84H8= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/77.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/77.sc new file mode 100644 index 0000000..09c6116 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/77.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx2Nm9oUDJCSGQ1eUJtSFBTOWRsZzVhUGlpUGdpRmNiR1ZidElBbUZRX0RVanIzN3NvY0lFUzc2T2NRVjNFYUxjeURZTFdyLTRpZDl4RGlBbTBsby1DVGtoUmFnRjB1bTE1dUFMbkYwbjRiR0NvcUpEam81UjBzZ09CYl9SVURudGgwSnVQUHo2R0s5QmVYel95cDgzWnZUYnBBdmlESm1ReHBDazdGa1hoZjBPSENHYUFZVXgtZmlNT0R3MnU0SDBUdUVNYlhQUy11ZUVMazdVMlZOUXFBcDh4RVAxaFFVPXxDq1pbr8BUxXw2qZpJMevp_9IcMC85wOHzyARU2H_nWA== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/78.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/78.sc new file mode 100644 index 0000000..cac4aec --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/78.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxTV0Z2NnJRUkxfWUh6TDhnSG5OaWdWR0FjNG1FN1FoMTN5QXBTRmg3M0FPNjFYcmtXeTBBU29HQlpRY29hWHNZLXFKdEVGRHYtdUplQXpDeVBpSmhKY1oyZHBzelhPZnBoVURFbDBleVNzMkpONFg4S1YxYzktMHFHc2VoX3hWRUplelFvYk5lN0RwMERSbWxZYlN5dEVIUUlmNFd5SEhqRlhRaTFsR2NrQWQ3UE5SMG9zZkxCR0ZlbEs1LWlzdUxzYy0ybVZCWjQ2R29OOWhyckJmVHFPXzBHM2VYLWpocFhPdGFxci11UXJhQjhyUHh0a3N1WWd1dHJaSWZkUERwTTdiYXg1ZExnbENjMjhJUnFWak96dGQ1czdBQ3lxR01EV2xzVjF4ZFBPUlZYcGZ2RXJZNmVvOGRpUDN3ZUp5M1MyY2FVM19RUlprPXydkj-7EvCOCaQNbV34o-vAQ8d8-fUHjI-c8krAQRPnYQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/79.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/79.sc new file mode 100644 index 0000000..8f34884 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/79.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxOY3l2VGo3WmNvWURFbmVsTEZlYmNKSXVWbmI1SGhOeEU1aFpKb3RKWjByQkRiaEV5TGJkMVhwV3JCQzBSMXhsRHBPd05VMjA2M2lmb3B0QmdhaWthMUdKSHV0QWU4M2ZLQWpqb2dpQWZKcm9YSnBlZkpYWE5ZY1pDWEV4TklMWXpMTnNoRDVSejc4Y2F4aWc4bk5ORUx6UlktUHFjVkxfSmxwVmVSYUs3YWhmZzNSUjNKYmRTY3N4cV8yWnlXX2lCX0ZrU0V3TXNrN3otTUd3YnpuSGstVjZya3RXM29KQUtHVnZybXdrLWdWRDRlSS1kMmRab2dmRE1uYlFQcWxJcTBwTWhsbGtURVUxSHROaVE0cVlzdlNZYXd2bnRteXUweFRzSXhZY3xD7IJyMO91H3LSSM2v0nyqzyfNexTgGNeSYxw1n1YrWA== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/8.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/8.sc new file mode 100644 index 0000000..e373c75 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/8.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx5ZjFSUkZQWHF6R0lrUlY1cXBwZTZpd0NDQXh4TXlDNUJuQWtldTQzOF84NTRRNFZFcVdKck9Ya2pDX0xINm0ySTlDYlA3RzNXY2FKbk8yMk5vc05XbzVEV0NLTnA5V0lSc1BUdEtYUmpTQXRUNTJKMDRyc3FjcG0xOHlWMlYyNTVMQjl2T0JlMlVSWmxkd3R6SEhPck1nTEdZWG9pU2VBTFlKWG1NS21MeGVkT0RQUi1WdUhlT1lOZ0lNSVhCQnRMRlk1dDBfZnRtZUlMUTFuSWdJakhZY0d3VUNaLW1maDFEUTFwamxZcTA5V3d3MlQ3enVMaDdfajhjQjl4d0xyNlQtc3dOMEhDbWsxX3FQN0VRWkNBU0d0MXZHanZhZTdfaDFqZlIzSHRIWEJJX3haZUd0WG9FeXFYSU1Za0JkdHBsNFNxQk9TM0N6RWtmRElJZWhUfKjpFKhD4zyUX3Wrcy0WeL0FzV2CQX9amyu939W3kXSN \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/80.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/80.sc new file mode 100644 index 0000000..460e921 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/80.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx0bG43b1BVZzR4MUs5WUZNWVcwRGQ0cWVEbFRqY1FnRDJLdHVTMUdSUGdUdm5ZOW0xYUJUZW5YV3hUYVBqejU3VVhpMU5lQTg1LTNZSnNzajB5MktLTEZYamdVXzN5NVR3UF9fM0R4ZmtPMEtLT09ULXNWRWVPRkVUREVnUWhudDI1dDIteHZaVGV0SW83ZV93N3FoOElWckZqWGcxd1g1cmJHZlI1bUVxVHFOT1E9PXy7SPZGoPPnDxm8JiVZi9hmXvvaIker83ubu_xoQONmKg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/81.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/81.sc new file mode 100644 index 0000000..f2d9ad9 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/81.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxKU19faFdTdGQ5S1NrdThZN25Fb1RmNE9HT3JQcjdIaGxIRXFBMDdMMHc3VzJsMnN1M2Y1aE1VQUVlS3lqQnlCcjJOdkZ0OXRQUE12VUJMRWJiR3VJVmI4N2EycjdZOWo2THJmcV8yNEVnWG90NU5JUjh4RzN6ek5HZmxINkJnd1JZbDNfR2VsNTJRN3lCY1BmY1J3UlBKa1FkZmZQNHJLZ1dBVFpaY0J3VTctamYwY1AxSFh6TGxObUxuZnR5aTcxV01ZMmc9PXxHixMgIoezOeAoBv4fBC7eHYtIrvhSSu_I2XJgVc76RA== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/82.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/82.sc new file mode 100644 index 0000000..371335b --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/82.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxtdTk0NmQzLU14OXVVMG5USzNXdnd0azFIcXFfOElxdG94T0tYWU56TzRhNS1qVDdjVFlURjlrdklZZ1BpNldHczg1SkVHSWhzNjlBRnN4dXI4ZkFObml4ZEM5VUdxVkxfSmRHV3dpWjNleVhyUERhYm9OdDZNMkl1TnlXaGRNa2hyaEdxNVptVzlOWEhaWkREM3JnZ3AxSVpRaU0tN1NPMTNraW1LS3hBQjZPaThxM05fUlliekVjWG1VPXwmvTU7eZgs2jKeks78dS_iaI9YAE5euzu6plCXKk2goQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/83.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/83.sc new file mode 100644 index 0000000..794dd19 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/83.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwwU3BYN3YtbTFrUm0xbUtKWUlidW0xVTJ6Y3Y4U2NLajRtczh4Mk9wUDJVM1RJa3o2T3ZHQm9zaElwMjJKTVp1M0FqYUtKNGplNkw5VHNiZGU4ak9ENVZwRVZ5OFhYTT18HGfGXzhKalF_Nuce6azPPzYwsYHXcq6aWlMSRTGnklw= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/84.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/84.sc new file mode 100644 index 0000000..8d49ec4 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/84.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnw0UE9TaHhpRk1TRnVlMDU1Q3c0STV1dHZaX0plb1RhRC1HeVR3V1lITC1HanpLMGl3T1RSXzE1YnBjUzUxT2sxWFp2VWQzSE5wellmai1BUm9nQi0zTy1MdERYWTBBU0lkQ0N5WHBZV19wNS03OVJPeUlRVWpsMnc2bjZfRlFjendVRzdzSm1aaG1TMmFoVEtORkg0aWJfSzlzSEZ5ZFc2amJsb1d4NklYNV90aEt5MDVTcjM2QTRYeTFhZEhoVTlrQlA5NEpNU2gyUTR2TTRUcDJxdk5jZXpIQ1FFSjVkOWI4b2g3RS1vWnRFPXwkqgChSUkX36GJC3EuUK4WURPWCCegxHB8tPv__n5PXw== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/85.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/85.sc new file mode 100644 index 0000000..a6e39bd --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/85.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnw2YjRRak5MaEZJcVpnamhkeWRkYWNnbGFSWnZVT01XUVRUY0piWGFhSl82dTRraEFDZEhnOHM1MG9YZnNIMWJBdkpmaUVscjBjTmE2czgxWTc0TDMxR1VlVFRqUERvaFUtSFBNUGVuclVTd3VjaDh0R3l0MTAtWkZ2Z0FBNmhCOHZ2NC00MlhrTVE9PXyKjjYod2keoNkH9xgBYzdhfn92OG0pynAFLXSXosy0Gw== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/86.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/86.sc new file mode 100644 index 0000000..a2d9739 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/86.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwtZEpLQVA0dU1Ga1ZqaTd4SGJJandmbEFuVllnaXJmTnBPM0xCLW5LM2tvdzZlQ3JfdUlaLVFleUd2ZGZ1Q2tDUG5aNmhtUGpPdW8yVnZiaERDcnU1dHFwUVBjRFp4UDFLaGloX0Q3VkVZU0tESjJ0aGNKdHV3S0JESjNLVTRSd0lLclBtX1hNRFBfaDVKdjczQWtwa1o2M3N3RTd1RE5kSDlxbWRmT2RUQURpX180YTRWNHhQM0k1cjJnN1Y5R19aY3pYTk1tSWtMVWZwdzhUQ2Y4dVlaS0xYbVdrS2Zhdkp5TlNVTzF5M3hSSmp4MXN0LTdFTjhSUnp3X0Vpb21wcko1alZKSWRScDlVb0pWeTJoaDlZNmc0VDFQT0FId0c1WGJLSU41Ung3SlBsNVdld2FZaF9pbUh8m3-4Zy4L5KCxUET1y9iV5cJgt0FTXBulXvO6e_Aeg_c= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/87.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/87.sc new file mode 100644 index 0000000..fba2d8a --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/87.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxBQ2R0b01ORnFrZzZIalNBVDlGLW9PXzRCVWVvYWIxWC1KdzJqUGRPMnZ1Q1VSYkNTd3lFV3VPS1VMSHRWWnEyempXVTRLY3NkUTBodWQwZ2p2Sm9RdFlPRzFxMGtqQ0NGWkV6SlB1a0Zkel9rNkRrYUpaOVpBcVF6Q0N1aHlRM3BpRTE4dVU1VWd0dmZ1dkxWXzhPTzNOeDJaeTJOWm5KS3RabWNPZENJRVhiZ3NOUk5KX0dWYkRtdEdaNlNCNy11T3pvWUpUNjBUTDVQdUFJeUZoazQwQlZCc1BYSHYxeWtfUmJKSTFHY2dBeExRa1ZXY2ZWWFlMOURwOGNYLWFKT3dRTUNqdnVPb3d4c0dWYlBRVWhmUmZ3SWlyS3BvQzN2SHJnRndOZnZKbzFUNkVPUGpIQ2RSeWRzSFlYbG5pdVhFbFpYdzA5RnBNdWVTdEh1ajVGdG9KWWFzMD184QvlQbFCVsttDDm-Pf8YvgzUBk51UFvHe1EZXrM-vXY= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/878643f2e5fb1c89d90d7b5c65957914bb7fe2c6-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/878643f2e5fb1c89d90d7b5c65957914bb7fe2c6-1 new file mode 100644 index 0000000..f6d4cee --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/878643f2e5fb1c89d90d7b5c65957914bb7fe2c6-1 @@ -0,0 +1 @@ +YA= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/88.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/88.sc new file mode 100644 index 0000000..7b84569 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/88.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxLM2xubFVwSU5qVnJHS1BYWThYZjFtYmcxNmVsLWxzRWR6VC00RkJOVUdUOWpuTzZTM1NIT0xUTXNGWTJpeWFGQjlZMlJabzR4OHJvSnpyVXIzVTBVZU1FcVIzc3pGS0Z6QzhCdnRDTE14dk1DYmhEUkFtOUREYWtQMDkwTW1IMWg4S2FrdEVvajRSbFRHaU9VVlhfZWhxU2ptTUdZdXNZeXVUd3FWZ21YRlhsREM1eWllM3lrWGw1TWN1NUxZcEViZ0ZnLVBNVDVGUTQ1QjAyRG55bUlYbEZad1ZpNkZNeFc0TDRfUmJKV0lUSUFWMDlEVnlLemZsNVl2T1kxYWY5U0pQV0VaRG5oVDlqVFB0U0k2cXlPTkpSVUNfalJndDhrdWJITW51cThPYVZ2RWVXQ0czVEFuUGxVUXVIakRiSUxLaG16OVNJWHBIeVRkUTlBMHc9fEYKEvjdgKBHD3Zn9ScjC71jYwMeS2-zY75xQnmpqCSO \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/89.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/89.sc new file mode 100644 index 0000000..9521792 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/89.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxEV2NSaUl0YS1kY2t0YnpWZnRDd3dfM2M5LXE4ZFI5TDhIdUZ1R05PTmlJTHoxMlNJaGxzMFA5dkljRVJRb01zdnBla2ZQZTFZSXdoNUthNzJiZ3JSc18yc0tRTHVJZ2hfZkF0WkUyNXg5OE85TXFGcUFIWWU3dml0bDUxdWpQbFQwQnpPS2NYek5kODZla21XY2Nrb0ljTVdRN2JZaWlGX0pOSUNmMWxzWDA2ZjM5N3RoWnFkSU1BdG5aSFFkcGQteW1ZbUlJV2NUcExtcFdPVC1nRV9neEtuX0VSMExXYXJTN29KZ0R0ZUgyNWU2ZThtVFMyZlNHS19xZHg2Zk5NcVN6bmxTVHNKTm9xa1g2TEVZNjhnNmlrRm9rU2R2S3AwYXBBUFJYMzNKbGs2LUllX01lVkxLRWxWUU44cEtia1U5ZWpPd0NWZFBySWlxeENLSWF3bXd3cFYwR1lwdnJZUURzPXwywZdJd17BJ8hx6xNXtwzgG0iX456897xLcR5CCw15RQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/8ed2598d72255e78e1cdecba1a0a3b0cb4e4d8be-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/8ed2598d72255e78e1cdecba1a0a3b0cb4e4d8be-1 new file mode 100644 index 0000000..6c12cb9 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/8ed2598d72255e78e1cdecba1a0a3b0cb4e4d8be-1 @@ -0,0 +1,2 @@ +- +½ \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/9.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/9.sc new file mode 100644 index 0000000..958b8ad --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/9.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxXQXRMTzdlZUlRaUV2OGl6Z25YSTNtQUlSOFlsT3huQUExRy13dU1SM1l5Z29uOFFQRXg1Y2ZyQ3lHaFBhT3hJcVR5M2ZYdTF6RTlXaWd1Vy1fbE01X3pwbFRVZTdoT1FVUVNnRUJlZmJPT29KbzA3aUYyUUY0V3dJVnZzaWdWc3NBeDNHWXpQX0RwZHxGwb5E3feFV7AMx9UYDiBTrzOgKdxTfYxfFJS1UiMAXg== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/90.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/90.sc new file mode 100644 index 0000000..1aa2fde --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/90.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxDUEl5WFB6dUV2ZEtCcy1MdXdaSERPQmgyOEN6Qm5xVUJuNlVFXzExMXpxeTl5amNCN05FRlhjQTkzaXFKOVdxdGptcncxcnNEXzlqV1pndUhVYjRyWV9mY3lUejZNcWJQWmdXaXBZd3hVSHhYMzJkbG9xNUdjWTJUSlJPSURGQUtrblU3YUg2b2UwbWI3TU80TFFSM1ktRkZLNVVaRjJON1pLWk9wbU9jd0NoeDdUZjFHaWFfeHFoNklJcnJ0YkFKZC1nbmVLTmxleXZ1VDlkZWIyZlNjai1CVUFMMzhtLS16SG9RQzdlTDQwazF1LU9UYllzZTRyWEg4X09YanlHZF9meGUyQ0UyLUthbEhMWGFKNVFBZDFfZzY1UWNHWWkzMTU4b3pCVmViXzJYQWFMd0c0UnE0alg3Ukd3enBNT0Z6cDVxaHo3R3c0PXwmpAcnVSB3YHD_PbruU0D3jg7IwrzBa5HtuCyeaCpsmQ== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/91.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/91.sc new file mode 100644 index 0000000..efa6f27 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/91.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxnNHlZNUxHdGlmQUU3T1VZWENOUGZVYWY1SVFPdXBHeDJZZE10amVCeEt3WVZwbktwYlNlNEJGdnk0X2RhRXd3RGlwVGZwNWZYcnJQRkNQQlVhNnlDNmZKa3NSTmRLd2FLZFljdHA4XzU2UEFmdVpDUjdtMzVtRjZfSHd2SDRsX0VnPT18TkfZK1nzBLYcMAQDkHIHtymNL6qBe7qQwUlIO9Znu7Q= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/92.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/92.sc new file mode 100644 index 0000000..7cfa33d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/92.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxXcS1wakRmNGdWRUhKb29EazlmVk1fS2lFUS1EUUt5dTdSeFpPLVQ2ZjIwaDRSeXBuOUJIMHFuSnd2TXREWU5vb2JybWZyNjNvLTQyVFZxN01BM09MZzA4QVhrNnV2bHp5WTZ4dUdDOC1XSDBrNmVxTjV1TzJSSGJVSXg0NFRkSHktZ0dSQmptTVdqSDdQRnFHRzJwalhCaTJjeElpMFp2a2U0dVNHMFBkMDZ5NG9yamhOcldpX2oxVW45d0xmV3VsbFhrTHFiaFZzZTMyVHV5RkFiMG5jRHo5OWFZWlIwc2hBbHl8GdvKOhv93iUO1tB87ROLC5-JCLe2y-R50Z5x_68YvRI= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/93.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/93.sc new file mode 100644 index 0000000..5b28264 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/93.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCo= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/94.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/94.sc new file mode 100644 index 0000000..fef4f00 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/94.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx1ZVNNc1hrMzQ0RmVDTUVpb01EaFlrT1BRdzhUQk9Oa3dIbWpmNE96OXB6X2F5ejVzUWlPdHppSDMxRVhrckhOMVA4MllBOWJTUXozWlFnanFoTDBpN3owc1VXX1FCai1ET29GS1A5Mjc2U2V5c2ZIQmJoUVIzWnNoYnY0TUdVcXU0M0Z4SGdKRHFQeVIzbzY2cXZGTVJBPXy-Le4iGLMrUB76xVGBZW3NOgKwpaYIku26_tyl93OhYA== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/95.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/95.sc new file mode 100644 index 0000000..6d65b38 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/95.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxQbFV1anRTQjZ0LVpjclVjM0JGeGhCTk5YZmx0QUh2QVR2MzMwa1NLVHhmc05hVndEMXU4TVQ1bXRGZ0o0UHE3Wnc3OHkwWVVjTFRfenhvYWZNWTBSMUlSVWxCYmcwNGRtUHA1czRtYjVIVkJBczFCM1RwRXpYTlZaUUFZWk1YZXJKRy1tUWQ0aGJBd0JQeEhWbmhvRTZQaGJtXzBsOVk9fKKCVRkqaBYWfLHjIU-cPjXaAV5uL4nHk2RI5jWj4jd1 \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/96.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/96.sc new file mode 100644 index 0000000..f3de56d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/96.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxFUnRfR2doNzVNU2k0al8tUjk4ZEV3bEg0TVM0bXFGZGlKSVlLRVc0UWxjOHNiRWtBMWtKWUkyM21iN1Z1ZWtQaHlxYXJPZzRSbTdyZXZVQU1rLTRKZlhzWlVheDZiY1V3X29DSzZaMHFsMzlEeG1hN2xaQmNIWDktVE5tbVBvQVhyX3VLc0F4ZWkyN1FRUVByeTJRSW1VN0QteXJ8_in0ZHSD5jPWPsR4IcjuzTekZ_CGzQKgl3Zu5U0U8HM= \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/97.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/97.sc new file mode 100644 index 0000000..fd751b5 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/97.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxWZ2p6d3JzUFFQNWpoNUFqakxTemdHaXNQM3pIQ1Z5aXp2bDhyUG10bk5qSVliNUlqRDdMMmp0VGpyeHdFanF4aE1LMzhaWUdUWnJlXzh0dEdRTzRUSWwza0pvYk9uRmZXOXNUclRoZnIwUVVwOTlPUnZUMDk2dDhTNUptZXg3aVhnZU5RVWw2YjhFUUwzNWxFeERpYlJFY01PMU0xcjljSUtMVVhoT1ZGU1RYdHZxRnJvVGJncXVBdUhDbHNUU3N2RnpZSEozVkw2cEJZSVE9fLwwrMqXB6g0r9yOzqZcTuiAc2OFEuK7AxEdTJGPoBgU \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/98.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/98.sc new file mode 100644 index 0000000..daf7d59 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/98.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3Mnx4WWZPcGdmeUE4LUZFX1pMMDBvdm1Gb1BobUtvVmpGdXVSUXJVZXJtZmtGbVJuRmtWOGI2dF90akdPbkNNam5IamtON3RDeU5yRUF0aGtuTDFRNlEtel91VEpYR281OEZVSXJjWEhoZ1dSX0hzTUNrV0hVZDlIbmxsLVNJWVk4aWJIM0p3OGc9fKEguloAVNTKMZbroD0NCrbjtVCLZt8rWBTnUYIX04Wh \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/99.sc b/vendor/github.com/gorilla/securecookie/fuzz/corpus/99.sc new file mode 100644 index 0000000..4e9d47c --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/99.sc @@ -0,0 +1 @@ +MTQzOTkyMzI3MnwyemlkdjBTNVZrQ2Znd3ZpT2JkV19lSzAydHI2aDVUaGNTUGtSdGFLdlh0LU9DZ1Rlb3phWlludUw2RUswWUtfSzE0ckJXSlQ0WDBuYnExT2dtNlhhcFE4OEFiZTN2c1IySHdHWTNTQ0lZTlExZWp0MXhZUG5LNkozVWRORENpdmpUMk5ld2xtMURRVm5oa21Zck5OVFRWRXgtRlc3NFFzZk1pUHZGQkF3TW5nZHpiMS1tXzNiZUlpeFFwWk10S2l2bnVuV0NyR2Q5T0RtYzRDVDZva09aUjZCeW1Kd1lLNldiSWU5Y3ZzZVh0RUhLNFVVWXZSV0ZLYkdjcnJFV3VmVC1ESmktSy1ORlUyYW1uQmhGN2pKamhtRWFoNmd3R3dDVmEtUERxYTgtY2l0cmhVZ3BCYXpvdmpuNVQzMVRYdEkwMG1LVDRnbWpnWWpsZXFhUDdSZ2lmbHlrcXhzYUZPfP5o9bNi5YI5P5tq0ZQupy5n1-kqBqOl19ZMmTcZBCVN \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/9e34c6aae8f2c610f838fed4a5bab0da097c5135-2 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/9e34c6aae8f2c610f838fed4a5bab0da097c5135-2 new file mode 100644 index 0000000..ef1e344 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/9e34c6aae8f2c610f838fed4a5bab0da097c5135-2 @@ -0,0 +1,2 @@ +T + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/9eecb7ef73e5211948391dfc0c2d586e3822b028-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/9eecb7ef73e5211948391dfc0c2d586e3822b028-1 new file mode 100644 index 0000000..a32d399 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/9eecb7ef73e5211948391dfc0c2d586e3822b028-1 @@ -0,0 +1 @@ +MnxBPXy- \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc-2 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc-2 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/adc83b19e793491b1c6ea0fd8b46cd9f32e592fc-2 @@ -0,0 +1 @@ + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/ae3eb68089a89eb0a707c1de4b60edfeb6efc6e0-4 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/ae3eb68089a89eb0a707c1de4b60edfeb6efc6e0-4 new file mode 100644 index 0000000..2b33900 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/ae3eb68089a89eb0a707c1de4b60edfeb6efc6e0-4 @@ -0,0 +1,11 @@ +J + + + + + + + + + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/b4f6322316fe4501272935267ab8b1c26684c884 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/b4f6322316fe4501272935267ab8b1c26684c884 new file mode 100644 index 0000000..2673fbf --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/b4f6322316fe4501272935267ab8b1c26684c884 @@ -0,0 +1 @@ +MTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoOuMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJUSWZNTnZYRHl4UF96cVk3bFhRTUhlZ1lEVF9CeXY4cmM5QlFQYi1jSTllbHBCUTZ4aENNSjBUZGRQQk5lYTh1S0VzMEVIaFRPMUFxRmxsZVBCX1RxZmFKUERoS0ZxWi1pST18CZk1M1q6UbWa3CHGVtjBOeOMZHoe1hpdzHjAIaQ7cCoMTQzOTkyMzI3MnxaRm5adFRCT3lweURrUWkyN09ab3M1N2hXcVIwd2QweG03NUNpZWx1a25BQmRVdy1LTnY2QktlVnpwSm9VbGpuRHNJUVdORk1qS2xqZl9FeWlFZWVvZHo3MndjaWN1eGNoT25hVWM4TEtWQnQ3QlNQeEx5R1F0bTFvUEg2a2wtMUFXdk82Z0RUdVUxa3pZekQ1R19XMDROSnlkTnhaZU9HOTh6ZG5UVHBycUNSRXBxVVJU \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/bf3f814c978c0fc01c46c8d5b337b024697186cc-7 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/bf3f814c978c0fc01c46c8d5b337b024697186cc-7 new file mode 100644 index 0000000..79020a3 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/bf3f814c978c0fc01c46c8d5b337b024697186cc-7 @@ -0,0 +1 @@ + = \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/c63ae6dd4fc9f9dda66970e827d13f7c73fe841c-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/c63ae6dd4fc9f9dda66970e827d13f7c73fe841c-1 new file mode 100644 index 0000000..ef6bce1 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/c63ae6dd4fc9f9dda66970e827d13f7c73fe841c-1 @@ -0,0 +1 @@ +M \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/cebedf21435b903c4013fb902fb5b753e40a100e-8 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/cebedf21435b903c4013fb902fb5b753e40a100e-8 new file mode 100644 index 0000000..898c69e --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/cebedf21435b903c4013fb902fb5b753e40a100e-8 @@ -0,0 +1,5 @@ +1Q== + + + + = \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/da39a3ee5e6b4b0d3255bfef95601890afd80709-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/da39a3ee5e6b4b0d3255bfef95601890afd80709-1 new file mode 100644 index 0000000..e69de29 diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/da5f06015af7bb09d3e421d086939d888f93271c-3 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/da5f06015af7bb09d3e421d086939d888f93271c-3 new file mode 100644 index 0000000..32f992e --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/da5f06015af7bb09d3e421d086939d888f93271c-3 @@ -0,0 +1,3 @@ +T + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/df60b2ac6f14afbf990d366fa820ee4906f1436e-2 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/df60b2ac6f14afbf990d366fa820ee4906f1436e-2 new file mode 100644 index 0000000..3747a16 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/df60b2ac6f14afbf990d366fa820ee4906f1436e-2 @@ -0,0 +1,2 @@ +8Q== + : \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/ec54cdb4f33539c9b852b89ebcc67b4ec31a2b01-5 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/ec54cdb4f33539c9b852b89ebcc67b4ec31a2b01-5 new file mode 100644 index 0000000..01cab44 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/ec54cdb4f33539c9b852b89ebcc67b4ec31a2b01-5 @@ -0,0 +1,17 @@ +J + + + + + + + + + + + + + + + + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/ec80b4b6f256eb0f29955c2bc000931d3b766c57-6 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/ec80b4b6f256eb0f29955c2bc000931d3b766c57-6 new file mode 100644 index 0000000..63d869f --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/ec80b4b6f256eb0f29955c2bc000931d3b766c57-6 @@ -0,0 +1 @@ + = \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/f2c59710b18847b10176f19fb0426cb597bafef0-9 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/f2c59710b18847b10176f19fb0426cb597bafef0-9 new file mode 100644 index 0000000..c7e805d --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/f2c59710b18847b10176f19fb0426cb597bafef0-9 @@ -0,0 +1,9 @@ +1Q== + + + + + + + + = \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/f4de882915d90ead3b18371ab004abb24b3cd320-3 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/f4de882915d90ead3b18371ab004abb24b3cd320-3 new file mode 100644 index 0000000..a24621e --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/f4de882915d90ead3b18371ab004abb24b3cd320-3 @@ -0,0 +1,2 @@ +8Q== + diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/f82d23aaf2be2cfc7aa8e323922208cdfce8d35a-3 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/f82d23aaf2be2cfc7aa8e323922208cdfce8d35a-3 new file mode 100644 index 0000000..725e321 --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/f82d23aaf2be2cfc7aa8e323922208cdfce8d35a-3 @@ -0,0 +1,2 @@ + +  \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/fuzz/corpus/fa0f4cd7fee9eb65ebb95a3dc88b6fa198a2c986-1 b/vendor/github.com/gorilla/securecookie/fuzz/corpus/fa0f4cd7fee9eb65ebb95a3dc88b6fa198a2c986-1 new file mode 100644 index 0000000..f4aac5a --- /dev/null +++ b/vendor/github.com/gorilla/securecookie/fuzz/corpus/fa0f4cd7fee9eb65ebb95a3dc88b6fa198a2c986-1 @@ -0,0 +1 @@ +hYA== \ No newline at end of file diff --git a/vendor/github.com/gorilla/securecookie/securecookie.go b/vendor/github.com/gorilla/securecookie/securecookie.go index 83dd606..cd4e097 100644 --- a/vendor/github.com/gorilla/securecookie/securecookie.go +++ b/vendor/github.com/gorilla/securecookie/securecookie.go @@ -102,6 +102,7 @@ var ( errTimestampExpired = cookieError{typ: decodeError, msg: "expired timestamp"} errDecryptionFailed = cookieError{typ: decodeError, msg: "the value could not be decrypted"} errValueNotByte = cookieError{typ: decodeError, msg: "value not a []byte."} + errValueNotBytePtr = cookieError{typ: decodeError, msg: "value not a pointer to []byte."} // ErrMacInvalid indicates that cookie decoding failed because the HMAC // could not be extracted and verified. Direct use of this error @@ -474,12 +475,11 @@ func (e NopEncoder) Serialize(src interface{}) ([]byte, error) { // Deserialize passes a []byte through as-is. func (e NopEncoder) Deserialize(src []byte, dst interface{}) error { - if _, ok := dst.([]byte); ok { - dst = src + if dat, ok := dst.(*[]byte); ok { + *dat = src return nil } - - return errValueNotByte + return errValueNotBytePtr } // Encoding ------------------------------------------------------------------- diff --git a/vendor/github.com/gorilla/securecookie/securecookie_test.go b/vendor/github.com/gorilla/securecookie/securecookie_test.go index 33ce4fc..2b0f8a1 100644 --- a/vendor/github.com/gorilla/securecookie/securecookie_test.go +++ b/vendor/github.com/gorilla/securecookie/securecookie_test.go @@ -193,6 +193,33 @@ func TestJSONSerialization(t *testing.T) { } } +func TestNopSerialization(t *testing.T) { + cookieData := "fooobar123" + sz := NopEncoder{} + + if _, err := sz.Serialize(cookieData); err != errValueNotByte { + t.Fatal("Expected error passing string") + } + dat, err := sz.Serialize([]byte(cookieData)) + if err != nil { + t.Fatal(err) + } + if (string(dat)) != cookieData { + t.Fatal("Expected serialized data to be same as source") + } + + var dst []byte + if err = sz.Deserialize(dat, dst); err != errValueNotBytePtr { + t.Fatal("Expect error unless you pass a *[]byte") + } + if err = sz.Deserialize(dat, &dst); err != nil { + t.Fatal(err) + } + if (string(dst)) != cookieData { + t.Fatal("Expected deserialized data to be same as source") + } +} + func TestEncoding(t *testing.T) { for _, value := range testStrings { encoded := encode([]byte(value)) diff --git a/vendor/github.com/kidstuff/mongostore/README.md b/vendor/github.com/kidstuff/mongostore/README.md index a2e9fff..40a1d94 100644 --- a/vendor/github.com/kidstuff/mongostore/README.md +++ b/vendor/github.com/kidstuff/mongostore/README.md @@ -16,6 +16,7 @@ Depends on the [mgo](https://labix.org/v2/mgo) library. Available on [godoc.org](http://www.godoc.org/github.com/kidstuff/mongostore). ### Example +```go func foo(rw http.ResponseWriter, req *http.Request) { // Fetch new store. dbsess, err := mgo.Dial("localhost") @@ -42,4 +43,5 @@ Available on [godoc.org](http://www.godoc.org/github.com/kidstuff/mongostore). } fmt.Fprintln(rw, "ok") - } \ No newline at end of file + } +``` diff --git a/vendor/github.com/kidstuff/mongostore/mongostore.go b/vendor/github.com/kidstuff/mongostore/mongostore.go index 48932da..e7b5939 100644 --- a/vendor/github.com/kidstuff/mongostore/mongostore.go +++ b/vendor/github.com/kidstuff/mongostore/mongostore.go @@ -6,12 +6,13 @@ package mongostore import ( "errors" + "net/http" + "time" + "github.com/gorilla/securecookie" "github.com/gorilla/sessions" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" - "net/http" - "time" ) var ( @@ -40,13 +41,15 @@ func NewMongoStore(c *mgo.Collection, maxAge int, ensureTTL bool, store := &MongoStore{ Codecs: securecookie.CodecsFromPairs(keyPairs...), Options: &sessions.Options{ - Path: "/", + Path: "/", MaxAge: maxAge, }, Token: &CookieToken{}, coll: c, } + store.MaxAge(maxAge) + if ensureTTL { c.EnsureIndex(mgo.Index{ Key: []string{"modified"}, @@ -122,6 +125,20 @@ func (m *MongoStore) Save(r *http.Request, w http.ResponseWriter, return nil } +// MaxAge sets the maximum age for the store and the underlying cookie +// implementation. Individual sessions can be deleted by setting Options.MaxAge +// = -1 for that session. +func (m *MongoStore) MaxAge(age int) { + m.Options.MaxAge = age + + // Set the maxAge for each securecookie instance. + for _, codec := range m.Codecs { + if sc, ok := codec.(*securecookie.SecureCookie); ok { + sc.MaxAge(age) + } + } +} + func (m *MongoStore) load(session *sessions.Session) error { if !bson.IsObjectIdHex(session.ID) { return ErrInvalidId diff --git a/vendor/github.com/microcosm-cc/bluemonday/README.md b/vendor/github.com/microcosm-cc/bluemonday/README.md index 2e77063..d8a7f8f 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/README.md +++ b/vendor/github.com/microcosm-cc/bluemonday/README.md @@ -140,7 +140,7 @@ func main() { We ship two default policies: -1. `bluemonday.StrictPolicy()` which can be thought of as equivalent to stripping all HTML elements and their attributes as it has nothing on it's whitelist. An example usage scenario would be blog post titles where HTML tags are not expected at all and if they are then the elements *and* the content of the elements should be stripped. This is a *very* strict policy. +1. `bluemonday.StrictPolicy()` which can be thought of as equivalent to stripping all HTML elements and their attributes as it has nothing on its whitelist. An example usage scenario would be blog post titles where HTML tags are not expected at all and if they are then the elements *and* the content of the elements should be stripped. This is a *very* strict policy. 2. `bluemonday.UGCPolicy()` which allows a broad selection of HTML elements and attributes that are safe for user generated content. Note that this policy does *not* whitelist iframes, object, embed, styles, script, etc. An example usage scenario would be blog post bodies where a variety of formatting is expected along with the potential for TABLEs and IMGs. ## Policy Building @@ -273,7 +273,7 @@ We also bundle some helpers to simplify policy building: // Permits the "dir", "id", "lang", "title" attributes globally p.AllowStandardAttributes() -// Permits the "img" element and it's standard attributes +// Permits the "img" element and its standard attributes p.AllowImages() // Permits ordered and unordered lists, and also definition lists diff --git a/vendor/github.com/microcosm-cc/bluemonday/doc.go b/vendor/github.com/microcosm-cc/bluemonday/doc.go index 2cb0a36..71dab60 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/doc.go +++ b/vendor/github.com/microcosm-cc/bluemonday/doc.go @@ -84,7 +84,7 @@ bluemonday is heavily inspired by both the OWASP Java HTML Sanitizer We ship two default policies, one is bluemonday.StrictPolicy() and can be thought of as equivalent to stripping all HTML elements and their attributes as -it has nothing on it's whitelist. +it has nothing on its whitelist. The other is bluemonday.UGCPolicy() and allows a broad selection of HTML elements and attributes that are safe for user generated content. Note that diff --git a/vendor/github.com/microcosm-cc/bluemonday/policy.go b/vendor/github.com/microcosm-cc/bluemonday/policy.go index 49ce508..2d766d1 100644 --- a/vendor/github.com/microcosm-cc/bluemonday/policy.go +++ b/vendor/github.com/microcosm-cc/bluemonday/policy.go @@ -384,7 +384,7 @@ func (p *Policy) AddSpaceWhenStrippingTag(allow bool) *Policy { } // SkipElementsContent adds the HTML elements whose tags is needed to be removed -// with it's content. +// with its content. func (p *Policy) SkipElementsContent(names ...string) *Policy { p.init() diff --git a/vendor/github.com/russross/blackfriday/README.md b/vendor/github.com/russross/blackfriday/README.md index 0d1ac9a..a6c94b7 100644 --- a/vendor/github.com/russross/blackfriday/README.md +++ b/vendor/github.com/russross/blackfriday/README.md @@ -1,4 +1,6 @@ -Blackfriday [![Build Status](https://travis-ci.org/russross/blackfriday.svg?branch=master)](https://travis-ci.org/russross/blackfriday) [![GoDoc](https://godoc.org/github.com/russross/blackfriday?status.svg)](https://godoc.org/github.com/russross/blackfriday) +Blackfriday +[![Build Status][BuildSVG]][BuildURL] +[![Godoc][GodocV2SVG]][GodocV2URL] =========== Blackfriday is a [Markdown][1] processor implemented in [Go][2]. It @@ -8,7 +10,7 @@ punctuation substitutions, etc.), and it is safe for all utf-8 (unicode) input. HTML output is currently supported, along with Smartypants -extensions. An experimental LaTeX output engine is also included. +extensions. It started as a translation from C of [Sundown][3]. @@ -16,26 +18,71 @@ It started as a translation from C of [Sundown][3]. Installation ------------ -Blackfriday is compatible with Go 1. If you are using an older -release of Go, consider using v1.1 of blackfriday, which was based -on the last stable release of Go prior to Go 1. You can find it as a -tagged commit on github. +Blackfriday is compatible with any modern Go release. With Go and git installed: -With Go 1 and git installed: + go get -u gopkg.in/russross/blackfriday.v2 - go get github.com/russross/blackfriday +will download, compile, and install the package into your `$GOPATH` directory +hierarchy. -will download, compile, and install the package into your `$GOPATH` -directory hierarchy. Alternatively, you can achieve the same if you -import it into a project: - import "github.com/russross/blackfriday" +Versions +-------- + +Currently maintained and recommended version of Blackfriday is `v2`. It's being +developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the +documentation is available at +https://godoc.org/gopkg.in/russross/blackfriday.v2. + +It is `go get`-able via via [gopkg.in][6] at `gopkg.in/russross/blackfriday.v2`, +but we highly recommend using package management tool like [dep][7] or +[Glide][8] and make use of semantic versioning. With package management you +should import `github.com/russross/blackfriday` and specify that you're using +version 2.0.0. + +Version 2 offers a number of improvements over v1: + +* Cleaned up API +* A separate call to [`Parse`][4], which produces an abstract syntax tree for + the document +* Latest bug fixes +* Flexibility to easily add your own rendering extensions + +Potential drawbacks: + +* Our benchmarks show v2 to be slightly slower than v1. Currently in the + ballpark of around 15%. +* API breakage. If you can't afford modifying your code to adhere to the new API + and don't care too much about the new features, v2 is probably not for you. +* Several bug fixes are trailing behind and still need to be forward-ported to + v2. See issue [#348](https://github.com/russross/blackfriday/issues/348) for + tracking. + +If you are still interested in the legacy `v1`, you can import it from +`github.com/russross/blackfriday`. Documentation for the legacy v1 can be found +here: https://godoc.org/github.com/russross/blackfriday + +### Known issue with `dep` + +There is a known problem with using Blackfriday v1 _transitively_ and `dep`. +Currently `dep` prioritizes semver versions over anything else, and picks the +latest one, plus it does not apply a `[[constraint]]` specifier to transitively +pulled in packages. So if you're using something that uses Blackfriday v1, but +that something does not use `dep` yet, you will get Blackfriday v2 pulled in and +your first dependency will fail to build. + +There are couple of fixes for it, documented here: +https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version + +Meanwhile, `dep` team is working on a more general solution to the constraints +on transitive dependencies problem: https://github.com/golang/dep/issues/1124. -and `go get` without parameters. Usage ----- +### v1 + For basic usage, it is as simple as getting your input into a byte slice and calling: @@ -46,34 +93,57 @@ feature set, use this instead: output := blackfriday.MarkdownCommon(input) +### v2 + +For the most sensible markdown processing, it is as simple as getting your input +into a byte slice and calling: + +```go +output := blackfriday.Run(input) +``` + +Your input will be parsed and the output rendered with a set of most popular +extensions enabled. If you want the most basic feature set, corresponding with +the bare Markdown specification, use: + +```go +output := blackfriday.Run(input, blackfriday.WithNoExtensions()) +``` + ### Sanitize untrusted content Blackfriday itself does nothing to protect against malicious content. If you are -dealing with user-supplied markdown, we recommend running blackfriday's output -through HTML sanitizer such as -[Bluemonday](https://github.com/microcosm-cc/bluemonday). +dealing with user-supplied markdown, we recommend running Blackfriday's output +through HTML sanitizer such as [Bluemonday][5]. -Here's an example of simple usage of blackfriday together with bluemonday: +Here's an example of simple usage of Blackfriday together with Bluemonday: -``` go +```go import ( "github.com/microcosm-cc/bluemonday" - "github.com/russross/blackfriday" + "gopkg.in/russross/blackfriday.v2" ) // ... -unsafe := blackfriday.MarkdownCommon(input) +unsafe := blackfriday.Run(input) html := bluemonday.UGCPolicy().SanitizeBytes(unsafe) ``` -### Custom options +### Custom options, v1 If you want to customize the set of options, first get a renderer -(currently either the HTML or LaTeX output engines), then use it to +(currently only the HTML output engine), then use it to call the more general `Markdown` function. For examples, see the implementations of `MarkdownBasic` and `MarkdownCommon` in `markdown.go`. +### Custom options, v2 + +If you want to customize the set of options, use `blackfriday.WithExtensions`, +`blackfriday.WithRenderer` and `blackfriday.WithRefOverride`. + +### `blackfriday-tool` + You can also check out `blackfriday-tool` for a more complete example of how to use it. Download and install it using: @@ -249,7 +319,7 @@ are a few of note: * [github_flavored_markdown](https://godoc.org/github.com/shurcooL/github_flavored_markdown): provides a GitHub Flavored Markdown renderer with fenced code block - highlighting, clickable header anchor links. + highlighting, clickable heading anchor links. It's not customizable, and its goal is to produce HTML output equivalent to the [GitHub Markdown API endpoint](https://developer.github.com/v3/markdown/#render-a-markdown-document-in-raw-mode), @@ -258,27 +328,18 @@ are a few of note: * [markdownfmt](https://github.com/shurcooL/markdownfmt): like gofmt, but for markdown. -* LaTeX output: renders output as LaTeX. This is currently part of the - main Blackfriday repository, but may be split into its own project - in the future. If you are interested in owning and maintaining the - LaTeX output component, please be in touch. - - It renders some basic documents, but is only experimental at this - point. In particular, it does not do any inline escaping, so input - that happens to look like LaTeX code will be passed through without - modification. - -* [Md2Vim](https://github.com/FooSoft/md2vim): transforms markdown files into vimdoc format. +* [LaTeX output](https://bitbucket.org/ambrevar/blackfriday-latex): + renders output as LaTeX. -Todo +TODO ---- * More unit testing -* Improve unicode support. It does not understand all unicode +* Improve Unicode support. It does not understand all Unicode rules (about what constitutes a letter, a punctuation symbol, etc.), so it may fail to detect word boundaries correctly in - some instances. It is safe on all utf-8 input. + some instances. It is safe on all UTF-8 input. License @@ -287,6 +348,16 @@ License [Blackfriday is distributed under the Simplified BSD License](LICENSE.txt) - [1]: http://daringfireball.net/projects/markdown/ "Markdown" - [2]: http://golang.org/ "Go Language" + [1]: https://daringfireball.net/projects/markdown/ "Markdown" + [2]: https://golang.org/ "Go Language" [3]: https://github.com/vmg/sundown "Sundown" + [4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func" + [5]: https://github.com/microcosm-cc/bluemonday "Bluemonday" + [6]: https://labix.org/gopkg.in "gopkg.in" + [7]: https://github.com/golang/dep/ "dep" + [8]: https://github.com/Masterminds/glide "Glide" + + [BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master + [BuildURL]: https://travis-ci.org/russross/blackfriday + [GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg + [GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2 diff --git a/vendor/github.com/russross/blackfriday/html.go b/vendor/github.com/russross/blackfriday/html.go index 2f0ad3b..c917c7d 100644 --- a/vendor/github.com/russross/blackfriday/html.go +++ b/vendor/github.com/russross/blackfriday/html.go @@ -620,7 +620,7 @@ func (options *Html) FootnoteRef(out *bytes.Buffer, ref []byte, id int) { out.WriteString(`fnref:`) out.WriteString(options.parameters.FootnoteAnchorPrefix) out.Write(slug) - out.WriteString(`">testing footnotes.1

+ `

testing footnotes.1


@@ -877,7 +877,7 @@ var footnoteTests = []string{ No longer in the footnote `, - `

testing long1 notes.

+ `

testing long1 notes.

No longer in the footnote

@@ -913,7 +913,7 @@ what happens here [note]: /link/c `, - `

testing1 multiple2 notes.

+ `

testing1 multiple2 notes.

omg

@@ -932,7 +932,7 @@ what happens here `, "testing inline^[this is the note] notes.\n", - `

testing inline1 notes.

+ `

testing inline1 notes.


@@ -944,7 +944,7 @@ what happens here `, "testing multiple[^1] types^[inline note] of notes[^2]\n\n[^2]: the second deferred note\n[^1]: the first deferred note\n\n\twhich happens to be a block\n", - `

testing multiple1 types2 of notes3

+ `

testing multiple1 types2 of notes3


@@ -967,7 +967,7 @@ what happens here may be multiple paragraphs. `, - `

This is a footnote12

+ `

This is a footnote12


@@ -983,13 +983,13 @@ what happens here `, "empty footnote[^]\n\n[^]: fn text", - "

empty footnote1

\n
\n\n
\n\n
    \n
  1. fn text\n
  2. \n
\n
\n", + "

empty footnote1

\n
\n\n
\n\n
    \n
  1. fn text\n
  2. \n
\n
\n", "Some text.[^note1]\n\n[^note1]: fn1", - "

Some text.1

\n
\n\n
\n\n
    \n
  1. fn1\n
  2. \n
\n
\n", + "

Some text.1

\n
\n\n
\n\n
    \n
  1. fn1\n
  2. \n
\n
\n", "Some text.[^note1][^note2]\n\n[^note1]: fn1\n[^note2]: fn2\n", - "

Some text.12

\n
\n\n
\n\n
    \n
  1. fn1\n
  2. \n
  3. fn2\n
  4. \n
\n
\n", + "

Some text.12

\n
\n\n
\n\n
    \n
  1. fn1\n
  2. \n
  3. fn2\n
  4. \n
\n
\n", `Bla bla [^1] [WWW][w3] @@ -997,7 +997,7 @@ what happens here [w3]: http://www.w3.org/ `, - `

Bla bla 1 WWW

+ `

Bla bla 1 WWW


@@ -1013,7 +1013,7 @@ what happens here [^fn1]: Fine print `, - `

This is exciting!1

+ `

This is exciting!1


@@ -1031,17 +1031,17 @@ test footnotes the second.[^b] [^a]: This is the first note[^a]. [^b]: this is the second note.[^a] `, - `

testing footnotes.1

+ `

testing footnotes.1

-

test footnotes the second.2

+

test footnotes the second.2


    -
  1. This is the first note1. +
  2. This is the first note1.
  3. -
  4. this is the second note.1 +
  5. this is the second note.1
@@ -1086,13 +1086,13 @@ func TestNestedFootnotes(t *testing.T) { [^fn2]: Obelisk`, - `

Paragraph.1

+ `

Paragraph.1


    -
  1. Asterisk2 +
  2. Asterisk2
  3. Obelisk
  4. @@ -1110,19 +1110,19 @@ This uses footnote C.[^C] [^C]: C note, uses B.[^B] `, - `

    This uses footnote A.1

    + `

    This uses footnote A.1

    -

    This uses footnote C.2

    +

    This uses footnote C.2


      -
    1. A note. use itself.1 +
    2. A note. use itself.1
    3. -
    4. C note, uses B.3 +
    5. C note, uses B.3
    6. -
    7. B note, uses A to test duplicate.1 +
    8. B note, uses A to test duplicate.1
    diff --git a/vendor/github.com/shurcooL/go/README.md b/vendor/github.com/shurcooL/go/README.md index fc0f959..a6ba055 100644 --- a/vendor/github.com/shurcooL/go/README.md +++ b/vendor/github.com/shurcooL/go/README.md @@ -22,7 +22,6 @@ Directories | [gddo](https://godoc.org/github.com/shurcooL/go/gddo) | Package gddo is a simple client library for accessing the godoc.org API. | | [generated](https://godoc.org/github.com/shurcooL/go/generated) | Package generated provides a function that parses a Go file and reports whether it contains a "// Code generated … DO NOT EDIT." line comment. | | [gfmutil](https://godoc.org/github.com/shurcooL/go/gfmutil) | Package gfmutil offers functionality to render GitHub Flavored Markdown to io.Writer. | -| [gopathutil](https://godoc.org/github.com/shurcooL/go/gopathutil) | Package gopathutil provides tools to operate on GOPATH workspace. | | [gopherjs_http](https://godoc.org/github.com/shurcooL/go/gopherjs_http) | Package gopherjs_http provides helpers for compiling Go using GopherJS and serving it over HTTP. | | [gopherjs_http/jsutil](https://godoc.org/github.com/shurcooL/go/gopherjs_http/jsutil) | Package jsutil provides utility functions for interacting with native JavaScript APIs. | | [importgraphutil](https://godoc.org/github.com/shurcooL/go/importgraphutil) | Package importgraphutil augments "golang.org/x/tools/refactor/importgraph" with a way to build graphs ignoring tests. | diff --git a/vendor/github.com/shurcooL/go/gopathutil/doc.go b/vendor/github.com/shurcooL/go/gopathutil/doc.go deleted file mode 100644 index d462d8b..0000000 --- a/vendor/github.com/shurcooL/go/gopathutil/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package gopathutil provides tools to operate on GOPATH workspace. -package gopathutil diff --git a/vendor/github.com/shurcooL/go/gopathutil/gopathutil.go b/vendor/github.com/shurcooL/go/gopathutil/gopathutil.go deleted file mode 100644 index daa4d35..0000000 --- a/vendor/github.com/shurcooL/go/gopathutil/gopathutil.go +++ /dev/null @@ -1,117 +0,0 @@ -// +build disable - -package gopathutil - -import ( - "errors" - "strings" - - "github.com/kisielk/gotool" - "github.com/shurcooL/go/gists/gist7480523" - "github.com/shurcooL/go/trash" -) - -// RemoveRepo removes go-gettable repo with no local changes (by moving it into trash). -// importPathPattern must match exactly with the repo root. -// For example, "github.com/user/repo/...". -func RemoveRepo(importPathPattern string) error { - // TODO: Use an official Go package for `go list` functionality whenever possible. - importPaths := gotool.ImportPaths([]string{importPathPattern}) - if len(importPaths) == 0 { - return errors.New("no packages to remove") - } - - var firstGoPackage *gist7480523.GoPackage - for i, importPath := range importPaths { - goPackage := gist7480523.GoPackageFromImportPath(importPath) - if goPackage == nil { - return errors.New("Import Path not found: " + importPath) - } - - if goPackage.Bpkg.Goroot { - return errors.New("can't remove packages from GOROOT") - } - - goPackage.UpdateVcs() - - if goPackage.Dir.Repo == nil { - return errors.New("can't get repo status") - } - - if i == 0 { - firstGoPackage = goPackage - } else if firstGoPackage.Dir.Repo != goPackage.Dir.Repo { - return errors.New("matched Go Packages span more than 1 repo: " + firstGoPackage.Dir.Repo.Vcs.RootPath() + " != " + goPackage.Dir.Repo.Vcs.RootPath()) - } else if !strings.HasPrefix(goPackage.Bpkg.Dir, firstGoPackage.Dir.Repo.Vcs.RootPath()) { // TODO: This is probably not neccessary... - return errors.New("Go Package not inside repo: " + goPackage.Bpkg.Dir + " doesn't have prefix " + firstGoPackage.Dir.Repo.Vcs.RootPath()) - } - } - - if repoImportPathPattern := gist7480523.GetRepoImportPathPattern(firstGoPackage.Dir.Repo.Vcs.RootPath(), firstGoPackage.Bpkg.SrcRoot); repoImportPathPattern != importPathPattern { - return errors.New("importPathPattern not exact repo root match: " + importPathPattern + " != " + repoImportPathPattern) - } - - firstGoPackage.UpdateVcsFields() - - cleanStatus := func(goPackage *gist7480523.GoPackage) bool { - packageStatus := presenter(goPackage)[:4] - return packageStatus == " " || packageStatus == " + " // Updates are okay to ignore. - } - - if !cleanStatus(firstGoPackage) { - return errors.New("non-clean status: " + presenter(firstGoPackage)) - } - - err := trash.MoveTo(firstGoPackage.Dir.Repo.Vcs.RootPath()) - return err - - // TODO: Clean up /pkg folder contents, if any, etc. -} - -// TODO: Inline and simplify this. -var presenter gist7480523.GoPackageStringer = func(goPackage *gist7480523.GoPackage) string { - out := "" - - if repo := goPackage.Dir.Repo; repo != nil { - repoImportPath := gist7480523.GetRepoImportPath(repo.Vcs.RootPath(), goPackage.Bpkg.SrcRoot) - - if repo.VcsLocal.LocalBranch != repo.Vcs.GetDefaultBranch() { - out += "b" - } else { - out += " " - } - if repo.VcsLocal.Status != "" { - out += "*" - } else { - out += " " - } - if repo.RepoRoot == nil || repo.RepoRoot.Repo != repo.VcsLocal.Remote { - out += "#" - } else if repo.VcsLocal.LocalRev != repo.VcsRemote.RemoteRev { - if repo.VcsRemote.RemoteRev != "" { - if !repo.VcsRemote.IsContained { - out += "+" - } else { - out += "-" - } - } else { - out += "!" - } - } else { - out += " " - } - if repo.VcsLocal.Stash != "" { - out += "$" - } else { - out += " " - } - - out += " " + repoImportPath + "/..." - } else { - out += "????" - - out += " " + goPackage.Bpkg.ImportPath - } - - return out -} diff --git a/vendor/github.com/shurcooL/go/gopathutil/stub.go b/vendor/github.com/shurcooL/go/gopathutil/stub.go deleted file mode 100644 index f0513fb..0000000 --- a/vendor/github.com/shurcooL/go/gopathutil/stub.go +++ /dev/null @@ -1,12 +0,0 @@ -package gopathutil - -import "errors" - -// RemoveRepo removes go-gettable repo with no local changes (by moving it into trash). -// importPathPattern must match exactly with the repo root. -// For example, "github.com/user/repo/...". -// -// It's currently not implemented. -func RemoveRepo(importPathPattern string) error { - return errors.New("not implemented: RemoveRepo needs to be updated to use new dependencies") -} diff --git a/vendor/github.com/shurcooL/go/vfs/godocfs/godocfs/godocfs.go b/vendor/github.com/shurcooL/go/vfs/godocfs/godocfs/godocfs.go index e096abc..db16f92 100644 --- a/vendor/github.com/shurcooL/go/vfs/godocfs/godocfs/godocfs.go +++ b/vendor/github.com/shurcooL/go/vfs/godocfs/godocfs/godocfs.go @@ -34,4 +34,6 @@ func (v *godocFS) ReadDir(path string) ([]os.FileInfo, error) { return vfsutil.ReadDir(v.fs, path) } -func (v *godocFS) String() string { return "godocfs" } +func (*godocFS) RootType(string) vfs.RootType { return "" } + +func (*godocFS) String() string { return "godocfs" } diff --git a/vendor/github.com/shurcooL/graphql/example/graphqldev/main.go b/vendor/github.com/shurcooL/graphql/example/graphqldev/main.go index 37b5eb9..ffc8302 100644 --- a/vendor/github.com/shurcooL/graphql/example/graphqldev/main.go +++ b/vendor/github.com/shurcooL/graphql/example/graphqldev/main.go @@ -14,9 +14,9 @@ import ( "net/http/httptest" "os" - graphqlserver "github.com/neelance/graphql-go" - "github.com/neelance/graphql-go/example/starwars" - "github.com/neelance/graphql-go/relay" + graphqlserver "github.com/graph-gophers/graphql-go" + "github.com/graph-gophers/graphql-go/example/starwars" + "github.com/graph-gophers/graphql-go/relay" "github.com/shurcooL/graphql" ) diff --git a/vendor/github.com/shurcooL/graphql/graphql.go b/vendor/github.com/shurcooL/graphql/graphql.go index b7f0e5a..fb3f4cc 100644 --- a/vendor/github.com/shurcooL/graphql/graphql.go +++ b/vendor/github.com/shurcooL/graphql/graphql.go @@ -81,11 +81,14 @@ func (c *Client) do(ctx context.Context, op operationType, v interface{}, variab if err != nil { return err } + err = jsonutil.UnmarshalGraphQL(out.Data, v) + if err != nil { + return err + } if len(out.Errors) > 0 { return out.Errors } - err = jsonutil.UnmarshalGraphQL(out.Data, v) - return err + return nil } // errors represents the "errors" array in a response from a GraphQL server. diff --git a/vendor/github.com/shurcooL/graphql/graphql_test.go b/vendor/github.com/shurcooL/graphql/graphql_test.go new file mode 100644 index 0000000..9607554 --- /dev/null +++ b/vendor/github.com/shurcooL/graphql/graphql_test.go @@ -0,0 +1,83 @@ +package graphql_test + +import ( + "context" + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/shurcooL/graphql" +) + +func TestClient_Query_partialResultWithErrorResponse(t *testing.T) { + mux := http.NewServeMux() + mux.HandleFunc("/graphql", func(w http.ResponseWriter, req *http.Request) { + w.Header().Set("Content-Type", "application/json") + mustWrite(w, `{ + "data": { + "node1": { + "id": "MDEyOklzc3VlQ29tbWVudDE2OTQwNzk0Ng==" + }, + "node2": null + }, + "errors": [ + { + "message": "Could not resolve to a node with the global id of 'NotExist'", + "type": "NOT_FOUND", + "path": [ + "node2" + ], + "locations": [ + { + "line": 10, + "column": 4 + } + ] + } + ] + }`) + }) + client := graphql.NewClient("/graphql", &http.Client{Transport: localRoundTripper{handler: mux}}) + + var q struct { + Node1 *struct { + ID graphql.ID + } `graphql:"node1: node(id: \"MDEyOklzc3VlQ29tbWVudDE2OTQwNzk0Ng==\")"` + Node2 *struct { + ID graphql.ID + } `graphql:"node2: node(id: \"NotExist\")"` + } + err := client.Query(context.Background(), &q, nil) + if err == nil { + t.Fatal("got error: nil, want: non-nil") + } + if got, want := err.Error(), "Could not resolve to a node with the global id of 'NotExist'"; got != want { + t.Errorf("got error: %v, want: %v", got, want) + } + if q.Node1 == nil || q.Node1.ID != "MDEyOklzc3VlQ29tbWVudDE2OTQwNzk0Ng==" { + t.Errorf("got wrong q.Node1: %v", q.Node1) + } + if q.Node2 != nil { + t.Errorf("got non-nil q.Node2: %v, want: nil", *q.Node2) + } +} + +// localRoundTripper is an http.RoundTripper that executes HTTP transactions +// by using handler directly, instead of going over an HTTP connection. +type localRoundTripper struct { + handler http.Handler +} + +func (l localRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + w := httptest.NewRecorder() + l.handler.ServeHTTP(w, req) + return w.Result(), nil +} + +func mustWrite(w io.Writer, s string) { + _, err := io.WriteString(w, s) + if err != nil { + panic(err) + } +} diff --git a/vendor/github.com/ugorji/go/.travis.yml b/vendor/github.com/ugorji/go/.travis.yml index 05e5934..b01c35d 100644 --- a/vendor/github.com/ugorji/go/.travis.yml +++ b/vendor/github.com/ugorji/go/.travis.yml @@ -4,6 +4,7 @@ go: - 1.7.x # go testing suite support, which we use, was introduced in go 1.7 - 1.8.x - 1.9.x + - 1.10.x - tip script: - go test -tags "alltests" -run Suite -coverprofile coverage.txt github.com/ugorji/go/codec diff --git a/vendor/github.com/ugorji/go/README.md b/vendor/github.com/ugorji/go/README.md index 8867438..291c6b4 100644 --- a/vendor/github.com/ugorji/go/README.md +++ b/vendor/github.com/ugorji/go/README.md @@ -1,6 +1,6 @@ -[![Sourcegraph](https://sourcegraph.com/github.com/ugorji/go/-/badge.svg)](https://sourcegraph.com/github.com/ugorji/go/-/blob/codec) +[![Sourcegraph](https://sourcegraph.com/github.com/ugorji/go/-/badge.svg?v=2)](https://sourcegraph.com/github.com/ugorji/go/-/tree/codec) [![Build Status](https://travis-ci.org/ugorji/go.svg?branch=master)](https://travis-ci.org/ugorji/go) -[![codecov](https://codecov.io/gh/ugorji/go/branch/master/graph/badge.svg)](https://codecov.io/gh/ugorji/go) +[![codecov](https://codecov.io/gh/ugorji/go/branch/master/graph/badge.svg?v=2)](https://codecov.io/gh/ugorji/go) [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/ugorji/go/codec) [![rcard](https://goreportcard.com/badge/github.com/ugorji/go/codec?v=2)](https://goreportcard.com/report/github.com/ugorji/go/codec) [![License](http://img.shields.io/badge/license-mit-blue.svg?style=flat-square)](https://raw.githubusercontent.com/ugorji/go/master/LICENSE) @@ -25,3 +25,7 @@ Install using: go get github.com/ugorji/go/codec +TODO: + + - [ ] 2018-03-12 - Release v1.1.1 containing 32-bit fixes + diff --git a/vendor/github.com/ugorji/go/codec/0doc.go b/vendor/github.com/ugorji/go/codec/0doc.go index cf7b48d..b61a818 100644 --- a/vendor/github.com/ugorji/go/codec/0doc.go +++ b/vendor/github.com/ugorji/go/codec/0doc.go @@ -225,7 +225,7 @@ with some caveats. See Encode documentation. package codec // TODO: -// - In Go 1.10, when mid-stack inlining is enabled, +// - For Go 1.11, when mid-stack inlining is enabled, // we should use committed functions for writeXXX and readXXX calls. // This involves uncommenting the methods for decReaderSwitch and encWriterSwitch // and using those (decReaderSwitch and encWriterSwitch) in all handles diff --git a/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/ugorji/go/codec/binc.go index 39fd7d4..a3c96fe 100644 --- a/vendor/github.com/ugorji/go/codec/binc.go +++ b/vendor/github.com/ugorji/go/codec/binc.go @@ -55,6 +55,50 @@ const ( // others not currently supported ) +func bincdesc(vd, vs byte) string { + switch vd { + case bincVdSpecial: + switch vs { + case bincSpNil: + return "nil" + case bincSpFalse: + return "false" + case bincSpTrue: + return "true" + case bincSpNan, bincSpPosInf, bincSpNegInf, bincSpZeroFloat: + return "float" + case bincSpZero: + return "uint" + case bincSpNegOne: + return "int" + default: + return "unknown" + } + case bincVdSmallInt, bincVdPosInt: + return "uint" + case bincVdNegInt: + return "int" + case bincVdFloat: + return "float" + case bincVdSymbol: + return "string" + case bincVdString: + return "string" + case bincVdByteArray: + return "bytes" + case bincVdTimestamp: + return "time" + case bincVdCustomExt: + return "ext" + case bincVdArray: + return "array" + case bincVdMap: + return "map" + default: + return "unknown" + } +} + type bincEncDriver struct { e *Encoder h *BincHandle @@ -405,7 +449,7 @@ func (d *bincDecDriver) DecodeTime() (t time.Time) { return } if d.vd != bincVdTimestamp { - d.d.errorf("Invalid d.vd. Expecting 0x%x. Received: 0x%x", bincVdTimestamp, d.vd) + d.d.errorf("cannot decode time - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } t, err := bincDecodeTime(d.r.readx(int(d.vs))) @@ -422,7 +466,7 @@ func (d *bincDecDriver) decFloatPre(vs, defaultLen byte) { } else { l := d.r.readn1() if l > 8 { - d.d.errorf("At most 8 bytes used to represent float. Received: %v bytes", l) + d.d.errorf("cannot read float - at most 8 bytes used to represent float - received %v bytes", l) return } for i := l; i < 8; i++ { @@ -441,7 +485,7 @@ func (d *bincDecDriver) decFloat() (f float64) { d.decFloatPre(d.vs, 8) f = math.Float64frombits(bigen.Uint64(d.b[0:8])) } else { - d.d.errorf("only float32 and float64 are supported. d.vd: 0x%x, d.vs: 0x%x", d.vd, d.vs) + d.d.errorf("read float - only float32 and float64 are supported - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } return @@ -498,7 +542,8 @@ func (d *bincDecDriver) decCheckInteger() (ui uint64, neg bool) { neg = true ui = 1 } else { - d.d.errorf("numeric decode fails for special value: d.vs: 0x%x", d.vs) + d.d.errorf("integer decode fails - invalid special value from descriptor %x-%x/%s", + d.vd, d.vs, bincdesc(d.vd, d.vs)) return } } else { @@ -521,7 +566,7 @@ func (d *bincDecDriver) DecodeInt64() (i int64) { func (d *bincDecDriver) DecodeUint64() (ui uint64) { ui, neg := d.decCheckInteger() if neg { - d.d.errorf("Assigning negative signed value to unsigned type") + d.d.errorf("assigning negative signed value to unsigned integer type") return } d.bdRead = false @@ -544,7 +589,8 @@ func (d *bincDecDriver) DecodeFloat64() (f float64) { } else if vs == bincSpNegInf { return math.Inf(-1) } else { - d.d.errorf("Invalid d.vs decoding float where d.vd=bincVdSpecial: %v", d.vs) + d.d.errorf("float - invalid special value from descriptor %x-%x/%s", + d.vd, d.vs, bincdesc(d.vd, d.vs)) return } } else if vd == bincVdFloat { @@ -566,7 +612,7 @@ func (d *bincDecDriver) DecodeBool() (b bool) { } else if bd == (bincVdSpecial | bincSpTrue) { b = true } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + d.d.errorf("bool - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } d.bdRead = false @@ -578,7 +624,7 @@ func (d *bincDecDriver) ReadMapStart() (length int) { d.readNextBd() } if d.vd != bincVdMap { - d.d.errorf("Invalid d.vd for map. Expecting 0x%x. Got: 0x%x", bincVdMap, d.vd) + d.d.errorf("map - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } length = d.decLen() @@ -591,7 +637,7 @@ func (d *bincDecDriver) ReadArrayStart() (length int) { d.readNextBd() } if d.vd != bincVdArray { - d.d.errorf("Invalid d.vd for array. Expecting 0x%x. Got: 0x%x", bincVdArray, d.vd) + d.d.errorf("array - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } length = d.decLen() @@ -704,8 +750,7 @@ func (d *bincDecDriver) decStringAndBytes(bs []byte, withString, zerocopy bool) d.s = append(d.s, bincDecSymbol{i: symbol, s: s, b: bs2}) } default: - d.d.errorf("Invalid d.vd. Expecting string:0x%x, bytearray:0x%x or symbol: 0x%x. Got: 0x%x", - bincVdString, bincVdByteArray, bincVdSymbol, d.vd) + d.d.errorf("string/bytes - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } d.bdRead = false @@ -742,8 +787,7 @@ func (d *bincDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { if d.vd == bincVdString || d.vd == bincVdByteArray { clen = d.decLen() } else { - d.d.errorf("Invalid d.vd for bytes. Expecting string:0x%x or bytearray:0x%x. Got: 0x%x", - bincVdString, bincVdByteArray, d.vd) + d.d.errorf("bytes - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } d.bdRead = false @@ -759,7 +803,7 @@ func (d *bincDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) { func (d *bincDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { if xtag > 0xff { - d.d.errorf("decodeExt: tag must be <= 0xff; got: %v", xtag) + d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag) return } realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) @@ -782,14 +826,14 @@ func (d *bincDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs []b l := d.decLen() xtag = d.r.readn1() if verifyTag && xtag != tag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) + d.d.errorf("wrong extension tag - got %b, expecting: %v", xtag, tag) return } xbs = d.r.readx(l) } else if d.vd == bincVdByteArray { xbs = d.DecodeBytes(nil, true) } else { - d.d.errorf("Invalid d.vd for extensions (Expecting extensions or byte array). Got: 0x%x", d.vd) + d.d.errorf("ext - expecting extensions or byte array - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) return } d.bdRead = false @@ -834,7 +878,7 @@ func (d *bincDecDriver) DecodeNaked() { n.v = valueTypeInt n.i = int64(-1) // int8(-1) default: - d.d.errorf("decodeNaked: Unrecognized special value 0x%x", d.vs) + d.d.errorf("cannot infer value - unrecognized special value from descriptor %x-%x/%s", d.vd, d.vs, bincdesc(d.vd, d.vs)) } case bincVdSmallInt: n.v = valueTypeUint @@ -876,7 +920,7 @@ func (d *bincDecDriver) DecodeNaked() { n.v = valueTypeMap decodeFurther = true default: - d.d.errorf("decodeNaked: Unrecognized d.vd: 0x%x", d.vd) + d.d.errorf("cannot infer value - %s %x-%x/%s", msgBadDesc, d.vd, d.vs, bincdesc(d.vd, d.vs)) } if !decodeFurther { @@ -928,7 +972,7 @@ type BincHandle struct { // - n: none // - a: all: same as m, s, ... - _ [1]uint64 // padding + // _ [1]uint64 // padding } // Name returns the name of the handle: binc diff --git a/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go index be01e19..7633c04 100644 --- a/vendor/github.com/ugorji/go/codec/cbor.go +++ b/vendor/github.com/ugorji/go/codec/cbor.go @@ -60,6 +60,46 @@ const ( cborBaseSimple = 0xe0 ) +func cbordesc(bd byte) string { + switch bd { + case cborBdNil: + return "nil" + case cborBdFalse: + return "false" + case cborBdTrue: + return "true" + case cborBdFloat16, cborBdFloat32, cborBdFloat64: + return "float" + case cborBdIndefiniteBytes: + return "bytes*" + case cborBdIndefiniteString: + return "string*" + case cborBdIndefiniteArray: + return "array*" + case cborBdIndefiniteMap: + return "map*" + default: + switch { + case bd >= cborBaseUint && bd < cborBaseNegInt: + return "(u)int" + case bd >= cborBaseNegInt && bd < cborBaseBytes: + return "int" + case bd >= cborBaseBytes && bd < cborBaseString: + return "bytes" + case bd >= cborBaseString && bd < cborBaseArray: + return "string" + case bd >= cborBaseArray && bd < cborBaseMap: + return "array" + case bd >= cborBaseMap && bd < cborBaseTag: + return "map" + case bd >= cborBaseTag && bd < cborBaseSimple: + return "ext" + default: + return "unknown" + } + } +} + // ------------------- type cborEncDriver struct { @@ -326,7 +366,7 @@ func (d *cborDecDriver) decUint() (ui uint64) { } else if v == 0x1b { ui = uint64(bigen.Uint64(d.r.readx(8))) } else { - d.d.errorf("decUint: Invalid descriptor: %v", d.bd) + d.d.errorf("invalid descriptor decoding uint: %x/%s", d.bd, cbordesc(d.bd)) return } } @@ -342,7 +382,7 @@ func (d *cborDecDriver) decCheckInteger() (neg bool) { } else if major == cborMajorNegInt { neg = true } else { - d.d.errorf("invalid major: %v (bd: %v)", major, d.bd) + d.d.errorf("not an integer - invalid major %v from descriptor %x/%s", major, d.bd, cbordesc(d.bd)) return } return @@ -363,7 +403,7 @@ func (d *cborDecDriver) DecodeInt64() (i int64) { func (d *cborDecDriver) DecodeUint64() (ui uint64) { if d.decCheckInteger() { - d.d.errorf("Assigning negative signed value to unsigned type") + d.d.errorf("assigning negative signed value to unsigned type") return } ui = d.decUint() @@ -384,7 +424,7 @@ func (d *cborDecDriver) DecodeFloat64() (f float64) { } else if bd >= cborBaseUint && bd < cborBaseBytes { f = float64(d.DecodeInt64()) } else { - d.d.errorf("Float only valid from float16/32/64: Invalid descriptor: %v", bd) + d.d.errorf("float only valid from float16/32/64 - invalid descriptor %x/%s", bd, cbordesc(bd)) return } d.bdRead = false @@ -400,7 +440,7 @@ func (d *cborDecDriver) DecodeBool() (b bool) { b = true } else if bd == cborBdFalse { } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + d.d.errorf("not bool - %s %x/%s", msgBadDesc, d.bd, cbordesc(d.bd)) return } d.bdRead = false @@ -441,7 +481,7 @@ func (d *cborDecDriver) decAppendIndefiniteBytes(bs []byte) []byte { } if major := d.bd >> 5; major != cborMajorBytes && major != cborMajorText { d.d.errorf("expect bytes/string major type in indefinite string/bytes;"+ - " got: %v, byte: %v", major, d.bd) + " got major %v from descriptor %x/%x", major, d.bd, cbordesc(d.bd)) return nil } n := d.decLen() @@ -684,7 +724,7 @@ type CborHandle struct { // If unset, we encode time.Time using seconds past epoch. TimeRFC3339 bool - _ [1]uint64 // padding + // _ [1]uint64 // padding } // Name returns the name of the handle: cbor diff --git a/vendor/github.com/ugorji/go/codec/codec_test.go b/vendor/github.com/ugorji/go/codec/codec_test.go index 22e1e3a..2bd9dc5 100644 --- a/vendor/github.com/ugorji/go/codec/codec_test.go +++ b/vendor/github.com/ugorji/go/codec/codec_test.go @@ -881,7 +881,7 @@ func testCodecMiscOne(t *testing.T, h Handle) { } else { logT(t, "------- b: size: %v, value: %s", len(b), b1) } - ts2 := new(TestStrucFlex) + ts2 := emptyTestStrucFlex() testUnmarshalErr(ts2, b, h, t, "pointer-to-struct") if ts2.I64 != math.MaxInt64*2/3 { logT(t, "------- Unmarshal wrong. Expect I64 = 64. Got: %v", ts2.I64) @@ -1874,12 +1874,13 @@ func doTestLargeContainerLen(t *testing.T, h Handle) { 0, 1, math.MaxInt8, math.MaxInt8 + 4, math.MaxInt8 - 4, math.MaxInt16, math.MaxInt16 + 4, math.MaxInt16 - 4, - math.MaxInt32, math.MaxInt32 + 4, math.MaxInt32 - 4, - math.MaxInt64, math.MaxInt64 - 4, + math.MaxInt32, math.MaxInt32 - 4, + // math.MaxInt32 + 4, // bombs on 32-bit + // math.MaxInt64, math.MaxInt64 - 4, // bombs on 32-bit math.MaxUint8, math.MaxUint8 + 4, math.MaxUint8 - 4, math.MaxUint16, math.MaxUint16 + 4, math.MaxUint16 - 4, - math.MaxUint32, math.MaxUint32 + 4, math.MaxUint32 - 4, + // math.MaxUint32, math.MaxUint32 + 4, math.MaxUint32 - 4, // bombs on 32-bit } { m[i] = make([]struct{}, i) } @@ -2286,6 +2287,26 @@ func doTestIntfMapping(t *testing.T, name string, h Handle) { } } +func doTestOmitempty(t *testing.T, name string, h Handle) { + testOnce.Do(testInitAll) + if h.getBasicHandle().StructToArray { + t.Skipf("Skipping OmitEmpty test when StructToArray=true") + } + type T1 struct { + A int `codec:"a"` + B *int `codec:"b,omitempty"` + C int `codec:"c,omitempty"` + } + type T2 struct { + A int `codec:"a"` + } + var v1 T1 + var v2 T2 + b1 := testMarshalErr(v1, h, t, name+"-omitempty") + b2 := testMarshalErr(v2, h, t, name+"-no-omitempty-trunc") + testDeepEqualErr(b1, b2, t, name+"-omitempty-cmp") +} + // ----------------- func TestJsonDecodeNonStringScalarInStringContext(t *testing.T) { @@ -2923,6 +2944,26 @@ func TestSimpleScalars(t *testing.T) { doTestScalars(t, "simple", testSimpleH) } +func TestJsonOmitempty(t *testing.T) { + doTestOmitempty(t, "json", testJsonH) +} + +func TestCborOmitempty(t *testing.T) { + doTestOmitempty(t, "cbor", testCborH) +} + +func TestMsgpackOmitempty(t *testing.T) { + doTestOmitempty(t, "msgpack", testMsgpackH) +} + +func TestBincOmitempty(t *testing.T) { + doTestOmitempty(t, "binc", testBincH) +} + +func TestSimpleOmitempty(t *testing.T) { + doTestOmitempty(t, "simple", testSimpleH) +} + func TestJsonIntfMapping(t *testing.T) { doTestIntfMapping(t, "json", testJsonH) } diff --git a/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/ugorji/go/codec/decode.go index 148c609..1c0817a 100644 --- a/vendor/github.com/ugorji/go/codec/decode.go +++ b/vendor/github.com/ugorji/go/codec/decode.go @@ -16,10 +16,14 @@ import ( // Some tagging information for error messages. const ( - msgBadDesc = "Unrecognized descriptor byte" + msgBadDesc = "unrecognized descriptor byte" msgDecCannotExpandArr = "cannot expand go array from %v to stream length: %v" ) +const decDefSliceCap = 8 +const decDefChanCap = 64 // should be large, as cap cannot be expanded +const decScratchByteArrayLen = cacheLineSize - 8 + var ( errstrOnlyMapOrArrayCanDecodeIntoStruct = "only encoded map or array can be decoded into a struct" errstrCannotDecodeIntoNil = "cannot decode into nil" @@ -1237,7 +1241,7 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { // This way, the order can be kept (as order is lost with map). ti := f.ti if f.seq == seqTypeChan && ti.chandir&uint8(reflect.SendDir) == 0 { - d.errorf("receive-only channel cannot be used for sending byte(s)") + d.errorf("receive-only channel cannot be decoded") } dd := d.d rtelem0 := ti.elem @@ -1356,14 +1360,17 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { if j == 0 && (f.seq == seqTypeSlice || f.seq == seqTypeChan) && rv.IsNil() { if hasLen { rvlen = decInferLen(containerLenS, d.h.MaxInitLen, rtelem0Size) + } else if f.seq == seqTypeSlice { + rvlen = decDefSliceCap } else { - rvlen = 8 + rvlen = decDefChanCap } if rvCanset { if f.seq == seqTypeSlice { rv = reflect.MakeSlice(ti.rt, rvlen, rvlen) rvChanged = true } else { // chan + // xdebugf(">>>>>> haslen = %v, make chan of type '%v' with length: %v", hasLen, ti.rt, rvlen) rv = reflect.MakeChan(ti.rt, rvlen) rvChanged = true } @@ -1385,6 +1392,7 @@ func (d *Decoder) kSlice(f *codecFnInfo, rv reflect.Value) { fn = d.cf.get(rtelem, true, true) } d.decodeValue(rv9, fn, true) + // xdebugf(">>>> rv9 sent on %v during decode: %v, with len=%v, cap=%v", rv.Type(), rv9, rv.Len(), rv.Cap()) rv.Send(rv9) } else { // if indefinite, etc, then expand the slice if necessary @@ -1734,7 +1742,7 @@ type decReaderSwitch struct { esep bool // has elem separators } -// TODO: Uncomment after mid-stack inlining enabled in go 1.10 +// TODO: Uncomment after mid-stack inlining enabled in go 1.11 // // func (z *decReaderSwitch) unreadn1() { // if z.bytes { @@ -1800,8 +1808,6 @@ type decReaderSwitch struct { // return z.ri.readUntil(in, stop) // } -const decScratchByteArrayLen = cacheLineSize - 8 - // A Decoder reads and decodes an object from an input stream in the codec format. type Decoder struct { panicHdl @@ -2002,9 +2008,7 @@ func (d *Decoder) naked() *decNaked { // Note: we allow nil values in the stream anywhere except for map keys. // A nil value in the encoded stream where a map key is expected is treated as an error. func (d *Decoder) Decode(v interface{}) (err error) { - // need to call defer directly, else it seems the recover is not fully handled - defer panicToErrs2(d, &d.err, &err) - defer d.alwaysAtEnd() + defer d.deferred(&err) d.MustDecode(v) return } @@ -2025,11 +2029,15 @@ func (d *Decoder) MustDecode(v interface{}) { // xprintf(">>>>>>>> >>>>>>>> num decFns: %v\n", d.cf.sn) } -// // this is not a smart swallow, as it allocates objects and does unnecessary work. -// func (d *Decoder) swallowViaHammer() { -// var blank interface{} -// d.decodeValueNoFn(reflect.ValueOf(&blank).Elem()) -// } +func (d *Decoder) deferred(err1 *error) { + d.alwaysAtEnd() + if recoverPanicToErr { + if x := recover(); x != nil { + panicValToErr(d, x, err1) + panicValToErr(d, x, &d.err) + } + } +} func (d *Decoder) alwaysAtEnd() { if d.n != nil { @@ -2040,6 +2048,12 @@ func (d *Decoder) alwaysAtEnd() { d.codecFnPooler.alwaysAtEnd() } +// // this is not a smart swallow, as it allocates objects and does unnecessary work. +// func (d *Decoder) swallowViaHammer() { +// var blank interface{} +// d.decodeValueNoFn(reflect.ValueOf(&blank).Elem()) +// } + func (d *Decoder) swallow() { // smarter decode that just swallows the content dd := d.d diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go index 48053d2..ef46529 100644 --- a/vendor/github.com/ugorji/go/codec/encode.go +++ b/vendor/github.com/ugorji/go/codec/encode.go @@ -103,7 +103,15 @@ type EncodeOptions struct { // if > 0, we use a smart buffer internally for performance purposes. WriterBufferSize int - // Encode a struct as an array, and not as a map + // ChanRecvTimeout is the timeout used when selecting from a chan. + // + // Configuring this controls how we receive from a chan during the encoding process. + // - If ==0, we only consume the elements currently available in the chan. + // - if <0, we consume until the chan is closed. + // - If >0, we consume until this timeout. + ChanRecvTimeout time.Duration + + // StructToArray specifies to encode a struct as an array, and not as a map StructToArray bool // Canonical representation means that encoding a value will always result in the same @@ -219,7 +227,9 @@ func (z *ioEncWriter) writen2(b1, b2 byte) { func (z *ioEncWriter) atEndOfEncode() { if z.fw != nil { - z.fw.Flush() + if err := z.fw.Flush(); err != nil { + panic(err) + } } } @@ -312,18 +322,19 @@ func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) { } } if f.seq == seqTypeChan && ti.chandir&uint8(reflect.RecvDir) == 0 { - e.errorf("send-only channel cannot be used for receiving byte(s)") + e.errorf("send-only channel cannot be encoded") } elemsep := e.esep - l := rv.Len() rtelem := ti.elem rtelemIsByte := uint8TypId == rt2id(rtelem) // NOT rtelem.Kind() == reflect.Uint8 + var l int // if a slice, array or chan of bytes, treat specially if rtelemIsByte { switch f.seq { case seqTypeSlice: ee.EncodeStringBytes(cRAW, rv.Bytes()) case seqTypeArray: + l = rv.Len() if rv.CanAddr() { ee.EncodeStringBytes(cRAW, rv.Slice(0, l).Bytes()) } else { @@ -337,24 +348,89 @@ func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) { ee.EncodeStringBytes(cRAW, bs) } case seqTypeChan: - bs := e.b[:0] // do not use range, so that the number of elements encoded // does not change, and encoding does not hang waiting on someone to close chan. // for b := range rv2i(rv).(<-chan byte) { bs = append(bs, b) } // ch := rv2i(rv).(<-chan byte) // fix error - that this is a chan byte, not a <-chan byte. + + if rv.IsNil() { + ee.EncodeNil() + break + } + bs := e.b[:0] irv := rv2i(rv) ch, ok := irv.(<-chan byte) if !ok { ch = irv.(chan byte) } - for i := 0; i < l; i++ { - bs = append(bs, <-ch) + + L1: + switch timeout := e.h.ChanRecvTimeout; { + case timeout == 0: // only consume available + for { + select { + case b := <-ch: + bs = append(bs, b) + default: + break L1 + } + } + case timeout > 0: // consume until timeout + tt := time.NewTimer(timeout) + for { + select { + case b := <-ch: + bs = append(bs, b) + case <-tt.C: + // close(tt.C) + break L1 + } + } + default: // consume until close + for b := range ch { + bs = append(bs, b) + } } + ee.EncodeStringBytes(cRAW, bs) } return } + // if chan, consume chan into a slice, and work off that slice. + var rvcs reflect.Value + if f.seq == seqTypeChan { + rvcs = reflect.Zero(reflect.SliceOf(rtelem)) + timeout := e.h.ChanRecvTimeout + if timeout < 0 { // consume until close + for { + recv, recvOk := rv.Recv() + if !recvOk { + break + } + rvcs = reflect.Append(rvcs, recv) + } + } else { + cases := make([]reflect.SelectCase, 2) + cases[0] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: rv} + if timeout == 0 { + cases[1] = reflect.SelectCase{Dir: reflect.SelectDefault} + } else { + tt := time.NewTimer(timeout) + cases[1] = reflect.SelectCase{Dir: reflect.SelectRecv, Chan: reflect.ValueOf(tt.C)} + } + for { + chosen, recv, recvOk := reflect.Select(cases) + if chosen == 1 || !recvOk { + break + } + rvcs = reflect.Append(rvcs, recv) + } + } + rv = rvcs // TODO: ensure this doesn't mess up anywhere that rv of kind chan is expected + } + + l = rv.Len() if ti.mbs { if l%2 == 1 { e.errorf("mapBySlice requires even slice length, but got %v", l) @@ -388,15 +464,7 @@ func (e *Encoder) kSlice(f *codecFnInfo, rv reflect.Value) { ee.WriteArrayElem() } } - if f.seq == seqTypeChan { - if rv2, ok2 := rv.Recv(); ok2 { - e.encodeValue(rv2, fn, true) - } else { - ee.EncodeNil() // WE HAVE TO DO SOMETHING, so nil if nothing received. - } - } else { - e.encodeValue(rv.Index(j), fn, true) - } + e.encodeValue(rv.Index(j), fn, true) } } @@ -835,7 +903,7 @@ type encWriterSwitch struct { isas bool // whether e.as != nil } -// // TODO: Uncomment after mid-stack inlining enabled in go 1.10 +// // TODO: Uncomment after mid-stack inlining enabled in go 1.11 // func (z *encWriterSwitch) writeb(s []byte) { // if z.wx { @@ -995,9 +1063,12 @@ func (e *Encoder) ResetBytes(out *[]byte) { // Encode writes an object into a stream. // // Encoding can be configured via the struct tag for the fields. -// The "codec" key in struct field's tag value is the key name, +// The key (in the struct tags) that we look at is configurable. +// +// By default, we look up the "codec" key in the struct field's tags, +// and fall bak to the "json" key if "codec" is absent. +// That key in struct field's tag value is the key name, // followed by an optional comma and options. -// Note that the "json" key is used in the absence of the "codec" key. // // To set an option on all fields (e.g. omitempty on all fields), you // can create a field called _struct, and set flags on it. The options @@ -1073,8 +1144,7 @@ func (e *Encoder) ResetBytes(out *[]byte) { // Some formats support symbols (e.g. binc) and will properly encode the string // only once in the stream, and use a tag to refer to it thereafter. func (e *Encoder) Encode(v interface{}) (err error) { - defer panicToErrs2(e, &e.err, &err) - defer e.alwaysAtEnd() + defer e.deferred(&err) e.MustEncode(v) return } @@ -1091,6 +1161,16 @@ func (e *Encoder) MustEncode(v interface{}) { e.alwaysAtEnd() } +func (e *Encoder) deferred(err1 *error) { + e.alwaysAtEnd() + if recoverPanicToErr { + if x := recover(); x != nil { + panicValToErr(e, x, err1) + panicValToErr(e, x, &e.err) + } + } +} + // func (e *Encoder) alwaysAtEnd() { // e.codecFnPooler.alwaysAtEnd() // } diff --git a/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl index fbe802e..59c5983 100644 --- a/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl +++ b/vendor/github.com/ugorji/go/codec/gen-dec-array.go.tmpl @@ -9,13 +9,14 @@ if {{var "l"}} == 0 { } else if len({{var "v"}}) != 0 { {{var "v"}} = {{var "v"}}[:0] {{var "c"}} = true - } {{end}} {{if isChan }}if {{var "v"}} == nil { + } {{else if isChan }}if {{var "v"}} == nil { {{var "v"}} = make({{ .CTyp }}, 0) {{var "c"}} = true } {{end}} } else { {{var "hl"}} := {{var "l"}} > 0 - var {{var "rl"}} int; _ = {{var "rl"}} + var {{var "rl"}} int + _ = {{var "rl"}} {{if isSlice }} if {{var "hl"}} { if {{var "l"}} > cap({{var "v"}}) { {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) @@ -33,25 +34,26 @@ if {{var "l"}} == 0 { var {{var "j"}} int // var {{var "dn"}} bool for ; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { - {{if not isArray}} if {{var "j"}} == 0 && len({{var "v"}}) == 0 { + {{if not isArray}} if {{var "j"}} == 0 && {{var "v"}} == nil { if {{var "hl"}} { {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) } else { - {{var "rl"}} = 8 + {{var "rl"}} = {{if isSlice}}8{{else if isChan}}64{{end}} } - {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) + {{var "v"}} = make({{if isSlice}}[]{{ .Typ }}{{else if isChan}}{{.CTyp}}{{end}}, {{var "rl"}}) {{var "c"}} = true }{{end}} {{var "h"}}.ElemContainerState({{var "j"}}) - {{/* {{var "dn"}} = r.TryDecodeAsNil() */}} - {{if isChan}}{{ $x := printf "%[1]vv%[2]v" .TempVar .Rand }}var {{var $x}} {{ .Typ }} + {{/* {{var "dn"}} = r.TryDecodeAsNil() */}}{{/* commented out, as decLineVar handles this already each time */}} + {{if isChan}}{{ $x := printf "%[1]vvcx%[2]v" .TempVar .Rand }}var {{$x}} {{ .Typ }} {{ decLineVar $x }} {{var "v"}} <- {{ $x }} - {{else}} - // if indefinite, etc, then expand the slice if necessary + // println(">>>> sending ", {{ $x }}, " into ", {{var "v"}}) // TODO: remove this + {{else}}{{/* // if indefinite, etc, then expand the slice if necessary */}} var {{var "db"}} bool if {{var "j"}} >= len({{var "v"}}) { - {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}); {{var "c"}} = true + {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}) + {{var "c"}} = true {{else}} z.DecArrayCannotExpand(len(v), {{var "j"}}+1); {{var "db"}} = true {{end}} } @@ -74,4 +76,3 @@ if {{var "l"}} == 0 { {{if not isArray }}if {{var "c"}} { *{{ .Varname }} = {{var "v"}} }{{end}} - diff --git a/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl b/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl new file mode 100644 index 0000000..4249588 --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/gen-enc-chan.go.tmpl @@ -0,0 +1,27 @@ +{{.Label}}: +switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { +case timeout{{.Sfx}} == 0: // only consume available + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) + default: + break {{.Label}} + } + } +case timeout{{.Sfx}} > 0: // consume until timeout + tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + case <-tt{{.Sfx}}.C: + // close(tt.C) + break {{.Label}} + } + } +default: // consume until close + for b{{.Sfx}} := range {{.Chan}} { + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + } +} diff --git a/vendor/github.com/ugorji/go/codec/gen.generated.go b/vendor/github.com/ugorji/go/codec/gen.generated.go index 799bc76..240ba9f 100644 --- a/vendor/github.com/ugorji/go/codec/gen.generated.go +++ b/vendor/github.com/ugorji/go/codec/gen.generated.go @@ -64,13 +64,14 @@ if {{var "l"}} == 0 { } else if len({{var "v"}}) != 0 { {{var "v"}} = {{var "v"}}[:0] {{var "c"}} = true - } {{end}} {{if isChan }}if {{var "v"}} == nil { + } {{else if isChan }}if {{var "v"}} == nil { {{var "v"}} = make({{ .CTyp }}, 0) {{var "c"}} = true } {{end}} } else { {{var "hl"}} := {{var "l"}} > 0 - var {{var "rl"}} int; _ = {{var "rl"}} + var {{var "rl"}} int + _ = {{var "rl"}} {{if isSlice }} if {{var "hl"}} { if {{var "l"}} > cap({{var "v"}}) { {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) @@ -88,25 +89,26 @@ if {{var "l"}} == 0 { var {{var "j"}} int // var {{var "dn"}} bool for ; ({{var "hl"}} && {{var "j"}} < {{var "l"}}) || !({{var "hl"}} || r.CheckBreak()); {{var "j"}}++ { - {{if not isArray}} if {{var "j"}} == 0 && len({{var "v"}}) == 0 { + {{if not isArray}} if {{var "j"}} == 0 && {{var "v"}} == nil { if {{var "hl"}} { {{var "rl"}} = z.DecInferLen({{var "l"}}, z.DecBasicHandle().MaxInitLen, {{ .Size }}) } else { - {{var "rl"}} = 8 + {{var "rl"}} = {{if isSlice}}8{{else if isChan}}64{{end}} } - {{var "v"}} = make([]{{ .Typ }}, {{var "rl"}}) + {{var "v"}} = make({{if isSlice}}[]{{ .Typ }}{{else if isChan}}{{.CTyp}}{{end}}, {{var "rl"}}) {{var "c"}} = true }{{end}} {{var "h"}}.ElemContainerState({{var "j"}}) - {{/* {{var "dn"}} = r.TryDecodeAsNil() */}} - {{if isChan}}{{ $x := printf "%[1]vv%[2]v" .TempVar .Rand }}var {{var $x}} {{ .Typ }} + {{/* {{var "dn"}} = r.TryDecodeAsNil() */}}{{/* commented out, as decLineVar handles this already each time */}} + {{if isChan}}{{ $x := printf "%[1]vvcx%[2]v" .TempVar .Rand }}var {{$x}} {{ .Typ }} {{ decLineVar $x }} {{var "v"}} <- {{ $x }} - {{else}} - // if indefinite, etc, then expand the slice if necessary + // println(">>>> sending ", {{ $x }}, " into ", {{var "v"}}) // TODO: remove this + {{else}}{{/* // if indefinite, etc, then expand the slice if necessary */}} var {{var "db"}} bool if {{var "j"}} >= len({{var "v"}}) { - {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}); {{var "c"}} = true + {{if isSlice }} {{var "v"}} = append({{var "v"}}, {{ zero }}) + {{var "c"}} = true {{else}} z.DecArrayCannotExpand(len(v), {{var "j"}}+1); {{var "db"}} = true {{end}} } @@ -129,5 +131,34 @@ if {{var "l"}} == 0 { {{if not isArray }}if {{var "c"}} { *{{ .Varname }} = {{var "v"}} }{{end}} - +` + +const genEncChanTmpl = ` +{{.Label}}: +switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { +case timeout{{.Sfx}} == 0: // only consume available + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) + default: + break {{.Label}} + } + } +case timeout{{.Sfx}} > 0: // consume until timeout + tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) + for { + select { + case b{{.Sfx}} := <-{{.Chan}}: + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + case <-tt{{.Sfx}}.C: + // close(tt.C) + break {{.Label}} + } + } +default: // consume until close + for b{{.Sfx}} := range {{.Chan}} { + {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) + } +} ` diff --git a/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/ugorji/go/codec/gen.go index d1dcdab..b4c4031 100644 --- a/vendor/github.com/ugorji/go/codec/gen.go +++ b/vendor/github.com/ugorji/go/codec/gen.go @@ -542,7 +542,6 @@ func (x *genRunner) selfer(encode bool) { if encode { x.line(") CodecEncodeSelf(e *" + x.cpfx + "Encoder) {") x.genRequiredMethodVars(true) - // x.enc(genTopLevelVarName, t) x.encVar(genTopLevelVarName, t) } else { x.line(") CodecDecodeSelf(d *" + x.cpfx + "Decoder) {") @@ -649,7 +648,7 @@ func (x *genRunner) encVar(varname string, t reflect.Type) { case reflect.Ptr: telem := t.Elem() tek := telem.Kind() - if tek == reflect.Array || (tek == reflect.Struct && t != timeTyp) { + if tek == reflect.Array || (tek == reflect.Struct && telem != timeTyp) { x.enc(varname, genNonPtr(t)) break } @@ -1083,28 +1082,49 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { } func (x *genRunner) encListFallback(varname string, t reflect.Type) { + elemBytes := t.Elem().Kind() == reflect.Uint8 if t.AssignableTo(uint8SliceTyp) { x.linef("r.EncodeStringBytes(codecSelferCcRAW%s, []byte(%s))", x.xs, varname) return } - if t.Kind() == reflect.Array && t.Elem().Kind() == reflect.Uint8 { + if t.Kind() == reflect.Array && elemBytes { x.linef("r.EncodeStringBytes(codecSelferCcRAW%s, ((*[%d]byte)(%s))[:])", x.xs, t.Len(), varname) return } i := x.varsfx() - g := genTempVarPfx - x.line("r.WriteArrayStart(len(" + varname + "))") if t.Kind() == reflect.Chan { - x.linef("for %si%s, %si2%s := 0, len(%s); %si%s < %si2%s; %si%s++ {", g, i, g, i, varname, g, i, g, i, g, i) - x.line("r.WriteArrayElem()") - x.linef("%sv%s := <-%s", g, i, varname) - } else { - x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname) - x.line("r.WriteArrayElem()") + type ts struct { + Label, Chan, Slice, Sfx string + } + tm, err := template.New("").Parse(genEncChanTmpl) + if err != nil { + panic(err) + } + x.linef("if %s == nil { r.EncodeNil() } else { ", varname) + x.linef("var sch%s []%s", i, x.genTypeName(t.Elem())) + err = tm.Execute(x.w, &ts{"Lsch" + i, varname, "sch" + i, i}) + if err != nil { + panic(err) + } + // x.linef("%s = sch%s", varname, i) + if elemBytes { + x.linef("r.EncodeStringBytes(codecSelferCcRAW%s, []byte(%s))", x.xs, "sch"+i) + x.line("}") + return + } + varname = "sch" + i } + + x.line("r.WriteArrayStart(len(" + varname + "))") + x.linef("for _, %sv%s := range %s {", genTempVarPfx, i, varname) + x.line("r.WriteArrayElem()") + x.encVar(genTempVarPfx+"v"+i, t.Elem()) x.line("}") x.line("r.WriteArrayEnd()") + if t.Kind() == reflect.Chan { + x.line("}") + } } func (x *genRunner) encMapFallback(varname string, t reflect.Type) { diff --git a/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/ugorji/go/codec/helper.go index e6994a9..bd29895 100644 --- a/vendor/github.com/ugorji/go/codec/helper.go +++ b/vendor/github.com/ugorji/go/codec/helper.go @@ -391,6 +391,10 @@ var immutableKindsSet = [32]bool{ // Any type which implements Selfer will be able to encode or decode itself. // Consequently, during (en|de)code, this takes precedence over // (text|binary)(M|Unm)arshal or extension support. +// +// Note: *the first set of bytes of any value MUST NOT represent nil in the format*. +// This is because, during each decode, we first check the the next set of bytes +// represent nil, and if so, we just set the value to nil. type Selfer interface { CodecEncodeSelf(*Encoder) CodecDecodeSelf(*Decoder) @@ -1543,6 +1547,8 @@ func isEmptyStruct(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) // } func panicToErr(h errstrDecorator, err *error) { + // Note: This method MUST be called directly from defer i.e. defer panicToErr ... + // else it seems the recover is not fully handled if recoverPanicToErr { if x := recover(); x != nil { // fmt.Printf("panic'ing with: %v\n", x) @@ -1552,15 +1558,6 @@ func panicToErr(h errstrDecorator, err *error) { } } -func panicToErrs2(h errstrDecorator, err1, err2 *error) { - if recoverPanicToErr { - if x := recover(); x != nil { - panicValToErr(h, x, err1) - panicValToErr(h, x, err2) - } - } -} - func panicValToErr(h errstrDecorator, v interface{}, err *error) { switch xerr := v.(type) { case nil: diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_unsafe.go index 21aa4db..e3df60a 100644 --- a/vendor/github.com/ugorji/go/codec/helper_unsafe.go +++ b/vendor/github.com/ugorji/go/codec/helper_unsafe.go @@ -157,7 +157,8 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) b } return isnil case reflect.Ptr: - isnil := urv.ptr == nil + // isnil := urv.ptr == nil (not sufficient, as a pointer value encodes the type) + isnil := urv.ptr == nil || *(*unsafe.Pointer)(urv.ptr) == nil if deref { if isnil { return true @@ -175,25 +176,31 @@ func isEmptyValue(v reflect.Value, tinfos *TypeInfos, deref, checkStruct bool) b // -------------------------- +// atomicTypeInfoSlice contains length and pointer to the array for a slice. +// It is expected to be 2 words. +// +// Previously, we atomically loaded and stored the length and array pointer separately, +// which could lead to some races. +// We now just atomically store and load the pointer to the value directly. + type atomicTypeInfoSlice struct { // expected to be 2 words + l int // length of the data array (must be first in struct, for 64-bit alignment necessary for 386) v unsafe.Pointer // data array - Pointer (not uintptr) to maintain GC reference - l int64 // length of the data array } func (x *atomicTypeInfoSlice) load() []rtid2ti { - l := int(atomic.LoadInt64(&x.l)) - if l == 0 { + xp := unsafe.Pointer(x) + x2 := *(*atomicTypeInfoSlice)(atomic.LoadPointer(&xp)) + if x2.l == 0 { return nil } - return *(*[]rtid2ti)(unsafe.Pointer(&unsafeSlice{Data: atomic.LoadPointer(&x.v), Len: l, Cap: l})) - // return (*[]rtid2ti)(atomic.LoadPointer(&x.v)) + return *(*[]rtid2ti)(unsafe.Pointer(&unsafeSlice{Data: x2.v, Len: x2.l, Cap: x2.l})) } func (x *atomicTypeInfoSlice) store(p []rtid2ti) { s := (*unsafeSlice)(unsafe.Pointer(&p)) - atomic.StorePointer(&x.v, s.Data) - atomic.StoreInt64(&x.l, int64(s.Len)) - // atomic.StorePointer(&x.v, unsafe.Pointer(p)) + xp := unsafe.Pointer(x) + atomic.StorePointer(&xp, unsafe.Pointer(&atomicTypeInfoSlice{l: s.Len, v: s.Data})) } // -------------------------- diff --git a/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/ugorji/go/codec/json.go index ec7b0d6..bdd1996 100644 --- a/vendor/github.com/ugorji/go/codec/json.go +++ b/vendor/github.com/ugorji/go/codec/json.go @@ -606,7 +606,7 @@ func (d *jsonDecDriver) ReadMapStart() int { } const xc uint8 = '{' if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read map - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 d.c = containerMapStart @@ -619,7 +619,7 @@ func (d *jsonDecDriver) ReadArrayStart() int { } const xc uint8 = '[' if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read array - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 d.c = containerArrayStart @@ -638,9 +638,10 @@ func (d *jsonDecDriver) CheckBreak() bool { // - ReadArrayElem would become: // readContainerState(containerArrayElem, ',', d.c != containerArrayStart) // -// However, until mid-stack inlining (go 1.10?) comes, supporting inlining of -// oneliners, we explicitly write them all 5 out to elide the extra func call. -// TODO: For Go 1.10, if inlined, consider consolidating these. +// However, until mid-stack inlining comes in go1.11 which supports inlining of +// one-liners, we explicitly write them all 5 out to elide the extra func call. +// +// TODO: For Go 1.11, if inlined, consider consolidating these. func (d *jsonDecDriver) ReadArrayElem() { const xc uint8 = ',' @@ -649,7 +650,7 @@ func (d *jsonDecDriver) ReadArrayElem() { } if d.c != containerArrayStart { if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read array element - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 } @@ -662,7 +663,7 @@ func (d *jsonDecDriver) ReadArrayEnd() { d.tok = d.r.skip(&jsonCharWhitespaceSet) } if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read array end - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 d.c = containerArrayEnd @@ -675,7 +676,7 @@ func (d *jsonDecDriver) ReadMapElemKey() { } if d.c != containerMapStart { if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read map key - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 } @@ -688,7 +689,7 @@ func (d *jsonDecDriver) ReadMapElemValue() { d.tok = d.r.skip(&jsonCharWhitespaceSet) } if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read map value - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 d.c = containerMapValue @@ -700,7 +701,7 @@ func (d *jsonDecDriver) ReadMapEnd() { d.tok = d.r.skip(&jsonCharWhitespaceSet) } if d.tok != xc { - d.d.errorf("expect char '%c' but got char '%c'", xc, d.tok) + d.d.errorf("read map end - expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 d.c = containerMapEnd @@ -1267,7 +1268,7 @@ type JsonHandle struct { // If not configured, raw bytes are encoded to/from base64 text. RawBytesExt InterfaceExt - _ [3]uint64 // padding + _ [2]uint64 // padding } // Name returns the name of the handle: json diff --git a/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go b/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go index ce9324a..b3813bc 100644 --- a/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go +++ b/vendor/github.com/ugorji/go/codec/mammoth2_codecgen_generated_test.go @@ -38224,7 +38224,6 @@ func (x codecSelfer19781) dectestMammoth2Basic(v *testMammoth2Basic, d *Decoder) yyh1.ElemContainerState(yyj1) - // if indefinite, etc, then expand the slice if necessary var yydb1 bool if yyj1 >= len(yyv1) { z.DecArrayCannotExpand(len(v), yyj1+1) @@ -38372,7 +38371,7 @@ func (x codecSelfer19781) decSliceTestMammoth2(v *[]TestMammoth2, d *Decoder) { var yyj1 int // var yydn1 bool for ; (yyhl1 && yyj1 < yyl1) || !(yyhl1 || r.CheckBreak()); yyj1++ { - if yyj1 == 0 && len(yyv1) == 0 { + if yyj1 == 0 && yyv1 == nil { if yyhl1 { yyrl1 = z.DecInferLen(yyl1, z.DecBasicHandle().MaxInitLen, 4880) } else { @@ -38383,7 +38382,6 @@ func (x codecSelfer19781) decSliceTestMammoth2(v *[]TestMammoth2, d *Decoder) { } yyh1.ElemContainerState(yyj1) - // if indefinite, etc, then expand the slice if necessary var yydb1 bool if yyj1 >= len(yyv1) { yyv1 = append(yyv1, TestMammoth2{}) @@ -38414,7 +38412,6 @@ func (x codecSelfer19781) decSliceTestMammoth2(v *[]TestMammoth2, d *Decoder) { if yyc1 { *v = yyv1 } - } func (x codecSelfer19781) encArray4int64(v *[4]int64, e *Encoder) { @@ -38452,7 +38449,6 @@ func (x codecSelfer19781) decArray4int64(v *[4]int64, d *Decoder) { yyh1.ElemContainerState(yyj1) - // if indefinite, etc, then expand the slice if necessary var yydb1 bool if yyj1 >= len(yyv1) { z.DecArrayCannotExpand(len(v), yyj1+1) diff --git a/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go index 31265cc..3271579 100644 --- a/vendor/github.com/ugorji/go/codec/msgpack.go +++ b/vendor/github.com/ugorji/go/codec/msgpack.go @@ -82,6 +82,86 @@ const ( var mpTimeExtTag int8 = -1 var mpTimeExtTagU = uint8(mpTimeExtTag) +// var mpdesc = map[byte]string{ +// mpPosFixNumMin: "PosFixNumMin", +// mpPosFixNumMax: "PosFixNumMax", +// mpFixMapMin: "FixMapMin", +// mpFixMapMax: "FixMapMax", +// mpFixArrayMin: "FixArrayMin", +// mpFixArrayMax: "FixArrayMax", +// mpFixStrMin: "FixStrMin", +// mpFixStrMax: "FixStrMax", +// mpNil: "Nil", +// mpFalse: "False", +// mpTrue: "True", +// mpFloat: "Float", +// mpDouble: "Double", +// mpUint8: "Uint8", +// mpUint16: "Uint16", +// mpUint32: "Uint32", +// mpUint64: "Uint64", +// mpInt8: "Int8", +// mpInt16: "Int16", +// mpInt32: "Int32", +// mpInt64: "Int64", +// mpBin8: "Bin8", +// mpBin16: "Bin16", +// mpBin32: "Bin32", +// mpExt8: "Ext8", +// mpExt16: "Ext16", +// mpExt32: "Ext32", +// mpFixExt1: "FixExt1", +// mpFixExt2: "FixExt2", +// mpFixExt4: "FixExt4", +// mpFixExt8: "FixExt8", +// mpFixExt16: "FixExt16", +// mpStr8: "Str8", +// mpStr16: "Str16", +// mpStr32: "Str32", +// mpArray16: "Array16", +// mpArray32: "Array32", +// mpMap16: "Map16", +// mpMap32: "Map32", +// mpNegFixNumMin: "NegFixNumMin", +// mpNegFixNumMax: "NegFixNumMax", +// } + +func mpdesc(bd byte) string { + switch bd { + case mpNil: + return "nil" + case mpFalse: + return "false" + case mpTrue: + return "true" + case mpFloat, mpDouble: + return "float" + case mpUint8, mpUint16, mpUint32, mpUint64: + return "uint" + case mpInt8, mpInt16, mpInt32, mpInt64: + return "int" + default: + switch { + case bd >= mpPosFixNumMin && bd <= mpPosFixNumMax: + return "int" + case bd >= mpNegFixNumMin && bd <= mpNegFixNumMax: + return "int" + case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax: + return "string|bytes" + case bd == mpBin8, bd == mpBin16, bd == mpBin32: + return "bytes" + case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: + return "array" + case bd == mpMap16, bd == mpMap32, bd >= mpFixMapMin && bd <= mpFixMapMax: + return "map" + case bd >= mpFixExt1 && bd <= mpFixExt16, bd >= mpExt8 && bd <= mpExt32: + return "ext" + default: + return "unknown" + } + } +} + // MsgpackSpecRpcMultiArgs is a special type which signifies to the MsgpackSpecRpcCodec // that the backend RPC service takes multiple arguments, which have been arranged // in sequence in the slice. @@ -442,7 +522,7 @@ func (d *msgpackDecDriver) DecodeNaked() { n.l = d.r.readx(clen) } default: - d.d.errorf("Nil-Deciphered DecodeValue: %s: hex: %x, dec: %d", msgBadDesc, bd, bd) + d.d.errorf("cannot infer value: %s: Ox%x/%d/%s", msgBadDesc, bd, bd, mpdesc(bd)) } } if !decodeFurther { @@ -484,7 +564,7 @@ func (d *msgpackDecDriver) DecodeInt64() (i int64) { case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax: i = int64(int8(d.bd)) default: - d.d.errorf("Unhandled single-byte unsigned integer value: %s: %x", msgBadDesc, d.bd) + d.d.errorf("cannot decode signed integer: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd)) return } } @@ -510,28 +590,28 @@ func (d *msgpackDecDriver) DecodeUint64() (ui uint64) { if i := int64(int8(d.r.readn1())); i >= 0 { ui = uint64(i) } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) return } case mpInt16: if i := int64(int16(bigen.Uint16(d.r.readx(2)))); i >= 0 { ui = uint64(i) } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) return } case mpInt32: if i := int64(int32(bigen.Uint32(d.r.readx(4)))); i >= 0 { ui = uint64(i) } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) return } case mpInt64: if i := int64(bigen.Uint64(d.r.readx(8))); i >= 0 { ui = uint64(i) } else { - d.d.errorf("Assigning negative signed value: %v, to unsigned type", i) + d.d.errorf("assigning negative signed value: %v, to unsigned type", i) return } default: @@ -539,10 +619,10 @@ func (d *msgpackDecDriver) DecodeUint64() (ui uint64) { case d.bd >= mpPosFixNumMin && d.bd <= mpPosFixNumMax: ui = uint64(d.bd) case d.bd >= mpNegFixNumMin && d.bd <= mpNegFixNumMax: - d.d.errorf("Assigning negative signed value: %v, to unsigned type", int(d.bd)) + d.d.errorf("assigning negative signed value: %v, to unsigned type", int(d.bd)) return default: - d.d.errorf("Unhandled single-byte unsigned integer value: %s: %x", msgBadDesc, d.bd) + d.d.errorf("cannot decode unsigned integer: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd)) return } } @@ -576,7 +656,7 @@ func (d *msgpackDecDriver) DecodeBool() (b bool) { } else if d.bd == mpTrue || d.bd == 1 { b = true } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + d.d.errorf("cannot decode bool: %s: %x/%s", msgBadDesc, d.bd, mpdesc(d.bd)) return } d.bdRead = false @@ -699,7 +779,7 @@ func (d *msgpackDecDriver) readContainerLen(ct msgpackContainerType) (clen int) } else if (ct.bFixMin & bd) == ct.bFixMin { clen = int(ct.bFixMin ^ bd) } else { - d.d.errorf("readContainerLen: %s: hex: %x, decimal: %d", msgBadDesc, bd, bd) + d.d.errorf("cannot read container length: %s: hex: %x, decimal: %d", msgBadDesc, bd, bd) return } d.bdRead = false @@ -800,7 +880,7 @@ func (d *msgpackDecDriver) decodeTime(clen int) (t time.Time) { func (d *msgpackDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { if xtag > 0xff { - d.d.errorf("decodeExt: tag must be <= 0xff; got: %v", xtag) + d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag) return } realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) @@ -829,7 +909,7 @@ func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs clen := d.readExtLen() xtag = d.r.readn1() if verifyTag && xtag != tag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) + d.d.errorf("wrong extension tag - got %b, expecting %v", xtag, tag) return } xbs = d.r.readx(clen) @@ -865,7 +945,7 @@ type MsgpackHandle struct { binaryEncodingType noElemSeparators - _ [1]uint64 // padding + // _ [1]uint64 // padding } // Name returns the name of the handle: msgpack @@ -970,13 +1050,13 @@ func (c *msgpackSpecRpcCodec) parseCustomHeader(expectTypeByte byte, msgid *uint var b = ba[0] if b != fia { - err = fmt.Errorf("Unexpected value for array descriptor: Expecting %v. Received %v", fia, b) + err = fmt.Errorf("not array - %s %x/%s", msgBadDesc, b, mpdesc(b)) } else { err = c.read(&b) if err == nil { if b != expectTypeByte { - err = fmt.Errorf("Unexpected byte descriptor. Expecting %v; Received %v", - expectTypeByte, b) + err = fmt.Errorf("%s - expecting %v but got %x/%s", + msgBadDesc, expectTypeByte, b, mpdesc(b)) } else { err = c.read(msgid) if err == nil { diff --git a/vendor/github.com/ugorji/go/codec/noop.go b/vendor/github.com/ugorji/go/codec/noop.go deleted file mode 100644 index 424bd49..0000000 --- a/vendor/github.com/ugorji/go/codec/noop.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. -// Use of this source code is governed by a MIT license found in the LICENSE file. - -// +build ignore - -package codec - -import ( - "math/rand" - "time" -) - -// NoopHandle returns a no-op handle. It basically does nothing. -// It is only useful for benchmarking, as it gives an idea of the -// overhead from the codec framework. -// -// LIBRARY USERS: *** DO NOT USE *** -func NoopHandle(slen int) *noopHandle { - h := noopHandle{} - h.rand = rand.New(rand.NewSource(time.Now().UnixNano())) - h.B = make([][]byte, slen) - h.S = make([]string, slen) - for i := 0; i < len(h.S); i++ { - b := make([]byte, i+1) - for j := 0; j < len(b); j++ { - b[j] = 'a' + byte(i) - } - h.B[i] = b - h.S[i] = string(b) - } - return &h -} - -// noopHandle does nothing. -// It is used to simulate the overhead of the codec framework. -type noopHandle struct { - BasicHandle - binaryEncodingType - noopDrv // noopDrv is unexported here, so we can get a copy of it when needed. -} - -type noopDrv struct { - d *Decoder - e *Encoder - i int - S []string - B [][]byte - mks []bool // stack. if map (true), else if array (false) - mk bool // top of stack. what container are we on? map or array? - ct valueType // last response for IsContainerType. - cb int // counter for ContainerType - rand *rand.Rand -} - -func (h *noopDrv) r(v int) int { return h.rand.Intn(v) } -func (h *noopDrv) m(v int) int { h.i++; return h.i % v } - -func (h *noopDrv) newEncDriver(e *Encoder) encDriver { h.e = e; return h } -func (h *noopDrv) newDecDriver(d *Decoder) decDriver { h.d = d; return h } - -func (h *noopDrv) reset() {} -func (h *noopDrv) uncacheRead() {} - -// --- encDriver - -// stack functions (for map and array) -func (h *noopDrv) start(b bool) { - // println("start", len(h.mks)+1) - h.mks = append(h.mks, b) - h.mk = b -} -func (h *noopDrv) end() { - // println("end: ", len(h.mks)-1) - h.mks = h.mks[:len(h.mks)-1] - if len(h.mks) > 0 { - h.mk = h.mks[len(h.mks)-1] - } else { - h.mk = false - } -} - -func (h *noopDrv) EncodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) EncodeNil() {} -func (h *noopDrv) EncodeInt(i int64) {} -func (h *noopDrv) EncodeUint(i uint64) {} -func (h *noopDrv) EncodeBool(b bool) {} -func (h *noopDrv) EncodeFloat32(f float32) {} -func (h *noopDrv) EncodeFloat64(f float64) {} -func (h *noopDrv) EncodeRawExt(re *RawExt, e *Encoder) {} -func (h *noopDrv) EncodeArrayStart(length int) { h.start(true) } -func (h *noopDrv) EncodeMapStart(length int) { h.start(false) } -func (h *noopDrv) EncodeEnd() { h.end() } - -func (h *noopDrv) EncodeString(c charEncoding, v string) {} - -// func (h *noopDrv) EncodeSymbol(v string) {} -func (h *noopDrv) EncodeStringBytes(c charEncoding, v []byte) {} - -func (h *noopDrv) EncodeExt(rv interface{}, xtag uint64, ext Ext, e *Encoder) {} - -// ---- decDriver -func (h *noopDrv) initReadNext() {} -func (h *noopDrv) CheckBreak() bool { return false } -func (h *noopDrv) IsBuiltinType(rt uintptr) bool { return false } -func (h *noopDrv) DecodeBuiltin(rt uintptr, v interface{}) {} -func (h *noopDrv) DecodeInt(bitsize uint8) (i int64) { return int64(h.m(15)) } -func (h *noopDrv) DecodeUint(bitsize uint8) (ui uint64) { return uint64(h.m(35)) } -func (h *noopDrv) DecodeFloat(chkOverflow32 bool) (f float64) { return float64(h.m(95)) } -func (h *noopDrv) DecodeBool() (b bool) { return h.m(2) == 0 } -func (h *noopDrv) DecodeString() (s string) { return h.S[h.m(8)] } -func (h *noopDrv) DecodeStringAsBytes() []byte { return h.DecodeBytes(nil, true) } - -func (h *noopDrv) DecodeBytes(bs []byte, zerocopy bool) []byte { return h.B[h.m(len(h.B))] } - -func (h *noopDrv) ReadEnd() { h.end() } - -// toggle map/slice -func (h *noopDrv) ReadMapStart() int { h.start(true); return h.m(10) } -func (h *noopDrv) ReadArrayStart() int { h.start(false); return h.m(10) } - -func (h *noopDrv) ContainerType() (vt valueType) { - // return h.m(2) == 0 - // handle kStruct, which will bomb is it calls this and - // doesn't get back a map or array. - // consequently, if the return value is not map or array, - // reset it to one of them based on h.m(7) % 2 - // for kstruct: at least one out of every 2 times, - // return one of valueTypeMap or Array (else kstruct bombs) - // however, every 10th time it is called, we just return something else. - var vals = [...]valueType{valueTypeArray, valueTypeMap} - // ------------ TAKE ------------ - // if h.cb%2 == 0 { - // if h.ct == valueTypeMap || h.ct == valueTypeArray { - // } else { - // h.ct = vals[h.m(2)] - // } - // } else if h.cb%5 == 0 { - // h.ct = valueType(h.m(8)) - // } else { - // h.ct = vals[h.m(2)] - // } - // ------------ TAKE ------------ - // if h.cb%16 == 0 { - // h.ct = valueType(h.cb % 8) - // } else { - // h.ct = vals[h.cb%2] - // } - h.ct = vals[h.cb%2] - h.cb++ - return h.ct - - // if h.ct == valueTypeNil || h.ct == valueTypeString || h.ct == valueTypeBytes { - // return h.ct - // } - // return valueTypeUnset - // TODO: may need to tweak this so it works. - // if h.ct == valueTypeMap && vt == valueTypeArray || - // h.ct == valueTypeArray && vt == valueTypeMap { - // h.cb = !h.cb - // h.ct = vt - // return h.cb - // } - // // go in a loop and check it. - // h.ct = vt - // h.cb = h.m(7) == 0 - // return h.cb -} -func (h *noopDrv) TryDecodeAsNil() bool { - if h.mk { - return false - } else { - return h.m(8) == 0 - } -} -func (h *noopDrv) DecodeExt(rv interface{}, xtag uint64, ext Ext) uint64 { - return 0 -} - -func (h *noopDrv) DecodeNaked() { - // use h.r (random) not h.m() because h.m() could cause the same value to be given. - var sk int - if h.mk { - // if mapkey, do not support values of nil OR bytes, array, map or rawext - sk = h.r(7) + 1 - } else { - sk = h.r(12) - } - n := &h.d.n - switch sk { - case 0: - n.v = valueTypeNil - case 1: - n.v, n.b = valueTypeBool, false - case 2: - n.v, n.b = valueTypeBool, true - case 3: - n.v, n.i = valueTypeInt, h.DecodeInt(64) - case 4: - n.v, n.u = valueTypeUint, h.DecodeUint(64) - case 5: - n.v, n.f = valueTypeFloat, h.DecodeFloat(true) - case 6: - n.v, n.f = valueTypeFloat, h.DecodeFloat(false) - case 7: - n.v, n.s = valueTypeString, h.DecodeString() - case 8: - n.v, n.l = valueTypeBytes, h.B[h.m(len(h.B))] - case 9: - n.v = valueTypeArray - case 10: - n.v = valueTypeMap - default: - n.v = valueTypeExt - n.u = h.DecodeUint(64) - n.l = h.B[h.m(len(h.B))] - } - h.ct = n.v - return -} diff --git a/vendor/github.com/ugorji/go/codec/rpc.go b/vendor/github.com/ugorji/go/codec/rpc.go index 7c3069e..9fb3c01 100644 --- a/vendor/github.com/ugorji/go/codec/rpc.go +++ b/vendor/github.com/ugorji/go/codec/rpc.go @@ -104,7 +104,7 @@ func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2 bool) (err error) { if err == nil { err = c.f.Flush() } else { - c.f.Flush() + _ = c.f.Flush() // swallow flush error, so we maintain prior error on write } } return @@ -144,15 +144,6 @@ func (c *rpcCodec) Close() error { } c.clsmu.Lock() c.cls = true - // var fErr error - // if c.f != nil { - // fErr = c.f.Flush() - // } - // _ = fErr - // c.clsErr = c.c.Close() - // if c.clsErr == nil && fErr != nil { - // c.clsErr = fErr - // } c.clsErr = c.c.Close() c.clsmu.Unlock() return c.clsErr diff --git a/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/ugorji/go/codec/simple.go index a839d81..f1e181e 100644 --- a/vendor/github.com/ugorji/go/codec/simple.go +++ b/vendor/github.com/ugorji/go/codec/simple.go @@ -290,7 +290,7 @@ func (d *simpleDecDriver) decCheckInteger() (ui uint64, neg bool) { ui = uint64(bigen.Uint64(d.r.readx(8))) neg = true default: - d.d.errorf("Integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd) + d.d.errorf("integer only valid from pos/neg integer1..8. Invalid descriptor: %v", d.bd) return } // don't do this check, because callers may only want the unsigned value. @@ -314,7 +314,7 @@ func (d *simpleDecDriver) DecodeInt64() (i int64) { func (d *simpleDecDriver) DecodeUint64() (ui uint64) { ui, neg := d.decCheckInteger() if neg { - d.d.errorf("Assigning negative signed value to unsigned type") + d.d.errorf("assigning negative signed value to unsigned type") return } d.bdRead = false @@ -333,7 +333,7 @@ func (d *simpleDecDriver) DecodeFloat64() (f float64) { if d.bd >= simpleVdPosInt && d.bd <= simpleVdNegInt+3 { f = float64(d.DecodeInt64()) } else { - d.d.errorf("Float only valid from float32/64: Invalid descriptor: %v", d.bd) + d.d.errorf("float only valid from float32/64: Invalid descriptor: %v", d.bd) return } } @@ -350,7 +350,7 @@ func (d *simpleDecDriver) DecodeBool() (b bool) { b = true } else if d.bd == simpleVdFalse { } else { - d.d.errorf("Invalid single-byte value for bool: %s: %x", msgBadDesc, d.bd) + d.d.errorf("cannot decode bool - %s: %x", msgBadDesc, d.bd) return } d.bdRead = false @@ -418,7 +418,7 @@ func (d *simpleDecDriver) decLen() int { } return int(ui) } - d.d.errorf("decLen: Cannot read length: bd%%8 must be in range 0..4. Got: %d", d.bd%8) + d.d.errorf("cannot read length: bd%%8 must be in range 0..4. Got: %d", d.bd%8) return -1 } @@ -482,7 +482,7 @@ func (d *simpleDecDriver) DecodeTime() (t time.Time) { func (d *simpleDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { if xtag > 0xff { - d.d.errorf("decodeExt: tag must be <= 0xff; got: %v", xtag) + d.d.errorf("ext: tag must be <= 0xff; got: %v", xtag) return } realxtag1, xbs := d.decodeExtV(ext != nil, uint8(xtag)) @@ -506,7 +506,7 @@ func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs [ l := d.decLen() xtag = d.r.readn1() if verifyTag && xtag != tag { - d.d.errorf("Wrong extension tag. Got %b. Expecting: %v", xtag, tag) + d.d.errorf("wrong extension tag. Got %b. Expecting: %v", xtag, tag) return } xbs = d.r.readx(l) @@ -514,7 +514,7 @@ func (d *simpleDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs [ simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: xbs = d.DecodeBytes(nil, true) default: - d.d.errorf("Invalid descriptor - expecting extensions/bytearray, got: 0x%x", d.bd) + d.d.errorf("ext - %s - expecting extensions/bytearray, got: 0x%x", msgBadDesc, d.bd) return } d.bdRead = false @@ -579,7 +579,7 @@ func (d *simpleDecDriver) DecodeNaked() { n.v = valueTypeMap decodeFurther = true default: - d.d.errorf("decodeNaked: Unrecognized d.bd: 0x%x", d.bd) + d.d.errorf("cannot infer value - %s 0x%x", msgBadDesc, d.bd) } if !decodeFurther { @@ -616,7 +616,7 @@ type SimpleHandle struct { // EncZeroValuesAsNil says to encode zero values for numbers, bool, string, etc as nil EncZeroValuesAsNil bool - _ [1]uint64 // padding + // _ [1]uint64 // padding } // Name returns the name of the handle: simple diff --git a/vendor/github.com/ugorji/go/codec/values_flex_test.go b/vendor/github.com/ugorji/go/codec/values_flex_test.go index 3b7da27..6f7de69 100644 --- a/vendor/github.com/ugorji/go/codec/values_flex_test.go +++ b/vendor/github.com/ugorji/go/codec/values_flex_test.go @@ -5,7 +5,12 @@ package codec -import "time" +import ( + "strings" + "time" +) + +const teststrucflexChanCap = 64 // This file contains values used by tests alone. // This is where we may try out different things, @@ -40,10 +45,6 @@ type SstructbigMapBySlice struct { Sptr *Sstructbig } -type Sinterface interface { - Noop() -} - // small struct for testing that codecgen works for unexported types type tLowerFirstLetter struct { I int @@ -62,6 +63,7 @@ type AnonInTestStrucIntf struct { Ms map[string]interface{} Nintf interface{} //don't set this, so we can test for nil T time.Time + Tptr *time.Time } var testWRepeated512 wrapBytes @@ -79,6 +81,8 @@ type TestStrucFlex struct { _struct struct{} `codec:",omitempty"` //set omitempty for every field TestStrucCommon + Chstr chan string + Mis map[int]string Mbu64 map[bool]struct{} Miwu64s map[int]wrapUint64Slice @@ -108,8 +112,21 @@ type TestStrucFlex struct { Nteststruc *TestStrucFlex } +func emptyTestStrucFlex() *TestStrucFlex { + var ts TestStrucFlex + // we initialize and start draining the chan, so that we can decode into it without it blocking due to no consumer + ts.Chstr = make(chan string, teststrucflexChanCap) + go func() { + for range ts.Chstr { + } + }() // drain it + return &ts +} + func newTestStrucFlex(depth, n int, bench, useInterface, useStringKeyOnly bool) (ts *TestStrucFlex) { ts = &TestStrucFlex{ + Chstr: make(chan string, teststrucflexChanCap), + Miwu64s: map[int]wrapUint64Slice{ 5: []wrapUint64{1, 2, 3, 4, 5}, 3: []wrapUint64{1, 2, 3}, @@ -156,6 +173,11 @@ func newTestStrucFlex(depth, n int, bench, useInterface, useStringKeyOnly bool) ArrStrUi64T: [4]stringUint64T{{"4", 4}, {"3", 3}, {"2", 2}, {"1", 1}}, } + numChanSend := cap(ts.Chstr) / 4 // 8 + for i := 0; i < numChanSend; i++ { + ts.Chstr <- strings.Repeat("A", i+1) + } + ts.Ui64slicearray = []*[4]uint64{&ts.Ui64array, &ts.Ui64array} if useInterface { diff --git a/vendor/github.com/ugorji/go/codec/z_all_test.go b/vendor/github.com/ugorji/go/codec/z_all_test.go index 58a3aa0..cc9c843 100644 --- a/vendor/github.com/ugorji/go/codec/z_all_test.go +++ b/vendor/github.com/ugorji/go/codec/z_all_test.go @@ -229,6 +229,11 @@ func testCodecGroup(t *testing.T) { t.Run("TestMsgpackScalars", TestMsgpackScalars) t.Run("TestBincScalars", TestBincScalars) t.Run("TestSimpleScalars", TestSimpleScalars) + t.Run("TestJsonOmitempty", TestJsonOmitempty) + t.Run("TestCborOmitempty", TestCborOmitempty) + t.Run("TestMsgpackOmitempty", TestMsgpackOmitempty) + t.Run("TestBincOmitempty", TestBincOmitempty) + t.Run("TestSimpleOmitempty", TestSimpleOmitempty) t.Run("TestJsonIntfMapping", TestJsonIntfMapping) t.Run("TestCborIntfMapping", TestCborIntfMapping) t.Run("TestMsgpackIntfMapping", TestMsgpackIntfMapping) @@ -265,6 +270,7 @@ func testJsonGroup(t *testing.T) { t.Run("TestJsonUintToInt", TestJsonUintToInt) t.Run("TestJsonDifferentMapOrSliceType", TestJsonDifferentMapOrSliceType) t.Run("TestJsonScalars", TestJsonScalars) + t.Run("TestJsonOmitempty", TestJsonOmitempty) t.Run("TestJsonIntfMapping", TestJsonIntfMapping) } @@ -289,6 +295,8 @@ func testBincGroup(t *testing.T) { t.Run("TestBincUintToInt", TestBincUintToInt) t.Run("TestBincDifferentMapOrSliceType", TestBincDifferentMapOrSliceType) t.Run("TestBincScalars", TestBincScalars) + t.Run("TestBincOmitempty", TestBincOmitempty) + t.Run("TestBincIntfMapping", TestBincIntfMapping) } func testCborGroup(t *testing.T) { @@ -313,7 +321,8 @@ func testCborGroup(t *testing.T) { t.Run("TestCborUintToInt", TestCborUintToInt) t.Run("TestCborDifferentMapOrSliceType", TestCborDifferentMapOrSliceType) t.Run("TestCborScalars", TestCborScalars) - + t.Run("TestCborOmitempty", TestCborOmitempty) + t.Run("TestCborIntfMapping", TestCborIntfMapping) t.Run("TestCborHalfFloat", TestCborHalfFloat) } @@ -337,6 +346,8 @@ func testMsgpackGroup(t *testing.T) { t.Run("TestMsgpackUintToInt", TestMsgpackUintToInt) t.Run("TestMsgpackDifferentMapOrSliceType", TestMsgpackDifferentMapOrSliceType) t.Run("TestMsgpackScalars", TestMsgpackScalars) + t.Run("TestMsgpackOmitempty", TestMsgpackOmitempty) + t.Run("TestMsgpackIntfMapping", TestMsgpackIntfMapping) } func testSimpleGroup(t *testing.T) { @@ -358,6 +369,8 @@ func testSimpleGroup(t *testing.T) { t.Run("TestSimpleUintToInt", TestSimpleUintToInt) t.Run("TestSimpleDifferentMapOrSliceType", TestSimpleDifferentMapOrSliceType) t.Run("TestSimpleScalars", TestSimpleScalars) + t.Run("TestSimpleOmitempty", TestSimpleOmitempty) + t.Run("TestSimpleIntfMapping", TestSimpleIntfMapping) } func testSimpleMammothGroup(t *testing.T) { diff --git a/vendor/golang.org/x/crypto/CONTRIBUTING.md b/vendor/golang.org/x/crypto/CONTRIBUTING.md index 88dff59..d0485e8 100644 --- a/vendor/golang.org/x/crypto/CONTRIBUTING.md +++ b/vendor/golang.org/x/crypto/CONTRIBUTING.md @@ -4,16 +4,15 @@ Go is an open source project. It is the work of hundreds of contributors. We appreciate your help! - ## Filing issues When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. The gophers there will answer or ask you to file an issue if you've tripped over a bug. @@ -23,9 +22,5 @@ The gophers there will answer or ask you to file an issue if you've tripped over Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches. -**We do not accept GitHub pull requests** -(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). - Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. - diff --git a/vendor/golang.org/x/crypto/acme/acme.go b/vendor/golang.org/x/crypto/acme/acme.go index fa9c4b3..1f4fb69 100644 --- a/vendor/golang.org/x/crypto/acme/acme.go +++ b/vendor/golang.org/x/crypto/acme/acme.go @@ -400,7 +400,7 @@ func (c *Client) RevokeAuthorization(ctx context.Context, url string) error { // WaitAuthorization polls an authorization at the given URL // until it is in one of the final states, StatusValid or StatusInvalid, -// or the context is done. +// the ACME CA responded with a 4xx error code, or the context is done. // // It returns a non-nil Authorization only if its Status is StatusValid. // In all other cases WaitAuthorization returns an error. @@ -412,6 +412,13 @@ func (c *Client) WaitAuthorization(ctx context.Context, url string) (*Authorizat if err != nil { return nil, err } + if res.StatusCode >= 400 && res.StatusCode <= 499 { + // Non-retriable error. For instance, Let's Encrypt may return 404 Not Found + // when requesting an expired authorization. + defer res.Body.Close() + return nil, responseError(res) + } + retry := res.Header.Get("Retry-After") if res.StatusCode != http.StatusOK && res.StatusCode != http.StatusAccepted { res.Body.Close() diff --git a/vendor/golang.org/x/crypto/acme/acme_test.go b/vendor/golang.org/x/crypto/acme/acme_test.go index 89f2efa..63cb79b 100644 --- a/vendor/golang.org/x/crypto/acme/acme_test.go +++ b/vendor/golang.org/x/crypto/acme/acme_test.go @@ -549,6 +549,34 @@ func TestWaitAuthorizationInvalid(t *testing.T) { } } +func TestWaitAuthorizationClientError(t *testing.T) { + const code = http.StatusBadRequest + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(code) + })) + defer ts.Close() + + ch := make(chan error, 1) + go func() { + var client Client + _, err := client.WaitAuthorization(context.Background(), ts.URL) + ch <- err + }() + + select { + case <-time.After(3 * time.Second): + t.Fatal("WaitAuthz took too long to return") + case err := <-ch: + res, ok := err.(*Error) + if !ok { + t.Fatalf("err is %v (%T); want a non-nil *Error", err, err) + } + if res.StatusCode != code { + t.Errorf("res.StatusCode = %d; want %d", res.StatusCode, code) + } + } +} + func TestWaitAuthorizationCancel(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Retry-After", "60") diff --git a/vendor/golang.org/x/crypto/acme/autocert/autocert.go b/vendor/golang.org/x/crypto/acme/autocert/autocert.go index 453e722..263b291 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/autocert.go +++ b/vendor/golang.org/x/crypto/acme/autocert/autocert.go @@ -27,7 +27,6 @@ import ( "net" "net/http" "path" - "strconv" "strings" "sync" "time" @@ -942,16 +941,6 @@ func validCert(domain string, der [][]byte, key crypto.Signer) (leaf *x509.Certi return leaf, nil } -func retryAfter(v string) time.Duration { - if i, err := strconv.Atoi(v); err == nil { - return time.Duration(i) * time.Second - } - if t, err := http.ParseTime(v); err == nil { - return t.Sub(timeNow()) - } - return time.Second -} - type lockedMathRand struct { sync.Mutex rnd *mathrand.Rand diff --git a/vendor/golang.org/x/crypto/acme/autocert/renewal.go b/vendor/golang.org/x/crypto/acme/autocert/renewal.go index 6c5da2b..3fa4d61 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/renewal.go +++ b/vendor/golang.org/x/crypto/acme/autocert/renewal.go @@ -71,12 +71,21 @@ func (dr *domainRenewal) renew() { testDidRenewLoop(next, err) } +// updateState locks and replaces the relevant Manager.state item with the given +// state. It additionally updates dr.key with the given state's key. +func (dr *domainRenewal) updateState(state *certState) { + dr.m.stateMu.Lock() + defer dr.m.stateMu.Unlock() + dr.key = state.key + dr.m.state[dr.domain] = state +} + // do is similar to Manager.createCert but it doesn't lock a Manager.state item. // Instead, it requests a new certificate independently and, upon success, // replaces dr.m.state item with a new one and updates cache for the given domain. // -// It may return immediately if the expiration date of the currently cached cert -// is far enough in the future. +// It may lock and update the Manager.state if the expiration date of the currently +// cached cert is far enough in the future. // // The returned value is a time interval after which the renewal should occur again. func (dr *domainRenewal) do(ctx context.Context) (time.Duration, error) { @@ -85,7 +94,16 @@ func (dr *domainRenewal) do(ctx context.Context) (time.Duration, error) { if tlscert, err := dr.m.cacheGet(ctx, dr.domain); err == nil { next := dr.next(tlscert.Leaf.NotAfter) if next > dr.m.renewBefore()+renewJitter { - return next, nil + signer, ok := tlscert.PrivateKey.(crypto.Signer) + if ok { + state := &certState{ + key: signer, + cert: tlscert.Certificate, + leaf: tlscert.Leaf, + } + dr.updateState(state) + return next, nil + } } } @@ -102,11 +120,10 @@ func (dr *domainRenewal) do(ctx context.Context) (time.Duration, error) { if err != nil { return 0, err } - dr.m.cachePut(ctx, dr.domain, tlscert) - dr.m.stateMu.Lock() - defer dr.m.stateMu.Unlock() - // m.state is guaranteed to be non-nil at this point - dr.m.state[dr.domain] = state + if err := dr.m.cachePut(ctx, dr.domain, tlscert); err != nil { + return 0, err + } + dr.updateState(state) return dr.next(leaf.NotAfter), nil } diff --git a/vendor/golang.org/x/crypto/acme/autocert/renewal_test.go b/vendor/golang.org/x/crypto/acme/autocert/renewal_test.go index 11d40ff..6e88672 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/renewal_test.go +++ b/vendor/golang.org/x/crypto/acme/autocert/renewal_test.go @@ -189,3 +189,149 @@ func TestRenewFromCache(t *testing.T) { case <-done: } } + +func TestRenewFromCacheAlreadyRenewed(t *testing.T) { + const domain = "example.org" + + // use EC key to run faster on 386 + key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatal(err) + } + man := &Manager{ + Prompt: AcceptTOS, + Cache: newMemCache(), + RenewBefore: 24 * time.Hour, + Client: &acme.Client{ + Key: key, + DirectoryURL: "invalid", + }, + } + defer man.stopRenew() + + // cache a recently renewed cert with a different private key + newKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatal(err) + } + now := time.Now() + newCert, err := dateDummyCert(newKey.Public(), now.Add(-2*time.Hour), now.Add(time.Hour*24*90), domain) + if err != nil { + t.Fatal(err) + } + newLeaf, err := validCert(domain, [][]byte{newCert}, newKey) + if err != nil { + t.Fatal(err) + } + newTLSCert := &tls.Certificate{PrivateKey: newKey, Certificate: [][]byte{newCert}, Leaf: newLeaf} + if err := man.cachePut(context.Background(), domain, newTLSCert); err != nil { + t.Fatal(err) + } + + // set internal state to an almost expired cert + oldCert, err := dateDummyCert(key.Public(), now.Add(-2*time.Hour), now.Add(time.Minute), domain) + if err != nil { + t.Fatal(err) + } + oldLeaf, err := validCert(domain, [][]byte{oldCert}, key) + if err != nil { + t.Fatal(err) + } + man.stateMu.Lock() + if man.state == nil { + man.state = make(map[string]*certState) + } + s := &certState{ + key: key, + cert: [][]byte{oldCert}, + leaf: oldLeaf, + } + man.state[domain] = s + man.stateMu.Unlock() + + // veriy the renewal accepted the newer cached cert + defer func() { + testDidRenewLoop = func(next time.Duration, err error) {} + }() + done := make(chan struct{}) + testDidRenewLoop = func(next time.Duration, err error) { + defer close(done) + if err != nil { + t.Errorf("testDidRenewLoop: %v", err) + } + // Next should be about 90 days + // Previous expiration was within 1 min. + future := 88 * 24 * time.Hour + if next < future { + t.Errorf("testDidRenewLoop: next = %v; want >= %v", next, future) + } + + // ensure the cached cert was not modified + tlscert, err := man.cacheGet(context.Background(), domain) + if err != nil { + t.Fatalf("man.cacheGet: %v", err) + } + if !tlscert.Leaf.NotAfter.Equal(newLeaf.NotAfter) { + t.Errorf("cache leaf.NotAfter = %v; want == %v", tlscert.Leaf.NotAfter, newLeaf.NotAfter) + } + + // verify the old cert is also replaced in memory + man.stateMu.Lock() + defer man.stateMu.Unlock() + s := man.state[domain] + if s == nil { + t.Fatalf("m.state[%q] is nil", domain) + } + stateKey := s.key.Public().(*ecdsa.PublicKey) + if stateKey.X.Cmp(newKey.X) != 0 || stateKey.Y.Cmp(newKey.Y) != 0 { + t.Fatalf("state key was not updated from cache x: %v y: %v; want x: %v y: %v", stateKey.X, stateKey.Y, newKey.X, newKey.Y) + } + tlscert, err = s.tlscert() + if err != nil { + t.Fatalf("s.tlscert: %v", err) + } + if !tlscert.Leaf.NotAfter.Equal(newLeaf.NotAfter) { + t.Errorf("state leaf.NotAfter = %v; want == %v", tlscert.Leaf.NotAfter, newLeaf.NotAfter) + } + + // verify the private key is replaced in the renewal state + r := man.renewal[domain] + if r == nil { + t.Fatalf("m.renewal[%q] is nil", domain) + } + renewalKey := r.key.Public().(*ecdsa.PublicKey) + if renewalKey.X.Cmp(newKey.X) != 0 || renewalKey.Y.Cmp(newKey.Y) != 0 { + t.Fatalf("renewal private key was not updated from cache x: %v y: %v; want x: %v y: %v", renewalKey.X, renewalKey.Y, newKey.X, newKey.Y) + } + + } + + // assert the expiring cert is returned from state + hello := &tls.ClientHelloInfo{ServerName: domain} + tlscert, err := man.GetCertificate(hello) + if err != nil { + t.Fatal(err) + } + if !oldLeaf.NotAfter.Equal(tlscert.Leaf.NotAfter) { + t.Errorf("state leaf.NotAfter = %v; want == %v", tlscert.Leaf.NotAfter, oldLeaf.NotAfter) + } + + // trigger renew + go man.renew(domain, s.key, s.leaf.NotAfter) + + // wait for renew loop + select { + case <-time.After(10 * time.Second): + t.Fatal("renew took too long to occur") + case <-done: + // assert the new cert is returned from state after renew + hello := &tls.ClientHelloInfo{ServerName: domain} + tlscert, err := man.GetCertificate(hello) + if err != nil { + t.Fatal(err) + } + if !newTLSCert.Leaf.NotAfter.Equal(tlscert.Leaf.NotAfter) { + t.Errorf("state leaf.NotAfter = %v; want == %v", tlscert.Leaf.NotAfter, newTLSCert.Leaf.NotAfter) + } + } +} diff --git a/vendor/golang.org/x/crypto/argon2/argon2.go b/vendor/golang.org/x/crypto/argon2/argon2.go index 71cf8c5..b423fea 100644 --- a/vendor/golang.org/x/crypto/argon2/argon2.go +++ b/vendor/golang.org/x/crypto/argon2/argon2.go @@ -5,7 +5,35 @@ // Package argon2 implements the key derivation function Argon2. // Argon2 was selected as the winner of the Password Hashing Competition and can // be used to derive cryptographic keys from passwords. -// Argon2 is specfifed at https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf +// +// For a detailed specification of Argon2 see [1]. +// +// If you aren't sure which function you need, use Argon2id (IDKey) and +// the parameter recommendations for your scenario. +// +// +// Argon2i +// +// Argon2i (implemented by Key) is the side-channel resistant version of Argon2. +// It uses data-independent memory access, which is preferred for password +// hashing and password-based key derivation. Argon2i requires more passes over +// memory than Argon2id to protect from trade-off attacks. The recommended +// parameters (taken from [2]) for non-interactive operations are time=3 and to +// use the maximum available memory. +// +// +// Argon2id +// +// Argon2id (implemented by IDKey) is a hybrid version of Argon2 combining +// Argon2i and Argon2d. It uses data-independent memory access for the first +// half of the first iteration over the memory and data-dependent memory access +// for the rest. Argon2id is side-channel resistant and provides better brute- +// force cost savings due to time-memory tradeoffs than Argon2i. The recommended +// parameters for non-interactive operations (taken from [2]) are time=1 and to +// use the maximum available memory. +// +// [1] https://github.com/P-H-C/phc-winner-argon2/blob/master/argon2-specs.pdf +// [2] https://tools.ietf.org/html/draft-irtf-cfrg-argon2-03#section-9.3 package argon2 import ( @@ -25,23 +53,52 @@ const ( ) // Key derives a key from the password, salt, and cost parameters using Argon2i -// returning a byte slice of length keyLen that can be used as cryptographic key. -// The CPU cost and parallism degree must be greater than zero. +// returning a byte slice of length keyLen that can be used as cryptographic +// key. The CPU cost and parallelism degree must be greater than zero. // -// For example, you can get a derived key for e.g. AES-256 (which needs a 32-byte key) by doing: -// `key := argon2.Key([]byte("some password"), salt, 4, 32*1024, 4, 32)` +// For example, you can get a derived key for e.g. AES-256 (which needs a +// 32-byte key) by doing: // -// The recommended parameters for interactive logins as of 2017 are time=4, memory=32*1024. -// The number of threads can be adjusted to the numbers of available CPUs. -// The time parameter specifies the number of passes over the memory and the memory -// parameter specifies the size of the memory in KiB. For example memory=32*1024 sets the -// memory cost to ~32 MB. -// The cost parameters should be increased as memory latency and CPU parallelism increases. -// Remember to get a good random salt. +// key := argon2.Key([]byte("some password"), salt, 3, 32*1024, 4, 32) +// +// The draft RFC recommends[2] time=3, and memory=32*1024 is a sensible number. +// If using that amount of memory (32 MB) is not possible in some contexts then +// the time parameter can be increased to compensate. +// +// The time parameter specifies the number of passes over the memory and the +// memory parameter specifies the size of the memory in KiB. For example +// memory=32*1024 sets the memory cost to ~32 MB. The number of threads can be +// adjusted to the number of available CPUs. The cost parameters should be +// increased as memory latency and CPU parallelism increases. Remember to get a +// good random salt. func Key(password, salt []byte, time, memory uint32, threads uint8, keyLen uint32) []byte { return deriveKey(argon2i, password, salt, nil, nil, time, memory, threads, keyLen) } +// IDKey derives a key from the password, salt, and cost parameters using +// Argon2id returning a byte slice of length keyLen that can be used as +// cryptographic key. The CPU cost and parallelism degree must be greater than +// zero. +// +// For example, you can get a derived key for e.g. AES-256 (which needs a +// 32-byte key) by doing: +// +// key := argon2.IDKey([]byte("some password"), salt, 1, 64*1024, 4, 32) +// +// The draft RFC recommends[2] time=1, and memory=64*1024 is a sensible number. +// If using that amount of memory (64 MB) is not possible in some contexts then +// the time parameter can be increased to compensate. +// +// The time parameter specifies the number of passes over the memory and the +// memory parameter specifies the size of the memory in KiB. For example +// memory=64*1024 sets the memory cost to ~64 MB. The number of threads can be +// adjusted to the numbers of available CPUs. The cost parameters should be +// increased as memory latency and CPU parallelism increases. Remember to get a +// good random salt. +func IDKey(password, salt []byte, time, memory uint32, threads uint8, keyLen uint32) []byte { + return deriveKey(argon2id, password, salt, nil, nil, time, memory, threads, keyLen) +} + func deriveKey(mode int, password, salt, secret, data []byte, time, memory uint32, threads uint8, keyLen uint32) []byte { if time < 1 { panic("argon2: number of rounds too small") diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b.go b/vendor/golang.org/x/crypto/blake2b/blake2b.go index 6dedb89..58ea875 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b.go @@ -92,6 +92,8 @@ func New256(key []byte) (hash.Hash, error) { return newDigest(Size256, key) } // values equal or greater than: // - 32 if BLAKE2b is used as a hash function (The key is zero bytes long). // - 16 if BLAKE2b is used as a MAC function (The key is at least 16 bytes long). +// When the key is nil, the returned hash.Hash implements BinaryMarshaler +// and BinaryUnmarshaler for state (de)serialization as documented by hash.Hash. func New(size int, key []byte) (hash.Hash, error) { return newDigest(size, key) } func newDigest(hashSize int, key []byte) (*digest, error) { @@ -150,6 +152,50 @@ type digest struct { keyLen int } +const ( + magic = "b2b" + marshaledSize = len(magic) + 8*8 + 2*8 + 1 + BlockSize + 1 +) + +func (d *digest) MarshalBinary() ([]byte, error) { + if d.keyLen != 0 { + return nil, errors.New("crypto/blake2b: cannot marshal MACs") + } + b := make([]byte, 0, marshaledSize) + b = append(b, magic...) + for i := 0; i < 8; i++ { + b = appendUint64(b, d.h[i]) + } + b = appendUint64(b, d.c[0]) + b = appendUint64(b, d.c[1]) + // Maximum value for size is 64 + b = append(b, byte(d.size)) + b = append(b, d.block[:]...) + b = append(b, byte(d.offset)) + return b, nil +} + +func (d *digest) UnmarshalBinary(b []byte) error { + if len(b) < len(magic) || string(b[:len(magic)]) != magic { + return errors.New("crypto/blake2b: invalid hash state identifier") + } + if len(b) != marshaledSize { + return errors.New("crypto/blake2b: invalid hash state size") + } + b = b[len(magic):] + for i := 0; i < 8; i++ { + b, d.h[i] = consumeUint64(b) + } + b, d.c[0] = consumeUint64(b) + b, d.c[1] = consumeUint64(b) + d.size = int(b[0]) + b = b[1:] + copy(d.block[:], b[:BlockSize]) + b = b[BlockSize:] + d.offset = int(b[0]) + return nil +} + func (d *digest) BlockSize() int { return BlockSize } func (d *digest) Size() int { return d.size } @@ -219,3 +265,25 @@ func (d *digest) finalize(hash *[Size]byte) { binary.LittleEndian.PutUint64(hash[8*i:], v) } } + +func appendUint64(b []byte, x uint64) []byte { + var a [8]byte + binary.BigEndian.PutUint64(a[:], x) + return append(b, a[:]...) +} + +func appendUint32(b []byte, x uint32) []byte { + var a [4]byte + binary.BigEndian.PutUint32(a[:], x) + return append(b, a[:]...) +} + +func consumeUint64(b []byte) ([]byte, uint64) { + x := binary.BigEndian.Uint64(b) + return b[8:], x +} + +func consumeUint32(b []byte) ([]byte, uint32) { + x := binary.BigEndian.Uint32(b) + return b[4:], x +} diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go index 8c41cf6..a1e08d7 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go @@ -6,21 +6,23 @@ package blake2b +import _ "unsafe" + +//go:linkname x86_HasAVX internal/cpu.X86.HasAVX +var x86_HasAVX bool + +//go:linkname x86_HasAVX2 internal/cpu.X86.HasAVX2 +var x86_HasAVX2 bool + +//go:linkname x86_HasAVX internal/cpu.X86.HasSSE4 +var x86_HasSSE4 bool + func init() { - useAVX2 = supportsAVX2() - useAVX = supportsAVX() - useSSE4 = supportsSSE4() + useAVX2 = x86_HasAVX2 + useAVX = x86_HasAVX + useSSE4 = x86_HasSSE4 } -//go:noescape -func supportsSSE4() bool - -//go:noescape -func supportsAVX() bool - -//go:noescape -func supportsAVX2() bool - //go:noescape func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s index 784bce6..5593b1b 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s @@ -748,15 +748,3 @@ noinc: MOVQ BP, SP RET - -// func supportsAVX2() bool -TEXT ·supportsAVX2(SB), 4, $0-1 - MOVQ runtime·support_avx2(SB), AX - MOVB AX, ret+0(FP) - RET - -// func supportsAVX() bool -TEXT ·supportsAVX(SB), 4, $0-1 - MOVQ runtime·support_avx(SB), AX - MOVB AX, ret+0(FP) - RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_test.go b/vendor/golang.org/x/crypto/blake2b/blake2b_test.go index 5d68bbf..723327a 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_test.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2b_test.go @@ -6,6 +6,7 @@ package blake2b import ( "bytes" + "encoding" "encoding/hex" "fmt" "hash" @@ -69,6 +70,54 @@ func TestHashes2X(t *testing.T) { testHashes2X(t) } +func TestMarshal(t *testing.T) { + input := make([]byte, 255) + for i := range input { + input[i] = byte(i) + } + for _, size := range []int{Size, Size256, Size384, 12, 25, 63} { + for i := 0; i < 256; i++ { + h, err := New(size, nil) + if err != nil { + t.Fatalf("size=%d, len(input)=%d: error from New(%v, nil): %v", size, i, size, err) + } + h2, err := New(size, nil) + if err != nil { + t.Fatalf("size=%d, len(input)=%d: error from New(%v, nil): %v", size, i, size, err) + } + + h.Write(input[:i/2]) + halfstate, err := h.(encoding.BinaryMarshaler).MarshalBinary() + if err != nil { + t.Fatalf("size=%d, len(input)=%d: could not marshal: %v", size, i, err) + } + err = h2.(encoding.BinaryUnmarshaler).UnmarshalBinary(halfstate) + if err != nil { + t.Fatalf("size=%d, len(input)=%d: could not unmarshal: %v", size, i, err) + } + + h.Write(input[i/2 : i]) + sum := h.Sum(nil) + h2.Write(input[i/2 : i]) + sum2 := h2.Sum(nil) + + if !bytes.Equal(sum, sum2) { + t.Fatalf("size=%d, len(input)=%d: results do not match; sum = %v, sum2 = %v", size, i, sum, sum2) + } + + h3, err := New(size, nil) + if err != nil { + t.Fatalf("size=%d, len(input)=%d: error from New(%v, nil): %v", size, i, size, err) + } + h3.Write(input[:i]) + sum3 := h3.Sum(nil) + if !bytes.Equal(sum, sum3) { + t.Fatalf("size=%d, len(input)=%d: sum = %v, want %v", size, i, sum, sum3) + } + } + } +} + func testHashes(t *testing.T) { key, _ := hex.DecodeString("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f") diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s.go b/vendor/golang.org/x/crypto/blake2s/blake2s.go index ae0dc92..5fb4a9e 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s.go @@ -49,6 +49,8 @@ func Sum256(data []byte) [Size]byte { // New256 returns a new hash.Hash computing the BLAKE2s-256 checksum. A non-nil // key turns the hash into a MAC. The key must between zero and 32 bytes long. +// When the key is nil, the returned hash.Hash implements BinaryMarshaler +// and BinaryUnmarshaler for state (de)serialization as documented by hash.Hash. func New256(key []byte) (hash.Hash, error) { return newDigest(Size, key) } // New128 returns a new hash.Hash computing the BLAKE2s-128 checksum given a @@ -120,6 +122,50 @@ type digest struct { keyLen int } +const ( + magic = "b2s" + marshaledSize = len(magic) + 8*4 + 2*4 + 1 + BlockSize + 1 +) + +func (d *digest) MarshalBinary() ([]byte, error) { + if d.keyLen != 0 { + return nil, errors.New("crypto/blake2s: cannot marshal MACs") + } + b := make([]byte, 0, marshaledSize) + b = append(b, magic...) + for i := 0; i < 8; i++ { + b = appendUint32(b, d.h[i]) + } + b = appendUint32(b, d.c[0]) + b = appendUint32(b, d.c[1]) + // Maximum value for size is 32 + b = append(b, byte(d.size)) + b = append(b, d.block[:]...) + b = append(b, byte(d.offset)) + return b, nil +} + +func (d *digest) UnmarshalBinary(b []byte) error { + if len(b) < len(magic) || string(b[:len(magic)]) != magic { + return errors.New("crypto/blake2s: invalid hash state identifier") + } + if len(b) != marshaledSize { + return errors.New("crypto/blake2s: invalid hash state size") + } + b = b[len(magic):] + for i := 0; i < 8; i++ { + b, d.h[i] = consumeUint32(b) + } + b, d.c[0] = consumeUint32(b) + b, d.c[1] = consumeUint32(b) + d.size = int(b[0]) + b = b[1:] + copy(d.block[:], b[:BlockSize]) + b = b[BlockSize:] + d.offset = int(b[0]) + return nil +} + func (d *digest) BlockSize() int { return BlockSize } func (d *digest) Size() int { return d.size } @@ -185,3 +231,14 @@ func (d *digest) finalize(hash *[Size]byte) { binary.LittleEndian.PutUint32(hash[4*i:], v) } } + +func appendUint32(b []byte, x uint32) []byte { + var a [4]byte + binary.BigEndian.PutUint32(a[:], x) + return append(b, a[:]...) +} + +func consumeUint32(b []byte) ([]byte, uint32) { + x := binary.BigEndian.Uint32(b) + return b[4:], x +} diff --git a/vendor/golang.org/x/crypto/blake2s/blake2s_test.go b/vendor/golang.org/x/crypto/blake2s/blake2s_test.go index cfeb18b..cde79fb 100644 --- a/vendor/golang.org/x/crypto/blake2s/blake2s_test.go +++ b/vendor/golang.org/x/crypto/blake2s/blake2s_test.go @@ -5,6 +5,8 @@ package blake2s import ( + "bytes" + "encoding" "encoding/hex" "fmt" "testing" @@ -64,6 +66,52 @@ func TestHashes2X(t *testing.T) { testHashes2X(t) } +func TestMarshal(t *testing.T) { + input := make([]byte, 255) + for i := range input { + input[i] = byte(i) + } + for i := 0; i < 256; i++ { + h, err := New256(nil) + if err != nil { + t.Fatalf("len(input)=%d: error from New256(nil): %v", i, err) + } + h2, err := New256(nil) + if err != nil { + t.Fatalf("len(input)=%d: error from New256(nil): %v", i, err) + } + + h.Write(input[:i/2]) + halfstate, err := h.(encoding.BinaryMarshaler).MarshalBinary() + if err != nil { + t.Fatalf("len(input)=%d: could not marshal: %v", i, err) + } + err = h2.(encoding.BinaryUnmarshaler).UnmarshalBinary(halfstate) + if err != nil { + t.Fatalf("len(input)=%d: could not unmarshal: %v", i, err) + } + + h.Write(input[i/2 : i]) + sum := h.Sum(nil) + h2.Write(input[i/2 : i]) + sum2 := h2.Sum(nil) + + if !bytes.Equal(sum, sum2) { + t.Fatalf("len(input)=%d: results do not match; sum = %v, sum2 = %v", i, sum, sum2) + } + + h3, err := New256(nil) + if err != nil { + t.Fatalf("len(input)=%d: error from New256(nil): %v", i, err) + } + h3.Write(input[:i]) + sum3 := h3.Sum(nil) + if !bytes.Equal(sum, sum3) { + t.Fatalf("len(input)=%d: sum = %v, want %v", i, sum, sum3) + } + } +} + func testHashes(t *testing.T) { key, _ := hex.DecodeString("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f") diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1.go b/vendor/golang.org/x/crypto/cryptobyte/asn1.go index 88ec8b4..528b9bf 100644 --- a/vendor/golang.org/x/crypto/cryptobyte/asn1.go +++ b/vendor/golang.org/x/crypto/cryptobyte/asn1.go @@ -23,6 +23,12 @@ func (b *Builder) AddASN1Int64(v int64) { b.addASN1Signed(asn1.INTEGER, v) } +// AddASN1Int64WithTag appends a DER-encoded ASN.1 INTEGER with the +// given tag. +func (b *Builder) AddASN1Int64WithTag(v int64, tag asn1.Tag) { + b.addASN1Signed(tag, v) +} + // AddASN1Enum appends a DER-encoded ASN.1 ENUMERATION. func (b *Builder) AddASN1Enum(v int64) { b.addASN1Signed(asn1.ENUM, v) @@ -224,6 +230,9 @@ func (b *Builder) AddASN1(tag asn1.Tag, f BuilderContinuation) { // String +// ReadASN1Boolean decodes an ASN.1 INTEGER and converts it to a boolean +// representation into out and advances. It reports whether the read +// was successful. func (s *String) ReadASN1Boolean(out *bool) bool { var bytes String if !s.ReadASN1(&bytes, asn1.INTEGER) || len(bytes) != 1 { @@ -245,8 +254,8 @@ func (s *String) ReadASN1Boolean(out *bool) bool { var bigIntType = reflect.TypeOf((*big.Int)(nil)).Elem() // ReadASN1Integer decodes an ASN.1 INTEGER into out and advances. If out does -// not point to an integer or to a big.Int, it panics. It returns true on -// success and false on error. +// not point to an integer or to a big.Int, it panics. It reports whether the +// read was successful. func (s *String) ReadASN1Integer(out interface{}) bool { if reflect.TypeOf(out).Kind() != reflect.Ptr { panic("out is not a pointer") @@ -359,8 +368,16 @@ func asn1Unsigned(out *uint64, n []byte) bool { return true } -// ReadASN1Enum decodes an ASN.1 ENUMERATION into out and advances. It returns -// true on success and false on error. +// ReadASN1Int64WithTag decodes an ASN.1 INTEGER with the given tag into out +// and advances. It reports whether the read was successful and resulted in a +// value that can be represented in an int64. +func (s *String) ReadASN1Int64WithTag(out *int64, tag asn1.Tag) bool { + var bytes String + return s.ReadASN1(&bytes, tag) && checkASN1Integer(bytes) && asn1Signed(out, bytes) +} + +// ReadASN1Enum decodes an ASN.1 ENUMERATION into out and advances. It reports +// whether the read was successful. func (s *String) ReadASN1Enum(out *int) bool { var bytes String var i int64 @@ -392,7 +409,7 @@ func (s *String) readBase128Int(out *int) bool { } // ReadASN1ObjectIdentifier decodes an ASN.1 OBJECT IDENTIFIER into out and -// advances. It returns true on success and false on error. +// advances. It reports whether the read was successful. func (s *String) ReadASN1ObjectIdentifier(out *encoding_asn1.ObjectIdentifier) bool { var bytes String if !s.ReadASN1(&bytes, asn1.OBJECT_IDENTIFIER) || len(bytes) == 0 { @@ -431,7 +448,7 @@ func (s *String) ReadASN1ObjectIdentifier(out *encoding_asn1.ObjectIdentifier) b } // ReadASN1GeneralizedTime decodes an ASN.1 GENERALIZEDTIME into out and -// advances. It returns true on success and false on error. +// advances. It reports whether the read was successful. func (s *String) ReadASN1GeneralizedTime(out *time.Time) bool { var bytes String if !s.ReadASN1(&bytes, asn1.GeneralizedTime) { @@ -449,8 +466,8 @@ func (s *String) ReadASN1GeneralizedTime(out *time.Time) bool { return true } -// ReadASN1BitString decodes an ASN.1 BIT STRING into out and advances. It -// returns true on success and false on error. +// ReadASN1BitString decodes an ASN.1 BIT STRING into out and advances. +// It reports whether the read was successful. func (s *String) ReadASN1BitString(out *encoding_asn1.BitString) bool { var bytes String if !s.ReadASN1(&bytes, asn1.BIT_STRING) || len(bytes) == 0 { @@ -471,8 +488,8 @@ func (s *String) ReadASN1BitString(out *encoding_asn1.BitString) bool { } // ReadASN1BitString decodes an ASN.1 BIT STRING into out and advances. It is -// an error if the BIT STRING is not a whole number of bytes. This function -// returns true on success and false on error. +// an error if the BIT STRING is not a whole number of bytes. It reports +// whether the read was successful. func (s *String) ReadASN1BitStringAsBytes(out *[]byte) bool { var bytes String if !s.ReadASN1(&bytes, asn1.BIT_STRING) || len(bytes) == 0 { @@ -489,14 +506,14 @@ func (s *String) ReadASN1BitStringAsBytes(out *[]byte) bool { // ReadASN1Bytes reads the contents of a DER-encoded ASN.1 element (not including // tag and length bytes) into out, and advances. The element must match the -// given tag. It returns true on success and false on error. +// given tag. It reports whether the read was successful. func (s *String) ReadASN1Bytes(out *[]byte, tag asn1.Tag) bool { return s.ReadASN1((*String)(out), tag) } // ReadASN1 reads the contents of a DER-encoded ASN.1 element (not including // tag and length bytes) into out, and advances. The element must match the -// given tag. It returns true on success and false on error. +// given tag. It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadASN1(out *String, tag asn1.Tag) bool { @@ -509,7 +526,7 @@ func (s *String) ReadASN1(out *String, tag asn1.Tag) bool { // ReadASN1Element reads the contents of a DER-encoded ASN.1 element (including // tag and length bytes) into out, and advances. The element must match the -// given tag. It returns true on success and false on error. +// given tag. It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadASN1Element(out *String, tag asn1.Tag) bool { @@ -521,8 +538,8 @@ func (s *String) ReadASN1Element(out *String, tag asn1.Tag) bool { } // ReadAnyASN1 reads the contents of a DER-encoded ASN.1 element (not including -// tag and length bytes) into out, sets outTag to its tag, and advances. It -// returns true on success and false on error. +// tag and length bytes) into out, sets outTag to its tag, and advances. +// It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadAnyASN1(out *String, outTag *asn1.Tag) bool { @@ -531,14 +548,14 @@ func (s *String) ReadAnyASN1(out *String, outTag *asn1.Tag) bool { // ReadAnyASN1Element reads the contents of a DER-encoded ASN.1 element // (including tag and length bytes) into out, sets outTag to is tag, and -// advances. It returns true on success and false on error. +// advances. It reports whether the read was successful. // // Tags greater than 30 are not supported (i.e. low-tag-number format only). func (s *String) ReadAnyASN1Element(out *String, outTag *asn1.Tag) bool { return s.readASN1(out, outTag, false /* include header */) } -// PeekASN1Tag returns true if the next ASN.1 value on the string starts with +// PeekASN1Tag reports whether the next ASN.1 value on the string starts with // the given tag. func (s String) PeekASN1Tag(tag asn1.Tag) bool { if len(s) == 0 { @@ -547,7 +564,8 @@ func (s String) PeekASN1Tag(tag asn1.Tag) bool { return asn1.Tag(s[0]) == tag } -// SkipASN1 reads and discards an ASN.1 element with the given tag. +// SkipASN1 reads and discards an ASN.1 element with the given tag. It +// reports whether the operation was successful. func (s *String) SkipASN1(tag asn1.Tag) bool { var unused String return s.ReadASN1(&unused, tag) @@ -556,7 +574,7 @@ func (s *String) SkipASN1(tag asn1.Tag) bool { // ReadOptionalASN1 attempts to read the contents of a DER-encoded ASN.1 // element (not including tag and length bytes) tagged with the given tag into // out. It stores whether an element with the tag was found in outPresent, -// unless outPresent is nil. It returns true on success and false on error. +// unless outPresent is nil. It reports whether the read was successful. func (s *String) ReadOptionalASN1(out *String, outPresent *bool, tag asn1.Tag) bool { present := s.PeekASN1Tag(tag) if outPresent != nil { @@ -569,7 +587,7 @@ func (s *String) ReadOptionalASN1(out *String, outPresent *bool, tag asn1.Tag) b } // SkipOptionalASN1 advances s over an ASN.1 element with the given tag, or -// else leaves s unchanged. +// else leaves s unchanged. It reports whether the operation was successful. func (s *String) SkipOptionalASN1(tag asn1.Tag) bool { if !s.PeekASN1Tag(tag) { return true @@ -581,8 +599,8 @@ func (s *String) SkipOptionalASN1(tag asn1.Tag) bool { // ReadOptionalASN1Integer attempts to read an optional ASN.1 INTEGER // explicitly tagged with tag into out and advances. If no element with a // matching tag is present, it writes defaultValue into out instead. If out -// does not point to an integer or to a big.Int, it panics. It returns true on -// success and false on error. +// does not point to an integer or to a big.Int, it panics. It reports +// whether the read was successful. func (s *String) ReadOptionalASN1Integer(out interface{}, tag asn1.Tag, defaultValue interface{}) bool { if reflect.TypeOf(out).Kind() != reflect.Ptr { panic("out is not a pointer") @@ -619,8 +637,8 @@ func (s *String) ReadOptionalASN1Integer(out interface{}, tag asn1.Tag, defaultV // ReadOptionalASN1OctetString attempts to read an optional ASN.1 OCTET STRING // explicitly tagged with tag into out and advances. If no element with a -// matching tag is present, it writes defaultValue into out instead. It returns -// true on success and false on error. +// matching tag is present, it sets "out" to nil instead. It reports +// whether the read was successful. func (s *String) ReadOptionalASN1OctetString(out *[]byte, outPresent *bool, tag asn1.Tag) bool { var present bool var child String @@ -644,6 +662,7 @@ func (s *String) ReadOptionalASN1OctetString(out *[]byte, outPresent *bool, tag // ReadOptionalASN1Boolean sets *out to the value of the next ASN.1 BOOLEAN or, // if the next bytes are not an ASN.1 BOOLEAN, to the value of defaultValue. +// It reports whether the operation was successful. func (s *String) ReadOptionalASN1Boolean(out *bool, defaultValue bool) bool { var present bool var child String diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go b/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go index ee6674a..9f6c952 100644 --- a/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go +++ b/vendor/golang.org/x/crypto/cryptobyte/asn1_test.go @@ -149,6 +149,39 @@ func TestReadASN1IntegerSigned(t *testing.T) { } } }) + + // Repeat with the implicit-tagging functions + t.Run("WithTag", func(t *testing.T) { + for i, test := range testData64 { + tag := asn1.Tag((i * 3) % 32).ContextSpecific() + + testData := make([]byte, len(test.in)) + copy(testData, test.in) + + // Alter the tag of the test case. + testData[0] = uint8(tag) + + in := String(testData) + var out int64 + ok := in.ReadASN1Int64WithTag(&out, tag) + if !ok || out != test.out { + t.Errorf("#%d: in.ReadASN1Int64WithTag() = %v, want true; out = %d, want %d", i, ok, out, test.out) + } + + var b Builder + b.AddASN1Int64WithTag(test.out, tag) + result, err := b.Bytes() + + if err != nil { + t.Errorf("#%d: AddASN1Int64WithTag failed: %s", i, err) + continue + } + + if !bytes.Equal(result, testData) { + t.Errorf("#%d: AddASN1Int64WithTag: got %x, want %x", i, result, testData) + } + } + }) } func TestReadASN1IntegerUnsigned(t *testing.T) { diff --git a/vendor/golang.org/x/crypto/cryptobyte/string.go b/vendor/golang.org/x/crypto/cryptobyte/string.go index 7636fb9..39bf98a 100644 --- a/vendor/golang.org/x/crypto/cryptobyte/string.go +++ b/vendor/golang.org/x/crypto/cryptobyte/string.go @@ -37,8 +37,8 @@ func (s *String) Skip(n int) bool { return s.read(n) != nil } -// ReadUint8 decodes an 8-bit value into out and advances over it. It -// returns true on success and false on error. +// ReadUint8 decodes an 8-bit value into out and advances over it. +// It reports whether the read was successful. func (s *String) ReadUint8(out *uint8) bool { v := s.read(1) if v == nil { @@ -49,7 +49,7 @@ func (s *String) ReadUint8(out *uint8) bool { } // ReadUint16 decodes a big-endian, 16-bit value into out and advances over it. -// It returns true on success and false on error. +// It reports whether the read was successful. func (s *String) ReadUint16(out *uint16) bool { v := s.read(2) if v == nil { @@ -60,7 +60,7 @@ func (s *String) ReadUint16(out *uint16) bool { } // ReadUint24 decodes a big-endian, 24-bit value into out and advances over it. -// It returns true on success and false on error. +// It reports whether the read was successful. func (s *String) ReadUint24(out *uint32) bool { v := s.read(3) if v == nil { @@ -71,7 +71,7 @@ func (s *String) ReadUint24(out *uint32) bool { } // ReadUint32 decodes a big-endian, 32-bit value into out and advances over it. -// It returns true on success and false on error. +// It reports whether the read was successful. func (s *String) ReadUint32(out *uint32) bool { v := s.read(4) if v == nil { @@ -119,28 +119,27 @@ func (s *String) readLengthPrefixed(lenLen int, outChild *String) bool { } // ReadUint8LengthPrefixed reads the content of an 8-bit length-prefixed value -// into out and advances over it. It returns true on success and false on -// error. +// into out and advances over it. It reports whether the read was successful. func (s *String) ReadUint8LengthPrefixed(out *String) bool { return s.readLengthPrefixed(1, out) } // ReadUint16LengthPrefixed reads the content of a big-endian, 16-bit -// length-prefixed value into out and advances over it. It returns true on -// success and false on error. +// length-prefixed value into out and advances over it. It reports whether the +// read was successful. func (s *String) ReadUint16LengthPrefixed(out *String) bool { return s.readLengthPrefixed(2, out) } // ReadUint24LengthPrefixed reads the content of a big-endian, 24-bit -// length-prefixed value into out and advances over it. It returns true on -// success and false on error. +// length-prefixed value into out and advances over it. It reports whether +// the read was successful. func (s *String) ReadUint24LengthPrefixed(out *String) bool { return s.readLengthPrefixed(3, out) } -// ReadBytes reads n bytes into out and advances over them. It returns true on -// success and false and error. +// ReadBytes reads n bytes into out and advances over them. It reports +// whether the read was successful. func (s *String) ReadBytes(out *[]byte, n int) bool { v := s.read(n) if v == nil { @@ -150,8 +149,8 @@ func (s *String) ReadBytes(out *[]byte, n int) bool { return true } -// CopyBytes copies len(out) bytes into out and advances over them. It returns -// true on success and false on error. +// CopyBytes copies len(out) bytes into out and advances over them. It reports +// whether the copy operation was successful func (s *String) CopyBytes(out []byte) bool { n := len(out) v := s.read(n) diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519.go b/vendor/golang.org/x/crypto/ed25519/ed25519.go index 4f26b49..a57771a 100644 --- a/vendor/golang.org/x/crypto/ed25519/ed25519.go +++ b/vendor/golang.org/x/crypto/ed25519/ed25519.go @@ -171,9 +171,16 @@ func Verify(publicKey PublicKey, message, sig []byte) bool { edwards25519.ScReduce(&hReduced, &digest) var R edwards25519.ProjectiveGroupElement - var b [32]byte - copy(b[:], sig[32:]) - edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &b) + var s [32]byte + copy(s[:], sig[32:]) + + // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in + // the range [0, order) in order to prevent signature malleability. + if !edwards25519.ScMinimal(&s) { + return false + } + + edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &s) var checkR [32]byte R.ToBytes(&checkR) diff --git a/vendor/golang.org/x/crypto/ed25519/ed25519_test.go b/vendor/golang.org/x/crypto/ed25519/ed25519_test.go index e272f8a..5f946e9 100644 --- a/vendor/golang.org/x/crypto/ed25519/ed25519_test.go +++ b/vendor/golang.org/x/crypto/ed25519/ed25519_test.go @@ -146,6 +146,30 @@ func TestGolden(t *testing.T) { } } +func TestMalleability(t *testing.T) { + // https://tools.ietf.org/html/rfc8032#section-5.1.7 adds an additional test + // that s be in [0, order). This prevents someone from adding a multiple of + // order to s and obtaining a second valid signature for the same message. + msg := []byte{0x54, 0x65, 0x73, 0x74} + sig := []byte{ + 0x7c, 0x38, 0xe0, 0x26, 0xf2, 0x9e, 0x14, 0xaa, 0xbd, 0x05, 0x9a, + 0x0f, 0x2d, 0xb8, 0xb0, 0xcd, 0x78, 0x30, 0x40, 0x60, 0x9a, 0x8b, + 0xe6, 0x84, 0xdb, 0x12, 0xf8, 0x2a, 0x27, 0x77, 0x4a, 0xb0, 0x67, + 0x65, 0x4b, 0xce, 0x38, 0x32, 0xc2, 0xd7, 0x6f, 0x8f, 0x6f, 0x5d, + 0xaf, 0xc0, 0x8d, 0x93, 0x39, 0xd4, 0xee, 0xf6, 0x76, 0x57, 0x33, + 0x36, 0xa5, 0xc5, 0x1e, 0xb6, 0xf9, 0x46, 0xb3, 0x1d, + } + publicKey := []byte{ + 0x7d, 0x4d, 0x0e, 0x7f, 0x61, 0x53, 0xa6, 0x9b, 0x62, 0x42, 0xb5, + 0x22, 0xab, 0xbe, 0xe6, 0x85, 0xfd, 0xa4, 0x42, 0x0f, 0x88, 0x34, + 0xb1, 0x08, 0xc3, 0xbd, 0xae, 0x36, 0x9e, 0xf5, 0x49, 0xfa, + } + + if Verify(publicKey, msg, sig) { + t.Fatal("non-canonical signature accepted") + } +} + func BenchmarkKeyGeneration(b *testing.B) { var zero zeroReader for i := 0; i < b.N; i++ { diff --git a/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go b/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go index 5f8b994..fd03c25 100644 --- a/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go +++ b/vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go @@ -4,6 +4,8 @@ package edwards25519 +import "encoding/binary" + // This code is a port of the public domain, “ref10†implementation of ed25519 // from SUPERCOP. @@ -1769,3 +1771,23 @@ func ScReduce(out *[32]byte, s *[64]byte) { out[30] = byte(s11 >> 9) out[31] = byte(s11 >> 17) } + +// order is the order of Curve25519 in little-endian form. +var order = [4]uint64{0x5812631a5cf5d3ed, 0x14def9dea2f79cd6, 0, 0x1000000000000000} + +// ScMinimal returns true if the given scalar is less than the order of the +// curve. +func ScMinimal(scalar *[32]byte) bool { + for i := 3; ; i-- { + v := binary.LittleEndian.Uint64(scalar[i*8:]) + if v > order[i] { + return false + } else if v < order[i] { + break + } else if i == 0 { + return false + } + } + + return true +} diff --git a/vendor/golang.org/x/crypto/nacl/sign/sign.go b/vendor/golang.org/x/crypto/nacl/sign/sign.go new file mode 100644 index 0000000..a9ac0a7 --- /dev/null +++ b/vendor/golang.org/x/crypto/nacl/sign/sign.go @@ -0,0 +1,83 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package sign signs small messages using public-key cryptography. +// +// Sign uses Ed25519 to sign messages. The length of messages is not hidden. +// Messages should be small because: +// 1. The whole message needs to be held in memory to be processed. +// 2. Using large messages pressures implementations on small machines to process +// plaintext without verifying the signature. This is very dangerous, and this API +// discourages it, but a protocol that uses excessive message sizes might present +// some implementations with no other choice. +// 3. Performance may be improved by working with messages that fit into data caches. +// Thus large amounts of data should be chunked so that each message is small. +// +// This package is not interoperable with the current release of NaCl +// (https://nacl.cr.yp.to/sign.html), which does not support Ed25519 yet. However, +// it is compatible with the NaCl fork libsodium (https://www.libsodium.org), as well +// as TweetNaCl (https://tweetnacl.cr.yp.to/). +package sign + +import ( + "io" + + "golang.org/x/crypto/ed25519" +) + +// Overhead is the number of bytes of overhead when signing a message. +const Overhead = 64 + +// GenerateKey generates a new public/private key pair suitable for use with +// Sign and Open. +func GenerateKey(rand io.Reader) (publicKey *[32]byte, privateKey *[64]byte, err error) { + pub, priv, err := ed25519.GenerateKey(rand) + if err != nil { + return nil, nil, err + } + publicKey, privateKey = new([32]byte), new([64]byte) + copy((*publicKey)[:], pub) + copy((*privateKey)[:], priv) + return publicKey, privateKey, nil +} + +// Sign appends a signed copy of message to out, which will be Overhead bytes +// longer than the original and must not overlap it. +func Sign(out, message []byte, privateKey *[64]byte) []byte { + sig := ed25519.Sign(ed25519.PrivateKey((*privateKey)[:]), message) + ret, out := sliceForAppend(out, Overhead+len(message)) + copy(out, sig) + copy(out[Overhead:], message) + return ret +} + +// Open verifies a signed message produced by Sign and appends the message to +// out, which must not overlap the signed message. The output will be Overhead +// bytes smaller than the signed message. +func Open(out, signedMessage []byte, publicKey *[32]byte) ([]byte, bool) { + if len(signedMessage) < Overhead { + return nil, false + } + if !ed25519.Verify(ed25519.PublicKey((*publicKey)[:]), signedMessage[Overhead:], signedMessage[:Overhead]) { + return nil, false + } + ret, out := sliceForAppend(out, len(signedMessage)-Overhead) + copy(out, signedMessage[Overhead:]) + return ret, true +} + +// sliceForAppend takes a slice and a requested number of bytes. It returns a +// slice with the contents of the given slice followed by that many bytes and a +// second slice that aliases into it and contains only the extra bytes. If the +// original slice has sufficient capacity then no allocation is performed. +func sliceForAppend(in []byte, n int) (head, tail []byte) { + if total := len(in) + n; cap(in) >= total { + head = in[:total] + } else { + head = make([]byte, total) + copy(head, in) + } + tail = head[len(in):] + return +} diff --git a/vendor/golang.org/x/crypto/nacl/sign/sign_test.go b/vendor/golang.org/x/crypto/nacl/sign/sign_test.go new file mode 100644 index 0000000..0a6439a --- /dev/null +++ b/vendor/golang.org/x/crypto/nacl/sign/sign_test.go @@ -0,0 +1,74 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sign + +import ( + "bytes" + "crypto/rand" + "encoding/hex" + "testing" +) + +var testSignedMessage, _ = hex.DecodeString("26a0a47f733d02ddb74589b6cbd6f64a7dab1947db79395a1a9e00e4c902c0f185b119897b89b248d16bab4ea781b5a3798d25c2984aec833dddab57e0891e0d68656c6c6f20776f726c64") +var testMessage = testSignedMessage[Overhead:] +var testPublicKey [32]byte +var testPrivateKey = [64]byte{ + 0x98, 0x3c, 0x6a, 0xa6, 0x21, 0xcc, 0xbb, 0xb2, 0xa7, 0xe8, 0x97, 0x94, 0xde, 0x5f, 0xf8, 0x11, + 0x8a, 0xf3, 0x33, 0x1a, 0x03, 0x5c, 0x43, 0x99, 0x03, 0x13, 0x2d, 0xd7, 0xb4, 0xc4, 0x8b, 0xb0, + 0xf6, 0x33, 0x20, 0xa3, 0x34, 0x8b, 0x7b, 0xe2, 0xfe, 0xb4, 0xe7, 0x3a, 0x54, 0x08, 0x2d, 0xd7, + 0x0c, 0xb7, 0xc0, 0xe3, 0xbf, 0x62, 0x6c, 0x55, 0xf0, 0x33, 0x28, 0x52, 0xf8, 0x48, 0x7d, 0xfd, +} + +func init() { + copy(testPublicKey[:], testPrivateKey[32:]) +} + +func TestSign(t *testing.T) { + signedMessage := Sign(nil, testMessage, &testPrivateKey) + if !bytes.Equal(signedMessage, testSignedMessage) { + t.Fatalf("signed message did not match, got\n%x\n, expected\n%x", signedMessage, testSignedMessage) + } +} + +func TestOpen(t *testing.T) { + message, ok := Open(nil, testSignedMessage, &testPublicKey) + if !ok { + t.Fatalf("valid signed message not successfully verified") + } + if !bytes.Equal(message, testMessage) { + t.Fatalf("message did not match, got\n%x\n, expected\n%x", message, testMessage) + } + message, ok = Open(nil, testSignedMessage[1:], &testPublicKey) + if ok { + t.Fatalf("invalid signed message successfully verified") + } + + badMessage := make([]byte, len(testSignedMessage)) + copy(badMessage, testSignedMessage) + badMessage[5] ^= 1 + if _, ok := Open(nil, badMessage, &testPublicKey); ok { + t.Fatalf("Open succeeded with a corrupt message") + } + + var badPublicKey [32]byte + copy(badPublicKey[:], testPublicKey[:]) + badPublicKey[5] ^= 1 + if _, ok := Open(nil, testSignedMessage, &badPublicKey); ok { + t.Fatalf("Open succeeded with a corrupt public key") + } +} + +func TestGenerateSignOpen(t *testing.T) { + publicKey, privateKey, _ := GenerateKey(rand.Reader) + signedMessage := Sign(nil, testMessage, privateKey) + message, ok := Open(nil, signedMessage, publicKey) + if !ok { + t.Fatalf("failed to verify signed message") + } + + if !bytes.Equal(message, testMessage) { + t.Fatalf("verified message does not match signed messge, got\n%x\n, expected\n%x", message, testMessage) + } +} diff --git a/vendor/golang.org/x/crypto/openpgp/keys.go b/vendor/golang.org/x/crypto/openpgp/keys.go index 744e293..fd582a8 100644 --- a/vendor/golang.org/x/crypto/openpgp/keys.go +++ b/vendor/golang.org/x/crypto/openpgp/keys.go @@ -486,7 +486,7 @@ func NewEntity(name, comment, email string, config *packet.Config) (*Entity, err } isPrimaryId := true e.Identities[uid.Id] = &Identity{ - Name: uid.Name, + Name: uid.Id, UserId: uid, SelfSignature: &packet.Signature{ CreationTime: currentTime, @@ -507,6 +507,11 @@ func NewEntity(name, comment, email string, config *packet.Config) (*Entity, err e.Identities[uid.Id].SelfSignature.PreferredHash = []uint8{hashToHashId(config.DefaultHash)} } + // Likewise for DefaultCipher. + if config != nil && config.DefaultCipher != 0 { + e.Identities[uid.Id].SelfSignature.PreferredSymmetric = []uint8{uint8(config.DefaultCipher)} + } + e.Subkeys = make([]Subkey, 1) e.Subkeys[0] = Subkey{ PublicKey: packet.NewRSAPublicKey(currentTime, &encryptingPriv.PublicKey), diff --git a/vendor/golang.org/x/crypto/openpgp/keys_test.go b/vendor/golang.org/x/crypto/openpgp/keys_test.go index 76ba13e..3a15506 100644 --- a/vendor/golang.org/x/crypto/openpgp/keys_test.go +++ b/vendor/golang.org/x/crypto/openpgp/keys_test.go @@ -320,6 +320,56 @@ func TestNewEntityWithoutPreferredHash(t *testing.T) { } } +func TestNewEntityCorrectName(t *testing.T) { + entity, err := NewEntity("Golang Gopher", "Test Key", "no-reply@golang.com", nil) + if err != nil { + t.Fatal(err) + } + if len(entity.Identities) != 1 { + t.Fatalf("len(entity.Identities) = %d, want 1", len(entity.Identities)) + } + var got string + for _, i := range entity.Identities { + got = i.Name + } + want := "Golang Gopher (Test Key) " + if got != want { + t.Fatalf("Identity.Name = %q, want %q", got, want) + } +} + +func TestNewEntityWithPreferredSymmetric(t *testing.T) { + c := &packet.Config{ + DefaultCipher: packet.CipherAES256, + } + entity, err := NewEntity("Golang Gopher", "Test Key", "no-reply@golang.com", c) + if err != nil { + t.Fatal(err) + } + + for _, identity := range entity.Identities { + if len(identity.SelfSignature.PreferredSymmetric) == 0 { + t.Fatal("didn't find a preferred cipher in self signature") + } + if identity.SelfSignature.PreferredSymmetric[0] != uint8(c.DefaultCipher) { + t.Fatalf("Expected preferred cipher to be %d, got %d", uint8(c.DefaultCipher), identity.SelfSignature.PreferredSymmetric[0]) + } + } +} + +func TestNewEntityWithoutPreferredSymmetric(t *testing.T) { + entity, err := NewEntity("Golang Gopher", "Test Key", "no-reply@golang.com", nil) + if err != nil { + t.Fatal(err) + } + + for _, identity := range entity.Identities { + if len(identity.SelfSignature.PreferredSymmetric) != 0 { + t.Fatalf("Expected preferred cipher to be empty but got length %d", len(identity.SelfSignature.PreferredSymmetric)) + } + } +} + const expiringKeyHex = "988d0451d1ec5d010400ba3385721f2dc3f4ab096b2ee867ab77213f0a27a8538441c35d2fa225b08798a1439a66a5150e6bdc3f40f5d28d588c712394c632b6299f77db8c0d48d37903fb72ebd794d61be6aa774688839e5fdecfe06b2684cc115d240c98c66cb1ef22ae84e3aa0c2b0c28665c1e7d4d044e7f270706193f5223c8d44e0d70b7b8da830011010001b40f4578706972792074657374206b657988be041301020028050251d1ec5d021b03050900278d00060b090807030206150802090a0b0416020301021e01021780000a091072589ad75e237d8c033503fd10506d72837834eb7f994117740723adc39227104b0d326a1161871c0b415d25b4aedef946ca77ea4c05af9c22b32cf98be86ab890111fced1ee3f75e87b7cc3c00dc63bbc85dfab91c0dc2ad9de2c4d13a34659333a85c6acc1a669c5e1d6cecb0cf1e56c10e72d855ae177ddc9e766f9b2dda57ccbb75f57156438bbdb4e42b88d0451d1ec5d0104009c64906559866c5cb61578f5846a94fcee142a489c9b41e67b12bb54cfe86eb9bc8566460f9a720cb00d6526fbccfd4f552071a8e3f7744b1882d01036d811ee5a3fb91a1c568055758f43ba5d2c6a9676b012f3a1a89e47bbf624f1ad571b208f3cc6224eb378f1645dd3d47584463f9eadeacfd1ce6f813064fbfdcc4b5a53001101000188a504180102000f021b0c050251d1f06b050900093e89000a091072589ad75e237d8c20e00400ab8310a41461425b37889c4da28129b5fae6084fafbc0a47dd1adc74a264c6e9c9cc125f40462ee1433072a58384daef88c961c390ed06426a81b464a53194c4e291ddd7e2e2ba3efced01537d713bd111f48437bde2363446200995e8e0d4e528dda377fd1e8f8ede9c8e2198b393bd86852ce7457a7e3daf74d510461a5b77b88d0451d1ece8010400b3a519f83ab0010307e83bca895170acce8964a044190a2b368892f7a244758d9fc193482648acb1fb9780d28cc22d171931f38bb40279389fc9bf2110876d4f3db4fcfb13f22f7083877fe56592b3b65251312c36f83ffcb6d313c6a17f197dd471f0712aad15a8537b435a92471ba2e5b0c72a6c72536c3b567c558d7b6051001101000188a504180102000f021b0c050251d1f07b050900279091000a091072589ad75e237d8ce69e03fe286026afacf7c97ee20673864d4459a2240b5655219950643c7dba0ac384b1d4359c67805b21d98211f7b09c2a0ccf6410c8c04d4ff4a51293725d8d6570d9d8bb0e10c07d22357caeb49626df99c180be02d77d1fe8ed25e7a54481237646083a9f89a11566cd20b9e995b1487c5f9e02aeb434f3a1897cd416dd0a87861838da3e9e" const subkeyUsageHex = "988d04533a52bc010400d26af43085558f65b9e7dbc90cb9238015259aed5e954637adcfa2181548b2d0b60c65f1f42ec5081cbf1bc0a8aa4900acfb77070837c58f26012fbce297d70afe96e759ad63531f0037538e70dbf8e384569b9720d99d8eb39d8d0a2947233ed242436cb6ac7dfe74123354b3d0119b5c235d3dd9c9d6c004f8ffaf67ad8583001101000188b7041f010200210502533b8552170c8001ce094aa433f7040bb2ddf0be3893cb843d0fe70c020700000a0910a42704b92866382aa98404009d63d916a27543da4221c60087c33f1c44bec9998c5438018ed370cca4962876c748e94b73eb39c58eb698063f3fd6346d58dd2a11c0247934c4a9d71f24754f7468f96fb24c3e791dd2392b62f626148ad724189498cbf993db2df7c0cdc2d677c35da0f16cb16c9ce7c33b4de65a4a91b1d21a130ae9cc26067718910ef8e2b417556d627261203c756d627261407379642e65642e61753e88b80413010200220502533a52bc021b03060b090807030206150802090a0b0416020301021e01021780000a0910a42704b92866382a47840400c0c2bd04f5fca586de408b395b3c280a278259c93eaaa8b79a53b97003f8ed502a8a00446dd9947fb462677e4fcac0dac2f0701847d15130aadb6cd9e0705ea0cf5f92f129136c7be21a718d46c8e641eb7f044f2adae573e11ae423a0a9ca51324f03a8a2f34b91fa40c3cc764bee4dccadedb54c768ba0469b683ea53f1c29b88d04533a52bc01040099c92a5d6f8b744224da27bc2369127c35269b58bec179de6bbc038f749344222f85a31933224f26b70243c4e4b2d242f0c4777eaef7b5502f9dad6d8bf3aaeb471210674b74de2d7078af497d55f5cdad97c7bedfbc1b41e8065a97c9c3d344b21fc81d27723af8e374bc595da26ea242dccb6ae497be26eea57e563ed517e90011010001889f0418010200090502533a52bc021b0c000a0910a42704b92866382afa1403ff70284c2de8a043ff51d8d29772602fa98009b7861c540535f874f2c230af8caf5638151a636b21f8255003997ccd29747fdd06777bb24f9593bd7d98a3e887689bf902f999915fcc94625ae487e5d13e6616f89090ebc4fdc7eb5cad8943e4056995bb61c6af37f8043016876a958ec7ebf39c43d20d53b7f546cfa83e8d2604b88d04533b8283010400c0b529316dbdf58b4c54461e7e669dc11c09eb7f73819f178ccd4177b9182b91d138605fcf1e463262fabefa73f94a52b5e15d1904635541c7ea540f07050ce0fb51b73e6f88644cec86e91107c957a114f69554548a85295d2b70bd0b203992f76eb5d493d86d9eabcaa7ef3fc7db7e458438db3fcdb0ca1cc97c638439a9170011010001889f0418010200090502533b8283021b0c000a0910a42704b92866382adc6d0400cfff6258485a21675adb7a811c3e19ebca18851533f75a7ba317950b9997fda8d1a4c8c76505c08c04b6c2cc31dc704d33da36a21273f2b388a1a706f7c3378b66d887197a525936ed9a69acb57fe7f718133da85ec742001c5d1864e9c6c8ea1b94f1c3759cebfd93b18606066c063a63be86085b7e37bdbc65f9a915bf084bb901a204533b85cd110400aed3d2c52af2b38b5b67904b0ef73d6dd7aef86adb770e2b153cd22489654dcc91730892087bb9856ae2d9f7ed1eb48f214243fe86bfe87b349ebd7c30e630e49c07b21fdabf78b7a95c8b7f969e97e3d33f2e074c63552ba64a2ded7badc05ce0ea2be6d53485f6900c7860c7aa76560376ce963d7271b9b54638a4028b573f00a0d8854bfcdb04986141568046202192263b9b67350400aaa1049dbc7943141ef590a70dcb028d730371d92ea4863de715f7f0f16d168bd3dc266c2450457d46dcbbf0b071547e5fbee7700a820c3750b236335d8d5848adb3c0da010e998908dfd93d961480084f3aea20b247034f8988eccb5546efaa35a92d0451df3aaf1aee5aa36a4c4d462c760ecd9cebcabfbe1412b1f21450f203fd126687cd486496e971a87fd9e1a8a765fe654baa219a6871ab97768596ab05c26c1aeea8f1a2c72395a58dbc12ef9640d2b95784e974a4d2d5a9b17c25fedacfe551bda52602de8f6d2e48443f5dd1a2a2a8e6a5e70ecdb88cd6e766ad9745c7ee91d78cc55c3d06536b49c3fee6c3d0b6ff0fb2bf13a314f57c953b8f4d93bf88e70418010200090502533b85cd021b0200520910a42704b92866382a47200419110200060502533b85cd000a091042ce2c64bc0ba99214b2009e26b26852c8b13b10c35768e40e78fbbb48bd084100a0c79d9ea0844fa5853dd3c85ff3ecae6f2c9dd6c557aa04008bbbc964cd65b9b8299d4ebf31f41cc7264b8cf33a00e82c5af022331fac79efc9563a822497ba012953cefe2629f1242fcdcb911dbb2315985bab060bfd58261ace3c654bdbbe2e8ed27a46e836490145c86dc7bae15c011f7e1ffc33730109b9338cd9f483e7cef3d2f396aab5bd80efb6646d7e778270ee99d934d187dd98" const revokedKeyHex = "988d045331ce82010400c4fdf7b40a5477f206e6ee278eaef888ca73bf9128a9eef9f2f1ddb8b7b71a4c07cfa241f028a04edb405e4d916c61d6beabc333813dc7b484d2b3c52ee233c6a79b1eea4e9cc51596ba9cd5ac5aeb9df62d86ea051055b79d03f8a4fa9f38386f5bd17529138f3325d46801514ea9047977e0829ed728e68636802796801be10011010001889f04200102000905025331d0e3021d03000a0910a401d9f09a34f7c042aa040086631196405b7e6af71026b88e98012eab44aa9849f6ef3fa930c7c9f23deaedba9db1538830f8652fb7648ec3fcade8dbcbf9eaf428e83c6cbcc272201bfe2fbb90d41963397a7c0637a1a9d9448ce695d9790db2dc95433ad7be19eb3de72dacf1d6db82c3644c13eae2a3d072b99bb341debba012c5ce4006a7d34a1f4b94b444526567205265766f6b657220283c52656727732022424d204261726973746122204b657920262530305c303e5c29203c72656740626d626172697374612e636f2e61753e88b704130102002205025331ce82021b03060b090807030206150802090a0b0416020301021e01021780000a0910a401d9f09a34f7c0019c03f75edfbeb6a73e7225ad3cc52724e2872e04260d7daf0d693c170d8c4b243b8767bc7785763533febc62ec2600c30603c433c095453ede59ff2fcabeb84ce32e0ed9d5cf15ffcbc816202b64370d4d77c1e9077d74e94a16fb4fa2e5bec23a56d7a73cf275f91691ae1801a976fcde09e981a2f6327ac27ea1fecf3185df0d56889c04100102000605025331cfb5000a0910fe9645554e8266b64b4303fc084075396674fb6f778d302ac07cef6bc0b5d07b66b2004c44aef711cbac79617ef06d836b4957522d8772dd94bf41a2f4ac8b1ee6d70c57503f837445a74765a076d07b829b8111fc2a918423ddb817ead7ca2a613ef0bfb9c6b3562aec6c3cf3c75ef3031d81d95f6563e4cdcc9960bcb386c5d757b104fcca5fe11fc709df884604101102000605025331cfe7000a09107b15a67f0b3ddc0317f6009e360beea58f29c1d963a22b962b80788c3fa6c84e009d148cfde6b351469b8eae91187eff07ad9d08fcaab88d045331ce820104009f25e20a42b904f3fa555530fe5c46737cf7bd076c35a2a0d22b11f7e0b61a69320b768f4a80fe13980ce380d1cfc4a0cd8fbe2d2e2ef85416668b77208baa65bf973fe8e500e78cc310d7c8705cdb34328bf80e24f0385fce5845c33bc7943cf6b11b02348a23da0bf6428e57c05135f2dc6bd7c1ce325d666d5a5fd2fd5e410011010001889f04180102000905025331ce82021b0c000a0910a401d9f09a34f7c0418003fe34feafcbeaef348a800a0d908a7a6809cc7304017d820f70f0474d5e23cb17e38b67dc6dca282c6ca00961f4ec9edf2738d0f087b1d81e4871ef08e1798010863afb4eac4c44a376cb343be929c5be66a78cfd4456ae9ec6a99d97f4e1c3ff3583351db2147a65c0acef5c003fb544ab3a2e2dc4d43646f58b811a6c3a369d1f" diff --git a/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go index 266840d..02b372c 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key.go @@ -42,12 +42,18 @@ func (e *EncryptedKey) parse(r io.Reader) (err error) { switch e.Algo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: e.encryptedMPI1.bytes, e.encryptedMPI1.bitLength, err = readMPI(r) + if err != nil { + return + } case PubKeyAlgoElGamal: e.encryptedMPI1.bytes, e.encryptedMPI1.bitLength, err = readMPI(r) if err != nil { return } e.encryptedMPI2.bytes, e.encryptedMPI2.bitLength, err = readMPI(r) + if err != nil { + return + } } _, err = consumeAll(r) return @@ -72,7 +78,8 @@ func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error { // padding oracle attacks. switch priv.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - b, err = rsa.DecryptPKCS1v15(config.Random(), priv.PrivateKey.(*rsa.PrivateKey), e.encryptedMPI1.bytes) + k := priv.PrivateKey.(*rsa.PrivateKey) + b, err = rsa.DecryptPKCS1v15(config.Random(), k, padToKeySize(&k.PublicKey, e.encryptedMPI1.bytes)) case PubKeyAlgoElGamal: c1 := new(big.Int).SetBytes(e.encryptedMPI1.bytes) c2 := new(big.Int).SetBytes(e.encryptedMPI2.bytes) diff --git a/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key_test.go b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key_test.go index fee14cf..f2fcf4d 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key_test.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/encrypted_key_test.go @@ -39,39 +39,44 @@ var encryptedKeyPriv = &PrivateKey{ } func TestDecryptingEncryptedKey(t *testing.T) { - const encryptedKeyHex = "c18c032a67d68660df41c70104005789d0de26b6a50c985a02a13131ca829c413a35d0e6fa8d6842599252162808ac7439c72151c8c6183e76923fe3299301414d0c25a2f06a2257db3839e7df0ec964773f6e4c4ac7ff3b48c444237166dd46ba8ff443a5410dc670cb486672fdbe7c9dfafb75b4fea83af3a204fe2a7dfa86bd20122b4f3d2646cbeecb8f7be8" - const expectedKeyHex = "d930363f7e0308c333b9618617ea728963d8df993665ae7be1092d4926fd864b" + for i, encryptedKeyHex := range []string{ + "c18c032a67d68660df41c70104005789d0de26b6a50c985a02a13131ca829c413a35d0e6fa8d6842599252162808ac7439c72151c8c6183e76923fe3299301414d0c25a2f06a2257db3839e7df0ec964773f6e4c4ac7ff3b48c444237166dd46ba8ff443a5410dc670cb486672fdbe7c9dfafb75b4fea83af3a204fe2a7dfa86bd20122b4f3d2646cbeecb8f7be8", + // MPI can be shorter than the length of the key. + "c18b032a67d68660df41c70103f8e520c52ae9807183c669ce26e772e482dc5d8cf60e6f59316e145be14d2e5221ee69550db1d5618a8cb002a719f1f0b9345bde21536d410ec90ba86cac37748dec7933eb7f9873873b2d61d3321d1cd44535014f6df58f7bc0c7afb5edc38e1a974428997d2f747f9a173bea9ca53079b409517d332df62d805564cffc9be6", + } { + const expectedKeyHex = "d930363f7e0308c333b9618617ea728963d8df993665ae7be1092d4926fd864b" - p, err := Read(readerFromHex(encryptedKeyHex)) - if err != nil { - t.Errorf("error from Read: %s", err) - return - } - ek, ok := p.(*EncryptedKey) - if !ok { - t.Errorf("didn't parse an EncryptedKey, got %#v", p) - return - } + p, err := Read(readerFromHex(encryptedKeyHex)) + if err != nil { + t.Errorf("#%d: error from Read: %s", i, err) + return + } + ek, ok := p.(*EncryptedKey) + if !ok { + t.Errorf("#%d: didn't parse an EncryptedKey, got %#v", i, p) + return + } - if ek.KeyId != 0x2a67d68660df41c7 || ek.Algo != PubKeyAlgoRSA { - t.Errorf("unexpected EncryptedKey contents: %#v", ek) - return - } + if ek.KeyId != 0x2a67d68660df41c7 || ek.Algo != PubKeyAlgoRSA { + t.Errorf("#%d: unexpected EncryptedKey contents: %#v", i, ek) + return + } - err = ek.Decrypt(encryptedKeyPriv, nil) - if err != nil { - t.Errorf("error from Decrypt: %s", err) - return - } + err = ek.Decrypt(encryptedKeyPriv, nil) + if err != nil { + t.Errorf("#%d: error from Decrypt: %s", i, err) + return + } - if ek.CipherFunc != CipherAES256 { - t.Errorf("unexpected EncryptedKey contents: %#v", ek) - return - } + if ek.CipherFunc != CipherAES256 { + t.Errorf("#%d: unexpected EncryptedKey contents: %#v", i, ek) + return + } - keyHex := fmt.Sprintf("%x", ek.Key) - if keyHex != expectedKeyHex { - t.Errorf("bad key, got %s want %x", keyHex, expectedKeyHex) + keyHex := fmt.Sprintf("%x", ek.Key) + if keyHex != expectedKeyHex { + t.Errorf("#%d: bad key, got %s want %s", i, keyHex, expectedKeyHex) + } } } @@ -121,7 +126,7 @@ func TestEncryptingEncryptedKey(t *testing.T) { keyHex := fmt.Sprintf("%x", ek.Key) if keyHex != expectedKeyHex { - t.Errorf("bad key, got %s want %x", keyHex, expectedKeyHex) + t.Errorf("bad key, got %s want %s", keyHex, expectedKeyHex) } } diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index 3eded93..625bb5a 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -11,10 +11,12 @@ import ( "crypto/aes" "crypto/cipher" "crypto/des" - "golang.org/x/crypto/cast5" - "golang.org/x/crypto/openpgp/errors" + "crypto/rsa" "io" "math/big" + + "golang.org/x/crypto/cast5" + "golang.org/x/crypto/openpgp/errors" ) // readFull is the same as io.ReadFull except that reading zero bytes returns @@ -500,19 +502,17 @@ func readMPI(r io.Reader) (mpi []byte, bitLength uint16, err error) { numBytes := (int(bitLength) + 7) / 8 mpi = make([]byte, numBytes) _, err = readFull(r, mpi) - return -} - -// mpiLength returns the length of the given *big.Int when serialized as an -// MPI. -func mpiLength(n *big.Int) (mpiLengthInBytes int) { - mpiLengthInBytes = 2 /* MPI length */ - mpiLengthInBytes += (n.BitLen() + 7) / 8 + // According to RFC 4880 3.2. we should check that the MPI has no leading + // zeroes (at least when not an encrypted MPI?), but this implementation + // does generate leading zeroes, so we keep accepting them. return } // writeMPI serializes a big integer to w. func writeMPI(w io.Writer, bitLength uint16, mpiBytes []byte) (err error) { + // Note that we can produce leading zeroes, in violation of RFC 4880 3.2. + // Implementations seem to be tolerant of them, and stripping them would + // make it complex to guarantee matching re-serialization. _, err = w.Write([]byte{byte(bitLength >> 8), byte(bitLength)}) if err == nil { _, err = w.Write(mpiBytes) @@ -525,6 +525,18 @@ func writeBig(w io.Writer, i *big.Int) error { return writeMPI(w, uint16(i.BitLen()), i.Bytes()) } +// padToKeySize left-pads a MPI with zeroes to match the length of the +// specified RSA public. +func padToKeySize(pub *rsa.PublicKey, b []byte) []byte { + k := (pub.N.BitLen() + 7) / 8 + if len(b) >= k { + return b + } + bb := make([]byte, k) + copy(bb[len(bb)-len(b):], b) + return bb +} + // CompressionAlgo Represents the different compression algorithms // supported by OpenPGP (except for BZIP2, which is not currently // supported). See Section 9.3 of RFC 4880. diff --git a/vendor/golang.org/x/crypto/openpgp/packet/public_key.go b/vendor/golang.org/x/crypto/openpgp/packet/public_key.go index ead2623..fcd5f52 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/public_key.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/public_key.go @@ -244,7 +244,12 @@ func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey } pk.ec.p.bytes = elliptic.Marshal(pub.Curve, pub.X, pub.Y) - pk.ec.p.bitLength = uint16(8 * len(pk.ec.p.bytes)) + + // The bit length is 3 (for the 0x04 specifying an uncompressed key) + // plus two field elements (for x and y), which are rounded up to the + // nearest byte. See https://tools.ietf.org/html/rfc6637#section-6 + fieldBytes := (pub.Curve.Params().BitSize + 7) & ^7 + pk.ec.p.bitLength = uint16(3 + fieldBytes + fieldBytes) pk.setFingerPrintAndKeyId() return pk @@ -515,7 +520,7 @@ func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err erro switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: rsaPublicKey, _ := pk.PublicKey.(*rsa.PublicKey) - err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, sig.RSASignature.bytes) + err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, padToKeySize(rsaPublicKey, sig.RSASignature.bytes)) if err != nil { return errors.SignatureError("RSA verification failure") } @@ -566,7 +571,7 @@ func (pk *PublicKey) VerifySignatureV3(signed hash.Hash, sig *SignatureV3) (err switch pk.PubKeyAlgo { case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: rsaPublicKey := pk.PublicKey.(*rsa.PublicKey) - if err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, sig.RSASignature.bytes); err != nil { + if err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, padToKeySize(rsaPublicKey, sig.RSASignature.bytes)); err != nil { return errors.SignatureError("RSA verification failure") } return diff --git a/vendor/golang.org/x/crypto/openpgp/packet/public_key_test.go b/vendor/golang.org/x/crypto/openpgp/packet/public_key_test.go index 7ad7d91..103696e 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/public_key_test.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/public_key_test.go @@ -6,7 +6,10 @@ package packet import ( "bytes" + "crypto/ecdsa" + "crypto/elliptic" "encoding/hex" + "math/big" "testing" "time" ) @@ -186,6 +189,29 @@ func TestEcc384Serialize(t *testing.T) { } } +func TestP256KeyID(t *testing.T) { + // Confirm that key IDs are correctly calculated for ECC keys. + ecdsaPub := &ecdsa.PublicKey{ + Curve: elliptic.P256(), + X: fromHex("81fbbc20eea9e8d1c3ceabb0a8185925b113d1ac42cd5c78403bd83da19235c6"), + Y: fromHex("5ed6db13d91db34507d0129bf88981878d29adbf8fcd1720afdb767bb3fcaaff"), + } + pub := NewECDSAPublicKey(time.Unix(1297309478, 0), ecdsaPub) + + const want = uint64(0xd01055fbcadd268e) + if pub.KeyId != want { + t.Errorf("want key ID: %x, got %x", want, pub.KeyId) + } +} + +func fromHex(hex string) *big.Int { + n, ok := new(big.Int).SetString(hex, 16) + if !ok { + panic("bad hex number: " + hex) + } + return n +} + const rsaFingerprintHex = "5fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb" const rsaPkDataHex = "988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001" diff --git a/vendor/golang.org/x/crypto/ripemd160/ripemd160_test.go b/vendor/golang.org/x/crypto/ripemd160/ripemd160_test.go index 5df1b25..a1fbffd 100644 --- a/vendor/golang.org/x/crypto/ripemd160/ripemd160_test.go +++ b/vendor/golang.org/x/crypto/ripemd160/ripemd160_test.go @@ -50,15 +50,23 @@ func TestVectors(t *testing.T) { } } -func TestMillionA(t *testing.T) { +func millionA() string { md := New() for i := 0; i < 100000; i++ { io.WriteString(md, "aaaaaaaaaa") } - out := "52783243c1697bdbe16d37f97f68f08325dc1528" - s := fmt.Sprintf("%x", md.Sum(nil)) - if s != out { + return fmt.Sprintf("%x", md.Sum(nil)) +} + +func TestMillionA(t *testing.T) { + const out = "52783243c1697bdbe16d37f97f68f08325dc1528" + if s := millionA(); s != out { t.Fatalf("RIPEMD-160 (1 million 'a') = %s, expected %s", s, out) } - md.Reset() +} + +func BenchmarkMillionA(b *testing.B) { + for i := 0; i < b.N; i++ { + millionA() + } } diff --git a/vendor/golang.org/x/crypto/ripemd160/ripemd160block.go b/vendor/golang.org/x/crypto/ripemd160/ripemd160block.go index 7bc8e6c..e0edc02 100644 --- a/vendor/golang.org/x/crypto/ripemd160/ripemd160block.go +++ b/vendor/golang.org/x/crypto/ripemd160/ripemd160block.go @@ -8,6 +8,10 @@ package ripemd160 +import ( + "math/bits" +) + // work buffer indices and roll amounts for one line var _n = [80]uint{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, @@ -59,16 +63,16 @@ func _Block(md *digest, p []byte) int { i := 0 for i < 16 { alpha = a + (b ^ c ^ d) + x[_n[i]] - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 + s := int(_r[i]) + alpha = bits.RotateLeft32(alpha, s) + e + beta = bits.RotateLeft32(c, 10) a, b, c, d, e = e, alpha, b, beta, d // parallel line alpha = aa + (bb ^ (cc | ^dd)) + x[n_[i]] + 0x50a28be6 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 + s = int(r_[i]) + alpha = bits.RotateLeft32(alpha, s) + ee + beta = bits.RotateLeft32(cc, 10) aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd i++ @@ -77,16 +81,16 @@ func _Block(md *digest, p []byte) int { // round 2 for i < 32 { alpha = a + (b&c | ^b&d) + x[_n[i]] + 0x5a827999 - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 + s := int(_r[i]) + alpha = bits.RotateLeft32(alpha, s) + e + beta = bits.RotateLeft32(c, 10) a, b, c, d, e = e, alpha, b, beta, d // parallel line alpha = aa + (bb&dd | cc&^dd) + x[n_[i]] + 0x5c4dd124 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 + s = int(r_[i]) + alpha = bits.RotateLeft32(alpha, s) + ee + beta = bits.RotateLeft32(cc, 10) aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd i++ @@ -95,16 +99,16 @@ func _Block(md *digest, p []byte) int { // round 3 for i < 48 { alpha = a + (b | ^c ^ d) + x[_n[i]] + 0x6ed9eba1 - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 + s := int(_r[i]) + alpha = bits.RotateLeft32(alpha, s) + e + beta = bits.RotateLeft32(c, 10) a, b, c, d, e = e, alpha, b, beta, d // parallel line alpha = aa + (bb | ^cc ^ dd) + x[n_[i]] + 0x6d703ef3 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 + s = int(r_[i]) + alpha = bits.RotateLeft32(alpha, s) + ee + beta = bits.RotateLeft32(cc, 10) aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd i++ @@ -113,16 +117,16 @@ func _Block(md *digest, p []byte) int { // round 4 for i < 64 { alpha = a + (b&d | c&^d) + x[_n[i]] + 0x8f1bbcdc - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 + s := int(_r[i]) + alpha = bits.RotateLeft32(alpha, s) + e + beta = bits.RotateLeft32(c, 10) a, b, c, d, e = e, alpha, b, beta, d // parallel line alpha = aa + (bb&cc | ^bb&dd) + x[n_[i]] + 0x7a6d76e9 - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 + s = int(r_[i]) + alpha = bits.RotateLeft32(alpha, s) + ee + beta = bits.RotateLeft32(cc, 10) aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd i++ @@ -131,16 +135,16 @@ func _Block(md *digest, p []byte) int { // round 5 for i < 80 { alpha = a + (b ^ (c | ^d)) + x[_n[i]] + 0xa953fd4e - s := _r[i] - alpha = (alpha<>(32-s)) + e - beta = c<<10 | c>>22 + s := int(_r[i]) + alpha = bits.RotateLeft32(alpha, s) + e + beta = bits.RotateLeft32(c, 10) a, b, c, d, e = e, alpha, b, beta, d // parallel line alpha = aa + (bb ^ cc ^ dd) + x[n_[i]] - s = r_[i] - alpha = (alpha<>(32-s)) + ee - beta = cc<<10 | cc>>22 + s = int(r_[i]) + alpha = bits.RotateLeft32(alpha, s) + ee + beta = bits.RotateLeft32(cc, 10) aa, bb, cc, dd, ee = ee, alpha, bb, beta, dd i++ diff --git a/vendor/golang.org/x/crypto/sha3/shake.go b/vendor/golang.org/x/crypto/sha3/shake.go index 841f986..5a027d2 100644 --- a/vendor/golang.org/x/crypto/sha3/shake.go +++ b/vendor/golang.org/x/crypto/sha3/shake.go @@ -40,7 +40,7 @@ func (d *state) Clone() ShakeHash { // least 32 bytes of its output are used. func NewShake128() ShakeHash { return &state{rate: 168, dsbyte: 0x1f} } -// NewShake256 creates a new SHAKE128 variable-output-length ShakeHash. +// NewShake256 creates a new SHAKE256 variable-output-length ShakeHash. // Its generic security strength is 256 bits against all attacks if // at least 64 bytes of its output are used. func NewShake256() ShakeHash { return &state{rate: 136, dsbyte: 0x1f} } diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go index cfc8ead..42106f3 100644 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ b/vendor/golang.org/x/crypto/ssh/certs.go @@ -44,7 +44,9 @@ type Signature struct { const CertTimeInfinity = 1<<64 - 1 // An Certificate represents an OpenSSH certificate as defined in -// [PROTOCOL.certkeys]?rev=1.8. +// [PROTOCOL.certkeys]?rev=1.8. The Certificate type implements the +// PublicKey interface, so it can be unmarshaled using +// ParsePublicKey. type Certificate struct { Nonce []byte Key PublicKey diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index f2ba117..30a49fd 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -671,7 +671,7 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, chacha20.XORKeyStream(polyKey[:], chacha20PolyKeyInput[:], &counter, &c.contentKey) encryptedLength := c.buf[:4] - if _, err := r.Read(encryptedLength); err != nil { + if _, err := io.ReadFull(r, encryptedLength); err != nil { return nil, err } @@ -692,13 +692,12 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, c.buf = c.buf[:packetEnd] } - if _, err := r.Read(c.buf[4:packetEnd]); err != nil { + if _, err := io.ReadFull(r, c.buf[4:packetEnd]); err != nil { return nil, err } var mac [poly1305.TagSize]byte copy(mac[:], c.buf[contentEnd:packetEnd]) - if !poly1305.Verify(&mac, c.buf[:contentEnd], &polyKey) { return nil, errors.New("ssh: MAC failure") } @@ -720,6 +719,7 @@ func (c *chacha20Poly1305Cipher) readPacket(seqNum uint32, r io.Reader) ([]byte, } plain = plain[1 : len(plain)-int(padding)] + return plain, nil } diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go index a1252cb..5f44b77 100644 --- a/vendor/golang.org/x/crypto/ssh/client_auth.go +++ b/vendor/golang.org/x/crypto/ssh/client_auth.go @@ -11,6 +11,14 @@ import ( "io" ) +type authResult int + +const ( + authFailure authResult = iota + authPartialSuccess + authSuccess +) + // clientAuthenticate authenticates with the remote server. See RFC 4252. func (c *connection) clientAuthenticate(config *ClientConfig) error { // initiate user auth session @@ -37,11 +45,12 @@ func (c *connection) clientAuthenticate(config *ClientConfig) error { if err != nil { return err } - if ok { + if ok == authSuccess { // success return nil + } else if ok == authFailure { + tried[auth.method()] = true } - tried[auth.method()] = true if methods == nil { methods = lastMethods } @@ -82,7 +91,7 @@ type AuthMethod interface { // If authentication is not successful, a []string of alternative // method names is returned. If the slice is nil, it will be ignored // and the previous set of possible methods will be reused. - auth(session []byte, user string, p packetConn, rand io.Reader) (bool, []string, error) + auth(session []byte, user string, p packetConn, rand io.Reader) (authResult, []string, error) // method returns the RFC 4252 method name. method() string @@ -91,13 +100,13 @@ type AuthMethod interface { // "none" authentication, RFC 4252 section 5.2. type noneAuth int -func (n *noneAuth) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { +func (n *noneAuth) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { if err := c.writePacket(Marshal(&userAuthRequestMsg{ User: user, Service: serviceSSH, Method: "none", })); err != nil { - return false, nil, err + return authFailure, nil, err } return handleAuthResponse(c) @@ -111,7 +120,7 @@ func (n *noneAuth) method() string { // a function call, e.g. by prompting the user. type passwordCallback func() (password string, err error) -func (cb passwordCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { +func (cb passwordCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { type passwordAuthMsg struct { User string `sshtype:"50"` Service string @@ -125,7 +134,7 @@ func (cb passwordCallback) auth(session []byte, user string, c packetConn, rand // The program may only find out that the user doesn't have a password // when prompting. if err != nil { - return false, nil, err + return authFailure, nil, err } if err := c.writePacket(Marshal(&passwordAuthMsg{ @@ -135,7 +144,7 @@ func (cb passwordCallback) auth(session []byte, user string, c packetConn, rand Reply: false, Password: pw, })); err != nil { - return false, nil, err + return authFailure, nil, err } return handleAuthResponse(c) @@ -178,7 +187,7 @@ func (cb publicKeyCallback) method() string { return "publickey" } -func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { +func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { // Authentication is performed by sending an enquiry to test if a key is // acceptable to the remote. If the key is acceptable, the client will // attempt to authenticate with the valid key. If not the client will repeat @@ -186,13 +195,13 @@ func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand signers, err := cb() if err != nil { - return false, nil, err + return authFailure, nil, err } var methods []string for _, signer := range signers { ok, err := validateKey(signer.PublicKey(), user, c) if err != nil { - return false, nil, err + return authFailure, nil, err } if !ok { continue @@ -206,7 +215,7 @@ func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand Method: cb.method(), }, []byte(pub.Type()), pubKey)) if err != nil { - return false, nil, err + return authFailure, nil, err } // manually wrap the serialized signature in a string @@ -224,24 +233,24 @@ func (cb publicKeyCallback) auth(session []byte, user string, c packetConn, rand } p := Marshal(&msg) if err := c.writePacket(p); err != nil { - return false, nil, err + return authFailure, nil, err } - var success bool + var success authResult success, methods, err = handleAuthResponse(c) if err != nil { - return false, nil, err + return authFailure, nil, err } // If authentication succeeds or the list of available methods does not // contain the "publickey" method, do not attempt to authenticate with any // other keys. According to RFC 4252 Section 7, the latter can occur when // additional authentication methods are required. - if success || !containsMethod(methods, cb.method()) { + if success == authSuccess || !containsMethod(methods, cb.method()) { return success, methods, err } } - return false, methods, nil + return authFailure, methods, nil } func containsMethod(methods []string, method string) bool { @@ -318,28 +327,31 @@ func PublicKeysCallback(getSigners func() (signers []Signer, err error)) AuthMet // handleAuthResponse returns whether the preceding authentication request succeeded // along with a list of remaining authentication methods to try next and // an error if an unexpected response was received. -func handleAuthResponse(c packetConn) (bool, []string, error) { +func handleAuthResponse(c packetConn) (authResult, []string, error) { for { packet, err := c.readPacket() if err != nil { - return false, nil, err + return authFailure, nil, err } switch packet[0] { case msgUserAuthBanner: if err := handleBannerResponse(c, packet); err != nil { - return false, nil, err + return authFailure, nil, err } case msgUserAuthFailure: var msg userAuthFailureMsg if err := Unmarshal(packet, &msg); err != nil { - return false, nil, err + return authFailure, nil, err } - return false, msg.Methods, nil + if msg.PartialSuccess { + return authPartialSuccess, msg.Methods, nil + } + return authFailure, msg.Methods, nil case msgUserAuthSuccess: - return true, nil, nil + return authSuccess, nil, nil default: - return false, nil, unexpectedMessageError(msgUserAuthSuccess, packet[0]) + return authFailure, nil, unexpectedMessageError(msgUserAuthSuccess, packet[0]) } } } @@ -381,7 +393,7 @@ func (cb KeyboardInteractiveChallenge) method() string { return "keyboard-interactive" } -func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packetConn, rand io.Reader) (bool, []string, error) { +func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packetConn, rand io.Reader) (authResult, []string, error) { type initiateMsg struct { User string `sshtype:"50"` Service string @@ -395,20 +407,20 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe Service: serviceSSH, Method: "keyboard-interactive", })); err != nil { - return false, nil, err + return authFailure, nil, err } for { packet, err := c.readPacket() if err != nil { - return false, nil, err + return authFailure, nil, err } // like handleAuthResponse, but with less options. switch packet[0] { case msgUserAuthBanner: if err := handleBannerResponse(c, packet); err != nil { - return false, nil, err + return authFailure, nil, err } continue case msgUserAuthInfoRequest: @@ -416,18 +428,21 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe case msgUserAuthFailure: var msg userAuthFailureMsg if err := Unmarshal(packet, &msg); err != nil { - return false, nil, err + return authFailure, nil, err } - return false, msg.Methods, nil + if msg.PartialSuccess { + return authPartialSuccess, msg.Methods, nil + } + return authFailure, msg.Methods, nil case msgUserAuthSuccess: - return true, nil, nil + return authSuccess, nil, nil default: - return false, nil, unexpectedMessageError(msgUserAuthInfoRequest, packet[0]) + return authFailure, nil, unexpectedMessageError(msgUserAuthInfoRequest, packet[0]) } var msg userAuthInfoRequestMsg if err := Unmarshal(packet, &msg); err != nil { - return false, nil, err + return authFailure, nil, err } // Manually unpack the prompt/echo pairs. @@ -437,7 +452,7 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe for i := 0; i < int(msg.NumPrompts); i++ { prompt, r, ok := parseString(rest) if !ok || len(r) == 0 { - return false, nil, errors.New("ssh: prompt format error") + return authFailure, nil, errors.New("ssh: prompt format error") } prompts = append(prompts, string(prompt)) echos = append(echos, r[0] != 0) @@ -445,16 +460,16 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe } if len(rest) != 0 { - return false, nil, errors.New("ssh: extra data following keyboard-interactive pairs") + return authFailure, nil, errors.New("ssh: extra data following keyboard-interactive pairs") } answers, err := cb(msg.User, msg.Instruction, prompts, echos) if err != nil { - return false, nil, err + return authFailure, nil, err } if len(answers) != len(prompts) { - return false, nil, errors.New("ssh: not enough answers from keyboard-interactive callback") + return authFailure, nil, errors.New("ssh: not enough answers from keyboard-interactive callback") } responseLength := 1 + 4 for _, a := range answers { @@ -470,7 +485,7 @@ func (cb KeyboardInteractiveChallenge) auth(session []byte, user string, c packe } if err := c.writePacket(serialized); err != nil { - return false, nil, err + return authFailure, nil, err } } } @@ -480,10 +495,10 @@ type retryableAuthMethod struct { maxTries int } -func (r *retryableAuthMethod) auth(session []byte, user string, c packetConn, rand io.Reader) (ok bool, methods []string, err error) { +func (r *retryableAuthMethod) auth(session []byte, user string, c packetConn, rand io.Reader) (ok authResult, methods []string, err error) { for i := 0; r.maxTries <= 0 || i < r.maxTries; i++ { ok, methods, err = r.authMethod.auth(session, user, c, rand) - if ok || err != nil { // either success or error terminate + if ok != authFailure || err != nil { // either success, partial success or error terminate return ok, methods, err } } diff --git a/vendor/golang.org/x/crypto/ssh/client_auth_test.go b/vendor/golang.org/x/crypto/ssh/client_auth_test.go index 145b57a..5fbb20d 100644 --- a/vendor/golang.org/x/crypto/ssh/client_auth_test.go +++ b/vendor/golang.org/x/crypto/ssh/client_auth_test.go @@ -614,8 +614,8 @@ func TestClientAuthErrorList(t *testing.T) { for i, e := range authErrs.Errors { switch i { case 0: - if e.Error() != "no auth passed yet" { - t.Fatalf("errors: got %v, want no auth passed yet", e.Error()) + if e != ErrNoAuth { + t.Fatalf("errors: got error %v, want ErrNoAuth", e) } case 1: if e != publicKeyErr { diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index ffdc01f..04f3620 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -36,9 +36,9 @@ var supportedCiphers = []string{ // preferredCiphers specifies the default preference for ciphers. var preferredCiphers = []string{ - "aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", chacha20Poly1305ID, + "aes128-ctr", "aes192-ctr", "aes256-ctr", } // supportedKexAlgos specifies the supported key-exchange algorithms in diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index dadf41a..73697de 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -276,7 +276,8 @@ type PublicKey interface { Type() string // Marshal returns the serialized key data in SSH wire format, - // with the name prefix. + // with the name prefix. To unmarshal the returned data, use + // the ParsePublicKey function. Marshal() []byte // Verify that sig is a signature on the given data using this diff --git a/vendor/golang.org/x/crypto/ssh/keys_test.go b/vendor/golang.org/x/crypto/ssh/keys_test.go index 20ab954..9a90abc 100644 --- a/vendor/golang.org/x/crypto/ssh/keys_test.go +++ b/vendor/golang.org/x/crypto/ssh/keys_test.go @@ -234,7 +234,7 @@ func TestMarshalParsePublicKey(t *testing.T) { } } -type authResult struct { +type testAuthResult struct { pubKey PublicKey options []string comments string @@ -242,11 +242,11 @@ type authResult struct { ok bool } -func testAuthorizedKeys(t *testing.T, authKeys []byte, expected []authResult) { +func testAuthorizedKeys(t *testing.T, authKeys []byte, expected []testAuthResult) { rest := authKeys - var values []authResult + var values []testAuthResult for len(rest) > 0 { - var r authResult + var r testAuthResult var err error r.pubKey, r.comments, r.options, rest, err = ParseAuthorizedKey(rest) r.ok = (err == nil) @@ -264,7 +264,7 @@ func TestAuthorizedKeyBasic(t *testing.T) { pub, pubSerialized := getTestKey() line := "ssh-rsa " + pubSerialized + " user@host" testAuthorizedKeys(t, []byte(line), - []authResult{ + []testAuthResult{ {pub, nil, "user@host", "", true}, }) } @@ -286,7 +286,7 @@ func TestAuth(t *testing.T) { authOptions := strings.Join(authWithOptions, eol) rest2 := strings.Join(authWithOptions[3:], eol) rest3 := strings.Join(authWithOptions[6:], eol) - testAuthorizedKeys(t, []byte(authOptions), []authResult{ + testAuthorizedKeys(t, []byte(authOptions), []testAuthResult{ {pub, []string{`env="HOME=/home/root"`, "no-port-forwarding"}, "user@host", rest2, true}, {pub, []string{`env="HOME=/home/root2"`}, "user2@host2", rest3, true}, {nil, nil, "", "", false}, @@ -297,7 +297,7 @@ func TestAuth(t *testing.T) { func TestAuthWithQuotedSpaceInEnv(t *testing.T) { pub, pubSerialized := getTestKey() authWithQuotedSpaceInEnv := []byte(`env="HOME=/home/root dir",no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host`) - testAuthorizedKeys(t, []byte(authWithQuotedSpaceInEnv), []authResult{ + testAuthorizedKeys(t, []byte(authWithQuotedSpaceInEnv), []testAuthResult{ {pub, []string{`env="HOME=/home/root dir"`, "no-port-forwarding"}, "user@host", "", true}, }) } @@ -305,7 +305,7 @@ func TestAuthWithQuotedSpaceInEnv(t *testing.T) { func TestAuthWithQuotedCommaInEnv(t *testing.T) { pub, pubSerialized := getTestKey() authWithQuotedCommaInEnv := []byte(`env="HOME=/home/root,dir",no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host`) - testAuthorizedKeys(t, []byte(authWithQuotedCommaInEnv), []authResult{ + testAuthorizedKeys(t, []byte(authWithQuotedCommaInEnv), []testAuthResult{ {pub, []string{`env="HOME=/home/root,dir"`, "no-port-forwarding"}, "user@host", "", true}, }) } @@ -314,11 +314,11 @@ func TestAuthWithQuotedQuoteInEnv(t *testing.T) { pub, pubSerialized := getTestKey() authWithQuotedQuoteInEnv := []byte(`env="HOME=/home/\"root dir",no-port-forwarding` + "\t" + `ssh-rsa` + "\t" + pubSerialized + ` user@host`) authWithDoubleQuotedQuote := []byte(`no-port-forwarding,env="HOME=/home/ \"root dir\"" ssh-rsa ` + pubSerialized + "\t" + `user@host`) - testAuthorizedKeys(t, []byte(authWithQuotedQuoteInEnv), []authResult{ + testAuthorizedKeys(t, []byte(authWithQuotedQuoteInEnv), []testAuthResult{ {pub, []string{`env="HOME=/home/\"root dir"`, "no-port-forwarding"}, "user@host", "", true}, }) - testAuthorizedKeys(t, []byte(authWithDoubleQuotedQuote), []authResult{ + testAuthorizedKeys(t, []byte(authWithDoubleQuotedQuote), []testAuthResult{ {pub, []string{"no-port-forwarding", `env="HOME=/home/ \"root dir\""`}, "user@host", "", true}, }) } @@ -327,7 +327,7 @@ func TestAuthWithInvalidSpace(t *testing.T) { _, pubSerialized := getTestKey() authWithInvalidSpace := []byte(`env="HOME=/home/root dir", no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host #more to follow but still no valid keys`) - testAuthorizedKeys(t, []byte(authWithInvalidSpace), []authResult{ + testAuthorizedKeys(t, []byte(authWithInvalidSpace), []testAuthResult{ {nil, nil, "", "", false}, }) } @@ -337,7 +337,7 @@ func TestAuthWithMissingQuote(t *testing.T) { authWithMissingQuote := []byte(`env="HOME=/home/root,no-port-forwarding ssh-rsa ` + pubSerialized + ` user@host env="HOME=/home/root",shared-control ssh-rsa ` + pubSerialized + ` user@host`) - testAuthorizedKeys(t, []byte(authWithMissingQuote), []authResult{ + testAuthorizedKeys(t, []byte(authWithMissingQuote), []testAuthResult{ {pub, []string{`env="HOME=/home/root"`, `shared-control`}, "user@host", "", true}, }) } diff --git a/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go b/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go index 448fc07..bc3db73 100644 --- a/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go +++ b/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package knownhosts implements a parser for the OpenSSH -// known_hosts host key database. +// Package knownhosts implements a parser for the OpenSSH known_hosts +// host key database, and provides utility functions for writing +// OpenSSH compliant known_hosts files. package knownhosts import ( @@ -38,7 +39,7 @@ func (a *addr) String() string { } type matcher interface { - match([]addr) bool + match(addr) bool } type hostPattern struct { @@ -57,19 +58,16 @@ func (p *hostPattern) String() string { type hostPatterns []hostPattern -func (ps hostPatterns) match(addrs []addr) bool { +func (ps hostPatterns) match(a addr) bool { matched := false for _, p := range ps { - for _, a := range addrs { - m := p.match(a) - if !m { - continue - } - if p.negate { - return false - } - matched = true + if !p.match(a) { + continue } + if p.negate { + return false + } + matched = true } return matched } @@ -122,8 +120,8 @@ func serialize(k ssh.PublicKey) string { return k.Type() + " " + base64.StdEncoding.EncodeToString(k.Marshal()) } -func (l *keyDBLine) match(addrs []addr) bool { - return l.matcher.match(addrs) +func (l *keyDBLine) match(a addr) bool { + return l.matcher.match(a) } type hostKeyDB struct { @@ -153,7 +151,7 @@ func (db *hostKeyDB) IsHostAuthority(remote ssh.PublicKey, address string) bool a := addr{host: h, port: p} for _, l := range db.lines { - if l.cert && keyEq(l.knownKey.Key, remote) && l.match([]addr{a}) { + if l.cert && keyEq(l.knownKey.Key, remote) && l.match(a) { return true } } @@ -338,26 +336,24 @@ func (db *hostKeyDB) check(address string, remote net.Addr, remoteKey ssh.Public return fmt.Errorf("knownhosts: SplitHostPort(%s): %v", remote, err) } - addrs := []addr{ - {host, port}, - } - + hostToCheck := addr{host, port} if address != "" { + // Give preference to the hostname if available. host, port, err := net.SplitHostPort(address) if err != nil { return fmt.Errorf("knownhosts: SplitHostPort(%s): %v", address, err) } - addrs = append(addrs, addr{host, port}) + hostToCheck = addr{host, port} } - return db.checkAddrs(addrs, remoteKey) + return db.checkAddr(hostToCheck, remoteKey) } // checkAddrs checks if we can find the given public key for any of // the given addresses. If we only find an entry for the IP address, // or only the hostname, then this still succeeds. -func (db *hostKeyDB) checkAddrs(addrs []addr, remoteKey ssh.PublicKey) error { +func (db *hostKeyDB) checkAddr(a addr, remoteKey ssh.PublicKey) error { // TODO(hanwen): are these the right semantics? What if there // is just a key for the IP address, but not for the // hostname? @@ -365,7 +361,7 @@ func (db *hostKeyDB) checkAddrs(addrs []addr, remoteKey ssh.PublicKey) error { // Algorithm => key. knownKeys := map[string]KnownKey{} for _, l := range db.lines { - if l.match(addrs) { + if l.match(a) { typ := l.knownKey.Key.Type() if _, ok := knownKeys[typ]; !ok { knownKeys[typ] = l.knownKey @@ -414,7 +410,10 @@ func (db *hostKeyDB) Read(r io.Reader, filename string) error { // New creates a host key callback from the given OpenSSH host key // files. The returned callback is for use in -// ssh.ClientConfig.HostKeyCallback. Hashed hostnames are not supported. +// ssh.ClientConfig.HostKeyCallback. By preference, the key check +// operates on the hostname if available, i.e. if a server changes its +// IP address, the host key check will still succeed, even though a +// record of the new IP address is not available. func New(files ...string) (ssh.HostKeyCallback, error) { db := newHostKeyDB() for _, fn := range files { @@ -536,11 +535,6 @@ func newHashedHost(encoded string) (*hashedHost, error) { return &hashedHost{salt: salt, hash: hash}, nil } -func (h *hashedHost) match(addrs []addr) bool { - for _, a := range addrs { - if bytes.Equal(hashHost(Normalize(a.String()), h.salt), h.hash) { - return true - } - } - return false +func (h *hashedHost) match(a addr) bool { + return bytes.Equal(hashHost(Normalize(a.String()), h.salt), h.hash) } diff --git a/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts_test.go b/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts_test.go index be7cc0e..464dd59 100644 --- a/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts_test.go +++ b/vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts_test.go @@ -166,7 +166,7 @@ func TestBasic(t *testing.T) { str := fmt.Sprintf("#comment\n\nserver.org,%s %s\notherhost %s", testAddr, edKeyStr, ecKeyStr) db := testDB(t, str) if err := db.check("server.org:22", testAddr, edKey); err != nil { - t.Errorf("got error %q, want none", err) + t.Errorf("got error %v, want none", err) } want := KnownKey{ @@ -185,6 +185,33 @@ func TestBasic(t *testing.T) { } } +func TestHostNamePrecedence(t *testing.T) { + var evilAddr = &net.TCPAddr{ + IP: net.IP{66, 66, 66, 66}, + Port: 22, + } + + str := fmt.Sprintf("server.org,%s %s\nevil.org,%s %s", testAddr, edKeyStr, evilAddr, ecKeyStr) + db := testDB(t, str) + + if err := db.check("server.org:22", evilAddr, ecKey); err == nil { + t.Errorf("check succeeded") + } else if _, ok := err.(*KeyError); !ok { + t.Errorf("got %T, want *KeyError", err) + } +} + +func TestDBOrderingPrecedenceKeyType(t *testing.T) { + str := fmt.Sprintf("server.org,%s %s\nserver.org,%s %s", testAddr, edKeyStr, testAddr, alternateEdKeyStr) + db := testDB(t, str) + + if err := db.check("server.org:22", testAddr, alternateEdKey); err == nil { + t.Errorf("check succeeded") + } else if _, ok := err.(*KeyError); !ok { + t.Errorf("got %T, want *KeyError", err) + } +} + func TestNegate(t *testing.T) { str := fmt.Sprintf("%s,!server.org %s", testAddr, edKeyStr) db := testDB(t, str) diff --git a/vendor/golang.org/x/crypto/ssh/mux_test.go b/vendor/golang.org/x/crypto/ssh/mux_test.go index 25d2181..d88b64e 100644 --- a/vendor/golang.org/x/crypto/ssh/mux_test.go +++ b/vendor/golang.org/x/crypto/ssh/mux_test.go @@ -108,10 +108,6 @@ func TestMuxReadWrite(t *testing.T) { if err != nil { t.Fatalf("Write: %v", err) } - err = s.Close() - if err != nil { - t.Fatalf("Close: %v", err) - } }() var buf [1024]byte diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index b83d473..d0f4825 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -166,6 +166,9 @@ type ServerConn struct { // unsuccessful, it closes the connection and returns an error. The // Request and NewChannel channels must be serviced, or the connection // will hang. +// +// The returned error may be of type *ServerAuthError for +// authentication errors. func NewServerConn(c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewChannel, <-chan *Request, error) { fullConf := *config fullConf.SetDefaults() @@ -292,12 +295,13 @@ func checkSourceAddress(addr net.Addr, sourceAddrs string) error { return fmt.Errorf("ssh: remote address %v is not allowed because of source-address restriction", addr) } -// ServerAuthError implements the error interface. It appends any authentication -// errors that may occur, and is returned if all of the authentication methods -// provided by the user failed to authenticate. +// ServerAuthError represents server authentication errors and is +// sometimes returned by NewServerConn. It appends any authentication +// errors that may occur, and is returned if all of the authentication +// methods provided by the user failed to authenticate. type ServerAuthError struct { // Errors contains authentication errors returned by the authentication - // callback methods. + // callback methods. The first entry is typically ErrNoAuth. Errors []error } @@ -309,6 +313,13 @@ func (l ServerAuthError) Error() string { return "[" + strings.Join(errs, ", ") + "]" } +// ErrNoAuth is the error value returned if no +// authentication method has been passed yet. This happens as a normal +// part of the authentication loop, since the client first tries +// 'none' authentication to discover available methods. +// It is returned in ServerAuthError.Errors from NewServerConn. +var ErrNoAuth = errors.New("ssh: no auth passed yet") + func (s *connection) serverAuthenticate(config *ServerConfig) (*Permissions, error) { sessionID := s.transport.getSessionID() var cache pubKeyCache @@ -363,7 +374,7 @@ userAuthLoop: } perms = nil - authErr := errors.New("no auth passed yet") + authErr := ErrNoAuth switch userAuthReq.Method { case "none": diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util.go b/vendor/golang.org/x/crypto/ssh/terminal/util.go index 02dad48..731c89a 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util.go @@ -108,9 +108,7 @@ func ReadPassword(fd int) ([]byte, error) { return nil, err } - defer func() { - unix.IoctlSetTermios(fd, ioctlWriteTermios, termios) - }() + defer unix.IoctlSetTermios(fd, ioctlWriteTermios, termios) return readPasswordLine(passwordReader(fd)) } diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go index a2e1b57..9e41b9f 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go @@ -14,7 +14,7 @@ import ( // State contains the state of a terminal. type State struct { - state *unix.Termios + termios unix.Termios } // IsTerminal returns true if the given file descriptor is a terminal. @@ -75,47 +75,43 @@ func ReadPassword(fd int) ([]byte, error) { // restored. // see http://cr.illumos.org/~webrev/andy_js/1060/ func MakeRaw(fd int) (*State, error) { - oldTermiosPtr, err := unix.IoctlGetTermios(fd, unix.TCGETS) + termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) if err != nil { return nil, err } - oldTermios := *oldTermiosPtr - newTermios := oldTermios - newTermios.Iflag &^= syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | syscall.ICRNL | syscall.IXON - newTermios.Oflag &^= syscall.OPOST - newTermios.Lflag &^= syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG | syscall.IEXTEN - newTermios.Cflag &^= syscall.CSIZE | syscall.PARENB - newTermios.Cflag |= syscall.CS8 - newTermios.Cc[unix.VMIN] = 1 - newTermios.Cc[unix.VTIME] = 0 + oldState := State{termios: *termios} - if err := unix.IoctlSetTermios(fd, unix.TCSETS, &newTermios); err != nil { + termios.Iflag &^= unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON + termios.Oflag &^= unix.OPOST + termios.Lflag &^= unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN + termios.Cflag &^= unix.CSIZE | unix.PARENB + termios.Cflag |= unix.CS8 + termios.Cc[unix.VMIN] = 1 + termios.Cc[unix.VTIME] = 0 + + if err := unix.IoctlSetTermios(fd, unix.TCSETS, termios); err != nil { return nil, err } - return &State{ - state: oldTermiosPtr, - }, nil + return &oldState, nil } // Restore restores the terminal connected to the given file descriptor to a // previous state. func Restore(fd int, oldState *State) error { - return unix.IoctlSetTermios(fd, unix.TCSETS, oldState.state) + return unix.IoctlSetTermios(fd, unix.TCSETS, &oldState.termios) } // GetState returns the current state of a terminal which may be useful to // restore the terminal after a signal. func GetState(fd int) (*State, error) { - oldTermiosPtr, err := unix.IoctlGetTermios(fd, unix.TCGETS) + termios, err := unix.IoctlGetTermios(fd, unix.TCGETS) if err != nil { return nil, err } - return &State{ - state: oldTermiosPtr, - }, nil + return &State{termios: *termios}, nil } // GetSize returns the dimensions of the given terminal. diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go index 92944f3..8618955 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go @@ -89,9 +89,15 @@ func ReadPassword(fd int) ([]byte, error) { return nil, err } - defer func() { - windows.SetConsoleMode(windows.Handle(fd), old) - }() + defer windows.SetConsoleMode(windows.Handle(fd), old) - return readPasswordLine(os.NewFile(uintptr(fd), "stdin")) + var h windows.Handle + p, _ := windows.GetCurrentProcess() + if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil { + return nil, err + } + + f := os.NewFile(uintptr(h), "stdin") + defer f.Close() + return readPasswordLine(f) } diff --git a/vendor/golang.org/x/crypto/ssh/test/multi_auth_test.go b/vendor/golang.org/x/crypto/ssh/test/multi_auth_test.go new file mode 100644 index 0000000..f594d36 --- /dev/null +++ b/vendor/golang.org/x/crypto/ssh/test/multi_auth_test.go @@ -0,0 +1,144 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Tests for ssh client multi-auth +// +// These tests run a simple go ssh client against OpenSSH server +// over unix domain sockets. The tests use multiple combinations +// of password, keyboard-interactive and publickey authentication +// methods. +// +// A wrapper library for making sshd PAM authentication use test +// passwords is required in ./sshd_test_pw.so. If the library does +// not exist these tests will be skipped. See compile instructions +// (for linux) in file ./sshd_test_pw.c. + +// +build linux + +package test + +import ( + "fmt" + "strings" + "testing" + + "golang.org/x/crypto/ssh" +) + +// test cases +type multiAuthTestCase struct { + authMethods []string + expectedPasswordCbs int + expectedKbdIntCbs int +} + +// test context +type multiAuthTestCtx struct { + password string + numPasswordCbs int + numKbdIntCbs int +} + +// create test context +func newMultiAuthTestCtx(t *testing.T) *multiAuthTestCtx { + password, err := randomPassword() + if err != nil { + t.Fatalf("Failed to generate random test password: %s", err.Error()) + } + + return &multiAuthTestCtx{ + password: password, + } +} + +// password callback +func (ctx *multiAuthTestCtx) passwordCb() (secret string, err error) { + ctx.numPasswordCbs++ + return ctx.password, nil +} + +// keyboard-interactive callback +func (ctx *multiAuthTestCtx) kbdIntCb(user, instruction string, questions []string, echos []bool) (answers []string, err error) { + if len(questions) == 0 { + return nil, nil + } + + ctx.numKbdIntCbs++ + if len(questions) == 1 { + return []string{ctx.password}, nil + } + + return nil, fmt.Errorf("unsupported keyboard-interactive flow") +} + +// TestMultiAuth runs several subtests for different combinations of password, keyboard-interactive and publickey authentication methods +func TestMultiAuth(t *testing.T) { + testCases := []multiAuthTestCase{ + // Test password,publickey authentication, assert that password callback is called 1 time + multiAuthTestCase{ + authMethods: []string{"password", "publickey"}, + expectedPasswordCbs: 1, + }, + // Test keyboard-interactive,publickey authentication, assert that keyboard-interactive callback is called 1 time + multiAuthTestCase{ + authMethods: []string{"keyboard-interactive", "publickey"}, + expectedKbdIntCbs: 1, + }, + // Test publickey,password authentication, assert that password callback is called 1 time + multiAuthTestCase{ + authMethods: []string{"publickey", "password"}, + expectedPasswordCbs: 1, + }, + // Test publickey,keyboard-interactive authentication, assert that keyboard-interactive callback is called 1 time + multiAuthTestCase{ + authMethods: []string{"publickey", "keyboard-interactive"}, + expectedKbdIntCbs: 1, + }, + // Test password,password authentication, assert that password callback is called 2 times + multiAuthTestCase{ + authMethods: []string{"password", "password"}, + expectedPasswordCbs: 2, + }, + } + + for _, testCase := range testCases { + t.Run(strings.Join(testCase.authMethods, ","), func(t *testing.T) { + ctx := newMultiAuthTestCtx(t) + + server := newServerForConfig(t, "MultiAuth", map[string]string{"AuthMethods": strings.Join(testCase.authMethods, ",")}) + defer server.Shutdown() + + clientConfig := clientConfig() + server.setTestPassword(clientConfig.User, ctx.password) + + publicKeyAuthMethod := clientConfig.Auth[0] + clientConfig.Auth = nil + for _, authMethod := range testCase.authMethods { + switch authMethod { + case "publickey": + clientConfig.Auth = append(clientConfig.Auth, publicKeyAuthMethod) + case "password": + clientConfig.Auth = append(clientConfig.Auth, + ssh.RetryableAuthMethod(ssh.PasswordCallback(ctx.passwordCb), 5)) + case "keyboard-interactive": + clientConfig.Auth = append(clientConfig.Auth, + ssh.RetryableAuthMethod(ssh.KeyboardInteractive(ctx.kbdIntCb), 5)) + default: + t.Fatalf("Unknown authentication method %s", authMethod) + } + } + + conn := server.Dial(clientConfig) + defer conn.Close() + + if ctx.numPasswordCbs != testCase.expectedPasswordCbs { + t.Fatalf("passwordCallback was called %d times, expected %d times", ctx.numPasswordCbs, testCase.expectedPasswordCbs) + } + + if ctx.numKbdIntCbs != testCase.expectedKbdIntCbs { + t.Fatalf("keyboardInteractiveCallback was called %d times, expected %d times", ctx.numKbdIntCbs, testCase.expectedKbdIntCbs) + } + }) + } +} diff --git a/vendor/golang.org/x/crypto/ssh/test/session_test.go b/vendor/golang.org/x/crypto/ssh/test/session_test.go index 7588b0c..4eb7afd 100644 --- a/vendor/golang.org/x/crypto/ssh/test/session_test.go +++ b/vendor/golang.org/x/crypto/ssh/test/session_test.go @@ -11,6 +11,7 @@ package test import ( "bytes" "errors" + "fmt" "io" "strings" "testing" @@ -324,6 +325,42 @@ func TestWindowChange(t *testing.T) { } } +func testOneCipher(t *testing.T, cipher string, cipherOrder []string) { + server := newServer(t) + defer server.Shutdown() + conf := clientConfig() + conf.Ciphers = []string{cipher} + // Don't fail if sshd doesn't have the cipher. + conf.Ciphers = append(conf.Ciphers, cipherOrder...) + conn, err := server.TryDial(conf) + if err != nil { + t.Fatalf("TryDial: %v", err) + } + defer conn.Close() + + numBytes := 4096 + + // Exercise sending data to the server + if _, _, err := conn.Conn.SendRequest("drop-me", false, make([]byte, numBytes)); err != nil { + t.Fatalf("SendRequest: %v", err) + } + + // Exercise receiving data from the server + session, err := conn.NewSession() + if err != nil { + t.Fatalf("NewSession: %v", err) + } + + out, err := session.Output(fmt.Sprintf("dd if=/dev/zero of=/dev/stdout bs=%d count=1", numBytes)) + if err != nil { + t.Fatalf("Output: %v", err) + } + + if len(out) != numBytes { + t.Fatalf("got %d bytes, want %d bytes", len(out), numBytes) + } +} + var deprecatedCiphers = []string{ "aes128-cbc", "3des-cbc", "arcfour128", "arcfour256", @@ -336,21 +373,11 @@ func TestCiphers(t *testing.T) { for _, ciph := range cipherOrder { t.Run(ciph, func(t *testing.T) { - server := newServer(t) - defer server.Shutdown() - conf := clientConfig() - conf.Ciphers = []string{ciph} - // Don't fail if sshd doesn't have the cipher. - conf.Ciphers = append(conf.Ciphers, cipherOrder...) - conn, err := server.TryDial(conf) - if err == nil { - conn.Close() - } else { - t.Fatalf("failed for cipher %q", ciph) - } + testOneCipher(t, ciph, cipherOrder) }) } } + func TestMACs(t *testing.T) { var config ssh.Config config.SetDefaults() diff --git a/vendor/golang.org/x/crypto/ssh/test/sshd_test_pw.c b/vendor/golang.org/x/crypto/ssh/test/sshd_test_pw.c new file mode 100644 index 0000000..2794a56 --- /dev/null +++ b/vendor/golang.org/x/crypto/ssh/test/sshd_test_pw.c @@ -0,0 +1,173 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// sshd_test_pw.c +// Wrapper to inject test password data for sshd PAM authentication +// +// This wrapper implements custom versions of getpwnam, getpwnam_r, +// getspnam and getspnam_r. These functions first call their real +// libc versions, then check if the requested user matches test user +// specified in env variable TEST_USER and if so replace the password +// with crypted() value of TEST_PASSWD env variable. +// +// Compile: +// gcc -Wall -shared -o sshd_test_pw.so -fPIC sshd_test_pw.c +// +// Compile with debug: +// gcc -DVERBOSE -Wall -shared -o sshd_test_pw.so -fPIC sshd_test_pw.c +// +// Run sshd: +// LD_PRELOAD="sshd_test_pw.so" TEST_USER="..." TEST_PASSWD="..." sshd ... + +// +build ignore + +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +#ifdef VERBOSE +#define DEBUG(X...) fprintf(stderr, X) +#else +#define DEBUG(X...) while (0) { } +#endif + +/* crypt() password */ +static char * +pwhash(char *passwd) { + return strdup(crypt(passwd, "$6$")); +} + +/* Pointers to real functions in libc */ +static struct passwd * (*real_getpwnam)(const char *) = NULL; +static int (*real_getpwnam_r)(const char *, struct passwd *, char *, size_t, struct passwd **) = NULL; +static struct spwd * (*real_getspnam)(const char *) = NULL; +static int (*real_getspnam_r)(const char *, struct spwd *, char *, size_t, struct spwd **) = NULL; + +/* Cached test user and test password */ +static char *test_user = NULL; +static char *test_passwd_hash = NULL; + +static void +init(void) { + /* Fetch real libc function pointers */ + real_getpwnam = dlsym(RTLD_NEXT, "getpwnam"); + real_getpwnam_r = dlsym(RTLD_NEXT, "getpwnam_r"); + real_getspnam = dlsym(RTLD_NEXT, "getspnam"); + real_getspnam_r = dlsym(RTLD_NEXT, "getspnam_r"); + + /* abort if env variables are not defined */ + if (getenv("TEST_USER") == NULL || getenv("TEST_PASSWD") == NULL) { + fprintf(stderr, "env variables TEST_USER and TEST_PASSWD are missing\n"); + abort(); + } + + /* Fetch test user and test password from env */ + test_user = strdup(getenv("TEST_USER")); + test_passwd_hash = pwhash(getenv("TEST_PASSWD")); + + DEBUG("sshd_test_pw init():\n"); + DEBUG("\treal_getpwnam: %p\n", real_getpwnam); + DEBUG("\treal_getpwnam_r: %p\n", real_getpwnam_r); + DEBUG("\treal_getspnam: %p\n", real_getspnam); + DEBUG("\treal_getspnam_r: %p\n", real_getspnam_r); + DEBUG("\tTEST_USER: '%s'\n", test_user); + DEBUG("\tTEST_PASSWD: '%s'\n", getenv("TEST_PASSWD")); + DEBUG("\tTEST_PASSWD_HASH: '%s'\n", test_passwd_hash); +} + +static int +is_test_user(const char *name) { + if (test_user != NULL && strcmp(test_user, name) == 0) + return 1; + return 0; +} + +/* getpwnam */ + +struct passwd * +getpwnam(const char *name) { + struct passwd *pw; + + DEBUG("sshd_test_pw getpwnam(%s)\n", name); + + if (real_getpwnam == NULL) + init(); + if ((pw = real_getpwnam(name)) == NULL) + return NULL; + + if (is_test_user(name)) + pw->pw_passwd = strdup(test_passwd_hash); + + return pw; +} + +/* getpwnam_r */ + +int +getpwnam_r(const char *name, + struct passwd *pwd, + char *buf, + size_t buflen, + struct passwd **result) { + int r; + + DEBUG("sshd_test_pw getpwnam_r(%s)\n", name); + + if (real_getpwnam_r == NULL) + init(); + if ((r = real_getpwnam_r(name, pwd, buf, buflen, result)) != 0 || *result == NULL) + return r; + + if (is_test_user(name)) + pwd->pw_passwd = strdup(test_passwd_hash); + + return 0; +} + +/* getspnam */ + +struct spwd * +getspnam(const char *name) { + struct spwd *sp; + + DEBUG("sshd_test_pw getspnam(%s)\n", name); + + if (real_getspnam == NULL) + init(); + if ((sp = real_getspnam(name)) == NULL) + return NULL; + + if (is_test_user(name)) + sp->sp_pwdp = strdup(test_passwd_hash); + + return sp; +} + +/* getspnam_r */ + +int +getspnam_r(const char *name, + struct spwd *spbuf, + char *buf, + size_t buflen, + struct spwd **spbufp) { + int r; + + DEBUG("sshd_test_pw getspnam_r(%s)\n", name); + + if (real_getspnam_r == NULL) + init(); + if ((r = real_getspnam_r(name, spbuf, buf, buflen, spbufp)) != 0) + return r; + + if (is_test_user(name)) + spbuf->sp_pwdp = strdup(test_passwd_hash); + + return r; +} diff --git a/vendor/golang.org/x/crypto/ssh/test/test_unix_test.go b/vendor/golang.org/x/crypto/ssh/test/test_unix_test.go index 15b879d..3960786 100644 --- a/vendor/golang.org/x/crypto/ssh/test/test_unix_test.go +++ b/vendor/golang.org/x/crypto/ssh/test/test_unix_test.go @@ -10,6 +10,8 @@ package test import ( "bytes" + "crypto/rand" + "encoding/base64" "fmt" "io/ioutil" "log" @@ -25,7 +27,8 @@ import ( "golang.org/x/crypto/ssh/testdata" ) -const sshdConfig = ` +const ( + defaultSshdConfig = ` Protocol 2 Banner {{.Dir}}/banner HostKey {{.Dir}}/id_rsa @@ -50,8 +53,17 @@ RhostsRSAAuthentication no HostbasedAuthentication no PubkeyAcceptedKeyTypes=* ` + multiAuthSshdConfigTail = ` +UsePAM yes +PasswordAuthentication yes +ChallengeResponseAuthentication yes +AuthenticationMethods {{.AuthMethods}} +` +) -var configTmpl = template.Must(template.New("").Parse(sshdConfig)) +var configTmpl = map[string]*template.Template{ + "default": template.Must(template.New("").Parse(defaultSshdConfig)), + "MultiAuth": template.Must(template.New("").Parse(defaultSshdConfig + multiAuthSshdConfigTail))} type server struct { t *testing.T @@ -60,6 +72,10 @@ type server struct { cmd *exec.Cmd output bytes.Buffer // holds stderr from sshd process + testUser string // test username for sshd + testPasswd string // test password for sshd + sshdTestPwSo string // dynamic library to inject a custom password into sshd + // Client half of the network connection. clientConn net.Conn } @@ -186,6 +202,20 @@ func (s *server) TryDialWithAddr(config *ssh.ClientConfig, addr string) (*ssh.Cl s.cmd.Stdin = f s.cmd.Stdout = f s.cmd.Stderr = &s.output + + if s.sshdTestPwSo != "" { + if s.testUser == "" { + s.t.Fatal("user missing from sshd_test_pw.so config") + } + if s.testPasswd == "" { + s.t.Fatal("password missing from sshd_test_pw.so config") + } + s.cmd.Env = append(os.Environ(), + fmt.Sprintf("LD_PRELOAD=%s", s.sshdTestPwSo), + fmt.Sprintf("TEST_USER=%s", s.testUser), + fmt.Sprintf("TEST_PASSWD=%s", s.testPasswd)) + } + if err := s.cmd.Start(); err != nil { s.t.Fail() s.Shutdown() @@ -236,8 +266,39 @@ func writeFile(path string, contents []byte) { } } +// generate random password +func randomPassword() (string, error) { + b := make([]byte, 12) + _, err := rand.Read(b) + if err != nil { + return "", err + } + return base64.RawURLEncoding.EncodeToString(b), nil +} + +// setTestPassword is used for setting user and password data for sshd_test_pw.so +// This function also checks that ./sshd_test_pw.so exists and if not calls s.t.Skip() +func (s *server) setTestPassword(user, passwd string) error { + wd, _ := os.Getwd() + wrapper := filepath.Join(wd, "sshd_test_pw.so") + if _, err := os.Stat(wrapper); err != nil { + s.t.Skip(fmt.Errorf("sshd_test_pw.so is not available")) + return err + } + + s.sshdTestPwSo = wrapper + s.testUser = user + s.testPasswd = passwd + return nil +} + // newServer returns a new mock ssh server. func newServer(t *testing.T) *server { + return newServerForConfig(t, "default", map[string]string{}) +} + +// newServerForConfig returns a new mock ssh server. +func newServerForConfig(t *testing.T, config string, configVars map[string]string) *server { if testing.Short() { t.Skip("skipping test due to -short") } @@ -249,9 +310,11 @@ func newServer(t *testing.T) *server { if err != nil { t.Fatal(err) } - err = configTmpl.Execute(f, map[string]string{ - "Dir": dir, - }) + if _, ok := configTmpl[config]; ok == false { + t.Fatal(fmt.Errorf("Invalid server config '%s'", config)) + } + configVars["Dir"] = dir + err = configTmpl[config].Execute(f, configVars) if err != nil { t.Fatal(err) } diff --git a/vendor/golang.org/x/crypto/xtea/block.go b/vendor/golang.org/x/crypto/xtea/block.go index bf5d245..fcb4e4d 100644 --- a/vendor/golang.org/x/crypto/xtea/block.go +++ b/vendor/golang.org/x/crypto/xtea/block.go @@ -50,7 +50,7 @@ func encryptBlock(c *Cipher, dst, src []byte) { uint32ToBlock(v0, v1, dst) } -// decryptBlock decrypt a single 8 byte block using XTEA. +// decryptBlock decrypts a single 8 byte block using XTEA. func decryptBlock(c *Cipher, dst, src []byte) { v0, v1 := blockToUint32(src) diff --git a/vendor/golang.org/x/crypto/xtea/cipher.go b/vendor/golang.org/x/crypto/xtea/cipher.go index 66ea0df..1661cbe 100644 --- a/vendor/golang.org/x/crypto/xtea/cipher.go +++ b/vendor/golang.org/x/crypto/xtea/cipher.go @@ -14,8 +14,8 @@ import "strconv" const BlockSize = 8 // A Cipher is an instance of an XTEA cipher using a particular key. -// table contains a series of precalculated values that are used each round. type Cipher struct { + // table contains a series of precalculated values that are used each round. table [64]uint32 } @@ -54,7 +54,7 @@ func (c *Cipher) BlockSize() int { return BlockSize } // instead, use an encryption mode like CBC (see crypto/cipher/cbc.go). func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c, dst, src) } -// Decrypt decrypts the 8 byte buffer src using the key k and stores the result in dst. +// Decrypt decrypts the 8 byte buffer src using the key and stores the result in dst. func (c *Cipher) Decrypt(dst, src []byte) { decryptBlock(c, dst, src) } // initCipher initializes the cipher context by creating a look up table diff --git a/vendor/golang.org/x/net/CONTRIBUTING.md b/vendor/golang.org/x/net/CONTRIBUTING.md index 88dff59..d0485e8 100644 --- a/vendor/golang.org/x/net/CONTRIBUTING.md +++ b/vendor/golang.org/x/net/CONTRIBUTING.md @@ -4,16 +4,15 @@ Go is an open source project. It is the work of hundreds of contributors. We appreciate your help! - ## Filing issues When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: -1. What version of Go are you using (`go version`)? -2. What operating system and processor architecture are you using? -3. What did you do? -4. What did you expect to see? -5. What did you see instead? +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. The gophers there will answer or ask you to file an issue if you've tripped over a bug. @@ -23,9 +22,5 @@ The gophers there will answer or ask you to file an issue if you've tripped over Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) before sending patches. -**We do not accept GitHub pull requests** -(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). - Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. - diff --git a/vendor/golang.org/x/net/bpf/instructions.go b/vendor/golang.org/x/net/bpf/instructions.go index 3b4fd08..f9dc0e8 100644 --- a/vendor/golang.org/x/net/bpf/instructions.go +++ b/vendor/golang.org/x/net/bpf/instructions.go @@ -198,7 +198,7 @@ func (a LoadConstant) Assemble() (RawInstruction, error) { return assembleLoad(a.Dst, 4, opAddrModeImmediate, a.Val) } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a LoadConstant) String() string { switch a.Dst { case RegA: @@ -224,7 +224,7 @@ func (a LoadScratch) Assemble() (RawInstruction, error) { return assembleLoad(a.Dst, 4, opAddrModeScratch, uint32(a.N)) } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a LoadScratch) String() string { switch a.Dst { case RegA: @@ -248,7 +248,7 @@ func (a LoadAbsolute) Assemble() (RawInstruction, error) { return assembleLoad(RegA, a.Size, opAddrModeAbsolute, a.Off) } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a LoadAbsolute) String() string { switch a.Size { case 1: // byte @@ -277,7 +277,7 @@ func (a LoadIndirect) Assemble() (RawInstruction, error) { return assembleLoad(RegA, a.Size, opAddrModeIndirect, a.Off) } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a LoadIndirect) String() string { switch a.Size { case 1: // byte @@ -306,7 +306,7 @@ func (a LoadMemShift) Assemble() (RawInstruction, error) { return assembleLoad(RegX, 1, opAddrModeMemShift, a.Off) } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a LoadMemShift) String() string { return fmt.Sprintf("ldx 4*([%d]&0xf)", a.Off) } @@ -325,7 +325,7 @@ func (a LoadExtension) Assemble() (RawInstruction, error) { return assembleLoad(RegA, 4, opAddrModeAbsolute, uint32(extOffset+a.Num)) } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a LoadExtension) String() string { switch a.Num { case ExtLen: @@ -392,7 +392,7 @@ func (a StoreScratch) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a StoreScratch) String() string { switch a.Src { case RegA: @@ -418,7 +418,7 @@ func (a ALUOpConstant) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a ALUOpConstant) String() string { switch a.Op { case ALUOpAdd: @@ -458,7 +458,7 @@ func (a ALUOpX) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a ALUOpX) String() string { switch a.Op { case ALUOpAdd: @@ -496,7 +496,7 @@ func (a NegateA) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a NegateA) String() string { return fmt.Sprintf("neg") } @@ -514,7 +514,7 @@ func (a Jump) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a Jump) String() string { return fmt.Sprintf("ja %d", a.Skip) } @@ -566,7 +566,7 @@ func (a JumpIf) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a JumpIf) String() string { switch a.Cond { // K == A @@ -621,7 +621,7 @@ func (a RetA) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a RetA) String() string { return fmt.Sprintf("ret a") } @@ -639,7 +639,7 @@ func (a RetConstant) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a RetConstant) String() string { return fmt.Sprintf("ret #%d", a.Val) } @@ -654,7 +654,7 @@ func (a TXA) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a TXA) String() string { return fmt.Sprintf("txa") } @@ -669,7 +669,7 @@ func (a TAX) Assemble() (RawInstruction, error) { }, nil } -// String returns the the instruction in assembler notation. +// String returns the instruction in assembler notation. func (a TAX) String() string { return fmt.Sprintf("tax") } diff --git a/vendor/golang.org/x/net/dns/dnsmessage/example_test.go b/vendor/golang.org/x/net/dns/dnsmessage/example_test.go index 5415c2d..8600a6b 100644 --- a/vendor/golang.org/x/net/dns/dnsmessage/example_test.go +++ b/vendor/golang.org/x/net/dns/dnsmessage/example_test.go @@ -37,20 +37,20 @@ func ExampleParser() { }, Answers: []dnsmessage.Resource{ { - dnsmessage.ResourceHeader{ + Header: dnsmessage.ResourceHeader{ Name: mustNewName("foo.bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET, }, - &dnsmessage.AResource{[4]byte{127, 0, 0, 1}}, + Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 1}}, }, { - dnsmessage.ResourceHeader{ + Header: dnsmessage.ResourceHeader{ Name: mustNewName("bar.example.com."), Type: dnsmessage.TypeA, Class: dnsmessage.ClassINET, }, - &dnsmessage.AResource{[4]byte{127, 0, 0, 2}}, + Body: &dnsmessage.AResource{A: [4]byte{127, 0, 0, 2}}, }, }, } diff --git a/vendor/golang.org/x/net/dns/dnsmessage/message.go b/vendor/golang.org/x/net/dns/dnsmessage/message.go index ea94bd4..38f8177 100644 --- a/vendor/golang.org/x/net/dns/dnsmessage/message.go +++ b/vendor/golang.org/x/net/dns/dnsmessage/message.go @@ -5,6 +5,9 @@ // Package dnsmessage provides a mostly RFC 1035 compliant implementation of // DNS message packing and unpacking. // +// The package also supports messages with Extension Mechanisms for DNS +// (EDNS(0)) as defined in RFC 6891. +// // This implementation is designed to minimize heap allocations and avoid // unnecessary packing and unpacking as much as possible. package dnsmessage @@ -39,6 +42,7 @@ const ( TypeTXT Type = 16 TypeAAAA Type = 28 TypeSRV Type = 33 + TypeOPT Type = 41 // Question.Type TypeWKS Type = 11 @@ -90,6 +94,8 @@ var ( errTooManyAuthorities = errors.New("too many Authorities to pack (>65535)") errTooManyAdditionals = errors.New("too many Additionals to pack (>65535)") errNonCanonicalName = errors.New("name is not in canonical format (it must end with a .)") + errStringTooLong = errors.New("character string exceeds maximum length (255)") + errCompressedSRV = errors.New("compressed name in SRV resource data") ) // Internal constants. @@ -218,6 +224,7 @@ func (h *header) count(sec section) uint16 { return 0 } +// pack appends the wire format of the header to msg. func (h *header) pack(msg []byte) []byte { msg = packUint16(msg, h.id) msg = packUint16(msg, h.bits) @@ -273,25 +280,26 @@ type Resource struct { // A ResourceBody is a DNS resource record minus the header. type ResourceBody interface { // pack packs a Resource except for its header. - pack(msg []byte, compression map[string]int) ([]byte, error) + pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) // realType returns the actual type of the Resource. This is used to // fill in the header Type field. realType() Type } -func (r *Resource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the Resource to msg. +func (r *Resource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { if r.Body == nil { return msg, errNilResouceBody } oldMsg := msg r.Header.Type = r.Body.realType() - msg, length, err := r.Header.pack(msg, compression) + msg, length, err := r.Header.pack(msg, compression, compressionOff) if err != nil { return msg, &nestedError{"ResourceHeader", err} } preLen := len(msg) - msg, err = r.Body.pack(msg, compression) + msg, err = r.Body.pack(msg, compression, compressionOff) if err != nil { return msg, &nestedError{"content", err} } @@ -436,7 +444,13 @@ func (p *Parser) Question() (Question, error) { // AllQuestions parses all Questions. func (p *Parser) AllQuestions() ([]Question, error) { - qs := make([]Question, 0, p.header.questions) + // Multiple questions are valid according to the spec, + // but servers don't actually support them. There will + // be at most one question here. + // + // Do not pre-allocate based on info in p.header, since + // the data is untrusted. + qs := []Question{} for { q, err := p.Question() if err == ErrSectionDone { @@ -492,7 +506,16 @@ func (p *Parser) Answer() (Resource, error) { // AllAnswers parses all Answer Resources. func (p *Parser) AllAnswers() ([]Resource, error) { - as := make([]Resource, 0, p.header.answers) + // The most common query is for A/AAAA, which usually returns + // a handful of IPs. + // + // Pre-allocate up to a certain limit, since p.header is + // untrusted data. + n := int(p.header.answers) + if n > 20 { + n = 20 + } + as := make([]Resource, 0, n) for { a, err := p.Answer() if err == ErrSectionDone { @@ -533,7 +556,16 @@ func (p *Parser) Authority() (Resource, error) { // AllAuthorities parses all Authority Resources. func (p *Parser) AllAuthorities() ([]Resource, error) { - as := make([]Resource, 0, p.header.authorities) + // Authorities contains SOA in case of NXDOMAIN and friends, + // otherwise it is empty. + // + // Pre-allocate up to a certain limit, since p.header is + // untrusted data. + n := int(p.header.authorities) + if n > 10 { + n = 10 + } + as := make([]Resource, 0, n) for { a, err := p.Authority() if err == ErrSectionDone { @@ -574,7 +606,16 @@ func (p *Parser) Additional() (Resource, error) { // AllAdditionals parses all Additional Resources. func (p *Parser) AllAdditionals() ([]Resource, error) { - as := make([]Resource, 0, p.header.additionals) + // Additionals usually contain OPT, and sometimes A/AAAA + // glue records. + // + // Pre-allocate up to a certain limit, since p.header is + // untrusted data. + n := int(p.header.additionals) + if n > 10 { + n = 10 + } + as := make([]Resource, 0, n) for { a, err := p.Additional() if err == ErrSectionDone { @@ -765,6 +806,24 @@ func (p *Parser) AAAAResource() (AAAAResource, error) { return r, nil } +// OPTResource parses a single OPTResource. +// +// One of the XXXHeader methods must have been called before calling this +// method. +func (p *Parser) OPTResource() (OPTResource, error) { + if !p.resHeaderValid || p.resHeader.Type != TypeOPT { + return OPTResource{}, ErrNotStarted + } + r, err := unpackOPTResource(p.msg, p.off, p.resHeader.Length) + if err != nil { + return OPTResource{}, err + } + p.off += int(p.resHeader.Length) + p.resHeaderValid = false + p.index++ + return r, nil +} + // Unpack parses a full Message. func (m *Message) Unpack(msg []byte) error { var p Parser @@ -819,6 +878,7 @@ func (m *Message) AppendPack(b []byte) ([]byte, error) { h.authorities = uint16(len(m.Authorities)) h.additionals = uint16(len(m.Additionals)) + compressionOff := len(b) msg := h.pack(b) // RFC 1035 allows (but does not require) compression for packing. RFC @@ -833,25 +893,25 @@ func (m *Message) AppendPack(b []byte) ([]byte, error) { for i := range m.Questions { var err error - if msg, err = m.Questions[i].pack(msg, compression); err != nil { + if msg, err = m.Questions[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Question", err} } } for i := range m.Answers { var err error - if msg, err = m.Answers[i].pack(msg, compression); err != nil { + if msg, err = m.Answers[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Answer", err} } } for i := range m.Authorities { var err error - if msg, err = m.Authorities[i].pack(msg, compression); err != nil { + if msg, err = m.Authorities[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Authority", err} } } for i := range m.Additionals { var err error - if msg, err = m.Additionals[i].pack(msg, compression); err != nil { + if msg, err = m.Additionals[i].pack(msg, compression, compressionOff); err != nil { return nil, &nestedError{"packing Additional", err} } } @@ -860,36 +920,69 @@ func (m *Message) AppendPack(b []byte) ([]byte, error) { } // A Builder allows incrementally packing a DNS message. +// +// Example usage: +// buf := make([]byte, 2, 514) +// b := NewBuilder(buf, Header{...}) +// b.EnableCompression() +// // Optionally start a section and add things to that section. +// // Repeat adding sections as necessary. +// buf, err := b.Finish() +// // If err is nil, buf[2:] will contain the built bytes. type Builder struct { - msg []byte - header header - section section + // msg is the storage for the message being built. + msg []byte + + // section keeps track of the current section being built. + section section + + // header keeps track of what should go in the header when Finish is + // called. + header header + + // start is the starting index of the bytes allocated in msg for header. + start int + + // compression is a mapping from name suffixes to their starting index + // in msg. compression map[string]int } -// Start initializes the builder. +// NewBuilder creates a new builder with compression disabled. // -// buf is optional (nil is fine), but if provided, Start takes ownership of buf. -func (b *Builder) Start(buf []byte, h Header) { - b.StartWithoutCompression(buf, h) - b.compression = map[string]int{} +// Note: Most users will want to immediately enable compression with the +// EnableCompression method. See that method's comment for why you may or may +// not want to enable compression. +// +// The DNS message is appended to the provided initial buffer buf (which may be +// nil) as it is built. The final message is returned by the (*Builder).Finish +// method, which may return the same underlying array if there was sufficient +// capacity in the slice. +func NewBuilder(buf []byte, h Header) Builder { + if buf == nil { + buf = make([]byte, 0, packStartingCap) + } + b := Builder{msg: buf, start: len(buf)} + b.header.id, b.header.bits = h.pack() + var hb [headerLen]byte + b.msg = append(b.msg, hb[:]...) + b.section = sectionHeader + return b } -// StartWithoutCompression initializes the builder with compression disabled. +// EnableCompression enables compression in the Builder. // -// This avoids compression related allocations, but can result in larger message -// sizes. Be careful with this mode as it can cause messages to exceed the UDP -// size limit. +// Leaving compression disabled avoids compression related allocations, but can +// result in larger message sizes. Be careful with this mode as it can cause +// messages to exceed the UDP size limit. // -// buf is optional (nil is fine), but if provided, Start takes ownership of buf. -func (b *Builder) StartWithoutCompression(buf []byte, h Header) { - *b = Builder{msg: buf} - b.header.id, b.header.bits = h.pack() - if cap(b.msg) < headerLen { - b.msg = make([]byte, 0, packStartingCap) - } - b.msg = b.msg[:headerLen] - b.section = sectionHeader +// According to RFC 1035, section 4.1.4, the use of compression is optional, but +// all implementations must accept both compressed and uncompressed DNS +// messages. +// +// Compression should be enabled before any sections are added for best results. +func (b *Builder) EnableCompression() { + b.compression = map[string]int{} } func (b *Builder) startCheck(s section) error { @@ -970,7 +1063,7 @@ func (b *Builder) Question(q Question) error { if b.section > sectionQuestions { return ErrSectionDone } - msg, err := q.pack(b.msg, b.compression) + msg, err := q.pack(b.msg, b.compression, b.start) if err != nil { return err } @@ -997,12 +1090,12 @@ func (b *Builder) CNAMEResource(h ResourceHeader, r CNAMEResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"CNAMEResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1021,12 +1114,12 @@ func (b *Builder) MXResource(h ResourceHeader, r MXResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"MXResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1045,12 +1138,12 @@ func (b *Builder) NSResource(h ResourceHeader, r NSResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"NSResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1069,12 +1162,12 @@ func (b *Builder) PTRResource(h ResourceHeader, r PTRResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"PTRResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1093,12 +1186,12 @@ func (b *Builder) SOAResource(h ResourceHeader, r SOAResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"SOAResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1117,12 +1210,12 @@ func (b *Builder) TXTResource(h ResourceHeader, r TXTResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"TXTResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1141,12 +1234,12 @@ func (b *Builder) SRVResource(h ResourceHeader, r SRVResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"SRVResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1165,12 +1258,12 @@ func (b *Builder) AResource(h ResourceHeader, r AResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"AResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1189,12 +1282,12 @@ func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error { return err } h.Type = r.realType() - msg, length, err := h.pack(b.msg, b.compression) + msg, length, err := h.pack(b.msg, b.compression, b.start) if err != nil { return &nestedError{"ResourceHeader", err} } preLen := len(msg) - if msg, err = r.pack(msg, b.compression); err != nil { + if msg, err = r.pack(msg, b.compression, b.start); err != nil { return &nestedError{"AAAAResource body", err} } if err := h.fixLen(msg, length, preLen); err != nil { @@ -1207,13 +1300,38 @@ func (b *Builder) AAAAResource(h ResourceHeader, r AAAAResource) error { return nil } +// OPTResource adds a single OPTResource. +func (b *Builder) OPTResource(h ResourceHeader, r OPTResource) error { + if err := b.checkResourceSection(); err != nil { + return err + } + h.Type = r.realType() + msg, length, err := h.pack(b.msg, b.compression, b.start) + if err != nil { + return &nestedError{"ResourceHeader", err} + } + preLen := len(msg) + if msg, err = r.pack(msg, b.compression, b.start); err != nil { + return &nestedError{"OPTResource body", err} + } + if err := h.fixLen(msg, length, preLen); err != nil { + return err + } + if err := b.incrementSectionCount(); err != nil { + return err + } + b.msg = msg + return nil +} + // Finish ends message building and generates a binary message. func (b *Builder) Finish() ([]byte, error) { if b.section < sectionHeader { return nil, ErrNotStarted } b.section = sectionDone - b.header.pack(b.msg[:0]) + // Space for the header was allocated in NewBuilder. + b.header.pack(b.msg[b.start:b.start]) return b.msg, nil } @@ -1243,12 +1361,13 @@ type ResourceHeader struct { Length uint16 } -// pack packs all of the fields in a ResourceHeader except for the length. The -// length bytes are returned as a slice so they can be filled in after the rest -// of the Resource has been packed. -func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]int) (msg []byte, length []byte, err error) { +// pack appends the wire format of the ResourceHeader to oldMsg. +// +// The bytes where length was packed are returned as a slice so they can be +// updated after the rest of the Resource has been packed. +func (h *ResourceHeader) pack(oldMsg []byte, compression map[string]int, compressionOff int) (msg []byte, length []byte, err error) { msg = oldMsg - if msg, err = h.Name.pack(msg, compression); err != nil { + if msg, err = h.Name.pack(msg, compression, compressionOff); err != nil { return oldMsg, nil, &nestedError{"Name", err} } msg = packType(msg, h.Type) @@ -1293,6 +1412,44 @@ func (h *ResourceHeader) fixLen(msg []byte, length []byte, preLen int) error { return nil } +// EDNS(0) wire costants. +const ( + edns0Version = 0 + + edns0DNSSECOK = 0x00008000 + ednsVersionMask = 0x00ff0000 + edns0DNSSECOKMask = 0x00ff8000 +) + +// SetEDNS0 configures h for EDNS(0). +// +// The provided extRCode must be an extedned RCode. +func (h *ResourceHeader) SetEDNS0(udpPayloadLen int, extRCode RCode, dnssecOK bool) error { + h.Name = Name{Data: [nameLen]byte{'.'}, Length: 1} // RFC 6891 section 6.1.2 + h.Type = TypeOPT + h.Class = Class(udpPayloadLen) + h.TTL = uint32(extRCode) >> 4 << 24 + if dnssecOK { + h.TTL |= edns0DNSSECOK + } + return nil +} + +// DNSSECAllowed reports whether the DNSSEC OK bit is set. +func (h *ResourceHeader) DNSSECAllowed() bool { + return h.TTL&edns0DNSSECOKMask == edns0DNSSECOK // RFC 6891 section 6.1.3 +} + +// ExtendedRCode returns an extended RCode. +// +// The provided rcode must be the RCode in DNS message header. +func (h *ResourceHeader) ExtendedRCode(rcode RCode) RCode { + if h.TTL&ednsVersionMask == edns0Version { // RFC 6891 section 6.1.3 + return RCode(h.TTL>>24<<4) | rcode + } + return rcode +} + func skipResource(msg []byte, off int) (int, error) { newOff, err := skipName(msg, off) if err != nil { @@ -1317,6 +1474,7 @@ func skipResource(msg []byte, off int) (int, error) { return newOff, nil } +// packUint16 appends the wire format of field to msg. func packUint16(msg []byte, field uint16) []byte { return append(msg, byte(field>>8), byte(field)) } @@ -1335,6 +1493,7 @@ func skipUint16(msg []byte, off int) (int, error) { return off + uint16Len, nil } +// packType appends the wire format of field to msg. func packType(msg []byte, field Type) []byte { return packUint16(msg, uint16(field)) } @@ -1348,6 +1507,7 @@ func skipType(msg []byte, off int) (int, error) { return skipUint16(msg, off) } +// packClass appends the wire format of field to msg. func packClass(msg []byte, field Class) []byte { return packUint16(msg, uint16(field)) } @@ -1361,6 +1521,7 @@ func skipClass(msg []byte, off int) (int, error) { return skipUint16(msg, off) } +// packUint32 appends the wire format of field to msg. func packUint32(msg []byte, field uint32) []byte { return append( msg, @@ -1386,17 +1547,16 @@ func skipUint32(msg []byte, off int) (int, error) { return off + uint32Len, nil } -func packText(msg []byte, field string) []byte { - for len(field) > 0 { - l := len(field) - if l > 255 { - l = 255 - } - msg = append(msg, byte(l)) - msg = append(msg, field[:l]...) - field = field[l:] +// packText appends the wire format of field to msg. +func packText(msg []byte, field string) ([]byte, error) { + l := len(field) + if l > 255 { + return nil, errStringTooLong } - return msg + msg = append(msg, byte(l)) + msg = append(msg, field...) + + return msg, nil } func unpackText(msg []byte, off int) (string, int, error) { @@ -1422,6 +1582,7 @@ func skipText(msg []byte, off int) (int, error) { return endOff, nil } +// packBytes appends the wire format of field to msg. func packBytes(msg []byte, field []byte) []byte { return append(msg, field...) } @@ -1466,14 +1627,14 @@ func (n Name) String() string { return string(n.Data[:n.Length]) } -// pack packs a domain name. +// pack appends the wire format of the Name to msg. // // Domain names are a sequence of counted strings split at the dots. They end // with a zero-length string. Compression can be used to reuse domain suffixes. // // The compression map will be updated with new domain suffixes. If compression // is nil, compression will not be used. -func (n *Name) pack(msg []byte, compression map[string]int) ([]byte, error) { +func (n *Name) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg // Add a trailing dot to canonicalize name. @@ -1525,7 +1686,7 @@ func (n *Name) pack(msg []byte, compression map[string]int) ([]byte, error) { // Miss. Add the suffix to the compression table if the // offset can be stored in the available 14 bytes. if len(msg) <= int(^uint16(0)>>2) { - compression[string(n.Data[i:])] = len(msg) + compression[string(n.Data[i:])] = len(msg) - compressionOff } } } @@ -1534,6 +1695,10 @@ func (n *Name) pack(msg []byte, compression map[string]int) ([]byte, error) { // unpack unpacks a domain name. func (n *Name) unpack(msg []byte, off int) (int, error) { + return n.unpackCompressed(msg, off, true /* allowCompression */) +} + +func (n *Name) unpackCompressed(msg []byte, off int, allowCompression bool) (int, error) { // currOff is the current working offset. currOff := off @@ -1569,6 +1734,9 @@ Loop: name = append(name, '.') currOff = endOff case 0xC0: // Pointer + if !allowCompression { + return off, errCompressedSRV + } if currOff >= len(msg) { return off, errInvalidPtr } @@ -1648,8 +1816,9 @@ type Question struct { Class Class } -func (q *Question) pack(msg []byte, compression map[string]int) ([]byte, error) { - msg, err := q.Name.pack(msg, compression) +// pack appends the wire format of the Question to msg. +func (q *Question) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + msg, err := q.Name.pack(msg, compression, compressionOff) if err != nil { return msg, &nestedError{"Name", err} } @@ -1709,6 +1878,11 @@ func unpackResourceBody(msg []byte, off int, hdr ResourceHeader) (ResourceBody, rb, err = unpackSRVResource(msg, off) r = &rb name = "SRV" + case TypeOPT: + var rb OPTResource + rb, err = unpackOPTResource(msg, off, hdr.Length) + r = &rb + name = "OPT" } if err != nil { return nil, off, &nestedError{name + " record", err} @@ -1728,8 +1902,9 @@ func (r *CNAMEResource) realType() Type { return TypeCNAME } -func (r *CNAMEResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return r.CNAME.pack(msg, compression) +// pack appends the wire format of the CNAMEResource to msg. +func (r *CNAMEResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + return r.CNAME.pack(msg, compression, compressionOff) } func unpackCNAMEResource(msg []byte, off int) (CNAMEResource, error) { @@ -1750,10 +1925,11 @@ func (r *MXResource) realType() Type { return TypeMX } -func (r *MXResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the MXResource to msg. +func (r *MXResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg msg = packUint16(msg, r.Pref) - msg, err := r.MX.pack(msg, compression) + msg, err := r.MX.pack(msg, compression, compressionOff) if err != nil { return oldMsg, &nestedError{"MXResource.MX", err} } @@ -1781,8 +1957,9 @@ func (r *NSResource) realType() Type { return TypeNS } -func (r *NSResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return r.NS.pack(msg, compression) +// pack appends the wire format of the NSResource to msg. +func (r *NSResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + return r.NS.pack(msg, compression, compressionOff) } func unpackNSResource(msg []byte, off int) (NSResource, error) { @@ -1802,8 +1979,9 @@ func (r *PTRResource) realType() Type { return TypePTR } -func (r *PTRResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return r.PTR.pack(msg, compression) +// pack appends the wire format of the PTRResource to msg. +func (r *PTRResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + return r.PTR.pack(msg, compression, compressionOff) } func unpackPTRResource(msg []byte, off int) (PTRResource, error) { @@ -1833,13 +2011,14 @@ func (r *SOAResource) realType() Type { return TypeSOA } -func (r *SOAResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the SOAResource to msg. +func (r *SOAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg - msg, err := r.NS.pack(msg, compression) + msg, err := r.NS.pack(msg, compression, compressionOff) if err != nil { return oldMsg, &nestedError{"SOAResource.NS", err} } - msg, err = r.MBox.pack(msg, compression) + msg, err = r.MBox.pack(msg, compression, compressionOff) if err != nil { return oldMsg, &nestedError{"SOAResource.MBox", err} } @@ -1885,19 +2064,28 @@ func unpackSOAResource(msg []byte, off int) (SOAResource, error) { // A TXTResource is a TXT Resource record. type TXTResource struct { - Txt string // Not a domain name. + TXT []string } func (r *TXTResource) realType() Type { return TypeTXT } -func (r *TXTResource) pack(msg []byte, compression map[string]int) ([]byte, error) { - return packText(msg, r.Txt), nil +// pack appends the wire format of the TXTResource to msg. +func (r *TXTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + oldMsg := msg + for _, s := range r.TXT { + var err error + msg, err = packText(msg, s) + if err != nil { + return oldMsg, err + } + } + return msg, nil } func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) { - var txt string + txts := make([]string, 0, 1) for n := uint16(0); n < length; { var t string var err error @@ -1909,9 +2097,9 @@ func unpackTXTResource(msg []byte, off int, length uint16) (TXTResource, error) return TXTResource{}, errCalcLen } n += uint16(len(t)) + 1 - txt += t + txts = append(txts, t) } - return TXTResource{txt}, nil + return TXTResource{txts}, nil } // An SRVResource is an SRV Resource record. @@ -1926,12 +2114,13 @@ func (r *SRVResource) realType() Type { return TypeSRV } -func (r *SRVResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the SRVResource to msg. +func (r *SRVResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { oldMsg := msg msg = packUint16(msg, r.Priority) msg = packUint16(msg, r.Weight) msg = packUint16(msg, r.Port) - msg, err := r.Target.pack(msg, nil) + msg, err := r.Target.pack(msg, nil, compressionOff) if err != nil { return oldMsg, &nestedError{"SRVResource.Target", err} } @@ -1952,7 +2141,7 @@ func unpackSRVResource(msg []byte, off int) (SRVResource, error) { return SRVResource{}, &nestedError{"Port", err} } var target Name - if _, err := target.unpack(msg, off); err != nil { + if _, err := target.unpackCompressed(msg, off, false /* allowCompression */); err != nil { return SRVResource{}, &nestedError{"Target", err} } return SRVResource{priority, weight, port, target}, nil @@ -1967,7 +2156,8 @@ func (r *AResource) realType() Type { return TypeA } -func (r *AResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the AResource to msg. +func (r *AResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { return packBytes(msg, r.A[:]), nil } @@ -1988,7 +2178,8 @@ func (r *AAAAResource) realType() Type { return TypeAAAA } -func (r *AAAAResource) pack(msg []byte, compression map[string]int) ([]byte, error) { +// pack appends the wire format of the AAAAResource to msg. +func (r *AAAAResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { return packBytes(msg, r.AAAA[:]), nil } @@ -1999,3 +2190,58 @@ func unpackAAAAResource(msg []byte, off int) (AAAAResource, error) { } return AAAAResource{aaaa}, nil } + +// An OPTResource is an OPT pseudo Resource record. +// +// The pseudo resource record is part of the extension mechanisms for DNS +// as defined in RFC 6891. +type OPTResource struct { + Options []Option +} + +// An Option represents a DNS message option within OPTResource. +// +// The message option is part of the extension mechanisms for DNS as +// defined in RFC 6891. +type Option struct { + Code uint16 // option code + Data []byte +} + +func (r *OPTResource) realType() Type { + return TypeOPT +} + +func (r *OPTResource) pack(msg []byte, compression map[string]int, compressionOff int) ([]byte, error) { + for _, opt := range r.Options { + msg = packUint16(msg, opt.Code) + l := uint16(len(opt.Data)) + msg = packUint16(msg, l) + msg = packBytes(msg, opt.Data) + } + return msg, nil +} + +func unpackOPTResource(msg []byte, off int, length uint16) (OPTResource, error) { + var opts []Option + for oldOff := off; off < oldOff+int(length); { + var err error + var o Option + o.Code, off, err = unpackUint16(msg, off) + if err != nil { + return OPTResource{}, &nestedError{"Code", err} + } + var l uint16 + l, off, err = unpackUint16(msg, off) + if err != nil { + return OPTResource{}, &nestedError{"Data", err} + } + o.Data = make([]byte, l) + if copy(o.Data, msg[off:]) != int(l) { + return OPTResource{}, &nestedError{"Data", errCalcLen} + } + off += int(l) + opts = append(opts, o) + } + return OPTResource{opts}, nil +} diff --git a/vendor/golang.org/x/net/dns/dnsmessage/message_test.go b/vendor/golang.org/x/net/dns/dnsmessage/message_test.go index 2bb7634..7e4e4bd 100644 --- a/vendor/golang.org/x/net/dns/dnsmessage/message_test.go +++ b/vendor/golang.org/x/net/dns/dnsmessage/message_test.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "reflect" + "strings" "testing" ) @@ -19,6 +20,14 @@ func mustNewName(name string) Name { return n } +func mustEDNS0ResourceHeader(l int, extrc RCode, do bool) ResourceHeader { + h := ResourceHeader{Class: ClassINET} + if err := h.SetEDNS0(l, extrc, do); err != nil { + panic(err) + } + return h +} + func (m *Message) String() string { s := fmt.Sprintf("Message: %#v\n", &m.Header) if len(m.Questions) > 0 { @@ -62,9 +71,9 @@ func TestQuestionPackUnpack(t *testing.T) { Type: TypeA, Class: ClassINET, } - buf, err := want.pack(make([]byte, 1, 50), map[string]int{}) + buf, err := want.pack(make([]byte, 1, 50), map[string]int{}, 1) if err != nil { - t.Fatal("Packing failed:", err) + t.Fatal("Question.pack() =", err) } var p Parser p.msg = buf @@ -73,13 +82,13 @@ func TestQuestionPackUnpack(t *testing.T) { p.off = 1 got, err := p.Question() if err != nil { - t.Fatalf("Unpacking failed: %v\n%s", err, string(buf[1:])) + t.Fatalf("Parser{%q}.Question() = %v", string(buf[1:]), err) } if p.off != len(buf) { - t.Errorf("Unpacked different amount than packed: got n = %d, want = %d", p.off, len(buf)) + t.Errorf("unpacked different amount than packed: got = %d, want = %d", p.off, len(buf)) } if !reflect.DeepEqual(got, want) { - t.Errorf("Got = %+v, want = %+v", got, want) + t.Errorf("got from Parser.Question() = %+v, want = %+v", got, want) } } @@ -99,11 +108,11 @@ func TestName(t *testing.T) { for _, test := range tests { n, err := NewName(test) if err != nil { - t.Errorf("Creating name for %q: %v", test, err) + t.Errorf("NewName(%q) = %v", test, err) continue } if ns := n.String(); ns != test { - t.Errorf("Got %#v.String() = %q, want = %q", n, ns, test) + t.Errorf("got %#v.String() = %q, want = %q", n, ns, test) continue } } @@ -129,9 +138,9 @@ func TestNamePackUnpack(t *testing.T) { for _, test := range tests { in := mustNewName(test.in) want := mustNewName(test.want) - buf, err := in.pack(make([]byte, 0, 30), map[string]int{}) + buf, err := in.pack(make([]byte, 0, 30), map[string]int{}, 0) if err != test.err { - t.Errorf("Packing of %q: got err = %v, want err = %v", test.in, err, test.err) + t.Errorf("got %q.pack() = %v, want = %v", test.in, err, test.err) continue } if test.err != nil { @@ -140,23 +149,45 @@ func TestNamePackUnpack(t *testing.T) { var got Name n, err := got.unpack(buf, 0) if err != nil { - t.Errorf("Unpacking for %q failed: %v", test.in, err) + t.Errorf("%q.unpack() = %v", test.in, err) continue } if n != len(buf) { t.Errorf( - "Unpacked different amount than packed for %q: got n = %d, want = %d", + "unpacked different amount than packed for %q: got = %d, want = %d", test.in, n, len(buf), ) } if got != want { - t.Errorf("Unpacking packing of %q: got = %#v, want = %#v", test.in, got, want) + t.Errorf("unpacking packing of %q: got = %#v, want = %#v", test.in, got, want) } } } +func TestIncompressibleName(t *testing.T) { + name := mustNewName("example.com.") + compression := map[string]int{} + buf, err := name.pack(make([]byte, 0, 100), compression, 0) + if err != nil { + t.Fatal("first Name.pack() =", err) + } + buf, err = name.pack(buf, compression, 0) + if err != nil { + t.Fatal("second Name.pack() =", err) + } + var n1 Name + off, err := n1.unpackCompressed(buf, 0, false /* allowCompression */) + if err != nil { + t.Fatal("unpacking incompressible name without pointers failed:", err) + } + var n2 Name + if _, err := n2.unpackCompressed(buf, off, false /* allowCompression */); err != errCompressedSRV { + t.Errorf("unpacking compressed incompressible name with pointers: got %v, want = %v", err, errCompressedSRV) + } +} + func checkErrorPrefix(err error, prefix string) bool { e, ok := err.(*nestedError) return ok && e.s == prefix @@ -176,7 +207,7 @@ func TestHeaderUnpackError(t *testing.T) { for _, want := range wants { n, err := h.unpack(buf, 0) if n != 0 || !checkErrorPrefix(err, want) { - t.Errorf("got h.unpack([%d]byte, 0) = %d, %v, want = 0, %s", len(buf), n, err, want) + t.Errorf("got header.unpack([%d]byte, 0) = %d, %v, want = 0, %s", len(buf), n, err, want) } buf = append(buf, 0, 0) } @@ -188,7 +219,7 @@ func TestParserStart(t *testing.T) { for i := 0; i <= 1; i++ { _, err := p.Start([]byte{}) if !checkErrorPrefix(err, want) { - t.Errorf("got p.Start(nil) = _, %v, want = _, %s", err, want) + t.Errorf("got Parser.Start(nil) = _, %v, want = _, %s", err, want) } } } @@ -211,7 +242,7 @@ func TestResourceNotStarted(t *testing.T) { for _, test := range tests { if err := test.fn(&Parser{}); err != ErrNotStarted { - t.Errorf("got _, %v = p.%s(), want = _, %v", err, test.name, ErrNotStarted) + t.Errorf("got Parser.%s() = _ , %v, want = _, %v", test.name, err, ErrNotStarted) } } } @@ -235,15 +266,49 @@ func TestDNSPackUnpack(t *testing.T) { for i, want := range wants { b, err := want.Pack() if err != nil { - t.Fatalf("%d: packing failed: %v", i, err) + t.Fatalf("%d: Message.Pack() = %v", i, err) } var got Message err = got.Unpack(b) if err != nil { - t.Fatalf("%d: unpacking failed: %v", i, err) + t.Fatalf("%d: Message.Unapck() = %v", i, err) } if !reflect.DeepEqual(got, want) { - t.Errorf("%d: got = %+v, want = %+v", i, &got, &want) + t.Errorf("%d: Message.Pack/Unpack() roundtrip: got = %+v, want = %+v", i, &got, &want) + } + } +} + +func TestDNSAppendPackUnpack(t *testing.T) { + wants := []Message{ + { + Questions: []Question{ + { + Name: mustNewName("."), + Type: TypeAAAA, + Class: ClassINET, + }, + }, + Answers: []Resource{}, + Authorities: []Resource{}, + Additionals: []Resource{}, + }, + largeTestMsg(), + } + for i, want := range wants { + b := make([]byte, 2, 514) + b, err := want.AppendPack(b) + if err != nil { + t.Fatalf("%d: Message.AppendPack() = %v", i, err) + } + b = b[2:] + var got Message + err = got.Unpack(b) + if err != nil { + t.Fatalf("%d: Message.Unapck() = %v", i, err) + } + if !reflect.DeepEqual(got, want) { + t.Errorf("%d: Message.AppendPack/Unpack() roundtrip: got = %+v, want = %+v", i, &got, &want) } } } @@ -252,11 +317,11 @@ func TestSkipAll(t *testing.T) { msg := largeTestMsg() buf, err := msg.Pack() if err != nil { - t.Fatal("Packing large test message:", err) + t.Fatal("Message.Pack() =", err) } var p Parser if _, err := p.Start(buf); err != nil { - t.Fatal(err) + t.Fatal("Parser.Start(non-nil) =", err) } tests := []struct { @@ -271,7 +336,7 @@ func TestSkipAll(t *testing.T) { for _, test := range tests { for i := 1; i <= 3; i++ { if err := test.f(); err != nil { - t.Errorf("Call #%d to %s(): %v", i, test.name, err) + t.Errorf("%d: Parser.%s() = %v", i, test.name, err) } } } @@ -282,11 +347,11 @@ func TestSkipEach(t *testing.T) { buf, err := msg.Pack() if err != nil { - t.Fatal("Packing test message:", err) + t.Fatal("Message.Pack() =", err) } var p Parser if _, err := p.Start(buf); err != nil { - t.Fatal(err) + t.Fatal("Parser.Start(non-nil) =", err) } tests := []struct { @@ -300,10 +365,10 @@ func TestSkipEach(t *testing.T) { } for _, test := range tests { if err := test.f(); err != nil { - t.Errorf("First call: got %s() = %v, want = %v", test.name, err, nil) + t.Errorf("first Parser.%s() = %v, want = nil", test.name, err) } if err := test.f(); err != ErrSectionDone { - t.Errorf("Second call: got %s() = %v, want = %v", test.name, err, ErrSectionDone) + t.Errorf("second Parser.%s() = %v, want = %v", test.name, err, ErrSectionDone) } } } @@ -313,11 +378,11 @@ func TestSkipAfterRead(t *testing.T) { buf, err := msg.Pack() if err != nil { - t.Fatal("Packing test message:", err) + t.Fatal("Message.Pack() =", err) } var p Parser if _, err := p.Start(buf); err != nil { - t.Fatal(err) + t.Fatal("Parser.Srart(non-nil) =", err) } tests := []struct { @@ -332,10 +397,10 @@ func TestSkipAfterRead(t *testing.T) { } for _, test := range tests { if err := test.read(); err != nil { - t.Errorf("Got %s() = _, %v, want = _, %v", test.name, err, nil) + t.Errorf("got Parser.%s() = _, %v, want = _, nil", test.name, err) } if err := test.skip(); err != ErrSectionDone { - t.Errorf("Got Skip%s() = %v, want = %v", test.name, err, ErrSectionDone) + t.Errorf("got Parser.Skip%s() = %v, want = %v", test.name, err, ErrSectionDone) } } } @@ -354,7 +419,7 @@ func TestSkipNotStarted(t *testing.T) { } for _, test := range tests { if err := test.f(); err != ErrNotStarted { - t.Errorf("Got %s() = %v, want = %v", test.name, err, ErrNotStarted) + t.Errorf("got Parser.%s() = %v, want = %v", test.name, err, ErrNotStarted) } } } @@ -398,7 +463,7 @@ func TestTooManyRecords(t *testing.T) { for _, test := range tests { if _, got := test.msg.Pack(); got != test.want { - t.Errorf("Packing %d %s: got = %v, want = %v", recs, test.name, got, test.want) + t.Errorf("got Message.Pack() for %d %s = %v, want = %v", recs, test.name, got, test.want) } } } @@ -410,27 +475,62 @@ func TestVeryLongTxt(t *testing.T) { Type: TypeTXT, Class: ClassINET, }, - &TXTResource{loremIpsum}, + &TXTResource{[]string{ + "", + "", + "foo bar", + "", + "www.example.com", + "www.example.com.", + strings.Repeat(".", 255), + }}, } - buf, err := want.pack(make([]byte, 0, 8000), map[string]int{}) + buf, err := want.pack(make([]byte, 0, 8000), map[string]int{}, 0) if err != nil { - t.Fatal("Packing failed:", err) + t.Fatal("Resource.pack() =", err) } var got Resource off, err := got.Header.unpack(buf, 0) if err != nil { - t.Fatal("Unpacking ResourceHeader failed:", err) + t.Fatal("ResourceHeader.unpack() =", err) } body, n, err := unpackResourceBody(buf, off, got.Header) if err != nil { - t.Fatal("Unpacking failed:", err) + t.Fatal("unpackResourceBody() =", err) } got.Body = body if n != len(buf) { - t.Errorf("Unpacked different amount than packed: got n = %d, want = %d", n, len(buf)) + t.Errorf("unpacked different amount than packed: got = %d, want = %d", n, len(buf)) } if !reflect.DeepEqual(got, want) { - t.Errorf("Got = %#v, want = %#v", got, want) + t.Errorf("Resource.pack/unpack() roundtrip: got = %#v, want = %#v", got, want) + } +} + +func TestTooLongTxt(t *testing.T) { + rb := TXTResource{[]string{strings.Repeat(".", 256)}} + if _, err := rb.pack(make([]byte, 0, 8000), map[string]int{}, 0); err != errStringTooLong { + t.Errorf("packing TXTResource with 256 character string: got err = %v, want = %v", err, errStringTooLong) + } +} + +func TestStartAppends(t *testing.T) { + buf := make([]byte, 2, 514) + wantBuf := []byte{4, 44} + copy(buf, wantBuf) + + b := NewBuilder(buf, Header{}) + b.EnableCompression() + + buf, err := b.Finish() + if err != nil { + t.Fatal("Builder.Finish() =", err) + } + if got, want := len(buf), headerLen+2; got != want { + t.Errorf("got len(buf) = %d, want = %d", got, want) + } + if string(buf[:2]) != string(wantBuf) { + t.Errorf("original data not preserved, got = %#v, want = %#v", buf[:2], wantBuf) } } @@ -457,7 +557,7 @@ func TestStartError(t *testing.T) { for _, env := range envs { for _, test := range tests { if got := test.fn(env.fn()); got != env.want { - t.Errorf("got Builder{%s}.Start%s = %v, want = %v", env.name, test.name, got, env.want) + t.Errorf("got Builder{%s}.Start%s() = %v, want = %v", env.name, test.name, got, env.want) } } } @@ -477,6 +577,7 @@ func TestBuilderResourceError(t *testing.T) { {"SRVResource", func(b *Builder) error { return b.SRVResource(ResourceHeader{}, SRVResource{}) }}, {"AResource", func(b *Builder) error { return b.AResource(ResourceHeader{}, AResource{}) }}, {"AAAAResource", func(b *Builder) error { return b.AAAAResource(ResourceHeader{}, AAAAResource{}) }}, + {"OPTResource", func(b *Builder) error { return b.OPTResource(ResourceHeader{}, OPTResource{}) }}, } envs := []struct { @@ -493,7 +594,7 @@ func TestBuilderResourceError(t *testing.T) { for _, env := range envs { for _, test := range tests { if got := test.fn(env.fn()); got != env.want { - t.Errorf("got Builder{%s}.%s = %v, want = %v", env.name, test.name, got, env.want) + t.Errorf("got Builder{%s}.%s() = %v, want = %v", env.name, test.name, got, env.want) } } } @@ -503,7 +604,7 @@ func TestFinishError(t *testing.T) { var b Builder want := ErrNotStarted if _, got := b.Finish(); got != want { - t.Errorf("got Builder{}.Finish() = %v, want = %v", got, want) + t.Errorf("got Builder.Finish() = %v, want = %v", got, want) } } @@ -511,89 +612,96 @@ func TestBuilder(t *testing.T) { msg := largeTestMsg() want, err := msg.Pack() if err != nil { - t.Fatal("Packing without builder:", err) + t.Fatal("Message.Pack() =", err) } - var b Builder - b.Start(nil, msg.Header) + b := NewBuilder(nil, msg.Header) + b.EnableCompression() if err := b.StartQuestions(); err != nil { - t.Fatal("b.StartQuestions():", err) + t.Fatal("Builder.StartQuestions() =", err) } for _, q := range msg.Questions { if err := b.Question(q); err != nil { - t.Fatalf("b.Question(%#v): %v", q, err) + t.Fatalf("Builder.Question(%#v) = %v", q, err) } } if err := b.StartAnswers(); err != nil { - t.Fatal("b.StartAnswers():", err) + t.Fatal("Builder.StartAnswers() =", err) } for _, a := range msg.Answers { switch a.Header.Type { case TypeA: if err := b.AResource(a.Header, *a.Body.(*AResource)); err != nil { - t.Fatalf("b.AResource(%#v): %v", a, err) + t.Fatalf("Builder.AResource(%#v) = %v", a, err) } case TypeNS: if err := b.NSResource(a.Header, *a.Body.(*NSResource)); err != nil { - t.Fatalf("b.NSResource(%#v): %v", a, err) + t.Fatalf("Builder.NSResource(%#v) = %v", a, err) } case TypeCNAME: if err := b.CNAMEResource(a.Header, *a.Body.(*CNAMEResource)); err != nil { - t.Fatalf("b.CNAMEResource(%#v): %v", a, err) + t.Fatalf("Builder.CNAMEResource(%#v) = %v", a, err) } case TypeSOA: if err := b.SOAResource(a.Header, *a.Body.(*SOAResource)); err != nil { - t.Fatalf("b.SOAResource(%#v): %v", a, err) + t.Fatalf("Builder.SOAResource(%#v) = %v", a, err) } case TypePTR: if err := b.PTRResource(a.Header, *a.Body.(*PTRResource)); err != nil { - t.Fatalf("b.PTRResource(%#v): %v", a, err) + t.Fatalf("Builder.PTRResource(%#v) = %v", a, err) } case TypeMX: if err := b.MXResource(a.Header, *a.Body.(*MXResource)); err != nil { - t.Fatalf("b.MXResource(%#v): %v", a, err) + t.Fatalf("Builder.MXResource(%#v) = %v", a, err) } case TypeTXT: if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { - t.Fatalf("b.TXTResource(%#v): %v", a, err) + t.Fatalf("Builder.TXTResource(%#v) = %v", a, err) } case TypeAAAA: if err := b.AAAAResource(a.Header, *a.Body.(*AAAAResource)); err != nil { - t.Fatalf("b.AAAAResource(%#v): %v", a, err) + t.Fatalf("Builder.AAAAResource(%#v) = %v", a, err) } case TypeSRV: if err := b.SRVResource(a.Header, *a.Body.(*SRVResource)); err != nil { - t.Fatalf("b.SRVResource(%#v): %v", a, err) + t.Fatalf("Builder.SRVResource(%#v) = %v", a, err) } } } if err := b.StartAuthorities(); err != nil { - t.Fatal("b.StartAuthorities():", err) + t.Fatal("Builder.StartAuthorities() =", err) } for _, a := range msg.Authorities { if err := b.NSResource(a.Header, *a.Body.(*NSResource)); err != nil { - t.Fatalf("b.NSResource(%#v): %v", a, err) + t.Fatalf("Builder.NSResource(%#v) = %v", a, err) } } if err := b.StartAdditionals(); err != nil { - t.Fatal("b.StartAdditionals():", err) + t.Fatal("Builder.StartAdditionals() =", err) } for _, a := range msg.Additionals { - if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { - t.Fatalf("b.TXTResource(%#v): %v", a, err) + switch a.Body.(type) { + case *TXTResource: + if err := b.TXTResource(a.Header, *a.Body.(*TXTResource)); err != nil { + t.Fatalf("Builder.TXTResource(%#v) = %v", a, err) + } + case *OPTResource: + if err := b.OPTResource(a.Header, *a.Body.(*OPTResource)); err != nil { + t.Fatalf("Builder.OPTResource(%#v) = %v", a, err) + } } } got, err := b.Finish() if err != nil { - t.Fatal("b.Finish():", err) + t.Fatal("Builder.Finish() =", err) } if !bytes.Equal(got, want) { - t.Fatalf("Got from Builder: %#v\nwant = %#v", got, want) + t.Fatalf("got from Builder.Finish() = %#v\nwant = %#v", got, want) } } @@ -648,14 +756,151 @@ func TestResourcePack(t *testing.T) { } { _, err := tt.m.Pack() if !reflect.DeepEqual(err, tt.err) { - t.Errorf("got %v for %v; want %v", err, tt.m, tt.err) + t.Errorf("got Message{%v}.Pack() = %v, want %v", tt.m, err, tt.err) } } } -func BenchmarkParsing(b *testing.B) { - b.ReportAllocs() +func TestOptionPackUnpack(t *testing.T) { + for _, tt := range []struct { + name string + w []byte // wire format of m.Additionals + m Message + dnssecOK bool + extRCode RCode + }{ + { + name: "without EDNS(0) options", + w: []byte{ + 0x00, 0x00, 0x29, 0x10, 0x00, 0xfe, 0x00, 0x80, + 0x00, 0x00, 0x00, + }, + m: Message{ + Header: Header{RCode: RCodeFormatError}, + Questions: []Question{ + { + Name: mustNewName("."), + Type: TypeA, + Class: ClassINET, + }, + }, + Additionals: []Resource{ + { + mustEDNS0ResourceHeader(4096, 0xfe0|RCodeFormatError, true), + &OPTResource{}, + }, + }, + }, + dnssecOK: true, + extRCode: 0xfe0 | RCodeFormatError, + }, + { + name: "with EDNS(0) options", + w: []byte{ + 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x0b, 0x00, 0x02, 0x12, 0x34, + }, + m: Message{ + Header: Header{RCode: RCodeServerFailure}, + Questions: []Question{ + { + Name: mustNewName("."), + Type: TypeAAAA, + Class: ClassINET, + }, + }, + Additionals: []Resource{ + { + mustEDNS0ResourceHeader(4096, 0xff0|RCodeServerFailure, false), + &OPTResource{ + Options: []Option{ + { + Code: 12, // see RFC 7828 + Data: []byte{0x00, 0x00}, + }, + { + Code: 11, // see RFC 7830 + Data: []byte{0x12, 0x34}, + }, + }, + }, + }, + }, + }, + dnssecOK: false, + extRCode: 0xff0 | RCodeServerFailure, + }, + { + // Containing multiple OPT resources in a + // message is invalid, but it's necessary for + // protocol conformance testing. + name: "with multiple OPT resources", + w: []byte{ + 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x0b, 0x00, 0x02, 0x12, + 0x34, 0x00, 0x00, 0x29, 0x10, 0x00, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x02, + 0x00, 0x00, + }, + m: Message{ + Header: Header{RCode: RCodeNameError}, + Questions: []Question{ + { + Name: mustNewName("."), + Type: TypeAAAA, + Class: ClassINET, + }, + }, + Additionals: []Resource{ + { + mustEDNS0ResourceHeader(4096, 0xff0|RCodeNameError, false), + &OPTResource{ + Options: []Option{ + { + Code: 11, // see RFC 7830 + Data: []byte{0x12, 0x34}, + }, + }, + }, + }, + { + mustEDNS0ResourceHeader(4096, 0xff0|RCodeNameError, false), + &OPTResource{ + Options: []Option{ + { + Code: 12, // see RFC 7828 + Data: []byte{0x00, 0x00}, + }, + }, + }, + }, + }, + }, + }, + } { + w, err := tt.m.Pack() + if err != nil { + t.Errorf("Message.Pack() for %s = %v", tt.name, err) + continue + } + if !bytes.Equal(w[len(w)-len(tt.w):], tt.w) { + t.Errorf("got Message.Pack() for %s = %#v, want %#v", tt.name, w[len(w)-len(tt.w):], tt.w) + continue + } + var m Message + if err := m.Unpack(w); err != nil { + t.Errorf("Message.Unpack() for %s = %v", tt.name, err) + continue + } + if !reflect.DeepEqual(m.Additionals, tt.m.Additionals) { + t.Errorf("got Message.Pack/Unpack() roundtrip for %s = %+v, want %+v", tt.name, m, tt.m) + continue + } + } +} +func benchmarkParsingSetup() ([]byte, error) { name := mustNewName("foo.bar.example.com.") msg := Message{ Header: Header{Response: true, Authoritative: true}, @@ -700,111 +945,161 @@ func BenchmarkParsing(b *testing.B) { buf, err := msg.Pack() if err != nil { - b.Fatal("msg.Pack():", err) + return nil, fmt.Errorf("Message.Pack() = %v", err) + } + return buf, nil +} + +func benchmarkParsing(tb testing.TB, buf []byte) { + var p Parser + if _, err := p.Start(buf); err != nil { + tb.Fatal("Parser.Start(non-nil) =", err) } - for i := 0; i < b.N; i++ { - var p Parser - if _, err := p.Start(buf); err != nil { - b.Fatal("p.Start(buf):", err) + for { + _, err := p.Question() + if err == ErrSectionDone { + break + } + if err != nil { + tb.Fatal("Parser.Question() =", err) + } + } + + for { + h, err := p.AnswerHeader() + if err == ErrSectionDone { + break + } + if err != nil { + tb.Fatal("Parser.AnswerHeader() =", err) } - for { - _, err := p.Question() - if err == ErrSectionDone { - break + switch h.Type { + case TypeA: + if _, err := p.AResource(); err != nil { + tb.Fatal("Parser.AResource() =", err) } - if err != nil { - b.Fatal("p.Question():", err) + case TypeAAAA: + if _, err := p.AAAAResource(); err != nil { + tb.Fatal("Parser.AAAAResource() =", err) } - } - - for { - h, err := p.AnswerHeader() - if err == ErrSectionDone { - break + case TypeCNAME: + if _, err := p.CNAMEResource(); err != nil { + tb.Fatal("Parser.CNAMEResource() =", err) } - if err != nil { - panic(err) + case TypeNS: + if _, err := p.NSResource(); err != nil { + tb.Fatal("Parser.NSResource() =", err) } - - switch h.Type { - case TypeA: - if _, err := p.AResource(); err != nil { - b.Fatal("p.AResource():", err) - } - case TypeAAAA: - if _, err := p.AAAAResource(); err != nil { - b.Fatal("p.AAAAResource():", err) - } - case TypeCNAME: - if _, err := p.CNAMEResource(); err != nil { - b.Fatal("p.CNAMEResource():", err) - } - case TypeNS: - if _, err := p.NSResource(); err != nil { - b.Fatal("p.NSResource():", err) - } - default: - b.Fatalf("unknown type: %T", h) + case TypeOPT: + if _, err := p.OPTResource(); err != nil { + tb.Fatal("Parser.OPTResource() =", err) } + default: + tb.Fatalf("got unknown type: %T", h) } } } -func BenchmarkBuilding(b *testing.B) { - b.ReportAllocs() +func BenchmarkParsing(b *testing.B) { + buf, err := benchmarkParsingSetup() + if err != nil { + b.Fatal(err) + } + b.ReportAllocs() + for i := 0; i < b.N; i++ { + benchmarkParsing(b, buf) + } +} + +func TestParsingAllocs(t *testing.T) { + buf, err := benchmarkParsingSetup() + if err != nil { + t.Fatal(err) + } + + if allocs := testing.AllocsPerRun(100, func() { benchmarkParsing(t, buf) }); allocs > 0.5 { + t.Errorf("allocations during parsing: got = %f, want ~0", allocs) + } +} + +func benchmarkBuildingSetup() (Name, []byte) { name := mustNewName("foo.bar.example.com.") buf := make([]byte, 0, packStartingCap) + return name, buf +} +func benchmarkBuilding(tb testing.TB, name Name, buf []byte) { + bld := NewBuilder(buf, Header{Response: true, Authoritative: true}) + + if err := bld.StartQuestions(); err != nil { + tb.Fatal("Builder.StartQuestions() =", err) + } + q := Question{ + Name: name, + Type: TypeA, + Class: ClassINET, + } + if err := bld.Question(q); err != nil { + tb.Fatalf("Builder.Question(%+v) = %v", q, err) + } + + hdr := ResourceHeader{ + Name: name, + Class: ClassINET, + } + if err := bld.StartAnswers(); err != nil { + tb.Fatal("Builder.StartQuestions() =", err) + } + + ar := AResource{[4]byte{}} + if err := bld.AResource(hdr, ar); err != nil { + tb.Fatalf("Builder.AResource(%+v, %+v) = %v", hdr, ar, err) + } + + aaar := AAAAResource{[16]byte{}} + if err := bld.AAAAResource(hdr, aaar); err != nil { + tb.Fatalf("Builder.AAAAResource(%+v, %+v) = %v", hdr, aaar, err) + } + + cnr := CNAMEResource{name} + if err := bld.CNAMEResource(hdr, cnr); err != nil { + tb.Fatalf("Builder.CNAMEResource(%+v, %+v) = %v", hdr, cnr, err) + } + + nsr := NSResource{name} + if err := bld.NSResource(hdr, nsr); err != nil { + tb.Fatalf("Builder.NSResource(%+v, %+v) = %v", hdr, nsr, err) + } + + extrc := 0xfe0 | RCodeNotImplemented + if err := (&hdr).SetEDNS0(4096, extrc, true); err != nil { + tb.Fatalf("ResourceHeader.SetEDNS0(4096, %#x, true) = %v", extrc, err) + } + optr := OPTResource{} + if err := bld.OPTResource(hdr, optr); err != nil { + tb.Fatalf("Builder.OPTResource(%+v, %+v) = %v", hdr, optr, err) + } + + if _, err := bld.Finish(); err != nil { + tb.Fatal("Builder.Finish() =", err) + } +} + +func BenchmarkBuilding(b *testing.B) { + name, buf := benchmarkBuildingSetup() + b.ReportAllocs() for i := 0; i < b.N; i++ { - var bld Builder - bld.StartWithoutCompression(buf, Header{Response: true, Authoritative: true}) + benchmarkBuilding(b, name, buf) + } +} - if err := bld.StartQuestions(); err != nil { - b.Fatal("bld.StartQuestions():", err) - } - q := Question{ - Name: name, - Type: TypeA, - Class: ClassINET, - } - if err := bld.Question(q); err != nil { - b.Fatalf("bld.Question(%+v): %v", q, err) - } - - hdr := ResourceHeader{ - Name: name, - Class: ClassINET, - } - if err := bld.StartAnswers(); err != nil { - b.Fatal("bld.StartQuestions():", err) - } - - ar := AResource{[4]byte{}} - if err := bld.AResource(hdr, ar); err != nil { - b.Fatalf("bld.AResource(%+v, %+v): %v", hdr, ar, err) - } - - aaar := AAAAResource{[16]byte{}} - if err := bld.AAAAResource(hdr, aaar); err != nil { - b.Fatalf("bld.AAAAResource(%+v, %+v): %v", hdr, aaar, err) - } - - cnr := CNAMEResource{name} - if err := bld.CNAMEResource(hdr, cnr); err != nil { - b.Fatalf("bld.CNAMEResource(%+v, %+v): %v", hdr, cnr, err) - } - - nsr := NSResource{name} - if err := bld.NSResource(hdr, nsr); err != nil { - b.Fatalf("bld.NSResource(%+v, %+v): %v", hdr, nsr, err) - } - - if _, err := bld.Finish(); err != nil { - b.Fatal("bld.Finish():", err) - } +func TestBuildingAllocs(t *testing.T) { + name, buf := benchmarkBuildingSetup() + if allocs := testing.AllocsPerRun(100, func() { benchmarkBuilding(t, name, buf) }); allocs > 0.5 { + t.Errorf("allocations during building: got = %f, want ~0", allocs) } } @@ -859,7 +1154,7 @@ func BenchmarkPack(b *testing.B) { for i := 0; i < b.N; i++ { if _, err := msg.Pack(); err != nil { - b.Fatal(err) + b.Fatal("Message.Pack() =", err) } } } @@ -872,7 +1167,7 @@ func BenchmarkAppendPack(b *testing.B) { for i := 0; i < b.N; i++ { if _, err := msg.AppendPack(buf[:0]); err != nil { - b.Fatal(err) + b.Fatal("Message.AppendPack() = ", err) } } } @@ -995,7 +1290,7 @@ func largeTestMsg() Message { Type: TypeTXT, Class: ClassINET, }, - &TXTResource{"So Long, and Thanks for All the Fish"}, + &TXTResource{[]string{"So Long, and Thanks for All the Fish"}}, }, { ResourceHeader{ @@ -1003,139 +1298,19 @@ func largeTestMsg() Message { Type: TypeTXT, Class: ClassINET, }, - &TXTResource{"Hamster Huey and the Gooey Kablooie"}, + &TXTResource{[]string{"Hamster Huey and the Gooey Kablooie"}}, + }, + { + mustEDNS0ResourceHeader(4096, 0xfe0|RCodeSuccess, false), + &OPTResource{ + Options: []Option{ + { + Code: 10, // see RFC 7873 + Data: []byte{0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef}, + }, + }, + }, }, }, } } - -const loremIpsum = ` -Lorem ipsum dolor sit amet, nec enim antiopam id, an ullum choro -nonumes qui, pro eu debet honestatis mediocritatem. No alia enim eos, -magna signiferumque ex vis. Mei no aperiri dissentias, cu vel quas -regione. Malorum quaeque vim ut, eum cu semper aliquid invidunt, ei -nam ipsum assentior. - -Nostrum appellantur usu no, vis ex probatus adipiscing. Cu usu illum -facilis eleifend. Iusto conceptam complectitur vim id. Tale omnesque -no usu, ei oblique sadipscing vim. At nullam voluptua usu, mei laudem -reformidans et. Qui ei eros porro reformidans, ius suas veritus -torquatos ex. Mea te facer alterum consequat. - -Soleat torquatos democritum sed et, no mea congue appareat, facer -aliquam nec in. Has te ipsum tritani. At justo dicta option nec, movet -phaedrum ad nam. Ea detracto verterem liberavisse has, delectus -suscipiantur in mei. Ex nam meliore complectitur. Ut nam omnis -honestatis quaerendum, ea mea nihil affert detracto, ad vix rebum -mollis. - -Ut epicurei praesent neglegentur pri, prima fuisset intellegebat ad -vim. An habemus comprehensam usu, at enim dignissim pro. Eam reque -vivendum adipisci ea. Vel ne odio choro minimum. Sea admodum -dissentiet ex. Mundi tamquam evertitur ius cu. Homero postea iisque ut -pro, vel ne saepe senserit consetetur. - -Nulla utamur facilisis ius ea, in viderer diceret pertinax eum. Mei no -enim quodsi facilisi, ex sed aeterno appareat mediocritatem, eum -sententiae deterruisset ut. At suas timeam euismod cum, offendit -appareat interpretaris ne vix. Vel ea civibus albucius, ex vim quidam -accusata intellegebat, noluisse instructior sea id. Nec te nonumes -habemus appellantur, quis dignissim vituperata eu nam. - -At vix apeirian patrioque vituperatoribus, an usu agam assum. Debet -iisque an mea. Per eu dicant ponderum accommodare. Pri alienum -placerat senserit an, ne eum ferri abhorreant vituperatoribus. Ut mea -eligendi disputationi. Ius no tation everti impedit, ei magna quidam -mediocritatem pri. - -Legendos perpetua iracundia ne usu, no ius ullum epicurei intellegam, -ad modus epicuri lucilius eam. In unum quaerendum usu. Ne diam paulo -has, ea veri virtute sed. Alia honestatis conclusionemque mea eu, ut -iudico albucius his. - -Usu essent probatus eu, sed omnis dolor delicatissimi ex. No qui augue -dissentias dissentiet. Laudem recteque no usu, vel an velit noluisse, -an sed utinam eirmod appetere. Ne mea fuisset inimicus ocurreret. At -vis dicant abhorreant, utinam forensibus nec ne, mei te docendi -consequat. Brute inermis persecuti cum id. Ut ipsum munere propriae -usu, dicit graeco disputando id has. - -Eros dolore quaerendum nam ei. Timeam ornatus inciderint pro id. Nec -torquatos sadipscing ei, ancillae molestie per in. Malis principes duo -ea, usu liber postulant ei. - -Graece timeam voluptatibus eu eam. Alia probatus quo no, ea scripta -feugiat duo. Congue option meliore ex qui, noster invenire appellantur -ea vel. Eu exerci legendos vel. Consetetur repudiandae vim ut. Vix an -probo minimum, et nam illud falli tempor. - -Cum dico signiferumque eu. Sed ut regione maiorum, id veritus insolens -tacimates vix. Eu mel sint tamquam lucilius, duo no oporteat -tacimates. Atqui augue concludaturque vix ei, id mel utroque menandri. - -Ad oratio blandit aliquando pro. Vis et dolorum rationibus -philosophia, ad cum nulla molestie. Hinc fuisset adversarium eum et, -ne qui nisl verear saperet, vel te quaestio forensibus. Per odio -option delenit an. Alii placerat has no, in pri nihil platonem -cotidieque. Est ut elit copiosae scaevola, debet tollit maluisset sea -an. - -Te sea hinc debet pericula, liber ridens fabulas cu sed, quem mutat -accusam mea et. Elitr labitur albucius et pri, an labore feugait mel. -Velit zril melius usu ea. Ad stet putent interpretaris qui. Mel no -error volumus scripserit. In pro paulo iudico, quo ei dolorem -verterem, affert fabellas dissentiet ea vix. - -Vis quot deserunt te. Error aliquid detraxit eu usu, vis alia eruditi -salutatus cu. Est nostrud bonorum an, ei usu alii salutatus. Vel at -nisl primis, eum ex aperiri noluisse reformidans. Ad veri velit -utroque vis, ex equidem detraxit temporibus has. - -Inermis appareat usu ne. Eros placerat periculis mea ad, in dictas -pericula pro. Errem postulant at usu, ea nec amet ornatus mentitum. Ad -mazim graeco eum, vel ex percipit volutpat iudicabit, sit ne delicata -interesset. Mel sapientem prodesset abhorreant et, oblique suscipit -eam id. - -An maluisset disputando mea, vidit mnesarchum pri et. Malis insolens -inciderint no sea. Ea persius maluisset vix, ne vim appellantur -instructior, consul quidam definiebas pri id. Cum integre feugiat -pericula in, ex sed persius similique, mel ne natum dicit percipitur. - -Primis discere ne pri, errem putent definitionem at vis. Ei mel dolore -neglegentur, mei tincidunt percipitur ei. Pro ad simul integre -rationibus. Eu vel alii honestatis definitiones, mea no nonumy -reprehendunt. - -Dicta appareat legendos est cu. Eu vel congue dicunt omittam, no vix -adhuc minimum constituam, quot noluisse id mel. Eu quot sale mutat -duo, ex nisl munere invenire duo. Ne nec ullum utamur. Pro alterum -debitis nostrum no, ut vel aliquid vivendo. - -Aliquip fierent praesent quo ne, id sit audiam recusabo delicatissimi. -Usu postulant incorrupte cu. At pro dicit tibique intellegam, cibo -dolore impedit id eam, et aeque feugait assentior has. Quando sensibus -nec ex. Possit sensibus pri ad, unum mutat periculis cu vix. - -Mundi tibique vix te, duo simul partiendo qualisque id, est at vidit -sonet tempor. No per solet aeterno deseruisse. Petentium salutandi -definiebas pri cu. Munere vivendum est in. Ei justo congue eligendi -vis, modus offendit omittantur te mel. - -Integre voluptaria in qui, sit habemus tractatos constituam no. Utinam -melius conceptam est ne, quo in minimum apeirian delicata, ut ius -porro recusabo. Dicant expetenda vix no, ludus scripserit sed ex, eu -his modo nostro. Ut etiam sonet his, quodsi inciderint philosophia te -per. Nullam lobortis eu cum, vix an sonet efficiendi repudiandae. Vis -ad idque fabellas intellegebat. - -Eum commodo senserit conclusionemque ex. Sed forensibus sadipscing ut, -mei in facer delicata periculis, sea ne hinc putent cetero. Nec ne -alia corpora invenire, alia prima soleat te cum. Eleifend posidonium -nam at. - -Dolorum indoctum cu quo, ex dolor legendos recteque eam, cu pri zril -discere. Nec civibus officiis dissentiunt ex, est te liber ludus -elaboraret. Cum ea fabellas invenire. Ex vim nostrud eripuit -comprehensam, nam te inermis delectus, saepe inermis senserit. -` diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go index cc5dc5d..5d05278 100644 --- a/vendor/golang.org/x/net/html/atom/gen.go +++ b/vendor/golang.org/x/net/html/atom/gen.go @@ -306,7 +306,7 @@ func (t *table) push(i uint32, depth int) bool { // The lists of element names and attribute keys were taken from // https://html.spec.whatwg.org/multipage/indices.html#index -// as of the "HTML Living Standard - Last Updated 18 September 2017" version. +// as of the "HTML Living Standard - Last Updated 16 April 2018" version. // "command", "keygen" and "menuitem" have been removed from the spec, // but are kept here for backwards compatibility. @@ -665,6 +665,7 @@ var eventHandlers = []string{ // extra are ad-hoc values not covered by any of the lists above. var extra = []string{ + "acronym", "align", "annotation", "annotation-xml", @@ -700,6 +701,8 @@ var extra = []string{ "plaintext", "prompt", "public", + "rb", + "rtc", "spacer", "strike", "svg", diff --git a/vendor/golang.org/x/net/html/atom/table.go b/vendor/golang.org/x/net/html/atom/table.go index f74018e..2a93886 100644 --- a/vendor/golang.org/x/net/html/atom/table.go +++ b/vendor/golang.org/x/net/html/atom/table.go @@ -10,366 +10,369 @@ const ( Accept Atom = 0x1a06 AcceptCharset Atom = 0x1a0e Accesskey Atom = 0x2c09 - Action Atom = 0x25a06 - Address Atom = 0x6ed07 - Align Atom = 0x6d405 - Allowfullscreen Atom = 0x1f00f - Allowpaymentrequest Atom = 0x6913 - Allowusermedia Atom = 0x850e - Alt Atom = 0xb003 - Annotation Atom = 0x1b90a - AnnotationXml Atom = 0x1b90e - Applet Atom = 0x30106 - Area Atom = 0x34a04 - Article Atom = 0x3f007 - As Atom = 0xb902 - Aside Atom = 0xc105 - Async Atom = 0xb905 - Audio Atom = 0xcf05 - Autocomplete Atom = 0x2600c - Autofocus Atom = 0xeb09 - Autoplay Atom = 0x10608 + Acronym Atom = 0xaa07 + Action Atom = 0x27206 + Address Atom = 0x6f307 + Align Atom = 0xb105 + Allowfullscreen Atom = 0x2080f + Allowpaymentrequest Atom = 0xc113 + Allowusermedia Atom = 0xdd0e + Alt Atom = 0xf303 + Annotation Atom = 0x1c90a + AnnotationXml Atom = 0x1c90e + Applet Atom = 0x31906 + Area Atom = 0x35604 + Article Atom = 0x3fc07 + As Atom = 0x3c02 + Aside Atom = 0x10705 + Async Atom = 0xff05 + Audio Atom = 0x11505 + Autocomplete Atom = 0x2780c + Autofocus Atom = 0x12109 + Autoplay Atom = 0x13c08 B Atom = 0x101 - Base Atom = 0x11504 - Basefont Atom = 0x11508 - Bdi Atom = 0x16103 - Bdo Atom = 0x13403 - Bgsound Atom = 0x14707 - Big Atom = 0x15903 - Blink Atom = 0x15c05 - Blockquote Atom = 0x1680a + Base Atom = 0x3b04 + Basefont Atom = 0x3b08 + Bdi Atom = 0xba03 + Bdo Atom = 0x14b03 + Bgsound Atom = 0x15e07 + Big Atom = 0x17003 + Blink Atom = 0x17305 + Blockquote Atom = 0x1870a Body Atom = 0x2804 Br Atom = 0x202 - Button Atom = 0x17206 - Canvas Atom = 0xbd06 - Caption Atom = 0x21907 - Center Atom = 0x20806 - Challenge Atom = 0x28309 + Button Atom = 0x19106 + Canvas Atom = 0x10306 + Caption Atom = 0x23107 + Center Atom = 0x22006 + Challenge Atom = 0x29b09 Charset Atom = 0x2107 - Checked Atom = 0x46d07 - Cite Atom = 0x55804 - Class Atom = 0x5b905 - Code Atom = 0x19004 - Col Atom = 0x19703 - Colgroup Atom = 0x19708 - Color Atom = 0x1af05 - Cols Atom = 0x1b404 - Colspan Atom = 0x1b407 - Command Atom = 0x1c707 - Content Atom = 0x57f07 - Contenteditable Atom = 0x57f0f - Contextmenu Atom = 0x3740b - Controls Atom = 0x1ce08 - Coords Atom = 0x1da06 - Crossorigin Atom = 0x1e30b - Data Atom = 0x49904 - Datalist Atom = 0x49908 - Datetime Atom = 0x2a008 - Dd Atom = 0x2bf02 - Default Atom = 0xc407 - Defer Atom = 0x19205 - Del Atom = 0x44603 - Desc Atom = 0x55504 - Details Atom = 0x4607 - Dfn Atom = 0x5f03 - Dialog Atom = 0x16206 - Dir Atom = 0xa303 - Dirname Atom = 0xa307 - Disabled Atom = 0x14d08 - Div Atom = 0x15403 - Dl Atom = 0x5e202 - Download Atom = 0x45708 - Draggable Atom = 0x18309 - Dropzone Atom = 0x3f908 - Dt Atom = 0x64702 - Em Atom = 0x4202 - Embed Atom = 0x4205 - Enctype Atom = 0x27507 - Face Atom = 0x20604 - Fieldset Atom = 0x20e08 - Figcaption Atom = 0x2160a - Figure Atom = 0x23006 - Font Atom = 0x11904 - Footer Atom = 0xb306 - For Atom = 0x23c03 - ForeignObject Atom = 0x23c0d - Foreignobject Atom = 0x2490d - Form Atom = 0x25604 - Formaction Atom = 0x2560a - Formenctype Atom = 0x2710b - Formmethod Atom = 0x28c0a - Formnovalidate Atom = 0x2960e - Formtarget Atom = 0x2a80a - Frame Atom = 0x5705 - Frameset Atom = 0x5708 - H1 Atom = 0x14502 - H2 Atom = 0x2c602 - H3 Atom = 0x2f502 - H4 Atom = 0x33902 - H5 Atom = 0x34302 - H6 Atom = 0x64902 - Head Atom = 0x32504 - Header Atom = 0x32506 - Headers Atom = 0x32507 - Height Atom = 0x12c06 - Hgroup Atom = 0x2b206 - Hidden Atom = 0x2bd06 - High Atom = 0x2c304 - Hr Atom = 0x14002 - Href Atom = 0x2c804 - Hreflang Atom = 0x2c808 - Html Atom = 0x13004 - HttpEquiv Atom = 0x2d00a + Checked Atom = 0x47907 + Cite Atom = 0x19c04 + Class Atom = 0x56405 + Code Atom = 0x5c504 + Col Atom = 0x1ab03 + Colgroup Atom = 0x1ab08 + Color Atom = 0x1bf05 + Cols Atom = 0x1c404 + Colspan Atom = 0x1c407 + Command Atom = 0x1d707 + Content Atom = 0x58b07 + Contenteditable Atom = 0x58b0f + Contextmenu Atom = 0x3800b + Controls Atom = 0x1de08 + Coords Atom = 0x1ea06 + Crossorigin Atom = 0x1fb0b + Data Atom = 0x4a504 + Datalist Atom = 0x4a508 + Datetime Atom = 0x2b808 + Dd Atom = 0x2d702 + Default Atom = 0x10a07 + Defer Atom = 0x5c705 + Del Atom = 0x45203 + Desc Atom = 0x56104 + Details Atom = 0x7207 + Dfn Atom = 0x8703 + Dialog Atom = 0xbb06 + Dir Atom = 0x9303 + Dirname Atom = 0x9307 + Disabled Atom = 0x16408 + Div Atom = 0x16b03 + Dl Atom = 0x5e602 + Download Atom = 0x46308 + Draggable Atom = 0x17a09 + Dropzone Atom = 0x40508 + Dt Atom = 0x64b02 + Em Atom = 0x6e02 + Embed Atom = 0x6e05 + Enctype Atom = 0x28d07 + Face Atom = 0x21e04 + Fieldset Atom = 0x22608 + Figcaption Atom = 0x22e0a + Figure Atom = 0x24806 + Font Atom = 0x3f04 + Footer Atom = 0xf606 + For Atom = 0x25403 + ForeignObject Atom = 0x2540d + Foreignobject Atom = 0x2610d + Form Atom = 0x26e04 + Formaction Atom = 0x26e0a + Formenctype Atom = 0x2890b + Formmethod Atom = 0x2a40a + Formnovalidate Atom = 0x2ae0e + Formtarget Atom = 0x2c00a + Frame Atom = 0x8b05 + Frameset Atom = 0x8b08 + H1 Atom = 0x15c02 + H2 Atom = 0x2de02 + H3 Atom = 0x30d02 + H4 Atom = 0x34502 + H5 Atom = 0x34f02 + H6 Atom = 0x64d02 + Head Atom = 0x33104 + Header Atom = 0x33106 + Headers Atom = 0x33107 + Height Atom = 0x5206 + Hgroup Atom = 0x2ca06 + Hidden Atom = 0x2d506 + High Atom = 0x2db04 + Hr Atom = 0x15702 + Href Atom = 0x2e004 + Hreflang Atom = 0x2e008 + Html Atom = 0x5604 + HttpEquiv Atom = 0x2e80a I Atom = 0x601 - Icon Atom = 0x57e04 - Id Atom = 0xc302 - Iframe Atom = 0x2e406 - Image Atom = 0x2ea05 - Img Atom = 0x2ef03 - Input Atom = 0x43f05 - Inputmode Atom = 0x43f09 - Ins Atom = 0x1ec03 - Integrity Atom = 0x22709 - Is Atom = 0x14e02 - Isindex Atom = 0x2f707 - Ismap Atom = 0x2fe05 - Itemid Atom = 0x37f06 - Itemprop Atom = 0x55908 - Itemref Atom = 0x3c107 - Itemscope Atom = 0x66d09 - Itemtype Atom = 0x30708 - Kbd Atom = 0x16003 + Icon Atom = 0x58a04 + Id Atom = 0x10902 + Iframe Atom = 0x2fc06 + Image Atom = 0x30205 + Img Atom = 0x30703 + Input Atom = 0x44b05 + Inputmode Atom = 0x44b09 + Ins Atom = 0x20403 + Integrity Atom = 0x23f09 + Is Atom = 0x16502 + Isindex Atom = 0x30f07 + Ismap Atom = 0x31605 + Itemid Atom = 0x38b06 + Itemprop Atom = 0x19d08 + Itemref Atom = 0x3cd07 + Itemscope Atom = 0x67109 + Itemtype Atom = 0x31f08 + Kbd Atom = 0xb903 Keygen Atom = 0x3206 - Keytype Atom = 0x7e07 - Kind Atom = 0x18004 - Label Atom = 0xda05 - Lang Atom = 0x2cc04 - Legend Atom = 0x18a06 - Li Atom = 0x11102 - Link Atom = 0x15d04 - List Atom = 0x49d04 - Listing Atom = 0x49d07 - Loop Atom = 0xde04 - Low Atom = 0x6b03 + Keytype Atom = 0xd607 + Kind Atom = 0x17704 + Label Atom = 0x5905 + Lang Atom = 0x2e404 + Legend Atom = 0x18106 + Li Atom = 0xb202 + Link Atom = 0x17404 + List Atom = 0x4a904 + Listing Atom = 0x4a907 + Loop Atom = 0x5d04 + Low Atom = 0xc303 Main Atom = 0x1004 - Malignmark Atom = 0x6d30a - Manifest Atom = 0x30f08 - Map Atom = 0x30003 - Mark Atom = 0x6d904 - Marquee Atom = 0x31b07 - Math Atom = 0x32204 - Max Atom = 0x33103 - Maxlength Atom = 0x33109 - Media Atom = 0x8e05 - Mediagroup Atom = 0x8e0a - Menu Atom = 0x37b04 - Menuitem Atom = 0x37b08 - Meta Atom = 0x4ac04 - Meter Atom = 0xa805 - Method Atom = 0x29006 - Mglyph Atom = 0x2f006 - Mi Atom = 0x33b02 - Min Atom = 0x33b03 - Minlength Atom = 0x33b09 - Mn Atom = 0x29902 - Mo Atom = 0x6302 - Ms Atom = 0x67002 - Mtext Atom = 0x34505 - Multiple Atom = 0x35308 - Muted Atom = 0x35b05 - Name Atom = 0xa604 + Malignmark Atom = 0xb00a + Manifest Atom = 0x6d708 + Map Atom = 0x31803 + Mark Atom = 0xb604 + Marquee Atom = 0x32707 + Math Atom = 0x32e04 + Max Atom = 0x33d03 + Maxlength Atom = 0x33d09 + Media Atom = 0xe605 + Mediagroup Atom = 0xe60a + Menu Atom = 0x38704 + Menuitem Atom = 0x38708 + Meta Atom = 0x4b804 + Meter Atom = 0x9805 + Method Atom = 0x2a806 + Mglyph Atom = 0x30806 + Mi Atom = 0x34702 + Min Atom = 0x34703 + Minlength Atom = 0x34709 + Mn Atom = 0x2b102 + Mo Atom = 0xa402 + Ms Atom = 0x67402 + Mtext Atom = 0x35105 + Multiple Atom = 0x35f08 + Muted Atom = 0x36705 + Name Atom = 0x9604 Nav Atom = 0x1303 Nobr Atom = 0x3704 - Noembed Atom = 0x4007 - Noframes Atom = 0x5508 - Nomodule Atom = 0x6108 - Nonce Atom = 0x56205 - Noscript Atom = 0x1fe08 - Novalidate Atom = 0x29a0a - Object Atom = 0x25006 - Ol Atom = 0x10102 - Onabort Atom = 0x17607 - Onafterprint Atom = 0x21e0c - Onautocomplete Atom = 0x25e0e - Onautocompleteerror Atom = 0x25e13 - Onauxclick Atom = 0x61b0a - Onbeforeprint Atom = 0x69a0d - Onbeforeunload Atom = 0x6e10e - Onblur Atom = 0x5c206 - Oncancel Atom = 0xd308 - Oncanplay Atom = 0x13609 - Oncanplaythrough Atom = 0x13610 - Onchange Atom = 0x40f08 - Onclick Atom = 0x2dd07 - Onclose Atom = 0x36007 - Oncontextmenu Atom = 0x3720d - Oncopy Atom = 0x38506 - Oncuechange Atom = 0x38b0b - Oncut Atom = 0x39605 - Ondblclick Atom = 0x39b0a - Ondrag Atom = 0x3a506 - Ondragend Atom = 0x3a509 - Ondragenter Atom = 0x3ae0b - Ondragexit Atom = 0x3b90a - Ondragleave Atom = 0x3d30b - Ondragover Atom = 0x3de0a - Ondragstart Atom = 0x3e80b - Ondrop Atom = 0x3f706 - Ondurationchange Atom = 0x40710 - Onemptied Atom = 0x3fe09 - Onended Atom = 0x41707 - Onerror Atom = 0x41e07 - Onfocus Atom = 0x42507 - Onhashchange Atom = 0x4310c - Oninput Atom = 0x43d07 - Oninvalid Atom = 0x44909 - Onkeydown Atom = 0x45209 - Onkeypress Atom = 0x45f0a - Onkeyup Atom = 0x47407 - Onlanguagechange Atom = 0x48110 - Onload Atom = 0x49106 - Onloadeddata Atom = 0x4910c - Onloadedmetadata Atom = 0x4a410 - Onloadend Atom = 0x4ba09 - Onloadstart Atom = 0x4c30b - Onmessage Atom = 0x4ce09 - Onmessageerror Atom = 0x4ce0e - Onmousedown Atom = 0x4dc0b - Onmouseenter Atom = 0x4e70c - Onmouseleave Atom = 0x4f30c - Onmousemove Atom = 0x4ff0b - Onmouseout Atom = 0x50a0a - Onmouseover Atom = 0x5170b - Onmouseup Atom = 0x52209 - Onmousewheel Atom = 0x5300c - Onoffline Atom = 0x53c09 - Ononline Atom = 0x54508 - Onpagehide Atom = 0x54d0a - Onpageshow Atom = 0x5670a - Onpaste Atom = 0x57307 - Onpause Atom = 0x58e07 - Onplay Atom = 0x59806 - Onplaying Atom = 0x59809 - Onpopstate Atom = 0x5a10a - Onprogress Atom = 0x5ab0a - Onratechange Atom = 0x5c80c - Onrejectionhandled Atom = 0x5d412 - Onreset Atom = 0x5e607 - Onresize Atom = 0x5ed08 - Onscroll Atom = 0x5fc08 - Onsecuritypolicyviolation Atom = 0x60419 - Onseeked Atom = 0x62508 - Onseeking Atom = 0x62d09 - Onselect Atom = 0x63608 - Onshow Atom = 0x64006 - Onsort Atom = 0x64b06 - Onstalled Atom = 0x65509 - Onstorage Atom = 0x65e09 - Onsubmit Atom = 0x66708 - Onsuspend Atom = 0x67709 - Ontimeupdate Atom = 0x11a0c - Ontoggle Atom = 0x68008 - Onunhandledrejection Atom = 0x68814 - Onunload Atom = 0x6a708 - Onvolumechange Atom = 0x6af0e - Onwaiting Atom = 0x6bd09 - Onwheel Atom = 0x6c607 - Open Atom = 0x55f04 - Optgroup Atom = 0xe008 - Optimum Atom = 0x6cd07 - Option Atom = 0x6dd06 - Output Atom = 0x51106 + Noembed Atom = 0x6c07 + Noframes Atom = 0x8908 + Nomodule Atom = 0xa208 + Nonce Atom = 0x1a605 + Noscript Atom = 0x21608 + Novalidate Atom = 0x2b20a + Object Atom = 0x26806 + Ol Atom = 0x13702 + Onabort Atom = 0x19507 + Onafterprint Atom = 0x2360c + Onautocomplete Atom = 0x2760e + Onautocompleteerror Atom = 0x27613 + Onauxclick Atom = 0x61f0a + Onbeforeprint Atom = 0x69e0d + Onbeforeunload Atom = 0x6e70e + Onblur Atom = 0x56d06 + Oncancel Atom = 0x11908 + Oncanplay Atom = 0x14d09 + Oncanplaythrough Atom = 0x14d10 + Onchange Atom = 0x41b08 + Onclick Atom = 0x2f507 + Onclose Atom = 0x36c07 + Oncontextmenu Atom = 0x37e0d + Oncopy Atom = 0x39106 + Oncuechange Atom = 0x3970b + Oncut Atom = 0x3a205 + Ondblclick Atom = 0x3a70a + Ondrag Atom = 0x3b106 + Ondragend Atom = 0x3b109 + Ondragenter Atom = 0x3ba0b + Ondragexit Atom = 0x3c50a + Ondragleave Atom = 0x3df0b + Ondragover Atom = 0x3ea0a + Ondragstart Atom = 0x3f40b + Ondrop Atom = 0x40306 + Ondurationchange Atom = 0x41310 + Onemptied Atom = 0x40a09 + Onended Atom = 0x42307 + Onerror Atom = 0x42a07 + Onfocus Atom = 0x43107 + Onhashchange Atom = 0x43d0c + Oninput Atom = 0x44907 + Oninvalid Atom = 0x45509 + Onkeydown Atom = 0x45e09 + Onkeypress Atom = 0x46b0a + Onkeyup Atom = 0x48007 + Onlanguagechange Atom = 0x48d10 + Onload Atom = 0x49d06 + Onloadeddata Atom = 0x49d0c + Onloadedmetadata Atom = 0x4b010 + Onloadend Atom = 0x4c609 + Onloadstart Atom = 0x4cf0b + Onmessage Atom = 0x4da09 + Onmessageerror Atom = 0x4da0e + Onmousedown Atom = 0x4e80b + Onmouseenter Atom = 0x4f30c + Onmouseleave Atom = 0x4ff0c + Onmousemove Atom = 0x50b0b + Onmouseout Atom = 0x5160a + Onmouseover Atom = 0x5230b + Onmouseup Atom = 0x52e09 + Onmousewheel Atom = 0x53c0c + Onoffline Atom = 0x54809 + Ononline Atom = 0x55108 + Onpagehide Atom = 0x5590a + Onpageshow Atom = 0x5730a + Onpaste Atom = 0x57f07 + Onpause Atom = 0x59a07 + Onplay Atom = 0x5a406 + Onplaying Atom = 0x5a409 + Onpopstate Atom = 0x5ad0a + Onprogress Atom = 0x5b70a + Onratechange Atom = 0x5cc0c + Onrejectionhandled Atom = 0x5d812 + Onreset Atom = 0x5ea07 + Onresize Atom = 0x5f108 + Onscroll Atom = 0x60008 + Onsecuritypolicyviolation Atom = 0x60819 + Onseeked Atom = 0x62908 + Onseeking Atom = 0x63109 + Onselect Atom = 0x63a08 + Onshow Atom = 0x64406 + Onsort Atom = 0x64f06 + Onstalled Atom = 0x65909 + Onstorage Atom = 0x66209 + Onsubmit Atom = 0x66b08 + Onsuspend Atom = 0x67b09 + Ontimeupdate Atom = 0x400c + Ontoggle Atom = 0x68408 + Onunhandledrejection Atom = 0x68c14 + Onunload Atom = 0x6ab08 + Onvolumechange Atom = 0x6b30e + Onwaiting Atom = 0x6c109 + Onwheel Atom = 0x6ca07 + Open Atom = 0x1a304 + Optgroup Atom = 0x5f08 + Optimum Atom = 0x6d107 + Option Atom = 0x6e306 + Output Atom = 0x51d06 P Atom = 0xc01 Param Atom = 0xc05 - Pattern Atom = 0x4f07 - Picture Atom = 0x9707 - Ping Atom = 0xe704 - Placeholder Atom = 0xfb0b - Plaintext Atom = 0x19e09 - Playsinline Atom = 0x10a0b - Poster Atom = 0x2b706 - Pre Atom = 0x46403 - Preload Atom = 0x47a07 - Progress Atom = 0x5ad08 - Prompt Atom = 0x52a06 - Public Atom = 0x57a06 - Q Atom = 0x7701 + Pattern Atom = 0x6607 + Picture Atom = 0x7b07 + Ping Atom = 0xef04 + Placeholder Atom = 0x1310b + Plaintext Atom = 0x1b209 + Playsinline Atom = 0x1400b + Poster Atom = 0x2cf06 + Pre Atom = 0x47003 + Preload Atom = 0x48607 + Progress Atom = 0x5b908 + Prompt Atom = 0x53606 + Public Atom = 0x58606 + Q Atom = 0xcf01 Radiogroup Atom = 0x30a - Readonly Atom = 0x34b08 - Referrerpolicy Atom = 0x3c50e - Rel Atom = 0x47b03 - Required Atom = 0x23408 - Reversed Atom = 0x9c08 - Rows Atom = 0x3a04 - Rowspan Atom = 0x3a07 - Rp Atom = 0x22402 - Rt Atom = 0x17b02 - Ruby Atom = 0xac04 + Rb Atom = 0x3a02 + Readonly Atom = 0x35708 + Referrerpolicy Atom = 0x3d10e + Rel Atom = 0x48703 + Required Atom = 0x24c08 + Reversed Atom = 0x8008 + Rows Atom = 0x9c04 + Rowspan Atom = 0x9c07 + Rp Atom = 0x23c02 + Rt Atom = 0x19a02 + Rtc Atom = 0x19a03 + Ruby Atom = 0xfb04 S Atom = 0x2501 - Samp Atom = 0x4c04 - Sandbox Atom = 0xf307 - Scope Atom = 0x67105 - Scoped Atom = 0x67106 - Script Atom = 0x20006 - Seamless Atom = 0x36508 - Section Atom = 0x5bd07 - Select Atom = 0x63806 - Selected Atom = 0x63808 - Shape Atom = 0x1d505 - Size Atom = 0x5f104 - Sizes Atom = 0x5f105 - Slot Atom = 0x1df04 - Small Atom = 0x1ee05 - Sortable Atom = 0x64d08 - Sorted Atom = 0x32b06 - Source Atom = 0x36c06 - Spacer Atom = 0x42b06 - Span Atom = 0x3d04 - Spellcheck Atom = 0x4680a - Src Atom = 0x5b403 - Srcdoc Atom = 0x5b406 - Srclang Atom = 0x5f507 - Srcset Atom = 0x6f306 - Start Atom = 0x3ee05 - Step Atom = 0x57704 - Strike Atom = 0x7a06 - Strong Atom = 0x31506 - Style Atom = 0x6f905 - Sub Atom = 0x66903 - Summary Atom = 0x6fe07 - Sup Atom = 0x70503 - Svg Atom = 0x70803 - System Atom = 0x70b06 - Tabindex Atom = 0x4b208 - Table Atom = 0x58905 - Target Atom = 0x2ac06 + Samp Atom = 0x7804 + Sandbox Atom = 0x12907 + Scope Atom = 0x67505 + Scoped Atom = 0x67506 + Script Atom = 0x21806 + Seamless Atom = 0x37108 + Section Atom = 0x56807 + Select Atom = 0x63c06 + Selected Atom = 0x63c08 + Shape Atom = 0x1e505 + Size Atom = 0x5f504 + Sizes Atom = 0x5f505 + Slot Atom = 0x1ef04 + Small Atom = 0x20605 + Sortable Atom = 0x65108 + Sorted Atom = 0x33706 + Source Atom = 0x37806 + Spacer Atom = 0x43706 + Span Atom = 0x9f04 + Spellcheck Atom = 0x4740a + Src Atom = 0x5c003 + Srcdoc Atom = 0x5c006 + Srclang Atom = 0x5f907 + Srcset Atom = 0x6f906 + Start Atom = 0x3fa05 + Step Atom = 0x58304 + Strike Atom = 0xd206 + Strong Atom = 0x6dd06 + Style Atom = 0x6ff05 + Sub Atom = 0x66d03 + Summary Atom = 0x70407 + Sup Atom = 0x70b03 + Svg Atom = 0x70e03 + System Atom = 0x71106 + Tabindex Atom = 0x4be08 + Table Atom = 0x59505 + Target Atom = 0x2c406 Tbody Atom = 0x2705 - Td Atom = 0x5e02 - Template Atom = 0x70e08 - Textarea Atom = 0x34608 - Tfoot Atom = 0xb205 - Th Atom = 0x13f02 - Thead Atom = 0x32405 - Time Atom = 0x11c04 - Title Atom = 0xca05 - Tr Atom = 0x7402 - Track Atom = 0x17c05 - Translate Atom = 0x1a609 - Tt Atom = 0x5102 - Type Atom = 0x8104 - Typemustmatch Atom = 0x2780d + Td Atom = 0x9202 + Template Atom = 0x71408 + Textarea Atom = 0x35208 + Tfoot Atom = 0xf505 + Th Atom = 0x15602 + Thead Atom = 0x33005 + Time Atom = 0x4204 + Title Atom = 0x11005 + Tr Atom = 0xcc02 + Track Atom = 0x1ba05 + Translate Atom = 0x1f209 + Tt Atom = 0x6802 + Type Atom = 0xd904 + Typemustmatch Atom = 0x2900d U Atom = 0xb01 - Ul Atom = 0x6602 - Updateviacache Atom = 0x1200e - Usemap Atom = 0x59206 + Ul Atom = 0xa702 + Updateviacache Atom = 0x460e + Usemap Atom = 0x59e06 Value Atom = 0x1505 - Var Atom = 0x15603 - Video Atom = 0x2d905 - Wbr Atom = 0x57003 - Width Atom = 0x64505 - Workertype Atom = 0x7160a - Wrap Atom = 0x72004 - Xmp Atom = 0xf903 + Var Atom = 0x16d03 + Video Atom = 0x2f105 + Wbr Atom = 0x57c03 + Width Atom = 0x64905 + Workertype Atom = 0x71c0a + Wrap Atom = 0x72604 + Xmp Atom = 0x12f03 ) const hash0 = 0x81cdf10e @@ -377,401 +380,404 @@ const hash0 = 0x81cdf10e const maxAtomLen = 25 var table = [1 << 9]Atom{ - 0x1: 0x8e0a, // mediagroup - 0x2: 0x2cc04, // lang + 0x1: 0xe60a, // mediagroup + 0x2: 0x2e404, // lang 0x4: 0x2c09, // accesskey - 0x5: 0x5708, // frameset - 0x7: 0x63608, // onselect - 0x8: 0x70b06, // system - 0xa: 0x64505, // width - 0xc: 0x2710b, // formenctype - 0xd: 0x10102, // ol - 0xe: 0x38b0b, // oncuechange - 0x10: 0x13403, // bdo - 0x11: 0xcf05, // audio - 0x12: 0x18309, // draggable - 0x14: 0x2d905, // video - 0x15: 0x29902, // mn - 0x16: 0x37b04, // menu - 0x17: 0x2b706, // poster - 0x19: 0xb306, // footer - 0x1a: 0x29006, // method - 0x1b: 0x2a008, // datetime - 0x1c: 0x17607, // onabort - 0x1d: 0x1200e, // updateviacache - 0x1e: 0xb905, // async - 0x1f: 0x49106, // onload - 0x21: 0xd308, // oncancel - 0x22: 0x62508, // onseeked - 0x23: 0x2ea05, // image - 0x24: 0x5d412, // onrejectionhandled - 0x26: 0x15d04, // link - 0x27: 0x51106, // output - 0x28: 0x32504, // head - 0x29: 0x4f30c, // onmouseleave - 0x2a: 0x57307, // onpaste - 0x2b: 0x59809, // onplaying - 0x2c: 0x1b407, // colspan - 0x2f: 0x1af05, // color - 0x30: 0x5f104, // size - 0x31: 0x2d00a, // http-equiv + 0x5: 0x8b08, // frameset + 0x7: 0x63a08, // onselect + 0x8: 0x71106, // system + 0xa: 0x64905, // width + 0xc: 0x2890b, // formenctype + 0xd: 0x13702, // ol + 0xe: 0x3970b, // oncuechange + 0x10: 0x14b03, // bdo + 0x11: 0x11505, // audio + 0x12: 0x17a09, // draggable + 0x14: 0x2f105, // video + 0x15: 0x2b102, // mn + 0x16: 0x38704, // menu + 0x17: 0x2cf06, // poster + 0x19: 0xf606, // footer + 0x1a: 0x2a806, // method + 0x1b: 0x2b808, // datetime + 0x1c: 0x19507, // onabort + 0x1d: 0x460e, // updateviacache + 0x1e: 0xff05, // async + 0x1f: 0x49d06, // onload + 0x21: 0x11908, // oncancel + 0x22: 0x62908, // onseeked + 0x23: 0x30205, // image + 0x24: 0x5d812, // onrejectionhandled + 0x26: 0x17404, // link + 0x27: 0x51d06, // output + 0x28: 0x33104, // head + 0x29: 0x4ff0c, // onmouseleave + 0x2a: 0x57f07, // onpaste + 0x2b: 0x5a409, // onplaying + 0x2c: 0x1c407, // colspan + 0x2f: 0x1bf05, // color + 0x30: 0x5f504, // size + 0x31: 0x2e80a, // http-equiv 0x33: 0x601, // i - 0x34: 0x54d0a, // onpagehide - 0x35: 0x68814, // onunhandledrejection - 0x37: 0x41e07, // onerror - 0x3a: 0x11508, // basefont + 0x34: 0x5590a, // onpagehide + 0x35: 0x68c14, // onunhandledrejection + 0x37: 0x42a07, // onerror + 0x3a: 0x3b08, // basefont 0x3f: 0x1303, // nav - 0x40: 0x18004, // kind - 0x41: 0x34b08, // readonly - 0x42: 0x2f006, // mglyph - 0x44: 0x11102, // li - 0x46: 0x2bd06, // hidden - 0x47: 0x70803, // svg - 0x48: 0x57704, // step - 0x49: 0x22709, // integrity - 0x4a: 0x57a06, // public - 0x4c: 0x19703, // col - 0x4d: 0x1680a, // blockquote - 0x4e: 0x34302, // h5 - 0x50: 0x5ad08, // progress - 0x51: 0x5f105, // sizes - 0x52: 0x33902, // h4 - 0x56: 0x32405, // thead - 0x57: 0x7e07, // keytype - 0x58: 0x5ab0a, // onprogress - 0x59: 0x43f09, // inputmode - 0x5a: 0x3a509, // ondragend - 0x5d: 0x39605, // oncut - 0x5e: 0x42b06, // spacer - 0x5f: 0x19708, // colgroup - 0x62: 0x14e02, // is - 0x65: 0xb902, // as - 0x66: 0x53c09, // onoffline - 0x67: 0x32b06, // sorted - 0x69: 0x48110, // onlanguagechange - 0x6c: 0x4310c, // onhashchange - 0x6d: 0xa604, // name - 0x6e: 0xb205, // tfoot - 0x6f: 0x55504, // desc - 0x70: 0x33103, // max - 0x72: 0x1da06, // coords - 0x73: 0x2f502, // h3 - 0x74: 0x6e10e, // onbeforeunload - 0x75: 0x3a04, // rows - 0x76: 0x63806, // select - 0x77: 0xa805, // meter - 0x78: 0x37f06, // itemid - 0x79: 0x5300c, // onmousewheel - 0x7a: 0x5b406, // srcdoc - 0x7d: 0x17c05, // track - 0x7f: 0x30708, // itemtype - 0x82: 0x6302, // mo - 0x83: 0x40f08, // onchange - 0x84: 0x32507, // headers - 0x85: 0x5c80c, // onratechange - 0x86: 0x60419, // onsecuritypolicyviolation - 0x88: 0x49908, // datalist - 0x89: 0x4dc0b, // onmousedown - 0x8a: 0x1df04, // slot - 0x8b: 0x4a410, // onloadedmetadata + 0x40: 0x17704, // kind + 0x41: 0x35708, // readonly + 0x42: 0x30806, // mglyph + 0x44: 0xb202, // li + 0x46: 0x2d506, // hidden + 0x47: 0x70e03, // svg + 0x48: 0x58304, // step + 0x49: 0x23f09, // integrity + 0x4a: 0x58606, // public + 0x4c: 0x1ab03, // col + 0x4d: 0x1870a, // blockquote + 0x4e: 0x34f02, // h5 + 0x50: 0x5b908, // progress + 0x51: 0x5f505, // sizes + 0x52: 0x34502, // h4 + 0x56: 0x33005, // thead + 0x57: 0xd607, // keytype + 0x58: 0x5b70a, // onprogress + 0x59: 0x44b09, // inputmode + 0x5a: 0x3b109, // ondragend + 0x5d: 0x3a205, // oncut + 0x5e: 0x43706, // spacer + 0x5f: 0x1ab08, // colgroup + 0x62: 0x16502, // is + 0x65: 0x3c02, // as + 0x66: 0x54809, // onoffline + 0x67: 0x33706, // sorted + 0x69: 0x48d10, // onlanguagechange + 0x6c: 0x43d0c, // onhashchange + 0x6d: 0x9604, // name + 0x6e: 0xf505, // tfoot + 0x6f: 0x56104, // desc + 0x70: 0x33d03, // max + 0x72: 0x1ea06, // coords + 0x73: 0x30d02, // h3 + 0x74: 0x6e70e, // onbeforeunload + 0x75: 0x9c04, // rows + 0x76: 0x63c06, // select + 0x77: 0x9805, // meter + 0x78: 0x38b06, // itemid + 0x79: 0x53c0c, // onmousewheel + 0x7a: 0x5c006, // srcdoc + 0x7d: 0x1ba05, // track + 0x7f: 0x31f08, // itemtype + 0x82: 0xa402, // mo + 0x83: 0x41b08, // onchange + 0x84: 0x33107, // headers + 0x85: 0x5cc0c, // onratechange + 0x86: 0x60819, // onsecuritypolicyviolation + 0x88: 0x4a508, // datalist + 0x89: 0x4e80b, // onmousedown + 0x8a: 0x1ef04, // slot + 0x8b: 0x4b010, // onloadedmetadata 0x8c: 0x1a06, // accept - 0x8d: 0x25006, // object - 0x91: 0x6af0e, // onvolumechange + 0x8d: 0x26806, // object + 0x91: 0x6b30e, // onvolumechange 0x92: 0x2107, // charset - 0x93: 0x25e13, // onautocompleteerror - 0x94: 0x6913, // allowpaymentrequest + 0x93: 0x27613, // onautocompleteerror + 0x94: 0xc113, // allowpaymentrequest 0x95: 0x2804, // body - 0x96: 0xc407, // default - 0x97: 0x63808, // selected - 0x98: 0x20604, // face - 0x99: 0x1d505, // shape - 0x9b: 0x68008, // ontoggle - 0x9e: 0x64702, // dt - 0x9f: 0x6d904, // mark + 0x96: 0x10a07, // default + 0x97: 0x63c08, // selected + 0x98: 0x21e04, // face + 0x99: 0x1e505, // shape + 0x9b: 0x68408, // ontoggle + 0x9e: 0x64b02, // dt + 0x9f: 0xb604, // mark 0xa1: 0xb01, // u - 0xa4: 0x6a708, // onunload - 0xa5: 0xde04, // loop - 0xa6: 0x14d08, // disabled - 0xaa: 0x41707, // onended - 0xab: 0x6d30a, // malignmark - 0xad: 0x67709, // onsuspend - 0xae: 0x34505, // mtext - 0xaf: 0x64b06, // onsort - 0xb0: 0x55908, // itemprop - 0xb3: 0x66d09, // itemscope - 0xb4: 0x15c05, // blink - 0xb6: 0x3a506, // ondrag - 0xb7: 0x6602, // ul - 0xb8: 0x25604, // form - 0xb9: 0xf307, // sandbox - 0xba: 0x5705, // frame + 0xa4: 0x6ab08, // onunload + 0xa5: 0x5d04, // loop + 0xa6: 0x16408, // disabled + 0xaa: 0x42307, // onended + 0xab: 0xb00a, // malignmark + 0xad: 0x67b09, // onsuspend + 0xae: 0x35105, // mtext + 0xaf: 0x64f06, // onsort + 0xb0: 0x19d08, // itemprop + 0xb3: 0x67109, // itemscope + 0xb4: 0x17305, // blink + 0xb6: 0x3b106, // ondrag + 0xb7: 0xa702, // ul + 0xb8: 0x26e04, // form + 0xb9: 0x12907, // sandbox + 0xba: 0x8b05, // frame 0xbb: 0x1505, // value - 0xbc: 0x65e09, // onstorage - 0xc0: 0x17b02, // rt + 0xbc: 0x66209, // onstorage + 0xbf: 0xaa07, // acronym + 0xc0: 0x19a02, // rt 0xc2: 0x202, // br - 0xc3: 0x20e08, // fieldset - 0xc4: 0x2780d, // typemustmatch - 0xc5: 0x6108, // nomodule - 0xc6: 0x4007, // noembed - 0xc7: 0x69a0d, // onbeforeprint - 0xc8: 0x17206, // button - 0xc9: 0x2dd07, // onclick - 0xca: 0x6fe07, // summary - 0xcd: 0xac04, // ruby - 0xce: 0x5b905, // class - 0xcf: 0x3e80b, // ondragstart - 0xd0: 0x21907, // caption - 0xd4: 0x850e, // allowusermedia - 0xd5: 0x4c30b, // onloadstart - 0xd9: 0x15403, // div - 0xda: 0x49d04, // list - 0xdb: 0x32204, // math - 0xdc: 0x43f05, // input - 0xdf: 0x3de0a, // ondragover - 0xe0: 0x2c602, // h2 - 0xe2: 0x19e09, // plaintext - 0xe4: 0x4e70c, // onmouseenter - 0xe7: 0x46d07, // checked - 0xe8: 0x46403, // pre - 0xea: 0x35308, // multiple - 0xeb: 0x16103, // bdi - 0xec: 0x33109, // maxlength - 0xed: 0x7701, // q - 0xee: 0x61b0a, // onauxclick - 0xf0: 0x57003, // wbr - 0xf2: 0x11504, // base - 0xf3: 0x6dd06, // option - 0xf5: 0x40710, // ondurationchange - 0xf7: 0x5508, // noframes - 0xf9: 0x3f908, // dropzone - 0xfb: 0x67105, // scope - 0xfc: 0x9c08, // reversed - 0xfd: 0x3ae0b, // ondragenter - 0xfe: 0x3ee05, // start - 0xff: 0xf903, // xmp - 0x100: 0x5f507, // srclang - 0x101: 0x2ef03, // img + 0xc3: 0x22608, // fieldset + 0xc4: 0x2900d, // typemustmatch + 0xc5: 0xa208, // nomodule + 0xc6: 0x6c07, // noembed + 0xc7: 0x69e0d, // onbeforeprint + 0xc8: 0x19106, // button + 0xc9: 0x2f507, // onclick + 0xca: 0x70407, // summary + 0xcd: 0xfb04, // ruby + 0xce: 0x56405, // class + 0xcf: 0x3f40b, // ondragstart + 0xd0: 0x23107, // caption + 0xd4: 0xdd0e, // allowusermedia + 0xd5: 0x4cf0b, // onloadstart + 0xd9: 0x16b03, // div + 0xda: 0x4a904, // list + 0xdb: 0x32e04, // math + 0xdc: 0x44b05, // input + 0xdf: 0x3ea0a, // ondragover + 0xe0: 0x2de02, // h2 + 0xe2: 0x1b209, // plaintext + 0xe4: 0x4f30c, // onmouseenter + 0xe7: 0x47907, // checked + 0xe8: 0x47003, // pre + 0xea: 0x35f08, // multiple + 0xeb: 0xba03, // bdi + 0xec: 0x33d09, // maxlength + 0xed: 0xcf01, // q + 0xee: 0x61f0a, // onauxclick + 0xf0: 0x57c03, // wbr + 0xf2: 0x3b04, // base + 0xf3: 0x6e306, // option + 0xf5: 0x41310, // ondurationchange + 0xf7: 0x8908, // noframes + 0xf9: 0x40508, // dropzone + 0xfb: 0x67505, // scope + 0xfc: 0x8008, // reversed + 0xfd: 0x3ba0b, // ondragenter + 0xfe: 0x3fa05, // start + 0xff: 0x12f03, // xmp + 0x100: 0x5f907, // srclang + 0x101: 0x30703, // img 0x104: 0x101, // b - 0x105: 0x23c03, // for - 0x106: 0xc105, // aside - 0x107: 0x43d07, // oninput - 0x108: 0x34a04, // area - 0x109: 0x28c0a, // formmethod - 0x10a: 0x72004, // wrap - 0x10c: 0x22402, // rp - 0x10d: 0x45f0a, // onkeypress - 0x10e: 0x5102, // tt - 0x110: 0x33b02, // mi - 0x111: 0x35b05, // muted - 0x112: 0xb003, // alt - 0x113: 0x19004, // code - 0x114: 0x4202, // em - 0x115: 0x3b90a, // ondragexit - 0x117: 0x3d04, // span - 0x119: 0x30f08, // manifest - 0x11a: 0x37b08, // menuitem - 0x11b: 0x57f07, // content - 0x11d: 0x6bd09, // onwaiting - 0x11f: 0x4ba09, // onloadend - 0x121: 0x3720d, // oncontextmenu - 0x123: 0x5c206, // onblur - 0x124: 0x3f007, // article - 0x125: 0xa303, // dir - 0x126: 0xe704, // ping - 0x127: 0x23408, // required - 0x128: 0x44909, // oninvalid - 0x129: 0x6d405, // align - 0x12b: 0x57e04, // icon - 0x12c: 0x64902, // h6 - 0x12d: 0x1b404, // cols - 0x12e: 0x2160a, // figcaption - 0x12f: 0x45209, // onkeydown - 0x130: 0x66708, // onsubmit - 0x131: 0x13609, // oncanplay - 0x132: 0x70503, // sup + 0x105: 0x25403, // for + 0x106: 0x10705, // aside + 0x107: 0x44907, // oninput + 0x108: 0x35604, // area + 0x109: 0x2a40a, // formmethod + 0x10a: 0x72604, // wrap + 0x10c: 0x23c02, // rp + 0x10d: 0x46b0a, // onkeypress + 0x10e: 0x6802, // tt + 0x110: 0x34702, // mi + 0x111: 0x36705, // muted + 0x112: 0xf303, // alt + 0x113: 0x5c504, // code + 0x114: 0x6e02, // em + 0x115: 0x3c50a, // ondragexit + 0x117: 0x9f04, // span + 0x119: 0x6d708, // manifest + 0x11a: 0x38708, // menuitem + 0x11b: 0x58b07, // content + 0x11d: 0x6c109, // onwaiting + 0x11f: 0x4c609, // onloadend + 0x121: 0x37e0d, // oncontextmenu + 0x123: 0x56d06, // onblur + 0x124: 0x3fc07, // article + 0x125: 0x9303, // dir + 0x126: 0xef04, // ping + 0x127: 0x24c08, // required + 0x128: 0x45509, // oninvalid + 0x129: 0xb105, // align + 0x12b: 0x58a04, // icon + 0x12c: 0x64d02, // h6 + 0x12d: 0x1c404, // cols + 0x12e: 0x22e0a, // figcaption + 0x12f: 0x45e09, // onkeydown + 0x130: 0x66b08, // onsubmit + 0x131: 0x14d09, // oncanplay + 0x132: 0x70b03, // sup 0x133: 0xc01, // p - 0x135: 0x3fe09, // onemptied - 0x136: 0x38506, // oncopy - 0x137: 0x55804, // cite - 0x138: 0x39b0a, // ondblclick - 0x13a: 0x4ff0b, // onmousemove - 0x13c: 0x66903, // sub - 0x13d: 0x47b03, // rel - 0x13e: 0xe008, // optgroup - 0x142: 0x3a07, // rowspan - 0x143: 0x36c06, // source - 0x144: 0x1fe08, // noscript - 0x145: 0x55f04, // open - 0x146: 0x1ec03, // ins - 0x147: 0x23c0d, // foreignObject - 0x148: 0x5a10a, // onpopstate - 0x14a: 0x27507, // enctype - 0x14b: 0x25e0e, // onautocomplete - 0x14c: 0x34608, // textarea - 0x14e: 0x2600c, // autocomplete - 0x14f: 0x14002, // hr - 0x150: 0x1ce08, // controls - 0x151: 0xc302, // id - 0x153: 0x21e0c, // onafterprint - 0x155: 0x2490d, // foreignobject - 0x156: 0x31b07, // marquee - 0x157: 0x58e07, // onpause - 0x158: 0x5e202, // dl - 0x159: 0x12c06, // height - 0x15a: 0x33b03, // min - 0x15b: 0xa307, // dirname - 0x15c: 0x1a609, // translate - 0x15d: 0x13004, // html - 0x15e: 0x33b09, // minlength - 0x15f: 0x47a07, // preload - 0x160: 0x70e08, // template - 0x161: 0x3d30b, // ondragleave - 0x164: 0x5b403, // src - 0x165: 0x31506, // strong - 0x167: 0x4c04, // samp - 0x168: 0x6ed07, // address - 0x169: 0x54508, // ononline - 0x16b: 0xfb0b, // placeholder - 0x16c: 0x2ac06, // target - 0x16d: 0x1ee05, // small - 0x16e: 0x6c607, // onwheel - 0x16f: 0x1b90a, // annotation - 0x170: 0x4680a, // spellcheck - 0x171: 0x4607, // details - 0x172: 0xbd06, // canvas - 0x173: 0xeb09, // autofocus + 0x135: 0x40a09, // onemptied + 0x136: 0x39106, // oncopy + 0x137: 0x19c04, // cite + 0x138: 0x3a70a, // ondblclick + 0x13a: 0x50b0b, // onmousemove + 0x13c: 0x66d03, // sub + 0x13d: 0x48703, // rel + 0x13e: 0x5f08, // optgroup + 0x142: 0x9c07, // rowspan + 0x143: 0x37806, // source + 0x144: 0x21608, // noscript + 0x145: 0x1a304, // open + 0x146: 0x20403, // ins + 0x147: 0x2540d, // foreignObject + 0x148: 0x5ad0a, // onpopstate + 0x14a: 0x28d07, // enctype + 0x14b: 0x2760e, // onautocomplete + 0x14c: 0x35208, // textarea + 0x14e: 0x2780c, // autocomplete + 0x14f: 0x15702, // hr + 0x150: 0x1de08, // controls + 0x151: 0x10902, // id + 0x153: 0x2360c, // onafterprint + 0x155: 0x2610d, // foreignobject + 0x156: 0x32707, // marquee + 0x157: 0x59a07, // onpause + 0x158: 0x5e602, // dl + 0x159: 0x5206, // height + 0x15a: 0x34703, // min + 0x15b: 0x9307, // dirname + 0x15c: 0x1f209, // translate + 0x15d: 0x5604, // html + 0x15e: 0x34709, // minlength + 0x15f: 0x48607, // preload + 0x160: 0x71408, // template + 0x161: 0x3df0b, // ondragleave + 0x162: 0x3a02, // rb + 0x164: 0x5c003, // src + 0x165: 0x6dd06, // strong + 0x167: 0x7804, // samp + 0x168: 0x6f307, // address + 0x169: 0x55108, // ononline + 0x16b: 0x1310b, // placeholder + 0x16c: 0x2c406, // target + 0x16d: 0x20605, // small + 0x16e: 0x6ca07, // onwheel + 0x16f: 0x1c90a, // annotation + 0x170: 0x4740a, // spellcheck + 0x171: 0x7207, // details + 0x172: 0x10306, // canvas + 0x173: 0x12109, // autofocus 0x174: 0xc05, // param - 0x176: 0x45708, // download - 0x177: 0x44603, // del - 0x178: 0x36007, // onclose - 0x179: 0x16003, // kbd - 0x17a: 0x30106, // applet - 0x17b: 0x2c804, // href - 0x17c: 0x5ed08, // onresize - 0x17e: 0x4910c, // onloadeddata - 0x180: 0x7402, // tr - 0x181: 0x2a80a, // formtarget - 0x182: 0xca05, // title - 0x183: 0x6f905, // style - 0x184: 0x7a06, // strike - 0x185: 0x59206, // usemap - 0x186: 0x2e406, // iframe + 0x176: 0x46308, // download + 0x177: 0x45203, // del + 0x178: 0x36c07, // onclose + 0x179: 0xb903, // kbd + 0x17a: 0x31906, // applet + 0x17b: 0x2e004, // href + 0x17c: 0x5f108, // onresize + 0x17e: 0x49d0c, // onloadeddata + 0x180: 0xcc02, // tr + 0x181: 0x2c00a, // formtarget + 0x182: 0x11005, // title + 0x183: 0x6ff05, // style + 0x184: 0xd206, // strike + 0x185: 0x59e06, // usemap + 0x186: 0x2fc06, // iframe 0x187: 0x1004, // main - 0x189: 0x9707, // picture - 0x18c: 0x2fe05, // ismap - 0x18e: 0x49904, // data - 0x18f: 0xda05, // label - 0x191: 0x3c50e, // referrerpolicy - 0x192: 0x13f02, // th - 0x194: 0x52a06, // prompt - 0x195: 0x5bd07, // section - 0x197: 0x6cd07, // optimum - 0x198: 0x2c304, // high - 0x199: 0x14502, // h1 - 0x19a: 0x65509, // onstalled - 0x19b: 0x15603, // var - 0x19c: 0x11c04, // time - 0x19e: 0x67002, // ms - 0x19f: 0x32506, // header - 0x1a0: 0x4ce09, // onmessage - 0x1a1: 0x56205, // nonce - 0x1a2: 0x2560a, // formaction - 0x1a3: 0x20806, // center + 0x189: 0x7b07, // picture + 0x18c: 0x31605, // ismap + 0x18e: 0x4a504, // data + 0x18f: 0x5905, // label + 0x191: 0x3d10e, // referrerpolicy + 0x192: 0x15602, // th + 0x194: 0x53606, // prompt + 0x195: 0x56807, // section + 0x197: 0x6d107, // optimum + 0x198: 0x2db04, // high + 0x199: 0x15c02, // h1 + 0x19a: 0x65909, // onstalled + 0x19b: 0x16d03, // var + 0x19c: 0x4204, // time + 0x19e: 0x67402, // ms + 0x19f: 0x33106, // header + 0x1a0: 0x4da09, // onmessage + 0x1a1: 0x1a605, // nonce + 0x1a2: 0x26e0a, // formaction + 0x1a3: 0x22006, // center 0x1a4: 0x3704, // nobr - 0x1a5: 0x58905, // table - 0x1a6: 0x49d07, // listing - 0x1a7: 0x18a06, // legend - 0x1a9: 0x28309, // challenge - 0x1aa: 0x23006, // figure - 0x1ab: 0x8e05, // media - 0x1ae: 0x8104, // type - 0x1af: 0x11904, // font - 0x1b0: 0x4ce0e, // onmessageerror - 0x1b1: 0x36508, // seamless - 0x1b2: 0x5f03, // dfn - 0x1b3: 0x19205, // defer - 0x1b4: 0x6b03, // low - 0x1b5: 0x62d09, // onseeking - 0x1b6: 0x5170b, // onmouseover - 0x1b7: 0x29a0a, // novalidate - 0x1b8: 0x7160a, // workertype - 0x1ba: 0x3c107, // itemref + 0x1a5: 0x59505, // table + 0x1a6: 0x4a907, // listing + 0x1a7: 0x18106, // legend + 0x1a9: 0x29b09, // challenge + 0x1aa: 0x24806, // figure + 0x1ab: 0xe605, // media + 0x1ae: 0xd904, // type + 0x1af: 0x3f04, // font + 0x1b0: 0x4da0e, // onmessageerror + 0x1b1: 0x37108, // seamless + 0x1b2: 0x8703, // dfn + 0x1b3: 0x5c705, // defer + 0x1b4: 0xc303, // low + 0x1b5: 0x19a03, // rtc + 0x1b6: 0x5230b, // onmouseover + 0x1b7: 0x2b20a, // novalidate + 0x1b8: 0x71c0a, // workertype + 0x1ba: 0x3cd07, // itemref 0x1bd: 0x1, // a - 0x1be: 0x30003, // map - 0x1bf: 0x11a0c, // ontimeupdate - 0x1c0: 0x14707, // bgsound + 0x1be: 0x31803, // map + 0x1bf: 0x400c, // ontimeupdate + 0x1c0: 0x15e07, // bgsound 0x1c1: 0x3206, // keygen 0x1c2: 0x2705, // tbody - 0x1c5: 0x64006, // onshow + 0x1c5: 0x64406, // onshow 0x1c7: 0x2501, // s - 0x1c8: 0x4f07, // pattern - 0x1cc: 0x13610, // oncanplaythrough - 0x1ce: 0x2bf02, // dd - 0x1cf: 0x6f306, // srcset - 0x1d0: 0x15903, // big - 0x1d2: 0x64d08, // sortable - 0x1d3: 0x47407, // onkeyup - 0x1d5: 0x59806, // onplay - 0x1d7: 0x4ac04, // meta - 0x1d8: 0x3f706, // ondrop - 0x1da: 0x5fc08, // onscroll - 0x1db: 0x1e30b, // crossorigin - 0x1dc: 0x5670a, // onpageshow + 0x1c8: 0x6607, // pattern + 0x1cc: 0x14d10, // oncanplaythrough + 0x1ce: 0x2d702, // dd + 0x1cf: 0x6f906, // srcset + 0x1d0: 0x17003, // big + 0x1d2: 0x65108, // sortable + 0x1d3: 0x48007, // onkeyup + 0x1d5: 0x5a406, // onplay + 0x1d7: 0x4b804, // meta + 0x1d8: 0x40306, // ondrop + 0x1da: 0x60008, // onscroll + 0x1db: 0x1fb0b, // crossorigin + 0x1dc: 0x5730a, // onpageshow 0x1dd: 0x4, // abbr - 0x1de: 0x5e02, // td - 0x1df: 0x57f0f, // contenteditable - 0x1e0: 0x25a06, // action - 0x1e1: 0x10a0b, // playsinline - 0x1e2: 0x42507, // onfocus - 0x1e3: 0x2c808, // hreflang - 0x1e5: 0x50a0a, // onmouseout - 0x1e6: 0x5e607, // onreset - 0x1e7: 0x10608, // autoplay - 0x1ea: 0x67106, // scoped + 0x1de: 0x9202, // td + 0x1df: 0x58b0f, // contenteditable + 0x1e0: 0x27206, // action + 0x1e1: 0x1400b, // playsinline + 0x1e2: 0x43107, // onfocus + 0x1e3: 0x2e008, // hreflang + 0x1e5: 0x5160a, // onmouseout + 0x1e6: 0x5ea07, // onreset + 0x1e7: 0x13c08, // autoplay + 0x1e8: 0x63109, // onseeking + 0x1ea: 0x67506, // scoped 0x1ec: 0x30a, // radiogroup - 0x1ee: 0x3740b, // contextmenu - 0x1ef: 0x52209, // onmouseup - 0x1f1: 0x2b206, // hgroup - 0x1f2: 0x1f00f, // allowfullscreen - 0x1f3: 0x4b208, // tabindex - 0x1f6: 0x2f707, // isindex + 0x1ee: 0x3800b, // contextmenu + 0x1ef: 0x52e09, // onmouseup + 0x1f1: 0x2ca06, // hgroup + 0x1f2: 0x2080f, // allowfullscreen + 0x1f3: 0x4be08, // tabindex + 0x1f6: 0x30f07, // isindex 0x1f7: 0x1a0e, // accept-charset - 0x1f8: 0x2960e, // formnovalidate - 0x1fb: 0x1b90e, // annotation-xml - 0x1fc: 0x4205, // embed - 0x1fd: 0x20006, // script - 0x1fe: 0x16206, // dialog - 0x1ff: 0x1c707, // command + 0x1f8: 0x2ae0e, // formnovalidate + 0x1fb: 0x1c90e, // annotation-xml + 0x1fc: 0x6e05, // embed + 0x1fd: 0x21806, // script + 0x1fe: 0xbb06, // dialog + 0x1ff: 0x1d707, // command } -const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobro" + - "wspanoembedetailsampatternoframesetdfnomoduleallowpaymentreq" + - "uestrikeytypeallowusermediagroupictureversedirnameterubyaltf" + - "ooterasyncanvasidefaultitleaudioncancelabelooptgroupingautof" + - "ocusandboxmplaceholderautoplaysinlinebasefontimeupdateviacac" + - "heightmlbdoncanplaythrough1bgsoundisabledivarbigblinkbdialog" + - "blockquotebuttonabortrackindraggablegendcodefercolgrouplaint" + - "extranslatecolorcolspannotation-xmlcommandcontrolshapecoords" + - "lotcrossoriginsmallowfullscreenoscriptfacenterfieldsetfigcap" + - "tionafterprintegrityfigurequiredforeignObjectforeignobjectfo" + - "rmactionautocompleteerrorformenctypemustmatchallengeformmeth" + - "odformnovalidatetimeformtargethgrouposterhiddenhigh2hreflang" + - "http-equivideonclickiframeimageimglyph3isindexismappletitemt" + - "ypemanifestrongmarqueematheadersortedmaxlength4minlength5mte" + - "xtareadonlymultiplemutedoncloseamlessourceoncontextmenuitemi" + - "doncopyoncuechangeoncutondblclickondragendondragenterondrage" + - "xitemreferrerpolicyondragleaveondragoverondragstarticleondro" + - "pzonemptiedondurationchangeonendedonerroronfocuspaceronhashc" + - "hangeoninputmodeloninvalidonkeydownloadonkeypresspellchecked" + - "onkeyupreloadonlanguagechangeonloadeddatalistingonloadedmeta" + - "databindexonloadendonloadstartonmessageerroronmousedownonmou" + - "seenteronmouseleaveonmousemoveonmouseoutputonmouseoveronmous" + - "eupromptonmousewheelonofflineononlineonpagehidescitempropeno" + - "nceonpageshowbronpastepublicontenteditableonpausemaponplayin" + - "gonpopstateonprogressrcdoclassectionbluronratechangeonreject" + - "ionhandledonresetonresizesrclangonscrollonsecuritypolicyviol" + - "ationauxclickonseekedonseekingonselectedonshowidth6onsortabl" + - "eonstalledonstorageonsubmitemscopedonsuspendontoggleonunhand" + - "ledrejectionbeforeprintonunloadonvolumechangeonwaitingonwhee" + - "loptimumalignmarkoptionbeforeunloaddressrcsetstylesummarysup" + - "svgsystemplateworkertypewrap" +const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobrb" + + "asefontimeupdateviacacheightmlabelooptgroupatternoembedetail" + + "sampictureversedfnoframesetdirnameterowspanomoduleacronymali" + + "gnmarkbdialogallowpaymentrequestrikeytypeallowusermediagroup" + + "ingaltfooterubyasyncanvasidefaultitleaudioncancelautofocusan" + + "dboxmplaceholderautoplaysinlinebdoncanplaythrough1bgsoundisa" + + "bledivarbigblinkindraggablegendblockquotebuttonabortcitempro" + + "penoncecolgrouplaintextrackcolorcolspannotation-xmlcommandco" + + "ntrolshapecoordslotranslatecrossoriginsmallowfullscreenoscri" + + "ptfacenterfieldsetfigcaptionafterprintegrityfigurequiredfore" + + "ignObjectforeignobjectformactionautocompleteerrorformenctype" + + "mustmatchallengeformmethodformnovalidatetimeformtargethgroup" + + "osterhiddenhigh2hreflanghttp-equivideonclickiframeimageimgly" + + "ph3isindexismappletitemtypemarqueematheadersortedmaxlength4m" + + "inlength5mtextareadonlymultiplemutedoncloseamlessourceoncont" + + "extmenuitemidoncopyoncuechangeoncutondblclickondragendondrag" + + "enterondragexitemreferrerpolicyondragleaveondragoverondragst" + + "articleondropzonemptiedondurationchangeonendedonerroronfocus" + + "paceronhashchangeoninputmodeloninvalidonkeydownloadonkeypres" + + "spellcheckedonkeyupreloadonlanguagechangeonloadeddatalisting" + + "onloadedmetadatabindexonloadendonloadstartonmessageerroronmo" + + "usedownonmouseenteronmouseleaveonmousemoveonmouseoutputonmou" + + "seoveronmouseupromptonmousewheelonofflineononlineonpagehides" + + "classectionbluronpageshowbronpastepublicontenteditableonpaus" + + "emaponplayingonpopstateonprogressrcdocodeferonratechangeonre" + + "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" + + "violationauxclickonseekedonseekingonselectedonshowidth6onsor" + + "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" + + "handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" + + "wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" + + "arysupsvgsystemplateworkertypewrap" diff --git a/vendor/golang.org/x/net/html/atom/table_test.go b/vendor/golang.org/x/net/html/atom/table_test.go index 1689105..8a30762 100644 --- a/vendor/golang.org/x/net/html/atom/table_test.go +++ b/vendor/golang.org/x/net/html/atom/table_test.go @@ -10,6 +10,7 @@ var testAtomList = []string{ "accept", "accept-charset", "accesskey", + "acronym", "action", "address", "align", @@ -295,6 +296,7 @@ var testAtomList = []string{ "public", "q", "radiogroup", + "rb", "readonly", "referrerpolicy", "rel", @@ -304,6 +306,7 @@ var testAtomList = []string{ "rowspan", "rp", "rt", + "rtc", "ruby", "s", "samp", diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go index b37e621..5eb7c5a 100644 --- a/vendor/golang.org/x/net/html/const.go +++ b/vendor/golang.org/x/net/html/const.go @@ -4,7 +4,7 @@ package html -// Section 12.2.3.2 of the HTML5 specification says "The following elements +// Section 12.2.4.2 of the HTML5 specification says "The following elements // have varying levels of special parsing rules". // https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements var isSpecialElementMap = map[string]bool{ diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go index d3b3844..01477a9 100644 --- a/vendor/golang.org/x/net/html/foreign.go +++ b/vendor/golang.org/x/net/html/foreign.go @@ -67,7 +67,7 @@ func mathMLTextIntegrationPoint(n *Node) bool { return false } -// Section 12.2.5.5. +// Section 12.2.6.5. var breakout = map[string]bool{ "b": true, "big": true, @@ -115,7 +115,7 @@ var breakout = map[string]bool{ "var": true, } -// Section 12.2.5.5. +// Section 12.2.6.5. var svgTagNameAdjustments = map[string]string{ "altglyph": "altGlyph", "altglyphdef": "altGlyphDef", @@ -155,7 +155,7 @@ var svgTagNameAdjustments = map[string]string{ "textpath": "textPath", } -// Section 12.2.5.1 +// Section 12.2.6.1 var mathMLAttributeAdjustments = map[string]string{ "definitionurl": "definitionURL", } diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go index 26b657a..2c1cade 100644 --- a/vendor/golang.org/x/net/html/node.go +++ b/vendor/golang.org/x/net/html/node.go @@ -21,9 +21,10 @@ const ( scopeMarkerNode ) -// Section 12.2.3.3 says "scope markers are inserted when entering applet -// elements, buttons, object elements, marquees, table cells, and table -// captions, and are used to prevent formatting from 'leaking'". +// Section 12.2.4.3 says "The markers are inserted when entering applet, +// object, marquee, template, td, th, and caption elements, and are used +// to prevent formatting from "leaking" into applet, object, marquee, +// template, td, th, and caption elements". var scopeMarker = Node{Type: scopeMarkerNode} // A Node consists of a NodeType and some Data (tag name for element nodes, @@ -173,6 +174,16 @@ func (s *nodeStack) index(n *Node) int { return -1 } +// contains returns whether a is within s. +func (s *nodeStack) contains(a atom.Atom) bool { + for _, n := range *s { + if n.DataAtom == a { + return true + } + } + return false +} + // insert inserts a node at the given index. func (s *nodeStack) insert(i int, n *Node) { (*s) = append(*s, nil) @@ -191,3 +202,19 @@ func (s *nodeStack) remove(n *Node) { (*s)[j] = nil *s = (*s)[:j] } + +type insertionModeStack []insertionMode + +func (s *insertionModeStack) pop() (im insertionMode) { + i := len(*s) + im = (*s)[i-1] + *s = (*s)[:i-1] + return im +} + +func (s *insertionModeStack) top() insertionMode { + if i := len(*s); i > 0 { + return (*s)[i-1] + } + return nil +} diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go index be4b2bf..d23e05e 100644 --- a/vendor/golang.org/x/net/html/parse.go +++ b/vendor/golang.org/x/net/html/parse.go @@ -25,20 +25,22 @@ type parser struct { hasSelfClosingToken bool // doc is the document root element. doc *Node - // The stack of open elements (section 12.2.3.2) and active formatting - // elements (section 12.2.3.3). + // The stack of open elements (section 12.2.4.2) and active formatting + // elements (section 12.2.4.3). oe, afe nodeStack - // Element pointers (section 12.2.3.4). + // Element pointers (section 12.2.4.4). head, form *Node - // Other parsing state flags (section 12.2.3.5). + // Other parsing state flags (section 12.2.4.5). scripting, framesetOK bool + // The stack of template insertion modes + templateStack insertionModeStack // im is the current insertion mode. im insertionMode // originalIM is the insertion mode to go back to after completing a text // or inTableText insertion mode. originalIM insertionMode // fosterParenting is whether new elements should be inserted according to - // the foster parenting rules (section 12.2.5.3). + // the foster parenting rules (section 12.2.6.1). fosterParenting bool // quirks is whether the parser is operating in "quirks mode." quirks bool @@ -56,7 +58,7 @@ func (p *parser) top() *Node { return p.doc } -// Stop tags for use in popUntil. These come from section 12.2.3.2. +// Stop tags for use in popUntil. These come from section 12.2.4.2. var ( defaultScopeStopTags = map[string][]a.Atom{ "": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template}, @@ -79,7 +81,7 @@ const ( // popUntil pops the stack of open elements at the highest element whose tag // is in matchTags, provided there is no higher element in the scope's stop -// tags (as defined in section 12.2.3.2). It returns whether or not there was +// tags (as defined in section 12.2.4.2). It returns whether or not there was // such an element. If there was not, popUntil leaves the stack unchanged. // // For example, the set of stop tags for table scope is: "html", "table". If @@ -126,7 +128,7 @@ func (p *parser) indexOfElementInScope(s scope, matchTags ...a.Atom) int { return -1 } case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { + if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { return -1 } case selectScope: @@ -162,17 +164,17 @@ func (p *parser) clearStackToContext(s scope) { tagAtom := p.oe[i].DataAtom switch s { case tableScope: - if tagAtom == a.Html || tagAtom == a.Table { + if tagAtom == a.Html || tagAtom == a.Table || tagAtom == a.Template { p.oe = p.oe[:i+1] return } case tableRowScope: - if tagAtom == a.Html || tagAtom == a.Tr { + if tagAtom == a.Html || tagAtom == a.Tr || tagAtom == a.Template { p.oe = p.oe[:i+1] return } case tableBodyScope: - if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead { + if tagAtom == a.Html || tagAtom == a.Tbody || tagAtom == a.Tfoot || tagAtom == a.Thead || tagAtom == a.Template { p.oe = p.oe[:i+1] return } @@ -183,7 +185,7 @@ func (p *parser) clearStackToContext(s scope) { } // generateImpliedEndTags pops nodes off the stack of open elements as long as -// the top node has a tag name of dd, dt, li, option, optgroup, p, rp, or rt. +// the top node has a tag name of dd, dt, li, optgroup, option, p, rb, rp, rt or rtc. // If exceptions are specified, nodes with that name will not be popped off. func (p *parser) generateImpliedEndTags(exceptions ...string) { var i int @@ -192,7 +194,7 @@ loop: n := p.oe[i] if n.Type == ElementNode { switch n.DataAtom { - case a.Dd, a.Dt, a.Li, a.Option, a.Optgroup, a.P, a.Rp, a.Rt: + case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc: for _, except := range exceptions { if n.Data == except { break loop @@ -207,6 +209,27 @@ loop: p.oe = p.oe[:i+1] } +// generateAllImpliedEndTags pops nodes off the stack of open elements as long as +// the top node has a tag name of caption, colgroup, dd, div, dt, li, optgroup, option, p, rb, +// rp, rt, rtc, span, tbody, td, tfoot, th, thead or tr. +func (p *parser) generateAllImpliedEndTags() { + var i int + for i = len(p.oe) - 1; i >= 0; i-- { + n := p.oe[i] + if n.Type == ElementNode { + switch n.DataAtom { + // TODO: remove this divergence from the HTML5 spec + case a.Caption, a.Colgroup, a.Dd, a.Div, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, + a.Rp, a.Rt, a.Rtc, a.Span, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: + continue + } + } + break + } + + p.oe = p.oe[:i+1] +} + // addChild adds a child node n to the top element, and pushes n onto the stack // of open elements if it is an element node. func (p *parser) addChild(n *Node) { @@ -234,9 +257,9 @@ func (p *parser) shouldFosterParent() bool { } // fosterParent adds a child node according to the foster parenting rules. -// Section 12.2.5.3, "foster parenting". +// Section 12.2.6.1, "foster parenting". func (p *parser) fosterParent(n *Node) { - var table, parent, prev *Node + var table, parent, prev, template *Node var i int for i = len(p.oe) - 1; i >= 0; i-- { if p.oe[i].DataAtom == a.Table { @@ -245,6 +268,19 @@ func (p *parser) fosterParent(n *Node) { } } + var j int + for j = len(p.oe) - 1; j >= 0; j-- { + if p.oe[j].DataAtom == a.Template { + template = p.oe[j] + break + } + } + + if template != nil && (table == nil || j < i) { + template.AppendChild(n) + return + } + if table == nil { // The foster parent is the html element. parent = p.oe[0] @@ -304,7 +340,7 @@ func (p *parser) addElement() { }) } -// Section 12.2.3.3. +// Section 12.2.4.3. func (p *parser) addFormattingElement() { tagAtom, attr := p.tok.DataAtom, p.tok.Attr p.addElement() @@ -351,7 +387,7 @@ findIdenticalElements: p.afe = append(p.afe, p.top()) } -// Section 12.2.3.3. +// Section 12.2.4.3. func (p *parser) clearActiveFormattingElements() { for { n := p.afe.pop() @@ -361,7 +397,7 @@ func (p *parser) clearActiveFormattingElements() { } } -// Section 12.2.3.3. +// Section 12.2.4.3. func (p *parser) reconstructActiveFormattingElements() { n := p.afe.top() if n == nil { @@ -390,12 +426,12 @@ func (p *parser) reconstructActiveFormattingElements() { } } -// Section 12.2.4. +// Section 12.2.5. func (p *parser) acknowledgeSelfClosingTag() { p.hasSelfClosingToken = false } -// An insertion mode (section 12.2.3.1) is the state transition function from +// An insertion mode (section 12.2.4.1) is the state transition function from // a particular state in the HTML5 parser's state machine. It updates the // parser's fields depending on parser.tok (where ErrorToken means EOF). // It returns whether the token was consumed. @@ -403,7 +439,7 @@ type insertionMode func(*parser) bool // setOriginalIM sets the insertion mode to return to after completing a text or // inTableText insertion mode. -// Section 12.2.3.1, "using the rules for". +// Section 12.2.4.1, "using the rules for". func (p *parser) setOriginalIM() { if p.originalIM != nil { panic("html: bad parser state: originalIM was set twice") @@ -411,18 +447,38 @@ func (p *parser) setOriginalIM() { p.originalIM = p.im } -// Section 12.2.3.1, "reset the insertion mode". +// Section 12.2.4.1, "reset the insertion mode". func (p *parser) resetInsertionMode() { for i := len(p.oe) - 1; i >= 0; i-- { n := p.oe[i] - if i == 0 && p.context != nil { + last := i == 0 + if last && p.context != nil { n = p.context } switch n.DataAtom { case a.Select: + if !last { + for ancestor, first := n, p.oe[0]; ancestor != first; { + if ancestor == first { + break + } + ancestor = p.oe[p.oe.index(ancestor)-1] + switch ancestor.DataAtom { + case a.Template: + p.im = inSelectIM + return + case a.Table: + p.im = inSelectInTableIM + return + } + } + } p.im = inSelectIM case a.Td, a.Th: + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 p.im = inCellIM case a.Tr: p.im = inRowIM @@ -434,25 +490,37 @@ func (p *parser) resetInsertionMode() { p.im = inColumnGroupIM case a.Table: p.im = inTableIM + case a.Template: + p.im = p.templateStack.top() case a.Head: - p.im = inBodyIM + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 + p.im = inHeadIM case a.Body: p.im = inBodyIM case a.Frameset: p.im = inFramesetIM case a.Html: - p.im = beforeHeadIM + if p.head == nil { + p.im = beforeHeadIM + } else { + p.im = afterHeadIM + } default: + if last { + p.im = inBodyIM + return + } continue } return } - p.im = inBodyIM } const whitespace = " \t\r\n\f" -// Section 12.2.5.4.1. +// Section 12.2.6.4.1. func initialIM(p *parser) bool { switch p.tok.Type { case TextToken: @@ -479,7 +547,7 @@ func initialIM(p *parser) bool { return false } -// Section 12.2.5.4.2. +// Section 12.2.6.4.2. func beforeHTMLIM(p *parser) bool { switch p.tok.Type { case DoctypeToken: @@ -517,7 +585,7 @@ func beforeHTMLIM(p *parser) bool { return false } -// Section 12.2.5.4.3. +// Section 12.2.6.4.3. func beforeHeadIM(p *parser) bool { switch p.tok.Type { case TextToken: @@ -560,7 +628,7 @@ func beforeHeadIM(p *parser) bool { return false } -// Section 12.2.5.4.4. +// Section 12.2.6.4.4. func inHeadIM(p *parser) bool { switch p.tok.Type { case TextToken: @@ -590,19 +658,36 @@ func inHeadIM(p *parser) bool { case a.Head: // Ignore the token. return true + case a.Template: + p.addElement() + p.afe = append(p.afe, &scopeMarker) + p.framesetOK = false + p.im = inTemplateIM + p.templateStack = append(p.templateStack, inTemplateIM) + return true } case EndTagToken: switch p.tok.DataAtom { case a.Head: - n := p.oe.pop() - if n.DataAtom != a.Head { - panic("html: bad parser state: element not found, in the in-head insertion mode") - } + p.oe.pop() p.im = afterHeadIM return true case a.Body, a.Html, a.Br: p.parseImpliedToken(EndTagToken, a.Head, a.Head.String()) return false + case a.Template: + if !p.oe.contains(a.Template) { + return true + } + p.generateAllImpliedEndTags() + if n := p.oe.top(); n.DataAtom != a.Template { + return true + } + p.popUntil(defaultScope, a.Template) + p.clearActiveFormattingElements() + p.templateStack.pop() + p.resetInsertionMode() + return true default: // Ignore the token. return true @@ -622,7 +707,7 @@ func inHeadIM(p *parser) bool { return false } -// Section 12.2.5.4.6. +// Section 12.2.6.4.6. func afterHeadIM(p *parser) bool { switch p.tok.Type { case TextToken: @@ -648,7 +733,7 @@ func afterHeadIM(p *parser) bool { p.addElement() p.im = inFramesetIM return true - case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: p.oe = append(p.oe, p.head) defer p.oe.remove(p.head) return inHeadIM(p) @@ -660,6 +745,8 @@ func afterHeadIM(p *parser) bool { switch p.tok.DataAtom { case a.Body, a.Html, a.Br: // Drop down to creating an implied tag. + case a.Template: + return inHeadIM(p) default: // Ignore the token. return true @@ -697,7 +784,7 @@ func copyAttributes(dst *Node, src Token) { } } -// Section 12.2.5.4.7. +// Section 12.2.6.4.7. func inBodyIM(p *parser) bool { switch p.tok.Type { case TextToken: @@ -727,10 +814,16 @@ func inBodyIM(p *parser) bool { case StartTagToken: switch p.tok.DataAtom { case a.Html: + if p.oe.contains(a.Template) { + return true + } copyAttributes(p.oe[0], p.tok) - case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Title: + case a.Base, a.Basefont, a.Bgsound, a.Command, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: return inHeadIM(p) case a.Body: + if p.oe.contains(a.Template) { + return true + } if len(p.oe) >= 2 { body := p.oe[1] if body.Type == ElementNode && body.DataAtom == a.Body { @@ -767,7 +860,7 @@ func inBodyIM(p *parser) bool { // The newline, if any, will be dealt with by the TextToken case. p.framesetOK = false case a.Form: - if p.form == nil { + if p.oe.contains(a.Template) || p.form == nil { p.popUntil(buttonScope, a.P) p.addElement() p.form = p.top() @@ -952,11 +1045,16 @@ func inBodyIM(p *parser) bool { } p.reconstructActiveFormattingElements() p.addElement() - case a.Rp, a.Rt: + case a.Rb, a.Rtc: if p.elementInScope(defaultScope, a.Ruby) { p.generateImpliedEndTags() } p.addElement() + case a.Rp, a.Rt: + if p.elementInScope(defaultScope, a.Ruby) { + p.generateImpliedEndTags("rtc") + } + p.addElement() case a.Math, a.Svg: p.reconstructActiveFormattingElements() if p.tok.DataAtom == a.Math { @@ -972,7 +1070,13 @@ func inBodyIM(p *parser) bool { p.acknowledgeSelfClosingTag() } return true - case a.Caption, a.Col, a.Colgroup, a.Frame, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: + case a.Frame: + // TODO: remove this divergence from the HTML5 spec. + if p.oe.contains(a.Template) { + p.addElement() + return true + } + case a.Caption, a.Col, a.Colgroup, a.Head, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: // Ignore the token. default: p.reconstructActiveFormattingElements() @@ -993,15 +1097,28 @@ func inBodyIM(p *parser) bool { case a.Address, a.Article, a.Aside, a.Blockquote, a.Button, a.Center, a.Details, a.Dir, a.Div, a.Dl, a.Fieldset, a.Figcaption, a.Figure, a.Footer, a.Header, a.Hgroup, a.Listing, a.Menu, a.Nav, a.Ol, a.Pre, a.Section, a.Summary, a.Ul: p.popUntil(defaultScope, p.tok.DataAtom) case a.Form: - node := p.form - p.form = nil - i := p.indexOfElementInScope(defaultScope, a.Form) - if node == nil || i == -1 || p.oe[i] != node { - // Ignore the token. - return true + if p.oe.contains(a.Template) { + if !p.oe.contains(a.Form) { + // Ignore the token. + return true + } + p.generateImpliedEndTags() + if p.tok.DataAtom == a.Form { + // Ignore the token. + return true + } + p.popUntil(defaultScope, a.Form) + } else { + node := p.form + p.form = nil + i := p.indexOfElementInScope(defaultScope, a.Form) + if node == nil || i == -1 || p.oe[i] != node { + // Ignore the token. + return true + } + p.generateImpliedEndTags() + p.oe.remove(node) } - p.generateImpliedEndTags() - p.oe.remove(node) case a.P: if !p.elementInScope(buttonScope, a.P) { p.parseImpliedToken(StartTagToken, a.P, a.P.String()) @@ -1022,6 +1139,8 @@ func inBodyIM(p *parser) bool { case a.Br: p.tok.Type = StartTagToken return false + case a.Template: + return inHeadIM(p) default: p.inBodyEndTagOther(p.tok.DataAtom) } @@ -1030,6 +1149,21 @@ func inBodyIM(p *parser) bool { Type: CommentNode, Data: p.tok.Data, }) + case ErrorToken: + // TODO: remove this divergence from the HTML5 spec. + if len(p.templateStack) > 0 { + p.im = inTemplateIM + return false + } else { + for _, e := range p.oe { + switch e.DataAtom { + case a.Dd, a.Dt, a.Li, a.Optgroup, a.Option, a.P, a.Rb, a.Rp, a.Rt, a.Rtc, a.Tbody, a.Td, a.Tfoot, a.Th, + a.Thead, a.Tr, a.Body, a.Html: + default: + return true + } + } + } } return true @@ -1135,6 +1269,12 @@ func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) { switch commonAncestor.DataAtom { case a.Table, a.Tbody, a.Tfoot, a.Thead, a.Tr: p.fosterParent(lastNode) + case a.Template: + // TODO: remove namespace checking + if commonAncestor.Namespace == "html" { + commonAncestor = commonAncestor.LastChild + } + fallthrough default: commonAncestor.AppendChild(lastNode) } @@ -1160,7 +1300,7 @@ func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) { } // inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM. -// "Any other end tag" handling from 12.2.5.5 The rules for parsing tokens in foreign content +// "Any other end tag" handling from 12.2.6.5 The rules for parsing tokens in foreign content // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign func (p *parser) inBodyEndTagOther(tagAtom a.Atom) { for i := len(p.oe) - 1; i >= 0; i-- { @@ -1174,7 +1314,7 @@ func (p *parser) inBodyEndTagOther(tagAtom a.Atom) { } } -// Section 12.2.5.4.8. +// Section 12.2.6.4.8. func textIM(p *parser) bool { switch p.tok.Type { case ErrorToken: @@ -1203,7 +1343,7 @@ func textIM(p *parser) bool { return p.tok.Type == EndTagToken } -// Section 12.2.5.4.9. +// Section 12.2.6.4.9. func inTableIM(p *parser) bool { switch p.tok.Type { case ErrorToken: @@ -1249,7 +1389,7 @@ func inTableIM(p *parser) bool { } // Ignore the token. return true - case a.Style, a.Script: + case a.Style, a.Script, a.Template: return inHeadIM(p) case a.Input: for _, t := range p.tok.Attr { @@ -1261,7 +1401,7 @@ func inTableIM(p *parser) bool { } // Otherwise drop down to the default action. case a.Form: - if p.form != nil { + if p.oe.contains(a.Template) || p.form != nil { // Ignore the token. return true } @@ -1291,6 +1431,8 @@ func inTableIM(p *parser) bool { case a.Body, a.Caption, a.Col, a.Colgroup, a.Html, a.Tbody, a.Td, a.Tfoot, a.Th, a.Thead, a.Tr: // Ignore the token. return true + case a.Template: + return inHeadIM(p) } case CommentToken: p.addChild(&Node{ @@ -1309,7 +1451,7 @@ func inTableIM(p *parser) bool { return inBodyIM(p) } -// Section 12.2.5.4.11. +// Section 12.2.6.4.11. func inCaptionIM(p *parser) bool { switch p.tok.Type { case StartTagToken: @@ -1355,7 +1497,7 @@ func inCaptionIM(p *parser) bool { return inBodyIM(p) } -// Section 12.2.5.4.12. +// Section 12.2.6.4.12. func inColumnGroupIM(p *parser) bool { switch p.tok.Type { case TextToken: @@ -1386,11 +1528,13 @@ func inColumnGroupIM(p *parser) bool { p.oe.pop() p.acknowledgeSelfClosingTag() return true + case a.Template: + return inHeadIM(p) } case EndTagToken: switch p.tok.DataAtom { case a.Colgroup: - if p.oe.top().DataAtom != a.Html { + if p.oe.top().DataAtom == a.Colgroup { p.oe.pop() p.im = inTableIM } @@ -1398,17 +1542,19 @@ func inColumnGroupIM(p *parser) bool { case a.Col: // Ignore the token. return true + case a.Template: + return inHeadIM(p) } } - if p.oe.top().DataAtom != a.Html { - p.oe.pop() - p.im = inTableIM - return false + if p.oe.top().DataAtom != a.Colgroup { + return true } - return true + p.oe.pop() + p.im = inTableIM + return false } -// Section 12.2.5.4.13. +// Section 12.2.6.4.13. func inTableBodyIM(p *parser) bool { switch p.tok.Type { case StartTagToken: @@ -1460,7 +1606,7 @@ func inTableBodyIM(p *parser) bool { return inTableIM(p) } -// Section 12.2.5.4.14. +// Section 12.2.6.4.14. func inRowIM(p *parser) bool { switch p.tok.Type { case StartTagToken: @@ -1511,7 +1657,7 @@ func inRowIM(p *parser) bool { return inTableIM(p) } -// Section 12.2.5.4.15. +// Section 12.2.6.4.15. func inCellIM(p *parser) bool { switch p.tok.Type { case StartTagToken: @@ -1560,7 +1706,7 @@ func inCellIM(p *parser) bool { return inBodyIM(p) } -// Section 12.2.5.4.16. +// Section 12.2.6.4.16. func inSelectIM(p *parser) bool { switch p.tok.Type { case ErrorToken: @@ -1597,7 +1743,7 @@ func inSelectIM(p *parser) bool { p.tokenizer.NextIsNotRawText() // Ignore the token. return true - case a.Script: + case a.Script, a.Template: return inHeadIM(p) } case EndTagToken: @@ -1618,6 +1764,8 @@ func inSelectIM(p *parser) bool { if p.popUntil(selectScope, a.Select) { p.resetInsertionMode() } + case a.Template: + return inHeadIM(p) } case CommentToken: p.addChild(&Node{ @@ -1632,7 +1780,7 @@ func inSelectIM(p *parser) bool { return true } -// Section 12.2.5.4.17. +// Section 12.2.6.4.17. func inSelectInTableIM(p *parser) bool { switch p.tok.Type { case StartTagToken, EndTagToken: @@ -1650,7 +1798,62 @@ func inSelectInTableIM(p *parser) bool { return inSelectIM(p) } -// Section 12.2.5.4.18. +// Section 12.2.6.4.18. +func inTemplateIM(p *parser) bool { + switch p.tok.Type { + case TextToken, CommentToken, DoctypeToken: + return inBodyIM(p) + case StartTagToken: + switch p.tok.DataAtom { + case a.Base, a.Basefont, a.Bgsound, a.Link, a.Meta, a.Noframes, a.Script, a.Style, a.Template, a.Title: + return inHeadIM(p) + case a.Caption, a.Colgroup, a.Tbody, a.Tfoot, a.Thead: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inTableIM) + p.im = inTableIM + return false + case a.Col: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inColumnGroupIM) + p.im = inColumnGroupIM + return false + case a.Tr: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inTableBodyIM) + p.im = inTableBodyIM + return false + case a.Td, a.Th: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inRowIM) + p.im = inRowIM + return false + default: + p.templateStack.pop() + p.templateStack = append(p.templateStack, inBodyIM) + p.im = inBodyIM + return false + } + case EndTagToken: + switch p.tok.DataAtom { + case a.Template: + return inHeadIM(p) + default: + // Ignore the token. + return true + } + } + if !p.oe.contains(a.Template) { + // Ignore the token. + return true + } + p.popUntil(defaultScope, a.Template) + p.clearActiveFormattingElements() + p.templateStack.pop() + p.resetInsertionMode() + return false +} + +// Section 12.2.6.4.19. func afterBodyIM(p *parser) bool { switch p.tok.Type { case ErrorToken: @@ -1688,7 +1891,7 @@ func afterBodyIM(p *parser) bool { return false } -// Section 12.2.5.4.19. +// Section 12.2.6.4.20. func inFramesetIM(p *parser) bool { switch p.tok.Type { case CommentToken: @@ -1720,6 +1923,11 @@ func inFramesetIM(p *parser) bool { p.acknowledgeSelfClosingTag() case a.Noframes: return inHeadIM(p) + case a.Template: + // TODO: remove this divergence from the HTML5 spec. + // + // See https://bugs.chromium.org/p/chromium/issues/detail?id=829668 + return inTemplateIM(p) } case EndTagToken: switch p.tok.DataAtom { @@ -1738,7 +1946,7 @@ func inFramesetIM(p *parser) bool { return true } -// Section 12.2.5.4.20. +// Section 12.2.6.4.21. func afterFramesetIM(p *parser) bool { switch p.tok.Type { case CommentToken: @@ -1777,7 +1985,7 @@ func afterFramesetIM(p *parser) bool { return true } -// Section 12.2.5.4.21. +// Section 12.2.6.4.22. func afterAfterBodyIM(p *parser) bool { switch p.tok.Type { case ErrorToken: @@ -1806,7 +2014,7 @@ func afterAfterBodyIM(p *parser) bool { return false } -// Section 12.2.5.4.22. +// Section 12.2.6.4.23. func afterAfterFramesetIM(p *parser) bool { switch p.tok.Type { case CommentToken: @@ -1844,7 +2052,7 @@ func afterAfterFramesetIM(p *parser) bool { const whitespaceOrNUL = whitespace + "\x00" -// Section 12.2.5.5. +// Section 12.2.6.5 func parseForeignContent(p *parser) bool { switch p.tok.Type { case TextToken: @@ -1924,7 +2132,7 @@ func parseForeignContent(p *parser) bool { return true } -// Section 12.2.5. +// Section 12.2.6. func (p *parser) inForeignContent() bool { if len(p.oe) == 0 { return false @@ -2064,6 +2272,9 @@ func ParseFragment(r io.Reader, context *Node) ([]*Node, error) { } p.doc.AppendChild(root) p.oe = nodeStack{root} + if context != nil && context.DataAtom == a.Template { + p.templateStack = append(p.templateStack, inTemplateIM) + } p.resetInsertionMode() for n := context; n != nil; n = n.Parent { diff --git a/vendor/golang.org/x/net/html/parse_test.go b/vendor/golang.org/x/net/html/parse_test.go index 7e47d11..89d9642 100644 --- a/vendor/golang.org/x/net/html/parse_test.go +++ b/vendor/golang.org/x/net/html/parse_test.go @@ -125,6 +125,7 @@ func (a sortedAttributes) Swap(i, j int) { func dumpLevel(w io.Writer, n *Node, level int) error { dumpIndent(w, level) + level++ switch n.Type { case ErrorNode: return errors.New("unexpected ErrorNode") @@ -140,13 +141,19 @@ func dumpLevel(w io.Writer, n *Node, level int) error { sort.Sort(attr) for _, a := range attr { io.WriteString(w, "\n") - dumpIndent(w, level+1) + dumpIndent(w, level) if a.Namespace != "" { fmt.Fprintf(w, `%s %s="%s"`, a.Namespace, a.Key, a.Val) } else { fmt.Fprintf(w, `%s="%s"`, a.Key, a.Val) } } + if n.Namespace == "" && n.DataAtom == atom.Template { + io.WriteString(w, "\n") + dumpIndent(w, level) + level++ + io.WriteString(w, "content") + } case TextNode: fmt.Fprintf(w, `"%s"`, n.Data) case CommentNode: @@ -176,7 +183,7 @@ func dumpLevel(w io.Writer, n *Node, level int) error { } io.WriteString(w, "\n") for c := n.FirstChild; c != nil; c = c.NextSibling { - if err := dumpLevel(w, c, level+1); err != nil { + if err := dumpLevel(w, c, level); err != nil { return err } } @@ -373,6 +380,11 @@ func TestNodeConsistency(t *testing.T) { } } +func TestParseFragmentWithNilContext(t *testing.T) { + // This shouldn't panic. + ParseFragment(strings.NewReader("

    hello

    "), nil) +} + func BenchmarkParser(b *testing.B) { buf, err := ioutil.ReadFile("testdata/go1.html") if err != nil { diff --git a/vendor/golang.org/x/net/html/testdata/webkit/ruby.dat b/vendor/golang.org/x/net/html/testdata/webkit/ruby.dat new file mode 100644 index 0000000..1ca8016 --- /dev/null +++ b/vendor/golang.org/x/net/html/testdata/webkit/ruby.dat @@ -0,0 +1,298 @@ +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +abcd +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| +| "c" +| +| "d" + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| "a" +| +| "b" +| + +#data +ab +#errors +(1,6): expected-doctype-but-got-start-tag +#document +| +| +| +| +| +| +| "a" +| +| "b" +| diff --git a/vendor/golang.org/x/net/html/testdata/webkit/template.dat b/vendor/golang.org/x/net/html/testdata/webkit/template.dat new file mode 100644 index 0000000..e25f690 --- /dev/null +++ b/vendor/golang.org/x/net/html/testdata/webkit/template.dat @@ -0,0 +1,1117 @@ +#data + +#errors +#document +| +| +| +|