| 1 |
#!/bin/sh
|
| 2 |
|
| 3 |
# Quit out if anything fails.
|
| 4 |
set -e
|
| 5 |
|
| 6 |
# Clean out patent-or-otherwise-encumbered code.
|
| 7 |
# MDC-2: 4,908,861 13/03/2007 - expired, we do not remove it but do not enable it anyway
|
| 8 |
# IDEA: 5,214,703 25/05/2010
|
| 9 |
# RC5: 5,724,428 03/03/2015
|
| 10 |
# EC: ????????? ??/??/2015
|
| 11 |
|
| 12 |
# Remove assembler portions of IDEA, MDC2, and RC5.
|
| 13 |
(find crypto/{idea,rc5}/asm -type f | xargs -r rm -fv)
|
| 14 |
|
| 15 |
# IDEA, MDC2, RC5, EC.
|
| 16 |
for a in idea rc5 ec ecdh ecdsa; do
|
| 17 |
for c in `find crypto/$a -name "*.c" -a \! -name "*test*" -type f` ; do
|
| 18 |
echo Destroying $c
|
| 19 |
> $c
|
| 20 |
done
|
| 21 |
done
|
| 22 |
|
| 23 |
for c in `find crypto/evp -name "*_rc5.c" -o -name "*_idea.c" -o -name "*_ecdsa.c"`; do
|
| 24 |
echo Destroying $c
|
| 25 |
> $c
|
| 26 |
done
|
| 27 |
|
| 28 |
for h in `find crypto ssl apps test -name "*.h"` ; do
|
| 29 |
echo Removing IDEA, RC5, and EC references from $h
|
| 30 |
cat $h | \
|
| 31 |
awk 'BEGIN {ech=1;} \
|
| 32 |
/^#[ \t]*ifndef.*NO_IDEA/ {ech--; next;} \
|
| 33 |
/^#[ \t]*ifndef.*NO_RC5/ {ech--; next;} \
|
| 34 |
/^#[ \t]*ifndef.*NO_EC/ {ech--; next;} \
|
| 35 |
/^#[ \t]*ifndef.*NO_ECDH/ {ech--; next;} \
|
| 36 |
/^#[ \t]*ifndef.*NO_ECDSA/ {ech--; next;} \
|
| 37 |
/^#[ \t]*if/ {if(ech < 1) ech--;} \
|
| 38 |
{if(ech>0) {;print $0};} \
|
| 39 |
/^#[ \t]*endif/ {if(ech < 1) ech++;}' > $h.hobbled && \
|
| 40 |
mv $h.hobbled $h
|
| 41 |
done
|
| 42 |
|
| 43 |
# Make the makefiles happy.
|
| 44 |
touch crypto/rc5/asm/rc5-586.pl
|