Blame SOURCES/hobble-openssl

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