Skip to content

Add defensive hash length check to VerifyTrait.php#20

Merged
soatok merged 9 commits intofedi-e2ee:mainfrom
shleeable:patch-1
Feb 16, 2026
Merged

Add defensive hash length check to VerifyTrait.php#20
soatok merged 9 commits intofedi-e2ee:mainfrom
shleeable:patch-1

Conversation

@shleeable
Copy link
Contributor

@shleeable shleeable commented Feb 13, 2026

I hope this is suitable.

SHA-256 produces a fixed-length 265-bit (32-byte)
SHA-384 produces a fixed-length 384-bit (48-byte)
SHA-512 produces a fixed-length 512-bit (64-byte)
BLAKE2b produces a variable-length 8 to 512 bits (1 to 64 bytes) but I assume we're looking for a floor of 32.

@shleeable
Copy link
Contributor Author

ok. I am bad at tests.. so might need you to expand on that side if this has merit for you. otherwise, just close.

@soatok
Copy link
Contributor

soatok commented Feb 16, 2026

Hey, I appreciate the effort. I think I can fix the mutation testing issues after merging.

@soatok soatok merged commit 4ac343b into fedi-e2ee:main Feb 16, 2026
10 of 11 checks passed
@shleeable shleeable deleted the patch-1 branch February 17, 2026 23:31
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