Commit Graph

536 Commits

Author SHA1 Message Date
Roland Bracewell Shoemaker 8d8263ac22 Switch CSR logging from base64 to hex (#2131) 2016-08-17 10:26:13 -04:00
Roland Bracewell Shoemaker c5d6166f08 Add registration update work around for new subscriber agreement URL (#2103)
Fixes #2102
2016-08-15 13:31:48 -07:00
Ben Irving 8ed5b1e6a1 Replace *AcmeURL with string (#2117)
Removes core.AcmeURL from boulder and uses string instead.

Fixes #1996
2016-08-11 13:27:19 -07:00
Roland Bracewell Shoemaker fc39781274 Allow user specified revocation reason (#2089)
Fixes #140.

This patch allows users to specify the following revocation reasons based on my interpretation of the meaning of the codes but could use confirmation from others.

* unspecified (0)
* keyCompromise (1)
* affiliationChanged (3)
* superseded (4)
* cessationOfOperation (5)
2016-08-08 14:26:52 -07:00
Jacob Hoffman-Andrews 5efccc5eb3 Always log malformed CSRs, even if check is off. (#2109)
This will help us evaluate their prevalence more easily.
2016-08-08 09:46:58 -04:00
Ben Irving daf3a988f9 Properly close test servers (#2110)
Now that we are on Go 1.6 we can properly close `httptest.Server`
Fixes #1989
2016-08-05 15:04:42 -07:00
Jacob Hoffman-Andrews 474b76ad95 Import forked x509 for parsing of CSRs with empty integers (#2088)
Part of #2080.

This change vendors `crypto/x509`, `crypto/x509/pkix`, and `encoding/asn1` from  1d5f6a765d. That commit is a direct child of the Go 1.5.4 release tag, so it contains the same code as the current Go version we are using. In that commit I rewrote imports in those packages so they depend on each other internally rather than calling out to the standard library, which would cause type disagreements.

I changed the imports in each place where we're parsing CSRs, and imported under a different name `oldx509`, both to avoid collisions and make it clear what's going on. Places that only use `x509` to parse certificates are not changed, and will use the current standard library.

This will unblock us from moving to Go 1.6, and subsequently Go 1.7.
2016-07-28 10:38:33 -04:00
Ben Irving f5d0038d47 Remove Shutdown{Kill,Stop}Timeout fields from WFE (#2062)
This PR removes the Shutdown{Kill,Stop}Timeout fields from `cmd/boulder-wfe/main.go`. These fields are set in `main.go` but never used. The relevant config fields only need to be used when creating an `httpdown.HTTP` in `cmd/boulder-wfe/main.go`.

Existing duration parsing was replaced with `cmd.ConfigDuration` use.
2016-07-21 09:36:52 -04:00
Daniel McCarney cc137507de Empty reg update should return existing reg data (#2067)
For #2001 an optimization was added to the WFE to avoid invoking the RA's `UpdateRegistration` method when a trivial (e.g. `{"resource:"reg"}`) update is received. Instead the WFE returned the trivial update back to the client immediately.

This is contrary to the ACME spec which indicates:
>  Servers SHOULD NOT respond to GET requests for registration resources as these requests are not authenticated. If a client wishes to query the server for information about its account (e.g., to examine the   “contact” or “certificates” fields), then it SHOULD do so by sending  a POST request with an empty update. That is, it should send a JWS whose payload is trivial ({“resource”:”reg”}).

The optimization regression was captured in issue #2066 when it broke at least one client implementation.

This removes the empty reg update optimization and passes all POST's to the RA. The RA will in turn fetch the existing registration to return to the client. The second half of the #2001 optimizations remains in place, no DB UPDATE's will be performed if the new registration content doesn't differ from the existing registration content (as determine by the return of `registration.MergeUpdate`).

Since the WFE optimization is no longer in place the `FailureRegistrationAuthority` mock isn't required and is removed. Similarly `TestEmptyRegistration` in `wfe_test.go` is changed from testing for the optimization to testing for the ACME described "get registration info" behaviour.

This fixes #2066
2016-07-21 09:05:56 -04:00
Jacob Hoffman-Andrews 5da7728cc5 Add helpful note to CSR parsing error. (#2055)
A few people have run into #565. This updated error message will make it more quickly obvious what's wrong.
2016-07-20 11:04:12 -04:00
Ben Irving dd4c9fdd42 Improve JWS supported algorithms error message (#2063)
Fixes #1191
2016-07-18 17:32:03 -07:00
Patrick Figel 8cd74bf766 Make (pending)AuthorizationLifetime configurable (#2028)
Introduces the `authorizationLifetimeDays` and `pendingAuthorizationLifetimeDays` configuration options for `RA`.

If the values are missing from configuration, the code defaults back to the current values (300/7 days).

fixes #2024
2016-07-12 15:18:22 -04:00
Daniel McCarney 7e946eaacc Registration update optimizations (#2001)
This PR adds two optimizations to fix the optimistic lock errors observed in #1986.

First, the WFE now returns early for registration POST's (before invoking the RA and SA) when the POST body is the trivial update (`{"resource":"reg"}`). This prevents any DB operations from being performed when there is no work to be done.

Second, the RA now tracks whether a update actually changes the base registration's `Contact` slice, or `Agreement` string. If the proposed update doesn't change either of these fields then the RA will return early before handing the update to the SA. 

Both changes save database operations from being performed needlessly and will help avoid the optimistic lock errors we observed when a problematic client was POSTing the trivial update repeatedly in a short period.

The fix was verified as follows: I checked out master and artificially introduced lock contention into the SA by adding a 2s sleep into `UpdateRegistration` between fetching the `existingRegModel` to get the `LockCol` value and calling `ssa.dbMap.Update`. With the sleep in place & two certbot clients posting matching registration updates the lock contention error is produced as expected. After checking out the `empty-reg-updates` branch, re-adding the sleep to the SA, and performing the same two client reg updates no error is produced.
2016-07-07 13:40:55 -04:00
Roland Bracewell Shoemaker 04961d7c66 Add basic ASN.1 structure test for pre-1.0.2 OpenSSL CSRs (#1972)
Adds a test for CSRs generated using a pre-1.0.2 version of OpenSSL and a buggy client which will fail to parse with Golang 1.6+.

This test checks the values of the bytes in the 8th and 9th offsets, which in a properly formatted CSR should be the version integer declaration bytes, and if the malformed values are present will return a error to the user informing them that they are using an old version of OpenSSL and/or a client which doesn't explicitly set the CSR version.

Fixes #1902.
2016-06-28 12:38:52 -07:00
Ben Irving afd382de78 Add no cache header for all requests, succeed or fail (#1965)
* move no cache header to before wfe.sendError

* Add no cache header for all requests, succeed or fail

* fix test
2016-06-23 17:30:46 -04:00
Ben Irving d3db851403 remove regID from WillingToIssue (#1957)
The `regID` parameter in the PA's `WillingToIssue` function was originally used for whitelisting purposes, but is not used any longer. This PR removes it.
2016-06-22 12:21:07 -04:00
Jacob Hoffman-Andrews 4e0f96d924 Remove last vestiges of challenge.AccountKey. (#1949)
This is a followup from https://github.com/letsencrypt/boulder/pull/1942. That PR stopped setting challenge.AccountKey. This one removes it entirely.

Fixes #1948
2016-06-21 16:25:58 -07:00
Ben Irving 67fd6ef67c Add certificatesPerName rate limit to integration test (#1940)
This PR, covers the code path where the certificatesPerName rate limit is exceeded.

Additionally, a node package (cli) was upgraded as the spinner was preventing the redirection of I/O. See this commit: node-js-libs/cli@ff064fe.

Fixes #1614

https://github.com/letsencrypt/boulder/pull/1940
2016-06-17 16:10:05 -07:00
Daniel McCarney cd2d1c4f6b Allow removing registration contact. (#1923)
The RA UpdateRegistration function merges a base registration object with an update by calling Registration.MergeUpdate. Prior to this commit MergeUpdate only allowed the updated registration object to overwrite the Contact field of the existing registration if the updated reg. defined at least one AcmeURL. This prevented clients from being able to outright remove the contact associated with an existing registration.

This commit removes the len() check on the input.Contact in MergeUpdate to allow the r.Contact field to be overwritten by a []*core.AcmeURL(nil) Contact field. Subsequently clients can now send an empty contacts list in the update registration POST in order to remove their reg contact.

Fixes #1846

* Allow removing registration contact.
* Adds a test for `MergeUpdate` contact removal.
* Change `Registration.Contact` type to `*[]*core.AcmeURL`.
* End validateContacts early for empty contacts
* Test removing reg. contact more thoroughly.
2016-06-13 11:02:29 -07:00
Daniel McCarney 9abc212448 Reuse valid authz for subsequent new authz requests (#1921)
Presently clients may request a new AuthZ be created for a domain that they have already proved authorization over. This results in unnecessary bloat in the authorizations table and duplicated effort.

This commit alters the `NewAuthorization` function of the RA such that before going through the work of creating a new AuthZ it checks whether there already exists a valid AuthZ for the domain/regID that expires in more than 24 hours from the current date. If there is, then we short circuit creation and return the existing AuthZ. When this case occurs the `RA.ReusedValidAuthz` counter is incremented to provide visibility.

Since clients requesting a new AuthZ and getting an AuthZ back expect to turn around and post updates to the corresponding challenges we also return early in `UpdateAuthorization` when asked to update an AuthZ that is already valid. When this case occurs the `RA.ReusedValidAuthzChallenge` counter is incremented.

All of the above behaviour is gated by a new RA config flag `reuseValidAuthz`. In the default case (false) the RA does **not** reuse any AuthZ's and instead maintains the historic behaviour; always creating a new AuthZ when requested, irregardless of whether there are already valid AuthZ's that could be reused. In the true case (enabled only in `boulder-config-next.json`) the AuthZ reuse described above is enabled.

Resolves #1854
2016-06-10 16:44:16 -04:00
Ben Irving 438580f206 Remove last of UseNewVARPC (#1914)
`UseNewVARPC` is no longer necessary and is safe to be removed. We default to using the newer VA RPC code.
2016-06-09 10:12:46 -04:00
Daniel McCarney 4c289f2a8f Reload ratelimit policy automatically at runtime (#1894)
Resolves #1810 by automatically updating the RA ratelimit.RateLimitConfig whenever the backing config file is changed. Much like the Policy Authority uses a reloader instance to support updating the Hostname policy on the fly, this PR changes the Registration Authority to use a reloader for the rate limit policy file.

Access to the ra.rlPolicies member is protected with a RWMutex now that there is a potential for the values to be reloaded while a reader is active.

A test is introduced to ensure that writing a new policy YAML to the policy config file results in new values being set in the RA's rlPolicies instance.

https://github.com/letsencrypt/boulder/pull/1894
2016-06-08 12:11:46 -07:00
Ben Irving 2b99464358 WFE returns headers Boulder-Request-ID and Boulder-Requester (#1886)
* WFE returns headers Boulder-Request-ID and Boulder-Requester
* improve test
* add the requestHeader after calls to verifyPOST
* move call of addRequesterHeader in NewRegistration
* move setting of request header to context, improve test
* remove pointless comment
2016-06-07 15:29:58 -04:00
Ben Irving 1336c42813 Replace all log.Err calls with log.AuditErr (#1891)
* remove calls to log.Err()
* go fmt
* remove more occurrences
* change AuditErr argument to string and replace occurrences
2016-06-06 16:27:16 -04:00
Jacob Hoffman-Andrews 92df4d0fc2 Rename authorities to shorter names. (#1878)
Fixes #1875.
2016-06-03 13:35:28 -07:00
Ben Irving 0f8a1a9d57 Implement StripPrefix in wfe (#1881)
This PR implements `http.StripPrefix` as a wrapper to the existing handler in `wfe.go`. `StripPrefix` is used to remove the path that it expects for each handler. Such as /acme/reg/. The remaining path is used as a slug, since multiple slugs are outside the scope of the specification. 

Several tests bypassed the `mux.Handle()` and called the wrapped handler directly. Ex `Registration`. As a result of this, many tests had to be modified to no longer pass in the full path. `request.URL.Path` should now only ever contain the slug (if there is one).

Fixes #437
2016-06-03 10:43:12 -07:00
Ben Irving a713823cd5 Remove most instances of blog.Get() (#1870)
In this PR, logger is passed to the following callers:
  NewWebFrontEndImpl
  NewCertificateAuthorityImpl
  NewValidationAuthorityImpl
  NewAmqpRPCServer
  newUpdater
  NewRegistrationAuthorityServer

This reduces the usage of a global singleton logger and allows tests to consistently use a mock logger.

Fixes #1642

* remove blog.Get() in wfe
* remove blog.Get() from va
* remove Blog.Get() from ca
* remove blog.Get() from oscp updater, ampq rpc server, registration authority server
* removed some pointless logging code
* remove one added newline
* fix format issue
* fix setup function to return *blog.Mock instead of being passed in
* remove useless blog.NewMock() call
2016-06-02 14:26:39 -07:00
Jacob Hoffman-Andrews cf65d7d595 Improve VA and RA initialization (#1867)
- Run both gRPC and AMQP servers simultaneously
- Take explicit constructor parameters and unexport fields that were previously set by users
- Remove transitional DomainCheck code in RA now that GSB is enabled.
- Remove some leftover UpdateValidation dummy methods.
2016-06-02 11:57:37 -07:00
Jacob Hoffman-Andrews 9a4b979397 Move goodkey and nonce out of core (#1869) 2016-06-02 11:29:58 -07:00
Daniel McCarney 19635b2b6c The rate limiting code previously lived in the `cmd` package without a clear justification for why. This commit moves the rate limiting code to its own `ratelimit` package and updates import paths as required. Notably all references from the `cmd` package's exported `LoadRateLimitPolicies`, `RateLimitPolicy`, and `RateLimitConfig` were moved to use `ratelimit`.This removed the `cmd` import from a couple of callers (nice!).
The rate limiting code previously lived in the `cmd` package without a clear justification for why. This commit moves the rate limiting code to its own `ratelimit` package and updates import paths as required. Notably all references from the `cmd` package's exported `LoadRateLimitPolicies`, `RateLimitPolicy`, and `RateLimitConfig` were moved to use `ratelimit`. This removed the `cmd` import from a couple of callers (nice!).
2016-05-31 17:38:17 -04:00
Roland Bracewell Shoemaker 54573b36ba Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
Daniel McCarney 5ce90a1a72 Make directory URLs relative to requested URL (#1847)
Prior to this PR the /directory JSON result was built once in Handler() and returned as-is for all requests. Each endpoint URL was fully qualified as an absolute URL using the BaseURL configuration
parameter. This required a configuration change in order to tweak the origin being used for subsequent requests. Returning purely relative URLs (e.g. /acme/new-reg vs http://localhost:4000/acme/new-reg) would break clients that assume absolute paths and we don't want that.

This PR introduces a new behaviour where the /directory JSON is built per-request using the HTTP Host header in place of the BaseURL. Clients will still receive a fully qualified URL in each directory entry but we gain the ability to more easily control the host without requiring config changes. To allow gradual migration via the config file we use the old /directory behaviour when a BaseURL is specified in the configuration file. This will address #1823.

Since the request.URL is not populated (Spare the Path attribute) we can not use request.URL.Scheme for the initial http:// vs https:// prefix when constructing the URLs and instead differentiate between the two cases using the req.TLS attribute. For cases (such as in production) where another service is terminating the initial request and making a subsequent HTTP request to the WFE we support the X-Forwarded-Proto header to ensure we use the original request's protocol when building URLs.

Many unit tests for the WFE assumed that when there is no BaseURL specified and no Host header is sent in the request, that the output will return relative paths. This PR changes that behaviour to always return absolute URLs by defaulting to localhost for the Host when it is not specified via the initial request or the BaseURL config option. This PR changes the expected test output to match this behaviour.
2016-05-27 10:17:19 -07:00
Roland Bracewell Shoemaker 5abe7e3cdf Move CSR normalization/verification to their own methods (#1826)
* Split CSR testing and name hoisting into own functions, verify CSR in RA & CA

* Move tests around and various other fixes

* 1.5.3 doesn't have the needed stringer

* Move functions to their own lib

* Remove unused imports

* Move MaxCNLength and BadSignatureAlgorithms to csr package

* Always normalizeCSR in VerifyCSR and de-export it

* Update comments
2016-05-26 14:17:41 -07:00
Jacob Hoffman-Andrews e62a99039d Use MarshalIndent in WFE (#1811)
* Use MarshalIndent in WFE

This makes it easier to read output without first running it through a JSON
prettifier.

* Fix test
* marshal->marshalIndent

https://github.com/letsencrypt/boulder/pull/1811
2016-05-12 20:31:36 -07:00
Roland Bracewell Shoemaker 8ee578c3b7 Check JWK is valid before sending to SA (#1782)
Update vendored github.com/square/go-jose
Check key is valid before sending to SA
2016-05-03 14:26:52 -07:00
Kane York b7cf618f5d context.Context as the first parameter of all RPC calls (#1741)
Change core/interfaces to put context.Context as the first parameter of all RPC calls in preparation for gRPC.
2016-04-19 11:34:36 -07:00
Jacob Hoffman-Andrews e6c17e1717 Switch to new vendor style (#1747)
* Switch to new vendor style.

* Fix metrics generate command.

* Fix miekg/dns types_generate.

* Use generated copies of files.

* Update miekg to latest.

Fixes a problem with `go generate`.

* Set GO15VENDOREXPERIMENT.

* Build in letsencrypt/boulder.

* fix travis more.

* Exclude vendor instead of godeps.

* Replace some ...

* Fix unformatted cmd

* Fix errcheck for vendorexp

* Add GO15VENDOREXPERIMENT to Makefile.

* Temp disable errcheck.

* Restore master fetch.

* Restore errcheck.

* Build with 1.6 also.

* Match statsd.*"

* Skip errcheck unles Go1.6.

* Add other ignorepkg.

* Fix errcheck.

* move errcheck

* Remove go1.6 requirement.

* Put godep-restore with errcheck.

* Remove go1.6 dep.

* Revert master fetch revert.

* Remove -r flag from godep save.

* Set GO15VENDOREXPERIMENT in Dockerfile and remove _worskpace.

* Fix Godep version.
2016-04-18 12:51:36 -07:00
Kane York 25b45a45ec Errcheck errors fixed (#1677)
* Fix all errcheck errors
* Add errcheck to test.sh
* Add a new sa.Rollback method to make handling errors in rollbacks easier.
This also causes a behavior change in the VA. If a HTTP connection is
abruptly closed after serving the headers for a non-200 response, the
reported error will be the read failure instead of the non-200.
2016-04-12 16:54:01 -07:00
Jacob Hoffman-Andrews ecc04e8e61 Refactor log package (#1717)
- Remove error signatures from log methods. This means fewer places where errcheck will show ignored errors.
- Pull in latest cfssl to be compatible with errorless log messages.
- Reduce the number of message priorities we support to just those we actually use.
- AuditNotice -> AuditInfo
- Remove InfoObject (only one use, switched to Info)
- Remove EmergencyExit and related functions in favor of panic
- Remove SyslogWriter / AuditLogger separate types in favor of a single interface, Logger, that has all the logging methods on it.
- Merge mock log into logger. This allows us to unexport the internals but still override them in the mock.
- Shorten names to be compatible with Go style: New, Set, Get, Logger, NewMock, etc.
- Use a shorter log format for stdout logs.
- Remove "... Starting" log messages. We have better information in the "Versions" message logged at startup.

Motivation: The AuditLogger / SyslogWriter distinction was confusing and exposed internals only necessary for tests. Some components accepted one type and some accepted the other. This made it hard to consistently use mock loggers in tests. Also, the unnecessarily fat interface for AuditLogger made it hard to meaningfully mock out.
2016-04-08 16:12:20 -07:00
Jacob Hoffman-Andrews 090565a711 Accept = in orphan-finder.
Also, when a certificate already exists, treat that as info, not error.

Update mock logger to allow matching by log level, and fix WFE and VA tests
correspondingly.
2016-04-05 17:46:51 -07:00
Elliot Iddon fd4ced2b8d Same URL, different place. 2016-04-01 15:19:24 +01:00
Kane York 6024176ee0 Add calls to PerformValidation in the RA 2016-03-23 10:39:23 -07:00
Jacob Hoffman-Andrews 231129bb78 Pull out WFE's MockCA into a shared mock.
Also:

- Use MockCA in the RA test instead of a real CA.
- Since the mock CA doesn't write to an SA, remove a part of the RA test that
checked that the certificate was written. That code is already tested in the CA,
where the test belongs.
- Format the constants in RA test to be more copy-and-pasteable.
- Remove Printf in mocks/log.go and test/db.go to make failed test output more readable.
2016-03-20 17:23:15 -07:00
Roland Shoemaker 00b617b59a Switch to upstream square/go-jose + pull latest 2016-03-15 13:54:22 -07:00
Roland Shoemaker 03427ccb81 Remove telephone contacts as a option 2016-03-08 16:03:16 -08:00
Kane York db8bea7b05 Specify severity of all log.Audit calls
Fixes #1534
2016-02-25 10:55:01 -08:00
Damian Poddebniak a3aac300b9 Merge branch 'master' into ChallengesFor_remove_error_type_return 2016-02-17 09:24:44 +01:00
Jessica Frazelle 3df2e942be
go fmt fixes
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-02-16 12:19:15 -08:00
Damian Poddebniak 01cee65079 Changed return type for "ChallengesFor". 2016-02-13 23:01:28 +01:00
Jeff Hodges 068c0e1620 include User-Agent in logEvent
This makes identifying clients with boogs or just weird behavior easier to find.
2016-01-21 17:39:41 -08:00
Jeff Hodges 3214245240 log nonce to and from client
Also, log when a nonce service error occurs.

Updates #1217
2016-01-21 11:54:15 -08:00
Hugo Landau 5c9be5385b ECDSA account key support 2016-01-14 06:56:35 +00:00
Hugo Landau f218e314f8 Add good key testing for ECDSA. 2016-01-07 22:48:38 +00:00
Jeff Hodges de14c9274c s/our/out/ in wfe HEAD comment 2016-01-04 17:06:32 -08:00
Roland Bracewell Shoemaker 35e8489bd0 Merge branch 'master' into correct_head_content_length 2016-01-04 16:35:16 -08:00
Alex Gaynor cbeffe96a6 Fixed a bunch of typos 2016-01-04 18:39:34 -05:00
Jeff Hodges 426ec155aa correct Content-Length/Transfer-Encoding on HEAD
Fixes #1320
2016-01-04 15:03:14 -08:00
Jeff Hodges 6b0e53b8e0 use ProblemDetails inside of wfe
This uses ProblemDetails throughout the wfe. This is the last step in
allowing the backend services to pass ProblemDetails from RPCs through
to the user.

Updates #1153.

Fixes #1161.
2015-12-15 11:44:33 -08:00
Jeff Hodges 1dc5e53c5a add HTTPStatus to ProblemDetails
For #1161
2015-11-24 23:14:51 -08:00
Jeff Hodges 2114f5d5cc move ProblemDetails into its own package
Part of #1161
2015-11-24 23:14:38 -08:00
Jeff Hodges c0318399df Merge branch 'master' into send_error_use_error 2015-11-23 12:16:31 -08:00
Roland Shoemaker 680c21c1b1 Decimal sentinel 2015-11-23 10:55:59 -08:00
Roland Shoemaker 15ae242cfe Add tests for new error 2015-11-22 17:19:43 -08:00
Jeff Hodges 1b9e858681 Merge branch 'master' into send_error_use_error 2015-11-20 16:39:11 -08:00
Jeff Hodges 49978dc289 narrow wfe.sendError's signature
And statusCodeFromError, as well.

This makes what was an `interface{}` into a `error`.

This change is the first step towards #1161
2015-11-20 16:28:11 -08:00
Roland Shoemaker 458c7e2b4a Add badNonce error as described in the specification 2015-11-20 15:57:22 -08:00
Richard Barnes 0835ee8db3 Update VA and WFE to use revised nonce mechanisms in go-jose 2015-11-17 13:50:17 -08:00
Jacob Hoffman-Andrews 8b2c50bc65 Return pointer from NewNonceService. 2015-11-11 12:47:38 -08:00
Jeff Hodges e8e1456b9d Merge branch 'master' into gsb 2015-11-06 16:39:04 -08:00
Jeff Hodges 13cab5c257 add Google Safe Browsing API calls
This allows us to call the Google Safe Browsing calls through the VA.

If the RA config's boolean UseIsSafeDomain is true, the RA will make the RPC
call to the VA during its NewAuthorization.

If the VA config's GoogleSafeBrowsingConfig struct is not nil, the VA
will check the Google Safe Browsing API in
VA.IsSafeDomain. If the GoogleSafeBrowsingConfig struct is nil, it will
always return true.

In order to actually make requests, the VA's GoogleSafeBrowsingConfig
will need to have a directory on disk it can store the local GSB hashes
it will check first and a working Google API key for the GSB API.

Fixes #1058
2015-11-06 16:37:34 -08:00
Jacob Hoffman-Andrews 45f1e2958c Move new code to a different file. 2015-11-06 15:18:14 -08:00
Jacob Hoffman-Andrews 3d3b508ad3 Check for correct algorithms in verifyPOST
Fixes https://github.com/letsencrypt/boulder/issues/259
2015-11-06 14:17:24 -08:00
Richard Barnes c62d4a0828 Spelling fix 2015-10-22 13:59:18 -04:00
Richard Barnes 2ebba2a466 Re-add descriptive errors 2015-10-21 22:45:54 -04:00
Richard Barnes ded5fa6f20 Back out field name changes 2015-10-21 21:55:45 -04:00
Richard Barnes d61d09bb61 Minor beautification 2015-10-21 09:25:27 -04:00
Richard Barnes dc58017032 Remove repetition by passing logEvent to sendError 2015-10-21 09:23:17 -04:00
Richard Barnes cddf1d27ef RealIP->clientAddr and fix nits 2015-10-21 09:07:35 -04:00
Richard Barnes fdc0e2cce9 Merge branch 'master' to wfe_context 2015-10-21 08:47:07 -04:00
Richard Barnes 0fd89d3048 Use a fake clock for the WFE and mock SA 2015-10-20 17:12:59 -04:00
Richard Barnes bd1dee5bbc StatusGone -> StatusNotFound 2015-10-20 11:01:24 -04:00
Jeff Hodges 7d04ea98cf add context to WFE errors
This change makes the use of requestEvent more prominent and provides
some nice handler types to make that better.

In order to avoid stomping on Error, requestEvent gains an Errors string
slice.

Fixes #552
2015-10-16 22:40:51 -07:00
Richard Barnes 8e64139ac2 Merge branch 'master' into shorter-expiry-for-pending 2015-10-13 15:55:38 -07:00
Tom Clegg 22ef139419 Merge branch 'master' into challenge-head 2015-10-09 19:54:45 -07:00
Richard Barnes c3dacf5dae Make expired authz URLs inaccessible. 2015-10-09 17:45:34 -04:00
Richard Barnes 109f7cf75e Limit the number of contacts per registration 2015-10-09 16:35:19 -04:00
Jacob Hoffman-Andrews 487d08ec2e Add rate limiting by registration IP. 2015-10-08 15:47:08 -07:00
Tom Clegg 1bf8cfb4fd Handle HEAD correctly in Challenge 2015-10-07 23:37:41 -07:00
Tom Clegg f32c26c1de Merge branch 'master' into log-actual-ip
Conflicts:
	wfe/web-front-end_test.go
2015-10-07 11:58:23 -07:00
Tom Clegg 75bc949985 Merge branch 'master' into log-actual-ip 2015-10-07 08:20:38 -07:00
Richard Barnes b01e99ea04 Merge branch 'master' into golint 2015-10-07 10:42:36 -04:00
Tom Clegg 01b40466a4 Log actual remote IP, in addition to X-Forwarded-For header, in request log and csrLog 2015-10-05 23:30:58 -07:00
Richard Barnes f064c6d5c7 Merge branch 'master' to 'sig-reuse' 2015-10-05 23:16:16 -04:00
bifurcation 90050e91f5 Merge branch 'master' into golint 2015-10-05 19:23:24 -04:00
Jeff Hodges 5217af94b0 allow whitelisting by a specific reg id
Currently, the whitelisted registration ID is one that is impossible for the
database to return. Once the partner's registration is in place, we can
deploy a change to it.

Fixes #810
2015-10-05 14:11:38 -07:00
Richard Barnes f70441113b Fix brokenness introduced from merge of master 2015-10-05 00:18:22 -04:00
bifurcation e7f47d4f09 Merge branch 'master' into golint 2015-10-05 00:14:29 -04:00
Richard Barnes 961e392521 Merge branch 'master' into sig-reuse 2015-10-04 23:25:54 -04:00
Richard Barnes 2616567953 Fix golint in ./wfe 2015-10-04 21:12:14 -04:00
Richard Barnes 498deeb518 Fix golint in ./mocks 2015-10-04 20:37:06 -04:00
Jacob Hoffman-Andrews 6906e395a4 Pass RateLimitedError properly through RPC layer. 2015-10-03 22:59:28 -07:00
Richard Barnes 31ae51129a Merge branch 'master' into sig-reuse 2015-10-03 14:01:34 -04:00
Tom Clegg 87dd8a4c44 Merge branch 'master' into 469-fix-cors-headers 2015-10-02 01:37:59 -07:00
Richard Barnes 4c20bfe310 Merge master to sig-reuse 2015-10-01 18:58:35 -07:00
Jacob Hoffman-Andrews 6963811ab5 Merge remote-tracking branch 'le/master' into paranoid-key
Conflicts:
	core/util.go
2015-10-01 14:13:05 -07:00
Jacob Hoffman-Andrews a9db85adf2 Merge branch 'master' into paranoid-key 2015-10-01 14:12:38 -07:00
Jeff Hodges c24ced260e Merge branch 'master' into cert-limit 2015-10-01 11:11:55 -07:00
Tom Clegg 72538dcd76 Update comment. A-C-A-Headers is never sent at all any more. 2015-10-01 10:29:08 -07:00
Tom Clegg 41fcec2db5 Remove unneeded Access-Control-Allow-Headers header. 2015-09-30 18:23:02 -07:00
Roland Shoemaker 65f10a5f9f Review fixes 2015-09-30 15:34:24 -07:00
Tom Clegg 05a142c6b7 Fix accidentally sending preflight headers with "actual" responses. 2015-09-30 13:34:36 -07:00
Tom Clegg 9898aec7e7 Test status==405 and body=="" on disallowed HEAD. 2015-09-30 11:10:18 -07:00
Tom Clegg c56f035cff Merge branch 'master' into 469-fix-cors-headers
Conflicts:
	wfe/web-front-end.go
	wfe/web-front-end_test.go
2015-09-30 07:13:12 -07:00
Jacob Hoffman-Andrews 685c6e4206 Use stored key to verify JWS POSTs
instead of submitted key. This minimizes the chances of unexpected JWK fields in
the submitted key altering its interpretation without altering the lookup in the
registrations table.

In the process, fix handling of NoSuchRegistration responses.

Fixes https://github.com/letsencrypt/boulder/issues/865.
2015-09-29 23:37:16 -07:00
Tom Clegg fa30debe15 De-duplicate uses of strings.Join() 2015-09-29 00:49:41 -07:00
Tom Clegg a49e54cfc3 Merge branch 'master' into 469-fix-cors-headers
Conflicts:
	wfe/web-front-end.go
2015-09-28 20:02:44 -07:00
Richard Barnes 1a9fd9b455 Update to latest ACME spec 2015-09-28 10:10:06 -04:00
Jacob Hoffman-Andrews 1fbf2d4990 Fix HEAD to work only for GET resources. 2015-09-27 23:49:59 -07:00
Jacob Hoffman-Andrews ecd08c0798 Allow HEAD for all GET resources. 2015-09-27 12:36:18 -07:00
Roland Shoemaker 96afd94e88 Review fixes
* Rewrite JSONDuration as ConfigDuration that can handle both JSON and YAML unmarshaling
* Factor out RPC certificate count request struct
* Return 429 to WFE on rate limit exceeded
* Fix wonky RateLimitPolicy comment
2015-09-25 14:39:53 -07:00
Roland Shoemaker 6f41cc9e39 Add issuance rate limiting based on total number of certificates issued in a window
Since the issuance count requires a full table scan a RA process local cache of the
count is kept and expired after 30 minutes.
2015-09-24 12:54:38 -07:00
Jacob Hoffman-Andrews 954004fafb Merge branch 'longserial' of github.com:letsencrypt/boulder into longserial 2015-09-22 16:18:07 -07:00
Jacob Hoffman-Andrews 3c5ffdea49 Restore full test for certificate location. 2015-09-22 16:17:22 -07:00
Jeff Hodges a645430a23 Merge branch 'master' into longserial 2015-09-22 15:01:47 -07:00
Roland Shoemaker 4a47aaed51 Merge master 2015-09-22 14:07:07 -07:00
Jacob Hoffman-Andrews 668ccc2d97 Merge github.com:letsencrypt/boulder into longserial 2015-09-22 14:04:19 -07:00
Jacob Hoffman-Andrews c858b4d430 Consolidate serial number validity checking.
Also, set the requirement to be hexadecimal and <36 characters, rather than
exactly 36 characters.
2015-09-22 14:03:29 -07:00
Roland Shoemaker 91724296a8 Use facebooks gracefully shutting down HTTP server for WFE & OCSP-Responder 2015-09-21 20:43:38 -07:00
Jacob Hoffman-Andrews f430280884 Fix review comments. 2015-09-21 18:18:08 -07:00
Jacob Hoffman-Andrews 02314f4041 Implement the new 144-bit mostly-random serial.
To keep the change small, I have not yet completely removed the
GetCertificateByShortSerial method from interfaces and the RPC. I will do taht
in a follow up change.
2015-09-21 13:10:16 -07:00
Tom Clegg 42958d1aab Merge branch 'master' into 469-fix-cors-headers 2015-09-17 19:19:55 -07:00
Roland Shoemaker 536de0249d Merge master 2015-09-16 18:08:26 -07:00
Jacob Hoffman-Andrews f7910753b5 Move MockSA from WFE to mocks. 2015-09-16 12:57:06 -07:00
Roland Shoemaker cc65beef3f Merge master 2015-09-15 14:52:40 -07:00
Jeff Hodges 7648e452b9 Merge branch 'master' into earliest-expiry 2015-09-15 13:26:44 -07:00
Tom Clegg 38b7bbee97 Merge branch 'master' into 469-fix-cors-headers 2015-09-15 15:49:37 -04:00
Roland Bracewell Shoemaker acf2999d5f Merge branch 'master' into clean_up_new_reg_test 2015-09-15 12:22:19 -07:00
Roland Shoemaker f35643bcaf Merge master 2015-09-15 12:05:58 -07:00
Tom Clegg 9eca9f0805 golint 2015-09-12 17:09:07 -04:00
Tom Clegg 62f7e6e530 Add config entry for allowed origins. 2015-09-12 01:39:55 -04:00
Tom Clegg b6a4b66899 Fix CORS headers, support OPTIONS requests. 2015-09-12 01:39:51 -04:00
Jacob Hoffman-Andrews e3c226a84e Remove earliestExpiry from IssueCertificate call. 2015-09-11 15:09:11 -04:00
Roland Bracewell Shoemaker d55e0e0d8d Merge branch 'master' into fix-wfe-test-better 2015-09-11 11:58:28 -07:00
Jeff Hodges 52055d3190 Merge branch 'master' into clean_up_new_reg_test 2015-09-11 11:31:46 -07:00
Jeff Hodges d2b0579283 Merge branch 'master' into metrics-cleanup 2015-09-11 11:28:05 -07:00
Jacob Hoffman-Andrews 6233c0891c Fix typo. 2015-09-11 14:08:26 -04:00
Jacob Hoffman-Andrews 86926dc20d Merge branch 'master' into fix-wfe-error 2015-09-11 14:03:47 -04:00
Jacob Hoffman-Andrews acff35cf48 Merge branch 'master' into clean_up_new_reg_test 2015-09-11 14:03:44 -04:00
Jacob Hoffman-Andrews 57e349ef00 Merge github.com:letsencrypt/boulder into fix-wfe-error 2015-09-11 13:54:25 -04:00
Jacob Hoffman-Andrews a48142e3c7 Remove testing arg. 2015-09-11 13:54:18 -04:00