a5ef24
#!/bin/sh
a5ef24
a5ef24
# Quit out if anything fails.
a5ef24
set -e
a5ef24
a5ef24
# Clean out patent-or-otherwise-encumbered code.
a5ef24
# MDC-2: 4,908,861 13/03/2007 - expired, we do not remove it but do not enable it anyway
a5ef24
# IDEA:  5,214,703 07/01/2012 - expired, we do not remove it anymore
cfec1a
# RC5:   5,724,428 01/11/2015 - expired, we do not remove it anymore
a5ef24
# EC:    ????????? ??/??/2020
a5ef24
# SRP:   ????????? ??/??/20??
a5ef24
a5ef24
# Remove assembler portions of IDEA, MDC2, and RC5.
cfec1a
# (find crypto/rc5/asm -type f | xargs -r rm -fv)
a5ef24
cfec1a
# SRP.
cfec1a
for a in srp; do
a5ef24
  for c in `find crypto/$a -name "*.c" -a \! -name "*test*" -type f` ; do
a5ef24
	echo Destroying $c
a5ef24
	> $c
a5ef24
  done
a5ef24
done
a5ef24
a5ef24
for c in `find crypto/bn -name "*gf2m.c"`; do
a5ef24
	echo Destroying $c
a5ef24
	> $c
a5ef24
done
a5ef24
cfec1a
for c in `find crypto/ec -name "ec2*.c" -o -name "ec_curve.c" -o -name "ecp_nistp22?.c" -o -name "ectest.c"`; do
a5ef24
	echo Destroying $c
a5ef24
	> $c
a5ef24
done
a5ef24
a5ef24
for h in `find crypto ssl apps test -name "*.h"` ; do
cfec1a
	echo Removing SRP and EC2M references from $h
a5ef24
	cat $h | \
a5ef24
	awk    'BEGIN {ech=1;} \
a5ef24
		/^#[ \t]*ifndef.*NO_SRP/ {ech--; next;} \
a5ef24
		/^#[ \t]*ifndef.*NO_EC2M/ {ech--; next;} \
a5ef24
                /^#[ \t]*if/ {if(ech < 1) ech--;} \
a5ef24
		{if(ech>0) {;print $0};} \
a5ef24
		/^#[ \t]*endif/ {if(ech < 1) ech++;}' > $h.hobbled && \
a5ef24
	mv $h.hobbled $h
a5ef24
done
a5ef24
a5ef24
# Make the makefiles happy.
cfec1a
# touch crypto/rc5/asm/rc5-586.pl