Compare commits

..

2 Commits

Author SHA1 Message Date
relyea%netscape.com
395c017f42 Move Tag forward to include Kai's changes.
Use NSS shared libraries on Unix.


git-svn-id: svn://10.0.0.236/branches/PSM_FOR_NSS_3_4@109378 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 21:11:26 +00:00
(no author)
57c76d447a This commit was manufactured by cvs2svn to create branch 'PSM_FOR_NSS_3_4'.
git-svn-id: svn://10.0.0.236/branches/PSM_FOR_NSS_3_4@109313 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 02:30:38 +00:00
236 changed files with 33158 additions and 20795 deletions

View File

@@ -19,9 +19,11 @@
#
# Contributor(s):
DEPTH=..\..\..\..
DEPTH=..
include <$(DEPTH)/config/config.mak>
DIRS= locale
DIRS = nss \
manager \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,109 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Brian Ryner <bryner@netscape.com>
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
LOADABLE_ROOT_MODULE = nssckbi$(DLL_SUFFIX)
NSS3_LIB = nss3$(DLL_SUFFIX)
SMIME3_LIB = smime3$(DLL_SUFFIX)
SSL3_LIB = ssl3$(DLL_SUFFIX)
SOFTOKEN3_LIB = softokn3$(DLL_SUFFIX)
else
LOADABLE_ROOT_MODULE = libnssckbi$(DLL_SUFFIX)
NSS3_LIB = libnss3$(DLL_SUFFIX)
SMIME3_LIB = libsmime3$(DLL_SUFFIX)
SSL3_LIB = libssl3$(DLL_SUFFIX)
SOFTOKEN3_LIB = libsoftokn3$(DLL_SUFFIX)
endif
FREEBL_PURE32_MODULE = libfreebl_pure32_3$(DLL_SUFFIX)
FREEBL_HYBRID_MODULE = libfreebl_hybrid_3$(DLL_SUFFIX)
# NSS makefiles are not safe for parallel execution.
DEFAULT_GMAKE_FLAGS = MAKE="$(MAKE) -j1" -j1
DEFAULT_GMAKE_FLAGS += MOZILLA_INCLUDES="-I$(MOZ_BUILD_ROOT)/dist/include/nspr -I$(MOZ_BUILD_ROOT)/dist/include/dbm"
DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(MOZ_BUILD_ROOT)/dist
DEFAULT_GMAKE_FLAGS += DIST=$(MOZ_BUILD_ROOT)/dist
DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
endif
ifndef MOZ_DEBUG
DEFAULT_GMAKE_FLAGS += BUILD_OPT=1
endif
ifdef GNU_CC
DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1 NS_USE_NATIVE=
else
DEFAULT_GMAKE_FLAGS += NS_USE_GCC= NS_USE_NATIVE=1
endif
ifdef USE_N32
# It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
# merely adds _PTH to coreconf's OBJDIR name.
DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
endif
ifdef HAVE_64BIT_OS
DEFAULT_GMAKE_FLAGS += USE_64=1
endif
SUBMAKEFILES = boot/Makefile ssl/Makefile pki/Makefile
include $(topsrcdir)/config/rules.mk
depend dependclean export::
$(MAKE) -C boot $@
$(MAKE) -C ssl $@
$(MAKE) -C pki $@
libs::
$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
cd $(DIST)/lib; cp -f libmozdbm_s.$(LIB_SUFFIX) libdbm.$(LIB_SUFFIX)
$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
$(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
$(INSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin
$(INSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DIST)/bin
$(INSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DIST)/bin
$(INSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DIST)/bin
ifneq (,$(filter SunOS HP-UX,$(OS_ARCH)))
ifneq ($(OS_TEST),i86pc)
ifndef HAVE_64BIT_OS
$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_PURE32_MODULE) $(DIST)/bin
$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_HYBRID_MODULE) $(DIST)/bin
endif
endif
endif
$(MAKE) -C boot $@
$(MAKE) -C ssl $@
$(MAKE) -C pki $@
clean clobber clobber_all realclean distclean::
$(MAKE) -C boot $@
$(MAKE) -C ssl $@
$(MAKE) -C pki $@
$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean

View File

@@ -0,0 +1,45 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Kai Engert <kaie@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DIRS = public src
include $(topsrcdir)/config/rules.mk

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,44 @@
#!nmake
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Kai Engert <kaie@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH=..\..\..
include <$(DEPTH)/config/config.mak>
DIRS = public src
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,53 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Kai Engert <kaie@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MODULE = pipboot
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
XPIDLSRCS = \
nsISSLStatusProvider.idl \
nsISecurityWarningDialogs.idl \
nsIBufEntropyCollector.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,55 @@
#!nmake
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Kai Engert <kaie@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MODULE = pipboot
DEPTH=..\..\..\..
IGNORE_MANIFEST=1
include <$(DEPTH)/config/config.mak>
XPIDL_INCLUDES=-I$(DEPTH)\dist\idl
XPIDLSRCS= \
.\nsISSLStatusProvider.idl \
.\nsISecurityWarningDialogs.idl \
.\nsIBufEntropyCollector.idl \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* L. David Baron <dbaron@fas.harvard.edu> (original author)
* Kai Engert <kaie@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
#include "nsIEntropyCollector.idl"
[uuid(485b87a8-5dd7-4b8d-8ea8-dee53201f899)]
interface nsIBufEntropyCollector : nsIEntropyCollector
{
/**
* Forward the entropy collected so far to |collector| and then
* continue forwarding new entropy as it arrives.
*/
void forwardTo(in nsIEntropyCollector collector);
/**
* No longer forward to a (possibly) previously remembered collector.
* Do buffering again.
*/
void dontForward();
};

View File

@@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Terry Hayes <thayes@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
[scriptable, uuid(8de811f0-1dd2-11b2-8bf1-e9aa324984b2)]
interface nsISSLStatusProvider : nsISupports {
readonly attribute nsISupports SSLStatus;
};

View File

@@ -0,0 +1,69 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Terry Hayes <thayes@netscape.com>
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
interface nsIInterfaceRequestor;
/**
* nsISecurityWarningDialogs - functions that
* display warnings for transitions between secure
* and insecure pages, posts to insecure servers etc.
*/
[scriptable, uuid(1c399d06-1dd2-11b2-bc58-c87cbcacdb78)]
interface nsISecurityWarningDialogs : nsISupports
{
/**
* alertEnteringSecure
*/
void alertEnteringSecure(in nsIInterfaceRequestor ctx);
/**
* alertEnteringWeak
*/
void alertEnteringWeak(in nsIInterfaceRequestor ctx);
/**
* alertLeavingSecure
*/
void alertLeavingSecure(in nsIInterfaceRequestor ctx);
/**
* alertMixedMode
*/
void alertMixedMode(in nsIInterfaceRequestor ctx);
/**
* confirmPostToInsecure
*/
boolean confirmPostToInsecure(in nsIInterfaceRequestor ctx);
/**
* confirmPostToInsecureFromSecure
*/
boolean confirmPostToInsecureFromSecure(in nsIInterfaceRequestor ctx);
};

View File

@@ -0,0 +1,99 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo <javi@netscape.com>
# Terry Hayes <thayes@netscape.com>
# Kai Engert <kaie@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = pipboot
LIBRARY_NAME = pipboot
IS_COMPONENT = 1
MODULE_NAME = BOOT
EXPORT_LIBRARY = 1
META_COMPONENT = crypto
EXPORTS = \
$(NULL)
CPPSRCS = \
nsEntropyCollector.cpp \
nsSecureBrowserUIImpl.cpp \
nsBOOTModule.cpp \
$(NULL)
REQUIRES = nspr \
xpcom \
string \
necko \
uriloader \
pref \
caps \
dom \
intl \
locale \
profile \
windowwatcher \
js \
docshell \
widget \
layout \
content \
pippki \
xpconnect \
jar \
unicharutil \
pipnss \
$(NULL)
include $(topsrcdir)/config/rules.mk
INCLUDES += \
-I$(DIST)/public/security \
$(NULL)
EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \
$(NULL)
EXTRA_LIBS += \
$(NULL)

View File

@@ -0,0 +1,86 @@
#!nmake
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
# Kai Engert <kaie@netscape.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MODULE = pipboot
DEPTH=..\..\..\..
IGNORE_MANIFEST=1
LIBRARY_NAME = pipboot
PDBFILE = $(LIBRARY_NAME).pdb
MAPFILE = $(LIBRARY_NAME).map
MODULE_NAME = BOOT
META_COMPONENT = crypto
REQUIRES = \
xpcom \
string \
dom \
pref \
intl \
locale \
windowwatcher \
necko \
pipnss \
layout \
layout_xul \
uriloader \
docshell \
widget \
content \
$(NULL)
include <$(DEPTH)/config/config.mak>
LLIBS = \
$(DIST)/lib/js3250.lib \
$(LIBNSPR) \
$(DIST)\lib\xpcom.lib \
$(NULL)
EXPORTS = \
$(NULL)
OBJS = \
.\$(OBJDIR)\nsEntropyCollector.obj \
.\$(OBJDIR)\nsSecureBrowserUIImpl.obj \
.\$(OBJDIR)\nsBOOTModule.obj \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,53 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Terry Hayes <thayes@netscape.com>
*
* ***** END LICENSE BLOCK ***** */
#include "nsIModule.h"
#include "nsIGenericFactory.h"
#include "nsEntropyCollector.h"
#include "nsSecureBrowserUIImpl.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsEntropyCollector)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSecureBrowserUIImpl)
static nsModuleComponentInfo components[] =
{
{
"Entropy Collector",
NS_ENTROPYCOLLECTOR_CID,
NS_ENTROPYCOLLECTOR_CONTRACTID,
nsEntropyCollectorConstructor
},
{
NS_SECURE_BROWSER_UI_CLASSNAME,
NS_SECURE_BROWSER_UI_CID,
NS_SECURE_BROWSER_UI_CONTRACTID,
nsSecureBrowserUIImplConstructor
}
};
NS_IMPL_NSGETMODULE(BOOT, components)

View File

@@ -0,0 +1,131 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* L. David Baron <dbaron@fas.harvard.edu> (original author)
* Kai Engert <kaie@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "prlog.h"
#include "nsEntropyCollector.h"
#include "nsMemory.h"
nsEntropyCollector::nsEntropyCollector()
:mBytesCollected(0), mWritePointer(mEntropyCache)
{
NS_INIT_ISUPPORTS();
}
nsEntropyCollector::~nsEntropyCollector()
{
}
NS_IMPL_THREADSAFE_ISUPPORTS2(nsEntropyCollector,
nsIEntropyCollector,
nsIBufEntropyCollector)
NS_IMETHODIMP
nsEntropyCollector::RandomUpdate(void *new_entropy, PRInt32 bufLen)
{
if (bufLen > 0) {
if (mForwardTarget) {
return mForwardTarget->RandomUpdate(new_entropy, bufLen);
}
else {
const unsigned char *InputPointer = (const unsigned char *)new_entropy;
const unsigned char *PastEndPointer = mEntropyCache + entropy_buffer_size;
// if the input is large, we only take as much as we can store
PRInt32 bytes_wanted = PR_MIN(bufLen, entropy_buffer_size);
// remember the number of bytes we will have after storing new_entropy
mBytesCollected = PR_MIN(entropy_buffer_size, mBytesCollected + bytes_wanted);
// as the above statements limit bytes_wanted to the entropy_buffer_size,
// this loop will iterate at most twice.
while (bytes_wanted > 0) {
// how many bytes to end of cyclic buffer?
const PRInt32 space_to_end = PastEndPointer - mWritePointer;
// how many bytes can we copy, not reaching the end of the buffer?
const PRInt32 this_time = PR_MIN(space_to_end, bytes_wanted);
// copy at most to the end of the cyclic buffer
for (PRInt32 i = 0; i < this_time; ++i) {
// accept the fact that we use our buffer's random uninitialized content
unsigned int old = *mWritePointer;
// combine new and old value already stored in buffer
// this logic comes from PSM 1
*mWritePointer++ = ((old << 1) | (old >> 7)) ^ *InputPointer++;
}
PR_ASSERT(mWritePointer <= PastEndPointer);
PR_ASSERT(mWritePointer >= mEntropyCache);
// have we arrived at the end of the buffer?
if (PastEndPointer == mWritePointer) {
// reset write pointer back to begining of our buffer
mWritePointer = mEntropyCache;
}
// subtract the number of bytes we have already copied
bytes_wanted -= this_time;
}
}
}
return NS_OK;
}
NS_IMETHODIMP
nsEntropyCollector::ForwardTo(nsIEntropyCollector *aCollector)
{
NS_PRECONDITION(!mForwardTarget, "|ForwardTo| should only be called once.");
mForwardTarget = aCollector;
mForwardTarget->RandomUpdate(mEntropyCache, mBytesCollected);
mBytesCollected = 0;
return NS_OK;
}
NS_IMETHODIMP
nsEntropyCollector::DontForward()
{
mForwardTarget = nsnull;
return NS_OK;
}

View File

@@ -0,0 +1,70 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* L. David Baron <dbaron@fas.harvard.edu> (original author)
* Kai Engert <kaie@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsEntropyCollector_h___
#define nsEntropyCollector_h___
#include "nsIEntropyCollector.h"
#include "nsIBufEntropyCollector.h"
#include "nsCOMPtr.h"
#define NS_ENTROPYCOLLECTOR_CID \
{ /* 34587f4a-be18-43c0-9112-b782b08c0add */ \
0x34587f4a, 0xbe18, 0x43c0, \
{0x91, 0x12, 0xb7, 0x82, 0xb0, 0x8c, 0x0a, 0xdd} }
class nsEntropyCollector : public nsIBufEntropyCollector
{
public:
nsEntropyCollector();
virtual ~nsEntropyCollector();
NS_DECL_ISUPPORTS
NS_DECL_NSIENTROPYCOLLECTOR
NS_DECL_NSIBUFENTROPYCOLLECTOR
enum { entropy_buffer_size = 1024 };
protected:
unsigned char mEntropyCache[entropy_buffer_size];
PRInt32 mBytesCollected;
unsigned char *mWritePointer;
nsCOMPtr<nsIEntropyCollector> mForwardTarget;
};
#endif /* !defined nsEntropyCollector_h__ */

View File

@@ -0,0 +1,834 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Hubbie Shaw
* Doug Turner <dougt@netscape.com>
* Stuart Parmenter <pavlov@netscape.com>
* Brian Ryner <bryner@netscape.com>
* Terry Hayes <thayes@netscape.com>
* Kai Engert <kaie@netscape.com>
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_LOGGING
#define FORCE_PR_LOG
#endif
#include "nspr.h"
#include "prlog.h"
#include "prmem.h"
#include "nsISecureBrowserUI.h"
#include "nsSecureBrowserUIImpl.h"
#include "nsCOMPtr.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIServiceManager.h"
#include "nsIScriptGlobalObject.h"
#include "nsIObserverService.h"
#include "nsIDocumentLoader.h"
#include "nsCURILoader.h"
#include "nsIDocShell.h"
#include "nsIDocumentViewer.h"
#include "nsIDocument.h"
#include "nsIDOMElement.h"
#include "nsIDOMWindowInternal.h"
#include "nsIContent.h"
#include "nsIWebProgress.h"
#include "nsIChannel.h"
#include "nsIHttpChannel.h"
#include "nsIFileChannel.h"
#include "nsITransportSecurityInfo.h"
#include "nsIURI.h"
#include "nsISecurityEventSink.h"
#include "nsIPrompt.h"
#include "nsIFormSubmitObserver.h"
#include "nsISecurityWarningDialogs.h"
#include "nsIProxyObjectManager.h"
#include "nsINSSDialogs.h"
#define SECURITY_STRING_BUNDLE_URL "chrome://communicator/locale/security.properties"
static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static const char *kNSSDialogsContractId = NS_NSSDIALOGS_CONTRACTID;
#define IS_SECURE(state) ((state & 0xFFFF) == STATE_IS_SECURE)
#if defined(PR_LOGGING)
//
// Log module for nsSecureBroswerUI logging...
//
// To enable logging (see prlog.h for full details):
//
// set NSPR_LOG_MODULES=nsSecureBroswerUI:5
// set NSPR_LOG_FILE=nspr.log
//
// this enables PR_LOG_DEBUG level information and places all output in
// the file nspr.log
//
PRLogModuleInfo* gSecureDocLog = nsnull;
#endif /* PR_LOGGING */
nsSecureBrowserUIImpl::nsSecureBrowserUIImpl()
: mMixContentAlertShown(PR_FALSE),
mSecurityState(STATE_IS_INSECURE)
{
NS_INIT_ISUPPORTS();
#if defined(PR_LOGGING)
if (!gSecureDocLog)
gSecureDocLog = PR_NewLogModule("nsSecureBrowserUI");
#endif /* PR_LOGGING */
}
nsSecureBrowserUIImpl::~nsSecureBrowserUIImpl()
{
nsresult rv;
// remove self from form post notifications:
nsCOMPtr<nsIObserverService> svc(do_GetService("@mozilla.org/observer-service;1", &rv));
if (NS_SUCCEEDED(rv)) {
svc->RemoveObserver(this, NS_FORMSUBMIT_SUBJECT);
}
}
NS_IMPL_ISUPPORTS6(nsSecureBrowserUIImpl,
nsISecureBrowserUI,
nsIWebProgressListener,
nsIFormSubmitObserver,
nsIObserver,
nsISupportsWeakReference,
nsISSLStatusProvider);
NS_IMETHODIMP
nsSecureBrowserUIImpl::Init(nsIDOMWindow *window,
nsIDOMElement *button)
{
nsresult rv = NS_OK;
mSecurityButton = button; /* may be null */
mWindow = window;
nsCOMPtr<nsIStringBundleService> service(do_GetService(kCStringBundleServiceCID, &rv));
if (NS_FAILED(rv)) return rv;
rv = service->CreateBundle(SECURITY_STRING_BUNDLE_URL,
getter_AddRefs(mStringBundle));
if (NS_FAILED(rv)) return rv;
// hook up to the form post notifications:
nsCOMPtr<nsIObserverService> svc(do_GetService("@mozilla.org/observer-service;1", &rv));
if (NS_SUCCEEDED(rv)) {
rv = svc->AddObserver(this, NS_FORMSUBMIT_SUBJECT, PR_TRUE);
}
/* GetWebProgress(mWindow) */
// hook up to the webprogress notifications.
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(mWindow));
if (!sgo) return NS_ERROR_FAILURE;
nsCOMPtr<nsIDocShell> docShell;
sgo->GetDocShell(getter_AddRefs(docShell));
if (!docShell) return NS_ERROR_FAILURE;
nsCOMPtr<nsIWebProgress> wp(do_GetInterface(docShell));
if (!wp) return NS_ERROR_FAILURE;
/* end GetWebProgress */
wp->AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener*,this));
return NS_OK;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::DisplayPageInfoUI()
{
#if 0
nsresult res = NS_OK;
nsCOMPtr<nsISecurityManagerComponent> psm(do_GetService(PSM_COMPONENT_CONTRACTID,
&res));
if (NS_FAILED(res))
return res;
nsXPIDLCString host;
if (mCurrentURI)
mCurrentURI->GetHost(getter_Copies(host));
// return psm->DisplayPSMAdvisor(mLastPSMStatus, host);
#endif
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::Observe(nsISupports*, const char*,
const PRUnichar*)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
static nsresult IsChildOfDomWindow(nsIDOMWindow *parent, nsIDOMWindow *child,
PRBool* value)
{
*value = PR_FALSE;
if (parent == child) {
*value = PR_TRUE;
return NS_OK;
}
nsCOMPtr<nsIDOMWindow> childsParent;
child->GetParent(getter_AddRefs(childsParent));
if (childsParent && childsParent.get() != child)
IsChildOfDomWindow(parent, childsParent, value);
return NS_OK;
}
static PRInt32 GetSecurityStateFromChannel(nsIChannel* aChannel)
{
nsresult res;
PRInt32 securityState;
// qi for the psm information about this channel load.
nsCOMPtr<nsISupports> info;
aChannel->GetSecurityInfo(getter_AddRefs(info));
nsCOMPtr<nsITransportSecurityInfo> psmInfo(do_QueryInterface(info));
if (!psmInfo) {
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState:%p - no nsITransportSecurityInfo for %p\n",
aChannel, (nsISupports *)info));
return nsIWebProgressListener::STATE_IS_INSECURE;
}
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState:%p - info is %p\n", aChannel,
(nsISupports *)info));
res = psmInfo->GetSecurityState(&securityState);
if (!NS_SUCCEEDED(res)) {
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState:%p - GetSecurityState failed: %d\n",
aChannel, res));
securityState = nsIWebProgressListener::STATE_IS_BROKEN;
}
PR_LOG(gSecureDocLog, PR_LOG_DEBUG, ("SecureUI: GetSecurityState:%p - Returning %d\n", aChannel,
securityState));
return securityState;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::Notify(nsIContent* formNode,
nsIDOMWindowInternal* window, nsIURI* actionURL,
PRBool* cancelSubmit)
{
// Return NS_OK unless we want to prevent this form from submitting.
*cancelSubmit = PR_FALSE;
if (!window || !actionURL || !formNode)
return NS_OK;
nsCOMPtr<nsIDocument> document;
formNode->GetDocument(*getter_AddRefs(document));
if (!document) return NS_OK;
nsCOMPtr<nsIURI> formURL;
document->GetBaseURL(*getter_AddRefs(formURL));
nsCOMPtr<nsIScriptGlobalObject> globalObject;
document->GetScriptGlobalObject(getter_AddRefs(globalObject));
nsCOMPtr<nsIDOMWindow> postingWindow(do_QueryInterface(globalObject));
PRBool isChild;
IsChildOfDomWindow(mWindow, postingWindow, &isChild);
// This notify call is not for our window, ignore it.
if (!isChild)
return NS_OK;
PRBool okayToPost;
nsresult res = CheckPost(formURL, actionURL, &okayToPost);
if (NS_SUCCEEDED(res) && !okayToPost)
*cancelSubmit = PR_TRUE;
return res;
}
// nsIWebProgressListener
NS_IMETHODIMP
nsSecureBrowserUIImpl::OnProgressChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
return NS_OK;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 aProgressStateFlags,
nsresult aStatus)
{
nsresult res = NS_OK;
if (!aRequest)
return NS_ERROR_NULL_POINTER;
// Get the channel from the request...
// If the request is not network based, then ignore it.
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest, &res));
if (NS_FAILED(res))
return NS_OK;
// We are only interested in HTTP and file requests.
nsCOMPtr<nsIHttpChannel> httpRequest(do_QueryInterface(aRequest));
nsCOMPtr<nsIFileChannel> fileRequest(do_QueryInterface(aRequest));
if (!httpRequest && !fileRequest) {
return NS_OK;
}
nsCOMPtr<nsIInterfaceRequestor> requestor;
nsCOMPtr<nsISecurityEventSink> eventSink;
channel->GetNotificationCallbacks(getter_AddRefs(requestor));
if (requestor)
eventSink = do_GetInterface(requestor);
#if defined(DEBUG)
nsCOMPtr<nsIURI> loadingURI;
res = channel->GetURI(getter_AddRefs(loadingURI));
NS_ASSERTION(NS_SUCCEEDED(res), "GetURI failed");
if (loadingURI) {
nsXPIDLCString temp;
loadingURI->GetSpec(getter_Copies(temp));
PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
("SecureUI:%p: OnStateChange: %x :%s\n", this,
aProgressStateFlags,(const char*)temp));
}
#endif
// First event when loading doc
if (aProgressStateFlags & STATE_START) {
if (aProgressStateFlags & STATE_IS_NETWORK) {
// Reset state variables used per doc loading
mMixContentAlertShown = PR_FALSE;
mFirstRequest = PR_TRUE;
mSSLStatus = nsnull;
}
}
// A Document is starting to load...
if ((aProgressStateFlags & (STATE_STOP)) &&
(aProgressStateFlags & STATE_IS_REQUEST)) {
// work-around for bug 48515.
nsCOMPtr<nsIURI> aURI;
channel->GetURI(getter_AddRefs(aURI));
// Sometimes URI is null, so ignore.
if (aURI == nsnull) {
return NS_OK;
}
// If this is the first request, then do a protocol check
if (mFirstRequest) {
mFirstRequest = PR_FALSE;
return CheckProtocolContextSwitch(eventSink, aRequest, channel);
}
// Check that the request does not have mixed content.
return CheckMixedContext(eventSink, aRequest, channel);
}
// A document has finished loading
if ((aProgressStateFlags & STATE_STOP) &&
(aProgressStateFlags & STATE_IS_NETWORK)) {
// Get SSL Status information if possible
nsCOMPtr<nsISupports> info;
channel->GetSecurityInfo(getter_AddRefs(info));
nsCOMPtr<nsISSLStatusProvider> sp = do_QueryInterface(info);
if (sp) {
// Ignore result
sp->GetSSLStatus(getter_AddRefs(mSSLStatus));
}
if (eventSink)
eventSink->OnSecurityChange(aRequest, mSecurityState);
if (!mSecurityButton)
return res;
/* TNH - need event for changing the tooltip */
// Do we really need to look at res here? What happens if there's an error?
// We should still set the certificate authority display.
nsXPIDLString tooltip;
if (info) {
nsCOMPtr<nsITransportSecurityInfo> secInfo(do_QueryInterface(info));
if (secInfo &&
NS_SUCCEEDED(secInfo->GetShortSecurityDescription(getter_Copies(tooltip))) &&
tooltip) {
res = mSecurityButton->SetAttribute(NS_LITERAL_STRING("tooltiptext"),
nsString(tooltip));
}
}
}
return res;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI* aLocation)
{
mCurrentURI = aLocation;
return NS_OK;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage)
{
return NS_OK;
}
nsresult
nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
{
nsresult res = NS_OK;
#if defined(DEBUG_dougt)
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
if (!channel)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIURI> aURI;
channel->GetURI(getter_AddRefs(aURI));
nsXPIDLCString temp;
aURI->GetSpec(getter_Copies(temp));
printf("OnSecurityChange: (%x) %s\n", state, (const char*)temp);
#endif
/* Deprecated support for mSecurityButton */
if (mSecurityButton) {
NS_NAMED_LITERAL_STRING(level, "level");
if (state == (STATE_IS_SECURE|STATE_SECURE_HIGH)) {
res = mSecurityButton->SetAttribute(level, NS_LITERAL_STRING("high"));
} else if (state == (STATE_IS_SECURE|STATE_SECURE_LOW)) {
res = mSecurityButton->SetAttribute(level, NS_LITERAL_STRING("low"));
} else if (state == STATE_IS_BROKEN) {
res = mSecurityButton->SetAttribute(level, NS_LITERAL_STRING("broken"));
} else {
res = mSecurityButton->RemoveAttribute(level);
}
}
return res;
}
// nsISSLStatusProvider methods
NS_IMETHODIMP
nsSecureBrowserUIImpl::GetSSLStatus(nsISupports** _result)
{
NS_ASSERTION(_result, "non-NULL destination required");
*_result = mSSLStatus;
NS_IF_ADDREF(*_result);
return NS_OK;
}
nsresult
nsSecureBrowserUIImpl::IsURLHTTPS(nsIURI* aURL, PRBool* value)
{
*value = PR_FALSE;
if (!aURL)
return NS_OK;
char* scheme;
aURL->GetScheme(&scheme);
// If no scheme, it's not an https url - not necessarily an error.
// See bugs 54845 and 54966
if (!scheme)
return NS_OK;
if (!PL_strncasecmp(scheme, "https", 5))
*value = PR_TRUE;
nsMemory::Free(scheme);
return NS_OK;
}
void
nsSecureBrowserUIImpl::GetBundleString(const PRUnichar* name,
nsString &outString)
{
if (mStringBundle && name) {
PRUnichar *ptrv = nsnull;
if (NS_SUCCEEDED(mStringBundle->GetStringFromName(name,
&ptrv)))
outString = ptrv;
else
outString.SetLength(0);
nsMemory::Free(ptrv);
} else {
outString.SetLength(0);
}
}
nsresult
nsSecureBrowserUIImpl::CheckProtocolContextSwitch(nsISecurityEventSink* eventSink,
nsIRequest* aRequest,
nsIChannel* aChannel)
{
PRInt32 newSecurityState, oldSecurityState = mSecurityState;
newSecurityState = GetSecurityStateFromChannel(aChannel);
mSecurityState = newSecurityState;
// Check to see if we are going from a secure page to an insecure page
if (newSecurityState == STATE_IS_INSECURE &&
(IS_SECURE(oldSecurityState) ||
oldSecurityState == STATE_IS_BROKEN)) {
SetBrokenLockIcon(eventSink, aRequest, PR_TRUE);
AlertLeavingSecure();
}
// check to see if we are going from an insecure page to a secure one.
else if ((newSecurityState == (STATE_IS_SECURE|STATE_SECURE_HIGH) ||
newSecurityState == STATE_IS_BROKEN) &&
oldSecurityState == STATE_IS_INSECURE) {
AlertEnteringSecure();
}
// check to see if we are going from a strong or insecure page to a
// weak one.
else if ((IS_SECURE(newSecurityState) &&
newSecurityState != (STATE_IS_SECURE|STATE_SECURE_HIGH)) &&
(oldSecurityState == STATE_IS_INSECURE ||
oldSecurityState == (STATE_IS_SECURE|STATE_SECURE_HIGH))) {
AlertEnteringWeak();
}
mSecurityState = newSecurityState;
return NS_OK;
}
nsresult
nsSecureBrowserUIImpl::CheckMixedContext(nsISecurityEventSink *eventSink,
nsIRequest* aRequest, nsIChannel* aChannel)
{
PRInt32 newSecurityState;
newSecurityState = GetSecurityStateFromChannel(aChannel);
// Deal with http redirect to https //
if (mSecurityState == STATE_IS_INSECURE && newSecurityState != STATE_IS_INSECURE) {
return CheckProtocolContextSwitch(eventSink, aRequest, aChannel);
}
if ((newSecurityState == STATE_IS_INSECURE ||
newSecurityState == STATE_IS_BROKEN) &&
IS_SECURE(mSecurityState)) {
// work-around for bug 48515
nsCOMPtr<nsIURI> aURI;
aChannel->GetURI(getter_AddRefs(aURI));
nsXPIDLCString temp;
aURI->GetSpec(getter_Copies(temp));
if (!nsCRT::strncmp((const char*) temp, "file:", 5) ||
!nsCRT::strcmp((const char*) temp, "about:layout-dummy-request")) {
return NS_OK;
}
mSecurityState = STATE_IS_BROKEN;
SetBrokenLockIcon(eventSink, aRequest);
// Show alert to user (first time only)
// NOTE: doesn't mSecurityState provide the correct
// one-time checking?? Why have mMixContentAlertShown
// as well?
if (!mMixContentAlertShown) {
AlertMixedMode();
mMixContentAlertShown = PR_TRUE;
}
}
return NS_OK;
}
nsresult
nsSecureBrowserUIImpl::CheckPost(nsIURI *formURL, nsIURI *actionURL, PRBool *okayToPost)
{
PRBool formSecure,actionSecure;
*okayToPost = PR_TRUE;
nsresult rv = IsURLHTTPS(formURL, &formSecure);
if (NS_FAILED(rv))
return rv;
rv = IsURLHTTPS(actionURL, &actionSecure);
if (NS_FAILED(rv))
return rv;
// if we are posting to a secure link from a secure page, all is okay.
if (actionSecure && formSecure) {
return NS_OK;
}
// posting to insecure webpage from a secure webpage.
if (!actionSecure && formSecure) {
*okayToPost = ConfirmPostToInsecureFromSecure();
} else {
*okayToPost = ConfirmPostToInsecure();
}
return NS_OK;
}
nsresult
nsSecureBrowserUIImpl::SetBrokenLockIcon(nsISecurityEventSink *eventSink,
nsIRequest* aRequest,
PRBool removeValue)
{
nsresult rv = NS_OK;
if (removeValue) {
if (eventSink)
(void) eventSink->OnSecurityChange(aRequest, STATE_IS_INSECURE);
} else {
if (eventSink)
(void) eventSink->OnSecurityChange(aRequest, (STATE_IS_BROKEN));
}
nsAutoString tooltiptext;
GetBundleString(NS_LITERAL_STRING("SecurityButtonTooltipText").get(),
tooltiptext);
/* TNH - need tooltip notification here */
if (mSecurityButton)
rv = mSecurityButton->SetAttribute(NS_LITERAL_STRING("tooltiptext"),
tooltiptext);
return rv;
}
//
// Implementation of an nsIInterfaceRequestor for use
// as context for NSS calls
//
class nsUIContext : public nsIInterfaceRequestor
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIINTERFACEREQUESTOR
nsUIContext(nsIDOMWindow *window);
virtual ~nsUIContext();
private:
nsCOMPtr<nsIDOMWindow> mWindow;
};
NS_IMPL_ISUPPORTS1(nsUIContext, nsIInterfaceRequestor)
nsUIContext::nsUIContext(nsIDOMWindow *aWindow)
: mWindow(aWindow)
{
NS_INIT_ISUPPORTS();
}
nsUIContext::~nsUIContext()
{
}
/* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_IMETHODIMP nsUIContext::GetInterface(const nsIID & uuid, void * *result)
{
nsresult rv;
if (uuid.Equals(NS_GET_IID(nsIPrompt))) {
nsCOMPtr<nsIDOMWindowInternal> internal = do_QueryInterface(mWindow, &rv);
if (NS_FAILED(rv)) return rv;
nsIPrompt *prompt;
rv = internal->GetPrompter(&prompt);
*result = prompt;
} else {
rv = NS_ERROR_NO_INTERFACE;
}
return rv;
}
nsresult nsSecureBrowserUIImpl::
GetNSSDialogs(nsISecurityWarningDialogs **result)
{
nsresult rv;
nsCOMPtr<nsISecurityWarningDialogs> my_result(do_GetService(kNSSDialogsContractId, &rv));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID));
if (!proxyman)
return NS_ERROR_FAILURE;
nsCOMPtr<nsISupports> proxiedResult;
proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,
NS_GET_IID(nsISecurityWarningDialogs),
my_result, PROXY_SYNC,
getter_AddRefs(proxiedResult));
if (!proxiedResult) {
return NS_ERROR_FAILURE;
}
return CallQueryInterface(proxiedResult, result);
}
void nsSecureBrowserUIImpl::
AlertEnteringSecure()
{
nsCOMPtr<nsISecurityWarningDialogs> dialogs;
GetNSSDialogs(getter_AddRefs(dialogs));
if (!dialogs) return;
nsCOMPtr<nsIInterfaceRequestor> ctx = new nsUIContext(mWindow);
dialogs->AlertEnteringSecure(ctx);
return;
}
void nsSecureBrowserUIImpl::
AlertEnteringWeak()
{
nsCOMPtr<nsISecurityWarningDialogs> dialogs;
GetNSSDialogs(getter_AddRefs(dialogs));
if (!dialogs) return;
nsCOMPtr<nsIInterfaceRequestor> ctx = new nsUIContext(mWindow);
dialogs->AlertEnteringWeak(ctx);
return;
}
void nsSecureBrowserUIImpl::
AlertLeavingSecure()
{
nsCOMPtr<nsISecurityWarningDialogs> dialogs;
GetNSSDialogs(getter_AddRefs(dialogs));
if (!dialogs) return;
nsCOMPtr<nsIInterfaceRequestor> ctx = new nsUIContext(mWindow);
dialogs->AlertLeavingSecure(ctx);
return;
}
void nsSecureBrowserUIImpl::
AlertMixedMode()
{
nsCOMPtr<nsISecurityWarningDialogs> dialogs;
GetNSSDialogs(getter_AddRefs(dialogs));
if (!dialogs) return;
nsCOMPtr<nsIInterfaceRequestor> ctx = new nsUIContext(mWindow);
dialogs->AlertMixedMode(ctx);
return;
}
/**
* ConfirmPostToInsecure - returns PR_TRUE if
* the user approves the submit (or doesn't care).
* returns PR_FALSE on errors.
*/
PRBool nsSecureBrowserUIImpl::
ConfirmPostToInsecure()
{
nsresult rv;
nsCOMPtr<nsISecurityWarningDialogs> dialogs;
GetNSSDialogs(getter_AddRefs(dialogs));
if (!dialogs) return PR_FALSE; // Should this allow PR_TRUE for unimplemented?
nsCOMPtr<nsIInterfaceRequestor> ctx = new nsUIContext(mWindow);
PRBool result;
rv = dialogs->ConfirmPostToInsecure(ctx, &result);
if (NS_FAILED(rv)) return PR_FALSE;
return result;
}
/**
* ConfirmPostToInsecureFromSecure - returns PR_TRUE if
* the user approves the submit (or doesn't care).
* returns PR_FALSE on errors.
*/
PRBool nsSecureBrowserUIImpl::
ConfirmPostToInsecureFromSecure()
{
nsresult rv;
nsCOMPtr<nsISecurityWarningDialogs> dialogs;
GetNSSDialogs(getter_AddRefs(dialogs));
if (!dialogs) return PR_FALSE; // Should this allow PR_TRUE for unimplemented?
nsCOMPtr<nsIInterfaceRequestor> ctx = new nsUIContext(mWindow);
PRBool result;
rv = dialogs->ConfirmPostToInsecureFromSecure(ctx, &result);
if (NS_FAILED(rv)) return PR_FALSE;
return result;
}

View File

@@ -0,0 +1,117 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Hubbie Shaw
* Doug Turner <dougt@netscape.com>
* Brian Ryner <bryner@netscape.com>
* Kai Engert <kaie@netscape.com>
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsSecureBrowserUIImpl_h_
#define nsSecureBrowserUIImpl_h_
#include "nsCOMPtr.h"
#include "nsXPIDLString.h"
#include "nsString.h"
#include "nsIObserver.h"
#include "nsIDOMElement.h"
#include "nsIDOMWindow.h"
#include "nsIStringBundle.h"
#include "nsISecureBrowserUI.h"
#include "nsIDocShell.h"
#include "nsIWebProgressListener.h"
#include "nsIFormSubmitObserver.h"
#include "nsIURI.h"
#include "nsISecurityEventSink.h"
#include "nsWeakReference.h"
#include "nsISSLStatusProvider.h"
class nsITransportSecurityInfo;
class nsISecurityWarningDialogs;
#define NS_SECURE_BROWSER_UI_CID \
{ 0xcc75499a, 0x1dd1, 0x11b2, {0x8a, 0x82, 0xca, 0x41, 0x0a, 0xc9, 0x07, 0xb8}}
class nsSecureBrowserUIImpl : public nsISecureBrowserUI,
public nsIWebProgressListener,
public nsIFormSubmitObserver,
public nsIObserver,
public nsSupportsWeakReference,
public nsISSLStatusProvider
{
public:
nsSecureBrowserUIImpl();
virtual ~nsSecureBrowserUIImpl();
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSISECUREBROWSERUI
// nsIObserver
NS_DECL_NSIOBSERVER
NS_DECL_NSISSLSTATUSPROVIDER
NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindowInternal* window,
nsIURI *actionURL, PRBool* cancelSubmit);
protected:
nsCOMPtr<nsIDOMWindow> mWindow;
nsCOMPtr<nsIDOMElement> mSecurityButton;
nsCOMPtr<nsIStringBundle> mStringBundle;
nsCOMPtr<nsIURI> mCurrentURI;
PRBool mMixContentAlertShown;
PRInt32 mSecurityState;
PRBool mFirstRequest;
nsCOMPtr<nsISupports> mSSLStatus;
void GetBundleString(const PRUnichar* name, nsString &outString);
nsresult CheckProtocolContextSwitch(nsISecurityEventSink* sink,
nsIRequest* request, nsIChannel* aChannel);
nsresult CheckMixedContext(nsISecurityEventSink* sink, nsIRequest* request,
nsIChannel* aChannel);
nsresult CheckPost(nsIURI *formURI, nsIURI *actionURL, PRBool *okayToPost);
nsresult IsURLHTTPS(nsIURI* aURL, PRBool *value);
nsresult SetBrokenLockIcon(nsISecurityEventSink* sink, nsIRequest* request,
PRBool removeValue = PR_FALSE);
// Alerts for security transitions
void AlertEnteringSecure();
void AlertEnteringWeak();
void AlertLeavingSecure();
void AlertMixedMode();
PRBool ConfirmPostToInsecure();
PRBool ConfirmPostToInsecureFromSecure();
// Support functions
nsresult GetNSSDialogs(nsISecurityWarningDialogs **);
};
#endif /* nsSecureBrowserUIImpl_h_ */

View File

@@ -18,41 +18,24 @@
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH=..\..\..\..
MODULE=bookmarks
REQUIRES = xpcom \
string \
rdf \
appshell \
widget \
necko \
nkcache \
uconv \
pref \
dom \
intl \
webshell \
windowwatcher \
unicharutil \
$(NULL)
DEPTH=..\..
include <$(DEPTH)/config/config.mak>
CPP_OBJS= \
.\$(OBJDIR)\nsBookmarksService.obj \
$(NULL)
LIBRARY_NAME=bookmarks_s
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
DIRS = boot ssl pki
include <$(DEPTH)\config\rules.mak>
libs:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -17,16 +17,14 @@
# Rights Reserved.
#
# Contributor(s):
#
# Terry Hayes <thayes@netscape.com>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src resources
DIRS = public resources src
include $(topsrcdir)/config/rules.mk

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH=..\..\..
include <$(DEPTH)/config/config.mak>
DIRS = public src resources
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,49 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo <javi@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
MODULE = pippki
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
XPIDLSRCS = \
nsIPKIParamBlock.idl \
nsIASN1Outliner.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,51 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
MODULE = pippki
DEPTH=..\..\..\..
IGNORE_MANIFEST=1
include <$(DEPTH)/config/config.mak>
XPIDL_INCLUDES=-I$(DEPTH)\dist\idl
XPIDLSRCS= \
.\nsIPKIParamBlock.idl \
.\nsIASN1Outliner.idl \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsISupports.idl"
#include "nsIOutlinerView.idl"
#include "nsIX509Cert.idl"
[scriptable, uuid(c727b2f2-1dd1-11b2-95df-f63c15b4cd35)]
interface nsIASN1Outliner : nsIOutlinerView {
void loadASN1Structure(in nsIASN1Object asn1Object);
wstring getDisplayData(in unsigned long index);
};
%{C++
#define NS_ASN1OUTLINER_CONTRACTID "@mozilla.org/security/nsASN1Outliner;1"
%}

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsISupports.idl"
#include "nsIOutlinerView.idl"
#include "nsIX509Cert.idl"
[scriptable, uuid(c727b2f2-1dd1-11b2-95df-f63c15b4cd35)]
interface nsIASN1Outliner : nsIOutlinerView {
void loadASN1Structure(in nsIASN1Object asn1Object);
wstring getDisplayData(in unsigned long index);
};
%{C++
#define NS_ASN1OUTLINER_CONTRACTID "@mozilla.org/security/nsASN1Outliner;1"
%}

View File

@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsISupports.idl"
[scriptable, uuid(b6fe3d78-1dd1-11b2-9058-ced9016984c8)]
interface nsIPKIParamBlock : nsISupports {
void setISupportAtIndex(in PRInt32 index, in nsISupports object);
nsISupports getISupportAtIndex(in PRInt32 index);
};

View File

@@ -17,7 +17,8 @@
# Rights Reserved.
#
# Contributor(s):
#
# Terry Hayes <thayes@netscape.com>
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
@@ -25,11 +26,8 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = appcomps
XPIDL_MODULE = bookmarks
XPIDLSRCS = nsIBookmarksService.idl
include $(topsrcdir)/config/rules.mk
libs::
$(REGCHROME) content pippki pippki.jar
$(REGCHROME) locale en-US/pippki en-US.jar

View File

@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="CAOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="CACerts">
<description>&certmgr.cas;</description>
<separator class="thin"/>
<outliner id="ca-outliner" multiple="true" enableColumnDrag="true"
onselect="ca_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="ca_viewButton"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="ca_editButton"
label="&certmgr.edit.label;"
disabled="true" oncommand="editCerts();"/>
<!-- future - import a DER cert?
<button id="ca_addButton"
label="&certmgr.add.label;"
oncommand="addCerts();"/>
-->
<button id="ca_deleteButton"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="MineOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="myCerts">
<description>&certmgr.mine;</description>
<separator class="thin"/>
<outliner id="user-outliner" multiple="true" enableColumnDrag="true"
onselect="mine_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="verifiedcol"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="purposecol" label="&certmgr.purpose;"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="serialnumcol" label="&certmgr.serial;"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="issuedcol" label="&certmgr.issued;"
class="outlinercol-header outlinercell-inset-header"
hidden="true" persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="expiredcol" label="&certmgr.expires;"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="mine_viewButton" class="normal"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="mine_backupButton" class="normal"
label="&certmgr.backup.label;"
disabled="true" oncommand="backupCerts();"/>
<button id="mine_backupAllButton" class="normal"
label="&certmgr.backupall.label;"
oncommand="backupAllCerts();"/>
<button id="mine_restoreButton" class="normal"
label="&certmgr.restore.label;"
oncommand="restoreCerts();"/>
<button id="mine_deleteButton" class="normal"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,83 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Communicator
-
- The Initial Developer of the Original Code is
- Netscape Communications Corp..
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Kai Engert <kaie@netscape.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="WebSitesOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="othersCerts">
<description>&certmgr.others;</description>
<separator class="thin"/>
<outliner id="email-outliner" multiple="true"
onselect="email_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="emailcol" label="&certmgr.email;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="email_viewButton"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="email_editButton"
label="&certmgr.edit.label;"
disabled="true" oncommand="editCerts();"/>
<!-- future - import a DER cert?
<button id="email_addButton"
label="&certmgr.add.label;"
oncommand="addCerts();"/>
-->
<button id="email_deleteButton"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,210 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!-- This file extends "chrome://navigator/content/pageInfo.xul" -->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/PageInfoOverlay.dtd">
<overlay id="pipPageInfoOverlayID"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript">
<![CDATA[
var security = {
// Display the server certificate (static)
viewCert : function () {
var cert = security._cert;
if (cert) cert.view();
},
_getSecurityInfo : function() {
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
const nsISSLStatus = Components.interfaces.nsISSLStatus;
// Get the window for this information
var w;
if ("arguments" in window && window.arguments.length > 1 && window.arguments[0])
w = window.arguments[0];
else
w = window.opener.frames[0];
var hName = null;
try
{
hName = w.location.host;
} catch(exception){}
var ui = security._getSecurityUI();
var sp = ui.QueryInterface(nsISSLStatusProvider);
var status = sp.SSLStatus;
if (status) {
status = status.QueryInterface(nsISSLStatus);
}
if (status) {
var cert = status.serverCert;
var issuerName;
issuerName = this.mapIssuerOrganization(cert.issuerOrganization);
if (!issuerName) issuerName = cert.issuerName;
return {
hostName : hName,
cAName : issuerName,
encryptionAlgorithm : status.cipherName,
encryptionStrength : status.secretKeyLength,
cert : cert
};
} else {
return {
hostName : hName,
cAName : "",
encryptionAlgorithm : "",
encryptionStrength : 0,
cert : null
};
}
},
// Find the secureBrowserUI object (if present)
_getSecurityUI : function() {
return window.opener.gBrowser.boxObject.getPropertyAsSupports("secureBrowserUI");
},
// Interface for mapping a certificate issuer organization to
// the value to be displayed.
// Bug 82017 - this implementation should be moved to pipnss C++ code
mapIssuerOrganization: function(name) {
if (!name) return null;
if (name == "RSA Data Security, Inc.") return "Verisign, Inc.";
// No mapping required
return name;
},
_cert : null
};
function securityOnLoad() {
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var info = security._getSecurityInfo();
var idHdr;
var message1;
var message2;
/* Set the identification messages */
if (info.cert)
{
idHdr = bundle.GetStringFromName("pageInfo_WebSiteVerified");
document.getElementById("security-identity").setAttribute("value", idHdr);
message1 = bundle.formatStringFromName("pageInfo_Identity_Verified",
[ info.hostName, info.cAName ],
2);
setText("security-identity-text", message1);
var viewText = bundle.GetStringFromName("pageInfo_ViewCertificate");
setText("security-view-text", viewText);
security._cert = info.cert;
} else {
idHdr = bundle.GetStringFromName("pageInfo_SiteNotVerified");
document.getElementById("security-identity").setAttribute("value", idHdr);
document.getElementById("security-view-cert").setAttribute("disabled", "true");
document.getElementById("security-view-cert").setAttribute("hidden", "true");
}
var hdr;
var msg1;
var msg2;
/* Set the encryption messages */
if (info.encryptionStrength >= 90) {
hdr = bundle.formatStringFromName("pageInfo_StrongEncryption",
[ info.encryptionAlgorithm, info.encryptionStrength+"" ], 2);
document.getElementById("security-privacy").setAttribute("value", hdr);
msg1 = bundle.GetStringFromName("pageInfo_Privacy_Strong1");
setText("security-privacy-msg1", msg1);
msg2 = bundle.GetStringFromName("pageInfo_Privacy_Strong2");
setText("security-privacy-msg2", msg2);
security._cert = info.cert;
} else if (info.encryptionStrength > 0) {
hdr = bundle.formatStringFromName("pageInfo_WeakEncryption",
[ info.encryptionAlgorithm, info.encryptionStrength+"" ], 2);
document.getElementById("security-privacy").setAttribute("value", hdr);
msg1 = bundle.formatStringFromName("pageInfo_Privacy_Weak1",
[ info.hostName ], 1);
setText("security-privacy-msg1", msg1);
msg2 = bundle.GetStringFromName("pageInfo_Privacy_Weak2");
setText("security-privacy-msg2", msg2);
} else {
hdr = bundle.GetStringFromName("pageInfo_NoEncryption");
document.getElementById("security-privacy").setAttribute("value", hdr);
if(info.hostName != null)
msg1 = bundle.formatStringFromName("pageInfo_Privacy_None1", [ info.hostName ], 1);
else
msg1 = bundle.GetStringFromName("pageInfo_Privacy_None3");
setText("security-privacy-msg1", msg1);
msg2 = bundle.GetStringFromName("pageInfo_Privacy_None2");
setText("security-privacy-msg2", msg2);
}
}
/* Register for pageInfo onload calls */
onLoadRegistry.push(securityOnLoad);
]]>
</script>
<tabs id="tabs">
<tab id="securityTab" label="&pageInfo.securityTab;"/>
</tabs>
<tabpanels id="tabpanels">
<vbox id="securityPanel" flex="1">
<label id="security-identity" class="header"/>
<description id="security-identity-text" flex="1"/>
<hbox>
<button id="security-view-cert" label="&pageInfo.view.label;"
oncommand="security.viewCert();"/>
<description id="security-view-text" flex="1"/>
</hbox>
<separator class="groove"/>
<label id="security-privacy" class="header"/>
<vbox flex="1">
<description id="security-privacy-msg1"/>
<description id="security-privacy-msg2"/>
</vbox>
</vbox>
</tabpanels>
</overlay>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!-- This file overlays "chrome://communicator/content/pref/preftree.xul" -->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/PrefOverlay.dtd">
<overlay id="pipPrefOverlayID"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<treechildren id="securityChildren">
<treeitem id="masterpassItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-masterpass.xul"
label="&masterpass.label;"/>
</treerow>
</treeitem>
<treeitem id="sslItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-ssl.xul"
label="&ssl.label;"/>
</treerow>
</treeitem>
<treeitem id="certItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-certs.xul"
label="&certs.label;"/>
</treerow>
</treeitem>
<treeitem id="validationItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-validation.xul"
label="&validation.label;"/>
</treerow>
</treeitem>
</treechildren>
</overlay>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="WebSitesOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="webCerts">
<description>&certmgr.websites;</description>
<separator class="thin"/>
<outliner id="server-outliner" multiple="true" enableColumnDrag="true"
onselect="websites_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
persist="hidden width ordinal" flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="websites_viewButton"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="websites_editButton"
label="&certmgr.edit.label;"
disabled="true" oncommand="editCerts();"/>
<!-- future - import a DER cert?
<button id="websites_addButton"
label="&certmgr.add.label;"
oncommand="addCerts();"/>
-->
<button id="websites_deleteButton"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,26 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Rangan Sen <rangansen@netscape.com>
*/
function doOK()
{
window.close();
}

View File

@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Rangan Sen <rangansen@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="cacertexists"
title="&caCertExists.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();">
<script type="application/x-javascript" src="chrome://pippki/content/cacertexists.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox flex="1">
<description>&caCertExists.message;</description>
<separator/>
<hbox align="center">
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
</hbox>
<separator/>
</vbox>
</window>

View File

@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
- Javier Delgadillo <javi@netscape.com>
-->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="certDumpOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox class="box-padded" id="certPrettyPrint" flex="1">
<label class="header" value="&certmgr.hierarchy.label;"/>
<tree id="treesetDump" rows="4"
onselect="updateCertDump();">
<treecolgroup>
<treecol flex="1"/>
</treecolgroup>
<treechildren id="chainDump"/>
</tree>
<outliner class="inset" id="prettyDumpOutliner" style="height:150px">
<outlinercol flex ="1" id="certDataCol" label="&certmgr.details.label;"
ignoreincolumnpicker="true" class="header outlinercol-header" primary="true"/>
<splitter/>
<outlinerbody flex="1" onselect="displaySelected();"/>
</outliner>
<label class="header" value="&certmgr.fields.label;"/>
<textbox class="inset" id="certDumpVal" multiline="true" rows="8"
readonly="true" style="font-family: -moz-fixed;"/>
</vbox>
</overlay>

View File

@@ -0,0 +1,371 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIFilePicker = Components.interfaces.nsIFilePicker;
const nsFilePicker = "@mozilla.org/filepicker;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsICertOutliner = Components.interfaces.nsICertOutliner;
const nsCertOutliner = "@mozilla.org/security/nsCertOutliner;1";
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsDialogParamBlock = "@mozilla.org/embedcomp/dialogparam;1";
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsPKIParamBlock = "@mozilla.org/security/pkiparamblock;1";
var helpURL = "chrome://help/content/help.xul";
var key;
var selected_certs = [];
var certdb;
var caOutlinerView;
var serverOutlinerView;
var emailOutlinerView;
var userOutlinerView;
function LoadCerts()
{
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
caOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
caOutlinerView.loadCerts(nsIX509Cert.CA_CERT);
document.getElementById('ca-outliner')
.outlinerBoxObject.view = caOutlinerView;
serverOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
serverOutlinerView.loadCerts(nsIX509Cert.SERVER_CERT);
document.getElementById('server-outliner')
.outlinerBoxObject.view = serverOutlinerView;
emailOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
emailOutlinerView.loadCerts(nsIX509Cert.EMAIL_CERT);
document.getElementById('email-outliner')
.outlinerBoxObject.view = emailOutlinerView;
userOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
userOutlinerView.loadCerts(nsIX509Cert.USER_CERT);
document.getElementById('user-outliner')
.outlinerBoxObject.view = userOutlinerView;
var rowCnt = userOutlinerView.rowCount;
var enableBackupAllButton=document.getElementById('mine_backupAllButton');
if(rowCnt < 1) {
enableBackupAllButton.setAttribute("disabled",true);
} else {
enableBackupAllButton.setAttribute("enabled",true);
}
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var verifiedColText;
if (certdb.ocspOn) {
verifiedColText = bundle.GetStringFromName("certmgr.verifiedNoOCSP");
} else {
verifiedColText = bundle.GetStringFromName("certmgr.verified");
}
var verifiedCol = document.getElementById('verifiedcol');
verifiedCol.setAttribute('label', verifiedColText);
}
function ReloadCerts()
{
caOutlinerView.loadCerts(nsIX509Cert.CA_CERT);
serverOutlinerView.loadCerts(nsIX509Cert.SERVER_CERT);
emailOutlinerView.loadCerts(nsIX509Cert.EMAIL_CERT);
userOutlinerView.loadCerts(nsIX509Cert.USER_CERT);
}
function getSelectedTab()
{
var selTab = document.getElementById('certMgrTabbox').selectedItem;
var selTabID = selTab.getAttribute('id');
if (selTabID == 'mine_tab') {
key = "?my_certs";
} else if (selTabID == "others_tab") {
key = "?others_certs";
} else if (selTabID == "websites_tab") {
key = "?web_certs";
} else if (selTabID == "ca_tab") {
key = "?ca_certs";
}
var context = helpURL + key;
return context;
}
function doHelpButton() {
var uri = getSelectedTab();
openHelp(uri);
}
function getSelectedCerts()
{
var ca_tab = document.getElementById("ca_tab");
var mine_tab = document.getElementById("mine_tab");
var others_tab = document.getElementById("others_tab");
var websites_tab = document.getElementById("websites_tab");
var items = null;
if (ca_tab.selected) {
items = caOutlinerView.selection;
} else if (mine_tab.selected) {
items = userOutlinerView.selection;
} else if (others_tab.selected) {
items = emailOutlinerView.selection;
} else if (websites_tab.selected) {
items = serverOutlinerView.selection;
}
selected_certs = [];
var cert = null;
var nr = 0;
if (items != null) nr = items.getRangeCount();
if (nr > 0) {
for (var i=0; i<nr; i++) {
var o1 = {};
var o2 = {};
items.getRangeAt(i, o1, o2);
var min = o1.value;
var max = o2.value;
for (var j=min; j<=max; j++) {
if (ca_tab.selected) {
cert = caOutlinerView.getCert(j);
} else if (mine_tab.selected) {
cert = userOutlinerView.getCert(j);
} else if (others_tab.selected) {
cert = emailOutlinerView.getCert(j);
} else if (websites_tab.selected) {
cert = serverOutlinerView.getCert(j);
}
if (cert)
selected_certs[selected_certs.length] = cert;
}
}
}
}
function ca_enableButtons()
{
var items = caOutlinerView.selection;
var nr = items.getRangeCount();
var toggle="false";
if (nr == 0) {
toggle="true";
}
var edit_toggle=toggle;
/*
var edit_toggle="true";
if (nr > 0) {
for (var i=0; i<nr; i++) {
var o1 = {};
var o2 = {};
items.getRangeAt(i, o1, o2);
var min = o1.value;
var max = o2.value;
var stop = false;
for (var j=min; j<=max; j++) {
var tokenName = items.outliner.view.getCellText(j, "tokencol");
if (tokenName == "Builtin Object Token") { stop = true; } break;
}
if (stop) break;
}
if (i == nr) {
edit_toggle="false";
}
}
*/
var enableViewButton=document.getElementById('ca_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableEditButton=document.getElementById('ca_editButton');
enableEditButton.setAttribute("disabled",edit_toggle);
var enableDeleteButton=document.getElementById('ca_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function mine_enableButtons()
{
var items = userOutlinerView.selection;
var toggle="false";
if (items.getRangeCount() == 0) {
toggle="true";
}
var enableViewButton=document.getElementById('mine_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableBackupButton=document.getElementById('mine_backupButton');
enableBackupButton.setAttribute("disabled",toggle);
var enableDeleteButton=document.getElementById('mine_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function websites_enableButtons()
{
var items = serverOutlinerView.selection;
var toggle="false";
if (items.getRangeCount() == 0) {
toggle="true";
}
var enableViewButton=document.getElementById('websites_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableEditButton=document.getElementById('websites_editButton');
enableEditButton.setAttribute("disabled",toggle);
var enableDeleteButton=document.getElementById('websites_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function email_enableButtons()
{
var items = emailOutlinerView.selection;
var toggle="false";
if (items.getRangeCount() == 0) {
toggle="true";
}
var enableViewButton=document.getElementById('email_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableEditButton=document.getElementById('email_editButton');
enableEditButton.setAttribute("disabled",toggle);
var enableDeleteButton=document.getElementById('email_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function backupCerts()
{
getSelectedCerts();
var numcerts = selected_certs.length;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);
fp.init(window,
bundle.GetStringFromName("chooseP12BackupFileDialog"),
nsIFilePicker.modeSave);
fp.appendFilter("PKCS12 Files", "*.p12");
fp.appendFilters(nsIFilePicker.filterAll);
var rv = fp.show();
if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
certdb.exportPKCS12File(null, fp.file,
selected_certs.length, selected_certs);
}
}
function backupAllCerts()
{
// Select all rows, then call doBackup()
var items = userOutlinerView.selection.selectAll();
backupCerts();
}
function editCerts()
{
getSelectedCerts();
var numcerts = selected_certs.length;
for (var t=0; t<numcerts; t++) {
var cert = selected_certs[t];
var certkey = cert.dbKey;
var ca_tab = document.getElementById("ca_tab");
if (ca_tab.selected) {
window.openDialog('chrome://pippki/content/editcacert.xul', certkey,
'chrome,width=100,resizable=1,modal');
} else {
window.openDialog('chrome://pippki/content/editsslcert.xul', certkey,
'chrome,width=100,resizable=1,modal');
}
}
}
function restoreCerts()
{
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);
fp.init(window,
bundle.GetStringFromName("chooseP12RestoreFileDialog"),
nsIFilePicker.modeOpen);
fp.appendFilter("PKCS12 Files", "*.p12;*.pfx");
fp.appendFilters(nsIFilePicker.filterAll);
if (fp.show() == nsIFilePicker.returnOK) {
var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
certdb.importPKCS12File(null, fp.file);
}
userOutlinerView.loadCerts(nsIX509Cert.USER_CERT);
}
function deleteCerts()
{
getSelectedCerts();
var params = Components.classes[nsDialogParamBlock].createInstance(nsIDialogParamBlock);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var selTab = document.getElementById('certMgrTabbox').selectedItem;
var selTabID = selTab.getAttribute('id');
if (selTabID == 'mine_tab')
{
params.SetString(1,bundle.GetStringFromName("deleteUserCertFlag"));
}
else if (selTabID == "websites_tab")
{
params.SetString(1,bundle.GetStringFromName("deleteSslCertFlag"));
}
else if (selTabID == "ca_tab")
{
params.SetString(1,bundle.GetStringFromName("deleteCaCertFlag"));
}
else if (selTabID == "others_tab")
{
params.SetString(1,bundle.GetStringFromName("deleteEmailCertFlag"));
}
else
{
return;
}
var numcerts = selected_certs.length;
params.SetInt(2,numcerts);
for (var t=0; t<numcerts; t++)
{
var cert = selected_certs[t];
params.SetString(t+3, cert.dbKey);
}
window.openDialog('chrome://pippki/content/deletecert.xul', "",
'chrome,resizable=1,modal',params);
ReloadCerts();
}
function viewCerts()
{
getSelectedCerts();
var numcerts = selected_certs.length;
for (var t=0; t<numcerts; t++) {
selected_certs[t].view();
}
}
/* XXX future - import a DER cert from a file? */
function addCerts()
{
alert("Add cert chosen");
}

View File

@@ -0,0 +1,68 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/MineOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/OthersOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/WebSitesOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/CAOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="certmanager"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&certmgr.title;"
onload="LoadCerts();">
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/certManager.js"/>
<vbox flex="1">
<tabbox flex="1">
<tabs id="certMgrTabbox">
<tab id="mine_tab" label="&certmgr.tab.mine;"/>
<tab id="others_tab" label="&certmgr.tab.others;"/>
<tab id="websites_tab" label="&certmgr.tab.websites;"/>
<tab id="ca_tab" label="&certmgr.tab.ca;" selected="true"/>
</tabs>
<tabpanels flex="1">
<vbox id="myCerts" flex="1"/>
<vbox id="othersCerts" flex="1"/>
<vbox id="webCerts" flex="1"/>
<vbox id="CACerts" flex="1"/>
</tabpanels>
</tabbox>
<hbox>
<button id="HelpButton"
label="&certmgr.help.label;"
accesskey="&certmgr.helpButtonAccessKey;"
oncommand="doHelpButton();"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
- Javier Delgadillo <javi@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<?xul-overlay href="chrome://pippki/content/viewCertDetails.xul"?>
<?xul-overlay href="chrome://pippki/content/certDump.xul"?>
<window id="certDetails"
title="&certmgr.certdetail.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/viewCertDetails.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close()"/>
</keyset>
<grid flex="1">
<column flex="1"/>
<rows>
<row flex="1">
<tabbox flex="1">
<tabs>
<tab id="general_tab" label="&certmgr.detail.general_tab.title;"/>
<tab id="prettyprint_tab" label="&certmgr.detail.prettyprint_tab.title;"/>
</tabs>
<tabpanels flex="1">
<vbox id="general_info" flex="1"/>
<vbox id="certPrettyPrint" flex="1"/>
</tabpanels>
</tabbox>
</row>
<row>
<separator class="thin"/>
</row>
<row>
<hbox align="right" flex="1">
<button id="HelpButton"
label="&certmgr.help.label;"
accesskey="&certmgr.helpButtonAccessKey;"
oncommand="openHelp('chrome://help/content/help.xul?cert_details');"/>
<button id="closeButton"
label="&certmgr.close.label;"
accesskey="&certmgr.closeWindowAccessKey;"
oncommand="window.close();"/>
</hbox>
</row>
</rows>
</grid>
</window>

View File

@@ -0,0 +1,96 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp..
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Kai Engert <kaie@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var dialogParams;
var itemCount = 0;
function onLoad()
{
dialogParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
var pickerTitle = dialogParams.GetString(1);
var mainwin = document.getElementById("certPicker");
mainwin.setAttribute("title", pickerTitle);
var pickerInfo = dialogParams.GetString(2);
setText("pickerInfo", pickerInfo);
var selectElement = document.getElementById("nicknames");
itemCount = dialogParams.GetInt(1);
for (var i=0; i < itemCount; i++) {
var menuItemNode = document.createElement("menuitem");
var nick = dialogParams.GetString(i+3);
menuItemNode.setAttribute("value", i);
menuItemNode.setAttribute("label", nick); // this is displayed
selectElement.firstChild.appendChild(menuItemNode);
if (i == 0) {
selectElement.selectedItem = menuItemNode;
}
}
dialogParams.SetInt(1,0); // set cancel return value
setDetails();
}
function setDetails()
{
var index = parseInt(document.getElementById("nicknames").value);
details = dialogParams.GetString(index+itemCount+3);
document.getElementById("details").value = details;
}
function onCertSelected()
{
setDetails();
}
function doOK()
{
dialogParams.SetInt(1,1);
var index = parseInt(document.getElementById("nicknames").value);
dialogParams.SetInt(2, index);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,81 @@
<?xml version="1.0"?>
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla Communicator
-
- The Initial Developer of the Original Code is
- Netscape Communications Corp..
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- Contributor(s): Kai Engert <kaie@netscape.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the LGPL or the GPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="certPicker" title="&certPicker.defaultTitle;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/certpicker.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<vbox style="margin: 5px;">
<groupbox>
<description id="pickerInfo" style="font-weight: bold;">&certPicker.defaultInfo;</description>
<broadcaster id="certSelected" oncommand="onCertSelected();"/>
<!-- The items in this menulist must never be sorted,
but remain in the order filled by the application
-->
<menulist id="nicknames" observes="certSelected">
<menupopup/>
</menulist>
<label value="&certPicker.detailsLabel;"/>
<textbox readonly="true" id="details" multiline="true"
style="height: 11em; width=80em;"/>
</groupbox>
<separator class="thin"/>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,117 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="set_password" title="&setPassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox style="margin: 5px;" flex="1">
<hbox align="center">
<label value="&setPassword.tokenName.label;: "/>
<label id="tokenName" />
<menulist id="tokenMenu" oncommand="onMenuChange()">
<menupopup/>
</menulist>
</hbox>
<!--
<menulist id="signerList" disabled="true">
<menupopup>
<menuitem id="token-menu" label="Built-in private key database"/>
<menuitem label="Bob Lord's iButton"/>
</menupopup>
</menulist>
-->
<separator/>
<groupbox>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<label value="&setPassword.oldPassword.label;"/>
<textbox id="oldpw" type="password"/>
<!-- This textbox is inserted as a workaround to the fact that making the 'type'
& 'disabled' property of the 'oldpw' textbox toggle between ['password' &
'false'] and ['text' & 'true'] - as would be necessary if the menu has more
than one tokens, some initialized and some not - does not work properly. So,
either the textbox 'oldpw' or the textbox 'message' would be displayed,
depending on the state of the token selected
-->
<textbox id="message" disabled="true" />
</row>
<row>
<label value="&setPassword.newPassword.label;"/>
<textbox id="pw1" type="password"
onkeypress="setPasswordStrength(); checkPasswords();"/>
</row>
<row>
<label value="&setPassword.reenterPassword.label;"/>
<textbox id="pw2" type="password" onkeypress="checkPasswords();"/>
</row>
</rows>
</grid>
</groupbox>
<groupbox>
<caption label="&setPassword.meter.label;"/>
<progressmeter id="pwmeter" mode="determined"
value="0"/>
</groupbox>
<separator/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="if (!document.getElementById('ok-button').disabled) setPassword();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="if (!document.getElementById('ok-button').disabled) setPassword();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="setPassword();" disabled="true" default="true"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?change_pwd');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,58 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan.
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var dialogParams;
function onLoad()
{
dialogParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
var selectElement = document.getElementById("tokens");
for (var i=1; i <= dialogParams.GetInt(1); i++) {
var menuItemNode = document.createElement("menuitem");
var token = dialogParams.GetString(i);
menuItemNode.setAttribute("value", token);
menuItemNode.setAttribute("label", token);
selectElement.firstChild.appendChild(menuItemNode);
if (i == 1) {
selectElement.selectedItem = menuItemNode;
}
}
}
function doOK()
{
var tokenList = document.getElementById("tokens");
var token = tokenList.value;
dialogParams.SetInt(1,1);
dialogParams.SetString(1, token);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corporation. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corporation. All
- Rights Reserved.
-
- Contributor(s):
- David Drinan (ddrinan@netscape.com)
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="ssl_warning" title="&chooseToken.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="360"
width="400"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/choosetoken.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="if (!document.getElementById('ok-button').disabled) doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="if (!document.getElementById('ok-button').disabled) doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<groupbox>
<description>&chooseToken.message1;</description>
<menulist id="tokens">
<menupopup/>
</menulist>
</groupbox>
<separator />
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?which_token');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,92 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var dialogParams;
var itemCount = 0;
function onLoad()
{
var cn;
var org;
var issuer;
dialogParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
cn = dialogParams.GetString(1);
org = dialogParams.GetString(2);
issuer = dialogParams.GetString(3);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = bundle.formatStringFromName("clientAuthMessage1",
[org],
1);
var message2 = bundle.formatStringFromName("clientAuthMessage2",
[issuer],
1);
setText("hostname", cn);
setText("organization", message1);
setText("issuer", message2);
var selectElement = document.getElementById("nicknames");
itemCount = dialogParams.GetInt(1);
for (var i=0; i < itemCount; i++) {
var menuItemNode = document.createElement("menuitem");
var nick = dialogParams.GetString(i+4);
menuItemNode.setAttribute("value", i);
menuItemNode.setAttribute("label", nick); // this is displayed
selectElement.firstChild.appendChild(menuItemNode);
if (i == 0) {
selectElement.selectedItem = menuItemNode;
}
}
setDetails();
}
function setDetails()
{
var index = parseInt(document.getElementById("nicknames").value);
details = dialogParams.GetString(index+itemCount+4);
document.getElementById("details").value = details;
}
function onCertSelected()
{
setDetails();
}
function doOK()
{
dialogParams.SetInt(1,1);
var index = parseInt(document.getElementById("nicknames").value);
dialogParams.SetInt(2, index);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- David Drinan (ddrinan@netscape.com)
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="ssl_warning" title="&clientAuthAsk.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/clientauthask.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox style="margin: 5px;">
<groupbox>
<description style="font-weight: bold;">&clientAuthAsk.message1;</description>
<description id="hostname"/>
<description id="organization"/>
<description id="issuer"/>
</groupbox>
<groupbox>
<description style="font-weight: bold;">&clientAuthAsk.message2;</description>
<broadcaster id="certSelected" oncommand="onCertSelected();"/>
<!-- The items in this menulist must never be sorted,
but remain in the order filled by the application
-->
<menulist id="nicknames" observes="certSelected">
<menupopup/>
</menulist>
<description>&clientAuthAsk.message3;</description>
<textbox readonly="true" id="details" multiline="true"
style="height: 11em; width=80em;"/>
</groupbox>
<separator/>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" label="&help.label;"
style="width: 10ex" oncommand="openHelp('chrome://help/content/help.xul?which_cert');" />
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:pippki"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:pippki"
chrome:displayName="pippki"
chrome:author="PSM Team"
chrome:name="pippki"
chrome:localeVersion="0.9.6">
</RDF:Description>
<!-- Declare overlay points used in this package -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
<RDF:li resource="chrome://navigator/content/pageInfo.xul"/>
</RDF:Seq>
<!-- Define the local overlay file(s) for each overlay point -->
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
<RDF:li>chrome://pippki/content/PrefOverlay.xul</RDF:li>
</RDF:Seq>
<RDF:Seq about="chrome://navigator/content/pageInfo.xul">
<RDF:li>chrome://pippki/content/PageInfoOverlay.xul</RDF:li>
</RDF:Seq>
</RDF:RDF>

View File

@@ -1,9 +1,9 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
@@ -16,11 +16,28 @@
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/* Defining the following causes NS_APPSHELL to be defined as NS_EXPORT. */
#define _IMPL_NS_APPSHELL
var keygenThread;
#include "MacSharedPrefix.h"
function onLoad()
{
keygenThread = window.arguments[0].QueryInterface(Components.interfaces.nsIKeygenThread);
if (!keygenThread) {
window.close();
return;
}
setCursor("wait");
keygenThread.startKeyGeneration(window);
}
function onClose()
{
setCursor("default");
var alreadyClosed = new Object();
keygenThread.userCanceled(alreadyClosed);
}

View File

@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window
id="domainMismatch" title="&createCertInfo.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();"
onclose="onClose();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="pippki.js" />
<script type="application/x-javascript" src="createCertInfo.js" />
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<vbox style="margin: 5px; max-width: 50em;">
<description>&createCertInfo.msg1;</description>
<separator/>
<description style="font-weight: bold; text-align: center; text-decoration: blink;">&createCertInfo.msg2;</description>
<separator/>
</vbox>
</window>

View File

@@ -0,0 +1,105 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsICrlEntry = Components.interfaces.nsICrlEntry;
const nsISupportsArray = Components.interfaces.nsISupportsArray;
var certdb;
var crls;
function onLoad()
{
var crlEntry;
var i;
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
crls = certdb.getCrls();
for (i=0; i<crls.Count(); i++) {
crlEntry = crls.GetElementAt(i).QueryInterface(nsICrlEntry);
var org = crlEntry.org;
var orgUnit = crlEntry.orgUnit;
var lastUpdate = crlEntry.lastUpdate;
var nextUpdate = crlEntry.nextUpdate;
AddItem("crlList", [org, orgUnit, lastUpdate, nextUpdate], "crltree_", i);
}
}
function AddItem(children,cells,prefix,idfier)
{
var kids = document.getElementById(children);
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
for(var i = 0; i < cells.length; i++)
{
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("label", cells[i])
row.appendChild(cell);
}
item.appendChild(row);
item.setAttribute("id",prefix + idfier);
kids.appendChild(item);
}
function DeleteCrlSelected() {
var crlEntry;
// delete selected item
var crltree = document.getElementById("crltree");
var i = crltree.selectedIndex;
// Delete it
certdb.deleteCrl(i);
DeleteItemSelected("crltree", "crltree_", "crlList");
if( !crltree.selectedItems.length ) {
if( !document.getElementById("deleteCrl").disabled ) {
document.getElementById("deleteCrl").setAttribute("disabled", "true")
}
}
}
function EnableCrlActions() {
document.getElementById("deleteCrl").removeAttribute("disabled", "true");
// document.getElementById("updateCrl").removeAttribute("disabled", "true");
}
function DeleteItemSelected(tree, prefix, kids) {
var i;
var delnarray = [];
var rv = "";
var cookietree = document.getElementById(tree);
var selitems = cookietree.selectedItems;
for(i = 0; i < selitems.length; i++)
{
delnarray[i] = document.getElementById(selitems[i].getAttribute("id"));
var itemid = parseInt(selitems[i].getAttribute("id").substring(prefix.length,selitems[i].getAttribute("id").length));
rv += (itemid + ",");
}
for(i = 0; i < delnarray.length; i++)
{
document.getElementById(kids).removeChild(delnarray[i]);
}
return rv;
}

View File

@@ -0,0 +1,80 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
David Drinan (ddrinan@netscape.com)
-->
<!-- CHANGE THIS WHEN MOVING FILES -->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window [
<!ENTITY % prefValDTD SYSTEM "chrome://pippki/locale/pref-validation.dtd">
%prefValDTD;
<!ENTITY % prefCertMgrDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
%prefCertMgrDTD;
]>
<window id="crlviewer"
class="dialog"
title="&validation.crlmanager.label;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em;"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/crlManager.js"/>
<description value="&validation.crlmanager.label;"/>
<separator class="thin"/>
<tree id="crltree" style="height: 10em;"
multiple="false" onclick="EnableCrlActions()" flex="1">
<treecolgroup>
<treecol flex="3" width="0"/>
<splitter class="tree-splitter"/>
<treecol flex="5" width="0"/>
<splitter class="tree-splitter"/>
<treecol flex="2" width="0"/>
<splitter class="tree-splitter"/>
<treecol flex="2" width="0"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header sortDirectionIndicator"
label="&certmgr.certdetail.o;"/>
<treecell class="treecell-header sortDirectionIndicator"
label="&certmgr.certdetail.ou;"/>
<treecell class="treecell-header sortDirectionIndicator"
label="&validation.crllastupdate.label;"/>
<treecell class="treecell-header sortDirectionIndicator"
label="&validation.crlnextupdate.label;"/>
</treerow>
</treehead>
<treechildren id="crlList" flex="1"/>
</tree>
<hbox>
<button id="deleteCrl" disabled="true"
label="&validation.deletecrl.label;"
oncommand="DeleteCrlSelected();"/>
</hbox>
<separator class="thin"/>
</window>

View File

@@ -0,0 +1,126 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var certdb;
var certs = [];
var helpUrl;
function setWindowName()
{
var params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
// Get the cert from the cert database
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
var typeFlag = params.GetString(1);
var numberOfCerts = params.GetInt(2);
var dbkey;
for(var x=0; x<numberOfCerts;x++)
{
dbkey = params.GetString(x+3);
certs[x] = certdb.getCertByDBKey(dbkey , null);
}
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var title;
var confirm;
var impact;
if(typeFlag == bundle.GetStringFromName("deleteUserCertFlag"))
{
title = bundle.GetStringFromName("deleteUserCertTitle");
confirm = bundle.GetStringFromName("deleteUserCertConfirm");
impact = bundle.GetStringFromName("deleteUserCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_my_certs"
}
else if(typeFlag == bundle.GetStringFromName("deleteSslCertFlag"))
{
title = bundle.GetStringFromName("deleteSslCertTitle");
confirm = bundle.GetStringFromName("deleteSslCertConfirm");
impact = bundle.GetStringFromName("deleteSslCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_web_certs"
}
else if(typeFlag == bundle.GetStringFromName("deleteCaCertFlag"))
{
title = bundle.GetStringFromName("deleteCaCertTitle");
confirm = bundle.GetStringFromName("deleteCaCertConfirm");
impact = bundle.GetStringFromName("deleteCaCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_ca_certs"
}
else if(typeFlag == bundle.GetStringFromName("deleteEmailCertFlag"))
{
title = bundle.GetStringFromName("deleteEmailCertTitle");
confirm = bundle.GetStringFromName("deleteEmailCertConfirm");
impact = bundle.GetStringFromName("deleteEmailCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_email_certs"
}
else
{
return;
}
var windowReference = document.getElementById('deleteCertificate');
var confirReference = document.getElementById('confirm');
var impactReference = document.getElementById('impact');
windowReference.setAttribute("title", title);
setText("confirm",confirm);
var box=document.getElementById("certlist");
var text;
for(var x=0;x<certs.length;x++)
{
text = document.createElement("text");
text.setAttribute("value",certs[x].commonName);
box.appendChild(text);
}
setText("impact",impact);
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("height",window.innerHeight + 40);
}
function doOK()
{
for(var i=0;i<certs.length;i++)
{
certdb.deleteCertificate(certs[i]);
}
window.close();
}
function doHelp()
{
openHelp(helpUrl);
}

View File

@@ -0,0 +1,62 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="deleteCertificate"
title="&certmgr.deletecert.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();"
style="width:8ex">
<script type="application/x-javascript" src="chrome://pippki/content/deletecert.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="pippki.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox flex="1">
<description id="confirm"/>
<separator />
<vbox id="certlist" flex="100%"/>
<description id="impact"/>
<separator />
<hbox align="center">
<button id="ok-button" label="&certmgr.ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&certmgr.cancel.label;"
oncommand="window.close();"/>
<button id="help-button" label="&certmgr.help.label;"
oncommand="doHelp();"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,420 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIFilePicker = Components.interfaces.nsIFilePicker;
const nsFilePicker = "@mozilla.org/filepicker;1";
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
const nsIPKCS11Module = Components.interfaces.nsIPKCS11Module;
const nsPKCS11ModuleDB = "@mozilla.org/security/pkcs11moduledb;1";
const nsIPKCS11ModuleDB = Components.interfaces.nsIPKCS11ModuleDB;
const nsIPK11Token = Components.interfaces.nsIPK11Token;
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
var bundle;
var secmoddb;
/* Do the initial load of all PKCS# modules and list them. */
function LoadModules()
{
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);
var modules = secmoddb.listModules();
var done = false;
try {
modules.isDone();
} catch (e) { done = true; }
while (!done) {
var module = modules.currentItem().QueryInterface(nsIPKCS11Module);
if (module) {
var slotnames = [];
var slots = module.listSlots();
var slots_done = false;
try {
slots.isDone();
} catch (e) { slots_done = true; }
while (!slots_done) {
var slot = null;
try {
slot = slots.currentItem().QueryInterface(nsIPKCS11Slot);
} catch (e) { slot = null; }
// in the ongoing discussion of whether slot names or token names
// are to be shown, I've gone with token names because NSS will
// prefer lookup by token name. However, the token may not be
// present, so maybe slot names should be listed, while token names
// are "remembered" for lookup?
if (slot != null) {
if (slot.tokenName)
slotnames[slotnames.length] = slot.tokenName;
else
slotnames[slotnames.length] = slot.name;
}
try {
slots.next();
} catch (e) { slots_done = true; }
}
AddModule(module.name, slotnames);
}
try {
modules.next();
} catch (e) { done = true; }
}
/* Set the text on the fips button */
SetFIPSButtonText();
}
function SetFIPSButtonText()
{
var fipsButton = document.getElementById("fipsbutton");
var label;
if (secmoddb.isFIPSEnabled) {
label = bundle.GetStringFromName("disable_fips");
} else {
label = bundle.GetStringFromName("enable_fips");
}
fipsButton.setAttribute("label", label);
}
/* Add a module to the tree. slots is the array of slots in the module,
* to be represented as children.
*/
function AddModule(module, slots)
{
var tree = document.getElementById("device_list");
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("label", module);
cell.setAttribute("style", "font-weight: bold");
cell.setAttribute("crop", "never");
row.appendChild(cell);
item.appendChild(row);
var parent = document.createElement("treechildren");
for (var i = 0; i<slots.length; i++) {
var child_item = document.createElement("treeitem");
var child_row = document.createElement("treerow");
var child_cell = document.createElement("treecell");
child_cell.setAttribute("label", slots[i]);
child_cell.setAttribute("class", "treecell-indent");
child_row.appendChild(child_cell);
child_item.appendChild(child_row);
child_item.setAttribute("pk11kind", "slot");
parent.appendChild(child_item);
}
item.appendChild(parent);
item.setAttribute("pk11kind", "module");
item.setAttribute("open", "true");
item.setAttribute("container", "true");
tree.appendChild(item);
}
var selected_slot;
var selected_module;
/* get the slot selected by the user (can only be one-at-a-time) */
function getSelectedItem()
{
var tree = document.getElementById('device_tree');
var items = tree.selectedItems;
selected_slot = null;
selected_module = null;
if (items.length > 0) {
var kind = items[0].getAttribute("pk11kind");
var module_name;
if (kind == "slot") {
// get the module cell for this slot cell
var cell = items[0].parentNode.parentNode.firstChild.firstChild;
module_name = cell.getAttribute("label");
var module = secmoddb.findModuleByName(module_name);
// get the cell for the selected row (the slot to display)
cell = items[0].firstChild.firstChild;
var slot_name = cell.getAttribute("label");
selected_slot = module.findSlotByName(slot_name);
} else { // (kind == "module")
// get the cell for the selected row (the module to display)
cell = items[0].firstChild.firstChild;
module_name = cell.getAttribute("label");
selected_module = secmoddb.findModuleByName(module_name);
}
}
}
function enableButtons()
{
var login_toggle = "true";
var logout_toggle = "true";
var pw_toggle = "true";
var unload_toggle = "true";
getSelectedItem();
if (selected_module) {
unload_toggle = "false";
showModuleInfo();
} else if (selected_slot) {
// here's the workaround - login functions are all with token,
// so grab the token type
var selected_token = selected_slot.getToken();
if (selected_token != null) {
if (selected_token.needsLogin() || !(selected_token.needsUserInit)) {
pw_toggle = "false";
if(selected_token.needsLogin()) {
if (selected_token.isLoggedIn()) {
logout_toggle = "false";
} else {
login_toggle = "false";
}
}
}
}
showSlotInfo();
}
var thebutton = document.getElementById('login_button');
thebutton.setAttribute("disabled", login_toggle);
thebutton = document.getElementById('logout_button');
thebutton.setAttribute("disabled", logout_toggle);
thebutton = document.getElementById('change_pw_button');
thebutton.setAttribute("disabled", pw_toggle);
thebutton = document.getElementById('unload_button');
thebutton.setAttribute("disabled", unload_toggle);
// not implemented
//thebutton = document.getElementById('change_slotname_button');
//thebutton.setAttribute("disabled", toggle);
}
// clear the display of information for the slot
function ClearInfoList()
{
var info_list = document.getElementById("info_list");
while (info_list.firstChild)
info_list.removeChild(info_list.firstChild);
}
// show a list of info about a slot
function showSlotInfo()
{
ClearInfoList();
switch (selected_slot.status) {
case nsIPKCS11Slot.SLOT_DISABLED:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_disabled"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_NOT_PRESENT:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_notpresent"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_UNINITIALIZED:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_uninitialized"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_NOT_LOGGED_IN:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_notloggedin"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_LOGGED_IN:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_loggedin"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_READY:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_ready"),
"tok_status");
break;
}
AddInfoRow(bundle.GetStringFromName("devinfo_desc"),
selected_slot.desc, "slot_desc");
AddInfoRow(bundle.GetStringFromName("devinfo_manID"),
selected_slot.manID, "slot_manID");
AddInfoRow(bundle.GetStringFromName("devinfo_hwversion"),
selected_slot.HWVersion, "slot_hwv");
AddInfoRow(bundle.GetStringFromName("devinfo_fwversion"),
selected_slot.FWVersion, "slot_fwv");
}
function showModuleInfo()
{
ClearInfoList();
AddInfoRow(bundle.GetStringFromName("devinfo_modname"),
selected_module.name, "module_name");
AddInfoRow(bundle.GetStringFromName("devinfo_modpath"),
selected_module.libName, "module_path");
}
// add a row to the info list, as [col1 col2] (ex.: ["status" "logged in"])
function AddInfoRow(col1, col2, cell_id)
{
var tree = document.getElementById("info_list");
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
var cell1 = document.createElement("treecell");
cell1.setAttribute("label", col1);
cell1.setAttribute("crop", "never");
row.appendChild(cell1);
var cell2 = document.createElement("treecell");
cell2.setAttribute("label", col2);
cell2.setAttribute("crop", "never");
cell2.setAttribute("id", cell_id);
row.appendChild(cell2);
item.appendChild(row);
tree.appendChild(item);
}
// log in to a slot
function doLogin()
{
getSelectedItem();
// here's the workaround - login functions are with token
var selected_token = selected_slot.getToken();
try {
selected_token.login(false);
var tok_status = document.getElementById("tok_status");
if (selected_token.isLoggedIn()) {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_loggedin"));
} else {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_notloggedin"));
}
} catch (e) {
var alertStr = bundle.GetStringFromName("login_failed");
alert(alertStr);
}
enableButtons();
}
// log out of a slot
function doLogout()
{
getSelectedItem();
// here's the workaround - login functions are with token
var selected_token = selected_slot.getToken();
try {
selected_token.logout(false);
var tok_status = document.getElementById("tok_status");
if (selected_token.isLoggedIn()) {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_loggedin"));
} else {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_notloggedin"));
}
} catch (e) {
}
enableButtons();
}
// load a new device
function doLoad()
{
//device.loaddlg.width=300
//device.loaddlg.height=200
var dlgWidth = bundle.GetStringFromName("device.loaddlg.width");
var dlgHeight = bundle.GetStringFromName("device.loaddlg.height");
//
window.open("load_device.xul", "loaddevice",
"chrome,width=" + dlgWidth + ",height="+ dlgHeight+ ",resizable=1,dialog=1,modal=1");
var device_list = document.getElementById("device_list");
while (device_list.firstChild)
device_list.removeChild(device_list.firstChild);
LoadModules();
}
function doUnload()
{
getSelectedItem();
if (selected_module) {
pkcs11.deletemodule(selected_module.name);
var device_list = document.getElementById("device_list");
while (device_list.firstChild)
device_list.removeChild(device_list.firstChild);
LoadModules();
}
}
function changePassword()
{
getSelectedItem();
token = selected_slot.getToken();
window.open("changepassword.xul",
selected_slot.tokenName,
"chrome,resizable=1,modal=1,dialog=1");
showSlotInfo();
enableButtons();
}
// browse fs for PKCS#11 device
function doBrowseFiles()
{
var srbundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);
fp.init(window,
srbundle.GetStringFromName("loadPK11TokenDialog"),
nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterAll);
if (fp.show() == nsIFilePicker.returnOK) {
var pathbox = document.getElementById("device_path");
pathbox.setAttribute("value", fp.file.persistentDescriptor);
}
}
function doLoadDevice()
{
var name_box = document.getElementById("device_name");
var path_box = document.getElementById("device_path");
pkcs11.addmodule(name_box.value, path_box.value, 0,0);
window.close();
}
// ------------------------------------- Old code
function showTokenInfo()
{
ClearInfoList();
getSelectedToken();
AddInfoRow(bundle.GetStringFromName("devinfo_label"),
selected_token.tokenLabel, "tok_label");
AddInfoRow(bundle.GetStringFromName("devinfo_manID"),
selected_token.tokenManID, "tok_manID");
AddInfoRow(bundle.GetStringFromName("devinfo_serialnum"),
selected_token.tokenSerialNumber, "tok_sNum");
AddInfoRow(bundle.GetStringFromName("devinfo_hwversion"),
selected_token.tokenHWVersion, "tok_hwv");
AddInfoRow(bundle.GetStringFromName("devinfo_fwversion"),
selected_token.tokenFWVersion, "tok_fwv");
}
function toggleFIPS()
{
secmoddb.toggleFIPSMode();
//Remove the existing listed modules so that re-fresh doesn't
//display the module that just changed.
var device_list = document.getElementById("device_list");
while (device_list.firstChild)
device_list.removeChild(device_list.firstChild);
LoadModules();
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % deviceManangerDTD SYSTEM "chrome://pippki/locale/deviceManager.dtd">
%deviceManangerDTD;
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="devicemanager"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&devmgr.title;"
persist="screenX screenY width height"
onload="LoadModules();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/device_manager.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<grid flex="1">
<columns>
<column flex="1"/>
<column flex="1"/>
<column flex="1"/>
</columns>
<rows>
<row>
<hbox flex="1"> <!-- List of devices -->
<tree id="device_tree" rows="12" multiple="false"
onselect="enableButtons();"
flex="1" style="min-width:15em">
<treecolgroup>
<treecol flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header"
label="&devmgr.devlist.label;"
flex="1"/>
</treerow>
</treehead>
<treechildren id="device_list"/>
</tree>
</hbox> <!-- / List of devices -->
<hbox flex="1"> <!-- Device status -->
<tree id="info_tree" rows="12" multiple="false"
class="list" flex="1" style="min-width:10em">
<treecolgroup>
<treecol flex="5"/>
<treecol flex="7"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header"
label="&devmgr.details.title;" flex="2"/>
<treecell class="treecell-header"
label="&devmgr.details.title2;" flex="7"/>
</treerow>
</treehead>
<treechildren id="info_list"/>
</tree>
</hbox> <!-- / Device status -->
<vbox> <!-- Buttons for manipulating devices -->
<button id="login_button"
label="&devmgr.button.login.label;"
oncommand="doLogin();" disabled="true"/>
<button id="logout_button"
label="&devmgr.button.logout.label;"
oncommand="doLogout();" disabled="true"/>
<button id="change_pw_button"
label="&devmgr.button.changepw.label;"
oncommand="changePassword();" disabled="true"/>
<button id="load_button"
label="&devmgr.button.load.label;"
oncommand="doLoad();"/>
<button id="unload_button"
label="&devmgr.button.unload.label;"
oncommand="doUnload();" disabled="true"/>
<button id="fipsbutton"
label=""
oncommand="toggleFIPS();"/>
</vbox> <!-- / Buttons for manipulating devices -->
</row>
<row>
<hbox>
<button id="help_button"
label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?sec_devices');"/>
<button id="ok_button"
label="&ok.label;"
oncommand="window.close();"/>
</hbox>
</row>
</rows>
</grid>
</window>

View File

@@ -0,0 +1,80 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var pkiParams;
var dialogParams;
var cert;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var connectURL = dialogParams.GetString(1);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = bundle.formatStringFromName("mismatchDomainMsg1",
[ connectURL, cert.commonName ],
2);
var message2 = bundle.formatStringFromName("mismatchDomainMsg2",
[ connectURL ],
1);
setText("message1", message1);
setText("message2", message2);
//Set the focus so key press events work
document.getElementById('ok-button').focus();
var xulWindow = document.getElementById("domainMismatch");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 40);
}
function viewCert()
{
cert.view();
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="domainMismatch" title="&domainMismatch.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="320"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/domainMismatch.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<description id="message1"/>
<separator/>
<description id="message2" flex="100%"/>
<hbox>
<button id="examineCert-button" label="&examineCert.label;"
oncommand="viewCert();"/>
</hbox>
<separator/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?bad_name_web_cert');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,92 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Terry Hayes <thayes@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var pkiParams;
var params;
var caName;
var cert;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
params = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
caName = cert.commonName;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
if (!caName.length)
caName = bundle.GetStringFromName("unnamedCA");
var message2 = bundle.formatStringFromName("newCAMessage1",
[ caName ],
1);
setText("message2", message2);
var xulWindow = document.getElementById("download_cert");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 40);
}
function viewCert()
{
cert.view();
}
function doOK()
{
var checkSSL = document.getElementById("trustSSL");
var checkEmail = document.getElementById("trustEmail");
var checkObjSign = document.getElementById("trustObjSign");
if (checkSSL.checked)
params.SetInt(2,1);
else
params.SetInt(2,0);
if (checkEmail.checked)
params.SetInt(3,1);
else
params.SetInt(3,0);
if (checkObjSign.checked)
params.SetInt(4,1);
else
params.SetInt(4,0);
params.SetInt(1,1);
window.close();
}
function doCancel()
{
params.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,107 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="download_cert" title="&downloadCert.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="320"
width="460"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/downloadcert.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox style="margin: 5px;" flex="1">
<!-- Let 'em know what they're doing -->
<vbox>
<description>&downloadCert.message1;</description>
</vbox>
<separator/>
<!-- checkboxes for trust bits
- "do you want to?"
- * trust for SSL
- * trust for email
- * trust for object signing
-->
<vbox>
<description id="message2"/>
<checkbox label="&downloadCert.trustSSL;"
id="trustSSL"/>
<checkbox label="&downloadCert.trustEmail;"
id="trustEmail"/>
<checkbox label="&downloadCert.trustObjSign;"
id="trustObjSign"/>
</vbox>
<separator/>
<!-- buttons for viewing cert and policies
- "suggested you view the following:"
- <> view cert
- <> view policy
-->
<vbox>
<description>&downloadCert.message3;</description>
<separator/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<button id="viewC-button"
label="&downloadCert.viewCert.label;"
oncommand="viewCert();"/>
<description style="margin: 4px;">&downloadCert.viewCert.text;</description>
</row>
</rows>
</grid>
</vbox>
<separator/>
<!-- usual runaround
- <ok> <cancel> <help>
-->
<hbox align="center">
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?new_ca');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="editCaCert"
title="&certmgr.editcacert.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/editcerts.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox flex="1">
<description id="certmsg"/>
<separator />
<description flex="100%">&certmgr.editcert.edittrust;</description>
<vbox flex="100%">
<checkbox label="&certmgr.editcert.trustssl;"
id="trustSSL"/>
<checkbox label="&certmgr.editcert.trustemail;"
id="trustEmail"/>
<checkbox label="&certmgr.editcert.trustobjsign;"
id="trustObjSign"/>
</vbox>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doSSLOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doSSLOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<hbox>
<button id="ok-button" label="&certmgr.ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&certmgr.cancel.label;"
oncommand="window.close();"/>
<button id="help-button" label="&certmgr.help.label;"
oncommand="openHelp('chrome://help/content/help.xul?edit_ca_certs');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,209 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
var certdb;
var cert;
function setWindowName()
{
var dbkey = self.name;
// Get the cert from the cert database
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
//var pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
//var isupport = pkiParams.getISupportAtIndex(1);
//cert = isupport.QueryInterface(nsIX509Cert);
cert = certdb.getCertByDBKey(dbkey, null);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var windowReference = document.getElementById('editCaCert');
var message1 = bundle.formatStringFromName("editTrustCA",
[ cert.commonName ],
1);
setText("certmsg", message1);
var ssl = document.getElementById("trustSSL");
if (certdb.getCertTrust(cert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_SSL)) {
ssl.setAttribute("checked", "true");
} else {
ssl.setAttribute("checked", "false");
}
var email = document.getElementById("trustEmail");
if (certdb.getCertTrust(cert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_EMAIL)) {
email.setAttribute("checked", "true");
} else {
email.setAttribute("checked", "false");
}
var objsign = document.getElementById("trustObjSign");
if (certdb.getCertTrust(cert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_OBJSIGN)) {
objsign.setAttribute("checked", "true");
} else {
objsign.setAttribute("checked", "false");
}
var xulWindow = document.getElementById("editCaCert");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 70);
}
function doOK()
{
var ssl = document.getElementById("trustSSL");
var email = document.getElementById("trustEmail");
var objsign = document.getElementById("trustObjSign");
var trustssl = (ssl.checked) ? nsIX509CertDB.TRUSTED_SSL : 0;
var trustemail = (email.checked) ? nsIX509CertDB.TRUSTED_EMAIL : 0;
var trustobjsign = (objsign.checked) ? nsIX509CertDB.TRUSTED_OBJSIGN : 0;
//
// Set the cert trust
//
certdb.setCertTrust(cert, nsIX509Cert.CA_CERT,
trustssl | trustemail | trustobjsign);
window.close();
}
function doLoadForSSLCert()
{
var dbkey = self.name;
// Get the cert from the cert database
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
cert = certdb.getCertByDBKey(dbkey, null);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var windowReference = document.getElementById('editWebsiteCert');
var message1 = bundle.formatStringFromName("editTrustSSL",
[ cert.commonName ],
1);
setText("certmsg", message1);
setText("issuer", cert.issuerName);
var cacert = getCaCertForServerCert(cert);
if(cacert == null)
{
setText("explainations",bundle.GetStringFromName("issuerNotKnown"));
}
else if(certdb.getCertTrust(cacert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_SSL))
{
setText("explainations",bundle.GetStringFromName("issuerTrusted"));
}
else
{
setText("explainations",bundle.GetStringFromName("issuerNotTrusted"));
}
/*
if(cacert == null)
{
var editButton = document.getElementById('editca-button');
editButton.setAttribute("disabled","true");
}
*/
var trustssl = document.getElementById("trustSSLCert");
var notrustssl = document.getElementById("dontTrustSSLCert");
if (certdb.getCertTrust(cert, nsIX509Cert.SERVER_CERT,
nsIX509CertDB.TRUSTED_SSL)) {
trustssl.radioGroup.selectedItem = trustssl;
} else {
trustssl.radioGroup.selectedItem = notrustssl;
}
var xulWindow = document.getElementById("editWebsiteCert");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 70);
}
function doSSLOK()
{
var ssl = document.getElementById("trustSSLCert");
//var checked = ssl.getAttribute("value");
var trustssl = ssl.selected ? nsIX509CertDB.TRUSTED_SSL : 0;
//
// Set the cert trust
//
certdb.setCertTrust(cert, nsIX509Cert.SERVER_CERT, trustssl);
window.close();
}
function editCaTrust()
{
var cacert = getCaCertForServerCert(cert);
if(cacert != null)
{
window.openDialog('chrome://pippki/content/editcacert.xul', cacert.dbKey,
'chrome,resizable=1,modal');
}
else
{
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
alert(bundle.GetStringFromName("issuerCertNotFound"));
}
}
function getCaCertForServerCert(cert)
{
var i=1;
var nextCertInChain;
nextCertInChain = cert;
var lastSubjectName="";
while(true)
{
if(nextCertInChain == null)
{
return null;
}
if((nextCertInChain.type == nsIX509Cert.CA_CERT) ||
(nextCertInChain.subjectName = lastSubjectName))
{
break;
}
lastSubjectName = nextCertInChain.subjectName;
nextCertInChain = nextCertInChain.issuer;
}
return nextCertInChain;
}

View File

@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="editWebsiteCert"
title="&certmgr.editsslcert.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="doLoadForSSLCert();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/editcerts.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox flex="1">
<description id="certmsg"/>
<description id="issuer"/>
<separator/>
<description id="explainations"/>
<separator />
<description>&certmgr.editsslcert.edittrust;</description>
<vbox>
<radiogroup id="sslTrustGroup" flex="1">
<radio label="&certmgr.editsslcert.dotrust;"
id="trustSSLCert"/>
<radio label="&certmgr.editsslcert.donttrust;"
id="dontTrustSSLCert"/>
</radiogroup>
</vbox>
<hbox>
<button id="editca-button" label="&certmgr.editca.label;"
oncommand="editCaTrust();"/>
</hbox>
<hbox>
<button id="ok-button" label="&certmgr.ok.label;"
oncommand="doSSLOK();"/>
<button id="cancel-button" label="&certmgr.cancel.label;"
oncommand="window.close();"/>
<button id="help-button" label="&certmgr.help.label;"
oncommand="openHelp('chrome://help/content/help.xul?edit_web_certs');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,73 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var cert=null;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupports = pkiParams.getISupportAtIndex(1);
cert = isupports.QueryInterface(nsIX509Cert);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var dispName = cert.commonName;
if (dispName == null)
dispName = cert.windowTitle;
var msg = bundle.formatStringFromName("escrowFinalMessage",
[dispName], 1);
setText("message1",msg);
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("height",window.innerHeight + 30);
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}
function viewCert()
{
cert.view();
}

View File

@@ -0,0 +1,62 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="escrowWarnDialog" title="&escrowWarn.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="400"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/escrowWarn.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="getPassword();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="getPassword();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<description>&escrowWarn.message1;</description>
<separator/>
<description>&escrowWarn.benefit1;</description>
<separator/>
<description>&escrowWarn.message2;</description>
<separator/>
<description id="message1"/>
<hbox>
<button id="examineCert-button" label="&examineCert.label;"
oncommand="viewCert();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?priv_key_copy');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="getp12password" title="&pkcs12.getpassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="200"
width="300"
onload="onP12Load();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="getPassword();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="getPassword();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<description>&pkcs12.getpassword.message;</description>
<separator />
<grid>
<columns> <column/> <column/> </columns>
<rows>
<row>
<label value="&getPassword.password.label;"/>
<textbox id="pw1" type="password"/>
</row>
</rows>
</grid>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="getPassword();"
default="true" accesskey="&createCertInfo.okButtonAccessKey;"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?my_certs');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="getpassword" title="&getPassword.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="320"
width="300"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<vbox style="margin: 5px;" flex="1">
<hbox>
<text value="&getPassword.tokenName.label;:"/>
<text id="tokenName"/>
</hbox>
<separator/>
<grid>
<columns> <column/> <column/> </columns>
<rows>
<row>
<text value="&getPassword.password.label;"/>
<textbox id="pw1" type="password"/>
</row>
</rows>
</grid>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="getPassword();"
default="true" accesskey="&createCertInfo.okButtonAccessKey;"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="alert('help goes here');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % deviceManangerDTD SYSTEM "chrome://pippki/locale/deviceManager.dtd">
%deviceManangerDTD;
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="loaddevice"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&loaddevice.title;">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/device_manager.js"/>
<vbox>
<description>&loaddevice.info;</description>
<hbox>
<label value="&loaddevice.modname;"/>
<textbox id="device_name" flex="1" value="&loaddevice.modname.default;"/>
</hbox>
<hbox>
<label value="&loaddevice.filename;"/>
<textbox id="device_path" flex="1"/>
<button label="&loaddevice.browse;" flex="1" oncommand="doBrowseFiles();"/>
</hbox>
<hbox>
<button id="ok_button"
label="&ok.label;"
oncommand="doLoadDevice();"/>
<button id="cancel_button"
label="&cancel.label;"
oncommand="window.close();"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
* Håkan Waara <hwaara@chello.se>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var cert;
function onLoad()
{
doSetOKCancel(doOK, doCancel, doHelpButton);
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
var bundle = srGetStrBundle("chrome://pippki/locale/newserver.properties");
var gBundleBrand = srGetStrBundle("chrome://global/locale/brand.properties");
var brandName = gBundleBrand.GetStringFromName("brandShortName");
var continueButton = bundle.GetStringFromName("continueButton");
document.getElementById("ok").label = continueButton;
var message =
bundle.formatStringFromName("newServerMessage",
[cert.commonName],
1);
var notRecognized =
bundle.formatStringFromName("certNotRecognized",
[brandName],
1);
setText("message", message);
setText("notRecognized", notRecognized);
var windowReference = document.getElementById('ssl_warning');
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("height",window.innerHeight + 40);
}
function doHelpButton()
{
openHelp('chrome://help/content/help.xul?new_web_cert');
}
function doOK()
{
// the user pressed OK
dialogParams.SetInt(1,1);
var checkbox = document.getElementById("alwaysAccept");
// 0 = accept perm, 1 = accept for this session - just the opposite
// of the checkbox value.
dialogParams.SetInt(2, !checkbox.checked);
window.close();
}
function doCancel()
{
// the user pressed cancel
dialogParams.SetInt(1,0);
window.close();
}
function viewCert()
{
cert.view();
}

View File

@@ -0,0 +1,68 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
- Håkan Waara <hwaara@chello.se>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % newserverDTD SYSTEM "chrome://pippki/locale/newserver.dtd" >
%newserverDTD;
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window id="ssl_warning" title="&newserver.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em; height: 16em"
class="dialog"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/newserver.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="dialogKeys"/>
<vbox flex="1">
<hbox valign="top" align="center">
<image class="alert-icon" style="margin: 5px"/>
<vbox flex="1" valign="middle">
<description id="message"/>
<separator class="thin"/>
<description id="notRecognized"/>
<separator/>
<vbox flex="1" align="start">
<button id="examineCert-button" label="&examineCert.label;"
oncommand="viewCert();"/>
</vbox>
<checkbox id="alwaysAccept" label="&alwaysAccept.label;"/>
</vbox>
</hbox>
<hbox id="okCancelHelpButtonsRight" flex="1"/>
</vbox>
</window>

View File

@@ -0,0 +1,311 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Terry Hayes <thayes@netscape.com>
*/
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsPKCS11ModuleDB = "@mozilla.org/security/pkcs11moduledb;1";
const nsIPKCS11ModuleDB = Components.interfaces.nsIPKCS11ModuleDB;
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
const nsIPK11Token = Components.interfaces.nsIPK11Token;
var params;
var tokenName="";
var pw1;
function onLoad()
{
pw1 = document.getElementById("pw1");
try {
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
tokenName = params.GetString(1);
}catch(exception)
{tokenName = self.name;}
if(tokenName=="" || tokenName=="_blank") {
var sectokdb = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
var tokenList = sectokdb.listTokens();
var enumElement;
i=0;
var menu = document.getElementById("tokenMenu");
try {
for ( ; !tokenList.isDone(); tokenList.next()) {
enumElement = tokenList.currentItem();
var token = enumElement.QueryInterface(nsIPK11Token);
if(token.needsLogin() || !(token.needsUserInit)) {
var menuItemNode = document.createElement("menuitem");
menuItemNode.setAttribute("value", token.tokenName);
menuItemNode.setAttribute("label", token.tokenName);
menu.firstChild.appendChild(menuItemNode);
if (i == 0) {
menu.selectedItem = menuItemNode;
tokenName = token.tokenName;
}
i++;
}
}
}catch(exception){}
} else {
var sel = document.getElementById("tokenMenu");
sel.setAttribute("hidden", "true");
var tag = document.getElementById("tokenName");
tag.setAttribute("value",tokenName);
}
process();
}
function onMenuChange()
{
//get the selected token
var list = document.getElementById("tokenMenu");
tokenName = list.value;
process();
}
function process()
{
var secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
// If the token is unitialized, don't use the old password box.
// Otherwise, do.
var slot = secmoddb.findSlotByName(tokenName);
if (slot) {
var oldpwbox = document.getElementById("oldpw");
var msgBox = document.getElementById("message");
var status = slot.status;
if (status == nsIPKCS11Slot.SLOT_UNINITIALIZED
|| status == nsIPKCS11Slot.SLOT_READY) {
oldpwbox.setAttribute("hidden", "true");
msgBox.setAttribute("value", bundle.GetStringFromName("password_not_set"));
msgBox.setAttribute("hidden", "false");
if (status == nsIPKCS11Slot.SLOT_READY) {
oldpwbox.setAttribute("inited", "empty");
} else {
oldpwbox.setAttribute("inited", "true");
}
// Select first password field
document.getElementById('pw1').focus();
} else {
// Select old password field
oldpwbox.setAttribute("hidden", "false");
msgBox.setAttribute("hidden", "true");
oldpwbox.setAttribute("inited", "false");
oldpwbox.focus();
}
}
if (params) {
// Return value 0 means "canceled"
params.SetInt(1, 0);
}
checkPasswords();
}
function onP12Load()
{
pw1 = document.getElementById("pw1");
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
// Select first password field
document.getElementById('pw1').focus();
}
function setPassword()
{
var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
var token = pk11db.findTokenByName(tokenName);
var oldpwbox = document.getElementById("oldpw");
var initpw = oldpwbox.getAttribute("inited");
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var success = false;
if (initpw == "false" || initpw == "empty") {
try {
var oldpw = "";
var passok = 0;
if (initpw == "empty") {
passok = 1;
} else {
oldpw = oldpwbox.value;
passok = token.checkPassword(oldpw);
}
if (passok) {
if (initpw == "empty" && pw1.value == "") {
// This makes no sense that we arrive here,
// we reached a case that should have been prevented by checkPasswords.
} else {
token.changePassword(oldpw, pw1.value);
if (pw1.value == "") {
alert(bundle.GetStringFromName("pw_erased_ok")
+ " "
+ bundle.GetStringFromName("pw_empty_warning"));
} else {
alert(bundle.GetStringFromName("pw_change_ok"));
}
}
success = true;
} else {
oldpwbox.focus();
oldpwbox.setAttribute("value", "");
alert(bundle.GetStringFromName("incorrect_pw"));
}
} catch (e) {
alert(bundle.GetStringFromName("failed_pw_change"));
}
} else {
token.initPassword(pw1.value);
if (pw1.value == "") {
alert(bundle.GetStringFromName("pw_not_wanted")
+ " "
+ bundle.GetStringFromName("pw_empty_warning"));
}
success = true;
}
// Terminate dialog
if (success) {
if (params) {
// Return value 1 means "successfully executed ok"
params.SetInt(1, 1);
}
window.close();
}
}
function getPassword()
{
// grab what was entered
params.SetString(2, pw1.value);
// Return value
params.SetInt(1, 1);
// Terminate dialog
window.close();
}
function setP12Password()
{
// grab what was entered
params.SetString(2, pw1.value);
// Return value
params.SetInt(1, 1);
// Terminate dialog
window.close();
}
function setPasswordStrength()
{
// Here is how we weigh the quality of the password
// number of characters
// numbers
// non-alpha-numeric chars
// upper and lower case characters
var pw=document.getElementById('pw1').value;
// alert("password='" + pw +"'");
//length of the password
var pwlength=(pw.length);
if (pwlength>5)
pwlength=5;
//use of numbers in the password
var numnumeric = pw.replace (/[0-9]/g, "");
var numeric=(pw.length - numnumeric.length);
if (numeric>3)
numeric=3;
//use of symbols in the password
var symbols = pw.replace (/\W/g, "");
var numsymbols=(pw.length - symbols.length);
if (numsymbols>3)
numsymbols=3;
//use of uppercase in the password
var numupper = pw.replace (/[A-Z]/g, "");
var upper=(pw.length - numupper.length);
if (upper>3)
upper=3;
var pwstrength=((pwlength*10)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
// make sure we're give a value between 0 and 100
if ( pwstrength < 0 ) {
pwstrength = 0;
}
if ( pwstrength > 100 ) {
pwstrength = 100;
}
var mymeter=document.getElementById('pwmeter');
mymeter.setAttribute("value",pwstrength);
return;
}
function checkPasswords()
{
var pw1=document.getElementById('pw1').value;
var pw2=document.getElementById('pw2').value;
var ok=document.getElementById('ok-button');
var oldpwbox = document.getElementById("oldpw");
if (oldpwbox) {
var initpw = oldpwbox.getAttribute("inited");
if (initpw == "empty" && pw1 == "") {
// The token has already been initialized, therefore this dialog
// was called with the intention to change the password.
// The token currently uses an empty password.
// We will not allow changing the password from empty to empty.
ok.setAttribute("disabled","true");
return;
}
}
if (pw1 == pw2){
ok.setAttribute("disabled","false");
} else
{
ok.setAttribute("disabled","true");
}
}

View File

@@ -1,9 +1,9 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
@@ -17,10 +17,21 @@
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
/* Defining the following causes NS_APPSHELL to be defined as NS_EXPORT. */
#define _IMPL_NS_APPSHELL
/*
* These are helper functions to be included
* pippki UI js files.
*/
function setText(id, value) {
var element = document.getElementById(id);
if (!element) return;
if (element.hasChildNodes())
element.removeChild(element.firstChild);
var textNode = document.createTextNode(value);
element.appendChild(textNode);
}
#include "MacSharedPrefix_debug.h"

View File

@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefSec SYSTEM "chrome://pippki/locale/pref-security.dtd">
<!ENTITY % prefSslDTD SYSTEM "chrome://pippki/locale/pref-ssl.dtd">
%brandDTD;
%prefSec;
%prefSslDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://pippki/content/pref-certs.xul');">
<!-- List elements to manage for prefs -->
<script type="application/x-javascript" src="chrome://pippki/content/pref-security.js"/>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = [ "certSelection" ];
]]>
</script>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="&certs.label;"/>
<groupbox align="start">
<caption label="&SSLClientAuthMethod;"/>
<description> &certselect.description; </description>
<!-- Prefs -->
<radiogroup id="certSelection" orient="horizontal" preftype="string"
prefstring="security.default_personal_cert">
<radio label="&certselect.auto;" value="Select Automatically"/>
<radio label="&certselect.ask;" value="Ask Every Time"/>
</radiogroup>
</groupbox>
<!-- Certificate manager -->
<groupbox>
<caption label="&managecerts.label;"/>
<description>&managecerts.text;</description>
<hbox align="center">
<button label="&managecerts.button;"
oncommand="openCertManager();"
id="openCertManagerButton"
prefstring="security.disable_button.openCertManager"/>
</hbox>
</groupbox>
<!-- Device manager -->
<groupbox>
<caption label="&managedevices.label;"/>
<description>&managedevices.text;</description>
<hbox align="center">
<button label="&managedevices.button;"
oncommand="openDeviceManager();"
id="openDeviceManagerButton"
prefstring="security.disable_button.openDeviceManager"/>
</hbox>
</groupbox>
</page>

View File

@@ -0,0 +1,143 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pref-ssl.dtd">
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window id="pref-ciphers" title="&cipher.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript"><![CDATA[
var prefs = null;
function onLoad() {
doSetOKCancel(doOK, doCancel);
// Set checkboxes from prefs
const nsIPref = Components.interfaces.nsIPref;
prefs = Components.classes["@mozilla.org/preferences;1"].getService(nsIPref);
// Enumerate each checkbox on this page and set value
var prefElements = document.getElementsByAttribute("prefstring", "*");
for (var i = 0; i < prefElements.length; i++) {
var element = prefElements[i];
var prefString = element.getAttribute("prefstring");
var prefValue = false;
try {
prefValue = prefs.GetBoolPref(prefString);
} catch(e) { /* Put debug output here */ }
element.setAttribute("checked", prefValue);
// disable xul element if the pref is locked.
if (prefs.PrefIsLocked(prefString)) {
element.disabled=true;
}
}
}
function doOK() {
// Save the prefs
try {
// Enumerate each checkbox on this page and save the value
var prefElements = document.getElementsByAttribute("prefstring", "true");
for (var i = 0; i < prefElements.length; i++) {
var element = prefElements[i];
var prefString = element.getAttribute("prefstring");
var prefValue = element.getAttribute("checked");
if (typeof(prefValue) == "string") prefValue = (prefValue == "true");
prefs.SetBoolPref(prefString, prefValue);
}
prefs.savePrefFile(null);
} catch(e) { }
window.close();
}
function doCancel() {
window.close();
}
]]></script>
<vbox style="overflow: hidden;" flex="1">
<groupbox align="start">
<caption label="&cipher.ssl2.label;"/>
<checkbox label="&cipher.ssl2.rc4_128;"
prefstring="security.ssl2.rc4_128"/>
<checkbox label="&cipher.ssl2.rc2_128;"
prefstring="security.ssl2.rc2_128"/>
<checkbox label="&cipher.ssl2.des_ede3_192;"
prefstring="security.ssl2.des_ede3_192"/>
<checkbox label="&cipher.ssl2.des_64;"
prefstring="security.ssl2.des_64"/>
<checkbox label="&cipher.ssl2.rc4_40;"
prefstring="security.ssl2.rc4_40"/>
<checkbox label="&cipher.ssl2.rc2_40;"
prefstring="security.ssl2.rc2_40"/>
</groupbox>
<groupbox align="start">
<caption label="&cipher.ssl3.label;"/>
<checkbox label="&cipher.ssl3.rsa_rc4_128_md5;"
prefstring="security.ssl3.rsa_rc4_128_md5"/>
<checkbox label="&cipher.ssl3.rsa_fips_des_ede3_sha;"
prefstring="security.ssl3.rsa_fips_des_ede3_sha"/>
<checkbox label="&cipher.ssl3.rsa_des_ede3_sha;"
prefstring="security.ssl3.rsa_des_ede3_sha"/>
<checkbox label="&cipher.ssl3.rsa_fips_des_sha;"
prefstring="security.ssl3.rsa_fips_des_sha"/>
<checkbox label="&cipher.ssl3.rsa_des_sha;"
prefstring="security.ssl3.rsa_des_sha"/>
<checkbox label="&cipher.ssl3.rsa_1024_rc4_56_sha;"
prefstring="security.ssl3.rsa_1024_rc4_56_sha"/>
<checkbox label="&cipher.ssl3.rsa_1024_des_cbc_sha;"
prefstring="security.ssl3.rsa_1024_des_cbc_sha"/>
<checkbox label="&cipher.ssl3.rsa_rc4_40_md5;"
prefstring="security.ssl3.rsa_rc4_40_md5"/>
<checkbox label="&cipher.ssl3.rsa_rc2_40_md5;"
prefstring="security.ssl3.rsa_rc2_40_md5"/>
<checkbox label="&cipher.ssl3.rsa_null_md5;"
prefstring="security.ssl3.rsa_null_md5"/>
</groupbox>
<separator/>
<keyset id="dialogKeys"/>
<hbox id="okCancelButtonsRight"/>
</vbox>
</window>

View File

@@ -0,0 +1,114 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
const nsIPK11Token = Components.interfaces.nsIPK11Token;
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsDialogParamBlock = "@mozilla.org/embedcomp/dialogparam;1";
var internal_token;
function onMasterPasswordLoad()
{
var tokendb = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
internal_token = tokendb.getInternalKeyToken();
var askTimes = internal_token.getAskPasswordTimes();
switch (askTimes) {
case nsIPK11Token.ASK_FIRST_TIME: askTimes = 0; break;
case nsIPK11Token.ASK_EVERY_TIME: askTimes = 1; break;
case nsIPK11Token.ASK_EXPIRE_TIME: askTimes = 2; break;
}
var radiogroup = document.getElementById("passwordAskTimes");
var radioitem;
switch (askTimes) {
case 0: radioitem = document.getElementById("askFirstTime"); break;
case 1: radioitem = document.getElementById("askEveryTime"); break;
case 2: radioitem = document.getElementById("askTimeout"); break;
}
radiogroup.selectedItem = radioitem;
var timeout = internal_token.getAskPasswordTimeout();
var timeoutField = document.getElementById("passwordTimeout");
timeoutField.setAttribute("value", timeout);
changePasswordSettings();
}
function changePasswordSettings()
{
var askTimes = 0;
var timeout = internal_token.getAskPasswordTimeout();
var timeoutField = document.getElementById("passwordTimeout");
var radiogroup = document.getElementById("passwordAskTimes");
switch ( radiogroup.value ) {
case "0":
timeoutField.setAttribute("disabled", true);
askTimes = nsIPK11Token.ASK_FIRST_TIME;
break;
case "1":
timeoutField.setAttribute("disabled", true);
askTimes = nsIPK11Token.ASK_EVERY_TIME;
break;
case "2":
timeoutField.removeAttribute("disabled");
timeoutField.focus();
timeout = timeoutField.value;
var re = new RegExp("^[0-9]+$");
if (!re.test(timeout)) {
timeout = "1";
}
askTimes = nsIPK11Token.ASK_EXPIRE_TIME;
break;
}
internal_token.setAskPasswordDefaults(askTimes, timeout);
var askEveryTimeHidden = document.getElementById("askEveryTimeHidden");
askEveryTimeHidden.setAttribute("checked",(radiogroup.value == 1)?"true":"false");
}
function ChangePW()
{
var params = Components.classes[nsDialogParamBlock].createInstance(nsIDialogParamBlock);
params.SetString(1,"_blank");
window.openDialog("chrome://pippki/content/changepassword.xul","",
"chrome,resizable=1,modal=1,dialog=1",params);
}
function ResetPW()
{
window.open("chrome://pippki/content/resetpassword.xul",
internal_token.tokenName,
"centerscreen,chrome,resizable=1,modal=1,dialog=1");
}

View File

@@ -0,0 +1,109 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefPass SYSTEM "chrome://pippki/locale/pref-masterpass.dtd">
%brandDTD;
%prefPass;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://pippki/content/pref-masterpass.xul'); onMasterPasswordLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/pref-masterpass.js"/>
<!-- List elements to manage for prefs -->
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["askEveryTimeHidden",
"changePasswordButton",
"resetPasswordButton",
"passwordAskTimes",
"passwordTimeout"];
]]>
</script>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="&lheader;"/>
<!-- Change Password -->
<groupbox>
<caption label="&changepassword.label;"/>
<description>&changepassword.text;</description>
<hbox align="center">
<button label="&changepassword.button;"
oncommand="ChangePW();"
id="changePasswordButton"
prefstring="security.disable_button.changePassword"/>
</hbox>
</groupbox>
<!-- Password Prefs -->
<groupbox>
<checkbox id="askEveryTimeHidden"
prefstring="signon.expireMasterPassword"
hidden="true"/>
<caption label="&managepassword.label;"/>
<description>&managepassword.text;</description>
<hbox align="center">
<radiogroup id="passwordAskTimes"
prefstring="security.ask_for_password"
flex="1">
<!-- note that these values are different than what NSS uses, which
are (0, -1, 1) respectively -->
<radio value="0" label="&managepassword.askfirsttime;" id="askFirstTime"
style="margin: 0px;" oncommand="changePasswordSettings();"/>
<radio value="1" label="&managepassword.askeverytime;" id="askEveryTime"
style="margin: 0px;" oncommand="changePasswordSettings();"/>
<hbox align="center">
<radio value="2" label="&managepassword.asktimeout;" id="askTimeout"
style="margin: 0px;" oncommand="changePasswordSettings();"/>
<textbox id="passwordTimeout" size="4"
preftype="int"
prefstring="security.password_lifetime"
oninput="changePasswordSettings();"/>
<label value="&managepassword.timeout.unit;" style="margin: 4px;"/>
</hbox>
</radiogroup>
</hbox>
</groupbox>
<!-- Reset Password -->
<groupbox>
<caption label="&resetpassword.label;"/>
<description>&resetpassword.text;</description>
<hbox align="center">
<button label="&resetpassword.button;"
oncommand="ResetPW();"
id="resetPasswordButton"
prefstring="security.disable_button.resetPassword"/>
</hbox>
</groupbox>
</page>

View File

@@ -0,0 +1,46 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
function openCertManager()
{
window.open('chrome://pippki/content/certManager.xul', "",
'chrome,width=500,height=400,resizable=yes,dialog=no');
}
function openDeviceManager()
{
window.open('chrome://pippki/content/device_manager.xul', "devmgr",
'chrome,width=540,height=360,resizable=yes');
}

View File

@@ -0,0 +1,91 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefSslDTD SYSTEM "chrome://pippki/locale/pref-ssl.dtd">
%brandDTD;
%prefSslDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="parent.initPanel('chrome://pippki/content/pref-ssl.xul');">
<!-- List elements to manage for prefs -->
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["enableSSL2", "enableSSL3", "enableTLS",
"warnEnteringSecure", "warnEnteringWeak",
"warnLeavingSecure", "warnInsecurePost",
"warnViewMixed" ];
]]>
</script>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="SSL"/>
<groupbox orient="horizontal">
<caption label="&SSLProtocolVersions;"/>
<!-- Prefs -->
<vbox flex="1" align="start">
<checkbox id="enableSSL2" label="&enable.ssl2;"
prefstring="security.enable_ssl2"/>
<checkbox id="enableSSL3" label="&enable.ssl3;"
prefstring="security.enable_ssl3"/>
<checkbox id="enableTLS" label="&enable.tls;"
prefstring="security.enable_tls"/>
</vbox>
<vbox halign="right">
<button label="&edit.sslciphers;"
oncommand="window.openDialog('chrome://pippki/content/pref-ciphers.xul', '',
'modal=yes,resizable,chrome');"
id="editSSLCiphersButton"
prefstring="security.disable_button.editSSLCiphers"/>
</vbox>
</groupbox>
<groupbox align="start">
<caption label="&SSLWarnings;"/>
<description>&warn.description;</description>
<!-- Prefs -->
<checkbox id="warnEnteringSecure" label="&warn.enteringsecure;"
prefstring="security.warn_entering_secure"/>
<checkbox id="warnEnteringWeak" label="&warn.enteringweak;"
prefstring="security.warn_entering_weak"/>
<checkbox id="warnLeavingSecure" label="&warn.leavingsecure;"
prefstring="security.warn_leaving_secure"/>
<checkbox id="warnInsecurePost" label="&warn.insecurepost;"
prefstring="security.warn_submit_insecure"/>
<checkbox id="warnViewMixed" label="&warn.viewmixed;"
prefstring="security.warn_viewing_mixed"
checked="true"/>
</groupbox>
</page>

View File

@@ -0,0 +1,95 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIOCSPResponder = Components.interfaces.nsIOCSPResponder;
const nsISupportsArray = Components.interfaces.nsISupportsArray;
var certdb;
var ocspResponders;
function onLoad()
{
var ocspEntry;
var i;
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
ocspResponders = certdb.getOCSPResponders();
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
for (i=0; i<ocspResponders.Count(); i++) {
ocspEntry = ocspResponders.GetElementAt(i).QueryInterface(nsIOCSPResponder);
var menuItemNode = document.createElement("menuitem");
menuItemNode.setAttribute("value", ocspEntry.responseSigner);
menuItemNode.setAttribute("label", ocspEntry.responseSigner);
signersMenu.firstChild.appendChild(menuItemNode);
}
parent.initPanel('chrome://pippki/content/pref-validation.xul');
doEnabling();
}
function doEnabling()
{
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
var radiogroup = document.getElementById("securityOCSPEnabled");
switch ( radiogroup.value ) {
case "0":
case "1":
signersMenu.setAttribute("disabled", true);
signersURL.setAttribute("disabled", true);
break;
case "2":
default:
signersMenu.removeAttribute("disabled");
signersURL.removeAttribute("disabled");
}
}
function changeURL()
{
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
var CA = signersMenu.getAttribute("value");
var i;
var ocspEntry;
for (i=0; i < ocspResponders.Count(); i++) {
ocspEntry = ocspResponders.GetElementAt(i).QueryInterface(nsIOCSPResponder);
if (CA == ocspEntry.responseSigner) {
signersURL.setAttribute("value", ocspEntry.serviceURL);
break;
}
}
}
function openCrlManager()
{
window.open('chrome://pippki/content/crlManager.xul', "",
'chrome,width=500,height=400,resizable=1');
}

View File

@@ -0,0 +1,92 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- David Drinan <ddrinan@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefValidationDTD SYSTEM "chrome://pippki/locale/pref-validation.dtd">
%brandDTD;
%prefValidationDTD;
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<!-- List elements to manage for prefs -->
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["securityOCSPEnabled", "serviceURL", "signingCA"];
]]>
</script>
<script type="application/x-javascript" src="chrome://pippki/content/pref-validation.js"/>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="&validation.title;"/>
<groupbox>
<caption label="&validation.crl.label;"/>
<description>&validation.crl.description;</description>
<hbox align="center">
<button label="&validation.managecrls.button;"
oncommand="openCrlManager();"
id="managecrlbutton"
prefstring="security.OCSP.disable_button.managecrl"/>
</hbox>
</groupbox>
<groupbox align="start">
<caption label="&validation.ocsp.label;"/>
<description>&validation.ocsp.description;</description>
<!-- Prefs -->
<radiogroup id="securityOCSPEnabled"
prefstring="security.OCSP.enabled">
<radio value="0" label="&disableOCSP.label;" oncommand="doEnabling();"/>
<radio value="1" label="&certOCSP.label;" oncommand="doEnabling();"/>
<radio value="2" label="&proxyOCSP.label;" oncommand="doEnabling();"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row align="center">
<label value="&signingCA.label;" control="signingCA"/>
<menulist id="signingCA" preftype="string" prefstring="security.OCSP.signingCA"
flex="1" oncommand="changeURL()">
<menupopup/>
</menulist>
</row>
<row align="center">
<label value="&serviceURL.label;" control="serviceURL"/>
<textbox id="serviceURL" prefstring="security.OCSP.URL"/>
</row>
</rows>
</grid>
</radiogroup>
</groupbox>
</page>

View File

@@ -0,0 +1,89 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*/
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
var tokenName;
function onLoad()
{
if ("arguments" in window) {
var params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
tokenName = params.GetString(1);
} else {
tokenName = self.name;
}
var okButton = document.getElementById("ok");
var cancelButton = document.getElementById("cancel");
var helpButton = document.getElementById("help");
var bundle = document.getElementById("pippki_bundle");
doSetOKCancel(resetPassword, null, null, null);
if (okButton && cancelButton && bundle) {
okButton.setAttribute("label", bundle.getString("resetPasswordButtonLabel"));
okButton.removeAttribute("default");
cancelButton.setAttribute("default", "true");
cancelButton.focus();
}
}
function resetPassword()
{
var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
var token = pk11db.findTokenByName(tokenName);
token.reset();
var pref = Components.classes['@mozilla.org/preferences;1'];
if (pref) {
pref = pref.getService(Components.interfaces.nsIPrefBranch);
try {
if (pref.getBoolPref("wallet.crypto")) {
// data in wallet is encrypted, clear it
var wallet = Components.classes['@mozilla.org/wallet/wallet-service;1'];
if (wallet) {
wallet = wallet.getService(Components.interfaces.nsIWalletService);
wallet.WALLET_DeleteAll();
}
}
}
catch(e) {
// wallet.crypto pref is missing
}
}
var bundle = document.getElementById("pippki_bundle");
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService);
if (promptService && bundle) {
promptService.alert(window,
bundle.getString("resetPasswordConfirmationTitle"),
bundle.getString("resetPasswordConfirmationMessage"));
}
window.close();
}
function doHelpButton()
{
openHelp('chrome://help/content/help.xul?reset_pwd');
}

View File

@@ -0,0 +1,55 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window id="reset_password" title="&resetPassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 40em;" onload="onLoad();">
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="window.close();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="window.close();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<stringbundle id="pippki_bundle" src="chrome://pippki/locale/pippki.properties"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/resetpassword.js"/>
<hbox flex="1">
<image class="alert-icon" style="margin: 5px;"/>
<vbox style="margin: 5px;" flex="1">
<hbox flex="1">
<vbox flex="1">
<description>&resetPassword.text;</description>
</vbox>
</hbox>
<separator class="thin"/>
<hbox id="okCancelHelpButtonsRight"/>
</vbox>
</hbox>
</window>

View File

@@ -0,0 +1,84 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var cert=null;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var title = dialogParams.GetString(2);
window.title = title;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = dialogParams.GetString(1);
var currDate = new Date();
var message2 = bundle.formatStringFromName("serverCertExpiredMsg2",
[ currDate.toLocaleString() ],
1);
setText("message1", message1);
setText("message2", message2);
//Set the focus so key press events work.
document.getElementById('ok-button').focus();
var xulWindow = document.getElementById("serverCertExpired");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 40);
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}
function viewCert()
{
if (cert == null) {
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
}
cert.view();
}

View File

@@ -0,0 +1,61 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="serverCertExpired"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="300"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/serverCertExpired.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox style="margin: 5px;" flex="100%">
<description id="message1" flex="100%"/>
<separator/>
<description id="message2" flex="100%"/>
<separator/>
<label value="&serverCertExpired.continue;" flex="100%"/>
<separator/>
<hbox>
<button id="examineCert-button" label="&examineCert.label;"
oncommand="viewCert();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?exp_web_cert');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var bundle;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
var cert = isupport.QueryInterface(nsIX509Cert);
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
// Organization
addAttributeFromCert('organization', cert.organization);
// Organizational Unit
addAttributeFromCert('orgunit', cert.organizationalUnit);
//Set the focus so key press events work.
document.getElementById('ok-button').focus();
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}
function managerCrls()
{
window.open('chrome://pippki/content/crlManager.xul', "",
'chrome,width=500,height=400,resizable=1');
}
function addAttributeFromCert(nodeName, value)
{
var node = document.getElementById(nodeName);
if (!value) {
value = bundle.GetStringFromName('notPresent');
}
node.setAttribute('value',value)
}

View File

@@ -0,0 +1,85 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- David Drinan <ddrinan@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window [
<!ENTITY % pipPkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd">
%pipPkiDTD;
<!ENTITY % prefCertMgrDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
%prefCertMgrDTD;
]>
<window
id="serverCrlExpired"
title="&serverCrlExpired.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em; height: 16em"
onload="onLoad();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js" />
<script type="application/x-javascript" src="chrome://pippki/content/serverCrlExpired.js" />
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox style="margin: 5px;" flex="100%">
<description> &serverCrlExpired.message1; </description>
<separator/>
<grid>
<columns>
<column />
<column />
</columns>
<rows>
<row>
<label value="&certmgr.certdetail.o;" />
<label id="organization"/>
</row>
<row>
<label value="&certmgr.certdetail.ou;" />
<label id="orgunit"/>
</row>
</rows>
</grid>
<separator/>
<description> &serverCrlExpired.message2; </description>
<separator/>
<description> &serverCrlExpired.continue; </description>
<separator/>
<hbox>
<button id="manageCrlCert-button" label="&serverCrlExpired.manageCrls.label;"
oncommand="managerCrls();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" label="&ok.label;"
onclick="doOK();"/>
<button id="cancel-button" label="&cancel.label;"
onclick="doCancel();" />
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?exp_web_cert_crl');" />
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var bundle;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
var cert = isupport.QueryInterface(nsIX509Cert);
var connectURL = dialogParams.GetString(1);
var gBundleBrand = srGetStrBundle("chrome://global/locale/brand.properties");
var brandName = gBundleBrand.GetStringFromName("brandShortName");
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = bundle.formatStringFromName("crlNextUpdateMsg1",
[ brandName, connectURL ],
2);
var message2 = bundle.formatStringFromName("crlNextUpdateMsg2",
[ cert.issuerOrganization ],
1);
setText("message1", message1);
setText("message2", message2);
// Set the focus
document.getElementById('ok-button').focus();
}
function doOK()
{
window.close();
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- David Drinan <ddrinan@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window [
<!ENTITY % pipPkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd">
%pipPkiDTD;
]>
<window
id="serverCrlNextupdate"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em; height: 16em"
onload="onLoad();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js" />
<script type="application/x-javascript" src="chrome://pippki/content/serverCrlNextupdate.js" />
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
</keyset>
<vbox style="margin: 5px;" flex="100%">
<description id="message1" flex="100%"/>
<separator/>
<description id="message2" flex="100%"/>
<separator/>
<label value="&serverCrlNextupdate.message;" flex="100%"/>
<separator/>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="doOK();" />
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?exp_crl');" />
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="setp12password" title="&pkcs12.setpassword.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="480"
width="360"
onload="onP12Load();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox style="margin: 5px;" flex="1">
<description>&pkcs12.setpassword.message;</description>
<separator />
<grid>
<columns> <column/> <column/> </columns>
<rows>
<row>
<label value="&pkcs12.setpassword.label1;"/>
<textbox id="pw1" type="password"
onkeypress="setPasswordStrength(); checkPasswords();"/>
</row>
<row>
<label value="&pkcs12.setpassword.label2;"/>
<textbox id="pw2" type="password"
onkeypress="checkPasswords();"/>
</row>
</rows>
</grid>
<separator/>
<description>&pkcs12.setpassword.reminder;</description>
<separator/>
<label value="&setPassword.meter.label;"/>
<grid style="margin: 4px;">
<rows> <row/> </rows>
<columns>
<column style="margin: 5px;">
<progressmeter flex="1" id="pwmeter" mode="determined" value="0%"
orient="horizontal" progresstext="Loading"
width="200" style="foreground-color: red"/>
</column>
</columns>
</grid>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="if (!document.getElementById('ok-button').disabled) setP12Password();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="if (!document.getElementById('ok-button').disabled) setP12Password();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<hbox>
<button id="ok-button" label="&ok.label;"
oncommand="setP12Password();" disabled="true"/>
<button id="cancel-button" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?cert_backup_pwd');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,255 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
* Javier Delgadillo <javi@netscape.com>
*/
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIASN1Object = Components.interfaces.nsIASN1Object;
const nsIASN1Sequence = Components.interfaces.nsIASN1Sequence;
const nsIASN1PrintableItem = Components.interfaces.nsIASN1PrintableItem;
const nsIASN1Outliner = Components.interfaces.nsIASN1Outliner;
const nsASN1Outliner = "@mozilla.org/security/nsASN1Outliner;1"
var bundle;
function AddCertChain(node, chain, idPrefix)
{
var idfier = idPrefix+"chain_";
var child = document.getElementById(node);
var numCerts = chain.Count();
var currCert;
var displayVal;
var addTwistie;
for (var i=numCerts-1; i>=0; i--) {
currCert = chain.GetElementAt(i);
currCert = currCert.QueryInterface(nsIX509Cert);
if (currCert.commonName) {
displayVal = currCert.commonName;
} else {
displayVal = currCert.windowTitle;
}
if (0 == i) {
addTwistie = false;
} else {
addTwistie = true;
}
child = addChildrenToTree(child, displayVal, currCert.dbKey,addTwistie);
}
}
function AddUsage(usage,verifyInfoBox)
{
var text = document.createElement("textbox");
text.setAttribute("value", usage);
text.setAttribute("style", "margin: 2px 5px");
text.setAttribute("readonly", "true");
text.setAttribute("class", "scrollfield");
verifyInfoBox.appendChild(text);
}
function setWindowName()
{
// Get the cert from the cert database
var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
var windowReference=document.getElementById('certDetails');
var myName = self.name;
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var cert;
var certDetails = bundle.GetStringFromName('certDetails');
if (myName != "_blank") {
windowReference.setAttribute("title",certDetails+'"'+myName+'"');
// Get the token
// XXX ignore this for now. NSS will find the cert on a token
// by "tokenname:certname", which is what we have.
//var tokenName = "";
//var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
//var token = pk11db.findTokenByName(tokenName);
//var cert = certdb.getCertByNickname(token, myName);
cert = certdb.getCertByNickname(null, myName);
} else {
var pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
windowReference.setAttribute("title",
certDetails+'"'+cert.windowTitle+'"');
}
//
// Set the cert attributes for viewing
//
// The chain of trust
var chain = cert.getChain();
AddCertChain("chainDump", chain,"dump_");
DisplayGeneralDataFromCert(cert);
BuildPrettyPrint(cert);
}
function addChildrenToTree(parentTree,label,value,addTwistie)
{
var treeChild1 = document.createElement("treechildren");
var treeElement = addTreeItemToTreeChild(treeChild1,label,value,addTwistie);
parentTree.appendChild(treeChild1);
return treeElement;
}
function addTreeItemToTreeChild(treeChild,label,value,addTwistie)
{
var treeElem1 = document.createElement("treeitem");
if (addTwistie) {
treeElem1.setAttribute("container","true");
treeElem1.setAttribute("open","true");
}
var treeRow = document.createElement("treerow");
var treeCell = document.createElement("treecell");
treeCell.setAttribute("class", "treecell-indent");
treeCell.setAttribute("label",label);
if (value)
treeCell.setAttribute("display",value);
treeRow.appendChild(treeCell);
treeElem1.appendChild(treeRow);
treeChild.appendChild(treeElem1);
return treeElem1;
}
function displaySelected() {
var asn1Outliner = document.getElementById('prettyDumpOutliner').
outlinerBoxObject.view.QueryInterface(nsIASN1Outliner);
var items = asn1Outliner.selection;
var certDumpVal = document.getElementById('certDumpVal');
if (items.currentIndex != -1) {
var value = asn1Outliner.getDisplayData(items.currentIndex);
certDumpVal.value = value;
} else {
certDumpVal.value ="";
}
}
function BuildPrettyPrint(cert)
{
var certDumpOutliner = Components.classes[nsASN1Outliner].
createInstance(nsIASN1Outliner);
certDumpOutliner.loadASN1Structure(cert.ASN1Structure);
document.getElementById('prettyDumpOutliner').
outlinerBoxObject.view = certDumpOutliner;
}
function addAttributeFromCert(nodeName, value)
{
var node = document.getElementById(nodeName);
if (!value) {
value = bundle.GetStringFromName('notPresent');
}
node.setAttribute('value',value)
}
function DisplayGeneralDataFromCert(cert)
{
// Verification and usage
var verifystr = "";
var o1 = {};
var o2 = {};
var o3 = {};
cert.getUsages(o1, o2, o3);
var verifystate = o1.value;
var count = o2.value;
var usageList = o3.value;
if (verifystate == cert.VERIFIED_OK) {
verifystr = bundle.GetStringFromName('certVerified');
} else if (verifystate == cert.CERT_REVOKED) {
verifystr = bundle.GetStringFromName('certNotVerified_CertRevoked');
} else if (verifystate == cert.CERT_EXPIRED) {
verifystr = bundle.GetStringFromName('certNotVerified_CertExpired');
} else if (verifystate == cert.CERT_NOT_TRUSTED) {
verifystr = bundle.GetStringFromName('certNotVerified_CertNotTrusted');
} else if (verifystate == cert.ISSUER_NOT_TRUSTED) {
verifystr = bundle.GetStringFromName('certNotVerified_IssuerNotTrusted');
} else if (verifystate == cert.ISSUER_UNKNOWN) {
verifystr = bundle.GetStringFromName('certNotVerified_IssuerUnknown');
} else if (verifystate == cert.INVALID_CA) {
verifystr = bundle.GetStringFromName('certNotVerified_CAInvalid');
} else { /* if (verifystate == cert.NOT_VERIFIED_UNKNOWN) */
verifystr = bundle.GetStringFromName('certNotVerified_Unknown');
}
var verified=document.getElementById('verified');
verified.setAttribute("value", verifystr);
if (count > 0) {
var verifyInfoBox = document.getElementById('verify_info_box');
for (var i=0; i<count; i++) {
AddUsage(usageList[i],verifyInfoBox);
}
}
// Common Name
addAttributeFromCert('commonname', cert.commonName);
// Organization
addAttributeFromCert('organization', cert.organization);
// Organizational Unit
addAttributeFromCert('orgunit', cert.organizationalUnit);
// Serial Number
addAttributeFromCert('serialnumber',cert.serialNumber);
// SHA1 Fingerprint
addAttributeFromCert('sha1fingerprint',cert.sha1Fingerprint);
// MD5 Fingerprint
addAttributeFromCert('md5fingerprint',cert.md5Fingerprint);
// Validity start
addAttributeFromCert('validitystart', cert.issuedDate);
// Validity end
addAttributeFromCert('validityend', cert.expiresDate);
//Now to populate the fields that correspond to the issuer.
var issuerCommonname, issuerOrg, issuerOrgUnit;
issuerCommonname = cert.issuerCommonName;
issuerOrg = cert.issuerOrganization;
issuerOrgUnit = cert.issuerOrganizationalUnit;
addAttributeFromCert('issuercommonname', issuerCommonname);
addAttributeFromCert('issuerorganization', issuerOrg);
addAttributeFromCert('issuerorgunit', issuerOrgUnit);
}
function updateCertDump()
{
var asn1Outliner = document.getElementById('prettyDumpOutliner').
outlinerBoxObject.view.QueryInterface(nsIASN1Outliner);
var tree = document.getElementById('treesetDump');
var items=tree.selectedItems;
if (items.length==0) {
alert("No items are selected."); //This should never happen.
} else {
var dbKey = items[0].firstChild.firstChild.getAttribute('display');
// Get the cert from the cert database
var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
var cert = certdb.getCertByDBKey(dbKey,null);
asn1Outliner.loadASN1Structure(cert.ASN1Structure);
}
displaySelected();
}

View File

@@ -0,0 +1,119 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="certViewerOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox class="box-padded" id="general_info">
<vbox id="verify_info_box">
<label class="header" id="verified"/>
</vbox>
<separator class="groove"/>
<vbox flex="1">
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<label class="header" value="&certmgr.subjectinfo.label;"/>
<spacer/>
<spacer/>
</row>
<row>
<label value="&certmgr.certdetail.cn;"/>
<label id="commonname"/>
</row>
<row>
<label value="&certmgr.certdetail.o;"/>
<label id="organization"/>
</row>
<row>
<label value="&certmgr.certdetail.ou;"/>
<label id="orgunit"/>
</row>
<row>
<label value="&certmgr.certdetail.serialnumber;"/>
<label id="serialnumber"/>
</row>
<row>
<separator class="thin"/>
<spacer/>
</row>
<row>
<label class="header" value="&certmgr.issuerinfo.label;"/>
<spacer/>
</row>
<row>
<label value="&certmgr.certdetail.cn;"/>
<label id="issuercommonname"/>
</row>
<row>
<label value="&certmgr.certdetail.o;"/>
<label id="issuerorganization"/>
</row>
<row>
<label value="&certmgr.certdetail.ou;"/>
<label id="issuerorgunit"/>
</row>
<row>
<separator class="thin"/>
<spacer/>
</row>
<row>
<label class ="header" value="&certmgr.validity.label;"/>
<spacer/>
</row>
<row>
<label value="&certmgr.issued;"/>
<label id="validitystart"/>
</row>
<row>
<label value="&certmgr.expires;"/>
<label id="validityend"/>
</row>
<row>
<separator class="thin"/>
<spacer/>
</row>
<row>
<label class="header" value="&certmgr.fingerprints.label;"/>
<spacer/>
</row>
<row>
<label value="&certmgr.certdetail.sha1fingerprint;"/>
<label id="sha1fingerprint"/>
</row>
<row>
<label value="&certmgr.certdetail.md5fingerprint;"/>
<label id="md5fingerprint"/>
</row>
</rows>
</grid>
</vbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,77 @@
pippki.jar:
content/pippki/contents.rdf (content/contents.rdf)
content/pippki/changepassword.xul (content/changepassword.xul)
content/pippki/getpassword.xul (content/getpassword.xul)
content/pippki/password.js (content/password.js)
content/pippki/resetpassword.xul (content/resetpassword.xul)
content/pippki/resetpassword.js (content/resetpassword.js)
content/pippki/PrefOverlay.xul (content/PrefOverlay.xul)
content/pippki/pref-security.js (content/pref-security.js)
content/pippki/pref-ssl.xul (content/pref-ssl.xul)
content/pippki/pref-certs.xul (content/pref-certs.xul)
content/pippki/pref-ciphers.xul (content/pref-ciphers.xul)
content/pippki/PageInfoOverlay.xul (content/PageInfoOverlay.xul)
content/pippki/newserver.js (content/newserver.js)
content/pippki/newserver.xul (content/newserver.xul)
content/pippki/downloadcert.js (content/downloadcert.js)
content/pippki/downloadcert.xul (content/downloadcert.xul)
content/pippki/cacertexists.js (content/cacertexists.js)
content/pippki/cacertexists.xul (content/cacertexists.xul)
content/pippki/certManager.js (content/certManager.js)
content/pippki/certManager.xul (content/certManager.xul)
content/pippki/CAOverlay.xul (content/CAOverlay.xul)
content/pippki/WebSitesOverlay.xul (content/WebSitesOverlay.xul)
content/pippki/OthersOverlay.xul (content/OthersOverlay.xul)
content/pippki/MineOverlay.xul (content/MineOverlay.xul)
content/pippki/viewCertDetails.xul (content/viewCertDetails.xul)
content/pippki/editcacert.xul (content/editcacert.xul)
content/pippki/editsslcert.xul (content/editsslcert.xul)
content/pippki/editcerts.js (content/editcerts.js)
content/pippki/deletecert.xul (content/deletecert.xul)
content/pippki/deletecert.js (content/deletecert.js)
content/pippki/viewCertDetails.js (content/viewCertDetails.js)
content/pippki/getp12password.xul (content/getp12password.xul)
content/pippki/setp12password.xul (content/setp12password.xul)
content/pippki/pippki.js (content/pippki.js)
content/pippki/domainMismatch.xul (content/domainMismatch.xul)
content/pippki/domainMismatch.js (content/domainMismatch.js)
content/pippki/serverCertExpired.xul (content/serverCertExpired.xul)
content/pippki/serverCertExpired.js (content/serverCertExpired.js)
content/pippki/clientauthask.xul (content/clientauthask.xul)
content/pippki/clientauthask.js (content/clientauthask.js)
content/pippki/certpicker.xul (content/certpicker.xul)
content/pippki/certpicker.js (content/certpicker.js)
content/pippki/certViewer.xul (content/certViewer.xul)
content/pippki/certDump.xul (content/certDump.xul)
content/pippki/device_manager.xul (content/device_manager.xul)
content/pippki/device_manager.js (content/device_manager.js)
content/pippki/load_device.xul (content/load_device.xul)
content/pippki/choosetoken.xul (content/choosetoken.xul)
content/pippki/choosetoken.js (content/choosetoken.js)
content/pippki/escrowWarn.xul (content/escrowWarn.xul)
content/pippki/escrowWarn.js (content/escrowWarn.js)
content/pippki/pref-validation.xul (content/pref-validation.xul)
content/pippki/pref-validation.js (content/pref-validation.js)
content/pippki/crlManager.xul (content/crlManager.xul)
content/pippki/crlManager.js (content/crlManager.js)
content/pippki/pref-masterpass.js (content/pref-masterpass.js)
content/pippki/pref-masterpass.xul (content/pref-masterpass.xul)
content/pippki/serverCrlNextupdate.js (content/serverCrlNextupdate.js)
content/pippki/serverCrlNextupdate.xul (content/serverCrlNextupdate.xul)
content/pippki/createCertInfo.xul (content/createCertInfo.xul)
content/pippki/createCertInfo.js (content/createCertInfo.js)
en-US.jar:
locale/en-US/pippki/contents.rdf (locale/en-US/contents.rdf)
locale/en-US/pippki/pippki.dtd (locale/en-US/pippki.dtd)
locale/en-US/pippki/pref-ssl.dtd (locale/en-US/pref-ssl.dtd)
locale/en-US/pippki/pippki.properties (locale/en-US/pippki.properties)
locale/en-US/pippki/PrefOverlay.dtd (locale/en-US/PrefOverlay.dtd)
locale/en-US/pippki/newserver.properties (locale/en-US/newserver.properties)
locale/en-US/pippki/newserver.dtd (locale/en-US/newserver.dtd)
locale/en-US/pippki/pref-security.dtd (locale/en-US/pref-security.dtd)
locale/en-US/pippki/PageInfoOverlay.dtd (locale/en-US/PageInfoOverlay.dtd)
locale/en-US/pippki/certManager.dtd (locale/en-US/certManager.dtd)
locale/en-US/pippki/deviceManager.dtd (locale/en-US/deviceManager.dtd)
locale/en-US/pippki/pref-validation.dtd (locale/en-US/pref-validation.dtd)
locale/en-US/pippki/pref-masterpass.dtd (locale/en-US/pref-masterpass.dtd)

View File

@@ -0,0 +1,26 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY pageInfo.securityTab "Security">
<!ENTITY pageInfo.securityHeader "Security information for this page">
<!ENTITY pageInfo.view.label "View">

View File

@@ -0,0 +1,28 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY masterpass.label "Master Passwords">
<!ENTITY security.label "Privacy and Security">
<!ENTITY ssl.label "SSL">
<!ENTITY certs.label "Certificates">
<!ENTITY validation.label "Validation">

View File

@@ -0,0 +1,98 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<!ENTITY certmgr.title "Certificate Manager">
<!ENTITY certmgr.tab.mine "Your Certificates">
<!ENTITY certmgr.tab.others "Other People's">
<!ENTITY certmgr.tab.websites "Web Sites">
<!ENTITY certmgr.tab.ca "Authorities">
<!ENTITY certmgr.ca.builtins "Built-in CAs">
<!ENTITY certmgr.ca.mycas "CAs Managed By You">
<!ENTITY certmgr.mine "You have certificates from these organizations that identify you:">
<!ENTITY certmgr.others "You have certificates on file that identify these people:">
<!ENTITY certmgr.websites "You have certificates on file that identify these web sites:">
<!ENTITY certmgr.cas "You have certificates on file that identify these certificate authorities:">
<!ENTITY certmgr.detail.general_tab.title "General">
<!ENTITY certmgr.detail.prettyprint_tab.title "Details">
<!ENTITY certmgr.subjectinfo.label "Issued To">
<!ENTITY certmgr.issuerinfo.label "Issued By">
<!ENTITY certmgr.validity.label "Validity" >
<!ENTITY certmgr.fingerprints.label "Fingerprints">
<!ENTITY certmgr.certdetail.title "Certificate Detail">
<!ENTITY certmgr.certdetail.cn "Common Name (CN)">
<!ENTITY certmgr.certdetail.o "Organization (O)">
<!ENTITY certmgr.certdetail.ou "Organizational Unit (OU)">
<!ENTITY certmgr.certdetail.serialnumber "Serial Number">
<!ENTITY certmgr.certdetail.rsapubmodulus "RSA Public Modulus">
<!ENTITY certmgr.certdetail.sha1fingerprint "SHA1 Fingerprint">
<!ENTITY certmgr.certdetail.md5fingerprint "MD5 Fingerprint">
<!ENTITY certmgr.editcert.title "Edit Security Certificate Settings">
<!ENTITY certmgr.editcacert.title "Edit CA certificate trust settings">
<!ENTITY certmgr.editsslcert.title "Edit web site certificate trust settings">
<!ENTITY certmgr.editcert.edittrust "Edit trust settings:">
<!ENTITY certmgr.editcert.trustssl "This certificate can identify web sites.">
<!ENTITY certmgr.editcert.trustemail "This certificate can identify mail users.">
<!ENTITY certmgr.editcert.trustobjsign "This certificate can identify software makers.">
<!ENTITY certmgr.editsslcert.edittrust "Edit certificate trust settings:">
<!ENTITY certmgr.editsslcert.dotrust "Trust the authenticity of this certificate.">
<!ENTITY certmgr.editsslcert.donttrust "Do not trust the authenticity of this certificate.">
<!ENTITY certmgr.deletecert.title "Delete Certificate">
<!ENTITY certmgr.deletecert.beforename "You have requested to delete this certificate:">
<!ENTITY certmgr.deletecert.aftername "Are you sure you want to delete this certificate?">
<!ENTITY certmgr.deleteusercert.title "Delete Your Certificate">
<!ENTITY certmgr.deleteusercert.beforename "You have requested to delete the certificate:">
<!ENTITY certmgr.deleteusercert.aftername "Once you have deleted this certificate, you will not be able to read mail that has been encrypted with it.">
<!ENTITY certmgr.certname "Certificate Name">
<!ENTITY certmgr.tokenname "Security Device">
<!ENTITY certmgr.purpose "Purpose">
<!ENTITY certmgr.issued "Issued On">
<!ENTITY certmgr.expires "Expires On">
<!ENTITY certmgr.email "E-Mail Address">
<!ENTITY certmgr.serial "Serial Number">
<!ENTITY certmgr.help.label "Help">
<!ENTITY certmgr.ok.label "OK">
<!ENTITY certmgr.close.label "Close">
<!ENTITY certmgr.cancel.label "Cancel">
<!ENTITY certmgr.view.label "View">
<!ENTITY certmgr.edit.label "Edit">
<!ENTITY certmgr.editca.label "Edit CA Trust">
<!ENTITY certmgr.add.label "Add">
<!ENTITY certmgr.delete.label "Delete">
<!ENTITY certmgr.backup.label "Backup">
<!ENTITY certmgr.backupall.label "Backup All">
<!ENTITY certmgr.restore.label "Restore">
<!ENTITY certmgr.details.label "Certificate Fields">
<!ENTITY certmgr.fields.label "Field Value">
<!ENTITY certmgr.hierarchy.label "Certificate Hierarchy">
<!-- access key definitions -->
<!ENTITY certmgr.helpButtonAccessKey "h">
<!ENTITY certmgr.closeWindowAccessKey "c">

View File

@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the locales being supplied by this jar -->
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<!-- locale information -->
<RDF:Description about="urn:mozilla:locale:en-US"
chrome:displayName="English (US)"
chrome:author="PSM Team"
chrome:name="en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:pippki"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
<!-- Version Information. State that we work only with major version of this
package. -->
<RDF:Description about="urn:mozilla:locale:en-US:pippki"
chrome:localeVersion="0.9.6"/>
</RDF:RDF>

View File

@@ -0,0 +1,44 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<!ENTITY devmgr.title "Device Manager">
<!ENTITY devmgr.devlist.label "Security Modules and Devices">
<!ENTITY devmgr.details.title "Details">
<!ENTITY devmgr.details.title2 "Value">
<!ENTITY devmgr.status.label "Status">
<!ENTITY devmgr.version.label "Version">
<!ENTITY devmgr.button.changeslotname.label "Change Slot Name">
<!ENTITY devmgr.button.login.label "Log In">
<!ENTITY devmgr.button.logout.label "Log Out">
<!ENTITY devmgr.button.changepw.label "Change Password">
<!ENTITY devmgr.button.load.label "Load">
<!ENTITY devmgr.button.unload.label "Unload">
<!ENTITY loaddevice.info "Enter the information for the module you want to add.">
<!ENTITY loaddevice.modname "Module Name:">
<!ENTITY loaddevice.modname.default "New PKCS#11 Module">
<!ENTITY loaddevice.filename "Module filename:">
<!ENTITY loaddevice.browse "Browse...">
<!ENTITY loaddevice.title "Load PKCS#11 Device">

View File

@@ -0,0 +1,21 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<!-- Values for newserver.xul -->
<!ENTITY newserver.title "">
<!ENTITY alwaysAccept.label "Remember this certificate permanently">
<!ENTITY continue.label "Continue">

View File

@@ -0,0 +1,27 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo <javi@netscape.com>
# Bob Lord <lord@netscape.com>
#
newServerMessage=There is a problem with the certificate that identifies "%S". Do you want to continue?
certNotRecognized=The certificate was issued by a certificate authority that %S does not recognize.
continueButton=Continue

Some files were not shown because too many files have changed in this diff Show More