194c062b5d
nss-fips-aes-keywrap-post.patch nss-fips-approved-crypto-non-ec.patch nss-fips-cavs-dsa-fixes.patch nss-fips-cavs-general.patch nss-fips-cavs-kas-ecc.patch nss-fips-cavs-kas-ffc.patch nss-fips-cavs-keywrap.patch nss-fips-cavs-rsa-fixes.patch nss-fips-combined-hash-sign-dsa-ecdsa.patch nss-fips-constructor-self-tests.patch nss-fips-detect-fips-mode-fixes.patch nss-fips-dsa-kat.patch nss-fips-gcm-ctr.patch nss-fips-pairwise-consistency-check.patch nss-fips-rsa-keygen-strictness.patch nss-fips-tls-allow-md5-prf.patch nss-fips-use-getrandom.patch nss-fips-use-strong-random-pool.patch nss-fips-zeroization.patch nss-fix-dh-pkcs-derive-inverted-logic.patch - update to NSS 3.53.1 * required for Firefox 78 * CVE-2020-12402 - Use constant-time GCD and modular inversion in MPI. (bmo#1631597, bsc#1173032) - update to NSS 3.53 Notable changes * SEED is now moved into a new freebl directory freebl/deprecated OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/mozilla-nss?expand=0&rev=326
52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
# HG changeset patch
|
|
# User Hans Petter Jansson <hpj@cl.no>
|
|
# Date 1574240799 -3600
|
|
# Wed Nov 20 10:06:39 2019 +0100
|
|
# Node ID 4ddd7d49eeed4ea32850daf41a472ccb50dee45e
|
|
# Parent 0efca22bbafd7575b20461f255c46157c9321822
|
|
[PATCH] 31
|
|
From a7cbf64ba8ac07a4a1fdea91f39da56d86af03bf Mon Sep 17 00:00:00 2001
|
|
---
|
|
nss/lib/freebl/unix_rand.c | 8 +++++---
|
|
1 file changed, 5 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/lib/freebl/unix_rand.c b/lib/freebl/unix_rand.c
|
|
--- a/lib/freebl/unix_rand.c
|
|
+++ b/lib/freebl/unix_rand.c
|
|
@@ -24,6 +24,7 @@
|
|
#include "prthread.h"
|
|
#include "prprf.h"
|
|
#include "prenv.h"
|
|
+#include "fips.h"
|
|
|
|
#ifdef NSS_USE_GETRANDOM
|
|
# ifndef __NR_getrandom
|
|
@@ -779,7 +780,7 @@
|
|
}
|
|
|
|
/* grab some data from system's PRNG before any other files. */
|
|
- bytes = RNG_FileUpdate("/dev/urandom", SYSTEM_RNG_SEED_COUNT);
|
|
+ bytes = RNG_FileUpdate(FIPS_mode() ? "/dev/random" : "/dev/urandom", SYSTEM_RNG_SEED_COUNT);
|
|
if (!bytes) {
|
|
PORT_SetError(SEC_ERROR_NEED_RANDOM);
|
|
}
|
|
@@ -909,7 +910,8 @@
|
|
int ret;
|
|
|
|
do {
|
|
- ret = syscall(__NR_getrandom, buf + inBytes, maxLen - inBytes, 0);
|
|
+ ret = syscall(__NR_getrandom, buf + inBytes, maxLen - inBytes,
|
|
+ FIPS_mode () ? GRND_RANDOM : 0);
|
|
|
|
if (0 < ret)
|
|
inBytes += ret;
|
|
@@ -929,7 +931,7 @@
|
|
size_t fileBytes = 0;
|
|
unsigned char *buffer = dest;
|
|
|
|
- file = fopen("/dev/urandom", "r");
|
|
+ file = fopen(FIPS_mode() ? "/dev/random" : "/dev/urandom", "r");
|
|
if (file == NULL) {
|
|
PORT_SetError(SEC_ERROR_NEED_RANDOM);
|
|
return 0;
|