diff options
| author | tb <> | 2025-12-26 18:41:05 +0000 |
|---|---|---|
| committer | tb <> | 2025-12-26 18:41:05 +0000 |
| commit | 9f98bd62b5811dc1239ca4a121b39c3d962c73c2 (patch) | |
| tree | fd09183064be2434ff34bf37bf3b51ec876d957d /src/lib/libcrypto/ec/ec_lib.c | |
| parent | 07a51ef39a66b69f85c35d11f0f5d8b9a351c25e (diff) | |
| download | openbsd-9f98bd62b5811dc1239ca4a121b39c3d962c73c2.tar.gz openbsd-9f98bd62b5811dc1239ca4a121b39c3d962c73c2.tar.bz2 openbsd-9f98bd62b5811dc1239ca4a121b39c3d962c73c2.zip | |
Add nid to EC_POINT for compat checking
It is annoying that an EC_POINT does not really know on what EC_GROUP it
lives. Adding a refcount to EC_GROUP is slightly tricky, so instead use
a nid which we will know unless the group was constructed by hand.
ok jsing kenjiro
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 36f42ecc05..b31c132a77 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_lib.c,v 1.126 2025/08/02 15:47:27 jsing Exp $ */ | 1 | /* $OpenBSD: ec_lib.c,v 1.127 2025/12/26 18:41:05 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -815,6 +815,7 @@ EC_POINT_new(const EC_GROUP *group) | |||
| 815 | goto err; | 815 | goto err; |
| 816 | 816 | ||
| 817 | point->meth = group->meth; | 817 | point->meth = group->meth; |
| 818 | point->nid = group->nid; | ||
| 818 | 819 | ||
| 819 | return point; | 820 | return point; |
| 820 | 821 | ||
| @@ -856,6 +857,8 @@ EC_POINT_copy(EC_POINT *dst, const EC_POINT *src) | |||
| 856 | if (dst == src) | 857 | if (dst == src) |
| 857 | return 1; | 858 | return 1; |
| 858 | 859 | ||
| 860 | dst->nid = src->nid; | ||
| 861 | |||
| 859 | if (!bn_copy(dst->X, src->X)) | 862 | if (!bn_copy(dst->X, src->X)) |
| 860 | return 0; | 863 | return 0; |
| 861 | if (!bn_copy(dst->Y, src->Y)) | 864 | if (!bn_copy(dst->Y, src->Y)) |
