Skip to content

Harden key handling and crypto backend edge cases#88

Merged
bifurcation merged 21 commits into
mainfrom
rlb/security-review-fixes
May 7, 2026
Merged

Harden key handling and crypto backend edge cases#88
bifurcation merged 21 commits into
mainfrom
rlb/security-review-fixes

Conversation

@bifurcation

Copy link
Copy Markdown
Collaborator

Summary

  • tighten key lifecycle and header parsing behavior, including epoch purging, counter exhaustion, key-direction checks, and clearer replay semantics
  • harden crypto backend edge cases across OpenSSL and BoringSSL, including empty HKDF salt handling, checked size conversions, CTR input bounds, and cleaner error reporting
  • clean up supporting infrastructure with safer wrapper types, fixed-capacity initialization, release hardening flags, and targeted API comments

Testing

  • make test

Comment thread include/sframe/sframe.h Outdated
Comment thread include/sframe/sframe.h Outdated
Comment thread include/sframe/sframe.h Outdated
Comment thread src/crypto_boringssl.cpp Outdated
Comment thread CMakeLists.txt Outdated
Comment thread src/crypto.cpp
Comment on lines +129 to +132
void
clear_openssl_errors()
{
ERR_clear_error();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it used actually outside of crypto files ? If not, wouldnt it be sufficient to call it directly?

Also ive noticed its also called in boringssl, and there it gets less clear. If method is used outside, maybe we could change the name ?

@bifurcation bifurcation merged commit b140909 into main May 7, 2026
25 checks passed
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.

2 participants