summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2017-08-08prop224: API for the creation of blinded keysDavid Goulet
Add a function for both the client and service side that is building a blinded key from a keypair (service) and from a public key (client). Those two functions uses the current time period information to build the key. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08hs: Implement constructor for hs_desc_intro_point_tDavid Goulet
Add a new and free function for hs_desc_intro_point_t so the service can use them to setup those objects properly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-25prop224: Add onion key to service descriptor intro pointDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-25prop224: Add the introduction point onion key to descriptorDavid Goulet
A prop224 descriptor was missing the onion key for an introduction point which is needed to extend to it by the client. Closes #22979 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-25prop224: Helper to dup a link_specifier_t objectDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-25prop224: Update hs identifier circuitDavid Goulet
Remove the legacy intro point key because both service and client only uses the ed25519 key even though the intro point chosen is a legacy one. This also adds the CLIENT_PK key that is needed for the ntor handshake. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-25fix wordo in commentRoger Dingledine
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
We need to keep these around for TAP and old-style hidden services, but they're obsolete, and we shouldn't encourage anyone to use them. So I've added "obsolete" to their names, and a comment explaining what the problem is. Closes ticket 23026.
2017-07-14Fix 32-bit warnings in hs_common.cNick Mathewson
2017-07-13Merge remote-tracking branch 'dgoulet/ticket21979_032_04'Nick Mathewson
2017-07-13prop224: Fix clang warningsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13Merge remote-tracking branch 'isis/bug19476'Nick Mathewson
2017-07-13Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-13prop224: Move service version into config objectDavid Goulet
It makes more sense to have the version in the configuration object of the service because it is afterall a torrc option (HiddenServiceVersion). Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Use the service config object when configuringDavid Goulet
Both configuration function now takes the service config object instead of the service itself. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Don't use char * for binary dataDavid Goulet
It turns out that some char * sneaked in our hs_common.c code. Replace those by uint8_t *. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Add a clear configuration functionDavid Goulet
The added function frees any allocated pointers in a service configuration object and reset all values to 0. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Don't use an array of config handlersDavid Goulet
As per nickm suggestion, an array of config handlers will not play well with our callgraph tool. Instead, we'll go with a switch case on the version which has a good side effect of allowing us to control what we pass to the function intead of a fix set of parameters. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Detect duplicate configuration optionsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Use a common function to parse uint64_tDavid Goulet
Add a helper function to parse uint64_t and also does logging so we can reduce the amount of duplicate code. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13Revert "fixup! prop224: Add hs_config.{c|h} with a refactoring"David Goulet
This reverts commit e2497e2ba038133026a475f0f93c9054187b2a1d.
2017-07-13test: Add v3 service load keys and accessorsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13test: Add v3 service config and registration testDavid Goulet
This tests our hs_config.c API to properly load v3 services and register them to the global map. It does NOT test the service object validity, that will be the hs service unit test later on. At this commit, we have 100% code coverage of hs_config.c. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13hs: Add rend_service_init()David Goulet
Initialize both the global and staging service lists. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Add a function to check for invalid optsDavid Goulet
Every hidden service option don't apply to every version so this new function makes sure we don't have for instance an option that is only for v2 in a v3 configured service. This works using an exclude lists for a specific version. Right now, there is only one option that is not allowed in v3. The rest is common. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Load and/or generate v3 service keysDavid Goulet
Try to load or/and generate service keys for v3. This write both the public and private key file to disk along with the hostname file containing the onion address. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Service address creation/validationDavid Goulet
This also adds unit test and a small python script generating a deterministic test vector that a unit test tries to match. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Configure v3 service from optionsDavid Goulet
This commit adds the support in the HS subsystem for loading a service from a set of or_options_t and put them in a staging list. To achieve this, service accessors have been created and a global hash map containing service object indexed by master public key. However, this is not used for now. It's ground work for registration process. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13hs: Use v3 maximum intro points value when decoding v3David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Add a init/free_all function for the whole subsystemDavid Goulet
Introduces hs_init() located in hs_common.c which initialize the entire HS v3 subsystem. This is done _prior_ to the options being loaded because we need to allocate global data structure before we load the configuration. The hs_free_all() is added to release everything from tor_free_all(). Note that both functions do NOT handle v2 service subsystem but does handle the common interface that both v2 and v3 needs such as the cache and circuitmap. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Add hs_config.{c|h} with a refactoringDavid Goulet
Add the hs_config.{c|h} files contains everything that the HS subsystem needs to load and configure services. Ultimately, it should also contain client functions such as client authorization. This comes with a big refactoring of rend_config_services() which has now changed to only configure a single service and it is stripped down of the common directives which are now part of the generic handler. This is ground work for prop224 of course but only touches version 2 services and add XXX note for version 3. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Initial import of hs_service_tDavid Goulet
This object is the foundation of proposal 224 service work. It will change and be adapted as it's being used more and more in the codebase. So, this version is just a basic skeleton one that *will* change. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13rephist: Remove unused crypto_pk statistics.Isis Lovecruft
These statistics were largely ununsed, and kept track of statistical information on things like how many time we had done TLS or how many signatures we had verified. This information is largely not useful, and would only be logged after receiving a SIGUSR1 signal (but only if the logging severity level was less than LOG_INFO). * FIXES #19871. * REMOVES note_crypto_pk_op(), dump_pk_op(), and pk_op_counts from src/or/rephist.c. * REMOVES every external call to these functions.
2017-07-12New configuration option MaxConsensusAgeForDiffsNick Mathewson
Relay operators (especially bridge operators) can use this to lower or raise the number of consensuses that they're willing to hold for diff generation purposes. This enables a workaround for bug 22883.
2017-07-12Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-12Merge branch 'bug22349_029' into maint-0.3.1Nick Mathewson
2017-07-12If writing a heartbeat message fails, retry after MIN_HEARTBEAT_PERIOD.Isis Lovecruft
* FIXES #19476.
2017-07-12Use the return value for choosing intervalscypherpunks
2017-07-10Avoid double-typedef errors on freebsd.Nick Mathewson
2017-07-07prop224: Add common intropoint objectDavid Goulet
Groundwork for more prop224 service and client code. This object contains common data that both client and service uses. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-07Merge branch 'bug17750_029_squashed'Nick Mathewson
2017-07-07Comment that failure schedules always use exponential backoffteor
2017-07-07Refactor exponential backoff multipliers into macrosteor
There are only so many times you can type "4".
2017-07-07Use download_status_get_next_attempt_at() more oftenteor
This guards against future occurrences of 17750.
2017-07-07Give correct bounds in next_random_exponential_delay() commentteor
2017-07-07Make clients try fallbacks before authoritiesteor
Make clients wait for 6 seconds before trying to download their consensus from an authority. Fixes bug 17750, bugfix on 0.2.8.1-alpha.
2017-07-07Merge branch 'bug21495'Nick Mathewson
2017-07-07Fix a couple of clang warningsNick Mathewson
2017-07-07Merge branch 'ticket21859_032_01_squashed'Nick Mathewson
2017-07-07Fix wide linesNick Mathewson