Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

ByteStream security fix + new additions, SSU fix + refactoring #810

Merged
merged 10 commits into from Feb 20, 2018

Conversation

anonimal
Copy link
Collaborator

@anonimal anonimal commented Feb 16, 2018


By submitting this pull-request, I confirm the following:

  • I have read and understood the contributor guide in kovri-docs.
  • I have checked that another pull-request for this purpose does not exist.
  • I have considered and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used and that this pull-request may be closed by the will of the maintainer.
  • I give this submission freely under the BSD 3-clause license.

Known issues to be resolved before merging:

  • 1. Ubuntu (gcc 5.4.0-6) unit-tests pass but SIGSEGV because of a cryptopp issue that I will soon open. Cryptopp apparently doesn't like how we construct our internal-buffer for the "stream". I cannot reproduce this issue on Arch (gcc 7.3.0 / clang 5.0.1) but will open an issue upstream regardless. Edit: Buildbot cannot reproduce so I can assume for now that the issue is specific to my personal build machine. Edit: this appears to affect our ARMv7 machine https://build.getmonero.org/builders/kovri-all-ubuntu-arm7/builds/613/steps/test/logs/stdio.
  • 2. Internal-buffer "stream" read test-cases fail on OS X 10.12 Apple LLVM version 8.0.0 (clang-800.0.42.1). I don't know how recently that machine has been updated though since many of our build machines are going out of date, I will open an issue for this too. Edit: opened Buildbot: complete backend software upgrades meta#179.

In all, I'm becoming very irritated with the bytestream implementation / concept as a whole. While #140 has had the best of intentions, the bytestream is building on - and revolving around - previous spaghetti-code pointer concepts rather then a usable, modular, OOP design. The current bytestream design also prevents us from managing memory in a more guaranteed and interoperable way. This issue too must be opened in the issue tracker. Edit: opened #811.

They aren't polluting the namespace yet.
We're no longer using scoped enumerations in SSU.
Allows OutputByteStream to behave more like a sequence container without
the overhead *or* functionality of one. Note that, ultimately, using
containers will produce better-managed code (see the TODOs).
"Skipped" bytes were not properly initialized when writing, so
zero-initialize. We also don't need access to the advancing impl.
and rewrite null-stream test-case.
@anonimal
Copy link
Collaborator Author

I've re-implemented how we handle our internal buffer as well as several interfaces (not yet pushed to this branch, so you'll still see the failed tests above). Doing so fixes the tests on OSX 10.12 (the only OSX machine I have access to because of monero-project/meta#179), should resolve all OSX failed tests (and possibly OpenBSD), and should also resolve the ARMv7 tests segfault (since it fixes the segfault on my aforementioned ubuntu machine).

I'll get the new work pushed sometime within ~24 hours or by Monday.

@anonimal
Copy link
Collaborator Author

All tests + live tests pass. Ready to merge.

@anonimal anonimal merged commit 6f4e0c7 into monero-project:master Feb 20, 2018
anonimal added a commit that referenced this pull request Feb 20, 2018
6f4e0c7 ByteStream: calculate size from length plus counter (anonimal)
b3e3c68 ByteStream: add base input interface + internal vector buffer (anonimal)
9fe1653 SSUSession: fix invalid writing of null padding (anonimal)
8e6989a ByteStream: add asserts + more exception handling (anonimal)
cd34ff1 CMake: fix incorrect setting of C release flags (anonimal)
b215ba6 ByteStream: add new byte skipping interfaces/impls (anonimal)
23871a1 ByteStream: add buffer-less ctor for container-like stream + test-case (anonimal)
92c1d51 ByteStream: rename advancing function as appropriate (anonimal)
7928c3e SSU: remove all calls to get enum underlying type (anonimal)
77e3a1d SSU: remove packet/data scoped enumerations (anonimal)
@anonimal anonimal deleted the ssu branch February 20, 2018 04:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant