isaacpittman-hitachi / rpms / openssl

Forked from rpms/openssl 2 years ago
Clone

Blame SOURCES/hobble-openssl

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