Skip to content

Voucher is double-encoded in bytes #382

@chrysn

Description

@chrysn

The voucher response as is part of our test vectors contains the CBOR encoded byte string of the CBOR encoded byte string of the 8-byte MAC; in the test vectors, that shows up as 4948.

The reference document so far is draft-ietf-lake-authz-01; note that a few things have changed in the meantime. Still, the voucher is supposed to be Voucher = COSE_Encrypt0.ciphertext, and that is in our case just a MAC, which should be 8 bytes -- instead, voucher is transported as the byte string around those 8 bytes (making it 9 bytes).

While refactoring, I won't change the test vectors, and will leave things functionally as they are, but as EADItem starts to store the slice rather than the encoded slice (for doing the latter creates a hard-to-enforce invariant on a structure that has all its fields pub), things that have looked smooth start looking weird due to the extra layer, and this issue helps keep track of them by providing an identifier associated with those places in the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions