Skip to content

Return None for malformed Sapling key encodings#190

Open
Michae2xl wants to merge 1 commit into
zcash:mainfrom
Michae2xl:fix-sapling-key-from-bytes-panics
Open

Return None for malformed Sapling key encodings#190
Michae2xl wants to merge 1 commit into
zcash:mainfrom
Michae2xl:fix-sapling-key-from-bytes-panics

Conversation

@Michae2xl

Copy link
Copy Markdown

Summary

  • rewrite SpendAuthorizingKey::from_bytes and SpendValidatingKey::from_bytes to use explicit Option parsing instead of constructing CtOption values around fallible conversions
  • return None for malformed encodings rather than panicking; the accepted key set is unchanged
  • add deterministic regression sweeps plus explicit malformed encodings for both constructors

Testing

  • CARGO_TARGET_DIR=/tmp/sapling-crypto-target cargo test malformed_bytes_without_panicking

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