diff options
Diffstat (limited to 'src/lib/libcrypto/asn1')
68 files changed, 6495 insertions, 4389 deletions
diff --git a/src/lib/libcrypto/asn1/Makefile.ssl b/src/lib/libcrypto/asn1/Makefile.ssl index dace5be2bc..b423419ba3 100644 --- a/src/lib/libcrypto/asn1/Makefile.ssl +++ b/src/lib/libcrypto/asn1/Makefile.ssl | |||
@@ -5,13 +5,14 @@ | |||
5 | DIR= asn1 | 5 | DIR= asn1 |
6 | TOP= ../.. | 6 | TOP= ../.. |
7 | CC= cc | 7 | CC= cc |
8 | INCLUDES= -I.. -I../../include | 8 | INCLUDES= -I.. -I$(TOP) -I../../include |
9 | CFLAG=-g | 9 | CFLAG=-g |
10 | INSTALL_PREFIX= | 10 | INSTALL_PREFIX= |
11 | OPENSSLDIR= /usr/local/ssl | 11 | OPENSSLDIR= /usr/local/ssl |
12 | INSTALLTOP=/usr/local/ssl | 12 | INSTALLTOP=/usr/local/ssl |
13 | MAKE= make -f Makefile.ssl | 13 | MAKE= make -f Makefile.ssl |
14 | MAKEDEPEND= $(TOP)/util/domd $(TOP) | 14 | MAKEDEPPROG= makedepend |
15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
15 | MAKEFILE= Makefile.ssl | 16 | MAKEFILE= Makefile.ssl |
16 | AR= ar r | 17 | AR= ar r |
17 | 18 | ||
@@ -23,39 +24,33 @@ APPS= | |||
23 | 24 | ||
24 | LIB=$(TOP)/libcrypto.a | 25 | LIB=$(TOP)/libcrypto.a |
25 | LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \ | 26 | LIBSRC= a_object.c a_bitstr.c a_utctm.c a_gentm.c a_time.c a_int.c a_octet.c \ |
26 | a_null.c a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c a_bmp.c \ | 27 | a_print.c a_type.c a_set.c a_dup.c a_d2i_fp.c a_i2d_fp.c \ |
27 | a_enum.c a_vis.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c \ | 28 | a_enum.c a_utf8.c a_sign.c a_digest.c a_verify.c a_mbstr.c a_strex.c \ |
28 | x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c \ | 29 | x_algor.c x_val.c x_pubkey.c x_sig.c x_req.c x_attrib.c x_bignum.c \ |
29 | x_name.c x_cinf.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c \ | 30 | x_long.c x_name.c x_x509.c x_x509a.c x_crl.c x_info.c x_spki.c nsseq.c \ |
30 | d2i_r_pr.c i2d_r_pr.c d2i_r_pu.c i2d_r_pu.c \ | ||
31 | d2i_s_pr.c i2d_s_pr.c d2i_s_pu.c i2d_s_pu.c \ | ||
32 | d2i_pu.c d2i_pr.c i2d_pu.c i2d_pr.c\ | 31 | d2i_pu.c d2i_pr.c i2d_pu.c i2d_pr.c\ |
33 | t_req.c t_x509.c t_x509a.c t_crl.c t_pkey.c t_spki.c t_bitst.c \ | 32 | t_req.c t_x509.c t_x509a.c t_crl.c t_pkey.c t_spki.c t_bitst.c \ |
34 | p7_i_s.c p7_signi.c p7_signd.c p7_recip.c p7_enc_c.c p7_evp.c \ | 33 | tasn_new.c tasn_fre.c tasn_enc.c tasn_dec.c tasn_utl.c tasn_typ.c \ |
35 | p7_dgst.c p7_s_e.c p7_enc.c p7_lib.c \ | 34 | f_int.c f_string.c n_pkey.c \ |
36 | f_int.c f_string.c i2d_dhp.c i2d_dsap.c d2i_dhp.c d2i_dsap.c n_pkey.c \ | ||
37 | f_enum.c a_hdr.c x_pkey.c a_bool.c x_exten.c \ | 35 | f_enum.c a_hdr.c x_pkey.c a_bool.c x_exten.c \ |
38 | asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c a_strnid.c \ | 36 | asn1_par.c asn1_lib.c asn1_err.c a_meth.c a_bytes.c a_strnid.c \ |
39 | evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c | 37 | evp_asn1.c asn_pack.c p5_pbe.c p5_pbev2.c p8_pkey.c asn_moid.c |
40 | LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \ | 38 | LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \ |
41 | a_null.o a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o a_bmp.o \ | 39 | a_print.o a_type.o a_set.o a_dup.o a_d2i_fp.o a_i2d_fp.o \ |
42 | a_enum.o a_vis.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o a_strex.o \ | 40 | a_enum.o a_utf8.o a_sign.o a_digest.o a_verify.o a_mbstr.o a_strex.o \ |
43 | x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o \ | 41 | x_algor.o x_val.o x_pubkey.o x_sig.o x_req.o x_attrib.o x_bignum.o \ |
44 | x_name.o x_cinf.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o \ | 42 | x_long.o x_name.o x_x509.o x_x509a.o x_crl.o x_info.o x_spki.o nsseq.o \ |
45 | d2i_r_pr.o i2d_r_pr.o d2i_r_pu.o i2d_r_pu.o \ | ||
46 | d2i_s_pr.o i2d_s_pr.o d2i_s_pu.o i2d_s_pu.o \ | ||
47 | d2i_pu.o d2i_pr.o i2d_pu.o i2d_pr.o \ | 43 | d2i_pu.o d2i_pr.o i2d_pu.o i2d_pr.o \ |
48 | t_req.o t_x509.o t_x509a.o t_crl.o t_pkey.o t_spki.o t_bitst.o \ | 44 | t_req.o t_x509.o t_x509a.o t_crl.o t_pkey.o t_spki.o t_bitst.o \ |
49 | p7_i_s.o p7_signi.o p7_signd.o p7_recip.o p7_enc_c.o p7_evp.o \ | 45 | tasn_new.o tasn_fre.o tasn_enc.o tasn_dec.o tasn_utl.o tasn_typ.o \ |
50 | p7_dgst.o p7_s_e.o p7_enc.o p7_lib.o \ | 46 | f_int.o f_string.o n_pkey.o \ |
51 | f_int.o f_string.o i2d_dhp.o i2d_dsap.o d2i_dhp.o d2i_dsap.o n_pkey.o \ | ||
52 | f_enum.o a_hdr.o x_pkey.o a_bool.o x_exten.o \ | 47 | f_enum.o a_hdr.o x_pkey.o a_bool.o x_exten.o \ |
53 | asn1_par.o asn1_lib.o asn1_err.o a_meth.o a_bytes.o a_strnid.o \ | 48 | asn1_par.o asn1_lib.o asn1_err.o a_meth.o a_bytes.o a_strnid.o \ |
54 | evp_asn1.o asn_pack.o p5_pbe.o p5_pbev2.o p8_pkey.o | 49 | evp_asn1.o asn_pack.o p5_pbe.o p5_pbev2.o p8_pkey.o asn_moid.o |
55 | 50 | ||
56 | SRC= $(LIBSRC) | 51 | SRC= $(LIBSRC) |
57 | 52 | ||
58 | EXHEADER= asn1.h asn1_mac.h | 53 | EXHEADER= asn1.h asn1_mac.h asn1t.h |
59 | HEADER= $(EXHEADER) | 54 | HEADER= $(EXHEADER) |
60 | 55 | ||
61 | ALL= $(GENERAL) $(SRC) $(HEADER) | 56 | ALL= $(GENERAL) $(SRC) $(HEADER) |
@@ -75,8 +70,7 @@ all: lib | |||
75 | 70 | ||
76 | lib: $(LIBOBJ) | 71 | lib: $(LIBOBJ) |
77 | $(AR) $(LIB) $(LIBOBJ) | 72 | $(AR) $(LIB) $(LIBOBJ) |
78 | @echo You may get an error following this line. Please ignore. | 73 | $(RANLIB) $(LIB) || echo Never mind. |
79 | - $(RANLIB) $(LIB) | ||
80 | @touch lib | 74 | @touch lib |
81 | 75 | ||
82 | files: | 76 | files: |
@@ -116,1231 +110,777 @@ clean: | |||
116 | 110 | ||
117 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 111 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
118 | 112 | ||
119 | a_bitstr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 113 | a_bitstr.o: ../../e_os.h ../../include/openssl/asn1.h |
120 | a_bitstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 114 | a_bitstr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
121 | a_bitstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 115 | a_bitstr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
122 | a_bitstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 116 | a_bitstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
123 | a_bitstr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 117 | a_bitstr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
124 | a_bitstr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 118 | a_bitstr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
125 | a_bitstr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 119 | a_bitstr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
126 | a_bitstr.o: ../cryptlib.h | 120 | a_bitstr.o: ../../include/openssl/symhacks.h ../cryptlib.h a_bitstr.c |
127 | a_bmp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 121 | a_bool.o: ../../e_os.h ../../include/openssl/asn1.h |
128 | a_bmp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 122 | a_bool.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
129 | a_bmp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | ||
130 | a_bmp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
131 | a_bmp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
132 | a_bmp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
133 | a_bmp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
134 | a_bmp.o: ../cryptlib.h | ||
135 | a_bool.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
136 | a_bool.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 123 | a_bool.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
137 | a_bool.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 124 | a_bool.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
138 | a_bool.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 125 | a_bool.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
139 | a_bool.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 126 | a_bool.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
140 | a_bool.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 127 | a_bool.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
141 | a_bool.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 128 | a_bool.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
142 | a_bool.o: ../cryptlib.h | 129 | a_bool.o: ../cryptlib.h a_bool.c |
143 | a_bytes.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 130 | a_bytes.o: ../../e_os.h ../../include/openssl/asn1.h |
144 | a_bytes.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 131 | a_bytes.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
145 | a_bytes.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 132 | a_bytes.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
146 | a_bytes.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 133 | a_bytes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
147 | a_bytes.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 134 | a_bytes.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
148 | a_bytes.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 135 | a_bytes.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
149 | a_bytes.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 136 | a_bytes.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
150 | a_bytes.o: ../../include/openssl/symhacks.h ../cryptlib.h | 137 | a_bytes.o: ../../include/openssl/symhacks.h ../cryptlib.h a_bytes.c |
151 | a_d2i_fp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 138 | a_d2i_fp.o: ../../e_os.h ../../include/openssl/asn1.h |
152 | a_d2i_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 139 | a_d2i_fp.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h |
153 | a_d2i_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 140 | a_d2i_fp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
154 | a_d2i_fp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 141 | a_d2i_fp.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
155 | a_d2i_fp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 142 | a_d2i_fp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
156 | a_d2i_fp.o: ../../include/openssl/opensslconf.h | 143 | a_d2i_fp.o: ../../include/openssl/opensslconf.h |
157 | a_d2i_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 144 | a_d2i_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
158 | a_d2i_fp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 145 | a_d2i_fp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
159 | a_d2i_fp.o: ../cryptlib.h | 146 | a_d2i_fp.o: ../../include/openssl/symhacks.h ../cryptlib.h a_d2i_fp.c |
160 | a_digest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 147 | a_digest.o: ../../e_os.h ../../include/openssl/asn1.h |
161 | a_digest.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 148 | a_digest.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
162 | a_digest.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 149 | a_digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
163 | a_digest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
164 | a_digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 150 | a_digest.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
165 | a_digest.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 151 | a_digest.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
166 | a_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 152 | a_digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
167 | a_digest.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
168 | a_digest.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
169 | a_digest.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
170 | a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 153 | a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
171 | a_digest.o: ../../include/openssl/opensslconf.h | 154 | a_digest.o: ../../include/openssl/opensslconf.h |
172 | a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 155 | a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
173 | a_digest.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 156 | a_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
174 | a_digest.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 157 | a_digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
175 | a_digest.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 158 | a_digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
176 | a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 159 | a_digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
177 | a_digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 160 | a_digest.o: ../cryptlib.h a_digest.c |
178 | a_digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 161 | a_dup.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
179 | a_dup.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 162 | a_dup.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
180 | a_dup.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 163 | a_dup.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
181 | a_dup.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
182 | a_dup.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
183 | a_dup.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 164 | a_dup.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
184 | a_dup.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 165 | a_dup.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
185 | a_dup.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 166 | a_dup.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
186 | a_dup.o: ../../include/openssl/symhacks.h ../cryptlib.h | 167 | a_dup.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
187 | a_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 168 | a_dup.o: ../cryptlib.h a_dup.c |
169 | a_enum.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
188 | a_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 170 | a_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
189 | a_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 171 | a_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
190 | a_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 172 | a_enum.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
191 | a_enum.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 173 | a_enum.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
192 | a_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 174 | a_enum.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
193 | a_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 175 | a_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
194 | a_enum.o: ../cryptlib.h | 176 | a_enum.o: ../cryptlib.h a_enum.c |
195 | a_gentm.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 177 | a_gentm.o: ../../e_os.h ../../include/openssl/asn1.h |
196 | a_gentm.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 178 | a_gentm.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
197 | a_gentm.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 179 | a_gentm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
198 | a_gentm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 180 | a_gentm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
199 | a_gentm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 181 | a_gentm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
200 | a_gentm.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 182 | a_gentm.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
201 | a_gentm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 183 | a_gentm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
202 | a_gentm.o: ../cryptlib.h | 184 | a_gentm.o: ../../include/openssl/symhacks.h ../cryptlib.h ../o_time.h a_gentm.c |
203 | a_hdr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 185 | a_hdr.o: ../../e_os.h ../../include/openssl/asn1.h |
204 | a_hdr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 186 | a_hdr.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h |
205 | a_hdr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 187 | a_hdr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
206 | a_hdr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 188 | a_hdr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
207 | a_hdr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 189 | a_hdr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
208 | a_hdr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 190 | a_hdr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
209 | a_hdr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 191 | a_hdr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
210 | a_hdr.o: ../../include/openssl/symhacks.h ../cryptlib.h | 192 | a_hdr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
211 | a_i2d_fp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 193 | a_hdr.o: ../cryptlib.h a_hdr.c |
194 | a_i2d_fp.o: ../../e_os.h ../../include/openssl/asn1.h | ||
212 | a_i2d_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 195 | a_i2d_fp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
213 | a_i2d_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 196 | a_i2d_fp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
214 | a_i2d_fp.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 197 | a_i2d_fp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
215 | a_i2d_fp.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 198 | a_i2d_fp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
216 | a_i2d_fp.o: ../../include/openssl/opensslconf.h | 199 | a_i2d_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
217 | a_i2d_fp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 200 | a_i2d_fp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
218 | a_i2d_fp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 201 | a_i2d_fp.o: ../../include/openssl/symhacks.h ../cryptlib.h a_i2d_fp.c |
219 | a_i2d_fp.o: ../cryptlib.h | 202 | a_int.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
220 | a_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
221 | a_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 203 | a_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
222 | a_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 204 | a_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
223 | a_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 205 | a_int.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
224 | a_int.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 206 | a_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
225 | a_int.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 207 | a_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
226 | a_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 208 | a_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
227 | a_int.o: ../cryptlib.h | 209 | a_int.o: ../cryptlib.h a_int.c |
228 | a_mbstr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 210 | a_mbstr.o: ../../e_os.h ../../include/openssl/asn1.h |
229 | a_mbstr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 211 | a_mbstr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
230 | a_mbstr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 212 | a_mbstr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
231 | a_mbstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 213 | a_mbstr.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
232 | a_mbstr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 214 | a_mbstr.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
233 | a_mbstr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 215 | a_mbstr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
234 | a_mbstr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 216 | a_mbstr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
235 | a_mbstr.o: ../cryptlib.h | 217 | a_mbstr.o: ../../include/openssl/symhacks.h ../cryptlib.h a_mbstr.c |
236 | a_meth.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 218 | a_meth.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
237 | a_meth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 219 | a_meth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
238 | a_meth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 220 | a_meth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
239 | a_meth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 221 | a_meth.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
240 | a_meth.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 222 | a_meth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
241 | a_meth.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 223 | a_meth.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
242 | a_meth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 224 | a_meth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
243 | a_meth.o: ../cryptlib.h | 225 | a_meth.o: ../cryptlib.h a_meth.c |
244 | a_null.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 226 | a_object.o: ../../e_os.h ../../include/openssl/asn1.h |
245 | a_null.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 227 | a_object.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
246 | a_null.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 228 | a_object.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
247 | a_null.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
248 | a_null.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
249 | a_null.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
250 | a_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
251 | a_null.o: ../cryptlib.h | ||
252 | a_object.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
253 | a_object.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
254 | a_object.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | ||
255 | a_object.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 229 | a_object.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
256 | a_object.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | 230 | a_object.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
257 | a_object.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 231 | a_object.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
258 | a_object.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 232 | a_object.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
259 | a_object.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 233 | a_object.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
260 | a_object.o: ../cryptlib.h | 234 | a_object.o: ../../include/openssl/symhacks.h ../cryptlib.h a_object.c |
261 | a_octet.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 235 | a_octet.o: ../../e_os.h ../../include/openssl/asn1.h |
262 | a_octet.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 236 | a_octet.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
263 | a_octet.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 237 | a_octet.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
264 | a_octet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 238 | a_octet.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
265 | a_octet.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 239 | a_octet.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
266 | a_octet.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 240 | a_octet.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
267 | a_octet.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 241 | a_octet.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
268 | a_octet.o: ../cryptlib.h | 242 | a_octet.o: ../../include/openssl/symhacks.h ../cryptlib.h a_octet.c |
269 | a_print.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 243 | a_print.o: ../../e_os.h ../../include/openssl/asn1.h |
270 | a_print.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 244 | a_print.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
271 | a_print.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 245 | a_print.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
272 | a_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 246 | a_print.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
273 | a_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 247 | a_print.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
274 | a_print.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 248 | a_print.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
275 | a_print.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 249 | a_print.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
276 | a_print.o: ../cryptlib.h | 250 | a_print.o: ../../include/openssl/symhacks.h ../cryptlib.h a_print.c |
277 | a_set.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 251 | a_set.o: ../../e_os.h ../../include/openssl/asn1.h |
278 | a_set.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 252 | a_set.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h |
279 | a_set.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 253 | a_set.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
280 | a_set.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 254 | a_set.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
281 | a_set.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 255 | a_set.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
282 | a_set.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 256 | a_set.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
283 | a_set.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 257 | a_set.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
284 | a_set.o: ../../include/openssl/symhacks.h ../cryptlib.h | 258 | a_set.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
285 | a_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 259 | a_set.o: ../cryptlib.h a_set.c |
286 | a_sign.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 260 | a_sign.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
287 | a_sign.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 261 | a_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
288 | a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 262 | a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
289 | a_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 263 | a_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
290 | a_sign.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
291 | a_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 264 | a_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
292 | a_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 265 | a_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
293 | a_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 266 | a_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
294 | a_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 267 | a_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
295 | a_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 268 | a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
296 | a_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
297 | a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
298 | a_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
299 | a_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
300 | a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 269 | a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
301 | a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 270 | a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
302 | a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 271 | a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
303 | a_sign.o: ../cryptlib.h | 272 | a_sign.o: ../cryptlib.h a_sign.c |
304 | a_strex.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 273 | a_strex.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
305 | a_strex.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 274 | a_strex.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
306 | a_strex.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 275 | a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
307 | a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 276 | a_strex.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
308 | a_strex.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 277 | a_strex.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
309 | a_strex.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h | ||
310 | a_strex.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
311 | a_strex.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
312 | a_strex.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
313 | a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 278 | a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
314 | a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 279 | a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
315 | a_strex.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 280 | a_strex.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
316 | a_strex.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 281 | a_strex.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
317 | a_strex.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 282 | a_strex.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
318 | a_strex.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 283 | a_strex.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
319 | a_strex.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 284 | a_strex.o: ../../include/openssl/x509_vfy.h a_strex.c charmap.h |
320 | a_strex.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 285 | a_strnid.o: ../../e_os.h ../../include/openssl/asn1.h |
321 | a_strex.o: charmap.h | 286 | a_strnid.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
322 | a_strnid.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 287 | a_strnid.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
323 | a_strnid.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
324 | a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | ||
325 | a_strnid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 288 | a_strnid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
326 | a_strnid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | 289 | a_strnid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
327 | a_strnid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 290 | a_strnid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
328 | a_strnid.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 291 | a_strnid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
329 | a_strnid.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 292 | a_strnid.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
330 | a_strnid.o: ../cryptlib.h | 293 | a_strnid.o: ../../include/openssl/symhacks.h ../cryptlib.h a_strnid.c |
331 | a_time.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 294 | a_time.o: ../../e_os.h ../../include/openssl/asn1.h |
295 | a_time.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
332 | a_time.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 296 | a_time.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
333 | a_time.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 297 | a_time.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
334 | a_time.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 298 | a_time.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
335 | a_time.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 299 | a_time.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
336 | a_time.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 300 | a_time.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
337 | a_time.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 301 | a_time.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
338 | a_time.o: ../cryptlib.h | 302 | a_time.o: ../cryptlib.h ../o_time.h a_time.c |
339 | a_type.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 303 | a_type.o: ../../e_os.h ../../include/openssl/asn1.h |
340 | a_type.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 304 | a_type.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
341 | a_type.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 305 | a_type.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
342 | a_type.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 306 | a_type.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
343 | a_type.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 307 | a_type.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
344 | a_type.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 308 | a_type.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
345 | a_type.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 309 | a_type.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
346 | a_type.o: ../../include/openssl/symhacks.h ../cryptlib.h | 310 | a_type.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
347 | a_utctm.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 311 | a_type.o: ../cryptlib.h a_type.c |
348 | a_utctm.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 312 | a_utctm.o: ../../e_os.h ../../include/openssl/asn1.h |
349 | a_utctm.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 313 | a_utctm.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
314 | a_utctm.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
350 | a_utctm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 315 | a_utctm.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
351 | a_utctm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 316 | a_utctm.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
352 | a_utctm.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 317 | a_utctm.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
353 | a_utctm.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 318 | a_utctm.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
354 | a_utctm.o: ../cryptlib.h | 319 | a_utctm.o: ../../include/openssl/symhacks.h ../cryptlib.h ../o_time.h a_utctm.c |
355 | a_utf8.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 320 | a_utf8.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
356 | a_utf8.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 321 | a_utf8.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
357 | a_utf8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 322 | a_utf8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
358 | a_utf8.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 323 | a_utf8.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
359 | a_utf8.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 324 | a_utf8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
360 | a_utf8.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 325 | a_utf8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
361 | a_utf8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 326 | a_utf8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
362 | a_utf8.o: ../cryptlib.h | 327 | a_utf8.o: ../cryptlib.h a_utf8.c |
363 | a_verify.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 328 | a_verify.o: ../../e_os.h ../../include/openssl/asn1.h |
364 | a_verify.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 329 | a_verify.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
365 | a_verify.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 330 | a_verify.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
366 | a_verify.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
367 | a_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 331 | a_verify.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
368 | a_verify.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 332 | a_verify.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
369 | a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 333 | a_verify.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
370 | a_verify.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
371 | a_verify.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
372 | a_verify.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
373 | a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 334 | a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
374 | a_verify.o: ../../include/openssl/opensslconf.h | 335 | a_verify.o: ../../include/openssl/opensslconf.h |
375 | a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 336 | a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
376 | a_verify.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 337 | a_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
377 | a_verify.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 338 | a_verify.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
378 | a_verify.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 339 | a_verify.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
379 | a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 340 | a_verify.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
380 | a_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 341 | a_verify.o: ../cryptlib.h a_verify.c |
381 | a_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
382 | a_vis.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
383 | a_vis.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
384 | a_vis.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | ||
385 | a_vis.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
386 | a_vis.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
387 | a_vis.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
388 | a_vis.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
389 | a_vis.o: ../cryptlib.h | ||
390 | asn1_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 342 | asn1_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
391 | asn1_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 343 | asn1_err.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
392 | asn1_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 344 | asn1_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
393 | asn1_err.o: ../../include/openssl/opensslconf.h | 345 | asn1_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
394 | asn1_err.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 346 | asn1_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
395 | asn1_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 347 | asn1_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
396 | asn1_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 348 | asn1_err.o: ../../include/openssl/symhacks.h asn1_err.c |
349 | asn1_lib.o: ../../e_os.h ../../include/openssl/asn1.h | ||
397 | asn1_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 350 | asn1_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
398 | asn1_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 351 | asn1_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
399 | asn1_lib.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 352 | asn1_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
400 | asn1_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 353 | asn1_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
401 | asn1_lib.o: ../../include/openssl/opensslconf.h | 354 | asn1_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
402 | asn1_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 355 | asn1_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
403 | asn1_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 356 | asn1_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h asn1_lib.c |
404 | asn1_lib.o: ../cryptlib.h | 357 | asn1_par.o: ../../e_os.h ../../include/openssl/asn1.h |
405 | asn1_par.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 358 | asn1_par.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
406 | asn1_par.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 359 | asn1_par.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
407 | asn1_par.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | ||
408 | asn1_par.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 360 | asn1_par.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
409 | asn1_par.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | 361 | asn1_par.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
410 | asn1_par.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 362 | asn1_par.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
411 | asn1_par.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 363 | asn1_par.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
412 | asn1_par.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 364 | asn1_par.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
413 | asn1_par.o: ../cryptlib.h | 365 | asn1_par.o: ../../include/openssl/symhacks.h ../cryptlib.h asn1_par.c |
414 | asn_pack.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 366 | asn_moid.o: ../../e_os.h ../../include/openssl/asn1.h |
415 | asn_pack.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 367 | asn_moid.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
416 | asn_pack.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 368 | asn_moid.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h |
369 | asn_moid.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h | ||
370 | asn_moid.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h | ||
371 | asn_moid.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
372 | asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
373 | asn_moid.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
374 | asn_moid.o: ../../include/openssl/opensslconf.h | ||
375 | asn_moid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
376 | asn_moid.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | ||
377 | asn_moid.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
378 | asn_moid.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
379 | asn_moid.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
380 | asn_moid.o: ../cryptlib.h asn_moid.c | ||
381 | asn_pack.o: ../../e_os.h ../../include/openssl/asn1.h | ||
382 | asn_pack.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
383 | asn_pack.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
417 | asn_pack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 384 | asn_pack.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
418 | asn_pack.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 385 | asn_pack.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
419 | asn_pack.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 386 | asn_pack.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
420 | asn_pack.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 387 | asn_pack.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
421 | asn_pack.o: ../cryptlib.h | 388 | asn_pack.o: ../../include/openssl/symhacks.h ../cryptlib.h asn_pack.c |
422 | d2i_dhp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 389 | d2i_pr.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
423 | d2i_dhp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 390 | d2i_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
424 | d2i_dhp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 391 | d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
425 | d2i_dhp.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h | 392 | d2i_pr.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
426 | d2i_dhp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
427 | d2i_dhp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
428 | d2i_dhp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
429 | d2i_dhp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
430 | d2i_dhp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
431 | d2i_dhp.o: ../cryptlib.h | ||
432 | d2i_dsap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
433 | d2i_dsap.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
434 | d2i_dsap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
435 | d2i_dsap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
436 | d2i_dsap.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
437 | d2i_dsap.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
438 | d2i_dsap.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
439 | d2i_dsap.o: ../../include/openssl/opensslconf.h | ||
440 | d2i_dsap.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
441 | d2i_dsap.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
442 | d2i_dsap.o: ../cryptlib.h | ||
443 | d2i_pr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
444 | d2i_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
445 | d2i_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
446 | d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
447 | d2i_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
448 | d2i_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
449 | d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 393 | d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
450 | d2i_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 394 | d2i_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
451 | d2i_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 395 | d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
452 | d2i_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 396 | d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
453 | d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
454 | d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
455 | d2i_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
456 | d2i_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
457 | d2i_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 397 | d2i_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
458 | d2i_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 398 | d2i_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
459 | d2i_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h | 399 | d2i_pr.o: ../cryptlib.h d2i_pr.c |
460 | d2i_pu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 400 | d2i_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
461 | d2i_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 401 | d2i_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
462 | d2i_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 402 | d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
463 | d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 403 | d2i_pu.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
464 | d2i_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
465 | d2i_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
466 | d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 404 | d2i_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
467 | d2i_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 405 | d2i_pu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
468 | d2i_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 406 | d2i_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
469 | d2i_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 407 | d2i_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
470 | d2i_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
471 | d2i_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
472 | d2i_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
473 | d2i_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
474 | d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 408 | d2i_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
475 | d2i_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 409 | d2i_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
476 | d2i_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h | 410 | d2i_pu.o: ../cryptlib.h d2i_pu.c |
477 | d2i_r_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 411 | evp_asn1.o: ../../e_os.h ../../include/openssl/asn1.h |
478 | d2i_r_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 412 | evp_asn1.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h |
479 | d2i_r_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 413 | evp_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
480 | d2i_r_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 414 | evp_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
481 | d2i_r_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
482 | d2i_r_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
483 | d2i_r_pr.o: ../../include/openssl/opensslconf.h | ||
484 | d2i_r_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h | ||
485 | d2i_r_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
486 | d2i_r_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
487 | d2i_r_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
488 | d2i_r_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
489 | d2i_r_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
490 | d2i_r_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
491 | d2i_r_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
492 | d2i_r_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
493 | d2i_r_pu.o: ../../include/openssl/opensslconf.h | ||
494 | d2i_r_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h | ||
495 | d2i_r_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
496 | d2i_r_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
497 | d2i_s_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
498 | d2i_s_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
499 | d2i_s_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
500 | d2i_s_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
501 | d2i_s_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
502 | d2i_s_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
503 | d2i_s_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
504 | d2i_s_pr.o: ../../include/openssl/opensslconf.h | ||
505 | d2i_s_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
506 | d2i_s_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
507 | d2i_s_pr.o: ../cryptlib.h | ||
508 | d2i_s_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
509 | d2i_s_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
510 | d2i_s_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
511 | d2i_s_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
512 | d2i_s_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
513 | d2i_s_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
514 | d2i_s_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
515 | d2i_s_pu.o: ../../include/openssl/opensslconf.h | ||
516 | d2i_s_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
517 | d2i_s_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
518 | d2i_s_pu.o: ../cryptlib.h | ||
519 | evp_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
520 | evp_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
521 | evp_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
522 | evp_asn1.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
523 | evp_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 415 | evp_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
524 | evp_asn1.o: ../../include/openssl/opensslconf.h | 416 | evp_asn1.o: ../../include/openssl/opensslconf.h |
525 | evp_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 417 | evp_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
526 | evp_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 418 | evp_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
527 | evp_asn1.o: ../cryptlib.h | 419 | evp_asn1.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_asn1.c |
528 | f_enum.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 420 | f_enum.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
529 | f_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 421 | f_enum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
530 | f_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 422 | f_enum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
531 | f_enum.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 423 | f_enum.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
532 | f_enum.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 424 | f_enum.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
533 | f_enum.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 425 | f_enum.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
534 | f_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 426 | f_enum.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
535 | f_enum.o: ../cryptlib.h | 427 | f_enum.o: ../cryptlib.h f_enum.c |
536 | f_int.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 428 | f_int.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
537 | f_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 429 | f_int.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
538 | f_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 430 | f_int.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
539 | f_int.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 431 | f_int.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
540 | f_int.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 432 | f_int.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
541 | f_int.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 433 | f_int.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
542 | f_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 434 | f_int.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
543 | f_int.o: ../cryptlib.h | 435 | f_int.o: ../cryptlib.h f_int.c |
544 | f_string.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 436 | f_string.o: ../../e_os.h ../../include/openssl/asn1.h |
545 | f_string.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 437 | f_string.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
546 | f_string.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h | 438 | f_string.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
547 | f_string.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 439 | f_string.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
548 | f_string.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | 440 | f_string.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h |
549 | f_string.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | 441 | f_string.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
550 | f_string.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 442 | f_string.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
551 | f_string.o: ../cryptlib.h | 443 | f_string.o: ../../include/openssl/symhacks.h ../cryptlib.h f_string.c |
552 | i2d_dhp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 444 | i2d_pr.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
553 | i2d_dhp.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 445 | i2d_pr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
554 | i2d_dhp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 446 | i2d_pr.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
555 | i2d_dhp.o: ../../include/openssl/dh.h ../../include/openssl/e_os.h | 447 | i2d_pr.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
556 | i2d_dhp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
557 | i2d_dhp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
558 | i2d_dhp.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
559 | i2d_dhp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
560 | i2d_dhp.o: ../cryptlib.h | ||
561 | i2d_dsap.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
562 | i2d_dsap.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
563 | i2d_dsap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
564 | i2d_dsap.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
565 | i2d_dsap.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
566 | i2d_dsap.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
567 | i2d_dsap.o: ../../include/openssl/opensslconf.h | ||
568 | i2d_dsap.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
569 | i2d_dsap.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
570 | i2d_dsap.o: ../cryptlib.h | ||
571 | i2d_pr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
572 | i2d_pr.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
573 | i2d_pr.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
574 | i2d_pr.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
575 | i2d_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
576 | i2d_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
577 | i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 448 | i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
578 | i2d_pr.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 449 | i2d_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
579 | i2d_pr.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 450 | i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
580 | i2d_pr.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 451 | i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
581 | i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
582 | i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
583 | i2d_pr.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
584 | i2d_pr.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
585 | i2d_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 452 | i2d_pr.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
586 | i2d_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 453 | i2d_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
587 | i2d_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h | 454 | i2d_pr.o: ../cryptlib.h i2d_pr.c |
588 | i2d_pu.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 455 | i2d_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
589 | i2d_pu.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 456 | i2d_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
590 | i2d_pu.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 457 | i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
591 | i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | 458 | i2d_pu.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
592 | i2d_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
593 | i2d_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
594 | i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 459 | i2d_pu.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
595 | i2d_pu.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 460 | i2d_pu.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
596 | i2d_pu.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 461 | i2d_pu.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
597 | i2d_pu.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 462 | i2d_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
598 | i2d_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
599 | i2d_pu.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
600 | i2d_pu.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
601 | i2d_pu.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
602 | i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 463 | i2d_pu.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
603 | i2d_pu.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 464 | i2d_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
604 | i2d_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h | 465 | i2d_pu.o: ../cryptlib.h i2d_pu.c |
605 | i2d_r_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 466 | n_pkey.o: ../../e_os.h ../../include/openssl/asn1.h |
606 | i2d_r_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 467 | n_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/asn1t.h |
607 | i2d_r_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 468 | n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
608 | i2d_r_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 469 | n_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
609 | i2d_r_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 470 | n_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
610 | i2d_r_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
611 | i2d_r_pr.o: ../../include/openssl/opensslconf.h | ||
612 | i2d_r_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h | ||
613 | i2d_r_pr.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
614 | i2d_r_pr.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
615 | i2d_r_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
616 | i2d_r_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
617 | i2d_r_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
618 | i2d_r_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
619 | i2d_r_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
620 | i2d_r_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
621 | i2d_r_pu.o: ../../include/openssl/opensslconf.h | ||
622 | i2d_r_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/rsa.h | ||
623 | i2d_r_pu.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
624 | i2d_r_pu.o: ../../include/openssl/symhacks.h ../cryptlib.h | ||
625 | i2d_s_pr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
626 | i2d_s_pr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
627 | i2d_s_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
628 | i2d_s_pr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
629 | i2d_s_pr.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
630 | i2d_s_pr.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
631 | i2d_s_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
632 | i2d_s_pr.o: ../../include/openssl/opensslconf.h | ||
633 | i2d_s_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
634 | i2d_s_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
635 | i2d_s_pr.o: ../cryptlib.h | ||
636 | i2d_s_pu.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
637 | i2d_s_pu.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
638 | i2d_s_pu.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
639 | i2d_s_pu.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
640 | i2d_s_pu.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
641 | i2d_s_pu.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
642 | i2d_s_pu.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
643 | i2d_s_pu.o: ../../include/openssl/opensslconf.h | ||
644 | i2d_s_pu.o: ../../include/openssl/opensslv.h ../../include/openssl/safestack.h | ||
645 | i2d_s_pu.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
646 | i2d_s_pu.o: ../cryptlib.h | ||
647 | n_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
648 | n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
649 | n_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
650 | n_pkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
651 | n_pkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
652 | n_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
653 | n_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 471 | n_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
654 | n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | 472 | n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
655 | n_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | 473 | n_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
656 | n_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | 474 | n_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
657 | n_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | 475 | n_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
658 | n_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
659 | n_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
660 | n_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
661 | n_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
662 | n_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 476 | n_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
663 | n_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 477 | n_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
664 | n_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 478 | n_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
665 | n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 479 | n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h n_pkey.c |
666 | nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 480 | nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h |
667 | nsseq.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 481 | nsseq.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
668 | nsseq.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 482 | nsseq.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
669 | nsseq.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 483 | nsseq.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
670 | nsseq.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 484 | nsseq.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h |
671 | nsseq.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | 485 | nsseq.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
672 | nsseq.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 486 | nsseq.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
673 | nsseq.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 487 | nsseq.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
674 | nsseq.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 488 | nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
675 | nsseq.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
676 | nsseq.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
677 | nsseq.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
678 | nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
679 | nsseq.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
680 | nsseq.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
681 | nsseq.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 489 | nsseq.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
682 | nsseq.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 490 | nsseq.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
683 | nsseq.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 491 | nsseq.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h nsseq.c |
684 | p5_pbe.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 492 | p5_pbe.o: ../../e_os.h ../../include/openssl/asn1.h |
685 | p5_pbe.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 493 | p5_pbe.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
686 | p5_pbe.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 494 | p5_pbe.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
687 | p5_pbe.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 495 | p5_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
688 | p5_pbe.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 496 | p5_pbe.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
689 | p5_pbe.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 497 | p5_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
690 | p5_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 498 | p5_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
691 | p5_pbe.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
692 | p5_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
693 | p5_pbe.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
694 | p5_pbe.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
695 | p5_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 499 | p5_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
696 | p5_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 500 | p5_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
697 | p5_pbe.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | 501 | p5_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h |
698 | p5_pbe.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 502 | p5_pbe.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
699 | p5_pbe.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 503 | p5_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
700 | p5_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 504 | p5_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
701 | p5_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 505 | p5_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_pbe.c |
702 | p5_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 506 | p5_pbev2.o: ../../e_os.h ../../include/openssl/asn1.h |
703 | p5_pbe.o: ../cryptlib.h | 507 | p5_pbev2.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
704 | p5_pbev2.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
705 | p5_pbev2.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
706 | p5_pbev2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 508 | p5_pbev2.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
707 | p5_pbev2.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 509 | p5_pbev2.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
708 | p5_pbev2.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 510 | p5_pbev2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
709 | p5_pbev2.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 511 | p5_pbev2.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
710 | p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 512 | p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
711 | p5_pbev2.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
712 | p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
713 | p5_pbev2.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
714 | p5_pbev2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
715 | p5_pbev2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 513 | p5_pbev2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
716 | p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 514 | p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
717 | p5_pbev2.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h | 515 | p5_pbev2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h |
718 | p5_pbev2.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 516 | p5_pbev2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
719 | p5_pbev2.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 517 | p5_pbev2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
720 | p5_pbev2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 518 | p5_pbev2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
721 | p5_pbev2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 519 | p5_pbev2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_pbev2.c |
722 | p5_pbev2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 520 | p8_pkey.o: ../../e_os.h ../../include/openssl/asn1.h |
723 | p5_pbev2.o: ../cryptlib.h | 521 | p8_pkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
724 | p7_dgst.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
725 | p7_dgst.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
726 | p7_dgst.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
727 | p7_dgst.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
728 | p7_dgst.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
729 | p7_dgst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
730 | p7_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
731 | p7_dgst.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
732 | p7_dgst.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
733 | p7_dgst.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
734 | p7_dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
735 | p7_dgst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
736 | p7_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
737 | p7_dgst.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
738 | p7_dgst.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
739 | p7_dgst.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
740 | p7_dgst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
741 | p7_dgst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
742 | p7_dgst.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
743 | p7_enc.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
744 | p7_enc.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
745 | p7_enc.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
746 | p7_enc.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
747 | p7_enc.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
748 | p7_enc.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
749 | p7_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
750 | p7_enc.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
751 | p7_enc.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
752 | p7_enc.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
753 | p7_enc.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
754 | p7_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
755 | p7_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
756 | p7_enc.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
757 | p7_enc.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
758 | p7_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
759 | p7_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
760 | p7_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
761 | p7_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
762 | p7_enc_c.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
763 | p7_enc_c.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
764 | p7_enc_c.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
765 | p7_enc_c.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
766 | p7_enc_c.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
767 | p7_enc_c.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
768 | p7_enc_c.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
769 | p7_enc_c.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
770 | p7_enc_c.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
771 | p7_enc_c.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
772 | p7_enc_c.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
773 | p7_enc_c.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
774 | p7_enc_c.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
775 | p7_enc_c.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
776 | p7_enc_c.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
777 | p7_enc_c.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
778 | p7_enc_c.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
779 | p7_enc_c.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
780 | p7_enc_c.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
781 | p7_evp.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
782 | p7_evp.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
783 | p7_evp.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
784 | p7_evp.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
785 | p7_evp.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
786 | p7_evp.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
787 | p7_evp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
788 | p7_evp.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
789 | p7_evp.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
790 | p7_evp.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
791 | p7_evp.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
792 | p7_evp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
793 | p7_evp.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
794 | p7_evp.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
795 | p7_evp.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
796 | p7_evp.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
797 | p7_evp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
798 | p7_evp.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
799 | p7_evp.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
800 | p7_i_s.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
801 | p7_i_s.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
802 | p7_i_s.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
803 | p7_i_s.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
804 | p7_i_s.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
805 | p7_i_s.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
806 | p7_i_s.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
807 | p7_i_s.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
808 | p7_i_s.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
809 | p7_i_s.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
810 | p7_i_s.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
811 | p7_i_s.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
812 | p7_i_s.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
813 | p7_i_s.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
814 | p7_i_s.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
815 | p7_i_s.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
816 | p7_i_s.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
817 | p7_i_s.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
818 | p7_i_s.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
819 | p7_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
820 | p7_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
821 | p7_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
822 | p7_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
823 | p7_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
824 | p7_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
825 | p7_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
826 | p7_lib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
827 | p7_lib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
828 | p7_lib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
829 | p7_lib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
830 | p7_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
831 | p7_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
832 | p7_lib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
833 | p7_lib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
834 | p7_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
835 | p7_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
836 | p7_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
837 | p7_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
838 | p7_recip.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
839 | p7_recip.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
840 | p7_recip.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
841 | p7_recip.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
842 | p7_recip.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
843 | p7_recip.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
844 | p7_recip.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
845 | p7_recip.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
846 | p7_recip.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
847 | p7_recip.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
848 | p7_recip.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
849 | p7_recip.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
850 | p7_recip.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
851 | p7_recip.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
852 | p7_recip.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
853 | p7_recip.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
854 | p7_recip.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
855 | p7_recip.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
856 | p7_recip.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
857 | p7_s_e.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
858 | p7_s_e.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
859 | p7_s_e.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
860 | p7_s_e.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
861 | p7_s_e.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
862 | p7_s_e.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
863 | p7_s_e.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
864 | p7_s_e.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
865 | p7_s_e.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
866 | p7_s_e.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
867 | p7_s_e.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
868 | p7_s_e.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
869 | p7_s_e.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
870 | p7_s_e.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
871 | p7_s_e.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
872 | p7_s_e.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
873 | p7_s_e.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
874 | p7_s_e.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
875 | p7_s_e.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
876 | p7_signd.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
877 | p7_signd.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
878 | p7_signd.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
879 | p7_signd.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
880 | p7_signd.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
881 | p7_signd.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
882 | p7_signd.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
883 | p7_signd.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
884 | p7_signd.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
885 | p7_signd.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
886 | p7_signd.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
887 | p7_signd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
888 | p7_signd.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
889 | p7_signd.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
890 | p7_signd.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
891 | p7_signd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
892 | p7_signd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
893 | p7_signd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
894 | p7_signd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
895 | p7_signi.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
896 | p7_signi.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
897 | p7_signi.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
898 | p7_signi.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
899 | p7_signi.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
900 | p7_signi.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
901 | p7_signi.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
902 | p7_signi.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
903 | p7_signi.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
904 | p7_signi.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
905 | p7_signi.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
906 | p7_signi.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
907 | p7_signi.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
908 | p7_signi.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
909 | p7_signi.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
910 | p7_signi.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
911 | p7_signi.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
912 | p7_signi.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
913 | p7_signi.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
914 | p8_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
915 | p8_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
916 | p8_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 522 | p8_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
917 | p8_pkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 523 | p8_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
918 | p8_pkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 524 | p8_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
919 | p8_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 525 | p8_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
920 | p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 526 | p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
921 | p8_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
922 | p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
923 | p8_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
924 | p8_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
925 | p8_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 527 | p8_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
926 | p8_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 528 | p8_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
927 | p8_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 529 | p8_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
928 | p8_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 530 | p8_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
929 | p8_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 531 | p8_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
930 | p8_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 532 | p8_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
931 | p8_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 533 | p8_pkey.o: ../cryptlib.h p8_pkey.c |
932 | p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 534 | t_bitst.o: ../../e_os.h ../../include/openssl/asn1.h |
933 | t_bitst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 535 | t_bitst.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
934 | t_bitst.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 536 | t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h |
935 | t_bitst.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | 537 | t_bitst.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
936 | t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | 538 | t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
937 | t_bitst.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
938 | t_bitst.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
939 | t_bitst.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
940 | t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h | 539 | t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
941 | t_bitst.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | 540 | t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
942 | t_bitst.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | 541 | t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
943 | t_bitst.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | 542 | t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
944 | t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 543 | t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
945 | t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
946 | t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | ||
947 | t_bitst.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | ||
948 | t_bitst.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | ||
949 | t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 544 | t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
950 | t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 545 | t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
951 | t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 546 | t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
952 | t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h | 547 | t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h t_bitst.c |
953 | t_crl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 548 | t_crl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
954 | t_crl.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 549 | t_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
955 | t_crl.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
956 | t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | 550 | t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h |
957 | t_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 551 | t_crl.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
958 | t_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 552 | t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
959 | t_crl.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 553 | t_crl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
960 | t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
961 | t_crl.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
962 | t_crl.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
963 | t_crl.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
964 | t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 554 | t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
965 | t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 555 | t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
966 | t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 556 | t_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
967 | t_crl.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 557 | t_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
968 | t_crl.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 558 | t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
969 | t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 559 | t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
970 | t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 560 | t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h |
971 | t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 561 | t_crl.o: ../cryptlib.h t_crl.c |
972 | t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h | 562 | t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
973 | t_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 563 | t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
974 | t_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 564 | t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
975 | t_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 565 | t_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
976 | t_pkey.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | ||
977 | t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 566 | t_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
978 | t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 567 | t_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
979 | t_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 568 | t_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h |
980 | t_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 569 | t_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
981 | t_pkey.o: ../cryptlib.h | 570 | t_pkey.o: ../../include/openssl/symhacks.h ../cryptlib.h t_pkey.c |
982 | t_req.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 571 | t_req.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
983 | t_req.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | 572 | t_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
984 | t_req.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
985 | t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | 573 | t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h |
986 | t_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 574 | t_req.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
987 | t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 575 | t_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
988 | t_req.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 576 | t_req.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
989 | t_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
990 | t_req.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
991 | t_req.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
992 | t_req.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
993 | t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 577 | t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
994 | t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 578 | t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
995 | t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 579 | t_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
996 | t_req.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 580 | t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
997 | t_req.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 581 | t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
998 | t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 582 | t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
999 | t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 583 | t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h |
1000 | t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 584 | t_req.o: ../cryptlib.h t_req.c |
1001 | t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h | 585 | t_spki.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
1002 | t_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
1003 | t_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1004 | t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 586 | t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1005 | t_spki.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 587 | t_spki.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1006 | t_spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 588 | t_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1007 | t_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 589 | t_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1008 | t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 590 | t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1009 | t_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1010 | t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1011 | t_spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1012 | t_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1013 | t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 591 | t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1014 | t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 592 | t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1015 | t_spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 593 | t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1016 | t_spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 594 | t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1017 | t_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 595 | t_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1018 | t_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 596 | t_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1019 | t_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 597 | t_spki.o: ../cryptlib.h t_spki.c |
1020 | t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 598 | t_x509.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
1021 | t_x509.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 599 | t_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1022 | t_x509.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h | ||
1023 | t_x509.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h | ||
1024 | t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h | 600 | t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h |
1025 | t_x509.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 601 | t_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
1026 | t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 602 | t_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
1027 | t_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h | 603 | t_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
1028 | t_x509.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
1029 | t_x509.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h | ||
1030 | t_x509.o: ../../include/openssl/md2.h ../../include/openssl/md4.h | ||
1031 | t_x509.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h | ||
1032 | t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 604 | t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
1033 | t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 605 | t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
1034 | t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h | 606 | t_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
1035 | t_x509.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h | 607 | t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
1036 | t_x509.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h | 608 | t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
1037 | t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 609 | t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
1038 | t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 610 | t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h |
1039 | t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 611 | t_x509.o: ../cryptlib.h t_x509.c |
1040 | t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h | 612 | t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h |
1041 | t_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 613 | t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
1042 | t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 614 | t_x509a.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
1043 | t_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 615 | t_x509a.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
1044 | t_x509a.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | ||
1045 | t_x509a.o: ../../include/openssl/des.h ../../include/openssl/dh.h | ||
1046 | t_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
1047 | t_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 616 | t_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
1048 | t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | 617 | t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
1049 | t_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | 618 | t_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
1050 | t_x509a.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | 619 | t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
1051 | t_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | 620 | t_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
1052 | t_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1053 | t_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1054 | t_x509a.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
1055 | t_x509a.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
1056 | t_x509a.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 621 | t_x509a.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
1057 | t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 622 | t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
1058 | t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 623 | t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
1059 | t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 624 | t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_x509a.c |
1060 | x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 625 | tasn_dec.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h |
1061 | x_algor.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 626 | tasn_dec.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
1062 | x_algor.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 627 | tasn_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
1063 | x_algor.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 628 | tasn_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
1064 | x_algor.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 629 | tasn_dec.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1065 | x_algor.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 630 | tasn_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1066 | x_algor.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 631 | tasn_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1067 | x_algor.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | 632 | tasn_dec.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
1068 | x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | 633 | tasn_dec.o: ../../include/openssl/symhacks.h tasn_dec.c |
1069 | x_algor.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | 634 | tasn_enc.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h |
1070 | x_algor.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | 635 | tasn_enc.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
636 | tasn_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
637 | tasn_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
638 | tasn_enc.o: ../../include/openssl/opensslconf.h | ||
639 | tasn_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
640 | tasn_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
641 | tasn_enc.o: ../../include/openssl/symhacks.h tasn_enc.c | ||
642 | tasn_fre.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
643 | tasn_fre.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
644 | tasn_fre.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
645 | tasn_fre.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
646 | tasn_fre.o: ../../include/openssl/opensslconf.h | ||
647 | tasn_fre.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
648 | tasn_fre.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
649 | tasn_fre.o: ../../include/openssl/symhacks.h tasn_fre.c | ||
650 | tasn_new.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
651 | tasn_new.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
652 | tasn_new.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
653 | tasn_new.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
654 | tasn_new.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
655 | tasn_new.o: ../../include/openssl/opensslconf.h | ||
656 | tasn_new.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
657 | tasn_new.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
658 | tasn_new.o: ../../include/openssl/symhacks.h tasn_new.c | ||
659 | tasn_typ.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
660 | tasn_typ.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
661 | tasn_typ.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
662 | tasn_typ.o: ../../include/openssl/opensslconf.h | ||
663 | tasn_typ.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
664 | tasn_typ.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
665 | tasn_typ.o: ../../include/openssl/symhacks.h tasn_typ.c | ||
666 | tasn_utl.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
667 | tasn_utl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
668 | tasn_utl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
669 | tasn_utl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
670 | tasn_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
671 | tasn_utl.o: ../../include/openssl/opensslconf.h | ||
672 | tasn_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
673 | tasn_utl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
674 | tasn_utl.o: ../../include/openssl/symhacks.h tasn_utl.c | ||
675 | x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h | ||
676 | x_algor.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
677 | x_algor.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
678 | x_algor.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | ||
679 | x_algor.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h | ||
680 | x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
1071 | x_algor.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 681 | x_algor.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1072 | x_algor.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 682 | x_algor.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1073 | x_algor.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 683 | x_algor.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1074 | x_algor.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 684 | x_algor.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1075 | x_algor.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 685 | x_algor.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1076 | x_algor.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 686 | x_algor.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1077 | x_algor.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 687 | x_algor.o: x_algor.c |
1078 | x_algor.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 688 | x_attrib.o: ../../e_os.h ../../include/openssl/asn1.h |
1079 | x_attrib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 689 | x_attrib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1080 | x_attrib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1081 | x_attrib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 690 | x_attrib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1082 | x_attrib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 691 | x_attrib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1083 | x_attrib.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 692 | x_attrib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1084 | x_attrib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 693 | x_attrib.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1085 | x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 694 | x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1086 | x_attrib.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1087 | x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1088 | x_attrib.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1089 | x_attrib.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1090 | x_attrib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 695 | x_attrib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1091 | x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 696 | x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1092 | x_attrib.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 697 | x_attrib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1093 | x_attrib.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 698 | x_attrib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1094 | x_attrib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 699 | x_attrib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1095 | x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 700 | x_attrib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1096 | x_attrib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 701 | x_attrib.o: ../cryptlib.h x_attrib.c |
1097 | x_attrib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 702 | x_bignum.o: ../../e_os.h ../../include/openssl/asn1.h |
1098 | x_cinf.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 703 | x_bignum.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1099 | x_cinf.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 704 | x_bignum.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1100 | x_cinf.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 705 | x_bignum.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
1101 | x_cinf.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 706 | x_bignum.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
1102 | x_cinf.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 707 | x_bignum.o: ../../include/openssl/opensslconf.h |
1103 | x_cinf.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 708 | x_bignum.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1104 | x_cinf.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 709 | x_bignum.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
1105 | x_cinf.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | 710 | x_bignum.o: ../../include/openssl/symhacks.h ../cryptlib.h x_bignum.c |
1106 | x_cinf.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | 711 | x_crl.o: ../../e_os.h ../../include/openssl/asn1.h |
1107 | x_cinf.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | 712 | x_crl.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1108 | x_cinf.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1109 | x_cinf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1110 | x_cinf.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1111 | x_cinf.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
1112 | x_cinf.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
1113 | x_cinf.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
1114 | x_cinf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
1115 | x_cinf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
1116 | x_cinf.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
1117 | x_crl.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
1118 | x_crl.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1119 | x_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 713 | x_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1120 | x_crl.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 714 | x_crl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1121 | x_crl.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 715 | x_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1122 | x_crl.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 716 | x_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1123 | x_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 717 | x_crl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1124 | x_crl.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1125 | x_crl.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1126 | x_crl.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1127 | x_crl.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1128 | x_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 718 | x_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1129 | x_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 719 | x_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1130 | x_crl.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 720 | x_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1131 | x_crl.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 721 | x_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1132 | x_crl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 722 | x_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1133 | x_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 723 | x_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1134 | x_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 724 | x_crl.o: ../cryptlib.h x_crl.c |
1135 | x_crl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 725 | x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h |
1136 | x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 726 | x_exten.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
1137 | x_exten.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 727 | x_exten.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
1138 | x_exten.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 728 | x_exten.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
1139 | x_exten.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 729 | x_exten.o: ../../include/openssl/e_os2.h ../../include/openssl/evp.h |
1140 | x_exten.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 730 | x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1141 | x_exten.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | ||
1142 | x_exten.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
1143 | x_exten.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1144 | x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1145 | x_exten.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1146 | x_exten.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1147 | x_exten.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 731 | x_exten.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1148 | x_exten.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 732 | x_exten.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1149 | x_exten.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 733 | x_exten.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1150 | x_exten.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 734 | x_exten.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1151 | x_exten.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 735 | x_exten.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1152 | x_exten.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 736 | x_exten.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1153 | x_exten.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 737 | x_exten.o: x_exten.c |
1154 | x_exten.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 738 | x_info.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
1155 | x_info.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | ||
1156 | x_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1157 | x_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 739 | x_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1158 | x_info.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 740 | x_info.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1159 | x_info.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 741 | x_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1160 | x_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 742 | x_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1161 | x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 743 | x_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1162 | x_info.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1163 | x_info.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1164 | x_info.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1165 | x_info.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1166 | x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 744 | x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1167 | x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 745 | x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1168 | x_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 746 | x_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1169 | x_info.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 747 | x_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1170 | x_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 748 | x_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1171 | x_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 749 | x_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1172 | x_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 750 | x_info.o: ../cryptlib.h x_info.c |
1173 | x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 751 | x_long.o: ../../e_os.h ../../include/openssl/asn1.h |
1174 | x_name.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 752 | x_long.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1175 | x_name.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 753 | x_long.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
754 | x_long.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
755 | x_long.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
756 | x_long.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
757 | x_long.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | ||
758 | x_long.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
759 | x_long.o: ../cryptlib.h x_long.c | ||
760 | x_name.o: ../../e_os.h ../../include/openssl/asn1.h | ||
761 | x_name.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | ||
1176 | x_name.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 762 | x_name.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1177 | x_name.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 763 | x_name.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1178 | x_name.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 764 | x_name.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1179 | x_name.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 765 | x_name.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1180 | x_name.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 766 | x_name.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1181 | x_name.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1182 | x_name.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1183 | x_name.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1184 | x_name.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1185 | x_name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 767 | x_name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1186 | x_name.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 768 | x_name.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1187 | x_name.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 769 | x_name.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1188 | x_name.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 770 | x_name.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1189 | x_name.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 771 | x_name.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1190 | x_name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 772 | x_name.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1191 | x_name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 773 | x_name.o: ../cryptlib.h x_name.c |
1192 | x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 774 | x_pkey.o: ../../e_os.h ../../include/openssl/asn1.h |
1193 | x_pkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 775 | x_pkey.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h |
1194 | x_pkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1195 | x_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 776 | x_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1196 | x_pkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 777 | x_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1197 | x_pkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 778 | x_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1198 | x_pkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 779 | x_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1199 | x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 780 | x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1200 | x_pkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1201 | x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1202 | x_pkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1203 | x_pkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1204 | x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 781 | x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1205 | x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 782 | x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1206 | x_pkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 783 | x_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1207 | x_pkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 784 | x_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1208 | x_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 785 | x_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1209 | x_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 786 | x_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1210 | x_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 787 | x_pkey.o: ../cryptlib.h x_pkey.c |
1211 | x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 788 | x_pubkey.o: ../../e_os.h ../../include/openssl/asn1.h |
1212 | x_pubkey.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 789 | x_pubkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1213 | x_pubkey.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1214 | x_pubkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 790 | x_pubkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1215 | x_pubkey.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 791 | x_pubkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1216 | x_pubkey.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 792 | x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1217 | x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 793 | x_pubkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1218 | x_pubkey.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 794 | x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1219 | x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1220 | x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1221 | x_pubkey.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1222 | x_pubkey.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1223 | x_pubkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 795 | x_pubkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1224 | x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 796 | x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1225 | x_pubkey.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 797 | x_pubkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1226 | x_pubkey.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 798 | x_pubkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1227 | x_pubkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 799 | x_pubkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1228 | x_pubkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 800 | x_pubkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1229 | x_pubkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 801 | x_pubkey.o: ../cryptlib.h x_pubkey.c |
1230 | x_pubkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 802 | x_req.o: ../../e_os.h ../../include/openssl/asn1.h |
1231 | x_req.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 803 | x_req.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1232 | x_req.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1233 | x_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 804 | x_req.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1234 | x_req.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 805 | x_req.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1235 | x_req.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 806 | x_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1236 | x_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 807 | x_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1237 | x_req.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 808 | x_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1238 | x_req.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1239 | x_req.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1240 | x_req.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1241 | x_req.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1242 | x_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 809 | x_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1243 | x_req.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 810 | x_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1244 | x_req.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 811 | x_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1245 | x_req.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 812 | x_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1246 | x_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 813 | x_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1247 | x_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 814 | x_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1248 | x_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 815 | x_req.o: ../cryptlib.h x_req.c |
1249 | x_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 816 | x_sig.o: ../../e_os.h ../../include/openssl/asn1.h |
1250 | x_sig.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 817 | x_sig.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1251 | x_sig.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1252 | x_sig.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 818 | x_sig.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1253 | x_sig.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 819 | x_sig.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1254 | x_sig.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 820 | x_sig.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1255 | x_sig.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 821 | x_sig.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1256 | x_sig.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 822 | x_sig.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1257 | x_sig.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1258 | x_sig.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1259 | x_sig.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1260 | x_sig.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1261 | x_sig.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 823 | x_sig.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1262 | x_sig.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 824 | x_sig.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1263 | x_sig.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 825 | x_sig.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1264 | x_sig.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 826 | x_sig.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1265 | x_sig.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 827 | x_sig.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1266 | x_sig.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 828 | x_sig.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1267 | x_sig.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 829 | x_sig.o: ../cryptlib.h x_sig.c |
1268 | x_sig.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 830 | x_spki.o: ../../e_os.h ../../include/openssl/asn1.h |
1269 | x_spki.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 831 | x_spki.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1270 | x_spki.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1271 | x_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 832 | x_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1272 | x_spki.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 833 | x_spki.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1273 | x_spki.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 834 | x_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1274 | x_spki.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 835 | x_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1275 | x_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 836 | x_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1276 | x_spki.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1277 | x_spki.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1278 | x_spki.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1279 | x_spki.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1280 | x_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 837 | x_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1281 | x_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 838 | x_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1282 | x_spki.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 839 | x_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1283 | x_spki.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 840 | x_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1284 | x_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 841 | x_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1285 | x_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 842 | x_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1286 | x_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 843 | x_spki.o: ../cryptlib.h x_spki.c |
1287 | x_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 844 | x_val.o: ../../e_os.h ../../include/openssl/asn1.h |
1288 | x_val.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 845 | x_val.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1289 | x_val.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1290 | x_val.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 846 | x_val.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1291 | x_val.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 847 | x_val.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1292 | x_val.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 848 | x_val.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1293 | x_val.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 849 | x_val.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1294 | x_val.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 850 | x_val.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1295 | x_val.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1296 | x_val.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1297 | x_val.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1298 | x_val.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1299 | x_val.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 851 | x_val.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1300 | x_val.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 852 | x_val.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1301 | x_val.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 853 | x_val.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1302 | x_val.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 854 | x_val.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1303 | x_val.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 855 | x_val.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1304 | x_val.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 856 | x_val.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1305 | x_val.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 857 | x_val.o: ../cryptlib.h x_val.c |
1306 | x_val.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | 858 | x_x509.o: ../../e_os.h ../../include/openssl/asn1.h |
1307 | x_x509.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 859 | x_x509.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1308 | x_x509.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | ||
1309 | x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 860 | x_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1310 | x_x509.o: ../../include/openssl/cast.h ../../include/openssl/conf.h | 861 | x_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h |
1311 | x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/des.h | ||
1312 | x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h | 862 | x_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h |
1313 | x_x509.o: ../../include/openssl/e_os.h ../../include/openssl/e_os.h | ||
1314 | x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 863 | x_x509.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
1315 | x_x509.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | 864 | x_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
1316 | x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | 865 | x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h |
1317 | x_x509.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | 866 | x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
1318 | x_x509.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | 867 | x_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h |
1319 | x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
1320 | x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | ||
1321 | x_x509.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | ||
1322 | x_x509.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | ||
1323 | x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 868 | x_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
1324 | x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 869 | x_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
1325 | x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 870 | x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
1326 | x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | 871 | x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h |
1327 | x_x509.o: ../cryptlib.h | 872 | x_x509.o: ../cryptlib.h x_x509.c |
1328 | x_x509a.o: ../../include/openssl/asn1.h ../../include/openssl/asn1_mac.h | 873 | x_x509a.o: ../../e_os.h ../../include/openssl/asn1.h |
1329 | x_x509a.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h | 874 | x_x509a.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
1330 | x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 875 | x_x509a.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
1331 | x_x509a.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h | 876 | x_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h |
1332 | x_x509a.o: ../../include/openssl/des.h ../../include/openssl/dh.h | 877 | x_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
1333 | x_x509a.o: ../../include/openssl/dsa.h ../../include/openssl/e_os.h | 878 | x_x509a.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
1334 | x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 879 | x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
1335 | x_x509a.o: ../../include/openssl/evp.h ../../include/openssl/idea.h | ||
1336 | x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h | ||
1337 | x_x509a.o: ../../include/openssl/md4.h ../../include/openssl/md5.h | ||
1338 | x_x509a.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h | ||
1339 | x_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 880 | x_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
1340 | x_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/pkcs7.h | 881 | x_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
1341 | x_x509a.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h | 882 | x_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
1342 | x_x509a.o: ../../include/openssl/rc5.h ../../include/openssl/ripemd.h | 883 | x_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
1343 | x_x509a.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 884 | x_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
1344 | x_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 885 | x_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
1345 | x_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 886 | x_x509a.o: ../cryptlib.h x_x509a.c |
1346 | x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h | ||
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index 7013a407ad..c36817c1ee 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c | |||
@@ -60,27 +60,9 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | ASN1_BIT_STRING *ASN1_BIT_STRING_new(void) | ||
64 | { return M_ASN1_BIT_STRING_new(); } | ||
65 | |||
66 | void ASN1_BIT_STRING_free(ASN1_BIT_STRING *x) | ||
67 | { M_ASN1_BIT_STRING_free(x); } | ||
68 | |||
69 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) | 63 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) |
70 | { return M_ASN1_BIT_STRING_set(x, d, len); } | 64 | { return M_ASN1_BIT_STRING_set(x, d, len); } |
71 | 65 | ||
72 | int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) | ||
73 | { | ||
74 | int len, ret; | ||
75 | len = i2c_ASN1_BIT_STRING(a, NULL); | ||
76 | ret=ASN1_object_size(0,len,V_ASN1_BIT_STRING); | ||
77 | if(pp) { | ||
78 | ASN1_put_object(pp,0,len,V_ASN1_BIT_STRING,V_ASN1_UNIVERSAL); | ||
79 | i2c_ASN1_BIT_STRING(a, pp); | ||
80 | } | ||
81 | return ret; | ||
82 | } | ||
83 | |||
84 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) | 66 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) |
85 | { | 67 | { |
86 | int ret,j,bits,len; | 68 | int ret,j,bits,len; |
@@ -129,40 +111,6 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp) | |||
129 | return(ret); | 111 | return(ret); |
130 | } | 112 | } |
131 | 113 | ||
132 | |||
133 | /* Convert DER encoded ASN1 BIT_STRING to ASN1_BIT_STRING structure */ | ||
134 | ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, | ||
135 | long length) | ||
136 | { | ||
137 | unsigned char *p; | ||
138 | long len; | ||
139 | int i; | ||
140 | int inf,tag,xclass; | ||
141 | ASN1_BIT_STRING *ret; | ||
142 | |||
143 | p= *pp; | ||
144 | inf=ASN1_get_object(&p,&len,&tag,&xclass,length); | ||
145 | if (inf & 0x80) | ||
146 | { | ||
147 | i=ASN1_R_BAD_OBJECT_HEADER; | ||
148 | goto err; | ||
149 | } | ||
150 | |||
151 | if (tag != V_ASN1_BIT_STRING) | ||
152 | { | ||
153 | i=ASN1_R_EXPECTING_A_BIT_STRING; | ||
154 | goto err; | ||
155 | } | ||
156 | if (len < 1) { i=ASN1_R_STRING_TOO_SHORT; goto err; } | ||
157 | ret = c2i_ASN1_BIT_STRING(a, &p, len); | ||
158 | if(ret) *pp = p; | ||
159 | return ret; | ||
160 | err: | ||
161 | ASN1err(ASN1_F_D2I_ASN1_BIT_STRING,i); | ||
162 | return(NULL); | ||
163 | |||
164 | } | ||
165 | |||
166 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, | 114 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp, |
167 | long len) | 115 | long len) |
168 | { | 116 | { |
@@ -224,6 +172,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value) | |||
224 | w=n/8; | 172 | w=n/8; |
225 | v=1<<(7-(n&0x07)); | 173 | v=1<<(7-(n&0x07)); |
226 | iv= ~v; | 174 | iv= ~v; |
175 | if (!value) v=0; | ||
227 | 176 | ||
228 | a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */ | 177 | a->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); /* clear, set on write */ |
229 | 178 | ||
diff --git a/src/lib/libcrypto/asn1/a_bool.c b/src/lib/libcrypto/asn1/a_bool.c index 18fa61840b..24333ea4d5 100644 --- a/src/lib/libcrypto/asn1/a_bool.c +++ b/src/lib/libcrypto/asn1/a_bool.c | |||
@@ -58,7 +58,7 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1t.h> |
62 | 62 | ||
63 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) | 63 | int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) |
64 | { | 64 | { |
@@ -110,3 +110,5 @@ err: | |||
110 | ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,i); | 110 | ASN1err(ASN1_F_D2I_ASN1_BOOLEAN,i); |
111 | return(ret); | 111 | return(ret); |
112 | } | 112 | } |
113 | |||
114 | |||
diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c index 3a0c0c7835..bb88660f58 100644 --- a/src/lib/libcrypto/asn1/a_bytes.c +++ b/src/lib/libcrypto/asn1/a_bytes.c | |||
@@ -58,18 +58,7 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1.h> |
62 | |||
63 | static unsigned long tag2bit[32]={ | ||
64 | 0, 0, 0, B_ASN1_BIT_STRING, /* tags 0 - 3 */ | ||
65 | B_ASN1_OCTET_STRING, 0, 0, B_ASN1_UNKNOWN,/* tags 4- 7 */ | ||
66 | B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN,/* tags 8-11 */ | ||
67 | B_ASN1_UTF8STRING,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,/* tags 12-15 */ | ||
68 | 0, 0, B_ASN1_NUMERICSTRING,B_ASN1_PRINTABLESTRING, | ||
69 | B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING,0, | ||
70 | 0,B_ASN1_GRAPHICSTRING,B_ASN1_ISO64STRING,B_ASN1_GENERALSTRING, | ||
71 | B_ASN1_UNIVERSALSTRING,B_ASN1_UNKNOWN,B_ASN1_BMPSTRING,B_ASN1_UNKNOWN, | ||
72 | }; | ||
73 | 62 | ||
74 | static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c); | 63 | static int asn1_collate_primitive(ASN1_STRING *a, ASN1_CTX *c); |
75 | /* type is a 'bitmap' of acceptable string types. | 64 | /* type is a 'bitmap' of acceptable string types. |
@@ -92,7 +81,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, unsigned char **pp, | |||
92 | i=ASN1_R_TAG_VALUE_TOO_HIGH;; | 81 | i=ASN1_R_TAG_VALUE_TOO_HIGH;; |
93 | goto err; | 82 | goto err; |
94 | } | 83 | } |
95 | if (!(tag2bit[tag] & type)) | 84 | if (!(ASN1_tag2bit(tag) & type)) |
96 | { | 85 | { |
97 | i=ASN1_R_WRONG_TYPE; | 86 | i=ASN1_R_WRONG_TYPE; |
98 | goto err; | 87 | goto err; |
diff --git a/src/lib/libcrypto/asn1/a_d2i_fp.c b/src/lib/libcrypto/asn1/a_d2i_fp.c index a49d1cb289..a80fbe9ff7 100644 --- a/src/lib/libcrypto/asn1/a_d2i_fp.c +++ b/src/lib/libcrypto/asn1/a_d2i_fp.c | |||
@@ -61,9 +61,11 @@ | |||
61 | #include <openssl/buffer.h> | 61 | #include <openssl/buffer.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1_mac.h> |
63 | 63 | ||
64 | #define HEADER_SIZE 8 | 64 | static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb); |
65 | |||
66 | #ifndef NO_OLD_ASN1 | ||
67 | #ifndef OPENSSL_NO_FP_API | ||
65 | 68 | ||
66 | #ifndef NO_FP_API | ||
67 | char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in, | 69 | char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in, |
68 | unsigned char **x) | 70 | unsigned char **x) |
69 | { | 71 | { |
@@ -85,10 +87,65 @@ char *ASN1_d2i_fp(char *(*xnew)(), char *(*d2i)(), FILE *in, | |||
85 | char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in, | 87 | char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in, |
86 | unsigned char **x) | 88 | unsigned char **x) |
87 | { | 89 | { |
90 | BUF_MEM *b = NULL; | ||
91 | unsigned char *p; | ||
92 | char *ret=NULL; | ||
93 | int len; | ||
94 | |||
95 | len = asn1_d2i_read_bio(in, &b); | ||
96 | if(len < 0) goto err; | ||
97 | |||
98 | p=(unsigned char *)b->data; | ||
99 | ret=d2i(x,&p,len); | ||
100 | err: | ||
101 | if (b != NULL) BUF_MEM_free(b); | ||
102 | return(ret); | ||
103 | } | ||
104 | |||
105 | #endif | ||
106 | |||
107 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x) | ||
108 | { | ||
109 | BUF_MEM *b = NULL; | ||
110 | unsigned char *p; | ||
111 | void *ret=NULL; | ||
112 | int len; | ||
113 | |||
114 | len = asn1_d2i_read_bio(in, &b); | ||
115 | if(len < 0) goto err; | ||
116 | |||
117 | p=(unsigned char *)b->data; | ||
118 | ret=ASN1_item_d2i(x,&p,len, it); | ||
119 | err: | ||
120 | if (b != NULL) BUF_MEM_free(b); | ||
121 | return(ret); | ||
122 | } | ||
123 | |||
124 | #ifndef OPENSSL_NO_FP_API | ||
125 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x) | ||
126 | { | ||
127 | BIO *b; | ||
128 | char *ret; | ||
129 | |||
130 | if ((b=BIO_new(BIO_s_file())) == NULL) | ||
131 | { | ||
132 | ASN1err(ASN1_F_ASN1_D2I_FP,ERR_R_BUF_LIB); | ||
133 | return(NULL); | ||
134 | } | ||
135 | BIO_set_fp(b,in,BIO_NOCLOSE); | ||
136 | ret=ASN1_item_d2i_bio(it,b,x); | ||
137 | BIO_free(b); | ||
138 | return(ret); | ||
139 | } | ||
140 | #endif | ||
141 | |||
142 | #define HEADER_SIZE 8 | ||
143 | static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | ||
144 | { | ||
88 | BUF_MEM *b; | 145 | BUF_MEM *b; |
89 | unsigned char *p; | 146 | unsigned char *p; |
90 | int i; | 147 | int i; |
91 | char *ret=NULL; | 148 | int ret=-1; |
92 | ASN1_CTX c; | 149 | ASN1_CTX c; |
93 | int want=HEADER_SIZE; | 150 | int want=HEADER_SIZE; |
94 | int eos=0; | 151 | int eos=0; |
@@ -99,7 +156,7 @@ char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in, | |||
99 | if (b == NULL) | 156 | if (b == NULL) |
100 | { | 157 | { |
101 | ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE); | 158 | ASN1err(ASN1_F_ASN1_D2I_BIO,ERR_R_MALLOC_FAILURE); |
102 | return(NULL); | 159 | return -1; |
103 | } | 160 | } |
104 | 161 | ||
105 | ERR_clear_error(); | 162 | ERR_clear_error(); |
@@ -187,8 +244,8 @@ char *ASN1_d2i_bio(char *(*xnew)(), char *(*d2i)(), BIO *in, | |||
187 | } | 244 | } |
188 | } | 245 | } |
189 | 246 | ||
190 | p=(unsigned char *)b->data; | 247 | *pb = b; |
191 | ret=d2i(x,&p,off); | 248 | return off; |
192 | err: | 249 | err: |
193 | if (b != NULL) BUF_MEM_free(b); | 250 | if (b != NULL) BUF_MEM_free(b); |
194 | return(ret); | 251 | return(ret); |
diff --git a/src/lib/libcrypto/asn1/a_digest.c b/src/lib/libcrypto/asn1/a_digest.c index 8257b8639e..4931e222a0 100644 --- a/src/lib/libcrypto/asn1/a_digest.c +++ b/src/lib/libcrypto/asn1/a_digest.c | |||
@@ -69,10 +69,11 @@ | |||
69 | #include <openssl/buffer.h> | 69 | #include <openssl/buffer.h> |
70 | #include <openssl/x509.h> | 70 | #include <openssl/x509.h> |
71 | 71 | ||
72 | #ifndef NO_ASN1_OLD | ||
73 | |||
72 | int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data, | 74 | int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data, |
73 | unsigned char *md, unsigned int *len) | 75 | unsigned char *md, unsigned int *len) |
74 | { | 76 | { |
75 | EVP_MD_CTX ctx; | ||
76 | int i; | 77 | int i; |
77 | unsigned char *str,*p; | 78 | unsigned char *str,*p; |
78 | 79 | ||
@@ -81,9 +82,24 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data, | |||
81 | p=str; | 82 | p=str; |
82 | i2d(data,&p); | 83 | i2d(data,&p); |
83 | 84 | ||
84 | EVP_DigestInit(&ctx,type); | 85 | EVP_Digest(str, i, md, len, type, NULL); |
85 | EVP_DigestUpdate(&ctx,str,i); | 86 | OPENSSL_free(str); |
86 | EVP_DigestFinal(&ctx,md,len); | 87 | return(1); |
88 | } | ||
89 | |||
90 | #endif | ||
91 | |||
92 | |||
93 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | ||
94 | unsigned char *md, unsigned int *len) | ||
95 | { | ||
96 | int i; | ||
97 | unsigned char *str = NULL; | ||
98 | |||
99 | i=ASN1_item_i2d(asn,&str, it); | ||
100 | if (!str) return(0); | ||
101 | |||
102 | EVP_Digest(str, i, md, len, type, NULL); | ||
87 | OPENSSL_free(str); | 103 | OPENSSL_free(str); |
88 | return(1); | 104 | return(1); |
89 | } | 105 | } |
diff --git a/src/lib/libcrypto/asn1/a_dup.c b/src/lib/libcrypto/asn1/a_dup.c index c3bda58a5d..58a017884c 100644 --- a/src/lib/libcrypto/asn1/a_dup.c +++ b/src/lib/libcrypto/asn1/a_dup.c | |||
@@ -58,9 +58,9 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | #define READ_CHUNK 2048 | 63 | #ifndef NO_OLD_ASN1 |
64 | 64 | ||
65 | char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) | 65 | char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) |
66 | { | 66 | { |
@@ -81,3 +81,27 @@ char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x) | |||
81 | OPENSSL_free(b); | 81 | OPENSSL_free(b); |
82 | return(ret); | 82 | return(ret); |
83 | } | 83 | } |
84 | |||
85 | #endif | ||
86 | |||
87 | /* ASN1_ITEM version of dup: this follows the model above except we don't need | ||
88 | * to allocate the buffer. At some point this could be rewritten to directly dup | ||
89 | * the underlying structure instead of doing and encode and decode. | ||
90 | */ | ||
91 | |||
92 | void *ASN1_item_dup(const ASN1_ITEM *it, void *x) | ||
93 | { | ||
94 | unsigned char *b = NULL, *p; | ||
95 | long i; | ||
96 | void *ret; | ||
97 | |||
98 | if (x == NULL) return(NULL); | ||
99 | |||
100 | i=ASN1_item_i2d(x,&b,it); | ||
101 | if (b == NULL) | ||
102 | { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } | ||
103 | p= b; | ||
104 | ret=ASN1_item_d2i(NULL,&p,i, it); | ||
105 | OPENSSL_free(b); | ||
106 | return(ret); | ||
107 | } | ||
diff --git a/src/lib/libcrypto/asn1/a_enum.c b/src/lib/libcrypto/asn1/a_enum.c index 1428d1df7a..8a315fa371 100644 --- a/src/lib/libcrypto/asn1/a_enum.c +++ b/src/lib/libcrypto/asn1/a_enum.c | |||
@@ -65,60 +65,6 @@ | |||
65 | * for comments on encoding see a_int.c | 65 | * for comments on encoding see a_int.c |
66 | */ | 66 | */ |
67 | 67 | ||
68 | ASN1_ENUMERATED *ASN1_ENUMERATED_new(void) | ||
69 | { return M_ASN1_ENUMERATED_new(); } | ||
70 | |||
71 | void ASN1_ENUMERATED_free(ASN1_ENUMERATED *x) | ||
72 | { M_ASN1_ENUMERATED_free(x); } | ||
73 | |||
74 | |||
75 | int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a, unsigned char **pp) | ||
76 | { | ||
77 | int len, ret; | ||
78 | if(!a) return 0; | ||
79 | len = i2c_ASN1_INTEGER(a, NULL); | ||
80 | ret=ASN1_object_size(0,len,V_ASN1_ENUMERATED); | ||
81 | if(pp) { | ||
82 | ASN1_put_object(pp,0,len,V_ASN1_ENUMERATED,V_ASN1_UNIVERSAL); | ||
83 | i2c_ASN1_INTEGER(a, pp); | ||
84 | } | ||
85 | return ret; | ||
86 | } | ||
87 | |||
88 | ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a, unsigned char **pp, | ||
89 | long length) | ||
90 | { | ||
91 | unsigned char *p; | ||
92 | long len; | ||
93 | int i; | ||
94 | int inf,tag,xclass; | ||
95 | ASN1_ENUMERATED *ret; | ||
96 | |||
97 | p= *pp; | ||
98 | inf=ASN1_get_object(&p,&len,&tag,&xclass,length); | ||
99 | if (inf & 0x80) | ||
100 | { | ||
101 | i=ASN1_R_BAD_OBJECT_HEADER; | ||
102 | goto err; | ||
103 | } | ||
104 | |||
105 | if (tag != V_ASN1_ENUMERATED) | ||
106 | { | ||
107 | i=ASN1_R_EXPECTING_AN_ENUMERATED; | ||
108 | goto err; | ||
109 | } | ||
110 | ret = c2i_ASN1_INTEGER(a, &p, len); | ||
111 | if(ret) { | ||
112 | ret->type = (V_ASN1_NEG & ret->type) | V_ASN1_ENUMERATED; | ||
113 | *pp = p; | ||
114 | } | ||
115 | return ret; | ||
116 | err: | ||
117 | ASN1err(ASN1_F_D2I_ASN1_ENUMERATED,i); | ||
118 | return(NULL); | ||
119 | |||
120 | } | ||
121 | |||
122 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) | 68 | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v) |
123 | { | 69 | { |
124 | int i,j,k; | 70 | int i,j,k; |
@@ -168,7 +114,7 @@ long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) | |||
168 | if (i == V_ASN1_NEG_ENUMERATED) | 114 | if (i == V_ASN1_NEG_ENUMERATED) |
169 | neg=1; | 115 | neg=1; |
170 | else if (i != V_ASN1_ENUMERATED) | 116 | else if (i != V_ASN1_ENUMERATED) |
171 | return(0); | 117 | return -1; |
172 | 118 | ||
173 | if (a->length > sizeof(long)) | 119 | if (a->length > sizeof(long)) |
174 | { | 120 | { |
@@ -176,7 +122,7 @@ long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) | |||
176 | return(0xffffffffL); | 122 | return(0xffffffffL); |
177 | } | 123 | } |
178 | if (a->data == NULL) | 124 | if (a->data == NULL) |
179 | return(0); | 125 | return 0; |
180 | 126 | ||
181 | for (i=0; i<a->length; i++) | 127 | for (i=0; i<a->length; i++) |
182 | { | 128 | { |
diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c index 314479a03d..cd09f68b38 100644 --- a/src/lib/libcrypto/asn1/a_gentm.c +++ b/src/lib/libcrypto/asn1/a_gentm.c | |||
@@ -61,13 +61,10 @@ | |||
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include <time.h> | 62 | #include <time.h> |
63 | #include "cryptlib.h" | 63 | #include "cryptlib.h" |
64 | #include "o_time.h" | ||
64 | #include <openssl/asn1.h> | 65 | #include <openssl/asn1.h> |
65 | 66 | ||
66 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_new(void) | 67 | #if 0 |
67 | { return M_ASN1_GENERALIZEDTIME_new(); } | ||
68 | |||
69 | void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *x) | ||
70 | { M_ASN1_GENERALIZEDTIME_free(x); } | ||
71 | 68 | ||
72 | int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp) | 69 | int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **pp) |
73 | { | 70 | { |
@@ -116,6 +113,8 @@ err: | |||
116 | return(NULL); | 113 | return(NULL); |
117 | } | 114 | } |
118 | 115 | ||
116 | #endif | ||
117 | |||
119 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) | 118 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) |
120 | { | 119 | { |
121 | static int min[9]={ 0, 0, 1, 1, 0, 0, 0, 0, 0}; | 120 | static int min[9]={ 0, 0, 1, 1, 0, 0, 0, 0, 0}; |
@@ -147,6 +146,19 @@ int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *d) | |||
147 | 146 | ||
148 | if ((n < min[i]) || (n > max[i])) goto err; | 147 | if ((n < min[i]) || (n > max[i])) goto err; |
149 | } | 148 | } |
149 | /* Optional fractional seconds: decimal point followed by one | ||
150 | * or more digits. | ||
151 | */ | ||
152 | if (a[o] == '.') | ||
153 | { | ||
154 | if (++o > l) goto err; | ||
155 | i = o; | ||
156 | while ((a[o] >= '0') && (a[o] <= '9') && (o <= l)) | ||
157 | o++; | ||
158 | /* Must have at least one digit after decimal point */ | ||
159 | if (i == o) goto err; | ||
160 | } | ||
161 | |||
150 | if (a[o] == 'Z') | 162 | if (a[o] == 'Z') |
151 | o++; | 163 | o++; |
152 | else if ((a[o] == '+') || (a[o] == '-')) | 164 | else if ((a[o] == '+') || (a[o] == '-')) |
@@ -182,6 +194,7 @@ int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str) | |||
182 | { | 194 | { |
183 | ASN1_STRING_set((ASN1_STRING *)s, | 195 | ASN1_STRING_set((ASN1_STRING *)s, |
184 | (unsigned char *)str,t.length); | 196 | (unsigned char *)str,t.length); |
197 | s->type=V_ASN1_GENERALIZEDTIME; | ||
185 | } | 198 | } |
186 | return(1); | 199 | return(1); |
187 | } | 200 | } |
@@ -194,21 +207,17 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, | |||
194 | { | 207 | { |
195 | char *p; | 208 | char *p; |
196 | struct tm *ts; | 209 | struct tm *ts; |
197 | #if defined(THREADS) && !defined(WIN32) | ||
198 | struct tm data; | 210 | struct tm data; |
199 | #endif | ||
200 | 211 | ||
201 | if (s == NULL) | 212 | if (s == NULL) |
202 | s=M_ASN1_GENERALIZEDTIME_new(); | 213 | s=M_ASN1_GENERALIZEDTIME_new(); |
203 | if (s == NULL) | 214 | if (s == NULL) |
204 | return(NULL); | 215 | return(NULL); |
205 | 216 | ||
206 | #if defined(THREADS) && !defined(WIN32) | 217 | ts=OPENSSL_gmtime(&t, &data); |
207 | gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ | 218 | if (ts == NULL) |
208 | ts=&data; | 219 | return(NULL); |
209 | #else | 220 | |
210 | ts=gmtime(&t); | ||
211 | #endif | ||
212 | p=(char *)s->data; | 221 | p=(char *)s->data; |
213 | if ((p == NULL) || (s->length < 16)) | 222 | if ((p == NULL) || (s->length < 16)) |
214 | { | 223 | { |
diff --git a/src/lib/libcrypto/asn1/a_i2d_fp.c b/src/lib/libcrypto/asn1/a_i2d_fp.c index aee29a7790..f4f1b73ebe 100644 --- a/src/lib/libcrypto/asn1/a_i2d_fp.c +++ b/src/lib/libcrypto/asn1/a_i2d_fp.c | |||
@@ -59,9 +59,11 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/buffer.h> | 61 | #include <openssl/buffer.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1.h> |
63 | 63 | ||
64 | #ifndef NO_FP_API | 64 | #ifndef NO_OLD_ASN1 |
65 | |||
66 | #ifndef OPENSSL_NO_FP_API | ||
65 | int ASN1_i2d_fp(int (*i2d)(), FILE *out, unsigned char *x) | 67 | int ASN1_i2d_fp(int (*i2d)(), FILE *out, unsigned char *x) |
66 | { | 68 | { |
67 | BIO *b; | 69 | BIO *b; |
@@ -111,3 +113,51 @@ int ASN1_i2d_bio(int (*i2d)(), BIO *out, unsigned char *x) | |||
111 | OPENSSL_free(b); | 113 | OPENSSL_free(b); |
112 | return(ret); | 114 | return(ret); |
113 | } | 115 | } |
116 | |||
117 | #endif | ||
118 | |||
119 | #ifndef OPENSSL_NO_FP_API | ||
120 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) | ||
121 | { | ||
122 | BIO *b; | ||
123 | int ret; | ||
124 | |||
125 | if ((b=BIO_new(BIO_s_file())) == NULL) | ||
126 | { | ||
127 | ASN1err(ASN1_F_ASN1_I2D_FP,ERR_R_BUF_LIB); | ||
128 | return(0); | ||
129 | } | ||
130 | BIO_set_fp(b,out,BIO_NOCLOSE); | ||
131 | ret=ASN1_item_i2d_bio(it,b,x); | ||
132 | BIO_free(b); | ||
133 | return(ret); | ||
134 | } | ||
135 | #endif | ||
136 | |||
137 | int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) | ||
138 | { | ||
139 | unsigned char *b = NULL; | ||
140 | int i,j=0,n,ret=1; | ||
141 | |||
142 | n = ASN1_item_i2d(x, &b, it); | ||
143 | if (b == NULL) | ||
144 | { | ||
145 | ASN1err(ASN1_F_ASN1_I2D_BIO,ERR_R_MALLOC_FAILURE); | ||
146 | return(0); | ||
147 | } | ||
148 | |||
149 | for (;;) | ||
150 | { | ||
151 | i=BIO_write(out,&(b[j]),n); | ||
152 | if (i == n) break; | ||
153 | if (i <= 0) | ||
154 | { | ||
155 | ret=0; | ||
156 | break; | ||
157 | } | ||
158 | j+=i; | ||
159 | n-=i; | ||
160 | } | ||
161 | OPENSSL_free(b); | ||
162 | return(ret); | ||
163 | } | ||
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index 6f0413f885..496704b9a5 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c | |||
@@ -60,33 +60,12 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | ASN1_INTEGER *ASN1_INTEGER_new(void) | ||
64 | { return M_ASN1_INTEGER_new();} | ||
65 | |||
66 | void ASN1_INTEGER_free(ASN1_INTEGER *x) | ||
67 | { M_ASN1_INTEGER_free(x);} | ||
68 | |||
69 | ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x) | 63 | ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x) |
70 | { return M_ASN1_INTEGER_dup(x);} | 64 | { return M_ASN1_INTEGER_dup(x);} |
71 | 65 | ||
72 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) | 66 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y) |
73 | { return M_ASN1_INTEGER_cmp(x,y);} | 67 | { return M_ASN1_INTEGER_cmp(x,y);} |
74 | 68 | ||
75 | /* Output ASN1 INTEGER including tag+length */ | ||
76 | |||
77 | int i2d_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) | ||
78 | { | ||
79 | int len, ret; | ||
80 | if(!a) return 0; | ||
81 | len = i2c_ASN1_INTEGER(a, NULL); | ||
82 | ret=ASN1_object_size(0,len,V_ASN1_INTEGER); | ||
83 | if(pp) { | ||
84 | ASN1_put_object(pp,0,len,V_ASN1_INTEGER,V_ASN1_UNIVERSAL); | ||
85 | i2c_ASN1_INTEGER(a, pp); | ||
86 | } | ||
87 | return ret; | ||
88 | } | ||
89 | |||
90 | /* | 69 | /* |
91 | * This converts an ASN1 INTEGER into its content encoding. | 70 | * This converts an ASN1 INTEGER into its content encoding. |
92 | * The internal representation is an ASN1_STRING whose data is a big endian | 71 | * The internal representation is an ASN1_STRING whose data is a big endian |
@@ -174,39 +153,6 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) | |||
174 | return(ret); | 153 | return(ret); |
175 | } | 154 | } |
176 | 155 | ||
177 | /* Convert DER encoded ASN1 INTEGER to ASN1_INTEGER structure */ | ||
178 | ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, | ||
179 | long length) | ||
180 | { | ||
181 | unsigned char *p; | ||
182 | long len; | ||
183 | int i; | ||
184 | int inf,tag,xclass; | ||
185 | ASN1_INTEGER *ret; | ||
186 | |||
187 | p= *pp; | ||
188 | inf=ASN1_get_object(&p,&len,&tag,&xclass,length); | ||
189 | if (inf & 0x80) | ||
190 | { | ||
191 | i=ASN1_R_BAD_OBJECT_HEADER; | ||
192 | goto err; | ||
193 | } | ||
194 | |||
195 | if (tag != V_ASN1_INTEGER) | ||
196 | { | ||
197 | i=ASN1_R_EXPECTING_AN_INTEGER; | ||
198 | goto err; | ||
199 | } | ||
200 | ret = c2i_ASN1_INTEGER(a, &p, len); | ||
201 | if(ret) *pp = p; | ||
202 | return ret; | ||
203 | err: | ||
204 | ASN1err(ASN1_F_D2I_ASN1_INTEGER,i); | ||
205 | return(NULL); | ||
206 | |||
207 | } | ||
208 | |||
209 | |||
210 | /* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */ | 156 | /* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */ |
211 | 157 | ||
212 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, | 158 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, unsigned char **pp, |
@@ -414,7 +360,7 @@ long ASN1_INTEGER_get(ASN1_INTEGER *a) | |||
414 | if (i == V_ASN1_NEG_INTEGER) | 360 | if (i == V_ASN1_NEG_INTEGER) |
415 | neg=1; | 361 | neg=1; |
416 | else if (i != V_ASN1_INTEGER) | 362 | else if (i != V_ASN1_INTEGER) |
417 | return(0); | 363 | return -1; |
418 | 364 | ||
419 | if (a->length > sizeof(long)) | 365 | if (a->length > sizeof(long)) |
420 | { | 366 | { |
@@ -422,7 +368,7 @@ long ASN1_INTEGER_get(ASN1_INTEGER *a) | |||
422 | return(0xffffffffL); | 368 | return(0xffffffffL); |
423 | } | 369 | } |
424 | if (a->data == NULL) | 370 | if (a->data == NULL) |
425 | return(0); | 371 | return 0; |
426 | 372 | ||
427 | for (i=0; i<a->length; i++) | 373 | for (i=0; i<a->length; i++) |
428 | { | 374 | { |
@@ -453,6 +399,12 @@ ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai) | |||
453 | len=((j == 0)?0:((j/8)+1)); | 399 | len=((j == 0)?0:((j/8)+1)); |
454 | ret->data=(unsigned char *)OPENSSL_malloc(len+4); | 400 | ret->data=(unsigned char *)OPENSSL_malloc(len+4); |
455 | ret->length=BN_bn2bin(bn,ret->data); | 401 | ret->length=BN_bn2bin(bn,ret->data); |
402 | /* Correct zero case */ | ||
403 | if(!ret->length) | ||
404 | { | ||
405 | ret->data[0] = 0; | ||
406 | ret->length = 1; | ||
407 | } | ||
456 | return(ret); | 408 | return(ret); |
457 | err: | 409 | err: |
458 | if (ret != ai) M_ASN1_INTEGER_free(ret); | 410 | if (ret != ai) M_ASN1_INTEGER_free(ret); |
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c index 20caa2d3bd..71ce7c3896 100644 --- a/src/lib/libcrypto/asn1/a_object.c +++ b/src/lib/libcrypto/asn1/a_object.c | |||
@@ -302,7 +302,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a) | |||
302 | } | 302 | } |
303 | 303 | ||
304 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, | 304 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, |
305 | char *sn, char *ln) | 305 | const char *sn, const char *ln) |
306 | { | 306 | { |
307 | ASN1_OBJECT o; | 307 | ASN1_OBJECT o; |
308 | 308 | ||
diff --git a/src/lib/libcrypto/asn1/a_octet.c b/src/lib/libcrypto/asn1/a_octet.c index 2586f4327d..9690bae0f1 100644 --- a/src/lib/libcrypto/asn1/a_octet.c +++ b/src/lib/libcrypto/asn1/a_octet.c | |||
@@ -60,12 +60,6 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_new(void) | ||
64 | { return M_ASN1_OCTET_STRING_new(); } | ||
65 | |||
66 | void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *x) | ||
67 | { M_ASN1_OCTET_STRING_free(x); } | ||
68 | |||
69 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *x) | 63 | ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *x) |
70 | { return M_ASN1_OCTET_STRING_dup(x); } | 64 | { return M_ASN1_OCTET_STRING_dup(x); } |
71 | 65 | ||
@@ -75,21 +69,3 @@ int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b) | |||
75 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, unsigned char *d, int len) | 69 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, unsigned char *d, int len) |
76 | { return M_ASN1_OCTET_STRING_set(x, d, len); } | 70 | { return M_ASN1_OCTET_STRING_set(x, d, len); } |
77 | 71 | ||
78 | int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a, unsigned char **pp) | ||
79 | { return M_i2d_ASN1_OCTET_STRING(a, pp); } | ||
80 | |||
81 | ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, | ||
82 | unsigned char **pp, long length) | ||
83 | { | ||
84 | ASN1_OCTET_STRING *ret=NULL; | ||
85 | |||
86 | ret=(ASN1_OCTET_STRING *)d2i_ASN1_bytes((ASN1_STRING **)a, | ||
87 | pp,length,V_ASN1_OCTET_STRING,V_ASN1_UNIVERSAL); | ||
88 | if (ret == NULL) | ||
89 | { | ||
90 | ASN1err(ASN1_F_D2I_ASN1_OCTET_STRING,ERR_R_NESTED_ASN1_ERROR); | ||
91 | return(NULL); | ||
92 | } | ||
93 | return(ret); | ||
94 | } | ||
95 | |||
diff --git a/src/lib/libcrypto/asn1/a_print.c b/src/lib/libcrypto/asn1/a_print.c index b7bd2bd18a..8035513f04 100644 --- a/src/lib/libcrypto/asn1/a_print.c +++ b/src/lib/libcrypto/asn1/a_print.c | |||
@@ -60,50 +60,6 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | ASN1_IA5STRING *ASN1_IA5STRING_new(void) | ||
64 | { return M_ASN1_IA5STRING_new();} | ||
65 | |||
66 | void ASN1_IA5STRING_free(ASN1_IA5STRING *x) | ||
67 | { M_ASN1_IA5STRING_free(x);} | ||
68 | |||
69 | int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a, unsigned char **pp) | ||
70 | { return(M_i2d_ASN1_IA5STRING(a,pp)); } | ||
71 | |||
72 | ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, unsigned char **pp, | ||
73 | long l) | ||
74 | { return(M_d2i_ASN1_IA5STRING(a,pp,l)); } | ||
75 | |||
76 | ASN1_T61STRING *ASN1_T61STRING_new(void) | ||
77 | { return M_ASN1_T61STRING_new();} | ||
78 | |||
79 | void ASN1_T61STRING_free(ASN1_T61STRING *x) | ||
80 | { M_ASN1_T61STRING_free(x);} | ||
81 | |||
82 | ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, unsigned char **pp, | ||
83 | long l) | ||
84 | { return(M_d2i_ASN1_T61STRING(a,pp,l)); } | ||
85 | |||
86 | ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void) | ||
87 | { return M_ASN1_PRINTABLESTRING_new();} | ||
88 | |||
89 | void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *x) | ||
90 | { M_ASN1_PRINTABLESTRING_free(x);} | ||
91 | |||
92 | ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, | ||
93 | unsigned char **pp, long l) | ||
94 | { return(M_d2i_ASN1_PRINTABLESTRING(a,pp, | ||
95 | l)); } | ||
96 | |||
97 | int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **pp) | ||
98 | { return(M_i2d_ASN1_PRINTABLESTRING(a,pp)); } | ||
99 | |||
100 | int i2d_ASN1_PRINTABLE(ASN1_STRING *a, unsigned char **pp) | ||
101 | { return(M_i2d_ASN1_PRINTABLE(a,pp)); } | ||
102 | |||
103 | ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, unsigned char **pp, | ||
104 | long l) | ||
105 | { return(M_d2i_ASN1_PRINTABLE(a,pp,l)); } | ||
106 | |||
107 | int ASN1_PRINTABLE_type(unsigned char *s, int len) | 63 | int ASN1_PRINTABLE_type(unsigned char *s, int len) |
108 | { | 64 | { |
109 | int c; | 65 | int c; |
@@ -169,29 +125,3 @@ int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s) | |||
169 | s->type=ASN1_PRINTABLE_type(s->data,s->length); | 125 | s->type=ASN1_PRINTABLE_type(s->data,s->length); |
170 | return(1); | 126 | return(1); |
171 | } | 127 | } |
172 | |||
173 | ASN1_STRING *DIRECTORYSTRING_new(void) | ||
174 | { return M_DIRECTORYSTRING_new();} | ||
175 | |||
176 | void DIRECTORYSTRING_free(ASN1_STRING *x) | ||
177 | { M_DIRECTORYSTRING_free(x);} | ||
178 | |||
179 | int i2d_DIRECTORYSTRING(ASN1_STRING *a, unsigned char **pp) | ||
180 | { return(M_i2d_DIRECTORYSTRING(a,pp)); } | ||
181 | |||
182 | ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp, | ||
183 | long l) | ||
184 | { return(M_d2i_DIRECTORYSTRING(a,pp,l)); } | ||
185 | |||
186 | ASN1_STRING *DISPLAYTEXT_new(void) | ||
187 | { return M_DISPLAYTEXT_new();} | ||
188 | |||
189 | void DISPLAYTEXT_free(ASN1_STRING *x) | ||
190 | { M_DISPLAYTEXT_free(x);} | ||
191 | |||
192 | int i2d_DISPLAYTEXT(ASN1_STRING *a, unsigned char **pp) | ||
193 | { return(M_i2d_DISPLAYTEXT(a,pp)); } | ||
194 | |||
195 | ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp, | ||
196 | long l) | ||
197 | { return(M_d2i_DISPLAYTEXT(a,pp,l)); } | ||
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c index caf5a1419c..19bb60fca8 100644 --- a/src/lib/libcrypto/asn1/a_set.c +++ b/src/lib/libcrypto/asn1/a_set.c | |||
@@ -60,6 +60,8 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1_mac.h> |
62 | 62 | ||
63 | #ifndef NO_ASN1_OLD | ||
64 | |||
63 | typedef struct | 65 | typedef struct |
64 | { | 66 | { |
65 | unsigned char *pbData; | 67 | unsigned char *pbData; |
@@ -215,3 +217,4 @@ err: | |||
215 | return(NULL); | 217 | return(NULL); |
216 | } | 218 | } |
217 | 219 | ||
220 | #endif | ||
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c index 4c651706d2..de53b44144 100644 --- a/src/lib/libcrypto/asn1/a_sign.c +++ b/src/lib/libcrypto/asn1/a_sign.c | |||
@@ -55,6 +55,59 @@ | |||
55 | * copied and put under another distribution licence | 55 | * copied and put under another distribution licence |
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | /* ==================================================================== | ||
59 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | ||
60 | * | ||
61 | * Redistribution and use in source and binary forms, with or without | ||
62 | * modification, are permitted provided that the following conditions | ||
63 | * are met: | ||
64 | * | ||
65 | * 1. Redistributions of source code must retain the above copyright | ||
66 | * notice, this list of conditions and the following disclaimer. | ||
67 | * | ||
68 | * 2. Redistributions in binary form must reproduce the above copyright | ||
69 | * notice, this list of conditions and the following disclaimer in | ||
70 | * the documentation and/or other materials provided with the | ||
71 | * distribution. | ||
72 | * | ||
73 | * 3. All advertising materials mentioning features or use of this | ||
74 | * software must display the following acknowledgment: | ||
75 | * "This product includes software developed by the OpenSSL Project | ||
76 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
77 | * | ||
78 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
79 | * endorse or promote products derived from this software without | ||
80 | * prior written permission. For written permission, please contact | ||
81 | * openssl-core@openssl.org. | ||
82 | * | ||
83 | * 5. Products derived from this software may not be called "OpenSSL" | ||
84 | * nor may "OpenSSL" appear in their names without prior written | ||
85 | * permission of the OpenSSL Project. | ||
86 | * | ||
87 | * 6. Redistributions of any form whatsoever must retain the following | ||
88 | * acknowledgment: | ||
89 | * "This product includes software developed by the OpenSSL Project | ||
90 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
91 | * | ||
92 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
93 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
94 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
95 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
96 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
97 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
98 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
99 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
100 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
101 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
102 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
103 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
104 | * ==================================================================== | ||
105 | * | ||
106 | * This product includes cryptographic software written by Eric Young | ||
107 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
108 | * Hudson (tjh@cryptsoft.com). | ||
109 | * | ||
110 | */ | ||
58 | 111 | ||
59 | #include <stdio.h> | 112 | #include <stdio.h> |
60 | #include <time.h> | 113 | #include <time.h> |
@@ -71,6 +124,8 @@ | |||
71 | #include <openssl/objects.h> | 124 | #include <openssl/objects.h> |
72 | #include <openssl/buffer.h> | 125 | #include <openssl/buffer.h> |
73 | 126 | ||
127 | #ifndef NO_ASN1_OLD | ||
128 | |||
74 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | 129 | int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, |
75 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, | 130 | ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey, |
76 | const EVP_MD *type) | 131 | const EVP_MD *type) |
@@ -80,6 +135,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
80 | int i,inl=0,outl=0,outll=0; | 135 | int i,inl=0,outl=0,outll=0; |
81 | X509_ALGOR *a; | 136 | X509_ALGOR *a; |
82 | 137 | ||
138 | EVP_MD_CTX_init(&ctx); | ||
83 | for (i=0; i<2; i++) | 139 | for (i=0; i<2; i++) |
84 | { | 140 | { |
85 | if (i == 0) | 141 | if (i == 0) |
@@ -87,7 +143,14 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
87 | else | 143 | else |
88 | a=algor2; | 144 | a=algor2; |
89 | if (a == NULL) continue; | 145 | if (a == NULL) continue; |
90 | if ( (a->parameter == NULL) || | 146 | if (type->pkey_type == NID_dsaWithSHA1) |
147 | { | ||
148 | /* special case: RFC 2459 tells us to omit 'parameters' | ||
149 | * with id-dsa-with-sha1 */ | ||
150 | ASN1_TYPE_free(a->parameter); | ||
151 | a->parameter = NULL; | ||
152 | } | ||
153 | else if ((a->parameter == NULL) || | ||
91 | (a->parameter->type != V_ASN1_NULL)) | 154 | (a->parameter->type != V_ASN1_NULL)) |
92 | { | 155 | { |
93 | ASN1_TYPE_free(a->parameter); | 156 | ASN1_TYPE_free(a->parameter); |
@@ -120,7 +183,90 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
120 | p=buf_in; | 183 | p=buf_in; |
121 | 184 | ||
122 | i2d(data,&p); | 185 | i2d(data,&p); |
123 | EVP_SignInit(&ctx,type); | 186 | EVP_SignInit_ex(&ctx,type, NULL); |
187 | EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl); | ||
188 | if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out, | ||
189 | (unsigned int *)&outl,pkey)) | ||
190 | { | ||
191 | outl=0; | ||
192 | ASN1err(ASN1_F_ASN1_SIGN,ERR_R_EVP_LIB); | ||
193 | goto err; | ||
194 | } | ||
195 | if (signature->data != NULL) OPENSSL_free(signature->data); | ||
196 | signature->data=buf_out; | ||
197 | buf_out=NULL; | ||
198 | signature->length=outl; | ||
199 | /* In the interests of compatibility, I'll make sure that | ||
200 | * the bit string has a 'not-used bits' value of 0 | ||
201 | */ | ||
202 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); | ||
203 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; | ||
204 | err: | ||
205 | EVP_MD_CTX_cleanup(&ctx); | ||
206 | if (buf_in != NULL) | ||
207 | { memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); } | ||
208 | if (buf_out != NULL) | ||
209 | { memset((char *)buf_out,0,outll); OPENSSL_free(buf_out); } | ||
210 | return(outl); | ||
211 | } | ||
212 | |||
213 | #endif | ||
214 | |||
215 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | ||
216 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey, | ||
217 | const EVP_MD *type) | ||
218 | { | ||
219 | EVP_MD_CTX ctx; | ||
220 | unsigned char *buf_in=NULL,*buf_out=NULL; | ||
221 | int i,inl=0,outl=0,outll=0; | ||
222 | X509_ALGOR *a; | ||
223 | |||
224 | EVP_MD_CTX_init(&ctx); | ||
225 | for (i=0; i<2; i++) | ||
226 | { | ||
227 | if (i == 0) | ||
228 | a=algor1; | ||
229 | else | ||
230 | a=algor2; | ||
231 | if (a == NULL) continue; | ||
232 | if (type->pkey_type == NID_dsaWithSHA1) | ||
233 | { | ||
234 | /* special case: RFC 2459 tells us to omit 'parameters' | ||
235 | * with id-dsa-with-sha1 */ | ||
236 | ASN1_TYPE_free(a->parameter); | ||
237 | a->parameter = NULL; | ||
238 | } | ||
239 | else if ((a->parameter == NULL) || | ||
240 | (a->parameter->type != V_ASN1_NULL)) | ||
241 | { | ||
242 | ASN1_TYPE_free(a->parameter); | ||
243 | if ((a->parameter=ASN1_TYPE_new()) == NULL) goto err; | ||
244 | a->parameter->type=V_ASN1_NULL; | ||
245 | } | ||
246 | ASN1_OBJECT_free(a->algorithm); | ||
247 | a->algorithm=OBJ_nid2obj(type->pkey_type); | ||
248 | if (a->algorithm == NULL) | ||
249 | { | ||
250 | ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_UNKNOWN_OBJECT_TYPE); | ||
251 | goto err; | ||
252 | } | ||
253 | if (a->algorithm->length == 0) | ||
254 | { | ||
255 | ASN1err(ASN1_F_ASN1_SIGN,ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD); | ||
256 | goto err; | ||
257 | } | ||
258 | } | ||
259 | inl=ASN1_item_i2d(asn,&buf_in, it); | ||
260 | outll=outl=EVP_PKEY_size(pkey); | ||
261 | buf_out=(unsigned char *)OPENSSL_malloc((unsigned int)outl); | ||
262 | if ((buf_in == NULL) || (buf_out == NULL)) | ||
263 | { | ||
264 | outl=0; | ||
265 | ASN1err(ASN1_F_ASN1_SIGN,ERR_R_MALLOC_FAILURE); | ||
266 | goto err; | ||
267 | } | ||
268 | |||
269 | EVP_SignInit_ex(&ctx,type, NULL); | ||
124 | EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl); | 270 | EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl); |
125 | if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out, | 271 | if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out, |
126 | (unsigned int *)&outl,pkey)) | 272 | (unsigned int *)&outl,pkey)) |
@@ -139,7 +285,7 @@ int ASN1_sign(int (*i2d)(), X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
139 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); | 285 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); |
140 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; | 286 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; |
141 | err: | 287 | err: |
142 | memset(&ctx,0,sizeof(ctx)); | 288 | EVP_MD_CTX_cleanup(&ctx); |
143 | if (buf_in != NULL) | 289 | if (buf_in != NULL) |
144 | { memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); } | 290 | { memset((char *)buf_in,0,(unsigned int)inl); OPENSSL_free(buf_in); } |
145 | if (buf_out != NULL) | 291 | if (buf_out != NULL) |
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c index 569b811998..128aa7e772 100644 --- a/src/lib/libcrypto/asn1/a_strex.c +++ b/src/lib/libcrypto/asn1/a_strex.c | |||
@@ -371,6 +371,8 @@ static int do_indent(char_io *io_ch, void *arg, int indent) | |||
371 | return 1; | 371 | return 1; |
372 | } | 372 | } |
373 | 373 | ||
374 | #define FN_WIDTH_LN 25 | ||
375 | #define FN_WIDTH_SN 10 | ||
374 | 376 | ||
375 | static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, | 377 | static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, |
376 | int indent, unsigned long flags) | 378 | int indent, unsigned long flags) |
@@ -456,19 +458,29 @@ static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, | |||
456 | val = X509_NAME_ENTRY_get_data(ent); | 458 | val = X509_NAME_ENTRY_get_data(ent); |
457 | fn_nid = OBJ_obj2nid(fn); | 459 | fn_nid = OBJ_obj2nid(fn); |
458 | if(fn_opt != XN_FLAG_FN_NONE) { | 460 | if(fn_opt != XN_FLAG_FN_NONE) { |
459 | int objlen; | 461 | int objlen, fld_len; |
460 | if((fn_opt == XN_FLAG_FN_OID) || (fn_nid==NID_undef) ) { | 462 | if((fn_opt == XN_FLAG_FN_OID) || (fn_nid==NID_undef) ) { |
461 | OBJ_obj2txt(objtmp, 80, fn, 1); | 463 | OBJ_obj2txt(objtmp, 80, fn, 1); |
464 | fld_len = 0; /* XXX: what should this be? */ | ||
462 | objbuf = objtmp; | 465 | objbuf = objtmp; |
463 | } else { | 466 | } else { |
464 | if(fn_opt == XN_FLAG_FN_SN) | 467 | if(fn_opt == XN_FLAG_FN_SN) { |
468 | fld_len = FN_WIDTH_SN; | ||
465 | objbuf = OBJ_nid2sn(fn_nid); | 469 | objbuf = OBJ_nid2sn(fn_nid); |
466 | else if(fn_opt == XN_FLAG_FN_LN) | 470 | } else if(fn_opt == XN_FLAG_FN_LN) { |
471 | fld_len = FN_WIDTH_LN; | ||
467 | objbuf = OBJ_nid2ln(fn_nid); | 472 | objbuf = OBJ_nid2ln(fn_nid); |
468 | else objbuf = ""; | 473 | } else { |
474 | fld_len = 0; /* XXX: what should this be? */ | ||
475 | objbuf = ""; | ||
476 | } | ||
469 | } | 477 | } |
470 | objlen = strlen(objbuf); | 478 | objlen = strlen(objbuf); |
471 | if(!io_ch(arg, objbuf, objlen)) return -1; | 479 | if(!io_ch(arg, objbuf, objlen)) return -1; |
480 | if ((objlen < fld_len) && (flags & XN_FLAG_FN_ALIGN)) { | ||
481 | if (!do_indent(io_ch, arg, fld_len - objlen)) return -1; | ||
482 | outlen += fld_len - objlen; | ||
483 | } | ||
472 | if(!io_ch(arg, sep_eq, sep_eq_len)) return -1; | 484 | if(!io_ch(arg, sep_eq, sep_eq_len)) return -1; |
473 | outlen += objlen + sep_eq_len; | 485 | outlen += objlen + sep_eq_len; |
474 | } | 486 | } |
@@ -491,12 +503,24 @@ static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n, | |||
491 | 503 | ||
492 | int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags) | 504 | int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags) |
493 | { | 505 | { |
506 | if(flags == XN_FLAG_COMPAT) | ||
507 | return X509_NAME_print(out, nm, indent); | ||
494 | return do_name_ex(send_bio_chars, out, nm, indent, flags); | 508 | return do_name_ex(send_bio_chars, out, nm, indent, flags); |
495 | } | 509 | } |
496 | 510 | ||
497 | 511 | ||
498 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags) | 512 | int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags) |
499 | { | 513 | { |
514 | if(flags == XN_FLAG_COMPAT) | ||
515 | { | ||
516 | BIO *btmp; | ||
517 | int ret; | ||
518 | btmp = BIO_new_fp(fp, BIO_NOCLOSE); | ||
519 | if(!btmp) return -1; | ||
520 | ret = X509_NAME_print(btmp, nm, indent); | ||
521 | BIO_free(btmp); | ||
522 | return ret; | ||
523 | } | ||
500 | return do_name_ex(send_fp_chars, fp, nm, indent, flags); | 524 | return do_name_ex(send_fp_chars, fp, nm, indent, flags); |
501 | } | 525 | } |
502 | 526 | ||
diff --git a/src/lib/libcrypto/asn1/a_strnid.c b/src/lib/libcrypto/asn1/a_strnid.c index 732e68fe46..04789d1c63 100644 --- a/src/lib/libcrypto/asn1/a_strnid.c +++ b/src/lib/libcrypto/asn1/a_strnid.c | |||
@@ -105,9 +105,9 @@ int ASN1_STRING_set_default_mask_asc(char *p) | |||
105 | mask = strtoul(p + 5, &end, 0); | 105 | mask = strtoul(p + 5, &end, 0); |
106 | if(*end) return 0; | 106 | if(*end) return 0; |
107 | } else if(!strcmp(p, "nombstr")) | 107 | } else if(!strcmp(p, "nombstr")) |
108 | mask = ~(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING); | 108 | mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)); |
109 | else if(!strcmp(p, "pkix")) | 109 | else if(!strcmp(p, "pkix")) |
110 | mask = ~B_ASN1_T61STRING; | 110 | mask = ~((unsigned long)B_ASN1_T61STRING); |
111 | else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING; | 111 | else if(!strcmp(p, "utf8only")) mask = B_ASN1_UTF8STRING; |
112 | else if(!strcmp(p, "default")) | 112 | else if(!strcmp(p, "default")) |
113 | mask = 0xFFFFFFFFL; | 113 | mask = 0xFFFFFFFFL; |
@@ -170,8 +170,10 @@ static ASN1_STRING_TABLE tbl_standard[] = { | |||
170 | {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0}, | 170 | {NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0}, |
171 | {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0}, | 171 | {NID_surname, 1, ub_name, DIRSTRING_TYPE, 0}, |
172 | {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0}, | 172 | {NID_initials, 1, ub_name, DIRSTRING_TYPE, 0}, |
173 | {NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}, | ||
173 | {NID_name, 1, ub_name, DIRSTRING_TYPE, 0}, | 174 | {NID_name, 1, ub_name, DIRSTRING_TYPE, 0}, |
174 | {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK} | 175 | {NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK}, |
176 | {NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK} | ||
175 | }; | 177 | }; |
176 | 178 | ||
177 | static int sk_table_cmp(const ASN1_STRING_TABLE * const *a, | 179 | static int sk_table_cmp(const ASN1_STRING_TABLE * const *a, |
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c index 8c0ddee4ac..27ddd30899 100644 --- a/src/lib/libcrypto/asn1/a_time.c +++ b/src/lib/libcrypto/asn1/a_time.c | |||
@@ -64,14 +64,14 @@ | |||
64 | #include <stdio.h> | 64 | #include <stdio.h> |
65 | #include <time.h> | 65 | #include <time.h> |
66 | #include "cryptlib.h" | 66 | #include "cryptlib.h" |
67 | #include <openssl/asn1.h> | 67 | #include "o_time.h" |
68 | #include <openssl/asn1t.h> | ||
68 | 69 | ||
69 | ASN1_TIME *ASN1_TIME_new(void) | 70 | IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME) |
70 | { return M_ASN1_TIME_new(); } | ||
71 | 71 | ||
72 | void ASN1_TIME_free(ASN1_TIME *x) | 72 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_TIME) |
73 | { M_ASN1_TIME_free(x); } | ||
74 | 73 | ||
74 | #if 0 | ||
75 | int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) | 75 | int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) |
76 | { | 76 | { |
77 | #ifdef CHARSET_EBCDIC | 77 | #ifdef CHARSET_EBCDIC |
@@ -95,33 +95,64 @@ int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) | |||
95 | ASN1err(ASN1_F_I2D_ASN1_TIME,ASN1_R_EXPECTING_A_TIME); | 95 | ASN1err(ASN1_F_I2D_ASN1_TIME,ASN1_R_EXPECTING_A_TIME); |
96 | return -1; | 96 | return -1; |
97 | } | 97 | } |
98 | 98 | #endif | |
99 | |||
100 | ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, unsigned char **pp, long length) | ||
101 | { | ||
102 | unsigned char tag; | ||
103 | tag = **pp & ~V_ASN1_CONSTRUCTED; | ||
104 | if(tag == (V_ASN1_UTCTIME|V_ASN1_UNIVERSAL)) | ||
105 | return d2i_ASN1_UTCTIME(a, pp, length); | ||
106 | if(tag == (V_ASN1_GENERALIZEDTIME|V_ASN1_UNIVERSAL)) | ||
107 | return d2i_ASN1_GENERALIZEDTIME(a, pp, length); | ||
108 | ASN1err(ASN1_F_D2I_ASN1_TIME,ASN1_R_EXPECTING_A_TIME); | ||
109 | return(NULL); | ||
110 | } | ||
111 | 99 | ||
112 | 100 | ||
113 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) | 101 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) |
114 | { | 102 | { |
115 | struct tm *ts; | 103 | struct tm *ts; |
116 | #if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) | ||
117 | struct tm data; | 104 | struct tm data; |
118 | 105 | ||
119 | gmtime_r(&t,&data); | 106 | ts=OPENSSL_gmtime(&t,&data); |
120 | ts=&data; /* should return &data, but doesn't on some systems, so we don't even look at the return value */ | 107 | if (ts == NULL) |
121 | #else | 108 | return NULL; |
122 | ts=gmtime(&t); | ||
123 | #endif | ||
124 | if((ts->tm_year >= 50) && (ts->tm_year < 150)) | 109 | if((ts->tm_year >= 50) && (ts->tm_year < 150)) |
125 | return ASN1_UTCTIME_set(s, t); | 110 | return ASN1_UTCTIME_set(s, t); |
126 | return ASN1_GENERALIZEDTIME_set(s,t); | 111 | return ASN1_GENERALIZEDTIME_set(s,t); |
127 | } | 112 | } |
113 | |||
114 | int ASN1_TIME_check(ASN1_TIME *t) | ||
115 | { | ||
116 | if (t->type == V_ASN1_GENERALIZEDTIME) | ||
117 | return ASN1_GENERALIZEDTIME_check(t); | ||
118 | else if (t->type == V_ASN1_UTCTIME) | ||
119 | return ASN1_UTCTIME_check(t); | ||
120 | return 0; | ||
121 | } | ||
122 | |||
123 | /* Convert an ASN1_TIME structure to GeneralizedTime */ | ||
124 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) | ||
125 | { | ||
126 | ASN1_GENERALIZEDTIME *ret; | ||
127 | char *str; | ||
128 | |||
129 | if (!ASN1_TIME_check(t)) return NULL; | ||
130 | |||
131 | if (!out || !*out) | ||
132 | { | ||
133 | if (!(ret = ASN1_GENERALIZEDTIME_new ())) | ||
134 | return NULL; | ||
135 | if (out) *out = ret; | ||
136 | } | ||
137 | else ret = *out; | ||
138 | |||
139 | /* If already GeneralizedTime just copy across */ | ||
140 | if (t->type == V_ASN1_GENERALIZEDTIME) | ||
141 | { | ||
142 | if(!ASN1_STRING_set(ret, t->data, t->length)) | ||
143 | return NULL; | ||
144 | return ret; | ||
145 | } | ||
146 | |||
147 | /* grow the string */ | ||
148 | if (!ASN1_STRING_set(ret, NULL, t->length + 2)) | ||
149 | return NULL; | ||
150 | str = (char *)ret->data; | ||
151 | /* Work out the century and prepend */ | ||
152 | if (t->data[0] >= '5') strcpy(str, "19"); | ||
153 | else strcpy(str, "20"); | ||
154 | |||
155 | strcat(str, (char *)t->data); | ||
156 | |||
157 | return ret; | ||
158 | } | ||
diff --git a/src/lib/libcrypto/asn1/a_type.c b/src/lib/libcrypto/asn1/a_type.c index e72a6b29e0..96e111cf23 100644 --- a/src/lib/libcrypto/asn1/a_type.c +++ b/src/lib/libcrypto/asn1/a_type.c | |||
@@ -57,236 +57,8 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <openssl/asn1t.h> | ||
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | ||
62 | |||
63 | static void ASN1_TYPE_component_free(ASN1_TYPE *a); | ||
64 | int i2d_ASN1_TYPE(ASN1_TYPE *a, unsigned char **pp) | ||
65 | { | ||
66 | int r=0; | ||
67 | |||
68 | if (a == NULL) return(0); | ||
69 | |||
70 | switch (a->type) | ||
71 | { | ||
72 | case V_ASN1_NULL: | ||
73 | if (pp != NULL) | ||
74 | ASN1_put_object(pp,0,0,V_ASN1_NULL,V_ASN1_UNIVERSAL); | ||
75 | r=2; | ||
76 | break; | ||
77 | case V_ASN1_INTEGER: | ||
78 | case V_ASN1_NEG_INTEGER: | ||
79 | r=i2d_ASN1_INTEGER(a->value.integer,pp); | ||
80 | break; | ||
81 | case V_ASN1_ENUMERATED: | ||
82 | case V_ASN1_NEG_ENUMERATED: | ||
83 | r=i2d_ASN1_ENUMERATED(a->value.enumerated,pp); | ||
84 | break; | ||
85 | case V_ASN1_BIT_STRING: | ||
86 | r=i2d_ASN1_BIT_STRING(a->value.bit_string,pp); | ||
87 | break; | ||
88 | case V_ASN1_OCTET_STRING: | ||
89 | r=i2d_ASN1_OCTET_STRING(a->value.octet_string,pp); | ||
90 | break; | ||
91 | case V_ASN1_OBJECT: | ||
92 | r=i2d_ASN1_OBJECT(a->value.object,pp); | ||
93 | break; | ||
94 | case V_ASN1_PRINTABLESTRING: | ||
95 | r=M_i2d_ASN1_PRINTABLESTRING(a->value.printablestring,pp); | ||
96 | break; | ||
97 | case V_ASN1_T61STRING: | ||
98 | r=M_i2d_ASN1_T61STRING(a->value.t61string,pp); | ||
99 | break; | ||
100 | case V_ASN1_IA5STRING: | ||
101 | r=M_i2d_ASN1_IA5STRING(a->value.ia5string,pp); | ||
102 | break; | ||
103 | case V_ASN1_GENERALSTRING: | ||
104 | r=M_i2d_ASN1_GENERALSTRING(a->value.generalstring,pp); | ||
105 | break; | ||
106 | case V_ASN1_UNIVERSALSTRING: | ||
107 | r=M_i2d_ASN1_UNIVERSALSTRING(a->value.universalstring,pp); | ||
108 | break; | ||
109 | case V_ASN1_UTF8STRING: | ||
110 | r=M_i2d_ASN1_UTF8STRING(a->value.utf8string,pp); | ||
111 | break; | ||
112 | case V_ASN1_VISIBLESTRING: | ||
113 | r=M_i2d_ASN1_VISIBLESTRING(a->value.visiblestring,pp); | ||
114 | break; | ||
115 | case V_ASN1_BMPSTRING: | ||
116 | r=M_i2d_ASN1_BMPSTRING(a->value.bmpstring,pp); | ||
117 | break; | ||
118 | case V_ASN1_UTCTIME: | ||
119 | r=i2d_ASN1_UTCTIME(a->value.utctime,pp); | ||
120 | break; | ||
121 | case V_ASN1_GENERALIZEDTIME: | ||
122 | r=i2d_ASN1_GENERALIZEDTIME(a->value.generalizedtime,pp); | ||
123 | break; | ||
124 | case V_ASN1_SET: | ||
125 | case V_ASN1_SEQUENCE: | ||
126 | case V_ASN1_OTHER: | ||
127 | default: | ||
128 | if (a->value.set == NULL) | ||
129 | r=0; | ||
130 | else | ||
131 | { | ||
132 | r=a->value.set->length; | ||
133 | if (pp != NULL) | ||
134 | { | ||
135 | memcpy(*pp,a->value.set->data,r); | ||
136 | *pp+=r; | ||
137 | } | ||
138 | } | ||
139 | break; | ||
140 | } | ||
141 | return(r); | ||
142 | } | ||
143 | |||
144 | ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, unsigned char **pp, long length) | ||
145 | { | ||
146 | ASN1_TYPE *ret=NULL; | ||
147 | unsigned char *q,*p,*max; | ||
148 | int inf,tag,xclass; | ||
149 | long len; | ||
150 | |||
151 | if ((a == NULL) || ((*a) == NULL)) | ||
152 | { | ||
153 | if ((ret=ASN1_TYPE_new()) == NULL) goto err; | ||
154 | } | ||
155 | else | ||
156 | ret=(*a); | ||
157 | |||
158 | p= *pp; | ||
159 | q=p; | ||
160 | max=(p+length); | ||
161 | |||
162 | inf=ASN1_get_object(&q,&len,&tag,&xclass,length); | ||
163 | if (inf & 0x80) goto err; | ||
164 | /* If not universal tag we've no idea what it is */ | ||
165 | if(xclass != V_ASN1_UNIVERSAL) tag = V_ASN1_OTHER; | ||
166 | |||
167 | ASN1_TYPE_component_free(ret); | ||
168 | |||
169 | switch (tag) | ||
170 | { | ||
171 | case V_ASN1_NULL: | ||
172 | p=q; | ||
173 | ret->value.ptr=NULL; | ||
174 | break; | ||
175 | case V_ASN1_INTEGER: | ||
176 | if ((ret->value.integer= | ||
177 | d2i_ASN1_INTEGER(NULL,&p,max-p)) == NULL) | ||
178 | goto err; | ||
179 | break; | ||
180 | case V_ASN1_ENUMERATED: | ||
181 | if ((ret->value.enumerated= | ||
182 | d2i_ASN1_ENUMERATED(NULL,&p,max-p)) == NULL) | ||
183 | goto err; | ||
184 | break; | ||
185 | case V_ASN1_BIT_STRING: | ||
186 | if ((ret->value.bit_string= | ||
187 | d2i_ASN1_BIT_STRING(NULL,&p,max-p)) == NULL) | ||
188 | goto err; | ||
189 | break; | ||
190 | case V_ASN1_OCTET_STRING: | ||
191 | if ((ret->value.octet_string= | ||
192 | d2i_ASN1_OCTET_STRING(NULL,&p,max-p)) == NULL) | ||
193 | goto err; | ||
194 | break; | ||
195 | case V_ASN1_VISIBLESTRING: | ||
196 | if ((ret->value.visiblestring= | ||
197 | d2i_ASN1_VISIBLESTRING(NULL,&p,max-p)) == NULL) | ||
198 | goto err; | ||
199 | break; | ||
200 | case V_ASN1_UTF8STRING: | ||
201 | if ((ret->value.utf8string= | ||
202 | d2i_ASN1_UTF8STRING(NULL,&p,max-p)) == NULL) | ||
203 | goto err; | ||
204 | break; | ||
205 | case V_ASN1_OBJECT: | ||
206 | if ((ret->value.object= | ||
207 | d2i_ASN1_OBJECT(NULL,&p,max-p)) == NULL) | ||
208 | goto err; | ||
209 | break; | ||
210 | case V_ASN1_PRINTABLESTRING: | ||
211 | if ((ret->value.printablestring= | ||
212 | d2i_ASN1_PRINTABLESTRING(NULL,&p,max-p)) == NULL) | ||
213 | goto err; | ||
214 | break; | ||
215 | case V_ASN1_T61STRING: | ||
216 | if ((ret->value.t61string= | ||
217 | M_d2i_ASN1_T61STRING(NULL,&p,max-p)) == NULL) | ||
218 | goto err; | ||
219 | break; | ||
220 | case V_ASN1_IA5STRING: | ||
221 | if ((ret->value.ia5string= | ||
222 | M_d2i_ASN1_IA5STRING(NULL,&p,max-p)) == NULL) | ||
223 | goto err; | ||
224 | break; | ||
225 | case V_ASN1_GENERALSTRING: | ||
226 | if ((ret->value.generalstring= | ||
227 | M_d2i_ASN1_GENERALSTRING(NULL,&p,max-p)) == NULL) | ||
228 | goto err; | ||
229 | break; | ||
230 | case V_ASN1_UNIVERSALSTRING: | ||
231 | if ((ret->value.universalstring= | ||
232 | M_d2i_ASN1_UNIVERSALSTRING(NULL,&p,max-p)) == NULL) | ||
233 | goto err; | ||
234 | break; | ||
235 | case V_ASN1_BMPSTRING: | ||
236 | if ((ret->value.bmpstring= | ||
237 | M_d2i_ASN1_BMPSTRING(NULL,&p,max-p)) == NULL) | ||
238 | goto err; | ||
239 | break; | ||
240 | case V_ASN1_UTCTIME: | ||
241 | if ((ret->value.utctime= | ||
242 | d2i_ASN1_UTCTIME(NULL,&p,max-p)) == NULL) | ||
243 | goto err; | ||
244 | break; | ||
245 | case V_ASN1_GENERALIZEDTIME: | ||
246 | if ((ret->value.generalizedtime= | ||
247 | d2i_ASN1_GENERALIZEDTIME(NULL,&p,max-p)) == NULL) | ||
248 | goto err; | ||
249 | break; | ||
250 | case V_ASN1_SET: | ||
251 | case V_ASN1_SEQUENCE: | ||
252 | case V_ASN1_OTHER: | ||
253 | default: | ||
254 | /* Sets and sequences are left complete */ | ||
255 | if ((ret->value.set=ASN1_STRING_new()) == NULL) goto err; | ||
256 | ret->value.set->type=tag; | ||
257 | len+=(q-p); | ||
258 | if (!ASN1_STRING_set(ret->value.set,p,(int)len)) goto err; | ||
259 | p+=len; | ||
260 | break; | ||
261 | } | ||
262 | |||
263 | ret->type=tag; | ||
264 | if (a != NULL) (*a)=ret; | ||
265 | *pp=p; | ||
266 | return(ret); | ||
267 | err: | ||
268 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) ASN1_TYPE_free(ret); | ||
269 | return(NULL); | ||
270 | } | ||
271 | |||
272 | ASN1_TYPE *ASN1_TYPE_new(void) | ||
273 | { | ||
274 | ASN1_TYPE *ret=NULL; | ||
275 | ASN1_CTX c; | ||
276 | |||
277 | M_ASN1_New_Malloc(ret,ASN1_TYPE); | ||
278 | ret->type= -1; | ||
279 | ret->value.ptr=NULL; | ||
280 | return(ret); | ||
281 | M_ASN1_New_Error(ASN1_F_ASN1_TYPE_NEW); | ||
282 | } | ||
283 | |||
284 | void ASN1_TYPE_free(ASN1_TYPE *a) | ||
285 | { | ||
286 | if (a == NULL) return; | ||
287 | ASN1_TYPE_component_free(a); | ||
288 | OPENSSL_free(a); | ||
289 | } | ||
290 | 62 | ||
291 | int ASN1_TYPE_get(ASN1_TYPE *a) | 63 | int ASN1_TYPE_get(ASN1_TYPE *a) |
292 | { | 64 | { |
@@ -299,54 +71,11 @@ int ASN1_TYPE_get(ASN1_TYPE *a) | |||
299 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) | 71 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value) |
300 | { | 72 | { |
301 | if (a->value.ptr != NULL) | 73 | if (a->value.ptr != NULL) |
302 | ASN1_TYPE_component_free(a); | 74 | ASN1_primitive_free((ASN1_VALUE **)&a, NULL); |
303 | a->type=type; | 75 | a->type=type; |
304 | a->value.ptr=value; | 76 | a->value.ptr=value; |
305 | } | 77 | } |
306 | 78 | ||
307 | static void ASN1_TYPE_component_free(ASN1_TYPE *a) | ||
308 | { | ||
309 | if (a == NULL) return; | ||
310 | |||
311 | if (a->value.ptr != NULL) | ||
312 | { | ||
313 | switch (a->type) | ||
314 | { | ||
315 | case V_ASN1_OBJECT: | ||
316 | ASN1_OBJECT_free(a->value.object); | ||
317 | break; | ||
318 | case V_ASN1_NULL: | ||
319 | break; | ||
320 | case V_ASN1_INTEGER: | ||
321 | case V_ASN1_NEG_INTEGER: | ||
322 | case V_ASN1_ENUMERATED: | ||
323 | case V_ASN1_NEG_ENUMERATED: | ||
324 | case V_ASN1_BIT_STRING: | ||
325 | case V_ASN1_OCTET_STRING: | ||
326 | case V_ASN1_SEQUENCE: | ||
327 | case V_ASN1_SET: | ||
328 | case V_ASN1_NUMERICSTRING: | ||
329 | case V_ASN1_PRINTABLESTRING: | ||
330 | case V_ASN1_T61STRING: | ||
331 | case V_ASN1_VIDEOTEXSTRING: | ||
332 | case V_ASN1_IA5STRING: | ||
333 | case V_ASN1_UTCTIME: | ||
334 | case V_ASN1_GENERALIZEDTIME: | ||
335 | case V_ASN1_GRAPHICSTRING: | ||
336 | case V_ASN1_VISIBLESTRING: | ||
337 | case V_ASN1_GENERALSTRING: | ||
338 | case V_ASN1_UNIVERSALSTRING: | ||
339 | case V_ASN1_BMPSTRING: | ||
340 | case V_ASN1_UTF8STRING: | ||
341 | case V_ASN1_OTHER: | ||
342 | default: | ||
343 | ASN1_STRING_free((ASN1_STRING *)a->value.ptr); | ||
344 | break; | ||
345 | } | ||
346 | a->type=0; | ||
347 | a->value.ptr=NULL; | ||
348 | } | ||
349 | } | ||
350 | 79 | ||
351 | IMPLEMENT_STACK_OF(ASN1_TYPE) | 80 | IMPLEMENT_STACK_OF(ASN1_TYPE) |
352 | IMPLEMENT_ASN1_SET_OF(ASN1_TYPE) | 81 | IMPLEMENT_ASN1_SET_OF(ASN1_TYPE) |
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c index d381c9e0d1..ed2d827db2 100644 --- a/src/lib/libcrypto/asn1/a_utctm.c +++ b/src/lib/libcrypto/asn1/a_utctm.c | |||
@@ -58,20 +58,11 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <time.h> | 60 | #include <time.h> |
61 | #ifdef VMS | ||
62 | #include <descrip.h> | ||
63 | #include <lnmdef.h> | ||
64 | #include <starlet.h> | ||
65 | #endif | ||
66 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include "o_time.h" | ||
67 | #include <openssl/asn1.h> | 63 | #include <openssl/asn1.h> |
68 | 64 | ||
69 | ASN1_UTCTIME *ASN1_UTCTIME_new(void) | 65 | #if 0 |
70 | { return M_ASN1_UTCTIME_new(); } | ||
71 | |||
72 | void ASN1_UTCTIME_free(ASN1_UTCTIME *x) | ||
73 | { M_ASN1_UTCTIME_free(x); } | ||
74 | |||
75 | int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp) | 66 | int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp) |
76 | { | 67 | { |
77 | #ifndef CHARSET_EBCDIC | 68 | #ifndef CHARSET_EBCDIC |
@@ -119,6 +110,8 @@ err: | |||
119 | return(NULL); | 110 | return(NULL); |
120 | } | 111 | } |
121 | 112 | ||
113 | #endif | ||
114 | |||
122 | int ASN1_UTCTIME_check(ASN1_UTCTIME *d) | 115 | int ASN1_UTCTIME_check(ASN1_UTCTIME *d) |
123 | { | 116 | { |
124 | static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0}; | 117 | static int min[8]={ 0, 1, 1, 0, 0, 0, 0, 0}; |
@@ -182,6 +175,7 @@ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str) | |||
182 | { | 175 | { |
183 | ASN1_STRING_set((ASN1_STRING *)s, | 176 | ASN1_STRING_set((ASN1_STRING *)s, |
184 | (unsigned char *)str,t.length); | 177 | (unsigned char *)str,t.length); |
178 | s->type = V_ASN1_UTCTIME; | ||
185 | } | 179 | } |
186 | return(1); | 180 | return(1); |
187 | } | 181 | } |
@@ -193,59 +187,17 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) | |||
193 | { | 187 | { |
194 | char *p; | 188 | char *p; |
195 | struct tm *ts; | 189 | struct tm *ts; |
196 | #if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) | ||
197 | |||
198 | struct tm data; | 190 | struct tm data; |
199 | #endif | ||
200 | 191 | ||
201 | if (s == NULL) | 192 | if (s == NULL) |
202 | s=M_ASN1_UTCTIME_new(); | 193 | s=M_ASN1_UTCTIME_new(); |
203 | if (s == NULL) | 194 | if (s == NULL) |
204 | return(NULL); | 195 | return(NULL); |
205 | 196 | ||
206 | #if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) | 197 | ts=OPENSSL_gmtime(&t, &data); |
207 | gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ | ||
208 | ts=&data; | ||
209 | #else | ||
210 | ts=gmtime(&t); | ||
211 | #endif | ||
212 | #ifdef VMS | ||
213 | if (ts == NULL) | 198 | if (ts == NULL) |
214 | { | 199 | return(NULL); |
215 | static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL"); | 200 | |
216 | static $DESCRIPTOR(lognam,"SYS$TIMEZONE_DIFFERENTIAL"); | ||
217 | char result[256]; | ||
218 | unsigned int reslen = 0; | ||
219 | struct { | ||
220 | short buflen; | ||
221 | short code; | ||
222 | void *bufaddr; | ||
223 | unsigned int *reslen; | ||
224 | } itemlist[] = { | ||
225 | { 0, LNM$_STRING, 0, 0 }, | ||
226 | { 0, 0, 0, 0 }, | ||
227 | }; | ||
228 | int status; | ||
229 | |||
230 | /* Get the value for SYS$TIMEZONE_DIFFERENTIAL */ | ||
231 | itemlist[0].buflen = sizeof(result); | ||
232 | itemlist[0].bufaddr = result; | ||
233 | itemlist[0].reslen = &reslen; | ||
234 | status = sys$trnlnm(0, &tabnam, &lognam, 0, itemlist); | ||
235 | if (!(status & 1)) | ||
236 | return NULL; | ||
237 | result[reslen] = '\0'; | ||
238 | |||
239 | /* Get the numerical value of the equivalence string */ | ||
240 | status = atoi(result); | ||
241 | |||
242 | /* and use it to move time to GMT */ | ||
243 | t -= status; | ||
244 | |||
245 | /* then convert the result to the time structure */ | ||
246 | ts=(struct tm *)localtime(&t); | ||
247 | } | ||
248 | #endif | ||
249 | p=(char *)s->data; | 201 | p=(char *)s->data; |
250 | if ((p == NULL) || (s->length < 14)) | 202 | if ((p == NULL) || (s->length < 14)) |
251 | { | 203 | { |
@@ -286,11 +238,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) | |||
286 | 238 | ||
287 | t -= offset*60; /* FIXME: may overflow in extreme cases */ | 239 | t -= offset*60; /* FIXME: may overflow in extreme cases */ |
288 | 240 | ||
289 | #if defined(THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) | 241 | { struct tm data; tm = OPENSSL_gmtime(&t, &data); } |
290 | { struct tm data; gmtime_r(&t, &data); tm = &data; } | ||
291 | #else | ||
292 | tm = gmtime(&t); | ||
293 | #endif | ||
294 | 242 | ||
295 | #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 | 243 | #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 |
296 | year = g2(s->data); | 244 | year = g2(s->data); |
diff --git a/src/lib/libcrypto/asn1/a_utf8.c b/src/lib/libcrypto/asn1/a_utf8.c index 854278f136..508e11e527 100644 --- a/src/lib/libcrypto/asn1/a_utf8.c +++ b/src/lib/libcrypto/asn1/a_utf8.c | |||
@@ -60,33 +60,6 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | ASN1_UTF8STRING *ASN1_UTF8STRING_new(void) | ||
64 | { return M_ASN1_UTF8STRING_new();} | ||
65 | |||
66 | void ASN1_UTF8STRING_free(ASN1_UTF8STRING *x) | ||
67 | { M_ASN1_UTF8STRING_free(x);} | ||
68 | |||
69 | int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **pp) | ||
70 | { | ||
71 | return(i2d_ASN1_bytes((ASN1_STRING *)a,pp, | ||
72 | V_ASN1_UTF8STRING,V_ASN1_UNIVERSAL)); | ||
73 | } | ||
74 | |||
75 | ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, unsigned char **pp, | ||
76 | long length) | ||
77 | { | ||
78 | ASN1_UTF8STRING *ret=NULL; | ||
79 | |||
80 | ret=(ASN1_UTF8STRING *)d2i_ASN1_bytes((ASN1_STRING **)a, | ||
81 | pp,length,V_ASN1_UTF8STRING,V_ASN1_UNIVERSAL); | ||
82 | if (ret == NULL) | ||
83 | { | ||
84 | ASN1err(ASN1_F_D2I_ASN1_UTF8STRING,ERR_R_NESTED_ASN1_ERROR); | ||
85 | return(NULL); | ||
86 | } | ||
87 | return(ret); | ||
88 | } | ||
89 | |||
90 | 63 | ||
91 | /* UTF8 utilities */ | 64 | /* UTF8 utilities */ |
92 | 65 | ||
diff --git a/src/lib/libcrypto/asn1/a_verify.c b/src/lib/libcrypto/asn1/a_verify.c index 2a11927e5c..bf41de5146 100644 --- a/src/lib/libcrypto/asn1/a_verify.c +++ b/src/lib/libcrypto/asn1/a_verify.c | |||
@@ -71,6 +71,8 @@ | |||
71 | #include <openssl/buffer.h> | 71 | #include <openssl/buffer.h> |
72 | #include <openssl/evp.h> | 72 | #include <openssl/evp.h> |
73 | 73 | ||
74 | #ifndef NO_ASN1_OLD | ||
75 | |||
74 | int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, | 76 | int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, |
75 | char *data, EVP_PKEY *pkey) | 77 | char *data, EVP_PKEY *pkey) |
76 | { | 78 | { |
@@ -79,6 +81,7 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, | |||
79 | unsigned char *p,*buf_in=NULL; | 81 | unsigned char *p,*buf_in=NULL; |
80 | int ret= -1,i,inl; | 82 | int ret= -1,i,inl; |
81 | 83 | ||
84 | EVP_MD_CTX_init(&ctx); | ||
82 | i=OBJ_obj2nid(a->algorithm); | 85 | i=OBJ_obj2nid(a->algorithm); |
83 | type=EVP_get_digestbyname(OBJ_nid2sn(i)); | 86 | type=EVP_get_digestbyname(OBJ_nid2sn(i)); |
84 | if (type == NULL) | 87 | if (type == NULL) |
@@ -97,7 +100,57 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, | |||
97 | p=buf_in; | 100 | p=buf_in; |
98 | 101 | ||
99 | i2d(data,&p); | 102 | i2d(data,&p); |
100 | EVP_VerifyInit(&ctx,type); | 103 | EVP_VerifyInit_ex(&ctx,type, NULL); |
104 | EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); | ||
105 | |||
106 | memset(buf_in,0,(unsigned int)inl); | ||
107 | OPENSSL_free(buf_in); | ||
108 | |||
109 | if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, | ||
110 | (unsigned int)signature->length,pkey) <= 0) | ||
111 | { | ||
112 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); | ||
113 | ret=0; | ||
114 | goto err; | ||
115 | } | ||
116 | /* we don't need to zero the 'ctx' because we just checked | ||
117 | * public information */ | ||
118 | /* memset(&ctx,0,sizeof(ctx)); */ | ||
119 | ret=1; | ||
120 | err: | ||
121 | EVP_MD_CTX_cleanup(&ctx); | ||
122 | return(ret); | ||
123 | } | ||
124 | |||
125 | #endif | ||
126 | |||
127 | |||
128 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signature, | ||
129 | void *asn, EVP_PKEY *pkey) | ||
130 | { | ||
131 | EVP_MD_CTX ctx; | ||
132 | const EVP_MD *type; | ||
133 | unsigned char *buf_in=NULL; | ||
134 | int ret= -1,i,inl; | ||
135 | |||
136 | EVP_MD_CTX_init(&ctx); | ||
137 | i=OBJ_obj2nid(a->algorithm); | ||
138 | type=EVP_get_digestbyname(OBJ_nid2sn(i)); | ||
139 | if (type == NULL) | ||
140 | { | ||
141 | ASN1err(ASN1_F_ASN1_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); | ||
142 | goto err; | ||
143 | } | ||
144 | |||
145 | inl = ASN1_item_i2d(asn, &buf_in, it); | ||
146 | |||
147 | if (buf_in == NULL) | ||
148 | { | ||
149 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE); | ||
150 | goto err; | ||
151 | } | ||
152 | |||
153 | EVP_VerifyInit_ex(&ctx,type, NULL); | ||
101 | EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); | 154 | EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); |
102 | 155 | ||
103 | memset(buf_in,0,(unsigned int)inl); | 156 | memset(buf_in,0,(unsigned int)inl); |
@@ -115,5 +168,8 @@ int ASN1_verify(int (*i2d)(), X509_ALGOR *a, ASN1_BIT_STRING *signature, | |||
115 | /* memset(&ctx,0,sizeof(ctx)); */ | 168 | /* memset(&ctx,0,sizeof(ctx)); */ |
116 | ret=1; | 169 | ret=1; |
117 | err: | 170 | err: |
171 | EVP_MD_CTX_cleanup(&ctx); | ||
118 | return(ret); | 172 | return(ret); |
119 | } | 173 | } |
174 | |||
175 | |||
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index 6f956b1963..0d1713f8dd 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -60,15 +60,24 @@ | |||
60 | #define HEADER_ASN1_H | 60 | #define HEADER_ASN1_H |
61 | 61 | ||
62 | #include <time.h> | 62 | #include <time.h> |
63 | #ifndef NO_BIO | 63 | #ifndef OPENSSL_NO_BIO |
64 | #include <openssl/bio.h> | 64 | #include <openssl/bio.h> |
65 | #endif | 65 | #endif |
66 | #include <openssl/e_os2.h> | ||
66 | #include <openssl/bn.h> | 67 | #include <openssl/bn.h> |
67 | #include <openssl/stack.h> | 68 | #include <openssl/stack.h> |
68 | #include <openssl/safestack.h> | 69 | #include <openssl/safestack.h> |
69 | 70 | ||
70 | #include <openssl/symhacks.h> | 71 | #include <openssl/symhacks.h> |
71 | 72 | ||
73 | #include <openssl/e_os2.h> | ||
74 | #include <openssl/ossl_typ.h> | ||
75 | |||
76 | #ifdef OPENSSL_BUILD_SHLIBCRYPTO | ||
77 | # undef OPENSSL_EXTERN | ||
78 | # define OPENSSL_EXTERN OPENSSL_EXPORT | ||
79 | #endif | ||
80 | |||
72 | #ifdef __cplusplus | 81 | #ifdef __cplusplus |
73 | extern "C" { | 82 | extern "C" { |
74 | #endif | 83 | #endif |
@@ -84,6 +93,7 @@ extern "C" { | |||
84 | 93 | ||
85 | #define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ | 94 | #define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ |
86 | #define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ | 95 | #define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ |
96 | #define V_ASN1_ANY -4 /* used in ASN1 template code */ | ||
87 | 97 | ||
88 | #define V_ASN1_NEG 0x100 /* negative flag */ | 98 | #define V_ASN1_NEG 0x100 /* negative flag */ |
89 | 99 | ||
@@ -136,6 +146,8 @@ extern "C" { | |||
136 | #define B_ASN1_BMPSTRING 0x0800 | 146 | #define B_ASN1_BMPSTRING 0x0800 |
137 | #define B_ASN1_UNKNOWN 0x1000 | 147 | #define B_ASN1_UNKNOWN 0x1000 |
138 | #define B_ASN1_UTF8STRING 0x2000 | 148 | #define B_ASN1_UTF8STRING 0x2000 |
149 | #define B_ASN1_UTCTIME 0x4000 | ||
150 | #define B_ASN1_GENERALIZEDTIME 0x8000 | ||
139 | 151 | ||
140 | /* For use with ASN1_mbstring_copy() */ | 152 | /* For use with ASN1_mbstring_copy() */ |
141 | #define MBSTRING_FLAG 0x1000 | 153 | #define MBSTRING_FLAG 0x1000 |
@@ -193,6 +205,21 @@ typedef struct asn1_string_st | |||
193 | long flags; | 205 | long flags; |
194 | } ASN1_STRING; | 206 | } ASN1_STRING; |
195 | 207 | ||
208 | /* ASN1_ENCODING structure: this is used to save the received | ||
209 | * encoding of an ASN1 type. This is useful to get round | ||
210 | * problems with invalid encodings which can break signatures. | ||
211 | */ | ||
212 | |||
213 | typedef struct ASN1_ENCODING_st | ||
214 | { | ||
215 | unsigned char *enc; /* DER encoding */ | ||
216 | long len; /* Length of encoding */ | ||
217 | int modified; /* set to 1 if 'enc' is invalid */ | ||
218 | } ASN1_ENCODING; | ||
219 | |||
220 | /* Used with ASN1 LONG type: if a long is set to this it is omitted */ | ||
221 | #define ASN1_LONG_UNDEF 0x7fffffffL | ||
222 | |||
196 | #define STABLE_FLAGS_MALLOC 0x01 | 223 | #define STABLE_FLAGS_MALLOC 0x01 |
197 | #define STABLE_NO_MASK 0x02 | 224 | #define STABLE_NO_MASK 0x02 |
198 | #define DIRSTRING_TYPE \ | 225 | #define DIRSTRING_TYPE \ |
@@ -220,43 +247,116 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE) | |||
220 | #define ub_title 64 | 247 | #define ub_title 64 |
221 | #define ub_email_address 128 | 248 | #define ub_email_address 128 |
222 | 249 | ||
223 | #ifdef NO_ASN1_TYPEDEFS | 250 | /* Declarations for template structures: for full definitions |
224 | #define ASN1_INTEGER ASN1_STRING | 251 | * see asn1t.h |
225 | #define ASN1_ENUMERATED ASN1_STRING | 252 | */ |
226 | #define ASN1_BIT_STRING ASN1_STRING | 253 | typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; |
227 | #define ASN1_OCTET_STRING ASN1_STRING | 254 | typedef struct ASN1_ITEM_st ASN1_ITEM; |
228 | #define ASN1_PRINTABLESTRING ASN1_STRING | 255 | typedef struct ASN1_TLC_st ASN1_TLC; |
229 | #define ASN1_T61STRING ASN1_STRING | 256 | /* This is just an opaque pointer */ |
230 | #define ASN1_IA5STRING ASN1_STRING | 257 | typedef struct ASN1_VALUE_st ASN1_VALUE; |
231 | #define ASN1_UTCTIME ASN1_STRING | 258 | |
232 | #define ASN1_GENERALIZEDTIME ASN1_STRING | 259 | /* Declare ASN1 functions: the implement macro in in asn1t.h */ |
233 | #define ASN1_TIME ASN1_STRING | 260 | |
234 | #define ASN1_GENERALSTRING ASN1_STRING | 261 | #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) |
235 | #define ASN1_UNIVERSALSTRING ASN1_STRING | 262 | |
236 | #define ASN1_BMPSTRING ASN1_STRING | 263 | #define DECLARE_ASN1_FUNCTIONS_name(type, name) \ |
237 | #define ASN1_VISIBLESTRING ASN1_STRING | 264 | type *name##_new(void); \ |
238 | #define ASN1_UTF8STRING ASN1_STRING | 265 | void name##_free(type *a); \ |
239 | #define ASN1_BOOLEAN int | 266 | DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) |
267 | |||
268 | #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ | ||
269 | type *name##_new(void); \ | ||
270 | void name##_free(type *a); \ | ||
271 | DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) | ||
272 | |||
273 | #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ | ||
274 | type *d2i_##name(type **a, unsigned char **in, long len); \ | ||
275 | int i2d_##name(type *a, unsigned char **out); \ | ||
276 | DECLARE_ASN1_ITEM(itname) | ||
277 | |||
278 | #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ | ||
279 | type *d2i_##name(type **a, const unsigned char **in, long len); \ | ||
280 | int i2d_##name(const type *a, unsigned char **out); \ | ||
281 | DECLARE_ASN1_ITEM(name) | ||
282 | |||
283 | #define DECLARE_ASN1_FUNCTIONS_const(name) \ | ||
284 | name *name##_new(void); \ | ||
285 | void name##_free(name *a); | ||
286 | |||
287 | |||
288 | /* The following macros and typedefs allow an ASN1_ITEM | ||
289 | * to be embedded in a structure and referenced. Since | ||
290 | * the ASN1_ITEM pointers need to be globally accessible | ||
291 | * (possibly from shared libraries) they may exist in | ||
292 | * different forms. On platforms that support it the | ||
293 | * ASN1_ITEM structure itself will be globally exported. | ||
294 | * Other platforms will export a function that returns | ||
295 | * an ASN1_ITEM pointer. | ||
296 | * | ||
297 | * To handle both cases transparently the macros below | ||
298 | * should be used instead of hard coding an ASN1_ITEM | ||
299 | * pointer in a structure. | ||
300 | * | ||
301 | * The structure will look like this: | ||
302 | * | ||
303 | * typedef struct SOMETHING_st { | ||
304 | * ... | ||
305 | * ASN1_ITEM_EXP *iptr; | ||
306 | * ... | ||
307 | * } SOMETHING; | ||
308 | * | ||
309 | * It would be initialised as e.g.: | ||
310 | * | ||
311 | * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; | ||
312 | * | ||
313 | * and the actual pointer extracted with: | ||
314 | * | ||
315 | * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); | ||
316 | * | ||
317 | * Finally an ASN1_ITEM pointer can be extracted from an | ||
318 | * appropriate reference with: ASN1_ITEM_rptr(X509). This | ||
319 | * would be used when a function takes an ASN1_ITEM * argument. | ||
320 | * | ||
321 | */ | ||
322 | |||
323 | #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION | ||
324 | |||
325 | /* ASN1_ITEM pointer exported type */ | ||
326 | typedef const ASN1_ITEM ASN1_ITEM_EXP; | ||
327 | |||
328 | /* Macro to obtain ASN1_ITEM pointer from exported type */ | ||
329 | #define ASN1_ITEM_ptr(iptr) (iptr) | ||
330 | |||
331 | /* Macro to include ASN1_ITEM pointer from base type */ | ||
332 | #define ASN1_ITEM_ref(iptr) (&(iptr##_it)) | ||
333 | |||
334 | #define ASN1_ITEM_rptr(ref) (&(ref##_it)) | ||
335 | |||
336 | #define DECLARE_ASN1_ITEM(name) \ | ||
337 | OPENSSL_EXTERN const ASN1_ITEM name##_it; | ||
338 | |||
240 | #else | 339 | #else |
241 | typedef struct asn1_string_st ASN1_INTEGER; | ||
242 | typedef struct asn1_string_st ASN1_ENUMERATED; | ||
243 | typedef struct asn1_string_st ASN1_BIT_STRING; | ||
244 | typedef struct asn1_string_st ASN1_OCTET_STRING; | ||
245 | typedef struct asn1_string_st ASN1_PRINTABLESTRING; | ||
246 | typedef struct asn1_string_st ASN1_T61STRING; | ||
247 | typedef struct asn1_string_st ASN1_IA5STRING; | ||
248 | typedef struct asn1_string_st ASN1_GENERALSTRING; | ||
249 | typedef struct asn1_string_st ASN1_UNIVERSALSTRING; | ||
250 | typedef struct asn1_string_st ASN1_BMPSTRING; | ||
251 | typedef struct asn1_string_st ASN1_UTCTIME; | ||
252 | typedef struct asn1_string_st ASN1_TIME; | ||
253 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; | ||
254 | typedef struct asn1_string_st ASN1_VISIBLESTRING; | ||
255 | typedef struct asn1_string_st ASN1_UTF8STRING; | ||
256 | typedef int ASN1_BOOLEAN; | ||
257 | #endif | ||
258 | 340 | ||
259 | typedef int ASN1_NULL; | 341 | /* Platforms that can't easily handle shared global variables are declared |
342 | * as functions returning ASN1_ITEM pointers. | ||
343 | */ | ||
344 | |||
345 | /* ASN1_ITEM pointer exported type */ | ||
346 | typedef const ASN1_ITEM * ASN1_ITEM_EXP(void); | ||
347 | |||
348 | /* Macro to obtain ASN1_ITEM pointer from exported type */ | ||
349 | #define ASN1_ITEM_ptr(iptr) (iptr()) | ||
350 | |||
351 | /* Macro to include ASN1_ITEM pointer from base type */ | ||
352 | #define ASN1_ITEM_ref(iptr) (iptr##_it) | ||
353 | |||
354 | #define ASN1_ITEM_rptr(ref) (ref##_it()) | ||
355 | |||
356 | #define DECLARE_ASN1_ITEM(name) \ | ||
357 | const ASN1_ITEM * name##_it(void); | ||
358 | |||
359 | #endif | ||
260 | 360 | ||
261 | /* Parameters used by ASN1_STRING_print_ex() */ | 361 | /* Parameters used by ASN1_STRING_print_ex() */ |
262 | 362 | ||
@@ -340,6 +440,8 @@ typedef int ASN1_NULL; | |||
340 | DECLARE_STACK_OF(ASN1_INTEGER) | 440 | DECLARE_STACK_OF(ASN1_INTEGER) |
341 | DECLARE_ASN1_SET_OF(ASN1_INTEGER) | 441 | DECLARE_ASN1_SET_OF(ASN1_INTEGER) |
342 | 442 | ||
443 | DECLARE_STACK_OF(ASN1_GENERALSTRING) | ||
444 | |||
343 | typedef struct asn1_type_st | 445 | typedef struct asn1_type_st |
344 | { | 446 | { |
345 | int type; | 447 | int type; |
@@ -438,12 +540,11 @@ typedef struct BIT_STRING_BITNAME_st { | |||
438 | i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\ | 540 | i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\ |
439 | V_ASN1_UNIVERSAL) | 541 | V_ASN1_UNIVERSAL) |
440 | 542 | ||
441 | #define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) | 543 | #define B_ASN1_TIME \ |
442 | #define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) | 544 | B_ASN1_UTCTIME | \ |
443 | #define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ | 545 | B_ASN1_GENERALIZEDTIME |
444 | pp,a->type,V_ASN1_UNIVERSAL) | 546 | |
445 | #define M_d2i_ASN1_PRINTABLE(a,pp,l) \ | 547 | #define B_ASN1_PRINTABLE \ |
446 | d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ | ||
447 | B_ASN1_PRINTABLESTRING| \ | 548 | B_ASN1_PRINTABLESTRING| \ |
448 | B_ASN1_T61STRING| \ | 549 | B_ASN1_T61STRING| \ |
449 | B_ASN1_IA5STRING| \ | 550 | B_ASN1_IA5STRING| \ |
@@ -451,7 +552,28 @@ typedef struct BIT_STRING_BITNAME_st { | |||
451 | B_ASN1_UNIVERSALSTRING|\ | 552 | B_ASN1_UNIVERSALSTRING|\ |
452 | B_ASN1_BMPSTRING|\ | 553 | B_ASN1_BMPSTRING|\ |
453 | B_ASN1_UTF8STRING|\ | 554 | B_ASN1_UTF8STRING|\ |
454 | B_ASN1_UNKNOWN) | 555 | B_ASN1_UNKNOWN |
556 | |||
557 | #define B_ASN1_DIRECTORYSTRING \ | ||
558 | B_ASN1_PRINTABLESTRING| \ | ||
559 | B_ASN1_TELETEXSTRING|\ | ||
560 | B_ASN1_BMPSTRING|\ | ||
561 | B_ASN1_UNIVERSALSTRING|\ | ||
562 | B_ASN1_UTF8STRING | ||
563 | |||
564 | #define B_ASN1_DISPLAYTEXT \ | ||
565 | B_ASN1_IA5STRING| \ | ||
566 | B_ASN1_VISIBLESTRING| \ | ||
567 | B_ASN1_BMPSTRING|\ | ||
568 | B_ASN1_UTF8STRING | ||
569 | |||
570 | #define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) | ||
571 | #define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) | ||
572 | #define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\ | ||
573 | pp,a->type,V_ASN1_UNIVERSAL) | ||
574 | #define M_d2i_ASN1_PRINTABLE(a,pp,l) \ | ||
575 | d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ | ||
576 | B_ASN1_PRINTABLE) | ||
455 | 577 | ||
456 | #define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) | 578 | #define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) |
457 | #define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) | 579 | #define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) |
@@ -459,11 +581,7 @@ typedef struct BIT_STRING_BITNAME_st { | |||
459 | pp,a->type,V_ASN1_UNIVERSAL) | 581 | pp,a->type,V_ASN1_UNIVERSAL) |
460 | #define M_d2i_DIRECTORYSTRING(a,pp,l) \ | 582 | #define M_d2i_DIRECTORYSTRING(a,pp,l) \ |
461 | d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ | 583 | d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ |
462 | B_ASN1_PRINTABLESTRING| \ | 584 | B_ASN1_DIRECTORYSTRING) |
463 | B_ASN1_TELETEXSTRING|\ | ||
464 | B_ASN1_BMPSTRING|\ | ||
465 | B_ASN1_UNIVERSALSTRING|\ | ||
466 | B_ASN1_UTF8STRING) | ||
467 | 585 | ||
468 | #define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) | 586 | #define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) |
469 | #define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) | 587 | #define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) |
@@ -471,9 +589,7 @@ typedef struct BIT_STRING_BITNAME_st { | |||
471 | pp,a->type,V_ASN1_UNIVERSAL) | 589 | pp,a->type,V_ASN1_UNIVERSAL) |
472 | #define M_d2i_DISPLAYTEXT(a,pp,l) \ | 590 | #define M_d2i_DISPLAYTEXT(a,pp,l) \ |
473 | d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ | 591 | d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \ |
474 | B_ASN1_VISIBLESTRING| \ | 592 | B_ASN1_DISPLAYTEXT) |
475 | B_ASN1_BMPSTRING|\ | ||
476 | B_ASN1_UTF8STRING) | ||
477 | 593 | ||
478 | #define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ | 594 | #define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ |
479 | ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) | 595 | ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) |
@@ -577,10 +693,8 @@ typedef struct BIT_STRING_BITNAME_st { | |||
577 | #define IS_SEQUENCE 0 | 693 | #define IS_SEQUENCE 0 |
578 | #define IS_SET 1 | 694 | #define IS_SET 1 |
579 | 695 | ||
580 | ASN1_TYPE * ASN1_TYPE_new(void ); | 696 | DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) |
581 | void ASN1_TYPE_free(ASN1_TYPE *a); | 697 | |
582 | int i2d_ASN1_TYPE(ASN1_TYPE *a,unsigned char **pp); | ||
583 | ASN1_TYPE * d2i_ASN1_TYPE(ASN1_TYPE **a,unsigned char **pp,long length); | ||
584 | int ASN1_TYPE_get(ASN1_TYPE *a); | 698 | int ASN1_TYPE_get(ASN1_TYPE *a); |
585 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); | 699 | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); |
586 | 700 | ||
@@ -592,6 +706,8 @@ ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp, | |||
592 | ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp, | 706 | ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp, |
593 | long length); | 707 | long length); |
594 | 708 | ||
709 | DECLARE_ASN1_ITEM(ASN1_OBJECT) | ||
710 | |||
595 | DECLARE_STACK_OF(ASN1_OBJECT) | 711 | DECLARE_STACK_OF(ASN1_OBJECT) |
596 | DECLARE_ASN1_SET_OF(ASN1_OBJECT) | 712 | DECLARE_ASN1_SET_OF(ASN1_OBJECT) |
597 | 713 | ||
@@ -608,12 +724,8 @@ void ASN1_STRING_length_set(ASN1_STRING *x, int n); | |||
608 | int ASN1_STRING_type(ASN1_STRING *x); | 724 | int ASN1_STRING_type(ASN1_STRING *x); |
609 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); | 725 | unsigned char * ASN1_STRING_data(ASN1_STRING *x); |
610 | 726 | ||
611 | ASN1_BIT_STRING * ASN1_BIT_STRING_new(void); | 727 | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) |
612 | void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a); | ||
613 | int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); | ||
614 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); | 728 | int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); |
615 | ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp, | ||
616 | long length); | ||
617 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp, | 729 | ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp, |
618 | long length); | 730 | long length); |
619 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, | 731 | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, |
@@ -621,7 +733,7 @@ int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, | |||
621 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); | 733 | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); |
622 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); | 734 | int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); |
623 | 735 | ||
624 | #ifndef NO_BIO | 736 | #ifndef OPENSSL_NO_BIO |
625 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, | 737 | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, |
626 | BIT_STRING_BITNAME *tbl, int indent); | 738 | BIT_STRING_BITNAME *tbl, int indent); |
627 | #endif | 739 | #endif |
@@ -632,12 +744,8 @@ int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value, | |||
632 | int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); | 744 | int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); |
633 | int d2i_ASN1_BOOLEAN(int *a,unsigned char **pp,long length); | 745 | int d2i_ASN1_BOOLEAN(int *a,unsigned char **pp,long length); |
634 | 746 | ||
635 | ASN1_INTEGER * ASN1_INTEGER_new(void); | 747 | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) |
636 | void ASN1_INTEGER_free(ASN1_INTEGER *a); | ||
637 | int i2d_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); | ||
638 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); | 748 | int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); |
639 | ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp, | ||
640 | long length); | ||
641 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp, | 749 | ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp, |
642 | long length); | 750 | long length); |
643 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp, | 751 | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp, |
@@ -645,11 +753,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp, | |||
645 | ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); | 753 | ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x); |
646 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y); | 754 | int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y); |
647 | 755 | ||
648 | ASN1_ENUMERATED * ASN1_ENUMERATED_new(void); | 756 | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) |
649 | void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a); | ||
650 | int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a,unsigned char **pp); | ||
651 | ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a,unsigned char **pp, | ||
652 | long length); | ||
653 | 757 | ||
654 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); | 758 | int ASN1_UTCTIME_check(ASN1_UTCTIME *a); |
655 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); | 759 | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); |
@@ -663,91 +767,34 @@ int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | |||
663 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); | 767 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); |
664 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str); | 768 | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str); |
665 | 769 | ||
666 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_new(void); | 770 | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) |
667 | void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a); | ||
668 | int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a,unsigned char **pp); | ||
669 | ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a, | ||
670 | unsigned char **pp,long length); | ||
671 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a); | 771 | ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a); |
672 | int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); | 772 | int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b); |
673 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, unsigned char *data, int len); | 773 | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, unsigned char *data, int len); |
674 | 774 | ||
675 | ASN1_VISIBLESTRING * ASN1_VISIBLESTRING_new(void); | 775 | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) |
676 | void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a); | 776 | DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) |
677 | int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a,unsigned char **pp); | 777 | DECLARE_ASN1_FUNCTIONS(ASN1_NULL) |
678 | ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a, | 778 | DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) |
679 | unsigned char **pp,long length); | ||
680 | |||
681 | ASN1_UTF8STRING * ASN1_UTF8STRING_new(void); | ||
682 | void ASN1_UTF8STRING_free(ASN1_UTF8STRING *a); | ||
683 | int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a,unsigned char **pp); | ||
684 | ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a, | ||
685 | unsigned char **pp,long length); | ||
686 | |||
687 | ASN1_NULL * ASN1_NULL_new(void); | ||
688 | void ASN1_NULL_free(ASN1_NULL *a); | ||
689 | int i2d_ASN1_NULL(ASN1_NULL *a,unsigned char **pp); | ||
690 | ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, unsigned char **pp,long length); | ||
691 | |||
692 | ASN1_BMPSTRING * ASN1_BMPSTRING_new(void); | ||
693 | void ASN1_BMPSTRING_free(ASN1_BMPSTRING *a); | ||
694 | int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp); | ||
695 | ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp, | ||
696 | long length); | ||
697 | |||
698 | 779 | ||
699 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); | 780 | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); |
700 | int UTF8_putc(unsigned char *str, int len, unsigned long value); | 781 | int UTF8_putc(unsigned char *str, int len, unsigned long value); |
701 | 782 | ||
702 | int i2d_ASN1_PRINTABLE(ASN1_STRING *a,unsigned char **pp); | 783 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) |
703 | ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a, | ||
704 | unsigned char **pp, long l); | ||
705 | |||
706 | ASN1_PRINTABLESTRING * ASN1_PRINTABLESTRING_new(void); | ||
707 | void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a); | ||
708 | ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a, | ||
709 | unsigned char **pp, long l); | ||
710 | int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **pp); | ||
711 | |||
712 | ASN1_STRING * DIRECTORYSTRING_new(void); | ||
713 | void DIRECTORYSTRING_free(ASN1_STRING *a); | ||
714 | int i2d_DIRECTORYSTRING(ASN1_STRING *a,unsigned char **pp); | ||
715 | ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp, | ||
716 | long length); | ||
717 | |||
718 | ASN1_STRING * DISPLAYTEXT_new(void); | ||
719 | void DISPLAYTEXT_free(ASN1_STRING *a); | ||
720 | int i2d_DISPLAYTEXT(ASN1_STRING *a,unsigned char **pp); | ||
721 | ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp, long length); | ||
722 | |||
723 | ASN1_T61STRING * ASN1_T61STRING_new(void); | ||
724 | void ASN1_T61STRING_free(ASN1_IA5STRING *a); | ||
725 | ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a, | ||
726 | unsigned char **pp, long l); | ||
727 | |||
728 | ASN1_IA5STRING * ASN1_IA5STRING_new(void); | ||
729 | void ASN1_IA5STRING_free(ASN1_IA5STRING *a); | ||
730 | int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a,unsigned char **pp); | ||
731 | ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a, | ||
732 | unsigned char **pp, long l); | ||
733 | |||
734 | ASN1_UTCTIME * ASN1_UTCTIME_new(void); | ||
735 | void ASN1_UTCTIME_free(ASN1_UTCTIME *a); | ||
736 | int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a,unsigned char **pp); | ||
737 | ASN1_UTCTIME * d2i_ASN1_UTCTIME(ASN1_UTCTIME **a,unsigned char **pp, | ||
738 | long length); | ||
739 | 784 | ||
740 | ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_new(void); | 785 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) |
741 | void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a); | 786 | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) |
742 | int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a,unsigned char **pp); | 787 | DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) |
743 | ASN1_GENERALIZEDTIME * d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,unsigned char **pp, | 788 | DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) |
744 | long length); | 789 | DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) |
790 | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) | ||
791 | DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) | ||
792 | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) | ||
793 | DECLARE_ASN1_FUNCTIONS(ASN1_TIME) | ||
745 | 794 | ||
746 | ASN1_TIME * ASN1_TIME_new(void); | ||
747 | void ASN1_TIME_free(ASN1_TIME *a); | ||
748 | int i2d_ASN1_TIME(ASN1_TIME *a,unsigned char **pp); | ||
749 | ASN1_TIME * d2i_ASN1_TIME(ASN1_TIME **a,unsigned char **pp, long length); | ||
750 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); | 795 | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); |
796 | int ASN1_TIME_check(ASN1_TIME *t); | ||
797 | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); | ||
751 | 798 | ||
752 | int i2d_ASN1_SET(STACK *a, unsigned char **pp, | 799 | int i2d_ASN1_SET(STACK *a, unsigned char **pp, |
753 | int (*func)(), int ex_tag, int ex_class, int is_set); | 800 | int (*func)(), int ex_tag, int ex_class, int is_set); |
@@ -755,7 +802,7 @@ STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, | |||
755 | char *(*func)(), void (*free_func)(void *), | 802 | char *(*func)(), void (*free_func)(void *), |
756 | int ex_tag, int ex_class); | 803 | int ex_tag, int ex_class); |
757 | 804 | ||
758 | #ifndef NO_BIO | 805 | #ifndef OPENSSL_NO_BIO |
759 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); | 806 | int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); |
760 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); | 807 | int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size); |
761 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); | 808 | int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); |
@@ -768,7 +815,7 @@ int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); | |||
768 | 815 | ||
769 | int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num); | 816 | int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num); |
770 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, | 817 | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, |
771 | char *sn, char *ln); | 818 | const char *sn, const char *ln); |
772 | 819 | ||
773 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); | 820 | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); |
774 | long ASN1_INTEGER_get(ASN1_INTEGER *a); | 821 | long ASN1_INTEGER_get(ASN1_INTEGER *a); |
@@ -787,6 +834,7 @@ int ASN1_PRINTABLE_type(unsigned char *s, int max); | |||
787 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); | 834 | int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass); |
788 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, | 835 | ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp, |
789 | long length, int Ptag, int Pclass); | 836 | long length, int Ptag, int Pclass); |
837 | unsigned long ASN1_tag2bit(int tag); | ||
790 | /* type is one or more of the B_ASN1_ values. */ | 838 | /* type is one or more of the B_ASN1_ values. */ |
791 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,unsigned char **pp, | 839 | ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,unsigned char **pp, |
792 | long length,int type); | 840 | long length,int type); |
@@ -805,17 +853,23 @@ int ASN1_object_size(int constructed, int length, int tag); | |||
805 | /* Used to implement other functions */ | 853 | /* Used to implement other functions */ |
806 | char *ASN1_dup(int (*i2d)(),char *(*d2i)(),char *x); | 854 | char *ASN1_dup(int (*i2d)(),char *(*d2i)(),char *x); |
807 | 855 | ||
808 | #ifndef NO_FP_API | 856 | void *ASN1_item_dup(const ASN1_ITEM *it, void *x); |
857 | |||
858 | #ifndef OPENSSL_NO_FP_API | ||
809 | char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x); | 859 | char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x); |
860 | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); | ||
810 | int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x); | 861 | int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x); |
862 | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); | ||
811 | int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); | 863 | int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); |
812 | #endif | 864 | #endif |
813 | 865 | ||
814 | int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); | 866 | int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); |
815 | 867 | ||
816 | #ifndef NO_BIO | 868 | #ifndef OPENSSL_NO_BIO |
817 | char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x); | 869 | char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x); |
870 | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); | ||
818 | int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x); | 871 | int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x); |
872 | int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); | ||
819 | int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); | 873 | int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a); |
820 | int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); | 874 | int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a); |
821 | int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); | 875 | int ASN1_TIME_print(BIO *fp,ASN1_TIME *a); |
@@ -834,8 +888,6 @@ void ASN1_HEADER_free(ASN1_HEADER *a); | |||
834 | 888 | ||
835 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); | 889 | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); |
836 | 890 | ||
837 | void ERR_load_ASN1_strings(void); | ||
838 | |||
839 | /* Not used that much at this point, except for the first two */ | 891 | /* Not used that much at this point, except for the first two */ |
840 | ASN1_METHOD *X509_asn1_meth(void); | 892 | ASN1_METHOD *X509_asn1_meth(void); |
841 | ASN1_METHOD *RSAPrivateKey_asn1_meth(void); | 893 | ASN1_METHOD *RSAPrivateKey_asn1_meth(void); |
@@ -856,7 +908,9 @@ STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(), | |||
856 | unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, | 908 | unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf, |
857 | int *len ); | 909 | int *len ); |
858 | void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)()); | 910 | void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)()); |
911 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); | ||
859 | ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct); | 912 | ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct); |
913 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); | ||
860 | 914 | ||
861 | void ASN1_STRING_set_default_mask(unsigned long mask); | 915 | void ASN1_STRING_set_default_mask(unsigned long mask); |
862 | int ASN1_STRING_set_default_mask_asc(char *p); | 916 | int ASN1_STRING_set_default_mask_asc(char *p); |
@@ -873,279 +927,177 @@ ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); | |||
873 | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); | 927 | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); |
874 | void ASN1_STRING_TABLE_cleanup(void); | 928 | void ASN1_STRING_TABLE_cleanup(void); |
875 | 929 | ||
930 | /* ASN1 template functions */ | ||
931 | |||
932 | /* Old API compatible functions */ | ||
933 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); | ||
934 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); | ||
935 | ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_ITEM *it); | ||
936 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); | ||
937 | |||
938 | void ASN1_add_oid_module(void); | ||
939 | |||
876 | /* BEGIN ERROR CODES */ | 940 | /* BEGIN ERROR CODES */ |
877 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 941 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
878 | * made after this point may be overwritten when the script is next run. | 942 | * made after this point may be overwritten when the script is next run. |
879 | */ | 943 | */ |
944 | void ERR_load_ASN1_strings(void); | ||
880 | 945 | ||
881 | /* Error codes for the ASN1 functions. */ | 946 | /* Error codes for the ASN1 functions. */ |
882 | 947 | ||
883 | /* Function codes. */ | 948 | /* Function codes. */ |
884 | #define ASN1_F_A2D_ASN1_OBJECT 100 | 949 | #define ASN1_F_A2D_ASN1_OBJECT 100 |
885 | #define ASN1_F_A2I_ASN1_ENUMERATED 236 | 950 | #define ASN1_F_A2I_ASN1_ENUMERATED 101 |
886 | #define ASN1_F_A2I_ASN1_INTEGER 101 | 951 | #define ASN1_F_A2I_ASN1_INTEGER 102 |
887 | #define ASN1_F_A2I_ASN1_STRING 102 | 952 | #define ASN1_F_A2I_ASN1_STRING 103 |
888 | #define ASN1_F_ACCESS_DESCRIPTION_NEW 291 | 953 | #define ASN1_F_ASN1_CHECK_TLEN 104 |
889 | #define ASN1_F_ASN1_COLLATE_PRIMITIVE 103 | 954 | #define ASN1_F_ASN1_COLLATE_PRIMITIVE 105 |
890 | #define ASN1_F_ASN1_D2I_BIO 104 | 955 | #define ASN1_F_ASN1_COLLECT 106 |
891 | #define ASN1_F_ASN1_D2I_FP 105 | 956 | #define ASN1_F_ASN1_D2I_BIO 107 |
892 | #define ASN1_F_ASN1_DUP 106 | 957 | #define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108 |
893 | #define ASN1_F_ASN1_ENUMERATED_SET 232 | 958 | #define ASN1_F_ASN1_D2I_FP 109 |
894 | #define ASN1_F_ASN1_ENUMERATED_TO_BN 233 | 959 | #define ASN1_F_ASN1_DO_ADB 110 |
895 | #define ASN1_F_ASN1_GENERALIZEDTIME_NEW 222 | 960 | #define ASN1_F_ASN1_DUP 111 |
896 | #define ASN1_F_ASN1_GET_OBJECT 107 | 961 | #define ASN1_F_ASN1_ENUMERATED_SET 112 |
897 | #define ASN1_F_ASN1_HEADER_NEW 108 | 962 | #define ASN1_F_ASN1_ENUMERATED_TO_BN 113 |
898 | #define ASN1_F_ASN1_I2D_BIO 109 | 963 | #define ASN1_F_ASN1_GET_OBJECT 114 |
899 | #define ASN1_F_ASN1_I2D_FP 110 | 964 | #define ASN1_F_ASN1_HEADER_NEW 115 |
900 | #define ASN1_F_ASN1_INTEGER_SET 111 | 965 | #define ASN1_F_ASN1_I2D_BIO 116 |
901 | #define ASN1_F_ASN1_INTEGER_TO_BN 112 | 966 | #define ASN1_F_ASN1_I2D_FP 117 |
902 | #define ASN1_F_ASN1_MBSTRING_COPY 282 | 967 | #define ASN1_F_ASN1_INTEGER_SET 118 |
903 | #define ASN1_F_ASN1_OBJECT_NEW 113 | 968 | #define ASN1_F_ASN1_INTEGER_TO_BN 119 |
904 | #define ASN1_F_ASN1_PACK_STRING 245 | 969 | #define ASN1_F_ASN1_ITEM_EX_D2I 120 |
905 | #define ASN1_F_ASN1_PBE_SET 253 | 970 | #define ASN1_F_ASN1_ITEM_NEW 121 |
906 | #define ASN1_F_ASN1_SEQ_PACK 246 | 971 | #define ASN1_F_ASN1_MBSTRING_COPY 122 |
907 | #define ASN1_F_ASN1_SEQ_UNPACK 247 | 972 | #define ASN1_F_ASN1_OBJECT_NEW 123 |
908 | #define ASN1_F_ASN1_SIGN 114 | 973 | #define ASN1_F_ASN1_PACK_STRING 124 |
909 | #define ASN1_F_ASN1_STRING_NEW 115 | 974 | #define ASN1_F_ASN1_PBE_SET 125 |
910 | #define ASN1_F_ASN1_STRING_TABLE_ADD 283 | 975 | #define ASN1_F_ASN1_SEQ_PACK 126 |
911 | #define ASN1_F_ASN1_STRING_TYPE_NEW 116 | 976 | #define ASN1_F_ASN1_SEQ_UNPACK 127 |
912 | #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 117 | 977 | #define ASN1_F_ASN1_SIGN 128 |
913 | #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 118 | 978 | #define ASN1_F_ASN1_STRING_TABLE_ADD 129 |
914 | #define ASN1_F_ASN1_TYPE_NEW 119 | 979 | #define ASN1_F_ASN1_STRING_TYPE_NEW 130 |
915 | #define ASN1_F_ASN1_UNPACK_STRING 248 | 980 | #define ASN1_F_ASN1_TEMPLATE_D2I 131 |
916 | #define ASN1_F_ASN1_UTCTIME_NEW 120 | 981 | #define ASN1_F_ASN1_TEMPLATE_EX_D2I 132 |
917 | #define ASN1_F_ASN1_VERIFY 121 | 982 | #define ASN1_F_ASN1_TEMPLATE_NEW 133 |
918 | #define ASN1_F_AUTHORITY_KEYID_NEW 237 | 983 | #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134 |
919 | #define ASN1_F_BASIC_CONSTRAINTS_NEW 226 | 984 | #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135 |
920 | #define ASN1_F_BN_TO_ASN1_ENUMERATED 234 | 985 | #define ASN1_F_ASN1_UNPACK_STRING 136 |
921 | #define ASN1_F_BN_TO_ASN1_INTEGER 122 | 986 | #define ASN1_F_ASN1_VERIFY 137 |
922 | #define ASN1_F_D2I_ACCESS_DESCRIPTION 284 | 987 | #define ASN1_F_BN_TO_ASN1_ENUMERATED 138 |
923 | #define ASN1_F_D2I_ASN1_BIT_STRING 123 | 988 | #define ASN1_F_BN_TO_ASN1_INTEGER 139 |
924 | #define ASN1_F_D2I_ASN1_BMPSTRING 124 | 989 | #define ASN1_F_COLLECT_DATA 140 |
925 | #define ASN1_F_D2I_ASN1_BOOLEAN 125 | 990 | #define ASN1_F_D2I_ASN1_BIT_STRING 141 |
926 | #define ASN1_F_D2I_ASN1_BYTES 126 | 991 | #define ASN1_F_D2I_ASN1_BOOLEAN 142 |
927 | #define ASN1_F_D2I_ASN1_ENUMERATED 235 | 992 | #define ASN1_F_D2I_ASN1_BYTES 143 |
928 | #define ASN1_F_D2I_ASN1_GENERALIZEDTIME 223 | 993 | #define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144 |
929 | #define ASN1_F_D2I_ASN1_HEADER 127 | 994 | #define ASN1_F_D2I_ASN1_HEADER 145 |
930 | #define ASN1_F_D2I_ASN1_INTEGER 128 | 995 | #define ASN1_F_D2I_ASN1_INTEGER 146 |
931 | #define ASN1_F_D2I_ASN1_NULL 292 | 996 | #define ASN1_F_D2I_ASN1_OBJECT 147 |
932 | #define ASN1_F_D2I_ASN1_OBJECT 129 | 997 | #define ASN1_F_D2I_ASN1_SET 148 |
933 | #define ASN1_F_D2I_ASN1_OCTET_STRING 130 | 998 | #define ASN1_F_D2I_ASN1_TYPE_BYTES 149 |
934 | #define ASN1_F_D2I_ASN1_PRINT_TYPE 131 | 999 | #define ASN1_F_D2I_ASN1_UINTEGER 150 |
935 | #define ASN1_F_D2I_ASN1_SET 132 | 1000 | #define ASN1_F_D2I_ASN1_UTCTIME 151 |
936 | #define ASN1_F_D2I_ASN1_TIME 224 | 1001 | #define ASN1_F_D2I_NETSCAPE_RSA 152 |
937 | #define ASN1_F_D2I_ASN1_TYPE 133 | 1002 | #define ASN1_F_D2I_NETSCAPE_RSA_2 153 |
938 | #define ASN1_F_D2I_ASN1_TYPE_BYTES 134 | 1003 | #define ASN1_F_D2I_PRIVATEKEY 154 |
939 | #define ASN1_F_D2I_ASN1_UINTEGER 280 | 1004 | #define ASN1_F_D2I_PUBLICKEY 155 |
940 | #define ASN1_F_D2I_ASN1_UTCTIME 135 | 1005 | #define ASN1_F_D2I_X509 156 |
941 | #define ASN1_F_D2I_ASN1_UTF8STRING 266 | 1006 | #define ASN1_F_D2I_X509_CINF 157 |
942 | #define ASN1_F_D2I_ASN1_VISIBLESTRING 267 | 1007 | #define ASN1_F_D2I_X509_NAME 158 |
943 | #define ASN1_F_D2I_AUTHORITY_KEYID 238 | 1008 | #define ASN1_F_D2I_X509_PKEY 159 |
944 | #define ASN1_F_D2I_BASIC_CONSTRAINTS 227 | 1009 | #define ASN1_F_I2D_ASN1_TIME 160 |
945 | #define ASN1_F_D2I_DHPARAMS 136 | 1010 | #define ASN1_F_I2D_DSA_PUBKEY 161 |
946 | #define ASN1_F_D2I_DIST_POINT 276 | 1011 | #define ASN1_F_I2D_NETSCAPE_RSA 162 |
947 | #define ASN1_F_D2I_DIST_POINT_NAME 277 | 1012 | #define ASN1_F_I2D_PRIVATEKEY 163 |
948 | #define ASN1_F_D2I_DSAPARAMS 137 | 1013 | #define ASN1_F_I2D_PUBLICKEY 164 |
949 | #define ASN1_F_D2I_DSAPRIVATEKEY 138 | 1014 | #define ASN1_F_I2D_RSA_PUBKEY 165 |
950 | #define ASN1_F_D2I_DSAPUBLICKEY 139 | 1015 | #define ASN1_F_LONG_C2I 166 |
951 | #define ASN1_F_D2I_GENERAL_NAME 230 | 1016 | #define ASN1_F_OID_MODULE_INIT 174 |
952 | #define ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE 228 | 1017 | #define ASN1_F_PKCS5_PBE2_SET 167 |
953 | #define ASN1_F_D2I_NETSCAPE_PKEY 140 | 1018 | #define ASN1_F_X509_CINF_NEW 168 |
954 | #define ASN1_F_D2I_NETSCAPE_RSA 141 | 1019 | #define ASN1_F_X509_CRL_ADD0_REVOKED 169 |
955 | #define ASN1_F_D2I_NETSCAPE_RSA_2 142 | 1020 | #define ASN1_F_X509_INFO_NEW 170 |
956 | #define ASN1_F_D2I_NETSCAPE_SPKAC 143 | 1021 | #define ASN1_F_X509_NAME_NEW 171 |
957 | #define ASN1_F_D2I_NETSCAPE_SPKI 144 | 1022 | #define ASN1_F_X509_NEW 172 |
958 | #define ASN1_F_D2I_NOTICEREF 268 | 1023 | #define ASN1_F_X509_PKEY_NEW 173 |
959 | #define ASN1_F_D2I_OTHERNAME 287 | ||
960 | #define ASN1_F_D2I_PBE2PARAM 262 | ||
961 | #define ASN1_F_D2I_PBEPARAM 249 | ||
962 | #define ASN1_F_D2I_PBKDF2PARAM 263 | ||
963 | #define ASN1_F_D2I_PKCS12 254 | ||
964 | #define ASN1_F_D2I_PKCS12_BAGS 255 | ||
965 | #define ASN1_F_D2I_PKCS12_MAC_DATA 256 | ||
966 | #define ASN1_F_D2I_PKCS12_SAFEBAG 257 | ||
967 | #define ASN1_F_D2I_PKCS7 145 | ||
968 | #define ASN1_F_D2I_PKCS7_DIGEST 146 | ||
969 | #define ASN1_F_D2I_PKCS7_ENCRYPT 147 | ||
970 | #define ASN1_F_D2I_PKCS7_ENC_CONTENT 148 | ||
971 | #define ASN1_F_D2I_PKCS7_ENVELOPE 149 | ||
972 | #define ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL 150 | ||
973 | #define ASN1_F_D2I_PKCS7_RECIP_INFO 151 | ||
974 | #define ASN1_F_D2I_PKCS7_SIGNED 152 | ||
975 | #define ASN1_F_D2I_PKCS7_SIGNER_INFO 153 | ||
976 | #define ASN1_F_D2I_PKCS7_SIGN_ENVELOPE 154 | ||
977 | #define ASN1_F_D2I_PKCS8_PRIV_KEY_INFO 250 | ||
978 | #define ASN1_F_D2I_PKEY_USAGE_PERIOD 239 | ||
979 | #define ASN1_F_D2I_POLICYINFO 269 | ||
980 | #define ASN1_F_D2I_POLICYQUALINFO 270 | ||
981 | #define ASN1_F_D2I_PRIVATEKEY 155 | ||
982 | #define ASN1_F_D2I_PUBLICKEY 156 | ||
983 | #define ASN1_F_D2I_RSAPRIVATEKEY 157 | ||
984 | #define ASN1_F_D2I_RSAPUBLICKEY 158 | ||
985 | #define ASN1_F_D2I_SXNET 241 | ||
986 | #define ASN1_F_D2I_SXNETID 243 | ||
987 | #define ASN1_F_D2I_USERNOTICE 271 | ||
988 | #define ASN1_F_D2I_X509 159 | ||
989 | #define ASN1_F_D2I_X509_ALGOR 160 | ||
990 | #define ASN1_F_D2I_X509_ATTRIBUTE 161 | ||
991 | #define ASN1_F_D2I_X509_CERT_AUX 285 | ||
992 | #define ASN1_F_D2I_X509_CINF 162 | ||
993 | #define ASN1_F_D2I_X509_CRL 163 | ||
994 | #define ASN1_F_D2I_X509_CRL_INFO 164 | ||
995 | #define ASN1_F_D2I_X509_EXTENSION 165 | ||
996 | #define ASN1_F_D2I_X509_KEY 166 | ||
997 | #define ASN1_F_D2I_X509_NAME 167 | ||
998 | #define ASN1_F_D2I_X509_NAME_ENTRY 168 | ||
999 | #define ASN1_F_D2I_X509_PKEY 169 | ||
1000 | #define ASN1_F_D2I_X509_PUBKEY 170 | ||
1001 | #define ASN1_F_D2I_X509_REQ 171 | ||
1002 | #define ASN1_F_D2I_X509_REQ_INFO 172 | ||
1003 | #define ASN1_F_D2I_X509_REVOKED 173 | ||
1004 | #define ASN1_F_D2I_X509_SIG 174 | ||
1005 | #define ASN1_F_D2I_X509_VAL 175 | ||
1006 | #define ASN1_F_DIST_POINT_NAME_NEW 278 | ||
1007 | #define ASN1_F_DIST_POINT_NEW 279 | ||
1008 | #define ASN1_F_GENERAL_NAME_NEW 231 | ||
1009 | #define ASN1_F_I2D_ASN1_HEADER 176 | ||
1010 | #define ASN1_F_I2D_ASN1_TIME 225 | ||
1011 | #define ASN1_F_I2D_DHPARAMS 177 | ||
1012 | #define ASN1_F_I2D_DSAPARAMS 178 | ||
1013 | #define ASN1_F_I2D_DSAPRIVATEKEY 179 | ||
1014 | #define ASN1_F_I2D_DSAPUBLICKEY 180 | ||
1015 | #define ASN1_F_I2D_DSA_PUBKEY 290 | ||
1016 | #define ASN1_F_I2D_NETSCAPE_RSA 181 | ||
1017 | #define ASN1_F_I2D_PKCS7 182 | ||
1018 | #define ASN1_F_I2D_PRIVATEKEY 183 | ||
1019 | #define ASN1_F_I2D_PUBLICKEY 184 | ||
1020 | #define ASN1_F_I2D_RSAPRIVATEKEY 185 | ||
1021 | #define ASN1_F_I2D_RSAPUBLICKEY 186 | ||
1022 | #define ASN1_F_I2D_RSA_PUBKEY 289 | ||
1023 | #define ASN1_F_I2D_X509_ATTRIBUTE 187 | ||
1024 | #define ASN1_F_I2T_ASN1_OBJECT 188 | ||
1025 | #define ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW 229 | ||
1026 | #define ASN1_F_NETSCAPE_PKEY_NEW 189 | ||
1027 | #define ASN1_F_NETSCAPE_SPKAC_NEW 190 | ||
1028 | #define ASN1_F_NETSCAPE_SPKI_NEW 191 | ||
1029 | #define ASN1_F_NOTICEREF_NEW 272 | ||
1030 | #define ASN1_F_OTHERNAME_NEW 288 | ||
1031 | #define ASN1_F_PBE2PARAM_NEW 264 | ||
1032 | #define ASN1_F_PBEPARAM_NEW 251 | ||
1033 | #define ASN1_F_PBKDF2PARAM_NEW 265 | ||
1034 | #define ASN1_F_PKCS12_BAGS_NEW 258 | ||
1035 | #define ASN1_F_PKCS12_MAC_DATA_NEW 259 | ||
1036 | #define ASN1_F_PKCS12_NEW 260 | ||
1037 | #define ASN1_F_PKCS12_SAFEBAG_NEW 261 | ||
1038 | #define ASN1_F_PKCS5_PBE2_SET 281 | ||
1039 | #define ASN1_F_PKCS7_DIGEST_NEW 192 | ||
1040 | #define ASN1_F_PKCS7_ENCRYPT_NEW 193 | ||
1041 | #define ASN1_F_PKCS7_ENC_CONTENT_NEW 194 | ||
1042 | #define ASN1_F_PKCS7_ENVELOPE_NEW 195 | ||
1043 | #define ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW 196 | ||
1044 | #define ASN1_F_PKCS7_NEW 197 | ||
1045 | #define ASN1_F_PKCS7_RECIP_INFO_NEW 198 | ||
1046 | #define ASN1_F_PKCS7_SIGNED_NEW 199 | ||
1047 | #define ASN1_F_PKCS7_SIGNER_INFO_NEW 200 | ||
1048 | #define ASN1_F_PKCS7_SIGN_ENVELOPE_NEW 201 | ||
1049 | #define ASN1_F_PKCS8_PRIV_KEY_INFO_NEW 252 | ||
1050 | #define ASN1_F_PKEY_USAGE_PERIOD_NEW 240 | ||
1051 | #define ASN1_F_POLICYINFO_NEW 273 | ||
1052 | #define ASN1_F_POLICYQUALINFO_NEW 274 | ||
1053 | #define ASN1_F_SXNETID_NEW 244 | ||
1054 | #define ASN1_F_SXNET_NEW 242 | ||
1055 | #define ASN1_F_USERNOTICE_NEW 275 | ||
1056 | #define ASN1_F_X509_ALGOR_NEW 202 | ||
1057 | #define ASN1_F_X509_ATTRIBUTE_NEW 203 | ||
1058 | #define ASN1_F_X509_CERT_AUX_NEW 286 | ||
1059 | #define ASN1_F_X509_CINF_NEW 204 | ||
1060 | #define ASN1_F_X509_CRL_INFO_NEW 205 | ||
1061 | #define ASN1_F_X509_CRL_NEW 206 | ||
1062 | #define ASN1_F_X509_DHPARAMS_NEW 207 | ||
1063 | #define ASN1_F_X509_EXTENSION_NEW 208 | ||
1064 | #define ASN1_F_X509_INFO_NEW 209 | ||
1065 | #define ASN1_F_X509_KEY_NEW 210 | ||
1066 | #define ASN1_F_X509_NAME_ENTRY_NEW 211 | ||
1067 | #define ASN1_F_X509_NAME_NEW 212 | ||
1068 | #define ASN1_F_X509_NEW 213 | ||
1069 | #define ASN1_F_X509_PKEY_NEW 214 | ||
1070 | #define ASN1_F_X509_PUBKEY_NEW 215 | ||
1071 | #define ASN1_F_X509_REQ_INFO_NEW 216 | ||
1072 | #define ASN1_F_X509_REQ_NEW 217 | ||
1073 | #define ASN1_F_X509_REVOKED_NEW 218 | ||
1074 | #define ASN1_F_X509_SIG_NEW 219 | ||
1075 | #define ASN1_F_X509_VAL_FREE 220 | ||
1076 | #define ASN1_F_X509_VAL_NEW 221 | ||
1077 | 1024 | ||
1078 | /* Reason codes. */ | 1025 | /* Reason codes. */ |
1079 | #define ASN1_R_BAD_CLASS 100 | 1026 | #define ASN1_R_ADDING_OBJECT 171 |
1080 | #define ASN1_R_BAD_OBJECT_HEADER 101 | 1027 | #define ASN1_R_AUX_ERROR 100 |
1081 | #define ASN1_R_BAD_PASSWORD_READ 102 | 1028 | #define ASN1_R_BAD_CLASS 101 |
1082 | #define ASN1_R_BAD_PKCS7_CONTENT 103 | 1029 | #define ASN1_R_BAD_OBJECT_HEADER 102 |
1083 | #define ASN1_R_BAD_PKCS7_TYPE 104 | 1030 | #define ASN1_R_BAD_PASSWORD_READ 103 |
1084 | #define ASN1_R_BAD_TAG 105 | 1031 | #define ASN1_R_BAD_TAG 104 |
1085 | #define ASN1_R_BAD_TYPE 106 | 1032 | #define ASN1_R_BN_LIB 105 |
1086 | #define ASN1_R_BN_LIB 107 | 1033 | #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 |
1087 | #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 108 | 1034 | #define ASN1_R_BUFFER_TOO_SMALL 107 |
1088 | #define ASN1_R_BUFFER_TOO_SMALL 109 | 1035 | #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 |
1089 | #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 166 | 1036 | #define ASN1_R_DATA_IS_WRONG 109 |
1090 | #define ASN1_R_DATA_IS_WRONG 110 | 1037 | #define ASN1_R_DECODE_ERROR 110 |
1091 | #define ASN1_R_DECODE_ERROR 155 | ||
1092 | #define ASN1_R_DECODING_ERROR 111 | 1038 | #define ASN1_R_DECODING_ERROR 111 |
1093 | #define ASN1_R_ENCODE_ERROR 156 | 1039 | #define ASN1_R_ENCODE_ERROR 112 |
1094 | #define ASN1_R_ERROR_PARSING_SET_ELEMENT 112 | 1040 | #define ASN1_R_ERROR_LOADING_SECTION 172 |
1095 | #define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 157 | 1041 | #define ASN1_R_ERROR_PARSING_SET_ELEMENT 113 |
1096 | #define ASN1_R_EXPECTING_AN_ENUMERATED 154 | 1042 | #define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114 |
1097 | #define ASN1_R_EXPECTING_AN_INTEGER 113 | 1043 | #define ASN1_R_EXPECTING_AN_INTEGER 115 |
1098 | #define ASN1_R_EXPECTING_AN_OBJECT 114 | 1044 | #define ASN1_R_EXPECTING_AN_OBJECT 116 |
1099 | #define ASN1_R_EXPECTING_AN_OCTET_STRING 115 | ||
1100 | #define ASN1_R_EXPECTING_A_BIT_STRING 116 | ||
1101 | #define ASN1_R_EXPECTING_A_BOOLEAN 117 | 1045 | #define ASN1_R_EXPECTING_A_BOOLEAN 117 |
1102 | #define ASN1_R_EXPECTING_A_GENERALIZEDTIME 151 | 1046 | #define ASN1_R_EXPECTING_A_TIME 118 |
1103 | #define ASN1_R_EXPECTING_A_NULL 164 | 1047 | #define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 |
1104 | #define ASN1_R_EXPECTING_A_TIME 152 | 1048 | #define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 |
1105 | #define ASN1_R_EXPECTING_A_UTCTIME 118 | 1049 | #define ASN1_R_FIELD_MISSING 121 |
1106 | #define ASN1_R_FIRST_NUM_TOO_LARGE 119 | 1050 | #define ASN1_R_FIRST_NUM_TOO_LARGE 122 |
1107 | #define ASN1_R_GENERALIZEDTIME_TOO_LONG 153 | 1051 | #define ASN1_R_HEADER_TOO_LONG 123 |
1108 | #define ASN1_R_HEADER_TOO_LONG 120 | 1052 | #define ASN1_R_ILLEGAL_CHARACTERS 124 |
1109 | #define ASN1_R_ILLEGAL_CHARACTERS 158 | 1053 | #define ASN1_R_ILLEGAL_NULL 125 |
1110 | #define ASN1_R_INVALID_BMPSTRING_LENGTH 159 | 1054 | #define ASN1_R_ILLEGAL_OPTIONAL_ANY 126 |
1111 | #define ASN1_R_INVALID_DIGIT 121 | 1055 | #define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170 |
1112 | #define ASN1_R_INVALID_SEPARATOR 122 | 1056 | #define ASN1_R_ILLEGAL_TAGGED_ANY 127 |
1113 | #define ASN1_R_INVALID_TIME_FORMAT 123 | 1057 | #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128 |
1114 | #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 160 | 1058 | #define ASN1_R_INVALID_BMPSTRING_LENGTH 129 |
1115 | #define ASN1_R_INVALID_UTF8STRING 161 | 1059 | #define ASN1_R_INVALID_DIGIT 130 |
1116 | #define ASN1_R_IV_TOO_LARGE 124 | 1060 | #define ASN1_R_INVALID_SEPARATOR 131 |
1117 | #define ASN1_R_LENGTH_ERROR 125 | 1061 | #define ASN1_R_INVALID_TIME_FORMAT 132 |
1118 | #define ASN1_R_MISSING_SECOND_NUMBER 126 | 1062 | #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133 |
1119 | #define ASN1_R_NON_HEX_CHARACTERS 127 | 1063 | #define ASN1_R_INVALID_UTF8STRING 134 |
1120 | #define ASN1_R_NOT_ENOUGH_DATA 128 | 1064 | #define ASN1_R_IV_TOO_LARGE 135 |
1121 | #define ASN1_R_NULL_IS_WRONG_LENGTH 165 | 1065 | #define ASN1_R_LENGTH_ERROR 136 |
1122 | #define ASN1_R_ODD_NUMBER_OF_CHARS 129 | 1066 | #define ASN1_R_MISSING_EOC 137 |
1123 | #define ASN1_R_PARSING 130 | 1067 | #define ASN1_R_MISSING_SECOND_NUMBER 138 |
1124 | #define ASN1_R_PRIVATE_KEY_HEADER_MISSING 131 | 1068 | #define ASN1_R_MSTRING_NOT_UNIVERSAL 139 |
1125 | #define ASN1_R_SECOND_NUMBER_TOO_LARGE 132 | 1069 | #define ASN1_R_MSTRING_WRONG_TAG 140 |
1126 | #define ASN1_R_SHORT_LINE 133 | 1070 | #define ASN1_R_NON_HEX_CHARACTERS 141 |
1127 | #define ASN1_R_STRING_TOO_LONG 163 | 1071 | #define ASN1_R_NOT_ENOUGH_DATA 142 |
1128 | #define ASN1_R_STRING_TOO_SHORT 134 | 1072 | #define ASN1_R_NO_MATCHING_CHOICE_TYPE 143 |
1129 | #define ASN1_R_TAG_VALUE_TOO_HIGH 135 | 1073 | #define ASN1_R_NULL_IS_WRONG_LENGTH 144 |
1130 | #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 136 | 1074 | #define ASN1_R_ODD_NUMBER_OF_CHARS 145 |
1131 | #define ASN1_R_TOO_LONG 137 | 1075 | #define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146 |
1132 | #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 138 | 1076 | #define ASN1_R_SECOND_NUMBER_TOO_LARGE 147 |
1133 | #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 139 | 1077 | #define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148 |
1134 | #define ASN1_R_UNKNOWN_ATTRIBUTE_TYPE 140 | 1078 | #define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149 |
1135 | #define ASN1_R_UNKNOWN_FORMAT 162 | 1079 | #define ASN1_R_SHORT_LINE 150 |
1136 | #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 141 | 1080 | #define ASN1_R_STRING_TOO_LONG 151 |
1137 | #define ASN1_R_UNKNOWN_OBJECT_TYPE 142 | 1081 | #define ASN1_R_STRING_TOO_SHORT 152 |
1138 | #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 143 | 1082 | #define ASN1_R_TAG_VALUE_TOO_HIGH 153 |
1139 | #define ASN1_R_UNSUPPORTED_CIPHER 144 | 1083 | #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154 |
1140 | #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 145 | 1084 | #define ASN1_R_TOO_LONG 155 |
1141 | #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 146 | 1085 | #define ASN1_R_TYPE_NOT_CONSTRUCTED 156 |
1142 | #define ASN1_R_UTCTIME_TOO_LONG 147 | 1086 | #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157 |
1143 | #define ASN1_R_WRONG_PRINTABLE_TYPE 148 | 1087 | #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158 |
1144 | #define ASN1_R_WRONG_TAG 149 | 1088 | #define ASN1_R_UNEXPECTED_EOC 159 |
1145 | #define ASN1_R_WRONG_TYPE 150 | 1089 | #define ASN1_R_UNKNOWN_FORMAT 160 |
1090 | #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161 | ||
1091 | #define ASN1_R_UNKNOWN_OBJECT_TYPE 162 | ||
1092 | #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163 | ||
1093 | #define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164 | ||
1094 | #define ASN1_R_UNSUPPORTED_CIPHER 165 | ||
1095 | #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166 | ||
1096 | #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167 | ||
1097 | #define ASN1_R_WRONG_TAG 168 | ||
1098 | #define ASN1_R_WRONG_TYPE 169 | ||
1146 | 1099 | ||
1147 | #ifdef __cplusplus | 1100 | #ifdef __cplusplus |
1148 | } | 1101 | } |
1149 | #endif | 1102 | #endif |
1150 | #endif | 1103 | #endif |
1151 | |||
diff --git a/src/lib/libcrypto/asn1/asn1_err.c b/src/lib/libcrypto/asn1/asn1_err.c index cecd555c88..c4c3d2a91d 100644 --- a/src/lib/libcrypto/asn1/asn1_err.c +++ b/src/lib/libcrypto/asn1/asn1_err.c | |||
@@ -63,27 +63,31 @@ | |||
63 | #include <openssl/asn1.h> | 63 | #include <openssl/asn1.h> |
64 | 64 | ||
65 | /* BEGIN ERROR CODES */ | 65 | /* BEGIN ERROR CODES */ |
66 | #ifndef NO_ERR | 66 | #ifndef OPENSSL_NO_ERR |
67 | static ERR_STRING_DATA ASN1_str_functs[]= | 67 | static ERR_STRING_DATA ASN1_str_functs[]= |
68 | { | 68 | { |
69 | {ERR_PACK(0,ASN1_F_A2D_ASN1_OBJECT,0), "a2d_ASN1_OBJECT"}, | 69 | {ERR_PACK(0,ASN1_F_A2D_ASN1_OBJECT,0), "a2d_ASN1_OBJECT"}, |
70 | {ERR_PACK(0,ASN1_F_A2I_ASN1_ENUMERATED,0), "a2i_ASN1_ENUMERATED"}, | 70 | {ERR_PACK(0,ASN1_F_A2I_ASN1_ENUMERATED,0), "a2i_ASN1_ENUMERATED"}, |
71 | {ERR_PACK(0,ASN1_F_A2I_ASN1_INTEGER,0), "a2i_ASN1_INTEGER"}, | 71 | {ERR_PACK(0,ASN1_F_A2I_ASN1_INTEGER,0), "a2i_ASN1_INTEGER"}, |
72 | {ERR_PACK(0,ASN1_F_A2I_ASN1_STRING,0), "a2i_ASN1_STRING"}, | 72 | {ERR_PACK(0,ASN1_F_A2I_ASN1_STRING,0), "a2i_ASN1_STRING"}, |
73 | {ERR_PACK(0,ASN1_F_ACCESS_DESCRIPTION_NEW,0), "ACCESS_DESCRIPTION_new"}, | 73 | {ERR_PACK(0,ASN1_F_ASN1_CHECK_TLEN,0), "ASN1_CHECK_TLEN"}, |
74 | {ERR_PACK(0,ASN1_F_ASN1_COLLATE_PRIMITIVE,0), "ASN1_COLLATE_PRIMITIVE"}, | 74 | {ERR_PACK(0,ASN1_F_ASN1_COLLATE_PRIMITIVE,0), "ASN1_COLLATE_PRIMITIVE"}, |
75 | {ERR_PACK(0,ASN1_F_ASN1_COLLECT,0), "ASN1_COLLECT"}, | ||
75 | {ERR_PACK(0,ASN1_F_ASN1_D2I_BIO,0), "ASN1_d2i_bio"}, | 76 | {ERR_PACK(0,ASN1_F_ASN1_D2I_BIO,0), "ASN1_d2i_bio"}, |
77 | {ERR_PACK(0,ASN1_F_ASN1_D2I_EX_PRIMITIVE,0), "ASN1_D2I_EX_PRIMITIVE"}, | ||
76 | {ERR_PACK(0,ASN1_F_ASN1_D2I_FP,0), "ASN1_d2i_fp"}, | 78 | {ERR_PACK(0,ASN1_F_ASN1_D2I_FP,0), "ASN1_d2i_fp"}, |
79 | {ERR_PACK(0,ASN1_F_ASN1_DO_ADB,0), "ASN1_DO_ADB"}, | ||
77 | {ERR_PACK(0,ASN1_F_ASN1_DUP,0), "ASN1_dup"}, | 80 | {ERR_PACK(0,ASN1_F_ASN1_DUP,0), "ASN1_dup"}, |
78 | {ERR_PACK(0,ASN1_F_ASN1_ENUMERATED_SET,0), "ASN1_ENUMERATED_set"}, | 81 | {ERR_PACK(0,ASN1_F_ASN1_ENUMERATED_SET,0), "ASN1_ENUMERATED_set"}, |
79 | {ERR_PACK(0,ASN1_F_ASN1_ENUMERATED_TO_BN,0), "ASN1_ENUMERATED_to_BN"}, | 82 | {ERR_PACK(0,ASN1_F_ASN1_ENUMERATED_TO_BN,0), "ASN1_ENUMERATED_to_BN"}, |
80 | {ERR_PACK(0,ASN1_F_ASN1_GENERALIZEDTIME_NEW,0), "ASN1_GENERALIZEDTIME_new"}, | ||
81 | {ERR_PACK(0,ASN1_F_ASN1_GET_OBJECT,0), "ASN1_get_object"}, | 83 | {ERR_PACK(0,ASN1_F_ASN1_GET_OBJECT,0), "ASN1_get_object"}, |
82 | {ERR_PACK(0,ASN1_F_ASN1_HEADER_NEW,0), "ASN1_HEADER_new"}, | 84 | {ERR_PACK(0,ASN1_F_ASN1_HEADER_NEW,0), "ASN1_HEADER_new"}, |
83 | {ERR_PACK(0,ASN1_F_ASN1_I2D_BIO,0), "ASN1_i2d_bio"}, | 85 | {ERR_PACK(0,ASN1_F_ASN1_I2D_BIO,0), "ASN1_i2d_bio"}, |
84 | {ERR_PACK(0,ASN1_F_ASN1_I2D_FP,0), "ASN1_i2d_fp"}, | 86 | {ERR_PACK(0,ASN1_F_ASN1_I2D_FP,0), "ASN1_i2d_fp"}, |
85 | {ERR_PACK(0,ASN1_F_ASN1_INTEGER_SET,0), "ASN1_INTEGER_set"}, | 87 | {ERR_PACK(0,ASN1_F_ASN1_INTEGER_SET,0), "ASN1_INTEGER_set"}, |
86 | {ERR_PACK(0,ASN1_F_ASN1_INTEGER_TO_BN,0), "ASN1_INTEGER_to_BN"}, | 88 | {ERR_PACK(0,ASN1_F_ASN1_INTEGER_TO_BN,0), "ASN1_INTEGER_to_BN"}, |
89 | {ERR_PACK(0,ASN1_F_ASN1_ITEM_EX_D2I,0), "ASN1_ITEM_EX_D2I"}, | ||
90 | {ERR_PACK(0,ASN1_F_ASN1_ITEM_NEW,0), "ASN1_item_new"}, | ||
87 | {ERR_PACK(0,ASN1_F_ASN1_MBSTRING_COPY,0), "ASN1_mbstring_copy"}, | 91 | {ERR_PACK(0,ASN1_F_ASN1_MBSTRING_COPY,0), "ASN1_mbstring_copy"}, |
88 | {ERR_PACK(0,ASN1_F_ASN1_OBJECT_NEW,0), "ASN1_OBJECT_new"}, | 92 | {ERR_PACK(0,ASN1_F_ASN1_OBJECT_NEW,0), "ASN1_OBJECT_new"}, |
89 | {ERR_PACK(0,ASN1_F_ASN1_PACK_STRING,0), "ASN1_pack_string"}, | 93 | {ERR_PACK(0,ASN1_F_ASN1_PACK_STRING,0), "ASN1_pack_string"}, |
@@ -91,186 +95,63 @@ static ERR_STRING_DATA ASN1_str_functs[]= | |||
91 | {ERR_PACK(0,ASN1_F_ASN1_SEQ_PACK,0), "ASN1_seq_pack"}, | 95 | {ERR_PACK(0,ASN1_F_ASN1_SEQ_PACK,0), "ASN1_seq_pack"}, |
92 | {ERR_PACK(0,ASN1_F_ASN1_SEQ_UNPACK,0), "ASN1_seq_unpack"}, | 96 | {ERR_PACK(0,ASN1_F_ASN1_SEQ_UNPACK,0), "ASN1_seq_unpack"}, |
93 | {ERR_PACK(0,ASN1_F_ASN1_SIGN,0), "ASN1_sign"}, | 97 | {ERR_PACK(0,ASN1_F_ASN1_SIGN,0), "ASN1_sign"}, |
94 | {ERR_PACK(0,ASN1_F_ASN1_STRING_NEW,0), "ASN1_STRING_new"}, | ||
95 | {ERR_PACK(0,ASN1_F_ASN1_STRING_TABLE_ADD,0), "ASN1_STRING_TABLE_add"}, | 98 | {ERR_PACK(0,ASN1_F_ASN1_STRING_TABLE_ADD,0), "ASN1_STRING_TABLE_add"}, |
96 | {ERR_PACK(0,ASN1_F_ASN1_STRING_TYPE_NEW,0), "ASN1_STRING_type_new"}, | 99 | {ERR_PACK(0,ASN1_F_ASN1_STRING_TYPE_NEW,0), "ASN1_STRING_type_new"}, |
100 | {ERR_PACK(0,ASN1_F_ASN1_TEMPLATE_D2I,0), "ASN1_TEMPLATE_D2I"}, | ||
101 | {ERR_PACK(0,ASN1_F_ASN1_TEMPLATE_EX_D2I,0), "ASN1_TEMPLATE_EX_D2I"}, | ||
102 | {ERR_PACK(0,ASN1_F_ASN1_TEMPLATE_NEW,0), "ASN1_TEMPLATE_NEW"}, | ||
97 | {ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING,0), "ASN1_TYPE_get_int_octetstring"}, | 103 | {ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING,0), "ASN1_TYPE_get_int_octetstring"}, |
98 | {ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_OCTETSTRING,0), "ASN1_TYPE_get_octetstring"}, | 104 | {ERR_PACK(0,ASN1_F_ASN1_TYPE_GET_OCTETSTRING,0), "ASN1_TYPE_get_octetstring"}, |
99 | {ERR_PACK(0,ASN1_F_ASN1_TYPE_NEW,0), "ASN1_TYPE_new"}, | ||
100 | {ERR_PACK(0,ASN1_F_ASN1_UNPACK_STRING,0), "ASN1_unpack_string"}, | 105 | {ERR_PACK(0,ASN1_F_ASN1_UNPACK_STRING,0), "ASN1_unpack_string"}, |
101 | {ERR_PACK(0,ASN1_F_ASN1_UTCTIME_NEW,0), "ASN1_UTCTIME_new"}, | ||
102 | {ERR_PACK(0,ASN1_F_ASN1_VERIFY,0), "ASN1_verify"}, | 106 | {ERR_PACK(0,ASN1_F_ASN1_VERIFY,0), "ASN1_verify"}, |
103 | {ERR_PACK(0,ASN1_F_AUTHORITY_KEYID_NEW,0), "AUTHORITY_KEYID_new"}, | ||
104 | {ERR_PACK(0,ASN1_F_BASIC_CONSTRAINTS_NEW,0), "BASIC_CONSTRAINTS_new"}, | ||
105 | {ERR_PACK(0,ASN1_F_BN_TO_ASN1_ENUMERATED,0), "BN_to_ASN1_ENUMERATED"}, | 107 | {ERR_PACK(0,ASN1_F_BN_TO_ASN1_ENUMERATED,0), "BN_to_ASN1_ENUMERATED"}, |
106 | {ERR_PACK(0,ASN1_F_BN_TO_ASN1_INTEGER,0), "BN_to_ASN1_INTEGER"}, | 108 | {ERR_PACK(0,ASN1_F_BN_TO_ASN1_INTEGER,0), "BN_to_ASN1_INTEGER"}, |
107 | {ERR_PACK(0,ASN1_F_D2I_ACCESS_DESCRIPTION,0), "d2i_ACCESS_DESCRIPTION"}, | 109 | {ERR_PACK(0,ASN1_F_COLLECT_DATA,0), "COLLECT_DATA"}, |
108 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BIT_STRING,0), "d2i_ASN1_BIT_STRING"}, | 110 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BIT_STRING,0), "D2I_ASN1_BIT_STRING"}, |
109 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BMPSTRING,0), "d2i_ASN1_BMPSTRING"}, | ||
110 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BOOLEAN,0), "d2i_ASN1_BOOLEAN"}, | 111 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BOOLEAN,0), "d2i_ASN1_BOOLEAN"}, |
111 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BYTES,0), "d2i_ASN1_bytes"}, | 112 | {ERR_PACK(0,ASN1_F_D2I_ASN1_BYTES,0), "d2i_ASN1_bytes"}, |
112 | {ERR_PACK(0,ASN1_F_D2I_ASN1_ENUMERATED,0), "d2i_ASN1_ENUMERATED"}, | 113 | {ERR_PACK(0,ASN1_F_D2I_ASN1_GENERALIZEDTIME,0), "D2I_ASN1_GENERALIZEDTIME"}, |
113 | {ERR_PACK(0,ASN1_F_D2I_ASN1_GENERALIZEDTIME,0), "d2i_ASN1_GENERALIZEDTIME"}, | ||
114 | {ERR_PACK(0,ASN1_F_D2I_ASN1_HEADER,0), "d2i_ASN1_HEADER"}, | 114 | {ERR_PACK(0,ASN1_F_D2I_ASN1_HEADER,0), "d2i_ASN1_HEADER"}, |
115 | {ERR_PACK(0,ASN1_F_D2I_ASN1_INTEGER,0), "d2i_ASN1_INTEGER"}, | 115 | {ERR_PACK(0,ASN1_F_D2I_ASN1_INTEGER,0), "D2I_ASN1_INTEGER"}, |
116 | {ERR_PACK(0,ASN1_F_D2I_ASN1_NULL,0), "d2i_ASN1_NULL"}, | ||
117 | {ERR_PACK(0,ASN1_F_D2I_ASN1_OBJECT,0), "d2i_ASN1_OBJECT"}, | 116 | {ERR_PACK(0,ASN1_F_D2I_ASN1_OBJECT,0), "d2i_ASN1_OBJECT"}, |
118 | {ERR_PACK(0,ASN1_F_D2I_ASN1_OCTET_STRING,0), "d2i_ASN1_OCTET_STRING"}, | ||
119 | {ERR_PACK(0,ASN1_F_D2I_ASN1_PRINT_TYPE,0), "D2I_ASN1_PRINT_TYPE"}, | ||
120 | {ERR_PACK(0,ASN1_F_D2I_ASN1_SET,0), "d2i_ASN1_SET"}, | 117 | {ERR_PACK(0,ASN1_F_D2I_ASN1_SET,0), "d2i_ASN1_SET"}, |
121 | {ERR_PACK(0,ASN1_F_D2I_ASN1_TIME,0), "d2i_ASN1_TIME"}, | ||
122 | {ERR_PACK(0,ASN1_F_D2I_ASN1_TYPE,0), "d2i_ASN1_TYPE"}, | ||
123 | {ERR_PACK(0,ASN1_F_D2I_ASN1_TYPE_BYTES,0), "d2i_ASN1_type_bytes"}, | 118 | {ERR_PACK(0,ASN1_F_D2I_ASN1_TYPE_BYTES,0), "d2i_ASN1_type_bytes"}, |
124 | {ERR_PACK(0,ASN1_F_D2I_ASN1_UINTEGER,0), "d2i_ASN1_UINTEGER"}, | 119 | {ERR_PACK(0,ASN1_F_D2I_ASN1_UINTEGER,0), "d2i_ASN1_UINTEGER"}, |
125 | {ERR_PACK(0,ASN1_F_D2I_ASN1_UTCTIME,0), "d2i_ASN1_UTCTIME"}, | 120 | {ERR_PACK(0,ASN1_F_D2I_ASN1_UTCTIME,0), "D2I_ASN1_UTCTIME"}, |
126 | {ERR_PACK(0,ASN1_F_D2I_ASN1_UTF8STRING,0), "d2i_ASN1_UTF8STRING"}, | ||
127 | {ERR_PACK(0,ASN1_F_D2I_ASN1_VISIBLESTRING,0), "d2i_ASN1_VISIBLESTRING"}, | ||
128 | {ERR_PACK(0,ASN1_F_D2I_AUTHORITY_KEYID,0), "d2i_AUTHORITY_KEYID"}, | ||
129 | {ERR_PACK(0,ASN1_F_D2I_BASIC_CONSTRAINTS,0), "d2i_BASIC_CONSTRAINTS"}, | ||
130 | {ERR_PACK(0,ASN1_F_D2I_DHPARAMS,0), "d2i_DHparams"}, | ||
131 | {ERR_PACK(0,ASN1_F_D2I_DIST_POINT,0), "d2i_DIST_POINT"}, | ||
132 | {ERR_PACK(0,ASN1_F_D2I_DIST_POINT_NAME,0), "d2i_DIST_POINT_NAME"}, | ||
133 | {ERR_PACK(0,ASN1_F_D2I_DSAPARAMS,0), "d2i_DSAparams"}, | ||
134 | {ERR_PACK(0,ASN1_F_D2I_DSAPRIVATEKEY,0), "d2i_DSAPrivateKey"}, | ||
135 | {ERR_PACK(0,ASN1_F_D2I_DSAPUBLICKEY,0), "d2i_DSAPublicKey"}, | ||
136 | {ERR_PACK(0,ASN1_F_D2I_GENERAL_NAME,0), "d2i_GENERAL_NAME"}, | ||
137 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE,0), "d2i_NETSCAPE_CERT_SEQUENCE"}, | ||
138 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_PKEY,0), "D2I_NETSCAPE_PKEY"}, | ||
139 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA,0), "d2i_Netscape_RSA"}, | 121 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA,0), "d2i_Netscape_RSA"}, |
140 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA_2,0), "d2i_Netscape_RSA_2"}, | 122 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_RSA_2,0), "D2I_NETSCAPE_RSA_2"}, |
141 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_SPKAC,0), "d2i_NETSCAPE_SPKAC"}, | ||
142 | {ERR_PACK(0,ASN1_F_D2I_NETSCAPE_SPKI,0), "d2i_NETSCAPE_SPKI"}, | ||
143 | {ERR_PACK(0,ASN1_F_D2I_NOTICEREF,0), "d2i_NOTICEREF"}, | ||
144 | {ERR_PACK(0,ASN1_F_D2I_OTHERNAME,0), "d2i_OTHERNAME"}, | ||
145 | {ERR_PACK(0,ASN1_F_D2I_PBE2PARAM,0), "d2i_PBE2PARAM"}, | ||
146 | {ERR_PACK(0,ASN1_F_D2I_PBEPARAM,0), "d2i_PBEPARAM"}, | ||
147 | {ERR_PACK(0,ASN1_F_D2I_PBKDF2PARAM,0), "d2i_PBKDF2PARAM"}, | ||
148 | {ERR_PACK(0,ASN1_F_D2I_PKCS12,0), "d2i_PKCS12"}, | ||
149 | {ERR_PACK(0,ASN1_F_D2I_PKCS12_BAGS,0), "d2i_PKCS12_BAGS"}, | ||
150 | {ERR_PACK(0,ASN1_F_D2I_PKCS12_MAC_DATA,0), "d2i_PKCS12_MAC_DATA"}, | ||
151 | {ERR_PACK(0,ASN1_F_D2I_PKCS12_SAFEBAG,0), "d2i_PKCS12_SAFEBAG"}, | ||
152 | {ERR_PACK(0,ASN1_F_D2I_PKCS7,0), "d2i_PKCS7"}, | ||
153 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_DIGEST,0), "d2i_PKCS7_DIGEST"}, | ||
154 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_ENCRYPT,0), "d2i_PKCS7_ENCRYPT"}, | ||
155 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_ENC_CONTENT,0), "d2i_PKCS7_ENC_CONTENT"}, | ||
156 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_ENVELOPE,0), "d2i_PKCS7_ENVELOPE"}, | ||
157 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL,0), "d2i_PKCS7_ISSUER_AND_SERIAL"}, | ||
158 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_RECIP_INFO,0), "d2i_PKCS7_RECIP_INFO"}, | ||
159 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_SIGNED,0), "d2i_PKCS7_SIGNED"}, | ||
160 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_SIGNER_INFO,0), "d2i_PKCS7_SIGNER_INFO"}, | ||
161 | {ERR_PACK(0,ASN1_F_D2I_PKCS7_SIGN_ENVELOPE,0), "d2i_PKCS7_SIGN_ENVELOPE"}, | ||
162 | {ERR_PACK(0,ASN1_F_D2I_PKCS8_PRIV_KEY_INFO,0), "d2i_PKCS8_PRIV_KEY_INFO"}, | ||
163 | {ERR_PACK(0,ASN1_F_D2I_PKEY_USAGE_PERIOD,0), "d2i_PKEY_USAGE_PERIOD"}, | ||
164 | {ERR_PACK(0,ASN1_F_D2I_POLICYINFO,0), "d2i_POLICYINFO"}, | ||
165 | {ERR_PACK(0,ASN1_F_D2I_POLICYQUALINFO,0), "d2i_POLICYQUALINFO"}, | ||
166 | {ERR_PACK(0,ASN1_F_D2I_PRIVATEKEY,0), "d2i_PrivateKey"}, | 123 | {ERR_PACK(0,ASN1_F_D2I_PRIVATEKEY,0), "d2i_PrivateKey"}, |
167 | {ERR_PACK(0,ASN1_F_D2I_PUBLICKEY,0), "d2i_PublicKey"}, | 124 | {ERR_PACK(0,ASN1_F_D2I_PUBLICKEY,0), "d2i_PublicKey"}, |
168 | {ERR_PACK(0,ASN1_F_D2I_RSAPRIVATEKEY,0), "d2i_RSAPrivateKey"}, | 125 | {ERR_PACK(0,ASN1_F_D2I_X509,0), "D2I_X509"}, |
169 | {ERR_PACK(0,ASN1_F_D2I_RSAPUBLICKEY,0), "d2i_RSAPublicKey"}, | 126 | {ERR_PACK(0,ASN1_F_D2I_X509_CINF,0), "D2I_X509_CINF"}, |
170 | {ERR_PACK(0,ASN1_F_D2I_SXNET,0), "d2i_SXNET"}, | 127 | {ERR_PACK(0,ASN1_F_D2I_X509_NAME,0), "D2I_X509_NAME"}, |
171 | {ERR_PACK(0,ASN1_F_D2I_SXNETID,0), "d2i_SXNETID"}, | ||
172 | {ERR_PACK(0,ASN1_F_D2I_USERNOTICE,0), "d2i_USERNOTICE"}, | ||
173 | {ERR_PACK(0,ASN1_F_D2I_X509,0), "d2i_X509"}, | ||
174 | {ERR_PACK(0,ASN1_F_D2I_X509_ALGOR,0), "d2i_X509_ALGOR"}, | ||
175 | {ERR_PACK(0,ASN1_F_D2I_X509_ATTRIBUTE,0), "d2i_X509_ATTRIBUTE"}, | ||
176 | {ERR_PACK(0,ASN1_F_D2I_X509_CERT_AUX,0), "d2i_X509_CERT_AUX"}, | ||
177 | {ERR_PACK(0,ASN1_F_D2I_X509_CINF,0), "d2i_X509_CINF"}, | ||
178 | {ERR_PACK(0,ASN1_F_D2I_X509_CRL,0), "d2i_X509_CRL"}, | ||
179 | {ERR_PACK(0,ASN1_F_D2I_X509_CRL_INFO,0), "d2i_X509_CRL_INFO"}, | ||
180 | {ERR_PACK(0,ASN1_F_D2I_X509_EXTENSION,0), "d2i_X509_EXTENSION"}, | ||
181 | {ERR_PACK(0,ASN1_F_D2I_X509_KEY,0), "D2I_X509_KEY"}, | ||
182 | {ERR_PACK(0,ASN1_F_D2I_X509_NAME,0), "d2i_X509_NAME"}, | ||
183 | {ERR_PACK(0,ASN1_F_D2I_X509_NAME_ENTRY,0), "d2i_X509_NAME_ENTRY"}, | ||
184 | {ERR_PACK(0,ASN1_F_D2I_X509_PKEY,0), "d2i_X509_PKEY"}, | 128 | {ERR_PACK(0,ASN1_F_D2I_X509_PKEY,0), "d2i_X509_PKEY"}, |
185 | {ERR_PACK(0,ASN1_F_D2I_X509_PUBKEY,0), "d2i_X509_PUBKEY"}, | 129 | {ERR_PACK(0,ASN1_F_I2D_ASN1_TIME,0), "I2D_ASN1_TIME"}, |
186 | {ERR_PACK(0,ASN1_F_D2I_X509_REQ,0), "d2i_X509_REQ"}, | ||
187 | {ERR_PACK(0,ASN1_F_D2I_X509_REQ_INFO,0), "d2i_X509_REQ_INFO"}, | ||
188 | {ERR_PACK(0,ASN1_F_D2I_X509_REVOKED,0), "d2i_X509_REVOKED"}, | ||
189 | {ERR_PACK(0,ASN1_F_D2I_X509_SIG,0), "d2i_X509_SIG"}, | ||
190 | {ERR_PACK(0,ASN1_F_D2I_X509_VAL,0), "d2i_X509_VAL"}, | ||
191 | {ERR_PACK(0,ASN1_F_DIST_POINT_NAME_NEW,0), "DIST_POINT_NAME_new"}, | ||
192 | {ERR_PACK(0,ASN1_F_DIST_POINT_NEW,0), "DIST_POINT_new"}, | ||
193 | {ERR_PACK(0,ASN1_F_GENERAL_NAME_NEW,0), "GENERAL_NAME_new"}, | ||
194 | {ERR_PACK(0,ASN1_F_I2D_ASN1_HEADER,0), "i2d_ASN1_HEADER"}, | ||
195 | {ERR_PACK(0,ASN1_F_I2D_ASN1_TIME,0), "i2d_ASN1_TIME"}, | ||
196 | {ERR_PACK(0,ASN1_F_I2D_DHPARAMS,0), "i2d_DHparams"}, | ||
197 | {ERR_PACK(0,ASN1_F_I2D_DSAPARAMS,0), "i2d_DSAparams"}, | ||
198 | {ERR_PACK(0,ASN1_F_I2D_DSAPRIVATEKEY,0), "i2d_DSAPrivateKey"}, | ||
199 | {ERR_PACK(0,ASN1_F_I2D_DSAPUBLICKEY,0), "i2d_DSAPublicKey"}, | ||
200 | {ERR_PACK(0,ASN1_F_I2D_DSA_PUBKEY,0), "i2d_DSA_PUBKEY"}, | 130 | {ERR_PACK(0,ASN1_F_I2D_DSA_PUBKEY,0), "i2d_DSA_PUBKEY"}, |
201 | {ERR_PACK(0,ASN1_F_I2D_NETSCAPE_RSA,0), "i2d_Netscape_RSA"}, | 131 | {ERR_PACK(0,ASN1_F_I2D_NETSCAPE_RSA,0), "i2d_Netscape_RSA"}, |
202 | {ERR_PACK(0,ASN1_F_I2D_PKCS7,0), "i2d_PKCS7"}, | ||
203 | {ERR_PACK(0,ASN1_F_I2D_PRIVATEKEY,0), "i2d_PrivateKey"}, | 132 | {ERR_PACK(0,ASN1_F_I2D_PRIVATEKEY,0), "i2d_PrivateKey"}, |
204 | {ERR_PACK(0,ASN1_F_I2D_PUBLICKEY,0), "i2d_PublicKey"}, | 133 | {ERR_PACK(0,ASN1_F_I2D_PUBLICKEY,0), "i2d_PublicKey"}, |
205 | {ERR_PACK(0,ASN1_F_I2D_RSAPRIVATEKEY,0), "i2d_RSAPrivateKey"}, | ||
206 | {ERR_PACK(0,ASN1_F_I2D_RSAPUBLICKEY,0), "i2d_RSAPublicKey"}, | ||
207 | {ERR_PACK(0,ASN1_F_I2D_RSA_PUBKEY,0), "i2d_RSA_PUBKEY"}, | 134 | {ERR_PACK(0,ASN1_F_I2D_RSA_PUBKEY,0), "i2d_RSA_PUBKEY"}, |
208 | {ERR_PACK(0,ASN1_F_I2D_X509_ATTRIBUTE,0), "i2d_X509_ATTRIBUTE"}, | 135 | {ERR_PACK(0,ASN1_F_LONG_C2I,0), "LONG_C2I"}, |
209 | {ERR_PACK(0,ASN1_F_I2T_ASN1_OBJECT,0), "i2t_ASN1_OBJECT"}, | 136 | {ERR_PACK(0,ASN1_F_OID_MODULE_INIT,0), "OID_MODULE_INIT"}, |
210 | {ERR_PACK(0,ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW,0), "NETSCAPE_CERT_SEQUENCE_new"}, | ||
211 | {ERR_PACK(0,ASN1_F_NETSCAPE_PKEY_NEW,0), "NETSCAPE_PKEY_NEW"}, | ||
212 | {ERR_PACK(0,ASN1_F_NETSCAPE_SPKAC_NEW,0), "NETSCAPE_SPKAC_new"}, | ||
213 | {ERR_PACK(0,ASN1_F_NETSCAPE_SPKI_NEW,0), "NETSCAPE_SPKI_new"}, | ||
214 | {ERR_PACK(0,ASN1_F_NOTICEREF_NEW,0), "NOTICEREF_new"}, | ||
215 | {ERR_PACK(0,ASN1_F_OTHERNAME_NEW,0), "OTHERNAME_new"}, | ||
216 | {ERR_PACK(0,ASN1_F_PBE2PARAM_NEW,0), "PBE2PARAM_new"}, | ||
217 | {ERR_PACK(0,ASN1_F_PBEPARAM_NEW,0), "PBEPARAM_new"}, | ||
218 | {ERR_PACK(0,ASN1_F_PBKDF2PARAM_NEW,0), "PBKDF2PARAM_new"}, | ||
219 | {ERR_PACK(0,ASN1_F_PKCS12_BAGS_NEW,0), "PKCS12_BAGS_new"}, | ||
220 | {ERR_PACK(0,ASN1_F_PKCS12_MAC_DATA_NEW,0), "PKCS12_MAC_DATA_new"}, | ||
221 | {ERR_PACK(0,ASN1_F_PKCS12_NEW,0), "PKCS12_new"}, | ||
222 | {ERR_PACK(0,ASN1_F_PKCS12_SAFEBAG_NEW,0), "PKCS12_SAFEBAG_new"}, | ||
223 | {ERR_PACK(0,ASN1_F_PKCS5_PBE2_SET,0), "PKCS5_pbe2_set"}, | 137 | {ERR_PACK(0,ASN1_F_PKCS5_PBE2_SET,0), "PKCS5_pbe2_set"}, |
224 | {ERR_PACK(0,ASN1_F_PKCS7_DIGEST_NEW,0), "PKCS7_DIGEST_new"}, | 138 | {ERR_PACK(0,ASN1_F_X509_CINF_NEW,0), "X509_CINF_NEW"}, |
225 | {ERR_PACK(0,ASN1_F_PKCS7_ENCRYPT_NEW,0), "PKCS7_ENCRYPT_new"}, | 139 | {ERR_PACK(0,ASN1_F_X509_CRL_ADD0_REVOKED,0), "X509_CRL_add0_revoked"}, |
226 | {ERR_PACK(0,ASN1_F_PKCS7_ENC_CONTENT_NEW,0), "PKCS7_ENC_CONTENT_new"}, | ||
227 | {ERR_PACK(0,ASN1_F_PKCS7_ENVELOPE_NEW,0), "PKCS7_ENVELOPE_new"}, | ||
228 | {ERR_PACK(0,ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW,0), "PKCS7_ISSUER_AND_SERIAL_new"}, | ||
229 | {ERR_PACK(0,ASN1_F_PKCS7_NEW,0), "PKCS7_new"}, | ||
230 | {ERR_PACK(0,ASN1_F_PKCS7_RECIP_INFO_NEW,0), "PKCS7_RECIP_INFO_new"}, | ||
231 | {ERR_PACK(0,ASN1_F_PKCS7_SIGNED_NEW,0), "PKCS7_SIGNED_new"}, | ||
232 | {ERR_PACK(0,ASN1_F_PKCS7_SIGNER_INFO_NEW,0), "PKCS7_SIGNER_INFO_new"}, | ||
233 | {ERR_PACK(0,ASN1_F_PKCS7_SIGN_ENVELOPE_NEW,0), "PKCS7_SIGN_ENVELOPE_new"}, | ||
234 | {ERR_PACK(0,ASN1_F_PKCS8_PRIV_KEY_INFO_NEW,0), "PKCS8_PRIV_KEY_INFO_new"}, | ||
235 | {ERR_PACK(0,ASN1_F_PKEY_USAGE_PERIOD_NEW,0), "PKEY_USAGE_PERIOD_new"}, | ||
236 | {ERR_PACK(0,ASN1_F_POLICYINFO_NEW,0), "POLICYINFO_new"}, | ||
237 | {ERR_PACK(0,ASN1_F_POLICYQUALINFO_NEW,0), "POLICYQUALINFO_new"}, | ||
238 | {ERR_PACK(0,ASN1_F_SXNETID_NEW,0), "SXNETID_new"}, | ||
239 | {ERR_PACK(0,ASN1_F_SXNET_NEW,0), "SXNET_new"}, | ||
240 | {ERR_PACK(0,ASN1_F_USERNOTICE_NEW,0), "USERNOTICE_new"}, | ||
241 | {ERR_PACK(0,ASN1_F_X509_ALGOR_NEW,0), "X509_ALGOR_new"}, | ||
242 | {ERR_PACK(0,ASN1_F_X509_ATTRIBUTE_NEW,0), "X509_ATTRIBUTE_new"}, | ||
243 | {ERR_PACK(0,ASN1_F_X509_CERT_AUX_NEW,0), "X509_CERT_AUX_new"}, | ||
244 | {ERR_PACK(0,ASN1_F_X509_CINF_NEW,0), "X509_CINF_new"}, | ||
245 | {ERR_PACK(0,ASN1_F_X509_CRL_INFO_NEW,0), "X509_CRL_INFO_new"}, | ||
246 | {ERR_PACK(0,ASN1_F_X509_CRL_NEW,0), "X509_CRL_new"}, | ||
247 | {ERR_PACK(0,ASN1_F_X509_DHPARAMS_NEW,0), "X509_DHPARAMS_NEW"}, | ||
248 | {ERR_PACK(0,ASN1_F_X509_EXTENSION_NEW,0), "X509_EXTENSION_new"}, | ||
249 | {ERR_PACK(0,ASN1_F_X509_INFO_NEW,0), "X509_INFO_new"}, | 140 | {ERR_PACK(0,ASN1_F_X509_INFO_NEW,0), "X509_INFO_new"}, |
250 | {ERR_PACK(0,ASN1_F_X509_KEY_NEW,0), "X509_KEY_NEW"}, | 141 | {ERR_PACK(0,ASN1_F_X509_NAME_NEW,0), "X509_NAME_NEW"}, |
251 | {ERR_PACK(0,ASN1_F_X509_NAME_ENTRY_NEW,0), "X509_NAME_ENTRY_new"}, | 142 | {ERR_PACK(0,ASN1_F_X509_NEW,0), "X509_NEW"}, |
252 | {ERR_PACK(0,ASN1_F_X509_NAME_NEW,0), "X509_NAME_new"}, | ||
253 | {ERR_PACK(0,ASN1_F_X509_NEW,0), "X509_new"}, | ||
254 | {ERR_PACK(0,ASN1_F_X509_PKEY_NEW,0), "X509_PKEY_new"}, | 143 | {ERR_PACK(0,ASN1_F_X509_PKEY_NEW,0), "X509_PKEY_new"}, |
255 | {ERR_PACK(0,ASN1_F_X509_PUBKEY_NEW,0), "X509_PUBKEY_new"}, | ||
256 | {ERR_PACK(0,ASN1_F_X509_REQ_INFO_NEW,0), "X509_REQ_INFO_new"}, | ||
257 | {ERR_PACK(0,ASN1_F_X509_REQ_NEW,0), "X509_REQ_new"}, | ||
258 | {ERR_PACK(0,ASN1_F_X509_REVOKED_NEW,0), "X509_REVOKED_new"}, | ||
259 | {ERR_PACK(0,ASN1_F_X509_SIG_NEW,0), "X509_SIG_new"}, | ||
260 | {ERR_PACK(0,ASN1_F_X509_VAL_FREE,0), "X509_VAL_free"}, | ||
261 | {ERR_PACK(0,ASN1_F_X509_VAL_NEW,0), "X509_VAL_new"}, | ||
262 | {0,NULL} | 144 | {0,NULL} |
263 | }; | 145 | }; |
264 | 146 | ||
265 | static ERR_STRING_DATA ASN1_str_reasons[]= | 147 | static ERR_STRING_DATA ASN1_str_reasons[]= |
266 | { | 148 | { |
149 | {ASN1_R_ADDING_OBJECT ,"adding object"}, | ||
150 | {ASN1_R_AUX_ERROR ,"aux error"}, | ||
267 | {ASN1_R_BAD_CLASS ,"bad class"}, | 151 | {ASN1_R_BAD_CLASS ,"bad class"}, |
268 | {ASN1_R_BAD_OBJECT_HEADER ,"bad object header"}, | 152 | {ASN1_R_BAD_OBJECT_HEADER ,"bad object header"}, |
269 | {ASN1_R_BAD_PASSWORD_READ ,"bad password read"}, | 153 | {ASN1_R_BAD_PASSWORD_READ ,"bad password read"}, |
270 | {ASN1_R_BAD_PKCS7_CONTENT ,"bad pkcs7 content"}, | ||
271 | {ASN1_R_BAD_PKCS7_TYPE ,"bad pkcs7 type"}, | ||
272 | {ASN1_R_BAD_TAG ,"bad tag"}, | 154 | {ASN1_R_BAD_TAG ,"bad tag"}, |
273 | {ASN1_R_BAD_TYPE ,"bad type"}, | ||
274 | {ASN1_R_BN_LIB ,"bn lib"}, | 155 | {ASN1_R_BN_LIB ,"bn lib"}, |
275 | {ASN1_R_BOOLEAN_IS_WRONG_LENGTH ,"boolean is wrong length"}, | 156 | {ASN1_R_BOOLEAN_IS_WRONG_LENGTH ,"boolean is wrong length"}, |
276 | {ASN1_R_BUFFER_TOO_SMALL ,"buffer too small"}, | 157 | {ASN1_R_BUFFER_TOO_SMALL ,"buffer too small"}, |
@@ -279,22 +160,24 @@ static ERR_STRING_DATA ASN1_str_reasons[]= | |||
279 | {ASN1_R_DECODE_ERROR ,"decode error"}, | 160 | {ASN1_R_DECODE_ERROR ,"decode error"}, |
280 | {ASN1_R_DECODING_ERROR ,"decoding error"}, | 161 | {ASN1_R_DECODING_ERROR ,"decoding error"}, |
281 | {ASN1_R_ENCODE_ERROR ,"encode error"}, | 162 | {ASN1_R_ENCODE_ERROR ,"encode error"}, |
163 | {ASN1_R_ERROR_LOADING_SECTION ,"error loading section"}, | ||
282 | {ASN1_R_ERROR_PARSING_SET_ELEMENT ,"error parsing set element"}, | 164 | {ASN1_R_ERROR_PARSING_SET_ELEMENT ,"error parsing set element"}, |
283 | {ASN1_R_ERROR_SETTING_CIPHER_PARAMS ,"error setting cipher params"}, | 165 | {ASN1_R_ERROR_SETTING_CIPHER_PARAMS ,"error setting cipher params"}, |
284 | {ASN1_R_EXPECTING_AN_ENUMERATED ,"expecting an enumerated"}, | ||
285 | {ASN1_R_EXPECTING_AN_INTEGER ,"expecting an integer"}, | 166 | {ASN1_R_EXPECTING_AN_INTEGER ,"expecting an integer"}, |
286 | {ASN1_R_EXPECTING_AN_OBJECT ,"expecting an object"}, | 167 | {ASN1_R_EXPECTING_AN_OBJECT ,"expecting an object"}, |
287 | {ASN1_R_EXPECTING_AN_OCTET_STRING ,"expecting an octet string"}, | ||
288 | {ASN1_R_EXPECTING_A_BIT_STRING ,"expecting a bit string"}, | ||
289 | {ASN1_R_EXPECTING_A_BOOLEAN ,"expecting a boolean"}, | 168 | {ASN1_R_EXPECTING_A_BOOLEAN ,"expecting a boolean"}, |
290 | {ASN1_R_EXPECTING_A_GENERALIZEDTIME ,"expecting a generalizedtime"}, | ||
291 | {ASN1_R_EXPECTING_A_NULL ,"expecting a null"}, | ||
292 | {ASN1_R_EXPECTING_A_TIME ,"expecting a time"}, | 169 | {ASN1_R_EXPECTING_A_TIME ,"expecting a time"}, |
293 | {ASN1_R_EXPECTING_A_UTCTIME ,"expecting a utctime"}, | 170 | {ASN1_R_EXPLICIT_LENGTH_MISMATCH ,"explicit length mismatch"}, |
171 | {ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED ,"explicit tag not constructed"}, | ||
172 | {ASN1_R_FIELD_MISSING ,"field missing"}, | ||
294 | {ASN1_R_FIRST_NUM_TOO_LARGE ,"first num too large"}, | 173 | {ASN1_R_FIRST_NUM_TOO_LARGE ,"first num too large"}, |
295 | {ASN1_R_GENERALIZEDTIME_TOO_LONG ,"generalizedtime too long"}, | ||
296 | {ASN1_R_HEADER_TOO_LONG ,"header too long"}, | 174 | {ASN1_R_HEADER_TOO_LONG ,"header too long"}, |
297 | {ASN1_R_ILLEGAL_CHARACTERS ,"illegal characters"}, | 175 | {ASN1_R_ILLEGAL_CHARACTERS ,"illegal characters"}, |
176 | {ASN1_R_ILLEGAL_NULL ,"illegal null"}, | ||
177 | {ASN1_R_ILLEGAL_OPTIONAL_ANY ,"illegal optional any"}, | ||
178 | {ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE ,"illegal options on item template"}, | ||
179 | {ASN1_R_ILLEGAL_TAGGED_ANY ,"illegal tagged any"}, | ||
180 | {ASN1_R_INTEGER_TOO_LARGE_FOR_LONG ,"integer too large for long"}, | ||
298 | {ASN1_R_INVALID_BMPSTRING_LENGTH ,"invalid bmpstring length"}, | 181 | {ASN1_R_INVALID_BMPSTRING_LENGTH ,"invalid bmpstring length"}, |
299 | {ASN1_R_INVALID_DIGIT ,"invalid digit"}, | 182 | {ASN1_R_INVALID_DIGIT ,"invalid digit"}, |
300 | {ASN1_R_INVALID_SEPARATOR ,"invalid separator"}, | 183 | {ASN1_R_INVALID_SEPARATOR ,"invalid separator"}, |
@@ -303,32 +186,37 @@ static ERR_STRING_DATA ASN1_str_reasons[]= | |||
303 | {ASN1_R_INVALID_UTF8STRING ,"invalid utf8string"}, | 186 | {ASN1_R_INVALID_UTF8STRING ,"invalid utf8string"}, |
304 | {ASN1_R_IV_TOO_LARGE ,"iv too large"}, | 187 | {ASN1_R_IV_TOO_LARGE ,"iv too large"}, |
305 | {ASN1_R_LENGTH_ERROR ,"length error"}, | 188 | {ASN1_R_LENGTH_ERROR ,"length error"}, |
189 | {ASN1_R_MISSING_EOC ,"missing eoc"}, | ||
306 | {ASN1_R_MISSING_SECOND_NUMBER ,"missing second number"}, | 190 | {ASN1_R_MISSING_SECOND_NUMBER ,"missing second number"}, |
191 | {ASN1_R_MSTRING_NOT_UNIVERSAL ,"mstring not universal"}, | ||
192 | {ASN1_R_MSTRING_WRONG_TAG ,"mstring wrong tag"}, | ||
307 | {ASN1_R_NON_HEX_CHARACTERS ,"non hex characters"}, | 193 | {ASN1_R_NON_HEX_CHARACTERS ,"non hex characters"}, |
308 | {ASN1_R_NOT_ENOUGH_DATA ,"not enough data"}, | 194 | {ASN1_R_NOT_ENOUGH_DATA ,"not enough data"}, |
195 | {ASN1_R_NO_MATCHING_CHOICE_TYPE ,"no matching choice type"}, | ||
309 | {ASN1_R_NULL_IS_WRONG_LENGTH ,"null is wrong length"}, | 196 | {ASN1_R_NULL_IS_WRONG_LENGTH ,"null is wrong length"}, |
310 | {ASN1_R_ODD_NUMBER_OF_CHARS ,"odd number of chars"}, | 197 | {ASN1_R_ODD_NUMBER_OF_CHARS ,"odd number of chars"}, |
311 | {ASN1_R_PARSING ,"parsing"}, | ||
312 | {ASN1_R_PRIVATE_KEY_HEADER_MISSING ,"private key header missing"}, | 198 | {ASN1_R_PRIVATE_KEY_HEADER_MISSING ,"private key header missing"}, |
313 | {ASN1_R_SECOND_NUMBER_TOO_LARGE ,"second number too large"}, | 199 | {ASN1_R_SECOND_NUMBER_TOO_LARGE ,"second number too large"}, |
200 | {ASN1_R_SEQUENCE_LENGTH_MISMATCH ,"sequence length mismatch"}, | ||
201 | {ASN1_R_SEQUENCE_NOT_CONSTRUCTED ,"sequence not constructed"}, | ||
314 | {ASN1_R_SHORT_LINE ,"short line"}, | 202 | {ASN1_R_SHORT_LINE ,"short line"}, |
315 | {ASN1_R_STRING_TOO_LONG ,"string too long"}, | 203 | {ASN1_R_STRING_TOO_LONG ,"string too long"}, |
316 | {ASN1_R_STRING_TOO_SHORT ,"string too short"}, | 204 | {ASN1_R_STRING_TOO_SHORT ,"string too short"}, |
317 | {ASN1_R_TAG_VALUE_TOO_HIGH ,"tag value too high"}, | 205 | {ASN1_R_TAG_VALUE_TOO_HIGH ,"tag value too high"}, |
318 | {ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD,"the asn1 object identifier is not known for this md"}, | 206 | {ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD,"the asn1 object identifier is not known for this md"}, |
319 | {ASN1_R_TOO_LONG ,"too long"}, | 207 | {ASN1_R_TOO_LONG ,"too long"}, |
208 | {ASN1_R_TYPE_NOT_CONSTRUCTED ,"type not constructed"}, | ||
320 | {ASN1_R_UNABLE_TO_DECODE_RSA_KEY ,"unable to decode rsa key"}, | 209 | {ASN1_R_UNABLE_TO_DECODE_RSA_KEY ,"unable to decode rsa key"}, |
321 | {ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY ,"unable to decode rsa private key"}, | 210 | {ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY ,"unable to decode rsa private key"}, |
322 | {ASN1_R_UNKNOWN_ATTRIBUTE_TYPE ,"unknown attribute type"}, | 211 | {ASN1_R_UNEXPECTED_EOC ,"unexpected eoc"}, |
323 | {ASN1_R_UNKNOWN_FORMAT ,"unknown format"}, | 212 | {ASN1_R_UNKNOWN_FORMAT ,"unknown format"}, |
324 | {ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM ,"unknown message digest algorithm"}, | 213 | {ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM ,"unknown message digest algorithm"}, |
325 | {ASN1_R_UNKNOWN_OBJECT_TYPE ,"unknown object type"}, | 214 | {ASN1_R_UNKNOWN_OBJECT_TYPE ,"unknown object type"}, |
326 | {ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE ,"unknown public key type"}, | 215 | {ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE ,"unknown public key type"}, |
216 | {ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE ,"unsupported any defined by type"}, | ||
327 | {ASN1_R_UNSUPPORTED_CIPHER ,"unsupported cipher"}, | 217 | {ASN1_R_UNSUPPORTED_CIPHER ,"unsupported cipher"}, |
328 | {ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM ,"unsupported encryption algorithm"}, | 218 | {ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM ,"unsupported encryption algorithm"}, |
329 | {ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE ,"unsupported public key type"}, | 219 | {ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE ,"unsupported public key type"}, |
330 | {ASN1_R_UTCTIME_TOO_LONG ,"utctime too long"}, | ||
331 | {ASN1_R_WRONG_PRINTABLE_TYPE ,"wrong printable type"}, | ||
332 | {ASN1_R_WRONG_TAG ,"wrong tag"}, | 220 | {ASN1_R_WRONG_TAG ,"wrong tag"}, |
333 | {ASN1_R_WRONG_TYPE ,"wrong type"}, | 221 | {ASN1_R_WRONG_TYPE ,"wrong type"}, |
334 | {0,NULL} | 222 | {0,NULL} |
@@ -343,7 +231,7 @@ void ERR_load_ASN1_strings(void) | |||
343 | if (init) | 231 | if (init) |
344 | { | 232 | { |
345 | init=0; | 233 | init=0; |
346 | #ifndef NO_ERR | 234 | #ifndef OPENSSL_NO_ERR |
347 | ERR_load_strings(ERR_LIB_ASN1,ASN1_str_functs); | 235 | ERR_load_strings(ERR_LIB_ASN1,ASN1_str_functs); |
348 | ERR_load_strings(ERR_LIB_ASN1,ASN1_str_reasons); | 236 | ERR_load_strings(ERR_LIB_ASN1,ASN1_str_reasons); |
349 | #endif | 237 | #endif |
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c index a8b651e54e..830ff2af3c 100644 --- a/src/lib/libcrypto/asn1/asn1_lib.c +++ b/src/lib/libcrypto/asn1/asn1_lib.c | |||
@@ -59,7 +59,6 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | #include <openssl/asn1_mac.h> | ||
63 | 62 | ||
64 | static int asn1_get_length(unsigned char **pp,int *inf,long *rl,int max); | 63 | static int asn1_get_length(unsigned char **pp,int *inf,long *rl,int max); |
65 | static void asn1_put_length(unsigned char **pp, int length); | 64 | static void asn1_put_length(unsigned char **pp, int length); |
@@ -301,7 +300,7 @@ int asn1_GetSequence(ASN1_CTX *c, long *length) | |||
301 | return(0); | 300 | return(0); |
302 | } | 301 | } |
303 | if (c->inf == (1|V_ASN1_CONSTRUCTED)) | 302 | if (c->inf == (1|V_ASN1_CONSTRUCTED)) |
304 | c->slen= *length; | 303 | c->slen= *length+ *(c->pp)-c->p; |
305 | c->eos=0; | 304 | c->eos=0; |
306 | return(1); | 305 | return(1); |
307 | } | 306 | } |
diff --git a/src/lib/libcrypto/asn1/asn1_mac.h b/src/lib/libcrypto/asn1/asn1_mac.h index af0e664b2d..a48649ceeb 100644 --- a/src/lib/libcrypto/asn1/asn1_mac.h +++ b/src/lib/libcrypto/asn1/asn1_mac.h | |||
@@ -70,14 +70,14 @@ extern "C" { | |||
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #define ASN1_MAC_H_err(f,r,line) \ | 72 | #define ASN1_MAC_H_err(f,r,line) \ |
73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),ERR_file_name,(line)) | 73 | ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line)) |
74 | 74 | ||
75 | #define M_ASN1_D2I_vars(a,type,func) \ | 75 | #define M_ASN1_D2I_vars(a,type,func) \ |
76 | ASN1_CTX c; \ | 76 | ASN1_CTX c; \ |
77 | type ret=NULL; \ | 77 | type ret=NULL; \ |
78 | \ | 78 | \ |
79 | c.pp=pp; \ | 79 | c.pp=(unsigned char **)pp; \ |
80 | c.q= *pp; \ | 80 | c.q= *(unsigned char **)pp; \ |
81 | c.error=ERR_R_NESTED_ASN1_ERROR; \ | 81 | c.error=ERR_R_NESTED_ASN1_ERROR; \ |
82 | if ((a == NULL) || ((*a) == NULL)) \ | 82 | if ((a == NULL) || ((*a) == NULL)) \ |
83 | { if ((ret=(type)func()) == NULL) \ | 83 | { if ((ret=(type)func()) == NULL) \ |
@@ -85,13 +85,13 @@ extern "C" { | |||
85 | else ret=(*a); | 85 | else ret=(*a); |
86 | 86 | ||
87 | #define M_ASN1_D2I_Init() \ | 87 | #define M_ASN1_D2I_Init() \ |
88 | c.p= *pp; \ | 88 | c.p= *(unsigned char **)pp; \ |
89 | c.max=(length == 0)?0:(c.p+length); | 89 | c.max=(length == 0)?0:(c.p+length); |
90 | 90 | ||
91 | #define M_ASN1_D2I_Finish_2(a) \ | 91 | #define M_ASN1_D2I_Finish_2(a) \ |
92 | if (!asn1_Finish(&c)) \ | 92 | if (!asn1_Finish(&c)) \ |
93 | { c.line=__LINE__; goto err; } \ | 93 | { c.line=__LINE__; goto err; } \ |
94 | *pp=c.p; \ | 94 | *(unsigned char **)pp=c.p; \ |
95 | if (a != NULL) (*a)=ret; \ | 95 | if (a != NULL) (*a)=ret; \ |
96 | return(ret); | 96 | return(ret); |
97 | 97 | ||
@@ -99,7 +99,7 @@ extern "C" { | |||
99 | M_ASN1_D2I_Finish_2(a); \ | 99 | M_ASN1_D2I_Finish_2(a); \ |
100 | err:\ | 100 | err:\ |
101 | ASN1_MAC_H_err((e),c.error,c.line); \ | 101 | ASN1_MAC_H_err((e),c.error,c.line); \ |
102 | asn1_add_error(*pp,(int)(c.q- *pp)); \ | 102 | asn1_add_error(*(unsigned char **)pp,(int)(c.q- *pp)); \ |
103 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ | 103 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \ |
104 | return(NULL) | 104 | return(NULL) |
105 | 105 | ||
@@ -196,9 +196,6 @@ err:\ | |||
196 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 196 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
197 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); | 197 | M_ASN1_I2D_put_SEQUENCE_type(type,a,f); |
198 | 198 | ||
199 | #define M_ASN1_I2D_put_SEQUENCE_opt_ex_type(type,a,f) \ | ||
200 | if (a) M_ASN1_I2D_put_SEQUENCE_type(type,a,f); | ||
201 | |||
202 | #define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ | 199 | #define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \ |
203 | if ((c.slen != 0) && \ | 200 | if ((c.slen != 0) && \ |
204 | (M_ASN1_next == \ | 201 | (M_ASN1_next == \ |
@@ -392,9 +389,6 @@ err:\ | |||
392 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ | 389 | if ((a != NULL) && (sk_##type##_num(a) != 0)) \ |
393 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); | 390 | M_ASN1_I2D_len_SEQUENCE_type(type,a,f); |
394 | 391 | ||
395 | #define M_ASN1_I2D_len_SEQUENCE_opt_ex_type(type,a,f) \ | ||
396 | if (a) M_ASN1_I2D_len_SEQUENCE_type(type,a,f); | ||
397 | |||
398 | #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ | 392 | #define M_ASN1_I2D_len_IMP_SET(a,f,x) \ |
399 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); | 393 | ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET); |
400 | 394 | ||
@@ -458,15 +452,6 @@ err:\ | |||
458 | ret+=ASN1_object_size(1,v,mtag); \ | 452 | ret+=ASN1_object_size(1,v,mtag); \ |
459 | } | 453 | } |
460 | 454 | ||
461 | #define M_ASN1_I2D_len_EXP_SEQUENCE_opt_ex_type(type,a,f,mtag,tag,v) \ | ||
462 | if (a)\ | ||
463 | { \ | ||
464 | v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \ | ||
465 | V_ASN1_UNIVERSAL, \ | ||
466 | IS_SEQUENCE); \ | ||
467 | ret+=ASN1_object_size(1,v,mtag); \ | ||
468 | } | ||
469 | |||
470 | /* Put Macros */ | 455 | /* Put Macros */ |
471 | #define M_ASN1_I2D_put(a,f) f(a,&p) | 456 | #define M_ASN1_I2D_put(a,f) f(a,&p) |
472 | 457 | ||
@@ -551,14 +536,6 @@ err:\ | |||
551 | IS_SEQUENCE); \ | 536 | IS_SEQUENCE); \ |
552 | } | 537 | } |
553 | 538 | ||
554 | #define M_ASN1_I2D_put_EXP_SEQUENCE_opt_ex_type(type,a,f,mtag,tag,v) \ | ||
555 | if (a) \ | ||
556 | { \ | ||
557 | ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \ | ||
558 | i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \ | ||
559 | IS_SEQUENCE); \ | ||
560 | } | ||
561 | |||
562 | #define M_ASN1_I2D_seq_total() \ | 539 | #define M_ASN1_I2D_seq_total() \ |
563 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ | 540 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \ |
564 | if (pp == NULL) return(r); \ | 541 | if (pp == NULL) return(r); \ |
diff --git a/src/lib/libcrypto/asn1/asn1t.h b/src/lib/libcrypto/asn1/asn1t.h new file mode 100644 index 0000000000..ed372f8554 --- /dev/null +++ b/src/lib/libcrypto/asn1/asn1t.h | |||
@@ -0,0 +1,846 @@ | |||
1 | /* asn1t.h */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | #ifndef HEADER_ASN1T_H | ||
59 | #define HEADER_ASN1T_H | ||
60 | |||
61 | #include <stddef.h> | ||
62 | #include <openssl/e_os2.h> | ||
63 | #include <openssl/asn1.h> | ||
64 | |||
65 | #ifdef OPENSSL_BUILD_SHLIBCRYPTO | ||
66 | # undef OPENSSL_EXTERN | ||
67 | # define OPENSSL_EXTERN OPENSSL_EXPORT | ||
68 | #endif | ||
69 | |||
70 | /* ASN1 template defines, structures and functions */ | ||
71 | |||
72 | #ifdef __cplusplus | ||
73 | extern "C" { | ||
74 | #endif | ||
75 | |||
76 | |||
77 | #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION | ||
78 | |||
79 | /* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ | ||
80 | #define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr)) | ||
81 | |||
82 | |||
83 | /* Macros for start and end of ASN1_ITEM definition */ | ||
84 | |||
85 | #define ASN1_ITEM_start(itname) \ | ||
86 | OPENSSL_GLOBAL const ASN1_ITEM itname##_it = { | ||
87 | |||
88 | #define ASN1_ITEM_end(itname) \ | ||
89 | }; | ||
90 | |||
91 | #else | ||
92 | |||
93 | /* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ | ||
94 | #define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr())) | ||
95 | |||
96 | |||
97 | /* Macros for start and end of ASN1_ITEM definition */ | ||
98 | |||
99 | #define ASN1_ITEM_start(itname) \ | ||
100 | const ASN1_ITEM * itname##_it(void) \ | ||
101 | { \ | ||
102 | static const ASN1_ITEM local_it = { \ | ||
103 | |||
104 | #define ASN1_ITEM_end(itname) \ | ||
105 | }; \ | ||
106 | return &local_it; \ | ||
107 | } | ||
108 | |||
109 | #endif | ||
110 | |||
111 | |||
112 | /* Macros to aid ASN1 template writing */ | ||
113 | |||
114 | #define ASN1_ITEM_TEMPLATE(tname) \ | ||
115 | const static ASN1_TEMPLATE tname##_item_tt | ||
116 | |||
117 | #define ASN1_ITEM_TEMPLATE_END(tname) \ | ||
118 | ;\ | ||
119 | ASN1_ITEM_start(tname) \ | ||
120 | ASN1_ITYPE_PRIMITIVE,\ | ||
121 | -1,\ | ||
122 | &tname##_item_tt,\ | ||
123 | 0,\ | ||
124 | NULL,\ | ||
125 | 0,\ | ||
126 | #tname \ | ||
127 | ASN1_ITEM_end(tname) | ||
128 | |||
129 | |||
130 | /* This is a ASN1 type which just embeds a template */ | ||
131 | |||
132 | /* This pair helps declare a SEQUENCE. We can do: | ||
133 | * | ||
134 | * ASN1_SEQUENCE(stname) = { | ||
135 | * ... SEQUENCE components ... | ||
136 | * } ASN1_SEQUENCE_END(stname) | ||
137 | * | ||
138 | * This will produce an ASN1_ITEM called stname_it | ||
139 | * for a structure called stname. | ||
140 | * | ||
141 | * If you want the same structure but a different | ||
142 | * name then use: | ||
143 | * | ||
144 | * ASN1_SEQUENCE(itname) = { | ||
145 | * ... SEQUENCE components ... | ||
146 | * } ASN1_SEQUENCE_END_name(stname, itname) | ||
147 | * | ||
148 | * This will create an item called itname_it using | ||
149 | * a structure called stname. | ||
150 | */ | ||
151 | |||
152 | #define ASN1_SEQUENCE(tname) \ | ||
153 | const static ASN1_TEMPLATE tname##_seq_tt[] | ||
154 | |||
155 | #define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) | ||
156 | |||
157 | #define ASN1_SEQUENCE_END_name(stname, tname) \ | ||
158 | ;\ | ||
159 | ASN1_ITEM_start(tname) \ | ||
160 | ASN1_ITYPE_SEQUENCE,\ | ||
161 | V_ASN1_SEQUENCE,\ | ||
162 | tname##_seq_tt,\ | ||
163 | sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ | ||
164 | NULL,\ | ||
165 | sizeof(stname),\ | ||
166 | #stname \ | ||
167 | ASN1_ITEM_end(tname) | ||
168 | |||
169 | #define ASN1_SEQUENCE_cb(tname, cb) \ | ||
170 | const static ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ | ||
171 | ASN1_SEQUENCE(tname) | ||
172 | |||
173 | #define ASN1_BROKEN_SEQUENCE(tname) \ | ||
174 | const static ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ | ||
175 | ASN1_SEQUENCE(tname) | ||
176 | |||
177 | #define ASN1_SEQUENCE_ref(tname, cb, lck) \ | ||
178 | const static ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ | ||
179 | ASN1_SEQUENCE(tname) | ||
180 | |||
181 | #define ASN1_SEQUENCE_enc(tname, enc, cb) \ | ||
182 | const static ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \ | ||
183 | ASN1_SEQUENCE(tname) | ||
184 | |||
185 | #define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) | ||
186 | |||
187 | #define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) | ||
188 | |||
189 | #define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) | ||
190 | |||
191 | #define ASN1_SEQUENCE_END_ref(stname, tname) \ | ||
192 | ;\ | ||
193 | ASN1_ITEM_start(tname) \ | ||
194 | ASN1_ITYPE_SEQUENCE,\ | ||
195 | V_ASN1_SEQUENCE,\ | ||
196 | tname##_seq_tt,\ | ||
197 | sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ | ||
198 | &tname##_aux,\ | ||
199 | sizeof(stname),\ | ||
200 | #stname \ | ||
201 | ASN1_ITEM_end(tname) | ||
202 | |||
203 | |||
204 | /* This pair helps declare a CHOICE type. We can do: | ||
205 | * | ||
206 | * ASN1_CHOICE(chname) = { | ||
207 | * ... CHOICE options ... | ||
208 | * ASN1_CHOICE_END(chname) | ||
209 | * | ||
210 | * This will produce an ASN1_ITEM called chname_it | ||
211 | * for a structure called chname. The structure | ||
212 | * definition must look like this: | ||
213 | * typedef struct { | ||
214 | * int type; | ||
215 | * union { | ||
216 | * ASN1_SOMETHING *opt1; | ||
217 | * ASN1_SOMEOTHER *opt2; | ||
218 | * } value; | ||
219 | * } chname; | ||
220 | * | ||
221 | * the name of the selector must be 'type'. | ||
222 | * to use an alternative selector name use the | ||
223 | * ASN1_CHOICE_END_selector() version. | ||
224 | */ | ||
225 | |||
226 | #define ASN1_CHOICE(tname) \ | ||
227 | const static ASN1_TEMPLATE tname##_ch_tt[] | ||
228 | |||
229 | #define ASN1_CHOICE_cb(tname, cb) \ | ||
230 | const static ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ | ||
231 | ASN1_CHOICE(tname) | ||
232 | |||
233 | #define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) | ||
234 | |||
235 | #define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) | ||
236 | |||
237 | #define ASN1_CHOICE_END_selector(stname, tname, selname) \ | ||
238 | ;\ | ||
239 | ASN1_ITEM_start(tname) \ | ||
240 | ASN1_ITYPE_CHOICE,\ | ||
241 | offsetof(stname,selname) ,\ | ||
242 | tname##_ch_tt,\ | ||
243 | sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ | ||
244 | NULL,\ | ||
245 | sizeof(stname),\ | ||
246 | #stname \ | ||
247 | ASN1_ITEM_end(tname) | ||
248 | |||
249 | #define ASN1_CHOICE_END_cb(stname, tname, selname) \ | ||
250 | ;\ | ||
251 | ASN1_ITEM_start(tname) \ | ||
252 | ASN1_ITYPE_CHOICE,\ | ||
253 | offsetof(stname,selname) ,\ | ||
254 | tname##_ch_tt,\ | ||
255 | sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ | ||
256 | &tname##_aux,\ | ||
257 | sizeof(stname),\ | ||
258 | #stname \ | ||
259 | ASN1_ITEM_end(tname) | ||
260 | |||
261 | /* This helps with the template wrapper form of ASN1_ITEM */ | ||
262 | |||
263 | #define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ | ||
264 | (flags), (tag), 0,\ | ||
265 | #name, ASN1_ITEM_ref(type) } | ||
266 | |||
267 | /* These help with SEQUENCE or CHOICE components */ | ||
268 | |||
269 | /* used to declare other types */ | ||
270 | |||
271 | #define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ | ||
272 | (flags), (tag), offsetof(stname, field),\ | ||
273 | #field, ASN1_ITEM_ref(type) } | ||
274 | |||
275 | /* used when the structure is combined with the parent */ | ||
276 | |||
277 | #define ASN1_EX_COMBINE(flags, tag, type) { \ | ||
278 | (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) } | ||
279 | |||
280 | /* implicit and explicit helper macros */ | ||
281 | |||
282 | #define ASN1_IMP_EX(stname, field, type, tag, ex) \ | ||
283 | ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type) | ||
284 | |||
285 | #define ASN1_EXP_EX(stname, field, type, tag, ex) \ | ||
286 | ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type) | ||
287 | |||
288 | /* Any defined by macros: the field used is in the table itself */ | ||
289 | |||
290 | #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION | ||
291 | #define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } | ||
292 | #define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } | ||
293 | #else | ||
294 | #define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb } | ||
295 | #define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb } | ||
296 | #endif | ||
297 | /* Plain simple type */ | ||
298 | #define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) | ||
299 | |||
300 | /* OPTIONAL simple type */ | ||
301 | #define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) | ||
302 | |||
303 | /* IMPLICIT tagged simple type */ | ||
304 | #define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) | ||
305 | |||
306 | /* IMPLICIT tagged OPTIONAL simple type */ | ||
307 | #define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) | ||
308 | |||
309 | /* Same as above but EXPLICIT */ | ||
310 | |||
311 | #define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) | ||
312 | #define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) | ||
313 | |||
314 | /* SEQUENCE OF type */ | ||
315 | #define ASN1_SEQUENCE_OF(stname, field, type) \ | ||
316 | ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) | ||
317 | |||
318 | /* OPTIONAL SEQUENCE OF */ | ||
319 | #define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ | ||
320 | ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) | ||
321 | |||
322 | /* Same as above but for SET OF */ | ||
323 | |||
324 | #define ASN1_SET_OF(stname, field, type) \ | ||
325 | ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) | ||
326 | |||
327 | #define ASN1_SET_OF_OPT(stname, field, type) \ | ||
328 | ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) | ||
329 | |||
330 | /* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ | ||
331 | |||
332 | #define ASN1_IMP_SET_OF(stname, field, type, tag) \ | ||
333 | ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) | ||
334 | |||
335 | #define ASN1_EXP_SET_OF(stname, field, type, tag) \ | ||
336 | ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) | ||
337 | |||
338 | #define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ | ||
339 | ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) | ||
340 | |||
341 | #define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ | ||
342 | ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) | ||
343 | |||
344 | #define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ | ||
345 | ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) | ||
346 | |||
347 | #define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ | ||
348 | ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) | ||
349 | |||
350 | #define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ | ||
351 | ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) | ||
352 | |||
353 | #define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ | ||
354 | ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) | ||
355 | |||
356 | /* Macros for the ASN1_ADB structure */ | ||
357 | |||
358 | #define ASN1_ADB(name) \ | ||
359 | const static ASN1_ADB_TABLE name##_adbtbl[] | ||
360 | |||
361 | #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION | ||
362 | |||
363 | #define ASN1_ADB_END(name, flags, field, app_table, def, none) \ | ||
364 | ;\ | ||
365 | const static ASN1_ADB name##_adb = {\ | ||
366 | flags,\ | ||
367 | offsetof(name, field),\ | ||
368 | app_table,\ | ||
369 | name##_adbtbl,\ | ||
370 | sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ | ||
371 | def,\ | ||
372 | none\ | ||
373 | } | ||
374 | |||
375 | #else | ||
376 | |||
377 | #define ASN1_ADB_END(name, flags, field, app_table, def, none) \ | ||
378 | ;\ | ||
379 | const static ASN1_ITEM *name##_adb(void) \ | ||
380 | { \ | ||
381 | const static ASN1_ADB internal_adb = \ | ||
382 | {\ | ||
383 | flags,\ | ||
384 | offsetof(name, field),\ | ||
385 | app_table,\ | ||
386 | name##_adbtbl,\ | ||
387 | sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ | ||
388 | def,\ | ||
389 | none\ | ||
390 | }; \ | ||
391 | return (const ASN1_ITEM *) &internal_adb; \ | ||
392 | } \ | ||
393 | void dummy_function(void) | ||
394 | |||
395 | #endif | ||
396 | |||
397 | #define ADB_ENTRY(val, template) {val, template} | ||
398 | |||
399 | #define ASN1_ADB_TEMPLATE(name) \ | ||
400 | const static ASN1_TEMPLATE name##_tt | ||
401 | |||
402 | /* This is the ASN1 template structure that defines | ||
403 | * a wrapper round the actual type. It determines the | ||
404 | * actual position of the field in the value structure, | ||
405 | * various flags such as OPTIONAL and the field name. | ||
406 | */ | ||
407 | |||
408 | struct ASN1_TEMPLATE_st { | ||
409 | unsigned long flags; /* Various flags */ | ||
410 | long tag; /* tag, not used if no tagging */ | ||
411 | unsigned long offset; /* Offset of this field in structure */ | ||
412 | #ifndef NO_ASN1_FIELD_NAMES | ||
413 | char *field_name; /* Field name */ | ||
414 | #endif | ||
415 | ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ | ||
416 | }; | ||
417 | |||
418 | /* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ | ||
419 | |||
420 | #define ASN1_TEMPLATE_item(t) (t->item_ptr) | ||
421 | #define ASN1_TEMPLATE_adb(t) (t->item_ptr) | ||
422 | |||
423 | typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; | ||
424 | typedef struct ASN1_ADB_st ASN1_ADB; | ||
425 | |||
426 | struct ASN1_ADB_st { | ||
427 | unsigned long flags; /* Various flags */ | ||
428 | unsigned long offset; /* Offset of selector field */ | ||
429 | STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */ | ||
430 | const ASN1_ADB_TABLE *tbl; /* Table of possible types */ | ||
431 | long tblcount; /* Number of entries in tbl */ | ||
432 | const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ | ||
433 | const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ | ||
434 | }; | ||
435 | |||
436 | struct ASN1_ADB_TABLE_st { | ||
437 | long value; /* NID for an object or value for an int */ | ||
438 | const ASN1_TEMPLATE tt; /* item for this value */ | ||
439 | }; | ||
440 | |||
441 | /* template flags */ | ||
442 | |||
443 | /* Field is optional */ | ||
444 | #define ASN1_TFLG_OPTIONAL (0x1) | ||
445 | |||
446 | /* Field is a SET OF */ | ||
447 | #define ASN1_TFLG_SET_OF (0x1 << 1) | ||
448 | |||
449 | /* Field is a SEQUENCE OF */ | ||
450 | #define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) | ||
451 | |||
452 | /* Special case: this refers to a SET OF that | ||
453 | * will be sorted into DER order when encoded *and* | ||
454 | * the corresponding STACK will be modified to match | ||
455 | * the new order. | ||
456 | */ | ||
457 | #define ASN1_TFLG_SET_ORDER (0x3 << 1) | ||
458 | |||
459 | /* Mask for SET OF or SEQUENCE OF */ | ||
460 | #define ASN1_TFLG_SK_MASK (0x3 << 1) | ||
461 | |||
462 | /* These flags mean the tag should be taken from the | ||
463 | * tag field. If EXPLICIT then the underlying type | ||
464 | * is used for the inner tag. | ||
465 | */ | ||
466 | |||
467 | /* IMPLICIT tagging */ | ||
468 | #define ASN1_TFLG_IMPTAG (0x1 << 3) | ||
469 | |||
470 | |||
471 | /* EXPLICIT tagging, inner tag from underlying type */ | ||
472 | #define ASN1_TFLG_EXPTAG (0x2 << 3) | ||
473 | |||
474 | #define ASN1_TFLG_TAG_MASK (0x3 << 3) | ||
475 | |||
476 | /* context specific IMPLICIT */ | ||
477 | #define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT | ||
478 | |||
479 | /* context specific EXPLICIT */ | ||
480 | #define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT | ||
481 | |||
482 | /* If tagging is in force these determine the | ||
483 | * type of tag to use. Otherwise the tag is | ||
484 | * determined by the underlying type. These | ||
485 | * values reflect the actual octet format. | ||
486 | */ | ||
487 | |||
488 | /* Universal tag */ | ||
489 | #define ASN1_TFLG_UNIVERSAL (0x0<<6) | ||
490 | /* Application tag */ | ||
491 | #define ASN1_TFLG_APPLICATION (0x1<<6) | ||
492 | /* Context specific tag */ | ||
493 | #define ASN1_TFLG_CONTEXT (0x2<<6) | ||
494 | /* Private tag */ | ||
495 | #define ASN1_TFLG_PRIVATE (0x3<<6) | ||
496 | |||
497 | #define ASN1_TFLG_TAG_CLASS (0x3<<6) | ||
498 | |||
499 | /* These are for ANY DEFINED BY type. In this case | ||
500 | * the 'item' field points to an ASN1_ADB structure | ||
501 | * which contains a table of values to decode the | ||
502 | * relevant type | ||
503 | */ | ||
504 | |||
505 | #define ASN1_TFLG_ADB_MASK (0x3<<8) | ||
506 | |||
507 | #define ASN1_TFLG_ADB_OID (0x1<<8) | ||
508 | |||
509 | #define ASN1_TFLG_ADB_INT (0x1<<9) | ||
510 | |||
511 | /* This flag means a parent structure is passed | ||
512 | * instead of the field: this is useful is a | ||
513 | * SEQUENCE is being combined with a CHOICE for | ||
514 | * example. Since this means the structure and | ||
515 | * item name will differ we need to use the | ||
516 | * ASN1_CHOICE_END_name() macro for example. | ||
517 | */ | ||
518 | |||
519 | #define ASN1_TFLG_COMBINE (0x1<<10) | ||
520 | |||
521 | /* This is the actual ASN1 item itself */ | ||
522 | |||
523 | struct ASN1_ITEM_st { | ||
524 | char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ | ||
525 | long utype; /* underlying type */ | ||
526 | const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */ | ||
527 | long tcount; /* Number of templates if SEQUENCE or CHOICE */ | ||
528 | const void *funcs; /* functions that handle this type */ | ||
529 | long size; /* Structure size (usually)*/ | ||
530 | #ifndef NO_ASN1_FIELD_NAMES | ||
531 | const char *sname; /* Structure name */ | ||
532 | #endif | ||
533 | }; | ||
534 | |||
535 | /* These are values for the itype field and | ||
536 | * determine how the type is interpreted. | ||
537 | * | ||
538 | * For PRIMITIVE types the underlying type | ||
539 | * determines the behaviour if items is NULL. | ||
540 | * | ||
541 | * Otherwise templates must contain a single | ||
542 | * template and the type is treated in the | ||
543 | * same way as the type specified in the template. | ||
544 | * | ||
545 | * For SEQUENCE types the templates field points | ||
546 | * to the members, the size field is the | ||
547 | * structure size. | ||
548 | * | ||
549 | * For CHOICE types the templates field points | ||
550 | * to each possible member (typically a union) | ||
551 | * and the 'size' field is the offset of the | ||
552 | * selector. | ||
553 | * | ||
554 | * The 'funcs' field is used for application | ||
555 | * specific functions. | ||
556 | * | ||
557 | * For COMPAT types the funcs field gives a | ||
558 | * set of functions that handle this type, this | ||
559 | * supports the old d2i, i2d convention. | ||
560 | * | ||
561 | * The EXTERN type uses a new style d2i/i2d. | ||
562 | * The new style should be used where possible | ||
563 | * because it avoids things like the d2i IMPLICIT | ||
564 | * hack. | ||
565 | * | ||
566 | * MSTRING is a multiple string type, it is used | ||
567 | * for a CHOICE of character strings where the | ||
568 | * actual strings all occupy an ASN1_STRING | ||
569 | * structure. In this case the 'utype' field | ||
570 | * has a special meaning, it is used as a mask | ||
571 | * of acceptable types using the B_ASN1 constants. | ||
572 | * | ||
573 | */ | ||
574 | |||
575 | #define ASN1_ITYPE_PRIMITIVE 0x0 | ||
576 | |||
577 | #define ASN1_ITYPE_SEQUENCE 0x1 | ||
578 | |||
579 | #define ASN1_ITYPE_CHOICE 0x2 | ||
580 | |||
581 | #define ASN1_ITYPE_COMPAT 0x3 | ||
582 | |||
583 | #define ASN1_ITYPE_EXTERN 0x4 | ||
584 | |||
585 | #define ASN1_ITYPE_MSTRING 0x5 | ||
586 | |||
587 | /* Cache for ASN1 tag and length, so we | ||
588 | * don't keep re-reading it for things | ||
589 | * like CHOICE | ||
590 | */ | ||
591 | |||
592 | struct ASN1_TLC_st{ | ||
593 | char valid; /* Values below are valid */ | ||
594 | int ret; /* return value */ | ||
595 | long plen; /* length */ | ||
596 | int ptag; /* class value */ | ||
597 | int pclass; /* class value */ | ||
598 | int hdrlen; /* header length */ | ||
599 | }; | ||
600 | |||
601 | /* Typedefs for ASN1 function pointers */ | ||
602 | |||
603 | typedef ASN1_VALUE * ASN1_new_func(void); | ||
604 | typedef void ASN1_free_func(ASN1_VALUE *a); | ||
605 | typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, unsigned char ** in, long length); | ||
606 | typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); | ||
607 | |||
608 | typedef int ASN1_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_ITEM *it, | ||
609 | int tag, int aclass, char opt, ASN1_TLC *ctx); | ||
610 | |||
611 | typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); | ||
612 | typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
613 | typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
614 | |||
615 | typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); | ||
616 | typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); | ||
617 | |||
618 | typedef struct ASN1_COMPAT_FUNCS_st { | ||
619 | ASN1_new_func *asn1_new; | ||
620 | ASN1_free_func *asn1_free; | ||
621 | ASN1_d2i_func *asn1_d2i; | ||
622 | ASN1_i2d_func *asn1_i2d; | ||
623 | } ASN1_COMPAT_FUNCS; | ||
624 | |||
625 | typedef struct ASN1_EXTERN_FUNCS_st { | ||
626 | void *app_data; | ||
627 | ASN1_ex_new_func *asn1_ex_new; | ||
628 | ASN1_ex_free_func *asn1_ex_free; | ||
629 | ASN1_ex_free_func *asn1_ex_clear; | ||
630 | ASN1_ex_d2i *asn1_ex_d2i; | ||
631 | ASN1_ex_i2d *asn1_ex_i2d; | ||
632 | } ASN1_EXTERN_FUNCS; | ||
633 | |||
634 | typedef struct ASN1_PRIMITIVE_FUNCS_st { | ||
635 | void *app_data; | ||
636 | unsigned long flags; | ||
637 | ASN1_ex_new_func *prim_new; | ||
638 | ASN1_ex_free_func *prim_free; | ||
639 | ASN1_ex_free_func *prim_clear; | ||
640 | ASN1_primitive_c2i *prim_c2i; | ||
641 | ASN1_primitive_i2c *prim_i2c; | ||
642 | } ASN1_PRIMITIVE_FUNCS; | ||
643 | |||
644 | /* This is the ASN1_AUX structure: it handles various | ||
645 | * miscellaneous requirements. For example the use of | ||
646 | * reference counts and an informational callback. | ||
647 | * | ||
648 | * The "informational callback" is called at various | ||
649 | * points during the ASN1 encoding and decoding. It can | ||
650 | * be used to provide minor customisation of the structures | ||
651 | * used. This is most useful where the supplied routines | ||
652 | * *almost* do the right thing but need some extra help | ||
653 | * at a few points. If the callback returns zero then | ||
654 | * it is assumed a fatal error has occurred and the | ||
655 | * main operation should be abandoned. | ||
656 | * | ||
657 | * If major changes in the default behaviour are required | ||
658 | * then an external type is more appropriate. | ||
659 | */ | ||
660 | |||
661 | typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it); | ||
662 | |||
663 | typedef struct ASN1_AUX_st { | ||
664 | void *app_data; | ||
665 | int flags; | ||
666 | int ref_offset; /* Offset of reference value */ | ||
667 | int ref_lock; /* Lock type to use */ | ||
668 | ASN1_aux_cb *asn1_cb; | ||
669 | int enc_offset; /* Offset of ASN1_ENCODING structure */ | ||
670 | } ASN1_AUX; | ||
671 | |||
672 | /* Flags in ASN1_AUX */ | ||
673 | |||
674 | /* Use a reference count */ | ||
675 | #define ASN1_AFLG_REFCOUNT 1 | ||
676 | /* Save the encoding of structure (useful for signatures) */ | ||
677 | #define ASN1_AFLG_ENCODING 2 | ||
678 | /* The Sequence length is invalid */ | ||
679 | #define ASN1_AFLG_BROKEN 4 | ||
680 | |||
681 | /* operation values for asn1_cb */ | ||
682 | |||
683 | #define ASN1_OP_NEW_PRE 0 | ||
684 | #define ASN1_OP_NEW_POST 1 | ||
685 | #define ASN1_OP_FREE_PRE 2 | ||
686 | #define ASN1_OP_FREE_POST 3 | ||
687 | #define ASN1_OP_D2I_PRE 4 | ||
688 | #define ASN1_OP_D2I_POST 5 | ||
689 | #define ASN1_OP_I2D_PRE 6 | ||
690 | #define ASN1_OP_I2D_POST 7 | ||
691 | |||
692 | /* Macro to implement a primitive type */ | ||
693 | #define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) | ||
694 | #define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ | ||
695 | ASN1_ITEM_start(itname) \ | ||
696 | ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ | ||
697 | ASN1_ITEM_end(itname) | ||
698 | |||
699 | /* Macro to implement a multi string type */ | ||
700 | #define IMPLEMENT_ASN1_MSTRING(itname, mask) \ | ||
701 | ASN1_ITEM_start(itname) \ | ||
702 | ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ | ||
703 | ASN1_ITEM_end(itname) | ||
704 | |||
705 | /* Macro to implement an ASN1_ITEM in terms of old style funcs */ | ||
706 | |||
707 | #define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE) | ||
708 | |||
709 | #define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \ | ||
710 | static const ASN1_COMPAT_FUNCS sname##_ff = { \ | ||
711 | (ASN1_new_func *)sname##_new, \ | ||
712 | (ASN1_free_func *)sname##_free, \ | ||
713 | (ASN1_d2i_func *)d2i_##sname, \ | ||
714 | (ASN1_i2d_func *)i2d_##sname, \ | ||
715 | }; \ | ||
716 | ASN1_ITEM_start(sname) \ | ||
717 | ASN1_ITYPE_COMPAT, \ | ||
718 | tag, \ | ||
719 | NULL, \ | ||
720 | 0, \ | ||
721 | &sname##_ff, \ | ||
722 | 0, \ | ||
723 | #sname \ | ||
724 | ASN1_ITEM_end(sname) | ||
725 | |||
726 | #define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ | ||
727 | ASN1_ITEM_start(sname) \ | ||
728 | ASN1_ITYPE_EXTERN, \ | ||
729 | tag, \ | ||
730 | NULL, \ | ||
731 | 0, \ | ||
732 | &fptrs, \ | ||
733 | 0, \ | ||
734 | #sname \ | ||
735 | ASN1_ITEM_end(sname) | ||
736 | |||
737 | /* Macro to implement standard functions in terms of ASN1_ITEM structures */ | ||
738 | |||
739 | #define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) | ||
740 | |||
741 | #define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) | ||
742 | |||
743 | #define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ | ||
744 | IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) | ||
745 | |||
746 | #define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ | ||
747 | stname *fname##_new(void) \ | ||
748 | { \ | ||
749 | return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ | ||
750 | } \ | ||
751 | void fname##_free(stname *a) \ | ||
752 | { \ | ||
753 | ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ | ||
754 | } | ||
755 | |||
756 | #define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ | ||
757 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ | ||
758 | IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) | ||
759 | |||
760 | #define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ | ||
761 | stname *d2i_##fname(stname **a, unsigned char **in, long len) \ | ||
762 | { \ | ||
763 | return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ | ||
764 | } \ | ||
765 | int i2d_##fname(stname *a, unsigned char **out) \ | ||
766 | { \ | ||
767 | return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ | ||
768 | } | ||
769 | |||
770 | /* This includes evil casts to remove const: they will go away when full | ||
771 | * ASN1 constification is done. | ||
772 | */ | ||
773 | #define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ | ||
774 | stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ | ||
775 | { \ | ||
776 | return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, (unsigned char **)in, len, ASN1_ITEM_rptr(itname));\ | ||
777 | } \ | ||
778 | int i2d_##fname(const stname *a, unsigned char **out) \ | ||
779 | { \ | ||
780 | return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ | ||
781 | } | ||
782 | |||
783 | #define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ | ||
784 | stname * stname##_dup(stname *x) \ | ||
785 | { \ | ||
786 | return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ | ||
787 | } | ||
788 | |||
789 | #define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ | ||
790 | IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) | ||
791 | |||
792 | #define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ | ||
793 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ | ||
794 | IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) | ||
795 | |||
796 | /* external definitions for primitive types */ | ||
797 | |||
798 | DECLARE_ASN1_ITEM(ASN1_BOOLEAN) | ||
799 | DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) | ||
800 | DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) | ||
801 | DECLARE_ASN1_ITEM(ASN1_ANY) | ||
802 | DECLARE_ASN1_ITEM(ASN1_SEQUENCE) | ||
803 | DECLARE_ASN1_ITEM(CBIGNUM) | ||
804 | DECLARE_ASN1_ITEM(BIGNUM) | ||
805 | DECLARE_ASN1_ITEM(LONG) | ||
806 | DECLARE_ASN1_ITEM(ZLONG) | ||
807 | |||
808 | DECLARE_STACK_OF(ASN1_VALUE) | ||
809 | |||
810 | /* Functions used internally by the ASN1 code */ | ||
811 | |||
812 | int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
813 | void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
814 | int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
815 | int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
816 | |||
817 | void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
818 | int ASN1_template_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_TEMPLATE *tt); | ||
819 | int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_ITEM *it, | ||
820 | int tag, int aclass, char opt, ASN1_TLC *ctx); | ||
821 | |||
822 | int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); | ||
823 | int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt); | ||
824 | void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
825 | |||
826 | int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); | ||
827 | int asn1_ex_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); | ||
828 | |||
829 | int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
830 | int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it); | ||
831 | |||
832 | ASN1_VALUE ** asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
833 | |||
834 | const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr); | ||
835 | |||
836 | int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); | ||
837 | |||
838 | void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
839 | void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
840 | int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
841 | int asn1_enc_save(ASN1_VALUE **pval, unsigned char *in, int inlen, const ASN1_ITEM *it); | ||
842 | |||
843 | #ifdef __cplusplus | ||
844 | } | ||
845 | #endif | ||
846 | #endif | ||
diff --git a/src/lib/libcrypto/asn1/asn_moid.c b/src/lib/libcrypto/asn1/asn_moid.c new file mode 100644 index 0000000000..be20db4bad --- /dev/null +++ b/src/lib/libcrypto/asn1/asn_moid.c | |||
@@ -0,0 +1,95 @@ | |||
1 | /* asn_moid.c */ | ||
2 | /* Written by Stephen Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2001. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <openssl/crypto.h> | ||
61 | #include "cryptlib.h" | ||
62 | #include <openssl/conf.h> | ||
63 | #include <openssl/dso.h> | ||
64 | #include <openssl/x509.h> | ||
65 | |||
66 | /* Simple ASN1 OID module: add all objects in a given section */ | ||
67 | |||
68 | static int oid_module_init(CONF_IMODULE *md, const CONF *cnf) | ||
69 | { | ||
70 | int i; | ||
71 | const char *oid_section; | ||
72 | STACK_OF(CONF_VALUE) *sktmp; | ||
73 | CONF_VALUE *oval; | ||
74 | oid_section = CONF_imodule_get_value(md); | ||
75 | if(!(sktmp = NCONF_get_section(cnf, oid_section))) | ||
76 | { | ||
77 | ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ERROR_LOADING_SECTION); | ||
78 | return 0; | ||
79 | } | ||
80 | for(i = 0; i < sk_CONF_VALUE_num(sktmp); i++) | ||
81 | { | ||
82 | oval = sk_CONF_VALUE_value(sktmp, i); | ||
83 | if(OBJ_create(oval->value, oval->name, oval->name) == NID_undef) | ||
84 | { | ||
85 | ASN1err(ASN1_F_OID_MODULE_INIT, ASN1_R_ADDING_OBJECT); | ||
86 | return 0; | ||
87 | } | ||
88 | } | ||
89 | return 1; | ||
90 | } | ||
91 | |||
92 | void ASN1_add_oid_module(void) | ||
93 | { | ||
94 | CONF_module_add("oid_section", oid_module_init, 0); | ||
95 | } | ||
diff --git a/src/lib/libcrypto/asn1/asn_pack.c b/src/lib/libcrypto/asn1/asn_pack.c index bdf5f130b3..e6051db2dc 100644 --- a/src/lib/libcrypto/asn1/asn_pack.c +++ b/src/lib/libcrypto/asn1/asn_pack.c | |||
@@ -60,6 +60,8 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1.h> | 61 | #include <openssl/asn1.h> |
62 | 62 | ||
63 | #ifndef NO_ASN1_OLD | ||
64 | |||
63 | /* ASN1 packing and unpacking functions */ | 65 | /* ASN1 packing and unpacking functions */ |
64 | 66 | ||
65 | /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ | 67 | /* Turn an ASN1 encoded SEQUENCE OF into a STACK of structures */ |
@@ -117,7 +119,7 @@ void *ASN1_unpack_string (ASN1_STRING *oct, char *(*d2i)()) | |||
117 | 119 | ||
118 | /* Pack an ASN1 object into an ASN1_STRING */ | 120 | /* Pack an ASN1 object into an ASN1_STRING */ |
119 | 121 | ||
120 | ASN1_STRING *ASN1_pack_string (void *obj, int (*i2d)(), ASN1_STRING **oct) | 122 | ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_STRING **oct) |
121 | { | 123 | { |
122 | unsigned char *p; | 124 | unsigned char *p; |
123 | ASN1_STRING *octmp; | 125 | ASN1_STRING *octmp; |
@@ -143,3 +145,47 @@ ASN1_STRING *ASN1_pack_string (void *obj, int (*i2d)(), ASN1_STRING **oct) | |||
143 | return octmp; | 145 | return octmp; |
144 | } | 146 | } |
145 | 147 | ||
148 | #endif | ||
149 | |||
150 | /* ASN1_ITEM versions of the above */ | ||
151 | |||
152 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_STRING **oct) | ||
153 | { | ||
154 | ASN1_STRING *octmp; | ||
155 | |||
156 | if (!oct || !*oct) { | ||
157 | if (!(octmp = ASN1_STRING_new ())) { | ||
158 | ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); | ||
159 | return NULL; | ||
160 | } | ||
161 | if (oct) *oct = octmp; | ||
162 | } else octmp = *oct; | ||
163 | |||
164 | if(octmp->data) { | ||
165 | OPENSSL_free(octmp->data); | ||
166 | octmp->data = NULL; | ||
167 | } | ||
168 | |||
169 | if (!(octmp->length = ASN1_item_i2d(obj, &octmp->data, it))) { | ||
170 | ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); | ||
171 | return NULL; | ||
172 | } | ||
173 | if (!octmp->data) { | ||
174 | ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); | ||
175 | return NULL; | ||
176 | } | ||
177 | return octmp; | ||
178 | } | ||
179 | |||
180 | /* Extract an ASN1 object from an ASN1_STRING */ | ||
181 | |||
182 | void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it) | ||
183 | { | ||
184 | unsigned char *p; | ||
185 | void *ret; | ||
186 | |||
187 | p = oct->data; | ||
188 | if(!(ret = ASN1_item_d2i(NULL, &p, oct->length, it))) | ||
189 | ASN1err(ASN1_F_ASN1_UNPACK_STRING,ASN1_R_DECODE_ERROR); | ||
190 | return ret; | ||
191 | } | ||
diff --git a/src/lib/libcrypto/asn1/d2i_pr.c b/src/lib/libcrypto/asn1/d2i_pr.c index c92b8325d8..2e7d96af90 100644 --- a/src/lib/libcrypto/asn1/d2i_pr.c +++ b/src/lib/libcrypto/asn1/d2i_pr.c | |||
@@ -62,6 +62,12 @@ | |||
62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
64 | #include <openssl/asn1.h> | 64 | #include <openssl/asn1.h> |
65 | #ifndef OPENSSL_NO_RSA | ||
66 | #include <openssl/rsa.h> | ||
67 | #endif | ||
68 | #ifndef OPENSSL_NO_DSA | ||
69 | #include <openssl/dsa.h> | ||
70 | #endif | ||
65 | 71 | ||
66 | EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, | 72 | EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, |
67 | long length) | 73 | long length) |
@@ -82,18 +88,20 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, | |||
82 | ret->type=EVP_PKEY_type(type); | 88 | ret->type=EVP_PKEY_type(type); |
83 | switch (ret->type) | 89 | switch (ret->type) |
84 | { | 90 | { |
85 | #ifndef NO_RSA | 91 | #ifndef OPENSSL_NO_RSA |
86 | case EVP_PKEY_RSA: | 92 | case EVP_PKEY_RSA: |
87 | if ((ret->pkey.rsa=d2i_RSAPrivateKey(NULL,pp,length)) == NULL) | 93 | if ((ret->pkey.rsa=d2i_RSAPrivateKey(NULL, |
94 | (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ | ||
88 | { | 95 | { |
89 | ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); | 96 | ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); |
90 | goto err; | 97 | goto err; |
91 | } | 98 | } |
92 | break; | 99 | break; |
93 | #endif | 100 | #endif |
94 | #ifndef NO_DSA | 101 | #ifndef OPENSSL_NO_DSA |
95 | case EVP_PKEY_DSA: | 102 | case EVP_PKEY_DSA: |
96 | if ((ret->pkey.dsa=d2i_DSAPrivateKey(NULL,pp,length)) == NULL) | 103 | if ((ret->pkey.dsa=d2i_DSAPrivateKey(NULL, |
104 | (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ | ||
97 | { | 105 | { |
98 | ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); | 106 | ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); |
99 | goto err; | 107 | goto err; |
diff --git a/src/lib/libcrypto/asn1/d2i_pu.c b/src/lib/libcrypto/asn1/d2i_pu.c index e0d203cef7..71f2eb361b 100644 --- a/src/lib/libcrypto/asn1/d2i_pu.c +++ b/src/lib/libcrypto/asn1/d2i_pu.c | |||
@@ -62,6 +62,12 @@ | |||
62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
64 | #include <openssl/asn1.h> | 64 | #include <openssl/asn1.h> |
65 | #ifndef OPENSSL_NO_RSA | ||
66 | #include <openssl/rsa.h> | ||
67 | #endif | ||
68 | #ifndef OPENSSL_NO_DSA | ||
69 | #include <openssl/dsa.h> | ||
70 | #endif | ||
65 | 71 | ||
66 | EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, | 72 | EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, |
67 | long length) | 73 | long length) |
@@ -82,18 +88,20 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, | |||
82 | ret->type=EVP_PKEY_type(type); | 88 | ret->type=EVP_PKEY_type(type); |
83 | switch (ret->type) | 89 | switch (ret->type) |
84 | { | 90 | { |
85 | #ifndef NO_RSA | 91 | #ifndef OPENSSL_NO_RSA |
86 | case EVP_PKEY_RSA: | 92 | case EVP_PKEY_RSA: |
87 | if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL,pp,length)) == NULL) | 93 | if ((ret->pkey.rsa=d2i_RSAPublicKey(NULL, |
94 | (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ | ||
88 | { | 95 | { |
89 | ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); | 96 | ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); |
90 | goto err; | 97 | goto err; |
91 | } | 98 | } |
92 | break; | 99 | break; |
93 | #endif | 100 | #endif |
94 | #ifndef NO_DSA | 101 | #ifndef OPENSSL_NO_DSA |
95 | case EVP_PKEY_DSA: | 102 | case EVP_PKEY_DSA: |
96 | if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL,pp,length)) == NULL) | 103 | if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL, |
104 | (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ | ||
97 | { | 105 | { |
98 | ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); | 106 | ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); |
99 | goto err; | 107 | goto err; |
diff --git a/src/lib/libcrypto/asn1/f_int.c b/src/lib/libcrypto/asn1/f_int.c index 6b090f6740..48cc3bfb90 100644 --- a/src/lib/libcrypto/asn1/f_int.c +++ b/src/lib/libcrypto/asn1/f_int.c | |||
@@ -69,10 +69,16 @@ int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a) | |||
69 | 69 | ||
70 | if (a == NULL) return(0); | 70 | if (a == NULL) return(0); |
71 | 71 | ||
72 | if (a->type & V_ASN1_NEG) | ||
73 | { | ||
74 | if (BIO_write(bp, "-", 1) != 1) goto err; | ||
75 | n = 1; | ||
76 | } | ||
77 | |||
72 | if (a->length == 0) | 78 | if (a->length == 0) |
73 | { | 79 | { |
74 | if (BIO_write(bp,"00",2) != 2) goto err; | 80 | if (BIO_write(bp,"00",2) != 2) goto err; |
75 | n=2; | 81 | n += 2; |
76 | } | 82 | } |
77 | else | 83 | else |
78 | { | 84 | { |
diff --git a/src/lib/libcrypto/asn1/i2d_pr.c b/src/lib/libcrypto/asn1/i2d_pr.c index 71d6910204..1e951ae01d 100644 --- a/src/lib/libcrypto/asn1/i2d_pr.c +++ b/src/lib/libcrypto/asn1/i2d_pr.c | |||
@@ -61,17 +61,23 @@ | |||
61 | #include <openssl/bn.h> | 61 | #include <openssl/bn.h> |
62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
64 | #ifndef OPENSSL_NO_RSA | ||
65 | #include <openssl/rsa.h> | ||
66 | #endif | ||
67 | #ifndef OPENSSL_NO_DSA | ||
68 | #include <openssl/dsa.h> | ||
69 | #endif | ||
64 | 70 | ||
65 | int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) | 71 | int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) |
66 | { | 72 | { |
67 | #ifndef NO_RSA | 73 | #ifndef OPENSSL_NO_RSA |
68 | if (a->type == EVP_PKEY_RSA) | 74 | if (a->type == EVP_PKEY_RSA) |
69 | { | 75 | { |
70 | return(i2d_RSAPrivateKey(a->pkey.rsa,pp)); | 76 | return(i2d_RSAPrivateKey(a->pkey.rsa,pp)); |
71 | } | 77 | } |
72 | else | 78 | else |
73 | #endif | 79 | #endif |
74 | #ifndef NO_DSA | 80 | #ifndef OPENSSL_NO_DSA |
75 | if (a->type == EVP_PKEY_DSA) | 81 | if (a->type == EVP_PKEY_DSA) |
76 | { | 82 | { |
77 | return(i2d_DSAPrivateKey(a->pkey.dsa,pp)); | 83 | return(i2d_DSAPrivateKey(a->pkey.dsa,pp)); |
diff --git a/src/lib/libcrypto/asn1/i2d_pu.c b/src/lib/libcrypto/asn1/i2d_pu.c index 8f73d37d03..013d19bbf4 100644 --- a/src/lib/libcrypto/asn1/i2d_pu.c +++ b/src/lib/libcrypto/asn1/i2d_pu.c | |||
@@ -61,16 +61,22 @@ | |||
61 | #include <openssl/bn.h> | 61 | #include <openssl/bn.h> |
62 | #include <openssl/evp.h> | 62 | #include <openssl/evp.h> |
63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
64 | #ifndef OPENSSL_NO_RSA | ||
65 | #include <openssl/rsa.h> | ||
66 | #endif | ||
67 | #ifndef OPENSSL_NO_DSA | ||
68 | #include <openssl/dsa.h> | ||
69 | #endif | ||
64 | 70 | ||
65 | int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) | 71 | int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) |
66 | { | 72 | { |
67 | switch (a->type) | 73 | switch (a->type) |
68 | { | 74 | { |
69 | #ifndef NO_RSA | 75 | #ifndef OPENSSL_NO_RSA |
70 | case EVP_PKEY_RSA: | 76 | case EVP_PKEY_RSA: |
71 | return(i2d_RSAPublicKey(a->pkey.rsa,pp)); | 77 | return(i2d_RSAPublicKey(a->pkey.rsa,pp)); |
72 | #endif | 78 | #endif |
73 | #ifndef NO_DSA | 79 | #ifndef OPENSSL_NO_DSA |
74 | case EVP_PKEY_DSA: | 80 | case EVP_PKEY_DSA: |
75 | return(i2d_DSAPublicKey(a->pkey.dsa,pp)); | 81 | return(i2d_DSAPublicKey(a->pkey.dsa,pp)); |
76 | #endif | 82 | #endif |
diff --git a/src/lib/libcrypto/asn1/n_pkey.c b/src/lib/libcrypto/asn1/n_pkey.c index 9840193538..49f80fffd2 100644 --- a/src/lib/libcrypto/asn1/n_pkey.c +++ b/src/lib/libcrypto/asn1/n_pkey.c | |||
@@ -56,110 +56,134 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #ifndef NO_RSA | 59 | #ifndef OPENSSL_NO_RSA |
60 | #include <stdio.h> | 60 | #include <stdio.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/rsa.h> | 62 | #include <openssl/rsa.h> |
63 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
64 | #include <openssl/asn1t.h> | ||
64 | #include <openssl/asn1_mac.h> | 65 | #include <openssl/asn1_mac.h> |
65 | #include <openssl/evp.h> | 66 | #include <openssl/evp.h> |
66 | #include <openssl/x509.h> | 67 | #include <openssl/x509.h> |
67 | 68 | ||
68 | 69 | ||
69 | #ifndef NO_RC4 | 70 | #ifndef OPENSSL_NO_RC4 |
70 | 71 | ||
71 | typedef struct netscape_pkey_st | 72 | typedef struct netscape_pkey_st |
72 | { | 73 | { |
73 | ASN1_INTEGER *version; | 74 | long version; |
74 | X509_ALGOR *algor; | 75 | X509_ALGOR *algor; |
75 | ASN1_OCTET_STRING *private_key; | 76 | ASN1_OCTET_STRING *private_key; |
76 | } NETSCAPE_PKEY; | 77 | } NETSCAPE_PKEY; |
77 | 78 | ||
78 | static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp); | 79 | typedef struct netscape_encrypted_pkey_st |
79 | static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a,unsigned char **pp, long length); | 80 | { |
80 | static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void); | 81 | ASN1_OCTET_STRING *os; |
81 | static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *); | 82 | /* This is the same structure as DigestInfo so use it: |
83 | * although this isn't really anything to do with | ||
84 | * digests. | ||
85 | */ | ||
86 | X509_SIG *enckey; | ||
87 | } NETSCAPE_ENCRYPTED_PKEY; | ||
88 | |||
89 | |||
90 | ASN1_BROKEN_SEQUENCE(NETSCAPE_ENCRYPTED_PKEY) = { | ||
91 | ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, os, ASN1_OCTET_STRING), | ||
92 | ASN1_SIMPLE(NETSCAPE_ENCRYPTED_PKEY, enckey, X509_SIG) | ||
93 | } ASN1_BROKEN_SEQUENCE_END(NETSCAPE_ENCRYPTED_PKEY) | ||
94 | |||
95 | IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_ENCRYPTED_PKEY) | ||
82 | 96 | ||
83 | int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()) | 97 | ASN1_SEQUENCE(NETSCAPE_PKEY) = { |
98 | ASN1_SIMPLE(NETSCAPE_PKEY, version, LONG), | ||
99 | ASN1_SIMPLE(NETSCAPE_PKEY, algor, X509_ALGOR), | ||
100 | ASN1_SIMPLE(NETSCAPE_PKEY, private_key, ASN1_OCTET_STRING) | ||
101 | } ASN1_SEQUENCE_END(NETSCAPE_PKEY) | ||
102 | |||
103 | IMPLEMENT_ASN1_FUNCTIONS_const(NETSCAPE_PKEY) | ||
104 | |||
105 | static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os, | ||
106 | int (*cb)(), int sgckey); | ||
107 | |||
108 | int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, int (*cb)()) | ||
84 | { | 109 | { |
85 | return i2d_RSA_NET(a, pp, cb, 0); | 110 | return i2d_RSA_NET(a, pp, cb, 0); |
86 | } | 111 | } |
87 | 112 | ||
88 | int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey) | 113 | int i2d_RSA_NET(const RSA *a, unsigned char **pp, int (*cb)(), int sgckey) |
89 | { | 114 | { |
90 | int i,j,l[6]; | 115 | int i, j, ret = 0; |
91 | NETSCAPE_PKEY *pkey; | 116 | int rsalen, pkeylen, olen; |
117 | NETSCAPE_PKEY *pkey = NULL; | ||
118 | NETSCAPE_ENCRYPTED_PKEY *enckey = NULL; | ||
92 | unsigned char buf[256],*zz; | 119 | unsigned char buf[256],*zz; |
93 | unsigned char key[EVP_MAX_KEY_LENGTH]; | 120 | unsigned char key[EVP_MAX_KEY_LENGTH]; |
94 | EVP_CIPHER_CTX ctx; | 121 | EVP_CIPHER_CTX ctx; |
95 | X509_ALGOR *alg=NULL; | ||
96 | ASN1_OCTET_STRING os,os2; | ||
97 | M_ASN1_I2D_vars(a); | ||
98 | 122 | ||
99 | if (a == NULL) return(0); | 123 | if (a == NULL) return(0); |
100 | 124 | ||
101 | #ifdef WIN32 | ||
102 | r=r; /* shut the damn compiler up :-) */ | ||
103 | #endif | ||
104 | |||
105 | os.data=os2.data=NULL; | ||
106 | if ((pkey=NETSCAPE_PKEY_new()) == NULL) goto err; | 125 | if ((pkey=NETSCAPE_PKEY_new()) == NULL) goto err; |
107 | if (!ASN1_INTEGER_set(pkey->version,0)) goto err; | 126 | if ((enckey=NETSCAPE_ENCRYPTED_PKEY_new()) == NULL) goto err; |
127 | pkey->version = 0; | ||
108 | 128 | ||
109 | if (pkey->algor->algorithm != NULL) | ||
110 | ASN1_OBJECT_free(pkey->algor->algorithm); | ||
111 | pkey->algor->algorithm=OBJ_nid2obj(NID_rsaEncryption); | 129 | pkey->algor->algorithm=OBJ_nid2obj(NID_rsaEncryption); |
112 | if ((pkey->algor->parameter=ASN1_TYPE_new()) == NULL) goto err; | 130 | if ((pkey->algor->parameter=ASN1_TYPE_new()) == NULL) goto err; |
113 | pkey->algor->parameter->type=V_ASN1_NULL; | 131 | pkey->algor->parameter->type=V_ASN1_NULL; |
114 | 132 | ||
115 | l[0]=i2d_RSAPrivateKey(a,NULL); | 133 | rsalen = i2d_RSAPrivateKey(a, NULL); |
116 | pkey->private_key->length=l[0]; | ||
117 | 134 | ||
118 | os2.length=i2d_NETSCAPE_PKEY(pkey,NULL); | 135 | /* Fake some octet strings just for the initial length |
119 | l[1]=i2d_ASN1_OCTET_STRING(&os2,NULL); | 136 | * calculation. |
137 | */ | ||
120 | 138 | ||
121 | if ((alg=X509_ALGOR_new()) == NULL) goto err; | 139 | pkey->private_key->length=rsalen; |
122 | if (alg->algorithm != NULL) | ||
123 | ASN1_OBJECT_free(alg->algorithm); | ||
124 | alg->algorithm=OBJ_nid2obj(NID_rc4); | ||
125 | if ((alg->parameter=ASN1_TYPE_new()) == NULL) goto err; | ||
126 | alg->parameter->type=V_ASN1_NULL; | ||
127 | 140 | ||
128 | l[2]=i2d_X509_ALGOR(alg,NULL); | 141 | pkeylen=i2d_NETSCAPE_PKEY(pkey,NULL); |
129 | l[3]=ASN1_object_size(1,l[2]+l[1],V_ASN1_SEQUENCE); | ||
130 | 142 | ||
131 | #ifndef CONST_STRICT | 143 | enckey->enckey->digest->length = pkeylen; |
132 | os.data=(unsigned char *)"private-key"; | ||
133 | #endif | ||
134 | os.length=11; | ||
135 | l[4]=i2d_ASN1_OCTET_STRING(&os,NULL); | ||
136 | 144 | ||
137 | l[5]=ASN1_object_size(1,l[4]+l[3],V_ASN1_SEQUENCE); | 145 | enckey->os->length = 11; /* "private-key" */ |
146 | |||
147 | enckey->enckey->algor->algorithm=OBJ_nid2obj(NID_rc4); | ||
148 | if ((enckey->enckey->algor->parameter=ASN1_TYPE_new()) == NULL) goto err; | ||
149 | enckey->enckey->algor->parameter->type=V_ASN1_NULL; | ||
138 | 150 | ||
139 | if (pp == NULL) | 151 | if (pp == NULL) |
140 | { | 152 | { |
141 | if (pkey != NULL) NETSCAPE_PKEY_free(pkey); | 153 | olen = i2d_NETSCAPE_ENCRYPTED_PKEY(enckey, NULL); |
142 | if (alg != NULL) X509_ALGOR_free(alg); | 154 | NETSCAPE_PKEY_free(pkey); |
143 | return(l[5]); | 155 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); |
156 | return olen; | ||
144 | } | 157 | } |
145 | 158 | ||
146 | if (pkey->private_key->data != NULL) | 159 | |
147 | OPENSSL_free(pkey->private_key->data); | 160 | /* Since its RC4 encrypted length is actual length */ |
148 | if ((pkey->private_key->data=(unsigned char *)OPENSSL_malloc(l[0])) == NULL) | 161 | if ((zz=(unsigned char *)OPENSSL_malloc(rsalen)) == NULL) |
149 | { | 162 | { |
150 | ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); | 163 | ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); |
151 | goto err; | 164 | goto err; |
152 | } | 165 | } |
153 | zz=pkey->private_key->data; | 166 | |
167 | pkey->private_key->data = zz; | ||
168 | /* Write out private key encoding */ | ||
154 | i2d_RSAPrivateKey(a,&zz); | 169 | i2d_RSAPrivateKey(a,&zz); |
155 | 170 | ||
156 | if ((os2.data=(unsigned char *)OPENSSL_malloc(os2.length)) == NULL) | 171 | if ((zz=OPENSSL_malloc(pkeylen)) == NULL) |
157 | { | 172 | { |
158 | ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); | 173 | ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); |
159 | goto err; | 174 | goto err; |
160 | } | 175 | } |
161 | zz=os2.data; | 176 | |
177 | if (!ASN1_STRING_set(enckey->os, "private-key", -1)) | ||
178 | { | ||
179 | ASN1err(ASN1_F_I2D_NETSCAPE_RSA,ERR_R_MALLOC_FAILURE); | ||
180 | goto err; | ||
181 | } | ||
182 | enckey->enckey->digest->data = zz; | ||
162 | i2d_NETSCAPE_PKEY(pkey,&zz); | 183 | i2d_NETSCAPE_PKEY(pkey,&zz); |
184 | |||
185 | /* Wipe the private key encoding */ | ||
186 | memset(pkey->private_key->data, 0, rsalen); | ||
163 | 187 | ||
164 | if (cb == NULL) | 188 | if (cb == NULL) |
165 | cb=EVP_read_pw_string; | 189 | cb=EVP_read_pw_string; |
@@ -171,109 +195,86 @@ int i2d_RSA_NET(RSA *a, unsigned char **pp, int (*cb)(), int sgckey) | |||
171 | } | 195 | } |
172 | i = strlen((char *)buf); | 196 | i = strlen((char *)buf); |
173 | /* If the key is used for SGC the algorithm is modified a little. */ | 197 | /* If the key is used for SGC the algorithm is modified a little. */ |
174 | if(sgckey){ | 198 | if(sgckey) { |
175 | EVP_MD_CTX mctx; | 199 | EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL); |
176 | EVP_DigestInit(&mctx, EVP_md5()); | ||
177 | EVP_DigestUpdate(&mctx, buf, i); | ||
178 | EVP_DigestFinal(&mctx, buf, NULL); | ||
179 | memcpy(buf + 16, "SGCKEYSALT", 10); | 200 | memcpy(buf + 16, "SGCKEYSALT", 10); |
180 | i = 26; | 201 | i = 26; |
181 | } | 202 | } |
182 | 203 | ||
183 | EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL); | 204 | EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL); |
184 | memset(buf,0,256); | 205 | memset(buf,0,256); |
185 | 206 | ||
207 | /* Encrypt private key in place */ | ||
208 | zz = enckey->enckey->digest->data; | ||
186 | EVP_CIPHER_CTX_init(&ctx); | 209 | EVP_CIPHER_CTX_init(&ctx); |
187 | EVP_EncryptInit(&ctx,EVP_rc4(),key,NULL); | 210 | EVP_EncryptInit_ex(&ctx,EVP_rc4(),NULL,key,NULL); |
188 | EVP_EncryptUpdate(&ctx,os2.data,&i,os2.data,os2.length); | 211 | EVP_EncryptUpdate(&ctx,zz,&i,zz,pkeylen); |
189 | EVP_EncryptFinal(&ctx,&(os2.data[i]),&j); | 212 | EVP_EncryptFinal_ex(&ctx,zz + i,&j); |
190 | EVP_CIPHER_CTX_cleanup(&ctx); | 213 | EVP_CIPHER_CTX_cleanup(&ctx); |
191 | 214 | ||
192 | p= *pp; | 215 | ret = i2d_NETSCAPE_ENCRYPTED_PKEY(enckey, pp); |
193 | ASN1_put_object(&p,1,l[4]+l[3],V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); | ||
194 | i2d_ASN1_OCTET_STRING(&os,&p); | ||
195 | ASN1_put_object(&p,1,l[2]+l[1],V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); | ||
196 | i2d_X509_ALGOR(alg,&p); | ||
197 | i2d_ASN1_OCTET_STRING(&os2,&p); | ||
198 | ret=l[5]; | ||
199 | err: | 216 | err: |
200 | if (os2.data != NULL) OPENSSL_free(os2.data); | 217 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); |
201 | if (alg != NULL) X509_ALGOR_free(alg); | 218 | NETSCAPE_PKEY_free(pkey); |
202 | if (pkey != NULL) NETSCAPE_PKEY_free(pkey); | ||
203 | r=r; | ||
204 | return(ret); | 219 | return(ret); |
205 | } | 220 | } |
206 | 221 | ||
207 | 222 | ||
208 | RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()) | 223 | RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)()) |
209 | { | 224 | { |
210 | return d2i_RSA_NET(a, pp, length, cb, 0); | 225 | return d2i_RSA_NET(a, pp, length, cb, 0); |
211 | } | 226 | } |
212 | 227 | ||
213 | RSA *d2i_RSA_NET(RSA **a, unsigned char **pp, long length, int (*cb)(), int sgckey) | 228 | RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, int (*cb)(), int sgckey) |
214 | { | 229 | { |
215 | RSA *ret=NULL; | 230 | RSA *ret=NULL; |
216 | ASN1_OCTET_STRING *os=NULL; | 231 | const unsigned char *p, *kp; |
217 | ASN1_CTX c; | 232 | NETSCAPE_ENCRYPTED_PKEY *enckey = NULL; |
233 | |||
234 | p = *pp; | ||
218 | 235 | ||
219 | c.pp=pp; | 236 | enckey = d2i_NETSCAPE_ENCRYPTED_PKEY(NULL, &p, length); |
220 | c.error=ASN1_R_DECODING_ERROR; | 237 | if(!enckey) { |
238 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_DECODING_ERROR); | ||
239 | return NULL; | ||
240 | } | ||
221 | 241 | ||
222 | M_ASN1_D2I_Init(); | 242 | if ((enckey->os->length != 11) || (strncmp("private-key", |
223 | M_ASN1_D2I_start_sequence(); | 243 | (char *)enckey->os->data,11) != 0)) |
224 | M_ASN1_D2I_get(os,d2i_ASN1_OCTET_STRING); | ||
225 | if ((os->length != 11) || (strncmp("private-key", | ||
226 | (char *)os->data,os->length) != 0)) | ||
227 | { | 244 | { |
228 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_PRIVATE_KEY_HEADER_MISSING); | 245 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA,ASN1_R_PRIVATE_KEY_HEADER_MISSING); |
229 | M_ASN1_BIT_STRING_free(os); | 246 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); |
230 | goto err; | 247 | return NULL; |
231 | } | 248 | } |
232 | M_ASN1_BIT_STRING_free(os); | 249 | if (OBJ_obj2nid(enckey->enckey->algor->algorithm) != NID_rc4) |
233 | c.q=c.p; | 250 | { |
234 | if ((ret=d2i_RSA_NET_2(a,&c.p,c.slen,cb, sgckey)) == NULL) goto err; | 251 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM); |
235 | /* Note: some versions of IIS key files use length values that are | 252 | goto err; |
236 | * too small for the surrounding SEQUENCEs. This following line | ||
237 | * effectively disable length checking. | ||
238 | */ | ||
239 | c.slen = 0; | ||
240 | |||
241 | M_ASN1_D2I_Finish(a,RSA_free,ASN1_F_D2I_NETSCAPE_RSA); | ||
242 | } | 253 | } |
254 | kp = enckey->enckey->digest->data; | ||
255 | if (cb == NULL) | ||
256 | cb=EVP_read_pw_string; | ||
257 | if ((ret=d2i_RSA_NET_2(a, enckey->enckey->digest,cb, sgckey)) == NULL) goto err; | ||
243 | 258 | ||
244 | RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, | 259 | *pp = p; |
245 | int (*cb)()) | ||
246 | { | ||
247 | return d2i_RSA_NET_2(a, pp, length, cb, 0); | ||
248 | } | ||
249 | 260 | ||
250 | RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, | 261 | err: |
262 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); | ||
263 | return ret; | ||
264 | |||
265 | } | ||
266 | |||
267 | static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os, | ||
251 | int (*cb)(), int sgckey) | 268 | int (*cb)(), int sgckey) |
252 | { | 269 | { |
253 | NETSCAPE_PKEY *pkey=NULL; | 270 | NETSCAPE_PKEY *pkey=NULL; |
254 | RSA *ret=NULL; | 271 | RSA *ret=NULL; |
255 | int i,j; | 272 | int i,j; |
256 | unsigned char buf[256],*zz; | 273 | unsigned char buf[256]; |
274 | const unsigned char *zz; | ||
257 | unsigned char key[EVP_MAX_KEY_LENGTH]; | 275 | unsigned char key[EVP_MAX_KEY_LENGTH]; |
258 | EVP_CIPHER_CTX ctx; | 276 | EVP_CIPHER_CTX ctx; |
259 | X509_ALGOR *alg=NULL; | ||
260 | ASN1_OCTET_STRING *os=NULL; | ||
261 | ASN1_CTX c; | ||
262 | 277 | ||
263 | c.error=ERR_R_NESTED_ASN1_ERROR; | ||
264 | c.pp=pp; | ||
265 | |||
266 | M_ASN1_D2I_Init(); | ||
267 | M_ASN1_D2I_start_sequence(); | ||
268 | M_ASN1_D2I_get(alg,d2i_X509_ALGOR); | ||
269 | if (OBJ_obj2nid(alg->algorithm) != NID_rc4) | ||
270 | { | ||
271 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM); | ||
272 | goto err; | ||
273 | } | ||
274 | M_ASN1_D2I_get(os,d2i_ASN1_OCTET_STRING); | ||
275 | if (cb == NULL) | ||
276 | cb=EVP_read_pw_string; | ||
277 | i=cb(buf,256,"Enter Private Key password:",0); | 278 | i=cb(buf,256,"Enter Private Key password:",0); |
278 | if (i != 0) | 279 | if (i != 0) |
279 | { | 280 | { |
@@ -283,10 +284,7 @@ RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, | |||
283 | 284 | ||
284 | i = strlen((char *)buf); | 285 | i = strlen((char *)buf); |
285 | if(sgckey){ | 286 | if(sgckey){ |
286 | EVP_MD_CTX mctx; | 287 | EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL); |
287 | EVP_DigestInit(&mctx, EVP_md5()); | ||
288 | EVP_DigestUpdate(&mctx, buf, i); | ||
289 | EVP_DigestFinal(&mctx, buf, NULL); | ||
290 | memcpy(buf + 16, "SGCKEYSALT", 10); | 288 | memcpy(buf + 16, "SGCKEYSALT", 10); |
291 | i = 26; | 289 | i = 26; |
292 | } | 290 | } |
@@ -295,9 +293,9 @@ RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, | |||
295 | memset(buf,0,256); | 293 | memset(buf,0,256); |
296 | 294 | ||
297 | EVP_CIPHER_CTX_init(&ctx); | 295 | EVP_CIPHER_CTX_init(&ctx); |
298 | EVP_DecryptInit(&ctx,EVP_rc4(),key,NULL); | 296 | EVP_DecryptInit_ex(&ctx,EVP_rc4(),NULL, key,NULL); |
299 | EVP_DecryptUpdate(&ctx,os->data,&i,os->data,os->length); | 297 | EVP_DecryptUpdate(&ctx,os->data,&i,os->data,os->length); |
300 | EVP_DecryptFinal(&ctx,&(os->data[i]),&j); | 298 | EVP_DecryptFinal_ex(&ctx,&(os->data[i]),&j); |
301 | EVP_CIPHER_CTX_cleanup(&ctx); | 299 | EVP_CIPHER_CTX_cleanup(&ctx); |
302 | os->length=i+j; | 300 | os->length=i+j; |
303 | 301 | ||
@@ -315,71 +313,14 @@ RSA *d2i_RSA_NET_2(RSA **a, unsigned char **pp, long length, | |||
315 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNABLE_TO_DECODE_RSA_KEY); | 313 | ASN1err(ASN1_F_D2I_NETSCAPE_RSA_2,ASN1_R_UNABLE_TO_DECODE_RSA_KEY); |
316 | goto err; | 314 | goto err; |
317 | } | 315 | } |
318 | if (!asn1_Finish(&c)) goto err; | ||
319 | *pp=c.p; | ||
320 | err: | 316 | err: |
321 | if (pkey != NULL) NETSCAPE_PKEY_free(pkey); | 317 | NETSCAPE_PKEY_free(pkey); |
322 | if (os != NULL) M_ASN1_BIT_STRING_free(os); | ||
323 | if (alg != NULL) X509_ALGOR_free(alg); | ||
324 | return(ret); | 318 | return(ret); |
325 | } | 319 | } |
326 | 320 | ||
327 | static int i2d_NETSCAPE_PKEY(NETSCAPE_PKEY *a, unsigned char **pp) | 321 | #endif /* OPENSSL_NO_RC4 */ |
328 | { | ||
329 | M_ASN1_I2D_vars(a); | ||
330 | |||
331 | |||
332 | M_ASN1_I2D_len(a->version, i2d_ASN1_INTEGER); | ||
333 | M_ASN1_I2D_len(a->algor, i2d_X509_ALGOR); | ||
334 | M_ASN1_I2D_len(a->private_key, i2d_ASN1_OCTET_STRING); | ||
335 | |||
336 | M_ASN1_I2D_seq_total(); | ||
337 | |||
338 | M_ASN1_I2D_put(a->version, i2d_ASN1_INTEGER); | ||
339 | M_ASN1_I2D_put(a->algor, i2d_X509_ALGOR); | ||
340 | M_ASN1_I2D_put(a->private_key, i2d_ASN1_OCTET_STRING); | ||
341 | |||
342 | M_ASN1_I2D_finish(); | ||
343 | } | ||
344 | |||
345 | static NETSCAPE_PKEY *d2i_NETSCAPE_PKEY(NETSCAPE_PKEY **a, unsigned char **pp, | ||
346 | long length) | ||
347 | { | ||
348 | M_ASN1_D2I_vars(a,NETSCAPE_PKEY *,NETSCAPE_PKEY_new); | ||
349 | |||
350 | M_ASN1_D2I_Init(); | ||
351 | M_ASN1_D2I_start_sequence(); | ||
352 | M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); | ||
353 | M_ASN1_D2I_get(ret->algor,d2i_X509_ALGOR); | ||
354 | M_ASN1_D2I_get(ret->private_key,d2i_ASN1_OCTET_STRING); | ||
355 | M_ASN1_D2I_Finish(a,NETSCAPE_PKEY_free,ASN1_F_D2I_NETSCAPE_PKEY); | ||
356 | } | ||
357 | |||
358 | static NETSCAPE_PKEY *NETSCAPE_PKEY_new(void) | ||
359 | { | ||
360 | NETSCAPE_PKEY *ret=NULL; | ||
361 | ASN1_CTX c; | ||
362 | |||
363 | M_ASN1_New_Malloc(ret,NETSCAPE_PKEY); | ||
364 | M_ASN1_New(ret->version,M_ASN1_INTEGER_new); | ||
365 | M_ASN1_New(ret->algor,X509_ALGOR_new); | ||
366 | M_ASN1_New(ret->private_key,M_ASN1_OCTET_STRING_new); | ||
367 | return(ret); | ||
368 | M_ASN1_New_Error(ASN1_F_NETSCAPE_PKEY_NEW); | ||
369 | } | ||
370 | |||
371 | static void NETSCAPE_PKEY_free(NETSCAPE_PKEY *a) | ||
372 | { | ||
373 | if (a == NULL) return; | ||
374 | M_ASN1_INTEGER_free(a->version); | ||
375 | X509_ALGOR_free(a->algor); | ||
376 | M_ASN1_OCTET_STRING_free(a->private_key); | ||
377 | OPENSSL_free(a); | ||
378 | } | ||
379 | |||
380 | #endif /* NO_RC4 */ | ||
381 | 322 | ||
382 | #else /* !NO_RSA */ | 323 | #else /* !OPENSSL_NO_RSA */ |
383 | 324 | ||
384 | # if PEDANTIC | 325 | # if PEDANTIC |
385 | static void *dummy=&dummy; | 326 | static void *dummy=&dummy; |
diff --git a/src/lib/libcrypto/asn1/nsseq.c b/src/lib/libcrypto/asn1/nsseq.c index 6e7f09ba23..50e2d4d07a 100644 --- a/src/lib/libcrypto/asn1/nsseq.c +++ b/src/lib/libcrypto/asn1/nsseq.c | |||
@@ -58,61 +58,25 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <stdlib.h> | 60 | #include <stdlib.h> |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/err.h> | ||
63 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
64 | #include <openssl/objects.h> | 63 | #include <openssl/objects.h> |
65 | 64 | ||
66 | /* Netscape certificate sequence structure */ | 65 | static int nsseq_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) |
67 | |||
68 | int i2d_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE *a, unsigned char **pp) | ||
69 | { | 66 | { |
70 | int v = 0; | 67 | if(operation == ASN1_OP_NEW_POST) { |
71 | M_ASN1_I2D_vars(a); | 68 | NETSCAPE_CERT_SEQUENCE *nsseq; |
72 | M_ASN1_I2D_len (a->type, i2d_ASN1_OBJECT); | 69 | nsseq = (NETSCAPE_CERT_SEQUENCE *)*pval; |
73 | M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(X509,a->certs,i2d_X509,0, | 70 | nsseq->type = OBJ_nid2obj(NID_netscape_cert_sequence); |
74 | V_ASN1_SEQUENCE,v); | 71 | } |
75 | 72 | return 1; | |
76 | M_ASN1_I2D_seq_total(); | ||
77 | |||
78 | M_ASN1_I2D_put (a->type, i2d_ASN1_OBJECT); | ||
79 | M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(X509,a->certs,i2d_X509,0, | ||
80 | V_ASN1_SEQUENCE,v); | ||
81 | |||
82 | M_ASN1_I2D_finish(); | ||
83 | } | 73 | } |
84 | 74 | ||
85 | NETSCAPE_CERT_SEQUENCE *NETSCAPE_CERT_SEQUENCE_new(void) | 75 | /* Netscape certificate sequence structure */ |
86 | { | ||
87 | NETSCAPE_CERT_SEQUENCE *ret=NULL; | ||
88 | ASN1_CTX c; | ||
89 | M_ASN1_New_Malloc(ret, NETSCAPE_CERT_SEQUENCE); | ||
90 | /* Note hardcoded object type */ | ||
91 | ret->type = OBJ_nid2obj(NID_netscape_cert_sequence); | ||
92 | ret->certs = NULL; | ||
93 | return (ret); | ||
94 | M_ASN1_New_Error(ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW); | ||
95 | } | ||
96 | 76 | ||
97 | NETSCAPE_CERT_SEQUENCE *d2i_NETSCAPE_CERT_SEQUENCE(NETSCAPE_CERT_SEQUENCE **a, | 77 | ASN1_SEQUENCE_cb(NETSCAPE_CERT_SEQUENCE, nsseq_cb) = { |
98 | unsigned char **pp, long length) | 78 | ASN1_SIMPLE(NETSCAPE_CERT_SEQUENCE, type, ASN1_OBJECT), |
99 | { | 79 | ASN1_EXP_SEQUENCE_OF_OPT(NETSCAPE_CERT_SEQUENCE, certs, X509, 0) |
100 | M_ASN1_D2I_vars(a,NETSCAPE_CERT_SEQUENCE *, | 80 | } ASN1_SEQUENCE_END_cb(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE) |
101 | NETSCAPE_CERT_SEQUENCE_new); | ||
102 | M_ASN1_D2I_Init(); | ||
103 | M_ASN1_D2I_start_sequence(); | ||
104 | M_ASN1_D2I_get (ret->type, d2i_ASN1_OBJECT); | ||
105 | M_ASN1_D2I_get_EXP_set_opt_type(X509,ret->certs,d2i_X509,X509_free,0, | ||
106 | V_ASN1_SEQUENCE); | ||
107 | M_ASN1_D2I_Finish(a, NETSCAPE_CERT_SEQUENCE_free, | ||
108 | ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE); | ||
109 | } | ||
110 | 81 | ||
111 | void NETSCAPE_CERT_SEQUENCE_free (NETSCAPE_CERT_SEQUENCE *a) | 82 | IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE) |
112 | { | ||
113 | if (a == NULL) return; | ||
114 | ASN1_OBJECT_free(a->type); | ||
115 | if(a->certs) | ||
116 | sk_X509_pop_free(a->certs, X509_free); | ||
117 | OPENSSL_free (a); | ||
118 | } | ||
diff --git a/src/lib/libcrypto/asn1/p5_pbe.c b/src/lib/libcrypto/asn1/p5_pbe.c index b7ed538eb2..891150638e 100644 --- a/src/lib/libcrypto/asn1/p5_pbe.c +++ b/src/lib/libcrypto/asn1/p5_pbe.c | |||
@@ -58,53 +58,18 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | #include <openssl/rand.h> | 63 | #include <openssl/rand.h> |
64 | 64 | ||
65 | /* PKCS#5 password based encryption structure */ | 65 | /* PKCS#5 password based encryption structure */ |
66 | 66 | ||
67 | int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp) | 67 | ASN1_SEQUENCE(PBEPARAM) = { |
68 | { | 68 | ASN1_SIMPLE(PBEPARAM, salt, ASN1_OCTET_STRING), |
69 | M_ASN1_I2D_vars(a); | 69 | ASN1_SIMPLE(PBEPARAM, iter, ASN1_INTEGER) |
70 | M_ASN1_I2D_len (a->salt, i2d_ASN1_OCTET_STRING); | 70 | } ASN1_SEQUENCE_END(PBEPARAM) |
71 | M_ASN1_I2D_len (a->iter, i2d_ASN1_INTEGER); | ||
72 | |||
73 | M_ASN1_I2D_seq_total (); | ||
74 | |||
75 | M_ASN1_I2D_put (a->salt, i2d_ASN1_OCTET_STRING); | ||
76 | M_ASN1_I2D_put (a->iter, i2d_ASN1_INTEGER); | ||
77 | M_ASN1_I2D_finish(); | ||
78 | } | ||
79 | |||
80 | PBEPARAM *PBEPARAM_new(void) | ||
81 | { | ||
82 | PBEPARAM *ret=NULL; | ||
83 | ASN1_CTX c; | ||
84 | M_ASN1_New_Malloc(ret, PBEPARAM); | ||
85 | M_ASN1_New(ret->iter,M_ASN1_INTEGER_new); | ||
86 | M_ASN1_New(ret->salt,M_ASN1_OCTET_STRING_new); | ||
87 | return (ret); | ||
88 | M_ASN1_New_Error(ASN1_F_PBEPARAM_NEW); | ||
89 | } | ||
90 | |||
91 | PBEPARAM *d2i_PBEPARAM(PBEPARAM **a, unsigned char **pp, long length) | ||
92 | { | ||
93 | M_ASN1_D2I_vars(a,PBEPARAM *,PBEPARAM_new); | ||
94 | M_ASN1_D2I_Init(); | ||
95 | M_ASN1_D2I_start_sequence(); | ||
96 | M_ASN1_D2I_get (ret->salt, d2i_ASN1_OCTET_STRING); | ||
97 | M_ASN1_D2I_get (ret->iter, d2i_ASN1_INTEGER); | ||
98 | M_ASN1_D2I_Finish(a, PBEPARAM_free, ASN1_F_D2I_PBEPARAM); | ||
99 | } | ||
100 | 71 | ||
101 | void PBEPARAM_free (PBEPARAM *a) | 72 | IMPLEMENT_ASN1_FUNCTIONS(PBEPARAM) |
102 | { | ||
103 | if(a==NULL) return; | ||
104 | M_ASN1_OCTET_STRING_free(a->salt); | ||
105 | M_ASN1_INTEGER_free (a->iter); | ||
106 | OPENSSL_free (a); | ||
107 | } | ||
108 | 73 | ||
109 | /* Return an algorithm identifier for a PKCS#5 PBE algorithm */ | 74 | /* Return an algorithm identifier for a PKCS#5 PBE algorithm */ |
110 | 75 | ||
diff --git a/src/lib/libcrypto/asn1/p5_pbev2.c b/src/lib/libcrypto/asn1/p5_pbev2.c index 6a7b578c0e..43dfe09479 100644 --- a/src/lib/libcrypto/asn1/p5_pbev2.c +++ b/src/lib/libcrypto/asn1/p5_pbev2.c | |||
@@ -58,108 +58,27 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | #include <openssl/rand.h> | 63 | #include <openssl/rand.h> |
64 | 64 | ||
65 | /* PKCS#5 v2.0 password based encryption structures */ | 65 | /* PKCS#5 v2.0 password based encryption structures */ |
66 | 66 | ||
67 | int i2d_PBE2PARAM(PBE2PARAM *a, unsigned char **pp) | 67 | ASN1_SEQUENCE(PBE2PARAM) = { |
68 | { | 68 | ASN1_SIMPLE(PBE2PARAM, keyfunc, X509_ALGOR), |
69 | M_ASN1_I2D_vars(a); | 69 | ASN1_SIMPLE(PBE2PARAM, encryption, X509_ALGOR) |
70 | M_ASN1_I2D_len (a->keyfunc, i2d_X509_ALGOR); | 70 | } ASN1_SEQUENCE_END(PBE2PARAM) |
71 | M_ASN1_I2D_len (a->encryption, i2d_X509_ALGOR); | ||
72 | |||
73 | M_ASN1_I2D_seq_total (); | ||
74 | |||
75 | M_ASN1_I2D_put (a->keyfunc, i2d_X509_ALGOR); | ||
76 | M_ASN1_I2D_put (a->encryption, i2d_X509_ALGOR); | ||
77 | |||
78 | M_ASN1_I2D_finish(); | ||
79 | } | ||
80 | |||
81 | PBE2PARAM *PBE2PARAM_new(void) | ||
82 | { | ||
83 | PBE2PARAM *ret=NULL; | ||
84 | ASN1_CTX c; | ||
85 | M_ASN1_New_Malloc(ret, PBE2PARAM); | ||
86 | M_ASN1_New(ret->keyfunc,X509_ALGOR_new); | ||
87 | M_ASN1_New(ret->encryption,X509_ALGOR_new); | ||
88 | return (ret); | ||
89 | M_ASN1_New_Error(ASN1_F_PBE2PARAM_NEW); | ||
90 | } | ||
91 | |||
92 | PBE2PARAM *d2i_PBE2PARAM(PBE2PARAM **a, unsigned char **pp, long length) | ||
93 | { | ||
94 | M_ASN1_D2I_vars(a,PBE2PARAM *,PBE2PARAM_new); | ||
95 | M_ASN1_D2I_Init(); | ||
96 | M_ASN1_D2I_start_sequence(); | ||
97 | M_ASN1_D2I_get (ret->keyfunc, d2i_X509_ALGOR); | ||
98 | M_ASN1_D2I_get (ret->encryption, d2i_X509_ALGOR); | ||
99 | M_ASN1_D2I_Finish(a, PBE2PARAM_free, ASN1_F_D2I_PBE2PARAM); | ||
100 | } | ||
101 | |||
102 | void PBE2PARAM_free (PBE2PARAM *a) | ||
103 | { | ||
104 | if(a==NULL) return; | ||
105 | X509_ALGOR_free(a->keyfunc); | ||
106 | X509_ALGOR_free(a->encryption); | ||
107 | OPENSSL_free (a); | ||
108 | } | ||
109 | |||
110 | int i2d_PBKDF2PARAM(PBKDF2PARAM *a, unsigned char **pp) | ||
111 | { | ||
112 | M_ASN1_I2D_vars(a); | ||
113 | M_ASN1_I2D_len (a->salt, i2d_ASN1_TYPE); | ||
114 | M_ASN1_I2D_len (a->iter, i2d_ASN1_INTEGER); | ||
115 | M_ASN1_I2D_len (a->keylength, i2d_ASN1_INTEGER); | ||
116 | M_ASN1_I2D_len (a->prf, i2d_X509_ALGOR); | ||
117 | 71 | ||
118 | M_ASN1_I2D_seq_total (); | 72 | IMPLEMENT_ASN1_FUNCTIONS(PBE2PARAM) |
119 | 73 | ||
120 | M_ASN1_I2D_put (a->salt, i2d_ASN1_TYPE); | 74 | ASN1_SEQUENCE(PBKDF2PARAM) = { |
121 | M_ASN1_I2D_put (a->iter, i2d_ASN1_INTEGER); | 75 | ASN1_SIMPLE(PBKDF2PARAM, salt, ASN1_ANY), |
122 | M_ASN1_I2D_put (a->keylength, i2d_ASN1_INTEGER); | 76 | ASN1_SIMPLE(PBKDF2PARAM, iter, ASN1_INTEGER), |
123 | M_ASN1_I2D_put (a->prf, i2d_X509_ALGOR); | 77 | ASN1_OPT(PBKDF2PARAM, keylength, ASN1_INTEGER), |
78 | ASN1_OPT(PBKDF2PARAM, prf, X509_ALGOR) | ||
79 | } ASN1_SEQUENCE_END(PBKDF2PARAM) | ||
124 | 80 | ||
125 | M_ASN1_I2D_finish(); | 81 | IMPLEMENT_ASN1_FUNCTIONS(PBKDF2PARAM) |
126 | } | ||
127 | |||
128 | PBKDF2PARAM *PBKDF2PARAM_new(void) | ||
129 | { | ||
130 | PBKDF2PARAM *ret=NULL; | ||
131 | ASN1_CTX c; | ||
132 | M_ASN1_New_Malloc(ret, PBKDF2PARAM); | ||
133 | M_ASN1_New(ret->salt, ASN1_TYPE_new); | ||
134 | M_ASN1_New(ret->iter, M_ASN1_INTEGER_new); | ||
135 | ret->keylength = NULL; | ||
136 | ret->prf = NULL; | ||
137 | return (ret); | ||
138 | M_ASN1_New_Error(ASN1_F_PBKDF2PARAM_NEW); | ||
139 | } | ||
140 | |||
141 | PBKDF2PARAM *d2i_PBKDF2PARAM(PBKDF2PARAM **a, unsigned char **pp, | ||
142 | long length) | ||
143 | { | ||
144 | M_ASN1_D2I_vars(a,PBKDF2PARAM *,PBKDF2PARAM_new); | ||
145 | M_ASN1_D2I_Init(); | ||
146 | M_ASN1_D2I_start_sequence(); | ||
147 | M_ASN1_D2I_get (ret->salt, d2i_ASN1_TYPE); | ||
148 | M_ASN1_D2I_get (ret->iter, d2i_ASN1_INTEGER); | ||
149 | M_ASN1_D2I_get_opt (ret->keylength, d2i_ASN1_INTEGER, V_ASN1_INTEGER); | ||
150 | M_ASN1_D2I_get_opt (ret->prf, d2i_X509_ALGOR, V_ASN1_SEQUENCE); | ||
151 | M_ASN1_D2I_Finish(a, PBKDF2PARAM_free, ASN1_F_D2I_PBKDF2PARAM); | ||
152 | } | ||
153 | |||
154 | void PBKDF2PARAM_free (PBKDF2PARAM *a) | ||
155 | { | ||
156 | if(a==NULL) return; | ||
157 | ASN1_TYPE_free(a->salt); | ||
158 | M_ASN1_INTEGER_free(a->iter); | ||
159 | M_ASN1_INTEGER_free(a->keylength); | ||
160 | X509_ALGOR_free(a->prf); | ||
161 | OPENSSL_free (a); | ||
162 | } | ||
163 | 82 | ||
164 | /* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm: | 83 | /* Return an algorithm identifier for a PKCS#5 v2.0 PBE algorithm: |
165 | * yes I know this is horrible! | 84 | * yes I know this is horrible! |
@@ -198,7 +117,7 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | |||
198 | goto err; | 117 | goto err; |
199 | 118 | ||
200 | /* Dummy cipherinit to just setup the IV */ | 119 | /* Dummy cipherinit to just setup the IV */ |
201 | EVP_CipherInit(&ctx, cipher, NULL, iv, 0); | 120 | EVP_CipherInit_ex(&ctx, cipher, NULL, NULL, iv, 0); |
202 | if(EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0) { | 121 | if(EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0) { |
203 | ASN1err(ASN1_F_PKCS5_PBE2_SET, | 122 | ASN1err(ASN1_F_PKCS5_PBE2_SET, |
204 | ASN1_R_ERROR_SETTING_CIPHER_PARAMS); | 123 | ASN1_R_ERROR_SETTING_CIPHER_PARAMS); |
diff --git a/src/lib/libcrypto/asn1/p8_pkey.c b/src/lib/libcrypto/asn1/p8_pkey.c index fa6cbfb6f8..b634d5bc85 100644 --- a/src/lib/libcrypto/asn1/p8_pkey.c +++ b/src/lib/libcrypto/asn1/p8_pkey.c | |||
@@ -58,70 +58,27 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | 63 | ||
64 | int i2d_PKCS8_PRIV_KEY_INFO (PKCS8_PRIV_KEY_INFO *a, unsigned char **pp) | 64 | /* Minor tweak to operation: zero private key data */ |
65 | static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
65 | { | 66 | { |
66 | 67 | /* Since the structure must still be valid use ASN1_OP_FREE_PRE */ | |
67 | M_ASN1_I2D_vars(a); | 68 | if(operation == ASN1_OP_FREE_PRE) { |
68 | 69 | PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; | |
69 | M_ASN1_I2D_len (a->version, i2d_ASN1_INTEGER); | 70 | if (key->pkey->value.octet_string) |
70 | M_ASN1_I2D_len (a->pkeyalg, i2d_X509_ALGOR); | 71 | memset(key->pkey->value.octet_string->data, |
71 | M_ASN1_I2D_len (a->pkey, i2d_ASN1_TYPE); | 72 | 0, key->pkey->value.octet_string->length); |
72 | M_ASN1_I2D_len_IMP_SET_opt_type (X509_ATTRIBUTE, a->attributes, | 73 | } |
73 | i2d_X509_ATTRIBUTE, 0); | 74 | return 1; |
74 | |||
75 | M_ASN1_I2D_seq_total (); | ||
76 | |||
77 | M_ASN1_I2D_put (a->version, i2d_ASN1_INTEGER); | ||
78 | M_ASN1_I2D_put (a->pkeyalg, i2d_X509_ALGOR); | ||
79 | M_ASN1_I2D_put (a->pkey, i2d_ASN1_TYPE); | ||
80 | M_ASN1_I2D_put_IMP_SET_opt_type (X509_ATTRIBUTE, a->attributes, | ||
81 | i2d_X509_ATTRIBUTE, 0); | ||
82 | |||
83 | M_ASN1_I2D_finish(); | ||
84 | } | 75 | } |
85 | 76 | ||
86 | PKCS8_PRIV_KEY_INFO *PKCS8_PRIV_KEY_INFO_new(void) | 77 | ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb) = { |
87 | { | 78 | ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER), |
88 | PKCS8_PRIV_KEY_INFO *ret=NULL; | 79 | ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR), |
89 | ASN1_CTX c; | 80 | ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY), |
90 | M_ASN1_New_Malloc(ret, PKCS8_PRIV_KEY_INFO); | 81 | ASN1_IMP_SET_OF_OPT(PKCS8_PRIV_KEY_INFO, attributes, X509_ATTRIBUTE, 0) |
91 | M_ASN1_New (ret->version, M_ASN1_INTEGER_new); | 82 | } ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) |
92 | M_ASN1_New (ret->pkeyalg, X509_ALGOR_new); | ||
93 | M_ASN1_New (ret->pkey, ASN1_TYPE_new); | ||
94 | ret->attributes = NULL; | ||
95 | ret->broken = PKCS8_OK; | ||
96 | return (ret); | ||
97 | M_ASN1_New_Error(ASN1_F_PKCS8_PRIV_KEY_INFO_NEW); | ||
98 | } | ||
99 | 83 | ||
100 | PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, | 84 | IMPLEMENT_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) |
101 | unsigned char **pp, long length) | ||
102 | { | ||
103 | M_ASN1_D2I_vars(a,PKCS8_PRIV_KEY_INFO *,PKCS8_PRIV_KEY_INFO_new); | ||
104 | M_ASN1_D2I_Init(); | ||
105 | M_ASN1_D2I_start_sequence(); | ||
106 | M_ASN1_D2I_get (ret->version, d2i_ASN1_INTEGER); | ||
107 | M_ASN1_D2I_get (ret->pkeyalg, d2i_X509_ALGOR); | ||
108 | M_ASN1_D2I_get (ret->pkey, d2i_ASN1_TYPE); | ||
109 | M_ASN1_D2I_get_IMP_set_opt_type(X509_ATTRIBUTE, ret->attributes, | ||
110 | d2i_X509_ATTRIBUTE, | ||
111 | X509_ATTRIBUTE_free, 0); | ||
112 | M_ASN1_D2I_Finish(a, PKCS8_PRIV_KEY_INFO_free, ASN1_F_D2I_PKCS8_PRIV_KEY_INFO); | ||
113 | } | ||
114 | |||
115 | void PKCS8_PRIV_KEY_INFO_free (PKCS8_PRIV_KEY_INFO *a) | ||
116 | { | ||
117 | if (a == NULL) return; | ||
118 | M_ASN1_INTEGER_free (a->version); | ||
119 | X509_ALGOR_free(a->pkeyalg); | ||
120 | /* Clear sensitive data */ | ||
121 | if (a->pkey->value.octet_string) | ||
122 | memset (a->pkey->value.octet_string->data, | ||
123 | 0, a->pkey->value.octet_string->length); | ||
124 | ASN1_TYPE_free (a->pkey); | ||
125 | sk_X509_ATTRIBUTE_pop_free (a->attributes, X509_ATTRIBUTE_free); | ||
126 | OPENSSL_free (a); | ||
127 | } | ||
diff --git a/src/lib/libcrypto/asn1/t_crl.c b/src/lib/libcrypto/asn1/t_crl.c index d78e4a8f88..60db305756 100644 --- a/src/lib/libcrypto/asn1/t_crl.c +++ b/src/lib/libcrypto/asn1/t_crl.c | |||
@@ -64,8 +64,7 @@ | |||
64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
65 | #include <openssl/x509v3.h> | 65 | #include <openssl/x509v3.h> |
66 | 66 | ||
67 | static void ext_print(BIO *out, X509_EXTENSION *ex); | 67 | #ifndef OPENSSL_NO_FP_API |
68 | #ifndef NO_FP_API | ||
69 | int X509_CRL_print_fp(FILE *fp, X509_CRL *x) | 68 | int X509_CRL_print_fp(FILE *fp, X509_CRL *x) |
70 | { | 69 | { |
71 | BIO *b; | 70 | BIO *b; |
@@ -86,11 +85,10 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x) | |||
86 | int X509_CRL_print(BIO *out, X509_CRL *x) | 85 | int X509_CRL_print(BIO *out, X509_CRL *x) |
87 | { | 86 | { |
88 | char buf[256]; | 87 | char buf[256]; |
89 | unsigned char *s; | ||
90 | STACK_OF(X509_REVOKED) *rev; | 88 | STACK_OF(X509_REVOKED) *rev; |
91 | X509_REVOKED *r; | 89 | X509_REVOKED *r; |
92 | long l; | 90 | long l; |
93 | int i, j, n; | 91 | int i, n; |
94 | 92 | ||
95 | BIO_printf(out, "Certificate Revocation List (CRL):\n"); | 93 | BIO_printf(out, "Certificate Revocation List (CRL):\n"); |
96 | l = X509_CRL_get_version(x); | 94 | l = X509_CRL_get_version(x); |
@@ -109,15 +107,12 @@ int X509_CRL_print(BIO *out, X509_CRL *x) | |||
109 | BIO_printf(out,"\n"); | 107 | BIO_printf(out,"\n"); |
110 | 108 | ||
111 | n=X509_CRL_get_ext_count(x); | 109 | n=X509_CRL_get_ext_count(x); |
112 | if (n > 0) { | 110 | X509V3_extensions_print(out, "CRL extensions", |
113 | BIO_printf(out,"%8sCRL extensions:\n",""); | 111 | x->crl->extensions, 0, 8); |
114 | for (i=0; i<n; i++) ext_print(out, X509_CRL_get_ext(x, i)); | ||
115 | } | ||
116 | |||
117 | 112 | ||
118 | rev = X509_CRL_get_REVOKED(x); | 113 | rev = X509_CRL_get_REVOKED(x); |
119 | 114 | ||
120 | if(sk_X509_REVOKED_num(rev)) | 115 | if(sk_X509_REVOKED_num(rev) > 0) |
121 | BIO_printf(out, "Revoked Certificates:\n"); | 116 | BIO_printf(out, "Revoked Certificates:\n"); |
122 | else BIO_printf(out, "No Revoked Certificates.\n"); | 117 | else BIO_printf(out, "No Revoked Certificates.\n"); |
123 | 118 | ||
@@ -128,39 +123,11 @@ int X509_CRL_print(BIO *out, X509_CRL *x) | |||
128 | BIO_printf(out,"\n Revocation Date: ",""); | 123 | BIO_printf(out,"\n Revocation Date: ",""); |
129 | ASN1_TIME_print(out,r->revocationDate); | 124 | ASN1_TIME_print(out,r->revocationDate); |
130 | BIO_printf(out,"\n"); | 125 | BIO_printf(out,"\n"); |
131 | for(j = 0; j < X509_REVOKED_get_ext_count(r); j++) | 126 | X509V3_extensions_print(out, "CRL entry extensions", |
132 | ext_print(out, X509_REVOKED_get_ext(r, j)); | 127 | r->extensions, 0, 8); |
133 | } | ||
134 | |||
135 | i=OBJ_obj2nid(x->sig_alg->algorithm); | ||
136 | BIO_printf(out," Signature Algorithm: %s", | ||
137 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)); | ||
138 | |||
139 | s = x->signature->data; | ||
140 | n = x->signature->length; | ||
141 | for (i=0; i<n; i++, s++) | ||
142 | { | ||
143 | if ((i%18) == 0) BIO_write(out,"\n ",9); | ||
144 | BIO_printf(out,"%02x%s",*s, ((i+1) == n)?"":":"); | ||
145 | } | 128 | } |
146 | BIO_write(out,"\n",1); | 129 | X509_signature_print(out, x->sig_alg, x->signature); |
147 | 130 | ||
148 | return 1; | 131 | return 1; |
149 | 132 | ||
150 | } | 133 | } |
151 | |||
152 | static void ext_print(BIO *out, X509_EXTENSION *ex) | ||
153 | { | ||
154 | ASN1_OBJECT *obj; | ||
155 | int j; | ||
156 | BIO_printf(out,"%12s",""); | ||
157 | obj=X509_EXTENSION_get_object(ex); | ||
158 | i2a_ASN1_OBJECT(out,obj); | ||
159 | j=X509_EXTENSION_get_critical(ex); | ||
160 | BIO_printf(out, ": %s\n", j ? "critical":"",""); | ||
161 | if(!X509V3_EXT_print(out, ex, 0, 16)) { | ||
162 | BIO_printf(out, "%16s", ""); | ||
163 | M_ASN1_OCTET_STRING_print(out,ex->value); | ||
164 | } | ||
165 | BIO_write(out,"\n",1); | ||
166 | } | ||
diff --git a/src/lib/libcrypto/asn1/t_pkey.c b/src/lib/libcrypto/asn1/t_pkey.c index ae18da96e3..8060115202 100644 --- a/src/lib/libcrypto/asn1/t_pkey.c +++ b/src/lib/libcrypto/asn1/t_pkey.c | |||
@@ -60,21 +60,21 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/buffer.h> | 61 | #include <openssl/buffer.h> |
62 | #include <openssl/bn.h> | 62 | #include <openssl/bn.h> |
63 | #ifndef NO_RSA | 63 | #ifndef OPENSSL_NO_RSA |
64 | #include <openssl/rsa.h> | 64 | #include <openssl/rsa.h> |
65 | #endif | 65 | #endif |
66 | #ifndef NO_DH | 66 | #ifndef OPENSSL_NO_DH |
67 | #include <openssl/dh.h> | 67 | #include <openssl/dh.h> |
68 | #endif | 68 | #endif |
69 | #ifndef NO_DSA | 69 | #ifndef OPENSSL_NO_DSA |
70 | #include <openssl/dsa.h> | 70 | #include <openssl/dsa.h> |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | static int print(BIO *fp,const char *str,BIGNUM *num, | 73 | static int print(BIO *fp,const char *str,BIGNUM *num, |
74 | unsigned char *buf,int off); | 74 | unsigned char *buf,int off); |
75 | #ifndef NO_RSA | 75 | #ifndef OPENSSL_NO_RSA |
76 | #ifndef NO_FP_API | 76 | #ifndef OPENSSL_NO_FP_API |
77 | int RSA_print_fp(FILE *fp, RSA *x, int off) | 77 | int RSA_print_fp(FILE *fp, const RSA *x, int off) |
78 | { | 78 | { |
79 | BIO *b; | 79 | BIO *b; |
80 | int ret; | 80 | int ret; |
@@ -91,7 +91,7 @@ int RSA_print_fp(FILE *fp, RSA *x, int off) | |||
91 | } | 91 | } |
92 | #endif | 92 | #endif |
93 | 93 | ||
94 | int RSA_print(BIO *bp, RSA *x, int off) | 94 | int RSA_print(BIO *bp, const RSA *x, int off) |
95 | { | 95 | { |
96 | char str[128]; | 96 | char str[128]; |
97 | const char *s; | 97 | const char *s; |
@@ -136,11 +136,11 @@ err: | |||
136 | if (m != NULL) OPENSSL_free(m); | 136 | if (m != NULL) OPENSSL_free(m); |
137 | return(ret); | 137 | return(ret); |
138 | } | 138 | } |
139 | #endif /* NO_RSA */ | 139 | #endif /* OPENSSL_NO_RSA */ |
140 | 140 | ||
141 | #ifndef NO_DSA | 141 | #ifndef OPENSSL_NO_DSA |
142 | #ifndef NO_FP_API | 142 | #ifndef OPENSSL_NO_FP_API |
143 | int DSA_print_fp(FILE *fp, DSA *x, int off) | 143 | int DSA_print_fp(FILE *fp, const DSA *x, int off) |
144 | { | 144 | { |
145 | BIO *b; | 145 | BIO *b; |
146 | int ret; | 146 | int ret; |
@@ -157,7 +157,7 @@ int DSA_print_fp(FILE *fp, DSA *x, int off) | |||
157 | } | 157 | } |
158 | #endif | 158 | #endif |
159 | 159 | ||
160 | int DSA_print(BIO *bp, DSA *x, int off) | 160 | int DSA_print(BIO *bp, const DSA *x, int off) |
161 | { | 161 | { |
162 | char str[128]; | 162 | char str[128]; |
163 | unsigned char *m=NULL; | 163 | unsigned char *m=NULL; |
@@ -207,7 +207,7 @@ err: | |||
207 | if (m != NULL) OPENSSL_free(m); | 207 | if (m != NULL) OPENSSL_free(m); |
208 | return(ret); | 208 | return(ret); |
209 | } | 209 | } |
210 | #endif /* !NO_DSA */ | 210 | #endif /* !OPENSSL_NO_DSA */ |
211 | 211 | ||
212 | static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, | 212 | static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, |
213 | int off) | 213 | int off) |
@@ -259,9 +259,9 @@ static int print(BIO *bp, const char *number, BIGNUM *num, unsigned char *buf, | |||
259 | return(1); | 259 | return(1); |
260 | } | 260 | } |
261 | 261 | ||
262 | #ifndef NO_DH | 262 | #ifndef OPENSSL_NO_DH |
263 | #ifndef NO_FP_API | 263 | #ifndef OPENSSL_NO_FP_API |
264 | int DHparams_print_fp(FILE *fp, DH *x) | 264 | int DHparams_print_fp(FILE *fp, const DH *x) |
265 | { | 265 | { |
266 | BIO *b; | 266 | BIO *b; |
267 | int ret; | 267 | int ret; |
@@ -278,7 +278,7 @@ int DHparams_print_fp(FILE *fp, DH *x) | |||
278 | } | 278 | } |
279 | #endif | 279 | #endif |
280 | 280 | ||
281 | int DHparams_print(BIO *bp, DH *x) | 281 | int DHparams_print(BIO *bp, const DH *x) |
282 | { | 282 | { |
283 | unsigned char *m=NULL; | 283 | unsigned char *m=NULL; |
284 | int reason=ERR_R_BUF_LIB,i,ret=0; | 284 | int reason=ERR_R_BUF_LIB,i,ret=0; |
@@ -312,9 +312,9 @@ err: | |||
312 | } | 312 | } |
313 | #endif | 313 | #endif |
314 | 314 | ||
315 | #ifndef NO_DSA | 315 | #ifndef OPENSSL_NO_DSA |
316 | #ifndef NO_FP_API | 316 | #ifndef OPENSSL_NO_FP_API |
317 | int DSAparams_print_fp(FILE *fp, DSA *x) | 317 | int DSAparams_print_fp(FILE *fp, const DSA *x) |
318 | { | 318 | { |
319 | BIO *b; | 319 | BIO *b; |
320 | int ret; | 320 | int ret; |
@@ -331,7 +331,7 @@ int DSAparams_print_fp(FILE *fp, DSA *x) | |||
331 | } | 331 | } |
332 | #endif | 332 | #endif |
333 | 333 | ||
334 | int DSAparams_print(BIO *bp, DSA *x) | 334 | int DSAparams_print(BIO *bp, const DSA *x) |
335 | { | 335 | { |
336 | unsigned char *m=NULL; | 336 | unsigned char *m=NULL; |
337 | int reason=ERR_R_BUF_LIB,i,ret=0; | 337 | int reason=ERR_R_BUF_LIB,i,ret=0; |
@@ -357,5 +357,5 @@ err: | |||
357 | return(ret); | 357 | return(ret); |
358 | } | 358 | } |
359 | 359 | ||
360 | #endif /* !NO_DSA */ | 360 | #endif /* !OPENSSL_NO_DSA */ |
361 | 361 | ||
diff --git a/src/lib/libcrypto/asn1/t_req.c b/src/lib/libcrypto/asn1/t_req.c index ea1af092db..848c29a2dd 100644 --- a/src/lib/libcrypto/asn1/t_req.c +++ b/src/lib/libcrypto/asn1/t_req.c | |||
@@ -64,7 +64,7 @@ | |||
64 | #include <openssl/x509.h> | 64 | #include <openssl/x509.h> |
65 | #include <openssl/x509v3.h> | 65 | #include <openssl/x509v3.h> |
66 | 66 | ||
67 | #ifndef NO_FP_API | 67 | #ifndef OPENSSL_NO_FP_API |
68 | int X509_REQ_print_fp(FILE *fp, X509_REQ *x) | 68 | int X509_REQ_print_fp(FILE *fp, X509_REQ *x) |
69 | { | 69 | { |
70 | BIO *b; | 70 | BIO *b; |
@@ -85,8 +85,7 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x) | |||
85 | int X509_REQ_print(BIO *bp, X509_REQ *x) | 85 | int X509_REQ_print(BIO *bp, X509_REQ *x) |
86 | { | 86 | { |
87 | unsigned long l; | 87 | unsigned long l; |
88 | int i,n; | 88 | int i; |
89 | char *s; | ||
90 | const char *neg; | 89 | const char *neg; |
91 | X509_REQ_INFO *ri; | 90 | X509_REQ_INFO *ri; |
92 | EVP_PKEY *pkey; | 91 | EVP_PKEY *pkey; |
@@ -118,7 +117,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
118 | if (BIO_puts(bp,str) <= 0) goto err; | 117 | if (BIO_puts(bp,str) <= 0) goto err; |
119 | 118 | ||
120 | pkey=X509_REQ_get_pubkey(x); | 119 | pkey=X509_REQ_get_pubkey(x); |
121 | #ifndef NO_RSA | 120 | #ifndef OPENSSL_NO_RSA |
122 | if (pkey != NULL && pkey->type == EVP_PKEY_RSA) | 121 | if (pkey != NULL && pkey->type == EVP_PKEY_RSA) |
123 | { | 122 | { |
124 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", | 123 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", |
@@ -127,7 +126,7 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
127 | } | 126 | } |
128 | else | 127 | else |
129 | #endif | 128 | #endif |
130 | #ifndef NO_DSA | 129 | #ifndef OPENSSL_NO_DSA |
131 | if (pkey != NULL && pkey->type == EVP_PKEY_DSA) | 130 | if (pkey != NULL && pkey->type == EVP_PKEY_DSA) |
132 | { | 131 | { |
133 | BIO_printf(bp,"%12sDSA Public Key:\n",""); | 132 | BIO_printf(bp,"%12sDSA Public Key:\n",""); |
@@ -145,13 +144,10 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
145 | if (BIO_puts(bp,str) <= 0) goto err; | 144 | if (BIO_puts(bp,str) <= 0) goto err; |
146 | 145 | ||
147 | sk=x->req_info->attributes; | 146 | sk=x->req_info->attributes; |
148 | if ((sk == NULL) || (sk_X509_ATTRIBUTE_num(sk) == 0)) | 147 | if (sk_X509_ATTRIBUTE_num(sk) == 0) |
149 | { | 148 | { |
150 | if (!x->req_info->req_kludge) | 149 | sprintf(str,"%12sa0:00\n",""); |
151 | { | 150 | if (BIO_puts(bp,str) <= 0) goto err; |
152 | sprintf(str,"%12sa0:00\n",""); | ||
153 | if (BIO_puts(bp,str) <= 0) goto err; | ||
154 | } | ||
155 | } | 151 | } |
156 | else | 152 | else |
157 | { | 153 | { |
@@ -170,7 +166,13 @@ int X509_REQ_print(BIO *bp, X509_REQ *x) | |||
170 | if (BIO_puts(bp,str) <= 0) goto err; | 166 | if (BIO_puts(bp,str) <= 0) goto err; |
171 | if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0) | 167 | if ((j=i2a_ASN1_OBJECT(bp,a->object)) > 0) |
172 | { | 168 | { |
173 | if (a->set) | 169 | if (a->single) |
170 | { | ||
171 | t=a->value.single; | ||
172 | type=t->type; | ||
173 | bs=t->value.bit_string; | ||
174 | } | ||
175 | else | ||
174 | { | 176 | { |
175 | ii=0; | 177 | ii=0; |
176 | count=sk_ASN1_TYPE_num(a->value.set); | 178 | count=sk_ASN1_TYPE_num(a->value.set); |
@@ -179,12 +181,6 @@ get_next: | |||
179 | type=at->type; | 181 | type=at->type; |
180 | bs=at->value.asn1_string; | 182 | bs=at->value.asn1_string; |
181 | } | 183 | } |
182 | else | ||
183 | { | ||
184 | t=a->value.single; | ||
185 | type=t->type; | ||
186 | bs=t->value.bit_string; | ||
187 | } | ||
188 | } | 184 | } |
189 | for (j=25-j; j>0; j--) | 185 | for (j=25-j; j>0; j--) |
190 | if (BIO_write(bp," ",1) != 1) goto err; | 186 | if (BIO_write(bp," ",1) != 1) goto err; |
@@ -229,24 +225,8 @@ get_next: | |||
229 | sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); | 225 | sk_X509_EXTENSION_pop_free(exts, X509_EXTENSION_free); |
230 | } | 226 | } |
231 | 227 | ||
232 | i=OBJ_obj2nid(x->sig_alg->algorithm); | 228 | if(!X509_signature_print(bp, x->sig_alg, x->signature)) goto err; |
233 | sprintf(str,"%4sSignature Algorithm: %s","", | ||
234 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)); | ||
235 | if (BIO_puts(bp,str) <= 0) goto err; | ||
236 | 229 | ||
237 | n=x->signature->length; | ||
238 | s=(char *)x->signature->data; | ||
239 | for (i=0; i<n; i++) | ||
240 | { | ||
241 | if ((i%18) == 0) | ||
242 | { | ||
243 | sprintf(str,"\n%8s",""); | ||
244 | if (BIO_puts(bp,str) <= 0) goto err; | ||
245 | } | ||
246 | sprintf(str,"%02x%s",(unsigned char)s[i],((i+1) == n)?"":":"); | ||
247 | if (BIO_puts(bp,str) <= 0) goto err; | ||
248 | } | ||
249 | if (BIO_puts(bp,"\n") <= 0) goto err; | ||
250 | return(1); | 230 | return(1); |
251 | err: | 231 | err: |
252 | X509err(X509_F_X509_REQ_PRINT,ERR_R_BUF_LIB); | 232 | X509err(X509_F_X509_REQ_PRINT,ERR_R_BUF_LIB); |
diff --git a/src/lib/libcrypto/asn1/t_spki.c b/src/lib/libcrypto/asn1/t_spki.c index d708434fca..5abfbc815e 100644 --- a/src/lib/libcrypto/asn1/t_spki.c +++ b/src/lib/libcrypto/asn1/t_spki.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/x509.h> | 61 | #include <openssl/x509.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1.h> |
63 | 63 | ||
64 | /* Print out an SPKI */ | 64 | /* Print out an SPKI */ |
65 | 65 | ||
@@ -76,7 +76,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki) | |||
76 | pkey = X509_PUBKEY_get(spki->spkac->pubkey); | 76 | pkey = X509_PUBKEY_get(spki->spkac->pubkey); |
77 | if(!pkey) BIO_printf(out, " Unable to load public key\n"); | 77 | if(!pkey) BIO_printf(out, " Unable to load public key\n"); |
78 | else { | 78 | else { |
79 | #ifndef NO_RSA | 79 | #ifndef OPENSSL_NO_RSA |
80 | if (pkey->type == EVP_PKEY_RSA) | 80 | if (pkey->type == EVP_PKEY_RSA) |
81 | { | 81 | { |
82 | BIO_printf(out," RSA Public Key: (%d bit)\n", | 82 | BIO_printf(out," RSA Public Key: (%d bit)\n", |
@@ -85,7 +85,7 @@ int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki) | |||
85 | } | 85 | } |
86 | else | 86 | else |
87 | #endif | 87 | #endif |
88 | #ifndef NO_DSA | 88 | #ifndef OPENSSL_NO_DSA |
89 | if (pkey->type == EVP_PKEY_DSA) | 89 | if (pkey->type == EVP_PKEY_DSA) |
90 | { | 90 | { |
91 | BIO_printf(out," DSA Public Key:\n"); | 91 | BIO_printf(out," DSA Public Key:\n"); |
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c index 89ae73a6de..5de4833ed0 100644 --- a/src/lib/libcrypto/asn1/t_x509.c +++ b/src/lib/libcrypto/asn1/t_x509.c | |||
@@ -60,18 +60,23 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/buffer.h> | 61 | #include <openssl/buffer.h> |
62 | #include <openssl/bn.h> | 62 | #include <openssl/bn.h> |
63 | #ifndef NO_RSA | 63 | #ifndef OPENSSL_NO_RSA |
64 | #include <openssl/rsa.h> | 64 | #include <openssl/rsa.h> |
65 | #endif | 65 | #endif |
66 | #ifndef NO_DSA | 66 | #ifndef OPENSSL_NO_DSA |
67 | #include <openssl/dsa.h> | 67 | #include <openssl/dsa.h> |
68 | #endif | 68 | #endif |
69 | #include <openssl/objects.h> | 69 | #include <openssl/objects.h> |
70 | #include <openssl/x509.h> | 70 | #include <openssl/x509.h> |
71 | #include <openssl/x509v3.h> | 71 | #include <openssl/x509v3.h> |
72 | 72 | ||
73 | #ifndef NO_FP_API | 73 | #ifndef OPENSSL_NO_FP_API |
74 | int X509_print_fp(FILE *fp, X509 *x) | 74 | int X509_print_fp(FILE *fp, X509 *x) |
75 | { | ||
76 | return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); | ||
77 | } | ||
78 | |||
79 | int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag) | ||
75 | { | 80 | { |
76 | BIO *b; | 81 | BIO *b; |
77 | int ret; | 82 | int ret; |
@@ -82,144 +87,165 @@ int X509_print_fp(FILE *fp, X509 *x) | |||
82 | return(0); | 87 | return(0); |
83 | } | 88 | } |
84 | BIO_set_fp(b,fp,BIO_NOCLOSE); | 89 | BIO_set_fp(b,fp,BIO_NOCLOSE); |
85 | ret=X509_print(b, x); | 90 | ret=X509_print_ex(b, x, nmflag, cflag); |
86 | BIO_free(b); | 91 | BIO_free(b); |
87 | return(ret); | 92 | return(ret); |
88 | } | 93 | } |
89 | #endif | 94 | #endif |
90 | 95 | ||
91 | int X509_print(BIO *bp, X509 *x) | 96 | int X509_print(BIO *bp, X509 *x) |
97 | { | ||
98 | return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); | ||
99 | } | ||
100 | |||
101 | int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) | ||
92 | { | 102 | { |
93 | long l; | 103 | long l; |
94 | int ret=0,i,j,n; | 104 | int ret=0,i; |
95 | char *m=NULL,*s; | 105 | char *m=NULL,mlch = ' '; |
106 | int nmindent = 0; | ||
96 | X509_CINF *ci; | 107 | X509_CINF *ci; |
97 | ASN1_INTEGER *bs; | 108 | ASN1_INTEGER *bs; |
98 | EVP_PKEY *pkey=NULL; | 109 | EVP_PKEY *pkey=NULL; |
99 | const char *neg; | 110 | const char *neg; |
100 | X509_EXTENSION *ex; | ||
101 | ASN1_STRING *str=NULL; | 111 | ASN1_STRING *str=NULL; |
102 | 112 | ||
113 | if((nmflags & XN_FLAG_SEP_MASK) == XN_FLAG_SEP_MULTILINE) { | ||
114 | mlch = '\n'; | ||
115 | nmindent = 12; | ||
116 | } | ||
117 | |||
118 | if(nmflags == X509_FLAG_COMPAT) | ||
119 | nmindent = 16; | ||
120 | |||
103 | ci=x->cert_info; | 121 | ci=x->cert_info; |
104 | if (BIO_write(bp,"Certificate:\n",13) <= 0) goto err; | 122 | if(!(cflag & X509_FLAG_NO_HEADER)) |
105 | if (BIO_write(bp," Data:\n",10) <= 0) goto err; | ||
106 | l=X509_get_version(x); | ||
107 | if (BIO_printf(bp,"%8sVersion: %lu (0x%lx)\n","",l+1,l) <= 0) goto err; | ||
108 | if (BIO_write(bp," Serial Number:",22) <= 0) goto err; | ||
109 | |||
110 | bs=X509_get_serialNumber(x); | ||
111 | if (bs->length <= 4) | ||
112 | { | 123 | { |
113 | l=ASN1_INTEGER_get(bs); | 124 | if (BIO_write(bp,"Certificate:\n",13) <= 0) goto err; |
114 | if (l < 0) | 125 | if (BIO_write(bp," Data:\n",10) <= 0) goto err; |
115 | { | ||
116 | l= -l; | ||
117 | neg="-"; | ||
118 | } | ||
119 | else | ||
120 | neg=""; | ||
121 | if (BIO_printf(bp," %s%lu (%s0x%lx)\n",neg,l,neg,l) <= 0) | ||
122 | goto err; | ||
123 | } | 126 | } |
124 | else | 127 | if(!(cflag & X509_FLAG_NO_VERSION)) |
128 | { | ||
129 | l=X509_get_version(x); | ||
130 | if (BIO_printf(bp,"%8sVersion: %lu (0x%lx)\n","",l+1,l) <= 0) goto err; | ||
131 | } | ||
132 | if(!(cflag & X509_FLAG_NO_SERIAL)) | ||
125 | { | 133 | { |
126 | neg=(bs->type == V_ASN1_NEG_INTEGER)?" (Negative)":""; | ||
127 | if (BIO_printf(bp,"\n%12s%s","",neg) <= 0) goto err; | ||
128 | 134 | ||
129 | for (i=0; i<bs->length; i++) | 135 | if (BIO_write(bp," Serial Number:",22) <= 0) goto err; |
136 | |||
137 | bs=X509_get_serialNumber(x); | ||
138 | if (bs->length <= 4) | ||
130 | { | 139 | { |
131 | if (BIO_printf(bp,"%02x%c",bs->data[i], | 140 | l=ASN1_INTEGER_get(bs); |
132 | ((i+1 == bs->length)?'\n':':')) <= 0) | 141 | if (l < 0) |
142 | { | ||
143 | l= -l; | ||
144 | neg="-"; | ||
145 | } | ||
146 | else | ||
147 | neg=""; | ||
148 | if (BIO_printf(bp," %s%lu (%s0x%lx)\n",neg,l,neg,l) <= 0) | ||
133 | goto err; | 149 | goto err; |
134 | } | 150 | } |
135 | } | 151 | else |
152 | { | ||
153 | neg=(bs->type == V_ASN1_NEG_INTEGER)?" (Negative)":""; | ||
154 | if (BIO_printf(bp,"\n%12s%s","",neg) <= 0) goto err; | ||
136 | 155 | ||
137 | i=OBJ_obj2nid(ci->signature->algorithm); | 156 | for (i=0; i<bs->length; i++) |
138 | if (BIO_printf(bp,"%8sSignature Algorithm: %s\n","", | 157 | { |
139 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)) <= 0) | 158 | if (BIO_printf(bp,"%02x%c",bs->data[i], |
140 | goto err; | 159 | ((i+1 == bs->length)?'\n':':')) <= 0) |
160 | goto err; | ||
161 | } | ||
162 | } | ||
141 | 163 | ||
142 | if (BIO_write(bp," Issuer: ",16) <= 0) goto err; | 164 | } |
143 | if (!X509_NAME_print(bp,X509_get_issuer_name(x),16)) goto err; | ||
144 | if (BIO_write(bp,"\n Validity\n",18) <= 0) goto err; | ||
145 | if (BIO_write(bp," Not Before: ",24) <= 0) goto err; | ||
146 | if (!ASN1_TIME_print(bp,X509_get_notBefore(x))) goto err; | ||
147 | if (BIO_write(bp,"\n Not After : ",25) <= 0) goto err; | ||
148 | if (!ASN1_TIME_print(bp,X509_get_notAfter(x))) goto err; | ||
149 | if (BIO_write(bp,"\n Subject: ",18) <= 0) goto err; | ||
150 | if (!X509_NAME_print(bp,X509_get_subject_name(x),16)) goto err; | ||
151 | if (BIO_write(bp,"\n Subject Public Key Info:\n",34) <= 0) | ||
152 | goto err; | ||
153 | i=OBJ_obj2nid(ci->key->algor->algorithm); | ||
154 | if (BIO_printf(bp,"%12sPublic Key Algorithm: %s\n","", | ||
155 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)) <= 0) goto err; | ||
156 | 165 | ||
157 | pkey=X509_get_pubkey(x); | 166 | if(!(cflag & X509_FLAG_NO_SIGNAME)) |
158 | if (pkey == NULL) | ||
159 | { | 167 | { |
160 | BIO_printf(bp,"%12sUnable to load Public Key\n",""); | 168 | if (BIO_printf(bp,"%8sSignature Algorithm: ","") <= 0) |
161 | ERR_print_errors(bp); | 169 | goto err; |
170 | if (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0) | ||
171 | goto err; | ||
172 | if (BIO_puts(bp, "\n") <= 0) | ||
173 | goto err; | ||
162 | } | 174 | } |
163 | else | 175 | |
164 | #ifndef NO_RSA | 176 | if(!(cflag & X509_FLAG_NO_ISSUER)) |
165 | if (pkey->type == EVP_PKEY_RSA) | ||
166 | { | 177 | { |
167 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", | 178 | if (BIO_printf(bp," Issuer:%c",mlch) <= 0) goto err; |
168 | BN_num_bits(pkey->pkey.rsa->n)); | 179 | if (X509_NAME_print_ex(bp,X509_get_issuer_name(x),nmindent, nmflags) < 0) goto err; |
169 | RSA_print(bp,pkey->pkey.rsa,16); | 180 | if (BIO_write(bp,"\n",1) <= 0) goto err; |
170 | } | 181 | } |
171 | else | 182 | if(!(cflag & X509_FLAG_NO_VALIDITY)) |
172 | #endif | ||
173 | #ifndef NO_DSA | ||
174 | if (pkey->type == EVP_PKEY_DSA) | ||
175 | { | 183 | { |
176 | BIO_printf(bp,"%12sDSA Public Key:\n",""); | 184 | if (BIO_write(bp," Validity\n",17) <= 0) goto err; |
177 | DSA_print(bp,pkey->pkey.dsa,16); | 185 | if (BIO_write(bp," Not Before: ",24) <= 0) goto err; |
186 | if (!ASN1_TIME_print(bp,X509_get_notBefore(x))) goto err; | ||
187 | if (BIO_write(bp,"\n Not After : ",25) <= 0) goto err; | ||
188 | if (!ASN1_TIME_print(bp,X509_get_notAfter(x))) goto err; | ||
189 | if (BIO_write(bp,"\n",1) <= 0) goto err; | ||
178 | } | 190 | } |
179 | else | 191 | if(!(cflag & X509_FLAG_NO_SUBJECT)) |
180 | #endif | ||
181 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); | ||
182 | |||
183 | EVP_PKEY_free(pkey); | ||
184 | |||
185 | n=X509_get_ext_count(x); | ||
186 | if (n > 0) | ||
187 | { | 192 | { |
188 | BIO_printf(bp,"%8sX509v3 extensions:\n",""); | 193 | if (BIO_printf(bp," Subject:%c",mlch) <= 0) goto err; |
189 | for (i=0; i<n; i++) | 194 | if (X509_NAME_print_ex(bp,X509_get_subject_name(x),nmindent, nmflags) < 0) goto err; |
195 | if (BIO_write(bp,"\n",1) <= 0) goto err; | ||
196 | } | ||
197 | if(!(cflag & X509_FLAG_NO_PUBKEY)) | ||
198 | { | ||
199 | if (BIO_write(bp," Subject Public Key Info:\n",33) <= 0) | ||
200 | goto err; | ||
201 | if (BIO_printf(bp,"%12sPublic Key Algorithm: ","") <= 0) | ||
202 | goto err; | ||
203 | if (i2a_ASN1_OBJECT(bp, ci->key->algor->algorithm) <= 0) | ||
204 | goto err; | ||
205 | if (BIO_puts(bp, "\n") <= 0) | ||
206 | goto err; | ||
207 | |||
208 | pkey=X509_get_pubkey(x); | ||
209 | if (pkey == NULL) | ||
190 | { | 210 | { |
191 | ASN1_OBJECT *obj; | 211 | BIO_printf(bp,"%12sUnable to load Public Key\n",""); |
192 | ex=X509_get_ext(x,i); | 212 | ERR_print_errors(bp); |
193 | if (BIO_printf(bp,"%12s","") <= 0) goto err; | 213 | } |
194 | obj=X509_EXTENSION_get_object(ex); | 214 | else |
195 | i2a_ASN1_OBJECT(bp,obj); | 215 | #ifndef OPENSSL_NO_RSA |
196 | j=X509_EXTENSION_get_critical(ex); | 216 | if (pkey->type == EVP_PKEY_RSA) |
197 | if (BIO_printf(bp,": %s\n",j?"critical":"","") <= 0) | 217 | { |
198 | goto err; | 218 | BIO_printf(bp,"%12sRSA Public Key: (%d bit)\n","", |
199 | if(!X509V3_EXT_print(bp, ex, 0, 16)) | 219 | BN_num_bits(pkey->pkey.rsa->n)); |
200 | { | 220 | RSA_print(bp,pkey->pkey.rsa,16); |
201 | BIO_printf(bp, "%16s", ""); | 221 | } |
202 | M_ASN1_OCTET_STRING_print(bp,ex->value); | 222 | else |
203 | } | 223 | #endif |
204 | if (BIO_write(bp,"\n",1) <= 0) goto err; | 224 | #ifndef OPENSSL_NO_DSA |
225 | if (pkey->type == EVP_PKEY_DSA) | ||
226 | { | ||
227 | BIO_printf(bp,"%12sDSA Public Key:\n",""); | ||
228 | DSA_print(bp,pkey->pkey.dsa,16); | ||
205 | } | 229 | } |
230 | else | ||
231 | #endif | ||
232 | BIO_printf(bp,"%12sUnknown Public Key:\n",""); | ||
233 | |||
234 | EVP_PKEY_free(pkey); | ||
206 | } | 235 | } |
207 | 236 | ||
208 | i=OBJ_obj2nid(x->sig_alg->algorithm); | 237 | if (!(cflag & X509_FLAG_NO_EXTENSIONS)) |
209 | if (BIO_printf(bp,"%4sSignature Algorithm: %s","", | 238 | X509V3_extensions_print(bp, "X509v3 extensions", |
210 | (i == NID_undef)?"UNKNOWN":OBJ_nid2ln(i)) <= 0) goto err; | 239 | ci->extensions, cflag, 8); |
211 | 240 | ||
212 | n=x->signature->length; | 241 | if(!(cflag & X509_FLAG_NO_SIGDUMP)) |
213 | s=(char *)x->signature->data; | ||
214 | for (i=0; i<n; i++) | ||
215 | { | 242 | { |
216 | if ((i%18) == 0) | 243 | if(X509_signature_print(bp, x->sig_alg, x->signature) <= 0) goto err; |
217 | if (BIO_write(bp,"\n ",9) <= 0) goto err; | 244 | } |
218 | if (BIO_printf(bp,"%02x%s",(unsigned char)s[i], | 245 | if(!(cflag & X509_FLAG_NO_AUX)) |
219 | ((i+1) == n)?"":":") <= 0) goto err; | 246 | { |
247 | if (!X509_CERT_AUX_print(bp, x->aux, 0)) goto err; | ||
220 | } | 248 | } |
221 | if (BIO_write(bp,"\n",1) != 1) goto err; | ||
222 | if (!X509_CERT_AUX_print(bp, x->aux, 0)) goto err; | ||
223 | ret=1; | 249 | ret=1; |
224 | err: | 250 | err: |
225 | if (str != NULL) ASN1_STRING_free(str); | 251 | if (str != NULL) ASN1_STRING_free(str); |
@@ -227,6 +253,71 @@ err: | |||
227 | return(ret); | 253 | return(ret); |
228 | } | 254 | } |
229 | 255 | ||
256 | int X509_ocspid_print (BIO *bp, X509 *x) | ||
257 | { | ||
258 | unsigned char *der=NULL ; | ||
259 | unsigned char *dertmp; | ||
260 | int derlen; | ||
261 | int i; | ||
262 | unsigned char SHA1md[SHA_DIGEST_LENGTH]; | ||
263 | |||
264 | /* display the hash of the subject as it would appear | ||
265 | in OCSP requests */ | ||
266 | if (BIO_printf(bp," Subject OCSP hash: ") <= 0) | ||
267 | goto err; | ||
268 | derlen = i2d_X509_NAME(x->cert_info->subject, NULL); | ||
269 | if ((der = dertmp = (unsigned char *)OPENSSL_malloc (derlen)) == NULL) | ||
270 | goto err; | ||
271 | i2d_X509_NAME(x->cert_info->subject, &dertmp); | ||
272 | |||
273 | EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL); | ||
274 | for (i=0; i < SHA_DIGEST_LENGTH; i++) | ||
275 | { | ||
276 | if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) goto err; | ||
277 | } | ||
278 | OPENSSL_free (der); | ||
279 | der=NULL; | ||
280 | |||
281 | /* display the hash of the public key as it would appear | ||
282 | in OCSP requests */ | ||
283 | if (BIO_printf(bp,"\n Public key OCSP hash: ") <= 0) | ||
284 | goto err; | ||
285 | |||
286 | EVP_Digest(x->cert_info->key->public_key->data, | ||
287 | x->cert_info->key->public_key->length, SHA1md, NULL, EVP_sha1(), NULL); | ||
288 | for (i=0; i < SHA_DIGEST_LENGTH; i++) | ||
289 | { | ||
290 | if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) | ||
291 | goto err; | ||
292 | } | ||
293 | BIO_printf(bp,"\n"); | ||
294 | |||
295 | return (1); | ||
296 | err: | ||
297 | if (der != NULL) OPENSSL_free(der); | ||
298 | return(0); | ||
299 | } | ||
300 | |||
301 | int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig) | ||
302 | { | ||
303 | unsigned char *s; | ||
304 | int i, n; | ||
305 | if (BIO_puts(bp," Signature Algorithm: ") <= 0) return 0; | ||
306 | if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) return 0; | ||
307 | |||
308 | n=sig->length; | ||
309 | s=sig->data; | ||
310 | for (i=0; i<n; i++) | ||
311 | { | ||
312 | if ((i%18) == 0) | ||
313 | if (BIO_write(bp,"\n ",9) <= 0) return 0; | ||
314 | if (BIO_printf(bp,"%02x%s",s[i], | ||
315 | ((i+1) == n)?"":":") <= 0) return 0; | ||
316 | } | ||
317 | if (BIO_write(bp,"\n",1) != 1) return 0; | ||
318 | return 1; | ||
319 | } | ||
320 | |||
230 | int ASN1_STRING_print(BIO *bp, ASN1_STRING *v) | 321 | int ASN1_STRING_print(BIO *bp, ASN1_STRING *v) |
231 | { | 322 | { |
232 | int i,n; | 323 | int i,n; |
diff --git a/src/lib/libcrypto/asn1/t_x509a.c b/src/lib/libcrypto/asn1/t_x509a.c index f06af5b576..7d4a6e6084 100644 --- a/src/lib/libcrypto/asn1/t_x509a.c +++ b/src/lib/libcrypto/asn1/t_x509a.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1.h> |
63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | /* X509_CERT_AUX and string set routines | 65 | /* X509_CERT_AUX and string set routines |
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c new file mode 100644 index 0000000000..0fc1f421e2 --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
@@ -0,0 +1,958 @@ | |||
1 | /* tasn_dec.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stddef.h> | ||
61 | #include <string.h> | ||
62 | #include <openssl/asn1.h> | ||
63 | #include <openssl/asn1t.h> | ||
64 | #include <openssl/objects.h> | ||
65 | #include <openssl/buffer.h> | ||
66 | #include <openssl/err.h> | ||
67 | |||
68 | static int asn1_check_eoc(unsigned char **in, long len); | ||
69 | static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, int tag, int aclass); | ||
70 | static int collect_data(BUF_MEM *buf, unsigned char **p, long plen); | ||
71 | static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, char *inf, char *cst, | ||
72 | unsigned char **in, long len, int exptag, int expclass, char opt, ASN1_TLC *ctx); | ||
73 | static int asn1_template_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx); | ||
74 | static int asn1_template_noexp_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx); | ||
75 | static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, unsigned char **in, long len, | ||
76 | const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx); | ||
77 | |||
78 | /* Table to convert tags to bit values, used for MSTRING type */ | ||
79 | static unsigned long tag2bit[32]={ | ||
80 | 0, 0, 0, B_ASN1_BIT_STRING, /* tags 0 - 3 */ | ||
81 | B_ASN1_OCTET_STRING, 0, 0, B_ASN1_UNKNOWN,/* tags 4- 7 */ | ||
82 | B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN, B_ASN1_UNKNOWN,/* tags 8-11 */ | ||
83 | B_ASN1_UTF8STRING,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,B_ASN1_UNKNOWN,/* tags 12-15 */ | ||
84 | 0, 0, B_ASN1_NUMERICSTRING,B_ASN1_PRINTABLESTRING, /* tags 16-19 */ | ||
85 | B_ASN1_T61STRING,B_ASN1_VIDEOTEXSTRING,B_ASN1_IA5STRING, /* tags 20-22 */ | ||
86 | B_ASN1_UTCTIME, B_ASN1_GENERALIZEDTIME, /* tags 23-24 */ | ||
87 | B_ASN1_GRAPHICSTRING,B_ASN1_ISO64STRING,B_ASN1_GENERALSTRING, /* tags 25-27 */ | ||
88 | B_ASN1_UNIVERSALSTRING,B_ASN1_UNKNOWN,B_ASN1_BMPSTRING,B_ASN1_UNKNOWN, /* tags 28-31 */ | ||
89 | }; | ||
90 | |||
91 | unsigned long ASN1_tag2bit(int tag) | ||
92 | { | ||
93 | if((tag < 0) || (tag > 30)) return 0; | ||
94 | return tag2bit[tag]; | ||
95 | } | ||
96 | |||
97 | /* Macro to initialize and invalidate the cache */ | ||
98 | |||
99 | #define asn1_tlc_clear(c) if(c) (c)->valid = 0 | ||
100 | |||
101 | /* Decode an ASN1 item, this currently behaves just | ||
102 | * like a standard 'd2i' function. 'in' points to | ||
103 | * a buffer to read the data from, in future we will | ||
104 | * have more advanced versions that can input data | ||
105 | * a piece at a time and this will simply be a special | ||
106 | * case. | ||
107 | */ | ||
108 | |||
109 | ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_ITEM *it) | ||
110 | { | ||
111 | ASN1_TLC c; | ||
112 | ASN1_VALUE *ptmpval = NULL; | ||
113 | if(!pval) pval = &ptmpval; | ||
114 | asn1_tlc_clear(&c); | ||
115 | if(ASN1_item_ex_d2i(pval, in, len, it, -1, 0, 0, &c) > 0) | ||
116 | return *pval; | ||
117 | return NULL; | ||
118 | } | ||
119 | |||
120 | int ASN1_template_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_TEMPLATE *tt) | ||
121 | { | ||
122 | ASN1_TLC c; | ||
123 | asn1_tlc_clear(&c); | ||
124 | return asn1_template_ex_d2i(pval, in, len, tt, 0, &c); | ||
125 | } | ||
126 | |||
127 | |||
128 | /* Decode an item, taking care of IMPLICIT tagging, if any. | ||
129 | * If 'opt' set and tag mismatch return -1 to handle OPTIONAL | ||
130 | */ | ||
131 | |||
132 | int ASN1_item_ex_d2i(ASN1_VALUE **pval, unsigned char **in, long len, const ASN1_ITEM *it, | ||
133 | int tag, int aclass, char opt, ASN1_TLC *ctx) | ||
134 | { | ||
135 | const ASN1_TEMPLATE *tt, *errtt = NULL; | ||
136 | const ASN1_COMPAT_FUNCS *cf; | ||
137 | const ASN1_EXTERN_FUNCS *ef; | ||
138 | const ASN1_AUX *aux = it->funcs; | ||
139 | ASN1_aux_cb *asn1_cb; | ||
140 | unsigned char *p, *q, imphack = 0, oclass; | ||
141 | char seq_eoc, seq_nolen, cst, isopt; | ||
142 | long tmplen; | ||
143 | int i; | ||
144 | int otag; | ||
145 | int ret = 0; | ||
146 | ASN1_VALUE *pchval, **pchptr, *ptmpval; | ||
147 | if(!pval) return 0; | ||
148 | if(aux && aux->asn1_cb) asn1_cb = aux->asn1_cb; | ||
149 | else asn1_cb = 0; | ||
150 | |||
151 | switch(it->itype) { | ||
152 | |||
153 | case ASN1_ITYPE_PRIMITIVE: | ||
154 | if(it->templates) { | ||
155 | /* tagging or OPTIONAL is currently illegal on an item template | ||
156 | * because the flags can't get passed down. In practice this isn't | ||
157 | * a problem: we include the relevant flags from the item template | ||
158 | * in the template itself. | ||
159 | */ | ||
160 | if ((tag != -1) || opt) { | ||
161 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE); | ||
162 | goto err; | ||
163 | } | ||
164 | return asn1_template_ex_d2i(pval, in, len, it->templates, opt, ctx); | ||
165 | } | ||
166 | return asn1_d2i_ex_primitive(pval, in, len, it, tag, aclass, opt, ctx); | ||
167 | break; | ||
168 | |||
169 | case ASN1_ITYPE_MSTRING: | ||
170 | p = *in; | ||
171 | /* Just read in tag and class */ | ||
172 | ret = asn1_check_tlen(NULL, &otag, &oclass, NULL, NULL, &p, len, -1, 0, 1, ctx); | ||
173 | if(!ret) { | ||
174 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
175 | goto err; | ||
176 | } | ||
177 | /* Must be UNIVERSAL class */ | ||
178 | if(oclass != V_ASN1_UNIVERSAL) { | ||
179 | /* If OPTIONAL, assume this is OK */ | ||
180 | if(opt) return -1; | ||
181 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_MSTRING_NOT_UNIVERSAL); | ||
182 | goto err; | ||
183 | } | ||
184 | /* Check tag matches bit map */ | ||
185 | if(!(ASN1_tag2bit(otag) & it->utype)) { | ||
186 | /* If OPTIONAL, assume this is OK */ | ||
187 | if(opt) return -1; | ||
188 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_MSTRING_WRONG_TAG); | ||
189 | goto err; | ||
190 | } | ||
191 | return asn1_d2i_ex_primitive(pval, in, len, it, otag, 0, 0, ctx); | ||
192 | |||
193 | case ASN1_ITYPE_EXTERN: | ||
194 | /* Use new style d2i */ | ||
195 | ef = it->funcs; | ||
196 | return ef->asn1_ex_d2i(pval, in, len, it, tag, aclass, opt, ctx); | ||
197 | |||
198 | case ASN1_ITYPE_COMPAT: | ||
199 | /* we must resort to old style evil hackery */ | ||
200 | cf = it->funcs; | ||
201 | |||
202 | /* If OPTIONAL see if it is there */ | ||
203 | if(opt) { | ||
204 | int exptag; | ||
205 | p = *in; | ||
206 | if(tag == -1) exptag = it->utype; | ||
207 | else exptag = tag; | ||
208 | /* Don't care about anything other than presence of expected tag */ | ||
209 | ret = asn1_check_tlen(NULL, NULL, NULL, NULL, NULL, &p, len, exptag, aclass, 1, ctx); | ||
210 | if(!ret) { | ||
211 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
212 | goto err; | ||
213 | } | ||
214 | if(ret == -1) return -1; | ||
215 | } | ||
216 | /* This is the old style evil hack IMPLICIT handling: | ||
217 | * since the underlying code is expecting a tag and | ||
218 | * class other than the one present we change the | ||
219 | * buffer temporarily then change it back afterwards. | ||
220 | * This doesn't and never did work for tags > 30. | ||
221 | * | ||
222 | * Yes this is *horrible* but it is only needed for | ||
223 | * old style d2i which will hopefully not be around | ||
224 | * for much longer. | ||
225 | * FIXME: should copy the buffer then modify it so | ||
226 | * the input buffer can be const: we should *always* | ||
227 | * copy because the old style d2i might modify the | ||
228 | * buffer. | ||
229 | */ | ||
230 | |||
231 | if(tag != -1) { | ||
232 | p = *in; | ||
233 | imphack = *p; | ||
234 | *p = (unsigned char)((*p & V_ASN1_CONSTRUCTED) | it->utype); | ||
235 | } | ||
236 | |||
237 | ptmpval = cf->asn1_d2i(pval, in, len); | ||
238 | |||
239 | if(tag != -1) *p = imphack; | ||
240 | |||
241 | if(ptmpval) return 1; | ||
242 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
243 | goto err; | ||
244 | |||
245 | |||
246 | case ASN1_ITYPE_CHOICE: | ||
247 | if(asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it)) | ||
248 | goto auxerr; | ||
249 | |||
250 | /* Allocate structure */ | ||
251 | if(!*pval) { | ||
252 | if(!ASN1_item_ex_new(pval, it)) { | ||
253 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
254 | goto err; | ||
255 | } | ||
256 | } | ||
257 | /* CHOICE type, try each possibility in turn */ | ||
258 | pchval = NULL; | ||
259 | p = *in; | ||
260 | for(i = 0, tt=it->templates; i < it->tcount; i++, tt++) { | ||
261 | pchptr = asn1_get_field_ptr(pval, tt); | ||
262 | /* We mark field as OPTIONAL so its absence | ||
263 | * can be recognised. | ||
264 | */ | ||
265 | ret = asn1_template_ex_d2i(pchptr, &p, len, tt, 1, ctx); | ||
266 | /* If field not present, try the next one */ | ||
267 | if(ret == -1) continue; | ||
268 | /* If positive return, read OK, break loop */ | ||
269 | if(ret > 0) break; | ||
270 | /* Otherwise must be an ASN1 parsing error */ | ||
271 | errtt = tt; | ||
272 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
273 | goto err; | ||
274 | } | ||
275 | /* Did we fall off the end without reading anything? */ | ||
276 | if(i == it->tcount) { | ||
277 | /* If OPTIONAL, this is OK */ | ||
278 | if(opt) { | ||
279 | /* Free and zero it */ | ||
280 | ASN1_item_ex_free(pval, it); | ||
281 | return -1; | ||
282 | } | ||
283 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_NO_MATCHING_CHOICE_TYPE); | ||
284 | goto err; | ||
285 | } | ||
286 | asn1_set_choice_selector(pval, i, it); | ||
287 | *in = p; | ||
288 | if(asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it)) | ||
289 | goto auxerr; | ||
290 | return 1; | ||
291 | |||
292 | case ASN1_ITYPE_SEQUENCE: | ||
293 | p = *in; | ||
294 | tmplen = len; | ||
295 | |||
296 | /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ | ||
297 | if(tag == -1) { | ||
298 | tag = V_ASN1_SEQUENCE; | ||
299 | aclass = V_ASN1_UNIVERSAL; | ||
300 | } | ||
301 | /* Get SEQUENCE length and update len, p */ | ||
302 | ret = asn1_check_tlen(&len, NULL, NULL, &seq_eoc, &cst, &p, len, tag, aclass, opt, ctx); | ||
303 | if(!ret) { | ||
304 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
305 | goto err; | ||
306 | } else if(ret == -1) return -1; | ||
307 | if(aux && (aux->flags & ASN1_AFLG_BROKEN)) { | ||
308 | len = tmplen - (p - *in); | ||
309 | seq_nolen = 1; | ||
310 | } else seq_nolen = seq_eoc; /* If indefinite we don't do a length check */ | ||
311 | if(!cst) { | ||
312 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_SEQUENCE_NOT_CONSTRUCTED); | ||
313 | goto err; | ||
314 | } | ||
315 | |||
316 | if(!*pval) { | ||
317 | if(!ASN1_item_ex_new(pval, it)) { | ||
318 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
319 | goto err; | ||
320 | } | ||
321 | } | ||
322 | if(asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it)) | ||
323 | goto auxerr; | ||
324 | |||
325 | /* Get each field entry */ | ||
326 | for(i = 0, tt = it->templates; i < it->tcount; i++, tt++) { | ||
327 | const ASN1_TEMPLATE *seqtt; | ||
328 | ASN1_VALUE **pseqval; | ||
329 | seqtt = asn1_do_adb(pval, tt, 1); | ||
330 | if(!seqtt) goto err; | ||
331 | pseqval = asn1_get_field_ptr(pval, seqtt); | ||
332 | /* Have we ran out of data? */ | ||
333 | if(!len) break; | ||
334 | q = p; | ||
335 | if(asn1_check_eoc(&p, len)) { | ||
336 | if(!seq_eoc) { | ||
337 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_UNEXPECTED_EOC); | ||
338 | goto err; | ||
339 | } | ||
340 | len -= p - q; | ||
341 | seq_eoc = 0; | ||
342 | q = p; | ||
343 | break; | ||
344 | } | ||
345 | /* This determines the OPTIONAL flag value. The field cannot | ||
346 | * be omitted if it is the last of a SEQUENCE and there is | ||
347 | * still data to be read. This isn't strictly necessary but | ||
348 | * it increases efficiency in some cases. | ||
349 | */ | ||
350 | if(i == (it->tcount - 1)) isopt = 0; | ||
351 | else isopt = (char)(seqtt->flags & ASN1_TFLG_OPTIONAL); | ||
352 | /* attempt to read in field, allowing each to be OPTIONAL */ | ||
353 | ret = asn1_template_ex_d2i(pseqval, &p, len, seqtt, isopt, ctx); | ||
354 | if(!ret) { | ||
355 | errtt = seqtt; | ||
356 | goto err; | ||
357 | } else if(ret == -1) { | ||
358 | /* OPTIONAL component absent. Free and zero the field | ||
359 | */ | ||
360 | ASN1_template_free(pseqval, seqtt); | ||
361 | continue; | ||
362 | } | ||
363 | /* Update length */ | ||
364 | len -= p - q; | ||
365 | } | ||
366 | /* Check for EOC if expecting one */ | ||
367 | if(seq_eoc && !asn1_check_eoc(&p, len)) { | ||
368 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_MISSING_EOC); | ||
369 | goto err; | ||
370 | } | ||
371 | /* Check all data read */ | ||
372 | if(!seq_nolen && len) { | ||
373 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_SEQUENCE_LENGTH_MISMATCH); | ||
374 | goto err; | ||
375 | } | ||
376 | |||
377 | /* If we get here we've got no more data in the SEQUENCE, | ||
378 | * however we may not have read all fields so check all | ||
379 | * remaining are OPTIONAL and clear any that are. | ||
380 | */ | ||
381 | for(; i < it->tcount; tt++, i++) { | ||
382 | const ASN1_TEMPLATE *seqtt; | ||
383 | seqtt = asn1_do_adb(pval, tt, 1); | ||
384 | if(!seqtt) goto err; | ||
385 | if(seqtt->flags & ASN1_TFLG_OPTIONAL) { | ||
386 | ASN1_VALUE **pseqval; | ||
387 | pseqval = asn1_get_field_ptr(pval, seqtt); | ||
388 | ASN1_template_free(pseqval, seqtt); | ||
389 | } else { | ||
390 | errtt = seqtt; | ||
391 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_FIELD_MISSING); | ||
392 | goto err; | ||
393 | } | ||
394 | } | ||
395 | /* Save encoding */ | ||
396 | if(!asn1_enc_save(pval, *in, p - *in, it)) goto auxerr; | ||
397 | *in = p; | ||
398 | if(asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it)) | ||
399 | goto auxerr; | ||
400 | return 1; | ||
401 | |||
402 | default: | ||
403 | return 0; | ||
404 | } | ||
405 | auxerr: | ||
406 | ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR); | ||
407 | err: | ||
408 | ASN1_item_ex_free(pval, it); | ||
409 | if(errtt) ERR_add_error_data(4, "Field=", errtt->field_name, ", Type=", it->sname); | ||
410 | else ERR_add_error_data(2, "Type=", it->sname); | ||
411 | return 0; | ||
412 | } | ||
413 | |||
414 | /* Templates are handled with two separate functions. One handles any EXPLICIT tag and the other handles the | ||
415 | * rest. | ||
416 | */ | ||
417 | |||
418 | static int asn1_template_ex_d2i(ASN1_VALUE **val, unsigned char **in, long inlen, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx) | ||
419 | { | ||
420 | int flags, aclass; | ||
421 | int ret; | ||
422 | long len; | ||
423 | unsigned char *p, *q; | ||
424 | char exp_eoc; | ||
425 | if(!val) return 0; | ||
426 | flags = tt->flags; | ||
427 | aclass = flags & ASN1_TFLG_TAG_CLASS; | ||
428 | |||
429 | p = *in; | ||
430 | |||
431 | /* Check if EXPLICIT tag expected */ | ||
432 | if(flags & ASN1_TFLG_EXPTAG) { | ||
433 | char cst; | ||
434 | /* Need to work out amount of data available to the inner content and where it | ||
435 | * starts: so read in EXPLICIT header to get the info. | ||
436 | */ | ||
437 | ret = asn1_check_tlen(&len, NULL, NULL, &exp_eoc, &cst, &p, inlen, tt->tag, aclass, opt, ctx); | ||
438 | q = p; | ||
439 | if(!ret) { | ||
440 | ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
441 | return 0; | ||
442 | } else if(ret == -1) return -1; | ||
443 | if(!cst) { | ||
444 | ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED); | ||
445 | return 0; | ||
446 | } | ||
447 | /* We've found the field so it can't be OPTIONAL now */ | ||
448 | ret = asn1_template_noexp_d2i(val, &p, len, tt, 0, ctx); | ||
449 | if(!ret) { | ||
450 | ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
451 | return 0; | ||
452 | } | ||
453 | /* We read the field in OK so update length */ | ||
454 | len -= p - q; | ||
455 | if(exp_eoc) { | ||
456 | /* If NDEF we must have an EOC here */ | ||
457 | if(!asn1_check_eoc(&p, len)) { | ||
458 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ASN1_R_MISSING_EOC); | ||
459 | goto err; | ||
460 | } | ||
461 | } else { | ||
462 | /* Otherwise we must hit the EXPLICIT tag end or its an error */ | ||
463 | if(len) { | ||
464 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ASN1_R_EXPLICIT_LENGTH_MISMATCH); | ||
465 | goto err; | ||
466 | } | ||
467 | } | ||
468 | } else | ||
469 | return asn1_template_noexp_d2i(val, in, inlen, tt, opt, ctx); | ||
470 | |||
471 | *in = p; | ||
472 | return 1; | ||
473 | |||
474 | err: | ||
475 | ASN1_template_free(val, tt); | ||
476 | *val = NULL; | ||
477 | return 0; | ||
478 | } | ||
479 | |||
480 | static int asn1_template_noexp_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_TEMPLATE *tt, char opt, ASN1_TLC *ctx) | ||
481 | { | ||
482 | int flags, aclass; | ||
483 | int ret; | ||
484 | unsigned char *p, *q; | ||
485 | if(!val) return 0; | ||
486 | flags = tt->flags; | ||
487 | aclass = flags & ASN1_TFLG_TAG_CLASS; | ||
488 | |||
489 | p = *in; | ||
490 | q = p; | ||
491 | |||
492 | if(flags & ASN1_TFLG_SK_MASK) { | ||
493 | /* SET OF, SEQUENCE OF */ | ||
494 | int sktag, skaclass; | ||
495 | char sk_eoc; | ||
496 | /* First work out expected inner tag value */ | ||
497 | if(flags & ASN1_TFLG_IMPTAG) { | ||
498 | sktag = tt->tag; | ||
499 | skaclass = aclass; | ||
500 | } else { | ||
501 | skaclass = V_ASN1_UNIVERSAL; | ||
502 | if(flags & ASN1_TFLG_SET_OF) sktag = V_ASN1_SET; | ||
503 | else sktag = V_ASN1_SEQUENCE; | ||
504 | } | ||
505 | /* Get the tag */ | ||
506 | ret = asn1_check_tlen(&len, NULL, NULL, &sk_eoc, NULL, &p, len, sktag, skaclass, opt, ctx); | ||
507 | if(!ret) { | ||
508 | ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
509 | return 0; | ||
510 | } else if(ret == -1) return -1; | ||
511 | if(!*val) *val = (ASN1_VALUE *)sk_new_null(); | ||
512 | else { | ||
513 | /* We've got a valid STACK: free up any items present */ | ||
514 | STACK *sktmp = (STACK *)*val; | ||
515 | ASN1_VALUE *vtmp; | ||
516 | while(sk_num(sktmp) > 0) { | ||
517 | vtmp = (ASN1_VALUE *)sk_pop(sktmp); | ||
518 | ASN1_item_ex_free(&vtmp, ASN1_ITEM_ptr(tt->item)); | ||
519 | } | ||
520 | } | ||
521 | |||
522 | if(!*val) { | ||
523 | ASN1err(ASN1_F_ASN1_TEMPLATE_EX_D2I, ERR_R_MALLOC_FAILURE); | ||
524 | goto err; | ||
525 | } | ||
526 | /* Read as many items as we can */ | ||
527 | while(len > 0) { | ||
528 | ASN1_VALUE *skfield; | ||
529 | q = p; | ||
530 | /* See if EOC found */ | ||
531 | if(asn1_check_eoc(&p, len)) { | ||
532 | if(!sk_eoc) { | ||
533 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ASN1_R_UNEXPECTED_EOC); | ||
534 | goto err; | ||
535 | } | ||
536 | len -= p - q; | ||
537 | sk_eoc = 0; | ||
538 | break; | ||
539 | } | ||
540 | skfield = NULL; | ||
541 | if(!ASN1_item_ex_d2i(&skfield, &p, len, ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx)) { | ||
542 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
543 | goto err; | ||
544 | } | ||
545 | len -= p - q; | ||
546 | if(!sk_push((STACK *)*val, (char *)skfield)) { | ||
547 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ERR_R_MALLOC_FAILURE); | ||
548 | goto err; | ||
549 | } | ||
550 | } | ||
551 | if(sk_eoc) { | ||
552 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ASN1_R_MISSING_EOC); | ||
553 | goto err; | ||
554 | } | ||
555 | } else if(flags & ASN1_TFLG_IMPTAG) { | ||
556 | /* IMPLICIT tagging */ | ||
557 | ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt, ctx); | ||
558 | if(!ret) { | ||
559 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
560 | goto err; | ||
561 | } else if(ret == -1) return -1; | ||
562 | } else { | ||
563 | /* Nothing special */ | ||
564 | ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), -1, 0, opt, ctx); | ||
565 | if(!ret) { | ||
566 | ASN1err(ASN1_F_ASN1_TEMPLATE_D2I, ERR_R_NESTED_ASN1_ERROR); | ||
567 | goto err; | ||
568 | } else if(ret == -1) return -1; | ||
569 | } | ||
570 | |||
571 | *in = p; | ||
572 | return 1; | ||
573 | |||
574 | err: | ||
575 | ASN1_template_free(val, tt); | ||
576 | *val = NULL; | ||
577 | return 0; | ||
578 | } | ||
579 | |||
580 | static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, unsigned char **in, long inlen, | ||
581 | const ASN1_ITEM *it, | ||
582 | int tag, int aclass, char opt, ASN1_TLC *ctx) | ||
583 | { | ||
584 | int ret = 0, utype; | ||
585 | long plen; | ||
586 | char cst, inf, free_cont = 0; | ||
587 | unsigned char *p; | ||
588 | BUF_MEM buf; | ||
589 | unsigned char *cont = NULL; | ||
590 | long len; | ||
591 | if(!pval) { | ||
592 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_NULL); | ||
593 | return 0; /* Should never happen */ | ||
594 | } | ||
595 | |||
596 | if(it->itype == ASN1_ITYPE_MSTRING) { | ||
597 | utype = tag; | ||
598 | tag = -1; | ||
599 | } else utype = it->utype; | ||
600 | |||
601 | if(utype == V_ASN1_ANY) { | ||
602 | /* If type is ANY need to figure out type from tag */ | ||
603 | unsigned char oclass; | ||
604 | if(tag >= 0) { | ||
605 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_TAGGED_ANY); | ||
606 | return 0; | ||
607 | } | ||
608 | if(opt) { | ||
609 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_ILLEGAL_OPTIONAL_ANY); | ||
610 | return 0; | ||
611 | } | ||
612 | p = *in; | ||
613 | ret = asn1_check_tlen(NULL, &utype, &oclass, NULL, NULL, &p, inlen, -1, 0, 0, ctx); | ||
614 | if(!ret) { | ||
615 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_NESTED_ASN1_ERROR); | ||
616 | return 0; | ||
617 | } | ||
618 | if(oclass != V_ASN1_UNIVERSAL) utype = V_ASN1_OTHER; | ||
619 | } | ||
620 | if(tag == -1) { | ||
621 | tag = utype; | ||
622 | aclass = V_ASN1_UNIVERSAL; | ||
623 | } | ||
624 | p = *in; | ||
625 | /* Check header */ | ||
626 | ret = asn1_check_tlen(&plen, NULL, NULL, &inf, &cst, &p, inlen, tag, aclass, opt, ctx); | ||
627 | if(!ret) { | ||
628 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_NESTED_ASN1_ERROR); | ||
629 | return 0; | ||
630 | } else if(ret == -1) return -1; | ||
631 | /* SEQUENCE, SET and "OTHER" are left in encoded form */ | ||
632 | if((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || (utype == V_ASN1_OTHER)) { | ||
633 | /* Clear context cache for type OTHER because the auto clear when | ||
634 | * we have a exact match wont work | ||
635 | */ | ||
636 | if(utype == V_ASN1_OTHER) { | ||
637 | asn1_tlc_clear(ctx); | ||
638 | /* SEQUENCE and SET must be constructed */ | ||
639 | } else if(!cst) { | ||
640 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_TYPE_NOT_CONSTRUCTED); | ||
641 | return 0; | ||
642 | } | ||
643 | |||
644 | cont = *in; | ||
645 | /* If indefinite length constructed find the real end */ | ||
646 | if(inf) { | ||
647 | if(!asn1_collect(NULL, &p, plen, inf, -1, -1)) goto err; | ||
648 | len = p - cont; | ||
649 | } else { | ||
650 | len = p - cont + plen; | ||
651 | p += plen; | ||
652 | buf.data = NULL; | ||
653 | } | ||
654 | } else if(cst) { | ||
655 | buf.length = 0; | ||
656 | buf.max = 0; | ||
657 | buf.data = NULL; | ||
658 | /* Should really check the internal tags are correct but | ||
659 | * some things may get this wrong. The relevant specs | ||
660 | * say that constructed string types should be OCTET STRINGs | ||
661 | * internally irrespective of the type. So instead just check | ||
662 | * for UNIVERSAL class and ignore the tag. | ||
663 | */ | ||
664 | if(!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL)) goto err; | ||
665 | len = buf.length; | ||
666 | /* Append a final null to string */ | ||
667 | if(!BUF_MEM_grow(&buf, len + 1)) { | ||
668 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_MALLOC_FAILURE); | ||
669 | return 0; | ||
670 | } | ||
671 | buf.data[len] = 0; | ||
672 | cont = (unsigned char *)buf.data; | ||
673 | free_cont = 1; | ||
674 | } else { | ||
675 | cont = p; | ||
676 | len = plen; | ||
677 | p += plen; | ||
678 | } | ||
679 | |||
680 | /* We now have content length and type: translate into a structure */ | ||
681 | if(!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)) goto err; | ||
682 | |||
683 | *in = p; | ||
684 | ret = 1; | ||
685 | err: | ||
686 | if(free_cont && buf.data) OPENSSL_free(buf.data); | ||
687 | return ret; | ||
688 | } | ||
689 | |||
690 | /* Translate ASN1 content octets into a structure */ | ||
691 | |||
692 | int asn1_ex_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) | ||
693 | { | ||
694 | ASN1_STRING *stmp; | ||
695 | ASN1_TYPE *typ = NULL; | ||
696 | int ret = 0; | ||
697 | const ASN1_PRIMITIVE_FUNCS *pf; | ||
698 | ASN1_INTEGER **tint; | ||
699 | pf = it->funcs; | ||
700 | if(pf && pf->prim_c2i) return pf->prim_c2i(pval, cont, len, utype, free_cont, it); | ||
701 | /* If ANY type clear type and set pointer to internal value */ | ||
702 | if(it->utype == V_ASN1_ANY) { | ||
703 | if(!*pval) { | ||
704 | typ = ASN1_TYPE_new(); | ||
705 | *pval = (ASN1_VALUE *)typ; | ||
706 | } else typ = (ASN1_TYPE *)*pval; | ||
707 | if(utype != typ->type) ASN1_TYPE_set(typ, utype, NULL); | ||
708 | pval = (ASN1_VALUE **)&typ->value.ptr; | ||
709 | } | ||
710 | switch(utype) { | ||
711 | case V_ASN1_OBJECT: | ||
712 | if(!c2i_ASN1_OBJECT((ASN1_OBJECT **)pval, &cont, len)) goto err; | ||
713 | break; | ||
714 | |||
715 | case V_ASN1_NULL: | ||
716 | if(len) { | ||
717 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_NULL_IS_WRONG_LENGTH); | ||
718 | goto err; | ||
719 | } | ||
720 | *pval = (ASN1_VALUE *)1; | ||
721 | break; | ||
722 | |||
723 | case V_ASN1_BOOLEAN: | ||
724 | if(len != 1) { | ||
725 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_BOOLEAN_IS_WRONG_LENGTH); | ||
726 | goto err; | ||
727 | } else { | ||
728 | ASN1_BOOLEAN *tbool; | ||
729 | tbool = (ASN1_BOOLEAN *)pval; | ||
730 | *tbool = *cont; | ||
731 | } | ||
732 | break; | ||
733 | |||
734 | case V_ASN1_BIT_STRING: | ||
735 | if(!c2i_ASN1_BIT_STRING((ASN1_BIT_STRING **)pval, &cont, len)) goto err; | ||
736 | break; | ||
737 | |||
738 | case V_ASN1_INTEGER: | ||
739 | case V_ASN1_NEG_INTEGER: | ||
740 | case V_ASN1_ENUMERATED: | ||
741 | case V_ASN1_NEG_ENUMERATED: | ||
742 | tint = (ASN1_INTEGER **)pval; | ||
743 | if(!c2i_ASN1_INTEGER(tint, &cont, len)) goto err; | ||
744 | /* Fixup type to match the expected form */ | ||
745 | (*tint)->type = utype | ((*tint)->type & V_ASN1_NEG); | ||
746 | break; | ||
747 | |||
748 | case V_ASN1_OCTET_STRING: | ||
749 | case V_ASN1_NUMERICSTRING: | ||
750 | case V_ASN1_PRINTABLESTRING: | ||
751 | case V_ASN1_T61STRING: | ||
752 | case V_ASN1_VIDEOTEXSTRING: | ||
753 | case V_ASN1_IA5STRING: | ||
754 | case V_ASN1_UTCTIME: | ||
755 | case V_ASN1_GENERALIZEDTIME: | ||
756 | case V_ASN1_GRAPHICSTRING: | ||
757 | case V_ASN1_VISIBLESTRING: | ||
758 | case V_ASN1_GENERALSTRING: | ||
759 | case V_ASN1_UNIVERSALSTRING: | ||
760 | case V_ASN1_BMPSTRING: | ||
761 | case V_ASN1_UTF8STRING: | ||
762 | case V_ASN1_OTHER: | ||
763 | case V_ASN1_SET: | ||
764 | case V_ASN1_SEQUENCE: | ||
765 | default: | ||
766 | /* All based on ASN1_STRING and handled the same */ | ||
767 | if(!*pval) { | ||
768 | stmp = ASN1_STRING_type_new(utype); | ||
769 | if(!stmp) { | ||
770 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_MALLOC_FAILURE); | ||
771 | goto err; | ||
772 | } | ||
773 | *pval = (ASN1_VALUE *)stmp; | ||
774 | } else { | ||
775 | stmp = (ASN1_STRING *)*pval; | ||
776 | stmp->type = utype; | ||
777 | } | ||
778 | /* If we've already allocated a buffer use it */ | ||
779 | if(*free_cont) { | ||
780 | if(stmp->data) OPENSSL_free(stmp->data); | ||
781 | stmp->data = cont; | ||
782 | stmp->length = len; | ||
783 | *free_cont = 0; | ||
784 | } else { | ||
785 | if(!ASN1_STRING_set(stmp, cont, len)) { | ||
786 | ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_MALLOC_FAILURE); | ||
787 | ASN1_STRING_free(stmp); | ||
788 | *pval = NULL; | ||
789 | goto err; | ||
790 | } | ||
791 | } | ||
792 | break; | ||
793 | } | ||
794 | /* If ASN1_ANY and NULL type fix up value */ | ||
795 | if(typ && utype==V_ASN1_NULL) typ->value.ptr = NULL; | ||
796 | |||
797 | ret = 1; | ||
798 | err: | ||
799 | if(!ret) ASN1_TYPE_free(typ); | ||
800 | return ret; | ||
801 | } | ||
802 | |||
803 | /* This function collects the asn1 data from a constructred string | ||
804 | * type into a buffer. The values of 'in' and 'len' should refer | ||
805 | * to the contents of the constructed type and 'inf' should be set | ||
806 | * if it is indefinite length. If 'buf' is NULL then we just want | ||
807 | * to find the end of the current structure: useful for indefinite | ||
808 | * length constructed stuff. | ||
809 | */ | ||
810 | |||
811 | static int asn1_collect(BUF_MEM *buf, unsigned char **in, long len, char inf, int tag, int aclass) | ||
812 | { | ||
813 | unsigned char *p, *q; | ||
814 | long plen; | ||
815 | char cst, ininf; | ||
816 | p = *in; | ||
817 | inf &= 1; | ||
818 | /* If no buffer and not indefinite length constructed just pass over the encoded data */ | ||
819 | if(!buf && !inf) { | ||
820 | *in += len; | ||
821 | return 1; | ||
822 | } | ||
823 | while(len > 0) { | ||
824 | q = p; | ||
825 | /* Check for EOC */ | ||
826 | if(asn1_check_eoc(&p, len)) { | ||
827 | /* EOC is illegal outside indefinite length constructed form */ | ||
828 | if(!inf) { | ||
829 | ASN1err(ASN1_F_ASN1_COLLECT, ASN1_R_UNEXPECTED_EOC); | ||
830 | return 0; | ||
831 | } | ||
832 | inf = 0; | ||
833 | break; | ||
834 | } | ||
835 | if(!asn1_check_tlen(&plen, NULL, NULL, &ininf, &cst, &p, len, tag, aclass, 0, NULL)) { | ||
836 | ASN1err(ASN1_F_ASN1_COLLECT, ERR_R_NESTED_ASN1_ERROR); | ||
837 | return 0; | ||
838 | } | ||
839 | /* If indefinite length constructed update max length */ | ||
840 | if(cst) { | ||
841 | if(!asn1_collect(buf, &p, plen, ininf, tag, aclass)) return 0; | ||
842 | } else { | ||
843 | if(!collect_data(buf, &p, plen)) return 0; | ||
844 | } | ||
845 | len -= p - q; | ||
846 | } | ||
847 | if(inf) { | ||
848 | ASN1err(ASN1_F_ASN1_COLLECT, ASN1_R_MISSING_EOC); | ||
849 | return 0; | ||
850 | } | ||
851 | *in = p; | ||
852 | return 1; | ||
853 | } | ||
854 | |||
855 | static int collect_data(BUF_MEM *buf, unsigned char **p, long plen) | ||
856 | { | ||
857 | int len; | ||
858 | if(buf) { | ||
859 | len = buf->length; | ||
860 | if(!BUF_MEM_grow(buf, len + plen)) { | ||
861 | ASN1err(ASN1_F_COLLECT_DATA, ERR_R_MALLOC_FAILURE); | ||
862 | return 0; | ||
863 | } | ||
864 | memcpy(buf->data + len, *p, plen); | ||
865 | } | ||
866 | *p += plen; | ||
867 | return 1; | ||
868 | } | ||
869 | |||
870 | /* Check for ASN1 EOC and swallow it if found */ | ||
871 | |||
872 | static int asn1_check_eoc(unsigned char **in, long len) | ||
873 | { | ||
874 | unsigned char *p; | ||
875 | if(len < 2) return 0; | ||
876 | p = *in; | ||
877 | if(!p[0] && !p[1]) { | ||
878 | *in += 2; | ||
879 | return 1; | ||
880 | } | ||
881 | return 0; | ||
882 | } | ||
883 | |||
884 | /* Check an ASN1 tag and length: a bit like ASN1_get_object | ||
885 | * but it sets the length for indefinite length constructed | ||
886 | * form, we don't know the exact length but we can set an | ||
887 | * upper bound to the amount of data available minus the | ||
888 | * header length just read. | ||
889 | */ | ||
890 | |||
891 | static int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, char *inf, char *cst, | ||
892 | unsigned char **in, long len, int exptag, int expclass, char opt, ASN1_TLC *ctx) | ||
893 | { | ||
894 | int i; | ||
895 | int ptag, pclass; | ||
896 | long plen; | ||
897 | unsigned char *p, *q; | ||
898 | p = *in; | ||
899 | q = p; | ||
900 | |||
901 | if(ctx && ctx->valid) { | ||
902 | i = ctx->ret; | ||
903 | plen = ctx->plen; | ||
904 | pclass = ctx->pclass; | ||
905 | ptag = ctx->ptag; | ||
906 | p += ctx->hdrlen; | ||
907 | } else { | ||
908 | i = ASN1_get_object(&p, &plen, &ptag, &pclass, len); | ||
909 | if(ctx) { | ||
910 | ctx->ret = i; | ||
911 | ctx->plen = plen; | ||
912 | ctx->pclass = pclass; | ||
913 | ctx->ptag = ptag; | ||
914 | ctx->hdrlen = p - q; | ||
915 | ctx->valid = 1; | ||
916 | /* If definite length, length + header can't exceed total | ||
917 | * amount of data available. | ||
918 | */ | ||
919 | if(!(i & 1) && ((plen + ctx->hdrlen) > len)) { | ||
920 | ASN1err(ASN1_F_ASN1_CHECK_TLEN, ASN1_R_TOO_LONG); | ||
921 | asn1_tlc_clear(ctx); | ||
922 | return 0; | ||
923 | } | ||
924 | } | ||
925 | } | ||
926 | |||
927 | if(i & 0x80) { | ||
928 | ASN1err(ASN1_F_ASN1_CHECK_TLEN, ASN1_R_BAD_OBJECT_HEADER); | ||
929 | asn1_tlc_clear(ctx); | ||
930 | return 0; | ||
931 | } | ||
932 | if(exptag >= 0) { | ||
933 | if((exptag != ptag) || (expclass != pclass)) { | ||
934 | /* If type is OPTIONAL, not an error, but indicate missing | ||
935 | * type. | ||
936 | */ | ||
937 | if(opt) return -1; | ||
938 | asn1_tlc_clear(ctx); | ||
939 | ASN1err(ASN1_F_ASN1_CHECK_TLEN, ASN1_R_WRONG_TAG); | ||
940 | return 0; | ||
941 | } | ||
942 | /* We have a tag and class match, so assume we are going to do something with it */ | ||
943 | asn1_tlc_clear(ctx); | ||
944 | } | ||
945 | |||
946 | if(i & 1) plen = len - (p - q); | ||
947 | |||
948 | if(inf) *inf = i & 1; | ||
949 | |||
950 | if(cst) *cst = i & V_ASN1_CONSTRUCTED; | ||
951 | |||
952 | if(olen) *olen = plen; | ||
953 | if(oclass) *oclass = pclass; | ||
954 | if(otag) *otag = ptag; | ||
955 | |||
956 | *in = p; | ||
957 | return 1; | ||
958 | } | ||
diff --git a/src/lib/libcrypto/asn1/tasn_enc.c b/src/lib/libcrypto/asn1/tasn_enc.c new file mode 100644 index 0000000000..f6c8ddef0a --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_enc.c | |||
@@ -0,0 +1,497 @@ | |||
1 | /* tasn_enc.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stddef.h> | ||
61 | #include <string.h> | ||
62 | #include <openssl/asn1.h> | ||
63 | #include <openssl/asn1t.h> | ||
64 | #include <openssl/objects.h> | ||
65 | |||
66 | static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); | ||
67 | static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *seq, unsigned char **out, int skcontlen, const ASN1_ITEM *item, int isset); | ||
68 | |||
69 | /* Encode an ASN1 item, this is compatible with the | ||
70 | * standard 'i2d' function. 'out' points to | ||
71 | * a buffer to output the data to, in future we will | ||
72 | * have more advanced versions that can output data | ||
73 | * a piece at a time and this will simply be a special | ||
74 | * case. | ||
75 | * | ||
76 | * The new i2d has one additional feature. If the output | ||
77 | * buffer is NULL (i.e. *out == NULL) then a buffer is | ||
78 | * allocated and populated with the encoding. | ||
79 | */ | ||
80 | |||
81 | |||
82 | int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it) | ||
83 | { | ||
84 | if(out && !*out) { | ||
85 | unsigned char *p, *buf; | ||
86 | int len; | ||
87 | len = ASN1_item_ex_i2d(&val, NULL, it, -1, 0); | ||
88 | if(len <= 0) return len; | ||
89 | buf = OPENSSL_malloc(len); | ||
90 | if(!buf) return -1; | ||
91 | p = buf; | ||
92 | ASN1_item_ex_i2d(&val, &p, it, -1, 0); | ||
93 | *out = buf; | ||
94 | return len; | ||
95 | } | ||
96 | |||
97 | return ASN1_item_ex_i2d(&val, out, it, -1, 0); | ||
98 | } | ||
99 | |||
100 | /* Encode an item, taking care of IMPLICIT tagging (if any). | ||
101 | * This function performs the normal item handling: it can be | ||
102 | * used in external types. | ||
103 | */ | ||
104 | |||
105 | int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass) | ||
106 | { | ||
107 | const ASN1_TEMPLATE *tt = NULL; | ||
108 | unsigned char *p = NULL; | ||
109 | int i, seqcontlen, seqlen; | ||
110 | ASN1_STRING *strtmp; | ||
111 | const ASN1_COMPAT_FUNCS *cf; | ||
112 | const ASN1_EXTERN_FUNCS *ef; | ||
113 | const ASN1_AUX *aux = it->funcs; | ||
114 | ASN1_aux_cb *asn1_cb; | ||
115 | if((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) return 0; | ||
116 | if(aux && aux->asn1_cb) asn1_cb = aux->asn1_cb; | ||
117 | else asn1_cb = 0; | ||
118 | |||
119 | switch(it->itype) { | ||
120 | |||
121 | case ASN1_ITYPE_PRIMITIVE: | ||
122 | if(it->templates) | ||
123 | return ASN1_template_i2d(pval, out, it->templates); | ||
124 | return asn1_i2d_ex_primitive(pval, out, it, tag, aclass); | ||
125 | break; | ||
126 | |||
127 | case ASN1_ITYPE_MSTRING: | ||
128 | strtmp = (ASN1_STRING *)*pval; | ||
129 | return asn1_i2d_ex_primitive(pval, out, it, -1, 0); | ||
130 | |||
131 | case ASN1_ITYPE_CHOICE: | ||
132 | if(asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it)) | ||
133 | return 0; | ||
134 | i = asn1_get_choice_selector(pval, it); | ||
135 | if((i >= 0) && (i < it->tcount)) { | ||
136 | ASN1_VALUE **pchval; | ||
137 | const ASN1_TEMPLATE *chtt; | ||
138 | chtt = it->templates + i; | ||
139 | pchval = asn1_get_field_ptr(pval, chtt); | ||
140 | return ASN1_template_i2d(pchval, out, chtt); | ||
141 | } | ||
142 | /* Fixme: error condition if selector out of range */ | ||
143 | if(asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it)) | ||
144 | return 0; | ||
145 | break; | ||
146 | |||
147 | case ASN1_ITYPE_EXTERN: | ||
148 | /* If new style i2d it does all the work */ | ||
149 | ef = it->funcs; | ||
150 | return ef->asn1_ex_i2d(pval, out, it, tag, aclass); | ||
151 | |||
152 | case ASN1_ITYPE_COMPAT: | ||
153 | /* old style hackery... */ | ||
154 | cf = it->funcs; | ||
155 | if(out) p = *out; | ||
156 | i = cf->asn1_i2d(*pval, out); | ||
157 | /* Fixup for IMPLICIT tag: note this messes up for tags > 30, | ||
158 | * but so did the old code. Tags > 30 are very rare anyway. | ||
159 | */ | ||
160 | if(out && (tag != -1)) | ||
161 | *p = aclass | tag | (*p & V_ASN1_CONSTRUCTED); | ||
162 | return i; | ||
163 | |||
164 | case ASN1_ITYPE_SEQUENCE: | ||
165 | i = asn1_enc_restore(&seqcontlen, out, pval, it); | ||
166 | /* An error occurred */ | ||
167 | if(i < 0) return 0; | ||
168 | /* We have a valid cached encoding... */ | ||
169 | if(i > 0) return seqcontlen; | ||
170 | /* Otherwise carry on */ | ||
171 | seqcontlen = 0; | ||
172 | /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ | ||
173 | if(tag == -1) { | ||
174 | tag = V_ASN1_SEQUENCE; | ||
175 | aclass = V_ASN1_UNIVERSAL; | ||
176 | } | ||
177 | if(asn1_cb && !asn1_cb(ASN1_OP_I2D_PRE, pval, it)) | ||
178 | return 0; | ||
179 | /* First work out sequence content length */ | ||
180 | for(i = 0, tt = it->templates; i < it->tcount; tt++, i++) { | ||
181 | const ASN1_TEMPLATE *seqtt; | ||
182 | ASN1_VALUE **pseqval; | ||
183 | seqtt = asn1_do_adb(pval, tt, 1); | ||
184 | if(!seqtt) return 0; | ||
185 | pseqval = asn1_get_field_ptr(pval, seqtt); | ||
186 | /* FIXME: check for errors in enhanced version */ | ||
187 | /* FIXME: special handling of indefinite length encoding */ | ||
188 | seqcontlen += ASN1_template_i2d(pseqval, NULL, seqtt); | ||
189 | } | ||
190 | seqlen = ASN1_object_size(1, seqcontlen, tag); | ||
191 | if(!out) return seqlen; | ||
192 | /* Output SEQUENCE header */ | ||
193 | ASN1_put_object(out, 1, seqcontlen, tag, aclass); | ||
194 | for(i = 0, tt = it->templates; i < it->tcount; tt++, i++) { | ||
195 | const ASN1_TEMPLATE *seqtt; | ||
196 | ASN1_VALUE **pseqval; | ||
197 | seqtt = asn1_do_adb(pval, tt, 1); | ||
198 | if(!seqtt) return 0; | ||
199 | pseqval = asn1_get_field_ptr(pval, seqtt); | ||
200 | /* FIXME: check for errors in enhanced version */ | ||
201 | ASN1_template_i2d(pseqval, out, seqtt); | ||
202 | } | ||
203 | if(asn1_cb && !asn1_cb(ASN1_OP_I2D_POST, pval, it)) | ||
204 | return 0; | ||
205 | return seqlen; | ||
206 | |||
207 | default: | ||
208 | return 0; | ||
209 | } | ||
210 | return 0; | ||
211 | } | ||
212 | |||
213 | int ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_TEMPLATE *tt) | ||
214 | { | ||
215 | int i, ret, flags, aclass; | ||
216 | flags = tt->flags; | ||
217 | aclass = flags & ASN1_TFLG_TAG_CLASS; | ||
218 | if(flags & ASN1_TFLG_SK_MASK) { | ||
219 | /* SET OF, SEQUENCE OF */ | ||
220 | STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval; | ||
221 | int isset, sktag, skaclass; | ||
222 | int skcontlen, sklen; | ||
223 | ASN1_VALUE *skitem; | ||
224 | if(!*pval) return 0; | ||
225 | if(flags & ASN1_TFLG_SET_OF) { | ||
226 | isset = 1; | ||
227 | /* 2 means we reorder */ | ||
228 | if(flags & ASN1_TFLG_SEQUENCE_OF) isset = 2; | ||
229 | } else isset = 0; | ||
230 | /* First work out inner tag value */ | ||
231 | if(flags & ASN1_TFLG_IMPTAG) { | ||
232 | sktag = tt->tag; | ||
233 | skaclass = aclass; | ||
234 | } else { | ||
235 | skaclass = V_ASN1_UNIVERSAL; | ||
236 | if(isset) sktag = V_ASN1_SET; | ||
237 | else sktag = V_ASN1_SEQUENCE; | ||
238 | } | ||
239 | /* Now work out length of items */ | ||
240 | skcontlen = 0; | ||
241 | for(i = 0; i < sk_ASN1_VALUE_num(sk); i++) { | ||
242 | skitem = sk_ASN1_VALUE_value(sk, i); | ||
243 | skcontlen += ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item), -1, 0); | ||
244 | } | ||
245 | sklen = ASN1_object_size(1, skcontlen, sktag); | ||
246 | /* If EXPLICIT need length of surrounding tag */ | ||
247 | if(flags & ASN1_TFLG_EXPTAG) | ||
248 | ret = ASN1_object_size(1, sklen, tt->tag); | ||
249 | else ret = sklen; | ||
250 | |||
251 | if(!out) return ret; | ||
252 | |||
253 | /* Now encode this lot... */ | ||
254 | /* EXPLICIT tag */ | ||
255 | if(flags & ASN1_TFLG_EXPTAG) | ||
256 | ASN1_put_object(out, 1, sklen, tt->tag, aclass); | ||
257 | /* SET or SEQUENCE and IMPLICIT tag */ | ||
258 | ASN1_put_object(out, 1, skcontlen, sktag, skaclass); | ||
259 | /* And finally the stuff itself */ | ||
260 | asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item), isset); | ||
261 | |||
262 | return ret; | ||
263 | } | ||
264 | |||
265 | if(flags & ASN1_TFLG_EXPTAG) { | ||
266 | /* EXPLICIT tagging */ | ||
267 | /* Find length of tagged item */ | ||
268 | i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), -1, 0); | ||
269 | if(!i) return 0; | ||
270 | /* Find length of EXPLICIT tag */ | ||
271 | ret = ASN1_object_size(1, i, tt->tag); | ||
272 | if(out) { | ||
273 | /* Output tag and item */ | ||
274 | ASN1_put_object(out, 1, i, tt->tag, aclass); | ||
275 | ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, 0); | ||
276 | } | ||
277 | return ret; | ||
278 | } | ||
279 | if(flags & ASN1_TFLG_IMPTAG) { | ||
280 | /* IMPLICIT tagging */ | ||
281 | return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), tt->tag, aclass); | ||
282 | } | ||
283 | /* Nothing special: treat as normal */ | ||
284 | return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, 0); | ||
285 | } | ||
286 | |||
287 | /* Temporary structure used to hold DER encoding of items for SET OF */ | ||
288 | |||
289 | typedef struct { | ||
290 | unsigned char *data; | ||
291 | int length; | ||
292 | ASN1_VALUE *field; | ||
293 | } DER_ENC; | ||
294 | |||
295 | static int der_cmp(const void *a, const void *b) | ||
296 | { | ||
297 | const DER_ENC *d1 = a, *d2 = b; | ||
298 | int cmplen, i; | ||
299 | cmplen = (d1->length < d2->length) ? d1->length : d2->length; | ||
300 | i = memcmp(d1->data, d2->data, cmplen); | ||
301 | if(i) return i; | ||
302 | return d1->length - d2->length; | ||
303 | } | ||
304 | |||
305 | /* Output the content octets of SET OF or SEQUENCE OF */ | ||
306 | |||
307 | static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, int skcontlen, const ASN1_ITEM *item, int do_sort) | ||
308 | { | ||
309 | int i; | ||
310 | ASN1_VALUE *skitem; | ||
311 | unsigned char *tmpdat = NULL, *p = NULL; | ||
312 | DER_ENC *derlst = NULL, *tder; | ||
313 | if(do_sort) { | ||
314 | /* Don't need to sort less than 2 items */ | ||
315 | if(sk_ASN1_VALUE_num(sk) < 2) do_sort = 0; | ||
316 | else { | ||
317 | derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) * sizeof(*derlst)); | ||
318 | tmpdat = OPENSSL_malloc(skcontlen); | ||
319 | if(!derlst || !tmpdat) return 0; | ||
320 | } | ||
321 | } | ||
322 | /* If not sorting just output each item */ | ||
323 | if(!do_sort) { | ||
324 | for(i = 0; i < sk_ASN1_VALUE_num(sk); i++) { | ||
325 | skitem = sk_ASN1_VALUE_value(sk, i); | ||
326 | ASN1_item_i2d(skitem, out, item); | ||
327 | } | ||
328 | return 1; | ||
329 | } | ||
330 | p = tmpdat; | ||
331 | /* Doing sort: build up a list of each member's DER encoding */ | ||
332 | for(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) { | ||
333 | skitem = sk_ASN1_VALUE_value(sk, i); | ||
334 | tder->data = p; | ||
335 | tder->length = ASN1_item_i2d(skitem, &p, item); | ||
336 | tder->field = skitem; | ||
337 | } | ||
338 | /* Now sort them */ | ||
339 | qsort(derlst, sk_ASN1_VALUE_num(sk), sizeof(*derlst), der_cmp); | ||
340 | /* Output sorted DER encoding */ | ||
341 | p = *out; | ||
342 | for(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) { | ||
343 | memcpy(p, tder->data, tder->length); | ||
344 | p += tder->length; | ||
345 | } | ||
346 | *out = p; | ||
347 | /* If do_sort is 2 then reorder the STACK */ | ||
348 | if(do_sort == 2) { | ||
349 | for(i = 0, tder = derlst; i < sk_ASN1_VALUE_num(sk); i++, tder++) | ||
350 | sk_ASN1_VALUE_set(sk, i, tder->field); | ||
351 | } | ||
352 | OPENSSL_free(derlst); | ||
353 | OPENSSL_free(tmpdat); | ||
354 | return 1; | ||
355 | } | ||
356 | |||
357 | static int asn1_i2d_ex_primitive(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass) | ||
358 | { | ||
359 | int len; | ||
360 | int utype; | ||
361 | int usetag; | ||
362 | |||
363 | utype = it->utype; | ||
364 | |||
365 | /* Get length of content octets and maybe find | ||
366 | * out the underlying type. | ||
367 | */ | ||
368 | |||
369 | len = asn1_ex_i2c(pval, NULL, &utype, it); | ||
370 | |||
371 | /* If SEQUENCE, SET or OTHER then header is | ||
372 | * included in pseudo content octets so don't | ||
373 | * include tag+length. We need to check here | ||
374 | * because the call to asn1_ex_i2c() could change | ||
375 | * utype. | ||
376 | */ | ||
377 | if((utype == V_ASN1_SEQUENCE) || (utype == V_ASN1_SET) || | ||
378 | (utype == V_ASN1_OTHER)) | ||
379 | usetag = 0; | ||
380 | else usetag = 1; | ||
381 | |||
382 | /* -1 means omit type */ | ||
383 | |||
384 | if(len == -1) return 0; | ||
385 | |||
386 | /* If not implicitly tagged get tag from underlying type */ | ||
387 | if(tag == -1) tag = utype; | ||
388 | |||
389 | /* Output tag+length followed by content octets */ | ||
390 | if(out) { | ||
391 | if(usetag) ASN1_put_object(out, 0, len, tag, aclass); | ||
392 | asn1_ex_i2c(pval, *out, &utype, it); | ||
393 | *out += len; | ||
394 | } | ||
395 | |||
396 | if(usetag) return ASN1_object_size(0, len, tag); | ||
397 | return len; | ||
398 | } | ||
399 | |||
400 | /* Produce content octets from a structure */ | ||
401 | |||
402 | int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, const ASN1_ITEM *it) | ||
403 | { | ||
404 | ASN1_BOOLEAN *tbool = NULL; | ||
405 | ASN1_STRING *strtmp; | ||
406 | ASN1_OBJECT *otmp; | ||
407 | int utype; | ||
408 | unsigned char *cont, c; | ||
409 | int len; | ||
410 | const ASN1_PRIMITIVE_FUNCS *pf; | ||
411 | pf = it->funcs; | ||
412 | if(pf && pf->prim_i2c) return pf->prim_i2c(pval, cout, putype, it); | ||
413 | |||
414 | /* Should type be omitted? */ | ||
415 | if((it->itype != ASN1_ITYPE_PRIMITIVE) || (it->utype != V_ASN1_BOOLEAN)) { | ||
416 | if(!*pval) return -1; | ||
417 | } | ||
418 | |||
419 | if(it->itype == ASN1_ITYPE_MSTRING) { | ||
420 | /* If MSTRING type set the underlying type */ | ||
421 | strtmp = (ASN1_STRING *)*pval; | ||
422 | utype = strtmp->type; | ||
423 | *putype = utype; | ||
424 | } else if(it->utype == V_ASN1_ANY) { | ||
425 | /* If ANY set type and pointer to value */ | ||
426 | ASN1_TYPE *typ; | ||
427 | typ = (ASN1_TYPE *)*pval; | ||
428 | utype = typ->type; | ||
429 | *putype = utype; | ||
430 | pval = (ASN1_VALUE **)&typ->value.ptr; | ||
431 | } else utype = *putype; | ||
432 | |||
433 | switch(utype) { | ||
434 | case V_ASN1_OBJECT: | ||
435 | otmp = (ASN1_OBJECT *)*pval; | ||
436 | cont = otmp->data; | ||
437 | len = otmp->length; | ||
438 | break; | ||
439 | |||
440 | case V_ASN1_NULL: | ||
441 | cont = NULL; | ||
442 | len = 0; | ||
443 | break; | ||
444 | |||
445 | case V_ASN1_BOOLEAN: | ||
446 | tbool = (ASN1_BOOLEAN *)pval; | ||
447 | if(*tbool == -1) return -1; | ||
448 | /* Default handling if value == size field then omit */ | ||
449 | if(*tbool && (it->size > 0)) return -1; | ||
450 | if(!*tbool && !it->size) return -1; | ||
451 | c = (unsigned char)*tbool; | ||
452 | cont = &c; | ||
453 | len = 1; | ||
454 | break; | ||
455 | |||
456 | case V_ASN1_BIT_STRING: | ||
457 | return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval, cout ? &cout : NULL); | ||
458 | break; | ||
459 | |||
460 | case V_ASN1_INTEGER: | ||
461 | case V_ASN1_NEG_INTEGER: | ||
462 | case V_ASN1_ENUMERATED: | ||
463 | case V_ASN1_NEG_ENUMERATED: | ||
464 | /* These are all have the same content format | ||
465 | * as ASN1_INTEGER | ||
466 | */ | ||
467 | return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL); | ||
468 | break; | ||
469 | |||
470 | case V_ASN1_OCTET_STRING: | ||
471 | case V_ASN1_NUMERICSTRING: | ||
472 | case V_ASN1_PRINTABLESTRING: | ||
473 | case V_ASN1_T61STRING: | ||
474 | case V_ASN1_VIDEOTEXSTRING: | ||
475 | case V_ASN1_IA5STRING: | ||
476 | case V_ASN1_UTCTIME: | ||
477 | case V_ASN1_GENERALIZEDTIME: | ||
478 | case V_ASN1_GRAPHICSTRING: | ||
479 | case V_ASN1_VISIBLESTRING: | ||
480 | case V_ASN1_GENERALSTRING: | ||
481 | case V_ASN1_UNIVERSALSTRING: | ||
482 | case V_ASN1_BMPSTRING: | ||
483 | case V_ASN1_UTF8STRING: | ||
484 | case V_ASN1_SEQUENCE: | ||
485 | case V_ASN1_SET: | ||
486 | default: | ||
487 | /* All based on ASN1_STRING and handled the same */ | ||
488 | strtmp = (ASN1_STRING *)*pval; | ||
489 | cont = strtmp->data; | ||
490 | len = strtmp->length; | ||
491 | |||
492 | break; | ||
493 | |||
494 | } | ||
495 | if(cout && len) memcpy(cout, cont, len); | ||
496 | return len; | ||
497 | } | ||
diff --git a/src/lib/libcrypto/asn1/tasn_fre.c b/src/lib/libcrypto/asn1/tasn_fre.c new file mode 100644 index 0000000000..c7610776f2 --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_fre.c | |||
@@ -0,0 +1,226 @@ | |||
1 | /* tasn_fre.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stddef.h> | ||
61 | #include <openssl/asn1.h> | ||
62 | #include <openssl/asn1t.h> | ||
63 | #include <openssl/objects.h> | ||
64 | |||
65 | static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine); | ||
66 | |||
67 | /* Free up an ASN1 structure */ | ||
68 | |||
69 | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it) | ||
70 | { | ||
71 | asn1_item_combine_free(&val, it, 0); | ||
72 | } | ||
73 | |||
74 | void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
75 | { | ||
76 | asn1_item_combine_free(pval, it, 0); | ||
77 | } | ||
78 | |||
79 | static void asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | ||
80 | { | ||
81 | const ASN1_TEMPLATE *tt = NULL, *seqtt; | ||
82 | const ASN1_EXTERN_FUNCS *ef; | ||
83 | const ASN1_COMPAT_FUNCS *cf; | ||
84 | const ASN1_AUX *aux = it->funcs; | ||
85 | ASN1_aux_cb *asn1_cb; | ||
86 | int i; | ||
87 | if(!pval) return; | ||
88 | if((it->itype != ASN1_ITYPE_PRIMITIVE) && !*pval) return; | ||
89 | if(aux && aux->asn1_cb) asn1_cb = aux->asn1_cb; | ||
90 | else asn1_cb = 0; | ||
91 | |||
92 | switch(it->itype) { | ||
93 | |||
94 | case ASN1_ITYPE_PRIMITIVE: | ||
95 | if(it->templates) ASN1_template_free(pval, it->templates); | ||
96 | else ASN1_primitive_free(pval, it); | ||
97 | break; | ||
98 | |||
99 | case ASN1_ITYPE_MSTRING: | ||
100 | ASN1_primitive_free(pval, it); | ||
101 | break; | ||
102 | |||
103 | case ASN1_ITYPE_CHOICE: | ||
104 | if(asn1_cb) { | ||
105 | i = asn1_cb(ASN1_OP_FREE_PRE, pval, it); | ||
106 | if(i == 2) return; | ||
107 | } | ||
108 | i = asn1_get_choice_selector(pval, it); | ||
109 | if(asn1_cb) asn1_cb(ASN1_OP_FREE_PRE, pval, it); | ||
110 | if((i >= 0) && (i < it->tcount)) { | ||
111 | ASN1_VALUE **pchval; | ||
112 | tt = it->templates + i; | ||
113 | pchval = asn1_get_field_ptr(pval, tt); | ||
114 | ASN1_template_free(pchval, tt); | ||
115 | } | ||
116 | if(asn1_cb) asn1_cb(ASN1_OP_FREE_POST, pval, it); | ||
117 | if(!combine) { | ||
118 | OPENSSL_free(*pval); | ||
119 | *pval = NULL; | ||
120 | } | ||
121 | break; | ||
122 | |||
123 | case ASN1_ITYPE_COMPAT: | ||
124 | cf = it->funcs; | ||
125 | if(cf && cf->asn1_free) cf->asn1_free(*pval); | ||
126 | break; | ||
127 | |||
128 | case ASN1_ITYPE_EXTERN: | ||
129 | ef = it->funcs; | ||
130 | if(ef && ef->asn1_ex_free) ef->asn1_ex_free(pval, it); | ||
131 | break; | ||
132 | |||
133 | case ASN1_ITYPE_SEQUENCE: | ||
134 | if(asn1_do_lock(pval, -1, it) > 0) return; | ||
135 | if(asn1_cb) { | ||
136 | i = asn1_cb(ASN1_OP_FREE_PRE, pval, it); | ||
137 | if(i == 2) return; | ||
138 | } | ||
139 | asn1_enc_free(pval, it); | ||
140 | /* If we free up as normal we will invalidate any | ||
141 | * ANY DEFINED BY field and we wont be able to | ||
142 | * determine the type of the field it defines. So | ||
143 | * free up in reverse order. | ||
144 | */ | ||
145 | tt = it->templates + it->tcount - 1; | ||
146 | for(i = 0; i < it->tcount; tt--, i++) { | ||
147 | ASN1_VALUE **pseqval; | ||
148 | seqtt = asn1_do_adb(pval, tt, 0); | ||
149 | if(!seqtt) continue; | ||
150 | pseqval = asn1_get_field_ptr(pval, seqtt); | ||
151 | ASN1_template_free(pseqval, seqtt); | ||
152 | } | ||
153 | if(asn1_cb) asn1_cb(ASN1_OP_FREE_POST, pval, it); | ||
154 | if(!combine) { | ||
155 | OPENSSL_free(*pval); | ||
156 | *pval = NULL; | ||
157 | } | ||
158 | break; | ||
159 | } | ||
160 | } | ||
161 | |||
162 | void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | ||
163 | { | ||
164 | int i; | ||
165 | if(tt->flags & ASN1_TFLG_SK_MASK) { | ||
166 | STACK_OF(ASN1_VALUE) *sk = (STACK_OF(ASN1_VALUE) *)*pval; | ||
167 | for(i = 0; i < sk_ASN1_VALUE_num(sk); i++) { | ||
168 | ASN1_VALUE *vtmp; | ||
169 | vtmp = sk_ASN1_VALUE_value(sk, i); | ||
170 | asn1_item_combine_free(&vtmp, ASN1_ITEM_ptr(tt->item), 0); | ||
171 | } | ||
172 | sk_ASN1_VALUE_free(sk); | ||
173 | *pval = NULL; | ||
174 | } else asn1_item_combine_free(pval, ASN1_ITEM_ptr(tt->item), | ||
175 | tt->flags & ASN1_TFLG_COMBINE); | ||
176 | } | ||
177 | |||
178 | void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
179 | { | ||
180 | int utype; | ||
181 | if(it) { | ||
182 | const ASN1_PRIMITIVE_FUNCS *pf; | ||
183 | pf = it->funcs; | ||
184 | if(pf && pf->prim_free) { | ||
185 | pf->prim_free(pval, it); | ||
186 | return; | ||
187 | } | ||
188 | } | ||
189 | /* Special case: if 'it' is NULL free contents of ASN1_TYPE */ | ||
190 | if(!it) { | ||
191 | ASN1_TYPE *typ = (ASN1_TYPE *)*pval; | ||
192 | utype = typ->type; | ||
193 | pval = (ASN1_VALUE **)&typ->value.ptr; | ||
194 | if(!*pval) return; | ||
195 | } else if(it->itype == ASN1_ITYPE_MSTRING) { | ||
196 | utype = -1; | ||
197 | if(!*pval) return; | ||
198 | } else { | ||
199 | utype = it->utype; | ||
200 | if((utype != V_ASN1_BOOLEAN) && !*pval) return; | ||
201 | } | ||
202 | |||
203 | switch(utype) { | ||
204 | case V_ASN1_OBJECT: | ||
205 | ASN1_OBJECT_free((ASN1_OBJECT *)*pval); | ||
206 | break; | ||
207 | |||
208 | case V_ASN1_BOOLEAN: | ||
209 | *(ASN1_BOOLEAN *)pval = it->size; | ||
210 | return; | ||
211 | |||
212 | case V_ASN1_NULL: | ||
213 | break; | ||
214 | |||
215 | case V_ASN1_ANY: | ||
216 | ASN1_primitive_free(pval, NULL); | ||
217 | OPENSSL_free(*pval); | ||
218 | break; | ||
219 | |||
220 | default: | ||
221 | ASN1_STRING_free((ASN1_STRING *)*pval); | ||
222 | *pval = NULL; | ||
223 | break; | ||
224 | } | ||
225 | *pval = NULL; | ||
226 | } | ||
diff --git a/src/lib/libcrypto/asn1/tasn_new.c b/src/lib/libcrypto/asn1/tasn_new.c new file mode 100644 index 0000000000..e33861f864 --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_new.c | |||
@@ -0,0 +1,348 @@ | |||
1 | /* tasn_new.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stddef.h> | ||
61 | #include <openssl/asn1.h> | ||
62 | #include <openssl/objects.h> | ||
63 | #include <openssl/err.h> | ||
64 | #include <openssl/asn1t.h> | ||
65 | #include <string.h> | ||
66 | |||
67 | static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine); | ||
68 | static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
69 | static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); | ||
70 | void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
71 | |||
72 | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it) | ||
73 | { | ||
74 | ASN1_VALUE *ret = NULL; | ||
75 | if(ASN1_item_ex_new(&ret, it) > 0) return ret; | ||
76 | return NULL; | ||
77 | } | ||
78 | |||
79 | /* Allocate an ASN1 structure */ | ||
80 | |||
81 | int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
82 | { | ||
83 | return asn1_item_ex_combine_new(pval, it, 0); | ||
84 | } | ||
85 | |||
86 | static int asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine) | ||
87 | { | ||
88 | const ASN1_TEMPLATE *tt = NULL; | ||
89 | const ASN1_COMPAT_FUNCS *cf; | ||
90 | const ASN1_EXTERN_FUNCS *ef; | ||
91 | const ASN1_AUX *aux = it->funcs; | ||
92 | ASN1_aux_cb *asn1_cb; | ||
93 | ASN1_VALUE **pseqval; | ||
94 | int i; | ||
95 | if(aux && aux->asn1_cb) asn1_cb = aux->asn1_cb; | ||
96 | else asn1_cb = 0; | ||
97 | |||
98 | if(!combine) *pval = NULL; | ||
99 | |||
100 | #ifdef CRYPTO_MDEBUG | ||
101 | if(it->sname) CRYPTO_push_info(it->sname); | ||
102 | #endif | ||
103 | |||
104 | switch(it->itype) { | ||
105 | |||
106 | case ASN1_ITYPE_EXTERN: | ||
107 | ef = it->funcs; | ||
108 | if(ef && ef->asn1_ex_new) { | ||
109 | if(!ef->asn1_ex_new(pval, it)) | ||
110 | goto memerr; | ||
111 | } | ||
112 | break; | ||
113 | |||
114 | case ASN1_ITYPE_COMPAT: | ||
115 | cf = it->funcs; | ||
116 | if(cf && cf->asn1_new) { | ||
117 | *pval = cf->asn1_new(); | ||
118 | if(!*pval) goto memerr; | ||
119 | } | ||
120 | break; | ||
121 | |||
122 | case ASN1_ITYPE_PRIMITIVE: | ||
123 | if(it->templates) { | ||
124 | if(!ASN1_template_new(pval, it->templates)) | ||
125 | goto memerr; | ||
126 | } else { | ||
127 | if(!ASN1_primitive_new(pval, it)) | ||
128 | goto memerr; | ||
129 | } | ||
130 | break; | ||
131 | |||
132 | case ASN1_ITYPE_MSTRING: | ||
133 | if(!ASN1_primitive_new(pval, it)) | ||
134 | goto memerr; | ||
135 | break; | ||
136 | |||
137 | case ASN1_ITYPE_CHOICE: | ||
138 | if(asn1_cb) { | ||
139 | i = asn1_cb(ASN1_OP_NEW_PRE, pval, it); | ||
140 | if(!i) goto auxerr; | ||
141 | if(i==2) { | ||
142 | #ifdef CRYPTO_MDEBUG | ||
143 | if(it->sname) CRYPTO_pop_info(); | ||
144 | #endif | ||
145 | return 1; | ||
146 | } | ||
147 | } | ||
148 | if(!combine) { | ||
149 | *pval = OPENSSL_malloc(it->size); | ||
150 | if(!*pval) goto memerr; | ||
151 | memset(*pval, 0, it->size); | ||
152 | } | ||
153 | asn1_set_choice_selector(pval, -1, it); | ||
154 | if(asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it)) | ||
155 | goto auxerr; | ||
156 | break; | ||
157 | |||
158 | case ASN1_ITYPE_SEQUENCE: | ||
159 | if(asn1_cb) { | ||
160 | i = asn1_cb(ASN1_OP_NEW_PRE, pval, it); | ||
161 | if(!i) goto auxerr; | ||
162 | if(i==2) { | ||
163 | #ifdef CRYPTO_MDEBUG | ||
164 | if(it->sname) CRYPTO_pop_info(); | ||
165 | #endif | ||
166 | return 1; | ||
167 | } | ||
168 | } | ||
169 | if(!combine) { | ||
170 | *pval = OPENSSL_malloc(it->size); | ||
171 | if(!*pval) goto memerr; | ||
172 | memset(*pval, 0, it->size); | ||
173 | asn1_do_lock(pval, 0, it); | ||
174 | asn1_enc_init(pval, it); | ||
175 | } | ||
176 | for(i = 0, tt = it->templates; i < it->tcount; tt++, i++) { | ||
177 | pseqval = asn1_get_field_ptr(pval, tt); | ||
178 | if(!ASN1_template_new(pseqval, tt)) goto memerr; | ||
179 | } | ||
180 | if(asn1_cb && !asn1_cb(ASN1_OP_NEW_POST, pval, it)) | ||
181 | goto auxerr; | ||
182 | break; | ||
183 | } | ||
184 | #ifdef CRYPTO_MDEBUG | ||
185 | if(it->sname) CRYPTO_pop_info(); | ||
186 | #endif | ||
187 | return 1; | ||
188 | |||
189 | memerr: | ||
190 | ASN1err(ASN1_F_ASN1_ITEM_NEW, ERR_R_MALLOC_FAILURE); | ||
191 | #ifdef CRYPTO_MDEBUG | ||
192 | if(it->sname) CRYPTO_pop_info(); | ||
193 | #endif | ||
194 | return 0; | ||
195 | |||
196 | auxerr: | ||
197 | ASN1err(ASN1_F_ASN1_ITEM_NEW, ASN1_R_AUX_ERROR); | ||
198 | ASN1_item_ex_free(pval, it); | ||
199 | #ifdef CRYPTO_MDEBUG | ||
200 | if(it->sname) CRYPTO_pop_info(); | ||
201 | #endif | ||
202 | return 0; | ||
203 | |||
204 | } | ||
205 | |||
206 | static void asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
207 | { | ||
208 | const ASN1_EXTERN_FUNCS *ef; | ||
209 | |||
210 | switch(it->itype) { | ||
211 | |||
212 | case ASN1_ITYPE_EXTERN: | ||
213 | ef = it->funcs; | ||
214 | if(ef && ef->asn1_ex_clear) | ||
215 | ef->asn1_ex_clear(pval, it); | ||
216 | else *pval = NULL; | ||
217 | break; | ||
218 | |||
219 | |||
220 | case ASN1_ITYPE_PRIMITIVE: | ||
221 | if(it->templates) | ||
222 | asn1_template_clear(pval, it->templates); | ||
223 | else | ||
224 | asn1_primitive_clear(pval, it); | ||
225 | break; | ||
226 | |||
227 | case ASN1_ITYPE_MSTRING: | ||
228 | asn1_primitive_clear(pval, it); | ||
229 | break; | ||
230 | |||
231 | case ASN1_ITYPE_COMPAT: | ||
232 | case ASN1_ITYPE_CHOICE: | ||
233 | case ASN1_ITYPE_SEQUENCE: | ||
234 | *pval = NULL; | ||
235 | break; | ||
236 | } | ||
237 | } | ||
238 | |||
239 | |||
240 | int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | ||
241 | { | ||
242 | const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item); | ||
243 | int ret; | ||
244 | if(tt->flags & ASN1_TFLG_OPTIONAL) { | ||
245 | asn1_template_clear(pval, tt); | ||
246 | return 1; | ||
247 | } | ||
248 | /* If ANY DEFINED BY nothing to do */ | ||
249 | |||
250 | if(tt->flags & ASN1_TFLG_ADB_MASK) { | ||
251 | *pval = NULL; | ||
252 | return 1; | ||
253 | } | ||
254 | #ifdef CRYPTO_MDEBUG | ||
255 | if(tt->field_name) CRYPTO_push_info(tt->field_name); | ||
256 | #endif | ||
257 | /* If SET OF or SEQUENCE OF, its a STACK */ | ||
258 | if(tt->flags & ASN1_TFLG_SK_MASK) { | ||
259 | STACK_OF(ASN1_VALUE) *skval; | ||
260 | skval = sk_ASN1_VALUE_new_null(); | ||
261 | if(!skval) { | ||
262 | ASN1err(ASN1_F_ASN1_TEMPLATE_NEW, ERR_R_MALLOC_FAILURE); | ||
263 | ret = 0; | ||
264 | goto done; | ||
265 | } | ||
266 | *pval = (ASN1_VALUE *)skval; | ||
267 | ret = 1; | ||
268 | goto done; | ||
269 | } | ||
270 | /* Otherwise pass it back to the item routine */ | ||
271 | ret = asn1_item_ex_combine_new(pval, it, tt->flags & ASN1_TFLG_COMBINE); | ||
272 | done: | ||
273 | #ifdef CRYPTO_MDEBUG | ||
274 | if(it->sname) CRYPTO_pop_info(); | ||
275 | #endif | ||
276 | return ret; | ||
277 | } | ||
278 | |||
279 | static void asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | ||
280 | { | ||
281 | /* If ADB or STACK just NULL the field */ | ||
282 | if(tt->flags & (ASN1_TFLG_ADB_MASK|ASN1_TFLG_SK_MASK)) | ||
283 | *pval = NULL; | ||
284 | else | ||
285 | asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item)); | ||
286 | } | ||
287 | |||
288 | |||
289 | /* NB: could probably combine most of the real XXX_new() behaviour and junk all the old | ||
290 | * functions. | ||
291 | */ | ||
292 | |||
293 | int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
294 | { | ||
295 | ASN1_TYPE *typ; | ||
296 | int utype; | ||
297 | const ASN1_PRIMITIVE_FUNCS *pf; | ||
298 | pf = it->funcs; | ||
299 | if(pf && pf->prim_new) return pf->prim_new(pval, it); | ||
300 | if(!it || (it->itype == ASN1_ITYPE_MSTRING)) utype = -1; | ||
301 | else utype = it->utype; | ||
302 | switch(utype) { | ||
303 | case V_ASN1_OBJECT: | ||
304 | *pval = (ASN1_VALUE *)OBJ_nid2obj(NID_undef); | ||
305 | return 1; | ||
306 | |||
307 | case V_ASN1_BOOLEAN: | ||
308 | *(ASN1_BOOLEAN *)pval = it->size; | ||
309 | return 1; | ||
310 | |||
311 | case V_ASN1_NULL: | ||
312 | *pval = (ASN1_VALUE *)1; | ||
313 | return 1; | ||
314 | |||
315 | case V_ASN1_ANY: | ||
316 | typ = OPENSSL_malloc(sizeof(ASN1_TYPE)); | ||
317 | if(!typ) return 0; | ||
318 | typ->value.ptr = NULL; | ||
319 | typ->type = -1; | ||
320 | *pval = (ASN1_VALUE *)typ; | ||
321 | break; | ||
322 | |||
323 | default: | ||
324 | *pval = (ASN1_VALUE *)ASN1_STRING_type_new(utype); | ||
325 | break; | ||
326 | } | ||
327 | if(*pval) return 1; | ||
328 | return 0; | ||
329 | } | ||
330 | |||
331 | void asn1_primitive_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
332 | { | ||
333 | int utype; | ||
334 | const ASN1_PRIMITIVE_FUNCS *pf; | ||
335 | pf = it->funcs; | ||
336 | if(pf) { | ||
337 | if(pf->prim_clear) | ||
338 | pf->prim_clear(pval, it); | ||
339 | else | ||
340 | *pval = NULL; | ||
341 | return; | ||
342 | } | ||
343 | if(!it || (it->itype == ASN1_ITYPE_MSTRING)) utype = -1; | ||
344 | else utype = it->utype; | ||
345 | if(utype == V_ASN1_BOOLEAN) | ||
346 | *(ASN1_BOOLEAN *)pval = it->size; | ||
347 | else *pval = NULL; | ||
348 | } | ||
diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c new file mode 100644 index 0000000000..fab67ae5ac --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_prn.c | |||
@@ -0,0 +1,198 @@ | |||
1 | /* tasn_prn.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stddef.h> | ||
61 | #include <openssl/asn1.h> | ||
62 | #include <openssl/objects.h> | ||
63 | #include <openssl/buffer.h> | ||
64 | #include <openssl/err.h> | ||
65 | #include <openssl/nasn.h> | ||
66 | |||
67 | /* Print routines. Print out a whole structure from a template. | ||
68 | */ | ||
69 | |||
70 | static int asn1_item_print_nm(BIO *out, void *fld, int indent, const ASN1_ITEM *it, const char *name); | ||
71 | |||
72 | int ASN1_item_print(BIO *out, void *fld, int indent, const ASN1_ITEM *it) | ||
73 | { | ||
74 | return asn1_item_print_nm(out, fld, indent, it, it->sname); | ||
75 | } | ||
76 | |||
77 | static int asn1_item_print_nm(BIO *out, void *fld, int indent, const ASN1_ITEM *it, const char *name) | ||
78 | { | ||
79 | ASN1_STRING *str; | ||
80 | const ASN1_TEMPLATE *tt; | ||
81 | void *tmpfld; | ||
82 | int i; | ||
83 | if(!fld) { | ||
84 | BIO_printf(out, "%*s%s ABSENT\n", indent, "", name); | ||
85 | return 1; | ||
86 | } | ||
87 | switch(it->itype) { | ||
88 | |||
89 | case ASN1_ITYPE_PRIMITIVE: | ||
90 | if(it->templates) | ||
91 | return ASN1_template_print(out, fld, indent, it->templates); | ||
92 | return asn1_primitive_print(out, fld, it->utype, indent, name); | ||
93 | break; | ||
94 | |||
95 | case ASN1_ITYPE_MSTRING: | ||
96 | str = fld; | ||
97 | return asn1_primitive_print(out, fld, str->type, indent, name); | ||
98 | |||
99 | case ASN1_ITYPE_EXTERN: | ||
100 | BIO_printf(out, "%*s%s:EXTERNAL TYPE %s %s\n", indent, "", name, it->sname, fld ? "" : "ABSENT"); | ||
101 | return 1; | ||
102 | case ASN1_ITYPE_COMPAT: | ||
103 | BIO_printf(out, "%*s%s:COMPATIBLE TYPE %s %s\n", indent, "", name, it->sname, fld ? "" : "ABSENT"); | ||
104 | return 1; | ||
105 | |||
106 | |||
107 | case ASN1_ITYPE_CHOICE: | ||
108 | /* CHOICE type, get selector */ | ||
109 | i = asn1_get_choice_selector(fld, it); | ||
110 | /* This should never happen... */ | ||
111 | if((i < 0) || (i >= it->tcount)) { | ||
112 | BIO_printf(out, "%s selector [%d] out of range\n", it->sname, i); | ||
113 | return 1; | ||
114 | } | ||
115 | tt = it->templates + i; | ||
116 | tmpfld = asn1_get_field(fld, tt); | ||
117 | return ASN1_template_print(out, tmpfld, indent, tt); | ||
118 | |||
119 | case ASN1_ITYPE_SEQUENCE: | ||
120 | BIO_printf(out, "%*s%s {\n", indent, "", name); | ||
121 | /* Get each field entry */ | ||
122 | for(i = 0, tt = it->templates; i < it->tcount; i++, tt++) { | ||
123 | tmpfld = asn1_get_field(fld, tt); | ||
124 | ASN1_template_print(out, tmpfld, indent + 2, tt); | ||
125 | } | ||
126 | BIO_printf(out, "%*s}\n", indent, ""); | ||
127 | return 1; | ||
128 | |||
129 | default: | ||
130 | return 0; | ||
131 | } | ||
132 | } | ||
133 | |||
134 | int ASN1_template_print(BIO *out, void *fld, int indent, const ASN1_TEMPLATE *tt) | ||
135 | { | ||
136 | int i, flags; | ||
137 | #if 0 | ||
138 | if(!fld) return 0; | ||
139 | #endif | ||
140 | flags = tt->flags; | ||
141 | if(flags & ASN1_TFLG_SK_MASK) { | ||
142 | char *tname; | ||
143 | void *skitem; | ||
144 | /* SET OF, SEQUENCE OF */ | ||
145 | if(flags & ASN1_TFLG_SET_OF) tname = "SET"; | ||
146 | else tname = "SEQUENCE"; | ||
147 | if(fld) { | ||
148 | BIO_printf(out, "%*s%s OF %s {\n", indent, "", tname, tt->field_name); | ||
149 | for(i = 0; i < sk_num(fld); i++) { | ||
150 | skitem = sk_value(fld, i); | ||
151 | asn1_item_print_nm(out, skitem, indent + 2, tt->item, ""); | ||
152 | } | ||
153 | BIO_printf(out, "%*s}\n", indent, ""); | ||
154 | } else | ||
155 | BIO_printf(out, "%*s%s OF %s ABSENT\n", indent, "", tname, tt->field_name); | ||
156 | return 1; | ||
157 | } | ||
158 | return asn1_item_print_nm(out, fld, indent, tt->item, tt->field_name); | ||
159 | } | ||
160 | |||
161 | static int asn1_primitive_print(BIO *out, void *fld, long utype, int indent, const char *name) | ||
162 | { | ||
163 | ASN1_STRING *str = fld; | ||
164 | if(fld) { | ||
165 | if(utype == V_ASN1_BOOLEAN) { | ||
166 | int *bool = fld; | ||
167 | if(*bool == -1) printf("BOOL MISSING\n"); | ||
168 | BIO_printf(out, "%*s%s:%s", indent, "", "BOOLEAN", *bool ? "TRUE" : "FALSE"); | ||
169 | } else if((utype == V_ASN1_INTEGER) | ||
170 | || (utype == V_ASN1_ENUMERATED)) { | ||
171 | char *s, *nm; | ||
172 | s = i2s_ASN1_INTEGER(NULL, fld); | ||
173 | if(utype == V_ASN1_INTEGER) nm = "INTEGER"; | ||
174 | else nm = "ENUMERATED"; | ||
175 | BIO_printf(out, "%*s%s:%s", indent, "", nm, s); | ||
176 | OPENSSL_free(s); | ||
177 | } else if(utype == V_ASN1_NULL) { | ||
178 | BIO_printf(out, "%*s%s", indent, "", "NULL"); | ||
179 | } else if(utype == V_ASN1_UTCTIME) { | ||
180 | BIO_printf(out, "%*s%s:%s:", indent, "", name, "UTCTIME"); | ||
181 | ASN1_UTCTIME_print(out, str); | ||
182 | } else if(utype == V_ASN1_GENERALIZEDTIME) { | ||
183 | BIO_printf(out, "%*s%s:%s:", indent, "", name, "GENERALIZEDTIME"); | ||
184 | ASN1_GENERALIZEDTIME_print(out, str); | ||
185 | } else if(utype == V_ASN1_OBJECT) { | ||
186 | char objbuf[80], *ln; | ||
187 | ln = OBJ_nid2ln(OBJ_obj2nid(fld)); | ||
188 | if(!ln) ln = ""; | ||
189 | OBJ_obj2txt(objbuf, 80, fld, 1); | ||
190 | BIO_printf(out, "%*s%s:%s (%s)", indent, "", "OBJECT", ln, objbuf); | ||
191 | } else { | ||
192 | BIO_printf(out, "%*s%s:", indent, "", name); | ||
193 | ASN1_STRING_print_ex(out, str, ASN1_STRFLGS_DUMP_UNKNOWN|ASN1_STRFLGS_SHOW_TYPE); | ||
194 | } | ||
195 | BIO_printf(out, "\n"); | ||
196 | } else BIO_printf(out, "%*s%s [ABSENT]\n", indent, "", name); | ||
197 | return 1; | ||
198 | } | ||
diff --git a/src/lib/libcrypto/asn1/tasn_typ.c b/src/lib/libcrypto/asn1/tasn_typ.c new file mode 100644 index 0000000000..804d2eeba2 --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_typ.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* tasn_typ.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | #include <stdio.h> | ||
59 | #include <openssl/asn1.h> | ||
60 | #include <openssl/asn1t.h> | ||
61 | |||
62 | /* Declarations for string types */ | ||
63 | |||
64 | |||
65 | IMPLEMENT_ASN1_TYPE(ASN1_INTEGER) | ||
66 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_INTEGER) | ||
67 | |||
68 | IMPLEMENT_ASN1_TYPE(ASN1_ENUMERATED) | ||
69 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_ENUMERATED) | ||
70 | |||
71 | IMPLEMENT_ASN1_TYPE(ASN1_BIT_STRING) | ||
72 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_BIT_STRING) | ||
73 | |||
74 | IMPLEMENT_ASN1_TYPE(ASN1_OCTET_STRING) | ||
75 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_OCTET_STRING) | ||
76 | |||
77 | IMPLEMENT_ASN1_TYPE(ASN1_NULL) | ||
78 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_NULL) | ||
79 | |||
80 | IMPLEMENT_ASN1_TYPE(ASN1_OBJECT) | ||
81 | |||
82 | IMPLEMENT_ASN1_TYPE(ASN1_UTF8STRING) | ||
83 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_UTF8STRING) | ||
84 | |||
85 | IMPLEMENT_ASN1_TYPE(ASN1_PRINTABLESTRING) | ||
86 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) | ||
87 | |||
88 | IMPLEMENT_ASN1_TYPE(ASN1_T61STRING) | ||
89 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_T61STRING) | ||
90 | |||
91 | IMPLEMENT_ASN1_TYPE(ASN1_IA5STRING) | ||
92 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_IA5STRING) | ||
93 | |||
94 | IMPLEMENT_ASN1_TYPE(ASN1_GENERALSTRING) | ||
95 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_GENERALSTRING) | ||
96 | |||
97 | IMPLEMENT_ASN1_TYPE(ASN1_UTCTIME) | ||
98 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_UTCTIME) | ||
99 | |||
100 | IMPLEMENT_ASN1_TYPE(ASN1_GENERALIZEDTIME) | ||
101 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) | ||
102 | |||
103 | IMPLEMENT_ASN1_TYPE(ASN1_VISIBLESTRING) | ||
104 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) | ||
105 | |||
106 | IMPLEMENT_ASN1_TYPE(ASN1_UNIVERSALSTRING) | ||
107 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) | ||
108 | |||
109 | IMPLEMENT_ASN1_TYPE(ASN1_BMPSTRING) | ||
110 | IMPLEMENT_ASN1_FUNCTIONS(ASN1_BMPSTRING) | ||
111 | |||
112 | IMPLEMENT_ASN1_TYPE(ASN1_ANY) | ||
113 | |||
114 | /* Just swallow an ASN1_SEQUENCE in an ASN1_STRING */ | ||
115 | IMPLEMENT_ASN1_TYPE(ASN1_SEQUENCE) | ||
116 | |||
117 | IMPLEMENT_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) | ||
118 | |||
119 | /* Multistring types */ | ||
120 | |||
121 | IMPLEMENT_ASN1_MSTRING(ASN1_PRINTABLE, B_ASN1_PRINTABLE) | ||
122 | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) | ||
123 | |||
124 | IMPLEMENT_ASN1_MSTRING(DISPLAYTEXT, B_ASN1_DISPLAYTEXT) | ||
125 | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) | ||
126 | |||
127 | IMPLEMENT_ASN1_MSTRING(DIRECTORYSTRING, B_ASN1_DIRECTORYSTRING) | ||
128 | IMPLEMENT_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) | ||
129 | |||
130 | /* Three separate BOOLEAN type: normal, DEFAULT TRUE and DEFAULT FALSE */ | ||
131 | IMPLEMENT_ASN1_TYPE_ex(ASN1_BOOLEAN, ASN1_BOOLEAN, -1) | ||
132 | IMPLEMENT_ASN1_TYPE_ex(ASN1_TBOOLEAN, ASN1_BOOLEAN, 1) | ||
133 | IMPLEMENT_ASN1_TYPE_ex(ASN1_FBOOLEAN, ASN1_BOOLEAN, 0) | ||
diff --git a/src/lib/libcrypto/asn1/tasn_utl.c b/src/lib/libcrypto/asn1/tasn_utl.c new file mode 100644 index 0000000000..8996ce8c13 --- /dev/null +++ b/src/lib/libcrypto/asn1/tasn_utl.c | |||
@@ -0,0 +1,253 @@ | |||
1 | /* tasn_utl.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | |||
60 | #include <stddef.h> | ||
61 | #include <string.h> | ||
62 | #include <openssl/asn1.h> | ||
63 | #include <openssl/asn1t.h> | ||
64 | #include <openssl/objects.h> | ||
65 | #include <openssl/err.h> | ||
66 | |||
67 | /* Utility functions for manipulating fields and offsets */ | ||
68 | |||
69 | /* Add 'offset' to 'addr' */ | ||
70 | #define offset2ptr(addr, offset) (void *)(((char *) addr) + offset) | ||
71 | |||
72 | /* Given an ASN1_ITEM CHOICE type return | ||
73 | * the selector value | ||
74 | */ | ||
75 | |||
76 | int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
77 | { | ||
78 | int *sel = offset2ptr(*pval, it->utype); | ||
79 | return *sel; | ||
80 | } | ||
81 | |||
82 | /* Given an ASN1_ITEM CHOICE type set | ||
83 | * the selector value, return old value. | ||
84 | */ | ||
85 | |||
86 | int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it) | ||
87 | { | ||
88 | int *sel, ret; | ||
89 | sel = offset2ptr(*pval, it->utype); | ||
90 | ret = *sel; | ||
91 | *sel = value; | ||
92 | return ret; | ||
93 | } | ||
94 | |||
95 | /* Do reference counting. The value 'op' decides what to do. | ||
96 | * if it is +1 then the count is incremented. If op is 0 count is | ||
97 | * set to 1. If op is -1 count is decremented and the return value | ||
98 | * is the current refrence count or 0 if no reference count exists. | ||
99 | */ | ||
100 | |||
101 | int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) | ||
102 | { | ||
103 | const ASN1_AUX *aux; | ||
104 | int *lck, ret; | ||
105 | if(it->itype != ASN1_ITYPE_SEQUENCE) return 0; | ||
106 | aux = it->funcs; | ||
107 | if(!aux || !(aux->flags & ASN1_AFLG_REFCOUNT)) return 0; | ||
108 | lck = offset2ptr(*pval, aux->ref_offset); | ||
109 | if(op == 0) { | ||
110 | *lck = 1; | ||
111 | return 1; | ||
112 | } | ||
113 | ret = CRYPTO_add(lck, op, aux->ref_lock); | ||
114 | #ifdef REF_PRINT | ||
115 | fprintf(stderr, "%s: Reference Count: %d\n", it->sname, *lck); | ||
116 | #endif | ||
117 | #ifdef REF_CHECK | ||
118 | if(ret < 0) | ||
119 | fprintf(stderr, "%s, bad reference count\n", it->sname); | ||
120 | #endif | ||
121 | return ret; | ||
122 | } | ||
123 | |||
124 | static ASN1_ENCODING *asn1_get_enc_ptr(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
125 | { | ||
126 | const ASN1_AUX *aux; | ||
127 | if(!pval || !*pval) return NULL; | ||
128 | aux = it->funcs; | ||
129 | if(!aux || !(aux->flags & ASN1_AFLG_ENCODING)) return NULL; | ||
130 | return offset2ptr(*pval, aux->enc_offset); | ||
131 | } | ||
132 | |||
133 | void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
134 | { | ||
135 | ASN1_ENCODING *enc; | ||
136 | enc = asn1_get_enc_ptr(pval, it); | ||
137 | if(enc) { | ||
138 | enc->enc = NULL; | ||
139 | enc->len = 0; | ||
140 | enc->modified = 1; | ||
141 | } | ||
142 | } | ||
143 | |||
144 | void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
145 | { | ||
146 | ASN1_ENCODING *enc; | ||
147 | enc = asn1_get_enc_ptr(pval, it); | ||
148 | if(enc) { | ||
149 | if(enc->enc) OPENSSL_free(enc->enc); | ||
150 | enc->enc = NULL; | ||
151 | enc->len = 0; | ||
152 | enc->modified = 1; | ||
153 | } | ||
154 | } | ||
155 | |||
156 | int asn1_enc_save(ASN1_VALUE **pval, unsigned char *in, int inlen, const ASN1_ITEM *it) | ||
157 | { | ||
158 | ASN1_ENCODING *enc; | ||
159 | enc = asn1_get_enc_ptr(pval, it); | ||
160 | if(!enc) return 1; | ||
161 | |||
162 | if(enc->enc) OPENSSL_free(enc->enc); | ||
163 | enc->enc = OPENSSL_malloc(inlen); | ||
164 | if(!enc->enc) return 0; | ||
165 | memcpy(enc->enc, in, inlen); | ||
166 | enc->len = inlen; | ||
167 | enc->modified = 0; | ||
168 | |||
169 | return 1; | ||
170 | } | ||
171 | |||
172 | int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
173 | { | ||
174 | ASN1_ENCODING *enc; | ||
175 | enc = asn1_get_enc_ptr(pval, it); | ||
176 | if(!enc || enc->modified) return 0; | ||
177 | if(out) { | ||
178 | memcpy(*out, enc->enc, enc->len); | ||
179 | *out += enc->len; | ||
180 | } | ||
181 | if(len) *len = enc->len; | ||
182 | return 1; | ||
183 | } | ||
184 | |||
185 | /* Given an ASN1_TEMPLATE get a pointer to a field */ | ||
186 | ASN1_VALUE ** asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) | ||
187 | { | ||
188 | ASN1_VALUE **pvaltmp; | ||
189 | if(tt->flags & ASN1_TFLG_COMBINE) return pval; | ||
190 | pvaltmp = offset2ptr(*pval, tt->offset); | ||
191 | /* NOTE for BOOLEAN types the field is just a plain | ||
192 | * int so we can't return int **, so settle for | ||
193 | * (int *). | ||
194 | */ | ||
195 | return pvaltmp; | ||
196 | } | ||
197 | |||
198 | /* Handle ANY DEFINED BY template, find the selector, look up | ||
199 | * the relevant ASN1_TEMPLATE in the table and return it. | ||
200 | */ | ||
201 | |||
202 | const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr) | ||
203 | { | ||
204 | const ASN1_ADB *adb; | ||
205 | const ASN1_ADB_TABLE *atbl; | ||
206 | long selector; | ||
207 | ASN1_VALUE **sfld; | ||
208 | int i; | ||
209 | if(!(tt->flags & ASN1_TFLG_ADB_MASK)) return tt; | ||
210 | |||
211 | /* Else ANY DEFINED BY ... get the table */ | ||
212 | adb = ASN1_ADB_ptr(tt->item); | ||
213 | |||
214 | /* Get the selector field */ | ||
215 | sfld = offset2ptr(*pval, adb->offset); | ||
216 | |||
217 | /* Check if NULL */ | ||
218 | if(!sfld) { | ||
219 | if(!adb->null_tt) goto err; | ||
220 | return adb->null_tt; | ||
221 | } | ||
222 | |||
223 | /* Convert type to a long: | ||
224 | * NB: don't check for NID_undef here because it | ||
225 | * might be a legitimate value in the table | ||
226 | */ | ||
227 | if(tt->flags & ASN1_TFLG_ADB_OID) | ||
228 | selector = OBJ_obj2nid((ASN1_OBJECT *)*sfld); | ||
229 | else | ||
230 | selector = ASN1_INTEGER_get((ASN1_INTEGER *)*sfld); | ||
231 | |||
232 | /* Try to find matching entry in table | ||
233 | * Maybe should check application types first to | ||
234 | * allow application override? Might also be useful | ||
235 | * to have a flag which indicates table is sorted and | ||
236 | * we can do a binary search. For now stick to a | ||
237 | * linear search. | ||
238 | */ | ||
239 | |||
240 | for(atbl = adb->tbl, i = 0; i < adb->tblcount; i++, atbl++) | ||
241 | if(atbl->value == selector) return &atbl->tt; | ||
242 | |||
243 | /* FIXME: need to search application table too */ | ||
244 | |||
245 | /* No match, return default type */ | ||
246 | if(!adb->default_tt) goto err; | ||
247 | return adb->default_tt; | ||
248 | |||
249 | err: | ||
250 | /* FIXME: should log the value or OID of unsupported type */ | ||
251 | if(nullerr) ASN1err(ASN1_F_ASN1_DO_ADB, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE); | ||
252 | return NULL; | ||
253 | } | ||
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 853a8dfeef..00b9ea54a1 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c | |||
@@ -1,118 +1,73 @@ | |||
1 | /* crypto/asn1/x_algor.c */ | 1 | /* x_algor.c */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL |
3 | * All rights reserved. | 3 | * project 2000. |
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
4 | * | 7 | * |
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
25 | * are met: | 10 | * are met: |
26 | * 1. Redistributions of source code must retain the copyright | 11 | * |
27 | * notice, this list of conditions and the following disclaimer. | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
29 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in |
30 | * documentation and/or other materials provided with the distribution. | 17 | * the documentation and/or other materials provided with the |
31 | * 3. All advertising materials mentioning features or use of this software | 18 | * distribution. |
32 | * must display the following acknowledgement: | 19 | * |
33 | * "This product includes cryptographic software written by | 20 | * 3. All advertising materials mentioning features or use of this |
34 | * Eric Young (eay@cryptsoft.com)" | 21 | * software must display the following acknowledgment: |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 22 | * "This product includes software developed by the OpenSSL Project |
36 | * being used are not cryptographic related :-). | 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 24 | * |
38 | * the apps directory (application code) you must include an acknowledgement: | 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 26 | * endorse or promote products derived from this software without |
40 | * | 27 | * prior written permission. For written permission, please contact |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 28 | * licensing@OpenSSL.org. |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 29 | * |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 30 | * 5. Products derived from this software may not be called "OpenSSL" |
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 31 | * nor may "OpenSSL" appear in their names without prior written |
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 32 | * permission of the OpenSSL Project. |
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 33 | * |
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 34 | * 6. Redistributions of any form whatsoever must retain the following |
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 35 | * acknowledgment: |
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 36 | * "This product includes software developed by the OpenSSL Project |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" |
51 | * SUCH DAMAGE. | 38 | * |
52 | * | 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY |
53 | * The licence and distribution terms for any publically available version or | 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
55 | * copied and put under another distribution licence | 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR |
56 | * [including the GNU Public Licence.] | 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stddef.h> |
60 | #include "cryptlib.h" | ||
61 | #include <openssl/asn1_mac.h> | ||
62 | #include <openssl/x509.h> | 60 | #include <openssl/x509.h> |
61 | #include <openssl/asn1.h> | ||
62 | #include <openssl/asn1t.h> | ||
63 | 63 | ||
64 | int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **pp) | 64 | ASN1_SEQUENCE(X509_ALGOR) = { |
65 | { | 65 | ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT), |
66 | M_ASN1_I2D_vars(a); | 66 | ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY) |
67 | 67 | } ASN1_SEQUENCE_END(X509_ALGOR) | |
68 | M_ASN1_I2D_len(a->algorithm,i2d_ASN1_OBJECT); | ||
69 | if (a->parameter != NULL) | ||
70 | { M_ASN1_I2D_len(a->parameter,i2d_ASN1_TYPE); } | ||
71 | |||
72 | M_ASN1_I2D_seq_total(); | ||
73 | M_ASN1_I2D_put(a->algorithm,i2d_ASN1_OBJECT); | ||
74 | if (a->parameter != NULL) | ||
75 | { M_ASN1_I2D_put(a->parameter,i2d_ASN1_TYPE); } | ||
76 | |||
77 | M_ASN1_I2D_finish(); | ||
78 | } | ||
79 | |||
80 | X509_ALGOR *d2i_X509_ALGOR(X509_ALGOR **a, unsigned char **pp, long length) | ||
81 | { | ||
82 | M_ASN1_D2I_vars(a,X509_ALGOR *,X509_ALGOR_new); | ||
83 | |||
84 | M_ASN1_D2I_Init(); | ||
85 | M_ASN1_D2I_start_sequence(); | ||
86 | M_ASN1_D2I_get(ret->algorithm,d2i_ASN1_OBJECT); | ||
87 | if (!M_ASN1_D2I_end_sequence()) | ||
88 | { M_ASN1_D2I_get(ret->parameter,d2i_ASN1_TYPE); } | ||
89 | else | ||
90 | { | ||
91 | ASN1_TYPE_free(ret->parameter); | ||
92 | ret->parameter=NULL; | ||
93 | } | ||
94 | M_ASN1_D2I_Finish(a,X509_ALGOR_free,ASN1_F_D2I_X509_ALGOR); | ||
95 | } | ||
96 | |||
97 | X509_ALGOR *X509_ALGOR_new(void) | ||
98 | { | ||
99 | X509_ALGOR *ret=NULL; | ||
100 | ASN1_CTX c; | ||
101 | |||
102 | M_ASN1_New_Malloc(ret,X509_ALGOR); | ||
103 | ret->algorithm=OBJ_nid2obj(NID_undef); | ||
104 | ret->parameter=NULL; | ||
105 | return(ret); | ||
106 | M_ASN1_New_Error(ASN1_F_X509_ALGOR_NEW); | ||
107 | } | ||
108 | 68 | ||
109 | void X509_ALGOR_free(X509_ALGOR *a) | 69 | IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR) |
110 | { | 70 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR) |
111 | if (a == NULL) return; | ||
112 | ASN1_OBJECT_free(a->algorithm); | ||
113 | ASN1_TYPE_free(a->parameter); | ||
114 | OPENSSL_free(a); | ||
115 | } | ||
116 | 71 | ||
117 | IMPLEMENT_STACK_OF(X509_ALGOR) | 72 | IMPLEMENT_STACK_OF(X509_ALGOR) |
118 | IMPLEMENT_ASN1_SET_OF(X509_ALGOR) | 73 | IMPLEMENT_ASN1_SET_OF(X509_ALGOR) |
diff --git a/src/lib/libcrypto/asn1/x_attrib.c b/src/lib/libcrypto/asn1/x_attrib.c index 14e5ea27aa..1e3713f18f 100644 --- a/src/lib/libcrypto/asn1/x_attrib.c +++ b/src/lib/libcrypto/asn1/x_attrib.c | |||
@@ -59,64 +59,42 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/objects.h> | 61 | #include <openssl/objects.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1t.h> |
63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | /* sequence */ | 65 | /* X509_ATTRIBUTE: this has the following form: |
66 | int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **pp) | 66 | * |
67 | { | 67 | * typedef struct x509_attributes_st |
68 | int k=0; | 68 | * { |
69 | int r=0,ret=0; | 69 | * ASN1_OBJECT *object; |
70 | unsigned char **p=NULL; | 70 | * int single; |
71 | 71 | * union { | |
72 | if (a == NULL) return(0); | 72 | * char *ptr; |
73 | 73 | * STACK_OF(ASN1_TYPE) *set; | |
74 | p=NULL; | 74 | * ASN1_TYPE *single; |
75 | for (;;) | 75 | * } value; |
76 | { | 76 | * } X509_ATTRIBUTE; |
77 | if (k) | 77 | * |
78 | { | 78 | * this needs some extra thought because the CHOICE type is |
79 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); | 79 | * merged with the main structure and because the value can |
80 | if (pp == NULL) return(r); | 80 | * be anything at all we *must* try the SET OF first because |
81 | p=pp; | 81 | * the ASN1_ANY type will swallow anything including the whole |
82 | ASN1_put_object(p,1,ret,V_ASN1_SEQUENCE, | 82 | * SET OF structure. |
83 | V_ASN1_UNIVERSAL); | 83 | */ |
84 | } | ||
85 | |||
86 | ret+=i2d_ASN1_OBJECT(a->object,p); | ||
87 | if (a->set) | ||
88 | ret+=i2d_ASN1_SET_OF_ASN1_TYPE(a->value.set,p,i2d_ASN1_TYPE, | ||
89 | V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET); | ||
90 | else | ||
91 | ret+=i2d_ASN1_TYPE(a->value.single,p); | ||
92 | if (k++) return(r); | ||
93 | } | ||
94 | } | ||
95 | |||
96 | X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, unsigned char **pp, | ||
97 | long length) | ||
98 | { | ||
99 | M_ASN1_D2I_vars(a,X509_ATTRIBUTE *,X509_ATTRIBUTE_new); | ||
100 | 84 | ||
101 | M_ASN1_D2I_Init(); | 85 | ASN1_CHOICE(X509_ATTRIBUTE_SET) = { |
102 | M_ASN1_D2I_start_sequence(); | 86 | ASN1_SET_OF(X509_ATTRIBUTE, value.set, ASN1_ANY), |
103 | M_ASN1_D2I_get(ret->object,d2i_ASN1_OBJECT); | 87 | ASN1_SIMPLE(X509_ATTRIBUTE, value.single, ASN1_ANY) |
88 | } ASN1_CHOICE_END_selector(X509_ATTRIBUTE, X509_ATTRIBUTE_SET, single) | ||
104 | 89 | ||
105 | if ((c.slen != 0) && | 90 | ASN1_SEQUENCE(X509_ATTRIBUTE) = { |
106 | (M_ASN1_next == (V_ASN1_CONSTRUCTED|V_ASN1_UNIVERSAL|V_ASN1_SET))) | 91 | ASN1_SIMPLE(X509_ATTRIBUTE, object, ASN1_OBJECT), |
107 | { | 92 | /* CHOICE type merged with parent */ |
108 | ret->set=1; | 93 | ASN1_EX_COMBINE(0, 0, X509_ATTRIBUTE_SET) |
109 | M_ASN1_D2I_get_set_type(ASN1_TYPE,ret->value.set,d2i_ASN1_TYPE, | 94 | } ASN1_SEQUENCE_END(X509_ATTRIBUTE) |
110 | ASN1_TYPE_free); | ||
111 | } | ||
112 | else | ||
113 | { | ||
114 | ret->set=0; | ||
115 | M_ASN1_D2I_get(ret->value.single,d2i_ASN1_TYPE); | ||
116 | } | ||
117 | 95 | ||
118 | M_ASN1_D2I_Finish(a,X509_ATTRIBUTE_free,ASN1_F_D2I_X509_ATTRIBUTE); | 96 | IMPLEMENT_ASN1_FUNCTIONS(X509_ATTRIBUTE) |
119 | } | 97 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) |
120 | 98 | ||
121 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value) | 99 | X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value) |
122 | { | 100 | { |
@@ -126,7 +104,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value) | |||
126 | if ((ret=X509_ATTRIBUTE_new()) == NULL) | 104 | if ((ret=X509_ATTRIBUTE_new()) == NULL) |
127 | return(NULL); | 105 | return(NULL); |
128 | ret->object=OBJ_nid2obj(nid); | 106 | ret->object=OBJ_nid2obj(nid); |
129 | ret->set=1; | 107 | ret->single=0; |
130 | if ((ret->value.set=sk_ASN1_TYPE_new_null()) == NULL) goto err; | 108 | if ((ret->value.set=sk_ASN1_TYPE_new_null()) == NULL) goto err; |
131 | if ((val=ASN1_TYPE_new()) == NULL) goto err; | 109 | if ((val=ASN1_TYPE_new()) == NULL) goto err; |
132 | if (!sk_ASN1_TYPE_push(ret->value.set,val)) goto err; | 110 | if (!sk_ASN1_TYPE_push(ret->value.set,val)) goto err; |
@@ -138,28 +116,3 @@ err: | |||
138 | if (val != NULL) ASN1_TYPE_free(val); | 116 | if (val != NULL) ASN1_TYPE_free(val); |
139 | return(NULL); | 117 | return(NULL); |
140 | } | 118 | } |
141 | |||
142 | X509_ATTRIBUTE *X509_ATTRIBUTE_new(void) | ||
143 | { | ||
144 | X509_ATTRIBUTE *ret=NULL; | ||
145 | ASN1_CTX c; | ||
146 | |||
147 | M_ASN1_New_Malloc(ret,X509_ATTRIBUTE); | ||
148 | ret->object=OBJ_nid2obj(NID_undef); | ||
149 | ret->set=0; | ||
150 | ret->value.ptr=NULL; | ||
151 | return(ret); | ||
152 | M_ASN1_New_Error(ASN1_F_X509_ATTRIBUTE_NEW); | ||
153 | } | ||
154 | |||
155 | void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) | ||
156 | { | ||
157 | if (a == NULL) return; | ||
158 | ASN1_OBJECT_free(a->object); | ||
159 | if (a->set) | ||
160 | sk_ASN1_TYPE_pop_free(a->value.set,ASN1_TYPE_free); | ||
161 | else | ||
162 | ASN1_TYPE_free(a->value.single); | ||
163 | OPENSSL_free(a); | ||
164 | } | ||
165 | |||
diff --git a/src/lib/libcrypto/asn1/x_bignum.c b/src/lib/libcrypto/asn1/x_bignum.c new file mode 100644 index 0000000000..848c7a0877 --- /dev/null +++ b/src/lib/libcrypto/asn1/x_bignum.c | |||
@@ -0,0 +1,137 @@ | |||
1 | /* x_bignum.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/asn1t.h> | ||
62 | |||
63 | /* Custom primitive type for BIGNUM handling. This reads in an ASN1_INTEGER as a | ||
64 | * BIGNUM directly. Currently it ignores the sign which isn't a problem since all | ||
65 | * BIGNUMs used are non negative and anything that looks negative is normally due | ||
66 | * to an encoding error. | ||
67 | */ | ||
68 | |||
69 | #define BN_SENSITIVE 1 | ||
70 | |||
71 | static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
72 | static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
73 | |||
74 | static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); | ||
75 | static int bn_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); | ||
76 | |||
77 | static ASN1_PRIMITIVE_FUNCS bignum_pf = { | ||
78 | NULL, 0, | ||
79 | bn_new, | ||
80 | bn_free, | ||
81 | 0, | ||
82 | bn_c2i, | ||
83 | bn_i2c | ||
84 | }; | ||
85 | |||
86 | ASN1_ITEM_start(BIGNUM) | ||
87 | ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" | ||
88 | ASN1_ITEM_end(BIGNUM) | ||
89 | |||
90 | ASN1_ITEM_start(CBIGNUM) | ||
91 | ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, BN_SENSITIVE, "BIGNUM" | ||
92 | ASN1_ITEM_end(CBIGNUM) | ||
93 | |||
94 | static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
95 | { | ||
96 | *pval = (ASN1_VALUE *)BN_new(); | ||
97 | if(*pval) return 1; | ||
98 | else return 0; | ||
99 | } | ||
100 | |||
101 | static void bn_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
102 | { | ||
103 | if(!*pval) return; | ||
104 | if(it->size & BN_SENSITIVE) BN_clear_free((BIGNUM *)*pval); | ||
105 | else BN_free((BIGNUM *)*pval); | ||
106 | *pval = NULL; | ||
107 | } | ||
108 | |||
109 | static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it) | ||
110 | { | ||
111 | BIGNUM *bn; | ||
112 | int pad; | ||
113 | if(!*pval) return -1; | ||
114 | bn = (BIGNUM *)*pval; | ||
115 | /* If MSB set in an octet we need a padding byte */ | ||
116 | if(BN_num_bits(bn) & 0x7) pad = 0; | ||
117 | else pad = 1; | ||
118 | if(cont) { | ||
119 | if(pad) *cont++ = 0; | ||
120 | BN_bn2bin(bn, cont); | ||
121 | } | ||
122 | return pad + BN_num_bytes(bn); | ||
123 | } | ||
124 | |||
125 | static int bn_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) | ||
126 | { | ||
127 | BIGNUM *bn; | ||
128 | if(!*pval) bn_new(pval, it); | ||
129 | bn = (BIGNUM *)*pval; | ||
130 | if(!BN_bin2bn(cont, len, bn)) { | ||
131 | bn_free(pval, it); | ||
132 | return 0; | ||
133 | } | ||
134 | return 1; | ||
135 | } | ||
136 | |||
137 | |||
diff --git a/src/lib/libcrypto/asn1/x_crl.c b/src/lib/libcrypto/asn1/x_crl.c index 51518cdf35..11fce96825 100644 --- a/src/lib/libcrypto/asn1/x_crl.c +++ b/src/lib/libcrypto/asn1/x_crl.c | |||
@@ -58,275 +58,76 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | 63 | ||
64 | static int X509_REVOKED_cmp(const X509_REVOKED * const *a, | 64 | static int X509_REVOKED_cmp(const X509_REVOKED * const *a, |
65 | const X509_REVOKED * const *b); | 65 | const X509_REVOKED * const *b); |
66 | static int X509_REVOKED_seq_cmp(const X509_REVOKED * const *a, | 66 | static int X509_REVOKED_seq_cmp(const X509_REVOKED * const *a, |
67 | const X509_REVOKED * const *b); | 67 | const X509_REVOKED * const *b); |
68 | int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **pp) | ||
69 | { | ||
70 | M_ASN1_I2D_vars(a); | ||
71 | |||
72 | M_ASN1_I2D_len(a->serialNumber,i2d_ASN1_INTEGER); | ||
73 | M_ASN1_I2D_len(a->revocationDate,i2d_ASN1_TIME); | ||
74 | M_ASN1_I2D_len_SEQUENCE_opt_ex_type(X509_EXTENSION,a->extensions, | ||
75 | i2d_X509_EXTENSION); | ||
76 | |||
77 | M_ASN1_I2D_seq_total(); | ||
78 | 68 | ||
79 | M_ASN1_I2D_put(a->serialNumber,i2d_ASN1_INTEGER); | 69 | ASN1_SEQUENCE(X509_REVOKED) = { |
80 | M_ASN1_I2D_put(a->revocationDate,i2d_ASN1_TIME); | 70 | ASN1_SIMPLE(X509_REVOKED,serialNumber, ASN1_INTEGER), |
81 | M_ASN1_I2D_put_SEQUENCE_opt_ex_type(X509_EXTENSION,a->extensions, | 71 | ASN1_SIMPLE(X509_REVOKED,revocationDate, ASN1_TIME), |
82 | i2d_X509_EXTENSION); | 72 | ASN1_SEQUENCE_OF_OPT(X509_REVOKED,extensions, X509_EXTENSION) |
83 | 73 | } ASN1_SEQUENCE_END(X509_REVOKED) | |
84 | M_ASN1_I2D_finish(); | 74 | |
85 | } | 75 | /* The X509_CRL_INFO structure needs a bit of customisation. This is actually |
86 | 76 | * mirroring the old behaviour: its purpose is to allow the use of | |
87 | X509_REVOKED *d2i_X509_REVOKED(X509_REVOKED **a, unsigned char **pp, | 77 | * sk_X509_REVOKED_find to lookup revoked certificates. Unfortunately |
88 | long length) | 78 | * this will zap the original order and the signature so we keep a copy |
89 | { | 79 | * of the original positions and reorder appropriately before encoding. |
90 | M_ASN1_D2I_vars(a,X509_REVOKED *,X509_REVOKED_new); | 80 | * |
91 | 81 | * Might want to see if there's a better way of doing this later... | |
92 | M_ASN1_D2I_Init(); | 82 | */ |
93 | M_ASN1_D2I_start_sequence(); | 83 | static int crl_inf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) |
94 | M_ASN1_D2I_get(ret->serialNumber,d2i_ASN1_INTEGER); | 84 | { |
95 | M_ASN1_D2I_get(ret->revocationDate,d2i_ASN1_TIME); | 85 | X509_CRL_INFO *a = (X509_CRL_INFO *)*pval; |
96 | M_ASN1_D2I_get_seq_opt_type(X509_EXTENSION,ret->extensions, | 86 | int i; |
97 | d2i_X509_EXTENSION,X509_EXTENSION_free); | ||
98 | M_ASN1_D2I_Finish(a,X509_REVOKED_free,ASN1_F_D2I_X509_REVOKED); | ||
99 | } | ||
100 | |||
101 | int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **pp) | ||
102 | { | ||
103 | int v1=0; | ||
104 | long l=0; | ||
105 | int (*old_cmp)(const X509_REVOKED * const *, | 87 | int (*old_cmp)(const X509_REVOKED * const *, |
106 | const X509_REVOKED * const *); | 88 | const X509_REVOKED * const *); |
107 | M_ASN1_I2D_vars(a); | ||
108 | |||
109 | old_cmp=sk_X509_REVOKED_set_cmp_func(a->revoked,X509_REVOKED_seq_cmp); | ||
110 | sk_X509_REVOKED_sort(a->revoked); | ||
111 | sk_X509_REVOKED_set_cmp_func(a->revoked,old_cmp); | ||
112 | |||
113 | if ((a->version != NULL) && ((l=ASN1_INTEGER_get(a->version)) != 0)) | ||
114 | { | ||
115 | M_ASN1_I2D_len(a->version,i2d_ASN1_INTEGER); | ||
116 | } | ||
117 | M_ASN1_I2D_len(a->sig_alg,i2d_X509_ALGOR); | ||
118 | M_ASN1_I2D_len(a->issuer,i2d_X509_NAME); | ||
119 | M_ASN1_I2D_len(a->lastUpdate,i2d_ASN1_TIME); | ||
120 | if (a->nextUpdate != NULL) | ||
121 | { M_ASN1_I2D_len(a->nextUpdate,i2d_ASN1_TIME); } | ||
122 | M_ASN1_I2D_len_SEQUENCE_opt_type(X509_REVOKED,a->revoked, | ||
123 | i2d_X509_REVOKED); | ||
124 | M_ASN1_I2D_len_EXP_SEQUENCE_opt_ex_type(X509_EXTENSION,a->extensions, | ||
125 | i2d_X509_EXTENSION,0, | ||
126 | V_ASN1_SEQUENCE,v1); | ||
127 | |||
128 | M_ASN1_I2D_seq_total(); | ||
129 | |||
130 | if ((a->version != NULL) && (l != 0)) | ||
131 | { | ||
132 | M_ASN1_I2D_put(a->version,i2d_ASN1_INTEGER); | ||
133 | } | ||
134 | M_ASN1_I2D_put(a->sig_alg,i2d_X509_ALGOR); | ||
135 | M_ASN1_I2D_put(a->issuer,i2d_X509_NAME); | ||
136 | M_ASN1_I2D_put(a->lastUpdate,i2d_ASN1_TIME); | ||
137 | if (a->nextUpdate != NULL) | ||
138 | { M_ASN1_I2D_put(a->nextUpdate,i2d_ASN1_TIME); } | ||
139 | M_ASN1_I2D_put_SEQUENCE_opt_type(X509_REVOKED,a->revoked, | ||
140 | i2d_X509_REVOKED); | ||
141 | M_ASN1_I2D_put_EXP_SEQUENCE_opt_ex_type(X509_EXTENSION,a->extensions, | ||
142 | i2d_X509_EXTENSION,0, | ||
143 | V_ASN1_SEQUENCE,v1); | ||
144 | 89 | ||
145 | M_ASN1_I2D_finish(); | 90 | if(!a || !a->revoked) return 1; |
146 | } | 91 | switch(operation) { |
147 | 92 | ||
148 | X509_CRL_INFO *d2i_X509_CRL_INFO(X509_CRL_INFO **a, unsigned char **pp, | 93 | /* Save original order */ |
149 | long length) | 94 | case ASN1_OP_D2I_POST: |
150 | { | 95 | for (i=0; i<sk_X509_REVOKED_num(a->revoked); i++) |
151 | int i,ver=0; | 96 | sk_X509_REVOKED_value(a->revoked,i)->sequence=i; |
152 | M_ASN1_D2I_vars(a,X509_CRL_INFO *,X509_CRL_INFO_new); | 97 | sk_X509_REVOKED_set_cmp_func(a->revoked,X509_REVOKED_cmp); |
153 | 98 | break; | |
154 | 99 | ||
155 | M_ASN1_D2I_Init(); | 100 | /* Restore original order */ |
156 | M_ASN1_D2I_start_sequence(); | 101 | case ASN1_OP_I2D_PRE: |
157 | M_ASN1_D2I_get_opt(ret->version,d2i_ASN1_INTEGER,V_ASN1_INTEGER); | 102 | old_cmp=sk_X509_REVOKED_set_cmp_func(a->revoked,X509_REVOKED_seq_cmp); |
158 | if (ret->version != NULL) | 103 | sk_X509_REVOKED_sort(a->revoked); |
159 | ver=ret->version->data[0]; | 104 | sk_X509_REVOKED_set_cmp_func(a->revoked,old_cmp); |
160 | 105 | break; | |
161 | if ((ver == 0) && (ret->version != NULL)) | ||
162 | { | ||
163 | M_ASN1_INTEGER_free(ret->version); | ||
164 | ret->version=NULL; | ||
165 | } | ||
166 | M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); | ||
167 | M_ASN1_D2I_get(ret->issuer,d2i_X509_NAME); | ||
168 | M_ASN1_D2I_get(ret->lastUpdate,d2i_ASN1_TIME); | ||
169 | /* Manually handle the OPTIONAL ASN1_TIME stuff */ | ||
170 | /* First try UTCTime */ | ||
171 | M_ASN1_D2I_get_opt(ret->nextUpdate,d2i_ASN1_UTCTIME, V_ASN1_UTCTIME); | ||
172 | /* If that doesn't work try GeneralizedTime */ | ||
173 | if(!ret->nextUpdate) | ||
174 | M_ASN1_D2I_get_opt(ret->nextUpdate,d2i_ASN1_GENERALIZEDTIME, | ||
175 | V_ASN1_GENERALIZEDTIME); | ||
176 | if (ret->revoked != NULL) | ||
177 | { | ||
178 | while (sk_X509_REVOKED_num(ret->revoked)) | ||
179 | X509_REVOKED_free(sk_X509_REVOKED_pop(ret->revoked)); | ||
180 | } | ||
181 | M_ASN1_D2I_get_seq_opt_type(X509_REVOKED,ret->revoked,d2i_X509_REVOKED, | ||
182 | X509_REVOKED_free); | ||
183 | |||
184 | if (ret->revoked != NULL) | ||
185 | { | ||
186 | for (i=0; i<sk_X509_REVOKED_num(ret->revoked); i++) | ||
187 | { | ||
188 | sk_X509_REVOKED_value(ret->revoked,i)->sequence=i; | ||
189 | } | ||
190 | } | ||
191 | |||
192 | if (ret->extensions != NULL) | ||
193 | { | ||
194 | while (sk_X509_EXTENSION_num(ret->extensions)) | ||
195 | X509_EXTENSION_free( | ||
196 | sk_X509_EXTENSION_pop(ret->extensions)); | ||
197 | } | ||
198 | |||
199 | M_ASN1_D2I_get_EXP_set_opt_type(X509_EXTENSION,ret->extensions, | ||
200 | d2i_X509_EXTENSION, | ||
201 | X509_EXTENSION_free,0, | ||
202 | V_ASN1_SEQUENCE); | ||
203 | |||
204 | M_ASN1_D2I_Finish(a,X509_CRL_INFO_free,ASN1_F_D2I_X509_CRL_INFO); | ||
205 | } | ||
206 | |||
207 | int i2d_X509_CRL(X509_CRL *a, unsigned char **pp) | ||
208 | { | ||
209 | M_ASN1_I2D_vars(a); | ||
210 | |||
211 | M_ASN1_I2D_len(a->crl,i2d_X509_CRL_INFO); | ||
212 | M_ASN1_I2D_len(a->sig_alg,i2d_X509_ALGOR); | ||
213 | M_ASN1_I2D_len(a->signature,i2d_ASN1_BIT_STRING); | ||
214 | |||
215 | M_ASN1_I2D_seq_total(); | ||
216 | |||
217 | M_ASN1_I2D_put(a->crl,i2d_X509_CRL_INFO); | ||
218 | M_ASN1_I2D_put(a->sig_alg,i2d_X509_ALGOR); | ||
219 | M_ASN1_I2D_put(a->signature,i2d_ASN1_BIT_STRING); | ||
220 | |||
221 | M_ASN1_I2D_finish(); | ||
222 | } | ||
223 | |||
224 | X509_CRL *d2i_X509_CRL(X509_CRL **a, unsigned char **pp, long length) | ||
225 | { | ||
226 | M_ASN1_D2I_vars(a,X509_CRL *,X509_CRL_new); | ||
227 | |||
228 | M_ASN1_D2I_Init(); | ||
229 | M_ASN1_D2I_start_sequence(); | ||
230 | M_ASN1_D2I_get(ret->crl,d2i_X509_CRL_INFO); | ||
231 | M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); | ||
232 | M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); | ||
233 | |||
234 | M_ASN1_D2I_Finish(a,X509_CRL_free,ASN1_F_D2I_X509_CRL); | ||
235 | } | ||
236 | |||
237 | |||
238 | X509_REVOKED *X509_REVOKED_new(void) | ||
239 | { | ||
240 | X509_REVOKED *ret=NULL; | ||
241 | ASN1_CTX c; | ||
242 | |||
243 | M_ASN1_New_Malloc(ret,X509_REVOKED); | ||
244 | M_ASN1_New(ret->serialNumber,M_ASN1_INTEGER_new); | ||
245 | M_ASN1_New(ret->revocationDate,M_ASN1_UTCTIME_new); | ||
246 | ret->extensions=NULL; | ||
247 | return(ret); | ||
248 | M_ASN1_New_Error(ASN1_F_X509_REVOKED_NEW); | ||
249 | } | ||
250 | |||
251 | X509_CRL_INFO *X509_CRL_INFO_new(void) | ||
252 | { | ||
253 | X509_CRL_INFO *ret=NULL; | ||
254 | ASN1_CTX c; | ||
255 | |||
256 | M_ASN1_New_Malloc(ret,X509_CRL_INFO); | ||
257 | ret->version=NULL; | ||
258 | M_ASN1_New(ret->sig_alg,X509_ALGOR_new); | ||
259 | M_ASN1_New(ret->issuer,X509_NAME_new); | ||
260 | M_ASN1_New(ret->lastUpdate,M_ASN1_UTCTIME_new); | ||
261 | ret->nextUpdate=NULL; | ||
262 | M_ASN1_New(ret->revoked,sk_X509_REVOKED_new_null); | ||
263 | ret->extensions = NULL; | ||
264 | sk_X509_REVOKED_set_cmp_func(ret->revoked,X509_REVOKED_cmp); | ||
265 | return(ret); | ||
266 | M_ASN1_New_Error(ASN1_F_X509_CRL_INFO_NEW); | ||
267 | } | ||
268 | |||
269 | X509_CRL *X509_CRL_new(void) | ||
270 | { | ||
271 | X509_CRL *ret=NULL; | ||
272 | ASN1_CTX c; | ||
273 | |||
274 | M_ASN1_New_Malloc(ret,X509_CRL); | ||
275 | ret->references=1; | ||
276 | M_ASN1_New(ret->crl,X509_CRL_INFO_new); | ||
277 | M_ASN1_New(ret->sig_alg,X509_ALGOR_new); | ||
278 | M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); | ||
279 | return(ret); | ||
280 | M_ASN1_New_Error(ASN1_F_X509_CRL_NEW); | ||
281 | } | ||
282 | |||
283 | void X509_REVOKED_free(X509_REVOKED *a) | ||
284 | { | ||
285 | if (a == NULL) return; | ||
286 | M_ASN1_INTEGER_free(a->serialNumber); | ||
287 | M_ASN1_UTCTIME_free(a->revocationDate); | ||
288 | sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free); | ||
289 | OPENSSL_free(a); | ||
290 | } | ||
291 | |||
292 | void X509_CRL_INFO_free(X509_CRL_INFO *a) | ||
293 | { | ||
294 | if (a == NULL) return; | ||
295 | M_ASN1_INTEGER_free(a->version); | ||
296 | X509_ALGOR_free(a->sig_alg); | ||
297 | X509_NAME_free(a->issuer); | ||
298 | M_ASN1_UTCTIME_free(a->lastUpdate); | ||
299 | if (a->nextUpdate) | ||
300 | M_ASN1_UTCTIME_free(a->nextUpdate); | ||
301 | sk_X509_REVOKED_pop_free(a->revoked,X509_REVOKED_free); | ||
302 | sk_X509_EXTENSION_pop_free(a->extensions,X509_EXTENSION_free); | ||
303 | OPENSSL_free(a); | ||
304 | } | ||
305 | |||
306 | void X509_CRL_free(X509_CRL *a) | ||
307 | { | ||
308 | int i; | ||
309 | |||
310 | if (a == NULL) return; | ||
311 | |||
312 | i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_X509_CRL); | ||
313 | #ifdef REF_PRINT | ||
314 | REF_PRINT("X509_CRL",a); | ||
315 | #endif | ||
316 | if (i > 0) return; | ||
317 | #ifdef REF_CHECK | ||
318 | if (i < 0) | ||
319 | { | ||
320 | fprintf(stderr,"X509_CRL_free, bad reference count\n"); | ||
321 | abort(); | ||
322 | } | ||
323 | #endif | ||
324 | |||
325 | X509_CRL_INFO_free(a->crl); | ||
326 | X509_ALGOR_free(a->sig_alg); | ||
327 | M_ASN1_BIT_STRING_free(a->signature); | ||
328 | OPENSSL_free(a); | ||
329 | } | 106 | } |
107 | return 1; | ||
108 | } | ||
109 | |||
110 | |||
111 | ASN1_SEQUENCE_cb(X509_CRL_INFO, crl_inf_cb) = { | ||
112 | ASN1_OPT(X509_CRL_INFO, version, ASN1_INTEGER), | ||
113 | ASN1_SIMPLE(X509_CRL_INFO, sig_alg, X509_ALGOR), | ||
114 | ASN1_SIMPLE(X509_CRL_INFO, issuer, X509_NAME), | ||
115 | ASN1_SIMPLE(X509_CRL_INFO, lastUpdate, ASN1_TIME), | ||
116 | ASN1_OPT(X509_CRL_INFO, nextUpdate, ASN1_TIME), | ||
117 | ASN1_SEQUENCE_OF_OPT(X509_CRL_INFO, revoked, X509_REVOKED), | ||
118 | ASN1_EXP_SEQUENCE_OF_OPT(X509_CRL_INFO, extensions, X509_EXTENSION, 0) | ||
119 | } ASN1_SEQUENCE_END_cb(X509_CRL_INFO, X509_CRL_INFO) | ||
120 | |||
121 | ASN1_SEQUENCE_ref(X509_CRL, 0, CRYPTO_LOCK_X509_CRL) = { | ||
122 | ASN1_SIMPLE(X509_CRL, crl, X509_CRL_INFO), | ||
123 | ASN1_SIMPLE(X509_CRL, sig_alg, X509_ALGOR), | ||
124 | ASN1_SIMPLE(X509_CRL, signature, ASN1_BIT_STRING) | ||
125 | } ASN1_SEQUENCE_END_ref(X509_CRL, X509_CRL) | ||
126 | |||
127 | IMPLEMENT_ASN1_FUNCTIONS(X509_REVOKED) | ||
128 | IMPLEMENT_ASN1_FUNCTIONS(X509_CRL_INFO) | ||
129 | IMPLEMENT_ASN1_FUNCTIONS(X509_CRL) | ||
130 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_CRL) | ||
330 | 131 | ||
331 | static int X509_REVOKED_cmp(const X509_REVOKED * const *a, | 132 | static int X509_REVOKED_cmp(const X509_REVOKED * const *a, |
332 | const X509_REVOKED * const *b) | 133 | const X509_REVOKED * const *b) |
@@ -342,6 +143,19 @@ static int X509_REVOKED_seq_cmp(const X509_REVOKED * const *a, | |||
342 | return((*a)->sequence-(*b)->sequence); | 143 | return((*a)->sequence-(*b)->sequence); |
343 | } | 144 | } |
344 | 145 | ||
146 | int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) | ||
147 | { | ||
148 | X509_CRL_INFO *inf; | ||
149 | inf = crl->crl; | ||
150 | if(!inf->revoked) | ||
151 | inf->revoked = sk_X509_REVOKED_new(X509_REVOKED_cmp); | ||
152 | if(!inf->revoked || !sk_X509_REVOKED_push(inf->revoked, rev)) { | ||
153 | ASN1err(ASN1_F_X509_CRL_ADD0_REVOKED, ERR_R_MALLOC_FAILURE); | ||
154 | return 0; | ||
155 | } | ||
156 | return 1; | ||
157 | } | ||
158 | |||
345 | IMPLEMENT_STACK_OF(X509_REVOKED) | 159 | IMPLEMENT_STACK_OF(X509_REVOKED) |
346 | IMPLEMENT_ASN1_SET_OF(X509_REVOKED) | 160 | IMPLEMENT_ASN1_SET_OF(X509_REVOKED) |
347 | IMPLEMENT_STACK_OF(X509_CRL) | 161 | IMPLEMENT_STACK_OF(X509_CRL) |
diff --git a/src/lib/libcrypto/asn1/x_exten.c b/src/lib/libcrypto/asn1/x_exten.c index fbfd963b40..702421b6c8 100644 --- a/src/lib/libcrypto/asn1/x_exten.c +++ b/src/lib/libcrypto/asn1/x_exten.c | |||
@@ -1,139 +1,71 @@ | |||
1 | /* crypto/asn1/x_exten.c */ | 1 | /* x_exten.c */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL |
3 | * All rights reserved. | 3 | * project 2000. |
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
4 | * | 7 | * |
5 | * This package is an SSL implementation written | ||
6 | * by Eric Young (eay@cryptsoft.com). | ||
7 | * The implementation was written so as to conform with Netscapes SSL. | ||
8 | * | ||
9 | * This library is free for commercial and non-commercial use as long as | ||
10 | * the following conditions are aheared to. The following conditions | ||
11 | * apply to all code found in this distribution, be it the RC4, RSA, | ||
12 | * lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
13 | * included with this distribution is covered by the same copyright terms | ||
14 | * except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
15 | * | ||
16 | * Copyright remains Eric Young's, and as such any Copyright notices in | ||
17 | * the code are not to be removed. | ||
18 | * If this package is used in a product, Eric Young should be given attribution | ||
19 | * as the author of the parts of the library used. | ||
20 | * This can be in the form of a textual message at program startup or | ||
21 | * in documentation (online or textual) provided with the package. | ||
22 | * | ||
23 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
24 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
25 | * are met: | 10 | * are met: |
26 | * 1. Redistributions of source code must retain the copyright | 11 | * |
27 | * notice, this list of conditions and the following disclaimer. | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
28 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright |
29 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in |
30 | * documentation and/or other materials provided with the distribution. | 17 | * the documentation and/or other materials provided with the |
31 | * 3. All advertising materials mentioning features or use of this software | 18 | * distribution. |
32 | * must display the following acknowledgement: | 19 | * |
33 | * "This product includes cryptographic software written by | 20 | * 3. All advertising materials mentioning features or use of this |
34 | * Eric Young (eay@cryptsoft.com)" | 21 | * software must display the following acknowledgment: |
35 | * The word 'cryptographic' can be left out if the rouines from the library | 22 | * "This product includes software developed by the OpenSSL Project |
36 | * being used are not cryptographic related :-). | 23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" |
37 | * 4. If you include any Windows specific code (or a derivative thereof) from | 24 | * |
38 | * the apps directory (application code) you must include an acknowledgement: | 25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to |
39 | * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | 26 | * endorse or promote products derived from this software without |
40 | * | 27 | * prior written permission. For written permission, please contact |
41 | * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | 28 | * licensing@OpenSSL.org. |
42 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 29 | * |
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 30 | * 5. Products derived from this software may not be called "OpenSSL" |
44 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 31 | * nor may "OpenSSL" appear in their names without prior written |
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 32 | * permission of the OpenSSL Project. |
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 33 | * |
47 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 34 | * 6. Redistributions of any form whatsoever must retain the following |
48 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 35 | * acknowledgment: |
49 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 36 | * "This product includes software developed by the OpenSSL Project |
50 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" |
51 | * SUCH DAMAGE. | 38 | * |
52 | * | 39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY |
53 | * The licence and distribution terms for any publically available version or | 40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
54 | * derivative of this code cannot be changed. i.e. this code cannot simply be | 41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
55 | * copied and put under another distribution licence | 42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR |
56 | * [including the GNU Public Licence.] | 43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stddef.h> |
60 | #include "cryptlib.h" | ||
61 | #include <openssl/objects.h> | ||
62 | #include <openssl/asn1_mac.h> | ||
63 | #include <openssl/x509.h> | 60 | #include <openssl/x509.h> |
61 | #include <openssl/asn1.h> | ||
62 | #include <openssl/asn1t.h> | ||
64 | 63 | ||
65 | int i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **pp) | 64 | ASN1_SEQUENCE(X509_EXTENSION) = { |
66 | { | 65 | ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT), |
67 | int k=0; | 66 | ASN1_OPT(X509_EXTENSION, critical, ASN1_BOOLEAN), |
68 | int r=0,ret=0; | 67 | ASN1_SIMPLE(X509_EXTENSION, value, ASN1_OCTET_STRING) |
69 | unsigned char **p=NULL; | 68 | } ASN1_SEQUENCE_END(X509_EXTENSION) |
70 | |||
71 | if (a == NULL) return(0); | ||
72 | |||
73 | p=NULL; | ||
74 | for (;;) | ||
75 | { | ||
76 | if (k) | ||
77 | { | ||
78 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); | ||
79 | if (pp == NULL) return(r); | ||
80 | p=pp; | ||
81 | ASN1_put_object(p,1,ret,V_ASN1_SEQUENCE, | ||
82 | V_ASN1_UNIVERSAL); | ||
83 | } | ||
84 | |||
85 | ret+=i2d_ASN1_OBJECT(a->object,p); | ||
86 | if ((a->critical) || a->netscape_hack) | ||
87 | ret+=i2d_ASN1_BOOLEAN(a->critical,p); | ||
88 | ret+=i2d_ASN1_OCTET_STRING(a->value,p); | ||
89 | if (k++) return(r); | ||
90 | } | ||
91 | } | ||
92 | |||
93 | X509_EXTENSION *d2i_X509_EXTENSION(X509_EXTENSION **a, unsigned char **pp, | ||
94 | long length) | ||
95 | { | ||
96 | int i; | ||
97 | M_ASN1_D2I_vars(a,X509_EXTENSION *,X509_EXTENSION_new); | ||
98 | |||
99 | M_ASN1_D2I_Init(); | ||
100 | M_ASN1_D2I_start_sequence(); | ||
101 | M_ASN1_D2I_get(ret->object,d2i_ASN1_OBJECT); | ||
102 | |||
103 | ret->netscape_hack=0; | ||
104 | if ((c.slen != 0) && | ||
105 | (M_ASN1_next == (V_ASN1_UNIVERSAL|V_ASN1_BOOLEAN))) | ||
106 | { | ||
107 | c.q=c.p; | ||
108 | if (d2i_ASN1_BOOLEAN(&i,&c.p,c.slen) < 0) goto err; | ||
109 | ret->critical=i; | ||
110 | c.slen-=(c.p-c.q); | ||
111 | if (ret->critical == 0) ret->netscape_hack=1; | ||
112 | } | ||
113 | M_ASN1_D2I_get(ret->value,d2i_ASN1_OCTET_STRING); | ||
114 | |||
115 | M_ASN1_D2I_Finish(a,X509_EXTENSION_free,ASN1_F_D2I_X509_EXTENSION); | ||
116 | } | ||
117 | |||
118 | X509_EXTENSION *X509_EXTENSION_new(void) | ||
119 | { | ||
120 | X509_EXTENSION *ret=NULL; | ||
121 | ASN1_CTX c; | ||
122 | |||
123 | M_ASN1_New_Malloc(ret,X509_EXTENSION); | ||
124 | ret->object=OBJ_nid2obj(NID_undef); | ||
125 | M_ASN1_New(ret->value,M_ASN1_OCTET_STRING_new); | ||
126 | ret->critical=0; | ||
127 | ret->netscape_hack=0; | ||
128 | return(ret); | ||
129 | M_ASN1_New_Error(ASN1_F_X509_EXTENSION_NEW); | ||
130 | } | ||
131 | |||
132 | void X509_EXTENSION_free(X509_EXTENSION *a) | ||
133 | { | ||
134 | if (a == NULL) return; | ||
135 | ASN1_OBJECT_free(a->object); | ||
136 | M_ASN1_OCTET_STRING_free(a->value); | ||
137 | OPENSSL_free(a); | ||
138 | } | ||
139 | 69 | ||
70 | IMPLEMENT_ASN1_FUNCTIONS(X509_EXTENSION) | ||
71 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_EXTENSION) | ||
diff --git a/src/lib/libcrypto/asn1/x_info.c b/src/lib/libcrypto/asn1/x_info.c index 5e62fc2f6f..d44f6cdb01 100644 --- a/src/lib/libcrypto/asn1/x_info.c +++ b/src/lib/libcrypto/asn1/x_info.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1.h> |
63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | X509_INFO *X509_INFO_new(void) | 65 | X509_INFO *X509_INFO_new(void) |
diff --git a/src/lib/libcrypto/asn1/x_long.c b/src/lib/libcrypto/asn1/x_long.c new file mode 100644 index 0000000000..c5f25956cb --- /dev/null +++ b/src/lib/libcrypto/asn1/x_long.c | |||
@@ -0,0 +1,169 @@ | |||
1 | /* x_long.c */ | ||
2 | /* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL | ||
3 | * project 2000. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include "cryptlib.h" | ||
61 | #include <openssl/asn1t.h> | ||
62 | |||
63 | /* Custom primitive type for long handling. This converts between an ASN1_INTEGER | ||
64 | * and a long directly. | ||
65 | */ | ||
66 | |||
67 | |||
68 | static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
69 | static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it); | ||
70 | |||
71 | static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); | ||
72 | static int long_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); | ||
73 | |||
74 | static ASN1_PRIMITIVE_FUNCS long_pf = { | ||
75 | NULL, 0, | ||
76 | long_new, | ||
77 | long_free, | ||
78 | long_free, /* Clear should set to initial value */ | ||
79 | long_c2i, | ||
80 | long_i2c | ||
81 | }; | ||
82 | |||
83 | ASN1_ITEM_start(LONG) | ||
84 | ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG" | ||
85 | ASN1_ITEM_end(LONG) | ||
86 | |||
87 | ASN1_ITEM_start(ZLONG) | ||
88 | ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, 0, "ZLONG" | ||
89 | ASN1_ITEM_end(ZLONG) | ||
90 | |||
91 | static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
92 | { | ||
93 | *(long *)pval = it->size; | ||
94 | return 1; | ||
95 | } | ||
96 | |||
97 | static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
98 | { | ||
99 | *(long *)pval = it->size; | ||
100 | } | ||
101 | |||
102 | static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it) | ||
103 | { | ||
104 | long ltmp; | ||
105 | unsigned long utmp; | ||
106 | int clen, pad, i; | ||
107 | /* this exists to bypass broken gcc optimization */ | ||
108 | char *cp = (char *)pval; | ||
109 | |||
110 | /* use memcpy, because we may not be long aligned */ | ||
111 | memcpy(<mp, cp, sizeof(long)); | ||
112 | |||
113 | if(ltmp == it->size) return -1; | ||
114 | /* Convert the long to positive: we subtract one if negative so | ||
115 | * we can cleanly handle the padding if only the MSB of the leading | ||
116 | * octet is set. | ||
117 | */ | ||
118 | if(ltmp < 0) utmp = -ltmp - 1; | ||
119 | else utmp = ltmp; | ||
120 | clen = BN_num_bits_word(utmp); | ||
121 | /* If MSB of leading octet set we need to pad */ | ||
122 | if(!(clen & 0x7)) pad = 1; | ||
123 | else pad = 0; | ||
124 | |||
125 | /* Convert number of bits to number of octets */ | ||
126 | clen = (clen + 7) >> 3; | ||
127 | |||
128 | if(cont) { | ||
129 | if(pad) *cont++ = (ltmp < 0) ? 0xff : 0; | ||
130 | for(i = clen - 1; i >= 0; i--) { | ||
131 | cont[i] = (unsigned char)(utmp & 0xff); | ||
132 | if(ltmp < 0) cont[i] ^= 0xff; | ||
133 | utmp >>= 8; | ||
134 | } | ||
135 | } | ||
136 | return clen + pad; | ||
137 | } | ||
138 | |||
139 | static int long_c2i(ASN1_VALUE **pval, unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) | ||
140 | { | ||
141 | int neg, i; | ||
142 | long ltmp; | ||
143 | unsigned long utmp = 0; | ||
144 | char *cp = (char *)pval; | ||
145 | if(len > sizeof(long)) { | ||
146 | ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG); | ||
147 | return 0; | ||
148 | } | ||
149 | /* Is it negative? */ | ||
150 | if(len && (cont[0] & 0x80)) neg = 1; | ||
151 | else neg = 0; | ||
152 | utmp = 0; | ||
153 | for(i = 0; i < len; i++) { | ||
154 | utmp <<= 8; | ||
155 | if(neg) utmp |= cont[i] ^ 0xff; | ||
156 | else utmp |= cont[i]; | ||
157 | } | ||
158 | ltmp = (long)utmp; | ||
159 | if(neg) { | ||
160 | ltmp++; | ||
161 | ltmp = -ltmp; | ||
162 | } | ||
163 | if(ltmp == it->size) { | ||
164 | ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG); | ||
165 | return 0; | ||
166 | } | ||
167 | memcpy(cp, <mp, sizeof(long)); | ||
168 | return 1; | ||
169 | } | ||
diff --git a/src/lib/libcrypto/asn1/x_name.c b/src/lib/libcrypto/asn1/x_name.c index 1885d699ef..caece0f158 100644 --- a/src/lib/libcrypto/asn1/x_name.c +++ b/src/lib/libcrypto/asn1/x_name.c | |||
@@ -58,212 +58,203 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/objects.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/asn1_mac.h> | ||
63 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
64 | 63 | ||
65 | static int i2d_X509_NAME_entries(X509_NAME *a); | 64 | static int x509_name_ex_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_ITEM *it, |
66 | int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **pp) | 65 | int tag, int aclass, char opt, ASN1_TLC *ctx); |
67 | { | ||
68 | M_ASN1_I2D_vars(a); | ||
69 | 66 | ||
70 | M_ASN1_I2D_len(a->object,i2d_ASN1_OBJECT); | 67 | static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); |
71 | M_ASN1_I2D_len(a->value,i2d_ASN1_PRINTABLE); | 68 | static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it); |
69 | static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it); | ||
72 | 70 | ||
73 | M_ASN1_I2D_seq_total(); | 71 | static int x509_name_encode(X509_NAME *a); |
74 | 72 | ||
75 | M_ASN1_I2D_put(a->object,i2d_ASN1_OBJECT); | 73 | ASN1_SEQUENCE(X509_NAME_ENTRY) = { |
76 | M_ASN1_I2D_put(a->value,i2d_ASN1_PRINTABLE); | 74 | ASN1_SIMPLE(X509_NAME_ENTRY, object, ASN1_OBJECT), |
75 | ASN1_SIMPLE(X509_NAME_ENTRY, value, ASN1_PRINTABLE) | ||
76 | } ASN1_SEQUENCE_END(X509_NAME_ENTRY) | ||
77 | 77 | ||
78 | M_ASN1_I2D_finish(); | 78 | IMPLEMENT_ASN1_FUNCTIONS(X509_NAME_ENTRY) |
79 | } | 79 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME_ENTRY) |
80 | 80 | ||
81 | X509_NAME_ENTRY *d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, unsigned char **pp, | 81 | /* For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } |
82 | long length) | 82 | * so declare two template wrappers for this |
83 | { | 83 | */ |
84 | M_ASN1_D2I_vars(a,X509_NAME_ENTRY *,X509_NAME_ENTRY_new); | ||
85 | 84 | ||
86 | M_ASN1_D2I_Init(); | 85 | ASN1_ITEM_TEMPLATE(X509_NAME_ENTRIES) = |
87 | M_ASN1_D2I_start_sequence(); | 86 | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SET_OF, 0, RDNS, X509_NAME_ENTRY) |
88 | M_ASN1_D2I_get(ret->object,d2i_ASN1_OBJECT); | 87 | ASN1_ITEM_TEMPLATE_END(X509_NAME_ENTRIES) |
89 | M_ASN1_D2I_get(ret->value,d2i_ASN1_PRINTABLE); | ||
90 | ret->set=0; | ||
91 | M_ASN1_D2I_Finish(a,X509_NAME_ENTRY_free,ASN1_F_D2I_X509_NAME_ENTRY); | ||
92 | } | ||
93 | 88 | ||
94 | int i2d_X509_NAME(X509_NAME *a, unsigned char **pp) | 89 | ASN1_ITEM_TEMPLATE(X509_NAME_INTERNAL) = |
95 | { | 90 | ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Name, X509_NAME_ENTRIES) |
96 | int ret; | 91 | ASN1_ITEM_TEMPLATE_END(X509_NAME_INTERNAL) |
97 | 92 | ||
98 | if (a == NULL) return(0); | 93 | /* Normally that's where it would end: we'd have two nested STACK structures |
99 | if (a->modified) | 94 | * representing the ASN1. Unfortunately X509_NAME uses a completely different |
100 | { | 95 | * form and caches encodings so we have to process the internal form and convert |
101 | ret=i2d_X509_NAME_entries(a); | 96 | * to the external form. |
102 | if (ret < 0) return(ret); | 97 | */ |
103 | } | ||
104 | |||
105 | ret=a->bytes->length; | ||
106 | if (pp != NULL) | ||
107 | { | ||
108 | memcpy(*pp,a->bytes->data,ret); | ||
109 | *pp+=ret; | ||
110 | } | ||
111 | return(ret); | ||
112 | } | ||
113 | |||
114 | static int i2d_X509_NAME_entries(X509_NAME *a) | ||
115 | { | ||
116 | X509_NAME_ENTRY *ne,*fe=NULL; | ||
117 | STACK_OF(X509_NAME_ENTRY) *sk; | ||
118 | BUF_MEM *buf=NULL; | ||
119 | int set=0,r,ret=0; | ||
120 | int i; | ||
121 | unsigned char *p; | ||
122 | int size=0; | ||
123 | 98 | ||
124 | sk=a->entries; | 99 | const ASN1_EXTERN_FUNCS x509_name_ff = { |
125 | for (i=0; i<sk_X509_NAME_ENTRY_num(sk); i++) | 100 | NULL, |
126 | { | 101 | x509_name_ex_new, |
127 | ne=sk_X509_NAME_ENTRY_value(sk,i); | 102 | x509_name_ex_free, |
128 | if (fe == NULL) | 103 | 0, /* Default clear behaviour is OK */ |
129 | { | 104 | x509_name_ex_d2i, |
130 | fe=ne; | 105 | x509_name_ex_i2d |
131 | size=0; | 106 | }; |
132 | } | 107 | |
108 | IMPLEMENT_EXTERN_ASN1(X509_NAME, V_ASN1_SEQUENCE, x509_name_ff) | ||
109 | |||
110 | IMPLEMENT_ASN1_FUNCTIONS(X509_NAME) | ||
111 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME) | ||
112 | |||
113 | static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) | ||
114 | { | ||
115 | X509_NAME *ret = NULL; | ||
116 | ret = OPENSSL_malloc(sizeof(X509_NAME)); | ||
117 | if(!ret) goto memerr; | ||
118 | if ((ret->entries=sk_X509_NAME_ENTRY_new_null()) == NULL) | ||
119 | goto memerr; | ||
120 | if((ret->bytes = BUF_MEM_new()) == NULL) goto memerr; | ||
121 | ret->modified=1; | ||
122 | *val = (ASN1_VALUE *)ret; | ||
123 | return 1; | ||
133 | 124 | ||
134 | if (ne->set != set) | 125 | memerr: |
135 | { | 126 | ASN1err(ASN1_F_X509_NAME_NEW, ERR_R_MALLOC_FAILURE); |
136 | ret+=ASN1_object_size(1,size,V_ASN1_SET); | 127 | if (ret) |
137 | fe->size=size; | ||
138 | fe=ne; | ||
139 | size=0; | ||
140 | set=ne->set; | ||
141 | } | ||
142 | size+=i2d_X509_NAME_ENTRY(ne,NULL); | ||
143 | } | ||
144 | if (fe != NULL) | ||
145 | { | 128 | { |
146 | /* SET OF needed only if entries is non empty */ | 129 | if (ret->entries) |
147 | ret+=ASN1_object_size(1,size,V_ASN1_SET); | 130 | sk_X509_NAME_ENTRY_free(ret->entries); |
148 | fe->size=size; | 131 | OPENSSL_free(ret); |
149 | } | 132 | } |
133 | return 0; | ||
134 | } | ||
150 | 135 | ||
151 | r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); | 136 | static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it) |
152 | 137 | { | |
153 | buf=a->bytes; | 138 | X509_NAME *a; |
154 | if (!BUF_MEM_grow(buf,r)) goto err; | 139 | if(!pval || !*pval) |
155 | p=(unsigned char *)buf->data; | 140 | return; |
156 | 141 | a = (X509_NAME *)*pval; | |
157 | ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL); | ||
158 | |||
159 | set= -1; | ||
160 | for (i=0; i<sk_X509_NAME_ENTRY_num(sk); i++) | ||
161 | { | ||
162 | ne=sk_X509_NAME_ENTRY_value(sk,i); | ||
163 | if (set != ne->set) | ||
164 | { | ||
165 | set=ne->set; | ||
166 | ASN1_put_object(&p,1,ne->size, | ||
167 | V_ASN1_SET,V_ASN1_UNIVERSAL); | ||
168 | } | ||
169 | i2d_X509_NAME_ENTRY(ne,&p); | ||
170 | } | ||
171 | a->modified=0; | ||
172 | return(r); | ||
173 | err: | ||
174 | return(-1); | ||
175 | } | ||
176 | 142 | ||
177 | X509_NAME *d2i_X509_NAME(X509_NAME **a, unsigned char **pp, long length) | 143 | BUF_MEM_free(a->bytes); |
178 | { | 144 | sk_X509_NAME_ENTRY_pop_free(a->entries,X509_NAME_ENTRY_free); |
179 | int set=0,i; | 145 | OPENSSL_free(a); |
180 | int idx=0; | 146 | *pval = NULL; |
181 | unsigned char *orig; | 147 | } |
182 | M_ASN1_D2I_vars(a,X509_NAME *,X509_NAME_new); | ||
183 | 148 | ||
184 | orig= *pp; | 149 | /* Used with sk_pop_free() to free up the internal representation. |
185 | if (sk_X509_NAME_ENTRY_num(ret->entries) > 0) | 150 | * NB: we only free the STACK and not its contents because it is |
186 | { | 151 | * already present in the X509_NAME structure. |
187 | while (sk_X509_NAME_ENTRY_num(ret->entries) > 0) | 152 | */ |
188 | X509_NAME_ENTRY_free( | ||
189 | sk_X509_NAME_ENTRY_pop(ret->entries)); | ||
190 | } | ||
191 | 153 | ||
192 | M_ASN1_D2I_Init(); | 154 | static void sk_internal_free(void *a) |
193 | M_ASN1_D2I_start_sequence(); | 155 | { |
194 | for (;;) | 156 | sk_free(a); |
195 | { | 157 | } |
196 | if (M_ASN1_D2I_end_sequence()) break; | 158 | |
197 | M_ASN1_D2I_get_set_type(X509_NAME_ENTRY,ret->entries, | 159 | static int x509_name_ex_d2i(ASN1_VALUE **val, unsigned char **in, long len, const ASN1_ITEM *it, |
198 | d2i_X509_NAME_ENTRY, | 160 | int tag, int aclass, char opt, ASN1_TLC *ctx) |
199 | X509_NAME_ENTRY_free); | 161 | { |
200 | for (; idx < sk_X509_NAME_ENTRY_num(ret->entries); idx++) | 162 | unsigned char *p = *in, *q; |
201 | { | 163 | STACK *intname = NULL; |
202 | sk_X509_NAME_ENTRY_value(ret->entries,idx)->set=set; | 164 | int i, j, ret; |
203 | } | 165 | X509_NAME *nm = NULL; |
204 | set++; | 166 | STACK_OF(X509_NAME_ENTRY) *entries; |
167 | X509_NAME_ENTRY *entry; | ||
168 | q = p; | ||
169 | |||
170 | /* Get internal representation of Name */ | ||
171 | ret = ASN1_item_ex_d2i((ASN1_VALUE **)&intname, &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL), | ||
172 | tag, aclass, opt, ctx); | ||
173 | |||
174 | if(ret <= 0) return ret; | ||
175 | |||
176 | if(*val) x509_name_ex_free(val, NULL); | ||
177 | if(!x509_name_ex_new((ASN1_VALUE **)&nm, NULL)) goto err; | ||
178 | /* We've decoded it: now cache encoding */ | ||
179 | if(!BUF_MEM_grow(nm->bytes, p - q)) goto err; | ||
180 | memcpy(nm->bytes->data, q, p - q); | ||
181 | |||
182 | /* Convert internal representation to X509_NAME structure */ | ||
183 | for(i = 0; i < sk_num(intname); i++) { | ||
184 | entries = (STACK_OF(X509_NAME_ENTRY) *)sk_value(intname, i); | ||
185 | for(j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) { | ||
186 | entry = sk_X509_NAME_ENTRY_value(entries, j); | ||
187 | entry->set = i; | ||
188 | if(!sk_X509_NAME_ENTRY_push(nm->entries, entry)) | ||
189 | goto err; | ||
205 | } | 190 | } |
206 | 191 | sk_X509_NAME_ENTRY_free(entries); | |
207 | i=(int)(c.p-orig); | ||
208 | if (!BUF_MEM_grow(ret->bytes,i)) goto err; | ||
209 | memcpy(ret->bytes->data,orig,i); | ||
210 | ret->bytes->length=i; | ||
211 | ret->modified=0; | ||
212 | |||
213 | M_ASN1_D2I_Finish(a,X509_NAME_free,ASN1_F_D2I_X509_NAME); | ||
214 | } | 192 | } |
215 | 193 | sk_free(intname); | |
216 | X509_NAME *X509_NAME_new(void) | 194 | nm->modified = 0; |
217 | { | 195 | *val = (ASN1_VALUE *)nm; |
218 | X509_NAME *ret=NULL; | 196 | *in = p; |
219 | ASN1_CTX c; | 197 | return ret; |
220 | 198 | err: | |
221 | M_ASN1_New_Malloc(ret,X509_NAME); | 199 | ASN1err(ASN1_F_D2I_X509_NAME, ERR_R_NESTED_ASN1_ERROR); |
222 | if ((ret->entries=sk_X509_NAME_ENTRY_new_null()) == NULL) | 200 | return 0; |
223 | { c.line=__LINE__; goto err2; } | 201 | } |
224 | M_ASN1_New(ret->bytes,BUF_MEM_new); | 202 | |
225 | ret->modified=1; | 203 | static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass) |
226 | return(ret); | 204 | { |
227 | M_ASN1_New_Error(ASN1_F_X509_NAME_NEW); | 205 | int ret; |
206 | X509_NAME *a = (X509_NAME *)*val; | ||
207 | if(a->modified) { | ||
208 | ret = x509_name_encode((X509_NAME *)a); | ||
209 | if(ret < 0) return ret; | ||
228 | } | 210 | } |
229 | 211 | ret = a->bytes->length; | |
230 | X509_NAME_ENTRY *X509_NAME_ENTRY_new(void) | 212 | if(out != NULL) { |
231 | { | 213 | memcpy(*out,a->bytes->data,ret); |
232 | X509_NAME_ENTRY *ret=NULL; | 214 | *out+=ret; |
233 | ASN1_CTX c; | ||
234 | |||
235 | M_ASN1_New_Malloc(ret,X509_NAME_ENTRY); | ||
236 | /* M_ASN1_New(ret->object,ASN1_OBJECT_new);*/ | ||
237 | ret->object=NULL; | ||
238 | ret->set=0; | ||
239 | M_ASN1_New(ret->value,ASN1_STRING_new); | ||
240 | return(ret); | ||
241 | M_ASN1_New_Error(ASN1_F_X509_NAME_ENTRY_NEW); | ||
242 | } | 215 | } |
216 | return ret; | ||
217 | } | ||
243 | 218 | ||
244 | void X509_NAME_free(X509_NAME *a) | 219 | static int x509_name_encode(X509_NAME *a) |
245 | { | 220 | { |
246 | if(a == NULL) | 221 | STACK *intname = NULL; |
247 | return; | 222 | int len; |
248 | 223 | unsigned char *p; | |
249 | BUF_MEM_free(a->bytes); | 224 | STACK_OF(X509_NAME_ENTRY) *entries = NULL; |
250 | sk_X509_NAME_ENTRY_pop_free(a->entries,X509_NAME_ENTRY_free); | 225 | X509_NAME_ENTRY *entry; |
251 | OPENSSL_free(a); | 226 | int i, set = -1; |
227 | intname = sk_new_null(); | ||
228 | if(!intname) goto memerr; | ||
229 | for(i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) { | ||
230 | entry = sk_X509_NAME_ENTRY_value(a->entries, i); | ||
231 | if(entry->set != set) { | ||
232 | entries = sk_X509_NAME_ENTRY_new_null(); | ||
233 | if(!entries) goto memerr; | ||
234 | if(!sk_push(intname, (char *)entries)) goto memerr; | ||
235 | set = entry->set; | ||
236 | } | ||
237 | if(!sk_X509_NAME_ENTRY_push(entries, entry)) goto memerr; | ||
252 | } | 238 | } |
239 | len = ASN1_item_ex_i2d((ASN1_VALUE **)&intname, NULL, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); | ||
240 | if (!BUF_MEM_grow(a->bytes,len)) goto memerr; | ||
241 | p=(unsigned char *)a->bytes->data; | ||
242 | ASN1_item_ex_i2d((ASN1_VALUE **)&intname, &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); | ||
243 | sk_pop_free(intname, sk_internal_free); | ||
244 | a->modified = 0; | ||
245 | return len; | ||
246 | memerr: | ||
247 | sk_pop_free(intname, sk_internal_free); | ||
248 | ASN1err(ASN1_F_D2I_X509_NAME, ERR_R_MALLOC_FAILURE); | ||
249 | return -1; | ||
250 | } | ||
253 | 251 | ||
254 | void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) | ||
255 | { | ||
256 | if (a == NULL) return; | ||
257 | ASN1_OBJECT_free(a->object); | ||
258 | M_ASN1_BIT_STRING_free(a->value); | ||
259 | OPENSSL_free(a); | ||
260 | } | ||
261 | 252 | ||
262 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name) | 253 | int X509_NAME_set(X509_NAME **xn, X509_NAME *name) |
263 | { | 254 | { |
264 | X509_NAME *in; | 255 | X509_NAME *in; |
265 | 256 | ||
266 | if (*xn == NULL) return(0); | 257 | if (!xn || !name) return(0); |
267 | 258 | ||
268 | if (*xn != name) | 259 | if (*xn != name) |
269 | { | 260 | { |
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c index 4397a404b5..55630294b6 100644 --- a/src/lib/libcrypto/asn1/x_pubkey.c +++ b/src/lib/libcrypto/asn1/x_pubkey.c | |||
@@ -58,62 +58,25 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | 63 | ||
64 | int i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **pp) | 64 | /* Minor tweak to operation: free up EVP_PKEY */ |
65 | { | 65 | static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) |
66 | M_ASN1_I2D_vars(a); | 66 | { |
67 | 67 | if(operation == ASN1_OP_FREE_POST) { | |
68 | M_ASN1_I2D_len(a->algor, i2d_X509_ALGOR); | 68 | X509_PUBKEY *pubkey = (X509_PUBKEY *)*pval; |
69 | M_ASN1_I2D_len(a->public_key, i2d_ASN1_BIT_STRING); | 69 | EVP_PKEY_free(pubkey->pkey); |
70 | |||
71 | M_ASN1_I2D_seq_total(); | ||
72 | |||
73 | M_ASN1_I2D_put(a->algor, i2d_X509_ALGOR); | ||
74 | M_ASN1_I2D_put(a->public_key, i2d_ASN1_BIT_STRING); | ||
75 | |||
76 | M_ASN1_I2D_finish(); | ||
77 | } | ||
78 | |||
79 | X509_PUBKEY *d2i_X509_PUBKEY(X509_PUBKEY **a, unsigned char **pp, | ||
80 | long length) | ||
81 | { | ||
82 | M_ASN1_D2I_vars(a,X509_PUBKEY *,X509_PUBKEY_new); | ||
83 | |||
84 | M_ASN1_D2I_Init(); | ||
85 | M_ASN1_D2I_start_sequence(); | ||
86 | M_ASN1_D2I_get(ret->algor,d2i_X509_ALGOR); | ||
87 | M_ASN1_D2I_get(ret->public_key,d2i_ASN1_BIT_STRING); | ||
88 | if (ret->pkey != NULL) | ||
89 | { | ||
90 | EVP_PKEY_free(ret->pkey); | ||
91 | ret->pkey=NULL; | ||
92 | } | ||
93 | M_ASN1_D2I_Finish(a,X509_PUBKEY_free,ASN1_F_D2I_X509_PUBKEY); | ||
94 | } | 70 | } |
71 | return 1; | ||
72 | } | ||
95 | 73 | ||
96 | X509_PUBKEY *X509_PUBKEY_new(void) | 74 | ASN1_SEQUENCE_cb(X509_PUBKEY, pubkey_cb) = { |
97 | { | 75 | ASN1_SIMPLE(X509_PUBKEY, algor, X509_ALGOR), |
98 | X509_PUBKEY *ret=NULL; | 76 | ASN1_SIMPLE(X509_PUBKEY, public_key, ASN1_BIT_STRING) |
99 | ASN1_CTX c; | 77 | } ASN1_SEQUENCE_END_cb(X509_PUBKEY, X509_PUBKEY) |
100 | |||
101 | M_ASN1_New_Malloc(ret,X509_PUBKEY); | ||
102 | M_ASN1_New(ret->algor,X509_ALGOR_new); | ||
103 | M_ASN1_New(ret->public_key,M_ASN1_BIT_STRING_new); | ||
104 | ret->pkey=NULL; | ||
105 | return(ret); | ||
106 | M_ASN1_New_Error(ASN1_F_X509_PUBKEY_NEW); | ||
107 | } | ||
108 | 78 | ||
109 | void X509_PUBKEY_free(X509_PUBKEY *a) | 79 | IMPLEMENT_ASN1_FUNCTIONS(X509_PUBKEY) |
110 | { | ||
111 | if (a == NULL) return; | ||
112 | X509_ALGOR_free(a->algor); | ||
113 | M_ASN1_BIT_STRING_free(a->public_key); | ||
114 | if (a->pkey != NULL) EVP_PKEY_free(a->pkey); | ||
115 | OPENSSL_free(a); | ||
116 | } | ||
117 | 80 | ||
118 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) | 81 | int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) |
119 | { | 82 | { |
@@ -146,7 +109,7 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) | |||
146 | } | 109 | } |
147 | } | 110 | } |
148 | else | 111 | else |
149 | #ifndef NO_DSA | 112 | #ifndef OPENSSL_NO_DSA |
150 | if (pkey->type == EVP_PKEY_DSA) | 113 | if (pkey->type == EVP_PKEY_DSA) |
151 | { | 114 | { |
152 | unsigned char *pp; | 115 | unsigned char *pp; |
@@ -206,7 +169,8 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) | |||
206 | long j; | 169 | long j; |
207 | int type; | 170 | int type; |
208 | unsigned char *p; | 171 | unsigned char *p; |
209 | #ifndef NO_DSA | 172 | #ifndef OPENSSL_NO_DSA |
173 | const unsigned char *cp; | ||
210 | X509_ALGOR *a; | 174 | X509_ALGOR *a; |
211 | #endif | 175 | #endif |
212 | 176 | ||
@@ -230,16 +194,16 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) | |||
230 | } | 194 | } |
231 | ret->save_parameters=0; | 195 | ret->save_parameters=0; |
232 | 196 | ||
233 | #ifndef NO_DSA | 197 | #ifndef OPENSSL_NO_DSA |
234 | a=key->algor; | 198 | a=key->algor; |
235 | if (ret->type == EVP_PKEY_DSA) | 199 | if (ret->type == EVP_PKEY_DSA) |
236 | { | 200 | { |
237 | if (a->parameter && (a->parameter->type == V_ASN1_SEQUENCE)) | 201 | if (a->parameter && (a->parameter->type == V_ASN1_SEQUENCE)) |
238 | { | 202 | { |
239 | ret->pkey.dsa->write_params=0; | 203 | ret->pkey.dsa->write_params=0; |
240 | p=a->parameter->value.sequence->data; | 204 | cp=p=a->parameter->value.sequence->data; |
241 | j=a->parameter->value.sequence->length; | 205 | j=a->parameter->value.sequence->length; |
242 | if (!d2i_DSAparams(&ret->pkey.dsa,&p,(long)j)) | 206 | if (!d2i_DSAparams(&ret->pkey.dsa,&cp,(long)j)) |
243 | goto err; | 207 | goto err; |
244 | } | 208 | } |
245 | ret->save_parameters=1; | 209 | ret->save_parameters=1; |
@@ -289,7 +253,7 @@ int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp) | |||
289 | /* The following are equivalents but which return RSA and DSA | 253 | /* The following are equivalents but which return RSA and DSA |
290 | * keys | 254 | * keys |
291 | */ | 255 | */ |
292 | #ifndef NO_RSA | 256 | #ifndef OPENSSL_NO_RSA |
293 | RSA *d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, | 257 | RSA *d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, |
294 | long length) | 258 | long length) |
295 | { | 259 | { |
@@ -327,7 +291,7 @@ int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp) | |||
327 | } | 291 | } |
328 | #endif | 292 | #endif |
329 | 293 | ||
330 | #ifndef NO_DSA | 294 | #ifndef OPENSSL_NO_DSA |
331 | DSA *d2i_DSA_PUBKEY(DSA **a, unsigned char **pp, | 295 | DSA *d2i_DSA_PUBKEY(DSA **a, unsigned char **pp, |
332 | long length) | 296 | long length) |
333 | { | 297 | { |
diff --git a/src/lib/libcrypto/asn1/x_req.c b/src/lib/libcrypto/asn1/x_req.c index 6dddd4f653..b3f18ebc12 100644 --- a/src/lib/libcrypto/asn1/x_req.c +++ b/src/lib/libcrypto/asn1/x_req.c | |||
@@ -58,200 +58,55 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | 63 | ||
64 | int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **pp) | 64 | /* X509_REQ_INFO is handled in an unusual way to get round |
65 | { | 65 | * invalid encodings. Some broken certificate requests don't |
66 | M_ASN1_I2D_vars(a); | 66 | * encode the attributes field if it is empty. This is in |
67 | 67 | * violation of PKCS#10 but we need to tolerate it. We do | |
68 | if(a->asn1) { | 68 | * this by making the attributes field OPTIONAL then using |
69 | if(pp) { | 69 | * the callback to initialise it to an empty STACK. |
70 | memcpy(*pp, a->asn1, a->length); | 70 | * |
71 | *pp += a->length; | 71 | * This means that the field will be correctly encoded unless |
72 | } | 72 | * we NULL out the field. |
73 | return a->length; | 73 | * |
74 | } | 74 | * As a result we no longer need the req_kludge field because |
75 | 75 | * the information is now contained in the attributes field: | |
76 | M_ASN1_I2D_len(a->version, i2d_ASN1_INTEGER); | 76 | * 1. If it is NULL then it's the invalid omission. |
77 | M_ASN1_I2D_len(a->subject, i2d_X509_NAME); | 77 | * 2. If it is empty it is the correct encoding. |
78 | M_ASN1_I2D_len(a->pubkey, i2d_X509_PUBKEY); | 78 | * 3. If it is not empty then some attributes are present. |
79 | 79 | * | |
80 | /* this is a *nasty* hack reported to be required to | 80 | */ |
81 | * allow some CA Software to accept the cert request. | ||
82 | * It is not following the PKCS standards ... | ||
83 | * PKCS#10 pg 5 | ||
84 | * attributes [0] IMPLICIT Attributes | ||
85 | * NOTE: no OPTIONAL ... so it *must* be there | ||
86 | */ | ||
87 | if (a->req_kludge) | ||
88 | { | ||
89 | M_ASN1_I2D_len_IMP_SET_opt_type(X509_ATTRIBUTE,a->attributes,i2d_X509_ATTRIBUTE,0); | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | M_ASN1_I2D_len_IMP_SET_type(X509_ATTRIBUTE,a->attributes, | ||
94 | i2d_X509_ATTRIBUTE,0); | ||
95 | } | ||
96 | |||
97 | M_ASN1_I2D_seq_total(); | ||
98 | M_ASN1_I2D_put(a->version, i2d_ASN1_INTEGER); | ||
99 | M_ASN1_I2D_put(a->subject, i2d_X509_NAME); | ||
100 | M_ASN1_I2D_put(a->pubkey, i2d_X509_PUBKEY); | ||
101 | 81 | ||
102 | /* this is a *nasty* hack reported to be required by some CA's. | 82 | static int rinf_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) |
103 | * It is not following the PKCS standards ... | 83 | { |
104 | * PKCS#10 pg 5 | 84 | X509_REQ_INFO *rinf = (X509_REQ_INFO *)*pval; |
105 | * attributes [0] IMPLICIT Attributes | ||
106 | * NOTE: no OPTIONAL ... so it *must* be there | ||
107 | */ | ||
108 | if (a->req_kludge) | ||
109 | { | ||
110 | M_ASN1_I2D_put_IMP_SET_opt_type(X509_ATTRIBUTE,a->attributes, | ||
111 | i2d_X509_ATTRIBUTE,0); | ||
112 | } | ||
113 | else | ||
114 | { | ||
115 | M_ASN1_I2D_put_IMP_SET_type(X509_ATTRIBUTE,a->attributes, | ||
116 | i2d_X509_ATTRIBUTE,0); | ||
117 | } | ||
118 | 85 | ||
119 | M_ASN1_I2D_finish(); | 86 | if(operation == ASN1_OP_NEW_POST) { |
87 | rinf->attributes = sk_X509_ATTRIBUTE_new_null(); | ||
88 | if(!rinf->attributes) return 0; | ||
120 | } | 89 | } |
121 | 90 | return 1; | |
122 | X509_REQ_INFO *d2i_X509_REQ_INFO(X509_REQ_INFO **a, unsigned char **pp, | 91 | } |
123 | long length) | 92 | |
124 | { | 93 | ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb) = { |
125 | M_ASN1_D2I_vars(a,X509_REQ_INFO *,X509_REQ_INFO_new); | 94 | ASN1_SIMPLE(X509_REQ_INFO, version, ASN1_INTEGER), |
126 | 95 | ASN1_SIMPLE(X509_REQ_INFO, subject, X509_NAME), | |
127 | M_ASN1_D2I_Init(); | 96 | ASN1_SIMPLE(X509_REQ_INFO, pubkey, X509_PUBKEY), |
128 | M_ASN1_D2I_start_sequence(); | 97 | /* This isn't really OPTIONAL but it gets round invalid |
129 | M_ASN1_D2I_get(ret->version,d2i_ASN1_INTEGER); | 98 | * encodings |
130 | M_ASN1_D2I_get(ret->subject,d2i_X509_NAME); | ||
131 | M_ASN1_D2I_get(ret->pubkey,d2i_X509_PUBKEY); | ||
132 | |||
133 | /* this is a *nasty* hack to allow for some CA's that | ||
134 | * have been reported as requiring it. | ||
135 | * It is not following the PKCS standards ... | ||
136 | * PKCS#10 pg 5 | ||
137 | * attributes [0] IMPLICIT Attributes | ||
138 | * NOTE: no OPTIONAL ... so it *must* be there | ||
139 | */ | 99 | */ |
140 | if (asn1_Finish(&c)) | 100 | ASN1_IMP_SET_OF_OPT(X509_REQ_INFO, attributes, X509_ATTRIBUTE, 0) |
141 | ret->req_kludge=1; | 101 | } ASN1_SEQUENCE_END_enc(X509_REQ_INFO, X509_REQ_INFO) |
142 | else | ||
143 | { | ||
144 | M_ASN1_D2I_get_IMP_set_type(X509_ATTRIBUTE,ret->attributes, | ||
145 | d2i_X509_ATTRIBUTE, | ||
146 | X509_ATTRIBUTE_free,0); | ||
147 | } | ||
148 | |||
149 | M_ASN1_D2I_Finish(a,X509_REQ_INFO_free,ASN1_F_D2I_X509_REQ_INFO); | ||
150 | } | ||
151 | |||
152 | X509_REQ_INFO *X509_REQ_INFO_new(void) | ||
153 | { | ||
154 | X509_REQ_INFO *ret=NULL; | ||
155 | ASN1_CTX c; | ||
156 | |||
157 | M_ASN1_New_Malloc(ret,X509_REQ_INFO); | ||
158 | M_ASN1_New(ret->version,M_ASN1_INTEGER_new); | ||
159 | M_ASN1_New(ret->subject,X509_NAME_new); | ||
160 | M_ASN1_New(ret->pubkey,X509_PUBKEY_new); | ||
161 | M_ASN1_New(ret->attributes,sk_X509_ATTRIBUTE_new_null); | ||
162 | ret->req_kludge=0; | ||
163 | ret->asn1 = NULL; | ||
164 | return(ret); | ||
165 | M_ASN1_New_Error(ASN1_F_X509_REQ_INFO_NEW); | ||
166 | } | ||
167 | |||
168 | void X509_REQ_INFO_free(X509_REQ_INFO *a) | ||
169 | { | ||
170 | if (a == NULL) return; | ||
171 | if(a->asn1) OPENSSL_free(a->asn1); | ||
172 | M_ASN1_INTEGER_free(a->version); | ||
173 | X509_NAME_free(a->subject); | ||
174 | X509_PUBKEY_free(a->pubkey); | ||
175 | sk_X509_ATTRIBUTE_pop_free(a->attributes,X509_ATTRIBUTE_free); | ||
176 | OPENSSL_free(a); | ||
177 | } | ||
178 | 102 | ||
179 | int i2d_X509_REQ(X509_REQ *a, unsigned char **pp) | 103 | IMPLEMENT_ASN1_FUNCTIONS(X509_REQ_INFO) |
180 | { | ||
181 | M_ASN1_I2D_vars(a); | ||
182 | M_ASN1_I2D_len(a->req_info, i2d_X509_REQ_INFO); | ||
183 | M_ASN1_I2D_len(a->sig_alg, i2d_X509_ALGOR); | ||
184 | M_ASN1_I2D_len(a->signature, i2d_ASN1_BIT_STRING); | ||
185 | |||
186 | M_ASN1_I2D_seq_total(); | ||
187 | |||
188 | M_ASN1_I2D_put(a->req_info, i2d_X509_REQ_INFO); | ||
189 | M_ASN1_I2D_put(a->sig_alg, i2d_X509_ALGOR); | ||
190 | M_ASN1_I2D_put(a->signature, i2d_ASN1_BIT_STRING); | ||
191 | |||
192 | M_ASN1_I2D_finish(); | ||
193 | } | ||
194 | |||
195 | X509_REQ *d2i_X509_REQ(X509_REQ **a, unsigned char **pp, long length) | ||
196 | { | ||
197 | M_ASN1_D2I_vars(a,X509_REQ *,X509_REQ_new); | ||
198 | |||
199 | M_ASN1_D2I_Init(); | ||
200 | M_ASN1_D2I_start_sequence(); | ||
201 | M_ASN1_D2I_get(ret->req_info,d2i_X509_REQ_INFO); | ||
202 | |||
203 | /* Keep a copy of the original encoding for signature checking */ | ||
204 | ret->req_info->length = c.p - c.q; | ||
205 | if(!(ret->req_info->asn1 = OPENSSL_malloc(ret->req_info->length))) { | ||
206 | c.line=__LINE__; | ||
207 | c.error = ERR_R_MALLOC_FAILURE; | ||
208 | goto err; | ||
209 | } | ||
210 | |||
211 | memcpy(ret->req_info->asn1, c.q, ret->req_info->length); | ||
212 | |||
213 | M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); | ||
214 | M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); | ||
215 | M_ASN1_D2I_Finish(a,X509_REQ_free,ASN1_F_D2I_X509_REQ); | ||
216 | } | ||
217 | |||
218 | X509_REQ *X509_REQ_new(void) | ||
219 | { | ||
220 | X509_REQ *ret=NULL; | ||
221 | ASN1_CTX c; | ||
222 | |||
223 | M_ASN1_New_Malloc(ret,X509_REQ); | ||
224 | ret->references=1; | ||
225 | M_ASN1_New(ret->req_info,X509_REQ_INFO_new); | ||
226 | M_ASN1_New(ret->sig_alg,X509_ALGOR_new); | ||
227 | M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); | ||
228 | return(ret); | ||
229 | M_ASN1_New_Error(ASN1_F_X509_REQ_NEW); | ||
230 | } | ||
231 | |||
232 | void X509_REQ_free(X509_REQ *a) | ||
233 | { | ||
234 | int i; | ||
235 | |||
236 | if (a == NULL) return; | ||
237 | |||
238 | i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_X509_REQ); | ||
239 | #ifdef REF_PRINT | ||
240 | REF_PRINT("X509_REQ",a); | ||
241 | #endif | ||
242 | if (i > 0) return; | ||
243 | #ifdef REF_CHECK | ||
244 | if (i < 0) | ||
245 | { | ||
246 | fprintf(stderr,"X509_REQ_free, bad reference count\n"); | ||
247 | abort(); | ||
248 | } | ||
249 | #endif | ||
250 | |||
251 | X509_REQ_INFO_free(a->req_info); | ||
252 | X509_ALGOR_free(a->sig_alg); | ||
253 | M_ASN1_BIT_STRING_free(a->signature); | ||
254 | OPENSSL_free(a); | ||
255 | } | ||
256 | 104 | ||
105 | ASN1_SEQUENCE_ref(X509_REQ, 0, CRYPTO_LOCK_X509_INFO) = { | ||
106 | ASN1_SIMPLE(X509_REQ, req_info, X509_REQ_INFO), | ||
107 | ASN1_SIMPLE(X509_REQ, sig_alg, X509_ALGOR), | ||
108 | ASN1_SIMPLE(X509_REQ, signature, ASN1_BIT_STRING) | ||
109 | } ASN1_SEQUENCE_END_ref(X509_REQ, X509_REQ) | ||
257 | 110 | ||
111 | IMPLEMENT_ASN1_FUNCTIONS(X509_REQ) | ||
112 | IMPLEMENT_ASN1_DUP_FUNCTION(X509_REQ) | ||
diff --git a/src/lib/libcrypto/asn1/x_sig.c b/src/lib/libcrypto/asn1/x_sig.c index d79f147647..42efa86c1c 100644 --- a/src/lib/libcrypto/asn1/x_sig.c +++ b/src/lib/libcrypto/asn1/x_sig.c | |||
@@ -58,53 +58,12 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | 63 | ||
64 | int i2d_X509_SIG(X509_SIG *a, unsigned char **pp) | 64 | ASN1_SEQUENCE(X509_SIG) = { |
65 | { | 65 | ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR), |
66 | M_ASN1_I2D_vars(a); | 66 | ASN1_SIMPLE(X509_SIG, digest, ASN1_OCTET_STRING) |
67 | 67 | } ASN1_SEQUENCE_END(X509_SIG) | |
68 | M_ASN1_I2D_len(a->algor, i2d_X509_ALGOR); | ||
69 | M_ASN1_I2D_len(a->digest, i2d_ASN1_OCTET_STRING); | ||
70 | |||
71 | M_ASN1_I2D_seq_total(); | ||
72 | |||
73 | M_ASN1_I2D_put(a->algor, i2d_X509_ALGOR); | ||
74 | M_ASN1_I2D_put(a->digest, i2d_ASN1_OCTET_STRING); | ||
75 | |||
76 | M_ASN1_I2D_finish(); | ||
77 | } | ||
78 | |||
79 | X509_SIG *d2i_X509_SIG(X509_SIG **a, unsigned char **pp, long length) | ||
80 | { | ||
81 | M_ASN1_D2I_vars(a,X509_SIG *,X509_SIG_new); | ||
82 | |||
83 | M_ASN1_D2I_Init(); | ||
84 | M_ASN1_D2I_start_sequence(); | ||
85 | M_ASN1_D2I_get(ret->algor,d2i_X509_ALGOR); | ||
86 | M_ASN1_D2I_get(ret->digest,d2i_ASN1_OCTET_STRING); | ||
87 | M_ASN1_D2I_Finish(a,X509_SIG_free,ASN1_F_D2I_X509_SIG); | ||
88 | } | ||
89 | |||
90 | X509_SIG *X509_SIG_new(void) | ||
91 | { | ||
92 | X509_SIG *ret=NULL; | ||
93 | ASN1_CTX c; | ||
94 | |||
95 | M_ASN1_New_Malloc(ret,X509_SIG); | ||
96 | M_ASN1_New(ret->algor,X509_ALGOR_new); | ||
97 | M_ASN1_New(ret->digest,M_ASN1_OCTET_STRING_new); | ||
98 | return(ret); | ||
99 | M_ASN1_New_Error(ASN1_F_X509_SIG_NEW); | ||
100 | } | ||
101 | |||
102 | void X509_SIG_free(X509_SIG *a) | ||
103 | { | ||
104 | if (a == NULL) return; | ||
105 | X509_ALGOR_free(a->algor); | ||
106 | M_ASN1_OCTET_STRING_free(a->digest); | ||
107 | OPENSSL_free(a); | ||
108 | } | ||
109 | |||
110 | 68 | ||
69 | IMPLEMENT_ASN1_FUNCTIONS(X509_SIG) | ||
diff --git a/src/lib/libcrypto/asn1/x_spki.c b/src/lib/libcrypto/asn1/x_spki.c index 4f01888f7d..2aece077c5 100644 --- a/src/lib/libcrypto/asn1/x_spki.c +++ b/src/lib/libcrypto/asn1/x_spki.c | |||
@@ -63,104 +63,19 @@ | |||
63 | #include <stdio.h> | 63 | #include <stdio.h> |
64 | #include "cryptlib.h" | 64 | #include "cryptlib.h" |
65 | #include <openssl/x509.h> | 65 | #include <openssl/x509.h> |
66 | #include <openssl/asn1_mac.h> | 66 | #include <openssl/asn1t.h> |
67 | 67 | ||
68 | int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **pp) | 68 | ASN1_SEQUENCE(NETSCAPE_SPKAC) = { |
69 | { | 69 | ASN1_SIMPLE(NETSCAPE_SPKAC, pubkey, X509_PUBKEY), |
70 | M_ASN1_I2D_vars(a); | 70 | ASN1_SIMPLE(NETSCAPE_SPKAC, challenge, ASN1_IA5STRING) |
71 | } ASN1_SEQUENCE_END(NETSCAPE_SPKAC) | ||
71 | 72 | ||
72 | M_ASN1_I2D_len(a->pubkey, i2d_X509_PUBKEY); | 73 | IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKAC) |
73 | M_ASN1_I2D_len(a->challenge, i2d_ASN1_IA5STRING); | ||
74 | 74 | ||
75 | M_ASN1_I2D_seq_total(); | 75 | ASN1_SEQUENCE(NETSCAPE_SPKI) = { |
76 | 76 | ASN1_SIMPLE(NETSCAPE_SPKI, spkac, NETSCAPE_SPKAC), | |
77 | M_ASN1_I2D_put(a->pubkey, i2d_X509_PUBKEY); | 77 | ASN1_SIMPLE(NETSCAPE_SPKI, sig_algor, X509_ALGOR), |
78 | M_ASN1_I2D_put(a->challenge, i2d_ASN1_IA5STRING); | 78 | ASN1_SIMPLE(NETSCAPE_SPKI, signature, ASN1_BIT_STRING) |
79 | 79 | } ASN1_SEQUENCE_END(NETSCAPE_SPKI) | |
80 | M_ASN1_I2D_finish(); | ||
81 | } | ||
82 | |||
83 | NETSCAPE_SPKAC *d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a, unsigned char **pp, | ||
84 | long length) | ||
85 | { | ||
86 | M_ASN1_D2I_vars(a,NETSCAPE_SPKAC *,NETSCAPE_SPKAC_new); | ||
87 | |||
88 | M_ASN1_D2I_Init(); | ||
89 | M_ASN1_D2I_start_sequence(); | ||
90 | M_ASN1_D2I_get(ret->pubkey,d2i_X509_PUBKEY); | ||
91 | M_ASN1_D2I_get(ret->challenge,d2i_ASN1_IA5STRING); | ||
92 | M_ASN1_D2I_Finish(a,NETSCAPE_SPKAC_free,ASN1_F_D2I_NETSCAPE_SPKAC); | ||
93 | } | ||
94 | |||
95 | NETSCAPE_SPKAC *NETSCAPE_SPKAC_new(void) | ||
96 | { | ||
97 | NETSCAPE_SPKAC *ret=NULL; | ||
98 | ASN1_CTX c; | ||
99 | |||
100 | M_ASN1_New_Malloc(ret,NETSCAPE_SPKAC); | ||
101 | M_ASN1_New(ret->pubkey,X509_PUBKEY_new); | ||
102 | M_ASN1_New(ret->challenge,M_ASN1_IA5STRING_new); | ||
103 | return(ret); | ||
104 | M_ASN1_New_Error(ASN1_F_NETSCAPE_SPKAC_NEW); | ||
105 | } | ||
106 | |||
107 | void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a) | ||
108 | { | ||
109 | if (a == NULL) return; | ||
110 | X509_PUBKEY_free(a->pubkey); | ||
111 | M_ASN1_IA5STRING_free(a->challenge); | ||
112 | OPENSSL_free(a); | ||
113 | } | ||
114 | |||
115 | int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **pp) | ||
116 | { | ||
117 | M_ASN1_I2D_vars(a); | ||
118 | |||
119 | M_ASN1_I2D_len(a->spkac, i2d_NETSCAPE_SPKAC); | ||
120 | M_ASN1_I2D_len(a->sig_algor, i2d_X509_ALGOR); | ||
121 | M_ASN1_I2D_len(a->signature, i2d_ASN1_BIT_STRING); | ||
122 | |||
123 | M_ASN1_I2D_seq_total(); | ||
124 | |||
125 | M_ASN1_I2D_put(a->spkac, i2d_NETSCAPE_SPKAC); | ||
126 | M_ASN1_I2D_put(a->sig_algor, i2d_X509_ALGOR); | ||
127 | M_ASN1_I2D_put(a->signature, i2d_ASN1_BIT_STRING); | ||
128 | |||
129 | M_ASN1_I2D_finish(); | ||
130 | } | ||
131 | |||
132 | NETSCAPE_SPKI *d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, unsigned char **pp, | ||
133 | long length) | ||
134 | { | ||
135 | M_ASN1_D2I_vars(a,NETSCAPE_SPKI *,NETSCAPE_SPKI_new); | ||
136 | |||
137 | M_ASN1_D2I_Init(); | ||
138 | M_ASN1_D2I_start_sequence(); | ||
139 | M_ASN1_D2I_get(ret->spkac,d2i_NETSCAPE_SPKAC); | ||
140 | M_ASN1_D2I_get(ret->sig_algor,d2i_X509_ALGOR); | ||
141 | M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); | ||
142 | M_ASN1_D2I_Finish(a,NETSCAPE_SPKI_free,ASN1_F_D2I_NETSCAPE_SPKI); | ||
143 | } | ||
144 | |||
145 | NETSCAPE_SPKI *NETSCAPE_SPKI_new(void) | ||
146 | { | ||
147 | NETSCAPE_SPKI *ret=NULL; | ||
148 | ASN1_CTX c; | ||
149 | |||
150 | M_ASN1_New_Malloc(ret,NETSCAPE_SPKI); | ||
151 | M_ASN1_New(ret->spkac,NETSCAPE_SPKAC_new); | ||
152 | M_ASN1_New(ret->sig_algor,X509_ALGOR_new); | ||
153 | M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); | ||
154 | return(ret); | ||
155 | M_ASN1_New_Error(ASN1_F_NETSCAPE_SPKI_NEW); | ||
156 | } | ||
157 | |||
158 | void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a) | ||
159 | { | ||
160 | if (a == NULL) return; | ||
161 | NETSCAPE_SPKAC_free(a->spkac); | ||
162 | X509_ALGOR_free(a->sig_algor); | ||
163 | M_ASN1_BIT_STRING_free(a->signature); | ||
164 | OPENSSL_free(a); | ||
165 | } | ||
166 | 80 | ||
81 | IMPLEMENT_ASN1_FUNCTIONS(NETSCAPE_SPKI) | ||
diff --git a/src/lib/libcrypto/asn1/x_val.c b/src/lib/libcrypto/asn1/x_val.c index 0f8f020b57..dc17c67758 100644 --- a/src/lib/libcrypto/asn1/x_val.c +++ b/src/lib/libcrypto/asn1/x_val.c | |||
@@ -58,52 +58,12 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/asn1_mac.h> | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | 63 | ||
64 | int i2d_X509_VAL(X509_VAL *a, unsigned char **pp) | 64 | ASN1_SEQUENCE(X509_VAL) = { |
65 | { | 65 | ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME), |
66 | M_ASN1_I2D_vars(a); | 66 | ASN1_SIMPLE(X509_VAL, notAfter, ASN1_TIME) |
67 | 67 | } ASN1_SEQUENCE_END(X509_VAL) | |
68 | M_ASN1_I2D_len(a->notBefore,i2d_ASN1_TIME); | ||
69 | M_ASN1_I2D_len(a->notAfter,i2d_ASN1_TIME); | ||
70 | |||
71 | M_ASN1_I2D_seq_total(); | ||
72 | |||
73 | M_ASN1_I2D_put(a->notBefore,i2d_ASN1_TIME); | ||
74 | M_ASN1_I2D_put(a->notAfter,i2d_ASN1_TIME); | ||
75 | |||
76 | M_ASN1_I2D_finish(); | ||
77 | } | ||
78 | |||
79 | X509_VAL *d2i_X509_VAL(X509_VAL **a, unsigned char **pp, long length) | ||
80 | { | ||
81 | M_ASN1_D2I_vars(a,X509_VAL *,X509_VAL_new); | ||
82 | |||
83 | M_ASN1_D2I_Init(); | ||
84 | M_ASN1_D2I_start_sequence(); | ||
85 | M_ASN1_D2I_get(ret->notBefore,d2i_ASN1_TIME); | ||
86 | M_ASN1_D2I_get(ret->notAfter,d2i_ASN1_TIME); | ||
87 | M_ASN1_D2I_Finish(a,X509_VAL_free,ASN1_F_D2I_X509_VAL); | ||
88 | } | ||
89 | |||
90 | X509_VAL *X509_VAL_new(void) | ||
91 | { | ||
92 | X509_VAL *ret=NULL; | ||
93 | ASN1_CTX c; | ||
94 | |||
95 | M_ASN1_New_Malloc(ret,X509_VAL); | ||
96 | M_ASN1_New(ret->notBefore,M_ASN1_TIME_new); | ||
97 | M_ASN1_New(ret->notAfter,M_ASN1_TIME_new); | ||
98 | return(ret); | ||
99 | M_ASN1_New_Error(ASN1_F_X509_VAL_NEW); | ||
100 | } | ||
101 | |||
102 | void X509_VAL_free(X509_VAL *a) | ||
103 | { | ||
104 | if (a == NULL) return; | ||
105 | M_ASN1_TIME_free(a->notBefore); | ||
106 | M_ASN1_TIME_free(a->notAfter); | ||
107 | OPENSSL_free(a); | ||
108 | } | ||
109 | 68 | ||
69 | IMPLEMENT_ASN1_FUNCTIONS(X509_VAL) | ||
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c index 61ba856b17..b50167ce43 100644 --- a/src/lib/libcrypto/asn1/x_x509.c +++ b/src/lib/libcrypto/asn1/x_x509.c | |||
@@ -59,12 +59,71 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1t.h> |
63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
64 | #include <openssl/x509v3.h> | 64 | #include <openssl/x509v3.h> |
65 | 65 | ||
66 | static int x509_meth_num = 0; | 66 | ASN1_SEQUENCE(X509_CINF) = { |
67 | static STACK_OF(CRYPTO_EX_DATA_FUNCS) *x509_meth = NULL; | 67 | ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0), |
68 | ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER), | ||
69 | ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR), | ||
70 | ASN1_SIMPLE(X509_CINF, issuer, X509_NAME), | ||
71 | ASN1_SIMPLE(X509_CINF, validity, X509_VAL), | ||
72 | ASN1_SIMPLE(X509_CINF, subject, X509_NAME), | ||
73 | ASN1_SIMPLE(X509_CINF, key, X509_PUBKEY), | ||
74 | ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1), | ||
75 | ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2), | ||
76 | ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3) | ||
77 | } ASN1_SEQUENCE_END(X509_CINF) | ||
78 | |||
79 | IMPLEMENT_ASN1_FUNCTIONS(X509_CINF) | ||
80 | /* X509 top level structure needs a bit of customisation */ | ||
81 | |||
82 | static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it) | ||
83 | { | ||
84 | X509 *ret = (X509 *)*pval; | ||
85 | |||
86 | switch(operation) { | ||
87 | |||
88 | case ASN1_OP_NEW_POST: | ||
89 | ret->valid=0; | ||
90 | ret->name = NULL; | ||
91 | ret->ex_flags = 0; | ||
92 | ret->ex_pathlen = -1; | ||
93 | ret->skid = NULL; | ||
94 | ret->akid = NULL; | ||
95 | ret->aux = NULL; | ||
96 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data); | ||
97 | break; | ||
98 | |||
99 | case ASN1_OP_D2I_POST: | ||
100 | if (ret->name != NULL) OPENSSL_free(ret->name); | ||
101 | ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0); | ||
102 | break; | ||
103 | |||
104 | case ASN1_OP_FREE_POST: | ||
105 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509, ret, &ret->ex_data); | ||
106 | X509_CERT_AUX_free(ret->aux); | ||
107 | ASN1_OCTET_STRING_free(ret->skid); | ||
108 | AUTHORITY_KEYID_free(ret->akid); | ||
109 | |||
110 | if (ret->name != NULL) OPENSSL_free(ret->name); | ||
111 | break; | ||
112 | |||
113 | } | ||
114 | |||
115 | return 1; | ||
116 | |||
117 | } | ||
118 | |||
119 | ASN1_SEQUENCE_ref(X509, x509_cb, CRYPTO_LOCK_X509) = { | ||
120 | ASN1_SIMPLE(X509, cert_info, X509_CINF), | ||
121 | ASN1_SIMPLE(X509, sig_alg, X509_ALGOR), | ||
122 | ASN1_SIMPLE(X509, signature, ASN1_BIT_STRING) | ||
123 | } ASN1_SEQUENCE_END_ref(X509, X509) | ||
124 | |||
125 | IMPLEMENT_ASN1_FUNCTIONS(X509) | ||
126 | IMPLEMENT_ASN1_DUP_FUNCTION(X509) | ||
68 | 127 | ||
69 | static ASN1_METHOD meth={ | 128 | static ASN1_METHOD meth={ |
70 | (int (*)()) i2d_X509, | 129 | (int (*)()) i2d_X509, |
@@ -77,97 +136,11 @@ ASN1_METHOD *X509_asn1_meth(void) | |||
77 | return(&meth); | 136 | return(&meth); |
78 | } | 137 | } |
79 | 138 | ||
80 | int i2d_X509(X509 *a, unsigned char **pp) | ||
81 | { | ||
82 | M_ASN1_I2D_vars(a); | ||
83 | |||
84 | M_ASN1_I2D_len(a->cert_info, i2d_X509_CINF); | ||
85 | M_ASN1_I2D_len(a->sig_alg, i2d_X509_ALGOR); | ||
86 | M_ASN1_I2D_len(a->signature, i2d_ASN1_BIT_STRING); | ||
87 | |||
88 | M_ASN1_I2D_seq_total(); | ||
89 | |||
90 | M_ASN1_I2D_put(a->cert_info, i2d_X509_CINF); | ||
91 | M_ASN1_I2D_put(a->sig_alg, i2d_X509_ALGOR); | ||
92 | M_ASN1_I2D_put(a->signature, i2d_ASN1_BIT_STRING); | ||
93 | |||
94 | M_ASN1_I2D_finish(); | ||
95 | } | ||
96 | |||
97 | X509 *d2i_X509(X509 **a, unsigned char **pp, long length) | ||
98 | { | ||
99 | M_ASN1_D2I_vars(a,X509 *,X509_new); | ||
100 | |||
101 | M_ASN1_D2I_Init(); | ||
102 | M_ASN1_D2I_start_sequence(); | ||
103 | M_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF); | ||
104 | M_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR); | ||
105 | M_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING); | ||
106 | if (ret->name != NULL) OPENSSL_free(ret->name); | ||
107 | ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0); | ||
108 | |||
109 | M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509); | ||
110 | } | ||
111 | |||
112 | X509 *X509_new(void) | ||
113 | { | ||
114 | X509 *ret=NULL; | ||
115 | ASN1_CTX c; | ||
116 | |||
117 | M_ASN1_New_Malloc(ret,X509); | ||
118 | ret->valid=0; | ||
119 | ret->references=1; | ||
120 | ret->name = NULL; | ||
121 | ret->ex_flags = 0; | ||
122 | ret->ex_pathlen = -1; | ||
123 | ret->skid = NULL; | ||
124 | ret->akid = NULL; | ||
125 | ret->aux = NULL; | ||
126 | M_ASN1_New(ret->cert_info,X509_CINF_new); | ||
127 | M_ASN1_New(ret->sig_alg,X509_ALGOR_new); | ||
128 | M_ASN1_New(ret->signature,M_ASN1_BIT_STRING_new); | ||
129 | CRYPTO_new_ex_data(x509_meth, ret, &ret->ex_data); | ||
130 | return(ret); | ||
131 | M_ASN1_New_Error(ASN1_F_X509_NEW); | ||
132 | } | ||
133 | |||
134 | void X509_free(X509 *a) | ||
135 | { | ||
136 | int i; | ||
137 | |||
138 | if (a == NULL) return; | ||
139 | |||
140 | i=CRYPTO_add(&a->references,-1,CRYPTO_LOCK_X509); | ||
141 | #ifdef REF_PRINT | ||
142 | REF_PRINT("X509",a); | ||
143 | #endif | ||
144 | if (i > 0) return; | ||
145 | #ifdef REF_CHECK | ||
146 | if (i < 0) | ||
147 | { | ||
148 | fprintf(stderr,"X509_free, bad reference count\n"); | ||
149 | abort(); | ||
150 | } | ||
151 | #endif | ||
152 | |||
153 | CRYPTO_free_ex_data(x509_meth,a,&a->ex_data); | ||
154 | X509_CINF_free(a->cert_info); | ||
155 | X509_ALGOR_free(a->sig_alg); | ||
156 | M_ASN1_BIT_STRING_free(a->signature); | ||
157 | X509_CERT_AUX_free(a->aux); | ||
158 | ASN1_OCTET_STRING_free(a->skid); | ||
159 | AUTHORITY_KEYID_free(a->akid); | ||
160 | |||
161 | if (a->name != NULL) OPENSSL_free(a->name); | ||
162 | OPENSSL_free(a); | ||
163 | } | ||
164 | |||
165 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 139 | int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
166 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) | 140 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func) |
167 | { | 141 | { |
168 | x509_meth_num++; | 142 | return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, argl, argp, |
169 | return(CRYPTO_get_ex_new_index(x509_meth_num-1, | 143 | new_func, dup_func, free_func); |
170 | &x509_meth,argl,argp,new_func,dup_func,free_func)); | ||
171 | } | 144 | } |
172 | 145 | ||
173 | int X509_set_ex_data(X509 *r, int idx, void *arg) | 146 | int X509_set_ex_data(X509 *r, int idx, void *arg) |
diff --git a/src/lib/libcrypto/asn1/x_x509a.c b/src/lib/libcrypto/asn1/x_x509a.c index ebcce87bf2..f244768b7e 100644 --- a/src/lib/libcrypto/asn1/x_x509a.c +++ b/src/lib/libcrypto/asn1/x_x509a.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
62 | #include <openssl/asn1_mac.h> | 62 | #include <openssl/asn1t.h> |
63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
64 | 64 | ||
65 | /* X509_CERT_AUX routines. These are used to encode additional | 65 | /* X509_CERT_AUX routines. These are used to encode additional |
@@ -71,72 +71,15 @@ | |||
71 | 71 | ||
72 | static X509_CERT_AUX *aux_get(X509 *x); | 72 | static X509_CERT_AUX *aux_get(X509 *x); |
73 | 73 | ||
74 | X509_CERT_AUX *d2i_X509_CERT_AUX(X509_CERT_AUX **a, unsigned char **pp, long length) | 74 | ASN1_SEQUENCE(X509_CERT_AUX) = { |
75 | { | 75 | ASN1_SEQUENCE_OF_OPT(X509_CERT_AUX, trust, ASN1_OBJECT), |
76 | M_ASN1_D2I_vars(a, X509_CERT_AUX *, X509_CERT_AUX_new); | 76 | ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, reject, ASN1_OBJECT, 0), |
77 | 77 | ASN1_OPT(X509_CERT_AUX, alias, ASN1_UTF8STRING), | |
78 | M_ASN1_D2I_Init(); | 78 | ASN1_OPT(X509_CERT_AUX, keyid, ASN1_OCTET_STRING), |
79 | M_ASN1_D2I_start_sequence(); | 79 | ASN1_IMP_SEQUENCE_OF_OPT(X509_CERT_AUX, other, X509_ALGOR, 1) |
80 | 80 | } ASN1_SEQUENCE_END(X509_CERT_AUX) | |
81 | M_ASN1_D2I_get_seq_opt_type(ASN1_OBJECT, ret->trust, | ||
82 | d2i_ASN1_OBJECT, ASN1_OBJECT_free); | ||
83 | M_ASN1_D2I_get_IMP_set_opt_type(ASN1_OBJECT, ret->reject, | ||
84 | d2i_ASN1_OBJECT, ASN1_OBJECT_free, 0); | ||
85 | M_ASN1_D2I_get_opt(ret->alias, d2i_ASN1_UTF8STRING, V_ASN1_UTF8STRING); | ||
86 | M_ASN1_D2I_get_opt(ret->keyid, d2i_ASN1_OCTET_STRING, V_ASN1_OCTET_STRING); | ||
87 | M_ASN1_D2I_get_IMP_set_opt_type(X509_ALGOR, ret->other, | ||
88 | d2i_X509_ALGOR, X509_ALGOR_free, 1); | ||
89 | |||
90 | M_ASN1_D2I_Finish(a, X509_CERT_AUX_free, ASN1_F_D2I_X509_CERT_AUX); | ||
91 | } | ||
92 | |||
93 | X509_CERT_AUX *X509_CERT_AUX_new() | ||
94 | { | ||
95 | X509_CERT_AUX *ret = NULL; | ||
96 | ASN1_CTX c; | ||
97 | M_ASN1_New_Malloc(ret, X509_CERT_AUX); | ||
98 | ret->trust = NULL; | ||
99 | ret->reject = NULL; | ||
100 | ret->alias = NULL; | ||
101 | ret->keyid = NULL; | ||
102 | ret->other = NULL; | ||
103 | return(ret); | ||
104 | M_ASN1_New_Error(ASN1_F_X509_CERT_AUX_NEW); | ||
105 | } | ||
106 | |||
107 | void X509_CERT_AUX_free(X509_CERT_AUX *a) | ||
108 | { | ||
109 | if(a == NULL) return; | ||
110 | sk_ASN1_OBJECT_pop_free(a->trust, ASN1_OBJECT_free); | ||
111 | sk_ASN1_OBJECT_pop_free(a->reject, ASN1_OBJECT_free); | ||
112 | ASN1_UTF8STRING_free(a->alias); | ||
113 | ASN1_OCTET_STRING_free(a->keyid); | ||
114 | sk_X509_ALGOR_pop_free(a->other, X509_ALGOR_free); | ||
115 | OPENSSL_free(a); | ||
116 | } | ||
117 | |||
118 | int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **pp) | ||
119 | { | ||
120 | M_ASN1_I2D_vars(a); | ||
121 | |||
122 | M_ASN1_I2D_len_SEQUENCE_opt_type(ASN1_OBJECT, a->trust, i2d_ASN1_OBJECT); | ||
123 | M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(ASN1_OBJECT, a->reject, i2d_ASN1_OBJECT, 0); | ||
124 | |||
125 | M_ASN1_I2D_len(a->alias, i2d_ASN1_UTF8STRING); | ||
126 | M_ASN1_I2D_len(a->keyid, i2d_ASN1_OCTET_STRING); | ||
127 | M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(X509_ALGOR, a->other, i2d_X509_ALGOR, 1); | ||
128 | 81 | ||
129 | M_ASN1_I2D_seq_total(); | 82 | IMPLEMENT_ASN1_FUNCTIONS(X509_CERT_AUX) |
130 | |||
131 | M_ASN1_I2D_put_SEQUENCE_opt_type(ASN1_OBJECT, a->trust, i2d_ASN1_OBJECT); | ||
132 | M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(ASN1_OBJECT, a->reject, i2d_ASN1_OBJECT, 0); | ||
133 | |||
134 | M_ASN1_I2D_put(a->alias, i2d_ASN1_UTF8STRING); | ||
135 | M_ASN1_I2D_put(a->keyid, i2d_ASN1_OCTET_STRING); | ||
136 | M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(X509_ALGOR, a->other, i2d_X509_ALGOR, 1); | ||
137 | |||
138 | M_ASN1_I2D_finish(); | ||
139 | } | ||
140 | 83 | ||
141 | static X509_CERT_AUX *aux_get(X509 *x) | 84 | static X509_CERT_AUX *aux_get(X509 *x) |
142 | { | 85 | { |