From 9afee96e42bccaead43e7234b9e48f0cb58e7ff6 Mon Sep 17 00:00:00 2001 From: "John M. Schanck" Date: Fri, 3 Mar 2023 21:43:37 +0000 Subject: Bug 1820175 - Fix unreachable code warning in fuzz builds. r=keeler Differential Revision: https://phabricator.services.mozilla.com/D171603 --- lib/freebl/rsa.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/freebl/rsa.c b/lib/freebl/rsa.c index 9a0edcaac..4dac95790 100644 --- a/lib/freebl/rsa.c +++ b/lib/freebl/rsa.c @@ -1313,10 +1313,16 @@ get_blinding_params(RSAPrivateKey *key, mp_int *n, unsigned int modLen, * Now, search its list of ready blinding params for a usable one. */ while (0 != (bp = rsabp->bp)) { -#ifndef UNSAFE_FUZZER_MODE - if (--(bp->counter) > 0) -#endif - { +#ifdef UNSAFE_FUZZER_MODE + /* Found a match and there are still remaining uses left */ + /* Return the parameters */ + CHECK_MPI_OK(mp_copy(&bp->f, f)); + CHECK_MPI_OK(mp_copy(&bp->g, g)); + + PZ_Unlock(blindingParamsList.lock); + return SECSuccess; +#else + if (--(bp->counter) > 0) { /* Found a match and there are still remaining uses left */ /* Return the parameters */ CHECK_MPI_OK(mp_copy(&bp->f, f)); @@ -1346,6 +1352,7 @@ get_blinding_params(RSAPrivateKey *key, mp_int *n, unsigned int modLen, } PZ_Unlock(blindingParamsList.lock); return SECSuccess; +#endif } /* We did not find a usable set of blinding params. Can we make one? */ /* Find a free bp struct. */ -- cgit v1.2.1