summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authortb <>2025-01-05 16:07:08 +0000
committertb <>2025-01-05 16:07:08 +0000
commit2193869c42abbda84814f22a4ab38d0067921360 (patch)
tree01052cd554006bd8d0b366164df08e22b7dd6d57 /src/lib/libc/stdlib/malloc.c
parentdb85eb543d9f117c58266ef87044672cadbaa8be (diff)
downloadopenbsd-2193869c42abbda84814f22a4ab38d0067921360.tar.gz
openbsd-2193869c42abbda84814f22a4ab38d0067921360.tar.bz2
openbsd-2193869c42abbda84814f22a4ab38d0067921360.zip
Move BIGNUMs in EC_GROUP and EC_POINT to the heap
The only way to get an EC_GROUP or an EC_POINT is by calling the relevant _new() function and to get rid of it, something must call _free(). Thus we can establish the invariant that every group has Weierstrass coefficients p, a, b as well as order and cofactor hanging off it. Similarly, Every point has allocated BIGNUMs for its Jacobian projective coordinates. Unfortunately, a group has the generator as an optional component in addition to seed and montgomery context/one (where optionality makes more sense). This is a mostly mechanical diff and only drops a few silly comments and a couple of unnecessary NULL checks since in our part of the wrold the word invariant has a meaning. This should also appease Coverity who likes to throw fits at calling BN_free() for BIGNUM on the stack (yes, this is actually a thing). ok jsing
Diffstat (limited to 'src/lib/libc/stdlib/malloc.c')
0 files changed, 0 insertions, 0 deletions