diff options
author | djm <> | 2008-09-06 12:15:54 +0000 |
---|---|---|
committer | djm <> | 2008-09-06 12:15:54 +0000 |
commit | f1625f274acf5dcd5601f6cb5e29e233b2a441a3 (patch) | |
tree | 44899ddfbef8f24aacbea50086c041c1b150f6d6 /src/lib/libcrypto/rsa | |
parent | 4f828b924f54507141fb95ebe49dfcd261945e85 (diff) | |
download | openbsd-f1625f274acf5dcd5601f6cb5e29e233b2a441a3.tar.gz openbsd-f1625f274acf5dcd5601f6cb5e29e233b2a441a3.tar.bz2 openbsd-f1625f274acf5dcd5601f6cb5e29e233b2a441a3.zip |
import of OpenSSL 0.9.8h
Diffstat (limited to 'src/lib/libcrypto/rsa')
-rw-r--r-- | src/lib/libcrypto/rsa/Makefile | 126 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_null.c | 15 | ||||
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_test.c | 32 |
3 files changed, 83 insertions, 90 deletions
diff --git a/src/lib/libcrypto/rsa/Makefile b/src/lib/libcrypto/rsa/Makefile index 8851825250..13900812ac 100644 --- a/src/lib/libcrypto/rsa/Makefile +++ b/src/lib/libcrypto/rsa/Makefile | |||
@@ -7,11 +7,6 @@ TOP= ../.. | |||
7 | CC= cc | 7 | CC= cc |
8 | INCLUDES= -I.. -I$(TOP) -I../../include | 8 | INCLUDES= -I.. -I$(TOP) -I../../include |
9 | CFLAG=-g | 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 | 10 | MAKEFILE= Makefile |
16 | AR= ar r | 11 | AR= ar r |
17 | 12 | ||
@@ -24,10 +19,10 @@ APPS= | |||
24 | LIB=$(TOP)/libcrypto.a | 19 | LIB=$(TOP)/libcrypto.a |
25 | LIBSRC= rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c \ | 20 | LIBSRC= rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c \ |
26 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_null.c \ | 21 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_null.c \ |
27 | rsa_pss.c rsa_x931.c rsa_asn1.c | 22 | rsa_pss.c rsa_x931.c rsa_asn1.c rsa_depr.c |
28 | LIBOBJ= rsa_eay.o rsa_gen.o rsa_lib.o rsa_sign.o rsa_saos.o rsa_err.o \ | 23 | LIBOBJ= rsa_eay.o rsa_gen.o rsa_lib.o rsa_sign.o rsa_saos.o rsa_err.o \ |
29 | rsa_pk1.o rsa_ssl.o rsa_none.o rsa_oaep.o rsa_chk.o rsa_null.o \ | 24 | rsa_pk1.o rsa_ssl.o rsa_none.o rsa_oaep.o rsa_chk.o rsa_null.o \ |
30 | rsa_pss.o rsa_x931.o rsa_asn1.o | 25 | rsa_pss.o rsa_x931.o rsa_asn1.o rsa_depr.o |
31 | 26 | ||
32 | SRC= $(LIBSRC) | 27 | SRC= $(LIBSRC) |
33 | 28 | ||
@@ -55,6 +50,7 @@ links: | |||
55 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) | 50 | @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS) |
56 | 51 | ||
57 | install: | 52 | install: |
53 | @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile... | ||
58 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ | 54 | @headerlist="$(EXHEADER)"; for i in $$headerlist ; \ |
59 | do \ | 55 | do \ |
60 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | 56 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ |
@@ -70,6 +66,7 @@ lint: | |||
70 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 66 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
71 | 67 | ||
72 | depend: | 68 | depend: |
69 | @[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile... | ||
73 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) | 70 | $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) |
74 | 71 | ||
75 | dclean: | 72 | dclean: |
@@ -99,6 +96,15 @@ rsa_chk.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
99 | rsa_chk.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 96 | rsa_chk.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
100 | rsa_chk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 97 | rsa_chk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
101 | rsa_chk.o: rsa_chk.c | 98 | rsa_chk.o: rsa_chk.c |
99 | rsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h | ||
100 | rsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
101 | rsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
102 | rsa_depr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
103 | rsa_depr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
104 | rsa_depr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
105 | rsa_depr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
106 | rsa_depr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
107 | rsa_depr.o: ../cryptlib.h rsa_depr.c | ||
102 | rsa_eay.o: ../../e_os.h ../../include/openssl/asn1.h | 108 | rsa_eay.o: ../../e_os.h ../../include/openssl/asn1.h |
103 | rsa_eay.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 109 | rsa_eay.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
104 | rsa_eay.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 110 | rsa_eay.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -109,13 +115,12 @@ rsa_eay.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h | |||
109 | rsa_eay.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 115 | rsa_eay.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
110 | rsa_eay.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_eay.c | 116 | rsa_eay.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_eay.c |
111 | rsa_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 117 | rsa_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
112 | rsa_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 118 | rsa_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
113 | rsa_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 119 | rsa_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
114 | rsa_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 120 | rsa_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
115 | rsa_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 121 | rsa_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h |
116 | rsa_err.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 122 | rsa_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
117 | rsa_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 123 | rsa_err.o: ../../include/openssl/symhacks.h rsa_err.c |
118 | rsa_err.o: rsa_err.c | ||
119 | rsa_gen.o: ../../e_os.h ../../include/openssl/asn1.h | 124 | rsa_gen.o: ../../e_os.h ../../include/openssl/asn1.h |
120 | rsa_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 125 | rsa_gen.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
121 | rsa_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 126 | rsa_gen.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -128,14 +133,13 @@ rsa_gen.o: ../cryptlib.h rsa_gen.c | |||
128 | rsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h | 133 | rsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h |
129 | rsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 134 | rsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
130 | rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 135 | rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
131 | rsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
132 | rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h | 136 | rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h |
133 | rsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 137 | rsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
134 | rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 138 | rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
135 | rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h | 139 | rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h |
136 | rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 140 | rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
137 | rsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 141 | rsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
138 | rsa_lib.o: ../../include/openssl/ui.h ../cryptlib.h rsa_lib.c | 142 | rsa_lib.o: ../cryptlib.h rsa_lib.c |
139 | rsa_none.o: ../../e_os.h ../../include/openssl/asn1.h | 143 | rsa_none.o: ../../e_os.h ../../include/openssl/asn1.h |
140 | rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 144 | rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
141 | rsa_none.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 145 | rsa_none.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -154,26 +158,17 @@ rsa_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
154 | rsa_null.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h | 158 | rsa_null.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h |
155 | rsa_null.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 159 | rsa_null.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
156 | rsa_null.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_null.c | 160 | rsa_null.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_null.c |
157 | rsa_oaep.o: ../../e_os.h ../../include/openssl/aes.h | 161 | rsa_oaep.o: ../../e_os.h ../../include/openssl/asn1.h |
158 | rsa_oaep.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 162 | rsa_oaep.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
159 | rsa_oaep.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 163 | rsa_oaep.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
160 | rsa_oaep.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 164 | rsa_oaep.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
161 | rsa_oaep.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 165 | rsa_oaep.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
162 | rsa_oaep.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
163 | rsa_oaep.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
164 | rsa_oaep.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
165 | rsa_oaep.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
166 | rsa_oaep.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
167 | rsa_oaep.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
168 | rsa_oaep.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 166 | rsa_oaep.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
169 | rsa_oaep.o: ../../include/openssl/opensslconf.h | 167 | rsa_oaep.o: ../../include/openssl/opensslconf.h |
170 | rsa_oaep.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 168 | rsa_oaep.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
171 | rsa_oaep.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | 169 | rsa_oaep.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h |
172 | rsa_oaep.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
173 | rsa_oaep.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
174 | rsa_oaep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 170 | rsa_oaep.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
175 | rsa_oaep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 171 | rsa_oaep.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
176 | rsa_oaep.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
177 | rsa_oaep.o: ../cryptlib.h rsa_oaep.c | 172 | rsa_oaep.o: ../cryptlib.h rsa_oaep.c |
178 | rsa_pk1.o: ../../e_os.h ../../include/openssl/asn1.h | 173 | rsa_pk1.o: ../../e_os.h ../../include/openssl/asn1.h |
179 | rsa_pk1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 174 | rsa_pk1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
@@ -184,68 +179,43 @@ rsa_pk1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
184 | rsa_pk1.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h | 179 | rsa_pk1.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h |
185 | rsa_pk1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 180 | rsa_pk1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
186 | rsa_pk1.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pk1.c | 181 | rsa_pk1.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pk1.c |
187 | rsa_pss.o: ../../e_os.h ../../include/openssl/aes.h | 182 | rsa_pss.o: ../../e_os.h ../../include/openssl/asn1.h |
188 | rsa_pss.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 183 | rsa_pss.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
189 | rsa_pss.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 184 | rsa_pss.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
190 | rsa_pss.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 185 | rsa_pss.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
191 | rsa_pss.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 186 | rsa_pss.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
192 | rsa_pss.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
193 | rsa_pss.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
194 | rsa_pss.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
195 | rsa_pss.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
196 | rsa_pss.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
197 | rsa_pss.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
198 | rsa_pss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 187 | rsa_pss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
199 | rsa_pss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 188 | rsa_pss.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
200 | rsa_pss.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h | 189 | rsa_pss.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h |
201 | rsa_pss.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
202 | rsa_pss.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
203 | rsa_pss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 190 | rsa_pss.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
204 | rsa_pss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 191 | rsa_pss.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
205 | rsa_pss.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | 192 | rsa_pss.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pss.c |
206 | rsa_pss.o: ../../include/openssl/ui_compat.h ../cryptlib.h rsa_pss.c | 193 | rsa_saos.o: ../../e_os.h ../../include/openssl/asn1.h |
207 | rsa_saos.o: ../../e_os.h ../../include/openssl/aes.h | 194 | rsa_saos.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
208 | rsa_saos.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 195 | rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
209 | rsa_saos.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 196 | rsa_saos.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
210 | rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 197 | rsa_saos.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h |
211 | rsa_saos.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
212 | rsa_saos.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
213 | rsa_saos.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
214 | rsa_saos.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 198 | rsa_saos.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
215 | rsa_saos.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 199 | rsa_saos.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
216 | rsa_saos.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 200 | rsa_saos.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
217 | rsa_saos.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
218 | rsa_saos.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
219 | rsa_saos.o: ../../include/openssl/opensslconf.h | ||
220 | rsa_saos.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 201 | rsa_saos.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
221 | rsa_saos.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 202 | rsa_saos.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
222 | rsa_saos.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
223 | rsa_saos.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
224 | rsa_saos.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 203 | rsa_saos.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
225 | rsa_saos.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 204 | rsa_saos.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
226 | rsa_saos.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
227 | rsa_saos.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 205 | rsa_saos.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
228 | rsa_saos.o: ../cryptlib.h rsa_saos.c | 206 | rsa_saos.o: ../cryptlib.h rsa_saos.c |
229 | rsa_sign.o: ../../e_os.h ../../include/openssl/aes.h | 207 | rsa_sign.o: ../../e_os.h ../../include/openssl/asn1.h |
230 | rsa_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 208 | rsa_sign.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
231 | rsa_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 209 | rsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
232 | rsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 210 | rsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
233 | rsa_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 211 | rsa_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h |
234 | rsa_sign.o: ../../include/openssl/des_old.h ../../include/openssl/dh.h | ||
235 | rsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | ||
236 | rsa_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 212 | rsa_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
237 | rsa_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 213 | rsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
238 | rsa_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 214 | rsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
239 | rsa_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
240 | rsa_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
241 | rsa_sign.o: ../../include/openssl/opensslconf.h | ||
242 | rsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 215 | rsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
243 | rsa_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 216 | rsa_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
244 | rsa_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
245 | rsa_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
246 | rsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 217 | rsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
247 | rsa_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 218 | rsa_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
248 | rsa_sign.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | ||
249 | rsa_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 219 | rsa_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
250 | rsa_sign.o: ../cryptlib.h rsa_sign.c | 220 | rsa_sign.o: ../cryptlib.h rsa_sign.c |
251 | rsa_ssl.o: ../../e_os.h ../../include/openssl/asn1.h | 221 | rsa_ssl.o: ../../e_os.h ../../include/openssl/asn1.h |
diff --git a/src/lib/libcrypto/rsa/rsa_null.c b/src/lib/libcrypto/rsa/rsa_null.c index 64057fbdcf..491572c82b 100644 --- a/src/lib/libcrypto/rsa/rsa_null.c +++ b/src/lib/libcrypto/rsa/rsa_null.c | |||
@@ -94,6 +94,9 @@ static RSA_METHOD rsa_null_meth={ | |||
94 | RSA_null_finish, | 94 | RSA_null_finish, |
95 | 0, | 95 | 0, |
96 | NULL, | 96 | NULL, |
97 | NULL, | ||
98 | NULL, | ||
99 | NULL | ||
97 | }; | 100 | }; |
98 | 101 | ||
99 | const RSA_METHOD *RSA_null_method(void) | 102 | const RSA_METHOD *RSA_null_method(void) |
@@ -104,35 +107,35 @@ const RSA_METHOD *RSA_null_method(void) | |||
104 | static int RSA_null_public_encrypt(int flen, const unsigned char *from, | 107 | static int RSA_null_public_encrypt(int flen, const unsigned char *from, |
105 | unsigned char *to, RSA *rsa, int padding) | 108 | unsigned char *to, RSA *rsa, int padding) |
106 | { | 109 | { |
107 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 110 | RSAerr(RSA_F_RSA_NULL_PUBLIC_ENCRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
108 | return -1; | 111 | return -1; |
109 | } | 112 | } |
110 | 113 | ||
111 | static int RSA_null_private_encrypt(int flen, const unsigned char *from, | 114 | static int RSA_null_private_encrypt(int flen, const unsigned char *from, |
112 | unsigned char *to, RSA *rsa, int padding) | 115 | unsigned char *to, RSA *rsa, int padding) |
113 | { | 116 | { |
114 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 117 | RSAerr(RSA_F_RSA_NULL_PRIVATE_ENCRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
115 | return -1; | 118 | return -1; |
116 | } | 119 | } |
117 | 120 | ||
118 | static int RSA_null_private_decrypt(int flen, const unsigned char *from, | 121 | static int RSA_null_private_decrypt(int flen, const unsigned char *from, |
119 | unsigned char *to, RSA *rsa, int padding) | 122 | unsigned char *to, RSA *rsa, int padding) |
120 | { | 123 | { |
121 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 124 | RSAerr(RSA_F_RSA_NULL_PRIVATE_DECRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
122 | return -1; | 125 | return -1; |
123 | } | 126 | } |
124 | 127 | ||
125 | static int RSA_null_public_decrypt(int flen, const unsigned char *from, | 128 | static int RSA_null_public_decrypt(int flen, const unsigned char *from, |
126 | unsigned char *to, RSA *rsa, int padding) | 129 | unsigned char *to, RSA *rsa, int padding) |
127 | { | 130 | { |
128 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 131 | RSAerr(RSA_F_RSA_NULL_PUBLIC_DECRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
129 | return -1; | 132 | return -1; |
130 | } | 133 | } |
131 | 134 | ||
132 | #if 0 /* not currently used */ | 135 | #if 0 /* not currently used */ |
133 | static int RSA_null_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) | 136 | static int RSA_null_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) |
134 | { | 137 | { |
135 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 138 | ...err(RSA_F_RSA_NULL_MOD_EXP, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
136 | return -1; | 139 | return -1; |
137 | } | 140 | } |
138 | #endif | 141 | #endif |
@@ -146,5 +149,3 @@ static int RSA_null_finish(RSA *rsa) | |||
146 | { | 149 | { |
147 | return(1); | 150 | return(1); |
148 | } | 151 | } |
149 | |||
150 | |||
diff --git a/src/lib/libcrypto/rsa/rsa_test.c b/src/lib/libcrypto/rsa/rsa_test.c index 218bb2a39b..4080de8bcf 100644 --- a/src/lib/libcrypto/rsa/rsa_test.c +++ b/src/lib/libcrypto/rsa/rsa_test.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <openssl/crypto.h> | 8 | #include <openssl/crypto.h> |
9 | #include <openssl/err.h> | 9 | #include <openssl/err.h> |
10 | #include <openssl/rand.h> | 10 | #include <openssl/rand.h> |
11 | #include <openssl/bn.h> | ||
11 | #ifdef OPENSSL_NO_RSA | 12 | #ifdef OPENSSL_NO_RSA |
12 | int main(int argc, char *argv[]) | 13 | int main(int argc, char *argv[]) |
13 | { | 14 | { |
@@ -218,6 +219,7 @@ int main(int argc, char *argv[]) | |||
218 | int plen; | 219 | int plen; |
219 | int clen = 0; | 220 | int clen = 0; |
220 | int num; | 221 | int num; |
222 | int n; | ||
221 | 223 | ||
222 | CRYPTO_malloc_debug_init(); | 224 | CRYPTO_malloc_debug_init(); |
223 | CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); | 225 | CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); |
@@ -241,7 +243,7 @@ int main(int argc, char *argv[]) | |||
241 | clen = key3(key, ctext_ex); | 243 | clen = key3(key, ctext_ex); |
242 | break; | 244 | break; |
243 | } | 245 | } |
244 | if (v/3 > 1) key->flags |= RSA_FLAG_NO_EXP_CONSTTIME; | 246 | if (v/3 >= 1) key->flags |= RSA_FLAG_NO_CONSTTIME; |
245 | 247 | ||
246 | num = RSA_public_encrypt(plen, ptext_ex, ctext, key, | 248 | num = RSA_public_encrypt(plen, ptext_ex, ctext, key, |
247 | RSA_PKCS1_PADDING); | 249 | RSA_PKCS1_PADDING); |
@@ -277,7 +279,7 @@ int main(int argc, char *argv[]) | |||
277 | err=1; | 279 | err=1; |
278 | goto next; | 280 | goto next; |
279 | } | 281 | } |
280 | 282 | ||
281 | num = RSA_private_decrypt(num, ctext, ptext, key, | 283 | num = RSA_private_decrypt(num, ctext, ptext, key, |
282 | RSA_PKCS1_OAEP_PADDING); | 284 | RSA_PKCS1_OAEP_PADDING); |
283 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) | 285 | if (num != plen || memcmp(ptext, ptext_ex, num) != 0) |
@@ -286,10 +288,7 @@ int main(int argc, char *argv[]) | |||
286 | err=1; | 288 | err=1; |
287 | } | 289 | } |
288 | else if (memcmp(ctext, ctext_ex, num) == 0) | 290 | else if (memcmp(ctext, ctext_ex, num) == 0) |
289 | { | ||
290 | printf("OAEP test vector %d passed!\n", v); | 291 | printf("OAEP test vector %d passed!\n", v); |
291 | goto next; | ||
292 | } | ||
293 | 292 | ||
294 | /* Different ciphertexts (rsa_oaep.c without -DPKCS_TESTVECT). | 293 | /* Different ciphertexts (rsa_oaep.c without -DPKCS_TESTVECT). |
295 | Try decrypting ctext_ex */ | 294 | Try decrypting ctext_ex */ |
@@ -304,6 +303,26 @@ int main(int argc, char *argv[]) | |||
304 | } | 303 | } |
305 | else | 304 | else |
306 | printf("OAEP encryption/decryption ok\n"); | 305 | printf("OAEP encryption/decryption ok\n"); |
306 | |||
307 | /* Try decrypting corrupted ciphertexts */ | ||
308 | for(n = 0 ; n < clen ; ++n) | ||
309 | { | ||
310 | int b; | ||
311 | unsigned char saved = ctext[n]; | ||
312 | for(b = 0 ; b < 256 ; ++b) | ||
313 | { | ||
314 | if(b == saved) | ||
315 | continue; | ||
316 | ctext[n] = b; | ||
317 | num = RSA_private_decrypt(num, ctext, ptext, key, | ||
318 | RSA_PKCS1_OAEP_PADDING); | ||
319 | if(num > 0) | ||
320 | { | ||
321 | printf("Corrupt data decrypted!\n"); | ||
322 | err = 1; | ||
323 | } | ||
324 | } | ||
325 | } | ||
307 | next: | 326 | next: |
308 | RSA_free(key); | 327 | RSA_free(key); |
309 | } | 328 | } |
@@ -313,6 +332,9 @@ int main(int argc, char *argv[]) | |||
313 | 332 | ||
314 | CRYPTO_mem_leaks_fp(stderr); | 333 | CRYPTO_mem_leaks_fp(stderr); |
315 | 334 | ||
335 | #ifdef OPENSSL_SYS_NETWARE | ||
336 | if (err) printf("ERROR: %d\n", err); | ||
337 | #endif | ||
316 | return err; | 338 | return err; |
317 | } | 339 | } |
318 | #endif | 340 | #endif |