GithubHelp home page GithubHelp logo

libernet's People

Contributors

marcpage avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

enigmaro

libernet's Issues

AsymmetricEncrypt should use the macOS specific API

Currently SymmetricEncrypt and Hash use macOS specific API and can use the openssl API and both can be tested on macOS. AsymmetricEncrypt should also have macOS APIs available and should be the default and would allow for code to work without openssl and cross-test between openssl and macOS APIs

  • Create a new RSA key-pair, given a number of bits
  • Serialize RSA public key
  • Deserialize RSA public key
  • Serialize RSA private key
  • Deserialize RSA private key
  • Sign text
  • Verify signed text
  • Public key encrypt
  • Private key decrypt
  • Get public key from private key
  • Test openssl public serialize -> macOS deserialize
  • Test openssl private serialize -> macOS deserialize
  • Test macOS public serialize -> openssl deserialize
  • Test macOS private serialize -> openssl deserialize
  • Test openssl sign -> macOS verify
  • Test macOS sign -> openssl verify
  • Test openssl encrypt -> macOS decrypt
  • Test macOS encrypt -> openssl decrypt

Test URL Query with just a variable name, no value

In tests/HTTP_test.cpp add code that exercises a URL query that has a name, but no value:

http://my.url.com/test.html?name
http://my.url.com/test.html?name=
http://my.url.com/test.html?name=value&nombre
http://my.url.com/test.html?name=value&nombre=

SymmetricEncrypt fails on Linux with openssl error "bad decrypt"

FAILED: Exception: OpenSSL Error (EVP_CipherFinal_ex(context, outBuffer, &bytesWritten)): error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt File: ../os/SymmetricEncrypt.h Line: 216

Steps to reproduce

  • Docker container using latest alpine linux
  • Install the latest packages with apk add: git, g++, clang, make, doxygen, cppcheck, sqlite-dev, openssl-dev, zlib-dev, and compiler-rt-static.
  • Create a symlink at /usr/lib/clang/9.0.0/libclang_rt.profile-x86_64.a to /usr/lib/clang/9.0.0/lib/linux/libclang_rt.profile-x86_64.a
  • git clone https://github.com/marcpage/os.git
  • make TEST=SymmetricEncrypt test

Versions

  • alpine 3.11.6
  • git (2.24.3-r0)
  • g++ (9.2.0-r4)
  • binutils (2.33.1-r0)
  • clang (9.0.0-r1)
  • make (4.2.1-r2)
  • doxygen (1.8.16-r1)
  • cppcheck (1.89-r1)
  • sqlite-dev (3.30.1-r2)
  • openssl-dev (1.1.1g-r0)
  • zlib-dev (1.2.11-r3)
  • compiler-rt-static (9.0.0-r0)
  • ca-certificates (20191127-r1)
  • expat (2.2.9-r1)
  • gcc (9.2.0-r4)
  • gmp (6.1.2-r1)
  • isl (0.18-r0)
  • libatomic (9.2.0-r4)
  • libc-dev (0.7.2-r0)
  • libcurl (7.67.0-r0)
  • libffi (3.2.1-r6)
  • libgcc (9.2.0-r4)
  • libgomp (9.2.0-r4)
  • libstdc++ (9.2.0-r4)
  • libxml2 (2.9.10-r3)
  • llvm9-libs (9.0.0-r1)
  • mpc1 (1.1.0-r1)
  • mpfr4 (4.0.2-r1)
  • musl-dev (1.1.24-r2)
  • nghttp2-libs (1.40.0-r0)
  • pcre (8.43-r0)
  • pcre2 (10.34-r1)
  • pkgconf (1.6.3-r0)
  • sqlite-libs (3.30.1-r2)
  • xz-libs (5.2.4-r0)

Backtrace needs Linux implementation

Get a stack backtrace apparently doesn't work in the linux environment. We need to figure out how to do this for linux.

Steps to reproduce

In BackTrace.h, remove the APPLE conditional around the following code:

#if defined(__APPLE__)
#include <execinfo.h> // not available on Linux?
#define BACKTRACE_AVAILABLE 1
#endif
  • Docker container using latest alpine linux
  • Install the latest packages with apk add: git, g++, clang, make, doxygen, cppcheck, sqlite-dev, openssl-dev, zlib-dev, and compiler-rt-static.
  • Create a symlink at /usr/lib/clang/9.0.0/libclang_rt.profile-x86_64.a to /usr/lib/clang/9.0.0/lib/linux/libclang_rt.profile-x86_64.a
  • git clone https://github.com/marcpage/os.git
  • make TEST=Backtrace test

Versions

  • alpine 3.11.6
  • git (2.24.3-r0)
  • g++ (9.2.0-r4)
  • binutils (2.33.1-r0)
  • clang (9.0.0-r1)
  • make (4.2.1-r2)
  • doxygen (1.8.16-r1)
  • cppcheck (1.89-r1)
  • sqlite-dev (3.30.1-r2)
  • openssl-dev (1.1.1g-r0)
  • zlib-dev (1.2.11-r3)
  • compiler-rt-static (9.0.0-r0)
  • ca-certificates (20191127-r1)
  • expat (2.2.9-r1)
  • gcc (9.2.0-r4)
  • gmp (6.1.2-r1)
  • isl (0.18-r0)
  • libatomic (9.2.0-r4)
  • libc-dev (0.7.2-r0)
  • libcurl (7.67.0-r0)
  • libffi (3.2.1-r6)
  • libgcc (9.2.0-r4)
  • libgomp (9.2.0-r4)
  • libstdc++ (9.2.0-r4)
  • libxml2 (2.9.10-r3)
  • llvm9-libs (9.0.0-r1)
  • mpc1 (1.1.0-r1)
  • mpfr4 (4.0.2-r1)
  • musl-dev (1.1.24-r2)
  • nghttp2-libs (1.40.0-r0)
  • pcre (8.43-r0)
  • pcre2 (10.34-r1)
  • pkgconf (1.6.3-r0)
  • sqlite-libs (3.30.1-r2)
  • xz-libs (5.2.4-r0)

Create tests/Socket_test.cpp

Currently Socket is pretty well tested via tests/SocketServer_test.cpp. However it does not test:

size_t Socket::sendTo(const Address &,const std::string &,size_t, size_t, RoutingOptions,OutOfBandDataOptions)

I believe this method is only used in UDP transactions. So UDP tests would be the contents of this test file.

Add Path::copyAttributesTo

Implement the following method:

void copyAttributesTo(const Path&) const;

This will copy permissions, xattr, ACL, etc. whatever is appropriate for the platform.

Test Library::Library(const char*) with __use_bundles__

Need to add code for the case use_bundles, to test:

Library::Library(const char*)

and pass a bundle basename (ie CoreFoundation.framework, but pass CoreFoundation). Call a function in the framework or bundle.

Also test loading a name that doesn't have a framework or bundle.

Port to Windows

Port makefile, tests/test.cpp, and code changes to get this up and building and running on Windows.

Test json::Value::insert on an Array type

Add code to tests/JSON_test.cpp that will insert a value into a json ArrayType.

json::Value myArray(json::ArrayType);

myArray.insert(json::Value() = "2", 0); // 2
myArray.insert(json::Value() = "0", 0); // 0,2
myArray.insert(json::Value() = "1", 1); // 0,1,2
myArray.insert(json::Value() = "3", 3); // 0,1,2,3

dotest(myArray[0] == (json::Value() = "0"));
dotest(myArray[1] == (json::Value() = "1"));
dotest(myArray[2] == (json::Value() = "2"));
dotest(myArray[3] == (json::Value() = "3"));

Document HTTP.h

There are very few doxygen comments. Document every class method and member.

Move os and protocol into this repo

  • Create src/os and move all headers from os into this directory.
  • Create src/protocol and move all headers from protocol into this directory.
  • Move headers to src/libernet
  • Move os/tests/*.cpp to tests.
  • Move protocol/tests/*.cpp to tests.
  • Modify tests/test.cpp to work with this new directory layout.
  • Move issues from os to libernet
  • Move issues from protocol to libernet
  • Update Makefile to build test.cpp from tests instead of ../os/tests
  • Update Makefile to search in src//.h for todo items

Document JSON.h

There is very little documentation in this file. Document every class, method, and member.

Add methods to MemoryMappedFile to support read/write integer

Similar to io::File read/write integer, using various endians.

template <class Int>
Int MemoryMappedFile::read(off_t &offset, Endian endian) const;
template <class Int>
void write(Int number, off_t &offset, Endian endian);

writes or returns Int of given size at that offset in the file and advances offset to just past the int.

Test failure with locale issue with utf8 on Linux

FAIL: Exception not caught: locale::facet::_S_create_c_locale name not valid

I'm hoping this is just a container configuration issue.
I've looked into building and installing musl-locales, but didn't seem to work.

Steps to reproduce

  • Docker container using latest alpine linux
  • Install the latest packages with apk add: git, g++, clang, make, doxygen, cppcheck, sqlite-dev, openssl-dev, zlib-dev, and compiler-rt-static.
  • Create a symlink at /usr/lib/clang/9.0.0/libclang_rt.profile-x86_64.a to /usr/lib/clang/9.0.0/lib/linux/libclang_rt.profile-x86_64.a
  • git clone https://github.com/marcpage/os.git
  • make TEST=Text test

Versions

  • alpine 3.11.6
  • git (2.24.3-r0)
  • g++ (9.2.0-r4)
  • binutils (2.33.1-r0)
  • clang (9.0.0-r1)
  • make (4.2.1-r2)
  • doxygen (1.8.16-r1)
  • cppcheck (1.89-r1)
  • sqlite-dev (3.30.1-r2)
  • openssl-dev (1.1.1g-r0)
  • zlib-dev (1.2.11-r3)
  • compiler-rt-static (9.0.0-r0)
  • ca-certificates (20191127-r1)
  • expat (2.2.9-r1)
  • gcc (9.2.0-r4)
  • gmp (6.1.2-r1)
  • isl (0.18-r0)
  • libatomic (9.2.0-r4)
  • libc-dev (0.7.2-r0)
  • libcurl (7.67.0-r0)
  • libffi (3.2.1-r6)
  • libgcc (9.2.0-r4)
  • libgomp (9.2.0-r4)
  • libstdc++ (9.2.0-r4)
  • libxml2 (2.9.10-r3)
  • llvm9-libs (9.0.0-r1)
  • mpc1 (1.1.0-r1)
  • mpfr4 (4.0.2-r1)
  • musl-dev (1.1.24-r2)
  • nghttp2-libs (1.40.0-r0)
  • pcre (8.43-r0)
  • pcre2 (10.34-r1)
  • pkgconf (1.6.3-r0)
  • sqlite-libs (3.30.1-r2)
  • xz-libs (5.2.4-r0)

AddressHistory::_changeContent performance improvement

When we are calculating the padding for AddressHistory so that it matches the hash of the address, we are unnecessarily converting from JSON to string every time. We could set the padding to a unique value that is not found elsewhere in the formatted string. We can then just search and replace the unique number with random numbers so we don't have to execute all that code to convert json to string for each iteration.

Library test fails to load zlib library on Linux

This may be a docker container configuration issue, or the path may be incorrect. The test may need to change to point to the correct install location for libz.

FAILED: EXCEPTION(libz.dylib:zlibVersion): (found) failed:Unable to open library: /usr/lib/libz.so File: ../os/Library.h Line: 227

Steps to reproduce

  • Docker container using latest alpine linux
  • Install the latest packages with apk add: git, g++, clang, make, doxygen, cppcheck, sqlite-dev, openssl-dev, zlib-dev, and compiler-rt-static.
  • Create a symlink at /usr/lib/clang/9.0.0/libclang_rt.profile-x86_64.a to /usr/lib/clang/9.0.0/lib/linux/libclang_rt.profile-x86_64.a
  • git clone https://github.com/marcpage/os.git
  • make TEST=Library test

Versions

  • alpine 3.11.6
  • git (2.24.3-r0)
  • g++ (9.2.0-r4)
  • binutils (2.33.1-r0)
  • clang (9.0.0-r1)
  • make (4.2.1-r2)
  • doxygen (1.8.16-r1)
  • cppcheck (1.89-r1)
  • sqlite-dev (3.30.1-r2)
  • openssl-dev (1.1.1g-r0)
  • zlib-dev (1.2.11-r3)
  • compiler-rt-static (9.0.0-r0)
  • ca-certificates (20191127-r1)
  • expat (2.2.9-r1)
  • gcc (9.2.0-r4)
  • gmp (6.1.2-r1)
  • isl (0.18-r0)
  • libatomic (9.2.0-r4)
  • libc-dev (0.7.2-r0)
  • libcurl (7.67.0-r0)
  • libffi (3.2.1-r6)
  • libgcc (9.2.0-r4)
  • libgomp (9.2.0-r4)
  • libstdc++ (9.2.0-r4)
  • libxml2 (2.9.10-r3)
  • llvm9-libs (9.0.0-r1)
  • mpc1 (1.1.0-r1)
  • mpfr4 (4.0.2-r1)
  • musl-dev (1.1.24-r2)
  • nghttp2-libs (1.40.0-r0)
  • pcre (8.43-r0)
  • pcre2 (10.34-r1)
  • pkgconf (1.6.3-r0)
  • sqlite-libs (3.30.1-r2)
  • xz-libs (5.2.4-r0)

Path test fails on Linux with Invalid argument while reading a directory

FAILED: Exception: [EINVAL (22): Invalid argument]: ep = ::readdir(dp) File: ../os/Path.h Line: 553

Steps to reproduce

  • Docker container using latest alpine linux
  • Install the latest packages with apk add: git, g++, clang, make, doxygen, cppcheck, sqlite-dev, openssl-dev, zlib-dev, and compiler-rt-static.
  • Create a symlink at /usr/lib/clang/9.0.0/libclang_rt.profile-x86_64.a to /usr/lib/clang/9.0.0/lib/linux/libclang_rt.profile-x86_64.a
  • git clone https://github.com/marcpage/os.git
  • make TEST=Path test

Versions

  • alpine 3.11.6
  • git (2.24.3-r0)
  • g++ (9.2.0-r4)
  • binutils (2.33.1-r0)
  • clang (9.0.0-r1)
  • make (4.2.1-r2)
  • doxygen (1.8.16-r1)
  • cppcheck (1.89-r1)
  • sqlite-dev (3.30.1-r2)
  • openssl-dev (1.1.1g-r0)
  • zlib-dev (1.2.11-r3)
  • compiler-rt-static (9.0.0-r0)
  • ca-certificates (20191127-r1)
  • expat (2.2.9-r1)
  • gcc (9.2.0-r4)
  • gmp (6.1.2-r1)
  • isl (0.18-r0)
  • libatomic (9.2.0-r4)
  • libc-dev (0.7.2-r0)
  • libcurl (7.67.0-r0)
  • libffi (3.2.1-r6)
  • libgcc (9.2.0-r4)
  • libgomp (9.2.0-r4)
  • libstdc++ (9.2.0-r4)
  • libxml2 (2.9.10-r3)
  • llvm9-libs (9.0.0-r1)
  • mpc1 (1.1.0-r1)
  • mpfr4 (4.0.2-r1)
  • musl-dev (1.1.24-r2)
  • nghttp2-libs (1.40.0-r0)
  • pcre (8.43-r0)
  • pcre2 (10.34-r1)
  • pkgconf (1.6.3-r0)
  • sqlite-libs (3.30.1-r2)
  • xz-libs (5.2.4-r0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.