2004-09-09 09:35:06 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2004-09-09 09:45:17 +00:00
|
|
|
# Quit out if anything fails.
|
2004-09-09 09:41:24 +00:00
|
|
|
set -e
|
|
|
|
|
2004-09-09 09:35:41 +00:00
|
|
|
# Clean out patent-or-otherwise-encumbered code.
|
2009-08-20 14:20:57 +00:00
|
|
|
# MDC-2: 4,908,861 13/03/2007 - expired, we do not remove it but do not enable it anyway
|
2004-09-09 09:35:06 +00:00
|
|
|
# IDEA: 5,214,703 25/05/2010
|
|
|
|
# RC5: 5,724,428 03/03/2015
|
2004-09-09 09:45:17 +00:00
|
|
|
# EC: ????????? ??/??/2015
|
2004-09-09 09:35:06 +00:00
|
|
|
|
2004-09-09 09:41:24 +00:00
|
|
|
# Remove assembler portions of IDEA, MDC2, and RC5.
|
2009-08-20 14:20:57 +00:00
|
|
|
(find crypto/{idea,rc5}/asm -type f | xargs -r rm -fv)
|
2004-09-09 09:35:06 +00:00
|
|
|
|
2004-09-09 09:45:17 +00:00
|
|
|
# IDEA, MDC2, RC5, EC.
|
2009-08-20 14:20:57 +00:00
|
|
|
for a in idea rc5 ec ecdh ecdsa; do
|
2004-09-09 09:41:24 +00:00
|
|
|
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
|
|
|
|
2009-08-20 14:20:57 +00:00
|
|
|
for c in `find crypto/evp -name "*_rc5.c" -o -name "*_idea.c" -o -name "*_ecdsa.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
|
2009-08-20 14:20:57 +00:00
|
|
|
echo Removing IDEA, RC5, and EC references from $h
|
2004-09-09 09:35:06 +00:00
|
|
|
cat $h | \
|
|
|
|
awk 'BEGIN {ech=1;} \
|
2005-11-08 13:52:29 +00:00
|
|
|
/^#[ \t]*ifndef.*NO_IDEA/ {ech--; next;} \
|
|
|
|
/^#[ \t]*ifndef.*NO_RC5/ {ech--; next;} \
|
|
|
|
/^#[ \t]*ifndef.*NO_EC/ {ech--; next;} \
|
|
|
|
/^#[ \t]*ifndef.*NO_ECDH/ {ech--; next;} \
|
|
|
|
/^#[ \t]*ifndef.*NO_ECDSA/ {ech--; next;} \
|
|
|
|
/^#[ \t]*if/ {if(ech < 1) ech--;} \
|
2004-09-09 09:35:06 +00:00
|
|
|
{if(ech>0) {;print $0};} \
|
2005-11-08 13:52:29 +00:00
|
|
|
/^#[ \t]*endif/ {if(ech < 1) ech++;}' > $h.hobbled && \
|
2004-09-09 09:35:06 +00:00
|
|
|
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
|