Blame SOURCES/hobble-openssl

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