Blame SOURCES/hobble-openssl

c4366c
#!/bin/sh
c4366c
c4366c
# Quit out if anything fails.
c4366c
set -e
c4366c
c4366c
# Clean out patent-or-otherwise-encumbered code.
c4366c
# MDC-2: 4,908,861 13/03/2007
c4366c
# IDEA:  5,214,703 25/05/2010
c4366c
# RC5:   5,724,428 03/03/2015
c4366c
# EC:    ????????? ??/??/2015
c4366c
c4366c
# Remove assembler portions of IDEA, MDC2, and RC5.
c4366c
(find crypto/{idea,mdc2,rc5}/asm -type f | xargs -r rm -fv)
c4366c
c4366c
# IDEA, MDC2, RC5, EC.
c4366c
for a in idea mdc2 rc5 ec ecdh ecdsa; do
c4366c
  for c in `find crypto/$a -name "*.c" -a \! -name "*test*" -type f` ; do
c4366c
	echo Destroying $c
c4366c
	> $c
c4366c
  done
c4366c
done
c4366c
c4366c
for c in `find crypto/evp -name "*_rc5.c" -o -name "*_idea.c" -o -name "*_mdc2.c" -o -name "*_ecdsa.c"`; do
c4366c
	echo Destroying $c
c4366c
	> $c
c4366c
done
c4366c
c4366c
for h in `find crypto ssl apps test -name "*.h"` ; do
c4366c
	echo Removing IDEA, MDC2, RC5, and EC references from $h
c4366c
	cat $h | \
c4366c
	awk    'BEGIN {ech=1;} \
c4366c
		/^#[ \t]*ifndef.*NO_IDEA/ {ech--; next;} \
c4366c
		/^#[ \t]*ifndef.*NO_MDC2/ {ech--; next;} \
c4366c
		/^#[ \t]*ifndef.*NO_RC5/ {ech--; next;} \
c4366c
		/^#[ \t]*ifndef.*NO_EC/ {ech--; next;} \
c4366c
		/^#[ \t]*ifndef.*NO_ECDH/ {ech--; next;} \
c4366c
		/^#[ \t]*ifndef.*NO_ECDSA/ {ech--; next;} \
c4366c
                /^#[ \t]*if/ {if(ech < 1) ech--;} \
c4366c
		{if(ech>0) {;print $0};} \
c4366c
		/^#[ \t]*endif/ {if(ech < 1) ech++;}' > $h.hobbled && \
c4366c
	mv $h.hobbled $h
c4366c
done
c4366c
c4366c
# Make the makefiles happy.
c4366c
touch crypto/rc5/asm/rc5-586.pl