File hobble-openssl of Package openssl
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 07/01/2012 - expired, we do not remove it anymore
9
# RC5: 5,724,428 01/11/2015
10
# EC: ????????? ??/??/2020
11
# SRP: ????????? ??/??/20??
12
13
# Remove assembler portions of IDEA, MDC2, and RC5.
14
(find crypto/rc5/asm -type f | xargs -r rm -fv)
15
16
# RC5, SRP.
17
for a in rc5 srp; do
18
for c in `find crypto/$a -name "*.c" -a \! -name "*test*" -type f` ; do
19
echo Destroying $c
20
> $c
21
done
22
done
23
24
for c in `find crypto/evp -name "*_rc5.c"`; do
25
echo Destroying $c
26
> $c
27
done
28
29
for c in `find crypto/bn -name "*gf2m.c"`; do
30
echo Destroying $c
31
> $c
32
done
33
34
for c in `find crypto/ec -name "ec2*.c" -o -name "ec_curve.c" -o -name "ecp_nistp?2?.c" -o -name "ectest.c"`; do
35
echo Destroying $c
36
> $c
37
done
38
39
for h in `find crypto ssl apps test -name "*.h"` ; do
40
echo Removing RC5, SRP and EC2M references from $h
41
cat $h | \
42
awk 'BEGIN {ech=1;} \
43
/^#[ \t]*ifndef.*NO_SRP/ {ech--; next;} \
44
/^#[ \t]*ifndef.*NO_RC5/ {ech--; next;} \
45
/^#[ \t]*ifndef.*NO_EC2M/ {ech--; next;} \
46
/^#[ \t]*if/ {if(ech < 1) ech--;} \
47
{if(ech>0) {;print $0};} \
48
/^#[ \t]*endif/ {if(ech < 1) ech++;}' > $h.hobbled && \
49
mv $h.hobbled $h
50
done
51
52
# Make the makefiles happy.
53
touch crypto/rc5/asm/rc5-586.pl
54