diff options
author | jsing <> | 2023-03-08 05:45:31 +0000 |
---|---|---|
committer | jsing <> | 2023-03-08 05:45:31 +0000 |
commit | f59a5e932baaa204327818534b8c93267c20bed0 (patch) | |
tree | 96a3d2dbc6ef11df6851b53d3d2e1c46dd7f2328 /src/lib/libcrypto/ec/ec.h | |
parent | 49f24f2af100d1cc94534c31f0db0ac8072ee4ac (diff) | |
download | openbsd-f59a5e932baaa204327818534b8c93267c20bed0.tar.gz openbsd-f59a5e932baaa204327818534b8c93267c20bed0.tar.bz2 openbsd-f59a5e932baaa204327818534b8c93267c20bed0.zip |
Always clear EC groups and points on free.
Rather than sometimes clearing, turn the free functions into ones that
always clear (as we've done elsewhere). Turn the EC_GROUP_clear_free() and
EC_POINT_clear_free() functions into wrappers that call the *_free()
version. Do similar for the EC_METHOD implementations, removing the
group_clear_finish() and point_clear_finish() hooks in the process.
ok tb@
Diffstat (limited to 'src/lib/libcrypto/ec/ec.h')
-rw-r--r-- | src/lib/libcrypto/ec/ec.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h index 8cafc5522f..8ba62c8784 100644 --- a/src/lib/libcrypto/ec/ec.h +++ b/src/lib/libcrypto/ec/ec.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec.h,v 1.30 2022/12/26 07:18:51 jmc Exp $ */ | 1 | /* $OpenBSD: ec.h,v 1.31 2023/03/08 05:45:31 jsing 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 | */ |
@@ -198,7 +198,9 @@ void EC_GROUP_free(EC_GROUP *group); | |||
198 | /** Clears and frees a EC_GROUP object | 198 | /** Clears and frees a EC_GROUP object |
199 | * \param group EC_GROUP object to be cleared and freed. | 199 | * \param group EC_GROUP object to be cleared and freed. |
200 | */ | 200 | */ |
201 | #ifndef LIBRESSL_INTERNAL | ||
201 | void EC_GROUP_clear_free(EC_GROUP *group); | 202 | void EC_GROUP_clear_free(EC_GROUP *group); |
203 | #endif | ||
202 | 204 | ||
203 | /** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD. | 205 | /** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD. |
204 | * \param dst destination EC_GROUP object | 206 | * \param dst destination EC_GROUP object |
@@ -425,7 +427,9 @@ void EC_POINT_free(EC_POINT *point); | |||
425 | /** Clears and frees a EC_POINT object | 427 | /** Clears and frees a EC_POINT object |
426 | * \param point EC_POINT object to be cleared and freed | 428 | * \param point EC_POINT object to be cleared and freed |
427 | */ | 429 | */ |
430 | #ifndef LIBRESSL_INTERNAL | ||
428 | void EC_POINT_clear_free(EC_POINT *point); | 431 | void EC_POINT_clear_free(EC_POINT *point); |
432 | #endif | ||
429 | 433 | ||
430 | /** Copies EC_POINT object | 434 | /** Copies EC_POINT object |
431 | * \param dst destination EC_POINT object | 435 | * \param dst destination EC_POINT object |