veraison / go-cose

go library for CBOR Object Signing and Encryption (COSE)
Mozilla Public License 2.0
49 stars 26 forks source link

Validate content type header parameter #176

Closed qmuntal closed 10 months ago

qmuntal commented 11 months ago

RFC 9052 Section 3.1 impose this restrictions on the content type textual format:

Text values follow the syntax of "/", where and are defined in Section 4.2 of [RFC6838]. Leading and trailing whitespace is not permitted.

We are currently not performing any of those validations. This PR fix that.

codecov[bot] commented 11 months ago

Codecov Report

Merging #176 (5508600) into main (e7ac36d) will increase coverage by 0.20%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   91.99%   92.19%   +0.20%     
==========================================
  Files          12       12              
  Lines        1961     1973      +12     
==========================================
+ Hits         1804     1819      +15     
+ Misses        108      105       -3     
  Partials       49       49              
Files Coverage Δ
headers.go 93.64% <100.00%> (+0.94%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

SteveLasker commented 10 months ago

Awaiting @qmuntal to resolve the merge conflict, then we can merge.