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