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