-
Notifications
You must be signed in to change notification settings - Fork 112
chore(everest-ci): bump build-kit base image version to debian13 #1381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Andreas Heinrich <[email protected]>
Signed-off-by: Andreas Heinrich <[email protected]>
Signed-off-by: Andreas Heinrich <[email protected]>
Signed-off-by: Andreas Heinrich <[email protected]>
|
||
TEST(openssl, base64Decode) { | ||
auto res = openssl::base64_decode(&iso_exi_a_hash_b64[0], sizeof(iso_exi_a_hash_b64)); | ||
auto res = openssl::base64_decode(iso_exi_a_hash_b64, std::strlen(iso_exi_a_hash_b64)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change needs to be reverted.
openssl::base64_decode() takes a constant pointer and a length - normally from a buffer of known size. It does not need to be null terminated.
And it if isn't null terminated then strlen() will not help.
ASSERT_EQ(res.size(), sizeof(iso_exi_a_hash)); | ||
EXPECT_EQ(std::memcmp(res.data(), &iso_exi_a_hash[0], res.size()), 0); | ||
res = openssl::base64_decode(&iso_exi_sig_b64[0], sizeof(iso_exi_sig_b64)); | ||
res = openssl::base64_decode(iso_exi_sig_b64, std::strlen(iso_exi_sig_b64)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change needs to be reverted.
openssl::base64_decode() takes a constant pointer and a length - normally from a buffer of known size. It does not need to be null terminated.
And it if isn't null terminated then strlen() will not help.
std::size_t buffer_len = buffer.size(); | ||
|
||
EXPECT_TRUE(openssl::base64_decode(&iso_exi_a_hash_b64[0], sizeof(iso_exi_a_hash_b64), buffer.data(), buffer_len)); | ||
EXPECT_TRUE(openssl::base64_decode(iso_exi_a_hash_b64, std::strlen(iso_exi_a_hash_b64), buffer.data(), buffer_len)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above why strlen isn't a solution
|
||
TEST(openssl, base64DecodeNl) { | ||
auto res = openssl::base64_decode(&iso_exi_a_hash_b64_nl[0], sizeof(iso_exi_a_hash_b64_nl)); | ||
auto res = openssl::base64_decode(iso_exi_a_hash_b64_nl, std::strlen(iso_exi_a_hash_b64_nl)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above why strlen isn't a solution
ASSERT_EQ(res.size(), sizeof(iso_exi_a_hash)); | ||
EXPECT_EQ(std::memcmp(res.data(), &iso_exi_a_hash[0], res.size()), 0); | ||
res = openssl::base64_decode(&iso_exi_sig_b64_nl[0], sizeof(iso_exi_sig_b64_nl)); | ||
res = openssl::base64_decode(iso_exi_sig_b64_nl, std::strlen(iso_exi_sig_b64_nl)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above why strlen isn't a solution
|
||
EXPECT_TRUE( | ||
openssl::base64_decode(&iso_exi_a_hash_b64_nl[0], sizeof(iso_exi_a_hash_b64_nl), buffer.data(), buffer_len)); | ||
openssl::base64_decode(iso_exi_a_hash_b64_nl, std::strlen(iso_exi_a_hash_b64_nl), buffer.data(), buffer_len)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above why strlen isn't a solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strlen() doesn't solve a "problem" where a string isn't null terminated.
Signed-off-by: Andreas Heinrich <[email protected]>
Signed-off-by: Andreas Heinrich <[email protected]>
Signed-off-by: Andreas Heinrich <[email protected]>
Describe your changes
Issue ticket number and link
Checklist before requesting a review