Releases: laurencelundblade/QCBOR
QCBOR 2.0 alpha 3
A relatively small release, but t_cose 2.0 needs the correct error codes for GetByteString()
- Fix error code returned by QCBORDecode_GetTextString() and QCBORDecode_GetByteString()
- Improve testing for QCBORDecode_GetTextString() and QCBORDecode_GetByteString()
- Add link to QCBOR documentation website in all header files
- Improve tag decoding documentation
QCBOR v2 alpha 2
Update version numbers to v2.0 (really dumb mistake for not getting this into alpha 1)
README fixes
EnterBstr() gives correct error when called on something that is not a bstr
New #define QCBOR_MAX_SIZE that is the max size in bytes for both the encoded output and input to be decoded. The size
isn't changed, still just below UINT32_MAX, but there is now a unified #define for input and output.
GetNextTagNumber() bug fix. The problem occurred when called repeatedly until error to get all tag numbers for an item.
v1.5.1
QCBOR 2.0 alpha 1
This is a QCBOR 2.0 alpha release. It is suitable for testing and prototyping,
but not commercial use. The planned 2.0 changes are in, but they are
not fully tested or documented. The interface is also subject to change.
QCBOR 2.0 is compatible with 1.0 with one exception that can be overridden
with a call to QCBORDecode_Compatibilityv1().
Please file issues found with this release in GitHub.
Major Changes
-
While decoding, unexpected tag numbers generate an error rather than being silently ignored. This is more correct decoding behavior.
-
New API to explicitly decode tag numbers to make tag numbers easier to work with.
-
Plug-in API scheme for custom tag content processors.
-
Sort maps and check for duplicate labels when encoding.
-
Encode modes for dCBOR, CDE and Preferred Serialization.
-
Decode modes that check for conformance with dCBOR, CDE and Preferred Serialization.
-
Full support for preferred serialization of big numbers, decimal fractions and big numbers.
-
Full support for 65-bit negative integers.
-
The interfaces (and sources) are split into multiple files.
Compatibility with QCBOR v1
QCBOR v1 decoding does not error out when a tag number occurs where it is not
expected. QCBOR v2 does. Tag numbers really do change the type of an
item, so it is more correct to error out.
For many protocols, the v2 behavior produces a more correct implementation,
so it is often better to not return to QCBOR v1 behavior.
Another difference is that the tag content decoders for big numbers,
big floats, URIs and such are not enabled by default. These are
what notices the things like the big number and big float tags,
decodes them and turns them into QCBOR types for big numbers and floats.
QCBORDecode_Compatibilityv1() disables the error out on unprocessed
tag numbers and installs the same tag content decoders that v1 has.
The tag number decoders can be installed with the retention of
erroring out on unprocessed tag numbers by calling
QCBORDecode_InstallTagDecoders(pMe, QCBORDecode_TagDecoderTablev1, NULL);
QCBOR v2 requires tag numbers to be consumed in one of three ways.
It may be consumed explicitly with QCBORDecode_GetNextTagNumber().
It may be consumed by a tag content process or like QCBORDecode_DateEpochTagCB()
installed with QCBORDecode_InstallTagDecoders(). It may be
consumed with a spiffy decode function like QCBORDecode_GetTBigNumber().
QCBOR v1.5
This has small feature additions, bug fixes and adjustments.
Very minor behavior changes were made:
- Decoding of maps limited to 32K items
- Decoding unexpected tag numbers on strings no longer an error
- Decoding of some negative big number mantissa's no longer off by one
- This should be compatible for the vast majority of uses by far and it is generally better to upgrade to this.
Bug fixes:
- QCBORDecode_GetBigFloatBig() and QCBORDecode_GetDecimalFractionBig() return negative big number mantissas consistently. They inconsistently applied the negative 1 offset.
- QCBORDecode_DoubleConvertAll() was off by 1 when the input to decode was a decimal fraction with a negative big number mantissa.
Changes:
- Map decoding is limited to 32K items rather than 65K so encoding and decoding map sizes are the same (inconsistency was turned up while bringing test coverage to 100%).
- QCBORDecode_GetXxxxString() no longer errors on the presence of tag numbers to be consistent with all the other spiffy decode functions QCBORDecode_GetXxxx() functions. Use QCBORDecode_GetNthTagOfLast() to check and error on the presence of tag numbers.
- Set SOVERSION in CMAKE to indicate version when built as a shared library.
Features:
- Add Encode_SubString() to get partial encoded results; useful for hashing/signing sub-parts of encoded output
- Add Encode_Tell() to current encoding offset
- Add QCBORDecode_RetrieveUndecodedInput() to get original input string back from decoder context
- Add QCBOREncode_RetrieveOutputStorage() to get original output buffer back from encoder context
Other:
- Restored some license text that was missing
- Consolidated all license stuff in the LICENSE file
- Test coverage for encode to 100%
- All functions that encode with string labels are named consistently ending in "SZ"
- Deprecated functions are better organized (deprecated functions will never be removed from QCBOR to keep backward compatibility).
QCBOR 1.4.1
There are no known problems or test failures in 1.4, but this fix should be picked up. This restores some defensiveness in decoding that was present in v1.3.
Specifically it is defensive decoding of reserved values (28, 29, 30) in additional info in the CBOR head. The change is to put the QCBORItem initialization back in the right place. From analysis of the code, the only effect was when the header decode returned QCBOR_ERR_UNSUPPORTED, a recoverable error. It is assumed that no caller would examine the secondary fields of QCBORItem when this error occurs, so there's no issue.
QCBOR v1.4
This release is the largest in a while. It fixes some small bugs in features that aren't used that often. It adds a few features and improves documentation and test. Backwards compatibility is retained. There's no reason not to upgrade to this version.
Feature Additions:
- Added QCBORDecode_GetArray() and QCBORDecode_GetMap() and related. These return the undecoded CBOR for an array or map.
- Added QCBORDecode_Tell() to report decode traversal cursor position.
- Add EndCheck() to tell if the decode traversal cursor is at the end of the input.
- Add QCBORDecode_AddSimple(). This is just for future-defined simple values. AddBool(), AddNULL() and AddUndef() have been supported for years.
- Added UsefulBuf_OffsetToPointer() and UsefulInputBuf_PointerToOffset().
- New compiler option QCBOR_DISABLE_NON_INTEGER_LABELS that reduces object code for protocols that use only integer map labels.
- Installation using CMake
Bug Fixes:
- CI correctly tests all the QCBOR_DISABLE_XXX configurations
- QCBORDecode_GetNthTagOfLast() works correctly for all spiffy decode functions
- QCBORDecode_GetItemInMapN() and QCBORDecode_GetItemInMapSZ() set the label and data types to QCBOR_TYPE_NONE when the decode is in error.
- QCBORDecode_GetXXXInX() traversal cursor bug fix. The bug occurred when mixing spiffy decode fetch by label with traversal using GetNext().
- Bug fixes for QCBOR_DECODE_MODE_MAP_AS_ARRAY mode so it works with indefinite-length strings and with QCBORDecode_EnterArray() and QCBORDecode_GetArray() (this mode is to decode unusual map labels and is not commonly used).
- QCBOR_Int64ToUInt16() was incorrectly named. The old incorrect name still works too.
- qcbor_err_to_str() is update date for all the recently added error codes.
Other:
- QCBORDecode_Private_ExpMantissa() refactoring. It will produce more accurate error codes.
- QCBORDecode_EnterBstrWrapped() produces better error code when attempted on allocated (e.g., indef length) strings.
- Size optimizations, particularly to reduce object code size for an encode minimal use case.
- Some refactoring of the decoder to reduce object code size and for code clarity and organization.
- Bring UsefulBuf test coverage to 100%.
QCBOR v1.3
This is a fully backwards compatible update that everyone should pick up. The majority of lines changed were only for documentation and code tidiness. Some small bugs are fixed and one feature addition.
- Floating-point conversion between half, single and double-precision for subnormal values and NaN payloads is completed. These are relatively obscure unused parts of IEEE754 floats.
- QCBOREncode_GetErrorState() can now be called after QCBOREncode_Finish() and it will always return the correct error.
- User-defined error codes are now supported. The error state can be set with the new function QCBORDecode_SetError().
- Fixed a rare condition where QCBORDecode_ VGetNext() would not set the Item.uDataType to QCBOR_TYPE_NONE on error.
- Function naming changed to better avoid name collision. This includes internal functions. This is to compensate for C not having name spaces like C++.
- Documentation correctly describes mixing of traversal cursor used by GetNext with fetch by label in entered maps
- Some increase in test coverage
- A bunch of "TODO:" items were addressed. Most result in no change to the code, just changes to documentation and test coverage.
QCBOR v1.2
This release addresses static analyzer warnings about INT64_MIN for decoding big floats and decimal fractions and addresses warnings for adding empty data/string items. In practice, the issues underlying these warnings are not known to cause any problems. Both gcc and clang produce correct code without these fixes. Test coverage for this in previous versions of QCBOR also indicated no problems.
There are no API changes in this release. It is compatible with previous releases.
Picking up this fix is recommended as the implementation is clearly more correct C code.
This release also substantially improves building with CMake.
QCBOR 1.1
QCBOR 1.1 is some small feature additions and some small bug fixes.
The bug fixes are primarily for decoding malformed input. There are
no security issues (no buffer overruns), though in one case an infinite loop occurs.
There are no compatibility issues relative to QCBOR 1.0. The only
API change is the addition of QCBOREncode_OpenBytes and related. The QCBOR_1_1 is #define'd to indicate the version is 1.1.
It is recommended that all users of QCBOR pick up this release.
It is a simple upgrade.
Features
- Add QCBOREncode_OpenBytes()
- Improved documentation for disabling parts of QCBOR
- Improved examples
Fixes
- Better naming of #defines for standard tag numbers
- All floating point tests are now properly disabled when all floating point is disabled.
- Bad input (e.g., not well formed maps) would result in an infinite loop for some spiffy decode API use.
- Fix compiler warnings with Microsoft compiler
- Calling QCBOREncode_CloseArray() and related incorrectly (multiple times) could put QCBOR in an undefined state.
- Zero-length indefinite-length string chunks are now correctly ignored rather than causing an error.