diff options
author | John M. Schanck <jschanck@mozilla.com> | 2023-03-03 21:43:37 +0000 |
---|---|---|
committer | John M. Schanck <jschanck@mozilla.com> | 2023-03-03 21:43:37 +0000 |
commit | 9afee96e42bccaead43e7234b9e48f0cb58e7ff6 (patch) | |
tree | d70ac25e3d1776df9213d580afd076ac7e500e59 | |
parent | fcdd8f6f67f6e8456b3e24e7b32e66dd1d3766fa (diff) | |
download | nss-hg-9afee96e42bccaead43e7234b9e48f0cb58e7ff6.tar.gz |
Bug 1820175 - Fix unreachable code warning in fuzz builds. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D171603
-rw-r--r-- | lib/freebl/rsa.c | 15 |
1 files 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. */ |