Fixes
1643092 and
1643093
Neither of these are major issues, but fixed anyway..
i.e. 1<<hm is bounded by the parameter set so this is not an issue
Not checking an error from WPACKET_memcpy() would also not cause an
issue.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/26835)
* i.e. A & (0xFFFF_FFFF_FFFF_FFFF >> (64 - X))
*/
tree_id_mask = (~(uint64_t)0) >> (64 - (params->h - params->hm));
- leaf_id_mask = (1 << params->hm) - 1; /* max value is 0x1FF when hm = 9 */
+ leaf_id_mask = ((uint64_t)1 << params->hm) - 1; /* max value is 0x1FF when hm = 9 */
*tree_id = bytes_to_u64_be(tree_id_bytes, tree_id_len) & tree_id_mask;
*leaf_id = (uint32_t)(bytes_to_u64_be(leaf_id_bytes, leaf_id_len) & leaf_id_mask);
return 1;
return 0;
node_id >>= 1; /* Get the parent node id */
tree_offset >>= 1; /* Each layer up has half as many nodes */
- WPACKET_memcpy(sig_wpkt, out, n);
+ if (!WPACKET_memcpy(sig_wpkt, out, n))
+ return 0;
}
tree_id_times_two_power_a += two_power_a;
}