[tor-commits] [tor/master] Merge branch 'maint-0.2.9'
commit 68a27dad4368b661f5b05d7660f6a96d03c7ea48 Merge: 1d76d38 e712b5d Author: Nick MathewsonDate: Mon Oct 31 16:33:12 2016 -0400 Merge branch 'maint-0.2.9' changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/release-0.2.9] Actually free the worker_state_t object when we do an update with it
commit 24b7b922ae9adc814890feae661ad64f474307f3 Author: Nick MathewsonDate: Mon Oct 31 14:36:15 2016 -0400 Actually free the worker_state_t object when we do an update with it Previously we freed the old "keys" object, but leaked the worker_state_t that we had taken it from. Fixes bug 20401; bugfix on 0.2.6.3-alpha. --- changes/bug20401 | 4 src/or/cpuworker.c | 1 + 2 files changed, 5 insertions(+) diff --git a/changes/bug20401 b/changes/bug20401 new file mode 100644 index 000..85ab3c7 --- /dev/null +++ b/changes/bug20401 @@ -0,0 +1,4 @@ + o Minor bugfixes (relay): +- Avoid a small memory leak when informing worker threads about rotated + onion keys. Fixes bug 20401; bugfix on 0.2.6.3-alpha. + diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 26bc54b..fd6de6e 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -168,6 +168,7 @@ update_state_threadfn(void *state_, void *work_) server_onion_keys_free(state->onion_keys); state->onion_keys = update->onion_keys; update->onion_keys = NULL; + worker_state_free(update); ++state->generation; return WQ_RPL_REPLY; } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/maint-0.2.9] Merge branch 'bug19968_029' into maint-0.2.9
commit e712b5d784db912f7924f090b91125aa6bcf Merge: 24b7b92 becc957 Author: Nick MathewsonDate: Mon Oct 31 16:33:03 2016 -0400 Merge branch 'bug19968_029' into maint-0.2.9 changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Actually clamp the number of detected CPUs to 16.
commit becc95783979cf1879e6390aad80781d0ce3ea66 Author: Nick MathewsonDate: Mon Oct 31 14:19:39 2016 -0400 Actually clamp the number of detected CPUs to 16. Previously we said we did, but didn't. Fixes #19968; bugfix on 0.2.3.1-alpha. --- changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) diff --git a/changes/bug19968 b/changes/bug19968 new file mode 100644 index 000..b285706 --- /dev/null +++ b/changes/bug19968 @@ -0,0 +1,11 @@ + o Minor bugfixes (relay): +- Do not try to parallelize workers more than 16x without the + user explicitly configuring us to do so, even if we do detect more than + 16 CPU cores. Fixes bug 19968; bugfix on + 0.2.3.1-alpha. + + + o Minor bugfixes (testing): +- Avoid a unit test failure on systems with over 16 detectable + CPU cores. Fixes bug 19968; bugfix on + 0.2.3.1-alpha. diff --git a/src/common/compat.c b/src/common/compat.c index 3fde2b3..4f2f977 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2818,6 +2818,7 @@ compute_num_cpus(void) "will not autodetect any more than %d, though. If you " "want to configure more, set NumCPUs in your torrc", num_cpus, MAX_DETECTABLE_CPUS); + num_cpus = MAX_DETECTABLE_CPUS; /* LCOV_EXCL_STOP */ } } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/release-0.2.9] Actually clamp the number of detected CPUs to 16.
commit becc95783979cf1879e6390aad80781d0ce3ea66 Author: Nick MathewsonDate: Mon Oct 31 14:19:39 2016 -0400 Actually clamp the number of detected CPUs to 16. Previously we said we did, but didn't. Fixes #19968; bugfix on 0.2.3.1-alpha. --- changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) diff --git a/changes/bug19968 b/changes/bug19968 new file mode 100644 index 000..b285706 --- /dev/null +++ b/changes/bug19968 @@ -0,0 +1,11 @@ + o Minor bugfixes (relay): +- Do not try to parallelize workers more than 16x without the + user explicitly configuring us to do so, even if we do detect more than + 16 CPU cores. Fixes bug 19968; bugfix on + 0.2.3.1-alpha. + + + o Minor bugfixes (testing): +- Avoid a unit test failure on systems with over 16 detectable + CPU cores. Fixes bug 19968; bugfix on + 0.2.3.1-alpha. diff --git a/src/common/compat.c b/src/common/compat.c index 3fde2b3..4f2f977 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2818,6 +2818,7 @@ compute_num_cpus(void) "will not autodetect any more than %d, though. If you " "want to configure more, set NumCPUs in your torrc", num_cpus, MAX_DETECTABLE_CPUS); + num_cpus = MAX_DETECTABLE_CPUS; /* LCOV_EXCL_STOP */ } } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Merge branch 'bug19968_029' into maint-0.2.9
commit e712b5d784db912f7924f090b91125aa6bcf Merge: 24b7b92 becc957 Author: Nick MathewsonDate: Mon Oct 31 16:33:03 2016 -0400 Merge branch 'bug19968_029' into maint-0.2.9 changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/release-0.2.9] Merge branch 'bug19968_029' into maint-0.2.9
commit e712b5d784db912f7924f090b91125aa6bcf Merge: 24b7b92 becc957 Author: Nick MathewsonDate: Mon Oct 31 16:33:03 2016 -0400 Merge branch 'bug19968_029' into maint-0.2.9 changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/maint-0.2.9] Actually clamp the number of detected CPUs to 16.
commit becc95783979cf1879e6390aad80781d0ce3ea66 Author: Nick MathewsonDate: Mon Oct 31 14:19:39 2016 -0400 Actually clamp the number of detected CPUs to 16. Previously we said we did, but didn't. Fixes #19968; bugfix on 0.2.3.1-alpha. --- changes/bug19968| 11 +++ src/common/compat.c | 1 + 2 files changed, 12 insertions(+) diff --git a/changes/bug19968 b/changes/bug19968 new file mode 100644 index 000..b285706 --- /dev/null +++ b/changes/bug19968 @@ -0,0 +1,11 @@ + o Minor bugfixes (relay): +- Do not try to parallelize workers more than 16x without the + user explicitly configuring us to do so, even if we do detect more than + 16 CPU cores. Fixes bug 19968; bugfix on + 0.2.3.1-alpha. + + + o Minor bugfixes (testing): +- Avoid a unit test failure on systems with over 16 detectable + CPU cores. Fixes bug 19968; bugfix on + 0.2.3.1-alpha. diff --git a/src/common/compat.c b/src/common/compat.c index 3fde2b3..4f2f977 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2818,6 +2818,7 @@ compute_num_cpus(void) "will not autodetect any more than %d, though. If you " "want to configure more, set NumCPUs in your torrc", num_cpus, MAX_DETECTABLE_CPUS); + num_cpus = MAX_DETECTABLE_CPUS; /* LCOV_EXCL_STOP */ } } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [torspec/master] Add DirPort url for retrieving the microdescriptor consensus
commit e788b8fc0afa03ed1e702bdbf258569590878ddf Author: Damian JohnsonDate: Mon Oct 31 16:18:10 2016 -0700 Add DirPort url for retrieving the microdescriptor consensus Neat! Turns out tor supports this, just wasn't documented... https://trac.torproject.org/projects/tor/ticket/20501#comment:5 --- dir-spec.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dir-spec.txt b/dir-spec.txt index 6400947..2417dd0 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -3398,6 +3398,9 @@ B. General-use HTTP URLs The most recent v3 consensus should be available at: http:///tor/status-vote/current/consensus.z + Similarly, the v3 microdescriptor consensus should be available at: + http:///tor/status-vote/current/consensus-microdesc.z + Starting with Tor version 0.2.1.1-alpha is also available at: http:///tor/status-vote/current/consensus/++.z @@ -3504,9 +3507,6 @@ B. General-use HTTP URLs fingerprints. Servers MUST accept both upper and lower case fingerprints in requests. - [XXX Add new URLs for microdescriptors, consensus flavors, and - microdescriptor consensus. -KL] - C. Converting a curve25519 public key to an ed25519 public key Given a curve25519 x-coordinate (u), we can get the y coordinate ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor-messenger-build/master] Add a patch for bugzilla 1313137
commit b24c72c3ecdde17daccb0337f2a727deeb09eede Author: Arlo BreaultDate: Mon Oct 31 17:11:25 2016 -0700 Add a patch for bugzilla 1313137 * Irc "msg is not defined" error --- ChangeLog | 1 + .../0001-Set-Tor-Messenger-preferences.patch | 4 +-- ...0002-Trac-16489-Prevent-account-autologin.patch | 4 +-- ...Support-Special-Characters-input-prompt-o.patch | 4 +-- ...Better-error-reporting-for-failed-outgoin.patch | 4 +-- .../0005-Trac-13312-OTR-over-Twitter-DMs.patch | 4 +-- ...-Fix-tab-strip-background-colour-on-OS-X..patch | 4 +-- ...-XMPP-createConversation-should-handle-in.patch | 4 +-- ...-Set-_userVCard-own-property-when-downloa.patch | 4 +-- .../0009-XMPP-in-band-registration.patch | 4 +-- .../instantbird/0010-Remove-search-from-UI.patch | 4 +-- .../0011-Add-Tor-Messenger-branding.patch | 4 +-- projects/instantbird/0012-Account-picture.patch| 4 +-- .../0013-Modify-protocol-defaults.patch| 4 +-- .../instantbird/0014-Modify-IRC-defaults.patch | 4 +-- projects/instantbird/0015-Modify-themes.patch | 4 +-- .../instantbird/0016-Modify-XMPP-defaults.patch| 4 +-- projects/instantbird/0017-Remove-logging-UI.patch | 4 +-- projects/instantbird/0018-Cert-override.patch | 4 +-- .../0019-Display-all-traffic-over-Tor.patch| 4 +-- .../instantbird/0020-Trac-17480-Content-sink.patch | 4 +-- .../0021-SASL-ECDSA-NIST256P-CHALLENGE.patch | 4 +-- ...-msg-is-not-defined-error-in-irc.js-chang.patch | 29 ++ projects/instantbird/config| 1 + 24 files changed, 73 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54d8dcf..b529abd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Tor Messenger 0.3.0b1 -- * Trac 17480: Make url linkification toggleable * Update ctypes-otr to 00e4e80a * Trac 20231: Remove incomplete translations + * Fix irc "msg is not defined" error (bugzilla 1313137) * Mac * Trac 20206: Avoid prompting to download font "Osaka" on macOS Sierra * Trac 20204: Windows don't drag on macOS Sierra diff --git a/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch b/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch index cb2ac47..a99fa26 100644 --- a/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch +++ b/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch @@ -1,7 +1,7 @@ From bfa4576ff8e6291a0cd293e05ac48b2a91c6a3c1 Mon Sep 17 00:00:00 2001 From: Sukhbir Singh Date: Mon, 10 Oct 2016 19:48:41 -0700 -Subject: [PATCH 01/21] Set Tor Messenger preferences +Subject: [PATCH 01/22] Set Tor Messenger preferences --- im/app/profile/all-instantbird.js | 110 +++--- @@ -197,5 +197,5 @@ index b7a3970..eb1423f 100644 +// Put conversations on hold so that OTR disconnect is not sent. See #20208. +pref("messenger.conversations.holdByDefault", true); -- -2.10.1 +2.10.2 diff --git a/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch b/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch index df7e4c5..84b7c3c 100644 --- a/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch +++ b/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch @@ -1,7 +1,7 @@ From 2f9785b7fb8fba1dae99f914a7500bac41d4a17b Mon Sep 17 00:00:00 2001 From: Arlo Breault Date: Mon, 16 Nov 2015 20:37:53 -0800 -Subject: [PATCH 02/21] Trac 16489: Prevent account autologin +Subject: [PATCH 02/22] Trac 16489: Prevent account autologin --- chat/components/src/imAccounts.js | 2 +- @@ -117,5 +117,5 @@ index e5f7fb6..5e0024d 100644 -- -2.10.1 +2.10.2 diff --git a/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch b/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch index c801890..2b32591 100644 --- a/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch +++ b/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch @@ -1,7 +1,7 @@ From fa84f77e4b3c3091aec5a479f862aa8cdb12de6a Mon Sep 17 00:00:00 2001 From: aleth Date: Sat, 30 Jan 2016 20:56:38 +0100 -Subject: [PATCH 03/21] Trac 17896: Support "Special Characters" input prompt +Subject: [PATCH 03/22] Trac 17896: Support "Special Characters" input prompt on OS X * Bug 1151784 - Add Edit menu to the conversation window on OS X. r=nhnt11,florian @@ -74,5 +74,5 @@ index 30aeb1f..14fc9e8 100644 -- -2.10.1 +2.10.2 diff --git a/projects/instantbird/0004-Trac-17494-Better-error-reporting-for-failed-outgoin.patch b/projects/instantbird/0004-Trac-17494-Better-error-reporting-for-failed-outgoin.patch index 1623b06..cc8b392 100644 ---
[tor-commits] [tor/master] Make trunnel find files recursively
commit 0ba3444b4a9d408573a442b32be794a78b9250b5 Author: David GouletDate: Thu Sep 1 10:07:41 2016 -0400 Make trunnel find files recursively Signed-off-by: David Goulet --- scripts/codegen/run_trunnel.sh | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/codegen/run_trunnel.sh b/scripts/codegen/run_trunnel.sh index d266993..c574ea8 100755 --- a/scripts/codegen/run_trunnel.sh +++ b/scripts/codegen/run_trunnel.sh @@ -5,7 +5,11 @@ if test "x$TRUNNEL_PATH" != "x"; then export PYTHONPATH fi -python -m trunnel --require-version=1.4 ./src/trunnel/*.trunnel +# Get all .trunnel files recursively from that directory so we can support +# multiple sub-directories. +for file in `find ./src/trunnel/ -name '*.trunnel'`; do + python -m trunnel --require-version=1.4 $file +done python -m trunnel --require-version=1.4 --write-c-files --target-dir=./src/ext/trunnel/ ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] prop224: Add INTRODUCE1 and INTRODUCE_ACK trunnel definition
commit 0fa671843e16f8e64c869726dc2cf3ffb206042a Author: David GouletDate: Mon Aug 29 15:31:38 2016 -0400 prop224: Add INTRODUCE1 and INTRODUCE_ACK trunnel definition Signed-off-by: David Goulet --- src/trunnel/hs/cell_introduce1.c | 1345 src/trunnel/hs/cell_introduce1.h | 493 src/trunnel/hs/cell_introduce1.trunnel | 60 ++ src/trunnel/include.am |6 +- 4 files changed, 1902 insertions(+), 2 deletions(-) diff --git a/src/trunnel/hs/cell_introduce1.c b/src/trunnel/hs/cell_introduce1.c new file mode 100644 index 000..d327ea8 --- /dev/null +++ b/src/trunnel/hs/cell_introduce1.c @@ -0,0 +1,1345 @@ +/* cell_introduce1.c -- generated by Trunnel v1.5. + * https://gitweb.torproject.org/trunnel.git + * You probably shouldn't edit this file. + */ +#include +#include "trunnel-impl.h" + +#include "cell_introduce1.h" + +#define TRUNNEL_SET_ERROR_CODE(obj) \ + do { \ +(obj)->trunnel_error_code_ = 1; \ + } while (0) + +#if defined(__COVERITY__) || defined(__clang_analyzer__) +/* If we're runnning a static analysis tool, we don't want it to complain + * that some of our remaining-bytes checks are dead-code. */ +int cellintroduce_deadcode_dummy__ = 0; +#define OR_DEADCODE_DUMMY || cellintroduce_deadcode_dummy__ +#else +#define OR_DEADCODE_DUMMY +#endif + +#define CHECK_REMAINING(nbytes, label) \ + do { \ +if (remaining < (nbytes) OR_DEADCODE_DUMMY) {\ + goto label;\ +}\ + } while (0) + +typedef struct cell_extension_st cell_extension_t; +cell_extension_t *cell_extension_new(void); +void cell_extension_free(cell_extension_t *victim); +ssize_t cell_extension_parse(cell_extension_t **output, const uint8_t *input, const size_t len_in); +ssize_t cell_extension_encoded_len(const cell_extension_t *obj); +ssize_t cell_extension_encode(uint8_t *output, size_t avail, const cell_extension_t *input); +const char *cell_extension_check(const cell_extension_t *obj); +int cell_extension_clear_errors(cell_extension_t *obj); +typedef struct link_specifier_st link_specifier_t; +link_specifier_t *link_specifier_new(void); +void link_specifier_free(link_specifier_t *victim); +ssize_t link_specifier_parse(link_specifier_t **output, const uint8_t *input, const size_t len_in); +ssize_t link_specifier_encoded_len(const link_specifier_t *obj); +ssize_t link_specifier_encode(uint8_t *output, size_t avail, const link_specifier_t *input); +const char *link_specifier_check(const link_specifier_t *obj); +int link_specifier_clear_errors(link_specifier_t *obj); +hs_cell_introduce1_t * +hs_cell_introduce1_new(void) +{ + hs_cell_introduce1_t *val = trunnel_calloc(1, sizeof(hs_cell_introduce1_t)); + if (NULL == val) +return NULL; + return val; +} + +/** Release all storage held inside 'obj', but do not free 'obj'. + */ +static void +hs_cell_introduce1_clear(hs_cell_introduce1_t *obj) +{ + (void) obj; + TRUNNEL_DYNARRAY_WIPE(>auth_key); + TRUNNEL_DYNARRAY_CLEAR(>auth_key); + cell_extension_free(obj->extensions); + obj->extensions = NULL; + TRUNNEL_DYNARRAY_WIPE(>encrypted); + TRUNNEL_DYNARRAY_CLEAR(>encrypted); +} + +void +hs_cell_introduce1_free(hs_cell_introduce1_t *obj) +{ + if (obj == NULL) +return; + hs_cell_introduce1_clear(obj); + trunnel_memwipe(obj, sizeof(hs_cell_introduce1_t)); + trunnel_free_(obj); +} + +size_t +hs_cell_introduce1_getlen_legacy_key_id(const hs_cell_introduce1_t *inp) +{ + (void)inp; return TRUNNEL_SHA1_LEN; +} + +uint8_t +hs_cell_introduce1_get_legacy_key_id(hs_cell_introduce1_t *inp, size_t idx) +{ + trunnel_assert(idx < TRUNNEL_SHA1_LEN); + return inp->legacy_key_id[idx]; +} + +uint8_t +hs_cell_introduce1_getconst_legacy_key_id(const hs_cell_introduce1_t *inp, size_t idx) +{ + return hs_cell_introduce1_get_legacy_key_id((hs_cell_introduce1_t*)inp, idx); +} +int +hs_cell_introduce1_set_legacy_key_id(hs_cell_introduce1_t *inp, size_t idx, uint8_t elt) +{ + trunnel_assert(idx < TRUNNEL_SHA1_LEN); + inp->legacy_key_id[idx] = elt; + return 0; +} + +uint8_t * +hs_cell_introduce1_getarray_legacy_key_id(hs_cell_introduce1_t *inp) +{ + return inp->legacy_key_id; +} +const uint8_t * +hs_cell_introduce1_getconstarray_legacy_key_id(const hs_cell_introduce1_t *inp) +{ + return (const uint8_t *)hs_cell_introduce1_getarray_legacy_key_id((hs_cell_introduce1_t*)inp); +} +uint8_t +hs_cell_introduce1_get_auth_key_type(hs_cell_introduce1_t *inp) +{ + return inp->auth_key_type; +} +int +hs_cell_introduce1_set_auth_key_type(hs_cell_introduce1_t *inp, uint8_t val) +{ + if (! ((val == 0 || val == 1 || val == 2))) { + TRUNNEL_SET_ERROR_CODE(inp); + return -1; + } + inp->auth_key_type = val; +
[tor-commits] [tor/master] Re-run trunnel.
commit 1d76d389033e09645ff746c2d2c449ea5af098a3 Author: Nick MathewsonDate: Mon Oct 31 16:25:34 2016 -0400 Re-run trunnel. --- src/trunnel/hs/cell_introduce1.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/trunnel/hs/cell_introduce1.c b/src/trunnel/hs/cell_introduce1.c index d327ea8..51f5676 100644 --- a/src/trunnel/hs/cell_introduce1.c +++ b/src/trunnel/hs/cell_introduce1.c @@ -733,6 +733,7 @@ hs_cell_introduce_encrypted_new(void) hs_cell_introduce_encrypted_t *val = trunnel_calloc(1, sizeof(hs_cell_introduce_encrypted_t)); if (NULL == val) return NULL; + val->onion_key_type = 1; return val; } @@ -836,6 +837,10 @@ hs_cell_introduce_encrypted_get_onion_key_type(hs_cell_introduce_encrypted_t *in int hs_cell_introduce_encrypted_set_onion_key_type(hs_cell_introduce_encrypted_t *inp, uint8_t val) { + if (! ((val == 1))) { + TRUNNEL_SET_ERROR_CODE(inp); + return -1; + } inp->onion_key_type = val; return 0; } @@ -1074,6 +1079,8 @@ hs_cell_introduce_encrypted_check(const hs_cell_introduce_encrypted_t *obj) if (NULL != (msg = cell_extension_check(obj->extensions))) return msg; } + if (! (obj->onion_key_type == 1)) +return "Integer out of bounds"; if (TRUNNEL_DYNARRAY_LEN(>onion_key) != obj->onion_key_len) return "Length mismatch for onion_key"; { @@ -1105,7 +1112,7 @@ hs_cell_introduce_encrypted_encoded_len(const hs_cell_introduce_encrypted_t *obj /* Length of struct cell_extension extensions */ result += cell_extension_encoded_len(obj->extensions); - /* Length of u8 onion_key_type */ + /* Length of u8 onion_key_type IN [1] */ result += 1; /* Length of u16 onion_key_len */ @@ -1169,7 +1176,7 @@ hs_cell_introduce_encrypted_encode(uint8_t *output, const size_t avail, const hs goto fail; /* XXX !*/ written += result; ptr += result; - /* Encode u8 onion_key_type */ + /* Encode u8 onion_key_type IN [1] */ trunnel_assert(written <= avail); if (avail - written < 1) goto truncated; @@ -1273,10 +1280,12 @@ hs_cell_introduce_encrypted_parse_into(hs_cell_introduce_encrypted_t *obj, const trunnel_assert((size_t)result <= remaining); remaining -= result; ptr += result; - /* Parse u8 onion_key_type */ + /* Parse u8 onion_key_type IN [1] */ CHECK_REMAINING(1, truncated); obj->onion_key_type = (trunnel_get_uint8(ptr)); remaining -= 1; ptr += 1; + if (! (obj->onion_key_type == 1)) +goto fail; /* Parse u16 onion_key_len */ CHECK_REMAINING(2, truncated); @@ -1327,6 +1336,9 @@ hs_cell_introduce_encrypted_parse_into(hs_cell_introduce_encrypted_t *obj, const return result; trunnel_alloc_failed: return -1; + fail: + result = -1; + return result; } ssize_t ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] prop224: Add ESTABLISH_INTRO and INTRO_ESTABLISHED trunnel definition
commit f22eb2730cccab44de579c64ba2386a94abef0fa Author: David GouletDate: Mon Aug 29 15:28:58 2016 -0400 prop224: Add ESTABLISH_INTRO and INTRO_ESTABLISHED trunnel definition Signed-off-by: David Goulet --- src/trunnel/hs/cell_common.c| 594 ++ src/trunnel/hs/cell_common.h| 198 src/trunnel/hs/cell_common.trunnel | 12 + src/trunnel/hs/cell_establish_intro.c | 735 src/trunnel/hs/cell_establish_intro.h | 275 +++ src/trunnel/hs/cell_establish_intro.trunnel | 41 ++ src/trunnel/include.am | 13 +- 7 files changed, 1863 insertions(+), 5 deletions(-) diff --git a/src/trunnel/hs/cell_common.c b/src/trunnel/hs/cell_common.c new file mode 100644 index 000..c6c610d --- /dev/null +++ b/src/trunnel/hs/cell_common.c @@ -0,0 +1,594 @@ +/* cell_common.c -- generated by Trunnel v1.5. + * https://gitweb.torproject.org/trunnel.git + * You probably shouldn't edit this file. + */ +#include +#include "trunnel-impl.h" + +#include "cell_common.h" + +#define TRUNNEL_SET_ERROR_CODE(obj) \ + do { \ +(obj)->trunnel_error_code_ = 1; \ + } while (0) + +#if defined(__COVERITY__) || defined(__clang_analyzer__) +/* If we're runnning a static analysis tool, we don't want it to complain + * that some of our remaining-bytes checks are dead-code. */ +int cellcommon_deadcode_dummy__ = 0; +#define OR_DEADCODE_DUMMY || cellcommon_deadcode_dummy__ +#else +#define OR_DEADCODE_DUMMY +#endif + +#define CHECK_REMAINING(nbytes, label) \ + do { \ +if (remaining < (nbytes) OR_DEADCODE_DUMMY) {\ + goto label;\ +}\ + } while (0) + +cell_extension_fields_t * +cell_extension_fields_new(void) +{ + cell_extension_fields_t *val = trunnel_calloc(1, sizeof(cell_extension_fields_t)); + if (NULL == val) +return NULL; + return val; +} + +/** Release all storage held inside 'obj', but do not free 'obj'. + */ +static void +cell_extension_fields_clear(cell_extension_fields_t *obj) +{ + (void) obj; + TRUNNEL_DYNARRAY_WIPE(>field); + TRUNNEL_DYNARRAY_CLEAR(>field); +} + +void +cell_extension_fields_free(cell_extension_fields_t *obj) +{ + if (obj == NULL) +return; + cell_extension_fields_clear(obj); + trunnel_memwipe(obj, sizeof(cell_extension_fields_t)); + trunnel_free_(obj); +} + +uint8_t +cell_extension_fields_get_field_type(cell_extension_fields_t *inp) +{ + return inp->field_type; +} +int +cell_extension_fields_set_field_type(cell_extension_fields_t *inp, uint8_t val) +{ + inp->field_type = val; + return 0; +} +uint8_t +cell_extension_fields_get_field_len(cell_extension_fields_t *inp) +{ + return inp->field_len; +} +int +cell_extension_fields_set_field_len(cell_extension_fields_t *inp, uint8_t val) +{ + inp->field_len = val; + return 0; +} +size_t +cell_extension_fields_getlen_field(const cell_extension_fields_t *inp) +{ + return TRUNNEL_DYNARRAY_LEN(>field); +} + +uint8_t +cell_extension_fields_get_field(cell_extension_fields_t *inp, size_t idx) +{ + return TRUNNEL_DYNARRAY_GET(>field, idx); +} + +uint8_t +cell_extension_fields_getconst_field(const cell_extension_fields_t *inp, size_t idx) +{ + return cell_extension_fields_get_field((cell_extension_fields_t*)inp, idx); +} +int +cell_extension_fields_set_field(cell_extension_fields_t *inp, size_t idx, uint8_t elt) +{ + TRUNNEL_DYNARRAY_SET(>field, idx, elt); + return 0; +} +int +cell_extension_fields_add_field(cell_extension_fields_t *inp, uint8_t elt) +{ +#if SIZE_MAX >= UINT8_MAX + if (inp->field.n_ == UINT8_MAX) +goto trunnel_alloc_failed; +#endif + TRUNNEL_DYNARRAY_ADD(uint8_t, >field, elt, {}); + return 0; + trunnel_alloc_failed: + TRUNNEL_SET_ERROR_CODE(inp); + return -1; +} + +uint8_t * +cell_extension_fields_getarray_field(cell_extension_fields_t *inp) +{ + return inp->field.elts_; +} +const uint8_t * +cell_extension_fields_getconstarray_field(const cell_extension_fields_t *inp) +{ + return (const uint8_t *)cell_extension_fields_getarray_field((cell_extension_fields_t*)inp); +} +int +cell_extension_fields_setlen_field(cell_extension_fields_t *inp, size_t newlen) +{ + uint8_t *newptr; +#if UINT8_MAX < SIZE_MAX + if (newlen > UINT8_MAX) +goto trunnel_alloc_failed; +#endif + newptr = trunnel_dynarray_setlen(>field.allocated_, + >field.n_, inp->field.elts_, newlen, + sizeof(inp->field.elts_[0]), (trunnel_free_fn_t) NULL, + >trunnel_error_code_); + if (newlen != 0 && newptr == NULL) +goto trunnel_alloc_failed; + inp->field.elts_ = newptr; + return 0; + trunnel_alloc_failed: + TRUNNEL_SET_ERROR_CODE(inp); + return -1; +} +const char *
[tor-commits] [tor/maint-0.2.9] Actually free the worker_state_t object when we do an update with it
commit 24b7b922ae9adc814890feae661ad64f474307f3 Author: Nick MathewsonDate: Mon Oct 31 14:36:15 2016 -0400 Actually free the worker_state_t object when we do an update with it Previously we freed the old "keys" object, but leaked the worker_state_t that we had taken it from. Fixes bug 20401; bugfix on 0.2.6.3-alpha. --- changes/bug20401 | 4 src/or/cpuworker.c | 1 + 2 files changed, 5 insertions(+) diff --git a/changes/bug20401 b/changes/bug20401 new file mode 100644 index 000..85ab3c7 --- /dev/null +++ b/changes/bug20401 @@ -0,0 +1,4 @@ + o Minor bugfixes (relay): +- Avoid a small memory leak when informing worker threads about rotated + onion keys. Fixes bug 20401; bugfix on 0.2.6.3-alpha. + diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 26bc54b..fd6de6e 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -168,6 +168,7 @@ update_state_threadfn(void *state_, void *work_) server_onion_keys_free(state->onion_keys); state->onion_keys = update->onion_keys; update->onion_keys = NULL; + worker_state_free(update); ++state->generation; return WQ_RPL_REPLY; } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Actually free the worker_state_t object when we do an update with it
commit 24b7b922ae9adc814890feae661ad64f474307f3 Author: Nick MathewsonDate: Mon Oct 31 14:36:15 2016 -0400 Actually free the worker_state_t object when we do an update with it Previously we freed the old "keys" object, but leaked the worker_state_t that we had taken it from. Fixes bug 20401; bugfix on 0.2.6.3-alpha. --- changes/bug20401 | 4 src/or/cpuworker.c | 1 + 2 files changed, 5 insertions(+) diff --git a/changes/bug20401 b/changes/bug20401 new file mode 100644 index 000..85ab3c7 --- /dev/null +++ b/changes/bug20401 @@ -0,0 +1,4 @@ + o Minor bugfixes (relay): +- Avoid a small memory leak when informing worker threads about rotated + onion keys. Fixes bug 20401; bugfix on 0.2.6.3-alpha. + diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c index 26bc54b..fd6de6e 100644 --- a/src/or/cpuworker.c +++ b/src/or/cpuworker.c @@ -168,6 +168,7 @@ update_state_threadfn(void *state_, void *work_) server_onion_keys_free(state->onion_keys); state->onion_keys = update->onion_keys; update->onion_keys = NULL; + worker_state_free(update); ++state->generation; return WQ_RPL_REPLY; } ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [tor/master] Merge branch 'maint-0.2.9'
commit 59a78187cdf9c48f492e92c3a33ce17b75f7472d Merge: cac495f 24b7b92 Author: Nick MathewsonDate: Mon Oct 31 15:20:45 2016 -0400 Merge branch 'maint-0.2.9' changes/bug20401 | 4 src/or/cpuworker.c | 1 + 2 files changed, 5 insertions(+) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits