commit | 5dac0e701ee58f150c717c5e287bc8fd74a37f10 | [log] [tgz] |
---|---|---|
author | Jim Schaad <ietf@augustcellars.com> | Wed May 20 13:58:30 2020 -0700 |
committer | GitHub <noreply@github.com> | Wed May 20 13:58:30 2020 -0700 |
tree | 1b28bce88f3b411c73c3c5bd9c5e2fdd59674335 | |
parent | c199b185ce62179e978f2379821543897aa55d29 [diff] |
Add CounterSign1 to code base (#117) * Add CounterSign0 to code base * Fix compiler errors * Fix context compiler issues * Fix testing errors * Fix 2 compiler errors and a crash * See if the crashes go away * More bug fixes * It would be nice if both compilers look at this the same * Update SignerInfo.cpp stupid gcc compiler. does not actually do this right * More memory leak checks * Fix bug correct free code * Deal with counterisign1 issues * Context needs to be ifdef dependent * Remove unused function call * Allocation failures * Fix errors from new test cases * Correct building COSE from EC key for OpenSSL * Update build scripts Build countersign1 on appveyor and github Correct the path from the countersign1 rename in cmake. * Increase coverage * FIx apveyor build script * Add countersign1 testing to Sign1
This project is a C implementation of the IETF CBOR Encoded Message Syntax (COSE). COSE has reached RFC status and is now available at RFC 8152.
In addition to the core document the following have also become RFCs:
The project is using the CN-CBOR project to provide an implementation of the Concise Binary Object Representation or CBOR.
The project is setup to use two different cryptographic
Go ahead, file issues, make pull requests.
before committing changes, run ./scripts/format_cmake.sh
and ./scripts/format_source.sh
The project is setup to build using CMake. The way that the CMake files are setup, it requires that version 3.0 or higher is used.
The project requires the use of cn-cbor(https://github.com/jimsch/cn-cbor) in order to build. While this is based on the original version at (https://github.com/cabo/cn-cbor) there have been several updates to this version which have not been reflected in the base library. The CMake configuration files will automatically pull down the correct version when run.
Building:
mkdir build cd build cmake .. cmake --build . # if user wants to install sudo cmake --build . --target install
Consuming via cmake find_package (after installation):
find_package(cose-c REQUIRED) add_executable(mytarget main.cpp) target_link_libraries(mytarget cose-c::cose-c)
Consuming via cmake add_subdirectory (e.g. as a submodule):
add_subdirectory(vendor/cose-c) add_executable(mytarget main.cpp) target_link_libraries(mytarget cose-c::cose-c)
Consuming via conan package: add cose-c/[>=20200417]
to your conanfile.txt
add_executable(mytarget main.cpp) target_link_libraries(mytarget cose-c::cose-c)
The memory model used in this library is a mess. This is in large part because the memory model of cn-cbor is still poorly understood.
There are three different memory models that can be used with cn-cbor and cose-c, at this time only one of them is going to produce good results for long running systems.
The cn-cbor project was built with a specific memory model, but did not limit itself to that memory model when writing the code. It was originally designed for working on small devices that use a block allocator with sub-allocations done from that allocated block. This allows for all of the items allocated in that large block to be freed in a single operation when everything is done.
Build without USE_CONTEXT: This model uses standard calloc/free and suffers from the cn-cbor memory model problems.
Build with USE_CONTEXT and pass in NULL: This model is equivalent to the previous configuration.
Build with USE_CONTEXT and pass in a block allocator: This model works, but requires that you provide the allocator.