Commit Graph

149 Commits

Author SHA1 Message Date
Jeff Hodges 390464ddf4 correct unique indexing of Registrations
Fixes #579 (which blocks #132).

This changes the SA to use a unique index on the sha256 of a
Registration's JWK's public key data instead of on the full serialized
JSON of the JWK. This corrects multiple problems:

 1. MySQL/Mariadb no longer complain about key's being larger than the
 largest allowed key size in an index
 2. We no longer have to worry about large keys not being seen as unique
 3. We no longer have to worry about the JWK's JSON being serialized with its inner keys in different orders and causing incorrectly empty queries or non-unique writes.

This change also hides the details of how Registrations are stored in
the database from the other services outside of SA. This will give us
greater flexibility if we need to move them to another database, or
change their schema, etc.

Also, adds some tests for NoSuchRegistration in the SA.
2015-08-06 14:19:19 -07:00
Jeff Hodges 0f03494d56 use pointer to AcmeURL everywhere
This has the benefit of not requiring us to copy very fat url.URL
objects when we pass them to funcs or call their methods.
2015-08-05 18:23:38 -07:00
Richard Barnes 652702bd7f Merge master 2015-07-30 13:47:10 -04:00
Roland Shoemaker 272fbbd480 Merge pull request #541 from r0ro/remove-authz-newcert
Remove the need for a client to send authorizations url when requesting new certificate
2015-07-29 13:10:46 -07:00
Richard Barnes 9e87cef807 Further test fixes 2015-07-29 12:20:00 -04:00
Richard Barnes 4cac9da9fd Refactor simpleHttp challenge 2015-07-29 12:18:09 -04:00
Romain Fliedel 36cba96fb2 update tests after jwk encoding fix. 2015-07-28 16:25:30 +02:00
Romain Fliedel 2b275405c1 remove authorizations member for certificate request. 2015-07-27 20:26:56 +02:00
Romain Fliedel 4bbd0fdccd Remove the need for a client to submit authorization urls when requesting a certificate. 2015-07-27 20:26:56 +02:00
Jacob Hoffman-Andrews 9423467142 Switch to our own fork of go-jose.
This is the result of `godep save -r ./...` and
`git rm -r -f Godeps/_workspace/src/github.com/square`

Our fork is currently at the head of go-jose when Richard made the local nonce
changes, with the nonce changes added on top. In other words, the newly created
files are exactly equal to the deleted files.

In a separate commit I will bring our own go-jose fork up to the remote head,
then update our deps.

Also note: Square's go-jose repo contains a `cipher` package. Since we don't
make any changes to that package, we leave it imported as-is.
2015-07-24 14:39:00 -07:00
Jacob Hoffman-Andrews 620a012c62 Rewrite go-jose dependencies to our fork. 2015-07-24 14:16:01 -07:00
Jeff Hodges 8975601d5e correct bodyStr->body 2015-07-23 17:41:15 -07:00
Roland Shoemaker 31f0674f03 Replace net.LookupMX with core.LookupMX using defined resolver 2015-07-21 22:36:29 -07:00
Tom Clegg 2d0be62966 Use mock syslog in test suites (except core and log). Drop SwitchLog(). 2015-07-21 17:06:39 -04:00
Roland Shoemaker f6248ef279 Flesh out DNS mock methods, and move them to their own sub-module instead of under test/ to avoid import loop, Add Loopback DNS resolver for core/dns_test.go 2015-07-07 22:31:44 +01:00
Richard Barnes 5b33afba8e Reject weak CSR signing algorithms.
Also removed a commented-out CSR in the RA tests, and fixed a CA test that was (1) not testing what it meant to, and (2) used a different method from the other tests.
2015-06-23 21:47:31 -07:00
Brad Warren c092d41348 Merge remote-tracking branch 'upstream/master' into errors 2015-06-19 13:25:38 -07:00
Brad Warren 9312fb7eae Allowed for more detailed error messages: 2015-06-19 12:51:09 -07:00
Roland Shoemaker 47187d6224 Log hex serial number 2015-06-19 12:49:57 -07:00
Roland Shoemaker 403af37a39 Hide Authorization.Expires field when uninitialized 2015-06-17 18:34:30 -07:00
J.C. Jones 41f5788c77 Correct most `go lint` warnings. (274 -> 5) 2015-06-16 22:18:28 -05:00
J.C. Jones fcaa6b9530 Issue #11: Add tests 2015-06-16 09:03:03 -05:00
Roland Shoemaker 01c41c1bd0 Merge pull request #354 from letsencrypt/344-internal_server_errors
Resolves Issue #344: Only send InternalServerError when needed
2015-06-15 15:57:04 -07:00
J.C. Jones dbe88d5d80 Issue #344: RA: Pull out a `validateContacts` method
- Created a `validateContacts` method to avoid duplicated code
- Added tests for `validateContacts` and `validateEmail`
- Fix error formatting in `validateEmail`:
  Discovered while testing `validateEmail` that, if no MX records are found,
  `err` is returned, not an empty array. As such, the error message
   was misleading, so I consoldated the conditions into one.
2015-06-15 16:46:50 -05:00
Jacob Hoffman-Andrews 80d5e50e42 Enable revocation by account key.
In addition to cert private key. This required modifying the GetCertificate*
functions to return core.Certificate instead of certificate bytes.
2015-06-15 12:33:50 -07:00
J.C. Jones 2d79af0c69 Issue 344 Rework: Revert Internal Errors in RA, add validation to UpdateReg 2015-06-13 00:21:44 -05:00
J.C. Jones 1474b7f21f Resolves Issue #344: Only send InternalServerError when needed
Basically, just send InternalServerError when it indicates an internal state
was broken.
2015-06-13 00:21:44 -05:00
Roland Shoemaker f4ee29d1d3 Change all references from SimpleHTTPS -> SimpleHTTP 2015-06-12 11:22:04 -07:00
J.C. Jones 2ad15a4a85 Issue #309: Produce OCSP Responses immediately upon issuance, if at all possible.
This approach performs a best-effort generation of the first OCSP response during
certificate issuance. In the event that OCSP generation fails, it logs a warning at
the Boulder-CA console, but returns successfully since the Certificate was itself
issued.
2015-06-11 11:31:04 -05:00
Roland Shoemaker 0265b6f5d0 Merge upstream/master and fix conflicts 2015-06-10 12:43:11 -07:00
Roland Shoemaker 370b6f9bf9 Return error from core.GoodKey 2015-06-06 17:12:16 -07:00
James 'J.C.' Jones 3acb03fdc9 Merge pull request #319 from letsencrypt/validate-contact
Validate contact details in the RA upon `new-reg`.
2015-06-06 07:57:16 -07:00
Roland Shoemaker 643bc4279c Move email validation to seperate function 2015-06-06 06:37:29 -07:00
Roland Shoemaker 28db5aab45 Merge master 2015-06-06 02:47:55 +01:00
Roland Shoemaker 23b0cfa29f Extend email parsing 2015-06-06 02:46:51 +01:00
Roland Shoemaker 4ecd6d58b6 Merge master 2015-06-06 02:11:46 +01:00
Roland Shoemaker bb5c042cef Fix tests and various other cleanup 2015-06-06 02:06:35 +01:00
Roland Shoemaker 0bfc50b7e5 Add check for max key size 2015-06-05 19:02:10 +01:00
Roland Shoemaker 84f187da96 Check MX records exist for provided emails 2015-06-05 15:27:07 +01:00
Roland Shoemaker 573e35ed56 Disallow multiple registrations with same key (and fix all related tests) 2015-06-04 20:21:59 +01:00
James 'J.C.' Jones 6a4aa8de3c Merge pull request #304 from letsencrypt/296-ca_tx_move
Issue #296: Fix erroneous transaction handling in CA
2015-06-03 22:10:43 -07:00
J.C. Jones abdc174be8 Issue #296: Fix erroneous transaction handling in CA
- Moved the transaction handling up to the `certificate-authority.go` file
- Simplified `certificate-authority-data.go`
- Created a mocks file in `test/` and reworked RA and CA to use it
- More audit logging to CA
2015-06-03 19:23:24 -07:00
Roland Shoemaker 78e621c95f further review fixes 2015-06-03 00:27:08 +01:00
Roland Shoemaker 51890a9626 Move cert-csr check to boulder/core and review fixes 2015-06-02 17:56:28 +01:00
Roland Shoemaker 6114189865 Add CommonName (if present) to DNSNames 2015-06-01 17:02:37 +01:00
Roland Shoemaker 33df806d25 wfe test fixes + DNSNames and CommonName cleanup 2015-06-01 15:01:24 +01:00
Roland Shoemaker e5bf16711c Add generated cert checks 2015-06-01 14:00:49 +01:00
Richard Barnes 28e737bee0 Fixing build error induced in rebase 2015-06-01 02:17:55 -04:00
Richard Barnes 0d932c0a2d Merge branch 'rlb-review' of https://github.com/letsencrypt/boulder into rlb-review 2015-06-01 02:13:25 -04:00
Richard Barnes bfd9e4ac20 Fixing JCJ nits 2015-06-01 02:11:10 -04:00