Blame SOURCES/hobble-openssl

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