CVSROOT:        /cvs
Module name:    src
Changes by:     t...@cvs.openbsd.org    2024/11/08 15:03:29

Modified files:
        lib/libcrypto/ec: ec_key.c 

Log message:
Sweep over EC_KEY_copy()

This is a special snowflake. Its logic is such that it only overwrites
things on the target that are available in the source. So if the source
has no group (yes, that's possible), the destination's group will remain.

Even better: if you copy a public key over what was previously a private
key, the private scalar will remain. That's almost never going to result
in a valid key. If you copy from a larger group to a smaller group the
private scalar will most likely be out of range [1, order).

Use dup functions instead of reimplementing badly and add a snarky comment
courtesy of beck to one of those silly const annotations (there's a small
addendum by me).

ok beck jsing

Reply via email to