Merge pull request #8643 from kaleb-himes/KH-SRTP-REVIEW-rev1

Explicit API redirects for FIPS moving forward
This commit is contained in:
Sean Parkinson
2025-04-09 07:08:52 +10:00
committed by GitHub
3 changed files with 12 additions and 0 deletions

View File

@@ -169,6 +169,9 @@ int mp_init (mp_int * a)
/* clear one (frees) */
void mp_clear (mp_int * a)
{
#ifdef HAVE_FIPS
mp_forcezero(a);
#else
int i;
if (a == NULL)
@@ -194,6 +197,7 @@ void mp_clear (mp_int * a)
a->alloc = a->used = 0;
a->sign = MP_ZPOS;
}
#endif
}
void mp_free (mp_int * a)

View File

@@ -5268,6 +5268,9 @@ void sp_zero(sp_int* a)
*/
void sp_clear(sp_int* a)
{
#ifdef HAVE_FIPS
sp_forcezero(a);
#else
/* Clear when valid pointer passed in. */
if (a != NULL) {
unsigned int i;
@@ -5280,6 +5283,7 @@ void sp_clear(sp_int* a)
_sp_zero(a);
sp_free(a);
}
#endif
}
#if !defined(NO_RSA) || !defined(NO_DH) || defined(HAVE_ECC) || \

View File

@@ -4568,6 +4568,9 @@ void fp_zero(fp_int *a)
void fp_clear(fp_int *a)
{
#ifdef HAVE_FIPS
fp_forcezero(a);
#else
int size;
a->used = 0;
a->sign = FP_ZPOS;
@@ -4578,6 +4581,7 @@ void fp_clear(fp_int *a)
#endif
XMEMSET(a->dp, 0, size * sizeof(fp_digit));
fp_free(a);
#endif
}
void fp_forcezero (mp_int * a)