Skip to content
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

Fix the Base 64 symbol converter. #212

Merged
merged 4 commits into from
Sep 18, 2023
Merged

Fix the Base 64 symbol converter. #212

merged 4 commits into from
Sep 18, 2023

Conversation

partim
Copy link
Member

@partim partim commented Jun 6, 2023

This PR fixes util::base64::SymbolConverter to also include the final group in the output if there is padding.

if self.input[2] == 0x80 {
return Err(Error::custom("trailing Base 64 data"));

if self.input[2] == 0x80 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if this could be a constant.

// The second to last character is padding. The last one
// needs to be, too.
if self.input[3] == 0x80 {
self.next = 0xF0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this as well.

Copy link
Member

@Philip-NLnetLabs Philip-NLnetLabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if 0x80 and 0xF0 could be constants

@partim partim merged commit a6fef8f into main Sep 18, 2023
@partim partim deleted the fix-base64-converter branch September 18, 2023 12:25
partim added a commit that referenced this pull request Sep 18, 2023
New

* Added a new method `FoundSrvs::into_srvs` that converts the value into an
  iterator over the found SRV records without resolving them further.
  ([#174], [#214] by [@WhyNotHugo]); this was added in 0.7.2 but missing
  in 0.8.0)
* Added impl of `Borrow<Dname<[u8]>>` and `AsRef<Dname<[u8]>>` for
  `Dname<_>`. ([#219] by [@iximeow}], [#225])
* Added `Dname::fmt_with_dot` that can be used when wanting to display a
  domain name with a dot at the end. ([#210])

Bug Fixes

* Fixed trait bounds on `FoundSrvs::into_stream` to make it usable again.
  ([#174], [#214 by [@WhyNotHugo]]; this was fixed in 0.7.2 but missing in
  0.8.0)
* Fixed scanning of domain names that are just the root label. ([#210])
* Fixed `util::base64::SymbolConverter` to also include the final group in
  the output if there is padding. ([#212])
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