diff options
author | Richard Levitte <levitte@openssl.org> | 2002-11-28 08:04:36 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-11-28 08:04:36 +0000 |
commit | 4579924b7e55fccc7013e6de196f2e2ab175ce39 (patch) | |
tree | fa19611a704cc901d3ba338cefbbb98878de7ee5 /crypto/ec | |
parent | 2047bda6fb8bedab1103b7bd5df5ea55eb7ccc9b (diff) | |
download | openssl-4579924b7e55fccc7013e6de196f2e2ab175ce39.tar.gz |
Cleanse memory using the new OPENSSL_cleanse() function.
I've covered all the memset()s I felt safe modifying, but may have missed some.
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec_key.c | 2 | ||||
-rw-r--r-- | crypto/ec/ec_lib.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index d537fe7de6..d7758c91d3 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -118,7 +118,7 @@ void EC_KEY_free(EC_KEY *r) if (r->meth_data && r->meth_data->finish) r->meth_data->finish(r); - memset((void *)r, 0x0, sizeof(EC_KEY)); + OPENSSL_cleanse((void *)r, sizeof(EC_KEY)); OPENSSL_free(r); } diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 9669f42aab..2cc0dc0ec1 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -162,11 +162,11 @@ void EC_GROUP_clear_free(EC_GROUP *group) if (group->seed) { - memset(group->seed, 0, group->seed_len); + OPENSSL_cleanse(group->seed, group->seed_len); OPENSSL_free(group->seed); } - memset(group, 0, sizeof *group); + OPENSSL_cleanse(group, sizeof *group); OPENSSL_free(group); } @@ -591,7 +591,7 @@ void EC_POINT_clear_free(EC_POINT *point) point->meth->point_clear_finish(point); else if (point->meth != NULL && point->meth->point_finish != 0) point->meth->point_finish(point); - memset(point, 0, sizeof *point); + OPENSSL_cleanse(point, sizeof *point); OPENSSL_free(point); } |