Merge branch 'master' into challenge-table

This commit is contained in:
Roland Shoemaker 2015-08-14 13:53:20 -07:00
commit 5601581aec
6 changed files with 45 additions and 13 deletions

View File

@ -0,0 +1,25 @@
package dns
import "testing"
func TestFuzzString(t *testing.T) {
testcases := []string{"", " MINFO ", " RP ", " NSEC 0 0", " \" NSEC 0 0\"", " \" MINFO \"",
";a ", ";a<><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
" NSAP O ", " NSAP N ",
" TYPE4 TYPE6a789a3bc0045c8a5fb42c7d1bd998f5444 IN 9579b47d46817afbd17273e6",
" TYPE45 3 3 4147994 TYPE\\(\\)\\)\\(\\)\\(\\(\\)\\(\\)\\)\\)\\(\\)\\(\\)\\(\\(\\R 948\"\")\\(\\)\\)\\)\\(\\ ",
"$GENERATE 0-3 ${441189,5039418474430,o}",
"$INCLUDE 00 TYPE00000000000n ",
"$INCLUDE PE4 TYPE061463623/727071511 \\(\\)\\$GENERATE 6-462/0",
}
for i, tc := range testcases {
rr, err := NewRR(tc)
if err == nil {
// rr can be nil because we can (for instance) just parse a comment
if rr == nil {
continue
}
t.Fatalf("parsed mailformed RR %d: %s", i, rr.String())
}
}
}

View File

@ -84,7 +84,12 @@ func (cadb *CertificateAuthorityDatabaseImpl) IncrementAndGetSerial(tx *gorp.Tra
return
}
row := rowObj.(*SerialNumber)
row, ok := rowObj.(*SerialNumber)
if !ok {
err = fmt.Errorf("No serial number found. This is a serious issue")
return
}
val = row.Number
row.Number = val + 1

View File

@ -159,7 +159,7 @@ func main() {
blog.SetAuditLogger(auditlogger)
// Configure DB
dbMap, err := sa.NewDbMap(c.Common.PolicyDB.Driver, c.Common.PolicyDB.Name)
dbMap, err := sa.NewDbMap(c.PA.DBDriver, c.PA.DBConnect)
cmd.FailOnError(err, "Could not connect to database")
dbMap.AddTableWithName(core.ExternalCert{}, "externalCerts").SetKeys(false, "SHA1")

View File

@ -170,6 +170,11 @@ type Config struct {
StatsdRate float32
}
PA struct {
DBDriver string
DBConnect string
}
Common struct {
BaseURL string
// Path to a PEM-encoded copy of the issuer certificate.

View File

@ -96,11 +96,8 @@ func recombineURLForDB(dbConnect string) (string, error) {
return "", err
}
// Check the parseTime=true DSN is present
if k := dsnVals.Get("parseTime"); k != "true" {
dsnVals.Set("parseTime", "true")
dbURL.RawQuery = dsnVals.Encode()
}
dsnVals.Set("parseTime", "true")
user := dbURL.User.Username()
passwd, hasPass := dbURL.User.Password()
dbConn := ""

View File

@ -49,7 +49,7 @@
"serialPrefix": 255,
"profile": "ee",
"dbDriver": "mysql",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test?parseTime=true",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test",
"debugAddr": "localhost:8001",
"testMode": true,
"_comment": "This should only be present in testMode. In prod use an HSM.",
@ -116,7 +116,7 @@
"sa": {
"dbDriver": "mysql",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test?parseTime=true",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test",
"debugAddr": "localhost:8003"
},
@ -132,12 +132,12 @@
"revoker": {
"dbDriver": "mysql",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test?parseTime=true"
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test"
},
"ocspResponder": {
"dbDriver": "mysql",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test?parseTime=true",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test",
"path": "/",
"listenAddress": "localhost:4001",
"debugAddr": "localhost:8005"
@ -145,7 +145,7 @@
"ocspUpdater": {
"dbDriver": "mysql",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test?parseTime=true",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test",
"minTimeToExpiry": "72h",
"debugAddr": "localhost:8006"
},
@ -160,7 +160,7 @@
"username": "cert-master@example.com",
"password": "password",
"dbDriver": "mysql",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test?parseTime=true",
"dbConnect": "mysql+tcp://boulder@localhost:3306/boulder_test",
"messageLimit": 0,
"nagTimes": ["24h", "72h", "168h", "336h"],
"emailTemplate": "test/example-expiration-template",