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

Specify that the .sbat section is ASCII not UTF-8 #413

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Specify that the .sbat section is ASCII not UTF-8 #413

merged 1 commit into from
Sep 8, 2021

Conversation

daxtens
Copy link
Contributor

@daxtens daxtens commented Sep 7, 2021

The SBAT variable is defined as ASCII, but the SBAT section in a binary was defined as UTF-8. These should match.

Use ASCII rather than UTF-8, because naive parsing of UTF-8 could lead to unexpected results. For example the character 'ä' can be encoded as 0xe4 or as 0x61 0x0308, and these should be considered equivalent. The shim is not smart enough to do this. This could lead to missed verifications, if the variable and section use different encodings.

Define everything as ASCII. It's sad not to be able to have 🦀 in our bootloader names, and potentially annoying for vendor names as well, but oh well.

The SBAT variable is defined as ASCII, but the SBAT section in a binary was defined as UTF-8. These should match.

Use ASCII rather than UTF-8, because naive parsing of UTF-8 could lead to unexpected results. For example the character 'ä' can be encoded as 0xe4 or as 0x61 0x0308, and these should be considered equivalent. The shim is not smart enough to do this. This could lead to missed verifications, if the variable and section use different encodings.

Define everything as ASCII. It's sad not to be able to have 🦀 in our bootloader names, and potentially annoying for vendor names as well, but oh well.
@julian-klode
Copy link
Collaborator

I don't think that's really necessary, UTF-8 is fine outside the component name, it's not used for verification purposes. But why are they not UCS-2 encoded like everything else anyway?

@steve-mcintyre
Copy link
Collaborator

I don't think that's really necessary, UTF-8 is fine outside the component name, it's not used for verification purposes. But why are they not UCS-2 encoded like everything else anyway?

That's something I asked a while back.myself. It's easier for us to work with UTF-8 generally, but...

@vathpela
Copy link
Contributor

vathpela commented Sep 8, 2021

I don't think that's really necessary, UTF-8 is fine outside the component name, it's not used for verification purposes. But why are they not UCS-2 encoded like everything else anyway?

Making the SBAT variable be ASCII (or UTF-8) makes the data considerably smaller where it really matters, and I'd rather not have to compare mixed encodings.

@vathpela vathpela merged commit 69b7bbf into rhboot:main Sep 8, 2021
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.

4 participants