From dd80610869cad3756fd217a7279927d1a184e17d Mon Sep 17 00:00:00 2001
From: Martin Nilsson <mani@lysator.liu.se>
Date: Wed, 19 Mar 2003 17:42:28 +0100
Subject: [PATCH] Remove lobotomized crypto for now.

Rev: Makefile:1.113
Rev: packaging/README:1.3
Rev: src/modules/.cvsignore:1.8
Rev: src/modules/_Crypto/.build_lobotomized_crypto:1.10(DEAD)
Rev: src/modules/_Crypto/.exportable_files:1.7(DEAD)
Rev: src/modules/_Crypto/Makefile.in:1.28
Rev: src/modules/_Crypto/configure.in:1.15
Rev: src/modules/_Crypto/crypto.c:1.53
Rev: src/modules/_Crypto/lib/Makefile.in:1.37
---
 .gitattributes                                |  2 -
 Makefile                                      | 18 +-------
 packaging/README                              | 13 ------
 src/modules/.cvsignore                        |  1 -
 src/modules/.gitignore                        |  1 -
 src/modules/_Crypto/.build_lobotomized_crypto | 46 -------------------
 src/modules/_Crypto/.exportable_files         | 16 -------
 src/modules/_Crypto/Makefile.in               |  9 ++--
 src/modules/_Crypto/configure.in              |  5 +-
 src/modules/_Crypto/crypto.c                  | 12 +----
 src/modules/_Crypto/lib/Makefile.in           |  8 +---
 11 files changed, 9 insertions(+), 122 deletions(-)
 delete mode 100755 src/modules/_Crypto/.build_lobotomized_crypto
 delete mode 100644 src/modules/_Crypto/.exportable_files

diff --git a/.gitattributes b/.gitattributes
index 3cb9d2a540..e3065d43e3 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -595,8 +595,6 @@ testfont binary
 /src/modules/_Charset/misc.c foreign_ident
 /src/modules/_Charset/tables.c foreign_ident
 /src/modules/_Charset/testsuite.in foreign_ident
-/src/modules/_Crypto/.build_lobotomized_crypto foreign_ident
-/src/modules/_Crypto/.exportable_files foreign_ident
 /src/modules/_Crypto/Makefile.in foreign_ident
 /src/modules/_Crypto/acconfig.h foreign_ident
 /src/modules/_Crypto/arcfour.c foreign_ident
diff --git a/Makefile b/Makefile
index f2731d71e9..28b3af7592 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# $Id: Makefile,v 1.112 2003/01/31 22:14:09 grubba Exp $
+# $Id: Makefile,v 1.113 2003/03/19 16:24:52 nilsson Exp $
 #
 # Meta Makefile
 #
@@ -133,22 +133,6 @@ compile: configure
 	  done; \
 	} || exit $$?
 
-lobotomize_crypto:
-	@echo "Removing Pike crypto modules."
-	-rm -f lib/modules/Crypto/_rsa.pike
-	-rm -f lib/modules/Crypto/aes.pike
-	-rm -f lib/modules/Crypto/des3.pike
-	-rm -f lib/modules/Crypto/des3_cbc.pike
-	-rm -f lib/modules/Crypto/idea_cbc.pike
-	-rm -f lib/modules/Crypto/rsa.pike
-	-rm -rf lib/modules/SSL.pmod
-	-rm -f lib/modules/Standards.pmod/PKCS.pmod/RSA.pmod
-	-rm -f lib/modules/Tools.pmod/X509.pmod
-	-(cd src/modules/_Crypto && ./.build_lobotomized_crypto);
-	@echo
-	@echo "Removing low Crypto module."
-	-rm -rf src/modules/_Crypto
-
 # FIXME: The refdoc stuff ought to use $(BUILDDIR) too.
 
 documentation:
diff --git a/packaging/README b/packaging/README
index 93115636a6..edc9deab8e 100644
--- a/packaging/README
+++ b/packaging/README
@@ -66,16 +66,3 @@ If modules or functionality residing in the standard Pike repository
 is missing in your package, the package documentation should clearly
 state so and provide a description for how to aquire a complete Pike
 installation.
-
-
-  Crypto code
-
-For political reasons it might be wanted to make a Pike release
-without support for encryption and decryption. By executing the make
-target "lobotomize" in a source tree, fresh from CVS, all encryption
-code should be removed from it. Enryption dependent parts of Pike,
-such as SSL and parts of PKCS and X509, will also be removed.
-Cryptographic hashes and signatures will remain in Pike and still be
-functional. Please verify manually that all encryption code really is
-gone in your release.
-
diff --git a/src/modules/.cvsignore b/src/modules/.cvsignore
index 3a8388ff14..cd4a0c8d3d 100644
--- a/src/modules/.cvsignore
+++ b/src/modules/.cvsignore
@@ -1,5 +1,4 @@
 Makefile
-_Lobotomized_Crypto
 config.log
 config.status
 configure
diff --git a/src/modules/.gitignore b/src/modules/.gitignore
index e12d0b9364..c7258b4c53 100644
--- a/src/modules/.gitignore
+++ b/src/modules/.gitignore
@@ -1,5 +1,4 @@
 /Makefile
-/_Lobotomized_Crypto
 /config.log
 /config.status
 /configure
diff --git a/src/modules/_Crypto/.build_lobotomized_crypto b/src/modules/_Crypto/.build_lobotomized_crypto
deleted file mode 100755
index 614da02708..0000000000
--- a/src/modules/_Crypto/.build_lobotomized_crypto
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-# $Id: .build_lobotomized_crypto,v 1.9 2001/10/16 18:13:07 nilsson Exp $
-
-if [ ! -f cbc.c ]; then
-    echo ".build_lobotomized_crypto should be run in pike/src/modules/_Crypto"
-    exit 1
-fi
-
-echo
-echo "Creating _Lobotomized_Crypto directories..."
-mkdir -p ../_Lobotomized_Crypto
-mkdir -p ../_Lobotomized_Crypto/include
-mkdir -p ../_Lobotomized_Crypto/lib
-
-#
-# This way we avoid re-building things which have not changed.
-#
-smartcopy() {
-  if test -f "$1" -a -f "$2" && cmp "$1" "$2" 1>/dev/null 2>/dev/null; then
-    :
-  else
-    cp "$1" "$2"
-  fi
-}
-
-echo
-echo "Copying source files..."
-for d in . include lib; do
-    for f in `egrep -v '^#' $d/.exportable_files`; do
-        echo $d/$f
-	smartcopy $d/$f ../_Lobotomized_Crypto/$d/$f
-    done
-done
-
-echo
-echo "Censoring sensitive files"
-# configure* catches configure.in and maybe configure too /Mirar
-for f in configure* crypto.c Makefile.in lib/Makefile.in testsuite.in ; do
-    echo $f
-    sed '/BEGIN NATIONAL SECURITY/,/END NATIONAL SECURITY/d' \
-    < $f > .temporary_file
-    smartcopy .temporary_file ../_Lobotomized_Crypto/$f
-done
-
-rm .temporary_file
diff --git a/src/modules/_Crypto/.exportable_files b/src/modules/_Crypto/.exportable_files
deleted file mode 100644
index 170ca0e6d0..0000000000
--- a/src/modules/_Crypto/.exportable_files
+++ /dev/null
@@ -1,16 +0,0 @@
-# $Id: .exportable_files,v 1.6 2001/10/16 18:11:14 nilsson Exp $
-CREDITS
-cbc.c
-configure.in
-crypto.c
-crypto.doc
-crypto.h
-crypto_submodule.doc
-hash_submodule.doc
-invert.c
-md2.c
-md5.c
-nt.c
-pipe.c
-sha.c
-acconfig.h
diff --git a/src/modules/_Crypto/Makefile.in b/src/modules/_Crypto/Makefile.in
index 7bd90bca72..e04027ced9 100644
--- a/src/modules/_Crypto/Makefile.in
+++ b/src/modules/_Crypto/Makefile.in
@@ -1,12 +1,9 @@
-# $Id: Makefile.in,v 1.27 2002/03/14 01:53:02 mast Exp $
+# $Id: Makefile.in,v 1.28 2003/03/19 16:40:37 nilsson Exp $
 @make_variables@
 VPATH=@srcdir@:@srcdir@/../..:../..
 
-# BEGIN NATIONAL SECURITY
-MASS_DESTRUCTION_OBJS = idea.o des.o cast.o arcfour.o rsa.o rijndael.o
-# END NATIONAL SECURITY
-
-OBJS= $(MASS_DESTRUCTION_OBJS) crypto.o invert.o sha.o md2.o md4.o md5.o pipe.o cbc.o nt.o
+OBJS= idea.o des.o cast.o arcfour.o rsa.o rijndael.o \
+  crypto.o invert.o sha.o md2.o md4.o md5.o pipe.o cbc.o nt.o
 
 MODULE_ARCHIVES=lib/algorithms.a
 MODULE_SUBDIRS=lib
diff --git a/src/modules/_Crypto/configure.in b/src/modules/_Crypto/configure.in
index 1c8eab753e..7bd72d7156 100755
--- a/src/modules/_Crypto/configure.in
+++ b/src/modules/_Crypto/configure.in
@@ -1,4 +1,4 @@
-# $Id: configure.in,v 1.14 2001/02/27 18:52:26 grubba Exp $
+# $Id: configure.in,v 1.15 2003/03/19 16:42:28 nilsson Exp $
 AC_INIT(crypto.c)
 AC_CONFIG_HEADER(config.h)
 
@@ -10,10 +10,7 @@ AC_MODULE_INIT()
 
 AC_ARG_WITH(rsaref,     [  --with-rsaref[=path]      Support for RSAREF],[],[])
 
-PIKE_FEATURE(Crypto,[yes (lobotomized)])
-# BEGIN NATIONAL SECURITY 
 PIKE_FEATURE_OK(Crypto)
-# END NATIONAL SECURITY
 
 if test x$with_rsaref = x ; then
   :
diff --git a/src/modules/_Crypto/crypto.c b/src/modules/_Crypto/crypto.c
index ff5b6db3ed..4fc1558627 100644
--- a/src/modules/_Crypto/crypto.c
+++ b/src/modules/_Crypto/crypto.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: crypto.c,v 1.52 2002/10/21 17:06:24 marcus Exp $
+|| $Id: crypto.c,v 1.53 2003/03/19 16:41:31 nilsson Exp $
 */
 
 /*
@@ -654,17 +654,13 @@ PIKE_MODULE_INIT
   pike_invert_init();
   pike_nt_init();
 
-  /* BEGIN NATIONAL SECURITY */  
-
   pike_idea_init();
   pike_des_init();
   pike_cast_init();
   pike_arcfour_init();
   pike_rsa_init();
   pike_rijndael_init();
-
-  /* END NATIONAL SECURITY */
-}  
+}
 
 PIKE_MODULE_EXIT
 {
@@ -677,14 +673,10 @@ PIKE_MODULE_EXIT
   pike_pipe_exit();
   pike_invert_exit();
 
-  /* BEGIN NATIONAL SECURITY */
-
   pike_idea_exit();
   pike_des_exit();
   pike_cast_exit();
   pike_arcfour_exit();
   pike_rsa_exit();
   pike_rijndael_exit();
-
-  /* END NATIONAL SECURITY */
 }
diff --git a/src/modules/_Crypto/lib/Makefile.in b/src/modules/_Crypto/lib/Makefile.in
index b717c7c5cb..b454ae0e9e 100644
--- a/src/modules/_Crypto/lib/Makefile.in
+++ b/src/modules/_Crypto/lib/Makefile.in
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.36 2002/05/04 16:51:33 mast Exp $
+# $Id: Makefile.in,v 1.37 2003/03/19 16:41:10 nilsson Exp $
 #
 # Makefile for low-level crypto library
 
@@ -37,11 +37,7 @@ O=		$(SO) $(GO)
 SRC_TARGETS=$(GH)
 MODULE_CLEAN_EXTRA=*.i *.x desTest $(GC)
 
-# BEGIN NATIONAL SECURITY
-MASS_DESTRUCTION_OBJS = idea.o arcfour.o cast.o rijndael.o $(O)
-# END NATIONAL SECURITY
-
-OBJS = $(MASS_DESTRUCTION_OBJS) sha.o md2.o md4.o md5.o crypt_md5.o
+OBJS = idea.o arcfour.o cast.o rijndael.o sha.o md2.o md4.o md5.o crypt_md5.o
 
 @dynamic_module_makefile@
 
-- 
GitLab