Skip to content

Commit c5ce984

Browse files
committed
wolfcrypt/src/wc_xmss_impl.c:wc_xmssmt_sign_next_idx(): use (XmssIdx)1, not (word32)1, for a shift-by-height operand;
src/ssl.c:set_curves_list(): don't attempt to enable curves that are out-of-range for word32 disabled.
1 parent caaa9fe commit c5ce984

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/ssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21564,7 +21564,10 @@ int set_curves_list(WOLFSSL* ssl, WOLFSSL_CTX *ctx, const char* names,
2156421564
for (i = 0; i < groups_len; ++i) {
2156521565
/* Switch the bit to off and therefore is enabled. */
2156621566
curve = (word16)groups[i];
21567-
if (curve >= 32) {
21567+
if (curve >= 64) {
21568+
WC_DO_NOTHING;
21569+
}
21570+
else if (curve >= 32) {
2156821571
/* 0 is for invalid and 1-14 aren't used otherwise. */
2156921572
disabled &= ~(1U << (curve - 32));
2157021573
}

wolfcrypt/src/wc_xmss_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3926,7 +3926,7 @@ static int wc_xmssmt_sign_next_idx(XmssState* state, BdsState* bds, XmssIdx idx,
39263926
* next leaf in alt state is not last. */
39273927
if ((ret == 0) && (i > 0) && (updates > 0) &&
39283928
(idx_tree < ((XmssIdx)1 << (h - (hs * (i + 1))))) &&
3929-
(bds[alt_i].next < ((word32)1 << h))) {
3929+
(bds[alt_i].next < ((XmssIdx)1 << h))) {
39303930
xmss_idx_set_addr_tree(idx_tree, state->addr);
39313931
/* Update alternative BDS state. */
39323932
wc_xmss_bds_update(state, &bds[alt_i], sk_seed, pk_seed,

0 commit comments

Comments
 (0)