mingw-openssl/hobble-openssl

45 lines
1.2 KiB
Plaintext
Raw Normal View History

2009-02-09 09:33:37 +00:00
#!/bin/sh
# Quit out if anything fails.
set -e
# Clean out patent-or-otherwise-encumbered code.
# MDC-2: 4,908,861 13/03/2007 - expired, we do not remove it but do not enable it anyway
# IDEA: 5,214,703 07/01/2012
# RC5: 5,724,428 01/11/2015
# EC: ????????? ??/??/2020
2009-02-09 09:33:37 +00:00
# Remove assembler portions of IDEA, MDC2, and RC5.
(find crypto/{idea,rc5}/asm -type f | xargs -r rm -fv)
2009-02-09 09:33:37 +00:00
# IDEA, MDC2, RC5, EC.
for a in idea rc5 ec ecdh ecdsa; do
2009-02-09 09:33:37 +00:00
for c in `find crypto/$a -name "*.c" -a \! -name "*test*" -type f` ; do
echo Destroying $c
> $c
done
done
for c in `find crypto/evp -name "*_rc5.c" -o -name "*_idea.c" -o -name "*_ecdsa.c"`; do
2009-02-09 09:33:37 +00:00
echo Destroying $c
> $c
done
for h in `find crypto ssl apps test -name "*.h"` ; do
echo Removing IDEA, RC5, and EC references from $h
2009-02-09 09:33:37 +00:00
cat $h | \
awk 'BEGIN {ech=1;} \
/^#[ \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--;} \
{if(ech>0) {;print $0};} \
/^#[ \t]*endif/ {if(ech < 1) ech++;}' > $h.hobbled && \
mv $h.hobbled $h
done
# Make the makefiles happy.
touch crypto/rc5/asm/rc5-586.pl