Skip to content

Commit

Permalink
fix: p11prov_tls_constant_time_depadding bug corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien ANDERT committed Sep 2, 2024
1 parent cbffce1 commit 438e490
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 438e490

Please sign in to comment.