summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/p_lib.c
diff options
context:
space:
mode:
authortb <>2023-12-25 22:02:59 +0000
committertb <>2023-12-25 22:02:59 +0000
commita42068ce674b48e2f26710269f43fa6c18e895dc (patch)
tree90d476cacff75c553be0c9a1bd40589eff75659d /src/lib/libcrypto/evp/p_lib.c
parent4e938e1bcd14ffc64708396f95e6e91a09735e32 (diff)
downloadopenbsd-a42068ce674b48e2f26710269f43fa6c18e895dc.tar.gz
openbsd-a42068ce674b48e2f26710269f43fa6c18e895dc.tar.bz2
openbsd-a42068ce674b48e2f26710269f43fa6c18e895dc.zip
Avoid out-of-bounds accesses in ASN1_BIT_STRING_{get,set}()
If a negative n is passed, these functions would underrun the bitstring's data array. So add checks for that and drop spades of unnecessary parens. These functions are quite broken anyway. The setter attempts to zap the unnecessary trailing zero octets, but fails to do so if the bit being cleared isn't already set. Worse is the getter where you can't tell an error (like attempting an out-of-bounds read) from the bit being unset. ok joshua
Diffstat (limited to 'src/lib/libcrypto/evp/p_lib.c')
0 files changed, 0 insertions, 0 deletions