I was trying to use this crate to serialize a SetOf data and found that the serialized tag of SetOf is 0x30, but the correct one should be 0x31 if I understand it correctly.
The issue can be demonstrated by a simple example:
let it = [2, 3, 4].iter();
let set = SetOf::from_iter(it);
let mut der = Vec::new();
set.write_der(&mut der).unwrap();
The content of der is:
30 09 02 01 02 02 01 03 02 01 04
which I think should be:
31 09 02 01 02 02 01 03 02 01 04
My wild guess is that the tag for Vec is always Tag::Sequence.
Could you please advise if this is an issue or not? Thanks.
Hi,
You're right, the encoding is wrong. The set is internally using a Vec, and write_der_header was delegating the call.
This is fixed in the next commit.
Thanks
Hi there,
I was trying to use this crate to serialize a
SetOf
data and found that the serialized tag ofSetOf
is0x30
, but the correct one should be0x31
if I understand it correctly.The issue can be demonstrated by a simple example:
The content of
der
is:which I think should be:
My wild guess is that the tag for
Vec
is alwaysTag::Sequence
.Could you please advise if this is an issue or not? Thanks.