Skip to content

stc-nettle: initialize base64 decode buffer length#82

Open
felixonmars wants to merge 1 commit into
stoken-dev:mainfrom
felixonmars:patch-1
Open

stc-nettle: initialize base64 decode buffer length#82
felixonmars wants to merge 1 commit into
stoken-dev:mainfrom
felixonmars:patch-1

Conversation

@felixonmars
Copy link
Copy Markdown

nettle's base64_decode_update() treats *dst_length as the size of the output buffer on input and updates it with the number of bytes written on success.

stoken passed an uninitialized local variable for that argument, which makes SDTID import depend on stack contents. In practice this can make valid SDTID test fixtures fail to decode their Seed field with 'missing required xml node Seed'.

Initialize dst_length to the size of the temporary decode buffer before calling into nettle.

nettle's base64_decode_update() treats *dst_length as the size of the output buffer on input and updates it with the number of bytes written on success.

stoken passed an uninitialized local variable for that argument, which makes SDTID import depend on stack contents. In practice this can make valid SDTID test fixtures fail to decode their Seed field with 'missing required xml node Seed'.

Initialize dst_length to the size of the temporary decode buffer before calling into nettle.
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.

1 participant