diff options
| author | Peter Jones <pjones@redhat.com> | 2023-07-27 15:13:08 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2023-12-05 13:17:19 -0500 |
| commit | f27182695d88350b48c8b9a6dce54bb513d7aa4e (patch) | |
| tree | 97ba54e76007ddbe9effcd32f0be0eb7c99ab0cd /Cryptlib/opensslconf-diff.patch | |
| parent | 66e6579dbf921152f647a0c16da1d3b2f40861ca (diff) | |
| download | efi-boot-shim-f27182695d88350b48c8b9a6dce54bb513d7aa4e.tar.gz efi-boot-shim-f27182695d88350b48c8b9a6dce54bb513d7aa4e.zip | |
Add primitives for overflow-checked arithmetic operations.
We need to do arithmetic on untrusted values sometimes, so this patch
adds the following primitives as macros that wrap the compiler builtins.
bool checked_add(TYPE addend0, TYPE addend1, TYPE *sum)
bool checked_sub(TYPE minuend, TYPE subtrahend, TYPE *difference)
bool checked_mul(TYPE factor0, TYPE factor1, TYPE *product)
And also the following primitive which returns True if divisor is 0 and
False otherwise:
bool checked_div(TYPE dividend, TYPE divisor, TYPE *quotient)
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'Cryptlib/opensslconf-diff.patch')
0 files changed, 0 insertions, 0 deletions
