Update dependencies

This commit is contained in:
Ken-Håvard Lieng 2018-11-14 08:25:20 +01:00
parent 374604fae2
commit a7b6442ed9
32 changed files with 458 additions and 502 deletions

File diff suppressed because one or more lines are too long

View File

@ -91,16 +91,18 @@ export function compareUsers(a, b) {
export const getChannels = state => state.channels; export const getChannels = state => state.channels;
export const getSortedChannels = createSelector(getChannels, channels => export const getSortedChannels = createSelector(
sortBy( getChannels,
Object.keys(channels).map(server => ({ channels =>
address: server, sortBy(
channels: sortBy(Object.keys(channels[server]), channel => Object.keys(channels).map(server => ({
channel.toLowerCase() address: server,
) channels: sortBy(Object.keys(channels[server]), channel =>
})), channel.toLowerCase()
server => server.address.toLowerCase() )
) })),
server => server.address.toLowerCase()
)
); );
export const getSelectedChannel = createSelector( export const getSelectedChannel = createSelector(

View File

@ -46,7 +46,7 @@
"postcss-flexbugs-fixes": "^4.1.0", "postcss-flexbugs-fixes": "^4.1.0",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.4.0", "postcss-preset-env": "^6.4.0",
"prettier": "1.15.1", "prettier": "1.15.2",
"react-test-renderer": "^16.7.0-alpha.0", "react-test-renderer": "^16.7.0-alpha.0",
"style-loader": "^0.23.1", "style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.1.0", "terser-webpack-plugin": "^1.1.0",
@ -79,8 +79,8 @@
"url-pattern": "^1.0.3" "url-pattern": "^1.0.3"
}, },
"scripts": { "scripts": {
"prettier": "prettier --write {.*,*.js,src/css/*.css,src/**/*.test.js}", "prettier": "prettier --write {.*,*.js,css/*.css,**/*.test.js}",
"prettier:all": "prettier --write {.*,*.js,src/**/*.js,src/css/*.css}", "prettier:all": "prettier --write {.*,*.js,**/*.js,css/*.css}",
"test": "jest", "test": "jest",
"test:verbose": "jest --verbose", "test:verbose": "jest --verbose",
"test:watch": "jest --watch", "test:watch": "jest --watch",

File diff suppressed because it is too large Load Diff

13
go.mod
View File

@ -38,21 +38,22 @@ require (
github.com/philhofer/fwd v1.0.0 // indirect github.com/philhofer/fwd v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446 // indirect github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a // indirect github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c // indirect
github.com/spf13/cast v1.3.0 github.com/spf13/cast v1.3.0
github.com/spf13/cobra v0.0.3 github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3 // indirect github.com/spf13/pflag v1.0.3 // indirect
github.com/spf13/viper v1.2.1 github.com/spf13/viper v1.2.1
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
github.com/stretchr/testify v1.2.2 github.com/stretchr/testify v1.2.2
github.com/syndtr/goleveldb v0.0.0-20181102132633-a4119e27a65d // indirect github.com/syndtr/goleveldb v0.0.0-20181105012736-f9080354173f // indirect
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect
github.com/tinylib/msgp v0.0.0-20180215042507-3b5c87ab5fb0 // indirect github.com/tinylib/msgp v0.0.0-20180215042507-3b5c87ab5fb0 // indirect
github.com/willf/bitset v1.1.9 // indirect github.com/willf/bitset v1.1.9 // indirect
github.com/xenolf/lego v1.1.0 github.com/xenolf/lego v1.2.1
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 // indirect golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 // indirect
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc golang.org/x/net v0.0.0-20181113165502-88d92db4c548
golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc // indirect golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/square/go-jose.v2 v2.1.9 // indirect gopkg.in/square/go-jose.v2 v2.1.9 // indirect
) )

26
go.sum
View File

@ -93,8 +93,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446 h1:/NRJ5vAYo
github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a h1:JSvGDIbmil4Ui/dDdFBExb7/cmkNjyX5F97oglmvCDo= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c h1:Ho+uVpkel/udgjbwB5Lktg9BtvJSh2DT0Hi6LPSyI2w=
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg= github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg=
@ -115,27 +115,29 @@ github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 h1:JNEGSiWg6D3lcBC
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2/go.mod h1:mjqs7N0Q6m5HpR7QfXVBZXZWSqTjQLeTujjA/xUp2uw= github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2/go.mod h1:mjqs7N0Q6m5HpR7QfXVBZXZWSqTjQLeTujjA/xUp2uw=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/syndtr/goleveldb v0.0.0-20181102132633-a4119e27a65d h1:wnS/zl2nFbhU9r6hlfqYEy9qJ0gG89VJGigG6dq7+Eo= github.com/syndtr/goleveldb v0.0.0-20181105012736-f9080354173f h1:EEVjSRihF8NIbfyCcErpSpNHEKrY3s8EAwqiPENZZn8=
github.com/syndtr/goleveldb v0.0.0-20181102132633-a4119e27a65d/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0= github.com/syndtr/goleveldb v0.0.0-20181105012736-f9080354173f/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 h1:HOxvxvnntLiPn123Fk+twfUhCQdMDaqmb0cclArW0T0= github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 h1:HOxvxvnntLiPn123Fk+twfUhCQdMDaqmb0cclArW0T0=
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
github.com/tinylib/msgp v0.0.0-20180215042507-3b5c87ab5fb0 h1:uAwzi+JwkDdOtQZVqPYljFvJr7i43ZgUYXKypk9Eibk= github.com/tinylib/msgp v0.0.0-20180215042507-3b5c87ab5fb0 h1:uAwzi+JwkDdOtQZVqPYljFvJr7i43ZgUYXKypk9Eibk=
github.com/tinylib/msgp v0.0.0-20180215042507-3b5c87ab5fb0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v0.0.0-20180215042507-3b5c87ab5fb0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
github.com/willf/bitset v1.1.9 h1:GBtFynGY9ZWZmEC9sWuu41/7VBXPFCOAbCbqTflOg9c= github.com/willf/bitset v1.1.9 h1:GBtFynGY9ZWZmEC9sWuu41/7VBXPFCOAbCbqTflOg9c=
github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4=
github.com/xenolf/lego v1.1.0 h1:Ias1pE9hO98/fI23RLza0T3461YiM720d96oxTRPyuM= github.com/xenolf/lego v1.2.1 h1:wAsBCIaTDlgYbR/yVuP0gzcnZrA94NVc84K6vfOIyyA=
github.com/xenolf/lego v1.1.0/go.mod h1:fwiGnfsIjG7OHPfOvgK7Y/Qo6+2Ox0iozjNTkZICKbY= github.com/xenolf/lego v1.2.1/go.mod h1:fwiGnfsIjG7OHPfOvgK7Y/Qo6+2Ox0iozjNTkZICKbY=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 h1:y6ce7gCWtnH+m3dCjzQ1PCuwl28DDIc3VNnvY29DlIA= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869 h1:kkXA53yGe04D0adEYJwEVQjeBppL01Exg+fnMjfUraU=
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc h1:ZMCWScCvS2fUVFw8LOpxyUUW5qiviqr4Dg5NdjLeiLU= golang.org/x/net v0.0.0-20181113165502-88d92db4c548 h1:lqFnrcY5rM6XXZ41MVa5mTlOBrBYultJDG1orIvlqPA=
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181113165502-88d92db4c548/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc h1:SdCq5U4J+PpbSDIl9bM0V1e1Ug1jsnBkAFvTs1htn7U= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 h1:YoY1wS6JYVRpIfFngRf2HHo9R9dAne3xbkGOQ5rJXjU=
golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

View File

@ -665,7 +665,7 @@ func (c *Client) getAuthzForOrder(order orderResource) ([]authorization, error)
go func(authzURL string) { go func(authzURL string) {
var authz authorization var authz authorization
_, err := getJSON(authzURL, &authz) _, err := postAsGet(c.jws, authzURL, &authz)
if err != nil { if err != nil {
errc <- domainError{Domain: authz.Identifier.Value, Error: err} errc <- domainError{Domain: authz.Identifier.Value, Error: err}
return return
@ -789,7 +789,7 @@ func (c *Client) requestCertificateForCsr(order orderResource, bundle bool, csr
case <-stopTimer.C: case <-stopTimer.C:
return nil, errors.New("certificate polling timed out") return nil, errors.New("certificate polling timed out")
case <-retryTick.C: case <-retryTick.C:
_, err := getJSON(order.URL, &retOrder) _, err := postAsGet(c.jws, order.URL, &retOrder)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -813,7 +813,7 @@ func (c *Client) requestCertificateForCsr(order orderResource, bundle bool, csr
func (c *Client) checkCertResponse(order orderMessage, certRes *CertificateResource, bundle bool) (bool, error) { func (c *Client) checkCertResponse(order orderMessage, certRes *CertificateResource, bundle bool) (bool, error) {
switch order.Status { switch order.Status {
case statusValid: case statusValid:
resp, err := httpGet(order.Certificate) resp, err := postAsGet(c.jws, order.Certificate, nil)
if err != nil { if err != nil {
return false, err return false, err
} }
@ -871,7 +871,7 @@ func (c *Client) checkCertResponse(order orderMessage, certRes *CertificateResou
// getIssuerCertificate requests the issuer certificate // getIssuerCertificate requests the issuer certificate
func (c *Client) getIssuerCertificate(url string) ([]byte, error) { func (c *Client) getIssuerCertificate(url string) ([]byte, error) {
log.Infof("acme: Requesting issuer cert from %s", url) log.Infof("acme: Requesting issuer cert from %s", url)
resp, err := httpGet(url) resp, err := postAsGet(c.jws, url, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -914,7 +914,10 @@ func parseLinks(links []string) map[string]string {
func validate(j *jws, domain, uri string, c challenge) error { func validate(j *jws, domain, uri string, c challenge) error {
var chlng challenge var chlng challenge
hdr, err := postJSON(j, uri, c, &chlng) // Challenge initiation is done by sending a JWS payload containing the
// trivial JSON object `{}`. We use an empty struct instance as the postJSON
// payload here to achieve this result.
hdr, err := postJSON(j, uri, struct{}{}, &chlng)
if err != nil { if err != nil {
return err return err
} }
@ -940,11 +943,15 @@ func validate(j *jws, domain, uri string, c challenge) error {
// If it doesn't, we'll just poll hard. // If it doesn't, we'll just poll hard.
ra = 5 ra = 5
} }
time.Sleep(time.Duration(ra) * time.Second) time.Sleep(time.Duration(ra) * time.Second)
hdr, err = getJSON(uri, &chlng) resp, err := postAsGet(j, uri, &chlng)
if err != nil { if err != nil {
return err return err
} }
if resp != nil {
hdr = resp.Header
}
} }
} }

View File

@ -151,48 +151,56 @@ func postJSON(j *jws, uri string, reqBody, respBody interface{}) (http.Header, e
return nil, errors.New("failed to marshal network message") return nil, errors.New("failed to marshal network message")
} }
resp, err := j.post(uri, jsonBytes) resp, err := post(j, uri, jsonBytes, respBody)
if err != nil { if resp == nil {
return nil, fmt.Errorf("failed to post JWS message. -> %v", err) return nil, err
} }
defer resp.Body.Close() defer resp.Body.Close()
return resp.Header, err
}
func postAsGet(j *jws, uri string, respBody interface{}) (*http.Response, error) {
return post(j, uri, []byte{}, respBody)
}
func post(j *jws, uri string, reqBody []byte, respBody interface{}) (*http.Response, error) {
resp, err := j.post(uri, reqBody)
if err != nil {
return nil, fmt.Errorf("failed to post JWS message. -> %v", err)
}
if resp.StatusCode >= http.StatusBadRequest { if resp.StatusCode >= http.StatusBadRequest {
err = handleHTTPError(resp) err = handleHTTPError(resp)
switch err.(type) { switch err.(type) {
case NonceError: case NonceError:
// Retry once if the nonce was invalidated // Retry once if the nonce was invalidated
retryResp, errP := j.post(uri, jsonBytes) retryResp, errP := j.post(uri, reqBody)
if errP != nil { if errP != nil {
return nil, fmt.Errorf("failed to post JWS message. -> %v", errP) return nil, fmt.Errorf("failed to post JWS message. -> %v", errP)
} }
defer retryResp.Body.Close()
if retryResp.StatusCode >= http.StatusBadRequest { if retryResp.StatusCode >= http.StatusBadRequest {
return retryResp.Header, handleHTTPError(retryResp) return retryResp, handleHTTPError(retryResp)
} }
if respBody == nil { if respBody == nil {
return retryResp.Header, nil return retryResp, nil
} }
return retryResp.Header, json.NewDecoder(retryResp.Body).Decode(respBody) return retryResp, json.NewDecoder(retryResp.Body).Decode(respBody)
default: default:
return resp.Header, err return resp, err
} }
} }
if respBody == nil { if respBody == nil {
return resp.Header, nil return resp, nil
} }
return resp.Header, json.NewDecoder(resp.Body).Decode(respBody) return resp, json.NewDecoder(resp.Body).Decode(respBody)
} }
// userAgent builds and returns the User-Agent string to use in requests. // userAgent builds and returns the User-Agent string to use in requests.

View File

@ -12,8 +12,8 @@ import (
) )
// idPeAcmeIdentifierV1 is the SMI Security for PKIX Certification Extension OID referencing the ACME extension. // idPeAcmeIdentifierV1 is the SMI Security for PKIX Certification Extension OID referencing the ACME extension.
// Reference: https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-01#section-5.1 // Reference: https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05#section-5.1
var idPeAcmeIdentifierV1 = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 30, 1} var idPeAcmeIdentifierV1 = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 1, 31}
type tlsALPNChallenge struct { type tlsALPNChallenge struct {
jws *jws jws *jws
@ -58,7 +58,7 @@ func TLSALPNChallengeBlocks(domain, keyAuth string) ([]byte, []byte, error) {
// Add the keyAuth digest as the acmeValidation-v1 extension // Add the keyAuth digest as the acmeValidation-v1 extension
// (marked as critical such that it won't be used by non-ACME software). // (marked as critical such that it won't be used by non-ACME software).
// Reference: https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-01#section-3 // Reference: https://tools.ietf.org/html/draft-ietf-acme-tls-alpn-05#section-3
extensions := []pkix.Extension{ extensions := []pkix.Extension{
{ {
Id: idPeAcmeIdentifierV1, Id: idPeAcmeIdentifierV1,

View File

@ -121,18 +121,21 @@ var zoneCache = ipv6ZoneCache{
toName: make(map[int]string), toName: make(map[int]string),
} }
func (zc *ipv6ZoneCache) update(ift []net.Interface) { // update refreshes the network interface information if the cache was last
// updated more than 1 minute ago, or if force is set. It returns whether the
// cache was updated.
func (zc *ipv6ZoneCache) update(ift []net.Interface, force bool) (updated bool) {
zc.Lock() zc.Lock()
defer zc.Unlock() defer zc.Unlock()
now := time.Now() now := time.Now()
if zc.lastFetched.After(now.Add(-60 * time.Second)) { if !force && zc.lastFetched.After(now.Add(-60*time.Second)) {
return return false
} }
zc.lastFetched = now zc.lastFetched = now
if len(ift) == 0 { if len(ift) == 0 {
var err error var err error
if ift, err = net.Interfaces(); err != nil { if ift, err = net.Interfaces(); err != nil {
return return false
} }
} }
zc.toIndex = make(map[string]int, len(ift)) zc.toIndex = make(map[string]int, len(ift))
@ -143,25 +146,38 @@ func (zc *ipv6ZoneCache) update(ift []net.Interface) {
zc.toName[ifi.Index] = ifi.Name zc.toName[ifi.Index] = ifi.Name
} }
} }
return true
} }
func (zc *ipv6ZoneCache) name(zone int) string { func (zc *ipv6ZoneCache) name(zone int) string {
zoneCache.update(nil) updated := zoneCache.update(nil, false)
zoneCache.RLock() zoneCache.RLock()
defer zoneCache.RUnlock()
name, ok := zoneCache.toName[zone] name, ok := zoneCache.toName[zone]
if !ok { zoneCache.RUnlock()
if !ok && !updated {
zoneCache.update(nil, true)
zoneCache.RLock()
name, ok = zoneCache.toName[zone]
zoneCache.RUnlock()
}
if !ok { // last resort
name = strconv.Itoa(zone) name = strconv.Itoa(zone)
} }
return name return name
} }
func (zc *ipv6ZoneCache) index(zone string) int { func (zc *ipv6ZoneCache) index(zone string) int {
zoneCache.update(nil) updated := zoneCache.update(nil, false)
zoneCache.RLock() zoneCache.RLock()
defer zoneCache.RUnlock()
index, ok := zoneCache.toIndex[zone] index, ok := zoneCache.toIndex[zone]
if !ok { zoneCache.RUnlock()
if !ok && !updated {
zoneCache.update(nil, true)
zoneCache.RLock()
index, ok = zoneCache.toIndex[zone]
zoneCache.RUnlock()
}
if !ok { // last resort
index, _ = strconv.Atoi(zone) index, _ = strconv.Atoi(zone)
} }
return index return index

View File

@ -241,4 +241,5 @@
// IncludeSourceSpecificGroup may return an error. // IncludeSourceSpecificGroup may return an error.
package ipv4 // import "golang.org/x/net/ipv4" package ipv4 // import "golang.org/x/net/ipv4"
// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9. // BUG(mikio): This package is not implemented on AIX, JS, NaCl and
// Plan 9.

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !js,!nacl,!plan9,!windows // +build darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv4 package ipv4

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !go1.9 // +build !go1.9
// +build !js,!nacl,!plan9,!windows // +build darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv4 package ipv4

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build go1.9 // +build go1.9
// +build !js,!nacl,!plan9,!windows // +build darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv4 package ipv4

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build js nacl plan9 windows // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris
package ipv4 package ipv4

View File

@ -240,4 +240,5 @@
// IncludeSourceSpecificGroup may return an error. // IncludeSourceSpecificGroup may return an error.
package ipv6 // import "golang.org/x/net/ipv6" package ipv6 // import "golang.org/x/net/ipv6"
// BUG(mikio): This package is not implemented on JS, NaCl and Plan 9. // BUG(mikio): This package is not implemented on AIX, JS, NaCl and
// Plan 9.

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !js,!nacl,!plan9,!windows // +build darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv6 package ipv6

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !go1.9 // +build !go1.9
// +build !js,!nacl,!plan9,!windows // +build darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv6 package ipv6

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build go1.9 // +build go1.9
// +build !js,!nacl,!plan9,!windows // +build darwin dragonfly freebsd linux netbsd openbsd solaris
package ipv6 package ipv6

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build js nacl plan9 windows // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris
package ipv6 package ipv6

View File

@ -15,12 +15,6 @@
// Just jump to package syscall's implementation for all these functions. // Just jump to package syscall's implementation for all these functions.
// The runtime may know about them. // The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
BR syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
BR syscall·Syscall6(SB)
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
BL runtime·entersyscall(SB) BL runtime·entersyscall(SB)
MOVD a1+8(FP), R3 MOVD a1+8(FP), R3
@ -36,12 +30,6 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
BL runtime·exitsyscall(SB) BL runtime·exitsyscall(SB)
RET RET
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
BR syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
BR syscall·RawSyscall6(SB)
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
MOVD a1+8(FP), R3 MOVD a1+8(FP), R3
MOVD a2+16(FP), R4 MOVD a2+16(FP), R4

View File

@ -101,7 +101,7 @@ includes_DragonFly='
' '
includes_FreeBSD=' includes_FreeBSD='
#include <sys/capability.h> #include <sys/capsicum.h>
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/event.h> #include <sys/event.h>

View File

@ -65,6 +65,10 @@ func main() {
convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
// Convert [1024]int8 to [1024]byte in Ptmget members
convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`)
b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte"))
// Remove spare fields (e.g. in Statx_t) // Remove spare fields (e.g. in Statx_t)
spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) spareFieldsRegex := regexp.MustCompile(`X__spare\S*`)
b = spareFieldsRegex.ReplaceAll(b, []byte("_")) b = spareFieldsRegex.ReplaceAll(b, []byte("_"))

View File

@ -13,6 +13,7 @@
package unix package unix
import ( import (
"runtime"
"syscall" "syscall"
"unsafe" "unsafe"
) )
@ -190,6 +191,13 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) {
return &value, err return &value, err
} }
func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) {
var value Ptmget
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
runtime.KeepAlive(value)
return &value, err
}
func Uname(uname *Utsname) error { func Uname(uname *Utsname) error {
mib := []_C_int{CTL_KERN, KERN_OSTYPE} mib := []_C_int{CTL_KERN, KERN_OSTYPE}
n := unsafe.Sizeof(uname.Sysname) n := unsafe.Sizeof(uname.Sysname)

View File

@ -3,7 +3,7 @@
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd linux netbsd openbsd solaris // +build darwin dragonfly freebsd linux netbsd openbsd solaris
// +build !gccgo // +build !gccgo,!ppc64le,!ppc64
package unix package unix

24
vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go generated vendored Normal file
View File

@ -0,0 +1,24 @@
// 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.
// +build linux
// +build ppc64le ppc64
// +build !gccgo
package unix
import "syscall"
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
return syscall.Syscall(trap, a1, a2, a3)
}
func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6)
}
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
return syscall.RawSyscall(trap, a1, a2, a3)
}
func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) {
return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6)
}

View File

@ -26,7 +26,7 @@ package unix
#include <termios.h> #include <termios.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/capability.h> #include <sys/capsicum.h>
#include <sys/event.h> #include <sys/event.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/mount.h> #include <sys/mount.h>

View File

@ -248,6 +248,8 @@ type Termios C.struct_termios
type Winsize C.struct_winsize type Winsize C.struct_winsize
type Ptmget C.struct_ptmget
// fchmodat-like syscalls. // fchmodat-like syscalls.
const ( const (

View File

@ -402,6 +402,13 @@ type Winsize struct {
Ypixel uint16 Ypixel uint16
} }
type Ptmget struct {
Cfd int32
Sfd int32
Cn [1024]byte
Sn [1024]byte
}
const ( const (
AT_FDCWD = -0x64 AT_FDCWD = -0x64
AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_NOFOLLOW = 0x200

View File

@ -409,6 +409,13 @@ type Winsize struct {
Ypixel uint16 Ypixel uint16
} }
type Ptmget struct {
Cfd int32
Sfd int32
Cn [1024]byte
Sn [1024]byte
}
const ( const (
AT_FDCWD = -0x64 AT_FDCWD = -0x64
AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_NOFOLLOW = 0x200

View File

@ -407,6 +407,13 @@ type Winsize struct {
Ypixel uint16 Ypixel uint16
} }
type Ptmget struct {
Cfd int32
Sfd int32
Cn [1024]byte
Sn [1024]byte
}
const ( const (
AT_FDCWD = -0x64 AT_FDCWD = -0x64
AT_SYMLINK_NOFOLLOW = 0x200 AT_SYMLINK_NOFOLLOW = 0x200

8
vendor/modules.txt vendored
View File

@ -127,15 +127,15 @@ github.com/stretchr/testify/assert
github.com/tinylib/msgp/msgp github.com/tinylib/msgp/msgp
# github.com/willf/bitset v1.1.9 # github.com/willf/bitset v1.1.9
github.com/willf/bitset github.com/willf/bitset
# github.com/xenolf/lego v1.1.0 # github.com/xenolf/lego v1.2.1
github.com/xenolf/lego/acme github.com/xenolf/lego/acme
github.com/xenolf/lego/log github.com/xenolf/lego/log
# golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16 # golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869
golang.org/x/crypto/ocsp golang.org/x/crypto/ocsp
golang.org/x/crypto/ed25519 golang.org/x/crypto/ed25519
golang.org/x/crypto/pbkdf2 golang.org/x/crypto/pbkdf2
golang.org/x/crypto/ed25519/internal/edwards25519 golang.org/x/crypto/ed25519/internal/edwards25519
# golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc # golang.org/x/net v0.0.0-20181113165502-88d92db4c548
golang.org/x/net/html golang.org/x/net/html
golang.org/x/net/html/atom golang.org/x/net/html/atom
golang.org/x/net/ipv4 golang.org/x/net/ipv4
@ -143,7 +143,7 @@ golang.org/x/net/ipv6
golang.org/x/net/bpf golang.org/x/net/bpf
golang.org/x/net/internal/iana golang.org/x/net/internal/iana
golang.org/x/net/internal/socket golang.org/x/net/internal/socket
# golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc # golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8
golang.org/x/sys/unix golang.org/x/sys/unix
# golang.org/x/text v0.3.0 # golang.org/x/text v0.3.0
golang.org/x/text/transform golang.org/x/text/transform