-/* $OpenBSD: bn_blind.c,v 1.19 2022/11/26 16:08:51 tb Exp $ */
+/* $OpenBSD: bn_blind.c,v 1.20 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
if (r == NULL)
return;
- BN_clear_free(r->A);
- BN_clear_free(r->Ai);
- BN_clear_free(r->e);
- BN_clear_free(r->mod);
+ BN_free(r->A);
+ BN_free(r->Ai);
+ BN_free(r->e);
+ BN_free(r->mod);
free(r);
}
-/* $OpenBSD: bn_sqrt.c,v 1.14 2022/11/26 16:08:51 tb Exp $ */
+/* $OpenBSD: bn_sqrt.c,v 1.15 2023/03/07 09:27:10 jsing Exp $ */
/* Written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* and Bodo Moeller for the OpenSSL project. */
/* ====================================================================
end:
if (err) {
if (ret != NULL && ret != in) {
- BN_clear_free(ret);
+ BN_free(ret);
}
ret = NULL;
}
-/* $OpenBSD: dh_lib.c,v 1.37 2022/06/27 12:31:38 tb Exp $ */
+/* $OpenBSD: dh_lib.c,v 1.38 2023/03/07 09:27:10 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DH, r, &r->ex_data);
- BN_clear_free(r->p);
- BN_clear_free(r->g);
- BN_clear_free(r->q);
- BN_clear_free(r->j);
+ BN_free(r->p);
+ BN_free(r->g);
+ BN_free(r->q);
+ BN_free(r->j);
free(r->seed);
- BN_clear_free(r->counter);
- BN_clear_free(r->pub_key);
- BN_clear_free(r->priv_key);
+ BN_free(r->counter);
+ BN_free(r->pub_key);
+ BN_free(r->priv_key);
free(r);
}
-/* $OpenBSD: dsa_asn1.c,v 1.28 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: dsa_asn1.c,v 1.29 2023/03/07 09:27:10 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
if (r == NULL || s == NULL)
return 0;
- BN_clear_free(sig->r);
+ BN_free(sig->r);
sig->r = r;
- BN_clear_free(sig->s);
+ BN_free(sig->s);
sig->s = s;
return 1;
-/* $OpenBSD: dsa_lib.c,v 1.40 2023/03/04 20:54:52 tb Exp $ */
+/* $OpenBSD: dsa_lib.c,v 1.41 2023/03/07 09:27:10 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_DSA, r, &r->ex_data);
- BN_clear_free(r->p);
- BN_clear_free(r->q);
- BN_clear_free(r->g);
- BN_clear_free(r->pub_key);
- BN_clear_free(r->priv_key);
- BN_clear_free(r->kinv);
- BN_clear_free(r->r);
+ BN_free(r->p);
+ BN_free(r->q);
+ BN_free(r->g);
+ BN_free(r->pub_key);
+ BN_free(r->priv_key);
+ BN_free(r->kinv);
+ BN_free(r->r);
free(r);
}
-/* $OpenBSD: ec2_smpl.c,v 1.30 2023/03/07 05:50:59 jsing Exp $ */
+/* $OpenBSD: ec2_smpl.c,v 1.31 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
static void
ec_GF2m_simple_group_clear_finish(EC_GROUP *group)
{
- BN_clear_free(&group->field);
- BN_clear_free(&group->a);
- BN_clear_free(&group->b);
+ BN_free(&group->field);
+ BN_free(&group->a);
+ BN_free(&group->b);
group->poly[0] = 0;
group->poly[1] = 0;
group->poly[2] = 0;
static void
ec_GF2m_simple_point_clear_finish(EC_POINT *point)
{
- BN_clear_free(&point->X);
- BN_clear_free(&point->Y);
- BN_clear_free(&point->Z);
+ BN_free(&point->X);
+ BN_free(&point->Y);
+ BN_free(&point->Z);
point->Z_is_one = 0;
}
-/* $OpenBSD: ec_key.c,v 1.30 2023/01/14 15:10:45 jsing Exp $ */
+/* $OpenBSD: ec_key.c,v 1.31 2023/03/07 09:27:10 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
EC_GROUP_free(r->group);
EC_POINT_free(r->pub_key);
- BN_clear_free(r->priv_key);
+ BN_free(r->priv_key);
EC_EX_DATA_free_all_data(&r->method_data);
-/* $OpenBSD: ec_lib.c,v 1.48 2023/02/07 09:00:48 tb Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.49 2023/03/07 09:27:10 jsing Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
EC_EX_DATA_clear_free_all_data(&group->extra_data);
EC_POINT_clear_free(group->generator);
- BN_clear_free(&group->order);
- BN_clear_free(&group->cofactor);
+ BN_free(&group->order);
+ BN_free(&group->cofactor);
freezero(group->seed, group->seed_len);
freezero(group, sizeof *group);
-/* $OpenBSD: ec_print.c,v 1.9 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: ec_print.c,v 1.10 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
ret = EC_POINT_bn2point(group, tmp_bn, point, ctx);
- BN_clear_free(tmp_bn);
+ BN_free(tmp_bn);
return ret;
}
-/* $OpenBSD: ecp_smpl.c,v 1.39 2023/03/07 05:54:40 jsing Exp $ */
+/* $OpenBSD: ecp_smpl.c,v 1.40 2023/03/07 09:27:10 jsing Exp $ */
/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
* for the OpenSSL project.
* Includes code written by Bodo Moeller for the OpenSSL project.
void
ec_GFp_simple_group_clear_finish(EC_GROUP *group)
{
- BN_clear_free(&group->field);
- BN_clear_free(&group->a);
- BN_clear_free(&group->b);
+ BN_free(&group->field);
+ BN_free(&group->a);
+ BN_free(&group->b);
}
int
void
ec_GFp_simple_point_clear_finish(EC_POINT *point)
{
- BN_clear_free(&point->X);
- BN_clear_free(&point->Y);
- BN_clear_free(&point->Z);
+ BN_free(&point->X);
+ BN_free(&point->Y);
+ BN_free(&point->Z);
point->Z_is_one = 0;
}
* locally!
*/
for (i = pow2 / 2 - 1; i > 0; i--) {
- BN_clear_free(heap[i]);
+ BN_free(heap[i]);
}
free(heap);
}
-/* $OpenBSD: ecs_asn1.c,v 1.12 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: ecs_asn1.c,v 1.13 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved.
*
if (r == NULL || s == NULL)
return 0;
- BN_clear_free(sig->r);
- BN_clear_free(sig->s);
+ BN_free(sig->r);
+ BN_free(sig->s);
sig->r = r;
sig->s = s;
return 1;
-/* $OpenBSD: ecs_lib.c,v 1.15 2022/11/26 16:08:52 tb Exp $ */
+/* $OpenBSD: ecs_lib.c,v 1.16 2023/03/07 09:27:10 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
ret = 0;
err:
- BN_clear_free(order);
+ BN_free(order);
return ret;
}
-/* $OpenBSD: ecs_ossl.c,v 1.28 2023/03/04 21:39:34 tb Exp $ */
+/* $OpenBSD: ecs_ossl.c,v 1.29 2023/03/07 09:27:10 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
ECDSAerror(ERR_R_BN_LIB);
goto err;
}
- BN_clear_free(*rp);
- BN_clear_free(*kinvp);
+ BN_free(*rp);
+ BN_free(*kinvp);
*rp = r;
*kinvp = k;
ret = 1;
err:
if (ret == 0) {
- BN_clear_free(k);
- BN_clear_free(r);
+ BN_free(k);
+ BN_free(r);
}
if (ctx_in == NULL)
BN_CTX_free(ctx);
BN_free(order);
EC_POINT_free(point);
- BN_clear_free(X);
+ BN_free(X);
return (ret);
}
ret = NULL;
}
BN_CTX_free(ctx);
- BN_clear_free(b);
- BN_clear_free(binv);
- BN_clear_free(bm);
- BN_clear_free(bxr);
- BN_clear_free(kinv);
- BN_clear_free(m);
+ BN_free(b);
+ BN_free(binv);
+ BN_free(bm);
+ BN_free(bxr);
+ BN_free(kinv);
+ BN_free(m);
BN_free(order);
BN_free(range);
return ret;
-/* $OpenBSD: gostr341001_key.c,v 1.11 2023/01/15 13:58:44 tb Exp $ */
+/* $OpenBSD: gostr341001_key.c,v 1.12 2023/03/07 09:27:10 jsing Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
EC_GROUP_free(r->group);
EC_POINT_free(r->pub_key);
- BN_clear_free(r->priv_key);
+ BN_free(r->priv_key);
freezero(r, sizeof(GOST_KEY));
}
int
GOST_KEY_set_private_key(GOST_KEY *key, const BIGNUM *priv_key)
{
- BN_clear_free(key->priv_key);
+ BN_free(key->priv_key);
key->priv_key = BN_dup(priv_key);
return (key->priv_key == NULL) ? 0 : 1;
}
return 0;
if (EC_GROUP_get_order(group, order, NULL) == 0) {
- BN_clear_free(order);
+ BN_free(order);
return 0;
}
i = BN_num_bytes(order);
- BN_clear_free(order);
+ BN_free(order);
return (i);
}
#endif
-/* $OpenBSD: rsa_lib.c,v 1.44 2022/11/26 16:08:54 tb Exp $ */
+/* $OpenBSD: rsa_lib.c,v 1.45 2023/03/07 09:27:10 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
CRYPTO_free_ex_data(CRYPTO_EX_INDEX_RSA, r, &r->ex_data);
- BN_clear_free(r->n);
- BN_clear_free(r->e);
- BN_clear_free(r->d);
- BN_clear_free(r->p);
- BN_clear_free(r->q);
- BN_clear_free(r->dmp1);
- BN_clear_free(r->dmq1);
- BN_clear_free(r->iqmp);
+ BN_free(r->n);
+ BN_free(r->e);
+ BN_free(r->d);
+ BN_free(r->p);
+ BN_free(r->q);
+ BN_free(r->dmp1);
+ BN_free(r->dmq1);
+ BN_free(r->iqmp);
BN_BLINDING_free(r->blinding);
BN_BLINDING_free(r->mt_blinding);
RSA_PSS_PARAMS_free(r->pss);