gofmt touched files
This commit is contained in:
parent
cf7f6f5db3
commit
1c7d0d5411
|
|
@ -13,8 +13,8 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose"
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
blog "github.com/letsencrypt/boulder/log"
|
||||
"github.com/letsencrypt/boulder/policy"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import (
|
|||
|
||||
"github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/cloudflare/cfssl/signer/local"
|
||||
_ "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/mattn/go-sqlite3"
|
||||
jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose"
|
||||
"github.com/letsencrypt/boulder/ca"
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose"
|
||||
"github.com/letsencrypt/boulder/policy"
|
||||
"github.com/letsencrypt/boulder/sa"
|
||||
"github.com/letsencrypt/boulder/test"
|
||||
|
|
@ -242,13 +242,13 @@ func TestCertificateKeyNotEqualAccountKey(t *testing.T) {
|
|||
authz := core.Authorization{}
|
||||
authz.ID, _ = sa.NewPendingAuthorization()
|
||||
authz.Identifier = core.AcmeIdentifier{
|
||||
Type: core.IdentifierDNS,
|
||||
Type: core.IdentifierDNS,
|
||||
Value: "www.example.com",
|
||||
}
|
||||
csr := x509.CertificateRequest{
|
||||
SignatureAlgorithm: x509.SHA256WithRSA,
|
||||
PublicKey: AccountKey.Key,
|
||||
DNSNames: []string{"www.example.com"},
|
||||
PublicKey: AccountKey.Key,
|
||||
DNSNames: []string{"www.example.com"},
|
||||
}
|
||||
csrBytes, err := x509.CreateCertificateRequest(rand.Reader, &csr, AccountPrivateKey.Key)
|
||||
test.AssertNotError(t, err, "Failed to sign CSR")
|
||||
|
|
|
|||
|
|
@ -6,24 +6,24 @@
|
|||
package sa
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
"crypto/x509/pkix"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"crypto/x509/pkix"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"time"
|
||||
|
||||
_ "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/mattn/go-sqlite3"
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose"
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
"github.com/letsencrypt/boulder/test"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func initSA(t *testing.T) (*SQLStorageAuthority) {
|
||||
func initSA(t *testing.T) *SQLStorageAuthority {
|
||||
sa, err := NewSQLStorageAuthority("sqlite3", ":memory:")
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create SA")
|
||||
|
|
@ -63,7 +63,7 @@ func TestAddRegistration(t *testing.T) {
|
|||
test.AssertNotError(t, err, fmt.Sprintf("Couldn't get registration with ID %v", reg.ID))
|
||||
|
||||
expectedReg := core.Registration{
|
||||
ID: reg.ID,
|
||||
ID: reg.ID,
|
||||
Key: jwk,
|
||||
}
|
||||
test.AssertEquals(t, dbReg.ID, expectedReg.ID)
|
||||
|
|
@ -114,8 +114,7 @@ func TestAddAuthorization(t *testing.T) {
|
|||
chall := core.Challenge{Type: "simpleHttps", Status: core.StatusPending, URI: u, Token: "THISWOULDNTBEAGOODTOKEN", Path: "test-me"}
|
||||
|
||||
combos := make([][]int, 1)
|
||||
combos[0] = []int{0,1}
|
||||
|
||||
combos[0] = []int{0, 1}
|
||||
|
||||
newPa := core.Authorization{ID: paID, Identifier: core.AcmeIdentifier{Type: core.IdentifierDNS, Value: "wut.com"}, RegistrationID: 0, Status: core.StatusPending, Expires: time.Now().AddDate(0, 0, 1), Challenges: []core.Challenge{chall}, Combinations: combos, Contact: []core.AcmeURL{u}}
|
||||
err = sa.UpdatePendingAuthorization(newPa)
|
||||
|
|
@ -194,7 +193,7 @@ func TestGetCertificateByShortSerial(t *testing.T) {
|
|||
func TestDeniedCSR(t *testing.T) {
|
||||
key, _ := rsa.GenerateKey(rand.Reader, 512)
|
||||
template := &x509.CertificateRequest{
|
||||
Subject: pkix.Name{CommonName: "google.com"},
|
||||
Subject: pkix.Name{CommonName: "google.com"},
|
||||
DNSNames: []string{"badguys.com", "reallybad.com"},
|
||||
}
|
||||
csrBytes, _ := x509.CreateCertificateRequest(rand.Reader, template, key)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import (
|
|||
|
||||
"github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/cactus/go-statsd-client/statsd"
|
||||
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose"
|
||||
"github.com/letsencrypt/boulder/core"
|
||||
|
||||
"github.com/letsencrypt/boulder/ra"
|
||||
"github.com/letsencrypt/boulder/test"
|
||||
|
|
@ -407,7 +407,7 @@ func TestRegistration(t *testing.T) {
|
|||
responseWriter.Body.Reset()
|
||||
wfe.NewRegistration(responseWriter, &http.Request{
|
||||
Method: "POST",
|
||||
Body: makeBody(signRequest(t, "{\"contact\":[\"tel:123456789\"]}")),
|
||||
Body: makeBody(signRequest(t, "{\"contact\":[\"tel:123456789\"]}")),
|
||||
})
|
||||
|
||||
test.AssertEquals(t, responseWriter.Body.String(), "{\"key\":{\"kty\":\"RSA\",\"n\":\"z2NsNdHeqAiGdPP8KuxfQXat_uatOK9y12SyGpfKw1sfkizBIsNxERjNDke6Wp9MugN9srN3sr2TDkmQ-gK8lfWo0v1uG_QgzJb1vBdf_hH7aejgETRGLNJZOdaKDsyFnWq1WGJq36zsHcd0qhggTk6zVwqczSxdiWIAZzEakIUZ13KxXvoepYLY0Q-rEEQiuX71e4hvhfeJ4l7m_B-awn22UUVvo3kCqmaRlZT-36vmQhDGoBsoUo1KBEU44jfeK5PbNRk7vDJuH0B7qinr_jczHcvyD-2TtPzKaCioMtNh_VZbPNDaG67sYkQlC15-Ff3HPzKKJW2XvkVG91qMvQ\",\"e\":\"AAEAAQ\"},\"recoveryToken\":\"\",\"contact\":[\"tel:123456789\"],\"thumbprint\":\"\"}")
|
||||
|
|
@ -493,11 +493,10 @@ func TestAuthorization(t *testing.T) {
|
|||
responseWriter.Body.String(),
|
||||
"{\"type\":\"urn:acme:error:malformed\",\"detail\":\"Unable to read/verify body\"}")
|
||||
|
||||
|
||||
responseWriter.Body.Reset()
|
||||
wfe.NewAuthorization(responseWriter, &http.Request{
|
||||
Method: "POST",
|
||||
Body: makeBody(signRequest(t, "{\"identifier\":{\"type\":\"dns\",\"value\":\"test.com\"}}")),
|
||||
Body: makeBody(signRequest(t, "{\"identifier\":{\"type\":\"dns\",\"value\":\"test.com\"}}")),
|
||||
})
|
||||
|
||||
test.AssertEquals(t, responseWriter.Body.String(), "{\"identifier\":{\"type\":\"dns\",\"value\":\"test.com\"},\"expires\":\"0001-01-01T00:00:00Z\"}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue