-
Notifications
You must be signed in to change notification settings - Fork 68
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
[3.2] Do not require trailing =
for base64 encoded strings
#1889
Conversation
…port non-fc valid base64 encodings
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.
So I assume that if there is an extra =
character at the end, base64_decode
ignores it, right?
Yes. And there is an existing test that verifies that: leap/libraries/libfc/test/test_base64.cpp Lines 40 to 45 in bce1b0b
|
return blob( { std::vector<char>( b64.begin(), b64.end() ) } ); | ||
} catch(const std::exception&) { |
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.
fc::assert_exception
?
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.
The implementation uses .at()
so std::out_of_range
is maybe possible, although not sure if really is because of the while (pos < length_of_string)
All previous versions of nodeos required a trailing
=
for base64 encoded strings.fc::variant
appends an extra=
for all of its base64 encoded strings. However, non-fc base64 encoders do not add an extra=
when one is not needed. This PR modifiesfc::variant
to support non-fc base64 encoded strings that do not have the extra=
.In 5.0,
fc::variant
was updated to not add the extra=
to base64 encoded strings. See #1888. This PR allowsnodeos
to support the new 5.0 version of base64 encoded strings.Issue #1461