Blame hobble-openssl

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