Skip to content

Conversation

@laurencelundblade
Copy link
Owner

@laurencelundblade laurencelundblade commented Feb 3, 2025

This is a breaking change in the t_cose v2 API, but it is not difficult to adapt to it. To adapt, switch from t_cose_sign_verify() to t_cose_sign_verify_msg() with an additional parameter if tag numbers are expected or NULL if not.

The main entry points for verify/validate/decrypt are changed to take a QCBORDecodeContext from which to read the message to decode. This makes them simpler inside and more flexible for the caller.

A new additional entry point for verify/validate/decrypt is added with the name ending in _msg that takes the
pointer and length like the old main entry points. This also returns all the tag numbers. t_cose_mac_validate_nth_tag()
is removed and the size of the verify/validate/decrypt context is reduced.

This commit make t_cose compatible with QCBOR v2, which does tag number decoding in a different way than
QCBOR v1. This commit also continues to work with QCBOR v1 and the sign1 APIs are still compatible with t_cose v1.

@laurencelundblade laurencelundblade merged commit 63d7286 into dev Feb 15, 2025
28 checks passed
@laurencelundblade laurencelundblade deleted the qcbor2_compat branch February 15, 2025 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant