Add non-FIPS algorithm blocking and selftest checking.
[openssl.git] / fips / rsa / Makefile
1 #
2 # OpenSSL/fips/rsa/Makefile
3 #
4
5 DIR=    rsa
6 TOP=    ../..
7 CC=     cc
8 INCLUDES=
9 CFLAG=-g
10 INSTALL_PREFIX=
11 OPENSSLDIR=     /usr/local/ssl
12 INSTALLTOP=/usr/local/ssl
13 MAKEDEPPROG=    makedepend
14 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
15 MAKEFILE=       Makefile
16 AR=             ar r
17
18 CFLAGS= $(INCLUDES) $(CFLAG)
19
20 GENERAL=Makefile
21 TEST= fips_rsavtest.c fips_rsastest.c fips_rsagtest.c
22 APPS=
23
24 LIB=$(TOP)/libcrypto.a
25 LIBSRC= fips_rsa_selftest.c fips_rsa_sign.c fips_rsa_lib.c
26 LIBOBJ= fips_rsa_selftest.o fips_rsa_sign.o fips_rsa_lib.o
27
28 SRC= $(LIBSRC)
29
30 EXHEADER=
31 HEADER= $(EXHEADER)
32
33 ALL=    $(GENERAL) $(SRC) $(HEADER)
34
35 top:
36         (cd $(TOP); $(MAKE) DIRS=fips FDIRS=$(DIR) sub_all)
37
38 all:    lib
39
40 lib:    $(LIBOBJ)
41         @echo $(LIBOBJ) > lib
42
43 files:
44         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
45
46 links:
47         @$(PERL) $(TOP)/util/mklink.pl $(TOP)/include/openssl $(EXHEADER)
48         @$(PERL) $(TOP)/util/mklink.pl $(TOP)/test $(TEST)
49         @$(PERL) $(TOP)/util/mklink.pl $(TOP)/apps $(APPS)
50
51 install:
52         @headerlist="$(EXHEADER)"; for i in $$headerlist; \
53         do \
54           (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
55           chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
56         done
57
58 tags:
59         ctags $(SRC)
60
61 tests:
62
63 Q=../testvectors/rsa/req
64 A=../testvectors/rsa/rsp
65 Q62=../testvectors/rsa_salt_62/req
66 A62=../testvectors/rsa_salt_62/rsp
67
68 fips_test:
69         -rm -rf $(A) $(A62)
70         mkdir $(A) $(A62)
71         if [ -f $(Q)/SigGen15.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsastest < $(Q)/SigGen15.req  > $(A)/SigGen15.rsp; fi
72         if [ -f $(Q)/SigVer15.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsavtest < $(Q)/SigVer15.req > $(A)/SigVer15.rsp; fi
73         if [ -f $(Q)/SigGenPSS.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsastest -saltlen 0 < $(Q)/SigGenPSS.req > $(A)/SigGenPSS.rsp; fi
74         if [ -f $(Q)/SigVerPSS.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsavtest -saltlen 0 < $(Q)/SigVerPSS.req > $(A)/SigVerPSS.rsp; fi
75         if [ -f $(Q)/SigGenRSA.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsastest -x931 < $(Q)/SigGenRSA.req > $(A)/SigGenRSA.rsp; fi
76         if [ -f $(Q)/SigVerRSA.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsavtest -x931 < $(Q)/SigVerRSA.req > $(A)/SigVerRSA.rsp; fi
77         if [ -f $(Q62)/SigGenPSS.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsastest -saltlen 62 < $(Q62)/SigGenPSS.req >$(A62)/SigGenPSS.rsp; fi
78         if [ -f $(Q62)/SigVerPSS.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsavtest -saltlen 62 <$(Q62)/SigVerPSS.req >$(A62)/SigVerPSS.rsp; fi
79         if [ -f $(Q)/KeyGenRSA.req ]; then $(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_rsagtest < $(Q)/KeyGenRSA.req > $(A)/KeyGenRSA.rsp; fi
80
81 lint:
82         lint -DLINT $(INCLUDES) $(SRC)>fluff
83
84 depend:
85         $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(SRC) $(TEST)
86
87 dclean:
88         $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
89         mv -f Makefile.new $(MAKEFILE)
90
91 clean:
92         rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
93 # DO NOT DELETE THIS LINE -- make depend depends on it.
94
95 fips_rsa_eay.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
96 fips_rsa_eay.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
97 fips_rsa_eay.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
98 fips_rsa_eay.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
99 fips_rsa_eay.o: ../../include/openssl/opensslconf.h
100 fips_rsa_eay.o: ../../include/openssl/opensslv.h
101 fips_rsa_eay.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
102 fips_rsa_eay.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
103 fips_rsa_eay.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
104 fips_rsa_eay.o: fips_rsa_eay.c
105 fips_rsa_gen.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
106 fips_rsa_gen.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
107 fips_rsa_gen.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
108 fips_rsa_gen.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
109 fips_rsa_gen.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
110 fips_rsa_gen.o: ../../include/openssl/objects.h
111 fips_rsa_gen.o: ../../include/openssl/opensslconf.h
112 fips_rsa_gen.o: ../../include/openssl/opensslv.h
113 fips_rsa_gen.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
114 fips_rsa_gen.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
115 fips_rsa_gen.o: ../../include/openssl/symhacks.h ../fips_locl.h fips_rsa_gen.c
116 fips_rsa_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
117 fips_rsa_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
118 fips_rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
119 fips_rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
120 fips_rsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
121 fips_rsa_lib.o: ../../include/openssl/objects.h
122 fips_rsa_lib.o: ../../include/openssl/opensslconf.h
123 fips_rsa_lib.o: ../../include/openssl/opensslv.h
124 fips_rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
125 fips_rsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
126 fips_rsa_lib.o: ../../include/openssl/symhacks.h fips_rsa_lib.c
127 fips_rsa_selftest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
128 fips_rsa_selftest.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
129 fips_rsa_selftest.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
130 fips_rsa_selftest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
131 fips_rsa_selftest.o: ../../include/openssl/lhash.h
132 fips_rsa_selftest.o: ../../include/openssl/obj_mac.h
133 fips_rsa_selftest.o: ../../include/openssl/objects.h
134 fips_rsa_selftest.o: ../../include/openssl/opensslconf.h
135 fips_rsa_selftest.o: ../../include/openssl/opensslv.h
136 fips_rsa_selftest.o: ../../include/openssl/ossl_typ.h
137 fips_rsa_selftest.o: ../../include/openssl/rsa.h
138 fips_rsa_selftest.o: ../../include/openssl/safestack.h
139 fips_rsa_selftest.o: ../../include/openssl/stack.h
140 fips_rsa_selftest.o: ../../include/openssl/symhacks.h fips_rsa_selftest.c
141 fips_rsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
142 fips_rsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
143 fips_rsa_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
144 fips_rsa_sign.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
145 fips_rsa_sign.o: ../../include/openssl/obj_mac.h
146 fips_rsa_sign.o: ../../include/openssl/objects.h
147 fips_rsa_sign.o: ../../include/openssl/opensslconf.h
148 fips_rsa_sign.o: ../../include/openssl/opensslv.h
149 fips_rsa_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
150 fips_rsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
151 fips_rsa_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
152 fips_rsa_sign.o: fips_rsa_sign.c
153 fips_rsa_x931g.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
154 fips_rsa_x931g.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
155 fips_rsa_x931g.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
156 fips_rsa_x931g.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
157 fips_rsa_x931g.o: ../../include/openssl/opensslconf.h
158 fips_rsa_x931g.o: ../../include/openssl/opensslv.h
159 fips_rsa_x931g.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
160 fips_rsa_x931g.o: ../../include/openssl/safestack.h
161 fips_rsa_x931g.o: ../../include/openssl/stack.h
162 fips_rsa_x931g.o: ../../include/openssl/symhacks.h fips_rsa_x931g.c
163 fips_rsagtest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
164 fips_rsagtest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
165 fips_rsagtest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
166 fips_rsagtest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
167 fips_rsagtest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
168 fips_rsagtest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
169 fips_rsagtest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h
170 fips_rsagtest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
171 fips_rsagtest.o: ../../include/openssl/objects.h
172 fips_rsagtest.o: ../../include/openssl/opensslconf.h
173 fips_rsagtest.o: ../../include/openssl/opensslv.h
174 fips_rsagtest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
175 fips_rsagtest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
176 fips_rsagtest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
177 fips_rsagtest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
178 fips_rsagtest.o: ../../include/openssl/x509_vfy.h
179 fips_rsagtest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_rsagtest.c
180 fips_rsastest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
181 fips_rsastest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
182 fips_rsastest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
183 fips_rsastest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
184 fips_rsastest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
185 fips_rsastest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
186 fips_rsastest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h
187 fips_rsastest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
188 fips_rsastest.o: ../../include/openssl/objects.h
189 fips_rsastest.o: ../../include/openssl/opensslconf.h
190 fips_rsastest.o: ../../include/openssl/opensslv.h
191 fips_rsastest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
192 fips_rsastest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
193 fips_rsastest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
194 fips_rsastest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
195 fips_rsastest.o: ../../include/openssl/x509_vfy.h
196 fips_rsastest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_rsastest.c
197 fips_rsavtest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
198 fips_rsavtest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
199 fips_rsavtest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
200 fips_rsavtest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
201 fips_rsavtest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
202 fips_rsavtest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
203 fips_rsavtest.o: ../../include/openssl/fips.h ../../include/openssl/hmac.h
204 fips_rsavtest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
205 fips_rsavtest.o: ../../include/openssl/objects.h
206 fips_rsavtest.o: ../../include/openssl/opensslconf.h
207 fips_rsavtest.o: ../../include/openssl/opensslv.h
208 fips_rsavtest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
209 fips_rsavtest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
210 fips_rsavtest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
211 fips_rsavtest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
212 fips_rsavtest.o: ../../include/openssl/x509_vfy.h
213 fips_rsavtest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_rsavtest.c