Bug 1636389 - Relocate deprecated seed algorithm. r=kjacobs
authorBenjamin Beurdouche <bbeurdouche@mozilla.com>
Thu, 14 May 2020 18:26:54 +0000
changeset 15610 d2cfb4ccdf167e5ea06d2bb5bc39c50f789929c8
parent 15609 789d7241e1f008df82b09a441cad7f053d62252a
child 15611 daa823a4a29bcef0fec33a379ec83857429aea2e
push id3743
push userjjones@mozilla.com
push dateThu, 14 May 2020 20:56:23 +0000
reviewerskjacobs
bugs1636389
Bug 1636389 - Relocate deprecated seed algorithm. r=kjacobs Differential Revision: https://phabricator.services.mozilla.com/D74384
lib/freebl/Makefile
lib/freebl/deprecated/seed.c
lib/freebl/deprecated/seed.h
lib/freebl/freebl.gyp
lib/freebl/freebl_base.gypi
lib/freebl/seed.c
lib/freebl/seed.h
--- a/lib/freebl/Makefile
+++ b/lib/freebl/Makefile
@@ -541,17 +541,17 @@ ifneq ($(shell $(CC) -? 2>&1 >/dev/null 
 endif # lcc
 endif # USE_64
 
 ifndef HAVE_INT128_SUPPORT
     DEFINES += -DKRML_VERIFIED_UINT128
 endif
 
 ifndef NSS_DISABLE_DEPRECATED_SEED
-	CSRCS += seed.c
+	CSRCS += deprecated/seed.c
 endif
 
 ifndef NSS_DISABLE_CHACHAPOLY
     ifeq ($(CPU_ARCH),x86_64)
         ifndef NSS_DISABLE_AVX2
             EXTRA_SRCS += Hacl_Poly1305_256.c Hacl_Chacha20_Vec256.c Hacl_Chacha20Poly1305_256.c
         else
             EXTRA_SRCS += Hacl_Poly1305_128.c Hacl_Chacha20_Vec128.c Hacl_Chacha20Poly1305_128.c
@@ -587,22 +587,22 @@ include $(CORE_DEPTH)/coreconf/rules.mk
 #######################################################################
 
 
 rijndael_tables:
 	$(CC) -o $(OBJDIR)/make_rijndael_tab rijndael_tables.c \
 	         $(DEFINES) $(INCLUDES) $(OBJDIR)/libfreebl.a
 	$(OBJDIR)/make_rijndael_tab
 
-vpath %.h mpi ecl verified
-vpath %.c mpi ecl verified
+vpath %.h mpi ecl verified deprecated
+vpath %.c mpi ecl verified deprecated
 vpath %.S mpi ecl
 vpath %.s mpi ecl
 vpath %.asm mpi ecl
-INCLUDES += -Impi -Iecl -Iverified -Iverified/kremlin/include -Iverified/kremlin/kremlib/dist/minimal
+INCLUDES += -Impi -Iecl -Iverified -Iverified/kremlin/include -Iverified/kremlin/kremlib/dist/minimal -Ideprecated
 
 
 DEFINES += -DMP_API_COMPATIBLE
 
 MPI_USERS = dh.c pqg.c dsa.c rsa.c ec.c
 
 MPI_OBJS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), $(MPI_SRCS:.c=$(OBJ_SUFFIX)))
 MPI_OBJS += $(addprefix $(OBJDIR)/$(PROG_PREFIX), $(MPI_USERS:.c=$(OBJ_SUFFIX)))
rename from lib/freebl/seed.c
rename to lib/freebl/deprecated/seed.c
--- a/lib/freebl/seed.c
+++ b/lib/freebl/deprecated/seed.c
@@ -1,14 +1,14 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifdef FREEBL_NO_DEPEND
-#include "stubs.h"
+#include "../stubs.h"
 #endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stddef.h>
 #ifdef WIN32
 #include <memory.h>
rename from lib/freebl/seed.h
rename to lib/freebl/deprecated/seed.h
--- a/lib/freebl/freebl.gyp
+++ b/lib/freebl/freebl.gyp
@@ -588,16 +588,17 @@
   ],
   'target_defaults': {
     'include_dirs': [
       'mpi',
       'ecl',
       'verified',
       'verified/kremlin/include',
       'verified/kremlin/kremlib/dist/minimal',
+      'deprecated',
     ],
     'defines': [
       'SHLIB_SUFFIX=\"<(dll_suffix)\"',
       'SHLIB_PREFIX=\"<(dll_prefix)\"',
       'SHLIB_VERSION=\"3\"',
       'SOFTOKEN_SHLIB_VERSION=\"3\"',
       'RIJNDAEL_INCLUDE_TABLES',
       'MP_API_COMPATIBLE'
--- a/lib/freebl/freebl_base.gypi
+++ b/lib/freebl/freebl_base.gypi
@@ -159,17 +159,17 @@
       'sources': [
         'verified/Hacl_Chacha20.c',
         'verified/Hacl_Chacha20Poly1305_32.c',
         'verified/Hacl_Poly1305_32.c',
       ],
     }],
     [ 'disable_deprecated_seed==0', {
       'sources': [
-        'seed.c',
+        'deprecated/seed.c',
       ],
     }],
     [ 'fuzz==1', {
       'sources!': [ 'drbg.c' ],
       'sources': [ 'det_rng.c' ],
     }],
     [ 'fuzz_tls==1', {
       'defines': [