Free the lizard
git-svn-id: svn://10.0.0.236/trunk@10 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
31
mozilla/modules/security/Makefile
Normal file
31
mozilla/modules/security/Makefile
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- Mode: Makefile -*-
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
DEPTH = ../..
|
||||
|
||||
ifndef NO_SECURITY
|
||||
DIRS = nav
|
||||
|
||||
ifdef MOZ_JAVA
|
||||
DIRS += java
|
||||
endif
|
||||
|
||||
else
|
||||
DIRS = freenav
|
||||
endif
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
50
mozilla/modules/security/freenav/Makefile
Normal file
50
mozilla/modules/security/freenav/Makefile
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*- Mode: Makefile -*-
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
|
||||
DEPTH = ../../..
|
||||
|
||||
MODULE = security
|
||||
LIBRARY_NAME = secfree
|
||||
|
||||
EXPORTS = base64.h \
|
||||
cert.h \
|
||||
preenc.h \
|
||||
seccomon.h \
|
||||
secerr.h \
|
||||
sechash.h \
|
||||
secnav.h \
|
||||
secrng.h \
|
||||
secstubn.h \
|
||||
secstubs.h \
|
||||
secstubt.h \
|
||||
ssl.h \
|
||||
sslerr.h \
|
||||
zig.h \
|
||||
rosetta.h \
|
||||
$(NULL)
|
||||
|
||||
CSRCS = secport.c \
|
||||
navstubs.c \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = dbm js img layer util
|
||||
|
||||
include $(DEPTH)/config/rules.mk
|
||||
|
||||
$(LIBRARY): $(OBJS)
|
||||
18
mozilla/modules/security/freenav/base64.h
Normal file
18
mozilla/modules/security/freenav/base64.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "seccomon.h"
|
||||
17
mozilla/modules/security/freenav/cert.h
Normal file
17
mozilla/modules/security/freenav/cert.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
BIN
mozilla/modules/security/freenav/macbuild/NoSecurity.mcp
Normal file
BIN
mozilla/modules/security/freenav/macbuild/NoSecurity.mcp
Normal file
Binary file not shown.
26
mozilla/modules/security/freenav/macbuild/Security.Prefix
Normal file
26
mozilla/modules/security/freenav/macbuild/Security.Prefix
Normal file
@@ -0,0 +1,26 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
//
|
||||
// Security.Prefix
|
||||
//
|
||||
// Global prefix file for the non-debug Security project.
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#include "SecurityConfig.h"
|
||||
55
mozilla/modules/security/freenav/macbuild/SecurityConfig.h
Normal file
55
mozilla/modules/security/freenav/macbuild/SecurityConfig.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
// we have to do this here because ConditionalMacros.h will be included from
|
||||
// within OpenTptInternet.h and will stupidly define these to 1 if they
|
||||
// have not been previously defined. The new PowerPlant (CWPro1) requires that
|
||||
// this be set to 0. (pinkerton)
|
||||
#define OLDROUTINENAMES 0
|
||||
#ifndef OLDROUTINELOCATIONS
|
||||
#define OLDROUTINELOCATIONS 0
|
||||
#endif
|
||||
|
||||
#define XP_MAC 1
|
||||
#define _PR_NO_PREEMPT 1
|
||||
#define _NO_FAST_STRING_INLINES_ 1
|
||||
#define NSPR20 1
|
||||
#define NSPR20_FOR_DOGBERT 1
|
||||
|
||||
// Need to define NETSCAPE so that Nelson's Java SSL API bits compile.
|
||||
#ifndef NETSCAPE
|
||||
#define NETSCAPE 1
|
||||
#endif
|
||||
|
||||
// Need to define MOZILLA_CLIENT since, well, we're the client-side library.
|
||||
#ifndef MOZILLA_CLIENT
|
||||
#define MOZILLA_CLIENT 1
|
||||
#endif
|
||||
|
||||
// OpenTransport.h has changed to not include the error messages we need from
|
||||
// it unless this is defined. Why? dunnno...(pinkerton)
|
||||
#define OTUNIXERRORS 1
|
||||
|
||||
// Brutal hack: Make sure only one copy of macsock.h is included.
|
||||
//#define macksocket_h___
|
||||
|
||||
#include "IDE_Options.h"
|
||||
|
||||
/* Make sure that "macintosh" is defined. */
|
||||
#ifndef macintosh
|
||||
#define macintosh 1
|
||||
#endif
|
||||
98
mozilla/modules/security/freenav/makefile.win
Normal file
98
mozilla/modules/security/freenav/makefile.win
Normal file
@@ -0,0 +1,98 @@
|
||||
IGNORE_MANIFEST=1
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
!ifndef MOZ_DEBUG
|
||||
OPTIMIZER=-Os -UDEBUG -DNDEBUG
|
||||
!endif
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..\..
|
||||
|
||||
## Include support for MOZ_LITE/MOZ_MEDIUM
|
||||
include <$(DEPTH)/config/liteness.mak>
|
||||
|
||||
!ifndef MAKE_OBJ_TYPE
|
||||
MAKE_OBJ_TYPE=EXE
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBNAME=secfreenav$(MOZ_BITS)
|
||||
PDBFILE=$(LIBNAME).pdb
|
||||
|
||||
LINCS = \
|
||||
!if "$(MOZ_BITS)" != "16"
|
||||
-I$(PUBLIC)\security \
|
||||
-I$(PUBLIC)\liblayer \
|
||||
-I$(PUBLIC)\dbm \
|
||||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\util \
|
||||
-I$(PUBLIC)\img \
|
||||
!endif
|
||||
-I$(DEPTH)\include
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
OBJS= \
|
||||
.\$(OBJDIR)\secport.obj \
|
||||
.\$(OBJDIR)\navstubs.obj \
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBNAME).lib
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// install headers
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
INSTALL_DIR=$(PUBLIC)\security
|
||||
INSTALL_FILE_LIST=base64.h cert.h preenc.h seccomon.h secerr.h sechash.h secnav.h secrng.h secstubn.h secstubs.h secstubt.h ssl.h sslerr.h zig.h secprefs.rc rosetta.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
||||
CFLAGS = $(CFLAGS) -DMOZILLA_CLIENT
|
||||
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
|
||||
|
||||
export:: INSTALL_FILES
|
||||
|
||||
libs:: install
|
||||
18
mozilla/modules/security/freenav/preenc.h
Normal file
18
mozilla/modules/security/freenav/preenc.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
#include "secstubn.h"
|
||||
50
mozilla/modules/security/freenav/rosetta.h
Normal file
50
mozilla/modules/security/freenav/rosetta.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#define HG93634
|
||||
#define HG56817
|
||||
#define HG43241
|
||||
#define HG12515
|
||||
#define HG07606
|
||||
#define HG94794
|
||||
#define HG51096
|
||||
#define HG59609
|
||||
#define HG40252
|
||||
#define HG28879
|
||||
#define HG71089
|
||||
#define HG31456
|
||||
#define HG69136
|
||||
#define HG86722
|
||||
#define HG87489
|
||||
#define HG40560
|
||||
#define HG33086
|
||||
#define HG17928
|
||||
#define HG68092
|
||||
#define HG08747
|
||||
#define HG60917
|
||||
#define HG82493
|
||||
#define HG85890
|
||||
#define HG09714
|
||||
#define HG90967
|
||||
#define HG59852
|
||||
#define HG61365
|
||||
#define HG54978
|
||||
#define HG18931
|
||||
#define HG29784
|
||||
#define HG82168
|
||||
#define HG29989
|
||||
#define HG48722
|
||||
89
mozilla/modules/security/freenav/seccomon.h
Normal file
89
mozilla/modules/security/freenav/seccomon.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _SECCOMON_H_
|
||||
#define _SECCOMON_H_
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include "prmem.h"
|
||||
#include "plarena.h"
|
||||
#include "prtypes.h"
|
||||
#include "prlog.h"
|
||||
#include "plstr.h"
|
||||
#include "prio.h"
|
||||
|
||||
#if defined(XP_CPLUSPLUS)
|
||||
# define SEC_BEGIN_PROTOS extern "C" {
|
||||
# define SEC_END_PROTOS }
|
||||
#else
|
||||
# define SEC_BEGIN_PROTOS
|
||||
# define SEC_END_PROTOS
|
||||
#endif
|
||||
|
||||
#include "secstubt.h"
|
||||
#include "secstubs.h"
|
||||
|
||||
#define PORT_Strlen(s) strlen(s)
|
||||
#define PORT_Strcasecmp PL_strcasecmp
|
||||
#define PORT_Memset memset
|
||||
#define PORT_Strcmp strcmp
|
||||
#define PORT_Assert PR_ASSERT
|
||||
#define PORT_Memcpy memcpy
|
||||
#define PORT_Strchr strchr
|
||||
|
||||
SEC_BEGIN_PROTOS
|
||||
void *
|
||||
PORT_Alloc(size_t bytes);
|
||||
|
||||
void *
|
||||
PORT_Realloc(void *oldptr, size_t bytes);
|
||||
|
||||
void *
|
||||
PORT_ZAlloc(size_t bytes);
|
||||
|
||||
void
|
||||
PORT_Free(void *ptr);
|
||||
|
||||
void
|
||||
PORT_ZFree(void *ptr, size_t len);
|
||||
|
||||
PRArenaPool *
|
||||
PORT_NewArena(unsigned long chunksize);
|
||||
|
||||
void *
|
||||
PORT_ArenaAlloc(PRArenaPool *arena, size_t size);
|
||||
|
||||
void *
|
||||
PORT_ArenaZAlloc(PRArenaPool *arena, size_t size);
|
||||
|
||||
void
|
||||
PORT_FreeArena(PRArenaPool *arena, PRBool zero);
|
||||
|
||||
void *
|
||||
PORT_ArenaGrow(PRArenaPool *arena, void *ptr, size_t oldsize, size_t newsize);
|
||||
|
||||
void *
|
||||
PORT_ArenaMark(PRArenaPool *arena);
|
||||
|
||||
void
|
||||
PORT_ArenaRelease(PRArenaPool *arena, void *mark);
|
||||
SEC_END_PROTOS
|
||||
|
||||
#endif /* _SECCOMON_H_ */
|
||||
27
mozilla/modules/security/freenav/secerr.h
Normal file
27
mozilla/modules/security/freenav/secerr.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef __SEC_ERR_H_
|
||||
#define __SEC_ERR_H_
|
||||
|
||||
|
||||
#define SEC_ERROR_BASE (-0x2000)
|
||||
#define SEC_ERROR_LIMIT (SEC_ERROR_BASE + 1000)
|
||||
|
||||
#define IS_SEC_ERROR(code) \
|
||||
(((code) >= SEC_ERROR_BASE) && ((code) < SEC_ERROR_LIMIT))
|
||||
|
||||
#endif /* __SEC_ERR_H_ */
|
||||
17
mozilla/modules/security/freenav/sechash.h
Normal file
17
mozilla/modules/security/freenav/sechash.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
18
mozilla/modules/security/freenav/secnav.h
Normal file
18
mozilla/modules/security/freenav/secnav.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
#include "secstubn.h"
|
||||
136
mozilla/modules/security/freenav/secport.c
Normal file
136
mozilla/modules/security/freenav/secport.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
|
||||
#include "seccomon.h"
|
||||
#include "prmem.h"
|
||||
#include "prerror.h"
|
||||
#include "plarena.h"
|
||||
#include "prlog.h"
|
||||
|
||||
void *
|
||||
PORT_Alloc(size_t bytes)
|
||||
{
|
||||
void *rv;
|
||||
|
||||
/* Always allocate a non-zero amount of bytes */
|
||||
rv = (void *)PR_Malloc(bytes ? bytes : 1);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void *
|
||||
PORT_Realloc(void *oldptr, size_t bytes)
|
||||
{
|
||||
void *rv;
|
||||
|
||||
rv = (void *)PR_Realloc(oldptr, bytes);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void *
|
||||
PORT_ZAlloc(size_t bytes)
|
||||
{
|
||||
void *rv;
|
||||
|
||||
/* Always allocate a non-zero amount of bytes */
|
||||
rv = (void *)PR_Calloc(1, bytes ? bytes : 1);
|
||||
return rv;
|
||||
}
|
||||
|
||||
void
|
||||
PORT_Free(void *ptr)
|
||||
{
|
||||
if (ptr) {
|
||||
PR_Free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PORT_ZFree(void *ptr, size_t len)
|
||||
{
|
||||
if (ptr) {
|
||||
memset(ptr, 0, len);
|
||||
PR_Free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
PRArenaPool *
|
||||
PORT_NewArena(unsigned long chunksize)
|
||||
{
|
||||
PRArenaPool *arena;
|
||||
|
||||
arena = PORT_ZAlloc(sizeof(PRArenaPool));
|
||||
if ( arena != NULL ) {
|
||||
PR_InitArenaPool(arena, "security", chunksize, sizeof(double));
|
||||
}
|
||||
|
||||
return(arena);
|
||||
}
|
||||
|
||||
void *
|
||||
PORT_ArenaAlloc(PRArenaPool *arena, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
PR_ARENA_ALLOCATE(p, arena, size);
|
||||
|
||||
return(p);
|
||||
}
|
||||
|
||||
void *
|
||||
PORT_ArenaZAlloc(PRArenaPool *arena, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
PR_ARENA_ALLOCATE(p, arena, size);
|
||||
if (p == NULL) {
|
||||
} else {
|
||||
memset(p, 0, size);
|
||||
}
|
||||
|
||||
return(p);
|
||||
}
|
||||
|
||||
/* XXX - need to zeroize!! - jsw */
|
||||
void
|
||||
PORT_FreeArena(PRArenaPool *arena, PRBool zero)
|
||||
{
|
||||
PR_FinishArenaPool(arena);
|
||||
PORT_Free(arena);
|
||||
}
|
||||
|
||||
void *
|
||||
PORT_ArenaGrow(PRArenaPool *arena, void *ptr, size_t oldsize, size_t newsize)
|
||||
{
|
||||
PR_ASSERT(newsize >= oldsize);
|
||||
|
||||
PR_ARENA_GROW(ptr, arena, oldsize, ( newsize - oldsize ) );
|
||||
|
||||
return(ptr);
|
||||
}
|
||||
|
||||
void *
|
||||
PORT_ArenaMark(PRArenaPool *arena)
|
||||
{
|
||||
return PR_ARENA_MARK(arena);
|
||||
}
|
||||
|
||||
void
|
||||
PORT_ArenaRelease(PRArenaPool *arena, void *mark)
|
||||
{
|
||||
PR_ARENA_RELEASE(arena, mark);
|
||||
}
|
||||
|
||||
1
mozilla/modules/security/freenav/secprefs.rc
Normal file
1
mozilla/modules/security/freenav/secprefs.rc
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
17
mozilla/modules/security/freenav/secrng.h
Normal file
17
mozilla/modules/security/freenav/secrng.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
125
mozilla/modules/security/freenav/secstubs.h
Normal file
125
mozilla/modules/security/freenav/secstubs.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef _SECSTUBS_H_
|
||||
#define _SECSTUBS_H_
|
||||
|
||||
SEC_BEGIN_PROTOS
|
||||
|
||||
CERTCertificate *
|
||||
CERT_DupCertificate(CERTCertificate *cert);
|
||||
|
||||
void
|
||||
CERT_DestroyCertificate(CERTCertificate *cert);
|
||||
|
||||
CERTCertificate *
|
||||
CERT_NewTempCertificate (CERTCertDBHandle *handle, SECItem *derCert,
|
||||
char *nickname, PRBool isperm, PRBool copyDER);
|
||||
|
||||
CERTCertDBHandle *
|
||||
CERT_GetDefaultCertDB(void);
|
||||
|
||||
CERTCertificate *
|
||||
CERT_DecodeCertFromPackage(char *certbuf, int certlen);
|
||||
|
||||
char *
|
||||
CERT_HTMLCertInfo(CERTCertificate *cert, PRBool showImages, PRBool showIssuer);
|
||||
|
||||
PRBool
|
||||
CERT_CompareCertsForRedirection(CERTCertificate *c1, CERTCertificate *c2);
|
||||
|
||||
unsigned long
|
||||
SSL_SecurityCapabilities(void);
|
||||
|
||||
int
|
||||
SSL_SetSockPeerID(PRFileDesc *fd, char *peerID);
|
||||
|
||||
int
|
||||
SSL_SecurityStatus(PRFileDesc *fd, int *on, char **cipher,
|
||||
int *keySize, int *secretKeySize,
|
||||
char **issuer, char **subject);
|
||||
|
||||
CERTCertificate *
|
||||
SSL_PeerCertificate(PRFileDesc *fd);
|
||||
|
||||
PRBool
|
||||
SSL_IsDomestic(void);
|
||||
|
||||
SECStatus
|
||||
RNG_RNGInit(void);
|
||||
|
||||
SECStatus
|
||||
RNG_GenerateGlobalRandomBytes(void *dest, size_t len);
|
||||
|
||||
size_t
|
||||
RNG_GetNoise(void *buf, size_t maxbytes);
|
||||
|
||||
void
|
||||
RNG_SystemInfoForRNG(void);
|
||||
|
||||
void RNG_FileForRNG(char *filename);
|
||||
|
||||
SECStatus
|
||||
RNG_RandomUpdate(void *data, size_t bytes);
|
||||
|
||||
SECStatus
|
||||
MD5_HashBuf(unsigned char *dest, const unsigned char *src,
|
||||
uint32 src_length);
|
||||
|
||||
MD5Context *
|
||||
MD5_NewContext(void);
|
||||
|
||||
void
|
||||
MD5_DestroyContext(MD5Context *cx, PRBool freeit);
|
||||
|
||||
void
|
||||
MD5_Begin(MD5Context *cx);
|
||||
|
||||
void
|
||||
MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen);
|
||||
|
||||
void
|
||||
MD5_End(MD5Context *cx, unsigned char *digest,
|
||||
unsigned int *digestLen, unsigned int maxDigestLen);
|
||||
|
||||
SECStatus
|
||||
SHA1_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length);
|
||||
|
||||
SHA1Context *
|
||||
SHA1_NewContext(void);
|
||||
|
||||
void
|
||||
SHA1_DestroyContext(SHA1Context *cx, PRBool freeit);
|
||||
|
||||
void
|
||||
SHA1_Begin(SHA1Context *cx);
|
||||
|
||||
void
|
||||
SHA1_Update(SHA1Context *cx, const unsigned char *input, unsigned int inputLen);
|
||||
|
||||
void
|
||||
SHA1_End(SHA1Context *cx, unsigned char *digest,
|
||||
unsigned int *digestLen, unsigned int maxDigestLen);
|
||||
|
||||
char *
|
||||
BTOA_DataToAscii(const unsigned char *data, unsigned int len);
|
||||
|
||||
unsigned char *
|
||||
ATOB_AsciiToData(const char *string, unsigned int *lenp);
|
||||
|
||||
SEC_END_PROTOS
|
||||
|
||||
#endif /* _SECSTUBS_H_ */
|
||||
58
mozilla/modules/security/freenav/secstubt.h
Normal file
58
mozilla/modules/security/freenav/secstubt.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef _SECSTUBT_H_
|
||||
#define _SECSTUBT_H_
|
||||
|
||||
typedef struct _item {
|
||||
unsigned char *data;
|
||||
unsigned long len;
|
||||
} SECItem;
|
||||
|
||||
struct CERTCertificateStr {
|
||||
SECItem derCert;
|
||||
};
|
||||
|
||||
typedef struct CERTCertificateStr CERTCertificate;
|
||||
typedef struct _certdb CERTCertDBHandle;
|
||||
typedef struct _md5context MD5Context;
|
||||
typedef struct _sha1context SHA1Context;
|
||||
|
||||
#define MD5_LENGTH 16
|
||||
#define SHA1_LENGTH 20
|
||||
|
||||
typedef enum _SECStatus {
|
||||
SECWouldBlock = -2,
|
||||
SECFailure = -1,
|
||||
SECSuccess = 0
|
||||
} SECStatus;
|
||||
|
||||
#define SSL_SECURITY_STATUS_NOOPT -1
|
||||
#define SSL_SECURITY_STATUS_OFF 0
|
||||
#define SSL_SECURITY_STATUS_ON_HIGH 1
|
||||
#define SSL_SECURITY_STATUS_ON_LOW 2
|
||||
#define SSL_SECURITY_STATUS_FORTEZZA 3
|
||||
|
||||
#define SSL_SC_RSA 0x00000001L
|
||||
#define SSL_SC_MD2 0x00000010L
|
||||
#define SSL_SC_MD5 0x00000020L
|
||||
#define SSL_SC_RC2_CBC 0x00001000L
|
||||
#define SSL_SC_RC4 0x00002000L
|
||||
#define SSL_SC_DES_CBC 0x00004000L
|
||||
#define SSL_SC_DES_EDE3_CBC 0x00008000L
|
||||
#define SSL_SC_IDEA_CBC 0x00010000L
|
||||
|
||||
#endif /* _SECSTUBT_H_ */
|
||||
17
mozilla/modules/security/freenav/ssl.h
Normal file
17
mozilla/modules/security/freenav/ssl.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
33
mozilla/modules/security/freenav/sslerr.h
Normal file
33
mozilla/modules/security/freenav/sslerr.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#ifndef __SSL_ERR_H_
|
||||
#define __SSL_ERR_H_
|
||||
|
||||
|
||||
#define SSL_ERROR_BASE (-0x3000)
|
||||
#define SSL_ERROR_LIMIT (SSL_ERROR_BASE + 1000)
|
||||
|
||||
#ifndef NO_SECURITY_ERROR_ENUM
|
||||
typedef enum {
|
||||
SSL_ERROR_BAD_CERTIFICATE = SSL_ERROR_BASE + 4
|
||||
} SSLErrorCodes;
|
||||
#endif
|
||||
|
||||
#define IS_SSL_ERROR(code) \
|
||||
(((code) >= SSL_ERROR_BASE) && ((code) < SSL_ERROR_LIMIT))
|
||||
|
||||
#endif /* __SSL_ERR_H_ */
|
||||
18
mozilla/modules/security/freenav/zig.h
Normal file
18
mozilla/modules/security/freenav/zig.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
* for the specific language governing rights and limitations under the
|
||||
* NPL.
|
||||
*
|
||||
* The Initial Developer of this code under the NPL is Netscape
|
||||
* Communications Corporation. Portions created by Netscape are
|
||||
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
* Reserved.
|
||||
*/
|
||||
#include "seccomon.h"
|
||||
#include "secstubn.h"
|
||||
56
mozilla/modules/security/makefile.win
Normal file
56
mozilla/modules/security/makefile.win
Normal file
@@ -0,0 +1,56 @@
|
||||
# -*- Mode: Makefile -*-
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build the MODULES tree
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH=..\..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify any "command" targets. (ie. DIRS, INSTALL_FILES, ...)
|
||||
#// (these must come before the common makefiles are included)
|
||||
#//
|
||||
#// DIRS - There are subdirectories to process
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
!ifdef NO_SECURITY
|
||||
DIRS = freenav
|
||||
!else
|
||||
!ifdef MOZ_JAVA
|
||||
DIRS = nav java
|
||||
!else
|
||||
DIRS = nav
|
||||
!endif
|
||||
!endif
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
Reference in New Issue
Block a user