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

e2e/policy: ensure that modified policy hash is valid hex #934

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

Freax13
Copy link
Contributor

@Freax13 Freax13 commented Oct 16, 2024

The policy hash is hex-encoded and unfortunately, XORing 1 into hex digits doesn't always yield valid hex digits:

>>> [chr(ord(hex(i)[2:])^1) for i in range(16)]
['1', '0', '3', '2', '5', '4', '7', '6', '9', '8', '`', 'c', 'b', 'e', 'd', 'g']

Instead, decode the hex-encoded hash and XOR 1 into that.

The policy hash is hex-encoded and unfortunately, XORing 1 into hex
digits doesn't always yield valid hex digits:
>>> [chr(ord(hex(i)[2:])^1) for i in range(16)]
['1', '0', '3', '2', '5', '4', '7', '6', '9', '8', '`', 'c', 'b', 'e', 'd', 'g']
Instead, decode the hex-encoded hash and XOR 1 into that.
Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

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

Thanks, good catch!

@burgerdev burgerdev added the no changelog PRs not listed in the release notes label Oct 16, 2024
@Freax13 Freax13 merged commit ca5e22e into main Oct 16, 2024
9 of 10 checks passed
@Freax13 Freax13 deleted the tom/e2e-policy-change branch October 16, 2024 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PRs not listed in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants