提交 45fb7379 编写于 作者: B Bodo Möller

reference counting for EC_GROUP structures is not needed (at the

moment at least), so remove it
上级 a01273ba
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
extracted before the specific public key. extracted before the specific public key.
[Nils Larsch <nla@trustcenter.de>] [Nils Larsch <nla@trustcenter.de>]
*) Add reference counting for EC_GROUP objects.
[Nils Larsch <nla@trustcenter.de>]
*) Include some named elliptic curves. These can be obtained from *) Include some named elliptic curves. These can be obtained from
the new functions the new functions
EC_GROUP_new_by_nid() EC_GROUP_new_by_nid()
......
...@@ -166,7 +166,6 @@ struct ec_group_st { ...@@ -166,7 +166,6 @@ struct ec_group_st {
EC_POINT *generator; /* optional */ EC_POINT *generator; /* optional */
BIGNUM order, cofactor; BIGNUM order, cofactor;
int references;
int nid; int nid;
void *field_data1; /* method-specific (e.g., Montgomery structure) */ void *field_data1; /* method-specific (e.g., Montgomery structure) */
......
...@@ -96,8 +96,6 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth) ...@@ -96,8 +96,6 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
ret->nid = 0; ret->nid = 0;
ret->references = 1;
if (!meth->group_init(ret)) if (!meth->group_init(ret))
{ {
OPENSSL_free(ret); OPENSSL_free(ret);
...@@ -110,12 +108,6 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth) ...@@ -110,12 +108,6 @@ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
void EC_GROUP_free(EC_GROUP *group) void EC_GROUP_free(EC_GROUP *group)
{ {
int i;
i = CRYPTO_add(&group->references, -1, CRYPTO_LOCK_EC);
if (i > 0)
return;
if (group->meth->group_finish != 0) if (group->meth->group_finish != 0)
group->meth->group_finish(group); group->meth->group_finish(group);
...@@ -127,12 +119,6 @@ void EC_GROUP_free(EC_GROUP *group) ...@@ -127,12 +119,6 @@ void EC_GROUP_free(EC_GROUP *group)
void EC_GROUP_clear_free(EC_GROUP *group) void EC_GROUP_clear_free(EC_GROUP *group)
{ {
int i;
i = CRYPTO_add(&group->references, -1, CRYPTO_LOCK_EC);
if (i > 0)
return;
if (group->meth->group_clear_finish != 0) if (group->meth->group_clear_finish != 0)
group->meth->group_clear_finish(group); group->meth->group_clear_finish(group);
else if (group->meth != NULL && group->meth->group_finish != 0) else if (group->meth != NULL && group->meth->group_finish != 0)
...@@ -314,14 +300,14 @@ void EC_GROUP_clear_free_extra_data(EC_GROUP *group) ...@@ -314,14 +300,14 @@ void EC_GROUP_clear_free_extra_data(EC_GROUP *group)
} }
void EC_GROUP_set_nid(EC_GROUP *group, int nid) void EC_GROUP_set_nid(EC_GROUP *group, int nid)
{ {
group->nid = nid; group->nid = nid;
} }
int EC_GROUP_get_nid(const EC_GROUP *group) int EC_GROUP_get_nid(const EC_GROUP *group)
{ {
return group->nid; return group->nid;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册