Blame SOURCES/hobble-openssl

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