Commit Graph

111 Commits

Author SHA1 Message Date
Roland Bracewell Shoemaker 5fabc90a16 Add IDN support (#2215)
Add feature flagged support for issuing for IDNs, fixes #597.

This patch expects that clients have performed valid IDN2008 encoding on any label that includes unicode characters. Invalid encodings (including non-compatible IDN2003 encoding) will be rejected. No script-mixing or script exclusion checks are performed as we assume that if a name is resolvable that it conforms to the registrar's policies on these matters and if it uses non-standard scripts in sub-domains etc that browsers should be the ones choosing how to display those names.

Required a full update of the golang.org/x/net tree to pull in golang.org/x/net/idna, all test suites pass.
2016-10-06 13:05:37 -04:00
Simone Carletti 7172e49650 Replace x/net/publicsuffix with weppos/publicsuffix-go (#1969)
This PR replaces the `x/net/publicsuffix` package with `weppos/publicsuffix-go`.

The conversations that leaded to this decision are #1479 and #1374. To summarize the discussion, the main issue with `x/net/publicsuffix` is that the package compiles the list into the Go source code and doesn't provide a way to easily pull updates (e.g. by re-parsing the original PSL) unless the entire package is recompiled.

The PSL update frequency is almost daily, which makes very hard to recompile the official Golang package to stay up-to-date with all the changes. Moreover, Golang maintainers expressed some concerns about rebuilding and committing changes with a frequency that would keep the package in sync with the original PSL. See https://github.com/letsencrypt/boulder/issues/1374#issuecomment-182429297

`weppos/publicsuffix-go` contains a compiled version of the list that is updated weekly (or more frequently). Moreover, the package can read and parse a PSL from a String or a File which will effectively decouple the Boulder source code with the list itself. The main benefit is that it will be possible to update the definition by simply downloading the latest list and restarting the application (assuming the list is persisted in memory).
2016-06-30 15:03:14 -07:00
Maxime Boisvert 821d572366 Adds RejectedIdentifierError on Blacklisted error. (#1944)
Boulder uses MalformedRequestError as a universal error. This pull request adds the RejectedIdentifierError and use it on a blacklist error.

For a client implementation, it is easier and cleaner to use an exception than parse the error message.

1336c42813/policy/pa.go (L131)

Fixes #1938

PR in acme : ietf-wg-acme/acme#142
2016-06-29 13:53:38 -07: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 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
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
Kane York f0cc131c44 Exact blacklist (#1816)
* policy: Implement exact blacklist matching
* fix?
* add test
* don't use real properties in tests

https://github.com/letsencrypt/boulder/pull/1816
2016-05-13 20:26:15 +02:00
Jacob Hoffman-Andrews e5e4fb744a * Delete Policy DB.This is no longer needed now that we have a JSON policy file.* Fix tests.* Revert Dockerfile.* Fix create_db* Simplify user addition.* Fix tests.* Fix tests* Review fixes.https://github.com/letsencrypt/boulder/pull/1773
* Delete Policy DB.

This is no longer needed now that we have a JSON policy file.

* Fix tests.
* Revert Dockerfile.
* Fix create_db
* Simplify user addition.
* Fix tests.
* Fix tests
* Review fixes.

https://github.com/letsencrypt/boulder/pull/1773
2016-04-29 12:12:24 -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
Kane York 2cd6b6b9c5 reloader: Split data/error callbacks (#1704)
The reloader package currently discriminates between file reading errors (in the reloader package) and data parsing errors (in the client code). Because of this, errors in a hot-replaced policy file may go unnoticed.

The former design, a (data, error) callback is replaced with a data callback and an error callback. This allows for uniform reporting of errors sourced from the library and errors sourced from the user-provided parser.

https://github.com/letsencrypt/boulder/pull/1704
2016-04-07 14:04:03 -07:00
Igor Bukanov 7b14242079 always use boulder-mysql, not localhost, for mysql
This followup for #1639 to always use the boulder-mysql, not localhost, when connecting to mysql database when testing.
2016-04-07 10:19:24 +02:00
Roland Shoemaker 00b617b59a Switch to upstream square/go-jose + pull latest 2016-03-15 13:54:22 -07:00
Jacob Hoffman-Andrews 9b9b09d35d Fix issues from review feedback. 2016-03-14 16:15:54 -07:00
Jacob Hoffman-Andrews cf95b6d412 Return early on error from reloader. 2016-03-14 12:57:39 -07:00
Jacob Hoffman-Andrews bc28bfe906 Implement reloadable JSON blacklist.
This eliminates the need the a database to store the hostname policy,
simplifying deployment. We keep the database for now, as part of our
deployability guidelines: we'll deploy, then switch config to the new style.

This also disables the obsolete whitelist checking code, but doesn't yet change
the function signature for policy.New(), to avoid bloating the pull request.
I'll fully remove the whitelist checking code in a future change when I also
remove the policy database code.
2016-03-13 20:00:51 -07:00
Jacob Hoffman-Andrews 8f0f261048 When multiple names are forbidden, list all.
Also, change "name is blacklisted" in PA to "Policy forbids issuance," to match
CA.
2016-03-05 14:29:05 -08:00
Jacob Hoffman-Andrews 66ab7f5fae Update DNS length comment.
Followup from https://github.com/letsencrypt/boulder/pull/1532/files#r54189791
2016-02-25 17:02:59 -08:00
Jacob Hoffman-Andrews efdbd75eda Use the maxDNSIdentifierLength constant
Instead of hardcoding.
2016-02-23 14:47:07 -08:00
Jessica Frazelle 7955e268c7
go lint fixes
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-02-17 11:36:06 -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
Jacob Hoffman-Andrews 02c4a47a4e Update comment. 2016-02-16 10:56:52 -08:00
Jacob Hoffman-Andrews 20d6281e98 Return error from PA when DB is down.
Previously, we'd return "Name is blacklisted" in the case of a DB failure. After
this change, we correctly return an internal server error.
2016-02-15 20:33:49 -08:00
Damian Poddebniak 01cee65079 Changed return type for "ChallengesFor". 2016-02-13 23:01:28 +01:00
Jacob Hoffman-Andrews cecb4d08e9 Reject final "-" in DNS label. 2016-01-28 11:08:10 -08:00
Jeff Hodges c9010744b4 delete old challenge code
Specifically, delete the simpleHttp and dvsni.

Hooray!

Fixes #894
2015-12-10 15:41:40 -08:00
Jacob Hoffman-Andrews ea95bcf78c Fix test. 2015-11-20 17:02:39 -08:00
Jacob Hoffman-Andrews aedc674d97 Restore bytewise DNS check. 2015-11-20 15:55:52 -08:00
Jacob Hoffman-Andrews d22457cdc1 Add test for core.MalformedRequestError in NewAuth
Also wrap policy errors in a var ( ) and delete old ones.
2015-11-19 16:14:54 -08:00
Jacob Hoffman-Andrews 662ed0730f Fix return types of errors. 2015-11-19 15:43:39 -08:00
Jacob Hoffman-Andrews eb8134f0cc Return more specific errors from WillingToIssue.
Fixes #1066
2015-11-19 12:00:49 -08:00
Jeff Hodges d2b6cc0e98 randomize output of PolicyAuthority.ChallengesFor
This shuffles both the challenges and the combinations returned while
keeping them in sync.

Fixes #1069.
2015-11-18 11:14:11 -08:00
Richard Barnes f61183e144 Use a map and set defaults 2015-11-07 12:39:57 -05:00
Richard Barnes fe047a1da8 Change config to flags from strings 2015-11-03 23:17:26 +09:00
Richard Barnes a16e98a4a4 Further copy/paste errors 2015-11-01 23:20:28 +09:00
Richard Barnes 36225bdf4f Fix go fmt errors 2015-11-01 22:35:29 +09:00
Richard Barnes f67405bfbc Fix unit test failures and a copy/paste error 2015-11-01 08:28:15 -05:00
Richard Barnes 39dcb9f285 Further unit test fixes 2015-10-31 18:11:08 +09:00
Richard Barnes 587bd8c89a Initialize the challenge type map before using it 2015-10-31 17:08:25 +09:00
Richard Barnes d8c67285cf Enable configuration of supported challenges 2015-10-31 16:55:59 +09:00
Jessica Frazelle 3ce50c106b
Add test/vars package
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-20 22:29:34 -07:00
Roland Shoemaker 6171420108 Golint fixes to builds work 2015-10-18 18:59:05 -07:00
Jacob Hoffman-Andrews dd05ace030 Set up databases with restrictive user permissions.
Fixes https://github.com/letsencrypt/boulder/issues/898

Also removes currently-unused 'development' DB, and do initial migrations in
parallel, which shortens create_db.sh from 20 seconds to 10 seconds.

Changes ResetTestDatabase into two functions, one each for SA and Policy DBs,
which take care of setting up the DB connection using a special higher-privileged
user called test_setup.
2015-10-16 15:50:57 -07:00
Jacob Hoffman-Andrews 3ab31960d3 Whitelist partner registration id. 2015-10-15 09:15:45 -07:00
Jacob Hoffman-Andrews 310343a061 Fix error name and tests. 2015-10-12 17:45:47 -07:00
Jacob Hoffman-Andrews a95c300d8b Switch to using publicsuffix package.
This has two advantages:
- Fixes #901
- Reduces number of allocations and copies for methods that used the previous
  public suffix code.
2015-10-12 16:32:35 -07:00