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
COSE requires that alg must be authenticated (external_aad or protected header) and crit must be in the protected header. pycose reads both parameters from the unprotected header if missing in the protected header.
Fetches an header attribute from the COSE header buckets.
:param attribute: A header parameter to fetch from the buckets.
:param default: A default return value in case the attribute was not found
:raise CoseException: When the same attribute is found in both the protected and unprotected header.
:returns: If found returns a header attribute else 'None' or the default value
"""
p_attr=self._phdr.get(attribute, default)
u_attr=self._uhdr.get(attribute, default)
ifp_attrisnotNoneandu_attrisnotNone:
raiseCoseException("MALFORMED: different values for the same header parameters in the header buckets")
ifp_attrisnotNone:
returnp_attr
else:
returnu_attr
The get_attr method should be extended to check whether a parameter is required to be in the protected bucket. This requires another field in the attribute class.
The text was updated successfully, but these errors were encountered:
COSE requires that alg must be authenticated (external_aad or protected header) and crit must be in the protected header. pycose reads both parameters from the unprotected header if missing in the protected header.
pycose/pycose/messages/signcommon.py
Lines 40 to 50 in 5a08c02
pycose/pycose/messages/cosebase.py
Lines 61 to 81 in 5a08c02
The
get_attr
method should be extended to check whether a parameter is required to be in the protected bucket. This requires another field in the attribute class.The text was updated successfully, but these errors were encountered: