aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-06-30Don't allow implicit conversion to Arrayandroid-s-beta-5android-s-beta-4android-s-beta-3android-s-beta-5android-s-beta-4Seth Moore
The variadic Array constructor would implicitly make an Array object from a single input that is convertable to an Item. This leads to surprising behaviors wherein Arrays could be created unintentionally. Fix this by making the variadic constructor only work for more than one argument. Add an additional, single-item constructor that is explicit. Bug: 191778240 Test: cppbor_host_test_external Change-Id: Ifadc6d3137ee285a81076a4125b6053f1d7c21c4
2021-06-03Add libcppcbor to library build system am: 10ca06966bStephen Crane
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1536784 Change-Id: I8003ef670f9ec658392ffeb4496df7aaae7cf15d
2021-04-27Add libcppcbor to library build systemStephen Crane
Switch to building libcppcbor with the library.mk system instead of as a generic lk module. Test: build.py qemu-generic-arm64-test-debug Change-Id: I04b91b6c18480bdc9018be18aebaf9b40bdefedf
2021-04-21Merge "Remove CONTRIBUTING.md" am: 8f773c2103Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1670288 Change-Id: I3e6410ec4e3dfddf1c8d00241c175ad6307f39df
2021-04-21Merge "Remove CONTRIBUTING.md"android-s-beta-2android-s-beta-1Treehugger Robot
2021-04-15Fix integer cast in handleNint am: a7ca25a181Andrei Homescu
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1663840 Change-Id: I8e27a73ec953c0db8a44fbff11c5dc81b26e11b0
2021-04-09Fix integer cast in handleNintAndrei Homescu
This fixes an incorrect integer cast in the handleNint function in cppbor_parse.cpp which would trigger UBSAN failures in the Trusty apploader. Change-Id: Id35865e524c9837d907fe352feac783b3f7f36b0
2021-04-08Make const overloads available in sub-classes. am: f3e77b2781Max Bires
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1670287 Change-Id: I817c04110708942a2977487603f852f949160529
2021-04-08Remove CONTRIBUTING.mdMax Bires
AOSP is the upstream source for this library. Test: Purple is a good color for a bike shed. Change-Id: I6be4c7ec47b15cc5fbed8091555613ef22623c28
2021-04-08Make const overloads available in sub-classes.Max Bires
Due to the overloading behavior in sub-classes, access to the methods returning const types in Item were not accessible from the Item subclasses. This change adds the using statements necessary to fix that. Test: cd hardware/interfaces/identity && mm -j48 Change-Id: I40bff6470c5fecfb308fec527540a8fbf1abf91a
2021-04-01Error on unknown simple value am: bdc577b46bAndrew Scull
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1658065 Change-Id: I382cf2f91896465db2fbdc67e7d6afb4ee51bf61
2021-04-01Reject reserved values and indefinite lengths am: 42a7aa8fbfAndrew Scull
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1658064 Change-Id: I643cd7fc1fa0f5e7430adabc73b7a2536d14bf0f
2021-03-30Error on unknown simple valueAndrew Scull
Null, true and false are handled but any other simple value, or floating pointer value, would otherwise reach the CHECK() that was expected to be unreachable. Instead, error when an unhandled value is seen. Test: cppbor_host_test_external Change-Id: Idb1099bbc51649e5eb8f5fb4fa60553e8cbe7e8f
2021-03-30Reject reserved values and indefinite lengthsAndrew Scull
RFC 8949 defines additional information values 28, 29, 30 and 31 as either reserved or indicating indefinite length values. Reject all of these. Test: cppbor_host_test_external Change-Id: Ic9ae7630c8f75d060e4199d375c1f696699a4f66
2021-03-25Add view items for zero-copy parsing of CBOR strings am: 4d171a791aAndrei Homescu
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1588192 Change-Id: I97ebf04460b75af783b1759a8e5816bc198cf321
2021-03-11Add view items for zero-copy parsing of CBOR stringsAndrei Homescu
This CL adds two new ViewTstr and ViewBstr Item types that hold strings as string_view and basic_string_view<uint8_t> types instead of std::string or std::vector<uint8_t>, respectively. This allows for zero-copy parsing of CBOR (mainly strings), which is useful in low-memory environments like the apploader where CBOR data can contain large bstr values. Bug: 115420908 Test: cppbor_host_test_external Change-Id: I69322f0de258e3583cbd842ce240398504a1973f
2021-02-20Mark ab/7061308 as merged in stage.Xin Li
Bug: 180401296 Merged-In: Iaa423f28a08a8b8619ceff179b69b7d102a596ce Change-Id: I6a852dd1175a92e556ba415cf48822ae6ab607eb
2021-02-17[LSC] Add LOCAL_LICENSE_KINDS to external/libcppbor am: 382930dc90Bob Badour
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1588871 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I68b59e51881ce2565f9791ee5d9ce6ab845704fc
2021-02-12[LSC] Add LOCAL_LICENSE_KINDS to external/libcppborandroid-s-preview-1Bob Badour
Added SPDX-license-identifier-Apache-2.0 to: Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Exempt-From-Owner-Approval: janitorial work Change-Id: Iaf70ec58fa73969cf9d7baeac57f56d745475e40
2020-12-16Change semantic tagging. am: 315d859ec4 am: 01589c6c88Shawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515385 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Iaa423f28a08a8b8619ceff179b69b7d102a596ce
2020-12-16Change semantic tagging. am: 315d859ec4Shawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515385 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ic98c01b5918eda13e21f0ff8d5343f98d5286914
2020-12-14Remove downcastItem<> am: f79067125c am: 7aa436b8caShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515384 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Icb8f251953eac9e5d58d9231e2c00fe76522abfa
2020-12-14Improve Map canonicalization and add Map iterators. am: 03990c2489 am: ↵Shawn Willden
be17dfffad Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515383 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I92a8bb0aae2636ceacc214160d1a7b4079064a65
2020-12-14Remove downcastItem<> am: f79067125cShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515384 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1ed83527b3d731f12817e3a860e40f8b7be06251
2020-12-14Improve Map canonicalization and add Map iterators. am: 03990c2489Shawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515383 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ic2e4d9e214c50a92d595d19e9c9a7aaddb213e91
2020-12-14Change semantic tagging.Shawn Willden
Semantic tagging in libcppbor was a bit cumbersome to use, with tags treated as separate items, requiring code that analyzes tagged data to pay attention to the tags. Among other issues, that violates the intention of semantic tagging in CBOR, which, per the RFC, does not require decoders to understand tags. This CL changes that behavior so that code that walks a parsed Item tree will not "see" the tags unless it looks for them, by calling "Item::semanticTagCount()" and then "Item::semanticTag()". Nested tags are supported. Test: cppbor_test_external Change-Id: Ifa99475fd0d9f369f3e379251979446a2ec262b5
2020-12-14Remove downcastItem<>Shawn Willden
This safe downcast template was never used and is hard to implement with the coming SemanticTag changes, so this CL removes it. Test: cppbor_test_external Change-Id: I0d4dd8b7323653c3924080f8fb328282dbca4566
2020-12-14Improve Map canonicalization and add Map iterators.Shawn Willden
This CL changes Map storage to use a vector of pairs, which removes the need to copy the contents twice to sort them and makes it easy to support Map iteration. Support for recursive canonicalization is added as well, and Map::get() uses a binary search when the map is canonicalized. Test: cppbor_test_external Change-Id: Ie7cee5d504e205e1768a26ec5df8436805a6eefe
2020-12-12Merge changes Id47afed4,I55b82067 am: 85e5286b59 am: 67e76405faTreehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515382 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I8858e2a6fc149eb8dd9de15bef54264b08ecf5ca
2020-12-12Merge changes Id47afed4,I55b82067 am: 85e5286b59Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515382 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ic1ef63c321e42104feadca4751ac54b8d88abdb4
2020-12-12Merge changes Id47afed4,I55b82067Treehugger Robot
* changes: Add Array iterators. Add non-const as*() methods.
2020-12-12Merge "Remove CompoundItem." am: e37e4e3063 am: b9bc338c27Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515380 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ic67708c894be12ebeffbe54d5b8f075e94778f64
2020-12-12Merge "Remove CompoundItem." am: e37e4e3063Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515380 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I9dd3988cda35ddd5e18c98d09d168318c68ea8bc
2020-12-12Merge "Remove CompoundItem."Treehugger Robot
2020-12-01Improve Map sorting performance. am: d613c9aa81 am: 4f9010ce6fShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515379 Change-Id: If566527cdf971bf327e1e15886c50ab834a6f861
2020-12-01Improve Map sorting performance. am: d613c9aa81Shawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1515379 Change-Id: I0f75631937e389d57d5733719629ed5a603b6cac
2020-12-01Add Array iterators.Shawn Willden
Test: cppbor_test_external Change-Id: Id47afed4927db47312b8bdf31a594b847448fb7d
2020-12-01Add non-const as*() methods.Shawn Willden
Other changes coming require non-const methods for safe downcasting, but this change stands alone since not having them was clearly an oversight. Test: cppbor_test_external Change-Id: I55b8206778f3c4de8e9fc5039efda0c2f45bfe00
2020-12-01Remove CompoundItem.Shawn Willden
Refactor to remove CompoundItem. It was a way to share some common code between Array and Map, and later Semantic, but the representations of those classes need to diverge so it adds no value. Test: cppbor_test_external Change-Id: I986e90c1d212f6d81debe4b2f650ba68f065a6ed
2020-11-25Improve Map sorting performance.Shawn Willden
Test: cppbor_host_test_external Change-Id: I0a7aaa1ba7d98c4660950ccfa1df743fe5f23d47
2020-11-24Fix Trusty breakage. am: def2ca0f35 am: 97a714291dShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1510449 Change-Id: I5f1d923295ad123260c9c5270c0a2e8cabcee4ba
2020-11-24Fix Trusty breakage. am: def2ca0f35Shawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1510449 Change-Id: I2c91190210b6aba9090781d9bee372d6fbc6ef02
2020-11-24Improvements to cppbor am: 0f9cd2d79d am: ca07638e8fShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1506866 Change-Id: I1cfa47099cf6259b82362bbbfbb69a35a6a96723
2020-11-24Apply clang-format. am: 6ad5732fa5 am: fba140d0cfShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1506865 Change-Id: I09b23e6d8afc616ba7f4b1bb4b66ad7f59664611
2020-11-24Fix Trusty breakage.Shawn Willden
Bug: 174164961 Test: Build Trusty Change-Id: Id0d9d464e6c4b600ffec53a4dbb5a1992b573c29
2020-11-24Improvements to cppbor am: 0f9cd2d79dShawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1506866 Change-Id: Ia920be733265e7feb01aee1633ed39e5560998cf
2020-11-24Apply clang-format. am: 6ad5732fa5Shawn Willden
Original change: https://android-review.googlesource.com/c/platform/external/libcppbor/+/1506865 Change-Id: I5c9067a0ebaa7c4b1921c8046db444b0672f50ed
2020-11-24Improvements to cppborShawn Willden
1. Add pretty-printing (moved from IdentityCredentialSupport) 2. Add EncodedItem to make it easy to add already-encoded CBOR. 3. Add Map canonicalization. 4. Add support for adding enums as integers. Test: cppbor_test_external Change-Id: I641c87567a11de4641b2fcadebe72dd832fceb51
2020-11-24Mark ab/6881855 as merged am: 9a5c37becfXin Li
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/libcppbor/+/13112837 Change-Id: I76e5d30c9eed5a580a496f3d021f6e9be3d11e70
2020-11-23Mark ab/6881855 as mergedXin Li
Bug: 172690556 Change-Id: I2f94cb574530b92e39f749c9c5a0e2ba4cd61967