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

fix: p11prov_tls_constant_time_depadding bug corrected #438

Closed
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
4 changes: 2 additions & 2 deletions src/asymmetric_cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ p11prov_tls_constant_time_depadding(struct p11prov_rsaenc_ctx *encctx,
return RET_OSSL_ERR;
}

cond = constant_equal(*out_size, 2 + length);
cond = constant_equal(*out_size, length);

ver_cond = constant_equal(buf[0], encctx->tls_padding.client_ver_major);
ver_cond &= constant_equal(buf[1], encctx->tls_padding.client_ver_minor);
Expand All @@ -286,7 +286,7 @@ p11prov_tls_constant_time_depadding(struct p11prov_rsaenc_ctx *encctx,
}
cond &= ver_cond;

constant_select_buf(cond, length, out, buf + 2, randbuf);
constant_select_buf(cond, length, out, buf, randbuf);

*out_size = length;
*ret_cond = cond;
Expand Down