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