From 80deef52d35ca11350cd2eedae187b087e913f79 Mon Sep 17 00:00:00 2001 From: "cyeh%netscape.com" Date: Mon, 12 Oct 1998 21:27:12 +0000 Subject: [PATCH] Flip security logic from #ifndef NO_SECURITY to #ifdef MOZ_SECURITY --- Makefile | 85 ------------------------- Makefile.in | 2 +- cmd/gnomefe/gnome-ctxt.c | 8 +-- cmd/gnomefe/gnome-src/g-browser-frame.c | 4 +- cmd/xfe/icons.c | 8 +-- cmd/xfe/mozilla.c | 4 +- cmd/xfe/prefs.c | 12 ++-- cmd/xfe/src/EditorView.cpp | 2 +- cmd/xfe/src/Frame.cpp | 2 +- cmd/xfe/src/PrefsProxiesView.cpp | 4 +- cmd/xfe/xfe.h | 4 +- lib/libmime/mimefilt.c | 12 ++-- lib/libmime/mimei.c | 16 ++--- lib/libmime/mimemoz.c | 4 +- lib/xp/xp_file.c | 2 +- makefile.win | 8 +-- 16 files changed, 46 insertions(+), 131 deletions(-) diff --git a/Makefile b/Makefile index 78a969fb935..e69de29bb2d 100644 --- a/Makefile +++ b/Makefile @@ -1,85 +0,0 @@ -# -# The contents of this file are subject to the Netscape Public License -# Version 1.0 (the "NPL"); you may not use this file except in -# compliance with the NPL. You may obtain a copy of the NPL at -# http://www.mozilla.org/NPL/ -# -# Software distributed under the NPL is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL -# for the specific language governing rights and limitations under the -# NPL. -# -# The Initial Developer of this code under the NPL is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All Rights -# Reserved. -# - -DEPTH = . - -NSPRDIR = nsprpub -NSPR20 = 1 -MOZILLA_CLIENT = 1 - -ifndef NO_MOCHA -DIRS_JS = js -endif - -DIRS = config coreconf $(NSPRDIR) jpeg dbm xpcom base network caps - -ifdef MOZ_NETCAST -DIRS += netcast -endif - -ifdef MOZ_JAVA -DIRS += sun-java ldap ifc $(DIRS_JS) nav-java ifc/tools js/jsd -else -DIRS += sun-java nav-java $(DIRS_JS) -endif - -ifndef NO_SECURITY -DIRS += security -endif - -DIRS += privacy - -DIRS += modules lib l10n cmd - -ifeq ($(STAND_ALONE_JAVA),1) -DIRS = config lib/xp $(NSPRDIR) jpeg modules/zlib sun-java ifc js ifc/tools sun-java/java -endif - -include $(DEPTH)/config/rules.mk - -export:: envirocheck $(OBJS) - -# Running this rule assembles all the SDK source pieces into dist/sdk. -# You'll need to run this rule on every platform to get all the -# binaries (e.g. javah) copied there. You'll also have to do special -# magic on a Mac. -sdk-src:: - $(SDKINSTALL) include/npapi.h $(SDK)/include/ - $(SDKINSTALL) include/jri_md.h $(SDK)/include/ - $(SDKINSTALL) include/jritypes.h $(SDK)/include/ - $(SDKINSTALL) include/jri.h $(SDK)/include/ - $(SDKINSTALL) lib/plugin/npupp.h $(SDK)/include/ - $(SDKINSTALL) sdk/common/*.c* $(SDK)/common/ - $(SDKINSTALL) sun-java/classsrc/$(ZIP_NAME).x $(SDK)/classes/$(ZIP_NAME) - $(SDKINSTALL) sdk/examples/simple/Source/*.c $(SDK)/examples/simple/Source/ - $(SDKINSTALL) sdk/examples/simple/Source/*.java $(SDK)/examples/simple/Source/ - $(SDKINSTALL) sdk/examples/simple/Source/*.class $(SDK)/examples/simple/Source/ - $(SDKINSTALL) sdk/examples/simple/Source/_gen/*.h $(SDK)/examples/simple/Source/_gen/ - $(SDKINSTALL) sdk/examples/simple/Source/_stubs/*.c $(SDK)/examples/simple/Source/_stubs/ - $(SDKINSTALL) sdk/examples/simple/Unix/makefile.* $(SDK)/examples/simple/Unix/ - $(SDKINSTALL) sdk/examples/simple/Testing/SimpleExample.html $(SDK)/examples/simple/Testing/ - $(SDKINSTALL) sdk/examples/simple/readme.html $(SDK)/examples/simple/ - $(SDKINSTALL) sdk/examples/UnixTemplate/Source/*.c $(SDK)/examples/UnixTemplate/Source/ - $(SDKINSTALL) sdk/examples/UnixTemplate/Testing/Test.html $(SDK)/examples/UnixTemplate/Testing/ - $(SDKINSTALL) sdk/examples/UnixTemplate/Unix/makefile.* $(SDK)/examples/UnixTemplate/Unix/ - $(SDKINSTALL) sdk/examples/UnixTemplate/readme.html $(SDK)/examples/UnixTemplate/ - -sdk-bin:: - cd sdk; $(MAKE); cd .. - $(SDKINSTALL) $(DIST)/bin/javah$(BIN_SUFFIX) $(SDK)/bin/$(OS_CONFIG)/ - $(SDKINSTALL) sdk/examples/simple/Source/$(OBJDIR)/npsimple.$(DLL_SUFFIX) $(SDK)/bin/$(OS_CONFIG)/ - $(SDKINSTALL) sdk/examples/UnixTemplate/Source/$(OBJDIR)/nptemplate.$(DLL_SUFFIX) $(SDK)/bin/$(OS_CONFIG)/ diff --git a/Makefile.in b/Makefile.in index 225fcbd0e56..4e9496bd3f6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -42,7 +42,7 @@ else DIRS += sun-java nav-java $(DIRS_JS) endif -ifndef NO_SECURITY +ifdef MOZ_SECURITY DIRS += security endif diff --git a/cmd/gnomefe/gnome-ctxt.c b/cmd/gnomefe/gnome-ctxt.c index 4bf2568cb66..7af0e8832f6 100644 --- a/cmd/gnomefe/gnome-ctxt.c +++ b/cmd/gnomefe/gnome-ctxt.c @@ -40,7 +40,7 @@ #include "../../lib/xp/biglogo.h" #include "../../lib/xp/photo.h" #include "../../lib/xp/hype.h" -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "../../lib/xp/rsalogo.h" #include "ssl.h" #include "xp_sec.h" @@ -1101,7 +1101,7 @@ FE_AboutData(const char* which, *length_ret = sizeof (hype_au) - 1; *content_type_ret = AUDIO_BASIC; } -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY else if (!strcmp (which, "rsalogo")) { /* Note, this one returns a read-only string. */ @@ -1358,7 +1358,7 @@ FE_AboutData(const char* which, { char *a2; int len; -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY char *s0 = XP_GetString(XFE_SECURITY_WITH); char *s1 = XP_SecurityVersion(1); char *s2 = XP_SecurityCapabilities(); @@ -1377,7 +1377,7 @@ FE_AboutData(const char* which, fe_version_and_locale, ss ); -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY free (s2); free (ss); #endif diff --git a/cmd/gnomefe/gnome-src/g-browser-frame.c b/cmd/gnomefe/gnome-src/g-browser-frame.c index dead1f39cc9..30054dc1398 100644 --- a/cmd/gnomefe/gnome-src/g-browser-frame.c +++ b/cmd/gnomefe/gnome-src/g-browser-frame.c @@ -172,7 +172,7 @@ static GnomeUIInfo window_submenu[] = { { GNOME_APP_UI_ITEM, "History", NULL, moz_open_history, NULL, NULL }, -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY { GNOME_APP_UI_ITEM, "View Security", NULL, callback, NULL, NULL }, #endif @@ -257,7 +257,7 @@ static GnomeUIInfo toolbar_info[] = { GNOME_APP_PIXMAP_FILENAME, "images/TB_Print.xpm" }, -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY { GNOME_APP_UI_ITEM, "Security", "View the Security Info for this page", callback, NULL, NULL, diff --git a/cmd/xfe/icons.c b/cmd/xfe/icons.c index a0dd3109e7e..ea534e683dd 100644 --- a/cmd/xfe/icons.c +++ b/cmd/xfe/icons.c @@ -30,7 +30,7 @@ #include /* For fast updating of the button pixmap... */ -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "ssl.h" #endif @@ -40,7 +40,7 @@ #include "../../lib/xp/biglogo.h" #include "../../lib/xp/photo.h" #include "../../lib/xp/hype.h" -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "../../lib/xp/rsalogo.h" #endif #ifdef JAVA @@ -1585,7 +1585,7 @@ fe_InitIcons (MWContext *c, MSG_BIFF_STATE biffstate) } } -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY Pixmap fe_NewSecurityPixmap (Widget widget, Dimension *w, Dimension *h, int type) @@ -1626,7 +1626,7 @@ fe_SecurityPixmap (MWContext *context, Dimension *w, Dimension *h, if (h) *h = fe_icons [index].height; return fe_icons [index].pixmap; } -#endif /* ! NO_SECURITY */ +#endif /* MOZ_SECURITY */ #ifdef EDITOR diff --git a/cmd/xfe/mozilla.c b/cmd/xfe/mozilla.c index 123f99f9841..97e55d6c7b8 100644 --- a/cmd/xfe/mozilla.c +++ b/cmd/xfe/mozilla.c @@ -421,12 +421,12 @@ XtResource fe_Resources [] = XtOffset (fe_ContextData *, default_background_image), XtRImmediate, "" }, -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY { "secureDocumentColor", XtCForeground, XtRPixel, sizeof (String), XtOffset (fe_ContextData *, secure_document_pixel), XtRString, "green" }, { "insecureDocumentColor", XtCForeground, XtRPixel, sizeof (String), XtOffset (fe_ContextData *, insecure_document_pixel), XtRString, "red" }, -#endif /* ! NO_SECURITY */ +#endif /* MOZ_SECURITY */ { "linkCursor", XtCCursor, XtRCursor, sizeof (Cursor), XtOffset (fe_ContextData *, link_cursor), XtRString, "hand2" }, diff --git a/cmd/xfe/prefs.c b/cmd/xfe/prefs.c index b74b503cce9..0c73d3e997e 100644 --- a/cmd/xfe/prefs.c +++ b/cmd/xfe/prefs.c @@ -319,7 +319,7 @@ static struct pref_map pref_map[] = { {"network.proxy.gopher_port", FIELD_OFFSET(gopher_proxy_port), read_int, write_int}, {"network.proxy.wais", FIELD_OFFSET(wais_proxy), fe_PrefReadString, fe_PrefWriteString}, {"network.proxy.wais_port", FIELD_OFFSET(wais_proxy_port), read_int, write_int}, -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY {"network.proxy.ssl", FIELD_OFFSET(https_proxy), fe_PrefReadString, fe_PrefWriteString}, {"network.proxy.ssl_port", FIELD_OFFSET(https_proxy_port), read_int, write_int}, #endif @@ -715,7 +715,7 @@ split_all_proxies(XFE_GlobalPrefs* prefs) split_proxy(&prefs->http_proxy, &prefs->http_proxy_port, 0); split_proxy(&prefs->gopher_proxy, &prefs->gopher_proxy_port, 0); split_proxy(&prefs->wais_proxy, &prefs->wais_proxy_port, 0); -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY split_proxy(&prefs->https_proxy, &prefs->https_proxy_port, 0); #endif } @@ -797,7 +797,7 @@ xfe_prefs_from_environment (XFE_GlobalPrefs *prefs) } PARSE_PROXY_ENV ("ftp_proxy", prefs->ftp_proxy) PARSE_PROXY_ENV ("http_proxy", prefs->http_proxy) -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY PARSE_PROXY_ENV ("https_proxy", prefs->https_proxy) #endif PARSE_PROXY_ENV ("gopher_proxy", prefs->gopher_proxy) @@ -1487,7 +1487,7 @@ XFE_OldReadPrefs(char * filename, XFE_GlobalPrefs *prefs) StrAllocCopy (prefs->ftp_proxy, value); else if (!XP_STRCASECMP("HTTP_PROXY", name)) StrAllocCopy (prefs->http_proxy, value); -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY else if (!XP_STRCASECMP("HTTPS_PROXY", name)) StrAllocCopy (prefs->https_proxy, value); #endif @@ -1500,7 +1500,7 @@ XFE_OldReadPrefs(char * filename, XFE_GlobalPrefs *prefs) /* SECURITY */ -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY else if (!XP_STRCASECMP("ASK_PASSWORD", name)) prefs->ask_password = atoi (value); else if (!XP_STRCASECMP("PASSWORD_TIMEOUT", name)) @@ -1529,7 +1529,7 @@ XFE_OldReadPrefs(char * filename, XFE_GlobalPrefs *prefs) else if (!XP_STRCASECMP("DEFAULT_USER_CERT", name)) StrAllocCopy (prefs->def_user_cert, value); -#endif /* ! NO_SECURITY */ +#endif /* MOZ_SECURITY */ else if (!XP_STRCASECMP("ENABLE_SSL2", name)) prefs->ssl2_enable = BOOLP (value); else if (!XP_STRCASECMP("ENABLE_SSL3", name)) diff --git a/cmd/xfe/src/EditorView.cpp b/cmd/xfe/src/EditorView.cpp index 7e989216316..2293d9bb9de 100644 --- a/cmd/xfe/src/EditorView.cpp +++ b/cmd/xfe/src/EditorView.cpp @@ -32,7 +32,7 @@ #include "fe_proto.h" #include "edt.h" #include "xeditor.h" -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "secnav.h" #include "pk11func.h" #endif diff --git a/cmd/xfe/src/Frame.cpp b/cmd/xfe/src/Frame.cpp index d5cc495c4aa..0d4de6f6c0c 100644 --- a/cmd/xfe/src/Frame.cpp +++ b/cmd/xfe/src/Frame.cpp @@ -21,7 +21,7 @@ */ -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "ssl.h" #endif diff --git a/cmd/xfe/src/PrefsProxiesView.cpp b/cmd/xfe/src/PrefsProxiesView.cpp index 45418a8f289..e1035c8c102 100644 --- a/cmd/xfe/src/PrefsProxiesView.cpp +++ b/cmd/xfe/src/PrefsProxiesView.cpp @@ -567,7 +567,7 @@ void XFE_PrefsProxiesViewDialog::initPage() FROB(ftp, proxy, ""); FROB(gopher, proxy, ""); FROB(http, proxy, ""); -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY FROB(https, proxy, ""); #endif FROB(wais, proxy, ""); @@ -700,7 +700,7 @@ void prefsProxiesViewCb_ok(Widget w, SNARFP (ftp, proxy, False); SNARFP (gopher, proxy, False); SNARFP (http, proxy, False); -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY SNARFP (https, proxy, False); #endif SNARFP (wais, proxy, False); diff --git a/cmd/xfe/xfe.h b/cmd/xfe/xfe.h index 59934bac044..d652b381541 100644 --- a/cmd/xfe/xfe.h +++ b/cmd/xfe/xfe.h @@ -355,7 +355,7 @@ extern Pixmap fe_ToolbarPixmap (MWContext *context, int i, Boolean disabled_p, #endif -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY extern Pixmap fe_SecurityPixmap (MWContext *context, Dimension *w, Dimension *h, int type); @@ -1072,7 +1072,7 @@ typedef struct fe_ContextData Pixel select_bg_pixel; Pixel default_fg_pixel; Pixel default_bg_pixel; -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY Pixel secure_document_pixel; Pixel insecure_document_pixel; #endif diff --git a/lib/libmime/mimefilt.c b/lib/libmime/mimefilt.c index 1d57af70627..042c310503b 100644 --- a/lib/libmime/mimefilt.c +++ b/lib/libmime/mimefilt.c @@ -55,13 +55,13 @@ #include "prglobal.h" #endif -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "key.h" #include "cert.h" #include "secrng.h" #include "secmod.h" #include "pk11func.h" -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ #ifndef XP_UNIX @@ -226,7 +226,7 @@ static int test_image_write_buffer(char *buf, int32 size, void *image_closure) return 0; } -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY static char * test_passwd_prompt (PK11SlotInfo *slot, void *wincx) { @@ -239,7 +239,7 @@ test_passwd_prompt (PK11SlotInfo *slot, void *wincx) s[strlen(s)-1] = '\0'; return s; } -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ int @@ -382,9 +382,9 @@ main (int argc, char **argv) XP_Bool decrypt_p = FALSE; char filename[1000]; -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY HG09846 -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ if (i < argc) { diff --git a/lib/libmime/mimei.c b/lib/libmime/mimei.c index 54872d0d663..0feeaac601d 100644 --- a/lib/libmime/mimei.c +++ b/lib/libmime/mimei.c @@ -52,9 +52,9 @@ #include "mimeeobj.h" /* | |--- MimeExternalObject */ #include "mimeebod.h" /* |--- MimeExternalBody */ -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY #include "mimesec.h" -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ /* ========================================================================== Allocation and destruction @@ -184,9 +184,9 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs, else if (!strcasecomp(content_type+10, "mixed")) class = (MimeObjectClass *)&mimeMultipartMixedClass; -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY HG09850 -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ if (!class && !exact_match_p) /* Treat all unknown multipart subtypes as "multipart/mixed" */ @@ -231,11 +231,11 @@ HG09850 else if (!strcasecomp(content_type, SUN_ATTACHMENT)) class = (MimeObjectClass *)&mimeSunAttachmentClass; -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY HG09855 else if ((class = mime_find_class_from_content_type(content_type)) != 0) ; -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ /* Everything else gets represented as a clickable link. */ @@ -586,9 +586,9 @@ mime_imap_part_address(MimeObject *obj) } HG09851 -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY HG09852 -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ HG09853 HG09854 diff --git a/lib/libmime/mimemoz.c b/lib/libmime/mimemoz.c index 868710174dc..11d01481c96 100644 --- a/lib/libmime/mimemoz.c +++ b/lib/libmime/mimemoz.c @@ -413,7 +413,7 @@ mime_display_stream_complete (NET_StreamClass *stream) if (msd->stream) { -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY /* Hold your breath. This is how we notify compose.c that the message was decrypted -- it will set a flag in the mime_delivery_state structure, which we don't have access to from @@ -423,7 +423,7 @@ mime_display_stream_complete (NET_StreamClass *stream) obj->options->state && obj->options->state->decrypted_p) HG09858 ; -#endif /* NO_SECURITY */ +#endif /* MOZ_SECURITY */ /* Close the output stream. */ msd->stream->complete (msd->stream); diff --git a/lib/xp/xp_file.c b/lib/xp/xp_file.c index e19054a51c6..4e351c9508e 100644 --- a/lib/xp/xp_file.c +++ b/lib/xp/xp_file.c @@ -1114,7 +1114,7 @@ xp_FileName (const char *name, XP_FileType type, char* buf, char* configBuf) name = buf; break; -#ifndef NO_SECURITY +#ifdef MOZ_SECURITY case xpCryptoPolicy: { extern void fe_GetProgramDirectory(char *path, int len); diff --git a/makefile.win b/makefile.win index 468e52520c8..8d1daebe1ba 100644 --- a/makefile.win +++ b/makefile.win @@ -38,10 +38,10 @@ DEPTH=. #// to netscape.netcast.* - spider #//------------------------------------------------------------------------ -!ifdef NO_SECURITY -SECDIR= -!else +!ifdef MOZ_SECURITY SECDIR=security +!else +SECDIR= !endif DISTDIRS=$(NSPRDIR) dbm $(SECDIR) xpcom base caps @@ -55,7 +55,7 @@ DIRS_JSD = js\jsd XTRADIRS = $(DISTDIRS) !endif -!ifndef NO_SECURITY +!ifdef MOZ_SECURITY CORECONF=coreconf !else CORECONF=