You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Decodes a COSE key such as/// ```/// {1: 1, -1: 7}/// ```#[derive(minicbor::Decode)]#[cbor(map)]pubstructCoseKeyOkpEc2<'a>{#[n(1)]pubkty:i32,#[n(-1)]pubcrv:Option<i32>,}
error: expected `u32` value
--> /home/chrysn/git/crates/ariel-os/src/lib/coapcore/src/ace.rs:97:9
|
97 | #[n(-1)]
Having negative keys in CBOR maps is a bit more rare than positive keys, but not completely unheard of: it is present in COSE but also in SenML.
Negative values to b() and n(), when used with the cbor(array) container encoding, make no sense, but I don't think it hurts to raise the error then rather than when processing the n()/b().
I'll try to work on a patch; if it is easier than the workaround, that will come soon; otherwise, whenever I next have a bit of spare time. (Such a patch may even prepare support for mixed integer and text string keys, as also COSE and SenML have it, but so far I haven't needed any of the text keys).
The text was updated successfully, but these errors were encountered:
Deriving minicbor traits fails on this:
Having negative keys in CBOR maps is a bit more rare than positive keys, but not completely unheard of: it is present in COSE but also in SenML.
Negative values to b() and n(), when used with the
cbor(array)
container encoding, make no sense, but I don't think it hurts to raise the error then rather than when processing the n()/b().I'll try to work on a patch; if it is easier than the workaround, that will come soon; otherwise, whenever I next have a bit of spare time. (Such a patch may even prepare support for mixed integer and text string keys, as also COSE and SenML have it, but so far I haven't needed any of the text keys).
The text was updated successfully, but these errors were encountered: