Blame SOURCES/hobble-openssl

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