GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — use an unsigned accumulator in base64_encode by metsw24-max · Pull Request #2477 · yhirose/cpp-httplib Conversation
Contributor
base64_encode folds each input byte into a signed int and shifts it left by eight every round; once four bytes are in, the top bit is set and the next shift left-shifts a negative int, which is undefined behaviour (ubsan reports a left shift of a negative value, and the same shift recurs in the trailing six-bit fixup). the helper runs on the server's websocket accept-key path over the sha1 digest and in the basic-auth header builder, so it is reachable from request handling. making the accumulator a uint32_t removes the ub and keeps the output byte-for-byte identical, since every emitted six-bit group is masked with 0x3f and is independent of the accumulator's signedness. the added test pins the rfc 4648 vectors plus a high-byte input that keeps the top bit set across rounds.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Owner
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Owner
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |