Fix regression from the new base64 encoder and other related cleanups#29550
Fix regression from the new base64 encoder and other related cleanups#29550t8m wants to merge 4 commits intoopenssl:masterfrom
Conversation
|
ping @openssl/committers for second review |
|
Rebased, applied some of the review suggestions from Matt. Added commit to rename test_base64_simdutf to base64_simdutf_test for consistency. |
The BIO_CTRL_FLUSH should just forward the call to the underlying BIOs when not writing.
It is never changed anywhere. Fixes openssl#29518
The new name is better for consistency with other tests.
Sashan
left a comment
There was a problem hiding this comment.
As I've mentioned in my comment may be we can move those constant conditions to asserts. this is just a thought to consider. I'm also fine leaving the code in PR as is.
|
|
||
| #include <stdio.h> | ||
| #include <limits.h> | ||
| #include <assert.h> |
There was a problem hiding this comment.
NIT: wen in here would it make sense to remove BIN_PER_LINE CHUNKS_PER_LINE and CHAR_PER_LINE as they are unused (for a long time, so we can zap them in follow up PR).
| return 0; | ||
| OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); | ||
| if (ctx->length - ctx->num > inl) { | ||
| assert(EVP_ENCODE_B64_LENGTH <= (int)sizeof(ctx->enc_data)); |
There was a problem hiding this comment.
just a side note: perhaps we can introduce compile time asserts, can be done in follow up PR.
|
|
||
| #define EVP_CTRL_RET_UNSUPPORTED -1 | ||
|
|
||
| #define EVP_ENCODE_B64_LENGTH 48 |
There was a problem hiding this comment.
The comment saying EVP_ENCODE_B64_LENGTH should be divisible by 3 to keep CPU optimized code used does not hurt.
|
I prefer not adding the asserts. |
Sashan
left a comment
There was a problem hiding this comment.
I think this can go in. Looks good to me.
|
This pull request is ready to merge |
|
Pushed to master. Thank you! |
The BIO_CTRL_FLUSH should just forward the call to the underlying BIOs when not writing. Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Matt Caswell <[email protected]> MergeDate: Mon Jan 19 14:20:35 2026 (Merged from #29550)
It is never changed anywhere. Fixes #29518 Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Matt Caswell <[email protected]> MergeDate: Mon Jan 19 14:20:35 2026 (Merged from #29550)
The new name is better for consistency with other tests. Reviewed-by: Saša Nedvědický <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Matt Caswell <[email protected]> MergeDate: Mon Jan 19 14:20:35 2026 (Merged from #29550)
Fixing a few things:
Fixes #29518