Ticket #23650: 0001-Fix-spelling-mistakes-corresponding-to-ticket-23650.patch

File 0001-Fix-spelling-mistakes-corresponding-to-ticket-23650.patch, 84.4 KB (added by fristonio, 9 months ago)

Fix typos in tor source code.

  • .gitlab-ci.yml

    From eb52b029d645889cd150be37a131101aefce8fd1 Mon Sep 17 00:00:00 2001
    From: Deepesh Pathak <deepshpathak@gmail.com>
    Date: Wed, 24 Jan 2018 14:25:15 +0530
    Subject: [PATCH] Fix spelling mistakes corresponding to ticket #23650
    
    ---
     .gitlab-ci.yml                           |  2 +-
     ChangeLog                                | 24 ++++++++++++------------
     ReleaseNotes                             | 16 ++++++++--------
     configure.ac                             |  2 +-
     contrib/operator-tools/linux-tor-prio.sh |  2 +-
     doc/HACKING/GettingStartedRust.md        |  2 +-
     doc/HACKING/Tracing.md                   |  2 +-
     doc/HACKING/android/Simpleperf.md        |  2 +-
     doc/tor.1.txt                            |  4 ++--
     m4/pkg.m4                                |  2 +-
     scripts/maint/redox.py                   |  2 +-
     scripts/maint/updateFallbackDirs.py      |  6 +++---
     src/common/address.c                     |  2 +-
     src/common/compat.c                      |  2 +-
     src/common/compat_openssl.h              |  2 +-
     src/common/compat_time.c                 |  2 +-
     src/common/crypto.c                      |  6 +++---
     src/common/crypto_ed25519.c              | 10 +++++-----
     src/common/timers.c                      |  2 +-
     src/common/tortls.c                      |  2 +-
     src/common/util.c                        |  6 +++---
     src/ext/curve25519_donna/README          |  2 +-
     src/ext/ed25519/donna/README.md          |  4 ++--
     src/ext/ed25519/donna/ed25519_tor.c      |  2 +-
     src/or/bridges.c                         |  2 +-
     src/or/channel.c                         |  8 ++++----
     src/or/circpathbias.c                    |  4 ++--
     src/or/circuitbuild.c                    |  2 +-
     src/or/circuitlist.c                     |  4 ++--
     src/or/circuitstats.c                    | 16 ++++++++--------
     src/or/circuituse.c                      |  2 +-
     src/or/config.c                          |  2 +-
     src/or/connection.c                      |  4 ++--
     src/or/control.c                         |  6 +++---
     src/or/directory.c                       | 10 +++++-----
     src/or/dirserv.c                         |  4 ++--
     src/or/dirserv.h                         |  2 +-
     src/or/dirvote.c                         |  2 +-
     src/or/dns.c                             |  2 +-
     src/or/hs_cache.c                        |  4 ++--
     src/or/hs_client.c                       |  2 +-
     src/or/hs_config.c                       |  2 +-
     src/or/hs_descriptor.c                   |  6 +++---
     src/or/hs_intropoint.c                   |  2 +-
     src/or/hs_service.c                      | 20 ++++++++++----------
     src/or/main.c                            |  2 +-
     src/or/onion_fast.c                      |  2 +-
     src/or/or.h                              |  6 +++---
     src/or/policies.c                        |  2 +-
     src/or/reasons.c                         |  2 +-
     src/or/rendcache.c                       |  4 ++--
     src/or/rendcache.h                       |  2 +-
     src/or/rendclient.c                      |  2 +-
     src/or/rendservice.c                     |  6 +++---
     src/or/rendservice.h                     |  2 +-
     src/or/rephist.c                         |  2 +-
     src/or/routerlist.c                      |  4 ++--
     src/or/shared_random.c                   |  2 +-
     src/or/shared_random_state.c             |  6 +++---
     src/or/status.c                          |  2 +-
     src/or/transports.c                      |  2 +-
     src/test/test.c                          |  2 +-
     src/test/test_cell_formats.c             |  2 +-
     src/test/test_channelpadding.c           |  8 ++++----
     src/test/test_config.c                   |  4 ++--
     src/test/test_connection.c               |  2 +-
     src/test/test_conscache.c                |  2 +-
     src/test/test_dir.c                      |  2 +-
     src/test/test_entrynodes.c               |  2 +-
     src/test/test_hs.c                       |  2 +-
     src/test/test_hs_descriptor.c            |  2 +-
     src/test/test_hs_intropoint.c            |  4 ++--
     src/test/test_hs_service.c               |  2 +-
     src/test/test_options.c                  | 10 +++++-----
     src/test/test_shared_random.c            |  4 ++--
     src/test/test_util.c                     | 10 +++++-----
     src/trunnel/hs/cell_introduce1.trunnel   |  2 +-
     77 files changed, 161 insertions(+), 161 deletions(-)
    
    diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
    index ba981d5..d2d0d55 100644
    a b update: 
    2626    - ssh-add <(echo "$DEPLOY_KEY")
    2727
    2828    # For Docker builds disable host key checking. Be aware that by adding that
    29     # you are suspectible to man-in-the-middle attacks.
     29    # you are susceptible to man-in-the-middle attacks.
    3030    # WARNING: Use this only with the Docker executor, if you use it with shell
    3131    # you will overwrite your user's SSH config.
    3232    - mkdir -p ~/.ssh
  • ChangeLog

    diff --git a/ChangeLog b/ChangeLog
    index fbeb7ce..dd87d93 100644
    a b Changes in version 0.2.6.5-rc - 2015-03-18 
    78687868  o Major bugfixes (pluggable transports):
    78697869    - Initialize the extended OR Port authentication cookie before
    78707870      launching pluggable transports. This prevents a race condition
    7871       that occured when server-side pluggable transports would cache the
     7871      that occurred when server-side pluggable transports would cache the
    78727872      authentication cookie before it has been (re)generated. Fixes bug
    78737873      15240; bugfix on 0.2.5.1-alpha.
    78747874
    Changes in version 0.2.6.2-alpha - 2014-12-31 
    86118611      some bugs where we would look at (but fortunately, not reveal)
    86128612      uninitialized memory on the stack. Fixes bug 14013; bugfix on all
    86138613      versions of Tor.
    8614     - Clear all memory targetted by tor_addr_{to,from}_sockaddr(), not
     8614    - Clear all memory targeted by tor_addr_{to,from}_sockaddr(), not
    86158615      just the part that's used. This makes it harder for data leak bugs
    86168616      to occur in the event of other programming failures. Resolves
    86178617      ticket 14041.
    Changes in version 0.2.5.5-alpha - 2014-06-18 
    97549754      directory authority options, remove the documentation for a
    97559755      V2-directory fetching option that no longer exists. Resolves
    97569756      ticket 11634.
    9757     - Correct the documenation so that it lists the correct directory
     9757    - Correct the documentation so that it lists the correct directory
    97589758      for the stats files. (They are in a subdirectory called "stats",
    97599759      not "status".)
    97609760    - In the manpage, move more authority-only options into the
    Changes in version 0.2.5.1-alpha - 2013-10-02 
    1103911039      from Arlo Breault.
    1104011040    - Remove instances of strcpy() from the unit tests. They weren't
    1104111041      hurting anything, since they were only in the unit tests, but it's
    11042       embarassing to have strcpy() in the code at all, and some analysis
     11042      embarrassing to have strcpy() in the code at all, and some analysis
    1104311043      tools don't like it. Fixes bug 8790; bugfix on 0.2.3.6-alpha and
    1104411044      0.2.3.8-alpha. Patch from Arlo Breault.
    1104511045
    Changes in version 0.2.4.16-rc - 2013-08-10 
    1114011140      0.2.4.15-rc. Found by stem integration tests.
    1114111141
    1114211142  o Minor bugfixes:
    11143     - Fix an invalid memory read that occured when a pluggable
     11143    - Fix an invalid memory read that occurred when a pluggable
    1114411144      transport proxy failed its configuration protocol.
    1114511145      Fixes bug 9288; bugfix on 0.2.4.1-alpha.
    1114611146    - When evaluating whether to use a connection that we haven't
    Changes in version 0.2.3.11-alpha - 2012-01-22 
    1393113931      CloseHSServiceRendCircuitsImmediatelyOnTimeout option. Fixes the
    1393213932      remaining part of bug 1297; bugfix on 0.2.2.2-alpha.
    1393313933    - Make sure we never mark the wrong rendezvous circuit as having
    13934       had its introduction cell acknowleged by the introduction-point
     13934      had its introduction cell acknowledged by the introduction-point
    1393513935      relay. Previously, when we received an INTRODUCE_ACK cell on a
    1393613936      client-side hidden-service introduction circuit, we might have
    1393713937      marked a rendezvous circuit other than the one we specified in
    Changes in version 0.2.3.3-alpha - 2011-09-01 
    1523815238      raised by bug 3898.
    1523915239    - The "--quiet" and "--hush" options now apply not only to Tor's
    1524015240      behavior before logs are configured, but also to Tor's behavior in
    15241       the absense of configured logs. Fixes bug 3550; bugfix on
     15241      the absence of configured logs. Fixes bug 3550; bugfix on
    1524215242      0.2.0.10-alpha.
    1524315243
    1524415244  o Minor bugfixes (also part of 0.2.2.31-rc):
    Changes in version 0.2.2.8-alpha - 2010-01-26 
    1773917739  please upgrade.
    1774017740
    1774117741  o Major bugfixes:
    17742     - Fix a memory corruption bug on bridges that occured during the
     17742    - Fix a memory corruption bug on bridges that occurred during the
    1774317743      inclusion of stats data in extra-info descriptors. Also fix the
    1774417744      interface for geoip_get_bridge_stats* to prevent similar bugs in
    1774517745      the future. Diagnosis by Tas, patch by Karsten and Sebastian.
    Changes in version 0.2.2.2-alpha - 2009-09-21 
    1815318153      to EDGE and find out if the build-time data in the .tor/state gets
    1815418154      reset without loss of Tor usability. You should also see a notice
    1815518155      log message telling you that Tor has reset its timeout.
    18156     - Directory authorities can now vote on arbitary integer values as
     18156    - Directory authorities can now vote on arbitrary integer values as
    1815718157      part of the consensus process. This is designed to help set
    1815818158      network-wide parameters. Implements proposal 167.
    1815918159    - Tor now reads the "circwindow" parameter out of the consensus,
    Changes in version 0.2.0.9-alpha - 2007-10-24 
    2118121181    - Distinguish between detached signatures for the wrong period, and
    2118221182      detached signatures for a divergent vote.
    2118321183    - Fix a small memory leak when computing a consensus.
    21184     - When there's no concensus, we were forming a vote every 30
     21184    - When there's no consensus, we were forming a vote every 30
    2118521185      minutes, but writing the "valid-after" line in our vote based
    2118621186      on our configured V3AuthVotingInterval: so unless the intervals
    2118721187      matched up, we immediately rejected our own vote because it didn't
    Changes in version 0.1.0.9-rc - 2005-06-09 
    2456824568      KeepalivePeriod, ClientOnly, NoPublish, HttpProxy, HttpsProxy,
    2456924569      HttpProxyAuthenticator
    2457024570    - Stop warning about sigpipes in the logs. We're going to
    24571       pretend that getting these occassionally is normal and fine.
     24571      pretend that getting these occasionally is normal and fine.
    2457224572    - Resolve OS X installer bugs: stop claiming to be 0.0.9.2 in
    2457324573      certain
    2457424574      installer screens; and don't put stuff into StartupItems unless
    Changes in version 0.1.0.1-rc - 2005-03-28 
    2503325033
    2503425034Changes in version 0.0.9.6 - 2005-03-24
    2503525035  o Bugfixes on 0.0.9.x (crashes and asserts):
    25036     - Add new end stream reasons to maintainance branch. Fix bug where
     25036    - Add new end stream reasons to maintenance branch. Fix bug where
    2503725037      reason (8) could trigger an assert. Prevent bug from recurring.
    2503825038    - Apparently win32 stat wants paths to not end with a slash.
    2503925039    - Fix assert triggers in assert_cpath_layer_ok(), where we were
  • ReleaseNotes

    diff --git a/ReleaseNotes b/ReleaseNotes
    index 65b7c60..4adba49 100644
    a b Changes in version 0.2.6.6 - 2015-03-24 
    64766476  o Major bugfixes (pluggable transports):
    64776477    - Initialize the extended OR Port authentication cookie before
    64786478      launching pluggable transports. This prevents a race condition
    6479       that occured when server-side pluggable transports would cache the
     6479      that occurred when server-side pluggable transports would cache the
    64806480      authentication cookie before it has been (re)generated. Fixes bug
    64816481      15240; bugfix on 0.2.5.1-alpha.
    64826482
    Changes in version 0.2.6.6 - 2015-03-24 
    69496949      some bugs where we would look at (but fortunately, not reveal)
    69506950      uninitialized memory on the stack. Fixes bug 14013; bugfix on all
    69516951      versions of Tor.
    6952     - Clear all memory targetted by tor_addr_{to,from}_sockaddr(), not
     6952    - Clear all memory targeted by tor_addr_{to,from}_sockaddr(), not
    69536953      just the part that's used. This makes it harder for data leak bugs
    69546954      to occur in the event of other programming failures. Resolves
    69556955      ticket 14041.
    Changes in version 0.2.5.10 - 2014-10-24 
    81268126      from Arlo Breault.
    81278127    - Remove instances of strcpy() from the unit tests. They weren't
    81288128      hurting anything, since they were only in the unit tests, but it's
    8129       embarassing to have strcpy() in the code at all, and some analysis
     8129      embarrassing to have strcpy() in the code at all, and some analysis
    81308130      tools don't like it. Fixes bug 8790; bugfix on 0.2.3.6-alpha and
    81318131      0.2.3.8-alpha. Patch from Arlo Breault.
    81328132    - Remove is_internal_IP() function. Resolves ticket 4645.
    Changes in version 0.2.5.10 - 2014-10-24 
    81508150      directory authority options, remove the documentation for a
    81518151      V2-directory fetching option that no longer exists. Resolves
    81528152      ticket 11634.
    8153     - Correct the documenation so that it lists the correct directory
     8153    - Correct the documentation so that it lists the correct directory
    81548154      for the stats files. (They are in a subdirectory called "stats",
    81558155      not "status".)
    81568156    - In the manpage, move more authority-only options into the
    Changes in version 0.2.3.25 - 2012-11-19 
    1029310293      bugfix on 0.2.0.3-alpha.
    1029410294    - The "--quiet" and "--hush" options now apply not only to Tor's
    1029510295      behavior before logs are configured, but also to Tor's behavior in
    10296       the absense of configured logs. Fixes bug 3550; bugfix on
     10296      the absence of configured logs. Fixes bug 3550; bugfix on
    1029710297      0.2.0.10-alpha.
    1029810298    - Change the AllowDotExit rules so they should actually work.
    1029910299      We now enforce AllowDotExit only immediately after receiving an
    Changes in version 0.2.2.32 - 2011-08-27 
    1140611406      algorithms for signatures and resource selection. Newer formats
    1140711407      are signed with SHA256, with a possibility for moving to a better
    1140811408      hash algorithm in the future.
    11409     - Directory authorities can now vote on arbitary integer values as
     11409    - Directory authorities can now vote on arbitrary integer values as
    1141011410      part of the consensus process. This is designed to help set
    1141111411      network-wide parameters. Implements proposal 167.
    1141211412
    Changes in version 0.1.0.10 - 2005-06-14 
    1659516595    - Use correct errno on win32 if libevent fails.
    1659616596    - Check and warn about known-bad/slow libevent versions.
    1659716597    - Stop warning about sigpipes in the logs. We're going to
    16598       pretend that getting these occassionally is normal and fine.
     16598      pretend that getting these occasionally is normal and fine.
    1659916599
    1660016600  o New contrib scripts:
    1660116601    - New experimental script tor/contrib/exitlist: a simple python
    Changes in version 0.0.9.7 - 2005-04-01 
    1671416714
    1671516715Changes in version 0.0.9.6 - 2005-03-24
    1671616716  o Bugfixes on 0.0.9.x (crashes and asserts):
    16717     - Add new end stream reasons to maintainance branch. Fix bug where
     16717    - Add new end stream reasons to maintenance branch. Fix bug where
    1671816718      reason (8) could trigger an assert.  Prevent bug from recurring.
    1671916719    - Apparently win32 stat wants paths to not end with a slash.
    1672016720    - Fix assert triggers in assert_cpath_layer_ok(), where we were
  • configure.ac

    diff --git a/configure.ac b/configure.ac
    index 569cfcd..04b6832 100644
    a b AC_CHECK_FUNCS( 
    573573# Apple messed up when they added two functions functions in Sierra: they
    574574# forgot to decorate them with appropriate AVAILABLE_MAC_OS_VERSION
    575575# checks. So we should only probe for those functions if we are sure that we
    576 # are not targetting OSX 10.11 or earlier.
     576# are not targeting OSX 10.11 or earlier.
    577577AC_MSG_CHECKING([for a pre-Sierra OSX build target])
    578578AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    579579#ifdef __APPLE__
  • contrib/operator-tools/linux-tor-prio.sh

    diff --git a/contrib/operator-tools/linux-tor-prio.sh b/contrib/operator-tools/linux-tor-prio.sh
    index ea9e0dd..30ea5fc 100644
    a b RATE_UP=5000 
    8787# machine does any other network activity. That is not very fun.
    8888RATE_UP_TOR=1500
    8989
    90 # RATE_UP_TOR_CEIL is the maximum rate allowed for all Tor trafic in
     90# RATE_UP_TOR_CEIL is the maximum rate allowed for all Tor traffic in
    9191# kbits/sec.
    9292RATE_UP_TOR_CEIL=5000
    9393
  • doc/HACKING/GettingStartedRust.md

    diff --git a/doc/HACKING/GettingStartedRust.md b/doc/HACKING/GettingStartedRust.md
    index 3d00388..3f9cf82 100644
    a b the module calls. Modules which call fewer other modules are better targets. 
    117117
    118118Strive to change the C API as little as possible.
    119119
    120 We are currently targetting Rust nightly, *for now*. We expect this to change
     120We are currently targeting Rust nightly, *for now*. We expect this to change
    121121moving forward, as we understand more about which nightly features we need. It
    122122is on our TODO list to try to cultivate good standing with various distro
    123123maintainers of `rustc` and `cargo`, in order to ensure that whatever version we
  • doc/HACKING/Tracing.md

    diff --git a/doc/HACKING/Tracing.md b/doc/HACKING/Tracing.md
    index a5fb516..349aade 100644
    a b tracing framework. 
    66
    77## Basics ###
    88
    9 Event tracing is seperated in two concepts, trace events and a tracer. The
     9Event tracing is separated in two concepts, trace events and a tracer. The
    1010tracing subsystem can be found in `src/trace`. The `events.h` header file is
    1111the main file that maps the different tracers to trace events.
    1212
  • doc/HACKING/android/Simpleperf.md

    diff --git a/doc/HACKING/android/Simpleperf.md b/doc/HACKING/android/Simpleperf.md
    index c12558a..25f39a3 100644
    a b the Android Software Development Kit (SDK) and Native Development Kit 
    1818   repository and build an Orbot APK (Android Package) file with
    1919   debugging enabled. Make sure that when you build the native content of
    2020   the Orbot application that you run the `make -C external` command with
    21    an additional `DEBUG=1` as paramter to ensure that the Orbot build
     21   an additional `DEBUG=1` as parameter to ensure that the Orbot build
    2222   process does not strip the debug symbols from the Tor binary.
    2323
    24242. (Optional) Uninstall and clean-up your old Orbot installation that
  • doc/tor.1.txt

    diff --git a/doc/tor.1.txt b/doc/tor.1.txt
    index 8e27a25..e83bafc 100644
    a b The following options are used to configure a hidden service. 
    26952695[[HiddenServiceMaxStreams]] **HiddenServiceMaxStreams** __N__::
    26962696   The maximum number of simultaneous streams (connections) per rendezvous
    26972697   circuit. The maximum value allowed is 65535. (Setting this to 0 will allow
    2698    an unlimited number of simultanous streams.) (Default: 0)
     2698   an unlimited number of simultaneous streams.) (Default: 0)
    26992699
    27002700[[HiddenServiceMaxStreamsCloseCircuit]] **HiddenServiceMaxStreamsCloseCircuit** **0**|**1**::
    27012701   If set to 1, then exceeding **HiddenServiceMaxStreams** will cause the
    __CacheDirectory__**/diff-cache**:: 
    30983098    Directory cache only. Holds older consensuses, and diffs from older
    30993099    consensuses to the most recent consensus of each type, compressed
    31003100    in various ways. Each file contains a set of key-value arguments
    3101     decribing its contents, followed by a single NUL byte, followed by the
     3101    describing its contents, followed by a single NUL byte, followed by the
    31023102    main file contents.
    31033103
    31043104__DataDirectory__**/bw_accounting**::
  • m4/pkg.m4

    diff --git a/m4/pkg.m4 b/m4/pkg.m4
    index c5b26b5..c0a8d3d 100644
    a b fi[]dnl 
    5353# to PKG_CHECK_MODULES(), but does not set variables or print errors.
    5454#
    5555# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
    56 # only at the first occurence in configure.ac, so if the first place
     56# only at the first occurrence in configure.ac, so if the first place
    5757# it's called might be skipped (such as if it is within an "if", you
    5858# have to call PKG_CHECK_EXISTS manually
    5959# --------------------------------------------------------------
  • scripts/maint/redox.py

    diff --git a/scripts/maint/redox.py b/scripts/maint/redox.py
    index 12aed64..53d3d90 100755
    a b def read(): 
    101101
    102102def findline(lines, lineno, ident):
    103103    """Given a list of all the lines in the file (adjusted so 1-indexing works),
    104        a line number that ident is alledgedly on, and ident, I figure out
     104       a line number that ident is allegedly on, and ident, I figure out
    105105       the line where ident was really declared."""
    106106    lno = lineno
    107107    for lineno in xrange(lineno, 0, -1):
  • scripts/maint/updateFallbackDirs.py

    diff --git a/scripts/maint/updateFallbackDirs.py b/scripts/maint/updateFallbackDirs.py
    index dbd15eb..c854830 100755
    a b MAX_FALLBACKS_PER_FAMILY = 7 
    232232
    233233## Fallback Bandwidth Requirements
    234234
    235 # Any fallback with the Exit flag has its bandwidth multipled by this fraction
     235# Any fallback with the Exit flag has its bandwidth multiplied by this fraction
    236236# to make sure we aren't further overloading exits
    237237# (Set to 1.0, because we asked that only lightly loaded exits opt-in,
    238238# and the extra load really isn't that much for large relays.)
    class Candidate(object): 
    561561      details['flags'] = []
    562562    if (not 'advertised_bandwidth' in details
    563563        or details['advertised_bandwidth'] is None):
    564       # relays without advertised bandwdith have it calculated from their
     564      # relays without advertised bandwidth have it calculated from their
    565565      # consensus weight
    566566      details['advertised_bandwidth'] = 0
    567567    if (not 'effective_family' in details
    class CandidateList(dict): 
    15951595                                                excluded_count, initial_count)
    15961596
    15971597  # calculate each fallback's measured bandwidth based on the median
    1598   # consensus weight to advertised bandwdith ratio
     1598  # consensus weight to advertised bandwidth ratio
    15991599  def calculate_measured_bandwidth(self):
    16001600    self.sort_fallbacks_by_cw_to_bw_factor()
    16011601    median_fallback = self.fallback_median(True)
  • src/common/address.c

    diff --git a/src/common/address.c b/src/common/address.c
    index d96ec51..7ff8120 100644
    a b tor_addr_compare_masked(const tor_addr_t *addr1, const tor_addr_t *addr2, 
    11251125      case AF_UNIX:
    11261126        /* HACKHACKHACKHACKHACK:
    11271127         * tor_addr_t doesn't contain a copy of sun_path, so it's not
    1128          * possible to comapre this at all.
     1128         * possible to compare this at all.
    11291129         *
    11301130         * Since the only time we currently actually should be comparing
    11311131         * 2 AF_UNIX addresses is when dealing with ISO_CLIENTADDR (which
  • src/common/compat.c

    diff --git a/src/common/compat.c b/src/common/compat.c
    index 6a61c6c..39d2f18 100644
    a b get_environment(void) 
    24552455
    24562456/** Get name of current host and write it to <b>name</b> array, whose
    24572457 * length is specified by <b>namelen</b> argument. Return 0 upon
    2458  * successfull completion; otherwise return return -1. (Currently,
     2458 * successful completion; otherwise return return -1. (Currently,
    24592459 * this function is merely a mockable wrapper for POSIX gethostname().)
    24602460 */
    24612461MOCK_IMPL(int,
  • src/common/compat_openssl.h

    diff --git a/src/common/compat_openssl.h b/src/common/compat_openssl.h
    index d1b871b..1299ac3 100644
    a b  
    1212/**
    1313 * \file compat_openssl.h
    1414 *
    15  * \brief compatability definitions for working with different openssl forks
     15 * \brief compatibility definitions for working with different openssl forks
    1616 **/
    1717
    1818#if !defined(LIBRESSL_VERSION_NUMBER) && \
  • src/common/compat_time.c

    diff --git a/src/common/compat_time.c b/src/common/compat_time.c
    index 8cecff2..183a60a 100644
    a b monotime_coarse_absolute_msec(void) 
    807807  return monotime_coarse_absolute_nsec() / ONE_MILLION;
    808808}
    809809#else
    810 #define initalized_at_coarse initialized_at
     810#define initialized_at_coarse initialized_at
    811811#endif /* defined(MONOTIME_COARSE_FN_IS_DIFFERENT) */
    812812
    813813/**
  • src/common/crypto.c

    diff --git a/src/common/crypto.c b/src/common/crypto.c
    index 107b53a..00f0132 100644
    a b crypto_pk_get_hashed_fingerprint(crypto_pk_t *pk, char *fp_out) 
    14601460/** Given a crypto_pk_t <b>pk</b>, allocate a new buffer containing the
    14611461 * Base64 encoding of the DER representation of the private key as a NUL
    14621462 * terminated string, and return it via <b>priv_out</b>.  Return 0 on
    1463  * sucess, -1 on failure.
     1463 * success, -1 on failure.
    14641464 *
    14651465 * It is the caller's responsibility to sanitize and free the resulting buffer.
    14661466 */
    crypto_strongest_rand_syscall(uint8_t *out, size_t out_len) 
    27692769#elif defined(__linux__) && defined(SYS_getrandom)
    27702770  static int getrandom_works = 1; /* Be optimitic about our chances... */
    27712771
    2772   /* getrandom() isn't as straight foward as getentropy(), and has
     2772  /* getrandom() isn't as straight forward as getentropy(), and has
    27732773   * no glibc wrapper.
    27742774   *
    27752775   * As far as I can tell from getrandom(2) and the source code, the
    crypto_strongest_rand_syscall(uint8_t *out, size_t out_len) 
    27822782   *
    27832783   * We optimistically assume that getrandom() is available and functional
    27842784   * because it is the way of the future, and 2 branch mispredicts pale in
    2785    * comparision to the overheads involved with failing to open
     2785   * comparison to the overheads involved with failing to open
    27862786   * /dev/srandom followed by opening and reading from /dev/urandom.
    27872787   */
    27882788  if (PREDICT_LIKELY(getrandom_works)) {
  • src/common/crypto_ed25519.c

    diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c
    index 26523e3..a5a61cb 100644
    a b ed25519_public_key_is_zero(const ed25519_public_key_t *pubkey) 
    225225
    226226/* Return a heap-allocated array that contains <b>msg</b> prefixed by the
    227227 * string <b>prefix_str</b>. Set <b>final_msg_len_out</b> to the size of the
    228  * final array. If an error occured, return NULL. It's the resonsibility of the
     228 * final array. If an error occurred, return NULL. It's the resonsibility of the
    229229 * caller to free the returned array. */
    230230static uint8_t *
    231231get_prefixed_msg(const uint8_t *msg, size_t msg_len,
    get_prefixed_msg(const uint8_t *msg, size_t msg_len, 
    259259 * Set <b>signature_out</b> to a signature of the <b>len</b>-byte message
    260260 * <b>msg</b>, using the secret and public key in <b>keypair</b>.
    261261 *
    262  * Return 0 if we successfuly signed the message, otherwise return -1.
     262 * Return 0 if we successfully signed the message, otherwise return -1.
    263263 */
    264264int
    265265ed25519_sign(ed25519_signature_t *signature_out,
    ed25519_keypair_blind(ed25519_keypair_t *out, 
    529529/**
    530530 * Given an ed25519 public key in <b>inp</b>, generate a corresponding blinded
    531531 * public key in <b>out</b>, blinded with the 32-byte parameter in
    532  * <b>param</b>.  Return 0 on sucess, -1 on railure.
     532 * <b>param</b>.  Return 0 on success, -1 on railure.
    533533 */
    534534int
    535535ed25519_public_blind(ed25519_public_key_t *out,
    ed25519_impl_spot_check,(void)) 
    719719    return -1;
    720720
    721721  /* XXX/yawning: Someone that's more paranoid than I am, can write "Assume
    722    * ref0 is cannonical, and fuzz impl against it" if they want, but I doubt
     722   * ref0 is canonical, and fuzz impl against it" if they want, but I doubt
    723723   * that will catch anything that the known answer tests won't.
    724724   */
    725725  goto end;
    pick_ed25519_impl(void) 
    762762  /* LCOV_EXCL_STOP */
    763763}
    764764
    765 /* Initialize the Ed25519 implementation. This is neccessary if you're
     765/* Initialize the Ed25519 implementation. This is necessary if you're
    766766 * going to use them in a multithreaded setting, and not otherwise. */
    767767void
    768768ed25519_init(void)
  • src/common/timers.c

    diff --git a/src/common/timers.c b/src/common/timers.c
    index 93cde7d..552080b 100644
    a b struct timeout_cb { 
    6363#define TIMEOUT_CB_OVERRIDE
    6464/* We're going to support timers that are pretty far out in advance. Making
    6565 * this big can be inefficient, but having a significant number of timers
    66  * above TIMEOUT_MAX can also be super-inefficent. Choosing 5 here sets
     66 * above TIMEOUT_MAX can also be super-inefficient. Choosing 5 here sets
    6767 * timeout_max to 2^30 ticks, or 29 hours with our value for USEC_PER_TICK */
    6868#define WHEEL_NUM 5
    6969#include "src/ext/timeouts/timeout.c"
  • src/common/tortls.c

    diff --git a/src/common/tortls.c b/src/common/tortls.c
    index 86a8767..bff5983 100644
    a b tor_tls_handshake(tor_tls_t *tls) 
    19421942  return r;
    19431943}
    19441944
    1945 /** Perform the final part of the intial TLS handshake on <b>tls</b>.  This
     1945/** Perform the final part of the initial TLS handshake on <b>tls</b>.  This
    19461946 * should be called for the first handshake only: it determines whether the v1
    19471947 * or the v2 handshake was used, and adjusts things for the renegotiation
    19481948 * handshake as appropriate.
  • src/common/util.c

    diff --git a/src/common/util.c b/src/common/util.c
    index 67e9781..90204be 100644
    a b unescape_string(const char *s, char **result, size_t *size_out) 
    30473047
    30483048/** Removes enclosing quotes from <b>path</b> and unescapes quotes between the
    30493049 * enclosing quotes. Backslashes are not unescaped. Return the unquoted
    3050  * <b>path</b> on sucess or 0 if <b>path</b> is not quoted correctly. */
     3050 * <b>path</b> on success or 0 if <b>path</b> is not quoted correctly. */
    30513051char *
    30523052get_unquoted_path(const char *path)
    30533053{
    format_number_sigsafe(unsigned long x, char *buf, int buf_len, 
    38983898 * call it with a signed int and an unsigned char, and since the C standard
    38993899 * does not guarantee that an int is wider than a char (an int must be at
    39003900 * least 16 bits but it is permitted for a char to be that wide as well), we
    3901  * can't assume a signed int is sufficient to accomodate an unsigned char.
     3901 * can't assume a signed int is sufficient to accommodate an unsigned char.
    39023902 * Thus, format_helper_exit_status() will still need to emit any require '-'
    39033903 * on its own.
    39043904 *
    format_dec_number_sigsafe(unsigned long x, char *buf, int buf_len) 
    39283928 *
    39293929 * The format of <b>hex_errno</b> is: "CHILD_STATE/ERRNO\n", left-padded
    39303930 * with spaces. CHILD_STATE indicates where
    3931  * in the processs of starting the child process did the failure occur (see
     3931 * in the process of starting the child process did the failure occur (see
    39323932 * CHILD_STATE_* macros for definition), and SAVED_ERRNO is the value of
    39333933 * errno when the failure occurred.
    39343934 *
  • src/ext/curve25519_donna/README

    diff --git a/src/ext/curve25519_donna/README b/src/ext/curve25519_donna/README
    index 9f77bd7..acab07c 100644
    a b If you run `make`, two .a archives will be built, similar to djb's curve25519 
    66code. Alternatively, read on:
    77
    88The C implementation is contained within curve25519-donna.c. It has no external
    9 dependancies and is BSD licenced. You can copy/include/link it directly in with
     9dependencies and is BSD licenced. You can copy/include/link it directly in with
    1010your program. Recommended C flags: -O2
    1111
    1212The x86-64 bit implementation is contained within curve25519-donna-x86-64.c and
  • src/ext/ed25519/donna/README.md

    diff --git a/src/ext/ed25519/donna/README.md b/src/ext/ed25519/donna/README.md
    index e09fc27..ee7ed30 100644
    a b No configuration is needed **if you are compiling against OpenSSL**. 
    5656
    5757##### Hash Options
    5858
    59 If you are not compiling aginst OpenSSL, you will need a hash function.
     59If you are not compiling against OpenSSL, you will need a hash function.
    6060
    6161To use a simple/**slow** implementation of SHA-512, use `-DED25519_REFHASH` when compiling `ed25519.c`.
    6262This should never be used except to verify the code works when OpenSSL is not available.
    custom hash implementation in ed25519-hash-custom.h. The hash must have a 512bit 
    7373
    7474##### Random Options
    7575
    76 If you are not compiling aginst OpenSSL, you will need a random function for batch verification.
     76If you are not compiling against OpenSSL, you will need a random function for batch verification.
    7777
    7878To use a custom random function, use `-DED25519_CUSTOMRANDOM` when compiling `ed25519.c` and put your
    7979custom hash implementation in ed25519-randombytes-custom.h. The random function must implement:
  • src/ext/ed25519/donna/ed25519_tor.c

    diff --git a/src/ext/ed25519/donna/ed25519_tor.c b/src/ext/ed25519/donna/ed25519_tor.c
    index 44ec562..84fc385 100644
    a b ED25519_FN(curved25519_scalarmult_basepoint) (curved25519_key pk, const curved25 
    132132}
    133133
    134134/*
    135    Tor has a specific idea of how an Ed25519 implementaion should behave.
     135   Tor has a specific idea of how an Ed25519 implementation should behave.
    136136   Implement such a beast using the ed25519-donna primitives/internals.
    137137
    138138    * Private key generation using Tor's CSPRNG.
  • src/or/bridges.c

    diff --git a/src/or/bridges.c b/src/or/bridges.c
    index 383c33f..d88d6c6 100644
    a b bridge_resolve_conflicts(const tor_addr_t *addr, uint16_t port, 
    356356{
    357357  /* Iterate the already-registered bridge list:
    358358
    359      If you find a bridge with the same adress and port, mark it for
     359     If you find a bridge with the same address and port, mark it for
    360360     removal. It doesn't make sense to have two active bridges with
    361361     the same IP:PORT. If the bridge in question has a different
    362362     digest or transport than <b>digest</b>/<b>transport_name</b>,
  • src/or/channel.c

    diff --git a/src/or/channel.c b/src/or/channel.c
    index 345a90a..f832f9b 100644
    a b  
    3131 * channel_set_cell_handlers(). Currently, this is passed back to the command
    3232 * subsystem which is command_process_cell().
    3333 *
    34  * NOTE: For now, the seperation between channels and specialized channels
     34 * NOTE: For now, the separation between channels and specialized channels
    3535 * (like channeltls) is not that well defined. So the channeltls layer calls
    3636 * channel_process_cell() which originally comes from the connection subsytem.
    3737 * This should be hopefully be fixed with #23993.
    channel_clear_remote_end(channel_t *chan) 
    14351435 *
    14361436 * Two possible errors can happen. Either the channel is not opened or the
    14371437 * lower layer (specialized channel) failed to write it. In both cases, it is
    1438  * the caller responsability to free the cell.
     1438 * the caller responsibility to free the cell.
    14391439 */
    14401440static int
    14411441write_packed_cell(channel_t *chan, packed_cell_t *cell)
    channel_write_packed_cell(channel_t *chan, packed_cell_t *cell) 
    15111511  ret = write_packed_cell(chan, cell);
    15121512
    15131513 end:
    1514   /* Whatever happens, we free the cell. Either an error occured or the cell
     1514  /* Whatever happens, we free the cell. Either an error occurred or the cell
    15151515   * was put on the connection outbuf, both cases we have ownership of the
    15161516   * cell and we free it. */
    15171517  packed_cell_free(cell);
    channel_listener_change_state(channel_listener_t *chan_l, 
    17141714  }
    17151715}
    17161716
    1717 /* Maximum number of cells that is allowed to flush at once withing
     1717/* Maximum number of cells that is allowed to flush at once within
    17181718 * channel_flush_some_cells(). */
    17191719#define MAX_CELLS_TO_GET_FROM_CIRCUITS_FOR_UNLIMITED 256
    17201720
  • src/or/circpathbias.c

    diff --git a/src/or/circpathbias.c b/src/or/circpathbias.c
    index f4bd5ea..c1c1ca3 100644
    a b pathbias_measure_close_rate(entry_guard_t *guard) 
    14671467 *
    14681468 * XXX: The attempt count transfer stuff here might be done
    14691469 * better by keeping separate pending counters that get
    1470  * transfered at circuit close. See ticket #8160.
     1470 * transferred at circuit close. See ticket #8160.
    14711471 */
    14721472static void
    14731473pathbias_scale_close_rates(entry_guard_t *guard)
    pathbias_scale_close_rates(entry_guard_t *guard) 
    15271527 *
    15281528 * XXX: The attempt count transfer stuff here might be done
    15291529 * better by keeping separate pending counters that get
    1530  * transfered at circuit close. See ticket #8160.
     1530 * transferred at circuit close. See ticket #8160.
    15311531 */
    15321532void
    15331533pathbias_scale_use_rates(entry_guard_t *guard)
  • src/or/circuitbuild.c

    diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
    index 9c049a2..3bbcc51 100644
    a b pick_restricted_middle_node(router_crn_flags_t flags, 
    22232223   * Max number of restricted nodes before we alert the user and try
    22242224   * to load balance for them.
    22252225   *
    2226    * The most agressive vanguard design had 16 nodes at layer3.
     2226   * The most aggressive vanguard design had 16 nodes at layer3.
    22272227   * Let's give a small ceiling above that. */
    22282228#define MAX_SANE_RESTRICTED_NODES 20
    22292229  /* If the user (or associated tor controller) selected only a few nodes,
  • src/or/circuitlist.c

    diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
    index 27d8c62..2ceb85f 100644
    a b circuit_purpose_to_string(uint8_t purpose) 
    806806    case CIRCUIT_PURPOSE_INTRO_POINT:
    807807      return "Acting as intro point";
    808808    case CIRCUIT_PURPOSE_REND_POINT_WAITING:
    809       return "Acting as rendevous (pending)";
     809      return "Acting as rendezvous (pending)";
    810810    case CIRCUIT_PURPOSE_REND_ESTABLISHED:
    811       return "Acting as rendevous (established)";
     811      return "Acting as rendezvous (established)";
    812812    case CIRCUIT_PURPOSE_C_GENERAL:
    813813      return "General-purpose client";
    814814    case CIRCUIT_PURPOSE_C_INTRODUCING:
  • src/or/circuitstats.c

    diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
    index f1df19e..6438319 100644
    a b circuit_build_times_disabled_(const or_options_t *options, 
    167167}
    168168
    169169/**
    170  * Retrieve and bounds-check the cbtmaxtimeouts consensus paramter.
     170 * Retrieve and bounds-check the cbtmaxtimeouts consensus parameter.
    171171 *
    172172 * Effect: When this many timeouts happen in the last 'cbtrecentcount'
    173173 * circuit attempts, the client should discard all of its history and
    circuit_build_times_max_timeouts(void) 
    194194}
    195195
    196196/**
    197  * Retrieve and bounds-check the cbtnummodes consensus paramter.
     197 * Retrieve and bounds-check the cbtnummodes consensus parameter.
    198198 *
    199199 * Effect: This value governs how many modes to use in the weighted
    200200 * average calculation of Pareto parameter Xm. A value of 3 introduces
    circuit_build_times_default_num_xm_modes(void) 
    221221}
    222222
    223223/**
    224  * Retrieve and bounds-check the cbtmincircs consensus paramter.
     224 * Retrieve and bounds-check the cbtmincircs consensus parameter.
    225225 *
    226226 * Effect: This is the minimum number of circuits to build before
    227227 * computing a timeout.
    circuit_build_times_enough_to_compute(const circuit_build_times_t *cbt) 
    253253}
    254254
    255255/**
    256  * Retrieve and bounds-check the cbtquantile consensus paramter.
     256 * Retrieve and bounds-check the cbtquantile consensus parameter.
    257257 *
    258258 * Effect: This is the position on the quantile curve to use to set the
    259259 * timeout value. It is a percent (10-99).
    circuit_build_times_quantile_cutoff(void) 
    277277}
    278278
    279279/**
    280  * Retrieve and bounds-check the cbtclosequantile consensus paramter.
     280 * Retrieve and bounds-check the cbtclosequantile consensus parameter.
    281281 *
    282282 * Effect: This is the position on the quantile curve to use to set the
    283283 * timeout value to use to actually close circuits. It is a percent
    circuit_build_times_close_quantile(void) 
    309309}
    310310
    311311/**
    312  * Retrieve and bounds-check the cbttestfreq consensus paramter.
     312 * Retrieve and bounds-check the cbttestfreq consensus parameter.
    313313 *
    314314 * Effect: Describes how often in seconds to build a test circuit to
    315315 * gather timeout values. Only applies if less than 'cbtmincircs'
    circuit_build_times_min_timeout(void) 
    356356}
    357357
    358358/**
    359  * Retrieve and bounds-check the cbtinitialtimeout consensus paramter.
     359 * Retrieve and bounds-check the cbtinitialtimeout consensus parameter.
    360360 *
    361361 * Effect: This is the timeout value to use before computing a timeout,
    362362 * in milliseconds.
    circuit_build_times_initial_timeout(void) 
    386386}
    387387
    388388/**
    389  * Retrieve and bounds-check the cbtrecentcount consensus paramter.
     389 * Retrieve and bounds-check the cbtrecentcount consensus parameter.
    390390 *
    391391 * Effect: This is the number of circuit build times to keep track of
    392392 * for deciding if we hit cbtmaxtimeouts and need to reset our state
  • src/or/circuituse.c

    diff --git a/src/or/circuituse.c b/src/or/circuituse.c
    index 1ff1de4..bea090b 100644
    a b circuit_expire_building(void) 
    674674          break;
    675675        case CIRCUIT_PURPOSE_C_INTRODUCING:
    676676          /* That purpose means that the intro point circuit has been opened
    677            * succesfully but the INTRODUCE1 cell hasn't been sent yet because
     677           * successfully but the INTRODUCE1 cell hasn't been sent yet because
    678678           * the client is waiting for the rendezvous point circuit to open.
    679679           * Keep this circuit open while waiting for the rendezvous circuit.
    680680           * We let the circuit idle timeout take care of cleaning this
  • src/or/config.c

    diff --git a/src/or/config.c b/src/or/config.c
    index afaf867..6ab226d 100644
    a b warn_if_option_path_is_relative(const char *option, 
    30883088  return 0;
    30893089}
    30903090
    3091 /** Scan <b>options</b> for occurances of relative file/directory
     3091/** Scan <b>options</b> for occurrences of relative file/directory
    30923092 * path and log a warning whenever it is found.
    30933093 *
    30943094 * Return 1 if there were relative paths; 0 otherwise.
  • src/or/connection.c

    diff --git a/src/or/connection.c b/src/or/connection.c
    index a020bef..c4047e9 100644
    a b connection_buf_add_buf(connection_t *conn, buf_t *buf) 
    42344234
    42354235/* Return a list of connections that aren't close and matches the given type
    42364236 * and state. The returned list can be empty and must be freed using
    4237  * smartlist_free(). The caller does NOT have owernship of the objects in the
     4237 * smartlist_free(). The caller does NOT have ownership of the objects in the
    42384238 * list so it must not free them nor reference them as they can disappear. */
    42394239smartlist_t *
    42404240connection_list_by_type_state(int type, int state)
    connection_list_by_type_state(int type, int state) 
    42444244
    42454245/* Return a list of connections that aren't close and matches the given type
    42464246 * and purpose. The returned list can be empty and must be freed using
    4247  * smartlist_free(). The caller does NOT have owernship of the objects in the
     4247 * smartlist_free(). The caller does NOT have ownership of the objects in the
    42484248 * list so it must not free them nor reference them as they can disappear. */
    42494249smartlist_t *
    42504250connection_list_by_type_purpose(int type, int purpose)
  • src/or/control.c

    diff --git a/src/or/control.c b/src/or/control.c
    index cce5c79..948ac92 100644
    a b handle_control_hspost(control_connection_t *conn, 
    44584458 * used in pk is given to the HS subsystem so the caller must stop accessing
    44594459 * it after.
    44604460 *
    4461  * The port_cfgs is a list of service port. Ownership transfered to service.
     4461 * The port_cfgs is a list of service port. Ownership transferred to service.
    44624462 * The max_streams refers to the MaxStreams= key.
    44634463 * The max_streams_close_circuit refers to the MaxStreamsCloseCircuit key.
    44644464 * The auth_type is the authentication type of the clients in auth_clients.
    4465  * The ownership of that list is transfered to the service.
     4465 * The ownership of that list is transferred to the service.
    44664466 *
    44674467 * On success (RSAE_OKAY), the address_out points to a newly allocated string
    44684468 * containing the onion address without the .onion part. On error, address_out
    add_onion_helper_keyarg(const char *arg, int discard_pk, 
    49114911    goto err;
    49124912  }
    49134913
    4914   /* Succeded in loading or generating a private key. */
     4914  /* Succeeded in loading or generating a private key. */
    49154915  ret = 0;
    49164916
    49174917 err:
  • src/or/directory.c

    diff --git a/src/or/directory.c b/src/or/directory.c
    index c55f81b..983a3e2 100644
    a b directory_request_free_(directory_request_t *req) 
    11121112/**
    11131113 * Set the address and OR port to use for this directory request.  If there is
    11141114 * no OR port, we'll have to connect over the dirport.  (If there are both,
    1115  * the indirection setting determins which to use.)
     1115 * the indirection setting determines which to use.)
    11161116 */
    11171117void
    11181118directory_request_set_or_addr_port(directory_request_t *req,
    directory_request_set_or_addr_port(directory_request_t *req, 
    11231123/**
    11241124 * Set the address and dirport to use for this directory request.  If there
    11251125 * is no dirport, we'll have to connect over the OR port.  (If there are both,
    1126  * the indirection setting determins which to use.)
     1126 * the indirection setting determines which to use.)
    11271127 */
    11281128void
    11291129directory_request_set_dir_addr_port(directory_request_t *req,
    connection_dir_process_inbuf(dir_connection_t *conn) 
    34133413}
    34143414
    34153415/** We are closing a dir connection: If <b>dir_conn</b> is a dir connection
    3416  *  that tried to fetch an HS descriptor, check if it successfuly fetched it,
     3416 *  that tried to fetch an HS descriptor, check if it successfully fetched it,
    34173417 *  or if we need to try again. */
    34183418static void
    34193419refetch_hsdesc_if_needed(dir_connection_t *dir_conn)
    find_best_diff(const smartlist_t *digests, int flav, 
    40364036}
    40374037
    40384038/** Lookup the cached consensus document by the flavor found in <b>flav</b>.
    4039  * The prefered set of compression methods should be listed in the
     4039 * The preferred set of compression methods should be listed in the
    40404040 * <b>compression_methods</b> bitfield. The compression method chosen (if any)
    40414041 * is stored in <b>compression_used_out</b>. */
    40424042static struct consensus_cache_entry_t *
    handle_get_robots(dir_connection_t *conn, const get_handler_args_t *args) 
    49484948
    49494949/* Given the <b>url</b> from a POST request, try to extract the version number
    49504950 * using the provided <b>prefix</b>. The version should be after the prefix and
    4951  * ending with the seperator "/". For instance:
     4951 * ending with the separator "/". For instance:
    49524952 *      /tor/hs/3/publish
    49534953 *
    49544954 * On success, <b>end_pos</b> points to the position right after the version
  • src/or/dirserv.c

    diff --git a/src/or/dirserv.c b/src/or/dirserv.c
    index d3bae24..fc6358a 100644
    a b  
    4343 * the directory authority functionality.  The directory.c module delegates
    4444 * here in order to handle incoming requests from clients, via
    4545 * connection_dirserv_flushed_some() and its kin.  In order to save RAM, this
    46  * module is reponsible for spooling directory objects (in whole or in part)
     46 * module is responsible for spooling directory objects (in whole or in part)
    4747 * onto buf_t instances, and then closing the dir_connection_t once the
    4848 * objects are totally flushed.
    4949 *
    router_is_active(const routerinfo_t *ri, const node_t *node, time_t now) 
    10861086  if (!node->is_running || !node->is_valid || ri->is_hibernating) {
    10871087    return 0;
    10881088  }
    1089   /* Only require bandwith capacity in non-test networks, or
     1089  /* Only require bandwidth capacity in non-test networks, or
    10901090   * if TestingTorNetwork, and TestingMinExitFlagThreshold is non-zero */
    10911091  if (!ri->bandwidthcapacity) {
    10921092    if (get_options()->TestingTorNetwork) {
  • src/or/dirserv.h

    diff --git a/src/or/dirserv.h b/src/or/dirserv.h
    index 0fd7b79..b9af68f 100644
    a b void dirserv_set_cached_consensus_networkstatus(const char *consensus, 
    123123void dirserv_clear_old_networkstatuses(time_t cutoff);
    124124int dirserv_get_routerdesc_spool(smartlist_t *spools_out, const char *key,
    125125                                 dir_spool_source_t source,
    126                                  int conn_is_encrytped,
     126                                 int conn_is_encrypted,
    127127                                 const char **msg_out);
    128128int dirserv_get_routerdescs(smartlist_t *descs_out, const char *key,
    129129                            const char **msg);
  • src/or/dirvote.c

    diff --git a/src/or/dirvote.c b/src/or/dirvote.c
    index a75d9e5..87b8aa0 100644
    a b static int 
    665665consensus_method_is_supported(int method)
    666666{
    667667  if (method == MIN_METHOD_FOR_ED25519_ID_IN_MD) {
    668     /* This method was broken due to buggy code accidently left in
     668    /* This method was broken due to buggy code accidentally left in
    669669     * dircollate.c; do not actually use it.
    670670     */
    671671    return 0;
  • src/or/dns.c

    diff --git a/src/or/dns.c b/src/or/dns.c
    index 1f00fe5..e4dc804 100644
    a b  
    1919 *      dns_seems_to_be_broken().
    2020 *    <li>When a client has asked the relay, in a RELAY_BEGIN cell, to connect
    2121 *      to a given server by hostname.  This happens via dns_resolve().
    22  *    <li>When a client has asked the rela, in a RELAY_RESOLVE cell, to look
     22 *    <li>When a client has asked the relay, in a RELAY_RESOLVE cell, to look
    2323 *      up a given server's IP address(es) by hostname. This also happens via
    2424 *      dns_resolve().
    2525 *   </ol>
  • src/or/hs_cache.c

    diff --git a/src/or/hs_cache.c b/src/or/hs_cache.c
    index 1a8fdbd..03a96cf 100644
    a b cache_clean_v3_as_client(time_t now) 
    702702    /* Entry is not in the cache anymore, destroy it. */
    703703    cache_client_desc_free(entry);
    704704    /* Update our OOM. We didn't use the remove() function because we are in
    705      * a loop so we have to explicitely decrement. */
     705     * a loop so we have to explicitey decrement. */
    706706    rend_cache_decrement_allocation(entry_size);
    707707    /* Logging. */
    708708    {
    hs_cache_purge_as_client(void) 
    805805    MAP_DEL_CURRENT(key);
    806806    cache_client_desc_free(entry);
    807807    /* Update our OOM. We didn't use the remove() function because we are in
    808      * a loop so we have to explicitely decrement. */
     808     * a loop so we have to explicitly decrement. */
    809809    rend_cache_decrement_allocation(entry_size);
    810810  } DIGEST256MAP_FOREACH_END;
    811811
  • src/or/hs_client.c

    diff --git a/src/or/hs_client.c b/src/or/hs_client.c
    index c863475..af89c99 100644
    a b desc_intro_point_to_extend_info(const hs_desc_intro_point_t *ip) 
    716716    smartlist_add(lspecs, lspec);
    717717  } SMARTLIST_FOREACH_END(desc_lspec);
    718718
    719   /* Explicitely put the direct connection option to 0 because this is client
     719  /* Explicitly put the direct connection option to 0 because this is client
    720720   * side and there is no such thing as a non anonymous client. */
    721721  ei = hs_get_extend_info_from_lspecs(lspecs, &ip->onion_key, 0);
    722722
  • src/or/hs_config.c

    diff --git a/src/or/hs_config.c b/src/or/hs_config.c
    index fa5c1ab..be22350 100644
    a b hs_config_service_all(const or_options_t *options, int validate_only) 
    558558  }
    559559
    560560  /* In non validation mode, we'll stage those services we just successfully
    561    * configured. Service ownership is transfered from the list to the global
     561   * configured. Service ownership is transferred from the list to the global
    562562   * state. If any service is invalid, it will be removed from the list and
    563563   * freed. All versions are handled in that function. */
    564564  if (!validate_only) {
  • src/or/hs_descriptor.c

    diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
    index 789bc1d..4ab4ff0 100644
    a b get_fake_auth_client_lines(void) 
    745745
    746746/* Create the inner layer of the descriptor (which includes the intro points,
    747747 * etc.). Return a newly-allocated string with the layer plaintext, or NULL if
    748  * an error occured. It's the responsibility of the caller to free the returned
     748 * an error occurred. It's the responsibility of the caller to free the returned
    749749 * string. */
    750750static char *
    751751get_inner_encrypted_layer_plaintext(const hs_descriptor_t *desc)
    get_inner_encrypted_layer_plaintext(const hs_descriptor_t *desc) 
    802802/* Create the middle layer of the descriptor, which includes the client auth
    803803 * data and the encrypted inner layer (provided as a base64 string at
    804804 * <b>layer2_b64_ciphertext</b>). Return a newly-allocated string with the
    805  * layer plaintext, or NULL if an error occured. It's the responsibility of the
     805 * layer plaintext, or NULL if an error occurred. It's the responsibility of the
    806806 * caller to free the returned string. */
    807807static char *
    808808get_outer_encrypted_layer_plaintext(const hs_descriptor_t *desc,
    decode_intro_legacy_key(const directory_token_t *tok, 
    16081608  /* The check on the expiration date is for the entire lifetime of a
    16091609   * certificate which is 24 hours. However, a descriptor has a maximum
    16101610   * lifetime of 12 hours meaning we have a 12h difference between the two
    1611    * which ultimately accomodate the clock skewed client. */
     1611   * which ultimately accommodate the clock skewed client. */
    16121612  if (rsa_ed25519_crosscert_check(ip->legacy.cert.encoded,
    16131613                                  ip->legacy.cert.len, ip->legacy.key,
    16141614                                  &desc->plaintext_data.signing_pubkey,
  • src/or/hs_intropoint.c

    diff --git a/src/or/hs_intropoint.c b/src/or/hs_intropoint.c
    index 4a5202f..8c6453e 100644
    a b validate_introduce1_parsed_cell(const trn_cell_introduce1_t *cell) 
    424424
    425425/* We just received a non legacy INTRODUCE1 cell on <b>client_circ</b> with
    426426 * the payload in <b>request</b> of size <b>request_len</b>. Return 0 if
    427  * everything went well, or -1 if an error occured. This function is in charge
     427 * everything went well, or -1 if an error occurred. This function is in charge
    428428 * of sending back an INTRODUCE_ACK cell and will close client_circ on error.
    429429 */
    430430STATIC int
  • src/or/hs_service.c

    diff --git a/src/or/hs_service.c b/src/or/hs_service.c
    index 64ab9c9..8ae00df 100644
    a b static const char address_tld[] = "onion"; 
    7272
    7373/* Staging list of service object. When configuring service, we add them to
    7474 * this list considered a staging area and they will get added to our global
    75  * map once the keys have been loaded. These two steps are seperated because
     75 * map once the keys have been loaded. These two steps are separated because
    7676 * loading keys requires that we are an actual running tor process. */
    7777static smartlist_t *hs_service_staging_list;
    7878
    find_service(hs_service_ht *map, const ed25519_public_key_t *pk) 
    139139
    140140/* Register the given service in the given map. If the service already exists
    141141 * in the map, -1 is returned. On success, 0 is returned and the service
    142  * ownership has been transfered to the global map. */
     142 * ownership has been transferred to the global map. */
    143143STATIC int
    144144register_service(hs_service_ht *map, hs_service_t *service)
    145145{
    describe_intro_point(const hs_service_intro_point_t *ip) 
    253253static int32_t
    254254get_intro_point_min_introduce2(void)
    255255{
    256   /* The [0, 2147483647] range is quite large to accomodate anything we decide
     256  /* The [0, 2147483647] range is quite large to accommodate anything we decide
    257257   * in the future. */
    258258  return networkstatus_get_param(NULL, "hs_intro_min_introduce2",
    259259                                 INTRO_POINT_MIN_LIFETIME_INTRODUCTIONS,
    get_intro_point_min_introduce2(void) 
    266266static int32_t
    267267get_intro_point_max_introduce2(void)
    268268{
    269   /* The [0, 2147483647] range is quite large to accomodate anything we decide
     269  /* The [0, 2147483647] range is quite large to accommodate anything we decide
    270270   * in the future. */
    271271  return networkstatus_get_param(NULL, "hs_intro_max_introduce2",
    272272                                 INTRO_POINT_MAX_LIFETIME_INTRODUCTIONS,
    get_intro_point_min_lifetime(void) 
    283283    return MIN_INTRO_POINT_LIFETIME_TESTING;
    284284  }
    285285
    286   /* The [0, 2147483647] range is quite large to accomodate anything we decide
     286  /* The [0, 2147483647] range is quite large to accommodate anything we decide
    287287   * in the future. */
    288288  return networkstatus_get_param(NULL, "hs_intro_min_lifetime",
    289289                                 INTRO_POINT_LIFETIME_MIN_SECONDS,
    get_intro_point_max_lifetime(void) 
    300300    return MAX_INTRO_POINT_LIFETIME_TESTING;
    301301  }
    302302
    303   /* The [0, 2147483647] range is quite large to accomodate anything we decide
     303  /* The [0, 2147483647] range is quite large to accommodate anything we decide
    304304   * in the future. */
    305305  return networkstatus_get_param(NULL, "hs_intro_max_lifetime",
    306306                                 INTRO_POINT_LIFETIME_MAX_SECONDS,
    build_desc_intro_points(const hs_service_t *service, 
    12721272  } DIGEST256MAP_FOREACH_END;
    12731273}
    12741274
    1275 /* Populate the descriptor encrypted section fomr the given service object.
     1275/* Populate the descriptor encrypted section from the given service object.
    12761276 * This will generate a valid list of introduction points that can be used
    12771277 * after for circuit creation. Return 0 on success else -1 on error. */
    12781278static int
    build_service_desc_encrypted(const hs_service_t *service, 
    13021302  return 0;
    13031303}
    13041304
    1305 /* Populare the descriptor plaintext section from the given service object.
     1305/* Populate the descriptor plaintext section from the given service object.
    13061306 * The caller must make sure that the keys in the descriptors are valid that
    13071307 * is are non-zero. Return 0 on success else -1 on error. */
    13081308static int
    hs_service_add_ephemeral(ed25519_secret_key_t *sk, smartlist_t *ports, 
    29782978  service = hs_service_new(get_options());
    29792979
    29802980  /* Setup the service configuration with specifics. A default service is
    2981    * HS_VERSION_TWO so explicitely set it. */
     2981   * HS_VERSION_TWO so explicitly set it. */
    29822982  service->config.version = HS_VERSION_THREE;
    29832983  service->config.max_streams_per_rdv_circuit = max_streams_per_rdv_circuit;
    29842984  service->config.max_streams_close_circuit = !!max_streams_close_circuit;
    hs_service_set_conn_addr_port(const origin_circuit_t *circ, 
    32183218  }
    32193219
    32203220  /* Find a virtual port of that service mathcing the one in the connection if
    3221    * succesful, set the address in the connection. */
     3221   * successful, set the address in the connection. */
    32223222  if (hs_set_conn_addr_port(service->config.ports, conn) < 0) {
    32233223    log_info(LD_REND, "No virtual port mapping exists for port %d for "
    32243224                      "hidden service %s.",
  • src/or/main.c

    diff --git a/src/or/main.c b/src/or/main.c
    index 10e606f..c8ca4bc 100644
    a b run_main_loop_once(void) 
    28292829  if (get_options()->MainloopStats) {
    28302830    /* Update our main loop counters. */
    28312831    if (loop_result == 0) {
    2832       // The call was succesful.
     2832      // The call was successful.
    28332833      increment_main_loop_success_count();
    28342834    } else if (loop_result == -1) {
    28352835      // The call was erroneous.
  • src/or/onion_fast.c

    diff --git a/src/or/onion_fast.c b/src/or/onion_fast.c
    index 56c9548..de9103b 100644
    a b  
    2323 * [*]Actually, it's possible that TAP _was_ a little better than TLS with
    2424 * RSA1024 certificates and EDH1024 for forward secrecy, if you
    2525 * hypothesize an adversary who can compute discrete logarithms on a
    26  * small number of targetted DH1024 fields, but who can't break all that
     26 * small number of targeted DH1024 fields, but who can't break all that
    2727 * many RSA1024 keys.
    2828 **/
    2929
  • src/or/or.h

    diff --git a/src/or/or.h b/src/or/or.h
    index c81e29c..d847496 100644
    a b typedef struct circuit_t { 
    31253125
    31263126  /** When the circuit was first used, or 0 if the circuit is clean.
    31273127   *
    3128    * XXXX Note that some code will artifically adjust this value backward
     3128   * XXXX Note that some code will artificially adjust this value backward
    31293129   * in time in order to indicate that a circuit shouldn't be used for new
    31303130   * streams, but that it can stay alive as long as it has streams on it.
    31313131   * That's a kludge we should fix.
    typedef struct origin_circuit_t { 
    33833383  uint32_t global_identifier;
    33843384
    33853385  /** True if we have associated one stream to this circuit, thereby setting
    3386    * the isolation paramaters for this circuit.  Note that this doesn't
     3386   * the isolation parameters for this circuit.  Note that this doesn't
    33873387   * necessarily mean that we've <em>attached</em> any streams to the circuit:
    33883388   * we may only have marked up this circuit during the launch process.
    33893389   */
    typedef struct { 
    41654165  int UseEntryGuards_option;
    41664166  /** Internal variable to remember whether we're actually acting on
    41674167   * UseEntryGuards_option -- when we're a non-anonymous Tor2web client or
    4168    * Single Onion Service, it is alwasy false, otherwise we use the value of
     4168   * Single Onion Service, it is always false, otherwise we use the value of
    41694169   * UseEntryGuards_option. */
    41704170  int UseEntryGuards;
    41714171
  • src/or/policies.c

    diff --git a/src/or/policies.c b/src/or/policies.c
    index e14b33c..f718ded 100644
    a b policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts) 
    24072407#define REJECT_CUTOFF_SCALE_IPV6 (64)
    24082408/* Ports are rejected in an IPv6 summary if they are rejected in more than one
    24092409 * IPv6 /16 address block.
    2410  * This is rougly equivalent to the IPv4 cutoff, as only five IPv6 /12s (and
     2410 * This is roughly equivalent to the IPv4 cutoff, as only five IPv6 /12s (and
    24112411 * some scattered smaller blocks) have been allocated to the RIRs.
    24122412 * Network providers are typically allocated one or more IPv6 /32s.
    24132413 */
  • src/or/reasons.c

    diff --git a/src/or/reasons.c b/src/or/reasons.c
    index 03d4941..ce1259b 100644
    a b socks5_response_code_to_string(uint8_t code) 
    428428  }
    429429}
    430430
    431 /** Return a string corresponding to a bandwidht_weight_rule_t */
     431/** Return a string corresponding to a bandwidth_weight_rule_t */
    432432const char *
    433433bandwidth_weight_rule_to_string(bandwidth_weight_rule_t rule)
    434434{
  • src/or/rendcache.c

    diff --git a/src/or/rendcache.c b/src/or/rendcache.c
    index 6f56df6..30115d0 100644
    a b STATIC digestmap_t *rend_cache_v2_dir = NULL; 
    4343 * ID, that were NOT present in the descriptor are removed from this cache.
    4444 * Which means that if at least one IP was not in this cache, thus usuable,
    4545 * it's considered a new descriptor so we keep it. Else, if all IPs were in
    46  * this cache, we discard the descriptor as it's considered unsuable.
     46 * this cache, we discard the descriptor as it's considered unusable.
    4747 *
    4848 * Once a descriptor is removed from the rend cache or expires, the entry
    4949 * in this cache is also removed for the service ID.
    5050 *
    51  * This scheme allows us to not realy on the descriptor's timestamp (which
     51 * This scheme allows us to not relay on the descriptor's timestamp (which
    5252 * is rounded down to the hour) to know if we have a newer descriptor. We
    5353 * only rely on the usability of intro points from an internal state. */
    5454STATIC strmap_t *rend_cache_failure = NULL;
  • src/or/rendcache.h

    diff --git a/src/or/rendcache.h b/src/or/rendcache.h
    index 66e9785..8b6fd5b 100644
    a b typedef struct rend_cache_entry_t { 
    3636
    3737/* Introduction point failure type. */
    3838typedef struct rend_cache_failure_intro_t {
    39   /* When this intro point failure occured thus we allocated this object and
     39  /* When this intro point failure occurred thus we allocated this object and
    4040   * cache it. */
    4141  time_t created_ts;
    4242  rend_intro_point_failure_t failure_type;
  • src/or/rendclient.c

    diff --git a/src/or/rendclient.c b/src/or/rendclient.c
    index 07fa333..5781581 100644
    a b fetch_v2_desc_by_descid(const char *desc_id, 
    571571
    572572/** Fetch a v2 descriptor using the onion address in the given query object.
    573573 * This will compute the descriptor id for each replicas and fetch it on the
    574  * given hsdir(s) if any or the responsible ones that are choosen
     574 * given hsdir(s) if any or the responsible ones that are chosen
    575575 * automatically.
    576576 *
    577577 * On success, 1 is returned. If no hidden service is left to ask, return 0.
  • src/or/rendservice.c

    diff --git a/src/or/rendservice.c b/src/or/rendservice.c
    index f38895d..b07a7a7 100644
    a b rend_services_add_filenames_to_lists(smartlist_t *open_lst, 
    13601360}
    13611361
    13621362/** Derive all rend_service_t internal material based on the service's key.
    1363  * Returns 0 on sucess, -1 on failure.
     1363 * Returns 0 on success, -1 on failure.
    13641364 */
    13651365static int
    13661366rend_service_derive_key_digests(struct rend_service_t *s)
    rend_service_intro_has_opened(origin_circuit_t *circuit) 
    31963196
    31973197  /* If we already have enough introduction circuits for this service,
    31983198   * redefine this one as a general circuit or close it, depending.
    3199    * Substract the amount of expiring nodes here because the circuits are
     3199   * Subtract the amount of expiring nodes here because the circuits are
    32003200   * still opened. */
    32013201  if (valid_ip_circuits > service->n_intro_points_wanted) {
    32023202    const or_options_t *options = get_options();
    rend_consider_services_intro_points(time_t now) 
    41214121                 n_intro_points_to_open);
    41224122        break;
    41234123      }
    4124       /* Add the choosen node to the exclusion list in order to avoid picking
     4124      /* Add the chosen node to the exclusion list in order to avoid picking
    41254125       * it again in the next iteration. */
    41264126      smartlist_add(exclude_nodes, (void*)node);
    41274127      intro = tor_malloc_zero(sizeof(rend_intro_point_t));
  • src/or/rendservice.h

    diff --git a/src/or/rendservice.h b/src/or/rendservice.h
    index 88da7b8..cc872ab 100644
    a b typedef struct rend_service_t { 
    108108  /** If true, we don't close circuits for making requests to unsupported
    109109   * ports. */
    110110  int allow_unknown_ports;
    111   /** The maximum number of simultanious streams-per-circuit that are allowed
     111  /** The maximum number of simultaneous streams-per-circuit that are allowed
    112112   * to be established, or 0 if no limit is set.
    113113   */
    114114  int max_streams_per_circuit;
  • src/or/rephist.c

    diff --git a/src/or/rephist.c b/src/or/rephist.c
    index 15fb674..c0abbb2 100644
    a b rep_hist_desc_stats_write(time_t now) 
    27362736}
    27372737
    27382738/** Called to note that we've served a given descriptor (by
    2739  * digest). Incrememnts the count of descriptors served, and the number
     2739 * digest). Increments the count of descriptors served, and the number
    27402740 * of times we've served this descriptor. */
    27412741void
    27422742rep_hist_note_desc_served(const char * desc)
  • src/or/routerlist.c

    diff --git a/src/or/routerlist.c b/src/or/routerlist.c
    index 2815c60..80f898d 100644
    a b list_authority_ids_with_downloads, (void)) 
    367367      smartlist_add(ids, tmp);
    368368    }
    369369  }
    370   /* else definitely no downlaods going since nothing even has a cert list */
     370  /* else definitely no downloads going since nothing even has a cert list */
    371371
    372372  return ids;
    373373}
    compute_weighted_bandwidths(const smartlist_t *sl, 
    26522652    is_dir = node_is_dir(node);
    26532653    if (node->rs) {
    26542654      if (!node->rs->has_bandwidth) {
    2655         /* This should never happen, unless all the authorites downgrade
     2655        /* This should never happen, unless all the authorities downgrade
    26562656         * to 0.2.0 or rogue routerstatuses get inserted into our consensus. */
    26572657        if (! warned_missing_bw) {
    26582658          log_warn(LD_BUG,
  • src/or/shared_random.c

    diff --git a/src/or/shared_random.c b/src/or/shared_random.c
    index 7723ad4..13416d6 100644
    a b sr_parse_srv(const smartlist_t *args) 
    10711071
    10721072  srv = tor_malloc_zero(sizeof(*srv));
    10731073  srv->num_reveals = num_reveals;
    1074   /* We substract one byte from the srclen because the function ignores the
     1074  /* We subtract one byte from the srclen because the function ignores the
    10751075   * '=' character in the given buffer. This is broken but it's a documented
    10761076   * behavior of the implementation. */
    10771077  ret = base64_decode((char *) srv->value, sizeof(srv->value), value,
  • src/or/shared_random_state.c

    diff --git a/src/or/shared_random_state.c b/src/or/shared_random_state.c
    index d6109b2..53782af 100644
    a b sr_state_get_previous_srv(void) 
    11011101}
    11021102
    11031103/* Set the current SRV value from our state. Value CAN be NULL. The srv
    1104  * object ownership is transfered to the state object. */
     1104 * object ownership is transferred to the state object. */
    11051105void
    11061106sr_state_set_previous_srv(const sr_srv_t *srv)
    11071107{
    sr_state_get_current_srv(void) 
    11201120}
    11211121
    11221122/* Set the current SRV value from our state. Value CAN be NULL. The srv
    1123  * object ownership is transfered to the state object. */
     1123 * object ownership is transferred to the state object. */
    11241124void
    11251125sr_state_set_current_srv(const sr_srv_t *srv)
    11261126{
    sr_state_get_commit(const char *rsa_identity) 
    12251225}
    12261226
    12271227/* Add <b>commit</b> to the permanent state. The commit object ownership is
    1228  * transfered to the state so the caller MUST not free it. */
     1228 * transferred to the state so the caller MUST not free it. */
    12291229void
    12301230sr_state_add_commit(sr_commit_t *commit)
    12311231{
  • src/or/status.c

    diff --git a/src/or/status.c b/src/or/status.c
    index 187dc4a..1b6a333 100644
    a b log_heartbeat(time_t now) 
    185185    const uint64_t main_loop_idle_count = get_main_loop_idle_count();
    186186
    187187    log_fn(LOG_NOTICE, LD_HEARTBEAT, "Main event loop statistics: "
    188          U64_FORMAT " succesful returns, "
     188         U64_FORMAT " successful returns, "
    189189         U64_FORMAT " erroneous returns, and "
    190190         U64_FORMAT " idle returns.",
    191191         U64_PRINTF_ARG(main_loop_success_count),
  • src/or/transports.c

    diff --git a/src/or/transports.c b/src/or/transports.c
    index 1e6307b..b08dcd1 100644
    a b pt_configure_remaining_proxies(void) 
    590590    }
    591591
    592592    /* If the proxy is not fully configured, try to configure it
    593        futher. */
     593       further. */
    594594    if (!proxy_configuration_finished(mp))
    595595      if (configure_proxy(mp) == 1)
    596596        at_least_a_proxy_config_finished = 1;
  • src/test/test.c

    diff --git a/src/test/test.c b/src/test/test.c
    index f225fd2..df83464 100644
    a b test_bad_onion_handshake(void *arg) 
    174174                                            s_buf, s_keys, 40));
    175175  c_buf[64] ^= 33;
    176176
    177   /* (Let the server procede) */
     177  /* (Let the server proceed) */
    178178  tt_int_op(0, OP_EQ,
    179179            onion_skin_TAP_server_handshake(c_buf, pk, NULL,
    180180                                            s_buf, s_keys, 40));
  • src/test/test_cell_formats.c

    diff --git a/src/test/test_cell_formats.c b/src/test/test_cell_formats.c
    index 007f7e3..88cdef3 100644
    a b test_cfmt_create_cells(void *arg) 
    477477  cell.command = CELL_CREATED;
    478478  tt_int_op(-1, OP_EQ, create_cell_parse(&cc, &cell));
    479479
    480   /* You can't acutally make an unparseable CREATE or CREATE_FAST cell. */
     480  /* You can't actually make an unparseable CREATE or CREATE_FAST cell. */
    481481
    482482  /* Try some CREATE2 cells.  First with a bad type. */
    483483  cell.command = CELL_CREATE2;
  • src/test/test_channelpadding.c

    diff --git a/src/test/test_channelpadding.c b/src/test/test_channelpadding.c
    index 4cc33cb..9e570b8 100644
    a b test_channelpadding_killonehop(void *arg) 
    457457  tt_assert(relay3_client->padding_enabled);
    458458  tt_assert(client_relay3->padding_enabled);
    459459  get_options_mutable()->Tor2webMode = 1;
    460   /* For the relay to recieve the negotiate: */
     460  /* For the relay to receive the negotiate: */
    461461  get_options_mutable()->ORPort_set = 1;
    462462  decision = channelpadding_decide_to_pad_channel(client_relay3);
    463463  tt_int_op(decision, OP_EQ, CHANNELPADDING_WONTPAD);
    test_channelpadding_killonehop(void *arg) 
    530530  // Test client side (it should stop immediately)
    531531  get_options_mutable()->HiddenServiceSingleHopMode = 1;
    532532  get_options_mutable()->HiddenServiceNonAnonymousMode = 1;
    533   /* For the relay to recieve the negotiate: */
     533  /* For the relay to receive the negotiate: */
    534534  get_options_mutable()->ORPort_set = 1;
    535535  decision = channelpadding_decide_to_pad_channel(client_relay3);
    536536  tt_int_op(decision, OP_EQ, CHANNELPADDING_WONTPAD);
    test_channelpadding_negotiation(void *arg) 
    835835  get_options_mutable()->ORPort_set = 0;
    836836
    837837  /* Test case #2: Torrc options */
    838   /* ConnectionPadding auto; Relay doesn't suport us */
     838  /* ConnectionPadding auto; Relay doesn't support us */
    839839  ((channel_tls_t*)relay3_client)->conn->link_proto = 4;
    840840  relay3_client->padding_enabled = 0;
    841841  tried_to_write_cell = 0;
    test_channelpadding_negotiation(void *arg) 
    846846  ((channel_tls_t*)relay3_client)->conn->link_proto = 5;
    847847  relay3_client->padding_enabled = 1;
    848848
    849   /* ConnectionPadding 1; Relay doesn't suport us */
     849  /* ConnectionPadding 1; Relay doesn't support us */
    850850  get_options_mutable()->ConnectionPadding = 1;
    851851  tried_to_write_cell = 0;
    852852  decision = channelpadding_decide_to_pad_channel(client_relay3);
  • src/test/test_config.c

    diff --git a/src/test/test_config.c b/src/test/test_config.c
    index 4290d0d..d42335d 100644
    a b test_config_write_to_data_subdir(void *arg) 
    323323  tt_int_op(mkdir(options->DataDirectory, 0700), OP_EQ, 0);
    324324#endif
    325325
    326   // Write attempt shoudl fail, if subdirectory doesn't exist.
     326  // Write attempt should fail, if subdirectory doesn't exist.
    327327  tt_assert(write_to_data_subdir(subdir, fname, str, NULL));
    328328  tt_assert(! check_or_create_data_subdir(subdir));
    329329
    test_config_resolve_my_address(void *arg) 
    13911391   *      if running on.
    13921392   *   3. Hostname from previous step cannot be converted to
    13931393   *      address by using tor_inet_aton() function.
    1394    *   4. However, tor_lookup_hostname() succeds in resolving the
     1394   *   4. However, tor_lookup_hostname() succeeds in resolving the
    13951395   *      hostname from step 2.
    13961396   *   5. Unfortunately, tor_addr_is_internal() deems this address
    13971397   *      to be internal.
  • src/test/test_connection.c

    diff --git a/src/test/test_connection.c b/src/test/test_connection.c
    index 314b90c..33f453b 100644
    a b test_conn_download_status(void *arg) 
    779779#define CONNECTION_TESTCASE(name, fork, setup)                           \
    780780  { #name, test_conn_##name, fork, &setup, NULL }
    781781
    782 /* where arg is an expression (constant, varaible, compound expression) */
     782/* where arg is an expression (constant, variable, compound expression) */
    783783#define CONNECTION_TESTCASE_ARG(name, fork, setup, arg)                  \
    784784  { #name "_" #arg, test_conn_##name, fork, &setup, (void *)arg }
    785785
  • src/test/test_conscache.c

    diff --git a/src/test/test_conscache.c b/src/test/test_conscache.c
    index ffec314..1017760 100644
    a b test_conscache_simple_usage(void *arg) 
    4141  /* Create object; make sure it exists. */
    4242  config_line_t *labels = NULL;
    4343  config_line_append(&labels, "Hello", "world");
    44   config_line_append(&labels, "Adios", "planetas");
     44  config_line_append(&labels, "Adios", "planets");
    4545  ent = consensus_cache_add(cache,
    4646                            labels, (const uint8_t *)"A\0B\0C", 5);
    4747  config_free_lines(labels);
  • src/test/test_dir.c

    diff --git a/src/test/test_dir.c b/src/test/test_dir.c
    index f2223ee..0c7c571 100644
    a b test_dir_versions(void *arg) 
    12701270  tt_int_op(0,OP_EQ, tor_version_as_new_as(
    12711271                                           "Tor 0.2.9.9 (git-00)",
    12721272                                           "Tor 0.2.9.9 (git-01)"));
    1273   /* In #21278, we comapre without integer overflows.
     1273  /* In #21278, we compare without integer overflows.
    12741274   * But since #21450 limits version components to [0, INT32_MAX], it is no
    12751275   * longer possible to cause an integer overflow in tor_version_compare() */
    12761276  tt_int_op(0,OP_EQ, tor_version_as_new_as(
  • src/test/test_entrynodes.c

    diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
    index 1cff382..92a8603 100644
    a b test_entry_guard_select_for_circuit_highlevel_primary(void *arg) 
    20242024  tt_mem_op(g->identity, OP_NE, g_prev->identity, DIGEST_LEN);
    20252025  tt_int_op(g->is_primary, OP_EQ, 1);
    20262026  tt_i64_op(g->last_tried_to_connect, OP_EQ, start+60);
    2027   tt_int_op(g->confirmed_idx, OP_EQ, -1); // not confirmd now.
     2027  tt_int_op(g->confirmed_idx, OP_EQ, -1); // not confirmed now.
    20282028
    20292029  /* Call this one up; watch it get confirmed. */
    20302030  update_approx_time(start+90);
  • src/test/test_hs.c

    diff --git a/src/test/test_hs.c b/src/test/test_hs.c
    index 55c6218..9189bb6 100644
    a b test_prune_services_on_reload(void *arg) 
    10101010    set_rend_service_list(old);
    10111011    set_rend_rend_service_staging_list(new);
    10121012    rend_service_prune_list_impl_();
    1013     /* Check if they've all been transfered. */
     1013    /* Check if they've all been transferred. */
    10141014    tt_int_op(smartlist_len(old), OP_EQ, 0);
    10151015    tt_int_op(smartlist_len(new), OP_EQ, 2);
    10161016  }
  • src/test/test_hs_descriptor.c

    diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c
    index 9ec183d..8e9d461 100644
    a b test_decode_invalid_intro_point(void *arg) 
    413413
    414414  (void) arg;
    415415
    416   /* Seperate pieces of a valid encoded introduction point. */
     416  /* Separate pieces of a valid encoded introduction point. */
    417417  const char *intro_point =
    418418    "introduction-point AQIUMDI5OUYyNjhGQ0E5RDU1Q0QxNTc=";
    419419  const char *auth_key =
  • src/test/test_hs_intropoint.c

    diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c
    index 6683208..55dfafb 100644
    a b helper_create_introduce1_cell(void) 
    139139    memcpy(auth_key_ptr, auth_key_kp.pubkey.pubkey, auth_key_len);
    140140  }
    141141
    142   /* Set the cell extentions to none. */
     142  /* Set the cell extensions to none. */
    143143  {
    144144    trn_cell_extension_t *ext = trn_cell_extension_new();
    145145    trn_cell_extension_set_num(ext, 0);
    test_circuitmap_free_all(void) 
    552552  ;
    553553}
    554554
    555 /** Successfuly register a v2 intro point and a v3 intro point. Ensure that HS
     555/** Successfully register a v2 intro point and a v3 intro point. Ensure that HS
    556556 *  circuitmap is maintained properly. */
    557557static void
    558558test_intro_point_registration(void *arg)
  • src/test/test_hs_service.c

    diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
    index 3e3a7d8..fb4ec2e 100644
    a b test_intro_circuit_opened(void *arg) 
    659659  UNMOCK(relay_send_command_from_edge_);
    660660}
    661661
    662 /** Test the operations we do on a circuit after we learn that we successfuly
     662/** Test the operations we do on a circuit after we learn that we successfully
    663663 *  established an intro point on it */
    664664static void
    665665test_intro_established(void *arg)
  • src/test/test_options.c

    diff --git a/src/test/test_options.c b/src/test/test_options.c
    index 62732ca..b889876 100644
    a b test_options_validate__authdir(void *ignored) 
    906906                                "Address 100.200.10.1\n"
    907907                                "BridgeAuthoritativeDir 1\n"
    908908                                "ContactInfo hello@hello.com\n"
    909                                 "V3BandwidthsFile non-existant-file\n");
     909                                "V3BandwidthsFile non-existent-file\n");
    910910  mock_clean_saved_logs();
    911911  options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
    912912  tt_str_op(msg, OP_EQ,
    test_options_validate__authdir(void *ignored) 
    918918                                "Address 100.200.10.1\n"
    919919                                "BridgeAuthoritativeDir 1\n"
    920920                                "ContactInfo hello@hello.com\n"
    921                                 "V3BandwidthsFile non-existant-file\n");
     921                                "V3BandwidthsFile non-existent-file\n");
    922922  mock_clean_saved_logs();
    923923  options_validate(NULL, tdata->opt, tdata->def_opt, 0, &msg);
    924924  tt_str_op(msg, OP_EQ,
    test_options_validate__authdir(void *ignored) 
    930930                                "Address 100.200.10.1\n"
    931931                                "BridgeAuthoritativeDir 1\n"
    932932                                "ContactInfo hello@hello.com\n"
    933                                 "GuardfractionFile non-existant-file\n");
     933                                "GuardfractionFile non-existent-file\n");
    934934  mock_clean_saved_logs();
    935935  options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
    936936  tt_str_op(msg, OP_EQ,
    test_options_validate__authdir(void *ignored) 
    942942                                "Address 100.200.10.1\n"
    943943                                "BridgeAuthoritativeDir 1\n"
    944944                                "ContactInfo hello@hello.com\n"
    945                                 "GuardfractionFile non-existant-file\n");
     945                                "GuardfractionFile non-existent-file\n");
    946946  mock_clean_saved_logs();
    947947  options_validate(NULL, tdata->opt, tdata->def_opt, 0, &msg);
    948948  tt_str_op(msg, OP_EQ,
    test_options_validate__transproxy(void *ignored) 
    11121112
    11131113  // Test unknown trans proxy
    11141114  free_options_test_data(tdata);
    1115   tdata = get_options_test_data("TransProxyType non-existant\n");
     1115  tdata = get_options_test_data("TransProxyType non-existent\n");
    11161116  ret = options_validate(tdata->old_opt, tdata->opt, tdata->def_opt, 0, &msg);
    11171117  tt_int_op(ret, OP_EQ, -1);
    11181118  tt_str_op(msg, OP_EQ, "Unrecognized value for TransProxyType");
  • src/test/test_shared_random.c

    diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c
    index 9649490..4fe9ee4 100644
    a b test_sr_commit(void *arg) 
    402402                               sizeof(our_commit->hashed_reveal)));
    403403    /* Do we have a valid encoded commit and reveal. Note the following only
    404404     * tests if the generated values are correct. Their could be a bug in
    405      * the decode function but we test them seperately. */
     405     * the decode function but we test them separately. */
    406406    tt_int_op(0, OP_EQ, reveal_decode(our_commit->encoded_reveal,
    407407                                   &test_commit));
    408408    tt_int_op(0, OP_EQ, commit_decode(our_commit->encoded_commit,
    test_vote(void *arg) 
    612612    ret = smartlist_split_string(chunks, lines, "\n", SPLIT_IGNORE_BLANK, 0);
    613613    tt_int_op(ret, OP_EQ, 4);
    614614    tt_str_op(smartlist_get(chunks, 0), OP_EQ, "shared-rand-participate");
    615     /* Get our commitment line and will validate it agains our commit. The
     615    /* Get our commitment line and will validate it against our commit. The
    616616     * format is as follow:
    617617     * "shared-rand-commitment" SP version SP algname SP identity
    618618     *                          SP COMMIT [SP REVEAL] NL
  • src/test/test_util.c

    diff --git a/src/test/test_util.c b/src/test/test_util.c
    index 1fd41a3..ba4ac3c 100644
    a b test_util_time(void *arg) 
    703703     * a "correct" retrospective gregorian negative year value,
    704704     * which I'm pretty sure is:
    705705     * -1*(2^63)/60/60/24*2000/730485 + 1970 = -292277022657
    706      * 730485 is the number of days in two millenia, including leap days */
     706     * 730485 is the number of days in two millennia, including leap days */
    707707    a_time.tm_year = -292277022657-1900;
    708708    CAPTURE();
    709709    tt_int_op((time_t) -1,OP_EQ, tor_timegm(&a_time));
    test_util_time(void *arg) 
    739739     * a "correct" proleptic gregorian year value,
    740740     * which I'm pretty sure is:
    741741     * (2^63-1)/60/60/24*2000/730485 + 1970 = 292277026596
    742      * 730485 is the number of days in two millenia, including leap days */
     742     * 730485 is the number of days in two millennia, including leap days */
    743743    a_time.tm_year = 292277026596-1900;
    744744    CAPTURE();
    745745    tt_int_op((time_t) -1,OP_EQ, tor_timegm(&a_time));
    test_util_time(void *arg) 
    875875     * a "correct" retrospective gregorian negative year value,
    876876     * which I'm pretty sure is:
    877877     * -1*(2^63)/60/60/24*2000/730485 + 1970 = -292277022657
    878      * 730485 is the number of days in two millenia, including leap days
     878     * 730485 is the number of days in two millennia, including leap days
    879879     * (int64_t)b_time.tm_year == (-292277022657LL-1900LL) without clamping */
    880880    t_res = INT64_MIN;
    881881    CAPTURE();
    test_util_time(void *arg) 
    921921     * a "correct" proleptic gregorian year value,
    922922     * which I'm pretty sure is:
    923923     * (2^63-1)/60/60/24*2000/730485 + 1970 = 292277026596
    924      * 730485 is the number of days in two millenia, including leap days
     924     * 730485 is the number of days in two millennia, including leap days
    925925     * (int64_t)b_time.tm_year == (292277026596L-1900L) without clamping */
    926926    t_res = INT64_MAX;
    927927    CAPTURE();
    is_there_a_localhost(int family) 
    54655465#endif /* 0 */
    54665466
    54675467/* Test for socketpair and ersatz_socketpair().  We test them both, since
    5468  * the latter is a tolerably good way to exersize tor_accept_socket(). */
     5468 * the latter is a tolerably good way to exercise tor_accept_socket(). */
    54695469static void
    54705470test_util_socketpair(void *arg)
    54715471{
  • src/trunnel/hs/cell_introduce1.trunnel

    diff --git a/src/trunnel/hs/cell_introduce1.trunnel b/src/trunnel/hs/cell_introduce1.trunnel
    index 7577c15..574382b 100644
    a b const TRUNNEL_REND_COOKIE_LEN = 20; 
    1414
    1515/* INTRODUCE1 payload. See details in section 3.2.1. */
    1616struct trn_cell_introduce1 {
    17   /* Always zeroed. MUST be checked explicitely by the caller. */
     17  /* Always zeroed. MUST be checked explicitly by the caller. */
    1818  u8 legacy_key_id[TRUNNEL_SHA1_LEN];
    1919
    2020  /* Authentication key material. */