Bug 654611: Remove WinCE code from NSS. The patch is contributed by

Ed Morley <bmo@edmorley.co.uk>. r=wtc.
Modified Files:
	mozilla/dbm/include/mcom_db.h mozilla/dbm/include/winfile.h
	mozilla/dbm/src/Makefile.in mozilla/dbm/src/mktemp.c
	mozilla/security/coreconf/Linux.mk
	mozilla/security/coreconf/WIN95.mk
	mozilla/security/coreconf/WINNT.mk
	mozilla/security/coreconf/config.mk
	mozilla/security/coreconf/rules.mk
	mozilla/security/nss/Makefile
	mozilla/security/nss/cmd/platlibs.mk
	mozilla/security/nss/cmd/certutil/keystuff.c
	mozilla/security/nss/cmd/lib/basicutil.c
	mozilla/security/nss/cmd/lib/config.mk
	mozilla/security/nss/cmd/lib/secpwd.c
	mozilla/security/nss/cmd/lib/secutil.c
	mozilla/security/nss/cmd/strsclnt/strsclnt.c
	mozilla/security/nss/lib/certhigh/ocsp.c
	mozilla/security/nss/lib/ckfw/Makefile
	mozilla/security/nss/lib/freebl/Makefile
	mozilla/security/nss/lib/freebl/arcfour.c
	mozilla/security/nss/lib/freebl/config.mk
	mozilla/security/nss/lib/freebl/win_rand.c
	mozilla/security/nss/lib/freebl/mpi/mpi.h
	mozilla/security/nss/lib/freebl/mpi/mpmontg.c
	mozilla/security/nss/lib/softoken/config.mk
	mozilla/security/nss/lib/softoken/sdb.c
	mozilla/security/nss/lib/softoken/legacydb/config.mk
	mozilla/security/nss/lib/ssl/sslimpl.h
	mozilla/security/nss/lib/ssl/sslnonce.c
	mozilla/security/nss/lib/ssl/sslsock.c
	mozilla/security/nss/lib/util/secder.h
	mozilla/security/nss/lib/util/secport.c
	mozilla/security/nss/lib/util/secport.h
	mozilla/security/nss/lib/util/utilmod.c
Removed Files:
	mozilla/security/coreconf/WINCE.mk
	mozilla/security/nss/cmd/lib/wincemain.c


git-svn-id: svn://10.0.0.236/trunk@264436 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com 2012-11-14 01:14:12 +00:00
parent be98838f49
commit b7d9ddd8e4
37 changed files with 41 additions and 440 deletions

View File

@ -36,10 +36,6 @@
#define _DB_H_
#ifdef WINCE
#define off_t long
#endif
#ifndef macintosh
#include <sys/types.h>
#endif

View File

@ -31,12 +31,7 @@ typedef struct DIR_Struct {
typedef unsigned long mode_t;
typedef long uid_t;
typedef long gid_t;
#ifdef WINCE
typedef long ino_t;
#else
typedef long off_t;
#endif
typedef unsigned long nlink_t;
#endif

View File

@ -53,10 +53,6 @@ include $(topsrcdir)/config/rules.mk
DEFINES += -DMEMMOVE -D__DBINTERFACE_PRIVATE $(SECURITY_FLAG)
ifeq ($(OS_ARCH),WINCE)
DEFINES += -D__STDC__ -DDBM_REOPEN_ON_FLUSH
endif
ifeq ($(OS_ARCH),AIX)
OS_LIBS += -lc_r
endif

View File

@ -78,14 +78,6 @@ mkstempflags(char *path, int extraFlags)
return (_gettemp(path, &fd, extraFlags) ? fd : -1);
}
#ifdef WINCE /* otherwise, use the one in libc */
char *
mktemp(char *path)
{
return(_gettemp(path, (int *)NULL, 0) ? path : (char *)NULL);
}
#endif
/* NB: This routine modifies its input string, and does not always restore it.
** returns 1 on success, 0 on failure.
*/

View File

@ -132,7 +132,7 @@ endif
G++INCLUDES = -I/usr/include/g++
#
# Always set CPU_TAG on Linux, WINCE.
# Always set CPU_TAG on Linux.
#
CPU_TAG = _$(CPU_ARCH)

View File

@ -11,5 +11,5 @@ include $(CORE_DEPTH)/coreconf/WIN32.mk
DEFINES += -DWIN95
# WINNT uses the lib prefix, Win95 and WinCE don't
# WINNT uses the lib prefix, Win95 doesn't
NSPR31_LIB_PREFIX = $(NULL)

View File

@ -1,182 +0,0 @@
#
# 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/.
#
# Configuration common to all versions of Windows CE and Pocket PC x.
#
ifeq ($(CPU_ARCH),x86)
DEFAULT_COMPILER = cl
CC = cl
CCC = cl
else
ifeq ($(CPU_ARCH),ARM)
DEFAULT_COMPILER = clarm
CC = clarm
CCC = clarm
else
include CPU_ARCH_is_not_recognized
include _$(CPU_ARCH)
endif
endif
LINK = link
AR = lib
AR += -NOLOGO -OUT:"$@"
RANLIB = echo
BSDECHO = echo
ifdef BUILD_TREE
NSINSTALL_DIR = $(BUILD_TREE)/nss
else
NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
endif
NSINSTALL = nsinstall
MKDEPEND_DIR = $(CORE_DEPTH)/coreconf/mkdepend
MKDEPEND = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
# Note: MKDEPENDENCIES __MUST__ be a relative pathname, not absolute.
# If it is absolute, gmake will crash unless the named file exists.
MKDEPENDENCIES = $(OBJDIR_NAME)/depend.mk
INSTALL = $(NSINSTALL)
MAKE_OBJDIR = mkdir
MAKE_OBJDIR += $(OBJDIR)
RC = rc.exe
GARBAGE += $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb
XP_DEFINE += -DXP_PC
LIB_SUFFIX = lib
DLL_SUFFIX = dll
OS_DLLFLAGS += -DLL
EXTRA_EXE_LD_FLAGS += -ENTRY:mainWCRTStartup
ifdef BUILD_OPT
# OS_CFLAGS += -MD
OPTIMIZER += -O2
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
DLLFLAGS += -OUT:"$@"
else
#
# Define USE_DEBUG_RTL if you want to use the debug runtime library
# (RTL) in the debug build
#
ifdef USE_DEBUG_RTL
# OS_CFLAGS += -MDd
else
# OS_CFLAGS += -MD
endif
OPTIMIZER += -Od -Z7
#OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DLLFLAGS += -DEBUG -DEBUGTYPE:CV -OUT:"$@"
LDFLAGS += -DEBUG -DEBUGTYPE:CV
endif
# DEFINES += -DWIN32
ifdef MAPFILE
DLLFLAGS += -DEF:$(MAPFILE)
endif
# Change PROCESS to put the mapfile in the correct format for this platform
PROCESS_MAP_FILE = cp $< $@
#
# The following is NOT needed for the NSPR 2.0 library.
#
DEFINES += -D_WINDOWS
# override default, which is ASFLAGS = CFLAGS
AS = ml.exe
ASFLAGS = -Cp -Sn -Zi -coff $(INCLUDES)
#
# override the definitions of RELEASE_TREE found in tree.mk
#
ifndef RELEASE_TREE
ifdef BUILD_SHIP
ifdef USE_SHIPS
RELEASE_TREE = $(NTBUILD_SHIP)
else
RELEASE_TREE = //redbuild/components
endif
else
RELEASE_TREE = //redbuild/components
endif
endif
#
# override the definitions of LIB_PREFIX and DLL_PREFIX in prefix.mk
#
ifndef LIB_PREFIX
LIB_PREFIX = $(NULL)
endif
ifndef DLL_PREFIX
DLL_PREFIX = $(NULL)
endif
#
# override the definitions of various _SUFFIX symbols in suffix.mk
#
#
# Object suffixes
#
ifndef OBJ_SUFFIX
OBJ_SUFFIX = .obj
endif
#
# Assembler source suffixes
#
ifndef ASM_SUFFIX
ASM_SUFFIX = .asm
endif
#
# Library suffixes
#
ifndef IMPORT_LIB_SUFFIX
IMPORT_LIB_SUFFIX = .$(LIB_SUFFIX)
endif
ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING
DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(IMPORT_LIB_SUFFIX)
endif
#
# Program suffixes
#
ifndef PROG_SUFFIX
PROG_SUFFIX = .exe
endif
#
# override ruleset.mk, removing the "lib" prefix for library names, and
# adding the "32" after the LIBRARY_VERSION.
#
ifdef LIBRARY_NAME
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).dll
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).lib
endif
#
# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY
#
ifndef TARGETS
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM)
endif
#
# Always set CPU_TAG on Linux, WINCE.
#
CPU_TAG = _$(CPU_ARCH)

View File

@ -16,5 +16,5 @@ DEFINES += -DWINNT
#
OS_CFLAGS += -GT
# WINNT uses the lib prefix, Win95 and WinCE don't
# WINNT uses the lib prefix, Win95 doesn't
NSPR31_LIB_PREFIX = lib

View File

@ -31,7 +31,7 @@ endif
#######################################################################
TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
AIX RISCOS WINNT WIN95 WINCE Linux
AIX RISCOS WINNT WIN95 Linux
ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk

View File

@ -241,7 +241,7 @@ alltags:
$(PROGRAM): $(OBJS) $(EXTRA_LIBS)
@$(MAKE_OBJDIR)
ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
$(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)) $(EXTRA_EXE_LD_FLAGS)
$(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS))
ifdef MT
if test -f $@.manifest; then \
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
@ -337,7 +337,7 @@ $(OBJDIR)/$(PROG_PREFIX)%$(PROG_SUFFIX): $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX)
@$(MAKE_OBJDIR)
ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET)))
$(MKPROG) $< -Fe$@ -link \
$(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(EXTRA_EXE_LD_FLAGS)
$(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)
ifdef MT
if test -f $@.manifest; then \
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \

View File

@ -26,9 +26,7 @@ include $(CORE_DEPTH)/coreconf/config.mk
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################
ifeq ($(OS_TARGET),WINCE)
DIRS = lib # omit cmd since wince has no command line shell
endif
#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #

View File

@ -14,10 +14,8 @@
#if defined(XP_WIN) || defined (XP_PC)
#include <time.h>
#ifndef WINCE
#include <conio.h>
#endif
#endif
#if defined(__sun) && !defined(SVR4)
extern int fclose(FILE*);
@ -96,7 +94,7 @@ UpdateRNG(void)
/* Get random noise from keyboard strokes */
count = 0;
while (count < sizeof randbuf) {
#if defined(XP_UNIX) || defined(WINCE)
#if defined(XP_UNIX)
c = getc(stdin);
#else
c = getch();

View File

@ -17,10 +17,8 @@
#include "basicutil.h"
#include <stdarg.h>
#if !defined(_WIN32_WCE)
#include <sys/stat.h>
#include <errno.h>
#endif
#ifdef XP_UNIX
#include <unistd.h>
@ -91,11 +89,7 @@ SECU_PrintSystemError(char *progName, char *msg, ...)
va_start(args, msg);
fprintf(stderr, "%s: ", progName);
vfprintf(stderr, msg, args);
#if defined(_WIN32_WCE)
fprintf(stderr, ": %d\n", PR_GetOSError());
#else
fprintf(stderr, ": %s\n", strerror(errno));
#endif
va_end(args);
}

View File

@ -13,7 +13,3 @@ SHARED_LIBRARY =
IMPORT_LIBRARY =
PROGRAM =
ifeq (WINCE,$(OS_ARCH))
CSRCS += wincemain.c
endif

View File

@ -20,7 +20,7 @@
#include <unistd.h> /* for isatty() */
#endif
#if( defined(_WINDOWS) && !defined(_WIN32_WCE))
#if defined(_WINDOWS)
#include <conio.h>
#include <io.h>
#define QUIET_FGETS quiet_fgets
@ -144,11 +144,8 @@ static char * quiet_fgets (char *buf, int length, FILE *input)
while (1)
{
#if defined (_WIN32_WCE)
c = getchar(); /* gets a character from stdin */
#else
c = getch(); /* getch gets a character from the console */
#endif
if (c == '\b')
{
if (end > buf)

View File

@ -20,10 +20,8 @@
#include "secpkcs7.h"
#include "secpkcs5.h"
#include <stdarg.h>
#if !defined(_WIN32_WCE)
#include <sys/stat.h>
#include <errno.h>
#endif
#ifdef XP_UNIX
#include <unistd.h>

View File

@ -1,33 +0,0 @@
/* 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 WINCE
#include <windows.h>
int
wmain(int argc, WCHAR **wargv)
{
char **argv;
int i, ret;
argv = malloc(argc * sizeof(char*));
for (i = 0; i < argc; i++) {
int len = WideCharToMultiByte(CP_ACP, 0, wargv[i], -1, NULL, 0, 0, 0);
argv[i] = malloc(len * sizeof(char));
WideCharToMultiByte(CP_ACP, 0, wargv[i], -1, argv[i], len, 0, 0);
}
ret = main(argc, argv);
for (i = 0; i < argc; i++) {
free(argv[i]);
}
free(argv);
return ret;
}
#endif

View File

@ -53,7 +53,7 @@ PKIXLIB = \
$(DIST)/lib/$(LIB_PREFIX)pkixcertsel.$(LIB_SUFFIX)
# can't do this in manifest.mn because OS_ARCH isn't defined there.
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
ifeq ($(OS_ARCH), WINNT)
EXTRA_LIBS += \
$(DIST)/lib/$(LIB_PREFIX)smime.$(LIB_SUFFIX) \
@ -139,7 +139,7 @@ endif
else # USE_STATIC_LIBS
# can't do this in manifest.mn because OS_ARCH isn't defined there.
ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
ifeq ($(OS_ARCH), WINNT)
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
EXTRA_LIBS += \

View File

@ -11,10 +11,8 @@
#include <unistd.h>
#endif
#include <stdlib.h>
#if !defined(_WIN32_WCE)
#include <errno.h>
#include <fcntl.h>
#endif
#include <stdarg.h>
#include "plgetopt.h"

View File

@ -6,7 +6,7 @@
* Implementation of OCSP services, for both client and server.
* (XXX, really, mostly just for client right now, but intended to do both.)
*
* $Id: ocsp.c,v 1.72 2012-09-22 13:41:58 wtc%google.com Exp $
* $Id: ocsp.c,v 1.73 2012-11-14 01:14:09 wtc%google.com Exp $
*/
#include "prerror.h"
@ -151,8 +151,8 @@ ocsp_CertRevokedAfter(ocspRevokedInfo *revokedInfo, int64 time);
#define OCSP_TRACE_CERT(cert) dumpCertificate(cert)
#define OCSP_TRACE_CERTID(certid) dumpCertID(certid)
#if (defined(XP_UNIX) || defined(XP_WIN32) || defined(XP_BEOS) \
|| defined(XP_MACOSX)) && !defined(_WIN32_WCE)
#if defined(XP_UNIX) || defined(XP_WIN32) || defined(XP_BEOS) \
|| defined(XP_MACOSX)
#define NSS_HAVE_GETENV 1
#endif

View File

@ -2,7 +2,7 @@
# 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/.
MAKEFILE_CVS_ID = "@(#) $RCSfile: Makefile,v $ $Revision: 1.18 $ $Date: 2012-04-25 14:49:28 $"
MAKEFILE_CVS_ID = "@(#) $RCSfile: Makefile,v $ $Revision: 1.19 $ $Date: 2012-11-14 01:14:10 $"
include manifest.mn
include $(CORE_DEPTH)/coreconf/config.mk
@ -29,7 +29,7 @@ endif
export:: private_export
# can't do this in manifest.mn because OS_TARGET isn't defined there.
ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET))) # list omits WINCE
ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
ifdef NSS_BUILD_CAPI
DIRS += capi
endif

View File

@ -115,7 +115,7 @@ ifeq (OS2,$(OS_TARGET))
DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
endif
ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET))) #omits WINCE
ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
ifndef USE_64
# 32-bit Windows
ifdef NS_USE_GCC
@ -155,11 +155,6 @@ endif
endif
endif
ifeq ($(OS_TARGET),WINCE)
DEFINES += -DMP_ARGCHK=0 # no assert in WinCE
DEFINES += -DSHA_NO_LONG_LONG # avoid 64-bit arithmetic in SHA512
endif
ifeq ($(OS_TARGET),IRIX)
ifeq ($(USE_N32),1)
ASFILES = mpi_mips.s

View File

@ -32,11 +32,6 @@
#define USE_WORD
#endif
#if defined(_WIN32_WCE)
#undef WORD
#define WORD ARC4WORD
#endif
#if (defined(IS_64))
typedef PRUint64 WORD;
#else

View File

@ -53,13 +53,11 @@ SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_
RES = $(OBJDIR)/$(LIBRARY_NAME).res
RESNAME = freebl.rc
ifndef WINCE
ifdef NS_USE_GCC
OS_LIBS += -lshell32
else
OS_LIBS += shell32.lib
endif
endif
ifdef NS_USE_GCC
EXTRA_SHARED_LIBS += \

View File

@ -6,7 +6,7 @@
* 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/. */
/* $Id: mpi.h,v 1.25 2012-04-25 14:49:50 gerv%gerv.net Exp $ */
/* $Id: mpi.h,v 1.26 2012-11-14 01:14:11 wtc%google.com Exp $ */
#ifndef _H_MPI_
#define _H_MPI_
@ -29,11 +29,7 @@
#undef ULLONG_MAX
#endif
#if defined( _WIN32_WCE)
/* #include <sys/types.h> What do we need here ?? */
#else
#include <sys/types.h>
#endif
#define MP_NEG 1
#define MP_ZPOS 0

View File

@ -1,7 +1,7 @@
/* 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/. */
/* $Id: mpmontg.c,v 1.24 2012-04-25 14:49:50 gerv%gerv.net Exp $ */
/* $Id: mpmontg.c,v 1.25 2012-11-14 01:14:11 wtc%google.com Exp $ */
/* This file implements moduluar exponentiation using Montgomery's
* method for modular reduction. This file implements the method
@ -35,12 +35,6 @@
#define MAX_ODD_INTS 32 /* 2 ** (WINDOW_BITS - 1) */
#if defined(_WIN32_WCE)
#define ABORT res = MP_UNDEF; goto CLEANUP
#else
#define ABORT abort()
#endif
/*! computes T = REDC(T), 2^b == R
\param T < RN
*/
@ -257,7 +251,7 @@ mp_err mp_exptmod_f(const mp_int * montBase,
} else if (smallExp & 1) {
SQR; MUL(0);
} else {
ABORT;
abort();
}
} else if (window_bits == 4) {
if (!smallExp) {
@ -271,7 +265,7 @@ mp_err mp_exptmod_f(const mp_int * montBase,
} else if (smallExp & 8) {
SQR; MUL(smallExp/16); SQR; SQR; SQR;
} else {
ABORT;
abort();
}
} else if (window_bits == 5) {
if (!smallExp) {
@ -287,7 +281,7 @@ mp_err mp_exptmod_f(const mp_int * montBase,
} else if (smallExp & 0x10) {
SQR; MUL(smallExp/32); SQR; SQR; SQR; SQR;
} else {
ABORT;
abort();
}
} else if (window_bits == 6) {
if (!smallExp) {
@ -305,10 +299,10 @@ mp_err mp_exptmod_f(const mp_int * montBase,
} else if (smallExp & 0x20) {
SQR; MUL(smallExp/64); SQR; SQR; SQR; SQR; SQR;
} else {
ABORT;
abort();
}
} else {
ABORT;
abort();
}
}
@ -405,7 +399,7 @@ mp_err mp_exptmod_i(const mp_int * montBase,
} else if (smallExp & 1) {
SQR(pa1,pa2); MUL(0,pa2,pa1);
} else {
ABORT;
abort();
}
} else if (window_bits == 4) {
if (!smallExp) {
@ -423,7 +417,7 @@ mp_err mp_exptmod_i(const mp_int * montBase,
SQR(pa1,pa2); MUL(smallExp/16,pa2,pa1); SQR(pa1,pa2);
SQR(pa2,pa1); SQR(pa1,pa2); SWAPPA;
} else {
ABORT;
abort();
}
} else if (window_bits == 5) {
if (!smallExp) {
@ -445,7 +439,7 @@ mp_err mp_exptmod_i(const mp_int * montBase,
SQR(pa1,pa2); MUL(smallExp/32,pa2,pa1); SQR(pa1,pa2);
SQR(pa2,pa1); SQR(pa1,pa2); SQR(pa2,pa1);
} else {
ABORT;
abort();
}
} else if (window_bits == 6) {
if (!smallExp) {
@ -471,10 +465,10 @@ mp_err mp_exptmod_i(const mp_int * montBase,
SQR(pa1,pa2); MUL(smallExp/64,pa2,pa1); SQR(pa1,pa2);
SQR(pa2,pa1); SQR(pa1,pa2); SQR(pa2,pa1); SQR(pa1,pa2); SWAPPA;
} else {
ABORT;
abort();
}
} else {
ABORT;
abort();
}
}
@ -1013,7 +1007,7 @@ mp_err mp_exptmod_safe_i(const mp_int * montBase,
} else if (smallExp & 1) {
SQR(pa1,pa2); MUL_NOWEAVE(montBase,pa2,pa1);
} else {
ABORT;
abort();
}
break;
case 6:
@ -1028,7 +1022,7 @@ mp_err mp_exptmod_safe_i(const mp_int * montBase,
SQR(pa1,pa2); MUL(smallExp,pa2,pa1);
break;
default:
ABORT; /* could do a loop? */
abort(); /* could do a loop? */
}
}

View File

@ -9,15 +9,10 @@
#include <windows.h>
#include <shlobj.h> /* for CSIDL constants */
#if defined(_WIN32_WCE)
#include <stdlib.h> /* Win CE puts lots of stuff here. */
#include "prprf.h" /* for PR_snprintf */
#else
#include <time.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#endif
#include <stdio.h>
#include "prio.h"
#include "prerror.h"
@ -81,17 +76,9 @@ size_t RNG_GetNoise(void *buf, size_t maxbuf)
return n;
{
#if defined(_WIN32_WCE)
// get the number of milliseconds elapsed since Windows CE was started.
FILETIME sTime;
SYSTEMTIME st;
GetSystemTime(&st);
SystemTimeToFileTime(&st,&sTime);
#else
time_t sTime;
// get the time in seconds since midnight Jan 1, 1970
time(&sTime);
#endif
nBytes = sizeof(sTime) > maxbuf ? maxbuf : sizeof(sTime);
memcpy(((char *)buf) + n, &sTime, nBytes);
n += nBytes;
@ -154,10 +141,8 @@ EnumSystemFiles(Handler func)
static const int folders[] = {
CSIDL_BITBUCKET,
CSIDL_RECENT,
#ifndef WINCE
CSIDL_INTERNET_CACHE,
CSIDL_HISTORY,
#endif
0
};
int i = 0;
@ -271,13 +256,11 @@ void RNG_SystemInfoForRNG(void)
int nBytes;
MEMORYSTATUS sMem;
HANDLE hVal;
#if !defined(_WIN32_WCE)
DWORD dwSerialNum;
DWORD dwComponentLen;
DWORD dwSysFlags;
char volName[128];
DWORD dwSectors, dwBytes, dwFreeClusters, dwNumClusters;
#endif
nBytes = RNG_GetNoise(buffer, 20); // get up to 20 bytes
RNG_RandomUpdate(buffer, nBytes);
@ -285,16 +268,12 @@ void RNG_SystemInfoForRNG(void)
sMem.dwLength = sizeof(sMem);
GlobalMemoryStatus(&sMem); // assorted memory stats
RNG_RandomUpdate(&sMem, sizeof(sMem));
#if !defined(_WIN32_WCE)
dwVal = GetLogicalDrives();
RNG_RandomUpdate(&dwVal, sizeof(dwVal)); // bitfields in bits 0-25
#endif
#if !defined(_WIN32_WCE)
dwVal = sizeof(buffer);
if (GetComputerName(buffer, &dwVal))
RNG_RandomUpdate(buffer, dwVal);
#endif
hVal = GetCurrentProcess(); // 4 or 8 byte pseudo handle (a
// constant!) of current process
@ -306,7 +285,6 @@ void RNG_SystemInfoForRNG(void)
dwVal = GetCurrentThreadId(); // thread ID (4 bytes)
RNG_RandomUpdate(&dwVal, sizeof(dwVal));
#if !defined(_WIN32_WCE)
volName[0] = '\0';
buffer[0] = '\0';
GetVolumeInformation(NULL,
@ -331,7 +309,6 @@ void RNG_SystemInfoForRNG(void)
RNG_RandomUpdate(&dwFreeClusters, sizeof(dwFreeClusters));
RNG_RandomUpdate(&dwNumClusters, sizeof(dwNumClusters));
}
#endif
// Skip the potentially slow file scanning if the OS's PRNG worked.
if (!usedWindowsPRNG)
@ -352,63 +329,6 @@ static void rng_systemJitter(void)
}
#if defined(_WIN32_WCE)
void RNG_FileForRNG(const char *filename)
{
PRFileDesc * file;
int nBytes;
PRFileInfo infoBuf;
unsigned char buffer[1024];
if (PR_GetFileInfo(filename, &infoBuf) != PR_SUCCESS)
return;
RNG_RandomUpdate((unsigned char*)&infoBuf, sizeof(infoBuf));
file = PR_Open(filename, PR_RDONLY, 0);
if (file != NULL) {
for (;;) {
PRInt32 bytes = PR_Read(file, buffer, sizeof buffer);
if (bytes <= 0)
break;
RNG_RandomUpdate(buffer, bytes);
totalFileBytes += bytes;
if (totalFileBytes > maxFileBytes)
break;
}
PR_Close(file);
}
nBytes = RNG_GetNoise(buffer, 20); // get up to 20 bytes
RNG_RandomUpdate(buffer, nBytes);
}
/*
* The Windows CE and Windows Mobile FIPS Security Policy, page 13,
* (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp825.pdf)
* says CeGenRandom is the right function to call for creating a seed
* for a random number generator.
*/
size_t RNG_SystemRNG(void *dest, size_t maxLen)
{
size_t bytes = 0;
usedWindowsPRNG = PR_FALSE;
if (CeGenRandom(maxLen, dest)) {
bytes = maxLen;
usedWindowsPRNG = PR_TRUE;
}
if (bytes == 0) {
bytes = rng_systemFromNoise(dest,maxLen);
}
return bytes;
}
#else /* not WinCE */
void RNG_FileForRNG(const char *filename)
{
FILE* file;
@ -542,6 +462,4 @@ done:
FreeLibrary(hModule);
return bytes;
}
#endif /* not WinCE */
#endif /* is XP_WIN */

View File

@ -65,7 +65,3 @@ endif
ifeq ($(OS_TARGET),SunOS)
OS_LIBS += -lbsm
endif
ifeq ($(OS_TARGET),WINCE)
DEFINES += -DDBM_USING_NSPR
endif

View File

@ -59,7 +59,3 @@ endif
ifeq ($(OS_TARGET),SunOS)
OS_LIBS += -lbsm
endif
ifeq ($(OS_TARGET),WINCE)
DEFINES += -DDBM_USING_NSPR
endif

View File

@ -1684,9 +1684,7 @@ sdb_init(char *dbname, char *table, sdbDataType type, int *inUpdate,
* a database */
if (create) {
/* NO NSPR call for this? :( */
#ifndef WINCE
chmod (dbname, 0600);
#endif
}
if (flags != SDB_RDONLY) {

View File

@ -5,7 +5,7 @@
* 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/. */
/* $Id: sslimpl.h,v 1.108 2012-09-28 01:46:45 wtc%google.com Exp $ */
/* $Id: sslimpl.h,v 1.109 2012-11-14 01:14:12 wtc%google.com Exp $ */
#ifndef __sslimpl_h_
#define __sslimpl_h_
@ -1791,8 +1791,6 @@ SEC_END_PROTOS
#if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
#define SSL_GETPID getpid
#elif defined(_WIN32_WCE)
#define SSL_GETPID GetCurrentProcessId
#elif defined(WIN32)
extern int __cdecl _getpid(void);
#define SSL_GETPID _getpid

View File

@ -4,7 +4,7 @@
* 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/. */
/* $Id: sslnonce.c,v 1.27 2012-04-25 14:50:12 gerv%gerv.net Exp $ */
/* $Id: sslnonce.c,v 1.28 2012-11-14 01:14:12 wtc%google.com Exp $ */
#include "cert.h"
#include "pk11pub.h"
@ -15,7 +15,7 @@
#include "sslimpl.h"
#include "sslproto.h"
#include "nssilock.h"
#if (defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) || defined(XP_BEOS)) && !defined(_WIN32_WCE)
#if defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) || defined(XP_BEOS)
#include <time.h>
#endif
@ -452,7 +452,7 @@ PRUint32
ssl_Time(void)
{
PRUint32 myTime;
#if (defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) || defined(XP_BEOS)) && !defined(_WIN32_WCE)
#if defined(XP_UNIX) || defined(XP_WIN) || defined(_WINDOWS) || defined(XP_BEOS)
myTime = time(NULL); /* accurate until the year 2038. */
#else
/* portable, but possibly slower */

View File

@ -6,7 +6,7 @@
* 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/. */
/* $Id: sslsock.c,v 1.97 2012-11-10 12:17:44 wtc%google.com Exp $ */
/* $Id: sslsock.c,v 1.98 2012-11-14 01:14:12 wtc%google.com Exp $ */
#include "seccomon.h"
#include "cert.h"
#include "keyhi.h"
@ -2753,7 +2753,7 @@ loser:
return SECFailure;
}
#if (defined(XP_UNIX) || defined(XP_WIN32) || defined(XP_BEOS)) && !defined(_WIN32_WCE)
#if defined(XP_UNIX) || defined(XP_WIN32) || defined(XP_BEOS)
#define NSS_HAVE_GETENV 1
#endif

View File

@ -11,13 +11,10 @@
* secder.h - public data structures and prototypes for the DER encoding and
* decoding utilities library
*
* $Id: secder.h,v 1.16 2012-04-25 14:50:16 gerv%gerv.net Exp $
* $Id: secder.h,v 1.17 2012-11-14 01:14:12 wtc%google.com Exp $
*/
#if defined(_WIN32_WCE)
#else
#include <time.h>
#endif
#include "plarena.h"
#include "prlong.h"

View File

@ -9,7 +9,7 @@
*
* NOTE - These are not public interfaces
*
* $Id: secport.c,v 1.30 2012-04-25 14:50:16 gerv%gerv.net Exp $
* $Id: secport.c,v 1.31 2012-11-14 01:14:12 wtc%google.com Exp $
*/
#include "seccomon.h"
@ -633,9 +633,6 @@ PORT_UCS2_ASCIIConversion(PRBool toUnicode, unsigned char *inBuf,
int
NSS_PutEnv(const char * envVarName, const char * envValue)
{
#ifdef _WIN32_WCE
return SECFailure;
#else
SECStatus result = SECSuccess;
char * encoded;
int putEnvFailed;
@ -661,7 +658,6 @@ NSS_PutEnv(const char * envVarName, const char * envValue)
PORT_Free(encoded);
}
return result;
#endif
}
/*

View File

@ -5,7 +5,7 @@
/*
* secport.h - portability interfaces for security libraries
*
* $Id: secport.h,v 1.28 2012-04-25 14:50:16 gerv%gerv.net Exp $
* $Id: secport.h,v 1.29 2012-11-14 01:14:12 wtc%google.com Exp $
*/
#ifndef _SECPORT_H_
@ -41,20 +41,11 @@
# endif
#endif
#if defined(_WIN32_WCE)
#include <windef.h>
#include <types.h>
#else
#include <sys/types.h>
#endif
#include <ctype.h>
#include <string.h>
#if defined(_WIN32_WCE)
#include <stdlib.h> /* WinCE puts some stddef symbols here. */
#else
#include <stddef.h>
#endif
#include <stdlib.h>
#include "prtypes.h"
#include "prlog.h" /* for PR_ASSERT */

View File

@ -137,7 +137,6 @@ static SECStatus nssutil_AddSecmodDB(NSSDBType dbType, const char *appName,
#endif
#include <fcntl.h>
#ifndef WINCE
/* same as fopen, except it doesn't use umask, but explicit */
FILE *
lfopen(const char *name, const char *mode, int flags)
@ -156,7 +155,6 @@ lfopen(const char *name, const char *mode, int flags)
/* file inherits fd */
return file;
}
#endif
#define MAX_LINE_LENGTH 2048
@ -466,11 +464,7 @@ nssutil_DeleteSecmodDB(NSSDBType dbType, const char *appName,
/* do we really want to use streams here */
fd = fopen(dbname, "r");
if (fd == NULL) goto loser;
#ifdef WINCE
fd2 = fopen(dbname2, "w+");
#else
fd2 = lfopen(dbname2, "w+", O_CREAT|O_RDWR|O_TRUNC);
#endif
if (fd2 == NULL) goto loser;
name = NSSUTIL_ArgGetParamValue("name",args);
@ -589,11 +583,7 @@ nssutil_AddSecmodDB(NSSDBType dbType, const char *appName,
(void) nssutil_DeleteSecmodDB(dbType, appName, filename,
dbname, module, rw);
#ifdef WINCE
fd = fopen(dbname, "a+");
#else
fd = lfopen(dbname, "a+", O_CREAT|O_RDWR|O_APPEND);
#endif
if (fd == NULL) {
return SECFailure;
}