re-introduce old nss im too tired for this

This commit is contained in:
wuggy 2026-06-30 06:37:32 +01:00
commit 3a838106b9
2871 changed files with 1374431 additions and 1762417 deletions

0
security/nss/cmd/pk11mode/Makefile Executable file → Normal file
View file

View file

@ -7,6 +7,8 @@ CORE_DEPTH = ../..
MODULE = nss
EXPORTS =
CSRCS = pk11mode.c
PROGRAM = pk11mode

View file

@ -16,7 +16,7 @@
#include <string.h>
#include <stdarg.h>
#if defined(XP_UNIX) && defined(DO_FORK_CHECK)
#if defined(XP_UNIX) && !defined(NO_FORK_CHECK)
#include <unistd.h>
#include <sys/wait.h>
#else
@ -96,7 +96,8 @@ int MODE = FIPSMODE;
CK_BBOOL true = CK_TRUE;
CK_BBOOL false = CK_FALSE;
static const CK_BYTE PLAINTEXT[] = { "Firefox Rules!" };
static const CK_BYTE PLAINTEXT_PAD[] = { "Firefox and thunderbird rule the world!" };
static const CK_BYTE PLAINTEXT_PAD[] =
{ "Firefox and thunderbird rule the world!" };
CK_ULONG NUMTESTS = 0;
static const char *slotFlagName[] = {
@ -322,7 +323,6 @@ main(int argc, char **argv)
CK_FUNCTION_LIST_PTR pFunctionList;
CK_RV crv = CKR_OK;
CK_C_INITIALIZE_ARGS_NSS initArgs;
CK_C_INITIALIZE_ARGS_NSS initArgsRerun; /* rerun selftests */
CK_SLOT_ID *pSlotList = NULL;
CK_TOKEN_INFO tokenInfo;
CK_ULONG slotID = 0; /* slotID == 0 for FIPSMODE */
@ -330,7 +330,6 @@ main(int argc, char **argv)
CK_UTF8CHAR *pwd = NULL;
CK_ULONG pwdLen = 0;
char *moduleSpec = NULL;
char *moduleSpecRerun = NULL;
char *configDir = NULL;
char *dbPrefix = NULL;
char *disableUnload = NULL;
@ -464,13 +463,8 @@ main(int argc, char **argv)
moduleSpec = PR_smprintf("configdir='%s' certPrefix='%s' "
"keyPrefix='%s' secmod='secmod.db' flags= ",
configDir, dbPrefix, dbPrefix);
moduleSpecRerun = PR_smprintf("configdir='%s' certPrefix='%s' "
"keyPrefix='%s' secmod='secmod.db' flags=forcePOST ",
configDir, dbPrefix, dbPrefix);
initArgs.LibraryParameters = (CK_CHAR_PTR *)moduleSpec;
initArgs.pReserved = NULL;
initArgsRerun = initArgs;
initArgsRerun.LibraryParameters = (CK_CHAR_PTR *)moduleSpecRerun;
/*DebugBreak();*/
/* FIPSMODE invokes FC_Initialize as pFunctionList->C_Initialize */
@ -716,7 +710,7 @@ main(int argc, char **argv)
if (doForkTests) {
/* testing one more C_Initialize / C_Finalize to exercise getpid()
* fork check code */
crv = pFunctionList->C_Initialize(&initArgsRerun);
crv = pFunctionList->C_Initialize(&initArgs);
if (crv == CKR_OK) {
PKM_LogIt("C_Initialize succeeded\n");
} else {
@ -752,9 +746,6 @@ cleanup:
if (moduleSpec) {
PR_smprintf_free(moduleSpec);
}
if (moduleSpecRerun) {
PR_smprintf_free(moduleSpecRerun);
}
#ifdef _WIN32
FreeLibrary(hModule);