Repository navigation
Limit default CBOR recursion depth to 16 - #133
manjarisrikant wants to merge 1 commit into
Conversation
Decode CBOR slices with `DEFAULT_CBOR_RECURSION_LIMIT` (16) instead of `ciborium`'s default recursion limit of 256, since valid COSE objects only require shallow CBOR nesting. Also add `CborSerializable::from_slice_with_recursion_limit` and `TaggedCborSerializable::from_tagged_slice_with_recursion_limit` so callers with deeper or tighter nesting requirements can specify a custom recursion limit.
|
Hi @manjarisrikant , could you share more context about the motivation of this change here since many reviewers on Github has access to buganizer. Thanks, Alice |
|
This probably helps in low-stack environments, cf. https://android-review.googlesource.com/c/platform/system/keymint/+/2609980 ? |
|
Thanks @aliciawyy and @daviddrysdale! Yes, @daviddrysdale — it is for the same reason: protecting both stack and fixed-size heap budgets in constrained With Setting (Internal Buganizer context: http://b/511320984) |
Decode CBOR slices with
DEFAULT_CBOR_RECURSION_LIMIT(16) instead ofciborium's default recursion limit of 256, since valid COSE objects only require shallow CBOR nesting.Also add
CborSerializable::from_slice_with_recursion_limitandTaggedCborSerializable::from_tagged_slice_with_recursion_limitso callers with deeper or tighter nesting requirements can specify a custom recursion limit.