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

Out-of-bounds memory read in 192 branch when N=24 #24

Open
wants to merge 2 commits into
base: 192
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions hss_verify_inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ bool hss_validate_signature_init(
ctx->signature_offset = signature - orig_signature;
ctx->signature_len = signature_len;

/* We have the public key in front of us; stash a copy */
/* Right now, we have a fixed length public key */
/* If that changes, we'll need to investigate the parmaeter set */
memcpy( ctx->final_public_key, public_key, 8 + I_LEN + MAX_HASH );

/* Now, initialize the context */
param_set_t ots_type = get_bigendian( public_key+4, 4 );

Expand All @@ -132,6 +127,10 @@ bool hss_validate_signature_init(
return false;
}
ctx->h = h;

/* We have the public key in front of us; stash a copy */
memcpy( ctx->final_public_key, public_key, 8 + I_LEN + n );

hss_init_hash_context( h, &ctx->hash_ctx );
{
unsigned char prefix[ MESG_PREFIX_MAXLEN ];
Expand Down