Skip to content

Cgo wrapper hardening: bounds, validation, missing stubs#39

Draft
JeremiahM37 wants to merge 4 commits intowolfSSL:masterfrom
JeremiahM37:fenrir
Draft

Cgo wrapper hardening: bounds, validation, missing stubs#39
JeremiahM37 wants to merge 4 commits intowolfSSL:masterfrom
JeremiahM37:fenrir

Conversation

@JeremiahM37
Copy link
Copy Markdown
Contributor

Fixes F-3021, F-1866, F-2546, F-1872, F-1875, F-2550, F-2553, F-2551, F-3023

Summary:

  • ChaCha20Poly1305 appended-tag encrypt: size the working buffer to exactly len(inPlain)+tag so oversized caller buffers don't leave garbage between cipher and tag.
  • Add NO_HMAC and NO_PWDBASED cgo stubs so builds without HMAC/HKDF/PBKDF2 compile.
  • Reject sizes >math.MaxInt32 before the C.int cast in WolfSSL_read/write, curve25519 make_pub/make_priv, BIO_new_mem_buf, and X509 buffer wrappers (BIO can wrap to -1, OpenSSL's strlen sentinel).
  • Reject iter <= 0 in Wc_PBKDF2 and require exactly CURVE25519_KEYSIZE on curve25519 export/shared_secret outputs.

@JeremiahM37 JeremiahM37 self-assigned this May 8, 2026
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