biscuit-rust icon indicating copy to clipboard operation
biscuit-rust copied to clipboard

Fix for third party block reuse

Open Geal opened this issue 1 year ago • 4 comments

This changes the third party block signature format to prevent reuse of third party blocks across tokens, by including the previous block's signature in the signed data

Geal avatar Oct 20 '24 13:10 Geal

I'm not decided yet on the best name for the functions still allowing the old format, between Biscuit::unsafe_deprecated_deserialize and UnverifiedBiscuit::unsafe_from

Geal avatar Oct 20 '24 13:10 Geal

CodSpeed Performance Report

Merging #230 will not alter performance

Comparing geal/third-party-reuse (c026d50) with v5 (e59f41d)

Summary

✅ 12 untouched benchmarks

codspeed-hq[bot] avatar Oct 20 '24 13:10 codspeed-hq[bot]

I'm not decided yet on the best name for the functions still allowing the old format, between Biscuit::unsafe_deprecated_deserialize and UnverifiedBiscuit::unsafe_from

I’d go for the most explicit. I read unsafe_from in the diff and was a bit confused

divarvel avatar Oct 21 '24 12:10 divarvel

I think we should document the signature scheme to make a few things clearer:

  • imo the version should be signed (if defined)
  • the previous key should not be signed if we sign the previous signature instead

divarvel avatar Oct 21 '24 12:10 divarvel

Codecov Report

Attention: Patch coverage is 87.34940% with 21 lines in your changes missing coverage. Please review.

Project coverage is 69.89%. Comparing base (3930767) to head (c026d50). Report is 2 commits behind head on v5.

Files with missing lines Patch % Lines
biscuit-auth/src/crypto/mod.rs 88.88% 9 Missing :warning:
biscuit-auth/src/format/mod.rs 92.72% 4 Missing :warning:
biscuit-auth/src/token/unverified.rs 69.23% 4 Missing :warning:
biscuit-auth/src/token/third_party.rs 66.66% 3 Missing :warning:
biscuit-auth/src/token/mod.rs 87.50% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##               v5     #230      +/-   ##
==========================================
+ Coverage   69.03%   69.89%   +0.86%     
==========================================
  Files          25       25              
  Lines        5926     5990      +64     
==========================================
+ Hits         4091     4187      +96     
+ Misses       1835     1803      -32     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

codecov[bot] avatar Nov 04 '24 22:11 codecov[bot]