diff options
author | tb <> | 2024-10-31 14:58:22 +0000 |
---|---|---|
committer | tb <> | 2024-10-31 14:58:22 +0000 |
commit | 0e3dba5b6baf332335bf0fdd135743ba36e8c5d9 (patch) | |
tree | ea716d9d9656a84b62cd034145985694da3ab19c /src/lib/libcrypto/cms/cms_lib.c | |
parent | 88f9511e2c9117d0faf1b852ec3ddb362c212115 (diff) | |
download | openbsd-0e3dba5b6baf332335bf0fdd135743ba36e8c5d9.tar.gz openbsd-0e3dba5b6baf332335bf0fdd135743ba36e8c5d9.tar.bz2 openbsd-0e3dba5b6baf332335bf0fdd135743ba36e8c5d9.zip |
Rewrite i2o_ECPublicKey()
Turn the function into single exit and use ec_point_to_octets() to avoid
the point2oct dance. Ensure that the buf_len size_t doesn't get truncated
by the int return.
While we could avoid an allocation in case out == NULL, we don't do so.
In case out != NULL and *out != NULL this API assumes *out has sufficient
room, copies the result into it and advances *out past it. This is just
asking for trouble (of course, i2d has the same misfeature). Don't use
this if you can help it.
Unfortunately, OpenSSH couldn't help it in at least one spot (that one's
on BoringSSL's allocator not returning an allocated pointer that you can
pass to free). We had to do it lest people run RedHat patches of dubious
quality. For: FIPS the monkey must be pleased at all cost.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/cms/cms_lib.c')
0 files changed, 0 insertions, 0 deletions