diff options
339 files changed, 15664 insertions, 4357 deletions
diff --git a/src/lib/libcrypto/Attic/Makefile b/src/lib/libcrypto/Attic/Makefile index 85d9f249c5..947dd5d44e 100644 --- a/src/lib/libcrypto/Attic/Makefile +++ b/src/lib/libcrypto/Attic/Makefile | |||
@@ -7,7 +7,7 @@ TOP= .. | |||
7 | CC= cc | 7 | CC= cc |
8 | INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE) | 8 | INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE) |
9 | # INCLUDES targets sudbirs! | 9 | # INCLUDES targets sudbirs! |
10 | INCLUDES= -I.. -I../.. -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE) | 10 | INCLUDES= -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE) |
11 | CFLAG= -g | 11 | CFLAG= -g |
12 | MAKEDEPPROG= makedepend | 12 | MAKEDEPPROG= makedepend |
13 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | 13 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) |
@@ -34,8 +34,10 @@ GENERAL=Makefile README crypto-lib.com install.com | |||
34 | 34 | ||
35 | LIB= $(TOP)/libcrypto.a | 35 | LIB= $(TOP)/libcrypto.a |
36 | SHARED_LIB= libcrypto$(SHLIB_EXT) | 36 | SHARED_LIB= libcrypto$(SHLIB_EXT) |
37 | LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c | 37 | LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ |
38 | LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ) | 38 | ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c |
39 | LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \ | ||
40 | uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ) | ||
39 | 41 | ||
40 | SRC= $(LIBSRC) | 42 | SRC= $(LIBSRC) |
41 | 43 | ||
@@ -67,14 +69,13 @@ applink.o: $(TOP)/ms/applink.c | |||
67 | uplink.o: $(TOP)/ms/uplink.c applink.o | 69 | uplink.o: $(TOP)/ms/uplink.c applink.o |
68 | $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c | 70 | $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c |
69 | 71 | ||
70 | uplink-cof.s: $(TOP)/ms/uplink.pl | 72 | uplink-x86.s: $(TOP)/ms/uplink-x86.pl |
71 | $(PERL) $(TOP)/ms/uplink.pl coff > $@ | 73 | $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@ |
72 | 74 | ||
73 | x86_64cpuid.s: x86_64cpuid.pl | 75 | x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ |
74 | $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ | 76 | ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@ |
75 | ia64cpuid.s: ia64cpuid.S | ||
76 | $(CC) $(CFLAGS) -E ia64cpuid.S > $@ | ||
77 | ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ | 77 | ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ |
78 | pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@ | ||
78 | alphacpuid.s: alphacpuid.pl | 79 | alphacpuid.s: alphacpuid.pl |
79 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | 80 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null |
80 | 81 | ||
@@ -102,6 +103,7 @@ lib: $(LIB) | |||
102 | @touch lib | 103 | @touch lib |
103 | $(LIB): $(LIBOBJ) | 104 | $(LIB): $(LIBOBJ) |
104 | $(AR) $(LIB) $(LIBOBJ) | 105 | $(AR) $(LIB) $(LIBOBJ) |
106 | [ -z "$(FIPSLIBDIR)" ] || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o | ||
105 | $(RANLIB) $(LIB) || echo Never mind. | 107 | $(RANLIB) $(LIB) || echo Never mind. |
106 | 108 | ||
107 | shared: buildinf.h lib subdirs | 109 | shared: buildinf.h lib subdirs |
@@ -171,6 +173,7 @@ ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
171 | ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | 173 | ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
172 | ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | 174 | ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h |
173 | ex_data.o: ex_data.c | 175 | ex_data.o: ex_data.c |
176 | fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c | ||
174 | mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h | 177 | mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
175 | mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | 178 | mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h |
176 | mem.o: ../include/openssl/err.h ../include/openssl/lhash.h | 179 | mem.o: ../include/openssl/err.h ../include/openssl/lhash.h |
@@ -191,6 +194,19 @@ mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | |||
191 | mem_dbg.o: mem_dbg.c | 194 | mem_dbg.o: mem_dbg.c |
192 | o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | 195 | o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h |
193 | o_dir.o: LPdir_unix.c o_dir.c o_dir.h | 196 | o_dir.o: LPdir_unix.c o_dir.c o_dir.h |
197 | o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h | ||
198 | o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
199 | o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
200 | o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
201 | o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
202 | o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | ||
203 | o_fips.o: o_fips.c | ||
204 | o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h | ||
205 | o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
206 | o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
207 | o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
208 | o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
209 | o_init.o: ../include/openssl/symhacks.h o_init.c | ||
194 | o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | 210 | o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h |
195 | o_str.o: o_str.c o_str.h | 211 | o_str.o: o_str.c o_str.h |
196 | o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c | 212 | o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c |
diff --git a/src/lib/libcrypto/aes/Makefile b/src/lib/libcrypto/aes/Makefile index c501a43a8f..45ede0a0b4 100644 --- a/src/lib/libcrypto/aes/Makefile +++ b/src/lib/libcrypto/aes/Makefile | |||
@@ -50,9 +50,21 @@ aes-ia64.s: asm/aes-ia64.S | |||
50 | 50 | ||
51 | aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl | 51 | aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl |
52 | $(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | 52 | $(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
53 | vpaes-x86.s: asm/vpaes-x86.pl ../perlasm/x86asm.pl | ||
54 | $(PERL) asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | ||
55 | aesni-x86.s: asm/aesni-x86.pl ../perlasm/x86asm.pl | ||
56 | $(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | ||
53 | 57 | ||
54 | aes-x86_64.s: asm/aes-x86_64.pl | 58 | aes-x86_64.s: asm/aes-x86_64.pl |
55 | $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@ | 59 | $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@ |
60 | vpaes-x86_64.s: asm/vpaes-x86_64.pl | ||
61 | $(PERL) asm/vpaes-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
62 | bsaes-x86_64.s: asm/bsaes-x86_64.pl | ||
63 | $(PERL) asm/bsaes-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
64 | aesni-x86_64.s: asm/aesni-x86_64.pl | ||
65 | $(PERL) asm/aesni-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
66 | aesni-sha1-x86_64.s: asm/aesni-sha1-x86_64.pl | ||
67 | $(PERL) asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
56 | 68 | ||
57 | aes-sparcv9.s: asm/aes-sparcv9.pl | 69 | aes-sparcv9.s: asm/aes-sparcv9.pl |
58 | $(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@ | 70 | $(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@ |
@@ -60,8 +72,15 @@ aes-sparcv9.s: asm/aes-sparcv9.pl | |||
60 | aes-ppc.s: asm/aes-ppc.pl | 72 | aes-ppc.s: asm/aes-ppc.pl |
61 | $(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@ | 73 | $(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@ |
62 | 74 | ||
75 | aes-parisc.s: asm/aes-parisc.pl | ||
76 | $(PERL) asm/aes-parisc.pl $(PERLASM_SCHEME) $@ | ||
77 | |||
78 | aes-mips.S: asm/aes-mips.pl | ||
79 | $(PERL) asm/aes-mips.pl $(PERLASM_SCHEME) $@ | ||
80 | |||
63 | # GNU make "catch all" | 81 | # GNU make "catch all" |
64 | aes-%.s: asm/aes-%.pl; $(PERL) $< $(CFLAGS) > $@ | 82 | aes-%.S: asm/aes-%.pl; $(PERL) $< $(PERLASM_SCHEME) > $@ |
83 | aes-armv4.o: aes-armv4.S | ||
65 | 84 | ||
66 | files: | 85 | files: |
67 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 86 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
@@ -117,9 +136,11 @@ aes_ige.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | |||
117 | aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 136 | aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
118 | aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 137 | aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
119 | aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h | 138 | aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h |
120 | aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h | 139 | aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/crypto.h |
121 | aes_misc.o: ../../include/openssl/opensslconf.h | 140 | aes_misc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
122 | aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c | 141 | aes_misc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
142 | aes_misc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
143 | aes_misc.o: ../../include/openssl/symhacks.h aes_locl.h aes_misc.c | ||
123 | aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h | 144 | aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h |
124 | aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c | 145 | aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c |
125 | aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h | 146 | aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h |
diff --git a/src/lib/libcrypto/asn1/Makefile b/src/lib/libcrypto/asn1/Makefile index 160544eede..f7787005d4 100644 --- a/src/lib/libcrypto/asn1/Makefile +++ b/src/lib/libcrypto/asn1/Makefile | |||
@@ -639,7 +639,7 @@ t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | |||
639 | t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 639 | t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
640 | t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 640 | t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
641 | t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | 641 | t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h |
642 | t_x509.o: ../cryptlib.h t_x509.c | 642 | t_x509.o: ../cryptlib.h asn1_locl.h t_x509.c |
643 | t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h | 643 | t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h |
644 | t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 644 | t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
645 | t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 645 | t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
diff --git a/src/lib/libcrypto/bf/Makefile b/src/lib/libcrypto/bf/Makefile index dd2c2c708e..d01bfaa315 100644 --- a/src/lib/libcrypto/bf/Makefile +++ b/src/lib/libcrypto/bf/Makefile | |||
@@ -94,5 +94,8 @@ bf_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h | |||
94 | bf_enc.o: ../../include/openssl/opensslconf.h bf_enc.c bf_locl.h | 94 | bf_enc.o: ../../include/openssl/opensslconf.h bf_enc.c bf_locl.h |
95 | bf_ofb64.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h | 95 | bf_ofb64.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h |
96 | bf_ofb64.o: ../../include/openssl/opensslconf.h bf_locl.h bf_ofb64.c | 96 | bf_ofb64.o: ../../include/openssl/opensslconf.h bf_locl.h bf_ofb64.c |
97 | bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h | 97 | bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/crypto.h |
98 | bf_skey.o: ../../include/openssl/opensslconf.h bf_locl.h bf_pi.h bf_skey.c | 98 | bf_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
99 | bf_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
100 | bf_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
101 | bf_skey.o: ../../include/openssl/symhacks.h bf_locl.h bf_pi.h bf_skey.c | ||
diff --git a/src/lib/libcrypto/bn/Makefile b/src/lib/libcrypto/bn/Makefile index aabc4f56b8..672773454c 100644 --- a/src/lib/libcrypto/bn/Makefile +++ b/src/lib/libcrypto/bn/Makefile | |||
@@ -26,13 +26,13 @@ LIBSRC= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c bn_mod.c \ | |||
26 | bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ | 26 | bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ |
27 | bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \ | 27 | bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \ |
28 | bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ | 28 | bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ |
29 | bn_depr.c bn_const.c | 29 | bn_depr.c bn_const.c bn_x931p.c |
30 | 30 | ||
31 | LIBOBJ= bn_add.o bn_div.o bn_exp.o bn_lib.o bn_ctx.o bn_mul.o bn_mod.o \ | 31 | LIBOBJ= bn_add.o bn_div.o bn_exp.o bn_lib.o bn_ctx.o bn_mul.o bn_mod.o \ |
32 | bn_print.o bn_rand.o bn_shift.o bn_word.o bn_blind.o \ | 32 | bn_print.o bn_rand.o bn_shift.o bn_word.o bn_blind.o \ |
33 | bn_kron.o bn_sqrt.o bn_gcd.o bn_prime.o bn_err.o bn_sqr.o $(BN_ASM) \ | 33 | bn_kron.o bn_sqrt.o bn_gcd.o bn_prime.o bn_err.o bn_sqr.o $(BN_ASM) \ |
34 | bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o bn_gf2m.o bn_nist.o \ | 34 | bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o bn_gf2m.o bn_nist.o \ |
35 | bn_depr.o bn_const.o | 35 | bn_depr.o bn_const.o bn_x931p.o |
36 | 36 | ||
37 | SRC= $(LIBSRC) | 37 | SRC= $(LIBSRC) |
38 | 38 | ||
@@ -66,6 +66,8 @@ co-586.s: asm/co-586.pl ../perlasm/x86asm.pl | |||
66 | $(PERL) asm/co-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | 66 | $(PERL) asm/co-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
67 | x86-mont.s: asm/x86-mont.pl ../perlasm/x86asm.pl | 67 | x86-mont.s: asm/x86-mont.pl ../perlasm/x86asm.pl |
68 | $(PERL) asm/x86-mont.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | 68 | $(PERL) asm/x86-mont.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
69 | x86-gf2m.s: asm/x86-gf2m.pl ../perlasm/x86asm.pl | ||
70 | $(PERL) asm/x86-gf2m.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | ||
69 | 71 | ||
70 | sparcv8.o: asm/sparcv8.S | 72 | sparcv8.o: asm/sparcv8.S |
71 | $(CC) $(CFLAGS) -c asm/sparcv8.S | 73 | $(CC) $(CFLAGS) -c asm/sparcv8.S |
@@ -82,16 +84,31 @@ bn-mips3.o: asm/mips3.s | |||
82 | as -$$ABI -O -o $@ asm/mips3.s; \ | 84 | as -$$ABI -O -o $@ asm/mips3.s; \ |
83 | else $(CC) -c $(CFLAGS) -o $@ asm/mips3.s; fi | 85 | else $(CC) -c $(CFLAGS) -o $@ asm/mips3.s; fi |
84 | 86 | ||
87 | bn-mips.s: asm/mips.pl | ||
88 | $(PERL) asm/mips.pl $(PERLASM_SCHEME) $@ | ||
89 | mips-mont.s: asm/mips-mont.pl | ||
90 | $(PERL) asm/mips-mont.pl $(PERLASM_SCHEME) $@ | ||
91 | |||
85 | bn-s390x.o: asm/s390x.S | 92 | bn-s390x.o: asm/s390x.S |
86 | $(CC) $(CFLAGS) -c -o $@ asm/s390x.S | 93 | $(CC) $(CFLAGS) -c -o $@ asm/s390x.S |
94 | s390x-gf2m.s: asm/s390x-gf2m.pl | ||
95 | $(PERL) asm/s390x-gf2m.pl $(PERLASM_SCHEME) $@ | ||
87 | 96 | ||
88 | x86_64-gcc.o: asm/x86_64-gcc.c | 97 | x86_64-gcc.o: asm/x86_64-gcc.c |
89 | $(CC) $(CFLAGS) -c -o $@ asm/x86_64-gcc.c | 98 | $(CC) $(CFLAGS) -c -o $@ asm/x86_64-gcc.c |
90 | x86_64-mont.s: asm/x86_64-mont.pl | 99 | x86_64-mont.s: asm/x86_64-mont.pl |
91 | $(PERL) asm/x86_64-mont.pl $(PERLASM_SCHEME) > $@ | 100 | $(PERL) asm/x86_64-mont.pl $(PERLASM_SCHEME) > $@ |
101 | x86_64-mont5.s: asm/x86_64-mont5.pl | ||
102 | $(PERL) asm/x86_64-mont5.pl $(PERLASM_SCHEME) > $@ | ||
103 | x86_64-gf2m.s: asm/x86_64-gf2m.pl | ||
104 | $(PERL) asm/x86_64-gf2m.pl $(PERLASM_SCHEME) > $@ | ||
105 | modexp512-x86_64.s: asm/modexp512-x86_64.pl | ||
106 | $(PERL) asm/modexp512-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
92 | 107 | ||
93 | bn-ia64.s: asm/ia64.S | 108 | bn-ia64.s: asm/ia64.S |
94 | $(CC) $(CFLAGS) -E asm/ia64.S > $@ | 109 | $(CC) $(CFLAGS) -E asm/ia64.S > $@ |
110 | ia64-mont.s: asm/ia64-mont.pl | ||
111 | $(PERL) asm/ia64-mont.pl $@ $(CFLAGS) | ||
95 | 112 | ||
96 | # GNU assembler fails to compile PA-RISC2 modules, insist on calling | 113 | # GNU assembler fails to compile PA-RISC2 modules, insist on calling |
97 | # vendor assembler... | 114 | # vendor assembler... |
@@ -99,16 +116,22 @@ pa-risc2W.o: asm/pa-risc2W.s | |||
99 | /usr/ccs/bin/as -o pa-risc2W.o asm/pa-risc2W.s | 116 | /usr/ccs/bin/as -o pa-risc2W.o asm/pa-risc2W.s |
100 | pa-risc2.o: asm/pa-risc2.s | 117 | pa-risc2.o: asm/pa-risc2.s |
101 | /usr/ccs/bin/as -o pa-risc2.o asm/pa-risc2.s | 118 | /usr/ccs/bin/as -o pa-risc2.o asm/pa-risc2.s |
119 | parisc-mont.s: asm/parisc-mont.pl | ||
120 | $(PERL) asm/parisc-mont.pl $(PERLASM_SCHEME) $@ | ||
102 | 121 | ||
103 | # ppc - AIX, Linux, MacOS X... | 122 | # ppc - AIX, Linux, MacOS X... |
104 | bn-ppc.s: asm/ppc.pl; $(PERL) asm/ppc.pl $(PERLASM_SCHEME) $@ | 123 | bn-ppc.s: asm/ppc.pl; $(PERL) asm/ppc.pl $(PERLASM_SCHEME) $@ |
105 | ppc-mont.s: asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@ | 124 | ppc-mont.s: asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@ |
125 | ppc64-mont.s: asm/ppc64-mont.pl;$(PERL) asm/ppc64-mont.pl $(PERLASM_SCHEME) $@ | ||
106 | 126 | ||
107 | alpha-mont.s: asm/alpha-mont.pl | 127 | alpha-mont.s: asm/alpha-mont.pl |
108 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | 128 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null |
109 | 129 | ||
110 | # GNU make "catch all" | 130 | # GNU make "catch all" |
111 | %-mont.s: asm/%-mont.pl; $(PERL) $< $(CFLAGS) > $@ | 131 | %-mont.s: asm/%-mont.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
132 | %-gf2m.S: asm/%-gf2m.pl; $(PERL) $< $(PERLASM_SCHEME) $@ | ||
133 | |||
134 | armv4-gf2m.o: armv4-gf2m.S | ||
112 | 135 | ||
113 | files: | 136 | files: |
114 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 137 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
@@ -345,3 +368,8 @@ bn_word.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | |||
345 | bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 368 | bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
346 | bn_word.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 369 | bn_word.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
347 | bn_word.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_word.c | 370 | bn_word.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_word.c |
371 | bn_x931p.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
372 | bn_x931p.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
373 | bn_x931p.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
374 | bn_x931p.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
375 | bn_x931p.o: ../../include/openssl/symhacks.h bn_x931p.c | ||
diff --git a/src/lib/libcrypto/bn/bntest.c b/src/lib/libcrypto/bn/bntest.c index 0cd99c5b4b..06f5954acc 100644 --- a/src/lib/libcrypto/bn/bntest.c +++ b/src/lib/libcrypto/bn/bntest.c | |||
@@ -262,7 +262,7 @@ int main(int argc, char *argv[]) | |||
262 | message(out,"BN_mod_sqrt"); | 262 | message(out,"BN_mod_sqrt"); |
263 | if (!test_sqrt(out,ctx)) goto err; | 263 | if (!test_sqrt(out,ctx)) goto err; |
264 | (void)BIO_flush(out); | 264 | (void)BIO_flush(out); |
265 | 265 | #ifndef OPENSSL_NO_EC2M | |
266 | message(out,"BN_GF2m_add"); | 266 | message(out,"BN_GF2m_add"); |
267 | if (!test_gf2m_add(out)) goto err; | 267 | if (!test_gf2m_add(out)) goto err; |
268 | (void)BIO_flush(out); | 268 | (void)BIO_flush(out); |
@@ -298,7 +298,7 @@ int main(int argc, char *argv[]) | |||
298 | message(out,"BN_GF2m_mod_solve_quad"); | 298 | message(out,"BN_GF2m_mod_solve_quad"); |
299 | if (!test_gf2m_mod_solve_quad(out,ctx)) goto err; | 299 | if (!test_gf2m_mod_solve_quad(out,ctx)) goto err; |
300 | (void)BIO_flush(out); | 300 | (void)BIO_flush(out); |
301 | 301 | #endif | |
302 | BN_CTX_free(ctx); | 302 | BN_CTX_free(ctx); |
303 | BIO_free(out); | 303 | BIO_free(out); |
304 | 304 | ||
@@ -1061,7 +1061,7 @@ int test_exp(BIO *bp, BN_CTX *ctx) | |||
1061 | BN_free(one); | 1061 | BN_free(one); |
1062 | return(1); | 1062 | return(1); |
1063 | } | 1063 | } |
1064 | 1064 | #ifndef OPENSSL_NO_EC2M | |
1065 | int test_gf2m_add(BIO *bp) | 1065 | int test_gf2m_add(BIO *bp) |
1066 | { | 1066 | { |
1067 | BIGNUM a,b,c; | 1067 | BIGNUM a,b,c; |
@@ -1636,7 +1636,7 @@ int test_gf2m_mod_solve_quad(BIO *bp,BN_CTX *ctx) | |||
1636 | BN_free(e); | 1636 | BN_free(e); |
1637 | return ret; | 1637 | return ret; |
1638 | } | 1638 | } |
1639 | 1639 | #endif | |
1640 | static int genprime_cb(int p, int n, BN_GENCB *arg) | 1640 | static int genprime_cb(int p, int n, BN_GENCB *arg) |
1641 | { | 1641 | { |
1642 | char c='*'; | 1642 | char c='*'; |
diff --git a/src/lib/libcrypto/buffer/Makefile b/src/lib/libcrypto/buffer/Makefile index 9f3a88d2d6..2efba47f07 100644 --- a/src/lib/libcrypto/buffer/Makefile +++ b/src/lib/libcrypto/buffer/Makefile | |||
@@ -17,8 +17,8 @@ TEST= | |||
17 | APPS= | 17 | APPS= |
18 | 18 | ||
19 | LIB=$(TOP)/libcrypto.a | 19 | LIB=$(TOP)/libcrypto.a |
20 | LIBSRC= buffer.c buf_err.c | 20 | LIBSRC= buffer.c buf_str.c buf_err.c |
21 | LIBOBJ= buffer.o buf_err.o | 21 | LIBOBJ= buffer.o buf_str.o buf_err.o |
22 | 22 | ||
23 | SRC= $(LIBSRC) | 23 | SRC= $(LIBSRC) |
24 | 24 | ||
@@ -81,6 +81,13 @@ buf_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | |||
81 | buf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 81 | buf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
82 | buf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 82 | buf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
83 | buf_err.o: buf_err.c | 83 | buf_err.o: buf_err.c |
84 | buf_str.o: ../../e_os.h ../../include/openssl/bio.h | ||
85 | buf_str.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
86 | buf_str.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
87 | buf_str.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
88 | buf_str.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
89 | buf_str.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
90 | buf_str.o: ../../include/openssl/symhacks.h ../cryptlib.h buf_str.c | ||
84 | buffer.o: ../../e_os.h ../../include/openssl/bio.h | 91 | buffer.o: ../../e_os.h ../../include/openssl/bio.h |
85 | buffer.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 92 | buffer.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
86 | buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 93 | buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
diff --git a/src/lib/libcrypto/cast/Makefile b/src/lib/libcrypto/cast/Makefile index 0acc38f28d..f3f4859886 100644 --- a/src/lib/libcrypto/cast/Makefile +++ b/src/lib/libcrypto/cast/Makefile | |||
@@ -95,5 +95,8 @@ c_ofb64.o: ../../e_os.h ../../include/openssl/cast.h | |||
95 | c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 95 | c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
96 | c_ofb64.o: c_ofb64.c cast_lcl.h | 96 | c_ofb64.o: c_ofb64.c cast_lcl.h |
97 | c_skey.o: ../../e_os.h ../../include/openssl/cast.h | 97 | c_skey.o: ../../e_os.h ../../include/openssl/cast.h |
98 | c_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 98 | c_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
99 | c_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
100 | c_skey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | ||
101 | c_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
99 | c_skey.o: c_skey.c cast_lcl.h cast_s.h | 102 | c_skey.o: c_skey.c cast_lcl.h cast_s.h |
diff --git a/src/lib/libcrypto/crypto-lib.com b/src/lib/libcrypto/crypto-lib.com index a29c0afd93..c280aa03a8 100644 --- a/src/lib/libcrypto/crypto-lib.com +++ b/src/lib/libcrypto/crypto-lib.com | |||
@@ -117,7 +117,7 @@ $ ENCRYPT_TYPES = "Basic,"+ - | |||
117 | "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ - | 117 | "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ - |
118 | "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - | 118 | "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - |
119 | "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - | 119 | "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - |
120 | "STORE,CMS,PQUEUE,TS,JPAKE" | 120 | "CMS,PQUEUE,TS,JPAKE,SRP,STORE,CMAC" |
121 | $! | 121 | $! |
122 | $! Check To Make Sure We Have Valid Command Line Parameters. | 122 | $! Check To Make Sure We Have Valid Command Line Parameters. |
123 | $! | 123 | $! |
@@ -207,7 +207,8 @@ $! | |||
207 | $ APPS_DES = "DES/DES,CBC3_ENC" | 207 | $ APPS_DES = "DES/DES,CBC3_ENC" |
208 | $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE" | 208 | $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE" |
209 | $ | 209 | $ |
210 | $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,ebcdic,uid,o_time,o_str,o_dir" | 210 | $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,"+ - |
211 | "ebcdic,uid,o_time,o_str,o_dir,o_fips.c,o_init,fips_ers" | ||
211 | $ LIB_MD2 = "md2_dgst,md2_one" | 212 | $ LIB_MD2 = "md2_dgst,md2_one" |
212 | $ LIB_MD4 = "md4_dgst,md4_one" | 213 | $ LIB_MD4 = "md4_dgst,md4_one" |
213 | $ LIB_MD5 = "md5_dgst,md5_one" | 214 | $ LIB_MD5 = "md5_dgst,md5_one" |
@@ -224,15 +225,16 @@ $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ - | |||
224 | "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ - | 225 | "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ - |
225 | "ede_cbcm_enc,des_old,des_old2,read2pwd" | 226 | "ede_cbcm_enc,des_old,des_old2,read2pwd" |
226 | $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" | 227 | $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" |
227 | $ LIB_RC4 = "rc4_skey,rc4_enc" | 228 | $ LIB_RC4 = "rc4_skey,rc4_enc,rc4_utl" |
228 | $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" | 229 | $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" |
229 | $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey" | 230 | $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey" |
230 | $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64" | 231 | $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64" |
231 | $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64" | 232 | $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64" |
232 | $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ - | 233 | $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ - |
233 | "cmll_cfb,cmll_ctr" | 234 | "cmll_cfb,cmll_ctr,cmll_utl" |
234 | $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb" | 235 | $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb" |
235 | $ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128" | 236 | $ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128,gcm128,"+ - |
237 | "ccm128,xts128" | ||
236 | $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" | 238 | $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" |
237 | $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN - | 239 | $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN - |
238 | LIB_BN_ASM = "bn_asm" | 240 | LIB_BN_ASM = "bn_asm" |
@@ -240,14 +242,16 @@ $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ - | |||
240 | "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ - | 242 | "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ - |
241 | "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ - | 243 | "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ - |
242 | "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ - | 244 | "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ - |
243 | "bn_depr,bn_const" | 245 | "bn_depr,bn_const,bn_x931p" |
244 | $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ - | 246 | $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ - |
245 | "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ - | 247 | "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ - |
246 | "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn" | 248 | "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn,"+ - |
249 | "ecp_nistp224,ecp_nistp256,ecp_nistp521,ecp_nistputil,"+ - | ||
250 | "ecp_oct,ec2_oct,ec_oct" | ||
247 | $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ - | 251 | $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ - |
248 | "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ - | 252 | "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ - |
249 | "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ - | 253 | "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ - |
250 | "rsa_pmeth" | 254 | "rsa_pmeth,rsa_crpt" |
251 | $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ - | 255 | $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ - |
252 | "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn" | 256 | "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn" |
253 | $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err" | 257 | $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err" |
@@ -260,10 +264,11 @@ $ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ - | |||
260 | "eng_table,eng_pkey,eng_fat,eng_all,"+ - | 264 | "eng_table,eng_pkey,eng_fat,eng_all,"+ - |
261 | "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ - | 265 | "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ - |
262 | "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ - | 266 | "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ - |
263 | "eng_openssl,eng_dyn,eng_cnf,eng_cryptodev" | 267 | "eng_openssl,eng_dyn,eng_cnf,eng_cryptodev,"+ - |
268 | "eng_rsax,eng_rdrand" | ||
264 | $ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr,"+ - | 269 | $ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr,"+ - |
265 | "aes_ige,aes_wrap" | 270 | "aes_ige,aes_wrap" |
266 | $ LIB_BUFFER = "buffer,buf_err" | 271 | $ LIB_BUFFER = "buffer,buf_str,buf_err" |
267 | $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - | 272 | $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - |
268 | "bss_mem,bss_null,bss_fd,"+ - | 273 | "bss_mem,bss_null,bss_fd,"+ - |
269 | "bss_file,bss_sock,bss_conn,"+ - | 274 | "bss_file,bss_sock,bss_conn,"+ - |
@@ -287,7 +292,8 @@ $ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1,m_wp," + - | |||
287 | "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ - | 292 | "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ - |
288 | "c_all,c_allc,c_alld,evp_lib,bio_ok,"+- | 293 | "c_all,c_allc,c_alld,evp_lib,bio_ok,"+- |
289 | "evp_pkey,evp_pbe,p5_crpt,p5_crpt2" | 294 | "evp_pkey,evp_pbe,p5_crpt,p5_crpt2" |
290 | $ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver" | 295 | $ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver,evp_fips,"+ - |
296 | "e_aes_cbc_hmac_sha1,e_rc4_hmac_md5" | ||
291 | $ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ - | 297 | $ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ - |
292 | "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ - | 298 | "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ - |
293 | "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ - | 299 | "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ - |
@@ -329,14 +335,17 @@ $ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ - | |||
329 | $ LIB_UI_COMPAT = ",ui_compat" | 335 | $ LIB_UI_COMPAT = ",ui_compat" |
330 | $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT | 336 | $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT |
331 | $ LIB_KRB5 = "krb5_asn" | 337 | $ LIB_KRB5 = "krb5_asn" |
332 | $ LIB_STORE = "str_err,str_lib,str_meth,str_mem" | ||
333 | $ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ - | 338 | $ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ - |
334 | "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess" | 339 | "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess,"+ - |
340 | "cms_pwri" | ||
335 | $ LIB_PQUEUE = "pqueue" | 341 | $ LIB_PQUEUE = "pqueue" |
336 | $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ - | 342 | $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ - |
337 | "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ - | 343 | "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ - |
338 | "ts_asn1" | 344 | "ts_asn1" |
339 | $ LIB_JPAKE = "jpake,jpake_err" | 345 | $ LIB_JPAKE = "jpake,jpake_err" |
346 | $ LIB_SRP = "srp_lib,srp_vfy" | ||
347 | $ LIB_STORE = "str_err,str_lib,str_meth,str_mem" | ||
348 | $ LIB_CMAC = "cmac,cm_ameth.c,cm_pmeth" | ||
340 | $! | 349 | $! |
341 | $! Setup exceptional compilations | 350 | $! Setup exceptional compilations |
342 | $! | 351 | $! |
@@ -1021,7 +1030,7 @@ $! | |||
1021 | $! Set basic C compiler /INCLUDE directories. | 1030 | $! Set basic C compiler /INCLUDE directories. |
1022 | $! | 1031 | $! |
1023 | $ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ - | 1032 | $ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ - |
1024 | "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1]" | 1033 | "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.MODES],SYS$DISK:[.ASN1],SYS$DISK:[.EVP]" |
1025 | $! | 1034 | $! |
1026 | $! Check To See If P3 Is Blank. | 1035 | $! Check To See If P3 Is Blank. |
1027 | $! | 1036 | $! |
diff --git a/src/lib/libcrypto/des/Makefile b/src/lib/libcrypto/des/Makefile index ae982265fd..a6e1001329 100644 --- a/src/lib/libcrypto/des/Makefile +++ b/src/lib/libcrypto/des/Makefile | |||
@@ -257,8 +257,9 @@ rpc_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | |||
257 | rpc_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 257 | rpc_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
258 | rpc_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | 258 | rpc_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h |
259 | rpc_enc.o: des_locl.h des_ver.h rpc_des.h rpc_enc.c | 259 | rpc_enc.o: des_locl.h des_ver.h rpc_des.h rpc_enc.c |
260 | set_key.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | 260 | set_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
261 | set_key.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 261 | set_key.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h |
262 | set_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
262 | set_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 263 | set_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
263 | set_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 264 | set_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
264 | set_key.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | 265 | set_key.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h |
diff --git a/src/lib/libcrypto/dsa/Makefile b/src/lib/libcrypto/dsa/Makefile index 8073c4ecfe..5fef4ca5ad 100644 --- a/src/lib/libcrypto/dsa/Makefile +++ b/src/lib/libcrypto/dsa/Makefile | |||
@@ -99,8 +99,9 @@ dsa_asn1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | |||
99 | dsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 99 | dsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
100 | dsa_asn1.o: ../../include/openssl/opensslconf.h | 100 | dsa_asn1.o: ../../include/openssl/opensslconf.h |
101 | dsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 101 | dsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
102 | dsa_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 102 | dsa_asn1.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h |
103 | dsa_asn1.o: ../../include/openssl/symhacks.h ../cryptlib.h dsa_asn1.c | 103 | dsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
104 | dsa_asn1.o: ../cryptlib.h dsa_asn1.c | ||
104 | dsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h | 105 | dsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h |
105 | dsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 106 | dsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
106 | dsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 107 | dsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -189,7 +190,7 @@ dsa_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | |||
189 | dsa_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 190 | dsa_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
190 | dsa_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 191 | dsa_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
191 | dsa_prn.o: ../cryptlib.h dsa_prn.c | 192 | dsa_prn.o: ../cryptlib.h dsa_prn.c |
192 | dsa_sign.o: ../../e_os.h ../../include/openssl/bio.h | 193 | dsa_sign.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h |
193 | dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 194 | dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
194 | dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | 195 | dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
195 | dsa_sign.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 196 | dsa_sign.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
diff --git a/src/lib/libcrypto/ec/Makefile b/src/lib/libcrypto/ec/Makefile index db380ed16f..f85fc845ca 100644 --- a/src/lib/libcrypto/ec/Makefile +++ b/src/lib/libcrypto/ec/Makefile | |||
@@ -19,11 +19,15 @@ APPS= | |||
19 | LIB=$(TOP)/libcrypto.a | 19 | LIB=$(TOP)/libcrypto.a |
20 | LIBSRC= ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c\ | 20 | LIBSRC= ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c\ |
21 | ec_err.c ec_curve.c ec_check.c ec_print.c ec_asn1.c ec_key.c\ | 21 | ec_err.c ec_curve.c ec_check.c ec_print.c ec_asn1.c ec_key.c\ |
22 | ec2_smpl.c ec2_mult.c ec_ameth.c ec_pmeth.c eck_prn.c | 22 | ec2_smpl.c ec2_mult.c ec_ameth.c ec_pmeth.c eck_prn.c \ |
23 | ecp_nistp224.c ecp_nistp256.c ecp_nistp521.c ecp_nistputil.c \ | ||
24 | ecp_oct.c ec2_oct.c ec_oct.c | ||
23 | 25 | ||
24 | LIBOBJ= ec_lib.o ecp_smpl.o ecp_mont.o ecp_nist.o ec_cvt.o ec_mult.o\ | 26 | LIBOBJ= ec_lib.o ecp_smpl.o ecp_mont.o ecp_nist.o ec_cvt.o ec_mult.o\ |
25 | ec_err.o ec_curve.o ec_check.o ec_print.o ec_asn1.o ec_key.o\ | 27 | ec_err.o ec_curve.o ec_check.o ec_print.o ec_asn1.o ec_key.o\ |
26 | ec2_smpl.o ec2_mult.o ec_ameth.o ec_pmeth.o eck_prn.o | 28 | ec2_smpl.o ec2_mult.o ec_ameth.o ec_pmeth.o eck_prn.o \ |
29 | ecp_nistp224.o ecp_nistp256.o ecp_nistp521.o ecp_nistputil.o \ | ||
30 | ecp_oct.o ec2_oct.o ec_oct.o | ||
27 | 31 | ||
28 | SRC= $(LIBSRC) | 32 | SRC= $(LIBSRC) |
29 | 33 | ||
@@ -87,6 +91,14 @@ ec2_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | |||
87 | ec2_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 91 | ec2_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
88 | ec2_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 92 | ec2_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
89 | ec2_mult.o: ../../include/openssl/symhacks.h ec2_mult.c ec_lcl.h | 93 | ec2_mult.o: ../../include/openssl/symhacks.h ec2_mult.c ec_lcl.h |
94 | ec2_oct.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
95 | ec2_oct.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
96 | ec2_oct.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
97 | ec2_oct.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
98 | ec2_oct.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | ||
99 | ec2_oct.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
100 | ec2_oct.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
101 | ec2_oct.o: ../../include/openssl/symhacks.h ec2_oct.c ec_lcl.h | ||
90 | ec2_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 102 | ec2_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
91 | ec2_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 103 | ec2_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
92 | ec2_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 104 | ec2_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -174,6 +186,14 @@ ec_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | |||
174 | ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 186 | ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
175 | ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 187 | ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
176 | ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c | 188 | ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c |
189 | ec_oct.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
190 | ec_oct.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
191 | ec_oct.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
192 | ec_oct.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
193 | ec_oct.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | ||
194 | ec_oct.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
195 | ec_oct.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
196 | ec_oct.o: ../../include/openssl/symhacks.h ec_lcl.h ec_oct.c | ||
177 | ec_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h | 197 | ec_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h |
178 | ec_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | 198 | ec_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
179 | ec_pmeth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 199 | ec_pmeth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -221,6 +241,18 @@ ecp_nist.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | |||
221 | ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 241 | ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
222 | ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 242 | ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
223 | ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c | 243 | ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c |
244 | ecp_nistp224.o: ../../include/openssl/opensslconf.h ecp_nistp224.c | ||
245 | ecp_nistp256.o: ../../include/openssl/opensslconf.h ecp_nistp256.c | ||
246 | ecp_nistp521.o: ../../include/openssl/opensslconf.h ecp_nistp521.c | ||
247 | ecp_nistputil.o: ../../include/openssl/opensslconf.h ecp_nistputil.c | ||
248 | ecp_oct.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
249 | ecp_oct.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
250 | ecp_oct.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
251 | ecp_oct.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
252 | ecp_oct.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | ||
253 | ecp_oct.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
254 | ecp_oct.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
255 | ecp_oct.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_oct.c | ||
224 | ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 256 | ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
225 | ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 257 | ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
226 | ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 258 | ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
diff --git a/src/lib/libcrypto/ec/ectest.c b/src/lib/libcrypto/ec/ectest.c index 7509cb9c7c..f107782de0 100644 --- a/src/lib/libcrypto/ec/ectest.c +++ b/src/lib/libcrypto/ec/ectest.c | |||
@@ -94,6 +94,7 @@ int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); retur | |||
94 | #include <openssl/objects.h> | 94 | #include <openssl/objects.h> |
95 | #include <openssl/rand.h> | 95 | #include <openssl/rand.h> |
96 | #include <openssl/bn.h> | 96 | #include <openssl/bn.h> |
97 | #include <openssl/opensslconf.h> | ||
97 | 98 | ||
98 | #if defined(_MSC_VER) && defined(_MIPS_) && (_MSC_VER/100==12) | 99 | #if defined(_MSC_VER) && defined(_MIPS_) && (_MSC_VER/100==12) |
99 | /* suppress "too big too optimize" warning */ | 100 | /* suppress "too big too optimize" warning */ |
@@ -107,10 +108,6 @@ int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); retur | |||
107 | EXIT(1); \ | 108 | EXIT(1); \ |
108 | } while (0) | 109 | } while (0) |
109 | 110 | ||
110 | void prime_field_tests(void); | ||
111 | void char2_field_tests(void); | ||
112 | void internal_curve_test(void); | ||
113 | |||
114 | #define TIMING_BASE_PT 0 | 111 | #define TIMING_BASE_PT 0 |
115 | #define TIMING_RAND_PT 1 | 112 | #define TIMING_RAND_PT 1 |
116 | #define TIMING_SIMUL 2 | 113 | #define TIMING_SIMUL 2 |
@@ -195,7 +192,50 @@ static void timings(EC_GROUP *group, int type, BN_CTX *ctx) | |||
195 | } | 192 | } |
196 | #endif | 193 | #endif |
197 | 194 | ||
198 | void prime_field_tests() | 195 | /* test multiplication with group order, long and negative scalars */ |
196 | static void group_order_tests(EC_GROUP *group) | ||
197 | { | ||
198 | BIGNUM *n1, *n2, *order; | ||
199 | EC_POINT *P = EC_POINT_new(group); | ||
200 | EC_POINT *Q = EC_POINT_new(group); | ||
201 | BN_CTX *ctx = BN_CTX_new(); | ||
202 | |||
203 | n1 = BN_new(); n2 = BN_new(); order = BN_new(); | ||
204 | fprintf(stdout, "verify group order ..."); | ||
205 | fflush(stdout); | ||
206 | if (!EC_GROUP_get_order(group, order, ctx)) ABORT; | ||
207 | if (!EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) ABORT; | ||
208 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
209 | fprintf(stdout, "."); | ||
210 | fflush(stdout); | ||
211 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
212 | if (!EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) ABORT; | ||
213 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
214 | fprintf(stdout, " ok\n"); | ||
215 | fprintf(stdout, "long/negative scalar tests ... "); | ||
216 | if (!BN_one(n1)) ABORT; | ||
217 | /* n1 = 1 - order */ | ||
218 | if (!BN_sub(n1, n1, order)) ABORT; | ||
219 | if(!EC_POINT_mul(group, Q, NULL, P, n1, ctx)) ABORT; | ||
220 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | ||
221 | /* n2 = 1 + order */ | ||
222 | if (!BN_add(n2, order, BN_value_one())) ABORT; | ||
223 | if(!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; | ||
224 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | ||
225 | /* n2 = (1 - order) * (1 + order) */ | ||
226 | if (!BN_mul(n2, n1, n2, ctx)) ABORT; | ||
227 | if(!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; | ||
228 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | ||
229 | fprintf(stdout, "ok\n"); | ||
230 | EC_POINT_free(P); | ||
231 | EC_POINT_free(Q); | ||
232 | BN_free(n1); | ||
233 | BN_free(n2); | ||
234 | BN_free(order); | ||
235 | BN_CTX_free(ctx); | ||
236 | } | ||
237 | |||
238 | static void prime_field_tests(void) | ||
199 | { | 239 | { |
200 | BN_CTX *ctx = NULL; | 240 | BN_CTX *ctx = NULL; |
201 | BIGNUM *p, *a, *b; | 241 | BIGNUM *p, *a, *b; |
@@ -321,21 +361,21 @@ void prime_field_tests() | |||
321 | if (len == 0) ABORT; | 361 | if (len == 0) ABORT; |
322 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; | 362 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; |
323 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; | 363 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; |
324 | fprintf(stdout, "Generator as octect string, compressed form:\n "); | 364 | fprintf(stdout, "Generator as octet string, compressed form:\n "); |
325 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 365 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
326 | 366 | ||
327 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx); | 367 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx); |
328 | if (len == 0) ABORT; | 368 | if (len == 0) ABORT; |
329 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; | 369 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; |
330 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; | 370 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; |
331 | fprintf(stdout, "\nGenerator as octect string, uncompressed form:\n "); | 371 | fprintf(stdout, "\nGenerator as octet string, uncompressed form:\n "); |
332 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 372 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
333 | 373 | ||
334 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx); | 374 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx); |
335 | if (len == 0) ABORT; | 375 | if (len == 0) ABORT; |
336 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; | 376 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; |
337 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; | 377 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; |
338 | fprintf(stdout, "\nGenerator as octect string, hybrid form:\n "); | 378 | fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); |
339 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 379 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
340 | 380 | ||
341 | if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) ABORT; | 381 | if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) ABORT; |
@@ -381,17 +421,7 @@ void prime_field_tests() | |||
381 | if (EC_GROUP_get_degree(group) != 160) ABORT; | 421 | if (EC_GROUP_get_degree(group) != 160) ABORT; |
382 | fprintf(stdout, " ok\n"); | 422 | fprintf(stdout, " ok\n"); |
383 | 423 | ||
384 | fprintf(stdout, "verify group order ..."); | 424 | group_order_tests(group); |
385 | fflush(stdout); | ||
386 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
387 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
388 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
389 | fprintf(stdout, "."); | ||
390 | fflush(stdout); | ||
391 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
392 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
393 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
394 | fprintf(stdout, " ok\n"); | ||
395 | 425 | ||
396 | if (!(P_160 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 426 | if (!(P_160 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
397 | if (!EC_GROUP_copy(P_160, group)) ABORT; | 427 | if (!EC_GROUP_copy(P_160, group)) ABORT; |
@@ -425,17 +455,7 @@ void prime_field_tests() | |||
425 | if (EC_GROUP_get_degree(group) != 192) ABORT; | 455 | if (EC_GROUP_get_degree(group) != 192) ABORT; |
426 | fprintf(stdout, " ok\n"); | 456 | fprintf(stdout, " ok\n"); |
427 | 457 | ||
428 | fprintf(stdout, "verify group order ..."); | 458 | group_order_tests(group); |
429 | fflush(stdout); | ||
430 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
431 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
432 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
433 | fprintf(stdout, "."); | ||
434 | fflush(stdout); | ||
435 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
436 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
437 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
438 | fprintf(stdout, " ok\n"); | ||
439 | 459 | ||
440 | if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 460 | if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
441 | if (!EC_GROUP_copy(P_192, group)) ABORT; | 461 | if (!EC_GROUP_copy(P_192, group)) ABORT; |
@@ -469,17 +489,7 @@ void prime_field_tests() | |||
469 | if (EC_GROUP_get_degree(group) != 224) ABORT; | 489 | if (EC_GROUP_get_degree(group) != 224) ABORT; |
470 | fprintf(stdout, " ok\n"); | 490 | fprintf(stdout, " ok\n"); |
471 | 491 | ||
472 | fprintf(stdout, "verify group order ..."); | 492 | group_order_tests(group); |
473 | fflush(stdout); | ||
474 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
475 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
476 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
477 | fprintf(stdout, "."); | ||
478 | fflush(stdout); | ||
479 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
480 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
481 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
482 | fprintf(stdout, " ok\n"); | ||
483 | 493 | ||
484 | if (!(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 494 | if (!(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
485 | if (!EC_GROUP_copy(P_224, group)) ABORT; | 495 | if (!EC_GROUP_copy(P_224, group)) ABORT; |
@@ -514,17 +524,7 @@ void prime_field_tests() | |||
514 | if (EC_GROUP_get_degree(group) != 256) ABORT; | 524 | if (EC_GROUP_get_degree(group) != 256) ABORT; |
515 | fprintf(stdout, " ok\n"); | 525 | fprintf(stdout, " ok\n"); |
516 | 526 | ||
517 | fprintf(stdout, "verify group order ..."); | 527 | group_order_tests(group); |
518 | fflush(stdout); | ||
519 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
520 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
521 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
522 | fprintf(stdout, "."); | ||
523 | fflush(stdout); | ||
524 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
525 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
526 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
527 | fprintf(stdout, " ok\n"); | ||
528 | 528 | ||
529 | if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 529 | if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
530 | if (!EC_GROUP_copy(P_256, group)) ABORT; | 530 | if (!EC_GROUP_copy(P_256, group)) ABORT; |
@@ -563,18 +563,8 @@ void prime_field_tests() | |||
563 | fprintf(stdout, "verify degree ..."); | 563 | fprintf(stdout, "verify degree ..."); |
564 | if (EC_GROUP_get_degree(group) != 384) ABORT; | 564 | if (EC_GROUP_get_degree(group) != 384) ABORT; |
565 | fprintf(stdout, " ok\n"); | 565 | fprintf(stdout, " ok\n"); |
566 | 566 | ||
567 | fprintf(stdout, "verify group order ..."); | 567 | group_order_tests(group); |
568 | fflush(stdout); | ||
569 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
570 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
571 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
572 | fprintf(stdout, "."); | ||
573 | fflush(stdout); | ||
574 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
575 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
576 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
577 | fprintf(stdout, " ok\n"); | ||
578 | 568 | ||
579 | if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 569 | if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
580 | if (!EC_GROUP_copy(P_384, group)) ABORT; | 570 | if (!EC_GROUP_copy(P_384, group)) ABORT; |
@@ -619,18 +609,8 @@ void prime_field_tests() | |||
619 | fprintf(stdout, "verify degree ..."); | 609 | fprintf(stdout, "verify degree ..."); |
620 | if (EC_GROUP_get_degree(group) != 521) ABORT; | 610 | if (EC_GROUP_get_degree(group) != 521) ABORT; |
621 | fprintf(stdout, " ok\n"); | 611 | fprintf(stdout, " ok\n"); |
622 | 612 | ||
623 | fprintf(stdout, "verify group order ..."); | 613 | group_order_tests(group); |
624 | fflush(stdout); | ||
625 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
626 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
627 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
628 | fprintf(stdout, "."); | ||
629 | fflush(stdout); | ||
630 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
631 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
632 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
633 | fprintf(stdout, " ok\n"); | ||
634 | 614 | ||
635 | if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 615 | if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
636 | if (!EC_GROUP_copy(P_521, group)) ABORT; | 616 | if (!EC_GROUP_copy(P_521, group)) ABORT; |
@@ -659,6 +639,7 @@ void prime_field_tests() | |||
659 | points[2] = Q; | 639 | points[2] = Q; |
660 | points[3] = Q; | 640 | points[3] = Q; |
661 | 641 | ||
642 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
662 | if (!BN_add(y, z, BN_value_one())) ABORT; | 643 | if (!BN_add(y, z, BN_value_one())) ABORT; |
663 | if (BN_is_odd(y)) ABORT; | 644 | if (BN_is_odd(y)) ABORT; |
664 | if (!BN_rshift1(y, y)) ABORT; | 645 | if (!BN_rshift1(y, y)) ABORT; |
@@ -792,22 +773,14 @@ void prime_field_tests() | |||
792 | fprintf(stdout, "verify degree ..."); \ | 773 | fprintf(stdout, "verify degree ..."); \ |
793 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ | 774 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ |
794 | fprintf(stdout, " ok\n"); \ | 775 | fprintf(stdout, " ok\n"); \ |
795 | fprintf(stdout, "verify group order ..."); \ | 776 | group_order_tests(group); \ |
796 | fflush(stdout); \ | ||
797 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; \ | ||
798 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \ | ||
799 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \ | ||
800 | fprintf(stdout, "."); \ | ||
801 | fflush(stdout); \ | ||
802 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; \ | ||
803 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \ | ||
804 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \ | ||
805 | fprintf(stdout, " ok\n"); \ | ||
806 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ | 777 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ |
807 | if (!EC_GROUP_copy(_variable, group)) ABORT; | 778 | if (!EC_GROUP_copy(_variable, group)) ABORT; \ |
808 | 779 | ||
809 | void char2_field_tests() | 780 | #ifndef OPENSSL_NO_EC2M |
810 | { | 781 | |
782 | static void char2_field_tests(void) | ||
783 | { | ||
811 | BN_CTX *ctx = NULL; | 784 | BN_CTX *ctx = NULL; |
812 | BIGNUM *p, *a, *b; | 785 | BIGNUM *p, *a, *b; |
813 | EC_GROUP *group; | 786 | EC_GROUP *group; |
@@ -1239,8 +1212,9 @@ void char2_field_tests() | |||
1239 | if (C2_B571) EC_GROUP_free(C2_B571); | 1212 | if (C2_B571) EC_GROUP_free(C2_B571); |
1240 | 1213 | ||
1241 | } | 1214 | } |
1215 | #endif | ||
1242 | 1216 | ||
1243 | void internal_curve_test(void) | 1217 | static void internal_curve_test(void) |
1244 | { | 1218 | { |
1245 | EC_builtin_curve *curves = NULL; | 1219 | EC_builtin_curve *curves = NULL; |
1246 | size_t crv_len = 0, n = 0; | 1220 | size_t crv_len = 0, n = 0; |
@@ -1287,13 +1261,189 @@ void internal_curve_test(void) | |||
1287 | EC_GROUP_free(group); | 1261 | EC_GROUP_free(group); |
1288 | } | 1262 | } |
1289 | if (ok) | 1263 | if (ok) |
1290 | fprintf(stdout, " ok\n"); | 1264 | fprintf(stdout, " ok\n\n"); |
1291 | else | 1265 | else |
1292 | fprintf(stdout, " failed\n"); | 1266 | { |
1267 | fprintf(stdout, " failed\n\n"); | ||
1268 | ABORT; | ||
1269 | } | ||
1293 | OPENSSL_free(curves); | 1270 | OPENSSL_free(curves); |
1294 | return; | 1271 | return; |
1295 | } | 1272 | } |
1296 | 1273 | ||
1274 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
1275 | /* nistp_test_params contains magic numbers for testing our optimized | ||
1276 | * implementations of several NIST curves with characteristic > 3. */ | ||
1277 | struct nistp_test_params | ||
1278 | { | ||
1279 | const EC_METHOD* (*meth) (); | ||
1280 | int degree; | ||
1281 | /* Qx, Qy and D are taken from | ||
1282 | * http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf | ||
1283 | * Otherwise, values are standard curve parameters from FIPS 180-3 */ | ||
1284 | const char *p, *a, *b, *Qx, *Qy, *Gx, *Gy, *order, *d; | ||
1285 | }; | ||
1286 | |||
1287 | static const struct nistp_test_params nistp_tests_params[] = | ||
1288 | { | ||
1289 | { | ||
1290 | /* P-224 */ | ||
1291 | EC_GFp_nistp224_method, | ||
1292 | 224, | ||
1293 | "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* p */ | ||
1294 | "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", /* a */ | ||
1295 | "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", /* b */ | ||
1296 | "E84FB0B8E7000CB657D7973CF6B42ED78B301674276DF744AF130B3E", /* Qx */ | ||
1297 | "4376675C6FC5612C21A0FF2D2A89D2987DF7A2BC52183B5982298555", /* Qy */ | ||
1298 | "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21", /* Gx */ | ||
1299 | "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", /* Gy */ | ||
1300 | "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", /* order */ | ||
1301 | "3F0C488E987C80BE0FEE521F8D90BE6034EC69AE11CA72AA777481E8", /* d */ | ||
1302 | }, | ||
1303 | { | ||
1304 | /* P-256 */ | ||
1305 | EC_GFp_nistp256_method, | ||
1306 | 256, | ||
1307 | "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", /* p */ | ||
1308 | "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", /* a */ | ||
1309 | "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", /* b */ | ||
1310 | "b7e08afdfe94bad3f1dc8c734798ba1c62b3a0ad1e9ea2a38201cd0889bc7a19", /* Qx */ | ||
1311 | "3603f747959dbf7a4bb226e41928729063adc7ae43529e61b563bbc606cc5e09", /* Qy */ | ||
1312 | "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", /* Gx */ | ||
1313 | "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", /* Gy */ | ||
1314 | "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", /* order */ | ||
1315 | "c477f9f65c22cce20657faa5b2d1d8122336f851a508a1ed04e479c34985bf96", /* d */ | ||
1316 | }, | ||
1317 | { | ||
1318 | /* P-521 */ | ||
1319 | EC_GFp_nistp521_method, | ||
1320 | 521, | ||
1321 | "1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", /* p */ | ||
1322 | "1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", /* a */ | ||
1323 | "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", /* b */ | ||
1324 | "0098e91eef9a68452822309c52fab453f5f117c1da8ed796b255e9ab8f6410cca16e59df403a6bdc6ca467a37056b1e54b3005d8ac030decfeb68df18b171885d5c4", /* Qx */ | ||
1325 | "0164350c321aecfc1cca1ba4364c9b15656150b4b78d6a48d7d28e7f31985ef17be8554376b72900712c4b83ad668327231526e313f5f092999a4632fd50d946bc2e", /* Qy */ | ||
1326 | "c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", /* Gx */ | ||
1327 | "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", /* Gy */ | ||
1328 | "1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409", /* order */ | ||
1329 | "0100085f47b8e1b8b11b7eb33028c0b2888e304bfc98501955b45bba1478dc184eeedf09b86a5f7c21994406072787205e69a63709fe35aa93ba333514b24f961722", /* d */ | ||
1330 | }, | ||
1331 | }; | ||
1332 | |||
1333 | void nistp_single_test(const struct nistp_test_params *test) | ||
1334 | { | ||
1335 | BN_CTX *ctx; | ||
1336 | BIGNUM *p, *a, *b, *x, *y, *n, *m, *order; | ||
1337 | EC_GROUP *NISTP; | ||
1338 | EC_POINT *G, *P, *Q, *Q_CHECK; | ||
1339 | |||
1340 | fprintf(stdout, "\nNIST curve P-%d (optimised implementation):\n", test->degree); | ||
1341 | ctx = BN_CTX_new(); | ||
1342 | p = BN_new(); | ||
1343 | a = BN_new(); | ||
1344 | b = BN_new(); | ||
1345 | x = BN_new(); y = BN_new(); | ||
1346 | m = BN_new(); n = BN_new(); order = BN_new(); | ||
1347 | |||
1348 | NISTP = EC_GROUP_new(test->meth()); | ||
1349 | if(!NISTP) ABORT; | ||
1350 | if (!BN_hex2bn(&p, test->p)) ABORT; | ||
1351 | if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL)) ABORT; | ||
1352 | if (!BN_hex2bn(&a, test->a)) ABORT; | ||
1353 | if (!BN_hex2bn(&b, test->b)) ABORT; | ||
1354 | if (!EC_GROUP_set_curve_GFp(NISTP, p, a, b, ctx)) ABORT; | ||
1355 | G = EC_POINT_new(NISTP); | ||
1356 | P = EC_POINT_new(NISTP); | ||
1357 | Q = EC_POINT_new(NISTP); | ||
1358 | Q_CHECK = EC_POINT_new(NISTP); | ||
1359 | if(!BN_hex2bn(&x, test->Qx)) ABORT; | ||
1360 | if(!BN_hex2bn(&y, test->Qy)) ABORT; | ||
1361 | if(!EC_POINT_set_affine_coordinates_GFp(NISTP, Q_CHECK, x, y, ctx)) ABORT; | ||
1362 | if (!BN_hex2bn(&x, test->Gx)) ABORT; | ||
1363 | if (!BN_hex2bn(&y, test->Gy)) ABORT; | ||
1364 | if (!EC_POINT_set_affine_coordinates_GFp(NISTP, G, x, y, ctx)) ABORT; | ||
1365 | if (!BN_hex2bn(&order, test->order)) ABORT; | ||
1366 | if (!EC_GROUP_set_generator(NISTP, G, order, BN_value_one())) ABORT; | ||
1367 | |||
1368 | fprintf(stdout, "verify degree ... "); | ||
1369 | if (EC_GROUP_get_degree(NISTP) != test->degree) ABORT; | ||
1370 | fprintf(stdout, "ok\n"); | ||
1371 | |||
1372 | fprintf(stdout, "NIST test vectors ... "); | ||
1373 | if (!BN_hex2bn(&n, test->d)) ABORT; | ||
1374 | /* fixed point multiplication */ | ||
1375 | EC_POINT_mul(NISTP, Q, n, NULL, NULL, ctx); | ||
1376 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1377 | /* random point multiplication */ | ||
1378 | EC_POINT_mul(NISTP, Q, NULL, G, n, ctx); | ||
1379 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1380 | |||
1381 | /* set generator to P = 2*G, where G is the standard generator */ | ||
1382 | if (!EC_POINT_dbl(NISTP, P, G, ctx)) ABORT; | ||
1383 | if (!EC_GROUP_set_generator(NISTP, P, order, BN_value_one())) ABORT; | ||
1384 | /* set the scalar to m=n/2, where n is the NIST test scalar */ | ||
1385 | if (!BN_rshift(m, n, 1)) ABORT; | ||
1386 | |||
1387 | /* test the non-standard generator */ | ||
1388 | /* fixed point multiplication */ | ||
1389 | EC_POINT_mul(NISTP, Q, m, NULL, NULL, ctx); | ||
1390 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1391 | /* random point multiplication */ | ||
1392 | EC_POINT_mul(NISTP, Q, NULL, P, m, ctx); | ||
1393 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1394 | |||
1395 | /* now repeat all tests with precomputation */ | ||
1396 | if (!EC_GROUP_precompute_mult(NISTP, ctx)) ABORT; | ||
1397 | |||
1398 | /* fixed point multiplication */ | ||
1399 | EC_POINT_mul(NISTP, Q, m, NULL, NULL, ctx); | ||
1400 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1401 | /* random point multiplication */ | ||
1402 | EC_POINT_mul(NISTP, Q, NULL, P, m, ctx); | ||
1403 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1404 | |||
1405 | /* reset generator */ | ||
1406 | if (!EC_GROUP_set_generator(NISTP, G, order, BN_value_one())) ABORT; | ||
1407 | /* fixed point multiplication */ | ||
1408 | EC_POINT_mul(NISTP, Q, n, NULL, NULL, ctx); | ||
1409 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1410 | /* random point multiplication */ | ||
1411 | EC_POINT_mul(NISTP, Q, NULL, G, n, ctx); | ||
1412 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1413 | |||
1414 | fprintf(stdout, "ok\n"); | ||
1415 | group_order_tests(NISTP); | ||
1416 | #if 0 | ||
1417 | timings(NISTP, TIMING_BASE_PT, ctx); | ||
1418 | timings(NISTP, TIMING_RAND_PT, ctx); | ||
1419 | #endif | ||
1420 | EC_GROUP_free(NISTP); | ||
1421 | EC_POINT_free(G); | ||
1422 | EC_POINT_free(P); | ||
1423 | EC_POINT_free(Q); | ||
1424 | EC_POINT_free(Q_CHECK); | ||
1425 | BN_free(n); | ||
1426 | BN_free(m); | ||
1427 | BN_free(p); | ||
1428 | BN_free(a); | ||
1429 | BN_free(b); | ||
1430 | BN_free(x); | ||
1431 | BN_free(y); | ||
1432 | BN_free(order); | ||
1433 | BN_CTX_free(ctx); | ||
1434 | } | ||
1435 | |||
1436 | void nistp_tests() | ||
1437 | { | ||
1438 | unsigned i; | ||
1439 | |||
1440 | for (i = 0; i < sizeof(nistp_tests_params) / sizeof(struct nistp_test_params); i++) | ||
1441 | { | ||
1442 | nistp_single_test(&nistp_tests_params[i]); | ||
1443 | } | ||
1444 | } | ||
1445 | #endif | ||
1446 | |||
1297 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | 1447 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; |
1298 | 1448 | ||
1299 | int main(int argc, char *argv[]) | 1449 | int main(int argc, char *argv[]) |
@@ -1317,7 +1467,12 @@ int main(int argc, char *argv[]) | |||
1317 | 1467 | ||
1318 | prime_field_tests(); | 1468 | prime_field_tests(); |
1319 | puts(""); | 1469 | puts(""); |
1470 | #ifndef OPENSSL_NO_EC2M | ||
1320 | char2_field_tests(); | 1471 | char2_field_tests(); |
1472 | #endif | ||
1473 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
1474 | nistp_tests(); | ||
1475 | #endif | ||
1321 | /* test the internal curves */ | 1476 | /* test the internal curves */ |
1322 | internal_curve_test(); | 1477 | internal_curve_test(); |
1323 | 1478 | ||
diff --git a/src/lib/libcrypto/engine/Makefile b/src/lib/libcrypto/engine/Makefile index 9c214824eb..d29bdd09a0 100644 --- a/src/lib/libcrypto/engine/Makefile +++ b/src/lib/libcrypto/engine/Makefile | |||
@@ -21,12 +21,14 @@ LIBSRC= eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c \ | |||
21 | eng_table.c eng_pkey.c eng_fat.c eng_all.c \ | 21 | eng_table.c eng_pkey.c eng_fat.c eng_all.c \ |
22 | tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c \ | 22 | tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c \ |
23 | tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c \ | 23 | tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c \ |
24 | eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c | 24 | eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c \ |
25 | eng_rsax.c eng_rdrand.c | ||
25 | LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \ | 26 | LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \ |
26 | eng_table.o eng_pkey.o eng_fat.o eng_all.o \ | 27 | eng_table.o eng_pkey.o eng_fat.o eng_all.o \ |
27 | tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o \ | 28 | tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o \ |
28 | tb_cipher.o tb_digest.o tb_pkmeth.o tb_asnmth.o \ | 29 | tb_cipher.o tb_digest.o tb_pkmeth.o tb_asnmth.o \ |
29 | eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o | 30 | eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o \ |
31 | eng_rsax.o eng_rdrand.o | ||
30 | 32 | ||
31 | SRC= $(LIBSRC) | 33 | SRC= $(LIBSRC) |
32 | 34 | ||
@@ -249,6 +251,34 @@ eng_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | |||
249 | eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 251 | eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
250 | eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 252 | eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
251 | eng_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_pkey.c | 253 | eng_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_pkey.c |
254 | eng_rdrand.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
255 | eng_rdrand.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
256 | eng_rdrand.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
257 | eng_rdrand.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
258 | eng_rdrand.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
259 | eng_rdrand.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
260 | eng_rdrand.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
261 | eng_rdrand.o: ../../include/openssl/opensslconf.h | ||
262 | eng_rdrand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
263 | eng_rdrand.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
264 | eng_rdrand.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
265 | eng_rdrand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
266 | eng_rdrand.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
267 | eng_rdrand.o: eng_rdrand.c | ||
268 | eng_rsax.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
269 | eng_rsax.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
270 | eng_rsax.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
271 | eng_rsax.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
272 | eng_rsax.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h | ||
273 | eng_rsax.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
274 | eng_rsax.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
275 | eng_rsax.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
276 | eng_rsax.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
277 | eng_rsax.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | ||
278 | eng_rsax.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
279 | eng_rsax.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
280 | eng_rsax.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
281 | eng_rsax.o: eng_rsax.c | ||
252 | eng_table.o: ../../e_os.h ../../include/openssl/asn1.h | 282 | eng_table.o: ../../e_os.h ../../include/openssl/asn1.h |
253 | eng_table.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 283 | eng_table.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
254 | eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 284 | eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
diff --git a/src/lib/libcrypto/engine/eng_cryptodev.c b/src/lib/libcrypto/engine/eng_cryptodev.c index 52f4ca3901..5a715aca4f 100644 --- a/src/lib/libcrypto/engine/eng_cryptodev.c +++ b/src/lib/libcrypto/engine/eng_cryptodev.c | |||
@@ -79,8 +79,6 @@ struct dev_crypto_state { | |||
79 | unsigned char digest_res[HASH_MAX_LEN]; | 79 | unsigned char digest_res[HASH_MAX_LEN]; |
80 | char *mac_data; | 80 | char *mac_data; |
81 | int mac_len; | 81 | int mac_len; |
82 | |||
83 | int copy; | ||
84 | #endif | 82 | #endif |
85 | }; | 83 | }; |
86 | 84 | ||
@@ -200,6 +198,7 @@ get_dev_crypto(void) | |||
200 | 198 | ||
201 | if ((fd = open_dev_crypto()) == -1) | 199 | if ((fd = open_dev_crypto()) == -1) |
202 | return (-1); | 200 | return (-1); |
201 | #ifndef CRIOGET_NOT_NEEDED | ||
203 | if (ioctl(fd, CRIOGET, &retfd) == -1) | 202 | if (ioctl(fd, CRIOGET, &retfd) == -1) |
204 | return (-1); | 203 | return (-1); |
205 | 204 | ||
@@ -208,9 +207,19 @@ get_dev_crypto(void) | |||
208 | close(retfd); | 207 | close(retfd); |
209 | return (-1); | 208 | return (-1); |
210 | } | 209 | } |
210 | #else | ||
211 | retfd = fd; | ||
212 | #endif | ||
211 | return (retfd); | 213 | return (retfd); |
212 | } | 214 | } |
213 | 215 | ||
216 | static void put_dev_crypto(int fd) | ||
217 | { | ||
218 | #ifndef CRIOGET_NOT_NEEDED | ||
219 | close(fd); | ||
220 | #endif | ||
221 | } | ||
222 | |||
214 | /* Caching version for asym operations */ | 223 | /* Caching version for asym operations */ |
215 | static int | 224 | static int |
216 | get_asym_dev_crypto(void) | 225 | get_asym_dev_crypto(void) |
@@ -252,7 +261,7 @@ get_cryptodev_ciphers(const int **cnids) | |||
252 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) | 261 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) |
253 | nids[count++] = ciphers[i].nid; | 262 | nids[count++] = ciphers[i].nid; |
254 | } | 263 | } |
255 | close(fd); | 264 | put_dev_crypto(fd); |
256 | 265 | ||
257 | if (count > 0) | 266 | if (count > 0) |
258 | *cnids = nids; | 267 | *cnids = nids; |
@@ -291,7 +300,7 @@ get_cryptodev_digests(const int **cnids) | |||
291 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) | 300 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) |
292 | nids[count++] = digests[i].nid; | 301 | nids[count++] = digests[i].nid; |
293 | } | 302 | } |
294 | close(fd); | 303 | put_dev_crypto(fd); |
295 | 304 | ||
296 | if (count > 0) | 305 | if (count > 0) |
297 | *cnids = nids; | 306 | *cnids = nids; |
@@ -436,7 +445,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
436 | sess->cipher = cipher; | 445 | sess->cipher = cipher; |
437 | 446 | ||
438 | if (ioctl(state->d_fd, CIOCGSESSION, sess) == -1) { | 447 | if (ioctl(state->d_fd, CIOCGSESSION, sess) == -1) { |
439 | close(state->d_fd); | 448 | put_dev_crypto(state->d_fd); |
440 | state->d_fd = -1; | 449 | state->d_fd = -1; |
441 | return (0); | 450 | return (0); |
442 | } | 451 | } |
@@ -473,7 +482,7 @@ cryptodev_cleanup(EVP_CIPHER_CTX *ctx) | |||
473 | } else { | 482 | } else { |
474 | ret = 1; | 483 | ret = 1; |
475 | } | 484 | } |
476 | close(state->d_fd); | 485 | put_dev_crypto(state->d_fd); |
477 | state->d_fd = -1; | 486 | state->d_fd = -1; |
478 | 487 | ||
479 | return (ret); | 488 | return (ret); |
@@ -686,7 +695,7 @@ static int cryptodev_digest_init(EVP_MD_CTX *ctx) | |||
686 | sess->mac = digest; | 695 | sess->mac = digest; |
687 | 696 | ||
688 | if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) { | 697 | if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) { |
689 | close(state->d_fd); | 698 | put_dev_crypto(state->d_fd); |
690 | state->d_fd = -1; | 699 | state->d_fd = -1; |
691 | printf("cryptodev_digest_init: Open session failed\n"); | 700 | printf("cryptodev_digest_init: Open session failed\n"); |
692 | return (0); | 701 | return (0); |
@@ -758,14 +767,12 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md) | |||
758 | if (! (ctx->flags & EVP_MD_CTX_FLAG_ONESHOT) ) { | 767 | if (! (ctx->flags & EVP_MD_CTX_FLAG_ONESHOT) ) { |
759 | /* if application doesn't support one buffer */ | 768 | /* if application doesn't support one buffer */ |
760 | memset(&cryp, 0, sizeof(cryp)); | 769 | memset(&cryp, 0, sizeof(cryp)); |
761 | |||
762 | cryp.ses = sess->ses; | 770 | cryp.ses = sess->ses; |
763 | cryp.flags = 0; | 771 | cryp.flags = 0; |
764 | cryp.len = state->mac_len; | 772 | cryp.len = state->mac_len; |
765 | cryp.src = state->mac_data; | 773 | cryp.src = state->mac_data; |
766 | cryp.dst = NULL; | 774 | cryp.dst = NULL; |
767 | cryp.mac = (caddr_t)md; | 775 | cryp.mac = (caddr_t)md; |
768 | |||
769 | if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) { | 776 | if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) { |
770 | printf("cryptodev_digest_final: digest failed\n"); | 777 | printf("cryptodev_digest_final: digest failed\n"); |
771 | return (0); | 778 | return (0); |
@@ -786,6 +793,9 @@ static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx) | |||
786 | struct dev_crypto_state *state = ctx->md_data; | 793 | struct dev_crypto_state *state = ctx->md_data; |
787 | struct session_op *sess = &state->d_sess; | 794 | struct session_op *sess = &state->d_sess; |
788 | 795 | ||
796 | if (state == NULL) | ||
797 | return 0; | ||
798 | |||
789 | if (state->d_fd < 0) { | 799 | if (state->d_fd < 0) { |
790 | printf("cryptodev_digest_cleanup: illegal input\n"); | 800 | printf("cryptodev_digest_cleanup: illegal input\n"); |
791 | return (0); | 801 | return (0); |
@@ -797,16 +807,13 @@ static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx) | |||
797 | state->mac_len = 0; | 807 | state->mac_len = 0; |
798 | } | 808 | } |
799 | 809 | ||
800 | if (state->copy) | ||
801 | return 1; | ||
802 | |||
803 | if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) { | 810 | if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) { |
804 | printf("cryptodev_digest_cleanup: failed to close session\n"); | 811 | printf("cryptodev_digest_cleanup: failed to close session\n"); |
805 | ret = 0; | 812 | ret = 0; |
806 | } else { | 813 | } else { |
807 | ret = 1; | 814 | ret = 1; |
808 | } | 815 | } |
809 | close(state->d_fd); | 816 | put_dev_crypto(state->d_fd); |
810 | state->d_fd = -1; | 817 | state->d_fd = -1; |
811 | 818 | ||
812 | return (ret); | 819 | return (ret); |
@@ -816,15 +823,39 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from) | |||
816 | { | 823 | { |
817 | struct dev_crypto_state *fstate = from->md_data; | 824 | struct dev_crypto_state *fstate = from->md_data; |
818 | struct dev_crypto_state *dstate = to->md_data; | 825 | struct dev_crypto_state *dstate = to->md_data; |
826 | struct session_op *sess; | ||
827 | int digest; | ||
819 | 828 | ||
820 | memcpy(dstate, fstate, sizeof(struct dev_crypto_state)); | 829 | if (dstate == NULL || fstate == NULL) |
830 | return 1; | ||
821 | 831 | ||
822 | if (fstate->mac_len != 0) { | 832 | memcpy(dstate, fstate, sizeof(struct dev_crypto_state)); |
823 | dstate->mac_data = OPENSSL_malloc(fstate->mac_len); | 833 | |
824 | memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len); | 834 | sess = &dstate->d_sess; |
835 | |||
836 | digest = digest_nid_to_cryptodev(to->digest->type); | ||
837 | |||
838 | sess->mackey = dstate->dummy_mac_key; | ||
839 | sess->mackeylen = digest_key_length(to->digest->type); | ||
840 | sess->mac = digest; | ||
841 | |||
842 | dstate->d_fd = get_dev_crypto(); | ||
843 | |||
844 | if (ioctl(dstate->d_fd, CIOCGSESSION, sess) < 0) { | ||
845 | put_dev_crypto(dstate->d_fd); | ||
846 | dstate->d_fd = -1; | ||
847 | printf("cryptodev_digest_init: Open session failed\n"); | ||
848 | return (0); | ||
825 | } | 849 | } |
826 | 850 | ||
827 | dstate->copy = 1; | 851 | if (fstate->mac_len != 0) { |
852 | if (fstate->mac_data != NULL) | ||
853 | { | ||
854 | dstate->mac_data = OPENSSL_malloc(fstate->mac_len); | ||
855 | memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len); | ||
856 | dstate->mac_len = fstate->mac_len; | ||
857 | } | ||
858 | } | ||
828 | 859 | ||
829 | return 1; | 860 | return 1; |
830 | } | 861 | } |
@@ -1347,11 +1378,11 @@ ENGINE_load_cryptodev(void) | |||
1347 | * find out what asymmetric crypto algorithms we support | 1378 | * find out what asymmetric crypto algorithms we support |
1348 | */ | 1379 | */ |
1349 | if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) { | 1380 | if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) { |
1350 | close(fd); | 1381 | put_dev_crypto(fd); |
1351 | ENGINE_free(engine); | 1382 | ENGINE_free(engine); |
1352 | return; | 1383 | return; |
1353 | } | 1384 | } |
1354 | close(fd); | 1385 | put_dev_crypto(fd); |
1355 | 1386 | ||
1356 | if (!ENGINE_set_id(engine, "cryptodev") || | 1387 | if (!ENGINE_set_id(engine, "cryptodev") || |
1357 | !ENGINE_set_name(engine, "BSD cryptodev engine") || | 1388 | !ENGINE_set_name(engine, "BSD cryptodev engine") || |
diff --git a/src/lib/libcrypto/evp/Makefile b/src/lib/libcrypto/evp/Makefile index 82825e5299..0fe1b96bff 100644 --- a/src/lib/libcrypto/evp/Makefile +++ b/src/lib/libcrypto/evp/Makefile | |||
@@ -28,7 +28,8 @@ LIBSRC= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c \ | |||
28 | bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ | 28 | bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ |
29 | c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ | 29 | c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ |
30 | evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c \ | 30 | evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c \ |
31 | e_old.c pmeth_lib.c pmeth_fn.c pmeth_gn.c m_sigver.c | 31 | e_old.c pmeth_lib.c pmeth_fn.c pmeth_gn.c m_sigver.c evp_fips.c \ |
32 | e_aes_cbc_hmac_sha1.c e_rc4_hmac_md5.c | ||
32 | 33 | ||
33 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ | 34 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ |
34 | e_des.o e_bf.o e_idea.o e_des3.o e_camellia.o\ | 35 | e_des.o e_bf.o e_idea.o e_des3.o e_camellia.o\ |
@@ -40,7 +41,8 @@ LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ | |||
40 | bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ | 41 | bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ |
41 | c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \ | 42 | c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \ |
42 | evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o \ | 43 | evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o \ |
43 | e_old.o pmeth_lib.o pmeth_fn.o pmeth_gn.o m_sigver.o | 44 | e_old.o pmeth_lib.o pmeth_fn.o pmeth_gn.o m_sigver.o evp_fips.o \ |
45 | e_aes_cbc_hmac_sha1.o e_rc4_hmac_md5.o | ||
44 | 46 | ||
45 | SRC= $(LIBSRC) | 47 | SRC= $(LIBSRC) |
46 | 48 | ||
@@ -189,11 +191,27 @@ e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | |||
189 | e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | 191 | e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h |
190 | e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 192 | e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
191 | e_aes.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | 193 | e_aes.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
192 | e_aes.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 194 | e_aes.o: ../../include/openssl/modes.h ../../include/openssl/obj_mac.h |
193 | e_aes.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 195 | e_aes.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
194 | e_aes.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 196 | e_aes.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
195 | e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.c | 197 | e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h |
196 | e_aes.o: evp_locl.h | 198 | e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
199 | e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h | ||
200 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
201 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h | ||
202 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h | ||
203 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h | ||
204 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h | ||
205 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/obj_mac.h | ||
206 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/objects.h | ||
207 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/opensslconf.h | ||
208 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/opensslv.h | ||
209 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/ossl_typ.h | ||
210 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h | ||
211 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h | ||
212 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h | ||
213 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h e_aes_cbc_hmac_sha1.c | ||
214 | e_aes_cbc_hmac_sha1.o: evp_locl.h | ||
197 | e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 215 | e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
198 | e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h | 216 | e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h |
199 | e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 217 | e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
@@ -279,7 +297,18 @@ e_rc4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | |||
279 | e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 297 | e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
280 | e_rc4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h | 298 | e_rc4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h |
281 | e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 299 | e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
282 | e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc4.c | 300 | e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc4.c evp_locl.h |
301 | e_rc4_hmac_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
302 | e_rc4_hmac_md5.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
303 | e_rc4_hmac_md5.o: ../../include/openssl/evp.h ../../include/openssl/md5.h | ||
304 | e_rc4_hmac_md5.o: ../../include/openssl/obj_mac.h | ||
305 | e_rc4_hmac_md5.o: ../../include/openssl/objects.h | ||
306 | e_rc4_hmac_md5.o: ../../include/openssl/opensslconf.h | ||
307 | e_rc4_hmac_md5.o: ../../include/openssl/opensslv.h | ||
308 | e_rc4_hmac_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h | ||
309 | e_rc4_hmac_md5.o: ../../include/openssl/safestack.h | ||
310 | e_rc4_hmac_md5.o: ../../include/openssl/stack.h | ||
311 | e_rc4_hmac_md5.o: ../../include/openssl/symhacks.h e_rc4_hmac_md5.c | ||
283 | e_rc5.o: ../../e_os.h ../../include/openssl/bio.h | 312 | e_rc5.o: ../../e_os.h ../../include/openssl/bio.h |
284 | e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 313 | e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
285 | e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 314 | e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
@@ -349,6 +378,13 @@ evp_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | |||
349 | evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 378 | evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
350 | evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 379 | evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
351 | evp_err.o: ../../include/openssl/symhacks.h evp_err.c | 380 | evp_err.o: ../../include/openssl/symhacks.h evp_err.c |
381 | evp_fips.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
382 | evp_fips.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
383 | evp_fips.o: ../../include/openssl/evp.h ../../include/openssl/obj_mac.h | ||
384 | evp_fips.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
385 | evp_fips.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
386 | evp_fips.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
387 | evp_fips.o: ../../include/openssl/symhacks.h evp_fips.c | ||
352 | evp_key.o: ../../e_os.h ../../include/openssl/asn1.h | 388 | evp_key.o: ../../e_os.h ../../include/openssl/asn1.h |
353 | evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 389 | evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
354 | evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 390 | evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
@@ -383,7 +419,7 @@ evp_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | |||
383 | evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | 419 | evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h |
384 | evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 420 | evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
385 | evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 421 | evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
386 | evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pbe.c | 422 | evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h evp_pbe.c |
387 | evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h | 423 | evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h |
388 | evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 424 | evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
389 | evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 425 | evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
@@ -456,7 +492,7 @@ m_md4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | |||
456 | m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 492 | m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
457 | m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 493 | m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
458 | m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 494 | m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
459 | m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md4.c | 495 | m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_md4.c |
460 | m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 496 | m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
461 | m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 497 | m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
462 | m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 498 | m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -469,7 +505,7 @@ m_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | |||
469 | m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 505 | m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
470 | m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 506 | m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
471 | m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 507 | m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
472 | m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md5.c | 508 | m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_md5.c |
473 | m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 509 | m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
474 | m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 510 | m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
475 | m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | 511 | m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h |
@@ -484,7 +520,7 @@ m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | |||
484 | m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 520 | m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
485 | m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | 521 | m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
486 | m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | 522 | m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h |
487 | m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_mdc2.c | 523 | m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_mdc2.c |
488 | m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 524 | m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
489 | m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 525 | m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
490 | m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 526 | m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -510,7 +546,8 @@ m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/ripemd.h | |||
510 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 546 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
511 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 547 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
512 | m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 548 | m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
513 | m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_ripemd.c | 549 | m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h |
550 | m_ripemd.o: m_ripemd.c | ||
514 | m_sha.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 551 | m_sha.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
515 | m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 552 | m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
516 | m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 553 | m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -523,7 +560,7 @@ m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | |||
523 | m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 560 | m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
524 | m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 561 | m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
525 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 562 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
526 | m_sha.o: ../cryptlib.h m_sha.c | 563 | m_sha.o: ../cryptlib.h evp_locl.h m_sha.c |
527 | m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 564 | m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
528 | m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 565 | m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
529 | m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 566 | m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -563,7 +600,7 @@ m_wp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | |||
563 | m_wp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 600 | m_wp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
564 | m_wp.o: ../../include/openssl/symhacks.h ../../include/openssl/whrlpool.h | 601 | m_wp.o: ../../include/openssl/symhacks.h ../../include/openssl/whrlpool.h |
565 | m_wp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 602 | m_wp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
566 | m_wp.o: ../cryptlib.h m_wp.c | 603 | m_wp.o: ../cryptlib.h evp_locl.h m_wp.c |
567 | names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 604 | names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
568 | names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 605 | names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
569 | names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 606 | names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -601,7 +638,8 @@ p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
601 | p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | 638 | p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h |
602 | p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 639 | p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
603 | p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 640 | p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
604 | p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_crpt2.c | 641 | p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h |
642 | p5_crpt2.o: p5_crpt2.c | ||
605 | p_dec.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 643 | p_dec.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
606 | p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 644 | p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
607 | p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 645 | p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c index 98bc1ab409..e64335353f 100644 --- a/src/lib/libcrypto/evp/bio_ok.c +++ b/src/lib/libcrypto/evp/bio_ok.c | |||
@@ -133,10 +133,10 @@ static int ok_new(BIO *h); | |||
133 | static int ok_free(BIO *data); | 133 | static int ok_free(BIO *data); |
134 | static long ok_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); | 134 | static long ok_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); |
135 | 135 | ||
136 | static void sig_out(BIO* b); | 136 | static int sig_out(BIO* b); |
137 | static void sig_in(BIO* b); | 137 | static int sig_in(BIO* b); |
138 | static void block_out(BIO* b); | 138 | static int block_out(BIO* b); |
139 | static void block_in(BIO* b); | 139 | static int block_in(BIO* b); |
140 | #define OK_BLOCK_SIZE (1024*4) | 140 | #define OK_BLOCK_SIZE (1024*4) |
141 | #define OK_BLOCK_BLOCK 4 | 141 | #define OK_BLOCK_BLOCK 4 |
142 | #define IOBS (OK_BLOCK_SIZE+ OK_BLOCK_BLOCK+ 3*EVP_MAX_MD_SIZE) | 142 | #define IOBS (OK_BLOCK_SIZE+ OK_BLOCK_BLOCK+ 3*EVP_MAX_MD_SIZE) |
@@ -266,10 +266,24 @@ static int ok_read(BIO *b, char *out, int outl) | |||
266 | ctx->buf_len+= i; | 266 | ctx->buf_len+= i; |
267 | 267 | ||
268 | /* no signature yet -- check if we got one */ | 268 | /* no signature yet -- check if we got one */ |
269 | if (ctx->sigio == 1) sig_in(b); | 269 | if (ctx->sigio == 1) |
270 | { | ||
271 | if (!sig_in(b)) | ||
272 | { | ||
273 | BIO_clear_retry_flags(b); | ||
274 | return 0; | ||
275 | } | ||
276 | } | ||
270 | 277 | ||
271 | /* signature ok -- check if we got block */ | 278 | /* signature ok -- check if we got block */ |
272 | if (ctx->sigio == 0) block_in(b); | 279 | if (ctx->sigio == 0) |
280 | { | ||
281 | if (!block_in(b)) | ||
282 | { | ||
283 | BIO_clear_retry_flags(b); | ||
284 | return 0; | ||
285 | } | ||
286 | } | ||
273 | 287 | ||
274 | /* invalid block -- cancel */ | 288 | /* invalid block -- cancel */ |
275 | if (ctx->cont <= 0) break; | 289 | if (ctx->cont <= 0) break; |
@@ -293,7 +307,8 @@ static int ok_write(BIO *b, const char *in, int inl) | |||
293 | 307 | ||
294 | if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0); | 308 | if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0); |
295 | 309 | ||
296 | if(ctx->sigio) sig_out(b); | 310 | if(ctx->sigio && !sig_out(b)) |
311 | return 0; | ||
297 | 312 | ||
298 | do{ | 313 | do{ |
299 | BIO_clear_retry_flags(b); | 314 | BIO_clear_retry_flags(b); |
@@ -332,7 +347,11 @@ static int ok_write(BIO *b, const char *in, int inl) | |||
332 | 347 | ||
333 | if(ctx->buf_len >= OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) | 348 | if(ctx->buf_len >= OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) |
334 | { | 349 | { |
335 | block_out(b); | 350 | if (!block_out(b)) |
351 | { | ||
352 | BIO_clear_retry_flags(b); | ||
353 | return 0; | ||
354 | } | ||
336 | } | 355 | } |
337 | }while(inl > 0); | 356 | }while(inl > 0); |
338 | 357 | ||
@@ -379,7 +398,8 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
379 | case BIO_CTRL_FLUSH: | 398 | case BIO_CTRL_FLUSH: |
380 | /* do a final write */ | 399 | /* do a final write */ |
381 | if(ctx->blockout == 0) | 400 | if(ctx->blockout == 0) |
382 | block_out(b); | 401 | if (!block_out(b)) |
402 | return 0; | ||
383 | 403 | ||
384 | while (ctx->blockout) | 404 | while (ctx->blockout) |
385 | { | 405 | { |
@@ -408,7 +428,8 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
408 | break; | 428 | break; |
409 | case BIO_C_SET_MD: | 429 | case BIO_C_SET_MD: |
410 | md=ptr; | 430 | md=ptr; |
411 | EVP_DigestInit_ex(&ctx->md, md, NULL); | 431 | if (!EVP_DigestInit_ex(&ctx->md, md, NULL)) |
432 | return 0; | ||
412 | b->init=1; | 433 | b->init=1; |
413 | break; | 434 | break; |
414 | case BIO_C_GET_MD: | 435 | case BIO_C_GET_MD: |
@@ -455,7 +476,7 @@ static void longswap(void *_ptr, size_t len) | |||
455 | } | 476 | } |
456 | } | 477 | } |
457 | 478 | ||
458 | static void sig_out(BIO* b) | 479 | static int sig_out(BIO* b) |
459 | { | 480 | { |
460 | BIO_OK_CTX *ctx; | 481 | BIO_OK_CTX *ctx; |
461 | EVP_MD_CTX *md; | 482 | EVP_MD_CTX *md; |
@@ -463,9 +484,10 @@ static void sig_out(BIO* b) | |||
463 | ctx=b->ptr; | 484 | ctx=b->ptr; |
464 | md=&ctx->md; | 485 | md=&ctx->md; |
465 | 486 | ||
466 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return; | 487 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return 1; |
467 | 488 | ||
468 | EVP_DigestInit_ex(md, md->digest, NULL); | 489 | if (!EVP_DigestInit_ex(md, md->digest, NULL)) |
490 | goto berr; | ||
469 | /* FIXME: there's absolutely no guarantee this makes any sense at all, | 491 | /* FIXME: there's absolutely no guarantee this makes any sense at all, |
470 | * particularly now EVP_MD_CTX has been restructured. | 492 | * particularly now EVP_MD_CTX has been restructured. |
471 | */ | 493 | */ |
@@ -474,14 +496,20 @@ static void sig_out(BIO* b) | |||
474 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); | 496 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); |
475 | ctx->buf_len+= md->digest->md_size; | 497 | ctx->buf_len+= md->digest->md_size; |
476 | 498 | ||
477 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); | 499 | if (!EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN))) |
478 | EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL); | 500 | goto berr; |
501 | if (!EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL)) | ||
502 | goto berr; | ||
479 | ctx->buf_len+= md->digest->md_size; | 503 | ctx->buf_len+= md->digest->md_size; |
480 | ctx->blockout= 1; | 504 | ctx->blockout= 1; |
481 | ctx->sigio= 0; | 505 | ctx->sigio= 0; |
506 | return 1; | ||
507 | berr: | ||
508 | BIO_clear_retry_flags(b); | ||
509 | return 0; | ||
482 | } | 510 | } |
483 | 511 | ||
484 | static void sig_in(BIO* b) | 512 | static int sig_in(BIO* b) |
485 | { | 513 | { |
486 | BIO_OK_CTX *ctx; | 514 | BIO_OK_CTX *ctx; |
487 | EVP_MD_CTX *md; | 515 | EVP_MD_CTX *md; |
@@ -491,15 +519,18 @@ static void sig_in(BIO* b) | |||
491 | ctx=b->ptr; | 519 | ctx=b->ptr; |
492 | md=&ctx->md; | 520 | md=&ctx->md; |
493 | 521 | ||
494 | if((int)(ctx->buf_len-ctx->buf_off) < 2*md->digest->md_size) return; | 522 | if((int)(ctx->buf_len-ctx->buf_off) < 2*md->digest->md_size) return 1; |
495 | 523 | ||
496 | EVP_DigestInit_ex(md, md->digest, NULL); | 524 | if (!EVP_DigestInit_ex(md, md->digest, NULL)) |
525 | goto berr; | ||
497 | memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size); | 526 | memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size); |
498 | longswap(md->md_data, md->digest->md_size); | 527 | longswap(md->md_data, md->digest->md_size); |
499 | ctx->buf_off+= md->digest->md_size; | 528 | ctx->buf_off+= md->digest->md_size; |
500 | 529 | ||
501 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); | 530 | if (!EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN))) |
502 | EVP_DigestFinal_ex(md, tmp, NULL); | 531 | goto berr; |
532 | if (!EVP_DigestFinal_ex(md, tmp, NULL)) | ||
533 | goto berr; | ||
503 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; | 534 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; |
504 | ctx->buf_off+= md->digest->md_size; | 535 | ctx->buf_off+= md->digest->md_size; |
505 | if(ret == 1) | 536 | if(ret == 1) |
@@ -516,9 +547,13 @@ static void sig_in(BIO* b) | |||
516 | { | 547 | { |
517 | ctx->cont= 0; | 548 | ctx->cont= 0; |
518 | } | 549 | } |
550 | return 1; | ||
551 | berr: | ||
552 | BIO_clear_retry_flags(b); | ||
553 | return 0; | ||
519 | } | 554 | } |
520 | 555 | ||
521 | static void block_out(BIO* b) | 556 | static int block_out(BIO* b) |
522 | { | 557 | { |
523 | BIO_OK_CTX *ctx; | 558 | BIO_OK_CTX *ctx; |
524 | EVP_MD_CTX *md; | 559 | EVP_MD_CTX *md; |
@@ -532,13 +567,20 @@ static void block_out(BIO* b) | |||
532 | ctx->buf[1]=(unsigned char)(tl>>16); | 567 | ctx->buf[1]=(unsigned char)(tl>>16); |
533 | ctx->buf[2]=(unsigned char)(tl>>8); | 568 | ctx->buf[2]=(unsigned char)(tl>>8); |
534 | ctx->buf[3]=(unsigned char)(tl); | 569 | ctx->buf[3]=(unsigned char)(tl); |
535 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | 570 | if (!EVP_DigestUpdate(md, |
536 | EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL); | 571 | (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl)) |
572 | goto berr; | ||
573 | if (!EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL)) | ||
574 | goto berr; | ||
537 | ctx->buf_len+= md->digest->md_size; | 575 | ctx->buf_len+= md->digest->md_size; |
538 | ctx->blockout= 1; | 576 | ctx->blockout= 1; |
577 | return 1; | ||
578 | berr: | ||
579 | BIO_clear_retry_flags(b); | ||
580 | return 0; | ||
539 | } | 581 | } |
540 | 582 | ||
541 | static void block_in(BIO* b) | 583 | static int block_in(BIO* b) |
542 | { | 584 | { |
543 | BIO_OK_CTX *ctx; | 585 | BIO_OK_CTX *ctx; |
544 | EVP_MD_CTX *md; | 586 | EVP_MD_CTX *md; |
@@ -554,10 +596,13 @@ static void block_in(BIO* b) | |||
554 | tl|=ctx->buf[2]; tl<<=8; | 596 | tl|=ctx->buf[2]; tl<<=8; |
555 | tl|=ctx->buf[3]; | 597 | tl|=ctx->buf[3]; |
556 | 598 | ||
557 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return; | 599 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return 1; |
558 | 600 | ||
559 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | 601 | if (!EVP_DigestUpdate(md, |
560 | EVP_DigestFinal_ex(md, tmp, NULL); | 602 | (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl)) |
603 | goto berr; | ||
604 | if (!EVP_DigestFinal_ex(md, tmp, NULL)) | ||
605 | goto berr; | ||
561 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) | 606 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) |
562 | { | 607 | { |
563 | /* there might be parts from next block lurking around ! */ | 608 | /* there might be parts from next block lurking around ! */ |
@@ -571,5 +616,9 @@ static void block_in(BIO* b) | |||
571 | { | 616 | { |
572 | ctx->cont= 0; | 617 | ctx->cont= 0; |
573 | } | 618 | } |
619 | return 1; | ||
620 | berr: | ||
621 | BIO_clear_retry_flags(b); | ||
622 | return 0; | ||
574 | } | 623 | } |
575 | 624 | ||
diff --git a/src/lib/libcrypto/evp/c_allc.c b/src/lib/libcrypto/evp/c_allc.c index c5f9268378..2a45d435e5 100644 --- a/src/lib/libcrypto/evp/c_allc.c +++ b/src/lib/libcrypto/evp/c_allc.c | |||
@@ -98,6 +98,9 @@ void OpenSSL_add_all_ciphers(void) | |||
98 | #ifndef OPENSSL_NO_RC4 | 98 | #ifndef OPENSSL_NO_RC4 |
99 | EVP_add_cipher(EVP_rc4()); | 99 | EVP_add_cipher(EVP_rc4()); |
100 | EVP_add_cipher(EVP_rc4_40()); | 100 | EVP_add_cipher(EVP_rc4_40()); |
101 | #ifndef OPENSSL_NO_MD5 | ||
102 | EVP_add_cipher(EVP_rc4_hmac_md5()); | ||
103 | #endif | ||
101 | #endif | 104 | #endif |
102 | 105 | ||
103 | #ifndef OPENSSL_NO_IDEA | 106 | #ifndef OPENSSL_NO_IDEA |
@@ -166,9 +169,9 @@ void OpenSSL_add_all_ciphers(void) | |||
166 | EVP_add_cipher(EVP_aes_128_cfb1()); | 169 | EVP_add_cipher(EVP_aes_128_cfb1()); |
167 | EVP_add_cipher(EVP_aes_128_cfb8()); | 170 | EVP_add_cipher(EVP_aes_128_cfb8()); |
168 | EVP_add_cipher(EVP_aes_128_ofb()); | 171 | EVP_add_cipher(EVP_aes_128_ofb()); |
169 | #if 0 | ||
170 | EVP_add_cipher(EVP_aes_128_ctr()); | 172 | EVP_add_cipher(EVP_aes_128_ctr()); |
171 | #endif | 173 | EVP_add_cipher(EVP_aes_128_gcm()); |
174 | EVP_add_cipher(EVP_aes_128_xts()); | ||
172 | EVP_add_cipher_alias(SN_aes_128_cbc,"AES128"); | 175 | EVP_add_cipher_alias(SN_aes_128_cbc,"AES128"); |
173 | EVP_add_cipher_alias(SN_aes_128_cbc,"aes128"); | 176 | EVP_add_cipher_alias(SN_aes_128_cbc,"aes128"); |
174 | EVP_add_cipher(EVP_aes_192_ecb()); | 177 | EVP_add_cipher(EVP_aes_192_ecb()); |
@@ -177,9 +180,8 @@ void OpenSSL_add_all_ciphers(void) | |||
177 | EVP_add_cipher(EVP_aes_192_cfb1()); | 180 | EVP_add_cipher(EVP_aes_192_cfb1()); |
178 | EVP_add_cipher(EVP_aes_192_cfb8()); | 181 | EVP_add_cipher(EVP_aes_192_cfb8()); |
179 | EVP_add_cipher(EVP_aes_192_ofb()); | 182 | EVP_add_cipher(EVP_aes_192_ofb()); |
180 | #if 0 | ||
181 | EVP_add_cipher(EVP_aes_192_ctr()); | 183 | EVP_add_cipher(EVP_aes_192_ctr()); |
182 | #endif | 184 | EVP_add_cipher(EVP_aes_192_gcm()); |
183 | EVP_add_cipher_alias(SN_aes_192_cbc,"AES192"); | 185 | EVP_add_cipher_alias(SN_aes_192_cbc,"AES192"); |
184 | EVP_add_cipher_alias(SN_aes_192_cbc,"aes192"); | 186 | EVP_add_cipher_alias(SN_aes_192_cbc,"aes192"); |
185 | EVP_add_cipher(EVP_aes_256_ecb()); | 187 | EVP_add_cipher(EVP_aes_256_ecb()); |
@@ -188,11 +190,15 @@ void OpenSSL_add_all_ciphers(void) | |||
188 | EVP_add_cipher(EVP_aes_256_cfb1()); | 190 | EVP_add_cipher(EVP_aes_256_cfb1()); |
189 | EVP_add_cipher(EVP_aes_256_cfb8()); | 191 | EVP_add_cipher(EVP_aes_256_cfb8()); |
190 | EVP_add_cipher(EVP_aes_256_ofb()); | 192 | EVP_add_cipher(EVP_aes_256_ofb()); |
191 | #if 0 | ||
192 | EVP_add_cipher(EVP_aes_256_ctr()); | 193 | EVP_add_cipher(EVP_aes_256_ctr()); |
193 | #endif | 194 | EVP_add_cipher(EVP_aes_256_gcm()); |
195 | EVP_add_cipher(EVP_aes_256_xts()); | ||
194 | EVP_add_cipher_alias(SN_aes_256_cbc,"AES256"); | 196 | EVP_add_cipher_alias(SN_aes_256_cbc,"AES256"); |
195 | EVP_add_cipher_alias(SN_aes_256_cbc,"aes256"); | 197 | EVP_add_cipher_alias(SN_aes_256_cbc,"aes256"); |
198 | #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) | ||
199 | EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1()); | ||
200 | EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1()); | ||
201 | #endif | ||
196 | #endif | 202 | #endif |
197 | 203 | ||
198 | #ifndef OPENSSL_NO_CAMELLIA | 204 | #ifndef OPENSSL_NO_CAMELLIA |
diff --git a/src/lib/libcrypto/evp/evptests.txt b/src/lib/libcrypto/evp/evptests.txt index beb12144b6..c273707c14 100644 --- a/src/lib/libcrypto/evp/evptests.txt +++ b/src/lib/libcrypto/evp/evptests.txt | |||
@@ -158,6 +158,19 @@ AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7B | |||
158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | 158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 |
159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | 159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 |
160 | 160 | ||
161 | # AES Counter test vectors from RFC3686 | ||
162 | aes-128-ctr:AE6852F8121067CC4BF7A5765577F39E:00000030000000000000000000000001:53696E676C6520626C6F636B206D7367:E4095D4FB7A7B3792D6175A3261311B8:1 | ||
163 | aes-128-ctr:7E24067817FAE0D743D6CE1F32539163:006CB6DBC0543B59DA48D90B00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28:1 | ||
164 | aes-128-ctr:7691BE035E5020A8AC6E618529F9A0DC:00E0017B27777F3F4A1786F000000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F:1 | ||
165 | |||
166 | aes-192-ctr:16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515:0000004836733C147D6D93CB00000001:53696E676C6520626C6F636B206D7367:4B55384FE259C9C84E7935A003CBE928:1 | ||
167 | aes-192-ctr:7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A:0096B03B020C6EADC2CB500D00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:453243FC609B23327EDFAAFA7131CD9F8490701C5AD4A79CFC1FE0FF42F4FB00:1 | ||
168 | aes-192-ctr:02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE:0007BDFD5CBD60278DCC091200000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:96893FC55E5C722F540B7DD1DDF7E758D288BC95C69165884536C811662F2188ABEE0935:1 | ||
169 | |||
170 | aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:00000060DB5672C97AA8F0B200000001:53696E676C6520626C6F636B206D7367:145AD01DBF824EC7560863DC71E3E0C0:1 | ||
171 | aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1 | ||
172 | aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1 | ||
173 | |||
161 | # DES ECB tests (from destest) | 174 | # DES ECB tests (from destest) |
162 | 175 | ||
163 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | 176 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 |
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c index b08d559803..3602bed316 100644 --- a/src/lib/libcrypto/evp/m_mdc2.c +++ b/src/lib/libcrypto/evp/m_mdc2.c | |||
@@ -69,6 +69,8 @@ | |||
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #include "evp_locl.h" | ||
73 | |||
72 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
73 | { return MDC2_Init(ctx->md_data); } | 75 | { return MDC2_Init(ctx->md_data); } |
74 | 76 | ||
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c index acccc8f92d..8769cdd42f 100644 --- a/src/lib/libcrypto/evp/m_sha.c +++ b/src/lib/libcrypto/evp/m_sha.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #ifndef OPENSSL_NO_RSA | 67 | #ifndef OPENSSL_NO_RSA |
68 | #include <openssl/rsa.h> | 68 | #include <openssl/rsa.h> |
69 | #endif | 69 | #endif |
70 | #include "evp_locl.h" | ||
70 | 71 | ||
71 | static int init(EVP_MD_CTX *ctx) | 72 | static int init(EVP_MD_CTX *ctx) |
72 | { return SHA_Init(ctx->md_data); } | 73 | { return SHA_Init(ctx->md_data); } |
diff --git a/src/lib/libcrypto/idea/Makefile b/src/lib/libcrypto/idea/Makefile index b2e7add666..8af0acdad9 100644 --- a/src/lib/libcrypto/idea/Makefile +++ b/src/lib/libcrypto/idea/Makefile | |||
@@ -82,5 +82,8 @@ i_ecb.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h | |||
82 | i_ecb.o: ../../include/openssl/opensslv.h i_ecb.c idea_lcl.h | 82 | i_ecb.o: ../../include/openssl/opensslv.h i_ecb.c idea_lcl.h |
83 | i_ofb64.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h | 83 | i_ofb64.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h |
84 | i_ofb64.o: i_ofb64.c idea_lcl.h | 84 | i_ofb64.o: i_ofb64.c idea_lcl.h |
85 | i_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
85 | i_skey.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h | 86 | i_skey.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h |
86 | i_skey.o: i_skey.c idea_lcl.h | 87 | i_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
88 | i_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
89 | i_skey.o: ../../include/openssl/symhacks.h i_skey.c idea_lcl.h | ||
diff --git a/src/lib/libcrypto/md2/md2.h b/src/lib/libcrypto/md2/md2.h index a46120e7d4..d59c9f2593 100644 --- a/src/lib/libcrypto/md2/md2.h +++ b/src/lib/libcrypto/md2/md2.h | |||
@@ -81,6 +81,9 @@ typedef struct MD2state_st | |||
81 | } MD2_CTX; | 81 | } MD2_CTX; |
82 | 82 | ||
83 | const char *MD2_options(void); | 83 | const char *MD2_options(void); |
84 | #ifdef OPENSSL_FIPS | ||
85 | int private_MD2_Init(MD2_CTX *c); | ||
86 | #endif | ||
84 | int MD2_Init(MD2_CTX *c); | 87 | int MD2_Init(MD2_CTX *c); |
85 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); | 88 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); |
86 | int MD2_Final(unsigned char *md, MD2_CTX *c); | 89 | int MD2_Final(unsigned char *md, MD2_CTX *c); |
diff --git a/src/lib/libcrypto/md2/md2_dgst.c b/src/lib/libcrypto/md2/md2_dgst.c index c57b3da288..bf89def73e 100644 --- a/src/lib/libcrypto/md2/md2_dgst.c +++ b/src/lib/libcrypto/md2/md2_dgst.c | |||
@@ -116,7 +116,7 @@ const char *MD2_options(void) | |||
116 | return("md2(int)"); | 116 | return("md2(int)"); |
117 | } | 117 | } |
118 | 118 | ||
119 | int MD2_Init(MD2_CTX *c) | 119 | fips_md_init(MD2) |
120 | { | 120 | { |
121 | c->num=0; | 121 | c->num=0; |
122 | memset(c->state,0,sizeof c->state); | 122 | memset(c->state,0,sizeof c->state); |
diff --git a/src/lib/libcrypto/md4/Makefile b/src/lib/libcrypto/md4/Makefile index c94a1398ed..e6f1e4478c 100644 --- a/src/lib/libcrypto/md4/Makefile +++ b/src/lib/libcrypto/md4/Makefile | |||
@@ -76,9 +76,11 @@ clean: | |||
76 | 76 | ||
77 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 77 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
78 | 78 | ||
79 | md4_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h | 79 | md4_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
80 | md4_dgst.o: ../../include/openssl/opensslconf.h | 80 | md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h |
81 | md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_dgst.c | 81 | md4_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
82 | md4_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
83 | md4_dgst.o: ../../include/openssl/symhacks.h ../md32_common.h md4_dgst.c | ||
82 | md4_dgst.o: md4_locl.h | 84 | md4_dgst.o: md4_locl.h |
83 | md4_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 85 | md4_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
84 | md4_one.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h | 86 | md4_one.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h |
diff --git a/src/lib/libcrypto/md5/Makefile b/src/lib/libcrypto/md5/Makefile index 9858d53d31..b9e2ce9a38 100644 --- a/src/lib/libcrypto/md5/Makefile +++ b/src/lib/libcrypto/md5/Makefile | |||
@@ -89,9 +89,11 @@ clean: | |||
89 | 89 | ||
90 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 90 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
91 | 91 | ||
92 | md5_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md5.h | 92 | md5_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
93 | md5_dgst.o: ../../include/openssl/opensslconf.h | 93 | md5_dgst.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h |
94 | md5_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md5_dgst.c | 94 | md5_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
95 | md5_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
96 | md5_dgst.o: ../../include/openssl/symhacks.h ../md32_common.h md5_dgst.c | ||
95 | md5_dgst.o: md5_locl.h | 97 | md5_dgst.o: md5_locl.h |
96 | md5_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 98 | md5_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
97 | md5_one.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h | 99 | md5_one.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h |
diff --git a/src/lib/libcrypto/mdc2/Makefile b/src/lib/libcrypto/mdc2/Makefile index 1d064f17a6..141553149d 100644 --- a/src/lib/libcrypto/mdc2/Makefile +++ b/src/lib/libcrypto/mdc2/Makefile | |||
@@ -84,10 +84,10 @@ mdc2_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
84 | mdc2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 84 | mdc2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
85 | mdc2_one.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | 85 | mdc2_one.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
86 | mdc2_one.o: ../../include/openssl/ui_compat.h ../cryptlib.h mdc2_one.c | 86 | mdc2_one.o: ../../include/openssl/ui_compat.h ../cryptlib.h mdc2_one.c |
87 | mdc2dgst.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | 87 | mdc2dgst.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
88 | mdc2dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/mdc2.h | 88 | mdc2dgst.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h |
89 | mdc2dgst.o: ../../include/openssl/opensslconf.h | 89 | mdc2dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h |
90 | mdc2dgst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 90 | mdc2dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
91 | mdc2dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 91 | mdc2dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
92 | mdc2dgst.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | 92 | mdc2dgst.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
93 | mdc2dgst.o: mdc2dgst.c | 93 | mdc2dgst.o: ../../include/openssl/ui_compat.h mdc2dgst.c |
diff --git a/src/lib/libcrypto/mdc2/mdc2.h b/src/lib/libcrypto/mdc2/mdc2.h index 72778a5212..f3e8e579d2 100644 --- a/src/lib/libcrypto/mdc2/mdc2.h +++ b/src/lib/libcrypto/mdc2/mdc2.h | |||
@@ -81,6 +81,9 @@ typedef struct mdc2_ctx_st | |||
81 | } MDC2_CTX; | 81 | } MDC2_CTX; |
82 | 82 | ||
83 | 83 | ||
84 | #ifdef OPENSSL_FIPS | ||
85 | int private_MDC2_Init(MDC2_CTX *c); | ||
86 | #endif | ||
84 | int MDC2_Init(MDC2_CTX *c); | 87 | int MDC2_Init(MDC2_CTX *c); |
85 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); | 88 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); |
86 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); | 89 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); |
diff --git a/src/lib/libcrypto/mem.c b/src/lib/libcrypto/mem.c index 6f80dd33eb..21c0011380 100644 --- a/src/lib/libcrypto/mem.c +++ b/src/lib/libcrypto/mem.c | |||
@@ -125,6 +125,7 @@ static long (*get_debug_options_func)(void) = NULL; | |||
125 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), | 125 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), |
126 | void (*f)(void *)) | 126 | void (*f)(void *)) |
127 | { | 127 | { |
128 | OPENSSL_init(); | ||
128 | if (!allow_customize) | 129 | if (!allow_customize) |
129 | return 0; | 130 | return 0; |
130 | if ((m == 0) || (r == 0) || (f == 0)) | 131 | if ((m == 0) || (r == 0) || (f == 0)) |
@@ -186,6 +187,7 @@ int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int), | |||
186 | { | 187 | { |
187 | if (!allow_customize_debug) | 188 | if (!allow_customize_debug) |
188 | return 0; | 189 | return 0; |
190 | OPENSSL_init(); | ||
189 | malloc_debug_func=m; | 191 | malloc_debug_func=m; |
190 | realloc_debug_func=r; | 192 | realloc_debug_func=r; |
191 | free_debug_func=f; | 193 | free_debug_func=f; |
@@ -361,6 +363,10 @@ void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file, | |||
361 | 363 | ||
362 | if (num <= 0) return NULL; | 364 | if (num <= 0) return NULL; |
363 | 365 | ||
366 | /* We don't support shrinking the buffer. Note the memcpy that copies | ||
367 | * |old_len| bytes to the new buffer, below. */ | ||
368 | if (num < old_len) return NULL; | ||
369 | |||
364 | if (realloc_debug_func != NULL) | 370 | if (realloc_debug_func != NULL) |
365 | realloc_debug_func(str, NULL, num, file, line, 0); | 371 | realloc_debug_func(str, NULL, num, file, line, 0); |
366 | ret=malloc_ex_func(num,file,line); | 372 | ret=malloc_ex_func(num,file,line); |
diff --git a/src/lib/libcrypto/objects/obj_dat.h b/src/lib/libcrypto/objects/obj_dat.h index 6449be6071..d404ad07c9 100644 --- a/src/lib/libcrypto/objects/obj_dat.h +++ b/src/lib/libcrypto/objects/obj_dat.h | |||
@@ -62,12 +62,12 @@ | |||
62 | * [including the GNU Public Licence.] | 62 | * [including the GNU Public Licence.] |
63 | */ | 63 | */ |
64 | 64 | ||
65 | #define NUM_NID 893 | 65 | #define NUM_NID 920 |
66 | #define NUM_SN 886 | 66 | #define NUM_SN 913 |
67 | #define NUM_LN 886 | 67 | #define NUM_LN 913 |
68 | #define NUM_OBJ 840 | 68 | #define NUM_OBJ 857 |
69 | 69 | ||
70 | static const unsigned char lvalues[5824]={ | 70 | static const unsigned char lvalues[5980]={ |
71 | 0x00, /* [ 0] OBJ_undef */ | 71 | 0x00, /* [ 0] OBJ_undef */ |
72 | 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */ | 72 | 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */ |
73 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */ | 73 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */ |
@@ -908,6 +908,23 @@ static const unsigned char lvalues[5824]={ | |||
908 | 0x55,0x04,0x34, /* [5814] OBJ_supportedAlgorithms */ | 908 | 0x55,0x04,0x34, /* [5814] OBJ_supportedAlgorithms */ |
909 | 0x55,0x04,0x35, /* [5817] OBJ_deltaRevocationList */ | 909 | 0x55,0x04,0x35, /* [5817] OBJ_deltaRevocationList */ |
910 | 0x55,0x04,0x36, /* [5820] OBJ_dmdName */ | 910 | 0x55,0x04,0x36, /* [5820] OBJ_dmdName */ |
911 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x09,/* [5823] OBJ_id_alg_PWRI_KEK */ | ||
912 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x06,/* [5834] OBJ_aes_128_gcm */ | ||
913 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x07,/* [5843] OBJ_aes_128_ccm */ | ||
914 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x08,/* [5852] OBJ_id_aes128_wrap_pad */ | ||
915 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1A,/* [5861] OBJ_aes_192_gcm */ | ||
916 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1B,/* [5870] OBJ_aes_192_ccm */ | ||
917 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1C,/* [5879] OBJ_id_aes192_wrap_pad */ | ||
918 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2E,/* [5888] OBJ_aes_256_gcm */ | ||
919 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2F,/* [5897] OBJ_aes_256_ccm */ | ||
920 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x30,/* [5906] OBJ_id_aes256_wrap_pad */ | ||
921 | 0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x02,/* [5915] OBJ_id_camellia128_wrap */ | ||
922 | 0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x03,/* [5926] OBJ_id_camellia192_wrap */ | ||
923 | 0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x04,/* [5937] OBJ_id_camellia256_wrap */ | ||
924 | 0x55,0x1D,0x25,0x00, /* [5948] OBJ_anyExtendedKeyUsage */ | ||
925 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,/* [5952] OBJ_mgf1 */ | ||
926 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,/* [5961] OBJ_rsassaPss */ | ||
927 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,/* [5970] OBJ_rsaesOaep */ | ||
911 | }; | 928 | }; |
912 | 929 | ||
913 | static const ASN1_OBJECT nid_objs[NUM_NID]={ | 930 | static const ASN1_OBJECT nid_objs[NUM_NID]={ |
@@ -2351,28 +2368,74 @@ static const ASN1_OBJECT nid_objs[NUM_NID]={ | |||
2351 | {"deltaRevocationList","deltaRevocationList",NID_deltaRevocationList, | 2368 | {"deltaRevocationList","deltaRevocationList",NID_deltaRevocationList, |
2352 | 3,&(lvalues[5817]),0}, | 2369 | 3,&(lvalues[5817]),0}, |
2353 | {"dmdName","dmdName",NID_dmdName,3,&(lvalues[5820]),0}, | 2370 | {"dmdName","dmdName",NID_dmdName,3,&(lvalues[5820]),0}, |
2371 | {"id-alg-PWRI-KEK","id-alg-PWRI-KEK",NID_id_alg_PWRI_KEK,11, | ||
2372 | &(lvalues[5823]),0}, | ||
2373 | {"CMAC","cmac",NID_cmac,0,NULL,0}, | ||
2374 | {"id-aes128-GCM","aes-128-gcm",NID_aes_128_gcm,9,&(lvalues[5834]),0}, | ||
2375 | {"id-aes128-CCM","aes-128-ccm",NID_aes_128_ccm,9,&(lvalues[5843]),0}, | ||
2376 | {"id-aes128-wrap-pad","id-aes128-wrap-pad",NID_id_aes128_wrap_pad,9, | ||
2377 | &(lvalues[5852]),0}, | ||
2378 | {"id-aes192-GCM","aes-192-gcm",NID_aes_192_gcm,9,&(lvalues[5861]),0}, | ||
2379 | {"id-aes192-CCM","aes-192-ccm",NID_aes_192_ccm,9,&(lvalues[5870]),0}, | ||
2380 | {"id-aes192-wrap-pad","id-aes192-wrap-pad",NID_id_aes192_wrap_pad,9, | ||
2381 | &(lvalues[5879]),0}, | ||
2382 | {"id-aes256-GCM","aes-256-gcm",NID_aes_256_gcm,9,&(lvalues[5888]),0}, | ||
2383 | {"id-aes256-CCM","aes-256-ccm",NID_aes_256_ccm,9,&(lvalues[5897]),0}, | ||
2384 | {"id-aes256-wrap-pad","id-aes256-wrap-pad",NID_id_aes256_wrap_pad,9, | ||
2385 | &(lvalues[5906]),0}, | ||
2386 | {"AES-128-CTR","aes-128-ctr",NID_aes_128_ctr,0,NULL,0}, | ||
2387 | {"AES-192-CTR","aes-192-ctr",NID_aes_192_ctr,0,NULL,0}, | ||
2388 | {"AES-256-CTR","aes-256-ctr",NID_aes_256_ctr,0,NULL,0}, | ||
2389 | {"id-camellia128-wrap","id-camellia128-wrap",NID_id_camellia128_wrap, | ||
2390 | 11,&(lvalues[5915]),0}, | ||
2391 | {"id-camellia192-wrap","id-camellia192-wrap",NID_id_camellia192_wrap, | ||
2392 | 11,&(lvalues[5926]),0}, | ||
2393 | {"id-camellia256-wrap","id-camellia256-wrap",NID_id_camellia256_wrap, | ||
2394 | 11,&(lvalues[5937]),0}, | ||
2395 | {"anyExtendedKeyUsage","Any Extended Key Usage", | ||
2396 | NID_anyExtendedKeyUsage,4,&(lvalues[5948]),0}, | ||
2397 | {"MGF1","mgf1",NID_mgf1,9,&(lvalues[5952]),0}, | ||
2398 | {"RSASSA-PSS","rsassaPss",NID_rsassaPss,9,&(lvalues[5961]),0}, | ||
2399 | {"AES-128-XTS","aes-128-xts",NID_aes_128_xts,0,NULL,0}, | ||
2400 | {"AES-256-XTS","aes-256-xts",NID_aes_256_xts,0,NULL,0}, | ||
2401 | {"RC4-HMAC-MD5","rc4-hmac-md5",NID_rc4_hmac_md5,0,NULL,0}, | ||
2402 | {"AES-128-CBC-HMAC-SHA1","aes-128-cbc-hmac-sha1", | ||
2403 | NID_aes_128_cbc_hmac_sha1,0,NULL,0}, | ||
2404 | {"AES-192-CBC-HMAC-SHA1","aes-192-cbc-hmac-sha1", | ||
2405 | NID_aes_192_cbc_hmac_sha1,0,NULL,0}, | ||
2406 | {"AES-256-CBC-HMAC-SHA1","aes-256-cbc-hmac-sha1", | ||
2407 | NID_aes_256_cbc_hmac_sha1,0,NULL,0}, | ||
2408 | {"RSAES-OAEP","rsaesOaep",NID_rsaesOaep,9,&(lvalues[5970]),0}, | ||
2354 | }; | 2409 | }; |
2355 | 2410 | ||
2356 | static const unsigned int sn_objs[NUM_SN]={ | 2411 | static const unsigned int sn_objs[NUM_SN]={ |
2357 | 364, /* "AD_DVCS" */ | 2412 | 364, /* "AD_DVCS" */ |
2358 | 419, /* "AES-128-CBC" */ | 2413 | 419, /* "AES-128-CBC" */ |
2414 | 916, /* "AES-128-CBC-HMAC-SHA1" */ | ||
2359 | 421, /* "AES-128-CFB" */ | 2415 | 421, /* "AES-128-CFB" */ |
2360 | 650, /* "AES-128-CFB1" */ | 2416 | 650, /* "AES-128-CFB1" */ |
2361 | 653, /* "AES-128-CFB8" */ | 2417 | 653, /* "AES-128-CFB8" */ |
2418 | 904, /* "AES-128-CTR" */ | ||
2362 | 418, /* "AES-128-ECB" */ | 2419 | 418, /* "AES-128-ECB" */ |
2363 | 420, /* "AES-128-OFB" */ | 2420 | 420, /* "AES-128-OFB" */ |
2421 | 913, /* "AES-128-XTS" */ | ||
2364 | 423, /* "AES-192-CBC" */ | 2422 | 423, /* "AES-192-CBC" */ |
2423 | 917, /* "AES-192-CBC-HMAC-SHA1" */ | ||
2365 | 425, /* "AES-192-CFB" */ | 2424 | 425, /* "AES-192-CFB" */ |
2366 | 651, /* "AES-192-CFB1" */ | 2425 | 651, /* "AES-192-CFB1" */ |
2367 | 654, /* "AES-192-CFB8" */ | 2426 | 654, /* "AES-192-CFB8" */ |
2427 | 905, /* "AES-192-CTR" */ | ||
2368 | 422, /* "AES-192-ECB" */ | 2428 | 422, /* "AES-192-ECB" */ |
2369 | 424, /* "AES-192-OFB" */ | 2429 | 424, /* "AES-192-OFB" */ |
2370 | 427, /* "AES-256-CBC" */ | 2430 | 427, /* "AES-256-CBC" */ |
2431 | 918, /* "AES-256-CBC-HMAC-SHA1" */ | ||
2371 | 429, /* "AES-256-CFB" */ | 2432 | 429, /* "AES-256-CFB" */ |
2372 | 652, /* "AES-256-CFB1" */ | 2433 | 652, /* "AES-256-CFB1" */ |
2373 | 655, /* "AES-256-CFB8" */ | 2434 | 655, /* "AES-256-CFB8" */ |
2435 | 906, /* "AES-256-CTR" */ | ||
2374 | 426, /* "AES-256-ECB" */ | 2436 | 426, /* "AES-256-ECB" */ |
2375 | 428, /* "AES-256-OFB" */ | 2437 | 428, /* "AES-256-OFB" */ |
2438 | 914, /* "AES-256-XTS" */ | ||
2376 | 91, /* "BF-CBC" */ | 2439 | 91, /* "BF-CBC" */ |
2377 | 93, /* "BF-CFB" */ | 2440 | 93, /* "BF-CFB" */ |
2378 | 92, /* "BF-ECB" */ | 2441 | 92, /* "BF-ECB" */ |
@@ -2400,6 +2463,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2400 | 110, /* "CAST5-CFB" */ | 2463 | 110, /* "CAST5-CFB" */ |
2401 | 109, /* "CAST5-ECB" */ | 2464 | 109, /* "CAST5-ECB" */ |
2402 | 111, /* "CAST5-OFB" */ | 2465 | 111, /* "CAST5-OFB" */ |
2466 | 894, /* "CMAC" */ | ||
2403 | 13, /* "CN" */ | 2467 | 13, /* "CN" */ |
2404 | 141, /* "CRLReason" */ | 2468 | 141, /* "CRLReason" */ |
2405 | 417, /* "CSPName" */ | 2469 | 417, /* "CSPName" */ |
@@ -2451,6 +2515,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2451 | 4, /* "MD5" */ | 2515 | 4, /* "MD5" */ |
2452 | 114, /* "MD5-SHA1" */ | 2516 | 114, /* "MD5-SHA1" */ |
2453 | 95, /* "MDC2" */ | 2517 | 95, /* "MDC2" */ |
2518 | 911, /* "MGF1" */ | ||
2454 | 388, /* "Mail" */ | 2519 | 388, /* "Mail" */ |
2455 | 393, /* "NULL" */ | 2520 | 393, /* "NULL" */ |
2456 | 404, /* "NULL" */ | 2521 | 404, /* "NULL" */ |
@@ -2487,6 +2552,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2487 | 40, /* "RC2-OFB" */ | 2552 | 40, /* "RC2-OFB" */ |
2488 | 5, /* "RC4" */ | 2553 | 5, /* "RC4" */ |
2489 | 97, /* "RC4-40" */ | 2554 | 97, /* "RC4-40" */ |
2555 | 915, /* "RC4-HMAC-MD5" */ | ||
2490 | 120, /* "RC5-CBC" */ | 2556 | 120, /* "RC5-CBC" */ |
2491 | 122, /* "RC5-CFB" */ | 2557 | 122, /* "RC5-CFB" */ |
2492 | 121, /* "RC5-ECB" */ | 2558 | 121, /* "RC5-ECB" */ |
@@ -2507,6 +2573,8 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2507 | 668, /* "RSA-SHA256" */ | 2573 | 668, /* "RSA-SHA256" */ |
2508 | 669, /* "RSA-SHA384" */ | 2574 | 669, /* "RSA-SHA384" */ |
2509 | 670, /* "RSA-SHA512" */ | 2575 | 670, /* "RSA-SHA512" */ |
2576 | 919, /* "RSAES-OAEP" */ | ||
2577 | 912, /* "RSASSA-PSS" */ | ||
2510 | 777, /* "SEED-CBC" */ | 2578 | 777, /* "SEED-CBC" */ |
2511 | 779, /* "SEED-CFB" */ | 2579 | 779, /* "SEED-CFB" */ |
2512 | 776, /* "SEED-ECB" */ | 2580 | 776, /* "SEED-ECB" */ |
@@ -2540,6 +2608,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2540 | 363, /* "ad_timestamping" */ | 2608 | 363, /* "ad_timestamping" */ |
2541 | 376, /* "algorithm" */ | 2609 | 376, /* "algorithm" */ |
2542 | 405, /* "ansi-X9-62" */ | 2610 | 405, /* "ansi-X9-62" */ |
2611 | 910, /* "anyExtendedKeyUsage" */ | ||
2543 | 746, /* "anyPolicy" */ | 2612 | 746, /* "anyPolicy" */ |
2544 | 370, /* "archiveCutoff" */ | 2613 | 370, /* "archiveCutoff" */ |
2545 | 484, /* "associatedDomain" */ | 2614 | 484, /* "associatedDomain" */ |
@@ -2716,14 +2785,27 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2716 | 357, /* "id-aca-group" */ | 2785 | 357, /* "id-aca-group" */ |
2717 | 358, /* "id-aca-role" */ | 2786 | 358, /* "id-aca-role" */ |
2718 | 176, /* "id-ad" */ | 2787 | 176, /* "id-ad" */ |
2788 | 896, /* "id-aes128-CCM" */ | ||
2789 | 895, /* "id-aes128-GCM" */ | ||
2719 | 788, /* "id-aes128-wrap" */ | 2790 | 788, /* "id-aes128-wrap" */ |
2791 | 897, /* "id-aes128-wrap-pad" */ | ||
2792 | 899, /* "id-aes192-CCM" */ | ||
2793 | 898, /* "id-aes192-GCM" */ | ||
2720 | 789, /* "id-aes192-wrap" */ | 2794 | 789, /* "id-aes192-wrap" */ |
2795 | 900, /* "id-aes192-wrap-pad" */ | ||
2796 | 902, /* "id-aes256-CCM" */ | ||
2797 | 901, /* "id-aes256-GCM" */ | ||
2721 | 790, /* "id-aes256-wrap" */ | 2798 | 790, /* "id-aes256-wrap" */ |
2799 | 903, /* "id-aes256-wrap-pad" */ | ||
2722 | 262, /* "id-alg" */ | 2800 | 262, /* "id-alg" */ |
2801 | 893, /* "id-alg-PWRI-KEK" */ | ||
2723 | 323, /* "id-alg-des40" */ | 2802 | 323, /* "id-alg-des40" */ |
2724 | 326, /* "id-alg-dh-pop" */ | 2803 | 326, /* "id-alg-dh-pop" */ |
2725 | 325, /* "id-alg-dh-sig-hmac-sha1" */ | 2804 | 325, /* "id-alg-dh-sig-hmac-sha1" */ |
2726 | 324, /* "id-alg-noSignature" */ | 2805 | 324, /* "id-alg-noSignature" */ |
2806 | 907, /* "id-camellia128-wrap" */ | ||
2807 | 908, /* "id-camellia192-wrap" */ | ||
2808 | 909, /* "id-camellia256-wrap" */ | ||
2727 | 268, /* "id-cct" */ | 2809 | 268, /* "id-cct" */ |
2728 | 361, /* "id-cct-PKIData" */ | 2810 | 361, /* "id-cct-PKIData" */ |
2729 | 362, /* "id-cct-PKIResponse" */ | 2811 | 362, /* "id-cct-PKIResponse" */ |
@@ -3246,6 +3328,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3246 | 363, /* "AD Time Stamping" */ | 3328 | 363, /* "AD Time Stamping" */ |
3247 | 405, /* "ANSI X9.62" */ | 3329 | 405, /* "ANSI X9.62" */ |
3248 | 368, /* "Acceptable OCSP Responses" */ | 3330 | 368, /* "Acceptable OCSP Responses" */ |
3331 | 910, /* "Any Extended Key Usage" */ | ||
3249 | 664, /* "Any language" */ | 3332 | 664, /* "Any language" */ |
3250 | 177, /* "Authority Information Access" */ | 3333 | 177, /* "Authority Information Access" */ |
3251 | 365, /* "Basic OCSP Response" */ | 3334 | 365, /* "Basic OCSP Response" */ |
@@ -3386,23 +3469,37 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3386 | 364, /* "ad dvcs" */ | 3469 | 364, /* "ad dvcs" */ |
3387 | 606, /* "additional verification" */ | 3470 | 606, /* "additional verification" */ |
3388 | 419, /* "aes-128-cbc" */ | 3471 | 419, /* "aes-128-cbc" */ |
3472 | 916, /* "aes-128-cbc-hmac-sha1" */ | ||
3473 | 896, /* "aes-128-ccm" */ | ||
3389 | 421, /* "aes-128-cfb" */ | 3474 | 421, /* "aes-128-cfb" */ |
3390 | 650, /* "aes-128-cfb1" */ | 3475 | 650, /* "aes-128-cfb1" */ |
3391 | 653, /* "aes-128-cfb8" */ | 3476 | 653, /* "aes-128-cfb8" */ |
3477 | 904, /* "aes-128-ctr" */ | ||
3392 | 418, /* "aes-128-ecb" */ | 3478 | 418, /* "aes-128-ecb" */ |
3479 | 895, /* "aes-128-gcm" */ | ||
3393 | 420, /* "aes-128-ofb" */ | 3480 | 420, /* "aes-128-ofb" */ |
3481 | 913, /* "aes-128-xts" */ | ||
3394 | 423, /* "aes-192-cbc" */ | 3482 | 423, /* "aes-192-cbc" */ |
3483 | 917, /* "aes-192-cbc-hmac-sha1" */ | ||
3484 | 899, /* "aes-192-ccm" */ | ||
3395 | 425, /* "aes-192-cfb" */ | 3485 | 425, /* "aes-192-cfb" */ |
3396 | 651, /* "aes-192-cfb1" */ | 3486 | 651, /* "aes-192-cfb1" */ |
3397 | 654, /* "aes-192-cfb8" */ | 3487 | 654, /* "aes-192-cfb8" */ |
3488 | 905, /* "aes-192-ctr" */ | ||
3398 | 422, /* "aes-192-ecb" */ | 3489 | 422, /* "aes-192-ecb" */ |
3490 | 898, /* "aes-192-gcm" */ | ||
3399 | 424, /* "aes-192-ofb" */ | 3491 | 424, /* "aes-192-ofb" */ |
3400 | 427, /* "aes-256-cbc" */ | 3492 | 427, /* "aes-256-cbc" */ |
3493 | 918, /* "aes-256-cbc-hmac-sha1" */ | ||
3494 | 902, /* "aes-256-ccm" */ | ||
3401 | 429, /* "aes-256-cfb" */ | 3495 | 429, /* "aes-256-cfb" */ |
3402 | 652, /* "aes-256-cfb1" */ | 3496 | 652, /* "aes-256-cfb1" */ |
3403 | 655, /* "aes-256-cfb8" */ | 3497 | 655, /* "aes-256-cfb8" */ |
3498 | 906, /* "aes-256-ctr" */ | ||
3404 | 426, /* "aes-256-ecb" */ | 3499 | 426, /* "aes-256-ecb" */ |
3500 | 901, /* "aes-256-gcm" */ | ||
3405 | 428, /* "aes-256-ofb" */ | 3501 | 428, /* "aes-256-ofb" */ |
3502 | 914, /* "aes-256-xts" */ | ||
3406 | 376, /* "algorithm" */ | 3503 | 376, /* "algorithm" */ |
3407 | 484, /* "associatedDomain" */ | 3504 | 484, /* "associatedDomain" */ |
3408 | 485, /* "associatedName" */ | 3505 | 485, /* "associatedName" */ |
@@ -3467,6 +3564,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3467 | 407, /* "characteristic-two-field" */ | 3564 | 407, /* "characteristic-two-field" */ |
3468 | 395, /* "clearance" */ | 3565 | 395, /* "clearance" */ |
3469 | 633, /* "cleartext track 2" */ | 3566 | 633, /* "cleartext track 2" */ |
3567 | 894, /* "cmac" */ | ||
3470 | 13, /* "commonName" */ | 3568 | 13, /* "commonName" */ |
3471 | 513, /* "content types" */ | 3569 | 513, /* "content types" */ |
3472 | 50, /* "contentType" */ | 3570 | 50, /* "contentType" */ |
@@ -3602,13 +3700,20 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3602 | 358, /* "id-aca-role" */ | 3700 | 358, /* "id-aca-role" */ |
3603 | 176, /* "id-ad" */ | 3701 | 176, /* "id-ad" */ |
3604 | 788, /* "id-aes128-wrap" */ | 3702 | 788, /* "id-aes128-wrap" */ |
3703 | 897, /* "id-aes128-wrap-pad" */ | ||
3605 | 789, /* "id-aes192-wrap" */ | 3704 | 789, /* "id-aes192-wrap" */ |
3705 | 900, /* "id-aes192-wrap-pad" */ | ||
3606 | 790, /* "id-aes256-wrap" */ | 3706 | 790, /* "id-aes256-wrap" */ |
3707 | 903, /* "id-aes256-wrap-pad" */ | ||
3607 | 262, /* "id-alg" */ | 3708 | 262, /* "id-alg" */ |
3709 | 893, /* "id-alg-PWRI-KEK" */ | ||
3608 | 323, /* "id-alg-des40" */ | 3710 | 323, /* "id-alg-des40" */ |
3609 | 326, /* "id-alg-dh-pop" */ | 3711 | 326, /* "id-alg-dh-pop" */ |
3610 | 325, /* "id-alg-dh-sig-hmac-sha1" */ | 3712 | 325, /* "id-alg-dh-sig-hmac-sha1" */ |
3611 | 324, /* "id-alg-noSignature" */ | 3713 | 324, /* "id-alg-noSignature" */ |
3714 | 907, /* "id-camellia128-wrap" */ | ||
3715 | 908, /* "id-camellia192-wrap" */ | ||
3716 | 909, /* "id-camellia256-wrap" */ | ||
3612 | 268, /* "id-cct" */ | 3717 | 268, /* "id-cct" */ |
3613 | 361, /* "id-cct-PKIData" */ | 3718 | 361, /* "id-cct-PKIData" */ |
3614 | 362, /* "id-cct-PKIResponse" */ | 3719 | 362, /* "id-cct-PKIResponse" */ |
@@ -3806,6 +3911,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3806 | 602, /* "merchant initiated auth" */ | 3911 | 602, /* "merchant initiated auth" */ |
3807 | 514, /* "message extensions" */ | 3912 | 514, /* "message extensions" */ |
3808 | 51, /* "messageDigest" */ | 3913 | 51, /* "messageDigest" */ |
3914 | 911, /* "mgf1" */ | ||
3809 | 506, /* "mime-mhs-bodies" */ | 3915 | 506, /* "mime-mhs-bodies" */ |
3810 | 505, /* "mime-mhs-headings" */ | 3916 | 505, /* "mime-mhs-headings" */ |
3811 | 488, /* "mobileTelephoneNumber" */ | 3917 | 488, /* "mobileTelephoneNumber" */ |
@@ -3889,6 +3995,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3889 | 40, /* "rc2-ofb" */ | 3995 | 40, /* "rc2-ofb" */ |
3890 | 5, /* "rc4" */ | 3996 | 5, /* "rc4" */ |
3891 | 97, /* "rc4-40" */ | 3997 | 97, /* "rc4-40" */ |
3998 | 915, /* "rc4-hmac-md5" */ | ||
3892 | 120, /* "rc5-cbc" */ | 3999 | 120, /* "rc5-cbc" */ |
3893 | 122, /* "rc5-cfb" */ | 4000 | 122, /* "rc5-cfb" */ |
3894 | 121, /* "rc5-ecb" */ | 4001 | 121, /* "rc5-ecb" */ |
@@ -3905,6 +4012,8 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3905 | 6, /* "rsaEncryption" */ | 4012 | 6, /* "rsaEncryption" */ |
3906 | 644, /* "rsaOAEPEncryptionSET" */ | 4013 | 644, /* "rsaOAEPEncryptionSET" */ |
3907 | 377, /* "rsaSignature" */ | 4014 | 377, /* "rsaSignature" */ |
4015 | 919, /* "rsaesOaep" */ | ||
4016 | 912, /* "rsassaPss" */ | ||
3908 | 124, /* "run length compression" */ | 4017 | 124, /* "run length compression" */ |
3909 | 482, /* "sOARecord" */ | 4018 | 482, /* "sOARecord" */ |
3910 | 155, /* "safeContentsBag" */ | 4019 | 155, /* "safeContentsBag" */ |
@@ -4254,6 +4363,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4254 | 96, /* OBJ_mdc2WithRSA 2 5 8 3 100 */ | 4363 | 96, /* OBJ_mdc2WithRSA 2 5 8 3 100 */ |
4255 | 95, /* OBJ_mdc2 2 5 8 3 101 */ | 4364 | 95, /* OBJ_mdc2 2 5 8 3 101 */ |
4256 | 746, /* OBJ_any_policy 2 5 29 32 0 */ | 4365 | 746, /* OBJ_any_policy 2 5 29 32 0 */ |
4366 | 910, /* OBJ_anyExtendedKeyUsage 2 5 29 37 0 */ | ||
4257 | 519, /* OBJ_setct_PANData 2 23 42 0 0 */ | 4367 | 519, /* OBJ_setct_PANData 2 23 42 0 0 */ |
4258 | 520, /* OBJ_setct_PANToken 2 23 42 0 1 */ | 4368 | 520, /* OBJ_setct_PANToken 2 23 42 0 1 */ |
4259 | 521, /* OBJ_setct_PANOnly 2 23 42 0 2 */ | 4369 | 521, /* OBJ_setct_PANOnly 2 23 42 0 2 */ |
@@ -4720,6 +4830,9 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4720 | 8, /* OBJ_md5WithRSAEncryption 1 2 840 113549 1 1 4 */ | 4830 | 8, /* OBJ_md5WithRSAEncryption 1 2 840 113549 1 1 4 */ |
4721 | 65, /* OBJ_sha1WithRSAEncryption 1 2 840 113549 1 1 5 */ | 4831 | 65, /* OBJ_sha1WithRSAEncryption 1 2 840 113549 1 1 5 */ |
4722 | 644, /* OBJ_rsaOAEPEncryptionSET 1 2 840 113549 1 1 6 */ | 4832 | 644, /* OBJ_rsaOAEPEncryptionSET 1 2 840 113549 1 1 6 */ |
4833 | 919, /* OBJ_rsaesOaep 1 2 840 113549 1 1 7 */ | ||
4834 | 911, /* OBJ_mgf1 1 2 840 113549 1 1 8 */ | ||
4835 | 912, /* OBJ_rsassaPss 1 2 840 113549 1 1 10 */ | ||
4723 | 668, /* OBJ_sha256WithRSAEncryption 1 2 840 113549 1 1 11 */ | 4836 | 668, /* OBJ_sha256WithRSAEncryption 1 2 840 113549 1 1 11 */ |
4724 | 669, /* OBJ_sha384WithRSAEncryption 1 2 840 113549 1 1 12 */ | 4837 | 669, /* OBJ_sha384WithRSAEncryption 1 2 840 113549 1 1 12 */ |
4725 | 670, /* OBJ_sha512WithRSAEncryption 1 2 840 113549 1 1 13 */ | 4838 | 670, /* OBJ_sha512WithRSAEncryption 1 2 840 113549 1 1 13 */ |
@@ -4785,16 +4898,25 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4785 | 420, /* OBJ_aes_128_ofb128 2 16 840 1 101 3 4 1 3 */ | 4898 | 420, /* OBJ_aes_128_ofb128 2 16 840 1 101 3 4 1 3 */ |
4786 | 421, /* OBJ_aes_128_cfb128 2 16 840 1 101 3 4 1 4 */ | 4899 | 421, /* OBJ_aes_128_cfb128 2 16 840 1 101 3 4 1 4 */ |
4787 | 788, /* OBJ_id_aes128_wrap 2 16 840 1 101 3 4 1 5 */ | 4900 | 788, /* OBJ_id_aes128_wrap 2 16 840 1 101 3 4 1 5 */ |
4901 | 895, /* OBJ_aes_128_gcm 2 16 840 1 101 3 4 1 6 */ | ||
4902 | 896, /* OBJ_aes_128_ccm 2 16 840 1 101 3 4 1 7 */ | ||
4903 | 897, /* OBJ_id_aes128_wrap_pad 2 16 840 1 101 3 4 1 8 */ | ||
4788 | 422, /* OBJ_aes_192_ecb 2 16 840 1 101 3 4 1 21 */ | 4904 | 422, /* OBJ_aes_192_ecb 2 16 840 1 101 3 4 1 21 */ |
4789 | 423, /* OBJ_aes_192_cbc 2 16 840 1 101 3 4 1 22 */ | 4905 | 423, /* OBJ_aes_192_cbc 2 16 840 1 101 3 4 1 22 */ |
4790 | 424, /* OBJ_aes_192_ofb128 2 16 840 1 101 3 4 1 23 */ | 4906 | 424, /* OBJ_aes_192_ofb128 2 16 840 1 101 3 4 1 23 */ |
4791 | 425, /* OBJ_aes_192_cfb128 2 16 840 1 101 3 4 1 24 */ | 4907 | 425, /* OBJ_aes_192_cfb128 2 16 840 1 101 3 4 1 24 */ |
4792 | 789, /* OBJ_id_aes192_wrap 2 16 840 1 101 3 4 1 25 */ | 4908 | 789, /* OBJ_id_aes192_wrap 2 16 840 1 101 3 4 1 25 */ |
4909 | 898, /* OBJ_aes_192_gcm 2 16 840 1 101 3 4 1 26 */ | ||
4910 | 899, /* OBJ_aes_192_ccm 2 16 840 1 101 3 4 1 27 */ | ||
4911 | 900, /* OBJ_id_aes192_wrap_pad 2 16 840 1 101 3 4 1 28 */ | ||
4793 | 426, /* OBJ_aes_256_ecb 2 16 840 1 101 3 4 1 41 */ | 4912 | 426, /* OBJ_aes_256_ecb 2 16 840 1 101 3 4 1 41 */ |
4794 | 427, /* OBJ_aes_256_cbc 2 16 840 1 101 3 4 1 42 */ | 4913 | 427, /* OBJ_aes_256_cbc 2 16 840 1 101 3 4 1 42 */ |
4795 | 428, /* OBJ_aes_256_ofb128 2 16 840 1 101 3 4 1 43 */ | 4914 | 428, /* OBJ_aes_256_ofb128 2 16 840 1 101 3 4 1 43 */ |
4796 | 429, /* OBJ_aes_256_cfb128 2 16 840 1 101 3 4 1 44 */ | 4915 | 429, /* OBJ_aes_256_cfb128 2 16 840 1 101 3 4 1 44 */ |
4797 | 790, /* OBJ_id_aes256_wrap 2 16 840 1 101 3 4 1 45 */ | 4916 | 790, /* OBJ_id_aes256_wrap 2 16 840 1 101 3 4 1 45 */ |
4917 | 901, /* OBJ_aes_256_gcm 2 16 840 1 101 3 4 1 46 */ | ||
4918 | 902, /* OBJ_aes_256_ccm 2 16 840 1 101 3 4 1 47 */ | ||
4919 | 903, /* OBJ_id_aes256_wrap_pad 2 16 840 1 101 3 4 1 48 */ | ||
4798 | 672, /* OBJ_sha256 2 16 840 1 101 3 4 2 1 */ | 4920 | 672, /* OBJ_sha256 2 16 840 1 101 3 4 2 1 */ |
4799 | 673, /* OBJ_sha384 2 16 840 1 101 3 4 2 2 */ | 4921 | 673, /* OBJ_sha384 2 16 840 1 101 3 4 2 2 */ |
4800 | 674, /* OBJ_sha512 2 16 840 1 101 3 4 2 3 */ | 4922 | 674, /* OBJ_sha512 2 16 840 1 101 3 4 2 3 */ |
@@ -4901,6 +5023,9 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4901 | 751, /* OBJ_camellia_128_cbc 1 2 392 200011 61 1 1 1 2 */ | 5023 | 751, /* OBJ_camellia_128_cbc 1 2 392 200011 61 1 1 1 2 */ |
4902 | 752, /* OBJ_camellia_192_cbc 1 2 392 200011 61 1 1 1 3 */ | 5024 | 752, /* OBJ_camellia_192_cbc 1 2 392 200011 61 1 1 1 3 */ |
4903 | 753, /* OBJ_camellia_256_cbc 1 2 392 200011 61 1 1 1 4 */ | 5025 | 753, /* OBJ_camellia_256_cbc 1 2 392 200011 61 1 1 1 4 */ |
5026 | 907, /* OBJ_id_camellia128_wrap 1 2 392 200011 61 1 1 3 2 */ | ||
5027 | 908, /* OBJ_id_camellia192_wrap 1 2 392 200011 61 1 1 3 3 */ | ||
5028 | 909, /* OBJ_id_camellia256_wrap 1 2 392 200011 61 1 1 3 4 */ | ||
4904 | 196, /* OBJ_id_smime_mod_cms 1 2 840 113549 1 9 16 0 1 */ | 5029 | 196, /* OBJ_id_smime_mod_cms 1 2 840 113549 1 9 16 0 1 */ |
4905 | 197, /* OBJ_id_smime_mod_ess 1 2 840 113549 1 9 16 0 2 */ | 5030 | 197, /* OBJ_id_smime_mod_ess 1 2 840 113549 1 9 16 0 2 */ |
4906 | 198, /* OBJ_id_smime_mod_oid 1 2 840 113549 1 9 16 0 3 */ | 5031 | 198, /* OBJ_id_smime_mod_oid 1 2 840 113549 1 9 16 0 3 */ |
@@ -4956,6 +5081,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4956 | 246, /* OBJ_id_smime_alg_CMS3DESwrap 1 2 840 113549 1 9 16 3 6 */ | 5081 | 246, /* OBJ_id_smime_alg_CMS3DESwrap 1 2 840 113549 1 9 16 3 6 */ |
4957 | 247, /* OBJ_id_smime_alg_CMSRC2wrap 1 2 840 113549 1 9 16 3 7 */ | 5082 | 247, /* OBJ_id_smime_alg_CMSRC2wrap 1 2 840 113549 1 9 16 3 7 */ |
4958 | 125, /* OBJ_zlib_compression 1 2 840 113549 1 9 16 3 8 */ | 5083 | 125, /* OBJ_zlib_compression 1 2 840 113549 1 9 16 3 8 */ |
5084 | 893, /* OBJ_id_alg_PWRI_KEK 1 2 840 113549 1 9 16 3 9 */ | ||
4959 | 248, /* OBJ_id_smime_cd_ldap 1 2 840 113549 1 9 16 4 1 */ | 5085 | 248, /* OBJ_id_smime_cd_ldap 1 2 840 113549 1 9 16 4 1 */ |
4960 | 249, /* OBJ_id_smime_spq_ets_sqt_uri 1 2 840 113549 1 9 16 5 1 */ | 5086 | 249, /* OBJ_id_smime_spq_ets_sqt_uri 1 2 840 113549 1 9 16 5 1 */ |
4961 | 250, /* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */ | 5087 | 250, /* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */ |
diff --git a/src/lib/libcrypto/objects/obj_mac.h b/src/lib/libcrypto/objects/obj_mac.h index 282f11a8a8..b5ea7cdab4 100644 --- a/src/lib/libcrypto/objects/obj_mac.h +++ b/src/lib/libcrypto/objects/obj_mac.h | |||
@@ -580,6 +580,21 @@ | |||
580 | #define NID_sha1WithRSAEncryption 65 | 580 | #define NID_sha1WithRSAEncryption 65 |
581 | #define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L | 581 | #define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L |
582 | 582 | ||
583 | #define SN_rsaesOaep "RSAES-OAEP" | ||
584 | #define LN_rsaesOaep "rsaesOaep" | ||
585 | #define NID_rsaesOaep 919 | ||
586 | #define OBJ_rsaesOaep OBJ_pkcs1,7L | ||
587 | |||
588 | #define SN_mgf1 "MGF1" | ||
589 | #define LN_mgf1 "mgf1" | ||
590 | #define NID_mgf1 911 | ||
591 | #define OBJ_mgf1 OBJ_pkcs1,8L | ||
592 | |||
593 | #define SN_rsassaPss "RSASSA-PSS" | ||
594 | #define LN_rsassaPss "rsassaPss" | ||
595 | #define NID_rsassaPss 912 | ||
596 | #define OBJ_rsassaPss OBJ_pkcs1,10L | ||
597 | |||
583 | #define SN_sha256WithRSAEncryption "RSA-SHA256" | 598 | #define SN_sha256WithRSAEncryption "RSA-SHA256" |
584 | #define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" | 599 | #define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" |
585 | #define NID_sha256WithRSAEncryption 668 | 600 | #define NID_sha256WithRSAEncryption 668 |
@@ -981,6 +996,10 @@ | |||
981 | #define NID_id_smime_alg_CMSRC2wrap 247 | 996 | #define NID_id_smime_alg_CMSRC2wrap 247 |
982 | #define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L | 997 | #define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L |
983 | 998 | ||
999 | #define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK" | ||
1000 | #define NID_id_alg_PWRI_KEK 893 | ||
1001 | #define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L | ||
1002 | |||
984 | #define SN_id_smime_cd_ldap "id-smime-cd-ldap" | 1003 | #define SN_id_smime_cd_ldap "id-smime-cd-ldap" |
985 | #define NID_id_smime_cd_ldap 248 | 1004 | #define NID_id_smime_cd_ldap 248 |
986 | #define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L | 1005 | #define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L |
@@ -2399,6 +2418,11 @@ | |||
2399 | #define NID_no_rev_avail 403 | 2418 | #define NID_no_rev_avail 403 |
2400 | #define OBJ_no_rev_avail OBJ_id_ce,56L | 2419 | #define OBJ_no_rev_avail OBJ_id_ce,56L |
2401 | 2420 | ||
2421 | #define SN_anyExtendedKeyUsage "anyExtendedKeyUsage" | ||
2422 | #define LN_anyExtendedKeyUsage "Any Extended Key Usage" | ||
2423 | #define NID_anyExtendedKeyUsage 910 | ||
2424 | #define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L | ||
2425 | |||
2402 | #define SN_netscape "Netscape" | 2426 | #define SN_netscape "Netscape" |
2403 | #define LN_netscape "Netscape Communications Corp." | 2427 | #define LN_netscape "Netscape Communications Corp." |
2404 | #define NID_netscape 57 | 2428 | #define NID_netscape 57 |
@@ -2586,6 +2610,24 @@ | |||
2586 | #define NID_aes_128_cfb128 421 | 2610 | #define NID_aes_128_cfb128 421 |
2587 | #define OBJ_aes_128_cfb128 OBJ_aes,4L | 2611 | #define OBJ_aes_128_cfb128 OBJ_aes,4L |
2588 | 2612 | ||
2613 | #define SN_id_aes128_wrap "id-aes128-wrap" | ||
2614 | #define NID_id_aes128_wrap 788 | ||
2615 | #define OBJ_id_aes128_wrap OBJ_aes,5L | ||
2616 | |||
2617 | #define SN_aes_128_gcm "id-aes128-GCM" | ||
2618 | #define LN_aes_128_gcm "aes-128-gcm" | ||
2619 | #define NID_aes_128_gcm 895 | ||
2620 | #define OBJ_aes_128_gcm OBJ_aes,6L | ||
2621 | |||
2622 | #define SN_aes_128_ccm "id-aes128-CCM" | ||
2623 | #define LN_aes_128_ccm "aes-128-ccm" | ||
2624 | #define NID_aes_128_ccm 896 | ||
2625 | #define OBJ_aes_128_ccm OBJ_aes,7L | ||
2626 | |||
2627 | #define SN_id_aes128_wrap_pad "id-aes128-wrap-pad" | ||
2628 | #define NID_id_aes128_wrap_pad 897 | ||
2629 | #define OBJ_id_aes128_wrap_pad OBJ_aes,8L | ||
2630 | |||
2589 | #define SN_aes_192_ecb "AES-192-ECB" | 2631 | #define SN_aes_192_ecb "AES-192-ECB" |
2590 | #define LN_aes_192_ecb "aes-192-ecb" | 2632 | #define LN_aes_192_ecb "aes-192-ecb" |
2591 | #define NID_aes_192_ecb 422 | 2633 | #define NID_aes_192_ecb 422 |
@@ -2606,6 +2648,24 @@ | |||
2606 | #define NID_aes_192_cfb128 425 | 2648 | #define NID_aes_192_cfb128 425 |
2607 | #define OBJ_aes_192_cfb128 OBJ_aes,24L | 2649 | #define OBJ_aes_192_cfb128 OBJ_aes,24L |
2608 | 2650 | ||
2651 | #define SN_id_aes192_wrap "id-aes192-wrap" | ||
2652 | #define NID_id_aes192_wrap 789 | ||
2653 | #define OBJ_id_aes192_wrap OBJ_aes,25L | ||
2654 | |||
2655 | #define SN_aes_192_gcm "id-aes192-GCM" | ||
2656 | #define LN_aes_192_gcm "aes-192-gcm" | ||
2657 | #define NID_aes_192_gcm 898 | ||
2658 | #define OBJ_aes_192_gcm OBJ_aes,26L | ||
2659 | |||
2660 | #define SN_aes_192_ccm "id-aes192-CCM" | ||
2661 | #define LN_aes_192_ccm "aes-192-ccm" | ||
2662 | #define NID_aes_192_ccm 899 | ||
2663 | #define OBJ_aes_192_ccm OBJ_aes,27L | ||
2664 | |||
2665 | #define SN_id_aes192_wrap_pad "id-aes192-wrap-pad" | ||
2666 | #define NID_id_aes192_wrap_pad 900 | ||
2667 | #define OBJ_id_aes192_wrap_pad OBJ_aes,28L | ||
2668 | |||
2609 | #define SN_aes_256_ecb "AES-256-ECB" | 2669 | #define SN_aes_256_ecb "AES-256-ECB" |
2610 | #define LN_aes_256_ecb "aes-256-ecb" | 2670 | #define LN_aes_256_ecb "aes-256-ecb" |
2611 | #define NID_aes_256_ecb 426 | 2671 | #define NID_aes_256_ecb 426 |
@@ -2626,6 +2686,24 @@ | |||
2626 | #define NID_aes_256_cfb128 429 | 2686 | #define NID_aes_256_cfb128 429 |
2627 | #define OBJ_aes_256_cfb128 OBJ_aes,44L | 2687 | #define OBJ_aes_256_cfb128 OBJ_aes,44L |
2628 | 2688 | ||
2689 | #define SN_id_aes256_wrap "id-aes256-wrap" | ||
2690 | #define NID_id_aes256_wrap 790 | ||
2691 | #define OBJ_id_aes256_wrap OBJ_aes,45L | ||
2692 | |||
2693 | #define SN_aes_256_gcm "id-aes256-GCM" | ||
2694 | #define LN_aes_256_gcm "aes-256-gcm" | ||
2695 | #define NID_aes_256_gcm 901 | ||
2696 | #define OBJ_aes_256_gcm OBJ_aes,46L | ||
2697 | |||
2698 | #define SN_aes_256_ccm "id-aes256-CCM" | ||
2699 | #define LN_aes_256_ccm "aes-256-ccm" | ||
2700 | #define NID_aes_256_ccm 902 | ||
2701 | #define OBJ_aes_256_ccm OBJ_aes,47L | ||
2702 | |||
2703 | #define SN_id_aes256_wrap_pad "id-aes256-wrap-pad" | ||
2704 | #define NID_id_aes256_wrap_pad 903 | ||
2705 | #define OBJ_id_aes256_wrap_pad OBJ_aes,48L | ||
2706 | |||
2629 | #define SN_aes_128_cfb1 "AES-128-CFB1" | 2707 | #define SN_aes_128_cfb1 "AES-128-CFB1" |
2630 | #define LN_aes_128_cfb1 "aes-128-cfb1" | 2708 | #define LN_aes_128_cfb1 "aes-128-cfb1" |
2631 | #define NID_aes_128_cfb1 650 | 2709 | #define NID_aes_128_cfb1 650 |
@@ -2650,6 +2728,26 @@ | |||
2650 | #define LN_aes_256_cfb8 "aes-256-cfb8" | 2728 | #define LN_aes_256_cfb8 "aes-256-cfb8" |
2651 | #define NID_aes_256_cfb8 655 | 2729 | #define NID_aes_256_cfb8 655 |
2652 | 2730 | ||
2731 | #define SN_aes_128_ctr "AES-128-CTR" | ||
2732 | #define LN_aes_128_ctr "aes-128-ctr" | ||
2733 | #define NID_aes_128_ctr 904 | ||
2734 | |||
2735 | #define SN_aes_192_ctr "AES-192-CTR" | ||
2736 | #define LN_aes_192_ctr "aes-192-ctr" | ||
2737 | #define NID_aes_192_ctr 905 | ||
2738 | |||
2739 | #define SN_aes_256_ctr "AES-256-CTR" | ||
2740 | #define LN_aes_256_ctr "aes-256-ctr" | ||
2741 | #define NID_aes_256_ctr 906 | ||
2742 | |||
2743 | #define SN_aes_128_xts "AES-128-XTS" | ||
2744 | #define LN_aes_128_xts "aes-128-xts" | ||
2745 | #define NID_aes_128_xts 913 | ||
2746 | |||
2747 | #define SN_aes_256_xts "AES-256-XTS" | ||
2748 | #define LN_aes_256_xts "aes-256-xts" | ||
2749 | #define NID_aes_256_xts 914 | ||
2750 | |||
2653 | #define SN_des_cfb1 "DES-CFB1" | 2751 | #define SN_des_cfb1 "DES-CFB1" |
2654 | #define LN_des_cfb1 "des-cfb1" | 2752 | #define LN_des_cfb1 "des-cfb1" |
2655 | #define NID_des_cfb1 656 | 2753 | #define NID_des_cfb1 656 |
@@ -2666,18 +2764,6 @@ | |||
2666 | #define LN_des_ede3_cfb8 "des-ede3-cfb8" | 2764 | #define LN_des_ede3_cfb8 "des-ede3-cfb8" |
2667 | #define NID_des_ede3_cfb8 659 | 2765 | #define NID_des_ede3_cfb8 659 |
2668 | 2766 | ||
2669 | #define SN_id_aes128_wrap "id-aes128-wrap" | ||
2670 | #define NID_id_aes128_wrap 788 | ||
2671 | #define OBJ_id_aes128_wrap OBJ_aes,5L | ||
2672 | |||
2673 | #define SN_id_aes192_wrap "id-aes192-wrap" | ||
2674 | #define NID_id_aes192_wrap 789 | ||
2675 | #define OBJ_id_aes192_wrap OBJ_aes,25L | ||
2676 | |||
2677 | #define SN_id_aes256_wrap "id-aes256-wrap" | ||
2678 | #define NID_id_aes256_wrap 790 | ||
2679 | #define OBJ_id_aes256_wrap OBJ_aes,45L | ||
2680 | |||
2681 | #define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L | 2767 | #define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L |
2682 | 2768 | ||
2683 | #define SN_sha256 "SHA256" | 2769 | #define SN_sha256 "SHA256" |
@@ -3810,6 +3896,18 @@ | |||
3810 | #define NID_camellia_256_cbc 753 | 3896 | #define NID_camellia_256_cbc 753 |
3811 | #define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L | 3897 | #define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L |
3812 | 3898 | ||
3899 | #define SN_id_camellia128_wrap "id-camellia128-wrap" | ||
3900 | #define NID_id_camellia128_wrap 907 | ||
3901 | #define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L | ||
3902 | |||
3903 | #define SN_id_camellia192_wrap "id-camellia192-wrap" | ||
3904 | #define NID_id_camellia192_wrap 908 | ||
3905 | #define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L | ||
3906 | |||
3907 | #define SN_id_camellia256_wrap "id-camellia256-wrap" | ||
3908 | #define NID_id_camellia256_wrap 909 | ||
3909 | #define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L | ||
3910 | |||
3813 | #define OBJ_ntt_ds 0L,3L,4401L,5L | 3911 | #define OBJ_ntt_ds 0L,3L,4401L,5L |
3814 | 3912 | ||
3815 | #define OBJ_camellia OBJ_ntt_ds,3L,1L,9L | 3913 | #define OBJ_camellia OBJ_ntt_ds,3L,1L,9L |
@@ -3912,3 +4010,23 @@ | |||
3912 | #define LN_hmac "hmac" | 4010 | #define LN_hmac "hmac" |
3913 | #define NID_hmac 855 | 4011 | #define NID_hmac 855 |
3914 | 4012 | ||
4013 | #define SN_cmac "CMAC" | ||
4014 | #define LN_cmac "cmac" | ||
4015 | #define NID_cmac 894 | ||
4016 | |||
4017 | #define SN_rc4_hmac_md5 "RC4-HMAC-MD5" | ||
4018 | #define LN_rc4_hmac_md5 "rc4-hmac-md5" | ||
4019 | #define NID_rc4_hmac_md5 915 | ||
4020 | |||
4021 | #define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1" | ||
4022 | #define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1" | ||
4023 | #define NID_aes_128_cbc_hmac_sha1 916 | ||
4024 | |||
4025 | #define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1" | ||
4026 | #define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1" | ||
4027 | #define NID_aes_192_cbc_hmac_sha1 917 | ||
4028 | |||
4029 | #define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1" | ||
4030 | #define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1" | ||
4031 | #define NID_aes_256_cbc_hmac_sha1 918 | ||
4032 | |||
diff --git a/src/lib/libcrypto/opensslconf.h b/src/lib/libcrypto/opensslconf.h index c21b3913f0..b18f4da496 100644 --- a/src/lib/libcrypto/opensslconf.h +++ b/src/lib/libcrypto/opensslconf.h | |||
@@ -5,6 +5,9 @@ | |||
5 | #ifndef OPENSSL_DOING_MAKEDEPEND | 5 | #ifndef OPENSSL_DOING_MAKEDEPEND |
6 | 6 | ||
7 | 7 | ||
8 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
9 | # define OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
10 | #endif | ||
8 | #ifndef OPENSSL_NO_GMP | 11 | #ifndef OPENSSL_NO_GMP |
9 | # define OPENSSL_NO_GMP | 12 | # define OPENSSL_NO_GMP |
10 | #endif | 13 | #endif |
@@ -23,6 +26,9 @@ | |||
23 | #ifndef OPENSSL_NO_RFC3779 | 26 | #ifndef OPENSSL_NO_RFC3779 |
24 | # define OPENSSL_NO_RFC3779 | 27 | # define OPENSSL_NO_RFC3779 |
25 | #endif | 28 | #endif |
29 | #ifndef OPENSSL_NO_SCTP | ||
30 | # define OPENSSL_NO_SCTP | ||
31 | #endif | ||
26 | #ifndef OPENSSL_NO_STORE | 32 | #ifndef OPENSSL_NO_STORE |
27 | # define OPENSSL_NO_STORE | 33 | # define OPENSSL_NO_STORE |
28 | #endif | 34 | #endif |
@@ -38,6 +44,9 @@ | |||
38 | who haven't had the time to do the appropriate changes in their | 44 | who haven't had the time to do the appropriate changes in their |
39 | applications. */ | 45 | applications. */ |
40 | #ifdef OPENSSL_ALGORITHM_DEFINES | 46 | #ifdef OPENSSL_ALGORITHM_DEFINES |
47 | # if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) | ||
48 | # define NO_EC_NISTP_64_GCC_128 | ||
49 | # endif | ||
41 | # if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) | 50 | # if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) |
42 | # define NO_GMP | 51 | # define NO_GMP |
43 | # endif | 52 | # endif |
@@ -56,6 +65,9 @@ | |||
56 | # if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) | 65 | # if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) |
57 | # define NO_RFC3779 | 66 | # define NO_RFC3779 |
58 | # endif | 67 | # endif |
68 | # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) | ||
69 | # define NO_SCTP | ||
70 | # endif | ||
59 | # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) | 71 | # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) |
60 | # define NO_STORE | 72 | # define NO_STORE |
61 | # endif | 73 | # endif |
diff --git a/src/lib/libcrypto/perlasm/x86nasm.pl b/src/lib/libcrypto/perlasm/x86nasm.pl index ce2bed9bb2..ca2511c9eb 100644 --- a/src/lib/libcrypto/perlasm/x86nasm.pl +++ b/src/lib/libcrypto/perlasm/x86nasm.pl | |||
@@ -19,6 +19,8 @@ sub ::generic | |||
19 | { $_[0] = "NEAR $_[0]"; } | 19 | { $_[0] = "NEAR $_[0]"; } |
20 | elsif ($opcode eq "lea" && $#_==1) # wipe storage qualifier from lea | 20 | elsif ($opcode eq "lea" && $#_==1) # wipe storage qualifier from lea |
21 | { $_[1] =~ s/^[^\[]*\[/\[/o; } | 21 | { $_[1] =~ s/^[^\[]*\[/\[/o; } |
22 | elsif ($opcode eq "clflush" && $#_==0) | ||
23 | { $_[0] =~ s/^[^\[]*\[/\[/o; } | ||
22 | } | 24 | } |
23 | &::emit($opcode,@_); | 25 | &::emit($opcode,@_); |
24 | 1; | 26 | 1; |
@@ -67,6 +69,7 @@ sub get_mem | |||
67 | } | 69 | } |
68 | sub ::BP { &get_mem("BYTE",@_); } | 70 | sub ::BP { &get_mem("BYTE",@_); } |
69 | sub ::DWP { &get_mem("DWORD",@_); } | 71 | sub ::DWP { &get_mem("DWORD",@_); } |
72 | sub ::WP { &get_mem("WORD",@_); } | ||
70 | sub ::QWP { &get_mem("",@_); } | 73 | sub ::QWP { &get_mem("",@_); } |
71 | sub ::BC { (($::mwerks)?"":"BYTE ")."@_"; } | 74 | sub ::BC { (($::mwerks)?"":"BYTE ")."@_"; } |
72 | sub ::DWC { (($::mwerks)?"":"DWORD ")."@_"; } | 75 | sub ::DWC { (($::mwerks)?"":"DWORD ")."@_"; } |
@@ -114,7 +117,7 @@ sub ::file_end | |||
114 | { if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) | 117 | { if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) |
115 | { my $comm=<<___; | 118 | { my $comm=<<___; |
116 | ${drdecor}segment .bss | 119 | ${drdecor}segment .bss |
117 | ${drdecor}common ${nmdecor}OPENSSL_ia32cap_P 4 | 120 | ${drdecor}common ${nmdecor}OPENSSL_ia32cap_P 8 |
118 | ___ | 121 | ___ |
119 | # comment out OPENSSL_ia32cap_P declarations | 122 | # comment out OPENSSL_ia32cap_P declarations |
120 | grep {s/(^extern\s+${nmdecor}OPENSSL_ia32cap_P)/\;$1/} @out; | 123 | grep {s/(^extern\s+${nmdecor}OPENSSL_ia32cap_P)/\;$1/} @out; |
@@ -135,7 +138,8 @@ sub ::public_label | |||
135 | 138 | ||
136 | sub ::data_byte | 139 | sub ::data_byte |
137 | { push(@out,(($::mwerks)?".byte\t":"db\t").join(',',@_)."\n"); } | 140 | { push(@out,(($::mwerks)?".byte\t":"db\t").join(',',@_)."\n"); } |
138 | 141 | sub ::data_short | |
142 | { push(@out,(($::mwerks)?".word\t":"dw\t").join(',',@_)."\n"); } | ||
139 | sub ::data_word | 143 | sub ::data_word |
140 | { push(@out,(($::mwerks)?".long\t":"dd\t").join(',',@_)."\n"); } | 144 | { push(@out,(($::mwerks)?".long\t":"dd\t").join(',',@_)."\n"); } |
141 | 145 | ||
@@ -163,4 +167,11 @@ sub ::dataseg | |||
163 | else { push(@out,"section\t.data align=4\n"); } | 167 | else { push(@out,"section\t.data align=4\n"); } |
164 | } | 168 | } |
165 | 169 | ||
170 | sub ::safeseh | ||
171 | { my $nm=shift; | ||
172 | push(@out,"%if __NASM_VERSION_ID__ >= 0x02030000\n"); | ||
173 | push(@out,"safeseh ".&::LABEL($nm,$nmdecor.$nm)."\n"); | ||
174 | push(@out,"%endif\n"); | ||
175 | } | ||
176 | |||
166 | 1; | 177 | 1; |
diff --git a/src/lib/libcrypto/rand/md_rand.c b/src/lib/libcrypto/rand/md_rand.c index b2f04ff13e..fcdd3f2a84 100644 --- a/src/lib/libcrypto/rand/md_rand.c +++ b/src/lib/libcrypto/rand/md_rand.c | |||
@@ -109,6 +109,8 @@ | |||
109 | * | 109 | * |
110 | */ | 110 | */ |
111 | 111 | ||
112 | #define OPENSSL_FIPSEVP | ||
113 | |||
112 | #ifdef MD_RAND_DEBUG | 114 | #ifdef MD_RAND_DEBUG |
113 | # ifndef NDEBUG | 115 | # ifndef NDEBUG |
114 | # define NDEBUG | 116 | # define NDEBUG |
@@ -157,13 +159,14 @@ const char RAND_version[]="RAND" OPENSSL_VERSION_PTEXT; | |||
157 | static void ssleay_rand_cleanup(void); | 159 | static void ssleay_rand_cleanup(void); |
158 | static void ssleay_rand_seed(const void *buf, int num); | 160 | static void ssleay_rand_seed(const void *buf, int num); |
159 | static void ssleay_rand_add(const void *buf, int num, double add_entropy); | 161 | static void ssleay_rand_add(const void *buf, int num, double add_entropy); |
160 | static int ssleay_rand_bytes(unsigned char *buf, int num); | 162 | static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo); |
163 | static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num); | ||
161 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num); | 164 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num); |
162 | static int ssleay_rand_status(void); | 165 | static int ssleay_rand_status(void); |
163 | 166 | ||
164 | RAND_METHOD rand_ssleay_meth={ | 167 | RAND_METHOD rand_ssleay_meth={ |
165 | ssleay_rand_seed, | 168 | ssleay_rand_seed, |
166 | ssleay_rand_bytes, | 169 | ssleay_rand_nopseudo_bytes, |
167 | ssleay_rand_cleanup, | 170 | ssleay_rand_cleanup, |
168 | ssleay_rand_add, | 171 | ssleay_rand_add, |
169 | ssleay_rand_pseudo_bytes, | 172 | ssleay_rand_pseudo_bytes, |
@@ -328,7 +331,7 @@ static void ssleay_rand_seed(const void *buf, int num) | |||
328 | ssleay_rand_add(buf, num, (double)num); | 331 | ssleay_rand_add(buf, num, (double)num); |
329 | } | 332 | } |
330 | 333 | ||
331 | static int ssleay_rand_bytes(unsigned char *buf, int num) | 334 | static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo) |
332 | { | 335 | { |
333 | static volatile int stirred_pool = 0; | 336 | static volatile int stirred_pool = 0; |
334 | int i,j,k,st_num,st_idx; | 337 | int i,j,k,st_num,st_idx; |
@@ -517,7 +520,9 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
517 | EVP_MD_CTX_cleanup(&m); | 520 | EVP_MD_CTX_cleanup(&m); |
518 | if (ok) | 521 | if (ok) |
519 | return(1); | 522 | return(1); |
520 | else | 523 | else if (pseudo) |
524 | return 0; | ||
525 | else | ||
521 | { | 526 | { |
522 | RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED); | 527 | RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED); |
523 | ERR_add_error_data(1, "You need to read the OpenSSL FAQ, " | 528 | ERR_add_error_data(1, "You need to read the OpenSSL FAQ, " |
@@ -526,22 +531,16 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
526 | } | 531 | } |
527 | } | 532 | } |
528 | 533 | ||
534 | static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num) | ||
535 | { | ||
536 | return ssleay_rand_bytes(buf, num, 0); | ||
537 | } | ||
538 | |||
529 | /* pseudo-random bytes that are guaranteed to be unique but not | 539 | /* pseudo-random bytes that are guaranteed to be unique but not |
530 | unpredictable */ | 540 | unpredictable */ |
531 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) | 541 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) |
532 | { | 542 | { |
533 | int ret; | 543 | return ssleay_rand_bytes(buf, num, 1); |
534 | unsigned long err; | ||
535 | |||
536 | ret = RAND_bytes(buf, num); | ||
537 | if (ret == 0) | ||
538 | { | ||
539 | err = ERR_peek_error(); | ||
540 | if (ERR_GET_LIB(err) == ERR_LIB_RAND && | ||
541 | ERR_GET_REASON(err) == RAND_R_PRNG_NOT_SEEDED) | ||
542 | ERR_clear_error(); | ||
543 | } | ||
544 | return (ret); | ||
545 | } | 544 | } |
546 | 545 | ||
547 | static int ssleay_rand_status(void) | 546 | static int ssleay_rand_status(void) |
diff --git a/src/lib/libcrypto/rc2/Makefile b/src/lib/libcrypto/rc2/Makefile index 73eac347e7..8a9d49ab5e 100644 --- a/src/lib/libcrypto/rc2/Makefile +++ b/src/lib/libcrypto/rc2/Makefile | |||
@@ -78,7 +78,11 @@ rc2_cbc.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h | |||
78 | rc2_cbc.o: rc2_cbc.c rc2_locl.h | 78 | rc2_cbc.o: rc2_cbc.c rc2_locl.h |
79 | rc2_ecb.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 79 | rc2_ecb.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
80 | rc2_ecb.o: ../../include/openssl/rc2.h rc2_ecb.c rc2_locl.h | 80 | rc2_ecb.o: ../../include/openssl/rc2.h rc2_ecb.c rc2_locl.h |
81 | rc2_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h | 81 | rc2_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
82 | rc2_skey.o: ../../include/openssl/opensslconf.h | ||
83 | rc2_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
84 | rc2_skey.o: ../../include/openssl/rc2.h ../../include/openssl/safestack.h | ||
85 | rc2_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
82 | rc2_skey.o: rc2_locl.h rc2_skey.c | 86 | rc2_skey.o: rc2_locl.h rc2_skey.c |
83 | rc2cfb64.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h | 87 | rc2cfb64.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h |
84 | rc2cfb64.o: rc2_locl.h rc2cfb64.c | 88 | rc2cfb64.o: rc2_locl.h rc2cfb64.c |
diff --git a/src/lib/libcrypto/rc4/Makefile b/src/lib/libcrypto/rc4/Makefile index 264451a213..1614d47961 100644 --- a/src/lib/libcrypto/rc4/Makefile +++ b/src/lib/libcrypto/rc4/Makefile | |||
@@ -21,8 +21,8 @@ TEST=rc4test.c | |||
21 | APPS= | 21 | APPS= |
22 | 22 | ||
23 | LIB=$(TOP)/libcrypto.a | 23 | LIB=$(TOP)/libcrypto.a |
24 | LIBSRC=rc4_skey.c rc4_enc.c | 24 | LIBSRC=rc4_skey.c rc4_enc.c rc4_utl.c |
25 | LIBOBJ=$(RC4_ENC) | 25 | LIBOBJ=$(RC4_ENC) rc4_utl.o |
26 | 26 | ||
27 | SRC= $(LIBSRC) | 27 | SRC= $(LIBSRC) |
28 | 28 | ||
@@ -46,12 +46,14 @@ rc4-586.s: asm/rc4-586.pl ../perlasm/x86asm.pl | |||
46 | 46 | ||
47 | rc4-x86_64.s: asm/rc4-x86_64.pl | 47 | rc4-x86_64.s: asm/rc4-x86_64.pl |
48 | $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@ | 48 | $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@ |
49 | rc4-md5-x86_64.s: asm/rc4-md5-x86_64.pl | ||
50 | $(PERL) asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
49 | 51 | ||
50 | rc4-ia64.S: asm/rc4-ia64.pl | 52 | rc4-ia64.S: asm/rc4-ia64.pl |
51 | $(PERL) asm/rc4-ia64.pl $(CFLAGS) > $@ | 53 | $(PERL) asm/rc4-ia64.pl $(CFLAGS) > $@ |
52 | 54 | ||
53 | rc4-s390x.s: asm/rc4-s390x.pl | 55 | rc4-parisc.s: asm/rc4-parisc.pl |
54 | $(PERL) asm/rc4-s390x.pl > $@ | 56 | $(PERL) asm/rc4-parisc.pl $(PERLASM_SCHEME) $@ |
55 | 57 | ||
56 | rc4-ia64.s: rc4-ia64.S | 58 | rc4-ia64.s: rc4-ia64.S |
57 | @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \ | 59 | @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \ |
@@ -60,6 +62,9 @@ rc4-ia64.s: rc4-ia64.S | |||
60 | *) exit 1 ;; \ | 62 | *) exit 1 ;; \ |
61 | esac | 63 | esac |
62 | 64 | ||
65 | # GNU make "catch all" | ||
66 | rc4-%.s: asm/rc4-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ | ||
67 | |||
63 | files: | 68 | files: |
64 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 69 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
65 | 70 | ||
@@ -113,3 +118,8 @@ rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
113 | rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h | 118 | rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h |
114 | rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 119 | rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
115 | rc4_skey.o: ../cryptlib.h rc4_locl.h rc4_skey.c | 120 | rc4_skey.o: ../cryptlib.h rc4_locl.h rc4_skey.c |
121 | rc4_utl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
122 | rc4_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
123 | rc4_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h | ||
124 | rc4_utl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
125 | rc4_utl.o: ../../include/openssl/symhacks.h rc4_utl.c | ||
diff --git a/src/lib/libcrypto/rc4/rc4test.c b/src/lib/libcrypto/rc4/rc4test.c index 633a79e758..4312605ccb 100644 --- a/src/lib/libcrypto/rc4/rc4test.c +++ b/src/lib/libcrypto/rc4/rc4test.c | |||
@@ -120,6 +120,12 @@ int main(int argc, char *argv[]) | |||
120 | RC4_KEY key; | 120 | RC4_KEY key; |
121 | unsigned char obuf[512]; | 121 | unsigned char obuf[512]; |
122 | 122 | ||
123 | #if !defined(OPENSSL_PIC) | ||
124 | void OPENSSL_cpuid_setup(void); | ||
125 | |||
126 | OPENSSL_cpuid_setup(); | ||
127 | #endif | ||
128 | |||
123 | for (i=0; i<6; i++) | 129 | for (i=0; i<6; i++) |
124 | { | 130 | { |
125 | RC4_set_key(&key,keys[i][0],&(keys[i][1])); | 131 | RC4_set_key(&key,keys[i][0],&(keys[i][1])); |
diff --git a/src/lib/libcrypto/ripemd/Makefile b/src/lib/libcrypto/ripemd/Makefile index d5b1067dbe..25140b2a73 100644 --- a/src/lib/libcrypto/ripemd/Makefile +++ b/src/lib/libcrypto/ripemd/Makefile | |||
@@ -82,8 +82,11 @@ clean: | |||
82 | 82 | ||
83 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 83 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
84 | 84 | ||
85 | rmd_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 85 | rmd_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
86 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ripemd.h | 86 | rmd_dgst.o: ../../include/openssl/opensslconf.h |
87 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
88 | rmd_dgst.o: ../../include/openssl/ripemd.h ../../include/openssl/safestack.h | ||
89 | rmd_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
87 | rmd_dgst.o: ../md32_common.h rmd_dgst.c rmd_locl.h rmdconst.h | 90 | rmd_dgst.o: ../md32_common.h rmd_dgst.c rmd_locl.h rmdconst.h |
88 | rmd_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 91 | rmd_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
89 | rmd_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 92 | rmd_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
diff --git a/src/lib/libcrypto/rsa/Makefile b/src/lib/libcrypto/rsa/Makefile index bb64223e05..f798d2f749 100644 --- a/src/lib/libcrypto/rsa/Makefile +++ b/src/lib/libcrypto/rsa/Makefile | |||
@@ -20,11 +20,11 @@ LIB=$(TOP)/libcrypto.a | |||
20 | LIBSRC= rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c \ | 20 | LIBSRC= rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c \ |
21 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_null.c \ | 21 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_null.c \ |
22 | rsa_pss.c rsa_x931.c rsa_asn1.c rsa_depr.c rsa_ameth.c rsa_prn.c \ | 22 | rsa_pss.c rsa_x931.c rsa_asn1.c rsa_depr.c rsa_ameth.c rsa_prn.c \ |
23 | rsa_pmeth.c | 23 | rsa_pmeth.c rsa_crpt.c |
24 | LIBOBJ= rsa_eay.o rsa_gen.o rsa_lib.o rsa_sign.o rsa_saos.o rsa_err.o \ | 24 | LIBOBJ= rsa_eay.o rsa_gen.o rsa_lib.o rsa_sign.o rsa_saos.o rsa_err.o \ |
25 | rsa_pk1.o rsa_ssl.o rsa_none.o rsa_oaep.o rsa_chk.o rsa_null.o \ | 25 | rsa_pk1.o rsa_ssl.o rsa_none.o rsa_oaep.o rsa_chk.o rsa_null.o \ |
26 | rsa_pss.o rsa_x931.o rsa_asn1.o rsa_depr.o rsa_ameth.o rsa_prn.o \ | 26 | rsa_pss.o rsa_x931.o rsa_asn1.o rsa_depr.o rsa_ameth.o rsa_prn.o \ |
27 | rsa_pmeth.o | 27 | rsa_pmeth.o rsa_crpt.o |
28 | 28 | ||
29 | SRC= $(LIBSRC) | 29 | SRC= $(LIBSRC) |
30 | 30 | ||
@@ -100,11 +100,16 @@ rsa_asn1.o: ../../e_os.h ../../include/openssl/asn1.h | |||
100 | rsa_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | 100 | rsa_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
101 | rsa_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 101 | rsa_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
102 | rsa_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 102 | rsa_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
103 | rsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 103 | rsa_asn1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h |
104 | rsa_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
105 | rsa_asn1.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
106 | rsa_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
104 | rsa_asn1.o: ../../include/openssl/opensslconf.h | 107 | rsa_asn1.o: ../../include/openssl/opensslconf.h |
105 | rsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 108 | rsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
106 | rsa_asn1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 109 | rsa_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
110 | rsa_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
107 | rsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 111 | rsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
112 | rsa_asn1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
108 | rsa_asn1.o: ../cryptlib.h rsa_asn1.c | 113 | rsa_asn1.o: ../cryptlib.h rsa_asn1.c |
109 | rsa_chk.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 114 | rsa_chk.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
110 | rsa_chk.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 115 | rsa_chk.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
@@ -114,6 +119,21 @@ rsa_chk.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
114 | rsa_chk.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 119 | rsa_chk.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
115 | rsa_chk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 120 | rsa_chk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
116 | rsa_chk.o: rsa_chk.c | 121 | rsa_chk.o: rsa_chk.c |
122 | rsa_crpt.o: ../../e_os.h ../../include/openssl/asn1.h | ||
123 | rsa_crpt.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
124 | rsa_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
125 | rsa_crpt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
126 | rsa_crpt.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
127 | rsa_crpt.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
128 | rsa_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
129 | rsa_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
130 | rsa_crpt.o: ../../include/openssl/opensslconf.h | ||
131 | rsa_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
132 | rsa_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
133 | rsa_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
134 | rsa_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
135 | rsa_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
136 | rsa_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h rsa_crpt.c | ||
117 | rsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h | 137 | rsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h |
118 | rsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 138 | rsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
119 | rsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 139 | rsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -205,11 +225,12 @@ rsa_pk1.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pk1.c | |||
205 | rsa_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h | 225 | rsa_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h |
206 | rsa_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | 226 | rsa_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
207 | rsa_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 227 | rsa_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
208 | rsa_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 228 | rsa_pmeth.o: ../../include/openssl/cms.h ../../include/openssl/crypto.h |
209 | rsa_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | 229 | rsa_pmeth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
210 | rsa_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | 230 | rsa_pmeth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h |
211 | rsa_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | 231 | rsa_pmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
212 | rsa_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 232 | rsa_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
233 | rsa_pmeth.o: ../../include/openssl/objects.h | ||
213 | rsa_pmeth.o: ../../include/openssl/opensslconf.h | 234 | rsa_pmeth.o: ../../include/openssl/opensslconf.h |
214 | rsa_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 235 | rsa_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
215 | rsa_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | 236 | rsa_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
diff --git a/src/lib/libcrypto/sha/Makefile b/src/lib/libcrypto/sha/Makefile index e6eccb05f9..6d191d3936 100644 --- a/src/lib/libcrypto/sha/Makefile +++ b/src/lib/libcrypto/sha/Makefile | |||
@@ -56,8 +56,11 @@ sha256-ia64.s: asm/sha512-ia64.pl | |||
56 | sha512-ia64.s: asm/sha512-ia64.pl | 56 | sha512-ia64.s: asm/sha512-ia64.pl |
57 | (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS)) | 57 | (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS)) |
58 | 58 | ||
59 | sha256-armv4.s: asm/sha256-armv4.pl | 59 | sha256-armv4.S: asm/sha256-armv4.pl |
60 | $(PERL) $< $@ | 60 | $(PERL) $< $(PERLASM_SCHEME) $@ |
61 | |||
62 | sha1-alpha.s: asm/sha1-alpha.pl | ||
63 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | ||
61 | 64 | ||
62 | # Solaris make has to be explicitly told | 65 | # Solaris make has to be explicitly told |
63 | sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@ | 66 | sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@ |
@@ -71,10 +74,22 @@ sha1-ppc.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@ | |||
71 | sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ | 74 | sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ |
72 | sha512-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ | 75 | sha512-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ |
73 | 76 | ||
77 | sha1-parisc.s: asm/sha1-parisc.pl; $(PERL) asm/sha1-parisc.pl $(PERLASM_SCHEME) $@ | ||
78 | sha256-parisc.s:asm/sha512-parisc.pl; $(PERL) asm/sha512-parisc.pl $(PERLASM_SCHEME) $@ | ||
79 | sha512-parisc.s:asm/sha512-parisc.pl; $(PERL) asm/sha512-parisc.pl $(PERLASM_SCHEME) $@ | ||
80 | |||
81 | sha1-mips.S: asm/sha1-mips.pl; $(PERL) asm/sha1-mips.pl $(PERLASM_SCHEME) $@ | ||
82 | sha256-mips.S: asm/sha512-mips.pl; $(PERL) asm/sha512-mips.pl $(PERLASM_SCHEME) $@ | ||
83 | sha512-mips.S: asm/sha512-mips.pl; $(PERL) asm/sha512-mips.pl $(PERLASM_SCHEME) $@ | ||
84 | |||
74 | # GNU make "catch all" | 85 | # GNU make "catch all" |
75 | sha1-%.s: asm/sha1-%.pl; $(PERL) $< $@ | 86 | sha1-%.S: asm/sha1-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
76 | sha256-%.s: asm/sha512-%.pl; $(PERL) $< $@ | 87 | sha256-%.S: asm/sha512-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
77 | sha512-%.s: asm/sha512-%.pl; $(PERL) $< $@ | 88 | sha512-%.S: asm/sha512-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
89 | |||
90 | sha1-armv4-large.o: sha1-armv4-large.S | ||
91 | sha256-armv4.o: sha256-armv4.S | ||
92 | sha512-armv4.o: sha512-armv4.S | ||
78 | 93 | ||
79 | files: | 94 | files: |
80 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 95 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
@@ -119,8 +134,11 @@ sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
119 | sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 134 | sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
120 | sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 135 | sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
121 | sha1_one.o: sha1_one.c | 136 | sha1_one.o: sha1_one.c |
122 | sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 137 | sha1dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
123 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 138 | sha1dgst.o: ../../include/openssl/opensslconf.h |
139 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
140 | sha1dgst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
141 | sha1dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
124 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h | 142 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h |
125 | sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 143 | sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
126 | sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 144 | sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
@@ -135,8 +153,11 @@ sha512.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
135 | sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 153 | sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
136 | sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 154 | sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
137 | sha512.o: ../cryptlib.h sha512.c | 155 | sha512.o: ../cryptlib.h sha512.c |
138 | sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 156 | sha_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
139 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 157 | sha_dgst.o: ../../include/openssl/opensslconf.h |
158 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
159 | sha_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
160 | sha_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
140 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h | 161 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h |
141 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 162 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
142 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 163 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
diff --git a/src/lib/libcrypto/sha/sha_dgst.c b/src/lib/libcrypto/sha/sha_dgst.c index 70eb56032c..c946ad827d 100644 --- a/src/lib/libcrypto/sha/sha_dgst.c +++ b/src/lib/libcrypto/sha/sha_dgst.c | |||
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/opensslconf.h> | 59 | #include <openssl/opensslconf.h> |
60 | #include <openssl/crypto.h> | ||
60 | #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) | 61 | #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) |
61 | 62 | ||
62 | #undef SHA_1 | 63 | #undef SHA_1 |
diff --git a/src/lib/libcrypto/symhacks.h b/src/lib/libcrypto/symhacks.h index 3fd4a81692..403f592dcd 100644 --- a/src/lib/libcrypto/symhacks.h +++ b/src/lib/libcrypto/symhacks.h | |||
@@ -176,7 +176,6 @@ | |||
176 | #define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud | 176 | #define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud |
177 | #undef SSL_COMP_get_compression_methods | 177 | #undef SSL_COMP_get_compression_methods |
178 | #define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods | 178 | #define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods |
179 | |||
180 | #undef ssl_add_clienthello_renegotiate_ext | 179 | #undef ssl_add_clienthello_renegotiate_ext |
181 | #define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext | 180 | #define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext |
182 | #undef ssl_add_serverhello_renegotiate_ext | 181 | #undef ssl_add_serverhello_renegotiate_ext |
@@ -185,6 +184,26 @@ | |||
185 | #define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext | 184 | #define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext |
186 | #undef ssl_parse_serverhello_renegotiate_ext | 185 | #undef ssl_parse_serverhello_renegotiate_ext |
187 | #define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext | 186 | #define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext |
187 | #undef SSL_srp_server_param_with_username | ||
188 | #define SSL_srp_server_param_with_username SSL_srp_server_param_with_un | ||
189 | #undef SSL_CTX_set_srp_client_pwd_callback | ||
190 | #define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb | ||
191 | #undef SSL_CTX_set_srp_verify_param_callback | ||
192 | #define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb | ||
193 | #undef SSL_CTX_set_srp_username_callback | ||
194 | #define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb | ||
195 | #undef ssl_add_clienthello_use_srtp_ext | ||
196 | #define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext | ||
197 | #undef ssl_add_serverhello_use_srtp_ext | ||
198 | #define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext | ||
199 | #undef ssl_parse_clienthello_use_srtp_ext | ||
200 | #define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext | ||
201 | #undef ssl_parse_serverhello_use_srtp_ext | ||
202 | #define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext | ||
203 | #undef SSL_CTX_set_next_protos_advertised_cb | ||
204 | #define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb | ||
205 | #undef SSL_CTX_set_next_proto_select_cb | ||
206 | #define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb | ||
188 | 207 | ||
189 | /* Hack some long ENGINE names */ | 208 | /* Hack some long ENGINE names */ |
190 | #undef ENGINE_get_default_BN_mod_exp_crt | 209 | #undef ENGINE_get_default_BN_mod_exp_crt |
@@ -238,6 +257,9 @@ | |||
238 | #define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form | 257 | #define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form |
239 | #undef EC_GROUP_clear_free_all_extra_data | 258 | #undef EC_GROUP_clear_free_all_extra_data |
240 | #define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data | 259 | #define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data |
260 | #undef EC_KEY_set_public_key_affine_coordinates | ||
261 | #define EC_KEY_set_public_key_affine_coordinates \ | ||
262 | EC_KEY_set_pub_key_aff_coords | ||
241 | #undef EC_POINT_set_Jprojective_coordinates_GFp | 263 | #undef EC_POINT_set_Jprojective_coordinates_GFp |
242 | #define EC_POINT_set_Jprojective_coordinates_GFp \ | 264 | #define EC_POINT_set_Jprojective_coordinates_GFp \ |
243 | EC_POINT_set_Jproj_coords_GFp | 265 | EC_POINT_set_Jproj_coords_GFp |
@@ -399,6 +421,12 @@ | |||
399 | #undef dtls1_retransmit_buffered_messages | 421 | #undef dtls1_retransmit_buffered_messages |
400 | #define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs | 422 | #define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs |
401 | 423 | ||
424 | /* Hack some long SRP names */ | ||
425 | #undef SRP_generate_server_master_secret | ||
426 | #define SRP_generate_server_master_secret SRP_gen_server_master_secret | ||
427 | #undef SRP_generate_client_master_secret | ||
428 | #define SRP_generate_client_master_secret SRP_gen_client_master_secret | ||
429 | |||
402 | /* Hack some long UI names */ | 430 | /* Hack some long UI names */ |
403 | #undef UI_method_get_prompt_constructor | 431 | #undef UI_method_get_prompt_constructor |
404 | #define UI_method_get_prompt_constructor UI_method_get_prompt_constructr | 432 | #define UI_method_get_prompt_constructor UI_method_get_prompt_constructr |
diff --git a/src/lib/libcrypto/util/cygwin.sh b/src/lib/libcrypto/util/cygwin.sh index d6228521e6..cfdb04d2a4 100644 --- a/src/lib/libcrypto/util/cygwin.sh +++ b/src/lib/libcrypto/util/cygwin.sh | |||
@@ -11,6 +11,7 @@ CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5" | |||
11 | INSTALL_PREFIX=/tmp/install/INSTALL | 11 | INSTALL_PREFIX=/tmp/install/INSTALL |
12 | 12 | ||
13 | VERSION= | 13 | VERSION= |
14 | SHLIB_VERSION_NUMBER= | ||
14 | SUBVERSION=$1 | 15 | SUBVERSION=$1 |
15 | 16 | ||
16 | function cleanup() | 17 | function cleanup() |
@@ -28,6 +29,13 @@ function get_openssl_version() | |||
28 | echo " Check value of variable VERSION in Makefile." | 29 | echo " Check value of variable VERSION in Makefile." |
29 | exit 1 | 30 | exit 1 |
30 | fi | 31 | fi |
32 | eval `grep '^SHLIB_VERSION_NUMBER=' Makefile` | ||
33 | if [ -z "${SHLIB_VERSION_NUMBER}" ] | ||
34 | then | ||
35 | echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile." | ||
36 | echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile." | ||
37 | exit 1 | ||
38 | fi | ||
31 | } | 39 | } |
32 | 40 | ||
33 | function base_install() | 41 | function base_install() |
@@ -124,7 +132,7 @@ strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so | |||
124 | chmod u-w usr/lib/engines/*.so | 132 | chmod u-w usr/lib/engines/*.so |
125 | 133 | ||
126 | # Runtime package | 134 | # Runtime package |
127 | tar cjf libopenssl${VERSION//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \ | 135 | tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \ |
128 | usr/bin/cyg*dll | 136 | usr/bin/cyg*dll |
129 | # Base package | 137 | # Base package |
130 | find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \ | 138 | find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \ |
@@ -139,7 +147,7 @@ tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 - | |||
139 | 147 | ||
140 | ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2 | 148 | ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2 |
141 | ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 | 149 | ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 |
142 | ls -l libopenssl${VERSION//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 | 150 | ls -l libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 |
143 | 151 | ||
144 | cleanup | 152 | cleanup |
145 | 153 | ||
diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num index b23619f20a..93f80ba0c6 100644 --- a/src/lib/libcrypto/util/libeay.num +++ b/src/lib/libcrypto/util/libeay.num | |||
@@ -1050,7 +1050,7 @@ ASN1_TYPE_get_octetstring 1077 EXIST::FUNCTION: | |||
1050 | ASN1_TYPE_set_int_octetstring 1078 EXIST::FUNCTION: | 1050 | ASN1_TYPE_set_int_octetstring 1078 EXIST::FUNCTION: |
1051 | ASN1_TYPE_set_octetstring 1079 EXIST::FUNCTION: | 1051 | ASN1_TYPE_set_octetstring 1079 EXIST::FUNCTION: |
1052 | ASN1_UTCTIME_set_string 1080 EXIST::FUNCTION: | 1052 | ASN1_UTCTIME_set_string 1080 EXIST::FUNCTION: |
1053 | ERR_add_error_data 1081 EXIST::FUNCTION:BIO | 1053 | ERR_add_error_data 1081 EXIST::FUNCTION: |
1054 | ERR_set_error_data 1082 EXIST::FUNCTION: | 1054 | ERR_set_error_data 1082 EXIST::FUNCTION: |
1055 | EVP_CIPHER_asn1_to_param 1083 EXIST::FUNCTION: | 1055 | EVP_CIPHER_asn1_to_param 1083 EXIST::FUNCTION: |
1056 | EVP_CIPHER_param_to_asn1 1084 EXIST::FUNCTION: | 1056 | EVP_CIPHER_param_to_asn1 1084 EXIST::FUNCTION: |
@@ -2808,7 +2808,7 @@ FIPS_corrupt_rsa 3249 NOEXIST::FUNCTION: | |||
2808 | FIPS_selftest_des 3250 NOEXIST::FUNCTION: | 2808 | FIPS_selftest_des 3250 NOEXIST::FUNCTION: |
2809 | EVP_aes_128_cfb1 3251 EXIST::FUNCTION:AES | 2809 | EVP_aes_128_cfb1 3251 EXIST::FUNCTION:AES |
2810 | EVP_aes_192_cfb8 3252 EXIST::FUNCTION:AES | 2810 | EVP_aes_192_cfb8 3252 EXIST::FUNCTION:AES |
2811 | FIPS_mode_set 3253 NOEXIST::FUNCTION: | 2811 | FIPS_mode_set 3253 EXIST::FUNCTION: |
2812 | FIPS_selftest_dsa 3254 NOEXIST::FUNCTION: | 2812 | FIPS_selftest_dsa 3254 NOEXIST::FUNCTION: |
2813 | EVP_aes_256_cfb8 3255 EXIST::FUNCTION:AES | 2813 | EVP_aes_256_cfb8 3255 EXIST::FUNCTION:AES |
2814 | FIPS_allow_md5 3256 NOEXIST::FUNCTION: | 2814 | FIPS_allow_md5 3256 NOEXIST::FUNCTION: |
@@ -2838,23 +2838,23 @@ AES_cfb1_encrypt 3279 EXIST::FUNCTION:AES | |||
2838 | EVP_des_ede3_cfb1 3280 EXIST::FUNCTION:DES | 2838 | EVP_des_ede3_cfb1 3280 EXIST::FUNCTION:DES |
2839 | FIPS_rand_check 3281 NOEXIST::FUNCTION: | 2839 | FIPS_rand_check 3281 NOEXIST::FUNCTION: |
2840 | FIPS_md5_allowed 3282 NOEXIST::FUNCTION: | 2840 | FIPS_md5_allowed 3282 NOEXIST::FUNCTION: |
2841 | FIPS_mode 3283 NOEXIST::FUNCTION: | 2841 | FIPS_mode 3283 EXIST::FUNCTION: |
2842 | FIPS_selftest_failed 3284 NOEXIST::FUNCTION: | 2842 | FIPS_selftest_failed 3284 NOEXIST::FUNCTION: |
2843 | sk_is_sorted 3285 EXIST::FUNCTION: | 2843 | sk_is_sorted 3285 EXIST::FUNCTION: |
2844 | X509_check_ca 3286 EXIST::FUNCTION: | 2844 | X509_check_ca 3286 EXIST::FUNCTION: |
2845 | private_idea_set_encrypt_key 3287 NOEXIST::FUNCTION: | 2845 | private_idea_set_encrypt_key 3287 EXIST:OPENSSL_FIPS:FUNCTION:IDEA |
2846 | HMAC_CTX_set_flags 3288 EXIST::FUNCTION:HMAC | 2846 | HMAC_CTX_set_flags 3288 EXIST::FUNCTION:HMAC |
2847 | private_SHA_Init 3289 NOEXIST::FUNCTION: | 2847 | private_SHA_Init 3289 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA0 |
2848 | private_CAST_set_key 3290 NOEXIST::FUNCTION: | 2848 | private_CAST_set_key 3290 EXIST:OPENSSL_FIPS:FUNCTION:CAST |
2849 | private_RIPEMD160_Init 3291 NOEXIST::FUNCTION: | 2849 | private_RIPEMD160_Init 3291 EXIST:OPENSSL_FIPS:FUNCTION:RIPEMD |
2850 | private_RC5_32_set_key 3292 NOEXIST::FUNCTION: | 2850 | private_RC5_32_set_key 3292 NOEXIST::FUNCTION: |
2851 | private_MD5_Init 3293 NOEXIST::FUNCTION: | 2851 | private_MD5_Init 3293 EXIST:OPENSSL_FIPS:FUNCTION:MD5 |
2852 | private_RC4_set_key 3294 NOEXIST::FUNCTION: | 2852 | private_RC4_set_key 3294 EXIST::FUNCTION:RC4 |
2853 | private_MDC2_Init 3295 NOEXIST::FUNCTION: | 2853 | private_MDC2_Init 3295 EXIST:OPENSSL_FIPS:FUNCTION:MDC2 |
2854 | private_RC2_set_key 3296 NOEXIST::FUNCTION: | 2854 | private_RC2_set_key 3296 EXIST:OPENSSL_FIPS:FUNCTION:RC2 |
2855 | private_MD4_Init 3297 NOEXIST::FUNCTION: | 2855 | private_MD4_Init 3297 EXIST:OPENSSL_FIPS:FUNCTION:MD4 |
2856 | private_BF_set_key 3298 NOEXIST::FUNCTION: | 2856 | private_BF_set_key 3298 EXIST:OPENSSL_FIPS:FUNCTION:BF |
2857 | private_MD2_Init 3299 NOEXIST::FUNCTION: | 2857 | private_MD2_Init 3299 EXIST:OPENSSL_FIPS:FUNCTION:MD2 |
2858 | d2i_PROXY_CERT_INFO_EXTENSION 3300 EXIST::FUNCTION: | 2858 | d2i_PROXY_CERT_INFO_EXTENSION 3300 EXIST::FUNCTION: |
2859 | PROXY_POLICY_it 3301 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: | 2859 | PROXY_POLICY_it 3301 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: |
2860 | PROXY_POLICY_it 3301 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION: | 2860 | PROXY_POLICY_it 3301 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION: |
@@ -2882,7 +2882,7 @@ RSA_verify_PKCS1_PSS 3321 EXIST::FUNCTION:RSA | |||
2882 | RSA_padding_add_X931 3322 EXIST::FUNCTION:RSA | 2882 | RSA_padding_add_X931 3322 EXIST::FUNCTION:RSA |
2883 | RSA_padding_add_PKCS1_PSS 3323 EXIST::FUNCTION:RSA | 2883 | RSA_padding_add_PKCS1_PSS 3323 EXIST::FUNCTION:RSA |
2884 | PKCS1_MGF1 3324 EXIST::FUNCTION:RSA | 2884 | PKCS1_MGF1 3324 EXIST::FUNCTION:RSA |
2885 | BN_X931_generate_Xpq 3325 NOEXIST::FUNCTION: | 2885 | BN_X931_generate_Xpq 3325 EXIST::FUNCTION: |
2886 | RSA_X931_generate_key 3326 NOEXIST::FUNCTION: | 2886 | RSA_X931_generate_key 3326 NOEXIST::FUNCTION: |
2887 | BN_X931_derive_prime 3327 NOEXIST::FUNCTION: | 2887 | BN_X931_derive_prime 3327 NOEXIST::FUNCTION: |
2888 | BN_X931_generate_prime 3328 NOEXIST::FUNCTION: | 2888 | BN_X931_generate_prime 3328 NOEXIST::FUNCTION: |
@@ -2906,7 +2906,7 @@ STORE_parse_attrs_start 3343 NOEXIST::FUNCTION: | |||
2906 | POLICY_CONSTRAINTS_free 3344 EXIST::FUNCTION: | 2906 | POLICY_CONSTRAINTS_free 3344 EXIST::FUNCTION: |
2907 | EVP_PKEY_add1_attr_by_NID 3345 EXIST::FUNCTION: | 2907 | EVP_PKEY_add1_attr_by_NID 3345 EXIST::FUNCTION: |
2908 | BN_nist_mod_192 3346 EXIST::FUNCTION: | 2908 | BN_nist_mod_192 3346 EXIST::FUNCTION: |
2909 | EC_GROUP_get_trinomial_basis 3347 EXIST::FUNCTION:EC | 2909 | EC_GROUP_get_trinomial_basis 3347 EXIST::FUNCTION:EC,EC2M |
2910 | STORE_set_method 3348 NOEXIST::FUNCTION: | 2910 | STORE_set_method 3348 NOEXIST::FUNCTION: |
2911 | GENERAL_SUBTREE_free 3349 EXIST::FUNCTION: | 2911 | GENERAL_SUBTREE_free 3349 EXIST::FUNCTION: |
2912 | NAME_CONSTRAINTS_it 3350 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: | 2912 | NAME_CONSTRAINTS_it 3350 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: |
@@ -2921,14 +2921,14 @@ SHA512_Update 3356 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | |||
2921 | i2d_ECPrivateKey 3357 EXIST::FUNCTION:EC | 2921 | i2d_ECPrivateKey 3357 EXIST::FUNCTION:EC |
2922 | BN_get0_nist_prime_192 3358 EXIST::FUNCTION: | 2922 | BN_get0_nist_prime_192 3358 EXIST::FUNCTION: |
2923 | STORE_modify_certificate 3359 NOEXIST::FUNCTION: | 2923 | STORE_modify_certificate 3359 NOEXIST::FUNCTION: |
2924 | EC_POINT_set_affine_coordinates_GF2m 3360 EXIST:!VMS:FUNCTION:EC | 2924 | EC_POINT_set_affine_coordinates_GF2m 3360 EXIST:!VMS:FUNCTION:EC,EC2M |
2925 | EC_POINT_set_affine_coords_GF2m 3360 EXIST:VMS:FUNCTION:EC | 2925 | EC_POINT_set_affine_coords_GF2m 3360 EXIST:VMS:FUNCTION:EC,EC2M |
2926 | BN_GF2m_mod_exp_arr 3361 EXIST::FUNCTION: | 2926 | BN_GF2m_mod_exp_arr 3361 EXIST::FUNCTION:EC2M |
2927 | STORE_ATTR_INFO_modify_number 3362 NOEXIST::FUNCTION: | 2927 | STORE_ATTR_INFO_modify_number 3362 NOEXIST::FUNCTION: |
2928 | X509_keyid_get0 3363 EXIST::FUNCTION: | 2928 | X509_keyid_get0 3363 EXIST::FUNCTION: |
2929 | ENGINE_load_gmp 3364 EXIST::FUNCTION:ENGINE,GMP,STATIC_ENGINE | 2929 | ENGINE_load_gmp 3364 EXIST::FUNCTION:ENGINE,GMP,STATIC_ENGINE |
2930 | pitem_new 3365 EXIST::FUNCTION: | 2930 | pitem_new 3365 EXIST::FUNCTION: |
2931 | BN_GF2m_mod_mul_arr 3366 EXIST::FUNCTION: | 2931 | BN_GF2m_mod_mul_arr 3366 EXIST::FUNCTION:EC2M |
2932 | STORE_list_public_key_endp 3367 NOEXIST::FUNCTION: | 2932 | STORE_list_public_key_endp 3367 NOEXIST::FUNCTION: |
2933 | o2i_ECPublicKey 3368 EXIST::FUNCTION:EC | 2933 | o2i_ECPublicKey 3368 EXIST::FUNCTION:EC |
2934 | EC_KEY_copy 3369 EXIST::FUNCTION:EC | 2934 | EC_KEY_copy 3369 EXIST::FUNCTION:EC |
@@ -2945,7 +2945,7 @@ X509_VERIFY_PARAM_inherit 3378 EXIST::FUNCTION: | |||
2945 | EC_POINT_point2bn 3379 EXIST::FUNCTION:EC | 2945 | EC_POINT_point2bn 3379 EXIST::FUNCTION:EC |
2946 | STORE_ATTR_INFO_set_dn 3380 NOEXIST::FUNCTION: | 2946 | STORE_ATTR_INFO_set_dn 3380 NOEXIST::FUNCTION: |
2947 | X509_policy_tree_get0_policies 3381 EXIST::FUNCTION: | 2947 | X509_policy_tree_get0_policies 3381 EXIST::FUNCTION: |
2948 | EC_GROUP_new_curve_GF2m 3382 EXIST::FUNCTION:EC | 2948 | EC_GROUP_new_curve_GF2m 3382 EXIST::FUNCTION:EC,EC2M |
2949 | STORE_destroy_method 3383 NOEXIST::FUNCTION: | 2949 | STORE_destroy_method 3383 NOEXIST::FUNCTION: |
2950 | ENGINE_unregister_STORE 3384 EXIST::FUNCTION:ENGINE | 2950 | ENGINE_unregister_STORE 3384 EXIST::FUNCTION:ENGINE |
2951 | EVP_PKEY_get1_EC_KEY 3385 EXIST::FUNCTION:EC | 2951 | EVP_PKEY_get1_EC_KEY 3385 EXIST::FUNCTION:EC |
@@ -2961,7 +2961,7 @@ ENGINE_get_static_state 3393 EXIST::FUNCTION:ENGINE | |||
2961 | pqueue_iterator 3394 EXIST::FUNCTION: | 2961 | pqueue_iterator 3394 EXIST::FUNCTION: |
2962 | ECDSA_SIG_new 3395 EXIST::FUNCTION:ECDSA | 2962 | ECDSA_SIG_new 3395 EXIST::FUNCTION:ECDSA |
2963 | OPENSSL_DIR_end 3396 EXIST::FUNCTION: | 2963 | OPENSSL_DIR_end 3396 EXIST::FUNCTION: |
2964 | BN_GF2m_mod_sqr 3397 EXIST::FUNCTION: | 2964 | BN_GF2m_mod_sqr 3397 EXIST::FUNCTION:EC2M |
2965 | EC_POINT_bn2point 3398 EXIST::FUNCTION:EC | 2965 | EC_POINT_bn2point 3398 EXIST::FUNCTION:EC |
2966 | X509_VERIFY_PARAM_set_depth 3399 EXIST::FUNCTION: | 2966 | X509_VERIFY_PARAM_set_depth 3399 EXIST::FUNCTION: |
2967 | EC_KEY_set_asn1_flag 3400 EXIST::FUNCTION:EC | 2967 | EC_KEY_set_asn1_flag 3400 EXIST::FUNCTION:EC |
@@ -2974,7 +2974,7 @@ EC_GROUP_get_point_conv_form 3405 EXIST:VMS:FUNCTION:EC | |||
2974 | STORE_method_set_store_function 3406 NOEXIST::FUNCTION: | 2974 | STORE_method_set_store_function 3406 NOEXIST::FUNCTION: |
2975 | STORE_ATTR_INFO_in 3407 NOEXIST::FUNCTION: | 2975 | STORE_ATTR_INFO_in 3407 NOEXIST::FUNCTION: |
2976 | PEM_read_bio_ECPKParameters 3408 EXIST::FUNCTION:EC | 2976 | PEM_read_bio_ECPKParameters 3408 EXIST::FUNCTION:EC |
2977 | EC_GROUP_get_pentanomial_basis 3409 EXIST::FUNCTION:EC | 2977 | EC_GROUP_get_pentanomial_basis 3409 EXIST::FUNCTION:EC,EC2M |
2978 | EVP_PKEY_add1_attr_by_txt 3410 EXIST::FUNCTION: | 2978 | EVP_PKEY_add1_attr_by_txt 3410 EXIST::FUNCTION: |
2979 | BN_BLINDING_set_flags 3411 EXIST::FUNCTION: | 2979 | BN_BLINDING_set_flags 3411 EXIST::FUNCTION: |
2980 | X509_VERIFY_PARAM_set1_policies 3412 EXIST::FUNCTION: | 2980 | X509_VERIFY_PARAM_set1_policies 3412 EXIST::FUNCTION: |
@@ -2982,10 +2982,10 @@ X509_VERIFY_PARAM_set1_name 3413 EXIST::FUNCTION: | |||
2982 | X509_VERIFY_PARAM_set_purpose 3414 EXIST::FUNCTION: | 2982 | X509_VERIFY_PARAM_set_purpose 3414 EXIST::FUNCTION: |
2983 | STORE_get_number 3415 NOEXIST::FUNCTION: | 2983 | STORE_get_number 3415 NOEXIST::FUNCTION: |
2984 | ECDSA_sign_setup 3416 EXIST::FUNCTION:ECDSA | 2984 | ECDSA_sign_setup 3416 EXIST::FUNCTION:ECDSA |
2985 | BN_GF2m_mod_solve_quad_arr 3417 EXIST::FUNCTION: | 2985 | BN_GF2m_mod_solve_quad_arr 3417 EXIST::FUNCTION:EC2M |
2986 | EC_KEY_up_ref 3418 EXIST::FUNCTION:EC | 2986 | EC_KEY_up_ref 3418 EXIST::FUNCTION:EC |
2987 | POLICY_MAPPING_free 3419 EXIST::FUNCTION: | 2987 | POLICY_MAPPING_free 3419 EXIST::FUNCTION: |
2988 | BN_GF2m_mod_div 3420 EXIST::FUNCTION: | 2988 | BN_GF2m_mod_div 3420 EXIST::FUNCTION:EC2M |
2989 | X509_VERIFY_PARAM_set_flags 3421 EXIST::FUNCTION: | 2989 | X509_VERIFY_PARAM_set_flags 3421 EXIST::FUNCTION: |
2990 | EC_KEY_free 3422 EXIST::FUNCTION:EC | 2990 | EC_KEY_free 3422 EXIST::FUNCTION:EC |
2991 | STORE_meth_set_list_next_fn 3423 NOEXIST::FUNCTION: | 2991 | STORE_meth_set_list_next_fn 3423 NOEXIST::FUNCTION: |
@@ -2999,7 +2999,7 @@ STORE_method_set_list_end_function 3427 NOEXIST::FUNCTION: | |||
2999 | pqueue_print 3428 EXIST::FUNCTION: | 2999 | pqueue_print 3428 EXIST::FUNCTION: |
3000 | EC_GROUP_have_precompute_mult 3429 EXIST::FUNCTION:EC | 3000 | EC_GROUP_have_precompute_mult 3429 EXIST::FUNCTION:EC |
3001 | EC_KEY_print_fp 3430 EXIST::FUNCTION:EC,FP_API | 3001 | EC_KEY_print_fp 3430 EXIST::FUNCTION:EC,FP_API |
3002 | BN_GF2m_mod_arr 3431 EXIST::FUNCTION: | 3002 | BN_GF2m_mod_arr 3431 EXIST::FUNCTION:EC2M |
3003 | PEM_write_bio_X509_CERT_PAIR 3432 EXIST::FUNCTION: | 3003 | PEM_write_bio_X509_CERT_PAIR 3432 EXIST::FUNCTION: |
3004 | EVP_PKEY_cmp 3433 EXIST::FUNCTION: | 3004 | EVP_PKEY_cmp 3433 EXIST::FUNCTION: |
3005 | X509_policy_level_node_count 3434 EXIST::FUNCTION: | 3005 | X509_policy_level_node_count 3434 EXIST::FUNCTION: |
@@ -3020,7 +3020,7 @@ X509_policy_node_get0_qualifiers 3448 EXIST:!VMS:FUNCTION: | |||
3020 | X509_pcy_node_get0_qualifiers 3448 EXIST:VMS:FUNCTION: | 3020 | X509_pcy_node_get0_qualifiers 3448 EXIST:VMS:FUNCTION: |
3021 | STORE_list_crl_end 3449 NOEXIST::FUNCTION: | 3021 | STORE_list_crl_end 3449 NOEXIST::FUNCTION: |
3022 | EVP_PKEY_set1_EC_KEY 3450 EXIST::FUNCTION:EC | 3022 | EVP_PKEY_set1_EC_KEY 3450 EXIST::FUNCTION:EC |
3023 | BN_GF2m_mod_sqrt_arr 3451 EXIST::FUNCTION: | 3023 | BN_GF2m_mod_sqrt_arr 3451 EXIST::FUNCTION:EC2M |
3024 | i2d_ECPrivateKey_bio 3452 EXIST::FUNCTION:BIO,EC | 3024 | i2d_ECPrivateKey_bio 3452 EXIST::FUNCTION:BIO,EC |
3025 | ECPKParameters_print_fp 3453 EXIST::FUNCTION:EC,FP_API | 3025 | ECPKParameters_print_fp 3453 EXIST::FUNCTION:EC,FP_API |
3026 | pqueue_find 3454 EXIST::FUNCTION: | 3026 | pqueue_find 3454 EXIST::FUNCTION: |
@@ -3037,7 +3037,7 @@ PKCS12_add_safes 3464 EXIST::FUNCTION: | |||
3037 | BN_BLINDING_convert_ex 3465 EXIST::FUNCTION: | 3037 | BN_BLINDING_convert_ex 3465 EXIST::FUNCTION: |
3038 | X509_policy_tree_free 3466 EXIST::FUNCTION: | 3038 | X509_policy_tree_free 3466 EXIST::FUNCTION: |
3039 | OPENSSL_ia32cap_loc 3467 EXIST::FUNCTION: | 3039 | OPENSSL_ia32cap_loc 3467 EXIST::FUNCTION: |
3040 | BN_GF2m_poly2arr 3468 EXIST::FUNCTION: | 3040 | BN_GF2m_poly2arr 3468 EXIST::FUNCTION:EC2M |
3041 | STORE_ctrl 3469 NOEXIST::FUNCTION: | 3041 | STORE_ctrl 3469 NOEXIST::FUNCTION: |
3042 | STORE_ATTR_INFO_compare 3470 NOEXIST::FUNCTION: | 3042 | STORE_ATTR_INFO_compare 3470 NOEXIST::FUNCTION: |
3043 | BN_get0_nist_prime_224 3471 EXIST::FUNCTION: | 3043 | BN_get0_nist_prime_224 3471 EXIST::FUNCTION: |
@@ -3061,7 +3061,7 @@ STORE_method_set_delete_function 3486 NOEXIST::FUNCTION: | |||
3061 | STORE_list_certificate_next 3487 NOEXIST::FUNCTION: | 3061 | STORE_list_certificate_next 3487 NOEXIST::FUNCTION: |
3062 | ASN1_generate_nconf 3488 EXIST::FUNCTION: | 3062 | ASN1_generate_nconf 3488 EXIST::FUNCTION: |
3063 | BUF_memdup 3489 EXIST::FUNCTION: | 3063 | BUF_memdup 3489 EXIST::FUNCTION: |
3064 | BN_GF2m_mod_mul 3490 EXIST::FUNCTION: | 3064 | BN_GF2m_mod_mul 3490 EXIST::FUNCTION:EC2M |
3065 | STORE_meth_get_list_next_fn 3491 NOEXIST::FUNCTION: | 3065 | STORE_meth_get_list_next_fn 3491 NOEXIST::FUNCTION: |
3066 | STORE_method_get_list_next_function 3491 NOEXIST::FUNCTION: | 3066 | STORE_method_get_list_next_function 3491 NOEXIST::FUNCTION: |
3067 | STORE_ATTR_INFO_get0_dn 3492 NOEXIST::FUNCTION: | 3067 | STORE_ATTR_INFO_get0_dn 3492 NOEXIST::FUNCTION: |
@@ -3072,7 +3072,7 @@ STORE_ATTR_INFO_free 3496 NOEXIST::FUNCTION: | |||
3072 | STORE_get_private_key 3497 NOEXIST::FUNCTION: | 3072 | STORE_get_private_key 3497 NOEXIST::FUNCTION: |
3073 | EVP_PKEY_get_attr_count 3498 EXIST::FUNCTION: | 3073 | EVP_PKEY_get_attr_count 3498 EXIST::FUNCTION: |
3074 | STORE_ATTR_INFO_new 3499 NOEXIST::FUNCTION: | 3074 | STORE_ATTR_INFO_new 3499 NOEXIST::FUNCTION: |
3075 | EC_GROUP_get_curve_GF2m 3500 EXIST::FUNCTION:EC | 3075 | EC_GROUP_get_curve_GF2m 3500 EXIST::FUNCTION:EC,EC2M |
3076 | STORE_meth_set_revoke_fn 3501 NOEXIST::FUNCTION: | 3076 | STORE_meth_set_revoke_fn 3501 NOEXIST::FUNCTION: |
3077 | STORE_method_set_revoke_function 3501 NOEXIST::FUNCTION: | 3077 | STORE_method_set_revoke_function 3501 NOEXIST::FUNCTION: |
3078 | STORE_store_number 3502 NOEXIST::FUNCTION: | 3078 | STORE_store_number 3502 NOEXIST::FUNCTION: |
@@ -3088,7 +3088,7 @@ BIO_dump_indent_fp 3511 EXIST::FUNCTION:FP_API | |||
3088 | EC_KEY_set_group 3512 EXIST::FUNCTION:EC | 3088 | EC_KEY_set_group 3512 EXIST::FUNCTION:EC |
3089 | BUF_strndup 3513 EXIST::FUNCTION: | 3089 | BUF_strndup 3513 EXIST::FUNCTION: |
3090 | STORE_list_certificate_start 3514 NOEXIST::FUNCTION: | 3090 | STORE_list_certificate_start 3514 NOEXIST::FUNCTION: |
3091 | BN_GF2m_mod 3515 EXIST::FUNCTION: | 3091 | BN_GF2m_mod 3515 EXIST::FUNCTION:EC2M |
3092 | X509_REQ_check_private_key 3516 EXIST::FUNCTION: | 3092 | X509_REQ_check_private_key 3516 EXIST::FUNCTION: |
3093 | EC_GROUP_get_seed_len 3517 EXIST::FUNCTION:EC | 3093 | EC_GROUP_get_seed_len 3517 EXIST::FUNCTION:EC |
3094 | ERR_load_STORE_strings 3518 NOEXIST::FUNCTION: | 3094 | ERR_load_STORE_strings 3518 NOEXIST::FUNCTION: |
@@ -3117,19 +3117,19 @@ STORE_method_set_get_function 3536 NOEXIST::FUNCTION: | |||
3117 | STORE_modify_number 3537 NOEXIST::FUNCTION: | 3117 | STORE_modify_number 3537 NOEXIST::FUNCTION: |
3118 | STORE_method_get_store_function 3538 NOEXIST::FUNCTION: | 3118 | STORE_method_get_store_function 3538 NOEXIST::FUNCTION: |
3119 | STORE_store_private_key 3539 NOEXIST::FUNCTION: | 3119 | STORE_store_private_key 3539 NOEXIST::FUNCTION: |
3120 | BN_GF2m_mod_sqr_arr 3540 EXIST::FUNCTION: | 3120 | BN_GF2m_mod_sqr_arr 3540 EXIST::FUNCTION:EC2M |
3121 | RSA_setup_blinding 3541 EXIST::FUNCTION:RSA | 3121 | RSA_setup_blinding 3541 EXIST::FUNCTION:RSA |
3122 | BIO_s_datagram 3542 EXIST::FUNCTION:DGRAM | 3122 | BIO_s_datagram 3542 EXIST::FUNCTION:DGRAM |
3123 | STORE_Memory 3543 NOEXIST::FUNCTION: | 3123 | STORE_Memory 3543 NOEXIST::FUNCTION: |
3124 | sk_find_ex 3544 EXIST::FUNCTION: | 3124 | sk_find_ex 3544 EXIST::FUNCTION: |
3125 | EC_GROUP_set_curve_GF2m 3545 EXIST::FUNCTION:EC | 3125 | EC_GROUP_set_curve_GF2m 3545 EXIST::FUNCTION:EC,EC2M |
3126 | ENGINE_set_default_ECDSA 3546 EXIST::FUNCTION:ENGINE | 3126 | ENGINE_set_default_ECDSA 3546 EXIST::FUNCTION:ENGINE |
3127 | POLICY_CONSTRAINTS_new 3547 EXIST::FUNCTION: | 3127 | POLICY_CONSTRAINTS_new 3547 EXIST::FUNCTION: |
3128 | BN_GF2m_mod_sqrt 3548 EXIST::FUNCTION: | 3128 | BN_GF2m_mod_sqrt 3548 EXIST::FUNCTION:EC2M |
3129 | ECDH_set_default_method 3549 EXIST::FUNCTION:ECDH | 3129 | ECDH_set_default_method 3549 EXIST::FUNCTION:ECDH |
3130 | EC_KEY_generate_key 3550 EXIST::FUNCTION:EC | 3130 | EC_KEY_generate_key 3550 EXIST::FUNCTION:EC |
3131 | SHA384_Update 3551 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | 3131 | SHA384_Update 3551 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 |
3132 | BN_GF2m_arr2poly 3552 EXIST::FUNCTION: | 3132 | BN_GF2m_arr2poly 3552 EXIST::FUNCTION:EC2M |
3133 | STORE_method_get_get_function 3553 NOEXIST::FUNCTION: | 3133 | STORE_method_get_get_function 3553 NOEXIST::FUNCTION: |
3134 | STORE_meth_set_cleanup_fn 3554 NOEXIST::FUNCTION: | 3134 | STORE_meth_set_cleanup_fn 3554 NOEXIST::FUNCTION: |
3135 | STORE_method_set_cleanup_function 3554 NOEXIST::FUNCTION: | 3135 | STORE_method_set_cleanup_function 3554 NOEXIST::FUNCTION: |
@@ -3154,7 +3154,7 @@ EC_GROUP_get_degree 3570 EXIST::FUNCTION:EC | |||
3154 | ASN1_generate_v3 3571 EXIST::FUNCTION: | 3154 | ASN1_generate_v3 3571 EXIST::FUNCTION: |
3155 | STORE_ATTR_INFO_modify_cstr 3572 NOEXIST::FUNCTION: | 3155 | STORE_ATTR_INFO_modify_cstr 3572 NOEXIST::FUNCTION: |
3156 | X509_policy_tree_level_count 3573 EXIST::FUNCTION: | 3156 | X509_policy_tree_level_count 3573 EXIST::FUNCTION: |
3157 | BN_GF2m_add 3574 EXIST::FUNCTION: | 3157 | BN_GF2m_add 3574 EXIST::FUNCTION:EC2M |
3158 | EC_KEY_get0_group 3575 EXIST::FUNCTION:EC | 3158 | EC_KEY_get0_group 3575 EXIST::FUNCTION:EC |
3159 | STORE_generate_crl 3576 NOEXIST::FUNCTION: | 3159 | STORE_generate_crl 3576 NOEXIST::FUNCTION: |
3160 | STORE_store_public_key 3577 NOEXIST::FUNCTION: | 3160 | STORE_store_public_key 3577 NOEXIST::FUNCTION: |
@@ -3179,8 +3179,8 @@ STORE_store_certificate 3593 NOEXIST::FUNCTION: | |||
3179 | OBJ_bsearch_ex 3594 NOEXIST::FUNCTION: | 3179 | OBJ_bsearch_ex 3594 NOEXIST::FUNCTION: |
3180 | X509_STORE_CTX_set_default 3595 EXIST::FUNCTION: | 3180 | X509_STORE_CTX_set_default 3595 EXIST::FUNCTION: |
3181 | STORE_ATTR_INFO_set_sha1str 3596 NOEXIST::FUNCTION: | 3181 | STORE_ATTR_INFO_set_sha1str 3596 NOEXIST::FUNCTION: |
3182 | BN_GF2m_mod_inv 3597 EXIST::FUNCTION: | 3182 | BN_GF2m_mod_inv 3597 EXIST::FUNCTION:EC2M |
3183 | BN_GF2m_mod_exp 3598 EXIST::FUNCTION: | 3183 | BN_GF2m_mod_exp 3598 EXIST::FUNCTION:EC2M |
3184 | STORE_modify_public_key 3599 NOEXIST::FUNCTION: | 3184 | STORE_modify_public_key 3599 NOEXIST::FUNCTION: |
3185 | STORE_meth_get_list_start_fn 3600 NOEXIST::FUNCTION: | 3185 | STORE_meth_get_list_start_fn 3600 NOEXIST::FUNCTION: |
3186 | STORE_method_get_list_start_function 3600 NOEXIST::FUNCTION: | 3186 | STORE_method_get_list_start_function 3600 NOEXIST::FUNCTION: |
@@ -3188,7 +3188,7 @@ EC_GROUP_get0_seed 3601 EXIST::FUNCTION:EC | |||
3188 | STORE_store_arbitrary 3602 NOEXIST::FUNCTION: | 3188 | STORE_store_arbitrary 3602 NOEXIST::FUNCTION: |
3189 | STORE_meth_set_unlock_store_fn 3603 NOEXIST::FUNCTION: | 3189 | STORE_meth_set_unlock_store_fn 3603 NOEXIST::FUNCTION: |
3190 | STORE_method_set_unlock_store_function 3603 NOEXIST::FUNCTION: | 3190 | STORE_method_set_unlock_store_function 3603 NOEXIST::FUNCTION: |
3191 | BN_GF2m_mod_div_arr 3604 EXIST::FUNCTION: | 3191 | BN_GF2m_mod_div_arr 3604 EXIST::FUNCTION:EC2M |
3192 | ENGINE_set_ECDSA 3605 EXIST::FUNCTION:ENGINE | 3192 | ENGINE_set_ECDSA 3605 EXIST::FUNCTION:ENGINE |
3193 | STORE_create_method 3606 NOEXIST::FUNCTION: | 3193 | STORE_create_method 3606 NOEXIST::FUNCTION: |
3194 | ECPKParameters_print 3607 EXIST::FUNCTION:BIO,EC | 3194 | ECPKParameters_print 3607 EXIST::FUNCTION:BIO,EC |
@@ -3211,8 +3211,8 @@ EC_KEY_get_enc_flags 3622 EXIST::FUNCTION:EC | |||
3211 | ASN1_const_check_infinite_end 3623 EXIST::FUNCTION: | 3211 | ASN1_const_check_infinite_end 3623 EXIST::FUNCTION: |
3212 | EVP_PKEY_delete_attr 3624 EXIST::FUNCTION: | 3212 | EVP_PKEY_delete_attr 3624 EXIST::FUNCTION: |
3213 | ECDSA_set_default_method 3625 EXIST::FUNCTION:ECDSA | 3213 | ECDSA_set_default_method 3625 EXIST::FUNCTION:ECDSA |
3214 | EC_POINT_set_compressed_coordinates_GF2m 3626 EXIST:!VMS:FUNCTION:EC | 3214 | EC_POINT_set_compressed_coordinates_GF2m 3626 EXIST:!VMS:FUNCTION:EC,EC2M |
3215 | EC_POINT_set_compr_coords_GF2m 3626 EXIST:VMS:FUNCTION:EC | 3215 | EC_POINT_set_compr_coords_GF2m 3626 EXIST:VMS:FUNCTION:EC,EC2M |
3216 | EC_GROUP_cmp 3627 EXIST::FUNCTION:EC | 3216 | EC_GROUP_cmp 3627 EXIST::FUNCTION:EC |
3217 | STORE_revoke_certificate 3628 NOEXIST::FUNCTION: | 3217 | STORE_revoke_certificate 3628 NOEXIST::FUNCTION: |
3218 | BN_get0_nist_prime_256 3629 EXIST::FUNCTION: | 3218 | BN_get0_nist_prime_256 3629 EXIST::FUNCTION: |
@@ -3241,7 +3241,7 @@ POLICY_CONSTRAINTS_it 3649 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTI | |||
3241 | STORE_get_ex_new_index 3650 NOEXIST::FUNCTION: | 3241 | STORE_get_ex_new_index 3650 NOEXIST::FUNCTION: |
3242 | EVP_PKEY_get_attr_by_OBJ 3651 EXIST::FUNCTION: | 3242 | EVP_PKEY_get_attr_by_OBJ 3651 EXIST::FUNCTION: |
3243 | X509_VERIFY_PARAM_add0_policy 3652 EXIST::FUNCTION: | 3243 | X509_VERIFY_PARAM_add0_policy 3652 EXIST::FUNCTION: |
3244 | BN_GF2m_mod_solve_quad 3653 EXIST::FUNCTION: | 3244 | BN_GF2m_mod_solve_quad 3653 EXIST::FUNCTION:EC2M |
3245 | SHA256 3654 EXIST::FUNCTION:SHA,SHA256 | 3245 | SHA256 3654 EXIST::FUNCTION:SHA,SHA256 |
3246 | i2d_ECPrivateKey_fp 3655 EXIST::FUNCTION:EC,FP_API | 3246 | i2d_ECPrivateKey_fp 3655 EXIST::FUNCTION:EC,FP_API |
3247 | X509_policy_tree_get0_user_policies 3656 EXIST:!VMS:FUNCTION: | 3247 | X509_policy_tree_get0_user_policies 3656 EXIST:!VMS:FUNCTION: |
@@ -3249,8 +3249,8 @@ X509_pcy_tree_get0_usr_policies 3656 EXIST:VMS:FUNCTION: | |||
3249 | OPENSSL_DIR_read 3657 EXIST::FUNCTION: | 3249 | OPENSSL_DIR_read 3657 EXIST::FUNCTION: |
3250 | ENGINE_register_all_ECDSA 3658 EXIST::FUNCTION:ENGINE | 3250 | ENGINE_register_all_ECDSA 3658 EXIST::FUNCTION:ENGINE |
3251 | X509_VERIFY_PARAM_lookup 3659 EXIST::FUNCTION: | 3251 | X509_VERIFY_PARAM_lookup 3659 EXIST::FUNCTION: |
3252 | EC_POINT_get_affine_coordinates_GF2m 3660 EXIST:!VMS:FUNCTION:EC | 3252 | EC_POINT_get_affine_coordinates_GF2m 3660 EXIST:!VMS:FUNCTION:EC,EC2M |
3253 | EC_POINT_get_affine_coords_GF2m 3660 EXIST:VMS:FUNCTION:EC | 3253 | EC_POINT_get_affine_coords_GF2m 3660 EXIST:VMS:FUNCTION:EC,EC2M |
3254 | EC_GROUP_dup 3661 EXIST::FUNCTION:EC | 3254 | EC_GROUP_dup 3661 EXIST::FUNCTION:EC |
3255 | ENGINE_get_default_ECDSA 3662 EXIST::FUNCTION:ENGINE | 3255 | ENGINE_get_default_ECDSA 3662 EXIST::FUNCTION:ENGINE |
3256 | EC_KEY_new 3663 EXIST::FUNCTION:EC | 3256 | EC_KEY_new 3663 EXIST::FUNCTION:EC |
@@ -3332,7 +3332,7 @@ STORE_list_certificate_end 3734 NOEXIST::FUNCTION: | |||
3332 | STORE_get_crl 3735 NOEXIST::FUNCTION: | 3332 | STORE_get_crl 3735 NOEXIST::FUNCTION: |
3333 | X509_POLICY_NODE_print 3736 EXIST::FUNCTION: | 3333 | X509_POLICY_NODE_print 3736 EXIST::FUNCTION: |
3334 | SHA384_Init 3737 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | 3334 | SHA384_Init 3737 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 |
3335 | EC_GF2m_simple_method 3738 EXIST::FUNCTION:EC | 3335 | EC_GF2m_simple_method 3738 EXIST::FUNCTION:EC,EC2M |
3336 | ECDSA_set_ex_data 3739 EXIST::FUNCTION:ECDSA | 3336 | ECDSA_set_ex_data 3739 EXIST::FUNCTION:ECDSA |
3337 | SHA384_Final 3740 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | 3337 | SHA384_Final 3740 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 |
3338 | PKCS7_set_digest 3741 EXIST::FUNCTION: | 3338 | PKCS7_set_digest 3741 EXIST::FUNCTION: |
@@ -3364,7 +3364,7 @@ BIO_dump_cb 3764 EXIST::FUNCTION: | |||
3364 | SHA256_Update 3765 EXIST::FUNCTION:SHA,SHA256 | 3364 | SHA256_Update 3765 EXIST::FUNCTION:SHA,SHA256 |
3365 | pqueue_insert 3766 EXIST::FUNCTION: | 3365 | pqueue_insert 3766 EXIST::FUNCTION: |
3366 | pitem_free 3767 EXIST::FUNCTION: | 3366 | pitem_free 3767 EXIST::FUNCTION: |
3367 | BN_GF2m_mod_inv_arr 3768 EXIST::FUNCTION: | 3367 | BN_GF2m_mod_inv_arr 3768 EXIST::FUNCTION:EC2M |
3368 | ENGINE_unregister_ECDSA 3769 EXIST::FUNCTION:ENGINE | 3368 | ENGINE_unregister_ECDSA 3769 EXIST::FUNCTION:ENGINE |
3369 | BN_BLINDING_set_thread_id 3770 EXIST::FUNCTION:DEPRECATED | 3369 | BN_BLINDING_set_thread_id 3770 EXIST::FUNCTION:DEPRECATED |
3370 | get_rfc3526_prime_8192 3771 EXIST::FUNCTION: | 3370 | get_rfc3526_prime_8192 3771 EXIST::FUNCTION: |
@@ -3670,7 +3670,7 @@ int_EVP_MD_set_engine_callbacks 4056 NOEXIST::FUNCTION: | |||
3670 | int_CRYPTO_set_do_dynlock_callback 4057 NOEXIST::FUNCTION: | 3670 | int_CRYPTO_set_do_dynlock_callback 4057 NOEXIST::FUNCTION: |
3671 | FIPS_rng_stick 4058 NOEXIST::FUNCTION: | 3671 | FIPS_rng_stick 4058 NOEXIST::FUNCTION: |
3672 | EVP_CIPHER_CTX_set_flags 4059 EXIST::FUNCTION: | 3672 | EVP_CIPHER_CTX_set_flags 4059 EXIST::FUNCTION: |
3673 | BN_X931_generate_prime_ex 4060 NOEXIST::FUNCTION: | 3673 | BN_X931_generate_prime_ex 4060 EXIST::FUNCTION: |
3674 | FIPS_selftest_check 4061 NOEXIST::FUNCTION: | 3674 | FIPS_selftest_check 4061 NOEXIST::FUNCTION: |
3675 | FIPS_rand_set_dt 4062 NOEXIST::FUNCTION: | 3675 | FIPS_rand_set_dt 4062 NOEXIST::FUNCTION: |
3676 | CRYPTO_dbg_pop_info 4063 NOEXIST::FUNCTION: | 3676 | CRYPTO_dbg_pop_info 4063 NOEXIST::FUNCTION: |
@@ -3695,14 +3695,14 @@ FIPS_rand_test_mode 4081 NOEXIST::FUNCTION: | |||
3695 | FIPS_rand_reset 4082 NOEXIST::FUNCTION: | 3695 | FIPS_rand_reset 4082 NOEXIST::FUNCTION: |
3696 | FIPS_dsa_new 4083 NOEXIST::FUNCTION: | 3696 | FIPS_dsa_new 4083 NOEXIST::FUNCTION: |
3697 | int_RAND_set_callbacks 4084 NOEXIST::FUNCTION: | 3697 | int_RAND_set_callbacks 4084 NOEXIST::FUNCTION: |
3698 | BN_X931_derive_prime_ex 4085 NOEXIST::FUNCTION: | 3698 | BN_X931_derive_prime_ex 4085 EXIST::FUNCTION: |
3699 | int_ERR_lib_init 4086 NOEXIST::FUNCTION: | 3699 | int_ERR_lib_init 4086 NOEXIST::FUNCTION: |
3700 | int_EVP_CIPHER_init_engine_callbacks 4087 NOEXIST::FUNCTION: | 3700 | int_EVP_CIPHER_init_engine_callbacks 4087 NOEXIST::FUNCTION: |
3701 | FIPS_rsa_free 4088 NOEXIST::FUNCTION: | 3701 | FIPS_rsa_free 4088 NOEXIST::FUNCTION: |
3702 | FIPS_dsa_sig_encode 4089 NOEXIST::FUNCTION: | 3702 | FIPS_dsa_sig_encode 4089 NOEXIST::FUNCTION: |
3703 | CRYPTO_dbg_remove_all_info 4090 NOEXIST::FUNCTION: | 3703 | CRYPTO_dbg_remove_all_info 4090 NOEXIST::FUNCTION: |
3704 | OPENSSL_init 4091 NOEXIST::FUNCTION: | 3704 | OPENSSL_init 4091 EXIST::FUNCTION: |
3705 | private_Camellia_set_key 4092 NOEXIST::FUNCTION: | 3705 | private_Camellia_set_key 4092 EXIST:OPENSSL_FIPS:FUNCTION:CAMELLIA |
3706 | CRYPTO_strdup 4093 EXIST::FUNCTION: | 3706 | CRYPTO_strdup 4093 EXIST::FUNCTION: |
3707 | JPAKE_STEP3A_process 4094 EXIST::FUNCTION:JPAKE | 3707 | JPAKE_STEP3A_process 4094 EXIST::FUNCTION:JPAKE |
3708 | JPAKE_STEP1_release 4095 EXIST::FUNCTION:JPAKE | 3708 | JPAKE_STEP1_release 4095 EXIST::FUNCTION:JPAKE |
@@ -4194,3 +4194,119 @@ OPENSSL_memcmp 4565 EXIST::FUNCTION: | |||
4194 | OPENSSL_strncasecmp 4566 EXIST::FUNCTION: | 4194 | OPENSSL_strncasecmp 4566 EXIST::FUNCTION: |
4195 | OPENSSL_gmtime 4567 EXIST::FUNCTION: | 4195 | OPENSSL_gmtime 4567 EXIST::FUNCTION: |
4196 | OPENSSL_gmtime_adj 4568 EXIST::FUNCTION: | 4196 | OPENSSL_gmtime_adj 4568 EXIST::FUNCTION: |
4197 | SRP_VBASE_get_by_user 4569 EXIST::FUNCTION:SRP | ||
4198 | SRP_Calc_server_key 4570 EXIST::FUNCTION:SRP | ||
4199 | SRP_create_verifier 4571 EXIST::FUNCTION:SRP | ||
4200 | SRP_create_verifier_BN 4572 EXIST::FUNCTION:SRP | ||
4201 | SRP_Calc_u 4573 EXIST::FUNCTION:SRP | ||
4202 | SRP_VBASE_free 4574 EXIST::FUNCTION:SRP | ||
4203 | SRP_Calc_client_key 4575 EXIST::FUNCTION:SRP | ||
4204 | SRP_get_default_gN 4576 EXIST::FUNCTION:SRP | ||
4205 | SRP_Calc_x 4577 EXIST::FUNCTION:SRP | ||
4206 | SRP_Calc_B 4578 EXIST::FUNCTION:SRP | ||
4207 | SRP_VBASE_new 4579 EXIST::FUNCTION:SRP | ||
4208 | SRP_check_known_gN_param 4580 EXIST::FUNCTION:SRP | ||
4209 | SRP_Calc_A 4581 EXIST::FUNCTION:SRP | ||
4210 | SRP_Verify_A_mod_N 4582 EXIST::FUNCTION:SRP | ||
4211 | SRP_VBASE_init 4583 EXIST::FUNCTION:SRP | ||
4212 | SRP_Verify_B_mod_N 4584 EXIST::FUNCTION:SRP | ||
4213 | EC_KEY_set_public_key_affine_coordinates 4585 EXIST:!VMS:FUNCTION:EC | ||
4214 | EC_KEY_set_pub_key_aff_coords 4585 EXIST:VMS:FUNCTION:EC | ||
4215 | EVP_aes_192_ctr 4586 EXIST::FUNCTION:AES | ||
4216 | EVP_PKEY_meth_get0_info 4587 EXIST::FUNCTION: | ||
4217 | EVP_PKEY_meth_copy 4588 EXIST::FUNCTION: | ||
4218 | ERR_add_error_vdata 4589 EXIST::FUNCTION: | ||
4219 | EVP_aes_128_ctr 4590 EXIST::FUNCTION:AES | ||
4220 | EVP_aes_256_ctr 4591 EXIST::FUNCTION:AES | ||
4221 | EC_GFp_nistp224_method 4592 EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128 | ||
4222 | EC_KEY_get_flags 4593 EXIST::FUNCTION:EC | ||
4223 | RSA_padding_add_PKCS1_PSS_mgf1 4594 EXIST::FUNCTION:RSA | ||
4224 | EVP_aes_128_xts 4595 EXIST::FUNCTION:AES | ||
4225 | private_SHA224_Init 4596 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA256 | ||
4226 | private_AES_set_decrypt_key 4597 EXIST::FUNCTION:AES | ||
4227 | private_WHIRLPOOL_Init 4598 EXIST:OPENSSL_FIPS:FUNCTION:WHIRLPOOL | ||
4228 | EVP_aes_256_xts 4599 EXIST::FUNCTION:AES | ||
4229 | private_SHA512_Init 4600 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA512 | ||
4230 | EVP_aes_128_gcm 4601 EXIST::FUNCTION:AES | ||
4231 | EC_KEY_clear_flags 4602 EXIST::FUNCTION:EC | ||
4232 | EC_KEY_set_flags 4603 EXIST::FUNCTION:EC | ||
4233 | private_DES_set_key_unchecked 4604 EXIST:OPENSSL_FIPS:FUNCTION:DES | ||
4234 | EVP_aes_256_ccm 4605 EXIST::FUNCTION:AES | ||
4235 | private_AES_set_encrypt_key 4606 EXIST::FUNCTION:AES | ||
4236 | RSA_verify_PKCS1_PSS_mgf1 4607 EXIST::FUNCTION:RSA | ||
4237 | private_SHA1_Init 4608 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA1 | ||
4238 | EVP_aes_128_ccm 4609 EXIST::FUNCTION:AES | ||
4239 | private_SEED_set_key 4610 EXIST:OPENSSL_FIPS:FUNCTION:SEED | ||
4240 | EVP_aes_192_gcm 4611 EXIST::FUNCTION:AES | ||
4241 | X509_ALGOR_set_md 4612 EXIST::FUNCTION: | ||
4242 | private_SHA256_Init 4613 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA256 | ||
4243 | RAND_init_fips 4614 EXIST:OPENSSL_FIPS:FUNCTION: | ||
4244 | EVP_aes_256_gcm 4615 EXIST::FUNCTION:AES | ||
4245 | private_SHA384_Init 4616 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA512 | ||
4246 | EVP_aes_192_ccm 4617 EXIST::FUNCTION:AES | ||
4247 | CMAC_CTX_copy 4618 EXIST::FUNCTION: | ||
4248 | CMAC_CTX_free 4619 EXIST::FUNCTION: | ||
4249 | CMAC_CTX_get0_cipher_ctx 4620 EXIST::FUNCTION: | ||
4250 | CMAC_CTX_cleanup 4621 EXIST::FUNCTION: | ||
4251 | CMAC_Init 4622 EXIST::FUNCTION: | ||
4252 | CMAC_Update 4623 EXIST::FUNCTION: | ||
4253 | CMAC_resume 4624 EXIST::FUNCTION: | ||
4254 | CMAC_CTX_new 4625 EXIST::FUNCTION: | ||
4255 | CMAC_Final 4626 EXIST::FUNCTION: | ||
4256 | CRYPTO_ctr128_encrypt_ctr32 4627 EXIST::FUNCTION: | ||
4257 | CRYPTO_gcm128_release 4628 EXIST::FUNCTION: | ||
4258 | CRYPTO_ccm128_decrypt_ccm64 4629 EXIST::FUNCTION: | ||
4259 | CRYPTO_ccm128_encrypt 4630 EXIST::FUNCTION: | ||
4260 | CRYPTO_gcm128_encrypt 4631 EXIST::FUNCTION: | ||
4261 | CRYPTO_xts128_encrypt 4632 EXIST::FUNCTION: | ||
4262 | EVP_rc4_hmac_md5 4633 EXIST::FUNCTION:MD5,RC4 | ||
4263 | CRYPTO_nistcts128_decrypt_block 4634 EXIST::FUNCTION: | ||
4264 | CRYPTO_gcm128_setiv 4635 EXIST::FUNCTION: | ||
4265 | CRYPTO_nistcts128_encrypt 4636 EXIST::FUNCTION: | ||
4266 | EVP_aes_128_cbc_hmac_sha1 4637 EXIST::FUNCTION:AES,SHA,SHA1 | ||
4267 | CRYPTO_gcm128_tag 4638 EXIST::FUNCTION: | ||
4268 | CRYPTO_ccm128_encrypt_ccm64 4639 EXIST::FUNCTION: | ||
4269 | ENGINE_load_rdrand 4640 EXIST::FUNCTION:ENGINE | ||
4270 | CRYPTO_ccm128_setiv 4641 EXIST::FUNCTION: | ||
4271 | CRYPTO_nistcts128_encrypt_block 4642 EXIST::FUNCTION: | ||
4272 | CRYPTO_gcm128_aad 4643 EXIST::FUNCTION: | ||
4273 | CRYPTO_ccm128_init 4644 EXIST::FUNCTION: | ||
4274 | CRYPTO_nistcts128_decrypt 4645 EXIST::FUNCTION: | ||
4275 | CRYPTO_gcm128_new 4646 EXIST::FUNCTION: | ||
4276 | CRYPTO_ccm128_tag 4647 EXIST::FUNCTION: | ||
4277 | CRYPTO_ccm128_decrypt 4648 EXIST::FUNCTION: | ||
4278 | CRYPTO_ccm128_aad 4649 EXIST::FUNCTION: | ||
4279 | CRYPTO_gcm128_init 4650 EXIST::FUNCTION: | ||
4280 | CRYPTO_gcm128_decrypt 4651 EXIST::FUNCTION: | ||
4281 | ENGINE_load_rsax 4652 EXIST::FUNCTION:ENGINE | ||
4282 | CRYPTO_gcm128_decrypt_ctr32 4653 EXIST::FUNCTION: | ||
4283 | CRYPTO_gcm128_encrypt_ctr32 4654 EXIST::FUNCTION: | ||
4284 | CRYPTO_gcm128_finish 4655 EXIST::FUNCTION: | ||
4285 | EVP_aes_256_cbc_hmac_sha1 4656 EXIST::FUNCTION:AES,SHA,SHA1 | ||
4286 | PKCS5_pbkdf2_set 4657 EXIST::FUNCTION: | ||
4287 | CMS_add0_recipient_password 4658 EXIST::FUNCTION:CMS | ||
4288 | CMS_decrypt_set1_password 4659 EXIST::FUNCTION:CMS | ||
4289 | CMS_RecipientInfo_set0_password 4660 EXIST::FUNCTION:CMS | ||
4290 | RAND_set_fips_drbg_type 4661 EXIST:OPENSSL_FIPS:FUNCTION: | ||
4291 | X509_REQ_sign_ctx 4662 EXIST::FUNCTION:EVP | ||
4292 | RSA_PSS_PARAMS_new 4663 EXIST::FUNCTION:RSA | ||
4293 | X509_CRL_sign_ctx 4664 EXIST::FUNCTION:EVP | ||
4294 | X509_signature_dump 4665 EXIST::FUNCTION:EVP | ||
4295 | d2i_RSA_PSS_PARAMS 4666 EXIST::FUNCTION:RSA | ||
4296 | RSA_PSS_PARAMS_it 4667 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:RSA | ||
4297 | RSA_PSS_PARAMS_it 4667 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:RSA | ||
4298 | RSA_PSS_PARAMS_free 4668 EXIST::FUNCTION:RSA | ||
4299 | X509_sign_ctx 4669 EXIST::FUNCTION:EVP | ||
4300 | i2d_RSA_PSS_PARAMS 4670 EXIST::FUNCTION:RSA | ||
4301 | ASN1_item_sign_ctx 4671 EXIST::FUNCTION:EVP | ||
4302 | EC_GFp_nistp521_method 4672 EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128 | ||
4303 | EC_GFp_nistp256_method 4673 EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128 | ||
4304 | OPENSSL_stderr 4674 EXIST::FUNCTION: | ||
4305 | OPENSSL_cpuid_setup 4675 EXIST::FUNCTION: | ||
4306 | OPENSSL_showfatal 4676 EXIST::FUNCTION: | ||
4307 | BIO_new_dgram_sctp 4677 EXIST::FUNCTION:SCTP | ||
4308 | BIO_dgram_sctp_msg_waiting 4678 EXIST::FUNCTION:SCTP | ||
4309 | BIO_dgram_sctp_wait_for_dry 4679 EXIST::FUNCTION:SCTP | ||
4310 | BIO_s_datagram_sctp 4680 EXIST::FUNCTION:DGRAM,SCTP | ||
4311 | BIO_dgram_is_sctp 4681 EXIST::FUNCTION:SCTP | ||
4312 | BIO_dgram_sctp_notification_cb 4682 EXIST::FUNCTION:SCTP | ||
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl index afe8c7326d..72fa089f6b 100644 --- a/src/lib/libcrypto/util/mk1mf.pl +++ b/src/lib/libcrypto/util/mk1mf.pl | |||
@@ -18,6 +18,8 @@ local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic | |||
18 | local $zlib_lib = ""; | 18 | local $zlib_lib = ""; |
19 | local $perl_asm = 0; # 1 to autobuild asm files from perl scripts | 19 | local $perl_asm = 0; # 1 to autobuild asm files from perl scripts |
20 | 20 | ||
21 | my $ex_l_libs = ""; | ||
22 | |||
21 | # Options to import from top level Makefile | 23 | # Options to import from top level Makefile |
22 | 24 | ||
23 | my %mf_import = ( | 25 | my %mf_import = ( |
@@ -40,7 +42,9 @@ my %mf_import = ( | |||
40 | SHA1_ASM_OBJ => \$mf_sha_asm, | 42 | SHA1_ASM_OBJ => \$mf_sha_asm, |
41 | RMD160_ASM_OBJ => \$mf_rmd_asm, | 43 | RMD160_ASM_OBJ => \$mf_rmd_asm, |
42 | WP_ASM_OBJ => \$mf_wp_asm, | 44 | WP_ASM_OBJ => \$mf_wp_asm, |
43 | CMLL_ENC => \$mf_cm_asm | 45 | CMLL_ENC => \$mf_cm_asm, |
46 | BASEADDR => \$baseaddr, | ||
47 | FIPSDIR => \$fipsdir, | ||
44 | ); | 48 | ); |
45 | 49 | ||
46 | 50 | ||
@@ -104,6 +108,7 @@ and [options] can be one of | |||
104 | just-ssl - remove all non-ssl keys/digest | 108 | just-ssl - remove all non-ssl keys/digest |
105 | no-asm - No x86 asm | 109 | no-asm - No x86 asm |
106 | no-krb5 - No KRB5 | 110 | no-krb5 - No KRB5 |
111 | no-srp - No SRP | ||
107 | no-ec - No EC | 112 | no-ec - No EC |
108 | no-ecdsa - No ECDSA | 113 | no-ecdsa - No ECDSA |
109 | no-ecdh - No ECDH | 114 | no-ecdh - No ECDH |
@@ -228,6 +233,8 @@ else | |||
228 | $cflags.=' -DTERMIO'; | 233 | $cflags.=' -DTERMIO'; |
229 | } | 234 | } |
230 | 235 | ||
236 | $fipsdir =~ s/\//${o}/g; | ||
237 | |||
231 | $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":""); | 238 | $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":""); |
232 | $tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":""); | 239 | $tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":""); |
233 | $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def; | 240 | $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def; |
@@ -261,6 +268,7 @@ $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock; | |||
261 | $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; | 268 | $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; |
262 | $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; | 269 | $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; |
263 | $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; | 270 | $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; |
271 | $cflags.=" -DOPENSSL_NO_SRP" if $no_srp; | ||
264 | $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; | 272 | $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; |
265 | $cflags.=" -DOPENSSL_NO_ERR" if $no_err; | 273 | $cflags.=" -DOPENSSL_NO_ERR" if $no_err; |
266 | $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; | 274 | $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; |
@@ -270,7 +278,9 @@ $cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; | |||
270 | $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; | 278 | $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; |
271 | $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; | 279 | $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; |
272 | $cflags.=" -DOPENSSL_NO_HW" if $no_hw; | 280 | $cflags.=" -DOPENSSL_NO_HW" if $no_hw; |
281 | $cflags.=" -DOPENSSL_FIPS" if $fips; | ||
273 | $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; | 282 | $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; |
283 | $cflags.=" -DOPENSSL_NO_EC2M" if $no_ec2m; | ||
274 | $cflags.= " -DZLIB" if $zlib_opt; | 284 | $cflags.= " -DZLIB" if $zlib_opt; |
275 | $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; | 285 | $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; |
276 | 286 | ||
@@ -404,6 +414,11 @@ else | |||
404 | \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\" | 414 | \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\" |
405 | EOF | 415 | EOF |
406 | $ex_libs .= " $zlib_lib" if $zlib_opt == 1; | 416 | $ex_libs .= " $zlib_lib" if $zlib_opt == 1; |
417 | if ($fips) | ||
418 | { | ||
419 | $build_targets .= " \$(LIB_D)$o$crypto_compat \$(PREMAIN_DSO_EXE)"; | ||
420 | $ex_l_libs .= " \$(O_FIPSCANISTER)"; | ||
421 | } | ||
407 | } | 422 | } |
408 | 423 | ||
409 | $defs= <<"EOF"; | 424 | $defs= <<"EOF"; |
@@ -465,6 +480,18 @@ MKLIB=$bin_dir$mklib | |||
465 | MLFLAGS=$mlflags | 480 | MLFLAGS=$mlflags |
466 | ASM=$bin_dir$asm | 481 | ASM=$bin_dir$asm |
467 | 482 | ||
483 | # FIPS validated module and support file locations | ||
484 | |||
485 | FIPSDIR=$fipsdir | ||
486 | BASEADDR=$baseaddr | ||
487 | FIPSLIB_D=\$(FIPSDIR)${o}lib | ||
488 | FIPS_PREMAIN_SRC=\$(FIPSLIB_D)${o}fips_premain.c | ||
489 | O_FIPSCANISTER=\$(FIPSLIB_D)${o}fipscanister.lib | ||
490 | FIPS_SHA1_EXE=\$(FIPSDIR)${o}bin${o}fips_standalone_sha1${exep} | ||
491 | E_PREMAIN_DSO=fips_premain_dso | ||
492 | PREMAIN_DSO_EXE=\$(BIN_D)${o}fips_premain_dso$exep | ||
493 | FIPSLINK=\$(PERL) \$(FIPSDIR)${o}bin${o}fipslink.pl | ||
494 | |||
468 | ###################################################### | 495 | ###################################################### |
469 | # You should not need to touch anything below this point | 496 | # You should not need to touch anything below this point |
470 | ###################################################### | 497 | ###################################################### |
@@ -497,7 +524,7 @@ SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp | |||
497 | L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp | 524 | L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp |
498 | L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp | 525 | L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp |
499 | 526 | ||
500 | L_LIBS= \$(L_SSL) \$(L_CRYPTO) | 527 | L_LIBS= \$(L_SSL) \$(L_CRYPTO) $ex_l_libs |
501 | 528 | ||
502 | ###################################################### | 529 | ###################################################### |
503 | # Don't touch anything below this point | 530 | # Don't touch anything below this point |
@@ -513,7 +540,7 @@ LIBS_DEP=\$(O_CRYPTO) \$(O_SSL) | |||
513 | EOF | 540 | EOF |
514 | 541 | ||
515 | $rules=<<"EOF"; | 542 | $rules=<<"EOF"; |
516 | all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe | 543 | all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe $build_targets |
517 | 544 | ||
518 | banner: | 545 | banner: |
519 | $banner | 546 | $banner |
@@ -629,6 +656,16 @@ $rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)"); | |||
629 | $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); | 656 | $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); |
630 | $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); | 657 | $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); |
631 | 658 | ||
659 | # Special case rule for fips_premain_dso | ||
660 | |||
661 | if ($fips) | ||
662 | { | ||
663 | $rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj", | ||
664 | "\$(FIPS_PREMAIN_SRC)", | ||
665 | "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(SHLIB_CFLAGS)", ""); | ||
666 | $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1); | ||
667 | } | ||
668 | |||
632 | foreach (values %lib_nam) | 669 | foreach (values %lib_nam) |
633 | { | 670 | { |
634 | $lib_obj=$lib_obj{$_}; | 671 | $lib_obj=$lib_obj{$_}; |
@@ -677,7 +714,28 @@ foreach (split(/\s+/,$engines)) | |||
677 | 714 | ||
678 | 715 | ||
679 | $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); | 716 | $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); |
680 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)"); | 717 | |
718 | if ($fips) | ||
719 | { | ||
720 | if ($shlib) | ||
721 | { | ||
722 | $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)", | ||
723 | "\$(O_CRYPTO)", "$crypto", | ||
724 | $shlib, "\$(SO_CRYPTO)", "\$(BASEADDR)"); | ||
725 | } | ||
726 | else | ||
727 | { | ||
728 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)", | ||
729 | "\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)", ""); | ||
730 | $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)", | ||
731 | "\$(LIB_D)$o$crypto_compat",$crypto,$shlib,"\$(SO_CRYPTO)", ""); | ||
732 | } | ||
733 | } | ||
734 | else | ||
735 | { | ||
736 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib, | ||
737 | "\$(SO_CRYPTO)"); | ||
738 | } | ||
681 | 739 | ||
682 | foreach (split(" ",$otherlibs)) | 740 | foreach (split(" ",$otherlibs)) |
683 | { | 741 | { |
@@ -687,7 +745,7 @@ foreach (split(" ",$otherlibs)) | |||
687 | 745 | ||
688 | } | 746 | } |
689 | 747 | ||
690 | $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); | 748 | $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0); |
691 | 749 | ||
692 | print $defs; | 750 | print $defs; |
693 | 751 | ||
@@ -781,6 +839,8 @@ sub var_add | |||
781 | @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1; | 839 | @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1; |
782 | @a=grep(!/_mdc2$/,@a) if $no_mdc2; | 840 | @a=grep(!/_mdc2$/,@a) if $no_mdc2; |
783 | 841 | ||
842 | @a=grep(!/(srp)/,@a) if $no_srp; | ||
843 | |||
784 | @a=grep(!/^engine$/,@a) if $no_engine; | 844 | @a=grep(!/^engine$/,@a) if $no_engine; |
785 | @a=grep(!/^hw$/,@a) if $no_hw; | 845 | @a=grep(!/^hw$/,@a) if $no_hw; |
786 | @a=grep(!/(^rsa$)|(^genrsa$)/,@a) if $no_rsa; | 846 | @a=grep(!/(^rsa$)|(^genrsa$)/,@a) if $no_rsa; |
@@ -939,14 +999,15 @@ sub Sasm_compile_target | |||
939 | 999 | ||
940 | sub cc_compile_target | 1000 | sub cc_compile_target |
941 | { | 1001 | { |
942 | local($target,$source,$ex_flags)=@_; | 1002 | local($target,$source,$ex_flags, $srcd)=@_; |
943 | local($ret); | 1003 | local($ret); |
944 | 1004 | ||
945 | $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/); | 1005 | $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/); |
946 | $target =~ s/\//$o/g if $o ne "/"; | 1006 | $target =~ s/\//$o/g if $o ne "/"; |
947 | $source =~ s/\//$o/g if $o ne "/"; | 1007 | $source =~ s/\//$o/g if $o ne "/"; |
948 | $ret ="$target: \$(SRC_D)$o$source\n\t"; | 1008 | $srcd = "\$(SRC_D)$o" unless defined $srcd; |
949 | $ret.="\$(CC) ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n"; | 1009 | $ret ="$target: $srcd$source\n\t"; |
1010 | $ret.="\$(CC) ${ofile}$target $ex_flags -c $srcd$source\n\n"; | ||
950 | return($ret); | 1011 | return($ret); |
951 | } | 1012 | } |
952 | 1013 | ||
@@ -1056,8 +1117,11 @@ sub read_options | |||
1056 | "no-ssl2" => \$no_ssl2, | 1117 | "no-ssl2" => \$no_ssl2, |
1057 | "no-ssl3" => \$no_ssl3, | 1118 | "no-ssl3" => \$no_ssl3, |
1058 | "no-tlsext" => \$no_tlsext, | 1119 | "no-tlsext" => \$no_tlsext, |
1120 | "no-srp" => \$no_srp, | ||
1059 | "no-cms" => \$no_cms, | 1121 | "no-cms" => \$no_cms, |
1122 | "no-ec2m" => \$no_ec2m, | ||
1060 | "no-jpake" => \$no_jpake, | 1123 | "no-jpake" => \$no_jpake, |
1124 | "no-ec_nistp_64_gcc_128" => 0, | ||
1061 | "no-err" => \$no_err, | 1125 | "no-err" => \$no_err, |
1062 | "no-sock" => \$no_sock, | 1126 | "no-sock" => \$no_sock, |
1063 | "no-krb5" => \$no_krb5, | 1127 | "no-krb5" => \$no_krb5, |
@@ -1067,11 +1131,12 @@ sub read_options | |||
1067 | "no-gost" => \$no_gost, | 1131 | "no-gost" => \$no_gost, |
1068 | "no-engine" => \$no_engine, | 1132 | "no-engine" => \$no_engine, |
1069 | "no-hw" => \$no_hw, | 1133 | "no-hw" => \$no_hw, |
1134 | "no-rsax" => 0, | ||
1070 | "just-ssl" => | 1135 | "just-ssl" => |
1071 | [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, | 1136 | [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, |
1072 | \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, | 1137 | \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, |
1073 | \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, | 1138 | \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, |
1074 | \$no_aes, \$no_camellia, \$no_seed], | 1139 | \$no_aes, \$no_camellia, \$no_seed, \$no_srp], |
1075 | "rsaref" => 0, | 1140 | "rsaref" => 0, |
1076 | "gcc" => \$gcc, | 1141 | "gcc" => \$gcc, |
1077 | "debug" => \$debug, | 1142 | "debug" => \$debug, |
@@ -1079,6 +1144,7 @@ sub read_options | |||
1079 | "shlib" => \$shlib, | 1144 | "shlib" => \$shlib, |
1080 | "dll" => \$shlib, | 1145 | "dll" => \$shlib, |
1081 | "shared" => 0, | 1146 | "shared" => 0, |
1147 | "no-sctp" => 0, | ||
1082 | "no-gmp" => 0, | 1148 | "no-gmp" => 0, |
1083 | "no-rfc3779" => 0, | 1149 | "no-rfc3779" => 0, |
1084 | "no-montasm" => 0, | 1150 | "no-montasm" => 0, |
@@ -1086,6 +1152,7 @@ sub read_options | |||
1086 | "no-store" => 0, | 1152 | "no-store" => 0, |
1087 | "no-zlib" => 0, | 1153 | "no-zlib" => 0, |
1088 | "no-zlib-dynamic" => 0, | 1154 | "no-zlib-dynamic" => 0, |
1155 | "fips" => \$fips | ||
1089 | ); | 1156 | ); |
1090 | 1157 | ||
1091 | if (exists $valid_options{$_}) | 1158 | if (exists $valid_options{$_}) |
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl index ab47329097..9a8c7b87d1 100644 --- a/src/lib/libcrypto/util/mkdef.pl +++ b/src/lib/libcrypto/util/mkdef.pl | |||
@@ -79,13 +79,15 @@ my $OS2=0; | |||
79 | my $safe_stack_def = 0; | 79 | my $safe_stack_def = 0; |
80 | 80 | ||
81 | my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT", | 81 | my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT", |
82 | "EXPORT_VAR_AS_FUNCTION", "ZLIB" ); | 82 | "EXPORT_VAR_AS_FUNCTION", "ZLIB", "OPENSSL_FIPS" ); |
83 | my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" ); | 83 | my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" ); |
84 | my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | 84 | my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", |
85 | "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1", | 85 | "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1", |
86 | "SHA256", "SHA512", "RIPEMD", | 86 | "SHA256", "SHA512", "RIPEMD", |
87 | "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", | 87 | "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", "EC2M", |
88 | "HMAC", "AES", "CAMELLIA", "SEED", "GOST", | 88 | "HMAC", "AES", "CAMELLIA", "SEED", "GOST", |
89 | # EC_NISTP_64_GCC_128 | ||
90 | "EC_NISTP_64_GCC_128", | ||
89 | # Envelope "algorithms" | 91 | # Envelope "algorithms" |
90 | "EVP", "X509", "ASN1_TYPEDEFS", | 92 | "EVP", "X509", "ASN1_TYPEDEFS", |
91 | # Helper "algorithms" | 93 | # Helper "algorithms" |
@@ -98,7 +100,7 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | |||
98 | # RFC3779 | 100 | # RFC3779 |
99 | "RFC3779", | 101 | "RFC3779", |
100 | # TLS | 102 | # TLS |
101 | "TLSEXT", "PSK", | 103 | "TLSEXT", "PSK", "SRP", "HEARTBEATS", |
102 | # CMS | 104 | # CMS |
103 | "CMS", | 105 | "CMS", |
104 | # CryptoAPI Engine | 106 | # CryptoAPI Engine |
@@ -107,8 +109,14 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | |||
107 | "SSL2", | 109 | "SSL2", |
108 | # JPAKE | 110 | # JPAKE |
109 | "JPAKE", | 111 | "JPAKE", |
112 | # NEXTPROTONEG | ||
113 | "NEXTPROTONEG", | ||
110 | # Deprecated functions | 114 | # Deprecated functions |
111 | "DEPRECATED" ); | 115 | "DEPRECATED", |
116 | # Hide SSL internals | ||
117 | "SSL_INTERN", | ||
118 | # SCTP | ||
119 | "SCTP"); | ||
112 | 120 | ||
113 | my $options=""; | 121 | my $options=""; |
114 | open(IN,"<Makefile") || die "unable to open Makefile!\n"; | 122 | open(IN,"<Makefile") || die "unable to open Makefile!\n"; |
@@ -127,7 +135,10 @@ my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5; | |||
127 | my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; | 135 | my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; |
128 | my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated; | 136 | my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated; |
129 | my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng; | 137 | my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng; |
130 | my $no_jpake; my $no_ssl2; | 138 | my $no_jpake; my $no_srp; my $no_ssl2; my $no_ec2m; my $no_nistp_gcc; |
139 | my $no_nextprotoneg; my $no_sctp; | ||
140 | |||
141 | my $fips; | ||
131 | 142 | ||
132 | my $zlib; | 143 | my $zlib; |
133 | 144 | ||
@@ -151,6 +162,7 @@ foreach (@ARGV, split(/ /, $options)) | |||
151 | } | 162 | } |
152 | $VMS=1 if $_ eq "VMS"; | 163 | $VMS=1 if $_ eq "VMS"; |
153 | $OS2=1 if $_ eq "OS2"; | 164 | $OS2=1 if $_ eq "OS2"; |
165 | $fips=1 if /^fips/; | ||
154 | if ($_ eq "zlib" || $_ eq "enable-zlib" || $_ eq "zlib-dynamic" | 166 | if ($_ eq "zlib" || $_ eq "enable-zlib" || $_ eq "zlib-dynamic" |
155 | || $_ eq "enable-zlib-dynamic") { | 167 | || $_ eq "enable-zlib-dynamic") { |
156 | $zlib = 1; | 168 | $zlib = 1; |
@@ -215,9 +227,14 @@ foreach (@ARGV, split(/ /, $options)) | |||
215 | elsif (/^no-rfc3779$/) { $no_rfc3779=1; } | 227 | elsif (/^no-rfc3779$/) { $no_rfc3779=1; } |
216 | elsif (/^no-tlsext$/) { $no_tlsext=1; } | 228 | elsif (/^no-tlsext$/) { $no_tlsext=1; } |
217 | elsif (/^no-cms$/) { $no_cms=1; } | 229 | elsif (/^no-cms$/) { $no_cms=1; } |
230 | elsif (/^no-ec2m$/) { $no_ec2m=1; } | ||
231 | elsif (/^no-ec_nistp_64_gcc_128$/) { $no_nistp_gcc=1; } | ||
232 | elsif (/^no-nextprotoneg$/) { $no_nextprotoneg=1; } | ||
218 | elsif (/^no-ssl2$/) { $no_ssl2=1; } | 233 | elsif (/^no-ssl2$/) { $no_ssl2=1; } |
219 | elsif (/^no-capieng$/) { $no_capieng=1; } | 234 | elsif (/^no-capieng$/) { $no_capieng=1; } |
220 | elsif (/^no-jpake$/) { $no_jpake=1; } | 235 | elsif (/^no-jpake$/) { $no_jpake=1; } |
236 | elsif (/^no-srp$/) { $no_srp=1; } | ||
237 | elsif (/^no-sctp$/) { $no_sctp=1; } | ||
221 | } | 238 | } |
222 | 239 | ||
223 | 240 | ||
@@ -254,8 +271,10 @@ $max_crypto = $max_num; | |||
254 | my $ssl="ssl/ssl.h"; | 271 | my $ssl="ssl/ssl.h"; |
255 | $ssl.=" ssl/kssl.h"; | 272 | $ssl.=" ssl/kssl.h"; |
256 | $ssl.=" ssl/tls1.h"; | 273 | $ssl.=" ssl/tls1.h"; |
274 | $ssl.=" ssl/srtp.h"; | ||
257 | 275 | ||
258 | my $crypto ="crypto/crypto.h"; | 276 | my $crypto ="crypto/crypto.h"; |
277 | $crypto.=" crypto/cryptlib.h"; | ||
259 | $crypto.=" crypto/o_dir.h"; | 278 | $crypto.=" crypto/o_dir.h"; |
260 | $crypto.=" crypto/o_str.h"; | 279 | $crypto.=" crypto/o_str.h"; |
261 | $crypto.=" crypto/o_time.h"; | 280 | $crypto.=" crypto/o_time.h"; |
@@ -285,6 +304,7 @@ $crypto.=" crypto/ec/ec.h" ; # unless $no_ec; | |||
285 | $crypto.=" crypto/ecdsa/ecdsa.h" ; # unless $no_ecdsa; | 304 | $crypto.=" crypto/ecdsa/ecdsa.h" ; # unless $no_ecdsa; |
286 | $crypto.=" crypto/ecdh/ecdh.h" ; # unless $no_ecdh; | 305 | $crypto.=" crypto/ecdh/ecdh.h" ; # unless $no_ecdh; |
287 | $crypto.=" crypto/hmac/hmac.h" ; # unless $no_hmac; | 306 | $crypto.=" crypto/hmac/hmac.h" ; # unless $no_hmac; |
307 | $crypto.=" crypto/cmac/cmac.h" ; # unless $no_hmac; | ||
288 | 308 | ||
289 | $crypto.=" crypto/engine/engine.h"; # unless $no_engine; | 309 | $crypto.=" crypto/engine/engine.h"; # unless $no_engine; |
290 | $crypto.=" crypto/stack/stack.h" ; # unless $no_stack; | 310 | $crypto.=" crypto/stack/stack.h" ; # unless $no_stack; |
@@ -319,6 +339,7 @@ $crypto.=" crypto/pqueue/pqueue.h"; | |||
319 | $crypto.=" crypto/cms/cms.h"; | 339 | $crypto.=" crypto/cms/cms.h"; |
320 | $crypto.=" crypto/jpake/jpake.h"; | 340 | $crypto.=" crypto/jpake/jpake.h"; |
321 | $crypto.=" crypto/modes/modes.h"; | 341 | $crypto.=" crypto/modes/modes.h"; |
342 | $crypto.=" crypto/srp/srp.h"; | ||
322 | 343 | ||
323 | my $symhacks="crypto/symhacks.h"; | 344 | my $symhacks="crypto/symhacks.h"; |
324 | 345 | ||
@@ -1126,6 +1147,9 @@ sub is_valid | |||
1126 | if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) { | 1147 | if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) { |
1127 | return 1; | 1148 | return 1; |
1128 | } | 1149 | } |
1150 | if ($keyword eq "OPENSSL_FIPS" && $fips) { | ||
1151 | return 1; | ||
1152 | } | ||
1129 | if ($keyword eq "ZLIB" && $zlib) { return 1; } | 1153 | if ($keyword eq "ZLIB" && $zlib) { return 1; } |
1130 | return 0; | 1154 | return 0; |
1131 | } else { | 1155 | } else { |
@@ -1172,9 +1196,15 @@ sub is_valid | |||
1172 | if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } | 1196 | if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } |
1173 | if ($keyword eq "PSK" && $no_psk) { return 0; } | 1197 | if ($keyword eq "PSK" && $no_psk) { return 0; } |
1174 | if ($keyword eq "CMS" && $no_cms) { return 0; } | 1198 | if ($keyword eq "CMS" && $no_cms) { return 0; } |
1199 | if ($keyword eq "EC2M" && $no_ec2m) { return 0; } | ||
1200 | if ($keyword eq "NEXTPROTONEG" && $no_nextprotoneg) { return 0; } | ||
1201 | if ($keyword eq "EC_NISTP_64_GCC_128" && $no_nistp_gcc) | ||
1202 | { return 0; } | ||
1175 | if ($keyword eq "SSL2" && $no_ssl2) { return 0; } | 1203 | if ($keyword eq "SSL2" && $no_ssl2) { return 0; } |
1176 | if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } | 1204 | if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } |
1177 | if ($keyword eq "JPAKE" && $no_jpake) { return 0; } | 1205 | if ($keyword eq "JPAKE" && $no_jpake) { return 0; } |
1206 | if ($keyword eq "SRP" && $no_srp) { return 0; } | ||
1207 | if ($keyword eq "SCTP" && $no_sctp) { return 0; } | ||
1178 | if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } | 1208 | if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } |
1179 | 1209 | ||
1180 | # Nothing recognise as true | 1210 | # Nothing recognise as true |
diff --git a/src/lib/libcrypto/util/mkfiles.pl b/src/lib/libcrypto/util/mkfiles.pl index 6d15831450..7d9a9d5e5c 100644 --- a/src/lib/libcrypto/util/mkfiles.pl +++ b/src/lib/libcrypto/util/mkfiles.pl | |||
@@ -15,6 +15,7 @@ my @dirs = ( | |||
15 | "crypto/sha", | 15 | "crypto/sha", |
16 | "crypto/mdc2", | 16 | "crypto/mdc2", |
17 | "crypto/hmac", | 17 | "crypto/hmac", |
18 | "crypto/cmac", | ||
18 | "crypto/ripemd", | 19 | "crypto/ripemd", |
19 | "crypto/des", | 20 | "crypto/des", |
20 | "crypto/rc2", | 21 | "crypto/rc2", |
@@ -62,6 +63,7 @@ my @dirs = ( | |||
62 | "crypto/pqueue", | 63 | "crypto/pqueue", |
63 | "crypto/whrlpool", | 64 | "crypto/whrlpool", |
64 | "crypto/ts", | 65 | "crypto/ts", |
66 | "crypto/srp", | ||
65 | "ssl", | 67 | "ssl", |
66 | "apps", | 68 | "apps", |
67 | "engines", | 69 | "engines", |
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl index 5f25fc41bf..c503bd52b9 100644 --- a/src/lib/libcrypto/util/pl/VC-32.pl +++ b/src/lib/libcrypto/util/pl/VC-32.pl | |||
@@ -6,6 +6,16 @@ | |||
6 | $ssl= "ssleay32"; | 6 | $ssl= "ssleay32"; |
7 | $crypto="libeay32"; | 7 | $crypto="libeay32"; |
8 | 8 | ||
9 | if ($fips && !$shlib) | ||
10 | { | ||
11 | $crypto="libeayfips32"; | ||
12 | $crypto_compat = "libeaycompat32.lib"; | ||
13 | } | ||
14 | else | ||
15 | { | ||
16 | $crypto="libeay32"; | ||
17 | } | ||
18 | |||
9 | $o='\\'; | 19 | $o='\\'; |
10 | $cp='$(PERL) util/copy.pl'; | 20 | $cp='$(PERL) util/copy.pl'; |
11 | $mkdir='$(PERL) util/mkdir-p.pl'; | 21 | $mkdir='$(PERL) util/mkdir-p.pl'; |
@@ -33,7 +43,7 @@ if ($FLAVOR =~ /WIN64/) | |||
33 | # considered safe to ignore. | 43 | # considered safe to ignore. |
34 | # | 44 | # |
35 | $base_cflags= " $mf_cflag"; | 45 | $base_cflags= " $mf_cflag"; |
36 | my $f = $shlib?' /MD':' /MT'; | 46 | my $f = $shlib || $fips ?' /MD':' /MT'; |
37 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | 47 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib |
38 | $opt_cflags=$f.' /Ox'; | 48 | $opt_cflags=$f.' /Ox'; |
39 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | 49 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; |
@@ -114,7 +124,7 @@ elsif ($FLAVOR =~ /CE/) | |||
114 | else # Win32 | 124 | else # Win32 |
115 | { | 125 | { |
116 | $base_cflags= " $mf_cflag"; | 126 | $base_cflags= " $mf_cflag"; |
117 | my $f = $shlib?' /MD':' /MT'; | 127 | my $f = $shlib || $fips ?' /MD':' /MT'; |
118 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | 128 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib |
119 | $opt_cflags=$f.' /Ox /O2 /Ob2'; | 129 | $opt_cflags=$f.' /Ox /O2 /Ob2'; |
120 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | 130 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; |
@@ -266,10 +276,19 @@ elsif ($shlib && $FLAVOR =~ /CE/) | |||
266 | 276 | ||
267 | sub do_lib_rule | 277 | sub do_lib_rule |
268 | { | 278 | { |
269 | local($objs,$target,$name,$shlib)=@_; | 279 | my($objs,$target,$name,$shlib,$ign,$base_addr) = @_; |
270 | local($ret); | 280 | local($ret); |
271 | 281 | ||
272 | $taget =~ s/\//$o/g if $o ne '/'; | 282 | $taget =~ s/\//$o/g if $o ne '/'; |
283 | my $base_arg; | ||
284 | if ($base_addr ne "") | ||
285 | { | ||
286 | $base_arg= " /base:$base_addr"; | ||
287 | } | ||
288 | else | ||
289 | { | ||
290 | $base_arg = ""; | ||
291 | } | ||
273 | if ($name ne "") | 292 | if ($name ne "") |
274 | { | 293 | { |
275 | $name =~ tr/a-z/A-Z/; | 294 | $name =~ tr/a-z/A-Z/; |
@@ -277,17 +296,37 @@ sub do_lib_rule | |||
277 | } | 296 | } |
278 | 297 | ||
279 | # $target="\$(LIB_D)$o$target"; | 298 | # $target="\$(LIB_D)$o$target"; |
280 | $ret.="$target: $objs\n"; | 299 | # $ret.="$target: $objs\n"; |
281 | if (!$shlib) | 300 | if (!$shlib) |
282 | { | 301 | { |
283 | # $ret.="\t\$(RM) \$(O_$Name)\n"; | 302 | # $ret.="\t\$(RM) \$(O_$Name)\n"; |
303 | $ret.="$target: $objs\n"; | ||
284 | $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; | 304 | $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; |
285 | } | 305 | } |
286 | else | 306 | else |
287 | { | 307 | { |
288 | local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)'; | 308 | local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)'; |
289 | $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; | 309 | $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; |
290 | $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n"; | 310 | |
311 | if ($fips && $target =~ /O_CRYPTO/) | ||
312 | { | ||
313 | $ret.="$target: $objs \$(PREMAIN_DSO_EXE)"; | ||
314 | $ret.="\n\tSET FIPS_LINK=\$(LINK)\n"; | ||
315 | $ret.="\tSET FIPS_CC=\$(CC)\n"; | ||
316 | $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; | ||
317 | $ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n"; | ||
318 | $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; | ||
319 | $ret.="\tSET FIPS_TARGET=$target\n"; | ||
320 | $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; | ||
321 | $ret.="\t\$(FIPSLINK) \$(MLFLAGS) /map $base_arg $efile$target "; | ||
322 | $ret.="$name @<<\n \$(SHLIB_EX_OBJ) $objs \$(EX_LIBS) "; | ||
323 | $ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n"; | ||
324 | } | ||
325 | else | ||
326 | { | ||
327 | $ret.="$target: $objs"; | ||
328 | $ret.="\n\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n"; | ||
329 | } | ||
291 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; | 330 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; |
292 | } | 331 | } |
293 | $ret.="\n"; | 332 | $ret.="\n"; |
@@ -296,15 +335,35 @@ sub do_lib_rule | |||
296 | 335 | ||
297 | sub do_link_rule | 336 | sub do_link_rule |
298 | { | 337 | { |
299 | local($target,$files,$dep_libs,$libs)=@_; | 338 | my($target,$files,$dep_libs,$libs,$standalone)=@_; |
300 | local($ret,$_); | 339 | local($ret,$_); |
301 | |||
302 | $file =~ s/\//$o/g if $o ne '/'; | 340 | $file =~ s/\//$o/g if $o ne '/'; |
303 | $n=&bname($targer); | 341 | $n=&bname($targer); |
304 | $ret.="$target: $files $dep_libs\n"; | 342 | $ret.="$target: $files $dep_libs\n"; |
305 | $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; | 343 | if ($standalone == 1) |
306 | $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n"; | 344 | { |
307 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; | 345 | $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t"; |
346 | $ret.= "\$(EX_LIBS) " if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild); | ||
347 | $ret.="$files $libs\n<<\n"; | ||
348 | } | ||
349 | elsif ($standalone == 2) | ||
350 | { | ||
351 | $ret.="\tSET FIPS_LINK=\$(LINK)\n"; | ||
352 | $ret.="\tSET FIPS_CC=\$(CC)\n"; | ||
353 | $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; | ||
354 | $ret.="\tSET PREMAIN_DSO_EXE=\n"; | ||
355 | $ret.="\tSET FIPS_TARGET=$target\n"; | ||
356 | $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; | ||
357 | $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; | ||
358 | $ret.="\t\$(FIPSLINK) \$(LFLAGS) /map $efile$target @<<\n"; | ||
359 | $ret.="\t\$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n"; | ||
360 | } | ||
361 | else | ||
362 | { | ||
363 | $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; | ||
364 | $ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n"; | ||
365 | } | ||
366 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; | ||
308 | return($ret); | 367 | return($ret); |
309 | } | 368 | } |
310 | 369 | ||
diff --git a/src/lib/libcrypto/util/ssleay.num b/src/lib/libcrypto/util/ssleay.num index 15a58e7b13..37655bc40a 100644 --- a/src/lib/libcrypto/util/ssleay.num +++ b/src/lib/libcrypto/util/ssleay.num | |||
@@ -259,3 +259,64 @@ SSL_set_session_secret_cb 307 EXIST::FUNCTION: | |||
259 | SSL_set_session_ticket_ext_cb 308 EXIST::FUNCTION: | 259 | SSL_set_session_ticket_ext_cb 308 EXIST::FUNCTION: |
260 | SSL_set1_param 309 EXIST::FUNCTION: | 260 | SSL_set1_param 309 EXIST::FUNCTION: |
261 | SSL_CTX_set1_param 310 EXIST::FUNCTION: | 261 | SSL_CTX_set1_param 310 EXIST::FUNCTION: |
262 | SSL_tls1_key_exporter 311 NOEXIST::FUNCTION: | ||
263 | SSL_renegotiate_abbreviated 312 EXIST::FUNCTION: | ||
264 | TLSv1_1_method 313 EXIST::FUNCTION: | ||
265 | TLSv1_1_client_method 314 EXIST::FUNCTION: | ||
266 | TLSv1_1_server_method 315 EXIST::FUNCTION: | ||
267 | SSL_CTX_set_srp_client_pwd_callback 316 EXIST:!VMS:FUNCTION:SRP | ||
268 | SSL_CTX_set_srp_client_pwd_cb 316 EXIST:VMS:FUNCTION:SRP | ||
269 | SSL_get_srp_g 317 EXIST::FUNCTION:SRP | ||
270 | SSL_CTX_set_srp_username_callback 318 EXIST:!VMS:FUNCTION:SRP | ||
271 | SSL_CTX_set_srp_un_cb 318 EXIST:VMS:FUNCTION:SRP | ||
272 | SSL_get_srp_userinfo 319 EXIST::FUNCTION:SRP | ||
273 | SSL_set_srp_server_param 320 EXIST::FUNCTION:SRP | ||
274 | SSL_set_srp_server_param_pw 321 EXIST::FUNCTION:SRP | ||
275 | SSL_get_srp_N 322 EXIST::FUNCTION:SRP | ||
276 | SSL_get_srp_username 323 EXIST::FUNCTION:SRP | ||
277 | SSL_CTX_set_srp_password 324 EXIST::FUNCTION:SRP | ||
278 | SSL_CTX_set_srp_strength 325 EXIST::FUNCTION:SRP | ||
279 | SSL_CTX_set_srp_verify_param_callback 326 EXIST:!VMS:FUNCTION:SRP | ||
280 | SSL_CTX_set_srp_vfy_param_cb 326 EXIST:VMS:FUNCTION:SRP | ||
281 | SSL_CTX_set_srp_miss_srp_un_cb 327 NOEXIST::FUNCTION: | ||
282 | SSL_CTX_set_srp_missing_srp_username_callback 327 NOEXIST::FUNCTION: | ||
283 | SSL_CTX_set_srp_cb_arg 328 EXIST::FUNCTION:SRP | ||
284 | SSL_CTX_set_srp_username 329 EXIST::FUNCTION:SRP | ||
285 | SSL_CTX_SRP_CTX_init 330 EXIST::FUNCTION:SRP | ||
286 | SSL_SRP_CTX_init 331 EXIST::FUNCTION:SRP | ||
287 | SRP_Calc_A_param 332 EXIST::FUNCTION:SRP | ||
288 | SRP_generate_server_master_secret 333 EXIST:!VMS:FUNCTION:SRP | ||
289 | SRP_gen_server_master_secret 333 EXIST:VMS:FUNCTION:SRP | ||
290 | SSL_CTX_SRP_CTX_free 334 EXIST::FUNCTION:SRP | ||
291 | SRP_generate_client_master_secret 335 EXIST:!VMS:FUNCTION:SRP | ||
292 | SRP_gen_client_master_secret 335 EXIST:VMS:FUNCTION:SRP | ||
293 | SSL_srp_server_param_with_username 336 EXIST:!VMS:FUNCTION:SRP | ||
294 | SSL_srp_server_param_with_un 336 EXIST:VMS:FUNCTION:SRP | ||
295 | SRP_have_to_put_srp_username 337 NOEXIST::FUNCTION: | ||
296 | SSL_SRP_CTX_free 338 EXIST::FUNCTION:SRP | ||
297 | SSL_set_debug 339 EXIST::FUNCTION: | ||
298 | SSL_SESSION_get0_peer 340 EXIST::FUNCTION: | ||
299 | TLSv1_2_client_method 341 EXIST::FUNCTION: | ||
300 | SSL_SESSION_set1_id_context 342 EXIST::FUNCTION: | ||
301 | TLSv1_2_server_method 343 EXIST::FUNCTION: | ||
302 | SSL_cache_hit 344 EXIST::FUNCTION: | ||
303 | SSL_get0_kssl_ctx 345 EXIST::FUNCTION:KRB5 | ||
304 | SSL_set0_kssl_ctx 346 EXIST::FUNCTION:KRB5 | ||
305 | SSL_SESSION_get0_id 347 NOEXIST::FUNCTION: | ||
306 | SSL_set_state 348 EXIST::FUNCTION: | ||
307 | SSL_CIPHER_get_id 349 EXIST::FUNCTION: | ||
308 | TLSv1_2_method 350 EXIST::FUNCTION: | ||
309 | SSL_SESSION_get_id_len 351 NOEXIST::FUNCTION: | ||
310 | kssl_ctx_get0_client_princ 352 EXIST::FUNCTION:KRB5 | ||
311 | SSL_export_keying_material 353 EXIST::FUNCTION:TLSEXT | ||
312 | SSL_set_tlsext_use_srtp 354 EXIST::FUNCTION: | ||
313 | SSL_CTX_set_next_protos_advertised_cb 355 EXIST:!VMS:FUNCTION:NEXTPROTONEG | ||
314 | SSL_CTX_set_next_protos_adv_cb 355 EXIST:VMS:FUNCTION:NEXTPROTONEG | ||
315 | SSL_get0_next_proto_negotiated 356 EXIST::FUNCTION:NEXTPROTONEG | ||
316 | SSL_get_selected_srtp_profile 357 EXIST::FUNCTION: | ||
317 | SSL_CTX_set_tlsext_use_srtp 358 EXIST::FUNCTION: | ||
318 | SSL_select_next_proto 359 EXIST::FUNCTION:NEXTPROTONEG | ||
319 | SSL_get_srtp_profiles 360 EXIST::FUNCTION: | ||
320 | SSL_CTX_set_next_proto_select_cb 361 EXIST:!VMS:FUNCTION:NEXTPROTONEG | ||
321 | SSL_CTX_set_next_proto_sel_cb 361 EXIST:VMS:FUNCTION:NEXTPROTONEG | ||
322 | SSL_SESSION_get_compress_id 362 EXIST::FUNCTION: | ||
diff --git a/src/lib/libssl/src/CHANGES b/src/lib/libssl/src/CHANGES index 03e744a049..7013e4c12c 100644 --- a/src/lib/libssl/src/CHANGES +++ b/src/lib/libssl/src/CHANGES | |||
@@ -2,6 +2,387 @@ | |||
2 | OpenSSL CHANGES | 2 | OpenSSL CHANGES |
3 | _______________ | 3 | _______________ |
4 | 4 | ||
5 | Changes between 1.0.1b and 1.0.1c [10 May 2012] | ||
6 | |||
7 | *) Sanity check record length before skipping explicit IV in TLS | ||
8 | 1.2, 1.1 and DTLS to fix DoS attack. | ||
9 | |||
10 | Thanks to Codenomicon for discovering this issue using Fuzz-o-Matic | ||
11 | fuzzing as a service testing platform. | ||
12 | (CVE-2012-2333) | ||
13 | [Steve Henson] | ||
14 | |||
15 | *) Initialise tkeylen properly when encrypting CMS messages. | ||
16 | Thanks to Solar Designer of Openwall for reporting this issue. | ||
17 | [Steve Henson] | ||
18 | |||
19 | *) In FIPS mode don't try to use composite ciphers as they are not | ||
20 | approved. | ||
21 | [Steve Henson] | ||
22 | |||
23 | Changes between 1.0.1a and 1.0.1b [26 Apr 2012] | ||
24 | |||
25 | *) OpenSSL 1.0.0 sets SSL_OP_ALL to 0x80000FFFL and OpenSSL 1.0.1 and | ||
26 | 1.0.1a set SSL_OP_NO_TLSv1_1 to 0x00000400L which would unfortunately | ||
27 | mean any application compiled against OpenSSL 1.0.0 headers setting | ||
28 | SSL_OP_ALL would also set SSL_OP_NO_TLSv1_1, unintentionally disablng | ||
29 | TLS 1.1 also. Fix this by changing the value of SSL_OP_NO_TLSv1_1 to | ||
30 | 0x10000000L Any application which was previously compiled against | ||
31 | OpenSSL 1.0.1 or 1.0.1a headers and which cares about SSL_OP_NO_TLSv1_1 | ||
32 | will need to be recompiled as a result. Letting be results in | ||
33 | inability to disable specifically TLS 1.1 and in client context, | ||
34 | in unlike event, limit maximum offered version to TLS 1.0 [see below]. | ||
35 | [Steve Henson] | ||
36 | |||
37 | *) In order to ensure interoperabilty SSL_OP_NO_protocolX does not | ||
38 | disable just protocol X, but all protocols above X *if* there are | ||
39 | protocols *below* X still enabled. In more practical terms it means | ||
40 | that if application wants to disable TLS1.0 in favor of TLS1.1 and | ||
41 | above, it's not sufficient to pass SSL_OP_NO_TLSv1, one has to pass | ||
42 | SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2. This applies to | ||
43 | client side. | ||
44 | [Andy Polyakov] | ||
45 | |||
46 | Changes between 1.0.1 and 1.0.1a [19 Apr 2012] | ||
47 | |||
48 | *) Check for potentially exploitable overflows in asn1_d2i_read_bio | ||
49 | BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer | ||
50 | in CRYPTO_realloc_clean. | ||
51 | |||
52 | Thanks to Tavis Ormandy, Google Security Team, for discovering this | ||
53 | issue and to Adam Langley <agl@chromium.org> for fixing it. | ||
54 | (CVE-2012-2110) | ||
55 | [Adam Langley (Google), Tavis Ormandy, Google Security Team] | ||
56 | |||
57 | *) Don't allow TLS 1.2 SHA-256 ciphersuites in TLS 1.0, 1.1 connections. | ||
58 | [Adam Langley] | ||
59 | |||
60 | *) Workarounds for some broken servers that "hang" if a client hello | ||
61 | record length exceeds 255 bytes. | ||
62 | |||
63 | 1. Do not use record version number > TLS 1.0 in initial client | ||
64 | hello: some (but not all) hanging servers will now work. | ||
65 | 2. If we set OPENSSL_MAX_TLS1_2_CIPHER_LENGTH this will truncate | ||
66 | the number of ciphers sent in the client hello. This should be | ||
67 | set to an even number, such as 50, for example by passing: | ||
68 | -DOPENSSL_MAX_TLS1_2_CIPHER_LENGTH=50 to config or Configure. | ||
69 | Most broken servers should now work. | ||
70 | 3. If all else fails setting OPENSSL_NO_TLS1_2_CLIENT will disable | ||
71 | TLS 1.2 client support entirely. | ||
72 | [Steve Henson] | ||
73 | |||
74 | *) Fix SEGV in Vector Permutation AES module observed in OpenSSH. | ||
75 | [Andy Polyakov] | ||
76 | |||
77 | Changes between 1.0.0h and 1.0.1 [14 Mar 2012] | ||
78 | |||
79 | *) Add compatibility with old MDC2 signatures which use an ASN1 OCTET | ||
80 | STRING form instead of a DigestInfo. | ||
81 | [Steve Henson] | ||
82 | |||
83 | *) The format used for MDC2 RSA signatures is inconsistent between EVP | ||
84 | and the RSA_sign/RSA_verify functions. This was made more apparent when | ||
85 | OpenSSL used RSA_sign/RSA_verify for some RSA signatures in particular | ||
86 | those which went through EVP_PKEY_METHOD in 1.0.0 and later. Detect | ||
87 | the correct format in RSA_verify so both forms transparently work. | ||
88 | [Steve Henson] | ||
89 | |||
90 | *) Some servers which support TLS 1.0 can choke if we initially indicate | ||
91 | support for TLS 1.2 and later renegotiate using TLS 1.0 in the RSA | ||
92 | encrypted premaster secret. As a workaround use the maximum pemitted | ||
93 | client version in client hello, this should keep such servers happy | ||
94 | and still work with previous versions of OpenSSL. | ||
95 | [Steve Henson] | ||
96 | |||
97 | *) Add support for TLS/DTLS heartbeats. | ||
98 | [Robin Seggelmann <seggelmann@fh-muenster.de>] | ||
99 | |||
100 | *) Add support for SCTP. | ||
101 | [Robin Seggelmann <seggelmann@fh-muenster.de>] | ||
102 | |||
103 | *) Improved PRNG seeding for VOS. | ||
104 | [Paul Green <Paul.Green@stratus.com>] | ||
105 | |||
106 | *) Extensive assembler packs updates, most notably: | ||
107 | |||
108 | - x86[_64]: AES-NI, PCLMULQDQ, RDRAND support; | ||
109 | - x86[_64]: SSSE3 support (SHA1, vector-permutation AES); | ||
110 | - x86_64: bit-sliced AES implementation; | ||
111 | - ARM: NEON support, contemporary platforms optimizations; | ||
112 | - s390x: z196 support; | ||
113 | - *: GHASH and GF(2^m) multiplication implementations; | ||
114 | |||
115 | [Andy Polyakov] | ||
116 | |||
117 | *) Make TLS-SRP code conformant with RFC 5054 API cleanup | ||
118 | (removal of unnecessary code) | ||
119 | [Peter Sylvester <peter.sylvester@edelweb.fr>] | ||
120 | |||
121 | *) Add TLS key material exporter from RFC 5705. | ||
122 | [Eric Rescorla] | ||
123 | |||
124 | *) Add DTLS-SRTP negotiation from RFC 5764. | ||
125 | [Eric Rescorla] | ||
126 | |||
127 | *) Add Next Protocol Negotiation, | ||
128 | http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-00. Can be | ||
129 | disabled with a no-npn flag to config or Configure. Code donated | ||
130 | by Google. | ||
131 | [Adam Langley <agl@google.com> and Ben Laurie] | ||
132 | |||
133 | *) Add optional 64-bit optimized implementations of elliptic curves NIST-P224, | ||
134 | NIST-P256, NIST-P521, with constant-time single point multiplication on | ||
135 | typical inputs. Compiler support for the nonstandard type __uint128_t is | ||
136 | required to use this (present in gcc 4.4 and later, for 64-bit builds). | ||
137 | Code made available under Apache License version 2.0. | ||
138 | |||
139 | Specify "enable-ec_nistp_64_gcc_128" on the Configure (or config) command | ||
140 | line to include this in your build of OpenSSL, and run "make depend" (or | ||
141 | "make update"). This enables the following EC_METHODs: | ||
142 | |||
143 | EC_GFp_nistp224_method() | ||
144 | EC_GFp_nistp256_method() | ||
145 | EC_GFp_nistp521_method() | ||
146 | |||
147 | EC_GROUP_new_by_curve_name() will automatically use these (while | ||
148 | EC_GROUP_new_curve_GFp() currently prefers the more flexible | ||
149 | implementations). | ||
150 | [Emilia Käsper, Adam Langley, Bodo Moeller (Google)] | ||
151 | |||
152 | *) Use type ossl_ssize_t instad of ssize_t which isn't available on | ||
153 | all platforms. Move ssize_t definition from e_os.h to the public | ||
154 | header file e_os2.h as it now appears in public header file cms.h | ||
155 | [Steve Henson] | ||
156 | |||
157 | *) New -sigopt option to the ca, req and x509 utilities. Additional | ||
158 | signature parameters can be passed using this option and in | ||
159 | particular PSS. | ||
160 | [Steve Henson] | ||
161 | |||
162 | *) Add RSA PSS signing function. This will generate and set the | ||
163 | appropriate AlgorithmIdentifiers for PSS based on those in the | ||
164 | corresponding EVP_MD_CTX structure. No application support yet. | ||
165 | [Steve Henson] | ||
166 | |||
167 | *) Support for companion algorithm specific ASN1 signing routines. | ||
168 | New function ASN1_item_sign_ctx() signs a pre-initialised | ||
169 | EVP_MD_CTX structure and sets AlgorithmIdentifiers based on | ||
170 | the appropriate parameters. | ||
171 | [Steve Henson] | ||
172 | |||
173 | *) Add new algorithm specific ASN1 verification initialisation function | ||
174 | to EVP_PKEY_ASN1_METHOD: this is not in EVP_PKEY_METHOD since the ASN1 | ||
175 | handling will be the same no matter what EVP_PKEY_METHOD is used. | ||
176 | Add a PSS handler to support verification of PSS signatures: checked | ||
177 | against a number of sample certificates. | ||
178 | [Steve Henson] | ||
179 | |||
180 | *) Add signature printing for PSS. Add PSS OIDs. | ||
181 | [Steve Henson, Martin Kaiser <lists@kaiser.cx>] | ||
182 | |||
183 | *) Add algorithm specific signature printing. An individual ASN1 method | ||
184 | can now print out signatures instead of the standard hex dump. | ||
185 | |||
186 | More complex signatures (e.g. PSS) can print out more meaningful | ||
187 | information. Include DSA version that prints out the signature | ||
188 | parameters r, s. | ||
189 | [Steve Henson] | ||
190 | |||
191 | *) Password based recipient info support for CMS library: implementing | ||
192 | RFC3211. | ||
193 | [Steve Henson] | ||
194 | |||
195 | *) Split password based encryption into PBES2 and PBKDF2 functions. This | ||
196 | neatly separates the code into cipher and PBE sections and is required | ||
197 | for some algorithms that split PBES2 into separate pieces (such as | ||
198 | password based CMS). | ||
199 | [Steve Henson] | ||
200 | |||
201 | *) Session-handling fixes: | ||
202 | - Fix handling of connections that are resuming with a session ID, | ||
203 | but also support Session Tickets. | ||
204 | - Fix a bug that suppressed issuing of a new ticket if the client | ||
205 | presented a ticket with an expired session. | ||
206 | - Try to set the ticket lifetime hint to something reasonable. | ||
207 | - Make tickets shorter by excluding irrelevant information. | ||
208 | - On the client side, don't ignore renewed tickets. | ||
209 | [Adam Langley, Bodo Moeller (Google)] | ||
210 | |||
211 | *) Fix PSK session representation. | ||
212 | [Bodo Moeller] | ||
213 | |||
214 | *) Add RC4-MD5 and AESNI-SHA1 "stitched" implementations. | ||
215 | |||
216 | This work was sponsored by Intel. | ||
217 | [Andy Polyakov] | ||
218 | |||
219 | *) Add GCM support to TLS library. Some custom code is needed to split | ||
220 | the IV between the fixed (from PRF) and explicit (from TLS record) | ||
221 | portions. This adds all GCM ciphersuites supported by RFC5288 and | ||
222 | RFC5289. Generalise some AES* cipherstrings to inlclude GCM and | ||
223 | add a special AESGCM string for GCM only. | ||
224 | [Steve Henson] | ||
225 | |||
226 | *) Expand range of ctrls for AES GCM. Permit setting invocation | ||
227 | field on decrypt and retrieval of invocation field only on encrypt. | ||
228 | [Steve Henson] | ||
229 | |||
230 | *) Add HMAC ECC ciphersuites from RFC5289. Include SHA384 PRF support. | ||
231 | As required by RFC5289 these ciphersuites cannot be used if for | ||
232 | versions of TLS earlier than 1.2. | ||
233 | [Steve Henson] | ||
234 | |||
235 | *) For FIPS capable OpenSSL interpret a NULL default public key method | ||
236 | as unset and return the appopriate default but do *not* set the default. | ||
237 | This means we can return the appopriate method in applications that | ||
238 | swicth between FIPS and non-FIPS modes. | ||
239 | [Steve Henson] | ||
240 | |||
241 | *) Redirect HMAC and CMAC operations to FIPS module in FIPS mode. If an | ||
242 | ENGINE is used then we cannot handle that in the FIPS module so we | ||
243 | keep original code iff non-FIPS operations are allowed. | ||
244 | [Steve Henson] | ||
245 | |||
246 | *) Add -attime option to openssl utilities. | ||
247 | [Peter Eckersley <pde@eff.org>, Ben Laurie and Steve Henson] | ||
248 | |||
249 | *) Redirect DSA and DH operations to FIPS module in FIPS mode. | ||
250 | [Steve Henson] | ||
251 | |||
252 | *) Redirect ECDSA and ECDH operations to FIPS module in FIPS mode. Also use | ||
253 | FIPS EC methods unconditionally for now. | ||
254 | [Steve Henson] | ||
255 | |||
256 | *) New build option no-ec2m to disable characteristic 2 code. | ||
257 | [Steve Henson] | ||
258 | |||
259 | *) Backport libcrypto audit of return value checking from 1.1.0-dev; not | ||
260 | all cases can be covered as some introduce binary incompatibilities. | ||
261 | [Steve Henson] | ||
262 | |||
263 | *) Redirect RSA operations to FIPS module including keygen, | ||
264 | encrypt, decrypt, sign and verify. Block use of non FIPS RSA methods. | ||
265 | [Steve Henson] | ||
266 | |||
267 | *) Add similar low level API blocking to ciphers. | ||
268 | [Steve Henson] | ||
269 | |||
270 | *) Low level digest APIs are not approved in FIPS mode: any attempt | ||
271 | to use these will cause a fatal error. Applications that *really* want | ||
272 | to use them can use the private_* version instead. | ||
273 | [Steve Henson] | ||
274 | |||
275 | *) Redirect cipher operations to FIPS module for FIPS builds. | ||
276 | [Steve Henson] | ||
277 | |||
278 | *) Redirect digest operations to FIPS module for FIPS builds. | ||
279 | [Steve Henson] | ||
280 | |||
281 | *) Update build system to add "fips" flag which will link in fipscanister.o | ||
282 | for static and shared library builds embedding a signature if needed. | ||
283 | [Steve Henson] | ||
284 | |||
285 | *) Output TLS supported curves in preference order instead of numerical | ||
286 | order. This is currently hardcoded for the highest order curves first. | ||
287 | This should be configurable so applications can judge speed vs strength. | ||
288 | [Steve Henson] | ||
289 | |||
290 | *) Add TLS v1.2 server support for client authentication. | ||
291 | [Steve Henson] | ||
292 | |||
293 | *) Add support for FIPS mode in ssl library: disable SSLv3, non-FIPS ciphers | ||
294 | and enable MD5. | ||
295 | [Steve Henson] | ||
296 | |||
297 | *) Functions FIPS_mode_set() and FIPS_mode() which call the underlying | ||
298 | FIPS modules versions. | ||
299 | [Steve Henson] | ||
300 | |||
301 | *) Add TLS v1.2 client side support for client authentication. Keep cache | ||
302 | of handshake records longer as we don't know the hash algorithm to use | ||
303 | until after the certificate request message is received. | ||
304 | [Steve Henson] | ||
305 | |||
306 | *) Initial TLS v1.2 client support. Add a default signature algorithms | ||
307 | extension including all the algorithms we support. Parse new signature | ||
308 | format in client key exchange. Relax some ECC signing restrictions for | ||
309 | TLS v1.2 as indicated in RFC5246. | ||
310 | [Steve Henson] | ||
311 | |||
312 | *) Add server support for TLS v1.2 signature algorithms extension. Switch | ||
313 | to new signature format when needed using client digest preference. | ||
314 | All server ciphersuites should now work correctly in TLS v1.2. No client | ||
315 | support yet and no support for client certificates. | ||
316 | [Steve Henson] | ||
317 | |||
318 | *) Initial TLS v1.2 support. Add new SHA256 digest to ssl code, switch | ||
319 | to SHA256 for PRF when using TLS v1.2 and later. Add new SHA256 based | ||
320 | ciphersuites. At present only RSA key exchange ciphersuites work with | ||
321 | TLS v1.2. Add new option for TLS v1.2 replacing the old and obsolete | ||
322 | SSL_OP_PKCS1_CHECK flags with SSL_OP_NO_TLSv1_2. New TLSv1.2 methods | ||
323 | and version checking. | ||
324 | [Steve Henson] | ||
325 | |||
326 | *) New option OPENSSL_NO_SSL_INTERN. If an application can be compiled | ||
327 | with this defined it will not be affected by any changes to ssl internal | ||
328 | structures. Add several utility functions to allow openssl application | ||
329 | to work with OPENSSL_NO_SSL_INTERN defined. | ||
330 | [Steve Henson] | ||
331 | |||
332 | *) Add SRP support. | ||
333 | [Tom Wu <tjw@cs.stanford.edu> and Ben Laurie] | ||
334 | |||
335 | *) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id. | ||
336 | [Steve Henson] | ||
337 | |||
338 | *) Permit abbreviated handshakes when renegotiating using the function | ||
339 | SSL_renegotiate_abbreviated(). | ||
340 | [Robin Seggelmann <seggelmann@fh-muenster.de>] | ||
341 | |||
342 | *) Add call to ENGINE_register_all_complete() to | ||
343 | ENGINE_load_builtin_engines(), so some implementations get used | ||
344 | automatically instead of needing explicit application support. | ||
345 | [Steve Henson] | ||
346 | |||
347 | *) Add support for TLS key exporter as described in RFC5705. | ||
348 | [Robin Seggelmann <seggelmann@fh-muenster.de>, Steve Henson] | ||
349 | |||
350 | *) Initial TLSv1.1 support. Since TLSv1.1 is very similar to TLS v1.0 only | ||
351 | a few changes are required: | ||
352 | |||
353 | Add SSL_OP_NO_TLSv1_1 flag. | ||
354 | Add TLSv1_1 methods. | ||
355 | Update version checking logic to handle version 1.1. | ||
356 | Add explicit IV handling (ported from DTLS code). | ||
357 | Add command line options to s_client/s_server. | ||
358 | [Steve Henson] | ||
359 | |||
360 | Changes between 1.0.0g and 1.0.0h [12 Mar 2012] | ||
361 | |||
362 | *) Fix MMA (Bleichenbacher's attack on PKCS #1 v1.5 RSA padding) weakness | ||
363 | in CMS and PKCS7 code. When RSA decryption fails use a random key for | ||
364 | content decryption and always return the same error. Note: this attack | ||
365 | needs on average 2^20 messages so it only affects automated senders. The | ||
366 | old behaviour can be reenabled in the CMS code by setting the | ||
367 | CMS_DEBUG_DECRYPT flag: this is useful for debugging and testing where | ||
368 | an MMA defence is not necessary. | ||
369 | Thanks to Ivan Nestlerode <inestlerode@us.ibm.com> for discovering | ||
370 | this issue. (CVE-2012-0884) | ||
371 | [Steve Henson] | ||
372 | |||
373 | *) Fix CVE-2011-4619: make sure we really are receiving a | ||
374 | client hello before rejecting multiple SGC restarts. Thanks to | ||
375 | Ivan Nestlerode <inestlerode@us.ibm.com> for discovering this bug. | ||
376 | [Steve Henson] | ||
377 | |||
378 | Changes between 1.0.0f and 1.0.0g [18 Jan 2012] | ||
379 | |||
380 | *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. | ||
381 | Thanks to Antonio Martin, Enterprise Secure Access Research and | ||
382 | Development, Cisco Systems, Inc. for discovering this bug and | ||
383 | preparing a fix. (CVE-2012-0050) | ||
384 | [Antonio Martin] | ||
385 | |||
5 | Changes between 1.0.0e and 1.0.0f [4 Jan 2012] | 386 | Changes between 1.0.0e and 1.0.0f [4 Jan 2012] |
6 | 387 | ||
7 | *) Nadhem Alfardan and Kenny Paterson have discovered an extension | 388 | *) Nadhem Alfardan and Kenny Paterson have discovered an extension |
@@ -22,7 +403,9 @@ | |||
22 | (CVE-2011-4576) | 403 | (CVE-2011-4576) |
23 | [Adam Langley (Google)] | 404 | [Adam Langley (Google)] |
24 | 405 | ||
25 | *) Only allow one SGC handshake restart for SSL/TLS. (CVE-2011-4619) | 406 | *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George |
407 | Kadianakis <desnacked@gmail.com> for discovering this issue and | ||
408 | Adam Langley for preparing the fix. (CVE-2011-4619) | ||
26 | [Adam Langley (Google)] | 409 | [Adam Langley (Google)] |
27 | 410 | ||
28 | *) Check parameters are not NULL in GOST ENGINE. (CVE-2012-0027) | 411 | *) Check parameters are not NULL in GOST ENGINE. (CVE-2012-0027) |
@@ -963,8 +1346,47 @@ | |||
963 | 1346 | ||
964 | *) Change 'Configure' script to enable Camellia by default. | 1347 | *) Change 'Configure' script to enable Camellia by default. |
965 | [NTT] | 1348 | [NTT] |
1349 | |||
1350 | Changes between 0.9.8s and 0.9.8t [18 Jan 2012] | ||
1351 | |||
1352 | *) Fix for DTLS DoS issue introduced by fix for CVE-2011-4109. | ||
1353 | Thanks to Antonio Martin, Enterprise Secure Access Research and | ||
1354 | Development, Cisco Systems, Inc. for discovering this bug and | ||
1355 | preparing a fix. (CVE-2012-0050) | ||
1356 | [Antonio Martin] | ||
966 | 1357 | ||
967 | Changes between 0.9.8r and 0.9.8s [xx XXX xxxx] | 1358 | Changes between 0.9.8r and 0.9.8s [4 Jan 2012] |
1359 | |||
1360 | *) Nadhem Alfardan and Kenny Paterson have discovered an extension | ||
1361 | of the Vaudenay padding oracle attack on CBC mode encryption | ||
1362 | which enables an efficient plaintext recovery attack against | ||
1363 | the OpenSSL implementation of DTLS. Their attack exploits timing | ||
1364 | differences arising during decryption processing. A research | ||
1365 | paper describing this attack can be found at: | ||
1366 | http://www.isg.rhul.ac.uk/~kp/dtls.pdf | ||
1367 | Thanks go to Nadhem Alfardan and Kenny Paterson of the Information | ||
1368 | Security Group at Royal Holloway, University of London | ||
1369 | (www.isg.rhul.ac.uk) for discovering this flaw and to Robin Seggelmann | ||
1370 | <seggelmann@fh-muenster.de> and Michael Tuexen <tuexen@fh-muenster.de> | ||
1371 | for preparing the fix. (CVE-2011-4108) | ||
1372 | [Robin Seggelmann, Michael Tuexen] | ||
1373 | |||
1374 | *) Stop policy check failure freeing same buffer twice. (CVE-2011-4109) | ||
1375 | [Ben Laurie, Kasper <ekasper@google.com>] | ||
1376 | |||
1377 | *) Clear bytes used for block padding of SSL 3.0 records. | ||
1378 | (CVE-2011-4576) | ||
1379 | [Adam Langley (Google)] | ||
1380 | |||
1381 | *) Only allow one SGC handshake restart for SSL/TLS. Thanks to George | ||
1382 | Kadianakis <desnacked@gmail.com> for discovering this issue and | ||
1383 | Adam Langley for preparing the fix. (CVE-2011-4619) | ||
1384 | [Adam Langley (Google)] | ||
1385 | |||
1386 | *) Prevent malformed RFC3779 data triggering an assertion failure. | ||
1387 | Thanks to Andrew Chi, BBN Technologies, for discovering the flaw | ||
1388 | and Rob Austein <sra@hactrn.net> for fixing it. (CVE-2011-4577) | ||
1389 | [Rob Austein <sra@hactrn.net>] | ||
968 | 1390 | ||
969 | *) Fix ssl_ciph.c set-up race. | 1391 | *) Fix ssl_ciph.c set-up race. |
970 | [Adam Langley (Google)] | 1392 | [Adam Langley (Google)] |
diff --git a/src/lib/libssl/src/Configure b/src/lib/libssl/src/Configure index 7941c93f64..cbbf4de8b2 100644 --- a/src/lib/libssl/src/Configure +++ b/src/lib/libssl/src/Configure | |||
@@ -10,7 +10,7 @@ use strict; | |||
10 | 10 | ||
11 | # see INSTALL for instructions. | 11 | # see INSTALL for instructions. |
12 | 12 | ||
13 | my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; | 13 | my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; |
14 | 14 | ||
15 | # Options: | 15 | # Options: |
16 | # | 16 | # |
@@ -56,6 +56,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta | |||
56 | # [no-]zlib [don't] compile support for zlib compression. | 56 | # [no-]zlib [don't] compile support for zlib compression. |
57 | # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared | 57 | # zlib-dynamic Like "zlib", but the zlib library is expected to be a shared |
58 | # library and will be loaded in run-time by the OpenSSL library. | 58 | # library and will be loaded in run-time by the OpenSSL library. |
59 | # sctp include SCTP support | ||
59 | # 386 generate 80386 code | 60 | # 386 generate 80386 code |
60 | # no-sse2 disables IA-32 SSE2 code, above option implies no-sse2 | 61 | # no-sse2 disables IA-32 SSE2 code, above option implies no-sse2 |
61 | # no-<cipher> build without specified algorithm (rsa, idea, rc5, ...) | 62 | # no-<cipher> build without specified algorithm (rsa, idea, rc5, ...) |
@@ -123,21 +124,24 @@ my $tlib="-lnsl -lsocket"; | |||
123 | my $bits1="THIRTY_TWO_BIT "; | 124 | my $bits1="THIRTY_TWO_BIT "; |
124 | my $bits2="SIXTY_FOUR_BIT "; | 125 | my $bits2="SIXTY_FOUR_BIT "; |
125 | 126 | ||
126 | my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes-586.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o"; | 127 | my $x86_asm="x86cpuid.o:bn-586.o co-586.o x86-mont.o x86-gf2m.o:des-586.o crypt586.o:aes-586.o vpaes-x86.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o:cmll-x86.o:ghash-x86.o:"; |
127 | 128 | ||
128 | my $x86_elf_asm="$x86_asm:elf"; | 129 | my $x86_elf_asm="$x86_asm:elf"; |
129 | 130 | ||
130 | my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o"; | 131 | my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o:"; |
131 | my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::void"; | 132 | my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void"; |
132 | my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::void"; | 133 | my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void"; |
133 | my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::void"; | 134 | my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::::void"; |
134 | my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o::::::::::::void"; | 135 | my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o:::::sha1-alpha.o:::::::ghash-alpha.o::void"; |
135 | my $mips3_asm=":bn-mips3.o::::::::::::void"; | 136 | my $mips32_asm=":bn-mips.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o::::::::"; |
136 | my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o::aes-s390x.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::void"; | 137 | my $mips64_asm=":bn-mips.o mips-mont.o::aes_cbc.o aes-mips.o:::sha1-mips.o sha256-mips.o sha512-mips.o::::::::"; |
137 | my $armv4_asm=":bn_asm.o armv4-mont.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::void"; | 138 | my $s390x_asm="s390xcap.o s390xcpuid.o:bn-s390x.o s390x-mont.o s390x-gf2m.o::aes-s390x.o aes-ctr.o aes-xts.o:::sha1-s390x.o sha256-s390x.o sha512-s390x.o::rc4-s390x.o:::::ghash-s390x.o:"; |
138 | my $ppc32_asm="ppccpuid.o:bn-ppc.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::"; | 139 | my $armv4_asm="armcap.o armv4cpuid.o:bn_asm.o armv4-mont.o armv4-gf2m.o::aes_cbc.o aes-armv4.o:::sha1-armv4-large.o sha256-armv4.o sha512-armv4.o:::::::ghash-armv4.o::void"; |
139 | my $ppc64_asm="ppccpuid.o:bn-ppc.o ppc-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::"; | 140 | my $parisc11_asm="pariscid.o:bn_asm.o parisc-mont.o::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::32"; |
140 | my $no_asm=":::::::::::::void"; | 141 | my $parisc20_asm="pariscid.o:pa-risc2W.o parisc-mont.o::aes_core.o aes_cbc.o aes-parisc.o:::sha1-parisc.o sha256-parisc.o sha512-parisc.o::rc4-parisc.o:::::ghash-parisc.o::64"; |
142 | my $ppc32_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o::::::::"; | ||
143 | my $ppc64_asm="ppccpuid.o ppccap.o:bn-ppc.o ppc-mont.o ppc64-mont.o::aes_core.o aes_cbc.o aes-ppc.o:::sha1-ppc.o sha256-ppc.o sha512-ppc.o::::::::"; | ||
144 | my $no_asm=":::::::::::::::void"; | ||
141 | 145 | ||
142 | # As for $BSDthreads. Idea is to maintain "collective" set of flags, | 146 | # As for $BSDthreads. Idea is to maintain "collective" set of flags, |
143 | # which would cover all BSD flavors. -pthread applies to them all, | 147 | # which would cover all BSD flavors. -pthread applies to them all, |
@@ -148,7 +152,7 @@ my $no_asm=":::::::::::::void"; | |||
148 | # seems to be sufficient? | 152 | # seems to be sufficient? |
149 | my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT"; | 153 | my $BSDthreads="-pthread -D_THREAD_SAFE -D_REENTRANT"; |
150 | 154 | ||
151 | #config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib | 155 | #config-string $cc : $cflags : $unistd : $thread_cflag : $sys_id : $lflags : $bn_ops : $cpuid_obj : $bn_obj : $des_obj : $aes_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj : $rmd160_obj : $rc5_obj : $wp_obj : $cmll_obj : $modes_obj : $engines_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_ldflag : $shared_extension : $ranlib : $arflags : $multilib |
152 | 156 | ||
153 | my %table=( | 157 | my %table=( |
154 | # File 'TABLE' (created by 'make TABLE') contains the data from this list, | 158 | # File 'TABLE' (created by 'make TABLE') contains the data from this list, |
@@ -163,32 +167,34 @@ my %table=( | |||
163 | # Our development configs | 167 | # Our development configs |
164 | "purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::", | 168 | "purify", "purify gcc:-g -DPURIFY -Wall::(unknown)::-lsocket -lnsl::::", |
165 | "debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::", | 169 | "debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror::(unknown)::-lefence::::", |
166 | "debug-ben", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG_UNUSED -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o", | 170 | "debug-ben", "gcc:$gcc_devteam_warn -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DDEBUG_SAFESTACK -O2 -pipe::(unknown):::::", |
167 | "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", | 171 | "debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", |
168 | "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", | 172 | "debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::", |
169 | "debug-ben-debug", "gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::", | 173 | "debug-ben-debug", "gcc44:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -g3 -O2 -pipe::(unknown)::::::", |
174 | "debug-ben-macos", "cc:$gcc_devteam_warn -arch i386 -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::-Wl,-search_paths_first::::", | ||
175 | "debug-ben-macos-gcc46", "gcc-mp-4.6:$gcc_devteam_warn -Wconversion -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -DDEBUG_UNUSED -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -O3 -DL_ENDIAN -g3 -pipe::(unknown)::::::", | ||
170 | "debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::", | 176 | "debug-ben-no-opt", "gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::", |
171 | "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", | 177 | "debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::", |
172 | "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", | 178 | "debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", |
173 | "debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBIO_PAIR_DEBUG -DPEDANTIC -g -march=i486 -pedantic -Wshadow -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion::-D_REENTRANT:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", | 179 | "debug-bodo", "gcc:$gcc_devteam_warn -DBN_DEBUG -DBN_DEBUG_RAND -DCONF_DEBUG -DBIO_PAIR_DEBUG -m64 -DL_ENDIAN -DTERMIO -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", |
174 | "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", | 180 | "debug-ulf", "gcc:-DTERMIOS -DL_ENDIAN -march=i486 -Wall -DBN_DEBUG -DBN_DEBUG_RAND -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DOPENSSL_NO_ASM -g -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations:::CYGWIN32:::${no_asm}:win32:cygwin-shared:::.dll", |
175 | "debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 181 | "debug-steve64", "gcc:$gcc_devteam_warn -m64 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
176 | "debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 182 | "debug-steve32", "gcc:$gcc_devteam_warn -m32 -DL_ENDIAN -DCONF_DEBUG -DDEBUG_SAFESTACK -g -pipe::-D_REENTRANT::-rdynamic -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
177 | "debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 183 | "debug-steve-opt", "gcc:$gcc_devteam_warn -m64 -O3 -DL_ENDIAN -DTERMIO -DCONF_DEBUG -DDEBUG_SAFESTACK -g::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
178 | "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 184 | "debug-levitte-linux-elf","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
179 | "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 185 | "debug-levitte-linux-noasm","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
180 | "debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 186 | "debug-levitte-linux-elf-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
181 | "debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 187 | "debug-levitte-linux-noasm-extreme","gcc:-DLEVITTE_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_DEBUG_RAND -DCRYPTO_MDEBUG -DENGINE_CONF_DEBUG -DOPENSSL_NO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -DPEDANTIC -ggdb -g3 -mcpu=i486 -pedantic -ansi -Wall -W -Wundef -Wshadow -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wundef -Wconversion -pipe::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
182 | "debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 188 | "debug-geoff32","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
183 | "debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -DMD32_REG_T=int -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 189 | "debug-geoff64","gcc:-DBN_DEBUG -DBN_DEBUG_RAND -DBN_STRICT -DPURIFY -DOPENSSL_NO_DEPRECATED -DOPENSSL_NO_ASM -DOPENSSL_NO_INLINE_ASM -DL_ENDIAN -DTERMIO -DPEDANTIC -O1 -ggdb2 -Wall -Werror -Wundef -pedantic -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wsign-compare -Wmissing-prototypes -Wmissing-declarations -Wno-long-long::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
184 | "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", | 190 | "debug-linux-pentium","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentium -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", |
185 | "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", | 191 | "debug-linux-ppro","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -mcpu=pentiumpro -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn", |
186 | "debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 192 | "debug-linux-elf","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-lefence -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
187 | "debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 193 | "debug-linux-elf-noefence","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DL_ENDIAN -DTERMIO -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
188 | "debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 194 | "debug-linux-ia32-aes", "gcc:-DAES_EXPERIMENTAL -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:x86cpuid.o:bn-586.o co-586.o x86-mont.o:des-586.o crypt586.o:aes_x86core.o aes_cbc.o aesni-x86.o:bf-586.o:md5-586.o:sha1-586.o sha256-586.o sha512-586.o:cast-586.o:rc4-586.o:rmd-586.o:rc5-586.o:wp_block.o wp-mmx.o::ghash-x86.o::elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
189 | "debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 195 | "debug-linux-generic32","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
190 | "debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 196 | "debug-linux-generic64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
191 | "debug-linux-x86_64", "gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", | 197 | "debug-linux-x86_64","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -DTERMIO -g -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", |
192 | "dist", "cc:-O::(unknown)::::::", | 198 | "dist", "cc:-O::(unknown)::::::", |
193 | 199 | ||
194 | # Basic configs that should work on any (32 and less bit) box | 200 | # Basic configs that should work on any (32 and less bit) box |
@@ -214,7 +220,7 @@ my %table=( | |||
214 | # actually recommend to consider using gcc shared build even with vendor | 220 | # actually recommend to consider using gcc shared build even with vendor |
215 | # compiler:-) | 221 | # compiler:-) |
216 | # <appro@fy.chalmers.se> | 222 | # <appro@fy.chalmers.se> |
217 | "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64", | 223 | "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/64", |
218 | 224 | ||
219 | #### Solaris x86 with Sun C setups | 225 | #### Solaris x86 with Sun C setups |
220 | "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 226 | "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
@@ -248,16 +254,16 @@ my %table=( | |||
248 | 254 | ||
249 | #### IRIX 5.x configs | 255 | #### IRIX 5.x configs |
250 | # -mips2 flag is added by ./config when appropriate. | 256 | # -mips2 flag is added by ./config when appropriate. |
251 | "irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 257 | "irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
252 | "irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${no_asm}:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 258 | "irix-cc", "cc:-O2 -use_readonly_const -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC2 DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
253 | #### IRIX 6.x configs | 259 | #### IRIX 6.x configs |
254 | # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke | 260 | # Only N32 and N64 ABIs are supported. If you need O32 ABI build, invoke |
255 | # './Configure irix-cc -o32' manually. | 261 | # './Configure irix-cc -o32' manually. |
256 | "irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips3_asm}:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32", | 262 | "irix-mips3-gcc","gcc:-mabi=n32 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK_LL DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-mabi=n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32", |
257 | "irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips3_asm}:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32", | 263 | "irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::DES_PTR RC4_CHAR RC4_CHUNK_LL DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:${mips64_asm}:n32:dlfcn:irix-shared::-n32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::32", |
258 | # N64 ABI builds. | 264 | # N64 ABI builds. |
259 | "irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_asm}:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", | 265 | "irix64-mips4-gcc","gcc:-mabi=64 -mips4 -O3 -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-mabi=64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", |
260 | "irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips3_asm}:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", | 266 | "irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -G0 -rdata_shared -DTERMIOS -DB_ENDIAN -DBN_DIV3W::-D_SGI_MP_SOURCE:::RC4_CHAR RC4_CHUNK DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:${mips64_asm}:64:dlfcn:irix-shared::-64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", |
261 | 267 | ||
262 | #### Unified HP-UX ANSI C configs. | 268 | #### Unified HP-UX ANSI C configs. |
263 | # Special notes: | 269 | # Special notes: |
@@ -290,17 +296,18 @@ my %table=( | |||
290 | # Since there is mention of this in shlib/hpux10-cc.sh | 296 | # Since there is mention of this in shlib/hpux10-cc.sh |
291 | "hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 297 | "hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
292 | "hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 298 | "hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
293 | "hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1::pa-risc2.o::::::::::::void:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 299 | "hpux-parisc1_1-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-Wl,+s -ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:${parisc11_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1", |
294 | "hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64", | 300 | "hpux-parisc2-gcc","gcc:-march=2.0 -O3 -DB_ENDIAN -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL DES_RISC1:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32", |
301 | "hpux64-parisc2-gcc","gcc:-O3 -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::::void:dlfcn:hpux-shared:-fpic:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64", | ||
295 | 302 | ||
296 | # More attempts at unified 10.X and 11.X targets for HP C compiler. | 303 | # More attempts at unified 10.X and 11.X targets for HP C compiler. |
297 | # | 304 | # |
298 | # Chris Ruemmler <ruemmler@cup.hp.com> | 305 | # Chris Ruemmler <ruemmler@cup.hp.com> |
299 | # Kevin Steves <ks@hp.se> | 306 | # Kevin Steves <ks@hp.se> |
300 | "hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 307 | "hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
301 | "hpux-parisc1_0-cc","cc:+DAportable +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${no_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 308 | "hpux-parisc1_1-cc","cc:+DA1.1 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT::-Wl,+s -ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc11_asm}:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa1.1", |
302 | "hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2.o::::::::::::void:dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 309 | "hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-Wl,+s -ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:".eval{my $asm=$parisc20_asm;$asm=~s/2W\./2\./;$asm=~s/:64/:32/;$asm}.":dl:hpux-shared:+Z:-b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_32", |
303 | "hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::pa-risc2W.o::::::::::::void:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64", | 310 | "hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:${parisc20_asm}:dlfcn:hpux-shared:+Z:+DD64 -b:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/pa20_64", |
304 | 311 | ||
305 | # HP/UX IA-64 targets | 312 | # HP/UX IA-64 targets |
306 | "hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/hpux32", | 313 | "hpux-ia64-cc","cc:-Ae +DD32 +O2 +Olit=all -z -DB_ENDIAN -D_REENTRANT::::-ldl:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX DES_UNROLL DES_RISC1 DES_INT:${ia64_asm}:dlfcn:hpux-shared:+Z:+DD32 -b:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/hpux32", |
@@ -351,8 +358,22 @@ my %table=( | |||
351 | "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 358 | "linux-ia64", "gcc:-DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
352 | "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 359 | "linux-ia64-ecc","ecc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
353 | "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 360 | "linux-ia64-icc","icc:-DL_ENDIAN -DTERMIO -O2 -Wall -no_cpprt::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
354 | "linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", | 361 | "linux-x86_64", "gcc:-m64 -DL_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", |
355 | "linux-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", | 362 | "linux64-s390x", "gcc:-m64 -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", |
363 | #### So called "highgprs" target for z/Architecture CPUs | ||
364 | # "Highgprs" is kernel feature first implemented in Linux 2.6.32, see | ||
365 | # /proc/cpuinfo. The idea is to preserve most significant bits of | ||
366 | # general purpose registers not only upon 32-bit process context | ||
367 | # switch, but even on asynchronous signal delivery to such process. | ||
368 | # This makes it possible to deploy 64-bit instructions even in legacy | ||
369 | # application context and achieve better [or should we say adequate] | ||
370 | # performance. The build is binary compatible with linux-generic32, | ||
371 | # and the idea is to be able to install the resulting libcrypto.so | ||
372 | # alongside generic one, e.g. as /lib/highgprs/libcrypto.so.x.y, for | ||
373 | # ldconfig and run-time linker to autodiscover. Unfortunately it | ||
374 | # doesn't work just yet, because of couple of bugs in glibc | ||
375 | # sysdeps/s390/dl-procinfo.c affecting ldconfig and ld.so.1... | ||
376 | "linux32-s390x", "gcc:-m31 -Wa,-mzarch -DB_ENDIAN -DTERMIO -O3 -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$s390x_asm;$asm=~s/bn\-s390x\.o/bn_asm.o/;$asm}.":31:dlfcn:linux-shared:-fPIC:-m31:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::/highgprs", | ||
356 | #### SPARC Linux setups | 377 | #### SPARC Linux setups |
357 | # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently | 378 | # Ray Miller <ray.miller@computing-services.oxford.ac.uk> has patiently |
358 | # assisted with debugging of following two configs. | 379 | # assisted with debugging of following two configs. |
@@ -380,6 +401,11 @@ my %table=( | |||
380 | "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", | 401 | "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", |
381 | "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", | 402 | "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", |
382 | 403 | ||
404 | # Android: linux-* but without -DTERMIO and pointers to headers and libs. | ||
405 | "android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | ||
406 | "android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | ||
407 | "android-armv7","gcc:-march=armv7-a -mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | ||
408 | |||
383 | #### *BSD [do see comment about ${BSDthreads} above!] | 409 | #### *BSD [do see comment about ${BSDthreads} above!] |
384 | "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 410 | "BSD-generic32","gcc:-DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
385 | "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 411 | "BSD-x86", "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -Wall::${BSDthreads}:::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
@@ -393,7 +419,7 @@ my %table=( | |||
393 | # triggered by RIPEMD160 code. | 419 | # triggered by RIPEMD160 code. |
394 | "BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 420 | "BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
395 | "BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 421 | "BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
396 | "BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 422 | "BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
397 | 423 | ||
398 | "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", | 424 | "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", |
399 | 425 | ||
@@ -490,13 +516,13 @@ my %table=( | |||
490 | # Visual C targets | 516 | # Visual C targets |
491 | # | 517 | # |
492 | # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 | 518 | # Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64 |
493 | "VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32", | 519 | "VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o ia64-mont.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32", |
494 | "VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32", | 520 | "VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32", |
495 | "debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32", | 521 | "debug-VC-WIN64I","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ghash-ia64.o::ias:win32", |
496 | "debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32", | 522 | "debug-VC-WIN64A","cl:-W3 -Gs0 -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:".eval{my $asm=$x86_64_asm;$asm=~s/x86_64-gcc\.o/bn_asm.o/;$asm}.":auto:win32", |
497 | # x86 Win32 target defaults to ANSI API, if you want UNICODE, complement | 523 | # x86 Win32 target defaults to ANSI API, if you want UNICODE, complement |
498 | # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE' | 524 | # 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE' |
499 | "VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", | 525 | "VC-WIN32","cl:-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", |
500 | # Unified CE target | 526 | # Unified CE target |
501 | "debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", | 527 | "debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32", |
502 | "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", | 528 | "VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32", |
@@ -551,10 +577,12 @@ my %table=( | |||
551 | "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", | 577 | "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::", |
552 | "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | 578 | "darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", |
553 | "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | 579 | "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", |
554 | "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | 580 | "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", |
555 | "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | 581 | "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", |
556 | "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | 582 | "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", |
557 | "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | 583 | "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", |
584 | # iPhoneOS/iOS | ||
585 | "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", | ||
558 | 586 | ||
559 | ##### A/UX | 587 | ##### A/UX |
560 | "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", | 588 | "aux3-gcc","gcc:-O2 -DTERMIO::(unknown):AUX:-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", |
@@ -569,18 +597,21 @@ my %table=( | |||
569 | "OS2-EMX", "gcc::::::::", | 597 | "OS2-EMX", "gcc::::::::", |
570 | 598 | ||
571 | ##### VxWorks for various targets | 599 | ##### VxWorks for various targets |
600 | "vxworks-ppc60x","ccppc:-D_REENTRANT -mrtp -mhard-float -mstrict-align -fno-implicit-fp -DPPC32_fp60x -O2 -fstrength-reduce -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/common:::::", | ||
601 | "vxworks-ppcgen","ccppc:-D_REENTRANT -mrtp -msoft-float -mstrict-align -O1 -fno-builtin -fno-strict-aliasing -Wall -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=gnu -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/usr/h/wrn/coreip:::VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/ppc/PPC32/sfcommon:::::", | ||
572 | "vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", | 602 | "vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", |
573 | "vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::", | 603 | "vxworks-ppc750","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h \$(DEBUG_FLAG):::VXWORKS:-r:::::", |
574 | "vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::", | 604 | "vxworks-ppc750-debug","ccppc:-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g:::VXWORKS:-r:::::", |
575 | "vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", | 605 | "vxworks-ppc860","ccppc:-nostdinc -msoft-float -DCPU=PPC860 -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r:::::", |
576 | "vxworks-mipsle","ccmips:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -DL_ENDIAN -EL -Wl,-EL -mips2 -mno-branch-likely -G 0 -fno-builtin -msoft-float -DCPU=MIPS32 -DMIPSEL -DNO_STRINGS_H -I\$(WIND_BASE)/target/h:::VXWORKS:-r::${no_asm}::::::ranlibmips:", | 606 | "vxworks-simlinux","ccpentium:-B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DL_ENDIAN -DCPU=SIMLINUX -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/h -I\$(WIND_BASE)/target/h/wrn/coreip -DOPENSSL_NO_HW_PADLOCK:::VXWORKS:-r::${no_asm}::::::ranlibpentium:", |
607 | "vxworks-mips","ccmips:-mrtp -mips2 -O -G 0 -B\$(WIND_BASE)/host/\$(WIND_HOST_TYPE)/lib/gcc-lib/ -D_VSB_CONFIG_FILE=\"\$(WIND_BASE)/target/lib/h/config/vsbConfig.h\" -DCPU=MIPS32 -msoft-float -mno-branch-likely -DTOOL_FAMILY=gnu -DTOOL=gnu -fno-builtin -fno-defer-pop -DNO_STRINGS_H -I\$(WIND_BASE)/target/usr/h -I\$(WIND_BASE)/target/h/wrn/coreip::-D_REENTRANT:VXWORKS:-Wl,--defsym,__wrs_rtp_base=0xe0000000 -L \$(WIND_BASE)/target/usr/lib/mips/MIPSI32/sfcommon::${mips32_asm}:o32::::::ranlibmips:", | ||
577 | 608 | ||
578 | ##### Compaq Non-Stop Kernel (Tandem) | 609 | ##### Compaq Non-Stop Kernel (Tandem) |
579 | "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::", | 610 | "tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::", |
580 | 611 | ||
581 | # uClinux | 612 | # uClinux |
582 | "uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::", | 613 | "uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:${no_asm}:$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::", |
583 | "uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::", | 614 | "uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:${no_asm}:$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::", |
584 | 615 | ||
585 | ); | 616 | ); |
586 | 617 | ||
@@ -612,6 +643,8 @@ my $idx_rmd160_obj = $idx++; | |||
612 | my $idx_rc5_obj = $idx++; | 643 | my $idx_rc5_obj = $idx++; |
613 | my $idx_wp_obj = $idx++; | 644 | my $idx_wp_obj = $idx++; |
614 | my $idx_cmll_obj = $idx++; | 645 | my $idx_cmll_obj = $idx++; |
646 | my $idx_modes_obj = $idx++; | ||
647 | my $idx_engines_obj = $idx++; | ||
615 | my $idx_perlasm_scheme = $idx++; | 648 | my $idx_perlasm_scheme = $idx++; |
616 | my $idx_dso_scheme = $idx++; | 649 | my $idx_dso_scheme = $idx++; |
617 | my $idx_shared_target = $idx++; | 650 | my $idx_shared_target = $idx++; |
@@ -628,6 +661,9 @@ my $openssldir=""; | |||
628 | my $exe_ext=""; | 661 | my $exe_ext=""; |
629 | my $install_prefix= "$ENV{'INSTALL_PREFIX'}"; | 662 | my $install_prefix= "$ENV{'INSTALL_PREFIX'}"; |
630 | my $cross_compile_prefix=""; | 663 | my $cross_compile_prefix=""; |
664 | my $fipsdir="/usr/local/ssl/fips-2.0"; | ||
665 | my $fipslibdir=""; | ||
666 | my $baseaddr="0xFB00000"; | ||
631 | my $no_threads=0; | 667 | my $no_threads=0; |
632 | my $threads=0; | 668 | my $threads=0; |
633 | my $no_shared=0; # but "no-shared" is default | 669 | my $no_shared=0; # but "no-shared" is default |
@@ -662,26 +698,34 @@ my $cmll_enc="camellia.o cmll_misc.o cmll_cbc.o"; | |||
662 | my $processor=""; | 698 | my $processor=""; |
663 | my $default_ranlib; | 699 | my $default_ranlib; |
664 | my $perl; | 700 | my $perl; |
701 | my $fips=0; | ||
665 | 702 | ||
703 | if (exists $ENV{FIPSDIR}) | ||
704 | { | ||
705 | $fipsdir = $ENV{FIPSDIR}; | ||
706 | $fipsdir =~ s/\/$//; | ||
707 | } | ||
666 | 708 | ||
667 | # All of the following is disabled by default (RC5 was enabled before 0.9.8): | 709 | # All of the following is disabled by default (RC5 was enabled before 0.9.8): |
668 | 710 | ||
669 | my %disabled = ( # "what" => "comment" [or special keyword "experimental"] | 711 | my %disabled = ( # "what" => "comment" [or special keyword "experimental"] |
712 | "ec_nistp_64_gcc_128" => "default", | ||
670 | "gmp" => "default", | 713 | "gmp" => "default", |
671 | "jpake" => "experimental", | 714 | "jpake" => "experimental", |
672 | "md2" => "default", | 715 | "md2" => "default", |
673 | "rc5" => "default", | 716 | "rc5" => "default", |
674 | "rfc3779" => "default", | 717 | "rfc3779" => "default", |
675 | "shared" => "default", | 718 | "sctp" => "default", |
719 | "shared" => "default", | ||
676 | "store" => "experimental", | 720 | "store" => "experimental", |
677 | "zlib" => "default", | 721 | "zlib" => "default", |
678 | "zlib-dynamic" => "default" | 722 | "zlib-dynamic" => "default" |
679 | ); | 723 | ); |
680 | my @experimental = (); | 724 | my @experimental = (); |
681 | 725 | ||
682 | # This is what $depflags will look like with the above defaults | 726 | # This is what $depflags will look like with the above defaults |
683 | # (we need this to see if we should advise the user to run "make depend"): | 727 | # (we need this to see if we should advise the user to run "make depend"): |
684 | my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE"; | 728 | my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE"; |
685 | 729 | ||
686 | # Explicit "no-..." options will be collected in %disabled along with the defaults. | 730 | # Explicit "no-..." options will be collected in %disabled along with the defaults. |
687 | # To remove something from %disabled, use "enable-foo" (unless it's experimental). | 731 | # To remove something from %disabled, use "enable-foo" (unless it's experimental). |
@@ -739,6 +783,7 @@ PROCESS_ARGS: | |||
739 | 783 | ||
740 | # rewrite some options in "enable-..." form | 784 | # rewrite some options in "enable-..." form |
741 | s /^-?-?shared$/enable-shared/; | 785 | s /^-?-?shared$/enable-shared/; |
786 | s /^sctp$/enable-sctp/; | ||
742 | s /^threads$/enable-threads/; | 787 | s /^threads$/enable-threads/; |
743 | s /^zlib$/enable-zlib/; | 788 | s /^zlib$/enable-zlib/; |
744 | s /^zlib-dynamic$/enable-zlib-dynamic/; | 789 | s /^zlib-dynamic$/enable-zlib-dynamic/; |
@@ -808,6 +853,10 @@ PROCESS_ARGS: | |||
808 | } | 853 | } |
809 | elsif (/^386$/) | 854 | elsif (/^386$/) |
810 | { $processor=386; } | 855 | { $processor=386; } |
856 | elsif (/^fips$/) | ||
857 | { | ||
858 | $fips=1; | ||
859 | } | ||
811 | elsif (/^rsaref$/) | 860 | elsif (/^rsaref$/) |
812 | { | 861 | { |
813 | # No RSAref support any more since it's not needed. | 862 | # No RSAref support any more since it's not needed. |
@@ -822,6 +871,7 @@ PROCESS_ARGS: | |||
822 | } | 871 | } |
823 | elsif (/^-[^-]/ or /^\+/) | 872 | elsif (/^-[^-]/ or /^\+/) |
824 | { | 873 | { |
874 | $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei; | ||
825 | $flags.=$_." "; | 875 | $flags.=$_." "; |
826 | } | 876 | } |
827 | elsif (/^--prefix=(.*)$/) | 877 | elsif (/^--prefix=(.*)$/) |
@@ -852,6 +902,18 @@ PROCESS_ARGS: | |||
852 | { | 902 | { |
853 | $withargs{"zlib-include"}="-I$1"; | 903 | $withargs{"zlib-include"}="-I$1"; |
854 | } | 904 | } |
905 | elsif (/^--with-fipsdir=(.*)$/) | ||
906 | { | ||
907 | $fipsdir="$1"; | ||
908 | } | ||
909 | elsif (/^--with-fipslibdir=(.*)$/) | ||
910 | { | ||
911 | $fipslibdir="$1"; | ||
912 | } | ||
913 | elsif (/^--with-baseaddr=(.*)$/) | ||
914 | { | ||
915 | $baseaddr="$1"; | ||
916 | } | ||
855 | elsif (/^--cross-compile-prefix=(.*)$/) | 917 | elsif (/^--cross-compile-prefix=(.*)$/) |
856 | { | 918 | { |
857 | $cross_compile_prefix=$1; | 919 | $cross_compile_prefix=$1; |
@@ -926,6 +988,17 @@ if (defined($disabled{"md5"}) || defined($disabled{"rsa"})) | |||
926 | $disabled{"ssl2"} = "forced"; | 988 | $disabled{"ssl2"} = "forced"; |
927 | } | 989 | } |
928 | 990 | ||
991 | if ($fips && $fipslibdir eq "") | ||
992 | { | ||
993 | $fipslibdir = $fipsdir . "/lib/"; | ||
994 | } | ||
995 | |||
996 | # RSAX ENGINE sets default non-FIPS RSA method. | ||
997 | if ($fips) | ||
998 | { | ||
999 | $disabled{"rsax"} = "forced"; | ||
1000 | } | ||
1001 | |||
929 | # SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH | 1002 | # SSL 3.0 and TLS requires MD5 and SHA and either RSA or DSA+DH |
930 | if (defined($disabled{"md5"}) || defined($disabled{"sha"}) | 1003 | if (defined($disabled{"md5"}) || defined($disabled{"sha"}) |
931 | || (defined($disabled{"rsa"}) | 1004 | || (defined($disabled{"rsa"}) |
@@ -946,6 +1019,13 @@ if (defined($disabled{"ec"}) || defined($disabled{"dsa"}) | |||
946 | $disabled{"gost"} = "forced"; | 1019 | $disabled{"gost"} = "forced"; |
947 | } | 1020 | } |
948 | 1021 | ||
1022 | # SRP and HEARTBEATS require TLSEXT | ||
1023 | if (defined($disabled{"tlsext"})) | ||
1024 | { | ||
1025 | $disabled{"srp"} = "forced"; | ||
1026 | $disabled{"heartbeats"} = "forced"; | ||
1027 | } | ||
1028 | |||
949 | if ($target eq "TABLE") { | 1029 | if ($target eq "TABLE") { |
950 | foreach $target (sort keys %table) { | 1030 | foreach $target (sort keys %table) { |
951 | print_table_entry($target); | 1031 | print_table_entry($target); |
@@ -995,7 +1075,7 @@ foreach (sort (keys %disabled)) | |||
995 | else | 1075 | else |
996 | { | 1076 | { |
997 | my ($ALGO, $algo); | 1077 | my ($ALGO, $algo); |
998 | ($ALGO = $algo = $_) =~ tr/[a-z]/[A-Z]/; | 1078 | ($ALGO = $algo = $_) =~ tr/[\-a-z]/[_A-Z]/; |
999 | 1079 | ||
1000 | if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/) | 1080 | if (/^asm$/ || /^err$/ || /^hw$/ || /^hw-/) |
1001 | { | 1081 | { |
@@ -1015,6 +1095,8 @@ foreach (sort (keys %disabled)) | |||
1015 | else | 1095 | else |
1016 | { | 1096 | { |
1017 | push @skip, $algo; | 1097 | push @skip, $algo; |
1098 | # fix-up crypto/directory name(s) | ||
1099 | @skip[$#skip]="whrlpool" if $algo eq "whirlpool"; | ||
1018 | print " (skip dir)"; | 1100 | print " (skip dir)"; |
1019 | 1101 | ||
1020 | $depflags .= " -DOPENSSL_NO_$ALGO"; | 1102 | $depflags .= " -DOPENSSL_NO_$ALGO"; |
@@ -1085,6 +1167,8 @@ my $rmd160_obj = $fields[$idx_rmd160_obj]; | |||
1085 | my $rc5_obj = $fields[$idx_rc5_obj]; | 1167 | my $rc5_obj = $fields[$idx_rc5_obj]; |
1086 | my $wp_obj = $fields[$idx_wp_obj]; | 1168 | my $wp_obj = $fields[$idx_wp_obj]; |
1087 | my $cmll_obj = $fields[$idx_cmll_obj]; | 1169 | my $cmll_obj = $fields[$idx_cmll_obj]; |
1170 | my $modes_obj = $fields[$idx_modes_obj]; | ||
1171 | my $engines_obj = $fields[$idx_engines_obj]; | ||
1088 | my $perlasm_scheme = $fields[$idx_perlasm_scheme]; | 1172 | my $perlasm_scheme = $fields[$idx_perlasm_scheme]; |
1089 | my $dso_scheme = $fields[$idx_dso_scheme]; | 1173 | my $dso_scheme = $fields[$idx_dso_scheme]; |
1090 | my $shared_target = $fields[$idx_shared_target]; | 1174 | my $shared_target = $fields[$idx_shared_target]; |
@@ -1245,7 +1329,7 @@ if ($no_asm) | |||
1245 | { | 1329 | { |
1246 | $cpuid_obj=$bn_obj= | 1330 | $cpuid_obj=$bn_obj= |
1247 | $des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=$cmll_obj= | 1331 | $des_obj=$aes_obj=$bf_obj=$cast_obj=$rc4_obj=$rc5_obj=$cmll_obj= |
1248 | $sha1_obj=$md5_obj=$rmd160_obj=$wp_obj=""; | 1332 | $modes_obj=$sha1_obj=$md5_obj=$rmd160_obj=$wp_obj=$engines_obj=""; |
1249 | } | 1333 | } |
1250 | 1334 | ||
1251 | if (!$no_shared) | 1335 | if (!$no_shared) |
@@ -1309,7 +1393,7 @@ if (!$IsMK1MF) | |||
1309 | } | 1393 | } |
1310 | } | 1394 | } |
1311 | 1395 | ||
1312 | $cpuid_obj.=" uplink.o uplink-cof.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/); | 1396 | $cpuid_obj.=" uplink.o uplink-x86.o" if ($cflags =~ /\-DOPENSSL_USE_APPLINK/); |
1313 | 1397 | ||
1314 | # | 1398 | # |
1315 | # Platform fix-ups | 1399 | # Platform fix-ups |
@@ -1377,6 +1461,14 @@ $cflags.=" -DOPENSSL_BN_ASM_PART_WORDS" if ($bn_obj =~ /bn-586/); | |||
1377 | $cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /86/); | 1461 | $cflags.=" -DOPENSSL_IA32_SSE2" if (!$no_sse2 && $bn_obj =~ /86/); |
1378 | 1462 | ||
1379 | $cflags.=" -DOPENSSL_BN_ASM_MONT" if ($bn_obj =~ /-mont/); | 1463 | $cflags.=" -DOPENSSL_BN_ASM_MONT" if ($bn_obj =~ /-mont/); |
1464 | $cflags.=" -DOPENSSL_BN_ASM_MONT5" if ($bn_obj =~ /-mont5/); | ||
1465 | $cflags.=" -DOPENSSL_BN_ASM_GF2m" if ($bn_obj =~ /-gf2m/); | ||
1466 | |||
1467 | if ($fips) | ||
1468 | { | ||
1469 | $openssl_other_defines.="#define OPENSSL_FIPS\n"; | ||
1470 | $cflags .= " -I\$(FIPSDIR)/include"; | ||
1471 | } | ||
1380 | 1472 | ||
1381 | $cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/); | 1473 | $cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/); |
1382 | $des_obj=$des_enc unless ($des_obj =~ /\.o$/); | 1474 | $des_obj=$des_enc unless ($des_obj =~ /\.o$/); |
@@ -1410,12 +1502,20 @@ if ($rmd160_obj =~ /\.o$/) | |||
1410 | if ($aes_obj =~ /\.o$/) | 1502 | if ($aes_obj =~ /\.o$/) |
1411 | { | 1503 | { |
1412 | $cflags.=" -DAES_ASM"; | 1504 | $cflags.=" -DAES_ASM"; |
1505 | # aes-ctr.o is not a real file, only indication that assembler | ||
1506 | # module implements AES_ctr32_encrypt... | ||
1507 | $cflags.=" -DAES_CTR_ASM" if ($aes_obj =~ s/\s*aes\-ctr\.o//); | ||
1508 | # aes-xts.o indicates presense of AES_xts_[en|de]crypt... | ||
1509 | $cflags.=" -DAES_XTS_ASM" if ($aes_obj =~ s/\s*aes\-xts\.o//); | ||
1510 | $aes_obj =~ s/\s*(vpaes|aesni)\-x86\.o//g if ($no_sse2); | ||
1511 | $cflags.=" -DVPAES_ASM" if ($aes_obj =~ m/vpaes/); | ||
1512 | $cflags.=" -DBSAES_ASM" if ($aes_obj =~ m/bsaes/); | ||
1413 | } | 1513 | } |
1414 | else { | 1514 | else { |
1415 | $aes_obj=$aes_enc; | 1515 | $aes_obj=$aes_enc; |
1416 | } | 1516 | } |
1417 | $wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386"); | 1517 | $wp_obj="" if ($wp_obj =~ /mmx/ && $processor eq "386"); |
1418 | if ($wp_obj =~ /\.o$/) | 1518 | if ($wp_obj =~ /\.o$/ && !$disabled{"whirlpool"}) |
1419 | { | 1519 | { |
1420 | $cflags.=" -DWHIRLPOOL_ASM"; | 1520 | $cflags.=" -DWHIRLPOOL_ASM"; |
1421 | } | 1521 | } |
@@ -1423,6 +1523,10 @@ else { | |||
1423 | $wp_obj="wp_block.o"; | 1523 | $wp_obj="wp_block.o"; |
1424 | } | 1524 | } |
1425 | $cmll_obj=$cmll_enc unless ($cmll_obj =~ /.o$/); | 1525 | $cmll_obj=$cmll_enc unless ($cmll_obj =~ /.o$/); |
1526 | if ($modes_obj =~ /ghash/) | ||
1527 | { | ||
1528 | $cflags.=" -DGHASH_ASM"; | ||
1529 | } | ||
1426 | 1530 | ||
1427 | # "Stringify" the C flags string. This permits it to be made part of a string | 1531 | # "Stringify" the C flags string. This permits it to be made part of a string |
1428 | # and works as well on command lines. | 1532 | # and works as well on command lines. |
@@ -1537,6 +1641,8 @@ while (<IN>) | |||
1537 | s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/; | 1641 | s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/; |
1538 | s/^WP_ASM_OBJ=.*$/WP_ASM_OBJ= $wp_obj/; | 1642 | s/^WP_ASM_OBJ=.*$/WP_ASM_OBJ= $wp_obj/; |
1539 | s/^CMLL_ENC=.*$/CMLL_ENC= $cmll_obj/; | 1643 | s/^CMLL_ENC=.*$/CMLL_ENC= $cmll_obj/; |
1644 | s/^MODES_ASM_OBJ.=*$/MODES_ASM_OBJ= $modes_obj/; | ||
1645 | s/^ENGINES_ASM_OBJ.=*$/ENGINES_ASM_OBJ= $engines_obj/; | ||
1540 | s/^PERLASM_SCHEME=.*$/PERLASM_SCHEME= $perlasm_scheme/; | 1646 | s/^PERLASM_SCHEME=.*$/PERLASM_SCHEME= $perlasm_scheme/; |
1541 | s/^PROCESSOR=.*/PROCESSOR= $processor/; | 1647 | s/^PROCESSOR=.*/PROCESSOR= $processor/; |
1542 | s/^ARFLAGS=.*/ARFLAGS= $arflags/; | 1648 | s/^ARFLAGS=.*/ARFLAGS= $arflags/; |
@@ -1545,6 +1651,12 @@ while (<IN>) | |||
1545 | s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/; | 1651 | s/^LIBKRB5=.*/LIBKRB5=$withargs{"krb5-lib"}/; |
1546 | s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/; | 1652 | s/^LIBZLIB=.*/LIBZLIB=$withargs{"zlib-lib"}/; |
1547 | s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/; | 1653 | s/^ZLIB_INCLUDE=.*/ZLIB_INCLUDE=$withargs{"zlib-include"}/; |
1654 | |||
1655 | s/^FIPSDIR=.*/FIPSDIR=$fipsdir/; | ||
1656 | s/^FIPSLIBDIR=.*/FIPSLIBDIR=$fipslibdir/; | ||
1657 | s/^FIPSCANLIB=.*/FIPSCANLIB=libcrypto/ if $fips; | ||
1658 | s/^BASEADDR=.*/BASEADDR=$baseaddr/; | ||
1659 | |||
1548 | s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/; | 1660 | s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/; |
1549 | s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/; | 1661 | s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/; |
1550 | s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared); | 1662 | s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared); |
@@ -1588,7 +1700,9 @@ print "RC5_ENC =$rc5_obj\n"; | |||
1588 | print "MD5_OBJ_ASM =$md5_obj\n"; | 1700 | print "MD5_OBJ_ASM =$md5_obj\n"; |
1589 | print "SHA1_OBJ_ASM =$sha1_obj\n"; | 1701 | print "SHA1_OBJ_ASM =$sha1_obj\n"; |
1590 | print "RMD160_OBJ_ASM=$rmd160_obj\n"; | 1702 | print "RMD160_OBJ_ASM=$rmd160_obj\n"; |
1591 | print "CMLL_ENC= =$cmll_obj\n"; | 1703 | print "CMLL_ENC =$cmll_obj\n"; |
1704 | print "MODES_OBJ =$modes_obj\n"; | ||
1705 | print "ENGINES_OBJ =$engines_obj\n"; | ||
1592 | print "PROCESSOR =$processor\n"; | 1706 | print "PROCESSOR =$processor\n"; |
1593 | print "RANLIB =$ranlib\n"; | 1707 | print "RANLIB =$ranlib\n"; |
1594 | print "ARFLAGS =$arflags\n"; | 1708 | print "ARFLAGS =$arflags\n"; |
@@ -1981,7 +2095,8 @@ sub print_table_entry | |||
1981 | (my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags, | 2095 | (my $cc,my $cflags,my $unistd,my $thread_cflag,my $sys_id,my $lflags, |
1982 | my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj, | 2096 | my $bn_ops,my $cpuid_obj,my $bn_obj,my $des_obj,my $aes_obj, my $bf_obj, |
1983 | my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj, | 2097 | my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj, |
1984 | my $rc5_obj,my $wp_obj,my $cmll_obj,my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag, | 2098 | my $rc5_obj,my $wp_obj,my $cmll_obj,my $modes_obj, my $engines_obj, |
2099 | my $perlasm_scheme,my $dso_scheme,my $shared_target,my $shared_cflag, | ||
1985 | my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)= | 2100 | my $shared_ldflag,my $shared_extension,my $ranlib,my $arflags,my $multilib)= |
1986 | split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); | 2101 | split(/\s*:\s*/,$table{$target} . ":" x 30 , -1); |
1987 | 2102 | ||
@@ -2008,6 +2123,8 @@ sub print_table_entry | |||
2008 | \$rc5_obj = $rc5_obj | 2123 | \$rc5_obj = $rc5_obj |
2009 | \$wp_obj = $wp_obj | 2124 | \$wp_obj = $wp_obj |
2010 | \$cmll_obj = $cmll_obj | 2125 | \$cmll_obj = $cmll_obj |
2126 | \$modes_obj = $modes_obj | ||
2127 | \$engines_obj = $engines_obj | ||
2011 | \$perlasm_scheme = $perlasm_scheme | 2128 | \$perlasm_scheme = $perlasm_scheme |
2012 | \$dso_scheme = $dso_scheme | 2129 | \$dso_scheme = $dso_scheme |
2013 | \$shared_target= $shared_target | 2130 | \$shared_target= $shared_target |
diff --git a/src/lib/libssl/src/FAQ b/src/lib/libssl/src/FAQ index 3b07cd363d..bb6f7e2d29 100644 --- a/src/lib/libssl/src/FAQ +++ b/src/lib/libssl/src/FAQ | |||
@@ -10,6 +10,7 @@ OpenSSL - Frequently Asked Questions | |||
10 | * Why aren't tools like 'autoconf' and 'libtool' used? | 10 | * Why aren't tools like 'autoconf' and 'libtool' used? |
11 | * What is an 'engine' version? | 11 | * What is an 'engine' version? |
12 | * How do I check the authenticity of the OpenSSL distribution? | 12 | * How do I check the authenticity of the OpenSSL distribution? |
13 | * How does the versioning scheme work? | ||
13 | 14 | ||
14 | [LEGAL] Legal questions | 15 | [LEGAL] Legal questions |
15 | 16 | ||
@@ -82,7 +83,7 @@ OpenSSL - Frequently Asked Questions | |||
82 | * Which is the current version of OpenSSL? | 83 | * Which is the current version of OpenSSL? |
83 | 84 | ||
84 | The current version is available from <URL: http://www.openssl.org>. | 85 | The current version is available from <URL: http://www.openssl.org>. |
85 | OpenSSL 1.0.0f was released on Jan 4th, 2012. | 86 | OpenSSL 1.0.1c was released on May 10th, 2012. |
86 | 87 | ||
87 | In addition to the current stable release, you can also access daily | 88 | In addition to the current stable release, you can also access daily |
88 | snapshots of the OpenSSL development version at <URL: | 89 | snapshots of the OpenSSL development version at <URL: |
@@ -108,7 +109,9 @@ In addition, you can read the most current versions at | |||
108 | <URL: http://www.openssl.org/docs/>. Note that the online documents refer | 109 | <URL: http://www.openssl.org/docs/>. Note that the online documents refer |
109 | to the very latest development versions of OpenSSL and may include features | 110 | to the very latest development versions of OpenSSL and may include features |
110 | not present in released versions. If in doubt refer to the documentation | 111 | not present in released versions. If in doubt refer to the documentation |
111 | that came with the version of OpenSSL you are using. | 112 | that came with the version of OpenSSL you are using. The pod format |
113 | documentation is included in each OpenSSL distribution under the docs | ||
114 | directory. | ||
112 | 115 | ||
113 | For information on parts of libcrypto that are not yet documented, you | 116 | For information on parts of libcrypto that are not yet documented, you |
114 | might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's | 117 | might want to read Ariel Glenn's documentation on SSLeay 0.9, OpenSSL's |
@@ -173,6 +176,19 @@ just do: | |||
173 | 176 | ||
174 | pgp TARBALL.asc | 177 | pgp TARBALL.asc |
175 | 178 | ||
179 | * How does the versioning scheme work? | ||
180 | |||
181 | After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter | ||
182 | releases (e.g. 1.0.1a) can only contain bug and security fixes and no | ||
183 | new features. Minor releases change the last number (e.g. 1.0.2) and | ||
184 | can contain new features that retain binary compatibility. Changes to | ||
185 | the middle number are considered major releases and neither source nor | ||
186 | binary compatibility is guaranteed. | ||
187 | |||
188 | Therefore the answer to the common question "when will feature X be | ||
189 | backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear | ||
190 | in the next minor release. | ||
191 | |||
176 | [LEGAL] ======================================================================= | 192 | [LEGAL] ======================================================================= |
177 | 193 | ||
178 | * Do I need patent licenses to use OpenSSL? | 194 | * Do I need patent licenses to use OpenSSL? |
@@ -284,7 +300,7 @@ current directory in this case, but this has changed with 0.9.6a.) | |||
284 | Check out the CA.pl(1) manual page. This provides a simple wrapper round | 300 | Check out the CA.pl(1) manual page. This provides a simple wrapper round |
285 | the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check | 301 | the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check |
286 | out the manual pages for the individual utilities and the certificate | 302 | out the manual pages for the individual utilities and the certificate |
287 | extensions documentation (currently in doc/openssl.txt). | 303 | extensions documentation (in ca(1), req(1), x509v3_config(5) ) |
288 | 304 | ||
289 | 305 | ||
290 | * Why can't I create certificate requests? | 306 | * Why can't I create certificate requests? |
diff --git a/src/lib/libssl/src/Makefile b/src/lib/libssl/src/Makefile index 8fe888587e..d5db11b417 100644 --- a/src/lib/libssl/src/Makefile +++ b/src/lib/libssl/src/Makefile | |||
@@ -4,16 +4,16 @@ | |||
4 | ## Makefile for OpenSSL | 4 | ## Makefile for OpenSSL |
5 | ## | 5 | ## |
6 | 6 | ||
7 | VERSION=1.0.0f | 7 | VERSION=1.0.1c |
8 | MAJOR=1 | 8 | MAJOR=1 |
9 | MINOR=0.0 | 9 | MINOR=0.1 |
10 | SHLIB_VERSION_NUMBER=1.0.0 | 10 | SHLIB_VERSION_NUMBER=1.0.0 |
11 | SHLIB_VERSION_HISTORY= | 11 | SHLIB_VERSION_HISTORY= |
12 | SHLIB_MAJOR=1 | 12 | SHLIB_MAJOR=1 |
13 | SHLIB_MINOR=0.0 | 13 | SHLIB_MINOR=0.0 |
14 | SHLIB_EXT= | 14 | SHLIB_EXT= |
15 | PLATFORM=dist | 15 | PLATFORM=dist |
16 | OPTIONS= no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-shared no-store no-zlib no-zlib-dynamic static-engine | 16 | OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-store no-zlib no-zlib-dynamic static-engine |
17 | CONFIGURE_ARGS=dist | 17 | CONFIGURE_ARGS=dist |
18 | SHLIB_TARGET= | 18 | SHLIB_TARGET= |
19 | 19 | ||
@@ -61,7 +61,7 @@ OPENSSLDIR=/usr/local/ssl | |||
61 | 61 | ||
62 | CC= cc | 62 | CC= cc |
63 | CFLAG= -O | 63 | CFLAG= -O |
64 | DEPFLAG= -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE | 64 | DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_STORE |
65 | PEX_LIBS= | 65 | PEX_LIBS= |
66 | EX_LIBS= | 66 | EX_LIBS= |
67 | EXE_EXT= | 67 | EXE_EXT= |
@@ -101,6 +101,8 @@ SHA1_ASM_OBJ= | |||
101 | RMD160_ASM_OBJ= | 101 | RMD160_ASM_OBJ= |
102 | WP_ASM_OBJ= wp_block.o | 102 | WP_ASM_OBJ= wp_block.o |
103 | CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o | 103 | CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o |
104 | MODES_ASM_OBJ= | ||
105 | ENGINES_ASM_OBJ= | ||
104 | PERLASM_SCHEME= | 106 | PERLASM_SCHEME= |
105 | 107 | ||
106 | # KRB5 stuff | 108 | # KRB5 stuff |
@@ -111,6 +113,30 @@ LIBKRB5= | |||
111 | ZLIB_INCLUDE= | 113 | ZLIB_INCLUDE= |
112 | LIBZLIB= | 114 | LIBZLIB= |
113 | 115 | ||
116 | # TOP level FIPS install directory. | ||
117 | FIPSDIR=/usr/local/ssl/fips-2.0 | ||
118 | |||
119 | # This is the location of fipscanister.o and friends. | ||
120 | # The FIPS module build will place it $(INSTALLTOP)/lib | ||
121 | # but since $(INSTALLTOP) can only take the default value | ||
122 | # when the module is built it will be in /usr/local/ssl/lib | ||
123 | # $(INSTALLTOP) for this build may be different so hard | ||
124 | # code the path. | ||
125 | |||
126 | FIPSLIBDIR= | ||
127 | |||
128 | # The location of the library which contains fipscanister.o | ||
129 | # normally it will be libcrypto unless fipsdso is set in which | ||
130 | # case it will be libfips. If not compiling in FIPS mode at all | ||
131 | # this is empty making it a useful test for a FIPS compile. | ||
132 | |||
133 | FIPSCANLIB= | ||
134 | |||
135 | # Shared library base address. Currently only used on Windows. | ||
136 | # | ||
137 | |||
138 | BASEADDR=0xFB00000 | ||
139 | |||
114 | DIRS= crypto ssl engines apps test tools | 140 | DIRS= crypto ssl engines apps test tools |
115 | ENGDIRS= ccgost | 141 | ENGDIRS= ccgost |
116 | SHLIBDIRS= crypto ssl | 142 | SHLIBDIRS= crypto ssl |
@@ -123,7 +149,7 @@ SDIRS= \ | |||
123 | bn ec rsa dsa ecdsa dh ecdh dso engine \ | 149 | bn ec rsa dsa ecdsa dh ecdh dso engine \ |
124 | buffer bio stack lhash rand err \ | 150 | buffer bio stack lhash rand err \ |
125 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ | 151 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ |
126 | cms pqueue ts | 152 | cms pqueue ts srp cmac |
127 | # keep in mind that the above list is adjusted by ./Configure | 153 | # keep in mind that the above list is adjusted by ./Configure |
128 | # according to no-xxx arguments... | 154 | # according to no-xxx arguments... |
129 | 155 | ||
@@ -174,7 +200,7 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ | |||
174 | $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ | 200 | $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ |
175 | $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ | 201 | $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ |
176 | $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ | 202 | $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ |
177 | $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \ | 203 | $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \ |
178 | $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ | 204 | $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ |
179 | $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} | 205 | $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} |
180 | 206 | ||
@@ -206,7 +232,12 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ | |||
206 | MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ | 232 | MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ |
207 | RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ | 233 | RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ |
208 | WP_ASM_OBJ='$(WP_ASM_OBJ)' \ | 234 | WP_ASM_OBJ='$(WP_ASM_OBJ)' \ |
235 | MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \ | ||
236 | ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \ | ||
209 | PERLASM_SCHEME='$(PERLASM_SCHEME)' \ | 237 | PERLASM_SCHEME='$(PERLASM_SCHEME)' \ |
238 | FIPSLIBDIR='${FIPSLIBDIR}' \ | ||
239 | FIPSDIR='${FIPSDIR}' \ | ||
240 | FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \ | ||
210 | THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= | 241 | THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= |
211 | # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, | 242 | # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, |
212 | # which in turn eliminates ambiguities in variable treatment with -e. | 243 | # which in turn eliminates ambiguities in variable treatment with -e. |
@@ -260,9 +291,20 @@ all_testapps: build_libs build_testapps | |||
260 | build_testapps: | 291 | build_testapps: |
261 | @dir=crypto; target=testapps; $(BUILD_ONE_CMD) | 292 | @dir=crypto; target=testapps; $(BUILD_ONE_CMD) |
262 | 293 | ||
263 | libcrypto$(SHLIB_EXT): libcrypto.a | 294 | fips_premain_dso$(EXE_EXT): libcrypto.a |
295 | [ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \ | ||
296 | -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \ | ||
297 | $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \ | ||
298 | libcrypto.a $(EX_LIBS) | ||
299 | |||
300 | libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT) | ||
264 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ | 301 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
265 | $(MAKE) SHLIBDIRS=crypto build-shared; \ | 302 | if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ |
303 | FIPSLD_LIBCRYPTO=libcrypto.a ; \ | ||
304 | FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ | ||
305 | export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ | ||
306 | fi; \ | ||
307 | $(MAKE) -e SHLIBDIRS=crypto build-shared; \ | ||
266 | else \ | 308 | else \ |
267 | echo "There's no support for shared libraries on this platform" >&2; \ | 309 | echo "There's no support for shared libraries on this platform" >&2; \ |
268 | exit 1; \ | 310 | exit 1; \ |
@@ -324,7 +366,8 @@ libcrypto.pc: Makefile | |||
324 | echo 'Description: OpenSSL cryptography library'; \ | 366 | echo 'Description: OpenSSL cryptography library'; \ |
325 | echo 'Version: '$(VERSION); \ | 367 | echo 'Version: '$(VERSION); \ |
326 | echo 'Requires: '; \ | 368 | echo 'Requires: '; \ |
327 | echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \ | 369 | echo 'Libs: -L$${libdir} -lcrypto'; \ |
370 | echo 'Libs.private: $(EX_LIBS)'; \ | ||
328 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc | 371 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc |
329 | 372 | ||
330 | libssl.pc: Makefile | 373 | libssl.pc: Makefile |
@@ -337,7 +380,8 @@ libssl.pc: Makefile | |||
337 | echo 'Description: Secure Sockets Layer and cryptography libraries'; \ | 380 | echo 'Description: Secure Sockets Layer and cryptography libraries'; \ |
338 | echo 'Version: '$(VERSION); \ | 381 | echo 'Version: '$(VERSION); \ |
339 | echo 'Requires: '; \ | 382 | echo 'Requires: '; \ |
340 | echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ | 383 | echo 'Libs: -L$${libdir} -lssl -lcrypto'; \ |
384 | echo 'Libs.private: $(EX_LIBS)'; \ | ||
341 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc | 385 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc |
342 | 386 | ||
343 | openssl.pc: Makefile | 387 | openssl.pc: Makefile |
@@ -350,7 +394,8 @@ openssl.pc: Makefile | |||
350 | echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ | 394 | echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ |
351 | echo 'Version: '$(VERSION); \ | 395 | echo 'Version: '$(VERSION); \ |
352 | echo 'Requires: '; \ | 396 | echo 'Requires: '; \ |
353 | echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ | 397 | echo 'Libs: -L$${libdir} -lssl -lcrypto'; \ |
398 | echo 'Libs.private: $(EX_LIBS)'; \ | ||
354 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc | 399 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc |
355 | 400 | ||
356 | Makefile: Makefile.org Configure config | 401 | Makefile: Makefile.org Configure config |
@@ -359,7 +404,7 @@ Makefile: Makefile.org Configure config | |||
359 | @false | 404 | @false |
360 | 405 | ||
361 | libclean: | 406 | libclean: |
362 | rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib | 407 | rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib |
363 | 408 | ||
364 | clean: libclean | 409 | clean: libclean |
365 | rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c | 410 | rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c |
@@ -426,9 +471,9 @@ tags: | |||
426 | find . -name '[^.]*.[ch]' | xargs etags -a | 471 | find . -name '[^.]*.[ch]' | xargs etags -a |
427 | 472 | ||
428 | errors: | 473 | errors: |
474 | $(PERL) util/ck_errf.pl -strict */*.c */*/*.c | ||
429 | $(PERL) util/mkerr.pl -recurse -write | 475 | $(PERL) util/mkerr.pl -recurse -write |
430 | (cd engines; $(MAKE) PERL=$(PERL) errors) | 476 | (cd engines; $(MAKE) PERL=$(PERL) errors) |
431 | $(PERL) util/ck_errf.pl */*.c */*/*.c | ||
432 | 477 | ||
433 | stacks: | 478 | stacks: |
434 | $(PERL) util/mkstack.pl -write | 479 | $(PERL) util/mkstack.pl -write |
@@ -511,7 +556,7 @@ install_sw: | |||
511 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | 556 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ |
512 | done; | 557 | done; |
513 | @set -e; target=install; $(RECURSIVE_BUILD_CMD) | 558 | @set -e; target=install; $(RECURSIVE_BUILD_CMD) |
514 | @set -e; for i in $(LIBS) ;\ | 559 | @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ |
515 | do \ | 560 | do \ |
516 | if [ -f "$$i" ]; then \ | 561 | if [ -f "$$i" ]; then \ |
517 | ( echo installing $$i; \ | 562 | ( echo installing $$i; \ |
diff --git a/src/lib/libssl/src/Makefile.org b/src/lib/libssl/src/Makefile.org index fb0af7ecc2..55273ea364 100644 --- a/src/lib/libssl/src/Makefile.org +++ b/src/lib/libssl/src/Makefile.org | |||
@@ -99,6 +99,8 @@ SHA1_ASM_OBJ= | |||
99 | RMD160_ASM_OBJ= | 99 | RMD160_ASM_OBJ= |
100 | WP_ASM_OBJ= | 100 | WP_ASM_OBJ= |
101 | CMLL_ENC= | 101 | CMLL_ENC= |
102 | MODES_ASM_OBJ= | ||
103 | ENGINES_ASM_OBJ= | ||
102 | PERLASM_SCHEME= | 104 | PERLASM_SCHEME= |
103 | 105 | ||
104 | # KRB5 stuff | 106 | # KRB5 stuff |
@@ -109,6 +111,30 @@ LIBKRB5= | |||
109 | ZLIB_INCLUDE= | 111 | ZLIB_INCLUDE= |
110 | LIBZLIB= | 112 | LIBZLIB= |
111 | 113 | ||
114 | # TOP level FIPS install directory. | ||
115 | FIPSDIR= | ||
116 | |||
117 | # This is the location of fipscanister.o and friends. | ||
118 | # The FIPS module build will place it $(INSTALLTOP)/lib | ||
119 | # but since $(INSTALLTOP) can only take the default value | ||
120 | # when the module is built it will be in /usr/local/ssl/lib | ||
121 | # $(INSTALLTOP) for this build may be different so hard | ||
122 | # code the path. | ||
123 | |||
124 | FIPSLIBDIR= | ||
125 | |||
126 | # The location of the library which contains fipscanister.o | ||
127 | # normally it will be libcrypto unless fipsdso is set in which | ||
128 | # case it will be libfips. If not compiling in FIPS mode at all | ||
129 | # this is empty making it a useful test for a FIPS compile. | ||
130 | |||
131 | FIPSCANLIB= | ||
132 | |||
133 | # Shared library base address. Currently only used on Windows. | ||
134 | # | ||
135 | |||
136 | BASEADDR= | ||
137 | |||
112 | DIRS= crypto ssl engines apps test tools | 138 | DIRS= crypto ssl engines apps test tools |
113 | ENGDIRS= ccgost | 139 | ENGDIRS= ccgost |
114 | SHLIBDIRS= crypto ssl | 140 | SHLIBDIRS= crypto ssl |
@@ -121,7 +147,7 @@ SDIRS= \ | |||
121 | bn ec rsa dsa ecdsa dh ecdh dso engine \ | 147 | bn ec rsa dsa ecdsa dh ecdh dso engine \ |
122 | buffer bio stack lhash rand err \ | 148 | buffer bio stack lhash rand err \ |
123 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ | 149 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ |
124 | cms pqueue ts jpake store | 150 | cms pqueue ts jpake srp store cmac |
125 | # keep in mind that the above list is adjusted by ./Configure | 151 | # keep in mind that the above list is adjusted by ./Configure |
126 | # according to no-xxx arguments... | 152 | # according to no-xxx arguments... |
127 | 153 | ||
@@ -172,7 +198,7 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ | |||
172 | $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ | 198 | $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ |
173 | $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ | 199 | $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ |
174 | $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ | 200 | $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ |
175 | $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \ | 201 | $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \ |
176 | $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ | 202 | $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ |
177 | $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} | 203 | $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} |
178 | 204 | ||
@@ -204,7 +230,12 @@ BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ | |||
204 | MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ | 230 | MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ |
205 | RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ | 231 | RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ |
206 | WP_ASM_OBJ='$(WP_ASM_OBJ)' \ | 232 | WP_ASM_OBJ='$(WP_ASM_OBJ)' \ |
233 | MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \ | ||
234 | ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \ | ||
207 | PERLASM_SCHEME='$(PERLASM_SCHEME)' \ | 235 | PERLASM_SCHEME='$(PERLASM_SCHEME)' \ |
236 | FIPSLIBDIR='${FIPSLIBDIR}' \ | ||
237 | FIPSDIR='${FIPSDIR}' \ | ||
238 | FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \ | ||
208 | THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= | 239 | THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= |
209 | # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, | 240 | # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, |
210 | # which in turn eliminates ambiguities in variable treatment with -e. | 241 | # which in turn eliminates ambiguities in variable treatment with -e. |
@@ -258,9 +289,20 @@ all_testapps: build_libs build_testapps | |||
258 | build_testapps: | 289 | build_testapps: |
259 | @dir=crypto; target=testapps; $(BUILD_ONE_CMD) | 290 | @dir=crypto; target=testapps; $(BUILD_ONE_CMD) |
260 | 291 | ||
261 | libcrypto$(SHLIB_EXT): libcrypto.a | 292 | fips_premain_dso$(EXE_EXT): libcrypto.a |
293 | [ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \ | ||
294 | -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \ | ||
295 | $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \ | ||
296 | libcrypto.a $(EX_LIBS) | ||
297 | |||
298 | libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT) | ||
262 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ | 299 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
263 | $(MAKE) SHLIBDIRS=crypto build-shared; \ | 300 | if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ |
301 | FIPSLD_LIBCRYPTO=libcrypto.a ; \ | ||
302 | FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ | ||
303 | export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ | ||
304 | fi; \ | ||
305 | $(MAKE) -e SHLIBDIRS=crypto build-shared; \ | ||
264 | else \ | 306 | else \ |
265 | echo "There's no support for shared libraries on this platform" >&2; \ | 307 | echo "There's no support for shared libraries on this platform" >&2; \ |
266 | exit 1; \ | 308 | exit 1; \ |
@@ -322,7 +364,8 @@ libcrypto.pc: Makefile | |||
322 | echo 'Description: OpenSSL cryptography library'; \ | 364 | echo 'Description: OpenSSL cryptography library'; \ |
323 | echo 'Version: '$(VERSION); \ | 365 | echo 'Version: '$(VERSION); \ |
324 | echo 'Requires: '; \ | 366 | echo 'Requires: '; \ |
325 | echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \ | 367 | echo 'Libs: -L$${libdir} -lcrypto'; \ |
368 | echo 'Libs.private: $(EX_LIBS)'; \ | ||
326 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc | 369 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc |
327 | 370 | ||
328 | libssl.pc: Makefile | 371 | libssl.pc: Makefile |
@@ -335,7 +378,8 @@ libssl.pc: Makefile | |||
335 | echo 'Description: Secure Sockets Layer and cryptography libraries'; \ | 378 | echo 'Description: Secure Sockets Layer and cryptography libraries'; \ |
336 | echo 'Version: '$(VERSION); \ | 379 | echo 'Version: '$(VERSION); \ |
337 | echo 'Requires: '; \ | 380 | echo 'Requires: '; \ |
338 | echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ | 381 | echo 'Libs: -L$${libdir} -lssl -lcrypto'; \ |
382 | echo 'Libs.private: $(EX_LIBS)'; \ | ||
339 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc | 383 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc |
340 | 384 | ||
341 | openssl.pc: Makefile | 385 | openssl.pc: Makefile |
@@ -348,7 +392,8 @@ openssl.pc: Makefile | |||
348 | echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ | 392 | echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ |
349 | echo 'Version: '$(VERSION); \ | 393 | echo 'Version: '$(VERSION); \ |
350 | echo 'Requires: '; \ | 394 | echo 'Requires: '; \ |
351 | echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ | 395 | echo 'Libs: -L$${libdir} -lssl -lcrypto'; \ |
396 | echo 'Libs.private: $(EX_LIBS)'; \ | ||
352 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc | 397 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc |
353 | 398 | ||
354 | Makefile: Makefile.org Configure config | 399 | Makefile: Makefile.org Configure config |
@@ -357,7 +402,7 @@ Makefile: Makefile.org Configure config | |||
357 | @false | 402 | @false |
358 | 403 | ||
359 | libclean: | 404 | libclean: |
360 | rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib | 405 | rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib |
361 | 406 | ||
362 | clean: libclean | 407 | clean: libclean |
363 | rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c | 408 | rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c |
@@ -424,9 +469,9 @@ tags: | |||
424 | find . -name '[^.]*.[ch]' | xargs etags -a | 469 | find . -name '[^.]*.[ch]' | xargs etags -a |
425 | 470 | ||
426 | errors: | 471 | errors: |
472 | $(PERL) util/ck_errf.pl -strict */*.c */*/*.c | ||
427 | $(PERL) util/mkerr.pl -recurse -write | 473 | $(PERL) util/mkerr.pl -recurse -write |
428 | (cd engines; $(MAKE) PERL=$(PERL) errors) | 474 | (cd engines; $(MAKE) PERL=$(PERL) errors) |
429 | $(PERL) util/ck_errf.pl */*.c */*/*.c | ||
430 | 475 | ||
431 | stacks: | 476 | stacks: |
432 | $(PERL) util/mkstack.pl -write | 477 | $(PERL) util/mkstack.pl -write |
@@ -509,7 +554,7 @@ install_sw: | |||
509 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | 554 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ |
510 | done; | 555 | done; |
511 | @set -e; target=install; $(RECURSIVE_BUILD_CMD) | 556 | @set -e; target=install; $(RECURSIVE_BUILD_CMD) |
512 | @set -e; for i in $(LIBS) ;\ | 557 | @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ |
513 | do \ | 558 | do \ |
514 | if [ -f "$$i" ]; then \ | 559 | if [ -f "$$i" ]; then \ |
515 | ( echo installing $$i; \ | 560 | ( echo installing $$i; \ |
diff --git a/src/lib/libssl/src/NEWS b/src/lib/libssl/src/NEWS index 1fb25c626c..4f069cbd14 100644 --- a/src/lib/libssl/src/NEWS +++ b/src/lib/libssl/src/NEWS | |||
@@ -5,6 +5,46 @@ | |||
5 | This file gives a brief overview of the major changes between each OpenSSL | 5 | This file gives a brief overview of the major changes between each OpenSSL |
6 | release. For more details please read the CHANGES file. | 6 | release. For more details please read the CHANGES file. |
7 | 7 | ||
8 | Major changes between OpenSSL 1.0.1b and OpenSSL 1.0.1c: | ||
9 | |||
10 | o Fix TLS/DTLS record length checking bug CVE-2012-2333 | ||
11 | o Don't attempt to use non-FIPS composite ciphers in FIPS mode. | ||
12 | |||
13 | Major changes between OpenSSL 1.0.1a and OpenSSL 1.0.1b: | ||
14 | |||
15 | o Fix compilation error on non-x86 platforms. | ||
16 | o Make FIPS capable OpenSSL ciphers work in non-FIPS mode. | ||
17 | o Fix SSL_OP_NO_TLSv1_1 clash with SSL_OP_ALL in OpenSSL 1.0.0 | ||
18 | |||
19 | Major changes between OpenSSL 1.0.1 and OpenSSL 1.0.1a: | ||
20 | |||
21 | o Fix for ASN1 overflow bug CVE-2012-2110 | ||
22 | o Workarounds for some servers that hang on long client hellos. | ||
23 | o Fix SEGV in AES code. | ||
24 | |||
25 | Major changes between OpenSSL 1.0.0h and OpenSSL 1.0.1: | ||
26 | |||
27 | o TLS/DTLS heartbeat support. | ||
28 | o SCTP support. | ||
29 | o RFC 5705 TLS key material exporter. | ||
30 | o RFC 5764 DTLS-SRTP negotiation. | ||
31 | o Next Protocol Negotiation. | ||
32 | o PSS signatures in certificates, requests and CRLs. | ||
33 | o Support for password based recipient info for CMS. | ||
34 | o Support TLS v1.2 and TLS v1.1. | ||
35 | o Preliminary FIPS capability for unvalidated 2.0 FIPS module. | ||
36 | o SRP support. | ||
37 | |||
38 | Major changes between OpenSSL 1.0.0g and OpenSSL 1.0.0h: | ||
39 | |||
40 | o Fix for CMS/PKCS#7 MMA CVE-2012-0884 | ||
41 | o Corrected fix for CVE-2011-4619 | ||
42 | o Various DTLS fixes. | ||
43 | |||
44 | Major changes between OpenSSL 1.0.0f and OpenSSL 1.0.0g: | ||
45 | |||
46 | o Fix for DTLS DoS issue CVE-2012-0050 | ||
47 | |||
8 | Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f: | 48 | Major changes between OpenSSL 1.0.0e and OpenSSL 1.0.0f: |
9 | 49 | ||
10 | o Fix for DTLS plaintext recovery attack CVE-2011-4108 | 50 | o Fix for DTLS plaintext recovery attack CVE-2011-4108 |
diff --git a/src/lib/libssl/src/README b/src/lib/libssl/src/README index 50d54d5706..de51583a6f 100644 --- a/src/lib/libssl/src/README +++ b/src/lib/libssl/src/README | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | OpenSSL 1.0.0f 4 Jan 2012 | 2 | OpenSSL 1.0.1c 10 May 2012 |
3 | 3 | ||
4 | Copyright (c) 1998-2011 The OpenSSL Project | 4 | Copyright (c) 1998-2011 The OpenSSL Project |
5 | Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson | 5 | Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson |
diff --git a/src/lib/libssl/src/apps/Makefile b/src/lib/libssl/src/apps/Makefile index fa32d2d7e7..95f499e330 100644 --- a/src/lib/libssl/src/apps/Makefile +++ b/src/lib/libssl/src/apps/Makefile | |||
@@ -39,7 +39,7 @@ E_EXE= verify asn1pars req dgst dh dhparam enc passwd gendh errstr \ | |||
39 | ca crl rsa rsautl dsa dsaparam ec ecparam \ | 39 | ca crl rsa rsautl dsa dsaparam ec ecparam \ |
40 | x509 genrsa gendsa genpkey s_server s_client speed \ | 40 | x509 genrsa gendsa genpkey s_server s_client speed \ |
41 | s_time version pkcs7 cms crl2pkcs7 sess_id ciphers nseq pkcs12 \ | 41 | s_time version pkcs7 cms crl2pkcs7 sess_id ciphers nseq pkcs12 \ |
42 | pkcs8 pkey pkeyparam pkeyutl spkac smime rand engine ocsp prime ts | 42 | pkcs8 pkey pkeyparam pkeyutl spkac smime rand engine ocsp prime ts srp |
43 | 43 | ||
44 | PROGS= $(PROGRAM).c | 44 | PROGS= $(PROGRAM).c |
45 | 45 | ||
@@ -56,7 +56,7 @@ E_OBJ= verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o er | |||
56 | x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o \ | 56 | x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o \ |
57 | s_time.o $(A_OBJ) $(S_OBJ) $(RAND_OBJ) version.o sess_id.o \ | 57 | s_time.o $(A_OBJ) $(S_OBJ) $(RAND_OBJ) version.o sess_id.o \ |
58 | ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o \ | 58 | ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o \ |
59 | spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o | 59 | spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o |
60 | 60 | ||
61 | E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.c \ | 61 | E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca.c \ |
62 | pkcs7.c crl2p7.c crl.c \ | 62 | pkcs7.c crl2p7.c crl.c \ |
@@ -64,7 +64,7 @@ E_SRC= verify.c asn1pars.c req.c dgst.c dh.c enc.c passwd.c gendh.c errstr.c ca. | |||
64 | x509.c genrsa.c gendsa.c genpkey.c s_server.c s_client.c speed.c \ | 64 | x509.c genrsa.c gendsa.c genpkey.c s_server.c s_client.c speed.c \ |
65 | s_time.c $(A_SRC) $(S_SRC) $(RAND_SRC) version.c sess_id.c \ | 65 | s_time.c $(A_SRC) $(S_SRC) $(RAND_SRC) version.c sess_id.c \ |
66 | ciphers.c nseq.c pkcs12.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c \ | 66 | ciphers.c nseq.c pkcs12.c pkcs8.c pkey.c pkeyparam.c pkeyutl.c \ |
67 | spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c | 67 | spkac.c smime.c cms.c rand.c engine.c ocsp.c prime.c ts.c srp.c |
68 | 68 | ||
69 | SRC=$(E_SRC) | 69 | SRC=$(E_SRC) |
70 | 70 | ||
@@ -153,6 +153,8 @@ $(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL) | |||
153 | $(RM) $(EXE) | 153 | $(RM) $(EXE) |
154 | shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ | 154 | shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ |
155 | shlib_target="$(SHLIB_TARGET)"; \ | 155 | shlib_target="$(SHLIB_TARGET)"; \ |
156 | elif [ -n "$(FIPSCANLIB)" ]; then \ | ||
157 | FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; export CC FIPSLD_CC; \ | ||
156 | fi; \ | 158 | fi; \ |
157 | LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \ | 159 | LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \ |
158 | $(MAKE) -f $(TOP)/Makefile.shared -e \ | 160 | $(MAKE) -f $(TOP)/Makefile.shared -e \ |
@@ -245,13 +247,13 @@ ciphers.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
245 | ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 247 | ciphers.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
246 | ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 248 | ciphers.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
247 | ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 249 | ciphers.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
248 | ciphers.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 250 | ciphers.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
249 | ciphers.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 251 | ciphers.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
250 | ciphers.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 252 | ciphers.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
251 | ciphers.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 253 | ciphers.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
252 | ciphers.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 254 | ciphers.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
253 | ciphers.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 255 | ciphers.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
254 | ciphers.o: ciphers.c | 256 | ciphers.o: ../include/openssl/x509v3.h apps.h ciphers.c |
255 | cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 257 | cms.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
256 | cms.o: ../include/openssl/buffer.h ../include/openssl/cms.h | 258 | cms.o: ../include/openssl/buffer.h ../include/openssl/cms.h |
257 | cms.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 259 | cms.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -427,13 +429,13 @@ engine.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
427 | engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 429 | engine.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
428 | engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 430 | engine.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
429 | engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 431 | engine.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
430 | engine.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 432 | engine.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
431 | engine.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 433 | engine.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
432 | engine.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 434 | engine.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
433 | engine.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 435 | engine.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
434 | engine.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 436 | engine.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
435 | engine.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 437 | engine.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
436 | engine.o: engine.c | 438 | engine.o: ../include/openssl/x509v3.h apps.h engine.c |
437 | errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 439 | errstr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
438 | errstr.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 440 | errstr.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
439 | errstr.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 441 | errstr.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -448,13 +450,13 @@ errstr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
448 | errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 450 | errstr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
449 | errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 451 | errstr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
450 | errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 452 | errstr.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
451 | errstr.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 453 | errstr.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
452 | errstr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 454 | errstr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
453 | errstr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 455 | errstr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
454 | errstr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 456 | errstr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
455 | errstr.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 457 | errstr.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
456 | errstr.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 458 | errstr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
457 | errstr.o: errstr.c | 459 | errstr.o: ../include/openssl/x509v3.h apps.h errstr.c |
458 | gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 460 | gendh.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
459 | gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 461 | gendh.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
460 | gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 462 | gendh.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -556,12 +558,12 @@ ocsp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
556 | ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 558 | ocsp.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
557 | ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 559 | ocsp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
558 | ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 560 | ocsp.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
559 | ocsp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 561 | ocsp.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
560 | ocsp.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 562 | ocsp.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
561 | ocsp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 563 | ocsp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
562 | ocsp.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h | 564 | ocsp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
563 | ocsp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h | 565 | ocsp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h |
564 | ocsp.o: ../include/openssl/x509v3.h apps.h ocsp.c | 566 | ocsp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h ocsp.c |
565 | openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 567 | openssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
566 | openssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 568 | openssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
567 | openssl.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 569 | openssl.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -576,13 +578,13 @@ openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
576 | openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 578 | openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
577 | openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 579 | openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
578 | openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 580 | openssl.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
579 | openssl.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 581 | openssl.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
580 | openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 582 | openssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
581 | openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 583 | openssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
582 | openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 584 | openssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
583 | openssl.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 585 | openssl.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
584 | openssl.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 586 | openssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
585 | openssl.o: openssl.c progs.h s_apps.h | 587 | openssl.o: ../include/openssl/x509v3.h apps.h openssl.c progs.h s_apps.h |
586 | passwd.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 588 | passwd.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
587 | passwd.o: ../include/openssl/buffer.h ../include/openssl/conf.h | 589 | passwd.o: ../include/openssl/buffer.h ../include/openssl/conf.h |
588 | passwd.o: ../include/openssl/crypto.h ../include/openssl/des.h | 590 | passwd.o: ../include/openssl/crypto.h ../include/openssl/des.h |
@@ -791,12 +793,13 @@ s_cb.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
791 | s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 793 | s_cb.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
792 | s_cb.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 794 | s_cb.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
793 | s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 795 | s_cb.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
794 | s_cb.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 796 | s_cb.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
795 | s_cb.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 797 | s_cb.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
796 | s_cb.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 798 | s_cb.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
797 | s_cb.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h | 799 | s_cb.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
798 | s_cb.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h | 800 | s_cb.o: ../include/openssl/txt_db.h ../include/openssl/x509.h |
799 | s_cb.o: ../include/openssl/x509v3.h apps.h s_apps.h s_cb.c | 801 | s_cb.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h |
802 | s_cb.o: s_apps.h s_cb.c | ||
800 | s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 803 | s_client.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
801 | s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 804 | s_client.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
802 | s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h | 805 | s_client.o: ../include/openssl/comp.h ../include/openssl/conf.h |
@@ -812,7 +815,8 @@ s_client.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
812 | s_client.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 815 | s_client.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
813 | s_client.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 816 | s_client.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
814 | s_client.o: ../include/openssl/rand.h ../include/openssl/safestack.h | 817 | s_client.o: ../include/openssl/rand.h ../include/openssl/safestack.h |
815 | s_client.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 818 | s_client.o: ../include/openssl/sha.h ../include/openssl/srp.h |
819 | s_client.o: ../include/openssl/srtp.h ../include/openssl/ssl.h | ||
816 | s_client.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 820 | s_client.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
817 | s_client.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 821 | s_client.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
818 | s_client.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 822 | s_client.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
@@ -836,6 +840,7 @@ s_server.o: ../include/openssl/pem.h ../include/openssl/pem2.h | |||
836 | s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 840 | s_server.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
837 | s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h | 841 | s_server.o: ../include/openssl/rand.h ../include/openssl/rsa.h |
838 | s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 842 | s_server.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
843 | s_server.o: ../include/openssl/srp.h ../include/openssl/srtp.h | ||
839 | s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 844 | s_server.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
840 | s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 845 | s_server.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
841 | s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 846 | s_server.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
@@ -857,13 +862,13 @@ s_socket.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
857 | s_socket.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 862 | s_socket.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
858 | s_socket.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 863 | s_socket.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
859 | s_socket.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 864 | s_socket.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
860 | s_socket.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 865 | s_socket.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
861 | s_socket.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 866 | s_socket.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
862 | s_socket.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 867 | s_socket.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
863 | s_socket.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 868 | s_socket.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
864 | s_socket.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 869 | s_socket.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
865 | s_socket.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 870 | s_socket.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
866 | s_socket.o: s_apps.h s_socket.c | 871 | s_socket.o: ../include/openssl/x509v3.h apps.h s_apps.h s_socket.c |
867 | s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 872 | s_time.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
868 | s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 873 | s_time.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
869 | s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 874 | s_time.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -878,13 +883,13 @@ s_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
878 | s_time.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 883 | s_time.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
879 | s_time.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 884 | s_time.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
880 | s_time.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 885 | s_time.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
881 | s_time.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 886 | s_time.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
882 | s_time.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 887 | s_time.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
883 | s_time.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 888 | s_time.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
884 | s_time.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 889 | s_time.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
885 | s_time.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 890 | s_time.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
886 | s_time.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 891 | s_time.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
887 | s_time.o: s_apps.h s_time.c | 892 | s_time.o: ../include/openssl/x509v3.h apps.h s_apps.h s_time.c |
888 | sess_id.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 893 | sess_id.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
889 | sess_id.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 894 | sess_id.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
890 | sess_id.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 895 | sess_id.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -899,13 +904,13 @@ sess_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
899 | sess_id.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 904 | sess_id.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
900 | sess_id.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 905 | sess_id.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
901 | sess_id.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h | 906 | sess_id.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h |
902 | sess_id.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 907 | sess_id.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
903 | sess_id.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 908 | sess_id.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
904 | sess_id.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 909 | sess_id.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
905 | sess_id.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 910 | sess_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
906 | sess_id.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 911 | sess_id.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h |
907 | sess_id.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 912 | sess_id.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
908 | sess_id.o: sess_id.c | 913 | sess_id.o: ../include/openssl/x509v3.h apps.h sess_id.c |
909 | smime.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 914 | smime.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
910 | smime.o: ../include/openssl/buffer.h ../include/openssl/conf.h | 915 | smime.o: ../include/openssl/buffer.h ../include/openssl/conf.h |
911 | smime.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | 916 | smime.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h |
@@ -935,19 +940,19 @@ speed.o: ../include/openssl/err.h ../include/openssl/evp.h | |||
935 | speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h | 940 | speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h |
936 | speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h | 941 | speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h |
937 | speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h | 942 | speed.o: ../include/openssl/md5.h ../include/openssl/mdc2.h |
938 | speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | 943 | speed.o: ../include/openssl/modes.h ../include/openssl/obj_mac.h |
939 | speed.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h | 944 | speed.o: ../include/openssl/objects.h ../include/openssl/ocsp.h |
940 | speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | 945 | speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h |
941 | speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h | 946 | speed.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h |
942 | speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h | 947 | speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h |
943 | speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h | 948 | speed.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h |
944 | speed.o: ../include/openssl/safestack.h ../include/openssl/seed.h | 949 | speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
945 | speed.o: ../include/openssl/sha.h ../include/openssl/stack.h | 950 | speed.o: ../include/openssl/seed.h ../include/openssl/sha.h |
946 | speed.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h | 951 | speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
947 | speed.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h | 952 | speed.o: ../include/openssl/txt_db.h ../include/openssl/ui.h |
948 | speed.o: ../include/openssl/whrlpool.h ../include/openssl/x509.h | 953 | speed.o: ../include/openssl/ui_compat.h ../include/openssl/whrlpool.h |
949 | speed.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 954 | speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
950 | speed.o: speed.c testdsa.h testrsa.h | 955 | speed.o: ../include/openssl/x509v3.h apps.h speed.c testdsa.h testrsa.h |
951 | spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 956 | spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
952 | spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h | 957 | spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h |
953 | spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | 958 | spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h |
@@ -964,6 +969,21 @@ spkac.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | |||
964 | spkac.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | 969 | spkac.o: ../include/openssl/txt_db.h ../include/openssl/x509.h |
965 | spkac.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h | 970 | spkac.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h |
966 | spkac.o: spkac.c | 971 | spkac.o: spkac.c |
972 | srp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
973 | srp.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
974 | srp.o: ../include/openssl/conf.h ../include/openssl/crypto.h | ||
975 | srp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
976 | srp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h | ||
977 | srp.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
978 | srp.o: ../include/openssl/evp.h ../include/openssl/lhash.h | ||
979 | srp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
980 | srp.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h | ||
981 | srp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
982 | srp.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h | ||
983 | srp.o: ../include/openssl/sha.h ../include/openssl/srp.h | ||
984 | srp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
985 | srp.o: ../include/openssl/txt_db.h ../include/openssl/x509.h | ||
986 | srp.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h srp.c | ||
967 | ts.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 987 | ts.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
968 | ts.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 988 | ts.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
969 | ts.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 989 | ts.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
diff --git a/src/lib/libssl/src/apps/apps.c b/src/lib/libssl/src/apps/apps.c index feb7ed46e6..4e11915b02 100644 --- a/src/lib/libssl/src/apps/apps.c +++ b/src/lib/libssl/src/apps/apps.c | |||
@@ -109,7 +109,7 @@ | |||
109 | * | 109 | * |
110 | */ | 110 | */ |
111 | 111 | ||
112 | #ifndef _POSIX_C_SOURCE | 112 | #if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS) |
113 | #define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get | 113 | #define _POSIX_C_SOURCE 2 /* On VMS, you need to define this to get |
114 | the declaration of fileno(). The value | 114 | the declaration of fileno(). The value |
115 | 2 is to make sure no function defined | 115 | 2 is to make sure no function defined |
@@ -1215,7 +1215,8 @@ STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, | |||
1215 | const char *pass, ENGINE *e, const char *desc) | 1215 | const char *pass, ENGINE *e, const char *desc) |
1216 | { | 1216 | { |
1217 | STACK_OF(X509) *certs; | 1217 | STACK_OF(X509) *certs; |
1218 | load_certs_crls(err, file, format, pass, e, desc, &certs, NULL); | 1218 | if (!load_certs_crls(err, file, format, pass, e, desc, &certs, NULL)) |
1219 | return NULL; | ||
1219 | return certs; | 1220 | return certs; |
1220 | } | 1221 | } |
1221 | 1222 | ||
@@ -1223,7 +1224,8 @@ STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format, | |||
1223 | const char *pass, ENGINE *e, const char *desc) | 1224 | const char *pass, ENGINE *e, const char *desc) |
1224 | { | 1225 | { |
1225 | STACK_OF(X509_CRL) *crls; | 1226 | STACK_OF(X509_CRL) *crls; |
1226 | load_certs_crls(err, file, format, pass, e, desc, NULL, &crls); | 1227 | if (!load_certs_crls(err, file, format, pass, e, desc, NULL, &crls)) |
1228 | return NULL; | ||
1227 | return crls; | 1229 | return crls; |
1228 | } | 1230 | } |
1229 | 1231 | ||
@@ -2256,6 +2258,7 @@ int args_verify(char ***pargs, int *pargc, | |||
2256 | int purpose = 0, depth = -1; | 2258 | int purpose = 0, depth = -1; |
2257 | char **oldargs = *pargs; | 2259 | char **oldargs = *pargs; |
2258 | char *arg = **pargs, *argn = (*pargs)[1]; | 2260 | char *arg = **pargs, *argn = (*pargs)[1]; |
2261 | time_t at_time = 0; | ||
2259 | if (!strcmp(arg, "-policy")) | 2262 | if (!strcmp(arg, "-policy")) |
2260 | { | 2263 | { |
2261 | if (!argn) | 2264 | if (!argn) |
@@ -2308,6 +2311,27 @@ int args_verify(char ***pargs, int *pargc, | |||
2308 | } | 2311 | } |
2309 | (*pargs)++; | 2312 | (*pargs)++; |
2310 | } | 2313 | } |
2314 | else if (strcmp(arg,"-attime") == 0) | ||
2315 | { | ||
2316 | if (!argn) | ||
2317 | *badarg = 1; | ||
2318 | else | ||
2319 | { | ||
2320 | long timestamp; | ||
2321 | /* interpret the -attime argument as seconds since | ||
2322 | * Epoch */ | ||
2323 | if (sscanf(argn, "%li", ×tamp) != 1) | ||
2324 | { | ||
2325 | BIO_printf(bio_err, | ||
2326 | "Error parsing timestamp %s\n", | ||
2327 | argn); | ||
2328 | *badarg = 1; | ||
2329 | } | ||
2330 | /* on some platforms time_t may be a float */ | ||
2331 | at_time = (time_t) timestamp; | ||
2332 | } | ||
2333 | (*pargs)++; | ||
2334 | } | ||
2311 | else if (!strcmp(arg, "-ignore_critical")) | 2335 | else if (!strcmp(arg, "-ignore_critical")) |
2312 | flags |= X509_V_FLAG_IGNORE_CRITICAL; | 2336 | flags |= X509_V_FLAG_IGNORE_CRITICAL; |
2313 | else if (!strcmp(arg, "-issuer_checks")) | 2337 | else if (!strcmp(arg, "-issuer_checks")) |
@@ -2362,6 +2386,9 @@ int args_verify(char ***pargs, int *pargc, | |||
2362 | if (depth >= 0) | 2386 | if (depth >= 0) |
2363 | X509_VERIFY_PARAM_set_depth(*pm, depth); | 2387 | X509_VERIFY_PARAM_set_depth(*pm, depth); |
2364 | 2388 | ||
2389 | if (at_time) | ||
2390 | X509_VERIFY_PARAM_set_time(*pm, at_time); | ||
2391 | |||
2365 | end: | 2392 | end: |
2366 | 2393 | ||
2367 | (*pargs)++; | 2394 | (*pargs)++; |
@@ -2693,6 +2720,50 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret) | |||
2693 | 2720 | ||
2694 | #endif | 2721 | #endif |
2695 | 2722 | ||
2723 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
2724 | /* next_protos_parse parses a comma separated list of strings into a string | ||
2725 | * in a format suitable for passing to SSL_CTX_set_next_protos_advertised. | ||
2726 | * outlen: (output) set to the length of the resulting buffer on success. | ||
2727 | * err: (maybe NULL) on failure, an error message line is written to this BIO. | ||
2728 | * in: a NUL termianted string like "abc,def,ghi" | ||
2729 | * | ||
2730 | * returns: a malloced buffer or NULL on failure. | ||
2731 | */ | ||
2732 | unsigned char *next_protos_parse(unsigned short *outlen, const char *in) | ||
2733 | { | ||
2734 | size_t len; | ||
2735 | unsigned char *out; | ||
2736 | size_t i, start = 0; | ||
2737 | |||
2738 | len = strlen(in); | ||
2739 | if (len >= 65535) | ||
2740 | return NULL; | ||
2741 | |||
2742 | out = OPENSSL_malloc(strlen(in) + 1); | ||
2743 | if (!out) | ||
2744 | return NULL; | ||
2745 | |||
2746 | for (i = 0; i <= len; ++i) | ||
2747 | { | ||
2748 | if (i == len || in[i] == ',') | ||
2749 | { | ||
2750 | if (i - start > 255) | ||
2751 | { | ||
2752 | OPENSSL_free(out); | ||
2753 | return NULL; | ||
2754 | } | ||
2755 | out[start] = i - start; | ||
2756 | start = i + 1; | ||
2757 | } | ||
2758 | else | ||
2759 | out[i+1] = in[i]; | ||
2760 | } | ||
2761 | |||
2762 | *outlen = len + 1; | ||
2763 | return out; | ||
2764 | } | ||
2765 | #endif /* !OPENSSL_NO_TLSEXT && !OPENSSL_NO_NEXTPROTONEG */ | ||
2766 | |||
2696 | /* | 2767 | /* |
2697 | * Platform-specific sections | 2768 | * Platform-specific sections |
2698 | */ | 2769 | */ |
diff --git a/src/lib/libssl/src/apps/apps.h b/src/lib/libssl/src/apps/apps.h index 596a39aceb..c1ca99da12 100644 --- a/src/lib/libssl/src/apps/apps.h +++ b/src/lib/libssl/src/apps/apps.h | |||
@@ -317,6 +317,12 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in); | |||
317 | int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); | 317 | int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); |
318 | int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, | 318 | int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, |
319 | const char *algname, ENGINE *e, int do_param); | 319 | const char *algname, ENGINE *e, int do_param); |
320 | int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md, | ||
321 | STACK_OF(OPENSSL_STRING) *sigopts); | ||
322 | int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md, | ||
323 | STACK_OF(OPENSSL_STRING) *sigopts); | ||
324 | int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md, | ||
325 | STACK_OF(OPENSSL_STRING) *sigopts); | ||
320 | #ifndef OPENSSL_NO_PSK | 326 | #ifndef OPENSSL_NO_PSK |
321 | extern char *psk_key; | 327 | extern char *psk_key; |
322 | #endif | 328 | #endif |
@@ -325,6 +331,10 @@ void jpake_client_auth(BIO *out, BIO *conn, const char *secret); | |||
325 | void jpake_server_auth(BIO *out, BIO *conn, const char *secret); | 331 | void jpake_server_auth(BIO *out, BIO *conn, const char *secret); |
326 | #endif | 332 | #endif |
327 | 333 | ||
334 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
335 | unsigned char *next_protos_parse(unsigned short *outlen, const char *in); | ||
336 | #endif /* !OPENSSL_NO_TLSEXT && !OPENSSL_NO_NEXTPROTONEG */ | ||
337 | |||
328 | #define FORMAT_UNDEF 0 | 338 | #define FORMAT_UNDEF 0 |
329 | #define FORMAT_ASN1 1 | 339 | #define FORMAT_ASN1 1 |
330 | #define FORMAT_TEXT 2 | 340 | #define FORMAT_TEXT 2 |
@@ -357,4 +367,7 @@ int raw_write_stdout(const void *,int); | |||
357 | #define TM_START 0 | 367 | #define TM_START 0 |
358 | #define TM_STOP 1 | 368 | #define TM_STOP 1 |
359 | double app_tminterval (int stop,int usertime); | 369 | double app_tminterval (int stop,int usertime); |
370 | |||
371 | #define OPENSSL_NO_SSL_INTERN | ||
372 | |||
360 | #endif | 373 | #endif |
diff --git a/src/lib/libssl/src/apps/ca.c b/src/lib/libssl/src/apps/ca.c index 6b8b0ef8fd..2a83d1936e 100644 --- a/src/lib/libssl/src/apps/ca.c +++ b/src/lib/libssl/src/apps/ca.c | |||
@@ -197,26 +197,30 @@ extern int EF_ALIGNMENT; | |||
197 | 197 | ||
198 | static void lookup_fail(const char *name, const char *tag); | 198 | static void lookup_fail(const char *name, const char *tag); |
199 | static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, | 199 | static int certify(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, |
200 | const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy,CA_DB *db, | 200 | const EVP_MD *dgst,STACK_OF(OPENSSL_STRING) *sigopts, |
201 | STACK_OF(CONF_VALUE) *policy,CA_DB *db, | ||
201 | BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, char *startdate, | 202 | BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, char *startdate, |
202 | char *enddate, long days, int batch, char *ext_sect, CONF *conf, | 203 | char *enddate, long days, int batch, char *ext_sect, CONF *conf, |
203 | int verbose, unsigned long certopt, unsigned long nameopt, | 204 | int verbose, unsigned long certopt, unsigned long nameopt, |
204 | int default_op, int ext_copy, int selfsign); | 205 | int default_op, int ext_copy, int selfsign); |
205 | static int certify_cert(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, | 206 | static int certify_cert(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, |
206 | const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy, | 207 | const EVP_MD *dgst,STACK_OF(OPENSSL_STRING) *sigopts, |
208 | STACK_OF(CONF_VALUE) *policy, | ||
207 | CA_DB *db, BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, | 209 | CA_DB *db, BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, |
208 | char *startdate, char *enddate, long days, int batch, | 210 | char *startdate, char *enddate, long days, int batch, |
209 | char *ext_sect, CONF *conf,int verbose, unsigned long certopt, | 211 | char *ext_sect, CONF *conf,int verbose, unsigned long certopt, |
210 | unsigned long nameopt, int default_op, int ext_copy, | 212 | unsigned long nameopt, int default_op, int ext_copy, |
211 | ENGINE *e); | 213 | ENGINE *e); |
212 | static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, | 214 | static int certify_spkac(X509 **xret, char *infile,EVP_PKEY *pkey,X509 *x509, |
213 | const EVP_MD *dgst,STACK_OF(CONF_VALUE) *policy, | 215 | const EVP_MD *dgst,STACK_OF(OPENSSL_STRING) *sigopts, |
216 | STACK_OF(CONF_VALUE) *policy, | ||
214 | CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn, int email_dn, | 217 | CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn, int email_dn, |
215 | char *startdate, char *enddate, long days, char *ext_sect, | 218 | char *startdate, char *enddate, long days, char *ext_sect, |
216 | CONF *conf, int verbose, unsigned long certopt, | 219 | CONF *conf, int verbose, unsigned long certopt, |
217 | unsigned long nameopt, int default_op, int ext_copy); | 220 | unsigned long nameopt, int default_op, int ext_copy); |
218 | static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext); | 221 | static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext); |
219 | static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst, | 222 | static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst, |
223 | STACK_OF(OPENSSL_STRING) *sigopts, | ||
220 | STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn, | 224 | STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial,char *subj,unsigned long chtype, int multirdn, |
221 | int email_dn, char *startdate, char *enddate, long days, int batch, | 225 | int email_dn, char *startdate, char *enddate, long days, int batch, |
222 | int verbose, X509_REQ *req, char *ext_sect, CONF *conf, | 226 | int verbose, X509_REQ *req, char *ext_sect, CONF *conf, |
@@ -311,6 +315,7 @@ int MAIN(int argc, char **argv) | |||
311 | const EVP_MD *dgst=NULL; | 315 | const EVP_MD *dgst=NULL; |
312 | STACK_OF(CONF_VALUE) *attribs=NULL; | 316 | STACK_OF(CONF_VALUE) *attribs=NULL; |
313 | STACK_OF(X509) *cert_sk=NULL; | 317 | STACK_OF(X509) *cert_sk=NULL; |
318 | STACK_OF(OPENSSL_STRING) *sigopts = NULL; | ||
314 | #undef BSIZE | 319 | #undef BSIZE |
315 | #define BSIZE 256 | 320 | #define BSIZE 256 |
316 | MS_STATIC char buf[3][BSIZE]; | 321 | MS_STATIC char buf[3][BSIZE]; |
@@ -435,6 +440,15 @@ EF_ALIGNMENT=0; | |||
435 | if (--argc < 1) goto bad; | 440 | if (--argc < 1) goto bad; |
436 | outdir= *(++argv); | 441 | outdir= *(++argv); |
437 | } | 442 | } |
443 | else if (strcmp(*argv,"-sigopt") == 0) | ||
444 | { | ||
445 | if (--argc < 1) | ||
446 | goto bad; | ||
447 | if (!sigopts) | ||
448 | sigopts = sk_OPENSSL_STRING_new_null(); | ||
449 | if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv))) | ||
450 | goto bad; | ||
451 | } | ||
438 | else if (strcmp(*argv,"-notext") == 0) | 452 | else if (strcmp(*argv,"-notext") == 0) |
439 | notext=1; | 453 | notext=1; |
440 | else if (strcmp(*argv,"-batch") == 0) | 454 | else if (strcmp(*argv,"-batch") == 0) |
@@ -1170,8 +1184,9 @@ bad: | |||
1170 | if (spkac_file != NULL) | 1184 | if (spkac_file != NULL) |
1171 | { | 1185 | { |
1172 | total++; | 1186 | total++; |
1173 | j=certify_spkac(&x,spkac_file,pkey,x509,dgst,attribs,db, | 1187 | j=certify_spkac(&x,spkac_file,pkey,x509,dgst,sigopts, |
1174 | serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,extensions, | 1188 | attribs,db, serial,subj,chtype,multirdn, |
1189 | email_dn,startdate,enddate,days,extensions, | ||
1175 | conf,verbose,certopt,nameopt,default_op,ext_copy); | 1190 | conf,verbose,certopt,nameopt,default_op,ext_copy); |
1176 | if (j < 0) goto err; | 1191 | if (j < 0) goto err; |
1177 | if (j > 0) | 1192 | if (j > 0) |
@@ -1194,7 +1209,8 @@ bad: | |||
1194 | if (ss_cert_file != NULL) | 1209 | if (ss_cert_file != NULL) |
1195 | { | 1210 | { |
1196 | total++; | 1211 | total++; |
1197 | j=certify_cert(&x,ss_cert_file,pkey,x509,dgst,attribs, | 1212 | j=certify_cert(&x,ss_cert_file,pkey,x509,dgst,sigopts, |
1213 | attribs, | ||
1198 | db,serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,batch, | 1214 | db,serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,batch, |
1199 | extensions,conf,verbose, certopt, nameopt, | 1215 | extensions,conf,verbose, certopt, nameopt, |
1200 | default_op, ext_copy, e); | 1216 | default_op, ext_copy, e); |
@@ -1214,7 +1230,7 @@ bad: | |||
1214 | if (infile != NULL) | 1230 | if (infile != NULL) |
1215 | { | 1231 | { |
1216 | total++; | 1232 | total++; |
1217 | j=certify(&x,infile,pkey,x509p,dgst,attribs,db, | 1233 | j=certify(&x,infile,pkey,x509p,dgst,sigopts, attribs,db, |
1218 | serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,batch, | 1234 | serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,batch, |
1219 | extensions,conf,verbose, certopt, nameopt, | 1235 | extensions,conf,verbose, certopt, nameopt, |
1220 | default_op, ext_copy, selfsign); | 1236 | default_op, ext_copy, selfsign); |
@@ -1234,7 +1250,7 @@ bad: | |||
1234 | for (i=0; i<argc; i++) | 1250 | for (i=0; i<argc; i++) |
1235 | { | 1251 | { |
1236 | total++; | 1252 | total++; |
1237 | j=certify(&x,argv[i],pkey,x509p,dgst,attribs,db, | 1253 | j=certify(&x,argv[i],pkey,x509p,dgst,sigopts,attribs,db, |
1238 | serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,batch, | 1254 | serial,subj,chtype,multirdn,email_dn,startdate,enddate,days,batch, |
1239 | extensions,conf,verbose, certopt, nameopt, | 1255 | extensions,conf,verbose, certopt, nameopt, |
1240 | default_op, ext_copy, selfsign); | 1256 | default_op, ext_copy, selfsign); |
@@ -1483,7 +1499,7 @@ bad: | |||
1483 | crlnumber = NULL; | 1499 | crlnumber = NULL; |
1484 | } | 1500 | } |
1485 | 1501 | ||
1486 | if (!X509_CRL_sign(crl,pkey,dgst)) goto err; | 1502 | if (!do_X509_CRL_sign(bio_err,crl,pkey,dgst,sigopts)) goto err; |
1487 | 1503 | ||
1488 | PEM_write_bio_X509_CRL(Sout,crl); | 1504 | PEM_write_bio_X509_CRL(Sout,crl); |
1489 | 1505 | ||
@@ -1537,6 +1553,8 @@ err: | |||
1537 | BN_free(serial); | 1553 | BN_free(serial); |
1538 | BN_free(crlnumber); | 1554 | BN_free(crlnumber); |
1539 | free_index(db); | 1555 | free_index(db); |
1556 | if (sigopts) | ||
1557 | sk_OPENSSL_STRING_free(sigopts); | ||
1540 | EVP_PKEY_free(pkey); | 1558 | EVP_PKEY_free(pkey); |
1541 | if (x509) X509_free(x509); | 1559 | if (x509) X509_free(x509); |
1542 | X509_CRL_free(crl); | 1560 | X509_CRL_free(crl); |
@@ -1553,8 +1571,10 @@ static void lookup_fail(const char *name, const char *tag) | |||
1553 | } | 1571 | } |
1554 | 1572 | ||
1555 | static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, | 1573 | static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, |
1556 | const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, CA_DB *db, | 1574 | const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, |
1557 | BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, char *startdate, char *enddate, | 1575 | STACK_OF(CONF_VALUE) *policy, CA_DB *db, |
1576 | BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, | ||
1577 | int email_dn, char *startdate, char *enddate, | ||
1558 | long days, int batch, char *ext_sect, CONF *lconf, int verbose, | 1578 | long days, int batch, char *ext_sect, CONF *lconf, int verbose, |
1559 | unsigned long certopt, unsigned long nameopt, int default_op, | 1579 | unsigned long certopt, unsigned long nameopt, int default_op, |
1560 | int ext_copy, int selfsign) | 1580 | int ext_copy, int selfsign) |
@@ -1610,7 +1630,8 @@ static int certify(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, | |||
1610 | else | 1630 | else |
1611 | BIO_printf(bio_err,"Signature ok\n"); | 1631 | BIO_printf(bio_err,"Signature ok\n"); |
1612 | 1632 | ||
1613 | ok=do_body(xret,pkey,x509,dgst,policy,db,serial,subj,chtype,multirdn, email_dn, | 1633 | ok=do_body(xret,pkey,x509,dgst,sigopts, policy,db,serial,subj,chtype, |
1634 | multirdn, email_dn, | ||
1614 | startdate,enddate,days,batch,verbose,req,ext_sect,lconf, | 1635 | startdate,enddate,days,batch,verbose,req,ext_sect,lconf, |
1615 | certopt, nameopt, default_op, ext_copy, selfsign); | 1636 | certopt, nameopt, default_op, ext_copy, selfsign); |
1616 | 1637 | ||
@@ -1621,7 +1642,8 @@ err: | |||
1621 | } | 1642 | } |
1622 | 1643 | ||
1623 | static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, | 1644 | static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, |
1624 | const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, CA_DB *db, | 1645 | const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, |
1646 | STACK_OF(CONF_VALUE) *policy, CA_DB *db, | ||
1625 | BIGNUM *serial, char *subj, unsigned long chtype, int multirdn, int email_dn, char *startdate, char *enddate, | 1647 | BIGNUM *serial, char *subj, unsigned long chtype, int multirdn, int email_dn, char *startdate, char *enddate, |
1626 | long days, int batch, char *ext_sect, CONF *lconf, int verbose, | 1648 | long days, int batch, char *ext_sect, CONF *lconf, int verbose, |
1627 | unsigned long certopt, unsigned long nameopt, int default_op, | 1649 | unsigned long certopt, unsigned long nameopt, int default_op, |
@@ -1664,7 +1686,7 @@ static int certify_cert(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, | |||
1664 | if ((rreq=X509_to_X509_REQ(req,NULL,EVP_md5())) == NULL) | 1686 | if ((rreq=X509_to_X509_REQ(req,NULL,EVP_md5())) == NULL) |
1665 | goto err; | 1687 | goto err; |
1666 | 1688 | ||
1667 | ok=do_body(xret,pkey,x509,dgst,policy,db,serial,subj,chtype,multirdn,email_dn,startdate,enddate, | 1689 | ok=do_body(xret,pkey,x509,dgst,sigopts,policy,db,serial,subj,chtype,multirdn,email_dn,startdate,enddate, |
1668 | days,batch,verbose,rreq,ext_sect,lconf, certopt, nameopt, default_op, | 1690 | days,batch,verbose,rreq,ext_sect,lconf, certopt, nameopt, default_op, |
1669 | ext_copy, 0); | 1691 | ext_copy, 0); |
1670 | 1692 | ||
@@ -1675,7 +1697,8 @@ err: | |||
1675 | } | 1697 | } |
1676 | 1698 | ||
1677 | static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst, | 1699 | static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst, |
1678 | STACK_OF(CONF_VALUE) *policy, CA_DB *db, BIGNUM *serial, char *subj, | 1700 | STACK_OF(OPENSSL_STRING) *sigopts, STACK_OF(CONF_VALUE) *policy, |
1701 | CA_DB *db, BIGNUM *serial, char *subj, | ||
1679 | unsigned long chtype, int multirdn, | 1702 | unsigned long chtype, int multirdn, |
1680 | int email_dn, char *startdate, char *enddate, long days, int batch, | 1703 | int email_dn, char *startdate, char *enddate, long days, int batch, |
1681 | int verbose, X509_REQ *req, char *ext_sect, CONF *lconf, | 1704 | int verbose, X509_REQ *req, char *ext_sect, CONF *lconf, |
@@ -2146,7 +2169,7 @@ again2: | |||
2146 | EVP_PKEY_copy_parameters(pktmp,pkey); | 2169 | EVP_PKEY_copy_parameters(pktmp,pkey); |
2147 | EVP_PKEY_free(pktmp); | 2170 | EVP_PKEY_free(pktmp); |
2148 | 2171 | ||
2149 | if (!X509_sign(ret,pkey,dgst)) | 2172 | if (!do_X509_sign(bio_err, ret,pkey,dgst, sigopts)) |
2150 | goto err; | 2173 | goto err; |
2151 | 2174 | ||
2152 | /* We now just add it to the database */ | 2175 | /* We now just add it to the database */ |
@@ -2240,7 +2263,8 @@ static void write_new_certificate(BIO *bp, X509 *x, int output_der, int notext) | |||
2240 | } | 2263 | } |
2241 | 2264 | ||
2242 | static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, | 2265 | static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, |
2243 | const EVP_MD *dgst, STACK_OF(CONF_VALUE) *policy, CA_DB *db, | 2266 | const EVP_MD *dgst, STACK_OF(OPENSSL_STRING) *sigopts, |
2267 | STACK_OF(CONF_VALUE) *policy, CA_DB *db, | ||
2244 | BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, char *startdate, char *enddate, | 2268 | BIGNUM *serial, char *subj,unsigned long chtype, int multirdn, int email_dn, char *startdate, char *enddate, |
2245 | long days, char *ext_sect, CONF *lconf, int verbose, unsigned long certopt, | 2269 | long days, char *ext_sect, CONF *lconf, int verbose, unsigned long certopt, |
2246 | unsigned long nameopt, int default_op, int ext_copy) | 2270 | unsigned long nameopt, int default_op, int ext_copy) |
@@ -2366,9 +2390,9 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, X509 *x509, | |||
2366 | 2390 | ||
2367 | X509_REQ_set_pubkey(req,pktmp); | 2391 | X509_REQ_set_pubkey(req,pktmp); |
2368 | EVP_PKEY_free(pktmp); | 2392 | EVP_PKEY_free(pktmp); |
2369 | ok=do_body(xret,pkey,x509,dgst,policy,db,serial,subj,chtype,multirdn,email_dn,startdate,enddate, | 2393 | ok=do_body(xret,pkey,x509,dgst,sigopts,policy,db,serial,subj,chtype, |
2370 | days,1,verbose,req,ext_sect,lconf, certopt, nameopt, default_op, | 2394 | multirdn,email_dn,startdate,enddate, days,1,verbose,req, |
2371 | ext_copy, 0); | 2395 | ext_sect,lconf, certopt, nameopt, default_op, ext_copy, 0); |
2372 | err: | 2396 | err: |
2373 | if (req != NULL) X509_REQ_free(req); | 2397 | if (req != NULL) X509_REQ_free(req); |
2374 | if (parms != NULL) CONF_free(parms); | 2398 | if (parms != NULL) CONF_free(parms); |
@@ -2536,7 +2560,7 @@ static int get_certificate_status(const char *serial, CA_DB *db) | |||
2536 | 2560 | ||
2537 | /* Make it Upper Case */ | 2561 | /* Make it Upper Case */ |
2538 | for (i=0; row[DB_serial][i] != '\0'; i++) | 2562 | for (i=0; row[DB_serial][i] != '\0'; i++) |
2539 | row[DB_serial][i] = toupper(row[DB_serial][i]); | 2563 | row[DB_serial][i] = toupper((unsigned char)row[DB_serial][i]); |
2540 | 2564 | ||
2541 | 2565 | ||
2542 | ok=1; | 2566 | ok=1; |
diff --git a/src/lib/libssl/src/apps/ciphers.c b/src/lib/libssl/src/apps/ciphers.c index 3d4c60db9e..5f2b739700 100644 --- a/src/lib/libssl/src/apps/ciphers.c +++ b/src/lib/libssl/src/apps/ciphers.c | |||
@@ -196,7 +196,7 @@ int MAIN(int argc, char **argv) | |||
196 | 196 | ||
197 | if (Verbose) | 197 | if (Verbose) |
198 | { | 198 | { |
199 | unsigned long id = c->id; | 199 | unsigned long id = SSL_CIPHER_get_id(c); |
200 | int id0 = (int)(id >> 24); | 200 | int id0 = (int)(id >> 24); |
201 | int id1 = (int)((id >> 16) & 0xffL); | 201 | int id1 = (int)((id >> 16) & 0xffL); |
202 | int id2 = (int)((id >> 8) & 0xffL); | 202 | int id2 = (int)((id >> 8) & 0xffL); |
diff --git a/src/lib/libssl/src/apps/client.pem b/src/lib/libssl/src/apps/client.pem index 307910e56e..e7a47a73f3 100644 --- a/src/lib/libssl/src/apps/client.pem +++ b/src/lib/libssl/src/apps/client.pem | |||
@@ -1,24 +1,52 @@ | |||
1 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) | 1 | subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Client Cert |
2 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Client test cert (512 bit) | 2 | issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA |
3 | -----BEGIN CERTIFICATE----- | 3 | -----BEGIN CERTIFICATE----- |
4 | MIIB6TCCAVICAQIwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV | 4 | MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6yMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV |
5 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD | 5 | BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT |
6 | VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU2WhcNOTgwNjA5 | 6 | VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt |
7 | MTM1NzU2WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG | 7 | ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG |
8 | A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGkNsaWVudCB0ZXN0IGNl | 8 | A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU |
9 | cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALtv55QyzG6i2Plw | 9 | RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgQ2xpZW50IENlcnQw |
10 | Z1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexmq/R4KedLjFEIYjocDui+IXs62NNt | 10 | ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC0ranbHRLcLVqN+0BzcZpY |
11 | XrT8odkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBwtMmI7oGUG8nKmftQssATViH5 | 11 | +yOLqxzDWT1LD9eW1stC4NzXX9/DCtSIVyN7YIHdGLrIPr64IDdXXaMRzgZ2rOKs |
12 | NRRtoEw07DxJp/LfatHdrhqQB73eGdL5WILZJXk46Xz2e9WMSUjVCSYhdKxtflU3 | 12 | lmHCAiFpO/ja99gGCJRxH0xwQatqAULfJVHeUhs7OEGOZc2nWifjqKvGfNTilP7D |
13 | UR2Ajv1Oo0sTNdfz0wDqJNirLNtzyhhsaq8qMTrLwXrCP31VxBiigFSQSUFnZyTE | 13 | nwi69ipQFq9oS19FmhwVHk2wg7KZGHI1qDyG04UrfCZMRitvS9+UVhPpIPjuiBi2 |
14 | 9TKwhS4GlwbtCfxSKQ== | 14 | x3/FZIpL5gXJvvFK6xHY63oq2asyzBATntBgnP4qJFWWcvRx24wF1PnZabxuVoL2 |
15 | bPnQ/KvONDrw3IdqkKhYNTul7jEcu3OlcZIMw+7DiaKJLAzKb/bBF5gm/pwW6As9 | ||
16 | AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI | ||
17 | AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW | ||
18 | BBSZHKyLoTh7Mb409Zn/mK1ceSDAjDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49 | ||
19 | hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAD0mL7PtPYgCEuDyOQSbLpeND5hVS | ||
20 | curxQdGnrJ6Acrhodb7E9ccATokeb0PLx6HBLQUicxhTZIQ9FbO43YkQcOU6C3BB | ||
21 | IlwskqmtN6+VmrQzNolHCDzvxNZs9lYL2VbGPGqVRyjZeHpoAlf9cQr8PgDb4d4b | ||
22 | vUx2KAhHQvV2nkmYvKyXcgnRuHggumF87mkxidriGAEFwH4qfOqetUg64WyxP7P2 | ||
23 | QLipm04SyQa7ONtIApfVXgHcE42Py4/f4arzCzMjKe3VyhGkS7nsT55X/fWgTaRm | ||
24 | CQPkO+H94P958WTvQDt77bQ+D3IvYaVvfil8n6HJMOJfFT0LJuSUbpSXJg== | ||
15 | -----END CERTIFICATE----- | 25 | -----END CERTIFICATE----- |
16 | -----BEGIN RSA PRIVATE KEY----- | 26 | -----BEGIN RSA PRIVATE KEY----- |
17 | MIIBOwIBAAJBALtv55QyzG6i2PlwZ1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexm | 27 | MIIEpQIBAAKCAQEAtK2p2x0S3C1ajftAc3GaWPsji6scw1k9Sw/XltbLQuDc11/f |
18 | q/R4KedLjFEIYjocDui+IXs62NNtXrT8odkCAwEAAQJAbwXq0vJ/+uyEvsNgxLko | 28 | wwrUiFcje2CB3Ri6yD6+uCA3V12jEc4GdqzirJZhwgIhaTv42vfYBgiUcR9McEGr |
19 | /V86mGXQ/KrSkeKlL0r4ENxjcyeMAGoKu6J9yMY7+X9+Zm4nxShNfTsf/+Freoe1 | 29 | agFC3yVR3lIbOzhBjmXNp1on46irxnzU4pT+w58IuvYqUBavaEtfRZocFR5NsIOy |
20 | HQIhAPOSm5Q1YI+KIsII2GeVJx1U69+wnd71OasIPakS1L1XAiEAxQAW+J3/JWE0 | 30 | mRhyNag8htOFK3wmTEYrb0vflFYT6SD47ogYtsd/xWSKS+YFyb7xSusR2Ot6Ktmr |
21 | ftEYakbhUOKL8tD1OaFZS71/5GdG7E8CIQCefUMmySSvwd6kC0VlATSWbW+d+jp/ | 31 | MswQE57QYJz+KiRVlnL0cduMBdT52Wm8blaC9mz50PyrzjQ68NyHapCoWDU7pe4x |
22 | nWmM1KvqnAo5uQIhALqEADu5U1Wvt8UN8UDGBRPQulHWNycuNV45d3nnskWPAiAw | 32 | HLtzpXGSDMPuw4miiSwMym/2wReYJv6cFugLPQIDAQABAoIBAAZOyc9MhIwLSU4L |
23 | ueTyr6WsZ5+SD8g/Hy3xuvF3nPmJRH+rwvVihlcFOg== | 33 | p4RgQvM4UVVe8/Id+3XTZ8NsXExJbWxXfIhiqGjaIfL8u4vsgRjcl+v1s/jo2/iT |
34 | KMab4o4D8gXD7UavQVDjtjb/ta79WL3SjRl2Uc9YjjMkyq6WmDNQeo2NKDdafCTB | ||
35 | 1uzSJtLNipB8Z53ELPuHJhxX9QMHrMnuha49riQgXZ7buP9iQrHJFhImBjSzbxJx | ||
36 | L+TI6rkyLSf9Wi0Pd3L27Ob3QWNfNRYNSeTE+08eSRChkur5W0RuXAcuAICdQlCl | ||
37 | LBvWO/LmmvbzCqiDcgy/TliSb6CGGwgiNG7LJZmlkYNj8laGwalNlYZs3UrVv6NO | ||
38 | Br2loAECgYEA2kvCvPGj0Dg/6g7WhXDvAkEbcaL1tSeCxBbNH+6HS2UWMWvyTtCn | ||
39 | /bbD519QIdkvayy1QjEf32GV/UjUVmlULMLBcDy0DGjtL3+XpIhLKWDNxN1v1/ai | ||
40 | 1oz23ZJCOgnk6K4qtFtlRS1XtynjA+rBetvYvLP9SKeFrnpzCgaA2r0CgYEA0+KX | ||
41 | 1ACXDTNH5ySX3kMjSS9xdINf+OOw4CvPHFwbtc9aqk2HePlEsBTz5I/W3rKwXva3 | ||
42 | NqZ/bRqVVeZB/hHKFywgdUQk2Uc5z/S7Lw70/w1HubNTXGU06Ngb6zOFAo/o/TwZ | ||
43 | zTP1BMIKSOB6PAZPS3l+aLO4FRIRotfFhgRHOoECgYEAmiZbqt8cJaJDB/5YYDzC | ||
44 | mp3tSk6gIb936Q6M5VqkMYp9pIKsxhk0N8aDCnTU+kIK6SzWBpr3/d9Ecmqmfyq7 | ||
45 | 5SvWO3KyVf0WWK9KH0abhOm2BKm2HBQvI0DB5u8sUx2/hsvOnjPYDISbZ11t0MtK | ||
46 | u35Zy89yMYcSsIYJjG/ROCUCgYEAgI2P9G5PNxEP5OtMwOsW84Y3Xat/hPAQFlI+ | ||
47 | HES+AzbFGWJkeT8zL2nm95tVkFP1sggZ7Kxjz3w7cpx7GX0NkbWSE9O+T51pNASV | ||
48 | tN1sQ3p5M+/a+cnlqgfEGJVvc7iAcXQPa3LEi5h2yPR49QYXAgG6cifn3dDSpmwn | ||
49 | SUI7PQECgYEApGCIIpSRPLAEHTGmP87RBL1smurhwmy2s/pghkvUkWehtxg0sGHh | ||
50 | kuaqDWcskogv+QC0sVdytiLSz8G0DwcEcsHK1Fkyb8A+ayiw6jWJDo2m9+IF4Fww | ||
51 | 1Te6jFPYDESnbhq7+TLGgHGhtwcu5cnb4vSuYXGXKupZGzoLOBbv1Zw= | ||
24 | -----END RSA PRIVATE KEY----- | 52 | -----END RSA PRIVATE KEY----- |
diff --git a/src/lib/libssl/src/apps/dgst.c b/src/lib/libssl/src/apps/dgst.c index 9bf38ce73b..b08e9a7c78 100644 --- a/src/lib/libssl/src/apps/dgst.c +++ b/src/lib/libssl/src/apps/dgst.c | |||
@@ -127,6 +127,7 @@ int MAIN(int argc, char **argv) | |||
127 | #endif | 127 | #endif |
128 | char *hmac_key=NULL; | 128 | char *hmac_key=NULL; |
129 | char *mac_name=NULL; | 129 | char *mac_name=NULL; |
130 | int non_fips_allow = 0; | ||
130 | STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL; | 131 | STACK_OF(OPENSSL_STRING) *sigopts = NULL, *macopts = NULL; |
131 | 132 | ||
132 | apps_startup(); | 133 | apps_startup(); |
@@ -215,6 +216,10 @@ int MAIN(int argc, char **argv) | |||
215 | out_bin = 1; | 216 | out_bin = 1; |
216 | else if (strcmp(*argv,"-d") == 0) | 217 | else if (strcmp(*argv,"-d") == 0) |
217 | debug=1; | 218 | debug=1; |
219 | else if (strcmp(*argv,"-non-fips-allow") == 0) | ||
220 | non_fips_allow=1; | ||
221 | else if (!strcmp(*argv,"-fips-fingerprint")) | ||
222 | hmac_key = "etaonrishdlcupfm"; | ||
218 | else if (!strcmp(*argv,"-hmac")) | 223 | else if (!strcmp(*argv,"-hmac")) |
219 | { | 224 | { |
220 | if (--argc < 1) | 225 | if (--argc < 1) |
@@ -395,6 +400,13 @@ int MAIN(int argc, char **argv) | |||
395 | goto end; | 400 | goto end; |
396 | } | 401 | } |
397 | 402 | ||
403 | if (non_fips_allow) | ||
404 | { | ||
405 | EVP_MD_CTX *md_ctx; | ||
406 | BIO_get_md_ctx(bmd,&md_ctx); | ||
407 | EVP_MD_CTX_set_flags(md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
408 | } | ||
409 | |||
398 | if (hmac_key) | 410 | if (hmac_key) |
399 | { | 411 | { |
400 | sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, e, | 412 | sigkey = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, e, |
diff --git a/src/lib/libssl/src/apps/enc.c b/src/lib/libssl/src/apps/enc.c index 076225c4cb..719acc3250 100644 --- a/src/lib/libssl/src/apps/enc.c +++ b/src/lib/libssl/src/apps/enc.c | |||
@@ -129,6 +129,7 @@ int MAIN(int argc, char **argv) | |||
129 | char *engine = NULL; | 129 | char *engine = NULL; |
130 | #endif | 130 | #endif |
131 | const EVP_MD *dgst=NULL; | 131 | const EVP_MD *dgst=NULL; |
132 | int non_fips_allow = 0; | ||
132 | 133 | ||
133 | apps_startup(); | 134 | apps_startup(); |
134 | 135 | ||
@@ -281,6 +282,8 @@ int MAIN(int argc, char **argv) | |||
281 | if (--argc < 1) goto bad; | 282 | if (--argc < 1) goto bad; |
282 | md= *(++argv); | 283 | md= *(++argv); |
283 | } | 284 | } |
285 | else if (strcmp(*argv,"-non-fips-allow") == 0) | ||
286 | non_fips_allow = 1; | ||
284 | else if ((argv[0][0] == '-') && | 287 | else if ((argv[0][0] == '-') && |
285 | ((c=EVP_get_cipherbyname(&(argv[0][1]))) != NULL)) | 288 | ((c=EVP_get_cipherbyname(&(argv[0][1]))) != NULL)) |
286 | { | 289 | { |
@@ -589,6 +592,11 @@ bad: | |||
589 | */ | 592 | */ |
590 | 593 | ||
591 | BIO_get_cipher_ctx(benc, &ctx); | 594 | BIO_get_cipher_ctx(benc, &ctx); |
595 | |||
596 | if (non_fips_allow) | ||
597 | EVP_CIPHER_CTX_set_flags(ctx, | ||
598 | EVP_CIPH_FLAG_NON_FIPS_ALLOW); | ||
599 | |||
592 | if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc)) | 600 | if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, enc)) |
593 | { | 601 | { |
594 | BIO_printf(bio_err, "Error setting cipher %s\n", | 602 | BIO_printf(bio_err, "Error setting cipher %s\n", |
diff --git a/src/lib/libssl/src/apps/makeapps.com b/src/lib/libssl/src/apps/makeapps.com index 71417a86b0..efc213c8ee 100644 --- a/src/lib/libssl/src/apps/makeapps.com +++ b/src/lib/libssl/src/apps/makeapps.com | |||
@@ -184,7 +184,7 @@ $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+- | |||
184 | "X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+- | 184 | "X509,GENRSA,GENDSA,GENPKEY,S_SERVER,S_CLIENT,SPEED,"+- |
185 | "S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+- | 185 | "S_TIME,APPS,S_CB,S_SOCKET,APP_RAND,VERSION,SESS_ID,"+- |
186 | "CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ - | 186 | "CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ - |
187 | "SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS" | 187 | "SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS,SRP" |
188 | $! | 188 | $! |
189 | $ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT" | 189 | $ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT" |
190 | $! | 190 | $! |
diff --git a/src/lib/libssl/src/apps/openssl.c b/src/lib/libssl/src/apps/openssl.c index dab057bbff..1c880d90ba 100644 --- a/src/lib/libssl/src/apps/openssl.c +++ b/src/lib/libssl/src/apps/openssl.c | |||
@@ -129,6 +129,9 @@ | |||
129 | #include "progs.h" | 129 | #include "progs.h" |
130 | #include "s_apps.h" | 130 | #include "s_apps.h" |
131 | #include <openssl/err.h> | 131 | #include <openssl/err.h> |
132 | #ifdef OPENSSL_FIPS | ||
133 | #include <openssl/fips.h> | ||
134 | #endif | ||
132 | 135 | ||
133 | /* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the | 136 | /* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the |
134 | * base prototypes (we cast each variable inside the function to the required | 137 | * base prototypes (we cast each variable inside the function to the required |
@@ -310,6 +313,19 @@ int main(int Argc, char *ARGV[]) | |||
310 | CRYPTO_set_locking_callback(lock_dbg_cb); | 313 | CRYPTO_set_locking_callback(lock_dbg_cb); |
311 | } | 314 | } |
312 | 315 | ||
316 | if(getenv("OPENSSL_FIPS")) { | ||
317 | #ifdef OPENSSL_FIPS | ||
318 | if (!FIPS_mode_set(1)) { | ||
319 | ERR_load_crypto_strings(); | ||
320 | ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE)); | ||
321 | EXIT(1); | ||
322 | } | ||
323 | #else | ||
324 | fprintf(stderr, "FIPS mode not supported.\n"); | ||
325 | EXIT(1); | ||
326 | #endif | ||
327 | } | ||
328 | |||
313 | apps_startup(); | 329 | apps_startup(); |
314 | 330 | ||
315 | /* Lets load up our environment a little */ | 331 | /* Lets load up our environment a little */ |
diff --git a/src/lib/libssl/src/apps/progs.h b/src/lib/libssl/src/apps/progs.h index 79e479a337..949e78066b 100644 --- a/src/lib/libssl/src/apps/progs.h +++ b/src/lib/libssl/src/apps/progs.h | |||
@@ -46,6 +46,7 @@ extern int engine_main(int argc,char *argv[]); | |||
46 | extern int ocsp_main(int argc,char *argv[]); | 46 | extern int ocsp_main(int argc,char *argv[]); |
47 | extern int prime_main(int argc,char *argv[]); | 47 | extern int prime_main(int argc,char *argv[]); |
48 | extern int ts_main(int argc,char *argv[]); | 48 | extern int ts_main(int argc,char *argv[]); |
49 | extern int srp_main(int argc,char *argv[]); | ||
49 | 50 | ||
50 | #define FUNC_TYPE_GENERAL 1 | 51 | #define FUNC_TYPE_GENERAL 1 |
51 | #define FUNC_TYPE_MD 2 | 52 | #define FUNC_TYPE_MD 2 |
@@ -147,6 +148,9 @@ FUNCTION functions[] = { | |||
147 | #endif | 148 | #endif |
148 | {FUNC_TYPE_GENERAL,"prime",prime_main}, | 149 | {FUNC_TYPE_GENERAL,"prime",prime_main}, |
149 | {FUNC_TYPE_GENERAL,"ts",ts_main}, | 150 | {FUNC_TYPE_GENERAL,"ts",ts_main}, |
151 | #ifndef OPENSSL_NO_SRP | ||
152 | {FUNC_TYPE_GENERAL,"srp",srp_main}, | ||
153 | #endif | ||
150 | #ifndef OPENSSL_NO_MD2 | 154 | #ifndef OPENSSL_NO_MD2 |
151 | {FUNC_TYPE_MD,"md2",dgst_main}, | 155 | {FUNC_TYPE_MD,"md2",dgst_main}, |
152 | #endif | 156 | #endif |
diff --git a/src/lib/libssl/src/apps/progs.pl b/src/lib/libssl/src/apps/progs.pl index de6fdeabbd..39ca8f71fb 100644 --- a/src/lib/libssl/src/apps/progs.pl +++ b/src/lib/libssl/src/apps/progs.pl | |||
@@ -51,6 +51,8 @@ foreach (@ARGV) | |||
51 | { print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; } | 51 | { print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; } |
52 | elsif ( ($_ =~ /^ocsp$/)) | 52 | elsif ( ($_ =~ /^ocsp$/)) |
53 | { print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; } | 53 | { print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; } |
54 | elsif ( ($_ =~ /^srp$/)) | ||
55 | { print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n"; } | ||
54 | else | 56 | else |
55 | { print $str; } | 57 | { print $str; } |
56 | } | 58 | } |
diff --git a/src/lib/libssl/src/apps/req.c b/src/lib/libssl/src/apps/req.c index 820cd18fc7..85526581ce 100644 --- a/src/lib/libssl/src/apps/req.c +++ b/src/lib/libssl/src/apps/req.c | |||
@@ -165,7 +165,7 @@ int MAIN(int argc, char **argv) | |||
165 | EVP_PKEY_CTX *genctx = NULL; | 165 | EVP_PKEY_CTX *genctx = NULL; |
166 | const char *keyalg = NULL; | 166 | const char *keyalg = NULL; |
167 | char *keyalgstr = NULL; | 167 | char *keyalgstr = NULL; |
168 | STACK_OF(OPENSSL_STRING) *pkeyopts = NULL; | 168 | STACK_OF(OPENSSL_STRING) *pkeyopts = NULL, *sigopts = NULL; |
169 | EVP_PKEY *pkey=NULL; | 169 | EVP_PKEY *pkey=NULL; |
170 | int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1; | 170 | int i=0,badops=0,newreq=0,verbose=0,pkey_type=-1; |
171 | long newkey = -1; | 171 | long newkey = -1; |
@@ -310,6 +310,15 @@ int MAIN(int argc, char **argv) | |||
310 | if (!pkeyopts || !sk_OPENSSL_STRING_push(pkeyopts, *(++argv))) | 310 | if (!pkeyopts || !sk_OPENSSL_STRING_push(pkeyopts, *(++argv))) |
311 | goto bad; | 311 | goto bad; |
312 | } | 312 | } |
313 | else if (strcmp(*argv,"-sigopt") == 0) | ||
314 | { | ||
315 | if (--argc < 1) | ||
316 | goto bad; | ||
317 | if (!sigopts) | ||
318 | sigopts = sk_OPENSSL_STRING_new_null(); | ||
319 | if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv))) | ||
320 | goto bad; | ||
321 | } | ||
313 | else if (strcmp(*argv,"-batch") == 0) | 322 | else if (strcmp(*argv,"-batch") == 0) |
314 | batch=1; | 323 | batch=1; |
315 | else if (strcmp(*argv,"-newhdr") == 0) | 324 | else if (strcmp(*argv,"-newhdr") == 0) |
@@ -858,8 +867,9 @@ loop: | |||
858 | extensions); | 867 | extensions); |
859 | goto end; | 868 | goto end; |
860 | } | 869 | } |
861 | 870 | ||
862 | if (!(i=X509_sign(x509ss,pkey,digest))) | 871 | i=do_X509_sign(bio_err, x509ss, pkey, digest, sigopts); |
872 | if (!i) | ||
863 | { | 873 | { |
864 | ERR_print_errors(bio_err); | 874 | ERR_print_errors(bio_err); |
865 | goto end; | 875 | goto end; |
@@ -883,7 +893,8 @@ loop: | |||
883 | req_exts); | 893 | req_exts); |
884 | goto end; | 894 | goto end; |
885 | } | 895 | } |
886 | if (!(i=X509_REQ_sign(req,pkey,digest))) | 896 | i=do_X509_REQ_sign(bio_err, req, pkey, digest, sigopts); |
897 | if (!i) | ||
887 | { | 898 | { |
888 | ERR_print_errors(bio_err); | 899 | ERR_print_errors(bio_err); |
889 | goto end; | 900 | goto end; |
@@ -1084,6 +1095,8 @@ end: | |||
1084 | EVP_PKEY_CTX_free(genctx); | 1095 | EVP_PKEY_CTX_free(genctx); |
1085 | if (pkeyopts) | 1096 | if (pkeyopts) |
1086 | sk_OPENSSL_STRING_free(pkeyopts); | 1097 | sk_OPENSSL_STRING_free(pkeyopts); |
1098 | if (sigopts) | ||
1099 | sk_OPENSSL_STRING_free(sigopts); | ||
1087 | #ifndef OPENSSL_NO_ENGINE | 1100 | #ifndef OPENSSL_NO_ENGINE |
1088 | if (gen_eng) | 1101 | if (gen_eng) |
1089 | ENGINE_free(gen_eng); | 1102 | ENGINE_free(gen_eng); |
@@ -1756,3 +1769,68 @@ static int genpkey_cb(EVP_PKEY_CTX *ctx) | |||
1756 | #endif | 1769 | #endif |
1757 | return 1; | 1770 | return 1; |
1758 | } | 1771 | } |
1772 | |||
1773 | static int do_sign_init(BIO *err, EVP_MD_CTX *ctx, EVP_PKEY *pkey, | ||
1774 | const EVP_MD *md, STACK_OF(OPENSSL_STRING) *sigopts) | ||
1775 | { | ||
1776 | EVP_PKEY_CTX *pkctx = NULL; | ||
1777 | int i; | ||
1778 | EVP_MD_CTX_init(ctx); | ||
1779 | if (!EVP_DigestSignInit(ctx, &pkctx, md, NULL, pkey)) | ||
1780 | return 0; | ||
1781 | for (i = 0; i < sk_OPENSSL_STRING_num(sigopts); i++) | ||
1782 | { | ||
1783 | char *sigopt = sk_OPENSSL_STRING_value(sigopts, i); | ||
1784 | if (pkey_ctrl_string(pkctx, sigopt) <= 0) | ||
1785 | { | ||
1786 | BIO_printf(err, "parameter error \"%s\"\n", sigopt); | ||
1787 | ERR_print_errors(bio_err); | ||
1788 | return 0; | ||
1789 | } | ||
1790 | } | ||
1791 | return 1; | ||
1792 | } | ||
1793 | |||
1794 | int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md, | ||
1795 | STACK_OF(OPENSSL_STRING) *sigopts) | ||
1796 | { | ||
1797 | int rv; | ||
1798 | EVP_MD_CTX mctx; | ||
1799 | EVP_MD_CTX_init(&mctx); | ||
1800 | rv = do_sign_init(err, &mctx, pkey, md, sigopts); | ||
1801 | if (rv > 0) | ||
1802 | rv = X509_sign_ctx(x, &mctx); | ||
1803 | EVP_MD_CTX_cleanup(&mctx); | ||
1804 | return rv > 0 ? 1 : 0; | ||
1805 | } | ||
1806 | |||
1807 | |||
1808 | int do_X509_REQ_sign(BIO *err, X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md, | ||
1809 | STACK_OF(OPENSSL_STRING) *sigopts) | ||
1810 | { | ||
1811 | int rv; | ||
1812 | EVP_MD_CTX mctx; | ||
1813 | EVP_MD_CTX_init(&mctx); | ||
1814 | rv = do_sign_init(err, &mctx, pkey, md, sigopts); | ||
1815 | if (rv > 0) | ||
1816 | rv = X509_REQ_sign_ctx(x, &mctx); | ||
1817 | EVP_MD_CTX_cleanup(&mctx); | ||
1818 | return rv > 0 ? 1 : 0; | ||
1819 | } | ||
1820 | |||
1821 | |||
1822 | |||
1823 | int do_X509_CRL_sign(BIO *err, X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md, | ||
1824 | STACK_OF(OPENSSL_STRING) *sigopts) | ||
1825 | { | ||
1826 | int rv; | ||
1827 | EVP_MD_CTX mctx; | ||
1828 | EVP_MD_CTX_init(&mctx); | ||
1829 | rv = do_sign_init(err, &mctx, pkey, md, sigopts); | ||
1830 | if (rv > 0) | ||
1831 | rv = X509_CRL_sign_ctx(x, &mctx); | ||
1832 | EVP_MD_CTX_cleanup(&mctx); | ||
1833 | return rv > 0 ? 1 : 0; | ||
1834 | } | ||
1835 | |||
1836 | |||
diff --git a/src/lib/libssl/src/apps/s_cb.c b/src/lib/libssl/src/apps/s_cb.c index c4f5512247..2cd73376df 100644 --- a/src/lib/libssl/src/apps/s_cb.c +++ b/src/lib/libssl/src/apps/s_cb.c | |||
@@ -357,6 +357,12 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void * | |||
357 | case TLS1_VERSION: | 357 | case TLS1_VERSION: |
358 | str_version = "TLS 1.0 "; | 358 | str_version = "TLS 1.0 "; |
359 | break; | 359 | break; |
360 | case TLS1_1_VERSION: | ||
361 | str_version = "TLS 1.1 "; | ||
362 | break; | ||
363 | case TLS1_2_VERSION: | ||
364 | str_version = "TLS 1.2 "; | ||
365 | break; | ||
360 | case DTLS1_VERSION: | 366 | case DTLS1_VERSION: |
361 | str_version = "DTLS 1.0 "; | 367 | str_version = "DTLS 1.0 "; |
362 | break; | 368 | break; |
@@ -549,6 +555,9 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void * | |||
549 | case 114: | 555 | case 114: |
550 | str_details2 = " bad_certificate_hash_value"; | 556 | str_details2 = " bad_certificate_hash_value"; |
551 | break; | 557 | break; |
558 | case 115: | ||
559 | str_details2 = " unknown_psk_identity"; | ||
560 | break; | ||
552 | } | 561 | } |
553 | } | 562 | } |
554 | } | 563 | } |
@@ -597,6 +606,26 @@ void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void * | |||
597 | } | 606 | } |
598 | } | 607 | } |
599 | } | 608 | } |
609 | |||
610 | #ifndef OPENSSL_NO_HEARTBEATS | ||
611 | if (content_type == 24) /* Heartbeat */ | ||
612 | { | ||
613 | str_details1 = ", Heartbeat"; | ||
614 | |||
615 | if (len > 0) | ||
616 | { | ||
617 | switch (((const unsigned char*)buf)[0]) | ||
618 | { | ||
619 | case 1: | ||
620 | str_details1 = ", HeartbeatRequest"; | ||
621 | break; | ||
622 | case 2: | ||
623 | str_details1 = ", HeartbeatResponse"; | ||
624 | break; | ||
625 | } | ||
626 | } | ||
627 | } | ||
628 | #endif | ||
600 | } | 629 | } |
601 | 630 | ||
602 | BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version, str_content_type, (unsigned long)len, str_details1, str_details2); | 631 | BIO_printf(bio, "%s %s%s [length %04lx]%s%s\n", str_write_p, str_version, str_content_type, (unsigned long)len, str_details1, str_details2); |
@@ -657,6 +686,22 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type, | |||
657 | extname = "status request"; | 686 | extname = "status request"; |
658 | break; | 687 | break; |
659 | 688 | ||
689 | case TLSEXT_TYPE_user_mapping: | ||
690 | extname = "user mapping"; | ||
691 | break; | ||
692 | |||
693 | case TLSEXT_TYPE_client_authz: | ||
694 | extname = "client authz"; | ||
695 | break; | ||
696 | |||
697 | case TLSEXT_TYPE_server_authz: | ||
698 | extname = "server authz"; | ||
699 | break; | ||
700 | |||
701 | case TLSEXT_TYPE_cert_type: | ||
702 | extname = "cert type"; | ||
703 | break; | ||
704 | |||
660 | case TLSEXT_TYPE_elliptic_curves: | 705 | case TLSEXT_TYPE_elliptic_curves: |
661 | extname = "elliptic curves"; | 706 | extname = "elliptic curves"; |
662 | break; | 707 | break; |
@@ -665,12 +710,28 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type, | |||
665 | extname = "EC point formats"; | 710 | extname = "EC point formats"; |
666 | break; | 711 | break; |
667 | 712 | ||
713 | case TLSEXT_TYPE_srp: | ||
714 | extname = "SRP"; | ||
715 | break; | ||
716 | |||
717 | case TLSEXT_TYPE_signature_algorithms: | ||
718 | extname = "signature algorithms"; | ||
719 | break; | ||
720 | |||
721 | case TLSEXT_TYPE_use_srtp: | ||
722 | extname = "use SRTP"; | ||
723 | break; | ||
724 | |||
725 | case TLSEXT_TYPE_heartbeat: | ||
726 | extname = "heartbeat"; | ||
727 | break; | ||
728 | |||
668 | case TLSEXT_TYPE_session_ticket: | 729 | case TLSEXT_TYPE_session_ticket: |
669 | extname = "server ticket"; | 730 | extname = "session ticket"; |
670 | break; | 731 | break; |
671 | 732 | ||
672 | case TLSEXT_TYPE_renegotiate: | 733 | case TLSEXT_TYPE_renegotiate: |
673 | extname = "renegotiate"; | 734 | extname = "renegotiation info"; |
674 | break; | 735 | break; |
675 | 736 | ||
676 | #ifdef TLSEXT_TYPE_opaque_prf_input | 737 | #ifdef TLSEXT_TYPE_opaque_prf_input |
@@ -678,6 +739,11 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type, | |||
678 | extname = "opaque PRF input"; | 739 | extname = "opaque PRF input"; |
679 | break; | 740 | break; |
680 | #endif | 741 | #endif |
742 | #ifdef TLSEXT_TYPE_next_proto_neg | ||
743 | case TLSEXT_TYPE_next_proto_neg: | ||
744 | extname = "next protocol"; | ||
745 | break; | ||
746 | #endif | ||
681 | 747 | ||
682 | default: | 748 | default: |
683 | extname = "unknown"; | 749 | extname = "unknown"; |
diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c index 34ad2cec78..fc806eb672 100644 --- a/src/lib/libssl/src/apps/s_client.c +++ b/src/lib/libssl/src/apps/s_client.c | |||
@@ -163,6 +163,9 @@ typedef unsigned int u_int; | |||
163 | #include <openssl/rand.h> | 163 | #include <openssl/rand.h> |
164 | #include <openssl/ocsp.h> | 164 | #include <openssl/ocsp.h> |
165 | #include <openssl/bn.h> | 165 | #include <openssl/bn.h> |
166 | #ifndef OPENSSL_NO_SRP | ||
167 | #include <openssl/srp.h> | ||
168 | #endif | ||
166 | #include "s_apps.h" | 169 | #include "s_apps.h" |
167 | #include "timeouts.h" | 170 | #include "timeouts.h" |
168 | 171 | ||
@@ -203,6 +206,9 @@ static int c_status_req=0; | |||
203 | static int c_msg=0; | 206 | static int c_msg=0; |
204 | static int c_showcerts=0; | 207 | static int c_showcerts=0; |
205 | 208 | ||
209 | static char *keymatexportlabel=NULL; | ||
210 | static int keymatexportlen=20; | ||
211 | |||
206 | static void sc_usage(void); | 212 | static void sc_usage(void); |
207 | static void print_stuff(BIO *berr,SSL *con,int full); | 213 | static void print_stuff(BIO *berr,SSL *con,int full); |
208 | #ifndef OPENSSL_NO_TLSEXT | 214 | #ifndef OPENSSL_NO_TLSEXT |
@@ -316,12 +322,21 @@ static void sc_usage(void) | |||
316 | BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n"); | 322 | BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n"); |
317 | # endif | 323 | # endif |
318 | #endif | 324 | #endif |
325 | #ifndef OPENSSL_NO_SRP | ||
326 | BIO_printf(bio_err," -srpuser user - SRP authentification for 'user'\n"); | ||
327 | BIO_printf(bio_err," -srppass arg - password for 'user'\n"); | ||
328 | BIO_printf(bio_err," -srp_lateuser - SRP username into second ClientHello message\n"); | ||
329 | BIO_printf(bio_err," -srp_moregroups - Tolerate other than the known g N values.\n"); | ||
330 | BIO_printf(bio_err," -srp_strength int - minimal mength in bits for N (default %d).\n",SRP_MINIMAL_N); | ||
331 | #endif | ||
319 | BIO_printf(bio_err," -ssl2 - just use SSLv2\n"); | 332 | BIO_printf(bio_err," -ssl2 - just use SSLv2\n"); |
320 | BIO_printf(bio_err," -ssl3 - just use SSLv3\n"); | 333 | BIO_printf(bio_err," -ssl3 - just use SSLv3\n"); |
334 | BIO_printf(bio_err," -tls1_2 - just use TLSv1.2\n"); | ||
335 | BIO_printf(bio_err," -tls1_1 - just use TLSv1.1\n"); | ||
321 | BIO_printf(bio_err," -tls1 - just use TLSv1\n"); | 336 | BIO_printf(bio_err," -tls1 - just use TLSv1\n"); |
322 | BIO_printf(bio_err," -dtls1 - just use DTLSv1\n"); | 337 | BIO_printf(bio_err," -dtls1 - just use DTLSv1\n"); |
323 | BIO_printf(bio_err," -mtu - set the link layer MTU\n"); | 338 | BIO_printf(bio_err," -mtu - set the link layer MTU\n"); |
324 | BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n"); | 339 | BIO_printf(bio_err," -no_tls1_2/-no_tls1_1/-no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n"); |
325 | BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n"); | 340 | BIO_printf(bio_err," -bugs - Switch on all SSL implementation bug workarounds\n"); |
326 | BIO_printf(bio_err," -serverpref - Use server's cipher preferences (only SSLv2)\n"); | 341 | BIO_printf(bio_err," -serverpref - Use server's cipher preferences (only SSLv2)\n"); |
327 | BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n"); | 342 | BIO_printf(bio_err," -cipher - preferred cipher to use, use the 'openssl ciphers'\n"); |
@@ -342,8 +357,14 @@ static void sc_usage(void) | |||
342 | BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n"); | 357 | BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n"); |
343 | BIO_printf(bio_err," -status - request certificate status from server\n"); | 358 | BIO_printf(bio_err," -status - request certificate status from server\n"); |
344 | BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); | 359 | BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); |
360 | # if !defined(OPENSSL_NO_NEXTPROTONEG) | ||
361 | BIO_printf(bio_err," -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n"); | ||
362 | # endif | ||
345 | #endif | 363 | #endif |
346 | BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); | 364 | BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); |
365 | BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n"); | ||
366 | BIO_printf(bio_err," -keymatexport label - Export keying material using label\n"); | ||
367 | BIO_printf(bio_err," -keymatexportlen len - Export len bytes of keying material (default 20)\n"); | ||
347 | } | 368 | } |
348 | 369 | ||
349 | #ifndef OPENSSL_NO_TLSEXT | 370 | #ifndef OPENSSL_NO_TLSEXT |
@@ -366,6 +387,156 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg) | |||
366 | 387 | ||
367 | return SSL_TLSEXT_ERR_OK; | 388 | return SSL_TLSEXT_ERR_OK; |
368 | } | 389 | } |
390 | |||
391 | #ifndef OPENSSL_NO_SRP | ||
392 | |||
393 | /* This is a context that we pass to all callbacks */ | ||
394 | typedef struct srp_arg_st | ||
395 | { | ||
396 | char *srppassin; | ||
397 | char *srplogin; | ||
398 | int msg; /* copy from c_msg */ | ||
399 | int debug; /* copy from c_debug */ | ||
400 | int amp; /* allow more groups */ | ||
401 | int strength /* minimal size for N */ ; | ||
402 | } SRP_ARG; | ||
403 | |||
404 | #define SRP_NUMBER_ITERATIONS_FOR_PRIME 64 | ||
405 | |||
406 | static int srp_Verify_N_and_g(BIGNUM *N, BIGNUM *g) | ||
407 | { | ||
408 | BN_CTX *bn_ctx = BN_CTX_new(); | ||
409 | BIGNUM *p = BN_new(); | ||
410 | BIGNUM *r = BN_new(); | ||
411 | int ret = | ||
412 | g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) && | ||
413 | BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) && | ||
414 | p != NULL && BN_rshift1(p, N) && | ||
415 | |||
416 | /* p = (N-1)/2 */ | ||
417 | BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) && | ||
418 | r != NULL && | ||
419 | |||
420 | /* verify g^((N-1)/2) == -1 (mod N) */ | ||
421 | BN_mod_exp(r, g, p, N, bn_ctx) && | ||
422 | BN_add_word(r, 1) && | ||
423 | BN_cmp(r, N) == 0; | ||
424 | |||
425 | if(r) | ||
426 | BN_free(r); | ||
427 | if(p) | ||
428 | BN_free(p); | ||
429 | if(bn_ctx) | ||
430 | BN_CTX_free(bn_ctx); | ||
431 | return ret; | ||
432 | } | ||
433 | |||
434 | /* This callback is used here for two purposes: | ||
435 | - extended debugging | ||
436 | - making some primality tests for unknown groups | ||
437 | The callback is only called for a non default group. | ||
438 | |||
439 | An application does not need the call back at all if | ||
440 | only the stanard groups are used. In real life situations, | ||
441 | client and server already share well known groups, | ||
442 | thus there is no need to verify them. | ||
443 | Furthermore, in case that a server actually proposes a group that | ||
444 | is not one of those defined in RFC 5054, it is more appropriate | ||
445 | to add the group to a static list and then compare since | ||
446 | primality tests are rather cpu consuming. | ||
447 | */ | ||
448 | |||
449 | static int MS_CALLBACK ssl_srp_verify_param_cb(SSL *s, void *arg) | ||
450 | { | ||
451 | SRP_ARG *srp_arg = (SRP_ARG *)arg; | ||
452 | BIGNUM *N = NULL, *g = NULL; | ||
453 | if (!(N = SSL_get_srp_N(s)) || !(g = SSL_get_srp_g(s))) | ||
454 | return 0; | ||
455 | if (srp_arg->debug || srp_arg->msg || srp_arg->amp == 1) | ||
456 | { | ||
457 | BIO_printf(bio_err, "SRP parameters:\n"); | ||
458 | BIO_printf(bio_err,"\tN="); BN_print(bio_err,N); | ||
459 | BIO_printf(bio_err,"\n\tg="); BN_print(bio_err,g); | ||
460 | BIO_printf(bio_err,"\n"); | ||
461 | } | ||
462 | |||
463 | if (SRP_check_known_gN_param(g,N)) | ||
464 | return 1; | ||
465 | |||
466 | if (srp_arg->amp == 1) | ||
467 | { | ||
468 | if (srp_arg->debug) | ||
469 | BIO_printf(bio_err, "SRP param N and g are not known params, going to check deeper.\n"); | ||
470 | |||
471 | /* The srp_moregroups is a real debugging feature. | ||
472 | Implementors should rather add the value to the known ones. | ||
473 | The minimal size has already been tested. | ||
474 | */ | ||
475 | if (BN_num_bits(g) <= BN_BITS && srp_Verify_N_and_g(N,g)) | ||
476 | return 1; | ||
477 | } | ||
478 | BIO_printf(bio_err, "SRP param N and g rejected.\n"); | ||
479 | return 0; | ||
480 | } | ||
481 | |||
482 | #define PWD_STRLEN 1024 | ||
483 | |||
484 | static char * MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg) | ||
485 | { | ||
486 | SRP_ARG *srp_arg = (SRP_ARG *)arg; | ||
487 | char *pass = (char *)OPENSSL_malloc(PWD_STRLEN+1); | ||
488 | PW_CB_DATA cb_tmp; | ||
489 | int l; | ||
490 | |||
491 | cb_tmp.password = (char *)srp_arg->srppassin; | ||
492 | cb_tmp.prompt_info = "SRP user"; | ||
493 | if ((l = password_callback(pass, PWD_STRLEN, 0, &cb_tmp))<0) | ||
494 | { | ||
495 | BIO_printf (bio_err, "Can't read Password\n"); | ||
496 | OPENSSL_free(pass); | ||
497 | return NULL; | ||
498 | } | ||
499 | *(pass+l)= '\0'; | ||
500 | |||
501 | return pass; | ||
502 | } | ||
503 | |||
504 | #endif | ||
505 | char *srtp_profiles = NULL; | ||
506 | |||
507 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
508 | /* This the context that we pass to next_proto_cb */ | ||
509 | typedef struct tlsextnextprotoctx_st { | ||
510 | unsigned char *data; | ||
511 | unsigned short len; | ||
512 | int status; | ||
513 | } tlsextnextprotoctx; | ||
514 | |||
515 | static tlsextnextprotoctx next_proto; | ||
516 | |||
517 | static int next_proto_cb(SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg) | ||
518 | { | ||
519 | tlsextnextprotoctx *ctx = arg; | ||
520 | |||
521 | if (!c_quiet) | ||
522 | { | ||
523 | /* We can assume that |in| is syntactically valid. */ | ||
524 | unsigned i; | ||
525 | BIO_printf(bio_c_out, "Protocols advertised by server: "); | ||
526 | for (i = 0; i < inlen; ) | ||
527 | { | ||
528 | if (i) | ||
529 | BIO_write(bio_c_out, ", ", 2); | ||
530 | BIO_write(bio_c_out, &in[i + 1], in[i]); | ||
531 | i += in[i] + 1; | ||
532 | } | ||
533 | BIO_write(bio_c_out, "\n", 1); | ||
534 | } | ||
535 | |||
536 | ctx->status = SSL_select_next_proto(out, outlen, in, inlen, ctx->data, ctx->len); | ||
537 | return SSL_TLSEXT_ERR_OK; | ||
538 | } | ||
539 | # endif | ||
369 | #endif | 540 | #endif |
370 | 541 | ||
371 | enum | 542 | enum |
@@ -384,6 +555,9 @@ int MAIN(int argc, char **argv) | |||
384 | { | 555 | { |
385 | unsigned int off=0, clr=0; | 556 | unsigned int off=0, clr=0; |
386 | SSL *con=NULL; | 557 | SSL *con=NULL; |
558 | #ifndef OPENSSL_NO_KRB5 | ||
559 | KSSL_CTX *kctx; | ||
560 | #endif | ||
387 | int s,k,width,state=0; | 561 | int s,k,width,state=0; |
388 | char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL; | 562 | char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL; |
389 | int cbuf_len,cbuf_off; | 563 | int cbuf_len,cbuf_off; |
@@ -429,6 +603,9 @@ int MAIN(int argc, char **argv) | |||
429 | char *servername = NULL; | 603 | char *servername = NULL; |
430 | tlsextctx tlsextcbp = | 604 | tlsextctx tlsextcbp = |
431 | {NULL,0}; | 605 | {NULL,0}; |
606 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
607 | const char *next_proto_neg_in = NULL; | ||
608 | # endif | ||
432 | #endif | 609 | #endif |
433 | char *sess_in = NULL; | 610 | char *sess_in = NULL; |
434 | char *sess_out = NULL; | 611 | char *sess_out = NULL; |
@@ -439,14 +616,13 @@ int MAIN(int argc, char **argv) | |||
439 | #ifndef OPENSSL_NO_JPAKE | 616 | #ifndef OPENSSL_NO_JPAKE |
440 | char *jpake_secret = NULL; | 617 | char *jpake_secret = NULL; |
441 | #endif | 618 | #endif |
619 | #ifndef OPENSSL_NO_SRP | ||
620 | char * srppass = NULL; | ||
621 | int srp_lateuser = 0; | ||
622 | SRP_ARG srp_arg = {NULL,NULL,0,0,0,1024}; | ||
623 | #endif | ||
442 | 624 | ||
443 | #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) | ||
444 | meth=SSLv23_client_method(); | 625 | meth=SSLv23_client_method(); |
445 | #elif !defined(OPENSSL_NO_SSL3) | ||
446 | meth=SSLv3_client_method(); | ||
447 | #elif !defined(OPENSSL_NO_SSL2) | ||
448 | meth=SSLv2_client_method(); | ||
449 | #endif | ||
450 | 626 | ||
451 | apps_startup(); | 627 | apps_startup(); |
452 | c_Pause=0; | 628 | c_Pause=0; |
@@ -581,13 +757,44 @@ int MAIN(int argc, char **argv) | |||
581 | psk_key=*(++argv); | 757 | psk_key=*(++argv); |
582 | for (j = 0; j < strlen(psk_key); j++) | 758 | for (j = 0; j < strlen(psk_key); j++) |
583 | { | 759 | { |
584 | if (isxdigit((int)psk_key[j])) | 760 | if (isxdigit((unsigned char)psk_key[j])) |
585 | continue; | 761 | continue; |
586 | BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); | 762 | BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); |
587 | goto bad; | 763 | goto bad; |
588 | } | 764 | } |
589 | } | 765 | } |
590 | #endif | 766 | #endif |
767 | #ifndef OPENSSL_NO_SRP | ||
768 | else if (strcmp(*argv,"-srpuser") == 0) | ||
769 | { | ||
770 | if (--argc < 1) goto bad; | ||
771 | srp_arg.srplogin= *(++argv); | ||
772 | meth=TLSv1_client_method(); | ||
773 | } | ||
774 | else if (strcmp(*argv,"-srppass") == 0) | ||
775 | { | ||
776 | if (--argc < 1) goto bad; | ||
777 | srppass= *(++argv); | ||
778 | meth=TLSv1_client_method(); | ||
779 | } | ||
780 | else if (strcmp(*argv,"-srp_strength") == 0) | ||
781 | { | ||
782 | if (--argc < 1) goto bad; | ||
783 | srp_arg.strength=atoi(*(++argv)); | ||
784 | BIO_printf(bio_err,"SRP minimal length for N is %d\n",srp_arg.strength); | ||
785 | meth=TLSv1_client_method(); | ||
786 | } | ||
787 | else if (strcmp(*argv,"-srp_lateuser") == 0) | ||
788 | { | ||
789 | srp_lateuser= 1; | ||
790 | meth=TLSv1_client_method(); | ||
791 | } | ||
792 | else if (strcmp(*argv,"-srp_moregroups") == 0) | ||
793 | { | ||
794 | srp_arg.amp=1; | ||
795 | meth=TLSv1_client_method(); | ||
796 | } | ||
797 | #endif | ||
591 | #ifndef OPENSSL_NO_SSL2 | 798 | #ifndef OPENSSL_NO_SSL2 |
592 | else if (strcmp(*argv,"-ssl2") == 0) | 799 | else if (strcmp(*argv,"-ssl2") == 0) |
593 | meth=SSLv2_client_method(); | 800 | meth=SSLv2_client_method(); |
@@ -597,6 +804,10 @@ int MAIN(int argc, char **argv) | |||
597 | meth=SSLv3_client_method(); | 804 | meth=SSLv3_client_method(); |
598 | #endif | 805 | #endif |
599 | #ifndef OPENSSL_NO_TLS1 | 806 | #ifndef OPENSSL_NO_TLS1 |
807 | else if (strcmp(*argv,"-tls1_2") == 0) | ||
808 | meth=TLSv1_2_client_method(); | ||
809 | else if (strcmp(*argv,"-tls1_1") == 0) | ||
810 | meth=TLSv1_1_client_method(); | ||
600 | else if (strcmp(*argv,"-tls1") == 0) | 811 | else if (strcmp(*argv,"-tls1") == 0) |
601 | meth=TLSv1_client_method(); | 812 | meth=TLSv1_client_method(); |
602 | #endif | 813 | #endif |
@@ -645,6 +856,10 @@ int MAIN(int argc, char **argv) | |||
645 | if (--argc < 1) goto bad; | 856 | if (--argc < 1) goto bad; |
646 | CAfile= *(++argv); | 857 | CAfile= *(++argv); |
647 | } | 858 | } |
859 | else if (strcmp(*argv,"-no_tls1_2") == 0) | ||
860 | off|=SSL_OP_NO_TLSv1_2; | ||
861 | else if (strcmp(*argv,"-no_tls1_1") == 0) | ||
862 | off|=SSL_OP_NO_TLSv1_1; | ||
648 | else if (strcmp(*argv,"-no_tls1") == 0) | 863 | else if (strcmp(*argv,"-no_tls1") == 0) |
649 | off|=SSL_OP_NO_TLSv1; | 864 | off|=SSL_OP_NO_TLSv1; |
650 | else if (strcmp(*argv,"-no_ssl3") == 0) | 865 | else if (strcmp(*argv,"-no_ssl3") == 0) |
@@ -656,6 +871,13 @@ int MAIN(int argc, char **argv) | |||
656 | #ifndef OPENSSL_NO_TLSEXT | 871 | #ifndef OPENSSL_NO_TLSEXT |
657 | else if (strcmp(*argv,"-no_ticket") == 0) | 872 | else if (strcmp(*argv,"-no_ticket") == 0) |
658 | { off|=SSL_OP_NO_TICKET; } | 873 | { off|=SSL_OP_NO_TICKET; } |
874 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
875 | else if (strcmp(*argv,"-nextprotoneg") == 0) | ||
876 | { | ||
877 | if (--argc < 1) goto bad; | ||
878 | next_proto_neg_in = *(++argv); | ||
879 | } | ||
880 | # endif | ||
659 | #endif | 881 | #endif |
660 | else if (strcmp(*argv,"-serverpref") == 0) | 882 | else if (strcmp(*argv,"-serverpref") == 0) |
661 | off|=SSL_OP_CIPHER_SERVER_PREFERENCE; | 883 | off|=SSL_OP_CIPHER_SERVER_PREFERENCE; |
@@ -723,7 +945,23 @@ int MAIN(int argc, char **argv) | |||
723 | jpake_secret = *++argv; | 945 | jpake_secret = *++argv; |
724 | } | 946 | } |
725 | #endif | 947 | #endif |
726 | else | 948 | else if (strcmp(*argv,"-use_srtp") == 0) |
949 | { | ||
950 | if (--argc < 1) goto bad; | ||
951 | srtp_profiles = *(++argv); | ||
952 | } | ||
953 | else if (strcmp(*argv,"-keymatexport") == 0) | ||
954 | { | ||
955 | if (--argc < 1) goto bad; | ||
956 | keymatexportlabel= *(++argv); | ||
957 | } | ||
958 | else if (strcmp(*argv,"-keymatexportlen") == 0) | ||
959 | { | ||
960 | if (--argc < 1) goto bad; | ||
961 | keymatexportlen=atoi(*(++argv)); | ||
962 | if (keymatexportlen == 0) goto bad; | ||
963 | } | ||
964 | else | ||
727 | { | 965 | { |
728 | BIO_printf(bio_err,"unknown option %s\n",*argv); | 966 | BIO_printf(bio_err,"unknown option %s\n",*argv); |
729 | badop=1; | 967 | badop=1; |
@@ -749,19 +987,33 @@ bad: | |||
749 | goto end; | 987 | goto end; |
750 | } | 988 | } |
751 | psk_identity = "JPAKE"; | 989 | psk_identity = "JPAKE"; |
990 | if (cipher) | ||
991 | { | ||
992 | BIO_printf(bio_err, "JPAKE sets cipher to PSK\n"); | ||
993 | goto end; | ||
994 | } | ||
995 | cipher = "PSK"; | ||
752 | } | 996 | } |
753 | |||
754 | if (cipher) | ||
755 | { | ||
756 | BIO_printf(bio_err, "JPAKE sets cipher to PSK\n"); | ||
757 | goto end; | ||
758 | } | ||
759 | cipher = "PSK"; | ||
760 | #endif | 997 | #endif |
761 | 998 | ||
762 | OpenSSL_add_ssl_algorithms(); | 999 | OpenSSL_add_ssl_algorithms(); |
763 | SSL_load_error_strings(); | 1000 | SSL_load_error_strings(); |
764 | 1001 | ||
1002 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
1003 | next_proto.status = -1; | ||
1004 | if (next_proto_neg_in) | ||
1005 | { | ||
1006 | next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in); | ||
1007 | if (next_proto.data == NULL) | ||
1008 | { | ||
1009 | BIO_printf(bio_err, "Error parsing -nextprotoneg argument\n"); | ||
1010 | goto end; | ||
1011 | } | ||
1012 | } | ||
1013 | else | ||
1014 | next_proto.data = NULL; | ||
1015 | #endif | ||
1016 | |||
765 | #ifndef OPENSSL_NO_ENGINE | 1017 | #ifndef OPENSSL_NO_ENGINE |
766 | e = setup_engine(bio_err, engine_id, 1); | 1018 | e = setup_engine(bio_err, engine_id, 1); |
767 | if (ssl_client_engine_id) | 1019 | if (ssl_client_engine_id) |
@@ -835,6 +1087,14 @@ bad: | |||
835 | } | 1087 | } |
836 | } | 1088 | } |
837 | 1089 | ||
1090 | #ifndef OPENSSL_NO_SRP | ||
1091 | if(!app_passwd(bio_err, srppass, NULL, &srp_arg.srppassin, NULL)) | ||
1092 | { | ||
1093 | BIO_printf(bio_err, "Error getting password\n"); | ||
1094 | goto end; | ||
1095 | } | ||
1096 | #endif | ||
1097 | |||
838 | ctx=SSL_CTX_new(meth); | 1098 | ctx=SSL_CTX_new(meth); |
839 | if (ctx == NULL) | 1099 | if (ctx == NULL) |
840 | { | 1100 | { |
@@ -870,6 +1130,8 @@ bad: | |||
870 | BIO_printf(bio_c_out, "PSK key given or JPAKE in use, setting client callback\n"); | 1130 | BIO_printf(bio_c_out, "PSK key given or JPAKE in use, setting client callback\n"); |
871 | SSL_CTX_set_psk_client_callback(ctx, psk_client_cb); | 1131 | SSL_CTX_set_psk_client_callback(ctx, psk_client_cb); |
872 | } | 1132 | } |
1133 | if (srtp_profiles != NULL) | ||
1134 | SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles); | ||
873 | #endif | 1135 | #endif |
874 | if (bugs) | 1136 | if (bugs) |
875 | SSL_CTX_set_options(ctx,SSL_OP_ALL|off); | 1137 | SSL_CTX_set_options(ctx,SSL_OP_ALL|off); |
@@ -883,6 +1145,11 @@ bad: | |||
883 | */ | 1145 | */ |
884 | if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1); | 1146 | if (socket_type == SOCK_DGRAM) SSL_CTX_set_read_ahead(ctx, 1); |
885 | 1147 | ||
1148 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
1149 | if (next_proto.data) | ||
1150 | SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &next_proto); | ||
1151 | #endif | ||
1152 | |||
886 | if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback); | 1153 | if (state) SSL_CTX_set_info_callback(ctx,apps_ssl_info_callback); |
887 | if (cipher != NULL) | 1154 | if (cipher != NULL) |
888 | if(!SSL_CTX_set_cipher_list(ctx,cipher)) { | 1155 | if(!SSL_CTX_set_cipher_list(ctx,cipher)) { |
@@ -914,6 +1181,24 @@ bad: | |||
914 | SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb); | 1181 | SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb); |
915 | SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp); | 1182 | SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp); |
916 | } | 1183 | } |
1184 | #ifndef OPENSSL_NO_SRP | ||
1185 | if (srp_arg.srplogin) | ||
1186 | { | ||
1187 | if (!srp_lateuser && !SSL_CTX_set_srp_username(ctx, srp_arg.srplogin)) | ||
1188 | { | ||
1189 | BIO_printf(bio_err,"Unable to set SRP username\n"); | ||
1190 | goto end; | ||
1191 | } | ||
1192 | srp_arg.msg = c_msg; | ||
1193 | srp_arg.debug = c_debug ; | ||
1194 | SSL_CTX_set_srp_cb_arg(ctx,&srp_arg); | ||
1195 | SSL_CTX_set_srp_client_pwd_callback(ctx, ssl_give_srp_client_pwd_cb); | ||
1196 | SSL_CTX_set_srp_strength(ctx, srp_arg.strength); | ||
1197 | if (c_msg || c_debug || srp_arg.amp == 0) | ||
1198 | SSL_CTX_set_srp_verify_param_callback(ctx, ssl_srp_verify_param_cb); | ||
1199 | } | ||
1200 | |||
1201 | #endif | ||
917 | #endif | 1202 | #endif |
918 | 1203 | ||
919 | con=SSL_new(ctx); | 1204 | con=SSL_new(ctx); |
@@ -952,9 +1237,10 @@ bad: | |||
952 | } | 1237 | } |
953 | #endif | 1238 | #endif |
954 | #ifndef OPENSSL_NO_KRB5 | 1239 | #ifndef OPENSSL_NO_KRB5 |
955 | if (con && (con->kssl_ctx = kssl_ctx_new()) != NULL) | 1240 | if (con && (kctx = kssl_ctx_new()) != NULL) |
956 | { | 1241 | { |
957 | kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVER, host); | 1242 | SSL_set0_kssl_ctx(con, kctx); |
1243 | kssl_ctx_setstring(kctx, KSSL_SERVER, host); | ||
958 | } | 1244 | } |
959 | #endif /* OPENSSL_NO_KRB5 */ | 1245 | #endif /* OPENSSL_NO_KRB5 */ |
960 | /* SSL_set_cipher_list(con,"RC4-MD5"); */ | 1246 | /* SSL_set_cipher_list(con,"RC4-MD5"); */ |
@@ -986,7 +1272,7 @@ re_start: | |||
986 | } | 1272 | } |
987 | } | 1273 | } |
988 | #endif | 1274 | #endif |
989 | if (c_Pause & 0x01) con->debug=1; | 1275 | if (c_Pause & 0x01) SSL_set_debug(con, 1); |
990 | 1276 | ||
991 | if ( SSL_version(con) == DTLS1_VERSION) | 1277 | if ( SSL_version(con) == DTLS1_VERSION) |
992 | { | 1278 | { |
@@ -1035,7 +1321,7 @@ re_start: | |||
1035 | 1321 | ||
1036 | if (c_debug) | 1322 | if (c_debug) |
1037 | { | 1323 | { |
1038 | con->debug=1; | 1324 | SSL_set_debug(con, 1); |
1039 | BIO_set_callback(sbio,bio_dump_callback); | 1325 | BIO_set_callback(sbio,bio_dump_callback); |
1040 | BIO_set_callback_arg(sbio,(char *)bio_c_out); | 1326 | BIO_set_callback_arg(sbio,(char *)bio_c_out); |
1041 | } | 1327 | } |
@@ -1569,6 +1855,14 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240 | |||
1569 | SSL_renegotiate(con); | 1855 | SSL_renegotiate(con); |
1570 | cbuf_len=0; | 1856 | cbuf_len=0; |
1571 | } | 1857 | } |
1858 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1859 | else if ((!c_ign_eof) && (cbuf[0] == 'B')) | ||
1860 | { | ||
1861 | BIO_printf(bio_err,"HEARTBEATING\n"); | ||
1862 | SSL_heartbeat(con); | ||
1863 | cbuf_len=0; | ||
1864 | } | ||
1865 | #endif | ||
1572 | else | 1866 | else |
1573 | { | 1867 | { |
1574 | cbuf_len=i; | 1868 | cbuf_len=i; |
@@ -1630,6 +1924,7 @@ static void print_stuff(BIO *bio, SSL *s, int full) | |||
1630 | #ifndef OPENSSL_NO_COMP | 1924 | #ifndef OPENSSL_NO_COMP |
1631 | const COMP_METHOD *comp, *expansion; | 1925 | const COMP_METHOD *comp, *expansion; |
1632 | #endif | 1926 | #endif |
1927 | unsigned char *exportedkeymat; | ||
1633 | 1928 | ||
1634 | if (full) | 1929 | if (full) |
1635 | { | 1930 | { |
@@ -1720,7 +2015,7 @@ static void print_stuff(BIO *bio, SSL *s, int full) | |||
1720 | BIO_number_read(SSL_get_rbio(s)), | 2015 | BIO_number_read(SSL_get_rbio(s)), |
1721 | BIO_number_written(SSL_get_wbio(s))); | 2016 | BIO_number_written(SSL_get_wbio(s))); |
1722 | } | 2017 | } |
1723 | BIO_printf(bio,((s->hit)?"---\nReused, ":"---\nNew, ")); | 2018 | BIO_printf(bio,(SSL_cache_hit(s)?"---\nReused, ":"---\nNew, ")); |
1724 | c=SSL_get_current_cipher(s); | 2019 | c=SSL_get_current_cipher(s); |
1725 | BIO_printf(bio,"%s, Cipher is %s\n", | 2020 | BIO_printf(bio,"%s, Cipher is %s\n", |
1726 | SSL_CIPHER_get_version(c), | 2021 | SSL_CIPHER_get_version(c), |
@@ -1742,7 +2037,66 @@ static void print_stuff(BIO *bio, SSL *s, int full) | |||
1742 | BIO_printf(bio,"Expansion: %s\n", | 2037 | BIO_printf(bio,"Expansion: %s\n", |
1743 | expansion ? SSL_COMP_get_name(expansion) : "NONE"); | 2038 | expansion ? SSL_COMP_get_name(expansion) : "NONE"); |
1744 | #endif | 2039 | #endif |
2040 | |||
2041 | #ifdef SSL_DEBUG | ||
2042 | { | ||
2043 | /* Print out local port of connection: useful for debugging */ | ||
2044 | int sock; | ||
2045 | struct sockaddr_in ladd; | ||
2046 | socklen_t ladd_size = sizeof(ladd); | ||
2047 | sock = SSL_get_fd(s); | ||
2048 | getsockname(sock, (struct sockaddr *)&ladd, &ladd_size); | ||
2049 | BIO_printf(bio_c_out, "LOCAL PORT is %u\n", ntohs(ladd.sin_port)); | ||
2050 | } | ||
2051 | #endif | ||
2052 | |||
2053 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
2054 | if (next_proto.status != -1) { | ||
2055 | const unsigned char *proto; | ||
2056 | unsigned int proto_len; | ||
2057 | SSL_get0_next_proto_negotiated(s, &proto, &proto_len); | ||
2058 | BIO_printf(bio, "Next protocol: (%d) ", next_proto.status); | ||
2059 | BIO_write(bio, proto, proto_len); | ||
2060 | BIO_write(bio, "\n", 1); | ||
2061 | } | ||
2062 | #endif | ||
2063 | |||
2064 | { | ||
2065 | SRTP_PROTECTION_PROFILE *srtp_profile=SSL_get_selected_srtp_profile(s); | ||
2066 | |||
2067 | if(srtp_profile) | ||
2068 | BIO_printf(bio,"SRTP Extension negotiated, profile=%s\n", | ||
2069 | srtp_profile->name); | ||
2070 | } | ||
2071 | |||
1745 | SSL_SESSION_print(bio,SSL_get_session(s)); | 2072 | SSL_SESSION_print(bio,SSL_get_session(s)); |
2073 | if (keymatexportlabel != NULL) | ||
2074 | { | ||
2075 | BIO_printf(bio, "Keying material exporter:\n"); | ||
2076 | BIO_printf(bio, " Label: '%s'\n", keymatexportlabel); | ||
2077 | BIO_printf(bio, " Length: %i bytes\n", keymatexportlen); | ||
2078 | exportedkeymat = OPENSSL_malloc(keymatexportlen); | ||
2079 | if (exportedkeymat != NULL) | ||
2080 | { | ||
2081 | if (!SSL_export_keying_material(s, exportedkeymat, | ||
2082 | keymatexportlen, | ||
2083 | keymatexportlabel, | ||
2084 | strlen(keymatexportlabel), | ||
2085 | NULL, 0, 0)) | ||
2086 | { | ||
2087 | BIO_printf(bio, " Error\n"); | ||
2088 | } | ||
2089 | else | ||
2090 | { | ||
2091 | BIO_printf(bio, " Keying material: "); | ||
2092 | for (i=0; i<keymatexportlen; i++) | ||
2093 | BIO_printf(bio, "%02X", | ||
2094 | exportedkeymat[i]); | ||
2095 | BIO_printf(bio, "\n"); | ||
2096 | } | ||
2097 | OPENSSL_free(exportedkeymat); | ||
2098 | } | ||
2099 | } | ||
1746 | BIO_printf(bio,"---\n"); | 2100 | BIO_printf(bio,"---\n"); |
1747 | if (peer != NULL) | 2101 | if (peer != NULL) |
1748 | X509_free(peer); | 2102 | X509_free(peer); |
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c index 8a0c34cf0f..3f9b3704c6 100644 --- a/src/lib/libssl/src/apps/s_server.c +++ b/src/lib/libssl/src/apps/s_server.c | |||
@@ -186,6 +186,9 @@ typedef unsigned int u_int; | |||
186 | #ifndef OPENSSL_NO_RSA | 186 | #ifndef OPENSSL_NO_RSA |
187 | #include <openssl/rsa.h> | 187 | #include <openssl/rsa.h> |
188 | #endif | 188 | #endif |
189 | #ifndef OPENSSL_NO_SRP | ||
190 | #include <openssl/srp.h> | ||
191 | #endif | ||
189 | #include "s_apps.h" | 192 | #include "s_apps.h" |
190 | #include "timeouts.h" | 193 | #include "timeouts.h" |
191 | 194 | ||
@@ -290,6 +293,9 @@ static int cert_status_cb(SSL *s, void *arg); | |||
290 | static int s_msg=0; | 293 | static int s_msg=0; |
291 | static int s_quiet=0; | 294 | static int s_quiet=0; |
292 | 295 | ||
296 | static char *keymatexportlabel=NULL; | ||
297 | static int keymatexportlen=20; | ||
298 | |||
293 | static int hack=0; | 299 | static int hack=0; |
294 | #ifndef OPENSSL_NO_ENGINE | 300 | #ifndef OPENSSL_NO_ENGINE |
295 | static char *engine_id=NULL; | 301 | static char *engine_id=NULL; |
@@ -302,6 +308,7 @@ static long socket_mtu; | |||
302 | static int cert_chain = 0; | 308 | static int cert_chain = 0; |
303 | #endif | 309 | #endif |
304 | 310 | ||
311 | |||
305 | #ifndef OPENSSL_NO_PSK | 312 | #ifndef OPENSSL_NO_PSK |
306 | static char *psk_identity="Client_identity"; | 313 | static char *psk_identity="Client_identity"; |
307 | char *psk_key=NULL; /* by default PSK is not used */ | 314 | char *psk_key=NULL; /* by default PSK is not used */ |
@@ -369,6 +376,52 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity, | |||
369 | } | 376 | } |
370 | #endif | 377 | #endif |
371 | 378 | ||
379 | #ifndef OPENSSL_NO_SRP | ||
380 | /* This is a context that we pass to callbacks */ | ||
381 | typedef struct srpsrvparm_st | ||
382 | { | ||
383 | char *login; | ||
384 | SRP_VBASE *vb; | ||
385 | SRP_user_pwd *user; | ||
386 | } srpsrvparm; | ||
387 | |||
388 | /* This callback pretends to require some asynchronous logic in order to obtain | ||
389 | a verifier. When the callback is called for a new connection we return | ||
390 | with a negative value. This will provoke the accept etc to return with | ||
391 | an LOOKUP_X509. The main logic of the reinvokes the suspended call | ||
392 | (which would normally occur after a worker has finished) and we | ||
393 | set the user parameters. | ||
394 | */ | ||
395 | static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg) | ||
396 | { | ||
397 | srpsrvparm *p = (srpsrvparm *)arg; | ||
398 | if (p->login == NULL && p->user == NULL ) | ||
399 | { | ||
400 | p->login = SSL_get_srp_username(s); | ||
401 | BIO_printf(bio_err, "SRP username = \"%s\"\n", p->login); | ||
402 | return (-1) ; | ||
403 | } | ||
404 | |||
405 | if (p->user == NULL) | ||
406 | { | ||
407 | BIO_printf(bio_err, "User %s doesn't exist\n", p->login); | ||
408 | return SSL3_AL_FATAL; | ||
409 | } | ||
410 | if (SSL_set_srp_server_param(s, p->user->N, p->user->g, p->user->s, p->user->v, | ||
411 | p->user->info) < 0) | ||
412 | { | ||
413 | *ad = SSL_AD_INTERNAL_ERROR; | ||
414 | return SSL3_AL_FATAL; | ||
415 | } | ||
416 | BIO_printf(bio_err, "SRP parameters set: username = \"%s\" info=\"%s\" \n", p->login,p->user->info); | ||
417 | /* need to check whether there are memory leaks */ | ||
418 | p->user = NULL; | ||
419 | p->login = NULL; | ||
420 | return SSL_ERROR_NONE; | ||
421 | } | ||
422 | |||
423 | #endif | ||
424 | |||
372 | #ifdef MONOLITH | 425 | #ifdef MONOLITH |
373 | static void s_server_init(void) | 426 | static void s_server_init(void) |
374 | { | 427 | { |
@@ -456,8 +509,14 @@ static void sv_usage(void) | |||
456 | BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n"); | 509 | BIO_printf(bio_err," -jpake arg - JPAKE secret to use\n"); |
457 | # endif | 510 | # endif |
458 | #endif | 511 | #endif |
512 | #ifndef OPENSSL_NO_SRP | ||
513 | BIO_printf(bio_err," -srpvfile file - The verifier file for SRP\n"); | ||
514 | BIO_printf(bio_err," -srpuserseed string - A seed string for a default user salt.\n"); | ||
515 | #endif | ||
459 | BIO_printf(bio_err," -ssl2 - Just talk SSLv2\n"); | 516 | BIO_printf(bio_err," -ssl2 - Just talk SSLv2\n"); |
460 | BIO_printf(bio_err," -ssl3 - Just talk SSLv3\n"); | 517 | BIO_printf(bio_err," -ssl3 - Just talk SSLv3\n"); |
518 | BIO_printf(bio_err," -tls1_2 - Just talk TLSv1.2\n"); | ||
519 | BIO_printf(bio_err," -tls1_1 - Just talk TLSv1.1\n"); | ||
461 | BIO_printf(bio_err," -tls1 - Just talk TLSv1\n"); | 520 | BIO_printf(bio_err," -tls1 - Just talk TLSv1\n"); |
462 | BIO_printf(bio_err," -dtls1 - Just talk DTLSv1\n"); | 521 | BIO_printf(bio_err," -dtls1 - Just talk DTLSv1\n"); |
463 | BIO_printf(bio_err," -timeout - Enable timeouts\n"); | 522 | BIO_printf(bio_err," -timeout - Enable timeouts\n"); |
@@ -466,6 +525,8 @@ static void sv_usage(void) | |||
466 | BIO_printf(bio_err," -no_ssl2 - Just disable SSLv2\n"); | 525 | BIO_printf(bio_err," -no_ssl2 - Just disable SSLv2\n"); |
467 | BIO_printf(bio_err," -no_ssl3 - Just disable SSLv3\n"); | 526 | BIO_printf(bio_err," -no_ssl3 - Just disable SSLv3\n"); |
468 | BIO_printf(bio_err," -no_tls1 - Just disable TLSv1\n"); | 527 | BIO_printf(bio_err," -no_tls1 - Just disable TLSv1\n"); |
528 | BIO_printf(bio_err," -no_tls1_1 - Just disable TLSv1.1\n"); | ||
529 | BIO_printf(bio_err," -no_tls1_2 - Just disable TLSv1.2\n"); | ||
469 | #ifndef OPENSSL_NO_DH | 530 | #ifndef OPENSSL_NO_DH |
470 | BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n"); | 531 | BIO_printf(bio_err," -no_dhe - Disable ephemeral DH\n"); |
471 | #endif | 532 | #endif |
@@ -492,7 +553,13 @@ static void sv_usage(void) | |||
492 | BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n"); | 553 | BIO_printf(bio_err," -tlsextdebug - hex dump of all TLS extensions received\n"); |
493 | BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); | 554 | BIO_printf(bio_err," -no_ticket - disable use of RFC4507bis session tickets\n"); |
494 | BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); | 555 | BIO_printf(bio_err," -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); |
556 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
557 | BIO_printf(bio_err," -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n"); | ||
558 | # endif | ||
559 | BIO_printf(bio_err," -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n"); | ||
495 | #endif | 560 | #endif |
561 | BIO_printf(bio_err," -keymatexport label - Export keying material using label\n"); | ||
562 | BIO_printf(bio_err," -keymatexportlen len - Export len bytes of keying material (default 20)\n"); | ||
496 | } | 563 | } |
497 | 564 | ||
498 | static int local_argc=0; | 565 | static int local_argc=0; |
@@ -826,6 +893,26 @@ BIO_printf(err, "cert_status: received %d ids\n", sk_OCSP_RESPID_num(ids)); | |||
826 | ret = SSL_TLSEXT_ERR_ALERT_FATAL; | 893 | ret = SSL_TLSEXT_ERR_ALERT_FATAL; |
827 | goto done; | 894 | goto done; |
828 | } | 895 | } |
896 | |||
897 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
898 | /* This is the context that we pass to next_proto_cb */ | ||
899 | typedef struct tlsextnextprotoctx_st { | ||
900 | unsigned char *data; | ||
901 | unsigned int len; | ||
902 | } tlsextnextprotoctx; | ||
903 | |||
904 | static int next_proto_cb(SSL *s, const unsigned char **data, unsigned int *len, void *arg) | ||
905 | { | ||
906 | tlsextnextprotoctx *next_proto = arg; | ||
907 | |||
908 | *data = next_proto->data; | ||
909 | *len = next_proto->len; | ||
910 | |||
911 | return SSL_TLSEXT_ERR_OK; | ||
912 | } | ||
913 | # endif /* ndef OPENSSL_NO_NEXTPROTONEG */ | ||
914 | |||
915 | |||
829 | #endif | 916 | #endif |
830 | 917 | ||
831 | int MAIN(int, char **); | 918 | int MAIN(int, char **); |
@@ -833,6 +920,10 @@ int MAIN(int, char **); | |||
833 | #ifndef OPENSSL_NO_JPAKE | 920 | #ifndef OPENSSL_NO_JPAKE |
834 | static char *jpake_secret = NULL; | 921 | static char *jpake_secret = NULL; |
835 | #endif | 922 | #endif |
923 | #ifndef OPENSSL_NO_SRP | ||
924 | static srpsrvparm srp_callback_parm; | ||
925 | #endif | ||
926 | static char *srtp_profiles = NULL; | ||
836 | 927 | ||
837 | int MAIN(int argc, char *argv[]) | 928 | int MAIN(int argc, char *argv[]) |
838 | { | 929 | { |
@@ -864,21 +955,21 @@ int MAIN(int argc, char *argv[]) | |||
864 | #ifndef OPENSSL_NO_TLSEXT | 955 | #ifndef OPENSSL_NO_TLSEXT |
865 | EVP_PKEY *s_key2 = NULL; | 956 | EVP_PKEY *s_key2 = NULL; |
866 | X509 *s_cert2 = NULL; | 957 | X509 *s_cert2 = NULL; |
867 | #endif | ||
868 | #ifndef OPENSSL_NO_TLSEXT | ||
869 | tlsextctx tlsextcbp = {NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING}; | 958 | tlsextctx tlsextcbp = {NULL, NULL, SSL_TLSEXT_ERR_ALERT_WARNING}; |
959 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
960 | const char *next_proto_neg_in = NULL; | ||
961 | tlsextnextprotoctx next_proto; | ||
962 | # endif | ||
870 | #endif | 963 | #endif |
871 | #ifndef OPENSSL_NO_PSK | 964 | #ifndef OPENSSL_NO_PSK |
872 | /* by default do not send a PSK identity hint */ | 965 | /* by default do not send a PSK identity hint */ |
873 | static char *psk_identity_hint=NULL; | 966 | static char *psk_identity_hint=NULL; |
874 | #endif | 967 | #endif |
875 | #if !defined(OPENSSL_NO_SSL2) && !defined(OPENSSL_NO_SSL3) | 968 | #ifndef OPENSSL_NO_SRP |
876 | meth=SSLv23_server_method(); | 969 | char *srpuserseed = NULL; |
877 | #elif !defined(OPENSSL_NO_SSL3) | 970 | char *srp_verifier_file = NULL; |
878 | meth=SSLv3_server_method(); | ||
879 | #elif !defined(OPENSSL_NO_SSL2) | ||
880 | meth=SSLv2_server_method(); | ||
881 | #endif | 971 | #endif |
972 | meth=SSLv23_server_method(); | ||
882 | 973 | ||
883 | local_argc=argc; | 974 | local_argc=argc; |
884 | local_argv=argv; | 975 | local_argv=argv; |
@@ -1103,13 +1194,27 @@ int MAIN(int argc, char *argv[]) | |||
1103 | psk_key=*(++argv); | 1194 | psk_key=*(++argv); |
1104 | for (i=0; i<strlen(psk_key); i++) | 1195 | for (i=0; i<strlen(psk_key); i++) |
1105 | { | 1196 | { |
1106 | if (isxdigit((int)psk_key[i])) | 1197 | if (isxdigit((unsigned char)psk_key[i])) |
1107 | continue; | 1198 | continue; |
1108 | BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); | 1199 | BIO_printf(bio_err,"Not a hex number '%s'\n",*argv); |
1109 | goto bad; | 1200 | goto bad; |
1110 | } | 1201 | } |
1111 | } | 1202 | } |
1112 | #endif | 1203 | #endif |
1204 | #ifndef OPENSSL_NO_SRP | ||
1205 | else if (strcmp(*argv, "-srpvfile") == 0) | ||
1206 | { | ||
1207 | if (--argc < 1) goto bad; | ||
1208 | srp_verifier_file = *(++argv); | ||
1209 | meth=TLSv1_server_method(); | ||
1210 | } | ||
1211 | else if (strcmp(*argv, "-srpuserseed") == 0) | ||
1212 | { | ||
1213 | if (--argc < 1) goto bad; | ||
1214 | srpuserseed = *(++argv); | ||
1215 | meth=TLSv1_server_method(); | ||
1216 | } | ||
1217 | #endif | ||
1113 | else if (strcmp(*argv,"-www") == 0) | 1218 | else if (strcmp(*argv,"-www") == 0) |
1114 | { www=1; } | 1219 | { www=1; } |
1115 | else if (strcmp(*argv,"-WWW") == 0) | 1220 | else if (strcmp(*argv,"-WWW") == 0) |
@@ -1122,6 +1227,10 @@ int MAIN(int argc, char *argv[]) | |||
1122 | { off|=SSL_OP_NO_SSLv3; } | 1227 | { off|=SSL_OP_NO_SSLv3; } |
1123 | else if (strcmp(*argv,"-no_tls1") == 0) | 1228 | else if (strcmp(*argv,"-no_tls1") == 0) |
1124 | { off|=SSL_OP_NO_TLSv1; } | 1229 | { off|=SSL_OP_NO_TLSv1; } |
1230 | else if (strcmp(*argv,"-no_tls1_1") == 0) | ||
1231 | { off|=SSL_OP_NO_TLSv1_1; } | ||
1232 | else if (strcmp(*argv,"-no_tls1_2") == 0) | ||
1233 | { off|=SSL_OP_NO_TLSv1_2; } | ||
1125 | else if (strcmp(*argv,"-no_comp") == 0) | 1234 | else if (strcmp(*argv,"-no_comp") == 0) |
1126 | { off|=SSL_OP_NO_COMPRESSION; } | 1235 | { off|=SSL_OP_NO_COMPRESSION; } |
1127 | #ifndef OPENSSL_NO_TLSEXT | 1236 | #ifndef OPENSSL_NO_TLSEXT |
@@ -1139,6 +1248,10 @@ int MAIN(int argc, char *argv[]) | |||
1139 | #ifndef OPENSSL_NO_TLS1 | 1248 | #ifndef OPENSSL_NO_TLS1 |
1140 | else if (strcmp(*argv,"-tls1") == 0) | 1249 | else if (strcmp(*argv,"-tls1") == 0) |
1141 | { meth=TLSv1_server_method(); } | 1250 | { meth=TLSv1_server_method(); } |
1251 | else if (strcmp(*argv,"-tls1_1") == 0) | ||
1252 | { meth=TLSv1_1_server_method(); } | ||
1253 | else if (strcmp(*argv,"-tls1_2") == 0) | ||
1254 | { meth=TLSv1_2_server_method(); } | ||
1142 | #endif | 1255 | #endif |
1143 | #ifndef OPENSSL_NO_DTLS1 | 1256 | #ifndef OPENSSL_NO_DTLS1 |
1144 | else if (strcmp(*argv,"-dtls1") == 0) | 1257 | else if (strcmp(*argv,"-dtls1") == 0) |
@@ -1191,7 +1304,13 @@ int MAIN(int argc, char *argv[]) | |||
1191 | if (--argc < 1) goto bad; | 1304 | if (--argc < 1) goto bad; |
1192 | s_key_file2= *(++argv); | 1305 | s_key_file2= *(++argv); |
1193 | } | 1306 | } |
1194 | 1307 | # ifndef OPENSSL_NO_NEXTPROTONEG | |
1308 | else if (strcmp(*argv,"-nextprotoneg") == 0) | ||
1309 | { | ||
1310 | if (--argc < 1) goto bad; | ||
1311 | next_proto_neg_in = *(++argv); | ||
1312 | } | ||
1313 | # endif | ||
1195 | #endif | 1314 | #endif |
1196 | #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) | 1315 | #if !defined(OPENSSL_NO_JPAKE) && !defined(OPENSSL_NO_PSK) |
1197 | else if (strcmp(*argv,"-jpake") == 0) | 1316 | else if (strcmp(*argv,"-jpake") == 0) |
@@ -1200,6 +1319,22 @@ int MAIN(int argc, char *argv[]) | |||
1200 | jpake_secret = *(++argv); | 1319 | jpake_secret = *(++argv); |
1201 | } | 1320 | } |
1202 | #endif | 1321 | #endif |
1322 | else if (strcmp(*argv,"-use_srtp") == 0) | ||
1323 | { | ||
1324 | if (--argc < 1) goto bad; | ||
1325 | srtp_profiles = *(++argv); | ||
1326 | } | ||
1327 | else if (strcmp(*argv,"-keymatexport") == 0) | ||
1328 | { | ||
1329 | if (--argc < 1) goto bad; | ||
1330 | keymatexportlabel= *(++argv); | ||
1331 | } | ||
1332 | else if (strcmp(*argv,"-keymatexportlen") == 0) | ||
1333 | { | ||
1334 | if (--argc < 1) goto bad; | ||
1335 | keymatexportlen=atoi(*(++argv)); | ||
1336 | if (keymatexportlen == 0) goto bad; | ||
1337 | } | ||
1203 | else | 1338 | else |
1204 | { | 1339 | { |
1205 | BIO_printf(bio_err,"unknown option %s\n",*argv); | 1340 | BIO_printf(bio_err,"unknown option %s\n",*argv); |
@@ -1296,6 +1431,22 @@ bad: | |||
1296 | goto end; | 1431 | goto end; |
1297 | } | 1432 | } |
1298 | } | 1433 | } |
1434 | |||
1435 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
1436 | if (next_proto_neg_in) | ||
1437 | { | ||
1438 | unsigned short len; | ||
1439 | next_proto.data = next_protos_parse(&len, | ||
1440 | next_proto_neg_in); | ||
1441 | if (next_proto.data == NULL) | ||
1442 | goto end; | ||
1443 | next_proto.len = len; | ||
1444 | } | ||
1445 | else | ||
1446 | { | ||
1447 | next_proto.data = NULL; | ||
1448 | } | ||
1449 | # endif | ||
1299 | #endif | 1450 | #endif |
1300 | } | 1451 | } |
1301 | 1452 | ||
@@ -1399,6 +1550,9 @@ bad: | |||
1399 | else | 1550 | else |
1400 | SSL_CTX_sess_set_cache_size(ctx,128); | 1551 | SSL_CTX_sess_set_cache_size(ctx,128); |
1401 | 1552 | ||
1553 | if (srtp_profiles != NULL) | ||
1554 | SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles); | ||
1555 | |||
1402 | #if 0 | 1556 | #if 0 |
1403 | if (cipher == NULL) cipher=getenv("SSL_CIPHER"); | 1557 | if (cipher == NULL) cipher=getenv("SSL_CIPHER"); |
1404 | #endif | 1558 | #endif |
@@ -1476,6 +1630,11 @@ bad: | |||
1476 | if (vpm) | 1630 | if (vpm) |
1477 | SSL_CTX_set1_param(ctx2, vpm); | 1631 | SSL_CTX_set1_param(ctx2, vpm); |
1478 | } | 1632 | } |
1633 | |||
1634 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
1635 | if (next_proto.data) | ||
1636 | SSL_CTX_set_next_protos_advertised_cb(ctx, next_proto_cb, &next_proto); | ||
1637 | # endif | ||
1479 | #endif | 1638 | #endif |
1480 | 1639 | ||
1481 | #ifndef OPENSSL_NO_DH | 1640 | #ifndef OPENSSL_NO_DH |
@@ -1684,6 +1843,25 @@ bad: | |||
1684 | } | 1843 | } |
1685 | #endif | 1844 | #endif |
1686 | 1845 | ||
1846 | #ifndef OPENSSL_NO_SRP | ||
1847 | if (srp_verifier_file != NULL) | ||
1848 | { | ||
1849 | srp_callback_parm.vb = SRP_VBASE_new(srpuserseed); | ||
1850 | srp_callback_parm.user = NULL; | ||
1851 | srp_callback_parm.login = NULL; | ||
1852 | if ((ret = SRP_VBASE_init(srp_callback_parm.vb, srp_verifier_file)) != SRP_NO_ERROR) | ||
1853 | { | ||
1854 | BIO_printf(bio_err, | ||
1855 | "Cannot initialize SRP verifier file \"%s\":ret=%d\n", | ||
1856 | srp_verifier_file, ret); | ||
1857 | goto end; | ||
1858 | } | ||
1859 | SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE,verify_callback); | ||
1860 | SSL_CTX_set_srp_cb_arg(ctx, &srp_callback_parm); | ||
1861 | SSL_CTX_set_srp_username_callback(ctx, ssl_srp_server_param_cb); | ||
1862 | } | ||
1863 | else | ||
1864 | #endif | ||
1687 | if (CAfile != NULL) | 1865 | if (CAfile != NULL) |
1688 | { | 1866 | { |
1689 | SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile)); | 1867 | SSL_CTX_set_client_CA_list(ctx,SSL_load_client_CA_file(CAfile)); |
@@ -1765,6 +1943,9 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
1765 | unsigned long l; | 1943 | unsigned long l; |
1766 | SSL *con=NULL; | 1944 | SSL *con=NULL; |
1767 | BIO *sbio; | 1945 | BIO *sbio; |
1946 | #ifndef OPENSSL_NO_KRB5 | ||
1947 | KSSL_CTX *kctx; | ||
1948 | #endif | ||
1768 | struct timeval timeout; | 1949 | struct timeval timeout; |
1769 | #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) | 1950 | #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) |
1770 | struct timeval tv; | 1951 | struct timeval tv; |
@@ -1805,12 +1986,11 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
1805 | } | 1986 | } |
1806 | #endif | 1987 | #endif |
1807 | #ifndef OPENSSL_NO_KRB5 | 1988 | #ifndef OPENSSL_NO_KRB5 |
1808 | if ((con->kssl_ctx = kssl_ctx_new()) != NULL) | 1989 | if ((kctx = kssl_ctx_new()) != NULL) |
1809 | { | 1990 | { |
1810 | kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE, | 1991 | SSL_set0_kssl_ctx(con, kctx); |
1811 | KRB5SVC); | 1992 | kssl_ctx_setstring(kctx, KSSL_SERVICE, KRB5SVC); |
1812 | kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB, | 1993 | kssl_ctx_setstring(kctx, KSSL_KEYTAB, KRB5KEYTAB); |
1813 | KRB5KEYTAB); | ||
1814 | } | 1994 | } |
1815 | #endif /* OPENSSL_NO_KRB5 */ | 1995 | #endif /* OPENSSL_NO_KRB5 */ |
1816 | if(context) | 1996 | if(context) |
@@ -1873,7 +2053,7 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
1873 | 2053 | ||
1874 | if (s_debug) | 2054 | if (s_debug) |
1875 | { | 2055 | { |
1876 | con->debug=1; | 2056 | SSL_set_debug(con, 1); |
1877 | BIO_set_callback(SSL_get_rbio(con),bio_dump_callback); | 2057 | BIO_set_callback(SSL_get_rbio(con),bio_dump_callback); |
1878 | BIO_set_callback_arg(SSL_get_rbio(con),(char *)bio_s_out); | 2058 | BIO_set_callback_arg(SSL_get_rbio(con),(char *)bio_s_out); |
1879 | } | 2059 | } |
@@ -2002,6 +2182,16 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
2002 | goto err; | 2182 | goto err; |
2003 | } | 2183 | } |
2004 | 2184 | ||
2185 | #ifndef OPENSSL_NO_HEARTBEATS | ||
2186 | if ((buf[0] == 'B') && | ||
2187 | ((buf[1] == '\n') || (buf[1] == '\r'))) | ||
2188 | { | ||
2189 | BIO_printf(bio_err,"HEARTBEATING\n"); | ||
2190 | SSL_heartbeat(con); | ||
2191 | i=0; | ||
2192 | continue; | ||
2193 | } | ||
2194 | #endif | ||
2005 | if ((buf[0] == 'r') && | 2195 | if ((buf[0] == 'r') && |
2006 | ((buf[1] == '\n') || (buf[1] == '\r'))) | 2196 | ((buf[1] == '\n') || (buf[1] == '\r'))) |
2007 | { | 2197 | { |
@@ -2045,6 +2235,18 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
2045 | { static count=0; if (++count == 100) { count=0; SSL_renegotiate(con); } } | 2235 | { static count=0; if (++count == 100) { count=0; SSL_renegotiate(con); } } |
2046 | #endif | 2236 | #endif |
2047 | k=SSL_write(con,&(buf[l]),(unsigned int)i); | 2237 | k=SSL_write(con,&(buf[l]),(unsigned int)i); |
2238 | #ifndef OPENSSL_NO_SRP | ||
2239 | while (SSL_get_error(con,k) == SSL_ERROR_WANT_X509_LOOKUP) | ||
2240 | { | ||
2241 | BIO_printf(bio_s_out,"LOOKUP renego during write\n"); | ||
2242 | srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); | ||
2243 | if (srp_callback_parm.user) | ||
2244 | BIO_printf(bio_s_out,"LOOKUP done %s\n",srp_callback_parm.user->info); | ||
2245 | else | ||
2246 | BIO_printf(bio_s_out,"LOOKUP not successful\n"); | ||
2247 | k=SSL_write(con,&(buf[l]),(unsigned int)i); | ||
2248 | } | ||
2249 | #endif | ||
2048 | switch (SSL_get_error(con,k)) | 2250 | switch (SSL_get_error(con,k)) |
2049 | { | 2251 | { |
2050 | case SSL_ERROR_NONE: | 2252 | case SSL_ERROR_NONE: |
@@ -2092,6 +2294,18 @@ static int sv_body(char *hostname, int s, unsigned char *context) | |||
2092 | { | 2294 | { |
2093 | again: | 2295 | again: |
2094 | i=SSL_read(con,(char *)buf,bufsize); | 2296 | i=SSL_read(con,(char *)buf,bufsize); |
2297 | #ifndef OPENSSL_NO_SRP | ||
2298 | while (SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP) | ||
2299 | { | ||
2300 | BIO_printf(bio_s_out,"LOOKUP renego during read\n"); | ||
2301 | srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); | ||
2302 | if (srp_callback_parm.user) | ||
2303 | BIO_printf(bio_s_out,"LOOKUP done %s\n",srp_callback_parm.user->info); | ||
2304 | else | ||
2305 | BIO_printf(bio_s_out,"LOOKUP not successful\n"); | ||
2306 | i=SSL_read(con,(char *)buf,bufsize); | ||
2307 | } | ||
2308 | #endif | ||
2095 | switch (SSL_get_error(con,i)) | 2309 | switch (SSL_get_error(con,i)) |
2096 | { | 2310 | { |
2097 | case SSL_ERROR_NONE: | 2311 | case SSL_ERROR_NONE: |
@@ -2104,7 +2318,6 @@ again: | |||
2104 | break; | 2318 | break; |
2105 | case SSL_ERROR_WANT_WRITE: | 2319 | case SSL_ERROR_WANT_WRITE: |
2106 | case SSL_ERROR_WANT_READ: | 2320 | case SSL_ERROR_WANT_READ: |
2107 | case SSL_ERROR_WANT_X509_LOOKUP: | ||
2108 | BIO_printf(bio_s_out,"Read BLOCK\n"); | 2321 | BIO_printf(bio_s_out,"Read BLOCK\n"); |
2109 | break; | 2322 | break; |
2110 | case SSL_ERROR_SYSCALL: | 2323 | case SSL_ERROR_SYSCALL: |
@@ -2159,8 +2372,30 @@ static int init_ssl_connection(SSL *con) | |||
2159 | X509 *peer; | 2372 | X509 *peer; |
2160 | long verify_error; | 2373 | long verify_error; |
2161 | MS_STATIC char buf[BUFSIZ]; | 2374 | MS_STATIC char buf[BUFSIZ]; |
2375 | #ifndef OPENSSL_NO_KRB5 | ||
2376 | char *client_princ; | ||
2377 | #endif | ||
2378 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
2379 | const unsigned char *next_proto_neg; | ||
2380 | unsigned next_proto_neg_len; | ||
2381 | #endif | ||
2382 | unsigned char *exportedkeymat; | ||
2162 | 2383 | ||
2163 | if ((i=SSL_accept(con)) <= 0) | 2384 | |
2385 | i=SSL_accept(con); | ||
2386 | #ifndef OPENSSL_NO_SRP | ||
2387 | while (i <= 0 && SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP) | ||
2388 | { | ||
2389 | BIO_printf(bio_s_out,"LOOKUP during accept %s\n",srp_callback_parm.login); | ||
2390 | srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); | ||
2391 | if (srp_callback_parm.user) | ||
2392 | BIO_printf(bio_s_out,"LOOKUP done %s\n",srp_callback_parm.user->info); | ||
2393 | else | ||
2394 | BIO_printf(bio_s_out,"LOOKUP not successful\n"); | ||
2395 | i=SSL_accept(con); | ||
2396 | } | ||
2397 | #endif | ||
2398 | if (i <= 0) | ||
2164 | { | 2399 | { |
2165 | if (BIO_sock_should_retry(i)) | 2400 | if (BIO_sock_should_retry(i)) |
2166 | { | 2401 | { |
@@ -2198,19 +2433,67 @@ static int init_ssl_connection(SSL *con) | |||
2198 | BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf); | 2433 | BIO_printf(bio_s_out,"Shared ciphers:%s\n",buf); |
2199 | str=SSL_CIPHER_get_name(SSL_get_current_cipher(con)); | 2434 | str=SSL_CIPHER_get_name(SSL_get_current_cipher(con)); |
2200 | BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)"); | 2435 | BIO_printf(bio_s_out,"CIPHER is %s\n",(str != NULL)?str:"(NONE)"); |
2201 | if (con->hit) BIO_printf(bio_s_out,"Reused session-id\n"); | 2436 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) |
2437 | SSL_get0_next_proto_negotiated(con, &next_proto_neg, &next_proto_neg_len); | ||
2438 | if (next_proto_neg) | ||
2439 | { | ||
2440 | BIO_printf(bio_s_out,"NEXTPROTO is "); | ||
2441 | BIO_write(bio_s_out, next_proto_neg, next_proto_neg_len); | ||
2442 | BIO_printf(bio_s_out, "\n"); | ||
2443 | } | ||
2444 | #endif | ||
2445 | { | ||
2446 | SRTP_PROTECTION_PROFILE *srtp_profile | ||
2447 | = SSL_get_selected_srtp_profile(con); | ||
2448 | |||
2449 | if(srtp_profile) | ||
2450 | BIO_printf(bio_s_out,"SRTP Extension negotiated, profile=%s\n", | ||
2451 | srtp_profile->name); | ||
2452 | } | ||
2453 | if (SSL_cache_hit(con)) BIO_printf(bio_s_out,"Reused session-id\n"); | ||
2202 | if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) & | 2454 | if (SSL_ctrl(con,SSL_CTRL_GET_FLAGS,0,NULL) & |
2203 | TLS1_FLAGS_TLS_PADDING_BUG) | 2455 | TLS1_FLAGS_TLS_PADDING_BUG) |
2204 | BIO_printf(bio_s_out,"Peer has incorrect TLSv1 block padding\n"); | 2456 | BIO_printf(bio_s_out, |
2457 | "Peer has incorrect TLSv1 block padding\n"); | ||
2205 | #ifndef OPENSSL_NO_KRB5 | 2458 | #ifndef OPENSSL_NO_KRB5 |
2206 | if (con->kssl_ctx->client_princ != NULL) | 2459 | client_princ = kssl_ctx_get0_client_princ(SSL_get0_kssl_ctx(con)); |
2460 | if (client_princ != NULL) | ||
2207 | { | 2461 | { |
2208 | BIO_printf(bio_s_out,"Kerberos peer principal is %s\n", | 2462 | BIO_printf(bio_s_out,"Kerberos peer principal is %s\n", |
2209 | con->kssl_ctx->client_princ); | 2463 | client_princ); |
2210 | } | 2464 | } |
2211 | #endif /* OPENSSL_NO_KRB5 */ | 2465 | #endif /* OPENSSL_NO_KRB5 */ |
2212 | BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\n", | 2466 | BIO_printf(bio_s_out, "Secure Renegotiation IS%s supported\n", |
2213 | SSL_get_secure_renegotiation_support(con) ? "" : " NOT"); | 2467 | SSL_get_secure_renegotiation_support(con) ? "" : " NOT"); |
2468 | if (keymatexportlabel != NULL) | ||
2469 | { | ||
2470 | BIO_printf(bio_s_out, "Keying material exporter:\n"); | ||
2471 | BIO_printf(bio_s_out, " Label: '%s'\n", keymatexportlabel); | ||
2472 | BIO_printf(bio_s_out, " Length: %i bytes\n", | ||
2473 | keymatexportlen); | ||
2474 | exportedkeymat = OPENSSL_malloc(keymatexportlen); | ||
2475 | if (exportedkeymat != NULL) | ||
2476 | { | ||
2477 | if (!SSL_export_keying_material(con, exportedkeymat, | ||
2478 | keymatexportlen, | ||
2479 | keymatexportlabel, | ||
2480 | strlen(keymatexportlabel), | ||
2481 | NULL, 0, 0)) | ||
2482 | { | ||
2483 | BIO_printf(bio_s_out, " Error\n"); | ||
2484 | } | ||
2485 | else | ||
2486 | { | ||
2487 | BIO_printf(bio_s_out, " Keying material: "); | ||
2488 | for (i=0; i<keymatexportlen; i++) | ||
2489 | BIO_printf(bio_s_out, "%02X", | ||
2490 | exportedkeymat[i]); | ||
2491 | BIO_printf(bio_s_out, "\n"); | ||
2492 | } | ||
2493 | OPENSSL_free(exportedkeymat); | ||
2494 | } | ||
2495 | } | ||
2496 | |||
2214 | return(1); | 2497 | return(1); |
2215 | } | 2498 | } |
2216 | 2499 | ||
@@ -2228,6 +2511,9 @@ err: | |||
2228 | return(ret); | 2511 | return(ret); |
2229 | } | 2512 | } |
2230 | #endif | 2513 | #endif |
2514 | #ifndef OPENSSL_NO_KRB5 | ||
2515 | char *client_princ; | ||
2516 | #endif | ||
2231 | 2517 | ||
2232 | #if 0 | 2518 | #if 0 |
2233 | static int load_CA(SSL_CTX *ctx, char *file) | 2519 | static int load_CA(SSL_CTX *ctx, char *file) |
@@ -2258,6 +2544,9 @@ static int www_body(char *hostname, int s, unsigned char *context) | |||
2258 | SSL *con; | 2544 | SSL *con; |
2259 | const SSL_CIPHER *c; | 2545 | const SSL_CIPHER *c; |
2260 | BIO *io,*ssl_bio,*sbio; | 2546 | BIO *io,*ssl_bio,*sbio; |
2547 | #ifndef OPENSSL_NO_KRB5 | ||
2548 | KSSL_CTX *kctx; | ||
2549 | #endif | ||
2261 | 2550 | ||
2262 | buf=OPENSSL_malloc(bufsize); | 2551 | buf=OPENSSL_malloc(bufsize); |
2263 | if (buf == NULL) return(0); | 2552 | if (buf == NULL) return(0); |
@@ -2289,10 +2578,10 @@ static int www_body(char *hostname, int s, unsigned char *context) | |||
2289 | } | 2578 | } |
2290 | #endif | 2579 | #endif |
2291 | #ifndef OPENSSL_NO_KRB5 | 2580 | #ifndef OPENSSL_NO_KRB5 |
2292 | if ((con->kssl_ctx = kssl_ctx_new()) != NULL) | 2581 | if ((kctx = kssl_ctx_new()) != NULL) |
2293 | { | 2582 | { |
2294 | kssl_ctx_setstring(con->kssl_ctx, KSSL_SERVICE, KRB5SVC); | 2583 | kssl_ctx_setstring(kctx, KSSL_SERVICE, KRB5SVC); |
2295 | kssl_ctx_setstring(con->kssl_ctx, KSSL_KEYTAB, KRB5KEYTAB); | 2584 | kssl_ctx_setstring(kctx, KSSL_KEYTAB, KRB5KEYTAB); |
2296 | } | 2585 | } |
2297 | #endif /* OPENSSL_NO_KRB5 */ | 2586 | #endif /* OPENSSL_NO_KRB5 */ |
2298 | if(context) SSL_set_session_id_context(con, context, | 2587 | if(context) SSL_set_session_id_context(con, context, |
@@ -2318,7 +2607,7 @@ static int www_body(char *hostname, int s, unsigned char *context) | |||
2318 | 2607 | ||
2319 | if (s_debug) | 2608 | if (s_debug) |
2320 | { | 2609 | { |
2321 | con->debug=1; | 2610 | SSL_set_debug(con, 1); |
2322 | BIO_set_callback(SSL_get_rbio(con),bio_dump_callback); | 2611 | BIO_set_callback(SSL_get_rbio(con),bio_dump_callback); |
2323 | BIO_set_callback_arg(SSL_get_rbio(con),(char *)bio_s_out); | 2612 | BIO_set_callback_arg(SSL_get_rbio(con),(char *)bio_s_out); |
2324 | } | 2613 | } |
@@ -2333,7 +2622,18 @@ static int www_body(char *hostname, int s, unsigned char *context) | |||
2333 | if (hack) | 2622 | if (hack) |
2334 | { | 2623 | { |
2335 | i=SSL_accept(con); | 2624 | i=SSL_accept(con); |
2336 | 2625 | #ifndef OPENSSL_NO_SRP | |
2626 | while (i <= 0 && SSL_get_error(con,i) == SSL_ERROR_WANT_X509_LOOKUP) | ||
2627 | { | ||
2628 | BIO_printf(bio_s_out,"LOOKUP during accept %s\n",srp_callback_parm.login); | ||
2629 | srp_callback_parm.user = SRP_VBASE_get_by_user(srp_callback_parm.vb, srp_callback_parm.login); | ||
2630 | if (srp_callback_parm.user) | ||
2631 | BIO_printf(bio_s_out,"LOOKUP done %s\n",srp_callback_parm.user->info); | ||
2632 | else | ||
2633 | BIO_printf(bio_s_out,"LOOKUP not successful\n"); | ||
2634 | i=SSL_accept(con); | ||
2635 | } | ||
2636 | #endif | ||
2337 | switch (SSL_get_error(con,i)) | 2637 | switch (SSL_get_error(con,i)) |
2338 | { | 2638 | { |
2339 | case SSL_ERROR_NONE: | 2639 | case SSL_ERROR_NONE: |
@@ -2439,7 +2739,7 @@ static int www_body(char *hostname, int s, unsigned char *context) | |||
2439 | } | 2739 | } |
2440 | BIO_puts(io,"\n"); | 2740 | BIO_puts(io,"\n"); |
2441 | } | 2741 | } |
2442 | BIO_printf(io,((con->hit) | 2742 | BIO_printf(io,(SSL_cache_hit(con) |
2443 | ?"---\nReused, " | 2743 | ?"---\nReused, " |
2444 | :"---\nNew, ")); | 2744 | :"---\nNew, ")); |
2445 | c=SSL_get_current_cipher(con); | 2745 | c=SSL_get_current_cipher(con); |
diff --git a/src/lib/libssl/src/apps/s_socket.c b/src/lib/libssl/src/apps/s_socket.c index c08544a13c..380efdb1b9 100644 --- a/src/lib/libssl/src/apps/s_socket.c +++ b/src/lib/libssl/src/apps/s_socket.c | |||
@@ -238,11 +238,10 @@ int init_client(int *sock, char *host, int port, int type) | |||
238 | { | 238 | { |
239 | unsigned char ip[4]; | 239 | unsigned char ip[4]; |
240 | 240 | ||
241 | memset(ip, '\0', sizeof ip); | ||
241 | if (!host_ip(host,&(ip[0]))) | 242 | if (!host_ip(host,&(ip[0]))) |
242 | { | 243 | return 0; |
243 | return(0); | 244 | return init_client_ip(sock,ip,port,type); |
244 | } | ||
245 | return(init_client_ip(sock,ip,port,type)); | ||
246 | } | 245 | } |
247 | 246 | ||
248 | static int init_client_ip(int *sock, unsigned char ip[4], int port, int type) | 247 | static int init_client_ip(int *sock, unsigned char ip[4], int port, int type) |
diff --git a/src/lib/libssl/src/apps/server.pem b/src/lib/libssl/src/apps/server.pem index 56248e57a3..d0fc265f04 100644 --- a/src/lib/libssl/src/apps/server.pem +++ b/src/lib/libssl/src/apps/server.pem | |||
@@ -1,369 +1,52 @@ | |||
1 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) | 1 | subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Server Cert |
2 | subject= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (512 bit) | 2 | issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA |
3 | -----BEGIN CERTIFICATE----- | 3 | -----BEGIN CERTIFICATE----- |
4 | MIIB6TCCAVICAQYwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV | 4 | MIID5zCCAs+gAwIBAgIJALnu1NlVpZ6zMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV |
5 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD | 5 | BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT |
6 | VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDAxMDE2MjIzMTAzWhcNMDMwMTE0 | 6 | VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt |
7 | MjIzMTAzWjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG | 7 | ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZDELMAkG |
8 | A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0IGNl | 8 | A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU |
9 | cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8SMVIP | 9 | RVNUSU5HIFBVUlBPU0VTIE9OTFkxGTAXBgNVBAMMEFRlc3QgU2VydmVyIENlcnQw |
10 | Fe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8Ey2// | 10 | ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDzhPOSNtyyRspmeuUpxfNJ |
11 | Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCT0grFQeZaqYb5EYfk20XixZV4 | 11 | KCLTuf7g3uQ4zu4iHOmRO5TQci+HhVlLZrHF9XqFXcIP0y4pWDbMSGuiorUmzmfi |
12 | GmyAbXMftG1Eo7qGiMhYzRwGNWxEYojf5PZkYZXvSqZ/ZXHXa4g59jK/rJNnaVGM | 12 | R7bfSdI/+qIQt8KXRH6HNG1t8ou0VSvWId5TS5Dq/er5ODUr9OaaDva7EquHIcMv |
13 | k+xIX8mxQvlV0n5O9PIha5BX5teZnkHKgL8aKKLKW1BK7YTngsfSzzaeame5iKfz | 13 | vPQGuI+OEAcnleVCy9HVEIySrO4P3CNIicnGkwwiAud05yUAq/gPXBC1hTtmlPD7 |
14 | itAE+OjGF+PFKbwX8Q== | 14 | TVcGVSEiJdvzqqlgv02qedGrkki6GY4S7GjZxrrf7Foc2EP+51LJzwLQx3/JfrCU |
15 | -----END CERTIFICATE----- | 15 | 41NEWAsu/Sl0tQabXESN+zJ1pDqoZ3uHMgpQjeGiE0olr+YcsSW/tJmiU9OiAr8R |
16 | -----BEGIN RSA PRIVATE KEY----- | 16 | AgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJYIZI |
17 | MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD | 17 | AYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1UdDgQW |
18 | TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu | 18 | BBSCvM8AABPR9zklmifnr9LvIBturDAfBgNVHSMEGDAWgBQ2w2yI55X+sL3szj49 |
19 | OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj | 19 | hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEAqb1NV0B0/pbpK9Z4/bNjzPQLTRLK |
20 | gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz | 20 | WnSNm/Jh5v0GEUOE/Beg7GNjNrmeNmqxAlpqWz9qoeoFZax+QBpIZYjROU3TS3fp |
21 | rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b | 21 | yLsrnlr0CDQ5R7kCCDGa8dkXxemmpZZLbUCpW2Uoy8sAA4JjN9OtsZY7dvUXFgJ7 |
22 | PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA | 22 | vVNTRnI01ghknbtD+2SxSQd3CWF6QhcRMAzZJ1z1cbbwGDDzfvGFPzJ+Sq+zEPds |
23 | vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU= | 23 | xoVLLSetCiBc+40ZcDS5dV98h9XD7JMTQfxzA7mNGv73JoZJA6nFgj+ADSlJsY/t |
24 | -----END RSA PRIVATE KEY----- | 24 | JBv+z1iQRueoh9Qeee+ZbRifPouCB8FDx+AltvHTANdAq0t/K3o+pplMVA== |
25 | subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA | ||
26 | issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA | ||
27 | notBefore=950413210656Z | ||
28 | notAfter =970412210656Z | ||
29 | -----BEGIN X509 CERTIFICATE----- | ||
30 | |||
31 | MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV | ||
32 | BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS | ||
33 | ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ | ||
34 | BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD | ||
35 | VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA | ||
36 | MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR | ||
37 | 3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM | ||
38 | YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI | ||
39 | hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5 | ||
40 | dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/ | ||
41 | zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8= | ||
42 | -----END X509 CERTIFICATE----- | ||
43 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) | ||
44 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) | ||
45 | -----BEGIN CERTIFICATE----- | ||
46 | MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV | ||
47 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD | ||
48 | VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw | ||
49 | OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY | ||
50 | BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0 | ||
51 | IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ | ||
52 | DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv | ||
53 | 1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2 | ||
54 | mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v | ||
55 | hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4 | ||
56 | YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA | ||
57 | q30KIqGM/uoM60INq97qjDmCJapagcNBGQs= | ||
58 | -----END CERTIFICATE----- | ||
59 | -----BEGIN RSA PRIVATE KEY----- | ||
60 | MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425 | ||
61 | gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd | ||
62 | 2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB | ||
63 | AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6 | ||
64 | hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2 | ||
65 | J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs | ||
66 | HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL | ||
67 | 21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s | ||
68 | nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz | ||
69 | MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa | ||
70 | pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb | ||
71 | KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2 | ||
72 | XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ | ||
73 | -----END RSA PRIVATE KEY----- | ||
74 | -----BEGIN X509 CERTIFICATE----- | ||
75 | MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT | ||
76 | LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ | ||
77 | MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls | ||
78 | b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG | ||
79 | EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk | ||
80 | bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL | ||
81 | ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb | ||
82 | hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/ | ||
83 | ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb | ||
84 | bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3 | ||
85 | fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX | ||
86 | R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR | ||
87 | Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK | ||
88 | -----END X509 CERTIFICATE----- | ||
89 | -----BEGIN X509 CERTIFICATE----- | ||
90 | |||
91 | MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK | ||
92 | Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x | ||
93 | GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp | ||
94 | bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE | ||
95 | BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ | ||
96 | BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+ | ||
97 | ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw | ||
98 | ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI | ||
99 | H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z | ||
100 | WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE | ||
101 | MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM | ||
102 | LC7obsrHD8XAHG+ZRG== | ||
103 | -----END X509 CERTIFICATE----- | ||
104 | -----BEGIN CERTIFICATE----- | ||
105 | MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM | ||
106 | MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT | ||
107 | DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx | ||
108 | CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv | ||
109 | amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB | ||
110 | iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt | ||
111 | U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw | ||
112 | zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd | ||
113 | BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G | ||
114 | A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8 | ||
115 | /DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi | ||
116 | lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA | ||
117 | S7ELuYGtmYgYm9NZOIr7yU0= | ||
118 | -----END CERTIFICATE----- | ||
119 | -----BEGIN CERTIFICATE----- | ||
120 | MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG | ||
121 | A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0 | ||
122 | aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB | ||
123 | LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB | ||
124 | gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu | ||
125 | ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu | ||
126 | dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD | ||
127 | SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL | ||
128 | bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a | ||
129 | OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW | ||
130 | GJNMJ4L0AJ/ac+SmHZc= | ||
131 | -----END CERTIFICATE----- | ||
132 | -----BEGIN CERTIFICATE----- | ||
133 | MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN | ||
134 | BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w | ||
135 | HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0 | ||
136 | IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL | ||
137 | MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls | ||
138 | aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww | ||
139 | GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL | ||
140 | ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc | ||
141 | zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0 | ||
142 | YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq | ||
143 | hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF | ||
144 | cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W | ||
145 | YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w== | ||
146 | -----END CERTIFICATE----- | ||
147 | |||
148 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) | ||
149 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) | ||
150 | -----BEGIN CERTIFICATE----- | ||
151 | MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV | ||
152 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD | ||
153 | VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw | ||
154 | OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY | ||
155 | BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy | ||
156 | NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg | ||
157 | 40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp | ||
158 | 22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y | ||
159 | BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S | ||
160 | Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9 | ||
161 | xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO | ||
162 | cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI | ||
163 | -----END CERTIFICATE----- | 25 | -----END CERTIFICATE----- |
164 | -----BEGIN RSA PRIVATE KEY----- | 26 | -----BEGIN RSA PRIVATE KEY----- |
165 | MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg | 27 | MIIEpAIBAAKCAQEA84TzkjbcskbKZnrlKcXzSSgi07n+4N7kOM7uIhzpkTuU0HIv |
166 | wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ | 28 | h4VZS2axxfV6hV3CD9MuKVg2zEhroqK1Js5n4ke230nSP/qiELfCl0R+hzRtbfKL |
167 | vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB | 29 | tFUr1iHeU0uQ6v3q+Tg1K/Tmmg72uxKrhyHDL7z0BriPjhAHJ5XlQsvR1RCMkqzu |
168 | AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc | 30 | D9wjSInJxpMMIgLndOclAKv4D1wQtYU7ZpTw+01XBlUhIiXb86qpYL9NqnnRq5JI |
169 | z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz | 31 | uhmOEuxo2ca63+xaHNhD/udSyc8C0Md/yX6wlONTRFgLLv0pdLUGm1xEjfsydaQ6 |
170 | xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7 | 32 | qGd7hzIKUI3hohNKJa/mHLElv7SZolPTogK/EQIDAQABAoIBAADq9FwNtuE5IRQn |
171 | HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD | 33 | zGtO4q7Y5uCzZ8GDNYr9RKp+P2cbuWDbvVAecYq2NV9QoIiWJOAYZKklOvekIju3 |
172 | yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS | 34 | r0UZLA0PRiIrTg6NrESx3JrjWDK8QNlUO7CPTZ39/K+FrmMkV9lem9yxjJjyC34D |
173 | xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj | 35 | AQB+YRTx+l14HppjdxNwHjAVQpIx/uO2F5xAMuk32+3K+pq9CZUtrofe1q4Agj9R |
174 | 7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG | 36 | 5s8mSy9pbRo9kW9wl5xdEotz1LivFOEiqPUJTUq5J5PeMKao3vdK726XI4Z455Nm |
175 | h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL | 37 | W2/MA0YV0ug2FYinHcZdvKM6dimH8GLfa3X8xKRfzjGjTiMSwsdjgMa4awY3tEHH |
176 | QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q | 38 | 674jhAECgYEA/zqMrc0zsbNk83sjgaYIug5kzEpN4ic020rSZsmQxSCerJTgNhmg |
177 | hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc= | 39 | utKSCt0Re09Jt3LqG48msahX8ycqDsHNvlEGPQSbMu9IYeO3Wr3fAm75GEtFWePY |
40 | BhM73I7gkRt4s8bUiUepMG/wY45c5tRF23xi8foReHFFe9MDzh8fJFECgYEA9EFX | ||
41 | 4qAik1pOJGNei9BMwmx0I0gfVEIgu0tzeVqT45vcxbxr7RkTEaDoAG6PlbWP6D9a | ||
42 | WQNLp4gsgRM90ZXOJ4up5DsAWDluvaF4/omabMA+MJJ5kGZ0gCj5rbZbKqUws7x8 | ||
43 | bp+6iBfUPJUbcqNqFmi/08Yt7vrDnMnyMw2A/sECgYEAiiuRMxnuzVm34hQcsbhH | ||
44 | 6ymVqf7j0PW2qK0F4H1ocT9qhzWFd+RB3kHWrCjnqODQoI6GbGr/4JepHUpre1ex | ||
45 | 4UEN5oSS3G0ru0rC3U4C59dZ5KwDHFm7ffZ1pr52ljfQDUsrjjIMRtuiwNK2OoRa | ||
46 | WSsqiaL+SDzSB+nBmpnAizECgYBdt/y6rerWUx4MhDwwtTnel7JwHyo2MDFS6/5g | ||
47 | n8qC2Lj6/fMDRE22w+CA2esp7EJNQJGv+b27iFpbJEDh+/Lf5YzIT4MwVskQ5bYB | ||
48 | JFcmRxUVmf4e09D7o705U/DjCgMH09iCsbLmqQ38ONIRSHZaJtMDtNTHD1yi+jF+ | ||
49 | OT43gQKBgQC/2OHZoko6iRlNOAQ/tMVFNq7fL81GivoQ9F1U0Qr+DH3ZfaH8eIkX | ||
50 | xT0ToMPJUzWAn8pZv0snA0um6SIgvkCuxO84OkANCVbttzXImIsL7pFzfcwV/ERK | ||
51 | UM6j0ZuSMFOCr/lGPAoOQU0fskidGEHi1/kW+suSr28TqsyYZpwBDQ== | ||
178 | -----END RSA PRIVATE KEY----- | 52 | -----END RSA PRIVATE KEY----- |
179 | subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority | ||
180 | issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority | ||
181 | notBefore=941104185834Z | ||
182 | notAfter =991103185834Z | ||
183 | -----BEGIN X509 CERTIFICATE----- | ||
184 | |||
185 | MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw | ||
186 | HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy | ||
187 | Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05 | ||
188 | OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT | ||
189 | ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u | ||
190 | IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o | ||
191 | 975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/ | ||
192 | touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE | ||
193 | 7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j | ||
194 | 9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI | ||
195 | 0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb | ||
196 | MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU= | ||
197 | -----END X509 CERTIFICATE----- | ||
198 | subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority | ||
199 | issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority | ||
200 | notBefore=941109235417Z | ||
201 | notAfter =991231235417Z | ||
202 | -----BEGIN X509 CERTIFICATE----- | ||
203 | |||
204 | MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw | ||
205 | HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl | ||
206 | IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda | ||
207 | Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0 | ||
208 | YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp | ||
209 | Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB | ||
210 | roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12 | ||
211 | aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc | ||
212 | HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A | ||
213 | iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7 | ||
214 | suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h | ||
215 | cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk= | ||
216 | -----END X509 CERTIFICATE----- | ||
217 | subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc | ||
218 | /OU=Certification Services Division/CN=Thawte Server CA | ||
219 | /Email=server-certs@thawte.com | ||
220 | issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc | ||
221 | /OU=Certification Services Division/CN=Thawte Server CA | ||
222 | /Email=server-certs@thawte.com | ||
223 | -----BEGIN CERTIFICATE----- | ||
224 | MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD | ||
225 | VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU | ||
226 | VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy | ||
227 | dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq | ||
228 | hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1 | ||
229 | N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 | ||
230 | ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv | ||
231 | bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 | ||
232 | aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW | ||
233 | F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB | ||
234 | iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1 | ||
235 | Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A | ||
236 | KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG | ||
237 | SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX | ||
238 | 7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM | ||
239 | qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf | ||
240 | -----END CERTIFICATE----- | ||
241 | |||
242 | -----BEGIN CERTIFICATE----- | ||
243 | MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD | ||
244 | VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU | ||
245 | VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy | ||
246 | dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD | ||
247 | QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05 | ||
248 | NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG | ||
249 | A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT | ||
250 | FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl | ||
251 | cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg | ||
252 | Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w | ||
253 | DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c | ||
254 | G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU | ||
255 | c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH | ||
256 | jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR | ||
257 | w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2 | ||
258 | GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK | ||
259 | 3VZdLbCVIhNoEsysrxCpxcI= | ||
260 | -----END CERTIFICATE----- | ||
261 | Tims test GCI CA | ||
262 | |||
263 | -----BEGIN CERTIFICATE----- | ||
264 | MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD | ||
265 | VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 | ||
266 | cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD | ||
267 | cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow | ||
268 | gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC | ||
269 | cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl | ||
270 | dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN | ||
271 | AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw | ||
272 | OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF | ||
273 | AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA | ||
274 | TfdbFZtAAD2Hx9jUtY3tfdrJOb8= | ||
275 | -----END CERTIFICATE----- | ||
276 | |||
277 | -----BEGIN CERTIFICATE----- | ||
278 | MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD | ||
279 | VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 | ||
280 | cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O | ||
281 | IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB | ||
282 | VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1 | ||
283 | NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH | ||
284 | EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT | ||
285 | I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta | ||
286 | RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ | ||
287 | KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR | ||
288 | Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG | ||
289 | 9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4 | ||
290 | WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU= | ||
291 | -----END CERTIFICATE----- | ||
292 | -----BEGIN CERTIFICATE----- | ||
293 | MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0 | ||
294 | MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh | ||
295 | c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda | ||
296 | Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W | ||
297 | ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu | ||
298 | ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2 | ||
299 | FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j | ||
300 | W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari | ||
301 | QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG | ||
302 | 9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C | ||
303 | TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW | ||
304 | 8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA | ||
305 | -----END CERTIFICATE----- | ||
306 | |||
307 | subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber | ||
308 | issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber | ||
309 | |||
310 | -----BEGIN CERTIFICATE----- | ||
311 | MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw | ||
312 | YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw | ||
313 | MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp | ||
314 | YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI | ||
315 | SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp | ||
316 | U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG | ||
317 | SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb | ||
318 | RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp | ||
319 | 3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv | ||
320 | z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg | ||
321 | hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg | ||
322 | YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv | ||
323 | LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg | ||
324 | KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ | ||
325 | Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv | ||
326 | ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v | ||
327 | dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw | ||
328 | IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS | ||
329 | ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ | ||
330 | TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w | ||
331 | LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU | ||
332 | BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs | ||
333 | 53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq | ||
334 | 2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB | ||
335 | p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY= | ||
336 | -----END CERTIFICATE----- | ||
337 | |||
338 | subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority | ||
339 | issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority | ||
340 | -----BEGIN CERTIFICATE----- | ||
341 | MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw | ||
342 | FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg | ||
343 | UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa | ||
344 | Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln | ||
345 | biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp | ||
346 | Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ | ||
347 | nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma | ||
348 | AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga | ||
349 | IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF | ||
350 | AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ | ||
351 | Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6 | ||
352 | NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ== | ||
353 | -----END CERTIFICATE----- | ||
354 | subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority | ||
355 | issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority | ||
356 | -----BEGIN CERTIFICATE----- | ||
357 | MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw | ||
358 | FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg | ||
359 | UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa | ||
360 | Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln | ||
361 | biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp | ||
362 | Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1 | ||
363 | 9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj | ||
364 | IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd | ||
365 | O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF | ||
366 | AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ | ||
367 | g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am | ||
368 | yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q== | ||
369 | -----END CERTIFICATE----- | ||
diff --git a/src/lib/libssl/src/apps/server2.pem b/src/lib/libssl/src/apps/server2.pem index 8bb664194e..a3927cf788 100644 --- a/src/lib/libssl/src/apps/server2.pem +++ b/src/lib/libssl/src/apps/server2.pem | |||
@@ -1,376 +1,52 @@ | |||
1 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) | 1 | subject= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = Test Server Cert #2 |
2 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (1024 bit) | 2 | issuer= C = UK, O = OpenSSL Group, OU = FOR TESTING PURPOSES ONLY, CN = OpenSSL Test Intermediate CA |
3 | -----BEGIN CERTIFICATE----- | 3 | -----BEGIN CERTIFICATE----- |
4 | MIICLjCCAZcCAQEwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV | 4 | MIID6jCCAtKgAwIBAgIJALnu1NlVpZ60MA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV |
5 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD | 5 | BAYTAlVLMRYwFAYDVQQKDA1PcGVuU1NMIEdyb3VwMSIwIAYDVQQLDBlGT1IgVEVT |
6 | VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU0WhcNOTgwNjA5 | 6 | VElORyBQVVJQT1NFUyBPTkxZMSUwIwYDVQQDDBxPcGVuU1NMIFRlc3QgSW50ZXJt |
7 | MTM1NzU0WjBkMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG | 7 | ZWRpYXRlIENBMB4XDTExMTIwODE0MDE0OFoXDTIxMTAxNjE0MDE0OFowZzELMAkG |
8 | A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxJDAiBgNVBAMTG1NlcnZlciB0ZXN0IGNl | 8 | A1UEBhMCVUsxFjAUBgNVBAoMDU9wZW5TU0wgR3JvdXAxIjAgBgNVBAsMGUZPUiBU |
9 | cnQgKDEwMjQgYml0KTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsxH1PBPm | 9 | RVNUSU5HIFBVUlBPU0VTIE9OTFkxHDAaBgNVBAMME1Rlc3QgU2VydmVyIENlcnQg |
10 | RkxrR11eV4bzNi4N9n11CI8nV29+ARlT1+qDe/mjVUvXlmsr1v/vf71G9GgqopSa | 10 | IzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDrdi7j9yctG+L4EjBy |
11 | 6RXrICLVdk/FYYYzhPvl1M+OrjaXDFO8BzBAF1Lnz6c7aRZvGRJNrRSr2nZEkqDf | 11 | gjPmEqZzOJEQba26MoQGzglU7e5Xf59Rb/hgVQuKAoiZe7/R8rK4zJ4W7iXdXw0L |
12 | JW9dY7r2VZEpD5QeuaRYUnuECkqeieB65GMCAwEAATANBgkqhkiG9w0BAQQFAAOB | 12 | qBpyG8B5aGKeI32w+A9TcBApoXXL2CrYQEQjZwUIpLlYBIi2NkJj3nVkq5dgl1gO |
13 | gQCWsOta6C0wiVzXz8wPmJKyTrurMlgUss2iSuW9366iwofZddsNg7FXniMzkIf6 | 13 | ALiQ+W8jg3kzg5Ec9rimp9r93N8wsSL3awsafurmYCvOf7leHaMP1WJ/zDRGUNHG |
14 | dp7jnmWZwKZ9cXsNUS2o4OL07qOk2HOywC0YsNZQsOBu1CBTYYkIefDiKFL1zQHh | 14 | /WtDjXc8ZUG1+6EXU9Jc2Fs+2Omf7fcN0l00AK/wPg8OaNS0rKyGq9JdIT9FRGV1 |
15 | 8lwwNd4NP+OE3NzUNkCfh4DnFfg9WHkXUlD5UpxNRJ4gJA== | 15 | bXe/rx58FaE5CItdwCSYhJvF/O95LWQoxJXye5bCFLmvDTEyVq9FMSCptfsmbXjE |
16 | -----END CERTIFICATE----- | 16 | ZGsXAgMBAAGjgY8wgYwwDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBeAwLAYJ |
17 | -----BEGIN RSA PRIVATE KEY----- | 17 | YIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmljYXRlMB0GA1Ud |
18 | MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV | 18 | DgQWBBR52UaWWTKzZGDH/X4mWNcuqeQVazAfBgNVHSMEGDAWgBQ2w2yI55X+sL3s |
19 | S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP | 19 | zj49hqshgYfa2jANBgkqhkiG9w0BAQUFAAOCAQEANBW+XYLlHBqVY/31ie+3gRlS |
20 | pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB | 20 | LPfy4SIqn0t3RJjagT29MXprblBO2cbMO8VGjkQdKGpmMXjxbht2arOOUXRHX4n/ |
21 | AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0 | 21 | XTyn/QHEf0bcwIITMReO3DZUPAEw8hSjn9xEOM0IRVOCP+mH5fi74QzzQaZVCyYg |
22 | dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY | 22 | 5VtLKdww/+sc0nCbKl2KWgDluriH0nfVx95qgW3mg9dhXRr0zmf1w2zkBHYpARYL |
23 | bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E | 23 | Dew6Z8EE4tS3HJu8/qM6meWzNtrfonQ3eiiMxjZBxzV46jchBwa2z9XYhP6AmpPb |
24 | Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq | 24 | oeTSzcQNbWsxaGYzWo46oLDUZmJOwSBawbS31bZNMCoPIY6ukoesCzFSsUKZww== |
25 | zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM | ||
26 | 6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf | ||
27 | QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD | ||
28 | dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M | ||
29 | 0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv | ||
30 | nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA== | ||
31 | -----END RSA PRIVATE KEY----- | ||
32 | subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA | ||
33 | issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA | ||
34 | notBefore=950413210656Z | ||
35 | notAfter =970412210656Z | ||
36 | -----BEGIN X509 CERTIFICATE----- | ||
37 | |||
38 | MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV | ||
39 | BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS | ||
40 | ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ | ||
41 | BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD | ||
42 | VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA | ||
43 | MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR | ||
44 | 3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM | ||
45 | YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI | ||
46 | hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5 | ||
47 | dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/ | ||
48 | zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8= | ||
49 | -----END X509 CERTIFICATE----- | ||
50 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) | ||
51 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) | ||
52 | -----BEGIN CERTIFICATE----- | ||
53 | MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV | ||
54 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD | ||
55 | VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw | ||
56 | OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY | ||
57 | BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0 | ||
58 | IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ | ||
59 | DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv | ||
60 | 1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2 | ||
61 | mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v | ||
62 | hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4 | ||
63 | YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA | ||
64 | q30KIqGM/uoM60INq97qjDmCJapagcNBGQs= | ||
65 | -----END CERTIFICATE----- | ||
66 | -----BEGIN RSA PRIVATE KEY----- | ||
67 | MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425 | ||
68 | gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd | ||
69 | 2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB | ||
70 | AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6 | ||
71 | hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2 | ||
72 | J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs | ||
73 | HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL | ||
74 | 21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s | ||
75 | nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz | ||
76 | MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa | ||
77 | pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb | ||
78 | KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2 | ||
79 | XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ | ||
80 | -----END RSA PRIVATE KEY----- | ||
81 | -----BEGIN X509 CERTIFICATE----- | ||
82 | MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT | ||
83 | LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ | ||
84 | MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls | ||
85 | b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG | ||
86 | EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk | ||
87 | bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL | ||
88 | ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb | ||
89 | hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/ | ||
90 | ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb | ||
91 | bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3 | ||
92 | fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX | ||
93 | R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR | ||
94 | Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK | ||
95 | -----END X509 CERTIFICATE----- | ||
96 | -----BEGIN X509 CERTIFICATE----- | ||
97 | |||
98 | MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK | ||
99 | Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x | ||
100 | GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp | ||
101 | bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE | ||
102 | BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ | ||
103 | BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+ | ||
104 | ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw | ||
105 | ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI | ||
106 | H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z | ||
107 | WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE | ||
108 | MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM | ||
109 | LC7obsrHD8XAHG+ZRG== | ||
110 | -----END X509 CERTIFICATE----- | ||
111 | -----BEGIN CERTIFICATE----- | ||
112 | MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM | ||
113 | MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT | ||
114 | DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx | ||
115 | CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv | ||
116 | amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB | ||
117 | iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt | ||
118 | U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw | ||
119 | zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd | ||
120 | BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G | ||
121 | A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8 | ||
122 | /DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi | ||
123 | lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA | ||
124 | S7ELuYGtmYgYm9NZOIr7yU0= | ||
125 | -----END CERTIFICATE----- | ||
126 | -----BEGIN CERTIFICATE----- | ||
127 | MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG | ||
128 | A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0 | ||
129 | aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB | ||
130 | LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB | ||
131 | gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu | ||
132 | ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu | ||
133 | dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD | ||
134 | SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL | ||
135 | bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a | ||
136 | OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW | ||
137 | GJNMJ4L0AJ/ac+SmHZc= | ||
138 | -----END CERTIFICATE----- | ||
139 | -----BEGIN CERTIFICATE----- | ||
140 | MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN | ||
141 | BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w | ||
142 | HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0 | ||
143 | IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL | ||
144 | MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls | ||
145 | aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww | ||
146 | GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL | ||
147 | ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc | ||
148 | zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0 | ||
149 | YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq | ||
150 | hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF | ||
151 | cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W | ||
152 | YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w== | ||
153 | -----END CERTIFICATE----- | ||
154 | |||
155 | issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) | ||
156 | subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) | ||
157 | -----BEGIN CERTIFICATE----- | ||
158 | MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV | ||
159 | BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD | ||
160 | VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw | ||
161 | OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY | ||
162 | BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy | ||
163 | NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg | ||
164 | 40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp | ||
165 | 22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y | ||
166 | BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S | ||
167 | Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9 | ||
168 | xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO | ||
169 | cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI | ||
170 | -----END CERTIFICATE----- | 25 | -----END CERTIFICATE----- |
171 | -----BEGIN RSA PRIVATE KEY----- | 26 | -----BEGIN RSA PRIVATE KEY----- |
172 | MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg | 27 | MIIEowIBAAKCAQEA63Yu4/cnLRvi+BIwcoIz5hKmcziREG2tujKEBs4JVO3uV3+f |
173 | wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ | 28 | UW/4YFULigKImXu/0fKyuMyeFu4l3V8NC6gachvAeWhiniN9sPgPU3AQKaF1y9gq |
174 | vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB | 29 | 2EBEI2cFCKS5WASItjZCY951ZKuXYJdYDgC4kPlvI4N5M4ORHPa4pqfa/dzfMLEi |
175 | AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc | 30 | 92sLGn7q5mArzn+5Xh2jD9Vif8w0RlDRxv1rQ413PGVBtfuhF1PSXNhbPtjpn+33 |
176 | z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz | 31 | DdJdNACv8D4PDmjUtKyshqvSXSE/RURldW13v68efBWhOQiLXcAkmISbxfzveS1k |
177 | xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7 | 32 | KMSV8nuWwhS5rw0xMlavRTEgqbX7Jm14xGRrFwIDAQABAoIBAHLsTPihIfLnYIE5 |
178 | HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD | 33 | x4GsQQ5zXeBw5ITDM37ktwHnQDC+rIzyUl1aLD1AZRBoKinXd4lOTqLZ4/NHKx4A |
179 | yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS | 34 | DYr58mZtWyUmqLOMmQVuHXTZBlp7XtYuXMMNovQwjQlp9LicBeoBU6gQ5PVMtubD |
180 | xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj | 35 | F4xGF89Sn0cTHW3iMkqTtQ5KcR1j57OcJO0FEb1vPvk2MXI5ZyAatUYE7YacbEzd |
181 | 7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG | 36 | rg02uIwx3FqNSkuSI79uz4hMdV5TPtuhxx9nTwj9aLUhXFeZ0mn2PVgVzEnnMoJb |
182 | h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL | 37 | +znlsZDgzDlJqdaD744YGWh8Z3OEssB35KfzFcdOeO6yH8lmv2Zfznk7pNPT7LTb |
183 | QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q | 38 | Lae9VgkCgYEA92p1qnAB3NtJtNcaW53i0S5WJgS1hxWKvUDx3lTB9s8X9fHpqL1a |
184 | hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc= | 39 | E94fDfWzp/hax6FefUKIvBOukPLQ6bYjTMiFoOHzVirghAIuIUoMI5VtLhwD1hKs |
40 | Lr7l/dptMgKb1nZHyXoKHRBthsy3K4+udsPi8TzMvYElgEqyQIe/Rk0CgYEA86GL | ||
41 | 8HC6zLszzKERDPBxrboRmoFvVUCTQDhsfj1M8aR3nQ8V5LkdIJc7Wqm/Ggfk9QRf | ||
42 | rJ8M2WUMlU5CNnCn/KCrKzCNZIReze3fV+HnKdbcXGLvgbHPrhnz8yYehUFG+RGq | ||
43 | bVyDWRU94T38izy2s5qMYrMJWZEYyXncSPbfcPMCgYAtaXfxcZ+V5xYPQFARMtiX | ||
44 | 5nZfggvDoJuXgx0h3tK/N2HBfcaSdzbaYLG4gTmZggc/jwnl2dl5E++9oSPhUdIG | ||
45 | 3ONSFUbxsOsGr9PBvnKd8WZZyUCXAVRjPBzAzF+whzQNWCZy/5htnz9LN7YDI9s0 | ||
46 | 5113Q96cheDZPFydZY0hHQKBgQDVbEhNukM5xCiNcu+f2SaMnLp9EjQ4h5g3IvaP | ||
47 | 5B16daw/Dw8LzcohWboqIxeAsze0GD/D1ZUJAEd0qBjC3g+a9BjefervCjKOzXng | ||
48 | 38mEUm+6EwVjJSQcjSmycEs+Sr/kwr/8i5WYvU32+jk4tFgMoC+o6tQe/Uesf68k | ||
49 | z/dPVwKBgGbF7Vv1/3SmhlOy+zYyvJ0CrWtKxH9QP6tLIEgEpd8x7YTSuCH94yok | ||
50 | kToMXYA3sWNPt22GbRDZ+rcp4c7HkDx6I6vpdP9aQEwJTp0EPy0sgWr2XwYmreIQ | ||
51 | NFmkk8Itn9EY2R9VBaP7GLv5kvwxDdLAnmwGmzVtbmaVdxCaBwUk | ||
185 | -----END RSA PRIVATE KEY----- | 52 | -----END RSA PRIVATE KEY----- |
186 | subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority | ||
187 | issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority | ||
188 | notBefore=941104185834Z | ||
189 | notAfter =991103185834Z | ||
190 | -----BEGIN X509 CERTIFICATE----- | ||
191 | |||
192 | MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw | ||
193 | HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy | ||
194 | Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05 | ||
195 | OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT | ||
196 | ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u | ||
197 | IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o | ||
198 | 975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/ | ||
199 | touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE | ||
200 | 7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j | ||
201 | 9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI | ||
202 | 0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb | ||
203 | MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU= | ||
204 | -----END X509 CERTIFICATE----- | ||
205 | subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority | ||
206 | issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority | ||
207 | notBefore=941109235417Z | ||
208 | notAfter =991231235417Z | ||
209 | -----BEGIN X509 CERTIFICATE----- | ||
210 | |||
211 | MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw | ||
212 | HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl | ||
213 | IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda | ||
214 | Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0 | ||
215 | YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp | ||
216 | Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB | ||
217 | roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12 | ||
218 | aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc | ||
219 | HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A | ||
220 | iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7 | ||
221 | suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h | ||
222 | cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk= | ||
223 | -----END X509 CERTIFICATE----- | ||
224 | subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc | ||
225 | /OU=Certification Services Division/CN=Thawte Server CA | ||
226 | /Email=server-certs@thawte.com | ||
227 | issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc | ||
228 | /OU=Certification Services Division/CN=Thawte Server CA | ||
229 | /Email=server-certs@thawte.com | ||
230 | -----BEGIN CERTIFICATE----- | ||
231 | MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD | ||
232 | VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU | ||
233 | VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy | ||
234 | dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq | ||
235 | hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1 | ||
236 | N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 | ||
237 | ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv | ||
238 | bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 | ||
239 | aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW | ||
240 | F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB | ||
241 | iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1 | ||
242 | Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A | ||
243 | KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG | ||
244 | SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX | ||
245 | 7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM | ||
246 | qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf | ||
247 | -----END CERTIFICATE----- | ||
248 | |||
249 | -----BEGIN CERTIFICATE----- | ||
250 | MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD | ||
251 | VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU | ||
252 | VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy | ||
253 | dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD | ||
254 | QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05 | ||
255 | NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG | ||
256 | A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT | ||
257 | FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl | ||
258 | cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg | ||
259 | Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w | ||
260 | DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c | ||
261 | G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU | ||
262 | c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH | ||
263 | jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR | ||
264 | w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2 | ||
265 | GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK | ||
266 | 3VZdLbCVIhNoEsysrxCpxcI= | ||
267 | -----END CERTIFICATE----- | ||
268 | Tims test GCI CA | ||
269 | |||
270 | -----BEGIN CERTIFICATE----- | ||
271 | MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD | ||
272 | VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 | ||
273 | cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD | ||
274 | cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow | ||
275 | gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC | ||
276 | cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl | ||
277 | dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN | ||
278 | AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw | ||
279 | OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF | ||
280 | AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA | ||
281 | TfdbFZtAAD2Hx9jUtY3tfdrJOb8= | ||
282 | -----END CERTIFICATE----- | ||
283 | |||
284 | -----BEGIN CERTIFICATE----- | ||
285 | MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD | ||
286 | VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 | ||
287 | cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O | ||
288 | IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB | ||
289 | VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1 | ||
290 | NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH | ||
291 | EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT | ||
292 | I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta | ||
293 | RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ | ||
294 | KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR | ||
295 | Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG | ||
296 | 9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4 | ||
297 | WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU= | ||
298 | -----END CERTIFICATE----- | ||
299 | -----BEGIN CERTIFICATE----- | ||
300 | MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0 | ||
301 | MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh | ||
302 | c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda | ||
303 | Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W | ||
304 | ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu | ||
305 | ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2 | ||
306 | FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j | ||
307 | W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari | ||
308 | QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG | ||
309 | 9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C | ||
310 | TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW | ||
311 | 8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA | ||
312 | -----END CERTIFICATE----- | ||
313 | |||
314 | subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber | ||
315 | issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber | ||
316 | |||
317 | -----BEGIN CERTIFICATE----- | ||
318 | MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw | ||
319 | YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw | ||
320 | MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp | ||
321 | YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI | ||
322 | SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp | ||
323 | U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG | ||
324 | SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb | ||
325 | RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp | ||
326 | 3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv | ||
327 | z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg | ||
328 | hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg | ||
329 | YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv | ||
330 | LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg | ||
331 | KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ | ||
332 | Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv | ||
333 | ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v | ||
334 | dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw | ||
335 | IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS | ||
336 | ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ | ||
337 | TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w | ||
338 | LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU | ||
339 | BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs | ||
340 | 53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq | ||
341 | 2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB | ||
342 | p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY= | ||
343 | -----END CERTIFICATE----- | ||
344 | |||
345 | subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority | ||
346 | issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority | ||
347 | -----BEGIN CERTIFICATE----- | ||
348 | MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw | ||
349 | FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg | ||
350 | UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa | ||
351 | Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln | ||
352 | biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp | ||
353 | Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ | ||
354 | nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma | ||
355 | AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga | ||
356 | IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF | ||
357 | AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ | ||
358 | Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6 | ||
359 | NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ== | ||
360 | -----END CERTIFICATE----- | ||
361 | subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority | ||
362 | issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority | ||
363 | -----BEGIN CERTIFICATE----- | ||
364 | MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw | ||
365 | FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg | ||
366 | UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa | ||
367 | Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln | ||
368 | biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp | ||
369 | Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1 | ||
370 | 9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj | ||
371 | IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd | ||
372 | O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF | ||
373 | AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ | ||
374 | g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am | ||
375 | yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q== | ||
376 | -----END CERTIFICATE----- | ||
diff --git a/src/lib/libssl/src/apps/sess_id.c b/src/lib/libssl/src/apps/sess_id.c index b99179f276..b16686c26d 100644 --- a/src/lib/libssl/src/apps/sess_id.c +++ b/src/lib/libssl/src/apps/sess_id.c | |||
@@ -90,6 +90,7 @@ int MAIN(int, char **); | |||
90 | int MAIN(int argc, char **argv) | 90 | int MAIN(int argc, char **argv) |
91 | { | 91 | { |
92 | SSL_SESSION *x=NULL; | 92 | SSL_SESSION *x=NULL; |
93 | X509 *peer = NULL; | ||
93 | int ret=1,i,num,badops=0; | 94 | int ret=1,i,num,badops=0; |
94 | BIO *out=NULL; | 95 | BIO *out=NULL; |
95 | int informat,outformat; | 96 | int informat,outformat; |
@@ -163,16 +164,17 @@ bad: | |||
163 | ERR_load_crypto_strings(); | 164 | ERR_load_crypto_strings(); |
164 | x=load_sess_id(infile,informat); | 165 | x=load_sess_id(infile,informat); |
165 | if (x == NULL) { goto end; } | 166 | if (x == NULL) { goto end; } |
167 | peer = SSL_SESSION_get0_peer(x); | ||
166 | 168 | ||
167 | if(context) | 169 | if(context) |
168 | { | 170 | { |
169 | x->sid_ctx_length=strlen(context); | 171 | size_t ctx_len = strlen(context); |
170 | if(x->sid_ctx_length > SSL_MAX_SID_CTX_LENGTH) | 172 | if(ctx_len > SSL_MAX_SID_CTX_LENGTH) |
171 | { | 173 | { |
172 | BIO_printf(bio_err,"Context too long\n"); | 174 | BIO_printf(bio_err,"Context too long\n"); |
173 | goto end; | 175 | goto end; |
174 | } | 176 | } |
175 | memcpy(x->sid_ctx,context,x->sid_ctx_length); | 177 | SSL_SESSION_set1_id_context(x, (unsigned char *)context, ctx_len); |
176 | } | 178 | } |
177 | 179 | ||
178 | #ifdef undef | 180 | #ifdef undef |
@@ -231,10 +233,10 @@ bad: | |||
231 | 233 | ||
232 | if (cert) | 234 | if (cert) |
233 | { | 235 | { |
234 | if (x->peer == NULL) | 236 | if (peer == NULL) |
235 | BIO_puts(out,"No certificate present\n"); | 237 | BIO_puts(out,"No certificate present\n"); |
236 | else | 238 | else |
237 | X509_print(out,x->peer); | 239 | X509_print(out,peer); |
238 | } | 240 | } |
239 | } | 241 | } |
240 | 242 | ||
@@ -253,12 +255,12 @@ bad: | |||
253 | goto end; | 255 | goto end; |
254 | } | 256 | } |
255 | } | 257 | } |
256 | else if (!noout && (x->peer != NULL)) /* just print the certificate */ | 258 | else if (!noout && (peer != NULL)) /* just print the certificate */ |
257 | { | 259 | { |
258 | if (outformat == FORMAT_ASN1) | 260 | if (outformat == FORMAT_ASN1) |
259 | i=(int)i2d_X509_bio(out,x->peer); | 261 | i=(int)i2d_X509_bio(out,peer); |
260 | else if (outformat == FORMAT_PEM) | 262 | else if (outformat == FORMAT_PEM) |
261 | i=PEM_write_bio_X509(out,x->peer); | 263 | i=PEM_write_bio_X509(out,peer); |
262 | else { | 264 | else { |
263 | BIO_printf(bio_err,"bad output format specified for outfile\n"); | 265 | BIO_printf(bio_err,"bad output format specified for outfile\n"); |
264 | goto end; | 266 | goto end; |
diff --git a/src/lib/libssl/src/apps/speed.c b/src/lib/libssl/src/apps/speed.c index 65f85fecf7..8358b12fdd 100644 --- a/src/lib/libssl/src/apps/speed.c +++ b/src/lib/libssl/src/apps/speed.c | |||
@@ -108,8 +108,14 @@ | |||
108 | #include <signal.h> | 108 | #include <signal.h> |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | #ifdef _WIN32 | 111 | #if defined(_WIN32) || defined(__CYGWIN__) |
112 | #include <windows.h> | 112 | #include <windows.h> |
113 | # if defined(__CYGWIN__) && !defined(_WIN32) | ||
114 | /* <windows.h> should define _WIN32, which normally is mutually | ||
115 | * exclusive with __CYGWIN__, but if it didn't... */ | ||
116 | # define _WIN32 | ||
117 | /* this is done because Cygwin alarm() fails sometimes. */ | ||
118 | # endif | ||
113 | #endif | 119 | #endif |
114 | 120 | ||
115 | #include <openssl/bn.h> | 121 | #include <openssl/bn.h> |
@@ -183,6 +189,25 @@ | |||
183 | #ifndef OPENSSL_NO_ECDH | 189 | #ifndef OPENSSL_NO_ECDH |
184 | #include <openssl/ecdh.h> | 190 | #include <openssl/ecdh.h> |
185 | #endif | 191 | #endif |
192 | #include <openssl/modes.h> | ||
193 | |||
194 | #ifdef OPENSSL_FIPS | ||
195 | #ifdef OPENSSL_DOING_MAKEDEPEND | ||
196 | #undef AES_set_encrypt_key | ||
197 | #undef AES_set_decrypt_key | ||
198 | #undef DES_set_key_unchecked | ||
199 | #endif | ||
200 | #define BF_set_key private_BF_set_key | ||
201 | #define CAST_set_key private_CAST_set_key | ||
202 | #define idea_set_encrypt_key private_idea_set_encrypt_key | ||
203 | #define SEED_set_key private_SEED_set_key | ||
204 | #define RC2_set_key private_RC2_set_key | ||
205 | #define RC4_set_key private_RC4_set_key | ||
206 | #define DES_set_key_unchecked private_DES_set_key_unchecked | ||
207 | #define AES_set_encrypt_key private_AES_set_encrypt_key | ||
208 | #define AES_set_decrypt_key private_AES_set_decrypt_key | ||
209 | #define Camellia_set_key private_Camellia_set_key | ||
210 | #endif | ||
186 | 211 | ||
187 | #ifndef HAVE_FORK | 212 | #ifndef HAVE_FORK |
188 | # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE) | 213 | # if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MACINTOSH_CLASSIC) || defined(OPENSSL_SYS_OS2) || defined(OPENSSL_SYS_NETWARE) |
@@ -214,7 +239,7 @@ static void print_result(int alg,int run_no,int count,double time_used); | |||
214 | static int do_multi(int multi); | 239 | static int do_multi(int multi); |
215 | #endif | 240 | #endif |
216 | 241 | ||
217 | #define ALGOR_NUM 29 | 242 | #define ALGOR_NUM 30 |
218 | #define SIZE_NUM 5 | 243 | #define SIZE_NUM 5 |
219 | #define RSA_NUM 4 | 244 | #define RSA_NUM 4 |
220 | #define DSA_NUM 3 | 245 | #define DSA_NUM 3 |
@@ -229,7 +254,7 @@ static const char *names[ALGOR_NUM]={ | |||
229 | "aes-128 cbc","aes-192 cbc","aes-256 cbc", | 254 | "aes-128 cbc","aes-192 cbc","aes-256 cbc", |
230 | "camellia-128 cbc","camellia-192 cbc","camellia-256 cbc", | 255 | "camellia-128 cbc","camellia-192 cbc","camellia-256 cbc", |
231 | "evp","sha256","sha512","whirlpool", | 256 | "evp","sha256","sha512","whirlpool", |
232 | "aes-128 ige","aes-192 ige","aes-256 ige"}; | 257 | "aes-128 ige","aes-192 ige","aes-256 ige","ghash"}; |
233 | static double results[ALGOR_NUM][SIZE_NUM]; | 258 | static double results[ALGOR_NUM][SIZE_NUM]; |
234 | static int lengths[SIZE_NUM]={16,64,256,1024,8*1024}; | 259 | static int lengths[SIZE_NUM]={16,64,256,1024,8*1024}; |
235 | #ifndef OPENSSL_NO_RSA | 260 | #ifndef OPENSSL_NO_RSA |
@@ -273,9 +298,12 @@ static SIGRETTYPE sig_done(int sig) | |||
273 | 298 | ||
274 | #if defined(_WIN32) | 299 | #if defined(_WIN32) |
275 | 300 | ||
301 | #if !defined(SIGALRM) | ||
276 | #define SIGALRM | 302 | #define SIGALRM |
303 | #endif | ||
277 | static unsigned int lapse,schlock; | 304 | static unsigned int lapse,schlock; |
278 | static void alarm(unsigned int secs) { lapse = secs*1000; } | 305 | static void alarm_win32(unsigned int secs) { lapse = secs*1000; } |
306 | #define alarm alarm_win32 | ||
279 | 307 | ||
280 | static DWORD WINAPI sleepy(VOID *arg) | 308 | static DWORD WINAPI sleepy(VOID *arg) |
281 | { | 309 | { |
@@ -469,6 +497,7 @@ int MAIN(int argc, char **argv) | |||
469 | #define D_IGE_128_AES 26 | 497 | #define D_IGE_128_AES 26 |
470 | #define D_IGE_192_AES 27 | 498 | #define D_IGE_192_AES 27 |
471 | #define D_IGE_256_AES 28 | 499 | #define D_IGE_256_AES 28 |
500 | #define D_GHASH 29 | ||
472 | double d=0.0; | 501 | double d=0.0; |
473 | long c[ALGOR_NUM][SIZE_NUM]; | 502 | long c[ALGOR_NUM][SIZE_NUM]; |
474 | #define R_DSA_512 0 | 503 | #define R_DSA_512 0 |
@@ -894,6 +923,10 @@ int MAIN(int argc, char **argv) | |||
894 | doit[D_CBC_192_AES]=1; | 923 | doit[D_CBC_192_AES]=1; |
895 | doit[D_CBC_256_AES]=1; | 924 | doit[D_CBC_256_AES]=1; |
896 | } | 925 | } |
926 | else if (strcmp(*argv,"ghash") == 0) | ||
927 | { | ||
928 | doit[D_GHASH]=1; | ||
929 | } | ||
897 | else | 930 | else |
898 | #endif | 931 | #endif |
899 | #ifndef OPENSSL_NO_CAMELLIA | 932 | #ifndef OPENSSL_NO_CAMELLIA |
@@ -1264,6 +1297,7 @@ int MAIN(int argc, char **argv) | |||
1264 | c[D_IGE_128_AES][0]=count; | 1297 | c[D_IGE_128_AES][0]=count; |
1265 | c[D_IGE_192_AES][0]=count; | 1298 | c[D_IGE_192_AES][0]=count; |
1266 | c[D_IGE_256_AES][0]=count; | 1299 | c[D_IGE_256_AES][0]=count; |
1300 | c[D_GHASH][0]=count; | ||
1267 | 1301 | ||
1268 | for (i=1; i<SIZE_NUM; i++) | 1302 | for (i=1; i<SIZE_NUM; i++) |
1269 | { | 1303 | { |
@@ -1458,7 +1492,7 @@ int MAIN(int argc, char **argv) | |||
1458 | # error "You cannot disable DES on systems without SIGALRM." | 1492 | # error "You cannot disable DES on systems without SIGALRM." |
1459 | #endif /* OPENSSL_NO_DES */ | 1493 | #endif /* OPENSSL_NO_DES */ |
1460 | #else | 1494 | #else |
1461 | #define COND(c) (run) | 1495 | #define COND(c) (run && count<0x7fffffff) |
1462 | #define COUNT(d) (count) | 1496 | #define COUNT(d) (count) |
1463 | #ifndef _WIN32 | 1497 | #ifndef _WIN32 |
1464 | signal(SIGALRM,sig_done); | 1498 | signal(SIGALRM,sig_done); |
@@ -1754,7 +1788,22 @@ int MAIN(int argc, char **argv) | |||
1754 | print_result(D_IGE_256_AES,j,count,d); | 1788 | print_result(D_IGE_256_AES,j,count,d); |
1755 | } | 1789 | } |
1756 | } | 1790 | } |
1791 | if (doit[D_GHASH]) | ||
1792 | { | ||
1793 | GCM128_CONTEXT *ctx = CRYPTO_gcm128_new(&aes_ks1,(block128_f)AES_encrypt); | ||
1794 | CRYPTO_gcm128_setiv (ctx,(unsigned char *)"0123456789ab",12); | ||
1757 | 1795 | ||
1796 | for (j=0; j<SIZE_NUM; j++) | ||
1797 | { | ||
1798 | print_message(names[D_GHASH],c[D_GHASH][j],lengths[j]); | ||
1799 | Time_F(START); | ||
1800 | for (count=0,run=1; COND(c[D_GHASH][j]); count++) | ||
1801 | CRYPTO_gcm128_aad(ctx,buf,lengths[j]); | ||
1802 | d=Time_F(STOP); | ||
1803 | print_result(D_GHASH,j,count,d); | ||
1804 | } | ||
1805 | CRYPTO_gcm128_release(ctx); | ||
1806 | } | ||
1758 | 1807 | ||
1759 | #endif | 1808 | #endif |
1760 | #ifndef OPENSSL_NO_CAMELLIA | 1809 | #ifndef OPENSSL_NO_CAMELLIA |
@@ -2548,7 +2597,7 @@ static void pkey_print_message(const char *str, const char *str2, long num, | |||
2548 | BIO_printf(bio_err,mr ? "+DTP:%d:%s:%s:%d\n" | 2597 | BIO_printf(bio_err,mr ? "+DTP:%d:%s:%s:%d\n" |
2549 | : "Doing %d bit %s %s's for %ds: ",bits,str,str2,tm); | 2598 | : "Doing %d bit %s %s's for %ds: ",bits,str,str2,tm); |
2550 | (void)BIO_flush(bio_err); | 2599 | (void)BIO_flush(bio_err); |
2551 | alarm(RSA_SECONDS); | 2600 | alarm(tm); |
2552 | #else | 2601 | #else |
2553 | BIO_printf(bio_err,mr ? "+DNP:%ld:%d:%s:%s\n" | 2602 | BIO_printf(bio_err,mr ? "+DNP:%ld:%d:%s:%s\n" |
2554 | : "Doing %ld %d bit %s %s's: ",num,bits,str,str2); | 2603 | : "Doing %ld %d bit %s %s's: ",num,bits,str,str2); |
@@ -2608,7 +2657,11 @@ static int do_multi(int multi) | |||
2608 | fds=malloc(multi*sizeof *fds); | 2657 | fds=malloc(multi*sizeof *fds); |
2609 | for(n=0 ; n < multi ; ++n) | 2658 | for(n=0 ; n < multi ; ++n) |
2610 | { | 2659 | { |
2611 | pipe(fd); | 2660 | if (pipe(fd) == -1) |
2661 | { | ||
2662 | fprintf(stderr, "pipe failure\n"); | ||
2663 | exit(1); | ||
2664 | } | ||
2612 | fflush(stdout); | 2665 | fflush(stdout); |
2613 | fflush(stderr); | 2666 | fflush(stderr); |
2614 | if(fork()) | 2667 | if(fork()) |
@@ -2620,7 +2673,11 @@ static int do_multi(int multi) | |||
2620 | { | 2673 | { |
2621 | close(fd[0]); | 2674 | close(fd[0]); |
2622 | close(1); | 2675 | close(1); |
2623 | dup(fd[1]); | 2676 | if (dup(fd[1]) == -1) |
2677 | { | ||
2678 | fprintf(stderr, "dup failed\n"); | ||
2679 | exit(1); | ||
2680 | } | ||
2624 | close(fd[1]); | 2681 | close(fd[1]); |
2625 | mr=1; | 2682 | mr=1; |
2626 | usertime=0; | 2683 | usertime=0; |
diff --git a/src/lib/libssl/src/apps/verify.c b/src/lib/libssl/src/apps/verify.c index 9163997e93..b9749dcd36 100644 --- a/src/lib/libssl/src/apps/verify.c +++ b/src/lib/libssl/src/apps/verify.c | |||
@@ -230,6 +230,7 @@ int MAIN(int argc, char **argv) | |||
230 | end: | 230 | end: |
231 | if (ret == 1) { | 231 | if (ret == 1) { |
232 | BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); | 232 | BIO_printf(bio_err,"usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); |
233 | BIO_printf(bio_err," [-attime timestamp]"); | ||
233 | #ifndef OPENSSL_NO_ENGINE | 234 | #ifndef OPENSSL_NO_ENGINE |
234 | BIO_printf(bio_err," [-engine e]"); | 235 | BIO_printf(bio_err," [-engine e]"); |
235 | #endif | 236 | #endif |
diff --git a/src/lib/libssl/src/apps/x509.c b/src/lib/libssl/src/apps/x509.c index 9f5eaeb6be..e6e5e0d4e5 100644 --- a/src/lib/libssl/src/apps/x509.c +++ b/src/lib/libssl/src/apps/x509.c | |||
@@ -157,9 +157,10 @@ static int MS_CALLBACK callb(int ok, X509_STORE_CTX *ctx); | |||
157 | static int sign (X509 *x, EVP_PKEY *pkey,int days,int clrext, const EVP_MD *digest, | 157 | static int sign (X509 *x, EVP_PKEY *pkey,int days,int clrext, const EVP_MD *digest, |
158 | CONF *conf, char *section); | 158 | CONF *conf, char *section); |
159 | static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest, | 159 | static int x509_certify (X509_STORE *ctx,char *CAfile,const EVP_MD *digest, |
160 | X509 *x,X509 *xca,EVP_PKEY *pkey,char *serial, | 160 | X509 *x,X509 *xca,EVP_PKEY *pkey, |
161 | int create,int days, int clrext, CONF *conf, char *section, | 161 | STACK_OF(OPENSSL_STRING) *sigopts, |
162 | ASN1_INTEGER *sno); | 162 | char *serial, int create ,int days, int clrext, |
163 | CONF *conf, char *section, ASN1_INTEGER *sno); | ||
163 | static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt); | 164 | static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt); |
164 | static int reqfile=0; | 165 | static int reqfile=0; |
165 | 166 | ||
@@ -172,6 +173,7 @@ int MAIN(int argc, char **argv) | |||
172 | X509_REQ *req=NULL; | 173 | X509_REQ *req=NULL; |
173 | X509 *x=NULL,*xca=NULL; | 174 | X509 *x=NULL,*xca=NULL; |
174 | ASN1_OBJECT *objtmp; | 175 | ASN1_OBJECT *objtmp; |
176 | STACK_OF(OPENSSL_STRING) *sigopts = NULL; | ||
175 | EVP_PKEY *Upkey=NULL,*CApkey=NULL; | 177 | EVP_PKEY *Upkey=NULL,*CApkey=NULL; |
176 | ASN1_INTEGER *sno = NULL; | 178 | ASN1_INTEGER *sno = NULL; |
177 | int i,num,badops=0; | 179 | int i,num,badops=0; |
@@ -271,6 +273,15 @@ int MAIN(int argc, char **argv) | |||
271 | if (--argc < 1) goto bad; | 273 | if (--argc < 1) goto bad; |
272 | CAkeyformat=str2fmt(*(++argv)); | 274 | CAkeyformat=str2fmt(*(++argv)); |
273 | } | 275 | } |
276 | else if (strcmp(*argv,"-sigopt") == 0) | ||
277 | { | ||
278 | if (--argc < 1) | ||
279 | goto bad; | ||
280 | if (!sigopts) | ||
281 | sigopts = sk_OPENSSL_STRING_new_null(); | ||
282 | if (!sigopts || !sk_OPENSSL_STRING_push(sigopts, *(++argv))) | ||
283 | goto bad; | ||
284 | } | ||
274 | else if (strcmp(*argv,"-days") == 0) | 285 | else if (strcmp(*argv,"-days") == 0) |
275 | { | 286 | { |
276 | if (--argc < 1) goto bad; | 287 | if (--argc < 1) goto bad; |
@@ -970,7 +981,8 @@ bad: | |||
970 | 981 | ||
971 | assert(need_rand); | 982 | assert(need_rand); |
972 | if (!x509_certify(ctx,CAfile,digest,x,xca, | 983 | if (!x509_certify(ctx,CAfile,digest,x,xca, |
973 | CApkey, CAserial,CA_createserial,days, clrext, | 984 | CApkey, sigopts, |
985 | CAserial,CA_createserial,days, clrext, | ||
974 | extconf, extsect, sno)) | 986 | extconf, extsect, sno)) |
975 | goto end; | 987 | goto end; |
976 | } | 988 | } |
@@ -1081,6 +1093,8 @@ end: | |||
1081 | X509_free(xca); | 1093 | X509_free(xca); |
1082 | EVP_PKEY_free(Upkey); | 1094 | EVP_PKEY_free(Upkey); |
1083 | EVP_PKEY_free(CApkey); | 1095 | EVP_PKEY_free(CApkey); |
1096 | if (sigopts) | ||
1097 | sk_OPENSSL_STRING_free(sigopts); | ||
1084 | X509_REQ_free(rq); | 1098 | X509_REQ_free(rq); |
1085 | ASN1_INTEGER_free(sno); | 1099 | ASN1_INTEGER_free(sno); |
1086 | sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free); | 1100 | sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free); |
@@ -1131,8 +1145,11 @@ static ASN1_INTEGER *x509_load_serial(char *CAfile, char *serialfile, int create | |||
1131 | } | 1145 | } |
1132 | 1146 | ||
1133 | static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, | 1147 | static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, |
1134 | X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create, | 1148 | X509 *x, X509 *xca, EVP_PKEY *pkey, |
1135 | int days, int clrext, CONF *conf, char *section, ASN1_INTEGER *sno) | 1149 | STACK_OF(OPENSSL_STRING) *sigopts, |
1150 | char *serialfile, int create, | ||
1151 | int days, int clrext, CONF *conf, char *section, | ||
1152 | ASN1_INTEGER *sno) | ||
1136 | { | 1153 | { |
1137 | int ret=0; | 1154 | int ret=0; |
1138 | ASN1_INTEGER *bs=NULL; | 1155 | ASN1_INTEGER *bs=NULL; |
@@ -1191,7 +1208,8 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, | |||
1191 | if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x)) goto end; | 1208 | if (!X509V3_EXT_add_nconf(conf, &ctx2, section, x)) goto end; |
1192 | } | 1209 | } |
1193 | 1210 | ||
1194 | if (!X509_sign(x,pkey,digest)) goto end; | 1211 | if (!do_X509_sign(bio_err, x, pkey, digest, sigopts)) |
1212 | goto end; | ||
1195 | ret=1; | 1213 | ret=1; |
1196 | end: | 1214 | end: |
1197 | X509_STORE_CTX_cleanup(&xsc); | 1215 | X509_STORE_CTX_cleanup(&xsc); |
diff --git a/src/lib/libssl/src/config b/src/lib/libssl/src/config index cf64ec563e..88b9bc69da 100644 --- a/src/lib/libssl/src/config +++ b/src/lib/libssl/src/config | |||
@@ -370,6 +370,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in | |||
370 | NONSTOP_KERNEL*) | 370 | NONSTOP_KERNEL*) |
371 | echo "nsr-tandem-nsk"; exit 0; | 371 | echo "nsr-tandem-nsk"; exit 0; |
372 | ;; | 372 | ;; |
373 | |||
374 | vxworks*) | ||
375 | echo "${MACHINE}-whatever-vxworks"; exit 0; | ||
376 | ;; | ||
373 | esac | 377 | esac |
374 | 378 | ||
375 | # | 379 | # |
@@ -407,23 +411,18 @@ exit 0 | |||
407 | # this is where the translation occurs into SSLeay terms | 411 | # this is where the translation occurs into SSLeay terms |
408 | # --------------------------------------------------------------------------- | 412 | # --------------------------------------------------------------------------- |
409 | 413 | ||
410 | GCCVER=`(gcc -dumpversion) 2>/dev/null` | ||
411 | if [ "$GCCVER" != "" ]; then | ||
412 | # then strip off whatever prefix egcs prepends the number with... | ||
413 | # Hopefully, this will work for any future prefixes as well. | ||
414 | GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'` | ||
415 | # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion | ||
416 | # does give us what we want though, so we use that. We just just the | ||
417 | # major and minor version numbers. | ||
418 | # peak single digit before and after first dot, e.g. 2.95.1 gives 29 | ||
419 | GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` | ||
420 | fi | ||
421 | |||
422 | # Only set CC if not supplied already | 414 | # Only set CC if not supplied already |
423 | if [ -z "$CC" ]; then | 415 | if [ -z "$CROSS_COMPILE$CC" ]; then |
424 | # figure out if gcc is available and if so we use it otherwise | 416 | GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null` |
425 | # we fallback to whatever cc does on the system | ||
426 | if [ "$GCCVER" != "" ]; then | 417 | if [ "$GCCVER" != "" ]; then |
418 | # then strip off whatever prefix egcs prepends the number with... | ||
419 | # Hopefully, this will work for any future prefixes as well. | ||
420 | GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'` | ||
421 | # Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion | ||
422 | # does give us what we want though, so we use that. We just just the | ||
423 | # major and minor version numbers. | ||
424 | # peak single digit before and after first dot, e.g. 2.95.1 gives 29 | ||
425 | GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` | ||
427 | CC=gcc | 426 | CC=gcc |
428 | else | 427 | else |
429 | CC=cc | 428 | CC=cc |
@@ -539,7 +538,7 @@ case "$GUESSOS" in | |||
539 | ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; | 538 | ppc-apple-rhapsody) OUT="rhapsody-ppc-cc" ;; |
540 | ppc-apple-darwin*) | 539 | ppc-apple-darwin*) |
541 | ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null` | 540 | ISA64=`(sysctl -n hw.optional.64bitops) 2>/dev/null` |
542 | if [ "$ISA64" = "1" ]; then | 541 | if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then |
543 | echo "WARNING! If you wish to build 64-bit library, then you have to" | 542 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
544 | echo " invoke './Configure darwin64-ppc-cc' *manually*." | 543 | echo " invoke './Configure darwin64-ppc-cc' *manually*." |
545 | if [ "$TEST" = "false" -a -t 1 ]; then | 544 | if [ "$TEST" = "false" -a -t 1 ]; then |
@@ -547,10 +546,14 @@ case "$GUESSOS" in | |||
547 | (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 | 546 | (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
548 | fi | 547 | fi |
549 | fi | 548 | fi |
550 | OUT="darwin-ppc-cc" ;; | 549 | if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then |
550 | OUT="darwin64-ppc-cc" | ||
551 | else | ||
552 | OUT="darwin-ppc-cc" | ||
553 | fi ;; | ||
551 | i?86-apple-darwin*) | 554 | i?86-apple-darwin*) |
552 | ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null` | 555 | ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null` |
553 | if [ "$ISA64" = "1" ]; then | 556 | if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then |
554 | echo "WARNING! If you wish to build 64-bit library, then you have to" | 557 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
555 | echo " invoke './Configure darwin64-x86_64-cc' *manually*." | 558 | echo " invoke './Configure darwin64-x86_64-cc' *manually*." |
556 | if [ "$TEST" = "false" -a -t 1 ]; then | 559 | if [ "$TEST" = "false" -a -t 1 ]; then |
@@ -558,7 +561,17 @@ case "$GUESSOS" in | |||
558 | (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 | 561 | (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 |
559 | fi | 562 | fi |
560 | fi | 563 | fi |
561 | OUT="darwin-i386-cc" ;; | 564 | if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then |
565 | OUT="darwin64-x86_64-cc" | ||
566 | else | ||
567 | OUT="darwin-i386-cc" | ||
568 | fi ;; | ||
569 | armv6+7-*-iphoneos) | ||
570 | options="$options -arch%20armv6 -arch%20armv7" | ||
571 | OUT="iphoneos-cross" ;; | ||
572 | *-*-iphoneos) | ||
573 | options="$options -arch%20${MACHINE}" | ||
574 | OUT="iphoneos-cross" ;; | ||
562 | alpha-*-linux2) | 575 | alpha-*-linux2) |
563 | ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo` | 576 | ISA=`awk '/cpu model/{print$4;exit(0);}' /proc/cpuinfo` |
564 | case ${ISA:-generic} in | 577 | case ${ISA:-generic} in |
@@ -583,6 +596,11 @@ case "$GUESSOS" in | |||
583 | OUT="linux-ppc" | 596 | OUT="linux-ppc" |
584 | ;; | 597 | ;; |
585 | ppc-*-linux2) OUT="linux-ppc" ;; | 598 | ppc-*-linux2) OUT="linux-ppc" ;; |
599 | ppc60x-*-vxworks*) OUT="vxworks-ppc60x" ;; | ||
600 | ppcgen-*-vxworks*) OUT="vxworks-ppcgen" ;; | ||
601 | pentium-*-vxworks*) OUT="vxworks-pentium" ;; | ||
602 | simlinux-*-vxworks*) OUT="vxworks-simlinux" ;; | ||
603 | mips-*-vxworks*) OUT="vxworks-mips";; | ||
586 | ia64-*-linux?) OUT="linux-ia64" ;; | 604 | ia64-*-linux?) OUT="linux-ia64" ;; |
587 | sparc64-*-linux2) | 605 | sparc64-*-linux2) |
588 | echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI" | 606 | echo "WARNING! If you *know* that your GNU C supports 64-bit/V9 ABI" |
@@ -624,12 +642,24 @@ case "$GUESSOS" in | |||
624 | options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH" | 642 | options="$options -DB_ENDIAN -mschedule=$CPUSCHEDULE -march=$CPUARCH" |
625 | OUT="linux-generic32" ;; | 643 | OUT="linux-generic32" ;; |
626 | armv[1-3]*-*-linux2) OUT="linux-generic32" ;; | 644 | armv[1-3]*-*-linux2) OUT="linux-generic32" ;; |
645 | armv[7-9]*-*-linux2) OUT="linux-armv4"; options="$options -march=armv7-a" ;; | ||
627 | arm*-*-linux2) OUT="linux-armv4" ;; | 646 | arm*-*-linux2) OUT="linux-armv4" ;; |
628 | sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; | 647 | sh*b-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; |
629 | sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;; | 648 | sh*-*-linux2) OUT="linux-generic32"; options="$options -DL_ENDIAN" ;; |
630 | m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; | 649 | m68k*-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; |
631 | s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; | 650 | s390-*-linux2) OUT="linux-generic32"; options="$options -DB_ENDIAN" ;; |
632 | s390x-*-linux2) OUT="linux-s390x" ;; | 651 | s390x-*-linux2) |
652 | # To be uncommented when glibc bug is fixed, see Configure... | ||
653 | #if egrep -e '^features.* highgprs' /proc/cpuinfo >/dev/null ; then | ||
654 | # echo "WARNING! If you wish to build \"highgprs\" 32-bit library, then you" | ||
655 | # echo " have to invoke './Configure linux32-s390x' *manually*." | ||
656 | # if [ "$TEST" = "false" -a -t -1 ]; then | ||
657 | # echo " You have about 5 seconds to press Ctrl-C to abort." | ||
658 | # (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 | ||
659 | # fi | ||
660 | #fi | ||
661 | OUT="linux64-s390x" | ||
662 | ;; | ||
633 | x86_64-*-linux?) OUT="linux-x86_64" ;; | 663 | x86_64-*-linux?) OUT="linux-x86_64" ;; |
634 | *86-*-linux2) OUT="linux-elf" | 664 | *86-*-linux2) OUT="linux-elf" |
635 | if [ "$GCCVER" -gt 28 ]; then | 665 | if [ "$GCCVER" -gt 28 ]; then |
@@ -648,7 +678,7 @@ case "$GUESSOS" in | |||
648 | sun4[uv]*-*-solaris2) | 678 | sun4[uv]*-*-solaris2) |
649 | OUT="solaris-sparcv9-$CC" | 679 | OUT="solaris-sparcv9-$CC" |
650 | ISA64=`(isalist) 2>/dev/null | grep sparcv9` | 680 | ISA64=`(isalist) 2>/dev/null | grep sparcv9` |
651 | if [ "$ISA64" != "" ]; then | 681 | if [ "$ISA64" != "" -a "$KERNEL_BITS" = "" ]; then |
652 | if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then | 682 | if [ "$CC" = "cc" -a $CCVER -ge 50 ]; then |
653 | echo "WARNING! If you wish to build 64-bit library, then you have to" | 683 | echo "WARNING! If you wish to build 64-bit library, then you have to" |
654 | echo " invoke './Configure solaris64-sparcv9-cc' *manually*." | 684 | echo " invoke './Configure solaris64-sparcv9-cc' *manually*." |
@@ -678,13 +708,16 @@ case "$GUESSOS" in | |||
678 | fi | 708 | fi |
679 | fi | 709 | fi |
680 | fi | 710 | fi |
711 | if [ "$ISA64" != "" -a "$KERNEL_BITS" = "64" ]; then | ||
712 | OUT="solaris64-sparcv9-$CC" | ||
713 | fi | ||
681 | ;; | 714 | ;; |
682 | sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; | 715 | sun4m-*-solaris2) OUT="solaris-sparcv8-$CC" ;; |
683 | sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;; | 716 | sun4d-*-solaris2) OUT="solaris-sparcv8-$CC" ;; |
684 | sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;; | 717 | sun4*-*-solaris2) OUT="solaris-sparcv7-$CC" ;; |
685 | *86*-*-solaris2) | 718 | *86*-*-solaris2) |
686 | ISA64=`(isalist) 2>/dev/null | grep amd64` | 719 | ISA64=`(isalist) 2>/dev/null | grep amd64` |
687 | if [ "$ISA64" != "" ]; then | 720 | if [ "$ISA64" != "" -a ${KERNEL_BITS:-64} -eq 64 ]; then |
688 | OUT="solaris64-x86_64-$CC" | 721 | OUT="solaris64-x86_64-$CC" |
689 | else | 722 | else |
690 | OUT="solaris-x86-$CC" | 723 | OUT="solaris-x86-$CC" |
@@ -736,20 +769,17 @@ case "$GUESSOS" in | |||
736 | if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then | 769 | if [ $CC = "gcc" -a $GCC_BITS = "64" ]; then |
737 | OUT="hpux64-parisc2-gcc" | 770 | OUT="hpux64-parisc2-gcc" |
738 | fi | 771 | fi |
739 | KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null` | 772 | [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITS) 2>/dev/null` |
740 | KERNEL_BITS=${KERNEL_BITS:-32} | 773 | KERNEL_BITS=${KERNEL_BITS:-32} |
741 | CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null` | 774 | CPU_VERSION=`(getconf CPU_VERSION) 2>/dev/null` |
742 | CPU_VERSION=${CPU_VERSION:-0} | 775 | CPU_VERSION=${CPU_VERSION:-0} |
743 | # See <sys/unistd.h> for further info on CPU_VERSION. | 776 | # See <sys/unistd.h> for further info on CPU_VERSION. |
744 | if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU | 777 | if [ $CPU_VERSION -ge 768 ]; then # IA-64 CPU |
745 | echo "WARNING! 64-bit ABI is the default configured ABI on HP-UXi." | 778 | if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then |
746 | echo " If you wish to build 32-bit library, the you have to" | 779 | OUT="hpux64-ia64-cc" |
747 | echo " invoke './Configure hpux-ia64-cc' *manually*." | 780 | else |
748 | if [ "$TEST" = "false" -a -t 1 ]; then | 781 | OUT="hpux-ia64-cc" |
749 | echo " You have about 5 seconds to press Ctrl-C to abort." | 782 | fi |
750 | (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 | ||
751 | fi | ||
752 | OUT="hpux64-ia64-cc" | ||
753 | elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU | 783 | elif [ $CPU_VERSION -ge 532 ]; then # PA-RISC 2.x CPU |
754 | OUT=${OUT:-"hpux-parisc2-${CC}"} | 784 | OUT=${OUT:-"hpux-parisc2-${CC}"} |
755 | if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then | 785 | if [ $KERNEL_BITS -eq 64 -a "$CC" = "cc" ]; then |
@@ -770,7 +800,7 @@ case "$GUESSOS" in | |||
770 | options="$options -D_REENTRANT" ;; | 800 | options="$options -D_REENTRANT" ;; |
771 | *-hpux) OUT="hpux-parisc-$CC" ;; | 801 | *-hpux) OUT="hpux-parisc-$CC" ;; |
772 | *-aix) | 802 | *-aix) |
773 | KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null` | 803 | [ "$KERNEL_BITS" ] || KERNEL_BITS=`(getconf KERNEL_BITMODE) 2>/dev/null` |
774 | KERNEL_BITS=${KERNEL_BITS:-32} | 804 | KERNEL_BITS=${KERNEL_BITS:-32} |
775 | OBJECT_MODE=${OBJECT_MODE:-32} | 805 | OBJECT_MODE=${OBJECT_MODE:-32} |
776 | if [ "$CC" = "gcc" ]; then | 806 | if [ "$CC" = "gcc" ]; then |
@@ -810,6 +840,8 @@ case "$GUESSOS" in | |||
810 | beos-*) OUT="$GUESSOS" ;; | 840 | beos-*) OUT="$GUESSOS" ;; |
811 | x86pc-*-qnx6) OUT="QNX6-i386" ;; | 841 | x86pc-*-qnx6) OUT="QNX6-i386" ;; |
812 | *-*-qnx6) OUT="QNX6" ;; | 842 | *-*-qnx6) OUT="QNX6" ;; |
843 | x86-*-android|i?86-*-android) OUT="android-x86" ;; | ||
844 | armv[7-9]*-*-android) OUT="android-armv7" ;; | ||
813 | *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; | 845 | *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;; |
814 | esac | 846 | esac |
815 | 847 | ||
@@ -825,9 +857,11 @@ esac | |||
825 | # options="$options -DATALLA" | 857 | # options="$options -DATALLA" |
826 | #fi | 858 | #fi |
827 | 859 | ||
828 | ($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \ | 860 | if expr "$options" : '.*no\-asm' > /dev/null; then :; else |
829 | grep \\--noexecstack) 2>&1 > /dev/null && \ | 861 | sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \ |
862 | grep \\--noexecstack >/dev/null && \ | ||
830 | options="$options -Wa,--noexecstack" | 863 | options="$options -Wa,--noexecstack" |
864 | fi | ||
831 | 865 | ||
832 | # gcc < 2.8 does not support -march=ultrasparc | 866 | # gcc < 2.8 does not support -march=ultrasparc |
833 | if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] | 867 | if [ "$OUT" = solaris-sparcv9-gcc -a $GCCVER -lt 28 ] |
diff --git a/src/lib/libssl/src/crypto/Makefile b/src/lib/libssl/src/crypto/Makefile index 85d9f249c5..947dd5d44e 100644 --- a/src/lib/libssl/src/crypto/Makefile +++ b/src/lib/libssl/src/crypto/Makefile | |||
@@ -7,7 +7,7 @@ TOP= .. | |||
7 | CC= cc | 7 | CC= cc |
8 | INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE) | 8 | INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE) |
9 | # INCLUDES targets sudbirs! | 9 | # INCLUDES targets sudbirs! |
10 | INCLUDES= -I.. -I../.. -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE) | 10 | INCLUDES= -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE) |
11 | CFLAG= -g | 11 | CFLAG= -g |
12 | MAKEDEPPROG= makedepend | 12 | MAKEDEPPROG= makedepend |
13 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | 13 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) |
@@ -34,8 +34,10 @@ GENERAL=Makefile README crypto-lib.com install.com | |||
34 | 34 | ||
35 | LIB= $(TOP)/libcrypto.a | 35 | LIB= $(TOP)/libcrypto.a |
36 | SHARED_LIB= libcrypto$(SHLIB_EXT) | 36 | SHARED_LIB= libcrypto$(SHLIB_EXT) |
37 | LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c | 37 | LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ |
38 | LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ) | 38 | ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c |
39 | LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \ | ||
40 | uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ) | ||
39 | 41 | ||
40 | SRC= $(LIBSRC) | 42 | SRC= $(LIBSRC) |
41 | 43 | ||
@@ -67,14 +69,13 @@ applink.o: $(TOP)/ms/applink.c | |||
67 | uplink.o: $(TOP)/ms/uplink.c applink.o | 69 | uplink.o: $(TOP)/ms/uplink.c applink.o |
68 | $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c | 70 | $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c |
69 | 71 | ||
70 | uplink-cof.s: $(TOP)/ms/uplink.pl | 72 | uplink-x86.s: $(TOP)/ms/uplink-x86.pl |
71 | $(PERL) $(TOP)/ms/uplink.pl coff > $@ | 73 | $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@ |
72 | 74 | ||
73 | x86_64cpuid.s: x86_64cpuid.pl | 75 | x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ |
74 | $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ | 76 | ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@ |
75 | ia64cpuid.s: ia64cpuid.S | ||
76 | $(CC) $(CFLAGS) -E ia64cpuid.S > $@ | ||
77 | ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ | 77 | ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ |
78 | pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@ | ||
78 | alphacpuid.s: alphacpuid.pl | 79 | alphacpuid.s: alphacpuid.pl |
79 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | 80 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null |
80 | 81 | ||
@@ -102,6 +103,7 @@ lib: $(LIB) | |||
102 | @touch lib | 103 | @touch lib |
103 | $(LIB): $(LIBOBJ) | 104 | $(LIB): $(LIBOBJ) |
104 | $(AR) $(LIB) $(LIBOBJ) | 105 | $(AR) $(LIB) $(LIBOBJ) |
106 | [ -z "$(FIPSLIBDIR)" ] || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o | ||
105 | $(RANLIB) $(LIB) || echo Never mind. | 107 | $(RANLIB) $(LIB) || echo Never mind. |
106 | 108 | ||
107 | shared: buildinf.h lib subdirs | 109 | shared: buildinf.h lib subdirs |
@@ -171,6 +173,7 @@ ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | |||
171 | ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | 173 | ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h |
172 | ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | 174 | ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h |
173 | ex_data.o: ex_data.c | 175 | ex_data.o: ex_data.c |
176 | fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c | ||
174 | mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h | 177 | mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h |
175 | mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | 178 | mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h |
176 | mem.o: ../include/openssl/err.h ../include/openssl/lhash.h | 179 | mem.o: ../include/openssl/err.h ../include/openssl/lhash.h |
@@ -191,6 +194,19 @@ mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | |||
191 | mem_dbg.o: mem_dbg.c | 194 | mem_dbg.o: mem_dbg.c |
192 | o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | 195 | o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h |
193 | o_dir.o: LPdir_unix.c o_dir.c o_dir.h | 196 | o_dir.o: LPdir_unix.c o_dir.c o_dir.h |
197 | o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h | ||
198 | o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
199 | o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
200 | o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
201 | o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h | ||
202 | o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h | ||
203 | o_fips.o: o_fips.c | ||
204 | o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h | ||
205 | o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h | ||
206 | o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h | ||
207 | o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
208 | o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h | ||
209 | o_init.o: ../include/openssl/symhacks.h o_init.c | ||
194 | o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h | 210 | o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h |
195 | o_str.o: o_str.c o_str.h | 211 | o_str.o: o_str.c o_str.h |
196 | o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c | 212 | o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c |
diff --git a/src/lib/libssl/src/crypto/aes/Makefile b/src/lib/libssl/src/crypto/aes/Makefile index c501a43a8f..45ede0a0b4 100644 --- a/src/lib/libssl/src/crypto/aes/Makefile +++ b/src/lib/libssl/src/crypto/aes/Makefile | |||
@@ -50,9 +50,21 @@ aes-ia64.s: asm/aes-ia64.S | |||
50 | 50 | ||
51 | aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl | 51 | aes-586.s: asm/aes-586.pl ../perlasm/x86asm.pl |
52 | $(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | 52 | $(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
53 | vpaes-x86.s: asm/vpaes-x86.pl ../perlasm/x86asm.pl | ||
54 | $(PERL) asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | ||
55 | aesni-x86.s: asm/aesni-x86.pl ../perlasm/x86asm.pl | ||
56 | $(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | ||
53 | 57 | ||
54 | aes-x86_64.s: asm/aes-x86_64.pl | 58 | aes-x86_64.s: asm/aes-x86_64.pl |
55 | $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@ | 59 | $(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@ |
60 | vpaes-x86_64.s: asm/vpaes-x86_64.pl | ||
61 | $(PERL) asm/vpaes-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
62 | bsaes-x86_64.s: asm/bsaes-x86_64.pl | ||
63 | $(PERL) asm/bsaes-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
64 | aesni-x86_64.s: asm/aesni-x86_64.pl | ||
65 | $(PERL) asm/aesni-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
66 | aesni-sha1-x86_64.s: asm/aesni-sha1-x86_64.pl | ||
67 | $(PERL) asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
56 | 68 | ||
57 | aes-sparcv9.s: asm/aes-sparcv9.pl | 69 | aes-sparcv9.s: asm/aes-sparcv9.pl |
58 | $(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@ | 70 | $(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@ |
@@ -60,8 +72,15 @@ aes-sparcv9.s: asm/aes-sparcv9.pl | |||
60 | aes-ppc.s: asm/aes-ppc.pl | 72 | aes-ppc.s: asm/aes-ppc.pl |
61 | $(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@ | 73 | $(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@ |
62 | 74 | ||
75 | aes-parisc.s: asm/aes-parisc.pl | ||
76 | $(PERL) asm/aes-parisc.pl $(PERLASM_SCHEME) $@ | ||
77 | |||
78 | aes-mips.S: asm/aes-mips.pl | ||
79 | $(PERL) asm/aes-mips.pl $(PERLASM_SCHEME) $@ | ||
80 | |||
63 | # GNU make "catch all" | 81 | # GNU make "catch all" |
64 | aes-%.s: asm/aes-%.pl; $(PERL) $< $(CFLAGS) > $@ | 82 | aes-%.S: asm/aes-%.pl; $(PERL) $< $(PERLASM_SCHEME) > $@ |
83 | aes-armv4.o: aes-armv4.S | ||
65 | 84 | ||
66 | files: | 85 | files: |
67 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 86 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
@@ -117,9 +136,11 @@ aes_ige.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | |||
117 | aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 136 | aes_ige.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
118 | aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 137 | aes_ige.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
119 | aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h | 138 | aes_ige.o: ../../include/openssl/symhacks.h ../cryptlib.h aes_ige.c aes_locl.h |
120 | aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h | 139 | aes_misc.o: ../../include/openssl/aes.h ../../include/openssl/crypto.h |
121 | aes_misc.o: ../../include/openssl/opensslconf.h | 140 | aes_misc.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
122 | aes_misc.o: ../../include/openssl/opensslv.h aes_locl.h aes_misc.c | 141 | aes_misc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
142 | aes_misc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
143 | aes_misc.o: ../../include/openssl/symhacks.h aes_locl.h aes_misc.c | ||
123 | aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h | 144 | aes_ofb.o: ../../include/openssl/aes.h ../../include/openssl/modes.h |
124 | aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c | 145 | aes_ofb.o: ../../include/openssl/opensslconf.h aes_ofb.c |
125 | aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h | 146 | aes_wrap.o: ../../e_os.h ../../include/openssl/aes.h |
diff --git a/src/lib/libssl/src/crypto/aes/aes.h b/src/lib/libssl/src/crypto/aes/aes.h index d2c99730fe..031abf01b5 100644 --- a/src/lib/libssl/src/crypto/aes/aes.h +++ b/src/lib/libssl/src/crypto/aes/aes.h | |||
@@ -90,6 +90,11 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | |||
90 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | 90 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, |
91 | AES_KEY *key); | 91 | AES_KEY *key); |
92 | 92 | ||
93 | int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, | ||
94 | AES_KEY *key); | ||
95 | int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, | ||
96 | AES_KEY *key); | ||
97 | |||
93 | void AES_encrypt(const unsigned char *in, unsigned char *out, | 98 | void AES_encrypt(const unsigned char *in, unsigned char *out, |
94 | const AES_KEY *key); | 99 | const AES_KEY *key); |
95 | void AES_decrypt(const unsigned char *in, unsigned char *out, | 100 | void AES_decrypt(const unsigned char *in, unsigned char *out, |
diff --git a/src/lib/libssl/src/crypto/aes/aes_core.c b/src/lib/libssl/src/crypto/aes/aes_core.c index a7ec54f4da..8f5210ac70 100644 --- a/src/lib/libssl/src/crypto/aes/aes_core.c +++ b/src/lib/libssl/src/crypto/aes/aes_core.c | |||
@@ -625,7 +625,7 @@ static const u32 rcon[] = { | |||
625 | /** | 625 | /** |
626 | * Expand the cipher key into the encryption key schedule. | 626 | * Expand the cipher key into the encryption key schedule. |
627 | */ | 627 | */ |
628 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | 628 | int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, |
629 | AES_KEY *key) { | 629 | AES_KEY *key) { |
630 | 630 | ||
631 | u32 *rk; | 631 | u32 *rk; |
@@ -726,7 +726,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | |||
726 | /** | 726 | /** |
727 | * Expand the cipher key into the decryption key schedule. | 727 | * Expand the cipher key into the decryption key schedule. |
728 | */ | 728 | */ |
729 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | 729 | int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, |
730 | AES_KEY *key) { | 730 | AES_KEY *key) { |
731 | 731 | ||
732 | u32 *rk; | 732 | u32 *rk; |
@@ -734,7 +734,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | |||
734 | u32 temp; | 734 | u32 temp; |
735 | 735 | ||
736 | /* first, start with an encryption schedule */ | 736 | /* first, start with an encryption schedule */ |
737 | status = AES_set_encrypt_key(userKey, bits, key); | 737 | status = private_AES_set_encrypt_key(userKey, bits, key); |
738 | if (status < 0) | 738 | if (status < 0) |
739 | return status; | 739 | return status; |
740 | 740 | ||
@@ -1201,7 +1201,7 @@ static const u32 rcon[] = { | |||
1201 | /** | 1201 | /** |
1202 | * Expand the cipher key into the encryption key schedule. | 1202 | * Expand the cipher key into the encryption key schedule. |
1203 | */ | 1203 | */ |
1204 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | 1204 | int private_AES_set_encrypt_key(const unsigned char *userKey, const int bits, |
1205 | AES_KEY *key) { | 1205 | AES_KEY *key) { |
1206 | u32 *rk; | 1206 | u32 *rk; |
1207 | int i = 0; | 1207 | int i = 0; |
@@ -1301,7 +1301,7 @@ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | |||
1301 | /** | 1301 | /** |
1302 | * Expand the cipher key into the decryption key schedule. | 1302 | * Expand the cipher key into the decryption key schedule. |
1303 | */ | 1303 | */ |
1304 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | 1304 | int private_AES_set_decrypt_key(const unsigned char *userKey, const int bits, |
1305 | AES_KEY *key) { | 1305 | AES_KEY *key) { |
1306 | 1306 | ||
1307 | u32 *rk; | 1307 | u32 *rk; |
@@ -1309,7 +1309,7 @@ int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | |||
1309 | u32 temp; | 1309 | u32 temp; |
1310 | 1310 | ||
1311 | /* first, start with an encryption schedule */ | 1311 | /* first, start with an encryption schedule */ |
1312 | status = AES_set_encrypt_key(userKey, bits, key); | 1312 | status = private_AES_set_encrypt_key(userKey, bits, key); |
1313 | if (status < 0) | 1313 | if (status < 0) |
1314 | return status; | 1314 | return status; |
1315 | 1315 | ||
diff --git a/src/lib/libssl/src/crypto/aes/aes_misc.c b/src/lib/libssl/src/crypto/aes/aes_misc.c index 4fead1b4c7..f083488ecb 100644 --- a/src/lib/libssl/src/crypto/aes/aes_misc.c +++ b/src/lib/libssl/src/crypto/aes/aes_misc.c | |||
@@ -50,6 +50,7 @@ | |||
50 | */ | 50 | */ |
51 | 51 | ||
52 | #include <openssl/opensslv.h> | 52 | #include <openssl/opensslv.h> |
53 | #include <openssl/crypto.h> | ||
53 | #include <openssl/aes.h> | 54 | #include <openssl/aes.h> |
54 | #include "aes_locl.h" | 55 | #include "aes_locl.h" |
55 | 56 | ||
@@ -62,3 +63,23 @@ const char *AES_options(void) { | |||
62 | return "aes(partial)"; | 63 | return "aes(partial)"; |
63 | #endif | 64 | #endif |
64 | } | 65 | } |
66 | |||
67 | /* FIPS wrapper functions to block low level AES calls in FIPS mode */ | ||
68 | |||
69 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, | ||
70 | AES_KEY *key) | ||
71 | { | ||
72 | #ifdef OPENSSL_FIPS | ||
73 | fips_cipher_abort(AES); | ||
74 | #endif | ||
75 | return private_AES_set_encrypt_key(userKey, bits, key); | ||
76 | } | ||
77 | |||
78 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, | ||
79 | AES_KEY *key) | ||
80 | { | ||
81 | #ifdef OPENSSL_FIPS | ||
82 | fips_cipher_abort(AES); | ||
83 | #endif | ||
84 | return private_AES_set_decrypt_key(userKey, bits, key); | ||
85 | } | ||
diff --git a/src/lib/libssl/src/crypto/asn1/Makefile b/src/lib/libssl/src/crypto/asn1/Makefile index 160544eede..f7787005d4 100644 --- a/src/lib/libssl/src/crypto/asn1/Makefile +++ b/src/lib/libssl/src/crypto/asn1/Makefile | |||
@@ -639,7 +639,7 @@ t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | |||
639 | t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 639 | t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
640 | t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 640 | t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
641 | t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h | 641 | t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h |
642 | t_x509.o: ../cryptlib.h t_x509.c | 642 | t_x509.o: ../cryptlib.h asn1_locl.h t_x509.c |
643 | t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h | 643 | t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h |
644 | t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 644 | t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
645 | t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 645 | t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
diff --git a/src/lib/libssl/src/crypto/asn1/a_d2i_fp.c b/src/lib/libssl/src/crypto/asn1/a_d2i_fp.c index ece40bc4c0..52b2ebdb63 100644 --- a/src/lib/libssl/src/crypto/asn1/a_d2i_fp.c +++ b/src/lib/libssl/src/crypto/asn1/a_d2i_fp.c | |||
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <limits.h> | ||
60 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
61 | #include <openssl/buffer.h> | 62 | #include <openssl/buffer.h> |
62 | #include <openssl/asn1_mac.h> | 63 | #include <openssl/asn1_mac.h> |
@@ -143,17 +144,11 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
143 | BUF_MEM *b; | 144 | BUF_MEM *b; |
144 | unsigned char *p; | 145 | unsigned char *p; |
145 | int i; | 146 | int i; |
146 | int ret=-1; | ||
147 | ASN1_const_CTX c; | 147 | ASN1_const_CTX c; |
148 | int want=HEADER_SIZE; | 148 | size_t want=HEADER_SIZE; |
149 | int eos=0; | 149 | int eos=0; |
150 | #if defined(__GNUC__) && defined(__ia64) | 150 | size_t off=0; |
151 | /* pathetic compiler bug in all known versions as of Nov. 2002 */ | 151 | size_t len=0; |
152 | long off=0; | ||
153 | #else | ||
154 | int off=0; | ||
155 | #endif | ||
156 | int len=0; | ||
157 | 152 | ||
158 | b=BUF_MEM_new(); | 153 | b=BUF_MEM_new(); |
159 | if (b == NULL) | 154 | if (b == NULL) |
@@ -169,7 +164,7 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
169 | { | 164 | { |
170 | want-=(len-off); | 165 | want-=(len-off); |
171 | 166 | ||
172 | if (!BUF_MEM_grow_clean(b,len+want)) | 167 | if (len + want < len || !BUF_MEM_grow_clean(b,len+want)) |
173 | { | 168 | { |
174 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE); | 169 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE); |
175 | goto err; | 170 | goto err; |
@@ -181,7 +176,14 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
181 | goto err; | 176 | goto err; |
182 | } | 177 | } |
183 | if (i > 0) | 178 | if (i > 0) |
179 | { | ||
180 | if (len+i < len) | ||
181 | { | ||
182 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG); | ||
183 | goto err; | ||
184 | } | ||
184 | len+=i; | 185 | len+=i; |
186 | } | ||
185 | } | 187 | } |
186 | /* else data already loaded */ | 188 | /* else data already loaded */ |
187 | 189 | ||
@@ -206,6 +208,11 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
206 | { | 208 | { |
207 | /* no data body so go round again */ | 209 | /* no data body so go round again */ |
208 | eos++; | 210 | eos++; |
211 | if (eos < 0) | ||
212 | { | ||
213 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_HEADER_TOO_LONG); | ||
214 | goto err; | ||
215 | } | ||
209 | want=HEADER_SIZE; | 216 | want=HEADER_SIZE; |
210 | } | 217 | } |
211 | else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC)) | 218 | else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC)) |
@@ -220,10 +227,16 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
220 | else | 227 | else |
221 | { | 228 | { |
222 | /* suck in c.slen bytes of data */ | 229 | /* suck in c.slen bytes of data */ |
223 | want=(int)c.slen; | 230 | want=c.slen; |
224 | if (want > (len-off)) | 231 | if (want > (len-off)) |
225 | { | 232 | { |
226 | want-=(len-off); | 233 | want-=(len-off); |
234 | if (want > INT_MAX /* BIO_read takes an int length */ || | ||
235 | len+want < len) | ||
236 | { | ||
237 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG); | ||
238 | goto err; | ||
239 | } | ||
227 | if (!BUF_MEM_grow_clean(b,len+want)) | 240 | if (!BUF_MEM_grow_clean(b,len+want)) |
228 | { | 241 | { |
229 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE); | 242 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE); |
@@ -238,11 +251,18 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
238 | ASN1_R_NOT_ENOUGH_DATA); | 251 | ASN1_R_NOT_ENOUGH_DATA); |
239 | goto err; | 252 | goto err; |
240 | } | 253 | } |
254 | /* This can't overflow because | ||
255 | * |len+want| didn't overflow. */ | ||
241 | len+=i; | 256 | len+=i; |
242 | want -= i; | 257 | want-=i; |
243 | } | 258 | } |
244 | } | 259 | } |
245 | off+=(int)c.slen; | 260 | if (off + c.slen < off) |
261 | { | ||
262 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG); | ||
263 | goto err; | ||
264 | } | ||
265 | off+=c.slen; | ||
246 | if (eos <= 0) | 266 | if (eos <= 0) |
247 | { | 267 | { |
248 | break; | 268 | break; |
@@ -252,9 +272,15 @@ static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) | |||
252 | } | 272 | } |
253 | } | 273 | } |
254 | 274 | ||
275 | if (off > INT_MAX) | ||
276 | { | ||
277 | ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG); | ||
278 | goto err; | ||
279 | } | ||
280 | |||
255 | *pb = b; | 281 | *pb = b; |
256 | return off; | 282 | return off; |
257 | err: | 283 | err: |
258 | if (b != NULL) BUF_MEM_free(b); | 284 | if (b != NULL) BUF_MEM_free(b); |
259 | return(ret); | 285 | return -1; |
260 | } | 286 | } |
diff --git a/src/lib/libssl/src/crypto/asn1/a_digest.c b/src/lib/libssl/src/crypto/asn1/a_digest.c index d00d9e22b1..cbdeea6ac0 100644 --- a/src/lib/libssl/src/crypto/asn1/a_digest.c +++ b/src/lib/libssl/src/crypto/asn1/a_digest.c | |||
@@ -87,7 +87,8 @@ int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, | |||
87 | p=str; | 87 | p=str; |
88 | i2d(data,&p); | 88 | i2d(data,&p); |
89 | 89 | ||
90 | EVP_Digest(str, i, md, len, type, NULL); | 90 | if (!EVP_Digest(str, i, md, len, type, NULL)) |
91 | return 0; | ||
91 | OPENSSL_free(str); | 92 | OPENSSL_free(str); |
92 | return(1); | 93 | return(1); |
93 | } | 94 | } |
@@ -104,7 +105,8 @@ int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | |||
104 | i=ASN1_item_i2d(asn,&str, it); | 105 | i=ASN1_item_i2d(asn,&str, it); |
105 | if (!str) return(0); | 106 | if (!str) return(0); |
106 | 107 | ||
107 | EVP_Digest(str, i, md, len, type, NULL); | 108 | if (!EVP_Digest(str, i, md, len, type, NULL)) |
109 | return 0; | ||
108 | OPENSSL_free(str); | 110 | OPENSSL_free(str); |
109 | return(1); | 111 | return(1); |
110 | } | 112 | } |
diff --git a/src/lib/libssl/src/crypto/asn1/a_int.c b/src/lib/libssl/src/crypto/asn1/a_int.c index 3348b8762c..ad0d2506f6 100644 --- a/src/lib/libssl/src/crypto/asn1/a_int.c +++ b/src/lib/libssl/src/crypto/asn1/a_int.c | |||
@@ -386,8 +386,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a) | |||
386 | 386 | ||
387 | if (a->length > (int)sizeof(long)) | 387 | if (a->length > (int)sizeof(long)) |
388 | { | 388 | { |
389 | /* hmm... a bit ugly */ | 389 | /* hmm... a bit ugly, return all ones */ |
390 | return(0xffffffffL); | 390 | return -1; |
391 | } | 391 | } |
392 | if (a->data == NULL) | 392 | if (a->data == NULL) |
393 | return 0; | 393 | return 0; |
diff --git a/src/lib/libssl/src/crypto/asn1/a_sign.c b/src/lib/libssl/src/crypto/asn1/a_sign.c index ff63bfc7be..7b4a193d6b 100644 --- a/src/lib/libssl/src/crypto/asn1/a_sign.c +++ b/src/lib/libssl/src/crypto/asn1/a_sign.c | |||
@@ -184,9 +184,9 @@ int ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
184 | p=buf_in; | 184 | p=buf_in; |
185 | 185 | ||
186 | i2d(data,&p); | 186 | i2d(data,&p); |
187 | EVP_SignInit_ex(&ctx,type, NULL); | 187 | if (!EVP_SignInit_ex(&ctx,type, NULL) |
188 | EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl); | 188 | || !EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl) |
189 | if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out, | 189 | || !EVP_SignFinal(&ctx,(unsigned char *)buf_out, |
190 | (unsigned int *)&outl,pkey)) | 190 | (unsigned int *)&outl,pkey)) |
191 | { | 191 | { |
192 | outl=0; | 192 | outl=0; |
@@ -218,65 +218,100 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
218 | const EVP_MD *type) | 218 | const EVP_MD *type) |
219 | { | 219 | { |
220 | EVP_MD_CTX ctx; | 220 | EVP_MD_CTX ctx; |
221 | EVP_MD_CTX_init(&ctx); | ||
222 | if (!EVP_DigestSignInit(&ctx, NULL, type, NULL, pkey)) | ||
223 | { | ||
224 | EVP_MD_CTX_cleanup(&ctx); | ||
225 | return 0; | ||
226 | } | ||
227 | return ASN1_item_sign_ctx(it, algor1, algor2, signature, asn, &ctx); | ||
228 | } | ||
229 | |||
230 | |||
231 | int ASN1_item_sign_ctx(const ASN1_ITEM *it, | ||
232 | X509_ALGOR *algor1, X509_ALGOR *algor2, | ||
233 | ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx) | ||
234 | { | ||
235 | const EVP_MD *type; | ||
236 | EVP_PKEY *pkey; | ||
221 | unsigned char *buf_in=NULL,*buf_out=NULL; | 237 | unsigned char *buf_in=NULL,*buf_out=NULL; |
222 | int inl=0,outl=0,outll=0; | 238 | size_t inl=0,outl=0,outll=0; |
223 | int signid, paramtype; | 239 | int signid, paramtype; |
240 | int rv; | ||
241 | |||
242 | type = EVP_MD_CTX_md(ctx); | ||
243 | pkey = EVP_PKEY_CTX_get0_pkey(ctx->pctx); | ||
224 | 244 | ||
225 | if (type == NULL) | 245 | if (!type || !pkey) |
226 | { | 246 | { |
227 | int def_nid; | 247 | ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_CONTEXT_NOT_INITIALISED); |
228 | if (EVP_PKEY_get_default_digest_nid(pkey, &def_nid) > 0) | 248 | return 0; |
229 | type = EVP_get_digestbynid(def_nid); | ||
230 | } | 249 | } |
231 | 250 | ||
232 | if (type == NULL) | 251 | if (pkey->ameth->item_sign) |
233 | { | 252 | { |
234 | ASN1err(ASN1_F_ASN1_ITEM_SIGN, ASN1_R_NO_DEFAULT_DIGEST); | 253 | rv = pkey->ameth->item_sign(ctx, it, asn, algor1, algor2, |
235 | return 0; | 254 | signature); |
255 | if (rv == 1) | ||
256 | outl = signature->length; | ||
257 | /* Return value meanings: | ||
258 | * <=0: error. | ||
259 | * 1: method does everything. | ||
260 | * 2: carry on as normal. | ||
261 | * 3: ASN1 method sets algorithm identifiers: just sign. | ||
262 | */ | ||
263 | if (rv <= 0) | ||
264 | ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_EVP_LIB); | ||
265 | if (rv <= 1) | ||
266 | goto err; | ||
236 | } | 267 | } |
268 | else | ||
269 | rv = 2; | ||
237 | 270 | ||
238 | if (type->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) | 271 | if (rv == 2) |
239 | { | 272 | { |
240 | if (!pkey->ameth || | 273 | if (type->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) |
241 | !OBJ_find_sigid_by_algs(&signid, EVP_MD_nid(type), | ||
242 | pkey->ameth->pkey_id)) | ||
243 | { | 274 | { |
244 | ASN1err(ASN1_F_ASN1_ITEM_SIGN, | 275 | if (!pkey->ameth || |
245 | ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED); | 276 | !OBJ_find_sigid_by_algs(&signid, |
246 | return 0; | 277 | EVP_MD_nid(type), |
278 | pkey->ameth->pkey_id)) | ||
279 | { | ||
280 | ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, | ||
281 | ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED); | ||
282 | return 0; | ||
283 | } | ||
247 | } | 284 | } |
248 | } | 285 | else |
249 | else | 286 | signid = type->pkey_type; |
250 | signid = type->pkey_type; | ||
251 | 287 | ||
252 | if (pkey->ameth->pkey_flags & ASN1_PKEY_SIGPARAM_NULL) | 288 | if (pkey->ameth->pkey_flags & ASN1_PKEY_SIGPARAM_NULL) |
253 | paramtype = V_ASN1_NULL; | 289 | paramtype = V_ASN1_NULL; |
254 | else | 290 | else |
255 | paramtype = V_ASN1_UNDEF; | 291 | paramtype = V_ASN1_UNDEF; |
256 | 292 | ||
257 | if (algor1) | 293 | if (algor1) |
258 | X509_ALGOR_set0(algor1, OBJ_nid2obj(signid), paramtype, NULL); | 294 | X509_ALGOR_set0(algor1, OBJ_nid2obj(signid), paramtype, NULL); |
259 | if (algor2) | 295 | if (algor2) |
260 | X509_ALGOR_set0(algor2, OBJ_nid2obj(signid), paramtype, NULL); | 296 | X509_ALGOR_set0(algor2, OBJ_nid2obj(signid), paramtype, NULL); |
297 | |||
298 | } | ||
261 | 299 | ||
262 | EVP_MD_CTX_init(&ctx); | ||
263 | inl=ASN1_item_i2d(asn,&buf_in, it); | 300 | inl=ASN1_item_i2d(asn,&buf_in, it); |
264 | outll=outl=EVP_PKEY_size(pkey); | 301 | outll=outl=EVP_PKEY_size(pkey); |
265 | buf_out=(unsigned char *)OPENSSL_malloc((unsigned int)outl); | 302 | buf_out=OPENSSL_malloc((unsigned int)outl); |
266 | if ((buf_in == NULL) || (buf_out == NULL)) | 303 | if ((buf_in == NULL) || (buf_out == NULL)) |
267 | { | 304 | { |
268 | outl=0; | 305 | outl=0; |
269 | ASN1err(ASN1_F_ASN1_ITEM_SIGN,ERR_R_MALLOC_FAILURE); | 306 | ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX,ERR_R_MALLOC_FAILURE); |
270 | goto err; | 307 | goto err; |
271 | } | 308 | } |
272 | 309 | ||
273 | EVP_SignInit_ex(&ctx,type, NULL); | 310 | if (!EVP_DigestSignUpdate(ctx, buf_in, inl) |
274 | EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl); | 311 | || !EVP_DigestSignFinal(ctx, buf_out, &outl)) |
275 | if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out, | ||
276 | (unsigned int *)&outl,pkey)) | ||
277 | { | 312 | { |
278 | outl=0; | 313 | outl=0; |
279 | ASN1err(ASN1_F_ASN1_ITEM_SIGN,ERR_R_EVP_LIB); | 314 | ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX,ERR_R_EVP_LIB); |
280 | goto err; | 315 | goto err; |
281 | } | 316 | } |
282 | if (signature->data != NULL) OPENSSL_free(signature->data); | 317 | if (signature->data != NULL) OPENSSL_free(signature->data); |
@@ -289,7 +324,7 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | |||
289 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); | 324 | signature->flags&= ~(ASN1_STRING_FLAG_BITS_LEFT|0x07); |
290 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; | 325 | signature->flags|=ASN1_STRING_FLAG_BITS_LEFT; |
291 | err: | 326 | err: |
292 | EVP_MD_CTX_cleanup(&ctx); | 327 | EVP_MD_CTX_cleanup(ctx); |
293 | if (buf_in != NULL) | 328 | if (buf_in != NULL) |
294 | { OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); } | 329 | { OPENSSL_cleanse((char *)buf_in,(unsigned int)inl); OPENSSL_free(buf_in); } |
295 | if (buf_out != NULL) | 330 | if (buf_out != NULL) |
diff --git a/src/lib/libssl/src/crypto/asn1/a_verify.c b/src/lib/libssl/src/crypto/asn1/a_verify.c index cecdb13c70..432722e409 100644 --- a/src/lib/libssl/src/crypto/asn1/a_verify.c +++ b/src/lib/libssl/src/crypto/asn1/a_verify.c | |||
@@ -101,8 +101,13 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature, | |||
101 | p=buf_in; | 101 | p=buf_in; |
102 | 102 | ||
103 | i2d(data,&p); | 103 | i2d(data,&p); |
104 | EVP_VerifyInit_ex(&ctx,type, NULL); | 104 | if (!EVP_VerifyInit_ex(&ctx,type, NULL) |
105 | EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); | 105 | || !EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl)) |
106 | { | ||
107 | ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB); | ||
108 | ret=0; | ||
109 | goto err; | ||
110 | } | ||
106 | 111 | ||
107 | OPENSSL_cleanse(buf_in,(unsigned int)inl); | 112 | OPENSSL_cleanse(buf_in,(unsigned int)inl); |
108 | OPENSSL_free(buf_in); | 113 | OPENSSL_free(buf_in); |
@@ -126,11 +131,10 @@ err: | |||
126 | #endif | 131 | #endif |
127 | 132 | ||
128 | 133 | ||
129 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signature, | 134 | int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, |
130 | void *asn, EVP_PKEY *pkey) | 135 | ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) |
131 | { | 136 | { |
132 | EVP_MD_CTX ctx; | 137 | EVP_MD_CTX ctx; |
133 | const EVP_MD *type = NULL; | ||
134 | unsigned char *buf_in=NULL; | 138 | unsigned char *buf_in=NULL; |
135 | int ret= -1,inl; | 139 | int ret= -1,inl; |
136 | 140 | ||
@@ -144,25 +148,47 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat | |||
144 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); | 148 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); |
145 | goto err; | 149 | goto err; |
146 | } | 150 | } |
147 | type=EVP_get_digestbynid(mdnid); | 151 | if (mdnid == NID_undef) |
148 | if (type == NULL) | ||
149 | { | 152 | { |
150 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); | 153 | if (!pkey->ameth || !pkey->ameth->item_verify) |
151 | goto err; | 154 | { |
155 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM); | ||
156 | goto err; | ||
157 | } | ||
158 | ret = pkey->ameth->item_verify(&ctx, it, asn, a, | ||
159 | signature, pkey); | ||
160 | /* Return value of 2 means carry on, anything else means we | ||
161 | * exit straight away: either a fatal error of the underlying | ||
162 | * verification routine handles all verification. | ||
163 | */ | ||
164 | if (ret != 2) | ||
165 | goto err; | ||
166 | ret = -1; | ||
152 | } | 167 | } |
153 | 168 | else | |
154 | /* Check public key OID matches public key type */ | ||
155 | if (EVP_PKEY_type(pknid) != pkey->ameth->pkey_id) | ||
156 | { | 169 | { |
157 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_WRONG_PUBLIC_KEY_TYPE); | 170 | const EVP_MD *type; |
158 | goto err; | 171 | type=EVP_get_digestbynid(mdnid); |
159 | } | 172 | if (type == NULL) |
173 | { | ||
174 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM); | ||
175 | goto err; | ||
176 | } | ||
177 | |||
178 | /* Check public key OID matches public key type */ | ||
179 | if (EVP_PKEY_type(pknid) != pkey->ameth->pkey_id) | ||
180 | { | ||
181 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ASN1_R_WRONG_PUBLIC_KEY_TYPE); | ||
182 | goto err; | ||
183 | } | ||
184 | |||
185 | if (!EVP_DigestVerifyInit(&ctx, NULL, type, NULL, pkey)) | ||
186 | { | ||
187 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB); | ||
188 | ret=0; | ||
189 | goto err; | ||
190 | } | ||
160 | 191 | ||
161 | if (!EVP_VerifyInit_ex(&ctx,type, NULL)) | ||
162 | { | ||
163 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB); | ||
164 | ret=0; | ||
165 | goto err; | ||
166 | } | 192 | } |
167 | 193 | ||
168 | inl = ASN1_item_i2d(asn, &buf_in, it); | 194 | inl = ASN1_item_i2d(asn, &buf_in, it); |
@@ -173,13 +199,18 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, ASN1_BIT_STRING *signat | |||
173 | goto err; | 199 | goto err; |
174 | } | 200 | } |
175 | 201 | ||
176 | EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl); | 202 | if (!EVP_DigestVerifyUpdate(&ctx,buf_in,inl)) |
203 | { | ||
204 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB); | ||
205 | ret=0; | ||
206 | goto err; | ||
207 | } | ||
177 | 208 | ||
178 | OPENSSL_cleanse(buf_in,(unsigned int)inl); | 209 | OPENSSL_cleanse(buf_in,(unsigned int)inl); |
179 | OPENSSL_free(buf_in); | 210 | OPENSSL_free(buf_in); |
180 | 211 | ||
181 | if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data, | 212 | if (EVP_DigestVerifyFinal(&ctx,signature->data, |
182 | (unsigned int)signature->length,pkey) <= 0) | 213 | (size_t)signature->length) <= 0) |
183 | { | 214 | { |
184 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB); | 215 | ASN1err(ASN1_F_ASN1_ITEM_VERIFY,ERR_R_EVP_LIB); |
185 | ret=0; | 216 | ret=0; |
diff --git a/src/lib/libssl/src/crypto/asn1/asn1.h b/src/lib/libssl/src/crypto/asn1/asn1.h index 59540e4e79..220a0c8c63 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1.h +++ b/src/lib/libssl/src/crypto/asn1/asn1.h | |||
@@ -235,7 +235,7 @@ typedef struct asn1_object_st | |||
235 | */ | 235 | */ |
236 | #define ASN1_STRING_FLAG_MSTRING 0x040 | 236 | #define ASN1_STRING_FLAG_MSTRING 0x040 |
237 | /* This is the base type that holds just about everything :-) */ | 237 | /* This is the base type that holds just about everything :-) */ |
238 | typedef struct asn1_string_st | 238 | struct asn1_string_st |
239 | { | 239 | { |
240 | int length; | 240 | int length; |
241 | int type; | 241 | int type; |
@@ -245,7 +245,7 @@ typedef struct asn1_string_st | |||
245 | * input data has a non-zero 'unused bits' value, it will be | 245 | * input data has a non-zero 'unused bits' value, it will be |
246 | * handled correctly */ | 246 | * handled correctly */ |
247 | long flags; | 247 | long flags; |
248 | } ASN1_STRING; | 248 | }; |
249 | 249 | ||
250 | /* ASN1_ENCODING structure: this is used to save the received | 250 | /* ASN1_ENCODING structure: this is used to save the received |
251 | * encoding of an ASN1 type. This is useful to get round | 251 | * encoding of an ASN1 type. This is useful to get round |
@@ -293,7 +293,6 @@ DECLARE_STACK_OF(ASN1_STRING_TABLE) | |||
293 | * see asn1t.h | 293 | * see asn1t.h |
294 | */ | 294 | */ |
295 | typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; | 295 | typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; |
296 | typedef struct ASN1_ITEM_st ASN1_ITEM; | ||
297 | typedef struct ASN1_TLC_st ASN1_TLC; | 296 | typedef struct ASN1_TLC_st ASN1_TLC; |
298 | /* This is just an opaque pointer */ | 297 | /* This is just an opaque pointer */ |
299 | typedef struct ASN1_VALUE_st ASN1_VALUE; | 298 | typedef struct ASN1_VALUE_st ASN1_VALUE; |
@@ -1194,6 +1193,7 @@ void ERR_load_ASN1_strings(void); | |||
1194 | #define ASN1_F_ASN1_ITEM_I2D_FP 193 | 1193 | #define ASN1_F_ASN1_ITEM_I2D_FP 193 |
1195 | #define ASN1_F_ASN1_ITEM_PACK 198 | 1194 | #define ASN1_F_ASN1_ITEM_PACK 198 |
1196 | #define ASN1_F_ASN1_ITEM_SIGN 195 | 1195 | #define ASN1_F_ASN1_ITEM_SIGN 195 |
1196 | #define ASN1_F_ASN1_ITEM_SIGN_CTX 220 | ||
1197 | #define ASN1_F_ASN1_ITEM_UNPACK 199 | 1197 | #define ASN1_F_ASN1_ITEM_UNPACK 199 |
1198 | #define ASN1_F_ASN1_ITEM_VERIFY 197 | 1198 | #define ASN1_F_ASN1_ITEM_VERIFY 197 |
1199 | #define ASN1_F_ASN1_MBSTRING_NCOPY 122 | 1199 | #define ASN1_F_ASN1_MBSTRING_NCOPY 122 |
@@ -1266,6 +1266,7 @@ void ERR_load_ASN1_strings(void); | |||
1266 | #define ASN1_F_PKCS5_PBE2_SET_IV 167 | 1266 | #define ASN1_F_PKCS5_PBE2_SET_IV 167 |
1267 | #define ASN1_F_PKCS5_PBE_SET 202 | 1267 | #define ASN1_F_PKCS5_PBE_SET 202 |
1268 | #define ASN1_F_PKCS5_PBE_SET0_ALGOR 215 | 1268 | #define ASN1_F_PKCS5_PBE_SET0_ALGOR 215 |
1269 | #define ASN1_F_PKCS5_PBKDF2_SET 219 | ||
1269 | #define ASN1_F_SMIME_READ_ASN1 212 | 1270 | #define ASN1_F_SMIME_READ_ASN1 212 |
1270 | #define ASN1_F_SMIME_TEXT 213 | 1271 | #define ASN1_F_SMIME_TEXT 213 |
1271 | #define ASN1_F_X509_CINF_NEW 168 | 1272 | #define ASN1_F_X509_CINF_NEW 168 |
@@ -1291,6 +1292,7 @@ void ERR_load_ASN1_strings(void); | |||
1291 | #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 | 1292 | #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 |
1292 | #define ASN1_R_BUFFER_TOO_SMALL 107 | 1293 | #define ASN1_R_BUFFER_TOO_SMALL 107 |
1293 | #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 | 1294 | #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108 |
1295 | #define ASN1_R_CONTEXT_NOT_INITIALISED 217 | ||
1294 | #define ASN1_R_DATA_IS_WRONG 109 | 1296 | #define ASN1_R_DATA_IS_WRONG 109 |
1295 | #define ASN1_R_DECODE_ERROR 110 | 1297 | #define ASN1_R_DECODE_ERROR 110 |
1296 | #define ASN1_R_DECODING_ERROR 111 | 1298 | #define ASN1_R_DECODING_ERROR 111 |
diff --git a/src/lib/libssl/src/crypto/asn1/asn1_err.c b/src/lib/libssl/src/crypto/asn1/asn1_err.c index 6e04d08f31..1a30bf119b 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1_err.c +++ b/src/lib/libssl/src/crypto/asn1/asn1_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/asn1/asn1_err.c */ | 1 | /* crypto/asn1/asn1_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2009 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -107,6 +107,7 @@ static ERR_STRING_DATA ASN1_str_functs[]= | |||
107 | {ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_FP), "ASN1_item_i2d_fp"}, | 107 | {ERR_FUNC(ASN1_F_ASN1_ITEM_I2D_FP), "ASN1_item_i2d_fp"}, |
108 | {ERR_FUNC(ASN1_F_ASN1_ITEM_PACK), "ASN1_item_pack"}, | 108 | {ERR_FUNC(ASN1_F_ASN1_ITEM_PACK), "ASN1_item_pack"}, |
109 | {ERR_FUNC(ASN1_F_ASN1_ITEM_SIGN), "ASN1_item_sign"}, | 109 | {ERR_FUNC(ASN1_F_ASN1_ITEM_SIGN), "ASN1_item_sign"}, |
110 | {ERR_FUNC(ASN1_F_ASN1_ITEM_SIGN_CTX), "ASN1_item_sign_ctx"}, | ||
110 | {ERR_FUNC(ASN1_F_ASN1_ITEM_UNPACK), "ASN1_item_unpack"}, | 111 | {ERR_FUNC(ASN1_F_ASN1_ITEM_UNPACK), "ASN1_item_unpack"}, |
111 | {ERR_FUNC(ASN1_F_ASN1_ITEM_VERIFY), "ASN1_item_verify"}, | 112 | {ERR_FUNC(ASN1_F_ASN1_ITEM_VERIFY), "ASN1_item_verify"}, |
112 | {ERR_FUNC(ASN1_F_ASN1_MBSTRING_NCOPY), "ASN1_mbstring_ncopy"}, | 113 | {ERR_FUNC(ASN1_F_ASN1_MBSTRING_NCOPY), "ASN1_mbstring_ncopy"}, |
@@ -179,6 +180,7 @@ static ERR_STRING_DATA ASN1_str_functs[]= | |||
179 | {ERR_FUNC(ASN1_F_PKCS5_PBE2_SET_IV), "PKCS5_pbe2_set_iv"}, | 180 | {ERR_FUNC(ASN1_F_PKCS5_PBE2_SET_IV), "PKCS5_pbe2_set_iv"}, |
180 | {ERR_FUNC(ASN1_F_PKCS5_PBE_SET), "PKCS5_pbe_set"}, | 181 | {ERR_FUNC(ASN1_F_PKCS5_PBE_SET), "PKCS5_pbe_set"}, |
181 | {ERR_FUNC(ASN1_F_PKCS5_PBE_SET0_ALGOR), "PKCS5_pbe_set0_algor"}, | 182 | {ERR_FUNC(ASN1_F_PKCS5_PBE_SET0_ALGOR), "PKCS5_pbe_set0_algor"}, |
183 | {ERR_FUNC(ASN1_F_PKCS5_PBKDF2_SET), "PKCS5_pbkdf2_set"}, | ||
182 | {ERR_FUNC(ASN1_F_SMIME_READ_ASN1), "SMIME_read_ASN1"}, | 184 | {ERR_FUNC(ASN1_F_SMIME_READ_ASN1), "SMIME_read_ASN1"}, |
183 | {ERR_FUNC(ASN1_F_SMIME_TEXT), "SMIME_text"}, | 185 | {ERR_FUNC(ASN1_F_SMIME_TEXT), "SMIME_text"}, |
184 | {ERR_FUNC(ASN1_F_X509_CINF_NEW), "X509_CINF_NEW"}, | 186 | {ERR_FUNC(ASN1_F_X509_CINF_NEW), "X509_CINF_NEW"}, |
@@ -207,6 +209,7 @@ static ERR_STRING_DATA ASN1_str_reasons[]= | |||
207 | {ERR_REASON(ASN1_R_BOOLEAN_IS_WRONG_LENGTH),"boolean is wrong length"}, | 209 | {ERR_REASON(ASN1_R_BOOLEAN_IS_WRONG_LENGTH),"boolean is wrong length"}, |
208 | {ERR_REASON(ASN1_R_BUFFER_TOO_SMALL) ,"buffer too small"}, | 210 | {ERR_REASON(ASN1_R_BUFFER_TOO_SMALL) ,"buffer too small"}, |
209 | {ERR_REASON(ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),"cipher has no object identifier"}, | 211 | {ERR_REASON(ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER),"cipher has no object identifier"}, |
212 | {ERR_REASON(ASN1_R_CONTEXT_NOT_INITIALISED),"context not initialised"}, | ||
210 | {ERR_REASON(ASN1_R_DATA_IS_WRONG) ,"data is wrong"}, | 213 | {ERR_REASON(ASN1_R_DATA_IS_WRONG) ,"data is wrong"}, |
211 | {ERR_REASON(ASN1_R_DECODE_ERROR) ,"decode error"}, | 214 | {ERR_REASON(ASN1_R_DECODE_ERROR) ,"decode error"}, |
212 | {ERR_REASON(ASN1_R_DECODING_ERROR) ,"decoding error"}, | 215 | {ERR_REASON(ASN1_R_DECODING_ERROR) ,"decoding error"}, |
diff --git a/src/lib/libssl/src/crypto/asn1/n_pkey.c b/src/lib/libssl/src/crypto/asn1/n_pkey.c index e7d0439062..e251739933 100644 --- a/src/lib/libssl/src/crypto/asn1/n_pkey.c +++ b/src/lib/libssl/src/crypto/asn1/n_pkey.c | |||
@@ -129,6 +129,7 @@ int i2d_RSA_NET(const RSA *a, unsigned char **pp, | |||
129 | unsigned char buf[256],*zz; | 129 | unsigned char buf[256],*zz; |
130 | unsigned char key[EVP_MAX_KEY_LENGTH]; | 130 | unsigned char key[EVP_MAX_KEY_LENGTH]; |
131 | EVP_CIPHER_CTX ctx; | 131 | EVP_CIPHER_CTX ctx; |
132 | EVP_CIPHER_CTX_init(&ctx); | ||
132 | 133 | ||
133 | if (a == NULL) return(0); | 134 | if (a == NULL) return(0); |
134 | 135 | ||
@@ -206,24 +207,28 @@ int i2d_RSA_NET(const RSA *a, unsigned char **pp, | |||
206 | i = strlen((char *)buf); | 207 | i = strlen((char *)buf); |
207 | /* If the key is used for SGC the algorithm is modified a little. */ | 208 | /* If the key is used for SGC the algorithm is modified a little. */ |
208 | if(sgckey) { | 209 | if(sgckey) { |
209 | EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL); | 210 | if (!EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL)) |
211 | goto err; | ||
210 | memcpy(buf + 16, "SGCKEYSALT", 10); | 212 | memcpy(buf + 16, "SGCKEYSALT", 10); |
211 | i = 26; | 213 | i = 26; |
212 | } | 214 | } |
213 | 215 | ||
214 | EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL); | 216 | if (!EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL)) |
217 | goto err; | ||
215 | OPENSSL_cleanse(buf,256); | 218 | OPENSSL_cleanse(buf,256); |
216 | 219 | ||
217 | /* Encrypt private key in place */ | 220 | /* Encrypt private key in place */ |
218 | zz = enckey->enckey->digest->data; | 221 | zz = enckey->enckey->digest->data; |
219 | EVP_CIPHER_CTX_init(&ctx); | 222 | if (!EVP_EncryptInit_ex(&ctx,EVP_rc4(),NULL,key,NULL)) |
220 | EVP_EncryptInit_ex(&ctx,EVP_rc4(),NULL,key,NULL); | 223 | goto err; |
221 | EVP_EncryptUpdate(&ctx,zz,&i,zz,pkeylen); | 224 | if (!EVP_EncryptUpdate(&ctx,zz,&i,zz,pkeylen)) |
222 | EVP_EncryptFinal_ex(&ctx,zz + i,&j); | 225 | goto err; |
223 | EVP_CIPHER_CTX_cleanup(&ctx); | 226 | if (!EVP_EncryptFinal_ex(&ctx,zz + i,&j)) |
227 | goto err; | ||
224 | 228 | ||
225 | ret = i2d_NETSCAPE_ENCRYPTED_PKEY(enckey, pp); | 229 | ret = i2d_NETSCAPE_ENCRYPTED_PKEY(enckey, pp); |
226 | err: | 230 | err: |
231 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
227 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); | 232 | NETSCAPE_ENCRYPTED_PKEY_free(enckey); |
228 | NETSCAPE_PKEY_free(pkey); | 233 | NETSCAPE_PKEY_free(pkey); |
229 | return(ret); | 234 | return(ret); |
@@ -288,6 +293,7 @@ static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os, | |||
288 | const unsigned char *zz; | 293 | const unsigned char *zz; |
289 | unsigned char key[EVP_MAX_KEY_LENGTH]; | 294 | unsigned char key[EVP_MAX_KEY_LENGTH]; |
290 | EVP_CIPHER_CTX ctx; | 295 | EVP_CIPHER_CTX ctx; |
296 | EVP_CIPHER_CTX_init(&ctx); | ||
291 | 297 | ||
292 | i=cb((char *)buf,256,"Enter Private Key password:",0); | 298 | i=cb((char *)buf,256,"Enter Private Key password:",0); |
293 | if (i != 0) | 299 | if (i != 0) |
@@ -298,19 +304,22 @@ static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os, | |||
298 | 304 | ||
299 | i = strlen((char *)buf); | 305 | i = strlen((char *)buf); |
300 | if(sgckey){ | 306 | if(sgckey){ |
301 | EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL); | 307 | if (!EVP_Digest(buf, i, buf, NULL, EVP_md5(), NULL)) |
308 | goto err; | ||
302 | memcpy(buf + 16, "SGCKEYSALT", 10); | 309 | memcpy(buf + 16, "SGCKEYSALT", 10); |
303 | i = 26; | 310 | i = 26; |
304 | } | 311 | } |
305 | 312 | ||
306 | EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL); | 313 | if (!EVP_BytesToKey(EVP_rc4(),EVP_md5(),NULL,buf,i,1,key,NULL)) |
314 | goto err; | ||
307 | OPENSSL_cleanse(buf,256); | 315 | OPENSSL_cleanse(buf,256); |
308 | 316 | ||
309 | EVP_CIPHER_CTX_init(&ctx); | 317 | if (!EVP_DecryptInit_ex(&ctx,EVP_rc4(),NULL, key,NULL)) |
310 | EVP_DecryptInit_ex(&ctx,EVP_rc4(),NULL, key,NULL); | 318 | goto err; |
311 | EVP_DecryptUpdate(&ctx,os->data,&i,os->data,os->length); | 319 | if (!EVP_DecryptUpdate(&ctx,os->data,&i,os->data,os->length)) |
312 | EVP_DecryptFinal_ex(&ctx,&(os->data[i]),&j); | 320 | goto err; |
313 | EVP_CIPHER_CTX_cleanup(&ctx); | 321 | if (!EVP_DecryptFinal_ex(&ctx,&(os->data[i]),&j)) |
322 | goto err; | ||
314 | os->length=i+j; | 323 | os->length=i+j; |
315 | 324 | ||
316 | zz=os->data; | 325 | zz=os->data; |
@@ -328,6 +337,7 @@ static RSA *d2i_RSA_NET_2(RSA **a, ASN1_OCTET_STRING *os, | |||
328 | goto err; | 337 | goto err; |
329 | } | 338 | } |
330 | err: | 339 | err: |
340 | EVP_CIPHER_CTX_cleanup(&ctx); | ||
331 | NETSCAPE_PKEY_free(pkey); | 341 | NETSCAPE_PKEY_free(pkey); |
332 | return(ret); | 342 | return(ret); |
333 | } | 343 | } |
diff --git a/src/lib/libssl/src/crypto/asn1/p5_pbev2.c b/src/lib/libssl/src/crypto/asn1/p5_pbev2.c index cb49b6651d..4ea683036b 100644 --- a/src/lib/libssl/src/crypto/asn1/p5_pbev2.c +++ b/src/lib/libssl/src/crypto/asn1/p5_pbev2.c | |||
@@ -91,12 +91,10 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, | |||
91 | unsigned char *aiv, int prf_nid) | 91 | unsigned char *aiv, int prf_nid) |
92 | { | 92 | { |
93 | X509_ALGOR *scheme = NULL, *kalg = NULL, *ret = NULL; | 93 | X509_ALGOR *scheme = NULL, *kalg = NULL, *ret = NULL; |
94 | int alg_nid; | 94 | int alg_nid, keylen; |
95 | EVP_CIPHER_CTX ctx; | 95 | EVP_CIPHER_CTX ctx; |
96 | unsigned char iv[EVP_MAX_IV_LENGTH]; | 96 | unsigned char iv[EVP_MAX_IV_LENGTH]; |
97 | PBKDF2PARAM *kdf = NULL; | ||
98 | PBE2PARAM *pbe2 = NULL; | 97 | PBE2PARAM *pbe2 = NULL; |
99 | ASN1_OCTET_STRING *osalt = NULL; | ||
100 | ASN1_OBJECT *obj; | 98 | ASN1_OBJECT *obj; |
101 | 99 | ||
102 | alg_nid = EVP_CIPHER_type(cipher); | 100 | alg_nid = EVP_CIPHER_type(cipher); |
@@ -127,7 +125,8 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, | |||
127 | EVP_CIPHER_CTX_init(&ctx); | 125 | EVP_CIPHER_CTX_init(&ctx); |
128 | 126 | ||
129 | /* Dummy cipherinit to just setup the IV, and PRF */ | 127 | /* Dummy cipherinit to just setup the IV, and PRF */ |
130 | EVP_CipherInit_ex(&ctx, cipher, NULL, NULL, iv, 0); | 128 | if (!EVP_CipherInit_ex(&ctx, cipher, NULL, NULL, iv, 0)) |
129 | goto err; | ||
131 | if(EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0) { | 130 | if(EVP_CIPHER_param_to_asn1(&ctx, scheme->parameter) < 0) { |
132 | ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, | 131 | ASN1err(ASN1_F_PKCS5_PBE2_SET_IV, |
133 | ASN1_R_ERROR_SETTING_CIPHER_PARAMS); | 132 | ASN1_R_ERROR_SETTING_CIPHER_PARAMS); |
@@ -145,55 +144,21 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, | |||
145 | } | 144 | } |
146 | EVP_CIPHER_CTX_cleanup(&ctx); | 145 | EVP_CIPHER_CTX_cleanup(&ctx); |
147 | 146 | ||
148 | if(!(kdf = PBKDF2PARAM_new())) goto merr; | ||
149 | if(!(osalt = M_ASN1_OCTET_STRING_new())) goto merr; | ||
150 | |||
151 | if (!saltlen) saltlen = PKCS5_SALT_LEN; | ||
152 | if (!(osalt->data = OPENSSL_malloc (saltlen))) goto merr; | ||
153 | osalt->length = saltlen; | ||
154 | if (salt) memcpy (osalt->data, salt, saltlen); | ||
155 | else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) goto merr; | ||
156 | |||
157 | if(iter <= 0) iter = PKCS5_DEFAULT_ITER; | ||
158 | if(!ASN1_INTEGER_set(kdf->iter, iter)) goto merr; | ||
159 | |||
160 | /* Now include salt in kdf structure */ | ||
161 | kdf->salt->value.octet_string = osalt; | ||
162 | kdf->salt->type = V_ASN1_OCTET_STRING; | ||
163 | osalt = NULL; | ||
164 | |||
165 | /* If its RC2 then we'd better setup the key length */ | 147 | /* If its RC2 then we'd better setup the key length */ |
166 | 148 | ||
167 | if(alg_nid == NID_rc2_cbc) { | 149 | if(alg_nid == NID_rc2_cbc) |
168 | if(!(kdf->keylength = M_ASN1_INTEGER_new())) goto merr; | 150 | keylen = EVP_CIPHER_key_length(cipher); |
169 | if(!ASN1_INTEGER_set (kdf->keylength, | 151 | else |
170 | EVP_CIPHER_key_length(cipher))) goto merr; | 152 | keylen = -1; |
171 | } | ||
172 | |||
173 | /* prf can stay NULL if we are using hmacWithSHA1 */ | ||
174 | if (prf_nid != NID_hmacWithSHA1) | ||
175 | { | ||
176 | kdf->prf = X509_ALGOR_new(); | ||
177 | if (!kdf->prf) | ||
178 | goto merr; | ||
179 | X509_ALGOR_set0(kdf->prf, OBJ_nid2obj(prf_nid), | ||
180 | V_ASN1_NULL, NULL); | ||
181 | } | ||
182 | |||
183 | /* Now setup the PBE2PARAM keyfunc structure */ | ||
184 | 153 | ||
185 | pbe2->keyfunc->algorithm = OBJ_nid2obj(NID_id_pbkdf2); | 154 | /* Setup keyfunc */ |
186 | 155 | ||
187 | /* Encode PBKDF2PARAM into parameter of pbe2 */ | 156 | X509_ALGOR_free(pbe2->keyfunc); |
188 | 157 | ||
189 | if(!(pbe2->keyfunc->parameter = ASN1_TYPE_new())) goto merr; | 158 | pbe2->keyfunc = PKCS5_pbkdf2_set(iter, salt, saltlen, prf_nid, keylen); |
190 | 159 | ||
191 | if(!ASN1_item_pack(kdf, ASN1_ITEM_rptr(PBKDF2PARAM), | 160 | if (!pbe2->keyfunc) |
192 | &pbe2->keyfunc->parameter->value.sequence)) goto merr; | 161 | goto merr; |
193 | pbe2->keyfunc->parameter->type = V_ASN1_SEQUENCE; | ||
194 | |||
195 | PBKDF2PARAM_free(kdf); | ||
196 | kdf = NULL; | ||
197 | 162 | ||
198 | /* Now set up top level AlgorithmIdentifier */ | 163 | /* Now set up top level AlgorithmIdentifier */ |
199 | 164 | ||
@@ -219,8 +184,6 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, | |||
219 | err: | 184 | err: |
220 | PBE2PARAM_free(pbe2); | 185 | PBE2PARAM_free(pbe2); |
221 | /* Note 'scheme' is freed as part of pbe2 */ | 186 | /* Note 'scheme' is freed as part of pbe2 */ |
222 | M_ASN1_OCTET_STRING_free(osalt); | ||
223 | PBKDF2PARAM_free(kdf); | ||
224 | X509_ALGOR_free(kalg); | 187 | X509_ALGOR_free(kalg); |
225 | X509_ALGOR_free(ret); | 188 | X509_ALGOR_free(ret); |
226 | 189 | ||
@@ -233,3 +196,85 @@ X509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter, | |||
233 | { | 196 | { |
234 | return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1); | 197 | return PKCS5_pbe2_set_iv(cipher, iter, salt, saltlen, NULL, -1); |
235 | } | 198 | } |
199 | |||
200 | X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, | ||
201 | int prf_nid, int keylen) | ||
202 | { | ||
203 | X509_ALGOR *keyfunc = NULL; | ||
204 | PBKDF2PARAM *kdf = NULL; | ||
205 | ASN1_OCTET_STRING *osalt = NULL; | ||
206 | |||
207 | if(!(kdf = PBKDF2PARAM_new())) | ||
208 | goto merr; | ||
209 | if(!(osalt = M_ASN1_OCTET_STRING_new())) | ||
210 | goto merr; | ||
211 | |||
212 | kdf->salt->value.octet_string = osalt; | ||
213 | kdf->salt->type = V_ASN1_OCTET_STRING; | ||
214 | |||
215 | if (!saltlen) | ||
216 | saltlen = PKCS5_SALT_LEN; | ||
217 | if (!(osalt->data = OPENSSL_malloc (saltlen))) | ||
218 | goto merr; | ||
219 | |||
220 | osalt->length = saltlen; | ||
221 | |||
222 | if (salt) | ||
223 | memcpy (osalt->data, salt, saltlen); | ||
224 | else if (RAND_pseudo_bytes (osalt->data, saltlen) < 0) | ||
225 | goto merr; | ||
226 | |||
227 | if(iter <= 0) | ||
228 | iter = PKCS5_DEFAULT_ITER; | ||
229 | |||
230 | if(!ASN1_INTEGER_set(kdf->iter, iter)) | ||
231 | goto merr; | ||
232 | |||
233 | /* If have a key len set it up */ | ||
234 | |||
235 | if(keylen > 0) | ||
236 | { | ||
237 | if(!(kdf->keylength = M_ASN1_INTEGER_new())) | ||
238 | goto merr; | ||
239 | if(!ASN1_INTEGER_set (kdf->keylength, keylen)) | ||
240 | goto merr; | ||
241 | } | ||
242 | |||
243 | /* prf can stay NULL if we are using hmacWithSHA1 */ | ||
244 | if (prf_nid > 0 && prf_nid != NID_hmacWithSHA1) | ||
245 | { | ||
246 | kdf->prf = X509_ALGOR_new(); | ||
247 | if (!kdf->prf) | ||
248 | goto merr; | ||
249 | X509_ALGOR_set0(kdf->prf, OBJ_nid2obj(prf_nid), | ||
250 | V_ASN1_NULL, NULL); | ||
251 | } | ||
252 | |||
253 | /* Finally setup the keyfunc structure */ | ||
254 | |||
255 | keyfunc = X509_ALGOR_new(); | ||
256 | if (!keyfunc) | ||
257 | goto merr; | ||
258 | |||
259 | keyfunc->algorithm = OBJ_nid2obj(NID_id_pbkdf2); | ||
260 | |||
261 | /* Encode PBKDF2PARAM into parameter of pbe2 */ | ||
262 | |||
263 | if(!(keyfunc->parameter = ASN1_TYPE_new())) | ||
264 | goto merr; | ||
265 | |||
266 | if(!ASN1_item_pack(kdf, ASN1_ITEM_rptr(PBKDF2PARAM), | ||
267 | &keyfunc->parameter->value.sequence)) | ||
268 | goto merr; | ||
269 | keyfunc->parameter->type = V_ASN1_SEQUENCE; | ||
270 | |||
271 | PBKDF2PARAM_free(kdf); | ||
272 | return keyfunc; | ||
273 | |||
274 | merr: | ||
275 | ASN1err(ASN1_F_PKCS5_PBKDF2_SET,ERR_R_MALLOC_FAILURE); | ||
276 | PBKDF2PARAM_free(kdf); | ||
277 | X509_ALGOR_free(keyfunc); | ||
278 | return NULL; | ||
279 | } | ||
280 | |||
diff --git a/src/lib/libssl/src/crypto/asn1/t_crl.c b/src/lib/libssl/src/crypto/asn1/t_crl.c index ee5a687ce8..c61169208a 100644 --- a/src/lib/libssl/src/crypto/asn1/t_crl.c +++ b/src/lib/libssl/src/crypto/asn1/t_crl.c | |||
@@ -94,8 +94,7 @@ int X509_CRL_print(BIO *out, X509_CRL *x) | |||
94 | l = X509_CRL_get_version(x); | 94 | l = X509_CRL_get_version(x); |
95 | BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l+1, l); | 95 | BIO_printf(out, "%8sVersion %lu (0x%lx)\n", "", l+1, l); |
96 | i = OBJ_obj2nid(x->sig_alg->algorithm); | 96 | i = OBJ_obj2nid(x->sig_alg->algorithm); |
97 | BIO_printf(out, "%8sSignature Algorithm: %s\n", "", | 97 | X509_signature_print(out, x->sig_alg, NULL); |
98 | (i == NID_undef) ? "NONE" : OBJ_nid2ln(i)); | ||
99 | p=X509_NAME_oneline(X509_CRL_get_issuer(x),NULL,0); | 98 | p=X509_NAME_oneline(X509_CRL_get_issuer(x),NULL,0); |
100 | BIO_printf(out,"%8sIssuer: %s\n","",p); | 99 | BIO_printf(out,"%8sIssuer: %s\n","",p); |
101 | OPENSSL_free(p); | 100 | OPENSSL_free(p); |
diff --git a/src/lib/libssl/src/crypto/asn1/t_x509.c b/src/lib/libssl/src/crypto/asn1/t_x509.c index e061f2ffad..edbb39a02f 100644 --- a/src/lib/libssl/src/crypto/asn1/t_x509.c +++ b/src/lib/libssl/src/crypto/asn1/t_x509.c | |||
@@ -72,6 +72,7 @@ | |||
72 | #include <openssl/objects.h> | 72 | #include <openssl/objects.h> |
73 | #include <openssl/x509.h> | 73 | #include <openssl/x509.h> |
74 | #include <openssl/x509v3.h> | 74 | #include <openssl/x509v3.h> |
75 | #include "asn1_locl.h" | ||
75 | 76 | ||
76 | #ifndef OPENSSL_NO_FP_API | 77 | #ifndef OPENSSL_NO_FP_API |
77 | int X509_print_fp(FILE *fp, X509 *x) | 78 | int X509_print_fp(FILE *fp, X509 *x) |
@@ -137,10 +138,10 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) | |||
137 | if (BIO_write(bp," Serial Number:",22) <= 0) goto err; | 138 | if (BIO_write(bp," Serial Number:",22) <= 0) goto err; |
138 | 139 | ||
139 | bs=X509_get_serialNumber(x); | 140 | bs=X509_get_serialNumber(x); |
140 | if (bs->length <= 4) | 141 | if (bs->length <= (int)sizeof(long)) |
141 | { | 142 | { |
142 | l=ASN1_INTEGER_get(bs); | 143 | l=ASN1_INTEGER_get(bs); |
143 | if (l < 0) | 144 | if (bs->type == V_ASN1_NEG_INTEGER) |
144 | { | 145 | { |
145 | l= -l; | 146 | l= -l; |
146 | neg="-"; | 147 | neg="-"; |
@@ -167,12 +168,16 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) | |||
167 | 168 | ||
168 | if(!(cflag & X509_FLAG_NO_SIGNAME)) | 169 | if(!(cflag & X509_FLAG_NO_SIGNAME)) |
169 | { | 170 | { |
171 | if(X509_signature_print(bp, x->sig_alg, NULL) <= 0) | ||
172 | goto err; | ||
173 | #if 0 | ||
170 | if (BIO_printf(bp,"%8sSignature Algorithm: ","") <= 0) | 174 | if (BIO_printf(bp,"%8sSignature Algorithm: ","") <= 0) |
171 | goto err; | 175 | goto err; |
172 | if (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0) | 176 | if (i2a_ASN1_OBJECT(bp, ci->signature->algorithm) <= 0) |
173 | goto err; | 177 | goto err; |
174 | if (BIO_puts(bp, "\n") <= 0) | 178 | if (BIO_puts(bp, "\n") <= 0) |
175 | goto err; | 179 | goto err; |
180 | #endif | ||
176 | } | 181 | } |
177 | 182 | ||
178 | if(!(cflag & X509_FLAG_NO_ISSUER)) | 183 | if(!(cflag & X509_FLAG_NO_ISSUER)) |
@@ -255,7 +260,8 @@ int X509_ocspid_print (BIO *bp, X509 *x) | |||
255 | goto err; | 260 | goto err; |
256 | i2d_X509_NAME(x->cert_info->subject, &dertmp); | 261 | i2d_X509_NAME(x->cert_info->subject, &dertmp); |
257 | 262 | ||
258 | EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL); | 263 | if (!EVP_Digest(der, derlen, SHA1md, NULL, EVP_sha1(), NULL)) |
264 | goto err; | ||
259 | for (i=0; i < SHA_DIGEST_LENGTH; i++) | 265 | for (i=0; i < SHA_DIGEST_LENGTH; i++) |
260 | { | 266 | { |
261 | if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) goto err; | 267 | if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) goto err; |
@@ -268,8 +274,10 @@ int X509_ocspid_print (BIO *bp, X509 *x) | |||
268 | if (BIO_printf(bp,"\n Public key OCSP hash: ") <= 0) | 274 | if (BIO_printf(bp,"\n Public key OCSP hash: ") <= 0) |
269 | goto err; | 275 | goto err; |
270 | 276 | ||
271 | EVP_Digest(x->cert_info->key->public_key->data, | 277 | if (!EVP_Digest(x->cert_info->key->public_key->data, |
272 | x->cert_info->key->public_key->length, SHA1md, NULL, EVP_sha1(), NULL); | 278 | x->cert_info->key->public_key->length, |
279 | SHA1md, NULL, EVP_sha1(), NULL)) | ||
280 | goto err; | ||
273 | for (i=0; i < SHA_DIGEST_LENGTH; i++) | 281 | for (i=0; i < SHA_DIGEST_LENGTH; i++) |
274 | { | 282 | { |
275 | if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) | 283 | if (BIO_printf(bp,"%02X",SHA1md[i]) <= 0) |
@@ -283,23 +291,50 @@ err: | |||
283 | return(0); | 291 | return(0); |
284 | } | 292 | } |
285 | 293 | ||
286 | int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig) | 294 | int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) |
287 | { | 295 | { |
288 | unsigned char *s; | 296 | const unsigned char *s; |
289 | int i, n; | 297 | int i, n; |
290 | if (BIO_puts(bp," Signature Algorithm: ") <= 0) return 0; | ||
291 | if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) return 0; | ||
292 | 298 | ||
293 | n=sig->length; | 299 | n=sig->length; |
294 | s=sig->data; | 300 | s=sig->data; |
295 | for (i=0; i<n; i++) | 301 | for (i=0; i<n; i++) |
296 | { | 302 | { |
297 | if ((i%18) == 0) | 303 | if ((i%18) == 0) |
298 | if (BIO_write(bp,"\n ",9) <= 0) return 0; | 304 | { |
305 | if (BIO_write(bp,"\n",1) <= 0) return 0; | ||
306 | if (BIO_indent(bp, indent, indent) <= 0) return 0; | ||
307 | } | ||
299 | if (BIO_printf(bp,"%02x%s",s[i], | 308 | if (BIO_printf(bp,"%02x%s",s[i], |
300 | ((i+1) == n)?"":":") <= 0) return 0; | 309 | ((i+1) == n)?"":":") <= 0) return 0; |
301 | } | 310 | } |
302 | if (BIO_write(bp,"\n",1) != 1) return 0; | 311 | if (BIO_write(bp,"\n",1) != 1) return 0; |
312 | |||
313 | return 1; | ||
314 | } | ||
315 | |||
316 | int X509_signature_print(BIO *bp, X509_ALGOR *sigalg, ASN1_STRING *sig) | ||
317 | { | ||
318 | int sig_nid; | ||
319 | if (BIO_puts(bp," Signature Algorithm: ") <= 0) return 0; | ||
320 | if (i2a_ASN1_OBJECT(bp, sigalg->algorithm) <= 0) return 0; | ||
321 | |||
322 | sig_nid = OBJ_obj2nid(sigalg->algorithm); | ||
323 | if (sig_nid != NID_undef) | ||
324 | { | ||
325 | int pkey_nid, dig_nid; | ||
326 | const EVP_PKEY_ASN1_METHOD *ameth; | ||
327 | if (OBJ_find_sigid_algs(sig_nid, &dig_nid, &pkey_nid)) | ||
328 | { | ||
329 | ameth = EVP_PKEY_asn1_find(NULL, pkey_nid); | ||
330 | if (ameth && ameth->sig_print) | ||
331 | return ameth->sig_print(bp, sigalg, sig, 9, 0); | ||
332 | } | ||
333 | } | ||
334 | if (sig) | ||
335 | return X509_signature_dump(bp, sig, 9); | ||
336 | else if (BIO_puts(bp, "\n") <= 0) | ||
337 | return 0; | ||
303 | return 1; | 338 | return 1; |
304 | } | 339 | } |
305 | 340 | ||
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_prn.c b/src/lib/libssl/src/crypto/asn1/tasn_prn.c index 453698012d..542a091a66 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_prn.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_prn.c | |||
@@ -446,11 +446,11 @@ static int asn1_print_fsname(BIO *out, int indent, | |||
446 | return 1; | 446 | return 1; |
447 | } | 447 | } |
448 | 448 | ||
449 | static int asn1_print_boolean_ctx(BIO *out, const int bool, | 449 | static int asn1_print_boolean_ctx(BIO *out, int boolval, |
450 | const ASN1_PCTX *pctx) | 450 | const ASN1_PCTX *pctx) |
451 | { | 451 | { |
452 | const char *str; | 452 | const char *str; |
453 | switch (bool) | 453 | switch (boolval) |
454 | { | 454 | { |
455 | case -1: | 455 | case -1: |
456 | str = "BOOL ABSENT"; | 456 | str = "BOOL ABSENT"; |
@@ -574,10 +574,10 @@ static int asn1_primitive_print(BIO *out, ASN1_VALUE **fld, | |||
574 | { | 574 | { |
575 | case V_ASN1_BOOLEAN: | 575 | case V_ASN1_BOOLEAN: |
576 | { | 576 | { |
577 | int bool = *(int *)fld; | 577 | int boolval = *(int *)fld; |
578 | if (bool == -1) | 578 | if (boolval == -1) |
579 | bool = it->size; | 579 | boolval = it->size; |
580 | ret = asn1_print_boolean_ctx(out, bool, pctx); | 580 | ret = asn1_print_boolean_ctx(out, boolval, pctx); |
581 | } | 581 | } |
582 | break; | 582 | break; |
583 | 583 | ||
diff --git a/src/lib/libssl/src/crypto/asn1/x_algor.c b/src/lib/libssl/src/crypto/asn1/x_algor.c index 99e53429b7..274e456c73 100644 --- a/src/lib/libssl/src/crypto/asn1/x_algor.c +++ b/src/lib/libssl/src/crypto/asn1/x_algor.c | |||
@@ -128,3 +128,17 @@ void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, | |||
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | /* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ | ||
132 | |||
133 | void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) | ||
134 | { | ||
135 | int param_type; | ||
136 | |||
137 | if (md->flags & EVP_MD_FLAG_DIGALGID_ABSENT) | ||
138 | param_type = V_ASN1_UNDEF; | ||
139 | else | ||
140 | param_type = V_ASN1_NULL; | ||
141 | |||
142 | X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); | ||
143 | |||
144 | } | ||
diff --git a/src/lib/libssl/src/crypto/asn1/x_name.c b/src/lib/libssl/src/crypto/asn1/x_name.c index 49be08b4da..d7c2318693 100644 --- a/src/lib/libssl/src/crypto/asn1/x_name.c +++ b/src/lib/libssl/src/crypto/asn1/x_name.c | |||
@@ -399,8 +399,7 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) | |||
399 | /* If type not in bitmask just copy string across */ | 399 | /* If type not in bitmask just copy string across */ |
400 | if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) | 400 | if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) |
401 | { | 401 | { |
402 | out->type = in->type; | 402 | if (!ASN1_STRING_copy(out, in)) |
403 | if (!ASN1_STRING_set(out, in->data, in->length)) | ||
404 | return 0; | 403 | return 0; |
405 | return 1; | 404 | return 1; |
406 | } | 405 | } |
diff --git a/src/lib/libssl/src/crypto/asn1/x_pubkey.c b/src/lib/libssl/src/crypto/asn1/x_pubkey.c index d42b6a2c54..627ec87f9f 100644 --- a/src/lib/libssl/src/crypto/asn1/x_pubkey.c +++ b/src/lib/libssl/src/crypto/asn1/x_pubkey.c | |||
@@ -171,7 +171,16 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) | |||
171 | goto error; | 171 | goto error; |
172 | } | 172 | } |
173 | 173 | ||
174 | key->pkey = ret; | 174 | /* Check to see if another thread set key->pkey first */ |
175 | CRYPTO_w_lock(CRYPTO_LOCK_EVP_PKEY); | ||
176 | if (key->pkey) | ||
177 | { | ||
178 | EVP_PKEY_free(ret); | ||
179 | ret = key->pkey; | ||
180 | } | ||
181 | else | ||
182 | key->pkey = ret; | ||
183 | CRYPTO_w_unlock(CRYPTO_LOCK_EVP_PKEY); | ||
175 | CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); | 184 | CRYPTO_add(&ret->references, 1, CRYPTO_LOCK_EVP_PKEY); |
176 | 185 | ||
177 | return ret; | 186 | return ret; |
diff --git a/src/lib/libssl/src/crypto/bf/Makefile b/src/lib/libssl/src/crypto/bf/Makefile index dd2c2c708e..d01bfaa315 100644 --- a/src/lib/libssl/src/crypto/bf/Makefile +++ b/src/lib/libssl/src/crypto/bf/Makefile | |||
@@ -94,5 +94,8 @@ bf_enc.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h | |||
94 | bf_enc.o: ../../include/openssl/opensslconf.h bf_enc.c bf_locl.h | 94 | bf_enc.o: ../../include/openssl/opensslconf.h bf_enc.c bf_locl.h |
95 | bf_ofb64.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h | 95 | bf_ofb64.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h |
96 | bf_ofb64.o: ../../include/openssl/opensslconf.h bf_locl.h bf_ofb64.c | 96 | bf_ofb64.o: ../../include/openssl/opensslconf.h bf_locl.h bf_ofb64.c |
97 | bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/e_os2.h | 97 | bf_skey.o: ../../include/openssl/blowfish.h ../../include/openssl/crypto.h |
98 | bf_skey.o: ../../include/openssl/opensslconf.h bf_locl.h bf_pi.h bf_skey.c | 98 | bf_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
99 | bf_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
100 | bf_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
101 | bf_skey.o: ../../include/openssl/symhacks.h bf_locl.h bf_pi.h bf_skey.c | ||
diff --git a/src/lib/libssl/src/crypto/bf/bf_skey.c b/src/lib/libssl/src/crypto/bf/bf_skey.c index 3673cdee6e..3b0bca41ae 100644 --- a/src/lib/libssl/src/crypto/bf/bf_skey.c +++ b/src/lib/libssl/src/crypto/bf/bf_skey.c | |||
@@ -58,11 +58,19 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include <string.h> | 60 | #include <string.h> |
61 | #include <openssl/crypto.h> | ||
61 | #include <openssl/blowfish.h> | 62 | #include <openssl/blowfish.h> |
62 | #include "bf_locl.h" | 63 | #include "bf_locl.h" |
63 | #include "bf_pi.h" | 64 | #include "bf_pi.h" |
64 | 65 | ||
65 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data) | 66 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data) |
67 | #ifdef OPENSSL_FIPS | ||
68 | { | ||
69 | fips_cipher_abort(BLOWFISH); | ||
70 | private_BF_set_key(key, len, data); | ||
71 | } | ||
72 | void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data) | ||
73 | #endif | ||
66 | { | 74 | { |
67 | int i; | 75 | int i; |
68 | BF_LONG *p,ri,in[2]; | 76 | BF_LONG *p,ri,in[2]; |
diff --git a/src/lib/libssl/src/crypto/bf/blowfish.h b/src/lib/libssl/src/crypto/bf/blowfish.h index b97e76f9a3..4b6c8920a4 100644 --- a/src/lib/libssl/src/crypto/bf/blowfish.h +++ b/src/lib/libssl/src/crypto/bf/blowfish.h | |||
@@ -104,7 +104,9 @@ typedef struct bf_key_st | |||
104 | BF_LONG S[4*256]; | 104 | BF_LONG S[4*256]; |
105 | } BF_KEY; | 105 | } BF_KEY; |
106 | 106 | ||
107 | 107 | #ifdef OPENSSL_FIPS | |
108 | void private_BF_set_key(BF_KEY *key, int len, const unsigned char *data); | ||
109 | #endif | ||
108 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); | 110 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); |
109 | 111 | ||
110 | void BF_encrypt(BF_LONG *data,const BF_KEY *key); | 112 | void BF_encrypt(BF_LONG *data,const BF_KEY *key); |
diff --git a/src/lib/libssl/src/crypto/bio/b_sock.c b/src/lib/libssl/src/crypto/bio/b_sock.c index d47310d650..41f958be71 100644 --- a/src/lib/libssl/src/crypto/bio/b_sock.c +++ b/src/lib/libssl/src/crypto/bio/b_sock.c | |||
@@ -960,7 +960,6 @@ int BIO_set_tcp_ndelay(int s, int on) | |||
960 | #endif | 960 | #endif |
961 | return(ret == 0); | 961 | return(ret == 0); |
962 | } | 962 | } |
963 | #endif | ||
964 | 963 | ||
965 | int BIO_socket_nbio(int s, int mode) | 964 | int BIO_socket_nbio(int s, int mode) |
966 | { | 965 | { |
@@ -973,3 +972,4 @@ int BIO_socket_nbio(int s, int mode) | |||
973 | #endif | 972 | #endif |
974 | return(ret == 0); | 973 | return(ret == 0); |
975 | } | 974 | } |
975 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/bio/bio.h b/src/lib/libssl/src/crypto/bio/bio.h index ab47abcf14..05699ab212 100644 --- a/src/lib/libssl/src/crypto/bio/bio.h +++ b/src/lib/libssl/src/crypto/bio/bio.h | |||
@@ -68,6 +68,14 @@ | |||
68 | 68 | ||
69 | #include <openssl/crypto.h> | 69 | #include <openssl/crypto.h> |
70 | 70 | ||
71 | #ifndef OPENSSL_NO_SCTP | ||
72 | # ifndef OPENSSL_SYS_VMS | ||
73 | # include <stdint.h> | ||
74 | # else | ||
75 | # include <inttypes.h> | ||
76 | # endif | ||
77 | #endif | ||
78 | |||
71 | #ifdef __cplusplus | 79 | #ifdef __cplusplus |
72 | extern "C" { | 80 | extern "C" { |
73 | #endif | 81 | #endif |
@@ -95,6 +103,9 @@ extern "C" { | |||
95 | #define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ | 103 | #define BIO_TYPE_BIO (19|0x0400) /* (half a) BIO pair */ |
96 | #define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ | 104 | #define BIO_TYPE_LINEBUFFER (20|0x0200) /* filter */ |
97 | #define BIO_TYPE_DGRAM (21|0x0400|0x0100) | 105 | #define BIO_TYPE_DGRAM (21|0x0400|0x0100) |
106 | #ifndef OPENSSL_NO_SCTP | ||
107 | #define BIO_TYPE_DGRAM_SCTP (24|0x0400|0x0100) | ||
108 | #endif | ||
98 | #define BIO_TYPE_ASN1 (22|0x0200) /* filter */ | 109 | #define BIO_TYPE_ASN1 (22|0x0200) /* filter */ |
99 | #define BIO_TYPE_COMP (23|0x0200) /* filter */ | 110 | #define BIO_TYPE_COMP (23|0x0200) /* filter */ |
100 | 111 | ||
@@ -146,6 +157,7 @@ extern "C" { | |||
146 | /* #endif */ | 157 | /* #endif */ |
147 | 158 | ||
148 | #define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ | 159 | #define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */ |
160 | #define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47 | ||
149 | #define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ | 161 | #define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */ |
150 | #define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for | 162 | #define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for |
151 | * MTU. want to use this | 163 | * MTU. want to use this |
@@ -161,7 +173,22 @@ extern "C" { | |||
161 | #define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ | 173 | #define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */ |
162 | 174 | ||
163 | #define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to | 175 | #define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout to |
164 | * adjust socket timeouts */ | 176 | * adjust socket timeouts */ |
177 | |||
178 | #ifndef OPENSSL_NO_SCTP | ||
179 | /* SCTP stuff */ | ||
180 | #define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 | ||
181 | #define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 | ||
182 | #define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 | ||
183 | #define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 | ||
184 | #define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO 60 | ||
185 | #define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO 61 | ||
186 | #define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO 62 | ||
187 | #define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO 63 | ||
188 | #define BIO_CTRL_DGRAM_SCTP_GET_PRINFO 64 | ||
189 | #define BIO_CTRL_DGRAM_SCTP_SET_PRINFO 65 | ||
190 | #define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 | ||
191 | #endif | ||
165 | 192 | ||
166 | /* modifiers */ | 193 | /* modifiers */ |
167 | #define BIO_FP_READ 0x02 | 194 | #define BIO_FP_READ 0x02 |
@@ -331,6 +358,34 @@ typedef struct bio_f_buffer_ctx_struct | |||
331 | /* Prefix and suffix callback in ASN1 BIO */ | 358 | /* Prefix and suffix callback in ASN1 BIO */ |
332 | typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); | 359 | typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg); |
333 | 360 | ||
361 | #ifndef OPENSSL_NO_SCTP | ||
362 | /* SCTP parameter structs */ | ||
363 | struct bio_dgram_sctp_sndinfo | ||
364 | { | ||
365 | uint16_t snd_sid; | ||
366 | uint16_t snd_flags; | ||
367 | uint32_t snd_ppid; | ||
368 | uint32_t snd_context; | ||
369 | }; | ||
370 | |||
371 | struct bio_dgram_sctp_rcvinfo | ||
372 | { | ||
373 | uint16_t rcv_sid; | ||
374 | uint16_t rcv_ssn; | ||
375 | uint16_t rcv_flags; | ||
376 | uint32_t rcv_ppid; | ||
377 | uint32_t rcv_tsn; | ||
378 | uint32_t rcv_cumtsn; | ||
379 | uint32_t rcv_context; | ||
380 | }; | ||
381 | |||
382 | struct bio_dgram_sctp_prinfo | ||
383 | { | ||
384 | uint16_t pr_policy; | ||
385 | uint32_t pr_value; | ||
386 | }; | ||
387 | #endif | ||
388 | |||
334 | /* connect BIO stuff */ | 389 | /* connect BIO stuff */ |
335 | #define BIO_CONN_S_BEFORE 1 | 390 | #define BIO_CONN_S_BEFORE 1 |
336 | #define BIO_CONN_S_GET_IP 2 | 391 | #define BIO_CONN_S_GET_IP 2 |
@@ -628,6 +683,9 @@ BIO_METHOD *BIO_f_linebuffer(void); | |||
628 | BIO_METHOD *BIO_f_nbio_test(void); | 683 | BIO_METHOD *BIO_f_nbio_test(void); |
629 | #ifndef OPENSSL_NO_DGRAM | 684 | #ifndef OPENSSL_NO_DGRAM |
630 | BIO_METHOD *BIO_s_datagram(void); | 685 | BIO_METHOD *BIO_s_datagram(void); |
686 | #ifndef OPENSSL_NO_SCTP | ||
687 | BIO_METHOD *BIO_s_datagram_sctp(void); | ||
688 | #endif | ||
631 | #endif | 689 | #endif |
632 | 690 | ||
633 | /* BIO_METHOD *BIO_f_ber(void); */ | 691 | /* BIO_METHOD *BIO_f_ber(void); */ |
@@ -670,6 +728,15 @@ int BIO_set_tcp_ndelay(int sock,int turn_on); | |||
670 | 728 | ||
671 | BIO *BIO_new_socket(int sock, int close_flag); | 729 | BIO *BIO_new_socket(int sock, int close_flag); |
672 | BIO *BIO_new_dgram(int fd, int close_flag); | 730 | BIO *BIO_new_dgram(int fd, int close_flag); |
731 | #ifndef OPENSSL_NO_SCTP | ||
732 | BIO *BIO_new_dgram_sctp(int fd, int close_flag); | ||
733 | int BIO_dgram_is_sctp(BIO *bio); | ||
734 | int BIO_dgram_sctp_notification_cb(BIO *b, | ||
735 | void (*handle_notifications)(BIO *bio, void *context, void *buf), | ||
736 | void *context); | ||
737 | int BIO_dgram_sctp_wait_for_dry(BIO *b); | ||
738 | int BIO_dgram_sctp_msg_waiting(BIO *b); | ||
739 | #endif | ||
673 | BIO *BIO_new_fd(int fd, int close_flag); | 740 | BIO *BIO_new_fd(int fd, int close_flag); |
674 | BIO *BIO_new_connect(char *host_port); | 741 | BIO *BIO_new_connect(char *host_port); |
675 | BIO *BIO_new_accept(char *host_port); | 742 | BIO *BIO_new_accept(char *host_port); |
@@ -734,6 +801,7 @@ void ERR_load_BIO_strings(void); | |||
734 | #define BIO_F_BUFFER_CTRL 114 | 801 | #define BIO_F_BUFFER_CTRL 114 |
735 | #define BIO_F_CONN_CTRL 127 | 802 | #define BIO_F_CONN_CTRL 127 |
736 | #define BIO_F_CONN_STATE 115 | 803 | #define BIO_F_CONN_STATE 115 |
804 | #define BIO_F_DGRAM_SCTP_READ 132 | ||
737 | #define BIO_F_FILE_CTRL 116 | 805 | #define BIO_F_FILE_CTRL 116 |
738 | #define BIO_F_FILE_READ 130 | 806 | #define BIO_F_FILE_READ 130 |
739 | #define BIO_F_LINEBUFFER_CTRL 129 | 807 | #define BIO_F_LINEBUFFER_CTRL 129 |
diff --git a/src/lib/libssl/src/crypto/bio/bio_err.c b/src/lib/libssl/src/crypto/bio/bio_err.c index a224edd5a0..0dbfbd80d3 100644 --- a/src/lib/libssl/src/crypto/bio/bio_err.c +++ b/src/lib/libssl/src/crypto/bio/bio_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/bio/bio_err.c */ | 1 | /* crypto/bio/bio_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -95,6 +95,7 @@ static ERR_STRING_DATA BIO_str_functs[]= | |||
95 | {ERR_FUNC(BIO_F_BUFFER_CTRL), "BUFFER_CTRL"}, | 95 | {ERR_FUNC(BIO_F_BUFFER_CTRL), "BUFFER_CTRL"}, |
96 | {ERR_FUNC(BIO_F_CONN_CTRL), "CONN_CTRL"}, | 96 | {ERR_FUNC(BIO_F_CONN_CTRL), "CONN_CTRL"}, |
97 | {ERR_FUNC(BIO_F_CONN_STATE), "CONN_STATE"}, | 97 | {ERR_FUNC(BIO_F_CONN_STATE), "CONN_STATE"}, |
98 | {ERR_FUNC(BIO_F_DGRAM_SCTP_READ), "DGRAM_SCTP_READ"}, | ||
98 | {ERR_FUNC(BIO_F_FILE_CTRL), "FILE_CTRL"}, | 99 | {ERR_FUNC(BIO_F_FILE_CTRL), "FILE_CTRL"}, |
99 | {ERR_FUNC(BIO_F_FILE_READ), "FILE_READ"}, | 100 | {ERR_FUNC(BIO_F_FILE_READ), "FILE_READ"}, |
100 | {ERR_FUNC(BIO_F_LINEBUFFER_CTRL), "LINEBUFFER_CTRL"}, | 101 | {ERR_FUNC(BIO_F_LINEBUFFER_CTRL), "LINEBUFFER_CTRL"}, |
diff --git a/src/lib/libssl/src/crypto/bio/bio_lib.c b/src/lib/libssl/src/crypto/bio/bio_lib.c index e12bc3a2ca..9c9646afa8 100644 --- a/src/lib/libssl/src/crypto/bio/bio_lib.c +++ b/src/lib/libssl/src/crypto/bio/bio_lib.c | |||
@@ -521,40 +521,40 @@ void BIO_free_all(BIO *bio) | |||
521 | 521 | ||
522 | BIO *BIO_dup_chain(BIO *in) | 522 | BIO *BIO_dup_chain(BIO *in) |
523 | { | 523 | { |
524 | BIO *ret=NULL,*eoc=NULL,*bio,*new; | 524 | BIO *ret=NULL,*eoc=NULL,*bio,*new_bio; |
525 | 525 | ||
526 | for (bio=in; bio != NULL; bio=bio->next_bio) | 526 | for (bio=in; bio != NULL; bio=bio->next_bio) |
527 | { | 527 | { |
528 | if ((new=BIO_new(bio->method)) == NULL) goto err; | 528 | if ((new_bio=BIO_new(bio->method)) == NULL) goto err; |
529 | new->callback=bio->callback; | 529 | new_bio->callback=bio->callback; |
530 | new->cb_arg=bio->cb_arg; | 530 | new_bio->cb_arg=bio->cb_arg; |
531 | new->init=bio->init; | 531 | new_bio->init=bio->init; |
532 | new->shutdown=bio->shutdown; | 532 | new_bio->shutdown=bio->shutdown; |
533 | new->flags=bio->flags; | 533 | new_bio->flags=bio->flags; |
534 | 534 | ||
535 | /* This will let SSL_s_sock() work with stdin/stdout */ | 535 | /* This will let SSL_s_sock() work with stdin/stdout */ |
536 | new->num=bio->num; | 536 | new_bio->num=bio->num; |
537 | 537 | ||
538 | if (!BIO_dup_state(bio,(char *)new)) | 538 | if (!BIO_dup_state(bio,(char *)new_bio)) |
539 | { | 539 | { |
540 | BIO_free(new); | 540 | BIO_free(new_bio); |
541 | goto err; | 541 | goto err; |
542 | } | 542 | } |
543 | 543 | ||
544 | /* copy app data */ | 544 | /* copy app data */ |
545 | if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new->ex_data, | 545 | if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new_bio->ex_data, |
546 | &bio->ex_data)) | 546 | &bio->ex_data)) |
547 | goto err; | 547 | goto err; |
548 | 548 | ||
549 | if (ret == NULL) | 549 | if (ret == NULL) |
550 | { | 550 | { |
551 | eoc=new; | 551 | eoc=new_bio; |
552 | ret=eoc; | 552 | ret=eoc; |
553 | } | 553 | } |
554 | else | 554 | else |
555 | { | 555 | { |
556 | BIO_push(eoc,new); | 556 | BIO_push(eoc,new_bio); |
557 | eoc=new; | 557 | eoc=new_bio; |
558 | } | 558 | } |
559 | } | 559 | } |
560 | return(ret); | 560 | return(ret); |
diff --git a/src/lib/libssl/src/crypto/bio/bss_bio.c b/src/lib/libssl/src/crypto/bio/bss_bio.c index 76bd48e767..52ef0ebcb3 100644 --- a/src/lib/libssl/src/crypto/bio/bss_bio.c +++ b/src/lib/libssl/src/crypto/bio/bss_bio.c | |||
@@ -277,10 +277,10 @@ static int bio_read(BIO *bio, char *buf, int size_) | |||
277 | */ | 277 | */ |
278 | /* WARNING: The non-copying interface is largely untested as of yet | 278 | /* WARNING: The non-copying interface is largely untested as of yet |
279 | * and may contain bugs. */ | 279 | * and may contain bugs. */ |
280 | static ssize_t bio_nread0(BIO *bio, char **buf) | 280 | static ossl_ssize_t bio_nread0(BIO *bio, char **buf) |
281 | { | 281 | { |
282 | struct bio_bio_st *b, *peer_b; | 282 | struct bio_bio_st *b, *peer_b; |
283 | ssize_t num; | 283 | ossl_ssize_t num; |
284 | 284 | ||
285 | BIO_clear_retry_flags(bio); | 285 | BIO_clear_retry_flags(bio); |
286 | 286 | ||
@@ -315,15 +315,15 @@ static ssize_t bio_nread0(BIO *bio, char **buf) | |||
315 | return num; | 315 | return num; |
316 | } | 316 | } |
317 | 317 | ||
318 | static ssize_t bio_nread(BIO *bio, char **buf, size_t num_) | 318 | static ossl_ssize_t bio_nread(BIO *bio, char **buf, size_t num_) |
319 | { | 319 | { |
320 | struct bio_bio_st *b, *peer_b; | 320 | struct bio_bio_st *b, *peer_b; |
321 | ssize_t num, available; | 321 | ossl_ssize_t num, available; |
322 | 322 | ||
323 | if (num_ > SSIZE_MAX) | 323 | if (num_ > SSIZE_MAX) |
324 | num = SSIZE_MAX; | 324 | num = SSIZE_MAX; |
325 | else | 325 | else |
326 | num = (ssize_t)num_; | 326 | num = (ossl_ssize_t)num_; |
327 | 327 | ||
328 | available = bio_nread0(bio, buf); | 328 | available = bio_nread0(bio, buf); |
329 | if (num > available) | 329 | if (num > available) |
@@ -428,7 +428,7 @@ static int bio_write(BIO *bio, const char *buf, int num_) | |||
428 | * (example usage: bio_nwrite0(), write to buffer, bio_nwrite() | 428 | * (example usage: bio_nwrite0(), write to buffer, bio_nwrite() |
429 | * or just bio_nwrite(), write to buffer) | 429 | * or just bio_nwrite(), write to buffer) |
430 | */ | 430 | */ |
431 | static ssize_t bio_nwrite0(BIO *bio, char **buf) | 431 | static ossl_ssize_t bio_nwrite0(BIO *bio, char **buf) |
432 | { | 432 | { |
433 | struct bio_bio_st *b; | 433 | struct bio_bio_st *b; |
434 | size_t num; | 434 | size_t num; |
@@ -476,15 +476,15 @@ static ssize_t bio_nwrite0(BIO *bio, char **buf) | |||
476 | return num; | 476 | return num; |
477 | } | 477 | } |
478 | 478 | ||
479 | static ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_) | 479 | static ossl_ssize_t bio_nwrite(BIO *bio, char **buf, size_t num_) |
480 | { | 480 | { |
481 | struct bio_bio_st *b; | 481 | struct bio_bio_st *b; |
482 | ssize_t num, space; | 482 | ossl_ssize_t num, space; |
483 | 483 | ||
484 | if (num_ > SSIZE_MAX) | 484 | if (num_ > SSIZE_MAX) |
485 | num = SSIZE_MAX; | 485 | num = SSIZE_MAX; |
486 | else | 486 | else |
487 | num = (ssize_t)num_; | 487 | num = (ossl_ssize_t)num_; |
488 | 488 | ||
489 | space = bio_nwrite0(bio, buf); | 489 | space = bio_nwrite0(bio, buf); |
490 | if (num > space) | 490 | if (num > space) |
diff --git a/src/lib/libssl/src/crypto/bn/Makefile b/src/lib/libssl/src/crypto/bn/Makefile index aabc4f56b8..672773454c 100644 --- a/src/lib/libssl/src/crypto/bn/Makefile +++ b/src/lib/libssl/src/crypto/bn/Makefile | |||
@@ -26,13 +26,13 @@ LIBSRC= bn_add.c bn_div.c bn_exp.c bn_lib.c bn_ctx.c bn_mul.c bn_mod.c \ | |||
26 | bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ | 26 | bn_print.c bn_rand.c bn_shift.c bn_word.c bn_blind.c \ |
27 | bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \ | 27 | bn_kron.c bn_sqrt.c bn_gcd.c bn_prime.c bn_err.c bn_sqr.c bn_asm.c \ |
28 | bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ | 28 | bn_recp.c bn_mont.c bn_mpi.c bn_exp2.c bn_gf2m.c bn_nist.c \ |
29 | bn_depr.c bn_const.c | 29 | bn_depr.c bn_const.c bn_x931p.c |
30 | 30 | ||
31 | LIBOBJ= bn_add.o bn_div.o bn_exp.o bn_lib.o bn_ctx.o bn_mul.o bn_mod.o \ | 31 | LIBOBJ= bn_add.o bn_div.o bn_exp.o bn_lib.o bn_ctx.o bn_mul.o bn_mod.o \ |
32 | bn_print.o bn_rand.o bn_shift.o bn_word.o bn_blind.o \ | 32 | bn_print.o bn_rand.o bn_shift.o bn_word.o bn_blind.o \ |
33 | bn_kron.o bn_sqrt.o bn_gcd.o bn_prime.o bn_err.o bn_sqr.o $(BN_ASM) \ | 33 | bn_kron.o bn_sqrt.o bn_gcd.o bn_prime.o bn_err.o bn_sqr.o $(BN_ASM) \ |
34 | bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o bn_gf2m.o bn_nist.o \ | 34 | bn_recp.o bn_mont.o bn_mpi.o bn_exp2.o bn_gf2m.o bn_nist.o \ |
35 | bn_depr.o bn_const.o | 35 | bn_depr.o bn_const.o bn_x931p.o |
36 | 36 | ||
37 | SRC= $(LIBSRC) | 37 | SRC= $(LIBSRC) |
38 | 38 | ||
@@ -66,6 +66,8 @@ co-586.s: asm/co-586.pl ../perlasm/x86asm.pl | |||
66 | $(PERL) asm/co-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | 66 | $(PERL) asm/co-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
67 | x86-mont.s: asm/x86-mont.pl ../perlasm/x86asm.pl | 67 | x86-mont.s: asm/x86-mont.pl ../perlasm/x86asm.pl |
68 | $(PERL) asm/x86-mont.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | 68 | $(PERL) asm/x86-mont.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ |
69 | x86-gf2m.s: asm/x86-gf2m.pl ../perlasm/x86asm.pl | ||
70 | $(PERL) asm/x86-gf2m.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ | ||
69 | 71 | ||
70 | sparcv8.o: asm/sparcv8.S | 72 | sparcv8.o: asm/sparcv8.S |
71 | $(CC) $(CFLAGS) -c asm/sparcv8.S | 73 | $(CC) $(CFLAGS) -c asm/sparcv8.S |
@@ -82,16 +84,31 @@ bn-mips3.o: asm/mips3.s | |||
82 | as -$$ABI -O -o $@ asm/mips3.s; \ | 84 | as -$$ABI -O -o $@ asm/mips3.s; \ |
83 | else $(CC) -c $(CFLAGS) -o $@ asm/mips3.s; fi | 85 | else $(CC) -c $(CFLAGS) -o $@ asm/mips3.s; fi |
84 | 86 | ||
87 | bn-mips.s: asm/mips.pl | ||
88 | $(PERL) asm/mips.pl $(PERLASM_SCHEME) $@ | ||
89 | mips-mont.s: asm/mips-mont.pl | ||
90 | $(PERL) asm/mips-mont.pl $(PERLASM_SCHEME) $@ | ||
91 | |||
85 | bn-s390x.o: asm/s390x.S | 92 | bn-s390x.o: asm/s390x.S |
86 | $(CC) $(CFLAGS) -c -o $@ asm/s390x.S | 93 | $(CC) $(CFLAGS) -c -o $@ asm/s390x.S |
94 | s390x-gf2m.s: asm/s390x-gf2m.pl | ||
95 | $(PERL) asm/s390x-gf2m.pl $(PERLASM_SCHEME) $@ | ||
87 | 96 | ||
88 | x86_64-gcc.o: asm/x86_64-gcc.c | 97 | x86_64-gcc.o: asm/x86_64-gcc.c |
89 | $(CC) $(CFLAGS) -c -o $@ asm/x86_64-gcc.c | 98 | $(CC) $(CFLAGS) -c -o $@ asm/x86_64-gcc.c |
90 | x86_64-mont.s: asm/x86_64-mont.pl | 99 | x86_64-mont.s: asm/x86_64-mont.pl |
91 | $(PERL) asm/x86_64-mont.pl $(PERLASM_SCHEME) > $@ | 100 | $(PERL) asm/x86_64-mont.pl $(PERLASM_SCHEME) > $@ |
101 | x86_64-mont5.s: asm/x86_64-mont5.pl | ||
102 | $(PERL) asm/x86_64-mont5.pl $(PERLASM_SCHEME) > $@ | ||
103 | x86_64-gf2m.s: asm/x86_64-gf2m.pl | ||
104 | $(PERL) asm/x86_64-gf2m.pl $(PERLASM_SCHEME) > $@ | ||
105 | modexp512-x86_64.s: asm/modexp512-x86_64.pl | ||
106 | $(PERL) asm/modexp512-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
92 | 107 | ||
93 | bn-ia64.s: asm/ia64.S | 108 | bn-ia64.s: asm/ia64.S |
94 | $(CC) $(CFLAGS) -E asm/ia64.S > $@ | 109 | $(CC) $(CFLAGS) -E asm/ia64.S > $@ |
110 | ia64-mont.s: asm/ia64-mont.pl | ||
111 | $(PERL) asm/ia64-mont.pl $@ $(CFLAGS) | ||
95 | 112 | ||
96 | # GNU assembler fails to compile PA-RISC2 modules, insist on calling | 113 | # GNU assembler fails to compile PA-RISC2 modules, insist on calling |
97 | # vendor assembler... | 114 | # vendor assembler... |
@@ -99,16 +116,22 @@ pa-risc2W.o: asm/pa-risc2W.s | |||
99 | /usr/ccs/bin/as -o pa-risc2W.o asm/pa-risc2W.s | 116 | /usr/ccs/bin/as -o pa-risc2W.o asm/pa-risc2W.s |
100 | pa-risc2.o: asm/pa-risc2.s | 117 | pa-risc2.o: asm/pa-risc2.s |
101 | /usr/ccs/bin/as -o pa-risc2.o asm/pa-risc2.s | 118 | /usr/ccs/bin/as -o pa-risc2.o asm/pa-risc2.s |
119 | parisc-mont.s: asm/parisc-mont.pl | ||
120 | $(PERL) asm/parisc-mont.pl $(PERLASM_SCHEME) $@ | ||
102 | 121 | ||
103 | # ppc - AIX, Linux, MacOS X... | 122 | # ppc - AIX, Linux, MacOS X... |
104 | bn-ppc.s: asm/ppc.pl; $(PERL) asm/ppc.pl $(PERLASM_SCHEME) $@ | 123 | bn-ppc.s: asm/ppc.pl; $(PERL) asm/ppc.pl $(PERLASM_SCHEME) $@ |
105 | ppc-mont.s: asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@ | 124 | ppc-mont.s: asm/ppc-mont.pl;$(PERL) asm/ppc-mont.pl $(PERLASM_SCHEME) $@ |
125 | ppc64-mont.s: asm/ppc64-mont.pl;$(PERL) asm/ppc64-mont.pl $(PERLASM_SCHEME) $@ | ||
106 | 126 | ||
107 | alpha-mont.s: asm/alpha-mont.pl | 127 | alpha-mont.s: asm/alpha-mont.pl |
108 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | 128 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null |
109 | 129 | ||
110 | # GNU make "catch all" | 130 | # GNU make "catch all" |
111 | %-mont.s: asm/%-mont.pl; $(PERL) $< $(CFLAGS) > $@ | 131 | %-mont.s: asm/%-mont.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
132 | %-gf2m.S: asm/%-gf2m.pl; $(PERL) $< $(PERLASM_SCHEME) $@ | ||
133 | |||
134 | armv4-gf2m.o: armv4-gf2m.S | ||
112 | 135 | ||
113 | files: | 136 | files: |
114 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 137 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
@@ -345,3 +368,8 @@ bn_word.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | |||
345 | bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 368 | bn_word.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
346 | bn_word.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 369 | bn_word.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
347 | bn_word.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_word.c | 370 | bn_word.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_lcl.h bn_word.c |
371 | bn_x931p.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
372 | bn_x931p.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | ||
373 | bn_x931p.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
374 | bn_x931p.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
375 | bn_x931p.o: ../../include/openssl/symhacks.h bn_x931p.c | ||
diff --git a/src/lib/libssl/src/crypto/bn/asm/ppc.pl b/src/lib/libssl/src/crypto/bn/asm/ppc.pl index f4093177e6..1249ce2299 100644 --- a/src/lib/libssl/src/crypto/bn/asm/ppc.pl +++ b/src/lib/libssl/src/crypto/bn/asm/ppc.pl | |||
@@ -389,7 +389,9 @@ $data=<<EOF; | |||
389 | $ST r9,`6*$BNSZ`(r3) #r[6]=c1 | 389 | $ST r9,`6*$BNSZ`(r3) #r[6]=c1 |
390 | $ST r10,`7*$BNSZ`(r3) #r[7]=c2 | 390 | $ST r10,`7*$BNSZ`(r3) #r[7]=c2 |
391 | blr | 391 | blr |
392 | .long 0x00000000 | 392 | .long 0 |
393 | .byte 0,12,0x14,0,0,0,2,0 | ||
394 | .long 0 | ||
393 | 395 | ||
394 | # | 396 | # |
395 | # NOTE: The following label name should be changed to | 397 | # NOTE: The following label name should be changed to |
@@ -814,8 +816,9 @@ $data=<<EOF; | |||
814 | 816 | ||
815 | 817 | ||
816 | blr | 818 | blr |
817 | 819 | .long 0 | |
818 | .long 0x00000000 | 820 | .byte 0,12,0x14,0,0,0,2,0 |
821 | .long 0 | ||
819 | 822 | ||
820 | # | 823 | # |
821 | # NOTE: The following label name should be changed to | 824 | # NOTE: The following label name should be changed to |
@@ -966,7 +969,9 @@ $data=<<EOF; | |||
966 | $ST r10,`6*$BNSZ`(r3) #r[6]=c1 | 969 | $ST r10,`6*$BNSZ`(r3) #r[6]=c1 |
967 | $ST r11,`7*$BNSZ`(r3) #r[7]=c2 | 970 | $ST r11,`7*$BNSZ`(r3) #r[7]=c2 |
968 | blr | 971 | blr |
969 | .long 0x00000000 | 972 | .long 0 |
973 | .byte 0,12,0x14,0,0,0,3,0 | ||
974 | .long 0 | ||
970 | 975 | ||
971 | # | 976 | # |
972 | # NOTE: The following label name should be changed to | 977 | # NOTE: The following label name should be changed to |
@@ -1502,7 +1507,9 @@ $data=<<EOF; | |||
1502 | $ST r12,`14*$BNSZ`(r3) #r[14]=c3; | 1507 | $ST r12,`14*$BNSZ`(r3) #r[14]=c3; |
1503 | $ST r10,`15*$BNSZ`(r3) #r[15]=c1; | 1508 | $ST r10,`15*$BNSZ`(r3) #r[15]=c1; |
1504 | blr | 1509 | blr |
1505 | .long 0x00000000 | 1510 | .long 0 |
1511 | .byte 0,12,0x14,0,0,0,3,0 | ||
1512 | .long 0 | ||
1506 | 1513 | ||
1507 | # | 1514 | # |
1508 | # NOTE: The following label name should be changed to | 1515 | # NOTE: The following label name should be changed to |
@@ -1550,8 +1557,9 @@ Lppcasm_sub_adios: | |||
1550 | subfze r3,r0 # if carry bit is set then r3 = 0 else -1 | 1557 | subfze r3,r0 # if carry bit is set then r3 = 0 else -1 |
1551 | andi. r3,r3,1 # keep only last bit. | 1558 | andi. r3,r3,1 # keep only last bit. |
1552 | blr | 1559 | blr |
1553 | .long 0x00000000 | 1560 | .long 0 |
1554 | 1561 | .byte 0,12,0x14,0,0,0,4,0 | |
1562 | .long 0 | ||
1555 | 1563 | ||
1556 | # | 1564 | # |
1557 | # NOTE: The following label name should be changed to | 1565 | # NOTE: The following label name should be changed to |
@@ -1594,7 +1602,9 @@ Lppcasm_add_mainloop: | |||
1594 | Lppcasm_add_adios: | 1602 | Lppcasm_add_adios: |
1595 | addze r3,r0 #return carry bit. | 1603 | addze r3,r0 #return carry bit. |
1596 | blr | 1604 | blr |
1597 | .long 0x00000000 | 1605 | .long 0 |
1606 | .byte 0,12,0x14,0,0,0,4,0 | ||
1607 | .long 0 | ||
1598 | 1608 | ||
1599 | # | 1609 | # |
1600 | # NOTE: The following label name should be changed to | 1610 | # NOTE: The following label name should be changed to |
@@ -1707,7 +1717,9 @@ Lppcasm_div8: | |||
1707 | Lppcasm_div9: | 1717 | Lppcasm_div9: |
1708 | or r3,r8,r0 | 1718 | or r3,r8,r0 |
1709 | blr | 1719 | blr |
1710 | .long 0x00000000 | 1720 | .long 0 |
1721 | .byte 0,12,0x14,0,0,0,3,0 | ||
1722 | .long 0 | ||
1711 | 1723 | ||
1712 | # | 1724 | # |
1713 | # NOTE: The following label name should be changed to | 1725 | # NOTE: The following label name should be changed to |
@@ -1746,8 +1758,9 @@ Lppcasm_sqr_mainloop: | |||
1746 | bdnz- Lppcasm_sqr_mainloop | 1758 | bdnz- Lppcasm_sqr_mainloop |
1747 | Lppcasm_sqr_adios: | 1759 | Lppcasm_sqr_adios: |
1748 | blr | 1760 | blr |
1749 | .long 0x00000000 | 1761 | .long 0 |
1750 | 1762 | .byte 0,12,0x14,0,0,0,3,0 | |
1763 | .long 0 | ||
1751 | 1764 | ||
1752 | # | 1765 | # |
1753 | # NOTE: The following label name should be changed to | 1766 | # NOTE: The following label name should be changed to |
@@ -1850,7 +1863,9 @@ Lppcasm_mw_REM: | |||
1850 | Lppcasm_mw_OVER: | 1863 | Lppcasm_mw_OVER: |
1851 | addi r3,r12,0 | 1864 | addi r3,r12,0 |
1852 | blr | 1865 | blr |
1853 | .long 0x00000000 | 1866 | .long 0 |
1867 | .byte 0,12,0x14,0,0,0,4,0 | ||
1868 | .long 0 | ||
1854 | 1869 | ||
1855 | # | 1870 | # |
1856 | # NOTE: The following label name should be changed to | 1871 | # NOTE: The following label name should be changed to |
@@ -1973,7 +1988,9 @@ Lppcasm_maw_leftover: | |||
1973 | Lppcasm_maw_adios: | 1988 | Lppcasm_maw_adios: |
1974 | addi r3,r12,0 | 1989 | addi r3,r12,0 |
1975 | blr | 1990 | blr |
1976 | .long 0x00000000 | 1991 | .long 0 |
1992 | .byte 0,12,0x14,0,0,0,4,0 | ||
1993 | .long 0 | ||
1977 | .align 4 | 1994 | .align 4 |
1978 | EOF | 1995 | EOF |
1979 | $data =~ s/\`([^\`]*)\`/eval $1/gem; | 1996 | $data =~ s/\`([^\`]*)\`/eval $1/gem; |
diff --git a/src/lib/libssl/src/crypto/bn/bn.h b/src/lib/libssl/src/crypto/bn/bn.h index a0bc47837d..f34248ec4f 100644 --- a/src/lib/libssl/src/crypto/bn/bn.h +++ b/src/lib/libssl/src/crypto/bn/bn.h | |||
@@ -558,6 +558,17 @@ int BN_is_prime_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, BN_GENCB *cb); | |||
558 | int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, | 558 | int BN_is_prime_fasttest_ex(const BIGNUM *p,int nchecks, BN_CTX *ctx, |
559 | int do_trial_division, BN_GENCB *cb); | 559 | int do_trial_division, BN_GENCB *cb); |
560 | 560 | ||
561 | int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx); | ||
562 | |||
563 | int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, | ||
564 | const BIGNUM *Xp, const BIGNUM *Xp1, const BIGNUM *Xp2, | ||
565 | const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb); | ||
566 | int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, | ||
567 | BIGNUM *Xp1, BIGNUM *Xp2, | ||
568 | const BIGNUM *Xp, | ||
569 | const BIGNUM *e, BN_CTX *ctx, | ||
570 | BN_GENCB *cb); | ||
571 | |||
561 | BN_MONT_CTX *BN_MONT_CTX_new(void ); | 572 | BN_MONT_CTX *BN_MONT_CTX_new(void ); |
562 | void BN_MONT_CTX_init(BN_MONT_CTX *ctx); | 573 | void BN_MONT_CTX_init(BN_MONT_CTX *ctx); |
563 | int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, | 574 | int BN_mod_mul_montgomery(BIGNUM *r,const BIGNUM *a,const BIGNUM *b, |
@@ -612,6 +623,8 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | |||
612 | int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, | 623 | int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, |
613 | BN_RECP_CTX *recp, BN_CTX *ctx); | 624 | BN_RECP_CTX *recp, BN_CTX *ctx); |
614 | 625 | ||
626 | #ifndef OPENSSL_NO_EC2M | ||
627 | |||
615 | /* Functions for arithmetic over binary polynomials represented by BIGNUMs. | 628 | /* Functions for arithmetic over binary polynomials represented by BIGNUMs. |
616 | * | 629 | * |
617 | * The BIGNUM::neg property of BIGNUMs representing binary polynomials is | 630 | * The BIGNUM::neg property of BIGNUMs representing binary polynomials is |
@@ -663,6 +676,8 @@ int BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a, | |||
663 | int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max); | 676 | int BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max); |
664 | int BN_GF2m_arr2poly(const int p[], BIGNUM *a); | 677 | int BN_GF2m_arr2poly(const int p[], BIGNUM *a); |
665 | 678 | ||
679 | #endif | ||
680 | |||
666 | /* faster mod functions for the 'NIST primes' | 681 | /* faster mod functions for the 'NIST primes' |
667 | * 0 <= a < p^2 */ | 682 | * 0 <= a < p^2 */ |
668 | int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); | 683 | int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); |
diff --git a/src/lib/libssl/src/crypto/bn/bn_div.c b/src/lib/libssl/src/crypto/bn/bn_div.c index 802a43d642..52b3304293 100644 --- a/src/lib/libssl/src/crypto/bn/bn_div.c +++ b/src/lib/libssl/src/crypto/bn/bn_div.c | |||
@@ -169,15 +169,13 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, | |||
169 | #endif /* OPENSSL_NO_ASM */ | 169 | #endif /* OPENSSL_NO_ASM */ |
170 | 170 | ||
171 | 171 | ||
172 | /* BN_div[_no_branch] computes dv := num / divisor, rounding towards | 172 | /* BN_div computes dv := num / divisor, rounding towards |
173 | * zero, and sets up rm such that dv*divisor + rm = num holds. | 173 | * zero, and sets up rm such that dv*divisor + rm = num holds. |
174 | * Thus: | 174 | * Thus: |
175 | * dv->neg == num->neg ^ divisor->neg (unless the result is zero) | 175 | * dv->neg == num->neg ^ divisor->neg (unless the result is zero) |
176 | * rm->neg == num->neg (unless the remainder is zero) | 176 | * rm->neg == num->neg (unless the remainder is zero) |
177 | * If 'dv' or 'rm' is NULL, the respective value is not returned. | 177 | * If 'dv' or 'rm' is NULL, the respective value is not returned. |
178 | */ | 178 | */ |
179 | static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, | ||
180 | const BIGNUM *divisor, BN_CTX *ctx); | ||
181 | int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, | 179 | int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, |
182 | BN_CTX *ctx) | 180 | BN_CTX *ctx) |
183 | { | 181 | { |
@@ -186,6 +184,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, | |||
186 | BN_ULONG *resp,*wnump; | 184 | BN_ULONG *resp,*wnump; |
187 | BN_ULONG d0,d1; | 185 | BN_ULONG d0,d1; |
188 | int num_n,div_n; | 186 | int num_n,div_n; |
187 | int no_branch=0; | ||
189 | 188 | ||
190 | /* Invalid zero-padding would have particularly bad consequences | 189 | /* Invalid zero-padding would have particularly bad consequences |
191 | * in the case of 'num', so don't just rely on bn_check_top() for this one | 190 | * in the case of 'num', so don't just rely on bn_check_top() for this one |
@@ -200,7 +199,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, | |||
200 | 199 | ||
201 | if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0)) | 200 | if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0)) |
202 | { | 201 | { |
203 | return BN_div_no_branch(dv, rm, num, divisor, ctx); | 202 | no_branch=1; |
204 | } | 203 | } |
205 | 204 | ||
206 | bn_check_top(dv); | 205 | bn_check_top(dv); |
@@ -214,7 +213,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, | |||
214 | return(0); | 213 | return(0); |
215 | } | 214 | } |
216 | 215 | ||
217 | if (BN_ucmp(num,divisor) < 0) | 216 | if (!no_branch && BN_ucmp(num,divisor) < 0) |
218 | { | 217 | { |
219 | if (rm != NULL) | 218 | if (rm != NULL) |
220 | { if (BN_copy(rm,num) == NULL) return(0); } | 219 | { if (BN_copy(rm,num) == NULL) return(0); } |
@@ -239,242 +238,25 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor, | |||
239 | norm_shift+=BN_BITS2; | 238 | norm_shift+=BN_BITS2; |
240 | if (!(BN_lshift(snum,num,norm_shift))) goto err; | 239 | if (!(BN_lshift(snum,num,norm_shift))) goto err; |
241 | snum->neg=0; | 240 | snum->neg=0; |
242 | div_n=sdiv->top; | ||
243 | num_n=snum->top; | ||
244 | loop=num_n-div_n; | ||
245 | /* Lets setup a 'window' into snum | ||
246 | * This is the part that corresponds to the current | ||
247 | * 'area' being divided */ | ||
248 | wnum.neg = 0; | ||
249 | wnum.d = &(snum->d[loop]); | ||
250 | wnum.top = div_n; | ||
251 | /* only needed when BN_ucmp messes up the values between top and max */ | ||
252 | wnum.dmax = snum->dmax - loop; /* so we don't step out of bounds */ | ||
253 | |||
254 | /* Get the top 2 words of sdiv */ | ||
255 | /* div_n=sdiv->top; */ | ||
256 | d0=sdiv->d[div_n-1]; | ||
257 | d1=(div_n == 1)?0:sdiv->d[div_n-2]; | ||
258 | |||
259 | /* pointer to the 'top' of snum */ | ||
260 | wnump= &(snum->d[num_n-1]); | ||
261 | |||
262 | /* Setup to 'res' */ | ||
263 | res->neg= (num->neg^divisor->neg); | ||
264 | if (!bn_wexpand(res,(loop+1))) goto err; | ||
265 | res->top=loop; | ||
266 | resp= &(res->d[loop-1]); | ||
267 | |||
268 | /* space for temp */ | ||
269 | if (!bn_wexpand(tmp,(div_n+1))) goto err; | ||
270 | 241 | ||
271 | if (BN_ucmp(&wnum,sdiv) >= 0) | 242 | if (no_branch) |
272 | { | 243 | { |
273 | /* If BN_DEBUG_RAND is defined BN_ucmp changes (via | 244 | /* Since we don't know whether snum is larger than sdiv, |
274 | * bn_pollute) the const bignum arguments => | 245 | * we pad snum with enough zeroes without changing its |
275 | * clean the values between top and max again */ | 246 | * value. |
276 | bn_clear_top2max(&wnum); | 247 | */ |
277 | bn_sub_words(wnum.d, wnum.d, sdiv->d, div_n); | 248 | if (snum->top <= sdiv->top+1) |
278 | *resp=1; | ||
279 | } | ||
280 | else | ||
281 | res->top--; | ||
282 | /* if res->top == 0 then clear the neg value otherwise decrease | ||
283 | * the resp pointer */ | ||
284 | if (res->top == 0) | ||
285 | res->neg = 0; | ||
286 | else | ||
287 | resp--; | ||
288 | |||
289 | for (i=0; i<loop-1; i++, wnump--, resp--) | ||
290 | { | ||
291 | BN_ULONG q,l0; | ||
292 | /* the first part of the loop uses the top two words of | ||
293 | * snum and sdiv to calculate a BN_ULONG q such that | ||
294 | * | wnum - sdiv * q | < sdiv */ | ||
295 | #if defined(BN_DIV3W) && !defined(OPENSSL_NO_ASM) | ||
296 | BN_ULONG bn_div_3_words(BN_ULONG*,BN_ULONG,BN_ULONG); | ||
297 | q=bn_div_3_words(wnump,d1,d0); | ||
298 | #else | ||
299 | BN_ULONG n0,n1,rem=0; | ||
300 | |||
301 | n0=wnump[0]; | ||
302 | n1=wnump[-1]; | ||
303 | if (n0 == d0) | ||
304 | q=BN_MASK2; | ||
305 | else /* n0 < d0 */ | ||
306 | { | ||
307 | #ifdef BN_LLONG | ||
308 | BN_ULLONG t2; | ||
309 | |||
310 | #if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words) | ||
311 | q=(BN_ULONG)(((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0); | ||
312 | #else | ||
313 | q=bn_div_words(n0,n1,d0); | ||
314 | #ifdef BN_DEBUG_LEVITTE | ||
315 | fprintf(stderr,"DEBUG: bn_div_words(0x%08X,0x%08X,0x%08\ | ||
316 | X) -> 0x%08X\n", | ||
317 | n0, n1, d0, q); | ||
318 | #endif | ||
319 | #endif | ||
320 | |||
321 | #ifndef REMAINDER_IS_ALREADY_CALCULATED | ||
322 | /* | ||
323 | * rem doesn't have to be BN_ULLONG. The least we | ||
324 | * know it's less that d0, isn't it? | ||
325 | */ | ||
326 | rem=(n1-q*d0)&BN_MASK2; | ||
327 | #endif | ||
328 | t2=(BN_ULLONG)d1*q; | ||
329 | |||
330 | for (;;) | ||
331 | { | ||
332 | if (t2 <= ((((BN_ULLONG)rem)<<BN_BITS2)|wnump[-2])) | ||
333 | break; | ||
334 | q--; | ||
335 | rem += d0; | ||
336 | if (rem < d0) break; /* don't let rem overflow */ | ||
337 | t2 -= d1; | ||
338 | } | ||
339 | #else /* !BN_LLONG */ | ||
340 | BN_ULONG t2l,t2h; | ||
341 | |||
342 | q=bn_div_words(n0,n1,d0); | ||
343 | #ifdef BN_DEBUG_LEVITTE | ||
344 | fprintf(stderr,"DEBUG: bn_div_words(0x%08X,0x%08X,0x%08\ | ||
345 | X) -> 0x%08X\n", | ||
346 | n0, n1, d0, q); | ||
347 | #endif | ||
348 | #ifndef REMAINDER_IS_ALREADY_CALCULATED | ||
349 | rem=(n1-q*d0)&BN_MASK2; | ||
350 | #endif | ||
351 | |||
352 | #if defined(BN_UMULT_LOHI) | ||
353 | BN_UMULT_LOHI(t2l,t2h,d1,q); | ||
354 | #elif defined(BN_UMULT_HIGH) | ||
355 | t2l = d1 * q; | ||
356 | t2h = BN_UMULT_HIGH(d1,q); | ||
357 | #else | ||
358 | { | 249 | { |
359 | BN_ULONG ql, qh; | 250 | if (bn_wexpand(snum, sdiv->top + 2) == NULL) goto err; |
360 | t2l=LBITS(d1); t2h=HBITS(d1); | 251 | for (i = snum->top; i < sdiv->top + 2; i++) snum->d[i] = 0; |
361 | ql =LBITS(q); qh =HBITS(q); | 252 | snum->top = sdiv->top + 2; |
362 | mul64(t2l,t2h,ql,qh); /* t2=(BN_ULLONG)d1*q; */ | ||
363 | } | 253 | } |
364 | #endif | 254 | else |
365 | |||
366 | for (;;) | ||
367 | { | ||
368 | if ((t2h < rem) || | ||
369 | ((t2h == rem) && (t2l <= wnump[-2]))) | ||
370 | break; | ||
371 | q--; | ||
372 | rem += d0; | ||
373 | if (rem < d0) break; /* don't let rem overflow */ | ||
374 | if (t2l < d1) t2h--; t2l -= d1; | ||
375 | } | ||
376 | #endif /* !BN_LLONG */ | ||
377 | } | ||
378 | #endif /* !BN_DIV3W */ | ||
379 | |||
380 | l0=bn_mul_words(tmp->d,sdiv->d,div_n,q); | ||
381 | tmp->d[div_n]=l0; | ||
382 | wnum.d--; | ||
383 | /* ingore top values of the bignums just sub the two | ||
384 | * BN_ULONG arrays with bn_sub_words */ | ||
385 | if (bn_sub_words(wnum.d, wnum.d, tmp->d, div_n+1)) | ||
386 | { | 255 | { |
387 | /* Note: As we have considered only the leading | 256 | if (bn_wexpand(snum, snum->top + 1) == NULL) goto err; |
388 | * two BN_ULONGs in the calculation of q, sdiv * q | 257 | snum->d[snum->top] = 0; |
389 | * might be greater than wnum (but then (q-1) * sdiv | 258 | snum->top ++; |
390 | * is less or equal than wnum) | ||
391 | */ | ||
392 | q--; | ||
393 | if (bn_add_words(wnum.d, wnum.d, sdiv->d, div_n)) | ||
394 | /* we can't have an overflow here (assuming | ||
395 | * that q != 0, but if q == 0 then tmp is | ||
396 | * zero anyway) */ | ||
397 | (*wnump)++; | ||
398 | } | 259 | } |
399 | /* store part of the result */ | ||
400 | *resp = q; | ||
401 | } | ||
402 | bn_correct_top(snum); | ||
403 | if (rm != NULL) | ||
404 | { | ||
405 | /* Keep a copy of the neg flag in num because if rm==num | ||
406 | * BN_rshift() will overwrite it. | ||
407 | */ | ||
408 | int neg = num->neg; | ||
409 | BN_rshift(rm,snum,norm_shift); | ||
410 | if (!BN_is_zero(rm)) | ||
411 | rm->neg = neg; | ||
412 | bn_check_top(rm); | ||
413 | } | ||
414 | BN_CTX_end(ctx); | ||
415 | return(1); | ||
416 | err: | ||
417 | bn_check_top(rm); | ||
418 | BN_CTX_end(ctx); | ||
419 | return(0); | ||
420 | } | ||
421 | |||
422 | |||
423 | /* BN_div_no_branch is a special version of BN_div. It does not contain | ||
424 | * branches that may leak sensitive information. | ||
425 | */ | ||
426 | static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, | ||
427 | const BIGNUM *divisor, BN_CTX *ctx) | ||
428 | { | ||
429 | int norm_shift,i,loop; | ||
430 | BIGNUM *tmp,wnum,*snum,*sdiv,*res; | ||
431 | BN_ULONG *resp,*wnump; | ||
432 | BN_ULONG d0,d1; | ||
433 | int num_n,div_n; | ||
434 | |||
435 | bn_check_top(dv); | ||
436 | bn_check_top(rm); | ||
437 | /* bn_check_top(num); */ /* 'num' has been checked in BN_div() */ | ||
438 | bn_check_top(divisor); | ||
439 | |||
440 | if (BN_is_zero(divisor)) | ||
441 | { | ||
442 | BNerr(BN_F_BN_DIV_NO_BRANCH,BN_R_DIV_BY_ZERO); | ||
443 | return(0); | ||
444 | } | ||
445 | |||
446 | BN_CTX_start(ctx); | ||
447 | tmp=BN_CTX_get(ctx); | ||
448 | snum=BN_CTX_get(ctx); | ||
449 | sdiv=BN_CTX_get(ctx); | ||
450 | if (dv == NULL) | ||
451 | res=BN_CTX_get(ctx); | ||
452 | else res=dv; | ||
453 | if (sdiv == NULL || res == NULL) goto err; | ||
454 | |||
455 | /* First we normalise the numbers */ | ||
456 | norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2); | ||
457 | if (!(BN_lshift(sdiv,divisor,norm_shift))) goto err; | ||
458 | sdiv->neg=0; | ||
459 | norm_shift+=BN_BITS2; | ||
460 | if (!(BN_lshift(snum,num,norm_shift))) goto err; | ||
461 | snum->neg=0; | ||
462 | |||
463 | /* Since we don't know whether snum is larger than sdiv, | ||
464 | * we pad snum with enough zeroes without changing its | ||
465 | * value. | ||
466 | */ | ||
467 | if (snum->top <= sdiv->top+1) | ||
468 | { | ||
469 | if (bn_wexpand(snum, sdiv->top + 2) == NULL) goto err; | ||
470 | for (i = snum->top; i < sdiv->top + 2; i++) snum->d[i] = 0; | ||
471 | snum->top = sdiv->top + 2; | ||
472 | } | ||
473 | else | ||
474 | { | ||
475 | if (bn_wexpand(snum, snum->top + 1) == NULL) goto err; | ||
476 | snum->d[snum->top] = 0; | ||
477 | snum->top ++; | ||
478 | } | 260 | } |
479 | 261 | ||
480 | div_n=sdiv->top; | 262 | div_n=sdiv->top; |
@@ -500,12 +282,27 @@ static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, | |||
500 | /* Setup to 'res' */ | 282 | /* Setup to 'res' */ |
501 | res->neg= (num->neg^divisor->neg); | 283 | res->neg= (num->neg^divisor->neg); |
502 | if (!bn_wexpand(res,(loop+1))) goto err; | 284 | if (!bn_wexpand(res,(loop+1))) goto err; |
503 | res->top=loop-1; | 285 | res->top=loop-no_branch; |
504 | resp= &(res->d[loop-1]); | 286 | resp= &(res->d[loop-1]); |
505 | 287 | ||
506 | /* space for temp */ | 288 | /* space for temp */ |
507 | if (!bn_wexpand(tmp,(div_n+1))) goto err; | 289 | if (!bn_wexpand(tmp,(div_n+1))) goto err; |
508 | 290 | ||
291 | if (!no_branch) | ||
292 | { | ||
293 | if (BN_ucmp(&wnum,sdiv) >= 0) | ||
294 | { | ||
295 | /* If BN_DEBUG_RAND is defined BN_ucmp changes (via | ||
296 | * bn_pollute) the const bignum arguments => | ||
297 | * clean the values between top and max again */ | ||
298 | bn_clear_top2max(&wnum); | ||
299 | bn_sub_words(wnum.d, wnum.d, sdiv->d, div_n); | ||
300 | *resp=1; | ||
301 | } | ||
302 | else | ||
303 | res->top--; | ||
304 | } | ||
305 | |||
509 | /* if res->top == 0 then clear the neg value otherwise decrease | 306 | /* if res->top == 0 then clear the neg value otherwise decrease |
510 | * the resp pointer */ | 307 | * the resp pointer */ |
511 | if (res->top == 0) | 308 | if (res->top == 0) |
@@ -638,7 +435,7 @@ X) -> 0x%08X\n", | |||
638 | rm->neg = neg; | 435 | rm->neg = neg; |
639 | bn_check_top(rm); | 436 | bn_check_top(rm); |
640 | } | 437 | } |
641 | bn_correct_top(res); | 438 | if (no_branch) bn_correct_top(res); |
642 | BN_CTX_end(ctx); | 439 | BN_CTX_end(ctx); |
643 | return(1); | 440 | return(1); |
644 | err: | 441 | err: |
@@ -646,5 +443,4 @@ err: | |||
646 | BN_CTX_end(ctx); | 443 | BN_CTX_end(ctx); |
647 | return(0); | 444 | return(0); |
648 | } | 445 | } |
649 | |||
650 | #endif | 446 | #endif |
diff --git a/src/lib/libssl/src/crypto/bn/bn_exp.c b/src/lib/libssl/src/crypto/bn/bn_exp.c index d9b6c737fc..2abf6fd678 100644 --- a/src/lib/libssl/src/crypto/bn/bn_exp.c +++ b/src/lib/libssl/src/crypto/bn/bn_exp.c | |||
@@ -113,6 +113,18 @@ | |||
113 | #include "cryptlib.h" | 113 | #include "cryptlib.h" |
114 | #include "bn_lcl.h" | 114 | #include "bn_lcl.h" |
115 | 115 | ||
116 | #include <stdlib.h> | ||
117 | #ifdef _WIN32 | ||
118 | # include <malloc.h> | ||
119 | # ifndef alloca | ||
120 | # define alloca _alloca | ||
121 | # endif | ||
122 | #elif defined(__GNUC__) | ||
123 | # ifndef alloca | ||
124 | # define alloca(s) __builtin_alloca((s)) | ||
125 | # endif | ||
126 | #endif | ||
127 | |||
116 | /* maximum precomputation table size for *variable* sliding windows */ | 128 | /* maximum precomputation table size for *variable* sliding windows */ |
117 | #define TABLE_SIZE 32 | 129 | #define TABLE_SIZE 32 |
118 | 130 | ||
@@ -522,23 +534,17 @@ err: | |||
522 | * as cache lines are concerned. The following functions are used to transfer a BIGNUM | 534 | * as cache lines are concerned. The following functions are used to transfer a BIGNUM |
523 | * from/to that table. */ | 535 | * from/to that table. */ |
524 | 536 | ||
525 | static int MOD_EXP_CTIME_COPY_TO_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, int width) | 537 | static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top, unsigned char *buf, int idx, int width) |
526 | { | 538 | { |
527 | size_t i, j; | 539 | size_t i, j; |
528 | 540 | ||
529 | if (bn_wexpand(b, top) == NULL) | 541 | if (top > b->top) |
530 | return 0; | 542 | top = b->top; /* this works because 'buf' is explicitly zeroed */ |
531 | while (b->top < top) | ||
532 | { | ||
533 | b->d[b->top++] = 0; | ||
534 | } | ||
535 | |||
536 | for (i = 0, j=idx; i < top * sizeof b->d[0]; i++, j+=width) | 543 | for (i = 0, j=idx; i < top * sizeof b->d[0]; i++, j+=width) |
537 | { | 544 | { |
538 | buf[j] = ((unsigned char*)b->d)[i]; | 545 | buf[j] = ((unsigned char*)b->d)[i]; |
539 | } | 546 | } |
540 | 547 | ||
541 | bn_correct_top(b); | ||
542 | return 1; | 548 | return 1; |
543 | } | 549 | } |
544 | 550 | ||
@@ -561,7 +567,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf | |||
561 | 567 | ||
562 | /* Given a pointer value, compute the next address that is a cache line multiple. */ | 568 | /* Given a pointer value, compute the next address that is a cache line multiple. */ |
563 | #define MOD_EXP_CTIME_ALIGN(x_) \ | 569 | #define MOD_EXP_CTIME_ALIGN(x_) \ |
564 | ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ULONG)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK)))) | 570 | ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK)))) |
565 | 571 | ||
566 | /* This variant of BN_mod_exp_mont() uses fixed windows and the special | 572 | /* This variant of BN_mod_exp_mont() uses fixed windows and the special |
567 | * precomputation memory layout to limit data-dependency to a minimum | 573 | * precomputation memory layout to limit data-dependency to a minimum |
@@ -572,17 +578,15 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf | |||
572 | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, | 578 | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, |
573 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) | 579 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont) |
574 | { | 580 | { |
575 | int i,bits,ret=0,idx,window,wvalue; | 581 | int i,bits,ret=0,window,wvalue; |
576 | int top; | 582 | int top; |
577 | BIGNUM *r; | ||
578 | const BIGNUM *aa; | ||
579 | BN_MONT_CTX *mont=NULL; | 583 | BN_MONT_CTX *mont=NULL; |
580 | 584 | ||
581 | int numPowers; | 585 | int numPowers; |
582 | unsigned char *powerbufFree=NULL; | 586 | unsigned char *powerbufFree=NULL; |
583 | int powerbufLen = 0; | 587 | int powerbufLen = 0; |
584 | unsigned char *powerbuf=NULL; | 588 | unsigned char *powerbuf=NULL; |
585 | BIGNUM *computeTemp=NULL, *am=NULL; | 589 | BIGNUM tmp, am; |
586 | 590 | ||
587 | bn_check_top(a); | 591 | bn_check_top(a); |
588 | bn_check_top(p); | 592 | bn_check_top(p); |
@@ -602,10 +606,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, | |||
602 | return ret; | 606 | return ret; |
603 | } | 607 | } |
604 | 608 | ||
605 | /* Initialize BIGNUM context and allocate intermediate result */ | ||
606 | BN_CTX_start(ctx); | 609 | BN_CTX_start(ctx); |
607 | r = BN_CTX_get(ctx); | ||
608 | if (r == NULL) goto err; | ||
609 | 610 | ||
610 | /* Allocate a montgomery context if it was not supplied by the caller. | 611 | /* Allocate a montgomery context if it was not supplied by the caller. |
611 | * If this is not done, things will break in the montgomery part. | 612 | * If this is not done, things will break in the montgomery part. |
@@ -620,40 +621,154 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, | |||
620 | 621 | ||
621 | /* Get the window size to use with size of p. */ | 622 | /* Get the window size to use with size of p. */ |
622 | window = BN_window_bits_for_ctime_exponent_size(bits); | 623 | window = BN_window_bits_for_ctime_exponent_size(bits); |
624 | #if defined(OPENSSL_BN_ASM_MONT5) | ||
625 | if (window==6 && bits<=1024) window=5; /* ~5% improvement of 2048-bit RSA sign */ | ||
626 | #endif | ||
623 | 627 | ||
624 | /* Allocate a buffer large enough to hold all of the pre-computed | 628 | /* Allocate a buffer large enough to hold all of the pre-computed |
625 | * powers of a. | 629 | * powers of am, am itself and tmp. |
626 | */ | 630 | */ |
627 | numPowers = 1 << window; | 631 | numPowers = 1 << window; |
628 | powerbufLen = sizeof(m->d[0])*top*numPowers; | 632 | powerbufLen = sizeof(m->d[0])*(top*numPowers + |
633 | ((2*top)>numPowers?(2*top):numPowers)); | ||
634 | #ifdef alloca | ||
635 | if (powerbufLen < 3072) | ||
636 | powerbufFree = alloca(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH); | ||
637 | else | ||
638 | #endif | ||
629 | if ((powerbufFree=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL) | 639 | if ((powerbufFree=(unsigned char*)OPENSSL_malloc(powerbufLen+MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL) |
630 | goto err; | 640 | goto err; |
631 | 641 | ||
632 | powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree); | 642 | powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree); |
633 | memset(powerbuf, 0, powerbufLen); | 643 | memset(powerbuf, 0, powerbufLen); |
634 | 644 | ||
635 | /* Initialize the intermediate result. Do this early to save double conversion, | 645 | #ifdef alloca |
636 | * once each for a^0 and intermediate result. | 646 | if (powerbufLen < 3072) |
637 | */ | 647 | powerbufFree = NULL; |
638 | if (!BN_to_montgomery(r,BN_value_one(),mont,ctx)) goto err; | 648 | #endif |
639 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(r, top, powerbuf, 0, numPowers)) goto err; | ||
640 | 649 | ||
641 | /* Initialize computeTemp as a^1 with montgomery precalcs */ | 650 | /* lay down tmp and am right after powers table */ |
642 | computeTemp = BN_CTX_get(ctx); | 651 | tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0])*top*numPowers); |
643 | am = BN_CTX_get(ctx); | 652 | am.d = tmp.d + top; |
644 | if (computeTemp==NULL || am==NULL) goto err; | 653 | tmp.top = am.top = 0; |
654 | tmp.dmax = am.dmax = top; | ||
655 | tmp.neg = am.neg = 0; | ||
656 | tmp.flags = am.flags = BN_FLG_STATIC_DATA; | ||
657 | |||
658 | /* prepare a^0 in Montgomery domain */ | ||
659 | #if 1 | ||
660 | if (!BN_to_montgomery(&tmp,BN_value_one(),mont,ctx)) goto err; | ||
661 | #else | ||
662 | tmp.d[0] = (0-m->d[0])&BN_MASK2; /* 2^(top*BN_BITS2) - m */ | ||
663 | for (i=1;i<top;i++) | ||
664 | tmp.d[i] = (~m->d[i])&BN_MASK2; | ||
665 | tmp.top = top; | ||
666 | #endif | ||
645 | 667 | ||
668 | /* prepare a^1 in Montgomery domain */ | ||
646 | if (a->neg || BN_ucmp(a,m) >= 0) | 669 | if (a->neg || BN_ucmp(a,m) >= 0) |
647 | { | 670 | { |
648 | if (!BN_mod(am,a,m,ctx)) | 671 | if (!BN_mod(&am,a,m,ctx)) goto err; |
649 | goto err; | 672 | if (!BN_to_montgomery(&am,&am,mont,ctx)) goto err; |
650 | aa= am; | ||
651 | } | 673 | } |
652 | else | 674 | else if (!BN_to_montgomery(&am,a,mont,ctx)) goto err; |
653 | aa=a; | 675 | |
654 | if (!BN_to_montgomery(am,aa,mont,ctx)) goto err; | 676 | #if defined(OPENSSL_BN_ASM_MONT5) |
655 | if (!BN_copy(computeTemp, am)) goto err; | 677 | /* This optimization uses ideas from http://eprint.iacr.org/2011/239, |
656 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(am, top, powerbuf, 1, numPowers)) goto err; | 678 | * specifically optimization of cache-timing attack countermeasures |
679 | * and pre-computation optimization. */ | ||
680 | |||
681 | /* Dedicated window==4 case improves 512-bit RSA sign by ~15%, but as | ||
682 | * 512-bit RSA is hardly relevant, we omit it to spare size... */ | ||
683 | if (window==5) | ||
684 | { | ||
685 | void bn_mul_mont_gather5(BN_ULONG *rp,const BN_ULONG *ap, | ||
686 | const void *table,const BN_ULONG *np, | ||
687 | const BN_ULONG *n0,int num,int power); | ||
688 | void bn_scatter5(const BN_ULONG *inp,size_t num, | ||
689 | void *table,size_t power); | ||
690 | void bn_gather5(BN_ULONG *out,size_t num, | ||
691 | void *table,size_t power); | ||
692 | |||
693 | BN_ULONG *np=mont->N.d, *n0=mont->n0; | ||
694 | |||
695 | /* BN_to_montgomery can contaminate words above .top | ||
696 | * [in BN_DEBUG[_DEBUG] build]... */ | ||
697 | for (i=am.top; i<top; i++) am.d[i]=0; | ||
698 | for (i=tmp.top; i<top; i++) tmp.d[i]=0; | ||
699 | |||
700 | bn_scatter5(tmp.d,top,powerbuf,0); | ||
701 | bn_scatter5(am.d,am.top,powerbuf,1); | ||
702 | bn_mul_mont(tmp.d,am.d,am.d,np,n0,top); | ||
703 | bn_scatter5(tmp.d,top,powerbuf,2); | ||
704 | |||
705 | #if 0 | ||
706 | for (i=3; i<32; i++) | ||
707 | { | ||
708 | /* Calculate a^i = a^(i-1) * a */ | ||
709 | bn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1); | ||
710 | bn_scatter5(tmp.d,top,powerbuf,i); | ||
711 | } | ||
712 | #else | ||
713 | /* same as above, but uses squaring for 1/2 of operations */ | ||
714 | for (i=4; i<32; i*=2) | ||
715 | { | ||
716 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
717 | bn_scatter5(tmp.d,top,powerbuf,i); | ||
718 | } | ||
719 | for (i=3; i<8; i+=2) | ||
720 | { | ||
721 | int j; | ||
722 | bn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1); | ||
723 | bn_scatter5(tmp.d,top,powerbuf,i); | ||
724 | for (j=2*i; j<32; j*=2) | ||
725 | { | ||
726 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
727 | bn_scatter5(tmp.d,top,powerbuf,j); | ||
728 | } | ||
729 | } | ||
730 | for (; i<16; i+=2) | ||
731 | { | ||
732 | bn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1); | ||
733 | bn_scatter5(tmp.d,top,powerbuf,i); | ||
734 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
735 | bn_scatter5(tmp.d,top,powerbuf,2*i); | ||
736 | } | ||
737 | for (; i<32; i+=2) | ||
738 | { | ||
739 | bn_mul_mont_gather5(tmp.d,am.d,powerbuf,np,n0,top,i-1); | ||
740 | bn_scatter5(tmp.d,top,powerbuf,i); | ||
741 | } | ||
742 | #endif | ||
743 | bits--; | ||
744 | for (wvalue=0, i=bits%5; i>=0; i--,bits--) | ||
745 | wvalue = (wvalue<<1)+BN_is_bit_set(p,bits); | ||
746 | bn_gather5(tmp.d,top,powerbuf,wvalue); | ||
747 | |||
748 | /* Scan the exponent one window at a time starting from the most | ||
749 | * significant bits. | ||
750 | */ | ||
751 | while (bits >= 0) | ||
752 | { | ||
753 | for (wvalue=0, i=0; i<5; i++,bits--) | ||
754 | wvalue = (wvalue<<1)+BN_is_bit_set(p,bits); | ||
755 | |||
756 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
757 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
758 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
759 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
760 | bn_mul_mont(tmp.d,tmp.d,tmp.d,np,n0,top); | ||
761 | bn_mul_mont_gather5(tmp.d,tmp.d,powerbuf,np,n0,top,wvalue); | ||
762 | } | ||
763 | |||
764 | tmp.top=top; | ||
765 | bn_correct_top(&tmp); | ||
766 | } | ||
767 | else | ||
768 | #endif | ||
769 | { | ||
770 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, numPowers)) goto err; | ||
771 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, numPowers)) goto err; | ||
657 | 772 | ||
658 | /* If the window size is greater than 1, then calculate | 773 | /* If the window size is greater than 1, then calculate |
659 | * val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) | 774 | * val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) |
@@ -662,62 +777,54 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, | |||
662 | */ | 777 | */ |
663 | if (window > 1) | 778 | if (window > 1) |
664 | { | 779 | { |
665 | for (i=2; i<numPowers; i++) | 780 | if (!BN_mod_mul_montgomery(&tmp,&am,&am,mont,ctx)) goto err; |
781 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2, numPowers)) goto err; | ||
782 | for (i=3; i<numPowers; i++) | ||
666 | { | 783 | { |
667 | /* Calculate a^i = a^(i-1) * a */ | 784 | /* Calculate a^i = a^(i-1) * a */ |
668 | if (!BN_mod_mul_montgomery(computeTemp,am,computeTemp,mont,ctx)) | 785 | if (!BN_mod_mul_montgomery(&tmp,&am,&tmp,mont,ctx)) |
669 | goto err; | 786 | goto err; |
670 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(computeTemp, top, powerbuf, i, numPowers)) goto err; | 787 | if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i, numPowers)) goto err; |
671 | } | 788 | } |
672 | } | 789 | } |
673 | 790 | ||
674 | /* Adjust the number of bits up to a multiple of the window size. | 791 | bits--; |
675 | * If the exponent length is not a multiple of the window size, then | 792 | for (wvalue=0, i=bits%window; i>=0; i--,bits--) |
676 | * this pads the most significant bits with zeros to normalize the | 793 | wvalue = (wvalue<<1)+BN_is_bit_set(p,bits); |
677 | * scanning loop to there's no special cases. | 794 | if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp,top,powerbuf,wvalue,numPowers)) goto err; |
678 | * | 795 | |
679 | * * NOTE: Making the window size a power of two less than the native | 796 | /* Scan the exponent one window at a time starting from the most |
680 | * * word size ensures that the padded bits won't go past the last | 797 | * significant bits. |
681 | * * word in the internal BIGNUM structure. Going past the end will | 798 | */ |
682 | * * still produce the correct result, but causes a different branch | 799 | while (bits >= 0) |
683 | * * to be taken in the BN_is_bit_set function. | ||
684 | */ | ||
685 | bits = ((bits+window-1)/window)*window; | ||
686 | idx=bits-1; /* The top bit of the window */ | ||
687 | |||
688 | /* Scan the exponent one window at a time starting from the most | ||
689 | * significant bits. | ||
690 | */ | ||
691 | while (idx >= 0) | ||
692 | { | 800 | { |
693 | wvalue=0; /* The 'value' of the window */ | 801 | wvalue=0; /* The 'value' of the window */ |
694 | 802 | ||
695 | /* Scan the window, squaring the result as we go */ | 803 | /* Scan the window, squaring the result as we go */ |
696 | for (i=0; i<window; i++,idx--) | 804 | for (i=0; i<window; i++,bits--) |
697 | { | 805 | { |
698 | if (!BN_mod_mul_montgomery(r,r,r,mont,ctx)) goto err; | 806 | if (!BN_mod_mul_montgomery(&tmp,&tmp,&tmp,mont,ctx)) goto err; |
699 | wvalue = (wvalue<<1)+BN_is_bit_set(p,idx); | 807 | wvalue = (wvalue<<1)+BN_is_bit_set(p,bits); |
700 | } | 808 | } |
701 | 809 | ||
702 | /* Fetch the appropriate pre-computed value from the pre-buf */ | 810 | /* Fetch the appropriate pre-computed value from the pre-buf */ |
703 | if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(computeTemp, top, powerbuf, wvalue, numPowers)) goto err; | 811 | if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue, numPowers)) goto err; |
704 | 812 | ||
705 | /* Multiply the result into the intermediate result */ | 813 | /* Multiply the result into the intermediate result */ |
706 | if (!BN_mod_mul_montgomery(r,r,computeTemp,mont,ctx)) goto err; | 814 | if (!BN_mod_mul_montgomery(&tmp,&tmp,&am,mont,ctx)) goto err; |
707 | } | 815 | } |
816 | } | ||
708 | 817 | ||
709 | /* Convert the final result from montgomery to standard format */ | 818 | /* Convert the final result from montgomery to standard format */ |
710 | if (!BN_from_montgomery(rr,r,mont,ctx)) goto err; | 819 | if (!BN_from_montgomery(rr,&tmp,mont,ctx)) goto err; |
711 | ret=1; | 820 | ret=1; |
712 | err: | 821 | err: |
713 | if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont); | 822 | if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont); |
714 | if (powerbuf!=NULL) | 823 | if (powerbuf!=NULL) |
715 | { | 824 | { |
716 | OPENSSL_cleanse(powerbuf,powerbufLen); | 825 | OPENSSL_cleanse(powerbuf,powerbufLen); |
717 | OPENSSL_free(powerbufFree); | 826 | if (powerbufFree) OPENSSL_free(powerbufFree); |
718 | } | 827 | } |
719 | if (am!=NULL) BN_clear(am); | ||
720 | if (computeTemp!=NULL) BN_clear(computeTemp); | ||
721 | BN_CTX_end(ctx); | 828 | BN_CTX_end(ctx); |
722 | return(ret); | 829 | return(ret); |
723 | } | 830 | } |
@@ -988,4 +1095,3 @@ err: | |||
988 | bn_check_top(r); | 1095 | bn_check_top(r); |
989 | return(ret); | 1096 | return(ret); |
990 | } | 1097 | } |
991 | |||
diff --git a/src/lib/libssl/src/crypto/bn/bn_lcl.h b/src/lib/libssl/src/crypto/bn/bn_lcl.h index 8e5e98e3f2..eecfd8cc99 100644 --- a/src/lib/libssl/src/crypto/bn/bn_lcl.h +++ b/src/lib/libssl/src/crypto/bn/bn_lcl.h | |||
@@ -238,7 +238,7 @@ extern "C" { | |||
238 | # if defined(__DECC) | 238 | # if defined(__DECC) |
239 | # include <c_asm.h> | 239 | # include <c_asm.h> |
240 | # define BN_UMULT_HIGH(a,b) (BN_ULONG)asm("umulh %a0,%a1,%v0",(a),(b)) | 240 | # define BN_UMULT_HIGH(a,b) (BN_ULONG)asm("umulh %a0,%a1,%v0",(a),(b)) |
241 | # elif defined(__GNUC__) | 241 | # elif defined(__GNUC__) && __GNUC__>=2 |
242 | # define BN_UMULT_HIGH(a,b) ({ \ | 242 | # define BN_UMULT_HIGH(a,b) ({ \ |
243 | register BN_ULONG ret; \ | 243 | register BN_ULONG ret; \ |
244 | asm ("umulh %1,%2,%0" \ | 244 | asm ("umulh %1,%2,%0" \ |
@@ -247,7 +247,7 @@ extern "C" { | |||
247 | ret; }) | 247 | ret; }) |
248 | # endif /* compiler */ | 248 | # endif /* compiler */ |
249 | # elif defined(_ARCH_PPC) && defined(__64BIT__) && defined(SIXTY_FOUR_BIT_LONG) | 249 | # elif defined(_ARCH_PPC) && defined(__64BIT__) && defined(SIXTY_FOUR_BIT_LONG) |
250 | # if defined(__GNUC__) | 250 | # if defined(__GNUC__) && __GNUC__>=2 |
251 | # define BN_UMULT_HIGH(a,b) ({ \ | 251 | # define BN_UMULT_HIGH(a,b) ({ \ |
252 | register BN_ULONG ret; \ | 252 | register BN_ULONG ret; \ |
253 | asm ("mulhdu %0,%1,%2" \ | 253 | asm ("mulhdu %0,%1,%2" \ |
@@ -257,7 +257,7 @@ extern "C" { | |||
257 | # endif /* compiler */ | 257 | # endif /* compiler */ |
258 | # elif (defined(__x86_64) || defined(__x86_64__)) && \ | 258 | # elif (defined(__x86_64) || defined(__x86_64__)) && \ |
259 | (defined(SIXTY_FOUR_BIT_LONG) || defined(SIXTY_FOUR_BIT)) | 259 | (defined(SIXTY_FOUR_BIT_LONG) || defined(SIXTY_FOUR_BIT)) |
260 | # if defined(__GNUC__) | 260 | # if defined(__GNUC__) && __GNUC__>=2 |
261 | # define BN_UMULT_HIGH(a,b) ({ \ | 261 | # define BN_UMULT_HIGH(a,b) ({ \ |
262 | register BN_ULONG ret,discard; \ | 262 | register BN_ULONG ret,discard; \ |
263 | asm ("mulq %3" \ | 263 | asm ("mulq %3" \ |
@@ -280,6 +280,19 @@ extern "C" { | |||
280 | # define BN_UMULT_HIGH(a,b) __umulh((a),(b)) | 280 | # define BN_UMULT_HIGH(a,b) __umulh((a),(b)) |
281 | # define BN_UMULT_LOHI(low,high,a,b) ((low)=_umul128((a),(b),&(high))) | 281 | # define BN_UMULT_LOHI(low,high,a,b) ((low)=_umul128((a),(b),&(high))) |
282 | # endif | 282 | # endif |
283 | # elif defined(__mips) && (defined(SIXTY_FOUR_BIT) || defined(SIXTY_FOUR_BIT_LONG)) | ||
284 | # if defined(__GNUC__) && __GNUC__>=2 | ||
285 | # define BN_UMULT_HIGH(a,b) ({ \ | ||
286 | register BN_ULONG ret; \ | ||
287 | asm ("dmultu %1,%2" \ | ||
288 | : "=h"(ret) \ | ||
289 | : "r"(a), "r"(b) : "l"); \ | ||
290 | ret; }) | ||
291 | # define BN_UMULT_LOHI(low,high,a,b) \ | ||
292 | asm ("dmultu %2,%3" \ | ||
293 | : "=l"(low),"=h"(high) \ | ||
294 | : "r"(a), "r"(b)); | ||
295 | # endif | ||
283 | # endif /* cpu */ | 296 | # endif /* cpu */ |
284 | #endif /* OPENSSL_NO_ASM */ | 297 | #endif /* OPENSSL_NO_ASM */ |
285 | 298 | ||
@@ -459,6 +472,10 @@ extern "C" { | |||
459 | } | 472 | } |
460 | #endif /* !BN_LLONG */ | 473 | #endif /* !BN_LLONG */ |
461 | 474 | ||
475 | #if defined(OPENSSL_DOING_MAKEDEPEND) && defined(OPENSSL_FIPS) | ||
476 | #undef bn_div_words | ||
477 | #endif | ||
478 | |||
462 | void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb); | 479 | void bn_mul_normal(BN_ULONG *r,BN_ULONG *a,int na,BN_ULONG *b,int nb); |
463 | void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); | 480 | void bn_mul_comba8(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); |
464 | void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); | 481 | void bn_mul_comba4(BN_ULONG *r,BN_ULONG *a,BN_ULONG *b); |
diff --git a/src/lib/libssl/src/crypto/bn/bn_lib.c b/src/lib/libssl/src/crypto/bn/bn_lib.c index 5470fbe6ef..7a5676de69 100644 --- a/src/lib/libssl/src/crypto/bn/bn_lib.c +++ b/src/lib/libssl/src/crypto/bn/bn_lib.c | |||
@@ -139,25 +139,6 @@ const BIGNUM *BN_value_one(void) | |||
139 | return(&const_one); | 139 | return(&const_one); |
140 | } | 140 | } |
141 | 141 | ||
142 | char *BN_options(void) | ||
143 | { | ||
144 | static int init=0; | ||
145 | static char data[16]; | ||
146 | |||
147 | if (!init) | ||
148 | { | ||
149 | init++; | ||
150 | #ifdef BN_LLONG | ||
151 | BIO_snprintf(data,sizeof data,"bn(%d,%d)", | ||
152 | (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8); | ||
153 | #else | ||
154 | BIO_snprintf(data,sizeof data,"bn(%d,%d)", | ||
155 | (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8); | ||
156 | #endif | ||
157 | } | ||
158 | return(data); | ||
159 | } | ||
160 | |||
161 | int BN_num_bits_word(BN_ULONG l) | 142 | int BN_num_bits_word(BN_ULONG l) |
162 | { | 143 | { |
163 | static const unsigned char bits[256]={ | 144 | static const unsigned char bits[256]={ |
diff --git a/src/lib/libssl/src/crypto/bn/bn_mont.c b/src/lib/libssl/src/crypto/bn/bn_mont.c index 1a866880f5..427b5cf4df 100644 --- a/src/lib/libssl/src/crypto/bn/bn_mont.c +++ b/src/lib/libssl/src/crypto/bn/bn_mont.c | |||
@@ -177,31 +177,26 @@ err: | |||
177 | static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) | 177 | static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) |
178 | { | 178 | { |
179 | BIGNUM *n; | 179 | BIGNUM *n; |
180 | BN_ULONG *ap,*np,*rp,n0,v,*nrp; | 180 | BN_ULONG *ap,*np,*rp,n0,v,carry; |
181 | int al,nl,max,i,x,ri; | 181 | int nl,max,i; |
182 | 182 | ||
183 | n= &(mont->N); | 183 | n= &(mont->N); |
184 | /* mont->ri is the size of mont->N in bits (rounded up | ||
185 | to the word size) */ | ||
186 | al=ri=mont->ri/BN_BITS2; | ||
187 | |||
188 | nl=n->top; | 184 | nl=n->top; |
189 | if ((al == 0) || (nl == 0)) { ret->top=0; return(1); } | 185 | if (nl == 0) { ret->top=0; return(1); } |
190 | 186 | ||
191 | max=(nl+al+1); /* allow for overflow (no?) XXX */ | 187 | max=(2*nl); /* carry is stored separately */ |
192 | if (bn_wexpand(r,max) == NULL) return(0); | 188 | if (bn_wexpand(r,max) == NULL) return(0); |
193 | 189 | ||
194 | r->neg^=n->neg; | 190 | r->neg^=n->neg; |
195 | np=n->d; | 191 | np=n->d; |
196 | rp=r->d; | 192 | rp=r->d; |
197 | nrp= &(r->d[nl]); | ||
198 | 193 | ||
199 | /* clear the top words of T */ | 194 | /* clear the top words of T */ |
200 | #if 1 | 195 | #if 1 |
201 | for (i=r->top; i<max; i++) /* memset? XXX */ | 196 | for (i=r->top; i<max; i++) /* memset? XXX */ |
202 | r->d[i]=0; | 197 | rp[i]=0; |
203 | #else | 198 | #else |
204 | memset(&(r->d[r->top]),0,(max-r->top)*sizeof(BN_ULONG)); | 199 | memset(&(rp[r->top]),0,(max-r->top)*sizeof(BN_ULONG)); |
205 | #endif | 200 | #endif |
206 | 201 | ||
207 | r->top=max; | 202 | r->top=max; |
@@ -210,7 +205,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) | |||
210 | #ifdef BN_COUNT | 205 | #ifdef BN_COUNT |
211 | fprintf(stderr,"word BN_from_montgomery_word %d * %d\n",nl,nl); | 206 | fprintf(stderr,"word BN_from_montgomery_word %d * %d\n",nl,nl); |
212 | #endif | 207 | #endif |
213 | for (i=0; i<nl; i++) | 208 | for (carry=0, i=0; i<nl; i++, rp++) |
214 | { | 209 | { |
215 | #ifdef __TANDEM | 210 | #ifdef __TANDEM |
216 | { | 211 | { |
@@ -228,61 +223,33 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) | |||
228 | #else | 223 | #else |
229 | v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2); | 224 | v=bn_mul_add_words(rp,np,nl,(rp[0]*n0)&BN_MASK2); |
230 | #endif | 225 | #endif |
231 | nrp++; | 226 | v = (v+carry+rp[nl])&BN_MASK2; |
232 | rp++; | 227 | carry |= (v != rp[nl]); |
233 | if (((nrp[-1]+=v)&BN_MASK2) >= v) | 228 | carry &= (v <= rp[nl]); |
234 | continue; | 229 | rp[nl]=v; |
235 | else | ||
236 | { | ||
237 | if (((++nrp[0])&BN_MASK2) != 0) continue; | ||
238 | if (((++nrp[1])&BN_MASK2) != 0) continue; | ||
239 | for (x=2; (((++nrp[x])&BN_MASK2) == 0); x++) ; | ||
240 | } | ||
241 | } | ||
242 | bn_correct_top(r); | ||
243 | |||
244 | /* mont->ri will be a multiple of the word size and below code | ||
245 | * is kind of BN_rshift(ret,r,mont->ri) equivalent */ | ||
246 | if (r->top <= ri) | ||
247 | { | ||
248 | ret->top=0; | ||
249 | return(1); | ||
250 | } | 230 | } |
251 | al=r->top-ri; | ||
252 | 231 | ||
253 | #define BRANCH_FREE 1 | 232 | if (bn_wexpand(ret,nl) == NULL) return(0); |
254 | #if BRANCH_FREE | 233 | ret->top=nl; |
255 | if (bn_wexpand(ret,ri) == NULL) return(0); | ||
256 | x=0-(((al-ri)>>(sizeof(al)*8-1))&1); | ||
257 | ret->top=x=(ri&~x)|(al&x); /* min(ri,al) */ | ||
258 | ret->neg=r->neg; | 234 | ret->neg=r->neg; |
259 | 235 | ||
260 | rp=ret->d; | 236 | rp=ret->d; |
261 | ap=&(r->d[ri]); | 237 | ap=&(r->d[nl]); |
262 | 238 | ||
239 | #define BRANCH_FREE 1 | ||
240 | #if BRANCH_FREE | ||
263 | { | 241 | { |
264 | size_t m1,m2; | 242 | BN_ULONG *nrp; |
265 | 243 | size_t m; | |
266 | v=bn_sub_words(rp,ap,np,ri); | ||
267 | /* this ----------------^^ works even in al<ri case | ||
268 | * thanks to zealous zeroing of top of the vector in the | ||
269 | * beginning. */ | ||
270 | 244 | ||
271 | /* if (al==ri && !v) || al>ri) nrp=rp; else nrp=ap; */ | 245 | v=bn_sub_words(rp,ap,np,nl)-carry; |
272 | /* in other words if subtraction result is real, then | 246 | /* if subtraction result is real, then |
273 | * trick unconditional memcpy below to perform in-place | 247 | * trick unconditional memcpy below to perform in-place |
274 | * "refresh" instead of actual copy. */ | 248 | * "refresh" instead of actual copy. */ |
275 | m1=0-(size_t)(((al-ri)>>(sizeof(al)*8-1))&1); /* al<ri */ | 249 | m=(0-(size_t)v); |
276 | m2=0-(size_t)(((ri-al)>>(sizeof(al)*8-1))&1); /* al>ri */ | 250 | nrp=(BN_ULONG *)(((PTR_SIZE_INT)rp&~m)|((PTR_SIZE_INT)ap&m)); |
277 | m1|=m2; /* (al!=ri) */ | ||
278 | m1|=(0-(size_t)v); /* (al!=ri || v) */ | ||
279 | m1&=~m2; /* (al!=ri || v) && !al>ri */ | ||
280 | nrp=(BN_ULONG *)(((PTR_SIZE_INT)rp&~m1)|((PTR_SIZE_INT)ap&m1)); | ||
281 | } | ||
282 | 251 | ||
283 | /* 'i<ri' is chosen to eliminate dependency on input data, even | 252 | for (i=0,nl-=4; i<nl; i+=4) |
284 | * though it results in redundant copy in al<ri case. */ | ||
285 | for (i=0,ri-=4; i<ri; i+=4) | ||
286 | { | 253 | { |
287 | BN_ULONG t1,t2,t3,t4; | 254 | BN_ULONG t1,t2,t3,t4; |
288 | 255 | ||
@@ -295,40 +262,15 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) | |||
295 | rp[i+2]=t3; | 262 | rp[i+2]=t3; |
296 | rp[i+3]=t4; | 263 | rp[i+3]=t4; |
297 | } | 264 | } |
298 | for (ri+=4; i<ri; i++) | 265 | for (nl+=4; i<nl; i++) |
299 | rp[i]=nrp[i], ap[i]=0; | 266 | rp[i]=nrp[i], ap[i]=0; |
300 | bn_correct_top(r); | 267 | } |
301 | bn_correct_top(ret); | ||
302 | #else | 268 | #else |
303 | if (bn_wexpand(ret,al) == NULL) return(0); | 269 | if (bn_sub_words (rp,ap,np,nl)-carry) |
304 | ret->top=al; | 270 | memcpy(rp,ap,nl*sizeof(BN_ULONG)); |
305 | ret->neg=r->neg; | ||
306 | |||
307 | rp=ret->d; | ||
308 | ap=&(r->d[ri]); | ||
309 | al-=4; | ||
310 | for (i=0; i<al; i+=4) | ||
311 | { | ||
312 | BN_ULONG t1,t2,t3,t4; | ||
313 | |||
314 | t1=ap[i+0]; | ||
315 | t2=ap[i+1]; | ||
316 | t3=ap[i+2]; | ||
317 | t4=ap[i+3]; | ||
318 | rp[i+0]=t1; | ||
319 | rp[i+1]=t2; | ||
320 | rp[i+2]=t3; | ||
321 | rp[i+3]=t4; | ||
322 | } | ||
323 | al+=4; | ||
324 | for (; i<al; i++) | ||
325 | rp[i]=ap[i]; | ||
326 | |||
327 | if (BN_ucmp(ret, &(mont->N)) >= 0) | ||
328 | { | ||
329 | if (!BN_usub(ret,ret,&(mont->N))) return(0); | ||
330 | } | ||
331 | #endif | 271 | #endif |
272 | bn_correct_top(r); | ||
273 | bn_correct_top(ret); | ||
332 | bn_check_top(ret); | 274 | bn_check_top(ret); |
333 | 275 | ||
334 | return(1); | 276 | return(1); |
diff --git a/src/lib/libssl/src/crypto/bn/bn_print.c b/src/lib/libssl/src/crypto/bn/bn_print.c index bebb466d08..1743b6a7e2 100644 --- a/src/lib/libssl/src/crypto/bn/bn_print.c +++ b/src/lib/libssl/src/crypto/bn/bn_print.c | |||
@@ -357,3 +357,22 @@ end: | |||
357 | return(ret); | 357 | return(ret); |
358 | } | 358 | } |
359 | #endif | 359 | #endif |
360 | |||
361 | char *BN_options(void) | ||
362 | { | ||
363 | static int init=0; | ||
364 | static char data[16]; | ||
365 | |||
366 | if (!init) | ||
367 | { | ||
368 | init++; | ||
369 | #ifdef BN_LLONG | ||
370 | BIO_snprintf(data,sizeof data,"bn(%d,%d)", | ||
371 | (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8); | ||
372 | #else | ||
373 | BIO_snprintf(data,sizeof data,"bn(%d,%d)", | ||
374 | (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8); | ||
375 | #endif | ||
376 | } | ||
377 | return(data); | ||
378 | } | ||
diff --git a/src/lib/libssl/src/crypto/bn/bn_shift.c b/src/lib/libssl/src/crypto/bn/bn_shift.c index c4d301afc4..a6fca2c424 100644 --- a/src/lib/libssl/src/crypto/bn/bn_shift.c +++ b/src/lib/libssl/src/crypto/bn/bn_shift.c | |||
@@ -99,7 +99,7 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a) | |||
99 | int BN_rshift1(BIGNUM *r, const BIGNUM *a) | 99 | int BN_rshift1(BIGNUM *r, const BIGNUM *a) |
100 | { | 100 | { |
101 | BN_ULONG *ap,*rp,t,c; | 101 | BN_ULONG *ap,*rp,t,c; |
102 | int i; | 102 | int i,j; |
103 | 103 | ||
104 | bn_check_top(r); | 104 | bn_check_top(r); |
105 | bn_check_top(a); | 105 | bn_check_top(a); |
@@ -109,22 +109,25 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a) | |||
109 | BN_zero(r); | 109 | BN_zero(r); |
110 | return(1); | 110 | return(1); |
111 | } | 111 | } |
112 | i = a->top; | ||
113 | ap= a->d; | ||
114 | j = i-(ap[i-1]==1); | ||
112 | if (a != r) | 115 | if (a != r) |
113 | { | 116 | { |
114 | if (bn_wexpand(r,a->top) == NULL) return(0); | 117 | if (bn_wexpand(r,j) == NULL) return(0); |
115 | r->top=a->top; | ||
116 | r->neg=a->neg; | 118 | r->neg=a->neg; |
117 | } | 119 | } |
118 | ap=a->d; | ||
119 | rp=r->d; | 120 | rp=r->d; |
120 | c=0; | 121 | t=ap[--i]; |
121 | for (i=a->top-1; i>=0; i--) | 122 | c=(t&1)?BN_TBIT:0; |
123 | if (t>>=1) rp[i]=t; | ||
124 | while (i>0) | ||
122 | { | 125 | { |
123 | t=ap[i]; | 126 | t=ap[--i]; |
124 | rp[i]=((t>>1)&BN_MASK2)|c; | 127 | rp[i]=((t>>1)&BN_MASK2)|c; |
125 | c=(t&1)?BN_TBIT:0; | 128 | c=(t&1)?BN_TBIT:0; |
126 | } | 129 | } |
127 | bn_correct_top(r); | 130 | r->top=j; |
128 | bn_check_top(r); | 131 | bn_check_top(r); |
129 | return(1); | 132 | return(1); |
130 | } | 133 | } |
@@ -182,10 +185,11 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) | |||
182 | BN_zero(r); | 185 | BN_zero(r); |
183 | return(1); | 186 | return(1); |
184 | } | 187 | } |
188 | i = (BN_num_bits(a)-n+(BN_BITS2-1))/BN_BITS2; | ||
185 | if (r != a) | 189 | if (r != a) |
186 | { | 190 | { |
187 | r->neg=a->neg; | 191 | r->neg=a->neg; |
188 | if (bn_wexpand(r,a->top-nw+1) == NULL) return(0); | 192 | if (bn_wexpand(r,i) == NULL) return(0); |
189 | } | 193 | } |
190 | else | 194 | else |
191 | { | 195 | { |
@@ -196,7 +200,7 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) | |||
196 | f= &(a->d[nw]); | 200 | f= &(a->d[nw]); |
197 | t=r->d; | 201 | t=r->d; |
198 | j=a->top-nw; | 202 | j=a->top-nw; |
199 | r->top=j; | 203 | r->top=i; |
200 | 204 | ||
201 | if (rb == 0) | 205 | if (rb == 0) |
202 | { | 206 | { |
@@ -212,9 +216,8 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n) | |||
212 | l= *(f++); | 216 | l= *(f++); |
213 | *(t++) =(tmp|(l<<lb))&BN_MASK2; | 217 | *(t++) =(tmp|(l<<lb))&BN_MASK2; |
214 | } | 218 | } |
215 | *(t++) =(l>>rb)&BN_MASK2; | 219 | if ((l = (l>>rb)&BN_MASK2)) *(t) = l; |
216 | } | 220 | } |
217 | bn_correct_top(r); | ||
218 | bn_check_top(r); | 221 | bn_check_top(r); |
219 | return(1); | 222 | return(1); |
220 | } | 223 | } |
diff --git a/src/lib/libssl/src/crypto/bn/bntest.c b/src/lib/libssl/src/crypto/bn/bntest.c index 0cd99c5b4b..06f5954acc 100644 --- a/src/lib/libssl/src/crypto/bn/bntest.c +++ b/src/lib/libssl/src/crypto/bn/bntest.c | |||
@@ -262,7 +262,7 @@ int main(int argc, char *argv[]) | |||
262 | message(out,"BN_mod_sqrt"); | 262 | message(out,"BN_mod_sqrt"); |
263 | if (!test_sqrt(out,ctx)) goto err; | 263 | if (!test_sqrt(out,ctx)) goto err; |
264 | (void)BIO_flush(out); | 264 | (void)BIO_flush(out); |
265 | 265 | #ifndef OPENSSL_NO_EC2M | |
266 | message(out,"BN_GF2m_add"); | 266 | message(out,"BN_GF2m_add"); |
267 | if (!test_gf2m_add(out)) goto err; | 267 | if (!test_gf2m_add(out)) goto err; |
268 | (void)BIO_flush(out); | 268 | (void)BIO_flush(out); |
@@ -298,7 +298,7 @@ int main(int argc, char *argv[]) | |||
298 | message(out,"BN_GF2m_mod_solve_quad"); | 298 | message(out,"BN_GF2m_mod_solve_quad"); |
299 | if (!test_gf2m_mod_solve_quad(out,ctx)) goto err; | 299 | if (!test_gf2m_mod_solve_quad(out,ctx)) goto err; |
300 | (void)BIO_flush(out); | 300 | (void)BIO_flush(out); |
301 | 301 | #endif | |
302 | BN_CTX_free(ctx); | 302 | BN_CTX_free(ctx); |
303 | BIO_free(out); | 303 | BIO_free(out); |
304 | 304 | ||
@@ -1061,7 +1061,7 @@ int test_exp(BIO *bp, BN_CTX *ctx) | |||
1061 | BN_free(one); | 1061 | BN_free(one); |
1062 | return(1); | 1062 | return(1); |
1063 | } | 1063 | } |
1064 | 1064 | #ifndef OPENSSL_NO_EC2M | |
1065 | int test_gf2m_add(BIO *bp) | 1065 | int test_gf2m_add(BIO *bp) |
1066 | { | 1066 | { |
1067 | BIGNUM a,b,c; | 1067 | BIGNUM a,b,c; |
@@ -1636,7 +1636,7 @@ int test_gf2m_mod_solve_quad(BIO *bp,BN_CTX *ctx) | |||
1636 | BN_free(e); | 1636 | BN_free(e); |
1637 | return ret; | 1637 | return ret; |
1638 | } | 1638 | } |
1639 | 1639 | #endif | |
1640 | static int genprime_cb(int p, int n, BN_GENCB *arg) | 1640 | static int genprime_cb(int p, int n, BN_GENCB *arg) |
1641 | { | 1641 | { |
1642 | char c='*'; | 1642 | char c='*'; |
diff --git a/src/lib/libssl/src/crypto/buffer/Makefile b/src/lib/libssl/src/crypto/buffer/Makefile index 9f3a88d2d6..2efba47f07 100644 --- a/src/lib/libssl/src/crypto/buffer/Makefile +++ b/src/lib/libssl/src/crypto/buffer/Makefile | |||
@@ -17,8 +17,8 @@ TEST= | |||
17 | APPS= | 17 | APPS= |
18 | 18 | ||
19 | LIB=$(TOP)/libcrypto.a | 19 | LIB=$(TOP)/libcrypto.a |
20 | LIBSRC= buffer.c buf_err.c | 20 | LIBSRC= buffer.c buf_str.c buf_err.c |
21 | LIBOBJ= buffer.o buf_err.o | 21 | LIBOBJ= buffer.o buf_str.o buf_err.o |
22 | 22 | ||
23 | SRC= $(LIBSRC) | 23 | SRC= $(LIBSRC) |
24 | 24 | ||
@@ -81,6 +81,13 @@ buf_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | |||
81 | buf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 81 | buf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
82 | buf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 82 | buf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
83 | buf_err.o: buf_err.c | 83 | buf_err.o: buf_err.c |
84 | buf_str.o: ../../e_os.h ../../include/openssl/bio.h | ||
85 | buf_str.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
86 | buf_str.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | ||
87 | buf_str.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h | ||
88 | buf_str.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
89 | buf_str.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
90 | buf_str.o: ../../include/openssl/symhacks.h ../cryptlib.h buf_str.c | ||
84 | buffer.o: ../../e_os.h ../../include/openssl/bio.h | 91 | buffer.o: ../../e_os.h ../../include/openssl/bio.h |
85 | buffer.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 92 | buffer.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
86 | buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 93 | buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
diff --git a/src/lib/libssl/src/crypto/buffer/buffer.c b/src/lib/libssl/src/crypto/buffer/buffer.c index 620ea8d536..d7aa79ad7f 100644 --- a/src/lib/libssl/src/crypto/buffer/buffer.c +++ b/src/lib/libssl/src/crypto/buffer/buffer.c | |||
@@ -60,6 +60,11 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/buffer.h> | 61 | #include <openssl/buffer.h> |
62 | 62 | ||
63 | /* LIMIT_BEFORE_EXPANSION is the maximum n such that (n+3)/3*4 < 2**31. That | ||
64 | * function is applied in several functions in this file and this limit ensures | ||
65 | * that the result fits in an int. */ | ||
66 | #define LIMIT_BEFORE_EXPANSION 0x5ffffffc | ||
67 | |||
63 | BUF_MEM *BUF_MEM_new(void) | 68 | BUF_MEM *BUF_MEM_new(void) |
64 | { | 69 | { |
65 | BUF_MEM *ret; | 70 | BUF_MEM *ret; |
@@ -105,6 +110,12 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len) | |||
105 | str->length=len; | 110 | str->length=len; |
106 | return(len); | 111 | return(len); |
107 | } | 112 | } |
113 | /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */ | ||
114 | if (len > LIMIT_BEFORE_EXPANSION) | ||
115 | { | ||
116 | BUFerr(BUF_F_BUF_MEM_GROW,ERR_R_MALLOC_FAILURE); | ||
117 | return 0; | ||
118 | } | ||
108 | n=(len+3)/3*4; | 119 | n=(len+3)/3*4; |
109 | if (str->data == NULL) | 120 | if (str->data == NULL) |
110 | ret=OPENSSL_malloc(n); | 121 | ret=OPENSSL_malloc(n); |
@@ -142,6 +153,12 @@ int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) | |||
142 | str->length=len; | 153 | str->length=len; |
143 | return(len); | 154 | return(len); |
144 | } | 155 | } |
156 | /* This limit is sufficient to ensure (len+3)/3*4 < 2**31 */ | ||
157 | if (len > LIMIT_BEFORE_EXPANSION) | ||
158 | { | ||
159 | BUFerr(BUF_F_BUF_MEM_GROW_CLEAN,ERR_R_MALLOC_FAILURE); | ||
160 | return 0; | ||
161 | } | ||
145 | n=(len+3)/3*4; | 162 | n=(len+3)/3*4; |
146 | if (str->data == NULL) | 163 | if (str->data == NULL) |
147 | ret=OPENSSL_malloc(n); | 164 | ret=OPENSSL_malloc(n); |
@@ -162,64 +179,6 @@ int BUF_MEM_grow_clean(BUF_MEM *str, size_t len) | |||
162 | return(len); | 179 | return(len); |
163 | } | 180 | } |
164 | 181 | ||
165 | char *BUF_strdup(const char *str) | ||
166 | { | ||
167 | if (str == NULL) return(NULL); | ||
168 | return BUF_strndup(str, strlen(str)); | ||
169 | } | ||
170 | |||
171 | char *BUF_strndup(const char *str, size_t siz) | ||
172 | { | ||
173 | char *ret; | ||
174 | |||
175 | if (str == NULL) return(NULL); | ||
176 | |||
177 | ret=OPENSSL_malloc(siz+1); | ||
178 | if (ret == NULL) | ||
179 | { | ||
180 | BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE); | ||
181 | return(NULL); | ||
182 | } | ||
183 | BUF_strlcpy(ret,str,siz+1); | ||
184 | return(ret); | ||
185 | } | ||
186 | |||
187 | void *BUF_memdup(const void *data, size_t siz) | ||
188 | { | ||
189 | void *ret; | ||
190 | |||
191 | if (data == NULL) return(NULL); | ||
192 | |||
193 | ret=OPENSSL_malloc(siz); | ||
194 | if (ret == NULL) | ||
195 | { | ||
196 | BUFerr(BUF_F_BUF_MEMDUP,ERR_R_MALLOC_FAILURE); | ||
197 | return(NULL); | ||
198 | } | ||
199 | return memcpy(ret, data, siz); | ||
200 | } | ||
201 | |||
202 | size_t BUF_strlcpy(char *dst, const char *src, size_t size) | ||
203 | { | ||
204 | size_t l = 0; | ||
205 | for(; size > 1 && *src; size--) | ||
206 | { | ||
207 | *dst++ = *src++; | ||
208 | l++; | ||
209 | } | ||
210 | if (size) | ||
211 | *dst = '\0'; | ||
212 | return l + strlen(src); | ||
213 | } | ||
214 | |||
215 | size_t BUF_strlcat(char *dst, const char *src, size_t size) | ||
216 | { | ||
217 | size_t l = 0; | ||
218 | for(; size > 0 && *dst; size--, dst++) | ||
219 | l++; | ||
220 | return l + BUF_strlcpy(dst, src, size); | ||
221 | } | ||
222 | |||
223 | void BUF_reverse(unsigned char *out, unsigned char *in, size_t size) | 182 | void BUF_reverse(unsigned char *out, unsigned char *in, size_t size) |
224 | { | 183 | { |
225 | size_t i; | 184 | size_t i; |
diff --git a/src/lib/libssl/src/crypto/cast/Makefile b/src/lib/libssl/src/crypto/cast/Makefile index 0acc38f28d..f3f4859886 100644 --- a/src/lib/libssl/src/crypto/cast/Makefile +++ b/src/lib/libssl/src/crypto/cast/Makefile | |||
@@ -95,5 +95,8 @@ c_ofb64.o: ../../e_os.h ../../include/openssl/cast.h | |||
95 | c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 95 | c_ofb64.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
96 | c_ofb64.o: c_ofb64.c cast_lcl.h | 96 | c_ofb64.o: c_ofb64.c cast_lcl.h |
97 | c_skey.o: ../../e_os.h ../../include/openssl/cast.h | 97 | c_skey.o: ../../e_os.h ../../include/openssl/cast.h |
98 | c_skey.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 98 | c_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
99 | c_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
100 | c_skey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | ||
101 | c_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
99 | c_skey.o: c_skey.c cast_lcl.h cast_s.h | 102 | c_skey.o: c_skey.c cast_lcl.h cast_s.h |
diff --git a/src/lib/libssl/src/crypto/cast/c_skey.c b/src/lib/libssl/src/crypto/cast/c_skey.c index 76e40005c9..cb6bf9fee3 100644 --- a/src/lib/libssl/src/crypto/cast/c_skey.c +++ b/src/lib/libssl/src/crypto/cast/c_skey.c | |||
@@ -56,6 +56,7 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/crypto.h> | ||
59 | #include <openssl/cast.h> | 60 | #include <openssl/cast.h> |
60 | #include "cast_lcl.h" | 61 | #include "cast_lcl.h" |
61 | #include "cast_s.h" | 62 | #include "cast_s.h" |
@@ -71,8 +72,14 @@ | |||
71 | #define S5 CAST_S_table5 | 72 | #define S5 CAST_S_table5 |
72 | #define S6 CAST_S_table6 | 73 | #define S6 CAST_S_table6 |
73 | #define S7 CAST_S_table7 | 74 | #define S7 CAST_S_table7 |
74 | |||
75 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data) | 75 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data) |
76 | #ifdef OPENSSL_FIPS | ||
77 | { | ||
78 | fips_cipher_abort(CAST); | ||
79 | private_CAST_set_key(key, len, data); | ||
80 | } | ||
81 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data) | ||
82 | #endif | ||
76 | { | 83 | { |
77 | CAST_LONG x[16]; | 84 | CAST_LONG x[16]; |
78 | CAST_LONG z[16]; | 85 | CAST_LONG z[16]; |
diff --git a/src/lib/libssl/src/crypto/cast/cast.h b/src/lib/libssl/src/crypto/cast/cast.h index 1a264f8143..203922ea2b 100644 --- a/src/lib/libssl/src/crypto/cast/cast.h +++ b/src/lib/libssl/src/crypto/cast/cast.h | |||
@@ -83,7 +83,9 @@ typedef struct cast_key_st | |||
83 | int short_key; /* Use reduced rounds for short key */ | 83 | int short_key; /* Use reduced rounds for short key */ |
84 | } CAST_KEY; | 84 | } CAST_KEY; |
85 | 85 | ||
86 | 86 | #ifdef OPENSSL_FIPS | |
87 | void private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); | ||
88 | #endif | ||
87 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); | 89 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); |
88 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key, | 90 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *key, |
89 | int enc); | 91 | int enc); |
diff --git a/src/lib/libssl/src/crypto/comp/c_rle.c b/src/lib/libssl/src/crypto/comp/c_rle.c index 18bceae51e..47dfb67fbd 100644 --- a/src/lib/libssl/src/crypto/comp/c_rle.c +++ b/src/lib/libssl/src/crypto/comp/c_rle.c | |||
@@ -30,7 +30,7 @@ static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, | |||
30 | { | 30 | { |
31 | /* int i; */ | 31 | /* int i; */ |
32 | 32 | ||
33 | if (olen < (ilen+1)) | 33 | if (ilen == 0 || olen < (ilen-1)) |
34 | { | 34 | { |
35 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | 35 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ |
36 | return(-1); | 36 | return(-1); |
@@ -46,7 +46,7 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, | |||
46 | { | 46 | { |
47 | int i; | 47 | int i; |
48 | 48 | ||
49 | if (ilen == 0 || olen < (ilen-1)) | 49 | if (olen < (ilen-1)) |
50 | { | 50 | { |
51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | 51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ |
52 | return(-1); | 52 | return(-1); |
diff --git a/src/lib/libssl/src/crypto/cpt_err.c b/src/lib/libssl/src/crypto/cpt_err.c index 139b9284e4..289005f662 100644 --- a/src/lib/libssl/src/crypto/cpt_err.c +++ b/src/lib/libssl/src/crypto/cpt_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/cpt_err.c */ | 1 | /* crypto/cpt_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -76,6 +76,7 @@ static ERR_STRING_DATA CRYPTO_str_functs[]= | |||
76 | {ERR_FUNC(CRYPTO_F_CRYPTO_SET_EX_DATA), "CRYPTO_set_ex_data"}, | 76 | {ERR_FUNC(CRYPTO_F_CRYPTO_SET_EX_DATA), "CRYPTO_set_ex_data"}, |
77 | {ERR_FUNC(CRYPTO_F_DEF_ADD_INDEX), "DEF_ADD_INDEX"}, | 77 | {ERR_FUNC(CRYPTO_F_DEF_ADD_INDEX), "DEF_ADD_INDEX"}, |
78 | {ERR_FUNC(CRYPTO_F_DEF_GET_CLASS), "DEF_GET_CLASS"}, | 78 | {ERR_FUNC(CRYPTO_F_DEF_GET_CLASS), "DEF_GET_CLASS"}, |
79 | {ERR_FUNC(CRYPTO_F_FIPS_MODE_SET), "FIPS_mode_set"}, | ||
79 | {ERR_FUNC(CRYPTO_F_INT_DUP_EX_DATA), "INT_DUP_EX_DATA"}, | 80 | {ERR_FUNC(CRYPTO_F_INT_DUP_EX_DATA), "INT_DUP_EX_DATA"}, |
80 | {ERR_FUNC(CRYPTO_F_INT_FREE_EX_DATA), "INT_FREE_EX_DATA"}, | 81 | {ERR_FUNC(CRYPTO_F_INT_FREE_EX_DATA), "INT_FREE_EX_DATA"}, |
81 | {ERR_FUNC(CRYPTO_F_INT_NEW_EX_DATA), "INT_NEW_EX_DATA"}, | 82 | {ERR_FUNC(CRYPTO_F_INT_NEW_EX_DATA), "INT_NEW_EX_DATA"}, |
@@ -84,6 +85,7 @@ static ERR_STRING_DATA CRYPTO_str_functs[]= | |||
84 | 85 | ||
85 | static ERR_STRING_DATA CRYPTO_str_reasons[]= | 86 | static ERR_STRING_DATA CRYPTO_str_reasons[]= |
86 | { | 87 | { |
88 | {ERR_REASON(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED),"fips mode not supported"}, | ||
87 | {ERR_REASON(CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK),"no dynlock create callback"}, | 89 | {ERR_REASON(CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK),"no dynlock create callback"}, |
88 | {0,NULL} | 90 | {0,NULL} |
89 | }; | 91 | }; |
diff --git a/src/lib/libssl/src/crypto/cryptlib.c b/src/lib/libssl/src/crypto/cryptlib.c index 24fe123e14..766ea8cac7 100644 --- a/src/lib/libssl/src/crypto/cryptlib.c +++ b/src/lib/libssl/src/crypto/cryptlib.c | |||
@@ -409,6 +409,10 @@ int (*CRYPTO_get_add_lock_callback(void))(int *num,int mount,int type, | |||
409 | void CRYPTO_set_locking_callback(void (*func)(int mode,int type, | 409 | void CRYPTO_set_locking_callback(void (*func)(int mode,int type, |
410 | const char *file,int line)) | 410 | const char *file,int line)) |
411 | { | 411 | { |
412 | /* Calling this here ensures initialisation before any threads | ||
413 | * are started. | ||
414 | */ | ||
415 | OPENSSL_init(); | ||
412 | locking_callback=func; | 416 | locking_callback=func; |
413 | } | 417 | } |
414 | 418 | ||
@@ -661,28 +665,52 @@ const char *CRYPTO_get_lock_name(int type) | |||
661 | defined(__INTEL__) || \ | 665 | defined(__INTEL__) || \ |
662 | defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) | 666 | defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64) |
663 | 667 | ||
664 | unsigned long OPENSSL_ia32cap_P=0; | 668 | unsigned int OPENSSL_ia32cap_P[2]; |
665 | unsigned long *OPENSSL_ia32cap_loc(void) { return &OPENSSL_ia32cap_P; } | 669 | unsigned long *OPENSSL_ia32cap_loc(void) |
670 | { if (sizeof(long)==4) | ||
671 | /* | ||
672 | * If 32-bit application pulls address of OPENSSL_ia32cap_P[0] | ||
673 | * clear second element to maintain the illusion that vector | ||
674 | * is 32-bit. | ||
675 | */ | ||
676 | OPENSSL_ia32cap_P[1]=0; | ||
677 | return (unsigned long *)OPENSSL_ia32cap_P; | ||
678 | } | ||
666 | 679 | ||
667 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY) | 680 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) && !defined(I386_ONLY) |
668 | #define OPENSSL_CPUID_SETUP | 681 | #define OPENSSL_CPUID_SETUP |
682 | #if defined(_WIN32) | ||
683 | typedef unsigned __int64 IA32CAP; | ||
684 | #else | ||
685 | typedef unsigned long long IA32CAP; | ||
686 | #endif | ||
669 | void OPENSSL_cpuid_setup(void) | 687 | void OPENSSL_cpuid_setup(void) |
670 | { static int trigger=0; | 688 | { static int trigger=0; |
671 | unsigned long OPENSSL_ia32_cpuid(void); | 689 | IA32CAP OPENSSL_ia32_cpuid(void); |
690 | IA32CAP vec; | ||
672 | char *env; | 691 | char *env; |
673 | 692 | ||
674 | if (trigger) return; | 693 | if (trigger) return; |
675 | 694 | ||
676 | trigger=1; | 695 | trigger=1; |
677 | if ((env=getenv("OPENSSL_ia32cap"))) | 696 | if ((env=getenv("OPENSSL_ia32cap"))) { |
678 | OPENSSL_ia32cap_P = strtoul(env,NULL,0)|(1<<10); | 697 | int off = (env[0]=='~')?1:0; |
698 | #if defined(_WIN32) | ||
699 | if (!sscanf(env+off,"%I64i",&vec)) vec = strtoul(env+off,NULL,0); | ||
700 | #else | ||
701 | if (!sscanf(env+off,"%lli",(long long *)&vec)) vec = strtoul(env+off,NULL,0); | ||
702 | #endif | ||
703 | if (off) vec = OPENSSL_ia32_cpuid()&~vec; | ||
704 | } | ||
679 | else | 705 | else |
680 | OPENSSL_ia32cap_P = OPENSSL_ia32_cpuid()|(1<<10); | 706 | vec = OPENSSL_ia32_cpuid(); |
681 | /* | 707 | /* |
682 | * |(1<<10) sets a reserved bit to signal that variable | 708 | * |(1<<10) sets a reserved bit to signal that variable |
683 | * was initialized already... This is to avoid interference | 709 | * was initialized already... This is to avoid interference |
684 | * with cpuid snippets in ELF .init segment. | 710 | * with cpuid snippets in ELF .init segment. |
685 | */ | 711 | */ |
712 | OPENSSL_ia32cap_P[0] = (unsigned int)vec|(1<<10); | ||
713 | OPENSSL_ia32cap_P[1] = (unsigned int)(vec>>32); | ||
686 | } | 714 | } |
687 | #endif | 715 | #endif |
688 | 716 | ||
diff --git a/src/lib/libssl/src/crypto/cryptlib.h b/src/lib/libssl/src/crypto/cryptlib.h index fc249c57f3..1761f6b668 100644 --- a/src/lib/libssl/src/crypto/cryptlib.h +++ b/src/lib/libssl/src/crypto/cryptlib.h | |||
@@ -99,7 +99,7 @@ extern "C" { | |||
99 | #define HEX_SIZE(type) (sizeof(type)*2) | 99 | #define HEX_SIZE(type) (sizeof(type)*2) |
100 | 100 | ||
101 | void OPENSSL_cpuid_setup(void); | 101 | void OPENSSL_cpuid_setup(void); |
102 | extern unsigned long OPENSSL_ia32cap_P; | 102 | extern unsigned int OPENSSL_ia32cap_P[]; |
103 | void OPENSSL_showfatal(const char *,...); | 103 | void OPENSSL_showfatal(const char *,...); |
104 | void *OPENSSL_stderr(void); | 104 | void *OPENSSL_stderr(void); |
105 | extern int OPENSSL_NONPIC_relocated; | 105 | extern int OPENSSL_NONPIC_relocated; |
diff --git a/src/lib/libssl/src/crypto/crypto-lib.com b/src/lib/libssl/src/crypto/crypto-lib.com index a29c0afd93..c280aa03a8 100644 --- a/src/lib/libssl/src/crypto/crypto-lib.com +++ b/src/lib/libssl/src/crypto/crypto-lib.com | |||
@@ -117,7 +117,7 @@ $ ENCRYPT_TYPES = "Basic,"+ - | |||
117 | "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ - | 117 | "BUFFER,BIO,STACK,LHASH,RAND,ERR,"+ - |
118 | "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - | 118 | "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - |
119 | "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - | 119 | "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - |
120 | "STORE,CMS,PQUEUE,TS,JPAKE" | 120 | "CMS,PQUEUE,TS,JPAKE,SRP,STORE,CMAC" |
121 | $! | 121 | $! |
122 | $! Check To Make Sure We Have Valid Command Line Parameters. | 122 | $! Check To Make Sure We Have Valid Command Line Parameters. |
123 | $! | 123 | $! |
@@ -207,7 +207,8 @@ $! | |||
207 | $ APPS_DES = "DES/DES,CBC3_ENC" | 207 | $ APPS_DES = "DES/DES,CBC3_ENC" |
208 | $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE" | 208 | $ APPS_PKCS7 = "ENC/ENC;DEC/DEC;SIGN/SIGN;VERIFY/VERIFY,EXAMPLE" |
209 | $ | 209 | $ |
210 | $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,ebcdic,uid,o_time,o_str,o_dir" | 210 | $ LIB_ = "cryptlib,mem,mem_clr,mem_dbg,cversion,ex_data,cpt_err,"+ - |
211 | "ebcdic,uid,o_time,o_str,o_dir,o_fips.c,o_init,fips_ers" | ||
211 | $ LIB_MD2 = "md2_dgst,md2_one" | 212 | $ LIB_MD2 = "md2_dgst,md2_one" |
212 | $ LIB_MD4 = "md4_dgst,md4_one" | 213 | $ LIB_MD4 = "md4_dgst,md4_one" |
213 | $ LIB_MD5 = "md5_dgst,md5_one" | 214 | $ LIB_MD5 = "md5_dgst,md5_one" |
@@ -224,15 +225,16 @@ $ LIB_DES = "set_key,ecb_enc,cbc_enc,"+ - | |||
224 | "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ - | 225 | "fcrypt,xcbc_enc,rpc_enc,cbc_cksm,"+ - |
225 | "ede_cbcm_enc,des_old,des_old2,read2pwd" | 226 | "ede_cbcm_enc,des_old,des_old2,read2pwd" |
226 | $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" | 227 | $ LIB_RC2 = "rc2_ecb,rc2_skey,rc2_cbc,rc2cfb64,rc2ofb64" |
227 | $ LIB_RC4 = "rc4_skey,rc4_enc" | 228 | $ LIB_RC4 = "rc4_skey,rc4_enc,rc4_utl" |
228 | $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" | 229 | $ LIB_RC5 = "rc5_skey,rc5_ecb,rc5_enc,rc5cfb64,rc5ofb64" |
229 | $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey" | 230 | $ LIB_IDEA = "i_cbc,i_cfb64,i_ofb64,i_ecb,i_skey" |
230 | $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64" | 231 | $ LIB_BF = "bf_skey,bf_ecb,bf_enc,bf_cfb64,bf_ofb64" |
231 | $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64" | 232 | $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64" |
232 | $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ - | 233 | $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ - |
233 | "cmll_cfb,cmll_ctr" | 234 | "cmll_cfb,cmll_ctr,cmll_utl" |
234 | $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb" | 235 | $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb" |
235 | $ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128" | 236 | $ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128,gcm128,"+ - |
237 | "ccm128,xts128" | ||
236 | $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" | 238 | $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" |
237 | $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN - | 239 | $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN - |
238 | LIB_BN_ASM = "bn_asm" | 240 | LIB_BN_ASM = "bn_asm" |
@@ -240,14 +242,16 @@ $ LIB_BN = "bn_add,bn_div,bn_exp,bn_lib,bn_ctx,bn_mul,bn_mod,"+ - | |||
240 | "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ - | 242 | "bn_print,bn_rand,bn_shift,bn_word,bn_blind,"+ - |
241 | "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ - | 243 | "bn_kron,bn_sqrt,bn_gcd,bn_prime,bn_err,bn_sqr,"+LIB_BN_ASM+","+ - |
242 | "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ - | 244 | "bn_recp,bn_mont,bn_mpi,bn_exp2,bn_gf2m,bn_nist,"+ - |
243 | "bn_depr,bn_const" | 245 | "bn_depr,bn_const,bn_x931p" |
244 | $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ - | 246 | $ LIB_EC = "ec_lib,ecp_smpl,ecp_mont,ecp_nist,ec_cvt,ec_mult,"+ - |
245 | "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ - | 247 | "ec_err,ec_curve,ec_check,ec_print,ec_asn1,ec_key,"+ - |
246 | "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn" | 248 | "ec2_smpl,ec2_mult,ec_ameth,ec_pmeth,eck_prn,"+ - |
249 | "ecp_nistp224,ecp_nistp256,ecp_nistp521,ecp_nistputil,"+ - | ||
250 | "ecp_oct,ec2_oct,ec_oct" | ||
247 | $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ - | 251 | $ LIB_RSA = "rsa_eay,rsa_gen,rsa_lib,rsa_sign,rsa_saos,rsa_err,"+ - |
248 | "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ - | 252 | "rsa_pk1,rsa_ssl,rsa_none,rsa_oaep,rsa_chk,rsa_null,"+ - |
249 | "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ - | 253 | "rsa_pss,rsa_x931,rsa_asn1,rsa_depr,rsa_ameth,rsa_prn,"+ - |
250 | "rsa_pmeth" | 254 | "rsa_pmeth,rsa_crpt" |
251 | $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ - | 255 | $ LIB_DSA = "dsa_gen,dsa_key,dsa_lib,dsa_asn1,dsa_vrf,dsa_sign,"+ - |
252 | "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn" | 256 | "dsa_err,dsa_ossl,dsa_depr,dsa_ameth,dsa_pmeth,dsa_prn" |
253 | $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err" | 257 | $ LIB_ECDSA = "ecs_lib,ecs_asn1,ecs_ossl,ecs_sign,ecs_vrf,ecs_err" |
@@ -260,10 +264,11 @@ $ LIB_ENGINE = "eng_err,eng_lib,eng_list,eng_init,eng_ctrl,"+ - | |||
260 | "eng_table,eng_pkey,eng_fat,eng_all,"+ - | 264 | "eng_table,eng_pkey,eng_fat,eng_all,"+ - |
261 | "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ - | 265 | "tb_rsa,tb_dsa,tb_ecdsa,tb_dh,tb_ecdh,tb_rand,tb_store,"+ - |
262 | "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ - | 266 | "tb_cipher,tb_digest,tb_pkmeth,tb_asnmth,"+ - |
263 | "eng_openssl,eng_dyn,eng_cnf,eng_cryptodev" | 267 | "eng_openssl,eng_dyn,eng_cnf,eng_cryptodev,"+ - |
268 | "eng_rsax,eng_rdrand" | ||
264 | $ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr,"+ - | 269 | $ LIB_AES = "aes_core,aes_misc,aes_ecb,aes_cbc,aes_cfb,aes_ofb,aes_ctr,"+ - |
265 | "aes_ige,aes_wrap" | 270 | "aes_ige,aes_wrap" |
266 | $ LIB_BUFFER = "buffer,buf_err" | 271 | $ LIB_BUFFER = "buffer,buf_str,buf_err" |
267 | $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - | 272 | $ LIB_BIO = "bio_lib,bio_cb,bio_err,"+ - |
268 | "bss_mem,bss_null,bss_fd,"+ - | 273 | "bss_mem,bss_null,bss_fd,"+ - |
269 | "bss_file,bss_sock,bss_conn,"+ - | 274 | "bss_file,bss_sock,bss_conn,"+ - |
@@ -287,7 +292,8 @@ $ LIB_EVP_2 = "m_null,m_md2,m_md4,m_md5,m_sha,m_sha1,m_wp," + - | |||
287 | "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ - | 292 | "bio_md,bio_b64,bio_enc,evp_err,e_null,"+ - |
288 | "c_all,c_allc,c_alld,evp_lib,bio_ok,"+- | 293 | "c_all,c_allc,c_alld,evp_lib,bio_ok,"+- |
289 | "evp_pkey,evp_pbe,p5_crpt,p5_crpt2" | 294 | "evp_pkey,evp_pbe,p5_crpt,p5_crpt2" |
290 | $ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver" | 295 | $ LIB_EVP_3 = "e_old,pmeth_lib,pmeth_fn,pmeth_gn,m_sigver,evp_fips,"+ - |
296 | "e_aes_cbc_hmac_sha1,e_rc4_hmac_md5" | ||
291 | $ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ - | 297 | $ LIB_ASN1 = "a_object,a_bitstr,a_utctm,a_gentm,a_time,a_int,a_octet,"+ - |
292 | "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ - | 298 | "a_print,a_type,a_set,a_dup,a_d2i_fp,a_i2d_fp,"+ - |
293 | "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ - | 299 | "a_enum,a_utf8,a_sign,a_digest,a_verify,a_mbstr,a_strex,"+ - |
@@ -329,14 +335,17 @@ $ LIB_OCSP = "ocsp_asn,ocsp_ext,ocsp_ht,ocsp_lib,ocsp_cl,"+ - | |||
329 | $ LIB_UI_COMPAT = ",ui_compat" | 335 | $ LIB_UI_COMPAT = ",ui_compat" |
330 | $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT | 336 | $ LIB_UI = "ui_err,ui_lib,ui_openssl,ui_util"+LIB_UI_COMPAT |
331 | $ LIB_KRB5 = "krb5_asn" | 337 | $ LIB_KRB5 = "krb5_asn" |
332 | $ LIB_STORE = "str_err,str_lib,str_meth,str_mem" | ||
333 | $ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ - | 338 | $ LIB_CMS = "cms_lib,cms_asn1,cms_att,cms_io,cms_smime,cms_err,"+ - |
334 | "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess" | 339 | "cms_sd,cms_dd,cms_cd,cms_env,cms_enc,cms_ess,"+ - |
340 | "cms_pwri" | ||
335 | $ LIB_PQUEUE = "pqueue" | 341 | $ LIB_PQUEUE = "pqueue" |
336 | $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ - | 342 | $ LIB_TS = "ts_err,ts_req_utils,ts_req_print,ts_rsp_utils,ts_rsp_print,"+ - |
337 | "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ - | 343 | "ts_rsp_sign,ts_rsp_verify,ts_verify_ctx,ts_lib,ts_conf,"+ - |
338 | "ts_asn1" | 344 | "ts_asn1" |
339 | $ LIB_JPAKE = "jpake,jpake_err" | 345 | $ LIB_JPAKE = "jpake,jpake_err" |
346 | $ LIB_SRP = "srp_lib,srp_vfy" | ||
347 | $ LIB_STORE = "str_err,str_lib,str_meth,str_mem" | ||
348 | $ LIB_CMAC = "cmac,cm_ameth.c,cm_pmeth" | ||
340 | $! | 349 | $! |
341 | $! Setup exceptional compilations | 350 | $! Setup exceptional compilations |
342 | $! | 351 | $! |
@@ -1021,7 +1030,7 @@ $! | |||
1021 | $! Set basic C compiler /INCLUDE directories. | 1030 | $! Set basic C compiler /INCLUDE directories. |
1022 | $! | 1031 | $! |
1023 | $ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ - | 1032 | $ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ - |
1024 | "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1]" | 1033 | "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.MODES],SYS$DISK:[.ASN1],SYS$DISK:[.EVP]" |
1025 | $! | 1034 | $! |
1026 | $! Check To See If P3 Is Blank. | 1035 | $! Check To See If P3 Is Blank. |
1027 | $! | 1036 | $! |
diff --git a/src/lib/libssl/src/crypto/crypto.h b/src/lib/libssl/src/crypto/crypto.h index b0360cec51..6aeda0a9ac 100644 --- a/src/lib/libssl/src/crypto/crypto.h +++ b/src/lib/libssl/src/crypto/crypto.h | |||
@@ -547,6 +547,33 @@ unsigned long *OPENSSL_ia32cap_loc(void); | |||
547 | #define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) | 547 | #define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) |
548 | int OPENSSL_isservice(void); | 548 | int OPENSSL_isservice(void); |
549 | 549 | ||
550 | int FIPS_mode(void); | ||
551 | int FIPS_mode_set(int r); | ||
552 | |||
553 | void OPENSSL_init(void); | ||
554 | |||
555 | #define fips_md_init(alg) fips_md_init_ctx(alg, alg) | ||
556 | |||
557 | #ifdef OPENSSL_FIPS | ||
558 | #define fips_md_init_ctx(alg, cx) \ | ||
559 | int alg##_Init(cx##_CTX *c) \ | ||
560 | { \ | ||
561 | if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \ | ||
562 | "Low level API call to digest " #alg " forbidden in FIPS mode!"); \ | ||
563 | return private_##alg##_Init(c); \ | ||
564 | } \ | ||
565 | int private_##alg##_Init(cx##_CTX *c) | ||
566 | |||
567 | #define fips_cipher_abort(alg) \ | ||
568 | if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \ | ||
569 | "Low level API call to cipher " #alg " forbidden in FIPS mode!") | ||
570 | |||
571 | #else | ||
572 | #define fips_md_init_ctx(alg, cx) \ | ||
573 | int alg##_Init(cx##_CTX *c) | ||
574 | #define fips_cipher_abort(alg) while(0) | ||
575 | #endif | ||
576 | |||
550 | /* BEGIN ERROR CODES */ | 577 | /* BEGIN ERROR CODES */ |
551 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 578 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
552 | * made after this point may be overwritten when the script is next run. | 579 | * made after this point may be overwritten when the script is next run. |
@@ -562,11 +589,13 @@ void ERR_load_CRYPTO_strings(void); | |||
562 | #define CRYPTO_F_CRYPTO_SET_EX_DATA 102 | 589 | #define CRYPTO_F_CRYPTO_SET_EX_DATA 102 |
563 | #define CRYPTO_F_DEF_ADD_INDEX 104 | 590 | #define CRYPTO_F_DEF_ADD_INDEX 104 |
564 | #define CRYPTO_F_DEF_GET_CLASS 105 | 591 | #define CRYPTO_F_DEF_GET_CLASS 105 |
592 | #define CRYPTO_F_FIPS_MODE_SET 109 | ||
565 | #define CRYPTO_F_INT_DUP_EX_DATA 106 | 593 | #define CRYPTO_F_INT_DUP_EX_DATA 106 |
566 | #define CRYPTO_F_INT_FREE_EX_DATA 107 | 594 | #define CRYPTO_F_INT_FREE_EX_DATA 107 |
567 | #define CRYPTO_F_INT_NEW_EX_DATA 108 | 595 | #define CRYPTO_F_INT_NEW_EX_DATA 108 |
568 | 596 | ||
569 | /* Reason codes. */ | 597 | /* Reason codes. */ |
598 | #define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 | ||
570 | #define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 | 599 | #define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 |
571 | 600 | ||
572 | #ifdef __cplusplus | 601 | #ifdef __cplusplus |
diff --git a/src/lib/libssl/src/crypto/des/Makefile b/src/lib/libssl/src/crypto/des/Makefile index ae982265fd..a6e1001329 100644 --- a/src/lib/libssl/src/crypto/des/Makefile +++ b/src/lib/libssl/src/crypto/des/Makefile | |||
@@ -257,8 +257,9 @@ rpc_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | |||
257 | rpc_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 257 | rpc_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
258 | rpc_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | 258 | rpc_enc.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h |
259 | rpc_enc.o: des_locl.h des_ver.h rpc_des.h rpc_enc.c | 259 | rpc_enc.o: des_locl.h des_ver.h rpc_des.h rpc_enc.c |
260 | set_key.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | 260 | set_key.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
261 | set_key.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 261 | set_key.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h |
262 | set_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
262 | set_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 263 | set_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
263 | set_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 264 | set_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
264 | set_key.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | 265 | set_key.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h |
diff --git a/src/lib/libssl/src/crypto/des/des.h b/src/lib/libssl/src/crypto/des/des.h index 92b6663599..1eaedcbd24 100644 --- a/src/lib/libssl/src/crypto/des/des.h +++ b/src/lib/libssl/src/crypto/des/des.h | |||
@@ -224,6 +224,9 @@ int DES_set_key(const_DES_cblock *key,DES_key_schedule *schedule); | |||
224 | int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule); | 224 | int DES_key_sched(const_DES_cblock *key,DES_key_schedule *schedule); |
225 | int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule); | 225 | int DES_set_key_checked(const_DES_cblock *key,DES_key_schedule *schedule); |
226 | void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); | 226 | void DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); |
227 | #ifdef OPENSSL_FIPS | ||
228 | void private_DES_set_key_unchecked(const_DES_cblock *key,DES_key_schedule *schedule); | ||
229 | #endif | ||
227 | void DES_string_to_key(const char *str,DES_cblock *key); | 230 | void DES_string_to_key(const char *str,DES_cblock *key); |
228 | void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2); | 231 | void DES_string_to_2keys(const char *str,DES_cblock *key1,DES_cblock *key2); |
229 | void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length, | 232 | void DES_cfb64_encrypt(const unsigned char *in,unsigned char *out,long length, |
diff --git a/src/lib/libssl/src/crypto/des/set_key.c b/src/lib/libssl/src/crypto/des/set_key.c index 3004cc3ab3..d3e69ca8b5 100644 --- a/src/lib/libssl/src/crypto/des/set_key.c +++ b/src/lib/libssl/src/crypto/des/set_key.c | |||
@@ -65,6 +65,8 @@ | |||
65 | */ | 65 | */ |
66 | #include "des_locl.h" | 66 | #include "des_locl.h" |
67 | 67 | ||
68 | #include <openssl/crypto.h> | ||
69 | |||
68 | OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */ | 70 | OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */ |
69 | 71 | ||
70 | static const unsigned char odd_parity[256]={ | 72 | static const unsigned char odd_parity[256]={ |
@@ -335,6 +337,13 @@ int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule) | |||
335 | } | 337 | } |
336 | 338 | ||
337 | void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) | 339 | void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) |
340 | #ifdef OPENSSL_FIPS | ||
341 | { | ||
342 | fips_cipher_abort(DES); | ||
343 | private_DES_set_key_unchecked(key, schedule); | ||
344 | } | ||
345 | void private_DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule) | ||
346 | #endif | ||
338 | { | 347 | { |
339 | static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; | 348 | static const int shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0}; |
340 | register DES_LONG c,d,t,s,t2; | 349 | register DES_LONG c,d,t,s,t2; |
diff --git a/src/lib/libssl/src/crypto/dh/dh.h b/src/lib/libssl/src/crypto/dh/dh.h index 849309a489..ea59e610ef 100644 --- a/src/lib/libssl/src/crypto/dh/dh.h +++ b/src/lib/libssl/src/crypto/dh/dh.h | |||
@@ -86,6 +86,21 @@ | |||
86 | * be used for all exponents. | 86 | * be used for all exponents. |
87 | */ | 87 | */ |
88 | 88 | ||
89 | /* If this flag is set the DH method is FIPS compliant and can be used | ||
90 | * in FIPS mode. This is set in the validated module method. If an | ||
91 | * application sets this flag in its own methods it is its reposibility | ||
92 | * to ensure the result is compliant. | ||
93 | */ | ||
94 | |||
95 | #define DH_FLAG_FIPS_METHOD 0x0400 | ||
96 | |||
97 | /* If this flag is set the operations normally disabled in FIPS mode are | ||
98 | * permitted it is then the applications responsibility to ensure that the | ||
99 | * usage is compliant. | ||
100 | */ | ||
101 | |||
102 | #define DH_FLAG_NON_FIPS_ALLOW 0x0400 | ||
103 | |||
89 | #ifdef __cplusplus | 104 | #ifdef __cplusplus |
90 | extern "C" { | 105 | extern "C" { |
91 | #endif | 106 | #endif |
@@ -230,6 +245,9 @@ void ERR_load_DH_strings(void); | |||
230 | #define DH_F_COMPUTE_KEY 102 | 245 | #define DH_F_COMPUTE_KEY 102 |
231 | #define DH_F_DHPARAMS_PRINT_FP 101 | 246 | #define DH_F_DHPARAMS_PRINT_FP 101 |
232 | #define DH_F_DH_BUILTIN_GENPARAMS 106 | 247 | #define DH_F_DH_BUILTIN_GENPARAMS 106 |
248 | #define DH_F_DH_COMPUTE_KEY 114 | ||
249 | #define DH_F_DH_GENERATE_KEY 115 | ||
250 | #define DH_F_DH_GENERATE_PARAMETERS_EX 116 | ||
233 | #define DH_F_DH_NEW_METHOD 105 | 251 | #define DH_F_DH_NEW_METHOD 105 |
234 | #define DH_F_DH_PARAM_DECODE 107 | 252 | #define DH_F_DH_PARAM_DECODE 107 |
235 | #define DH_F_DH_PRIV_DECODE 110 | 253 | #define DH_F_DH_PRIV_DECODE 110 |
@@ -249,7 +267,9 @@ void ERR_load_DH_strings(void); | |||
249 | #define DH_R_DECODE_ERROR 104 | 267 | #define DH_R_DECODE_ERROR 104 |
250 | #define DH_R_INVALID_PUBKEY 102 | 268 | #define DH_R_INVALID_PUBKEY 102 |
251 | #define DH_R_KEYS_NOT_SET 108 | 269 | #define DH_R_KEYS_NOT_SET 108 |
270 | #define DH_R_KEY_SIZE_TOO_SMALL 110 | ||
252 | #define DH_R_MODULUS_TOO_LARGE 103 | 271 | #define DH_R_MODULUS_TOO_LARGE 103 |
272 | #define DH_R_NON_FIPS_METHOD 111 | ||
253 | #define DH_R_NO_PARAMETERS_SET 107 | 273 | #define DH_R_NO_PARAMETERS_SET 107 |
254 | #define DH_R_NO_PRIVATE_VALUE 100 | 274 | #define DH_R_NO_PRIVATE_VALUE 100 |
255 | #define DH_R_PARAMETER_ENCODING_ERROR 105 | 275 | #define DH_R_PARAMETER_ENCODING_ERROR 105 |
diff --git a/src/lib/libssl/src/crypto/dh/dh_err.c b/src/lib/libssl/src/crypto/dh/dh_err.c index d5cf0c22a3..56d3df7356 100644 --- a/src/lib/libssl/src/crypto/dh/dh_err.c +++ b/src/lib/libssl/src/crypto/dh/dh_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/dh/dh_err.c */ | 1 | /* crypto/dh/dh_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -73,6 +73,9 @@ static ERR_STRING_DATA DH_str_functs[]= | |||
73 | {ERR_FUNC(DH_F_COMPUTE_KEY), "COMPUTE_KEY"}, | 73 | {ERR_FUNC(DH_F_COMPUTE_KEY), "COMPUTE_KEY"}, |
74 | {ERR_FUNC(DH_F_DHPARAMS_PRINT_FP), "DHparams_print_fp"}, | 74 | {ERR_FUNC(DH_F_DHPARAMS_PRINT_FP), "DHparams_print_fp"}, |
75 | {ERR_FUNC(DH_F_DH_BUILTIN_GENPARAMS), "DH_BUILTIN_GENPARAMS"}, | 75 | {ERR_FUNC(DH_F_DH_BUILTIN_GENPARAMS), "DH_BUILTIN_GENPARAMS"}, |
76 | {ERR_FUNC(DH_F_DH_COMPUTE_KEY), "DH_compute_key"}, | ||
77 | {ERR_FUNC(DH_F_DH_GENERATE_KEY), "DH_generate_key"}, | ||
78 | {ERR_FUNC(DH_F_DH_GENERATE_PARAMETERS_EX), "DH_generate_parameters_ex"}, | ||
76 | {ERR_FUNC(DH_F_DH_NEW_METHOD), "DH_new_method"}, | 79 | {ERR_FUNC(DH_F_DH_NEW_METHOD), "DH_new_method"}, |
77 | {ERR_FUNC(DH_F_DH_PARAM_DECODE), "DH_PARAM_DECODE"}, | 80 | {ERR_FUNC(DH_F_DH_PARAM_DECODE), "DH_PARAM_DECODE"}, |
78 | {ERR_FUNC(DH_F_DH_PRIV_DECODE), "DH_PRIV_DECODE"}, | 81 | {ERR_FUNC(DH_F_DH_PRIV_DECODE), "DH_PRIV_DECODE"}, |
@@ -95,7 +98,9 @@ static ERR_STRING_DATA DH_str_reasons[]= | |||
95 | {ERR_REASON(DH_R_DECODE_ERROR) ,"decode error"}, | 98 | {ERR_REASON(DH_R_DECODE_ERROR) ,"decode error"}, |
96 | {ERR_REASON(DH_R_INVALID_PUBKEY) ,"invalid public key"}, | 99 | {ERR_REASON(DH_R_INVALID_PUBKEY) ,"invalid public key"}, |
97 | {ERR_REASON(DH_R_KEYS_NOT_SET) ,"keys not set"}, | 100 | {ERR_REASON(DH_R_KEYS_NOT_SET) ,"keys not set"}, |
101 | {ERR_REASON(DH_R_KEY_SIZE_TOO_SMALL) ,"key size too small"}, | ||
98 | {ERR_REASON(DH_R_MODULUS_TOO_LARGE) ,"modulus too large"}, | 102 | {ERR_REASON(DH_R_MODULUS_TOO_LARGE) ,"modulus too large"}, |
103 | {ERR_REASON(DH_R_NON_FIPS_METHOD) ,"non fips method"}, | ||
99 | {ERR_REASON(DH_R_NO_PARAMETERS_SET) ,"no parameters set"}, | 104 | {ERR_REASON(DH_R_NO_PARAMETERS_SET) ,"no parameters set"}, |
100 | {ERR_REASON(DH_R_NO_PRIVATE_VALUE) ,"no private value"}, | 105 | {ERR_REASON(DH_R_NO_PRIVATE_VALUE) ,"no private value"}, |
101 | {ERR_REASON(DH_R_PARAMETER_ENCODING_ERROR),"parameter encoding error"}, | 106 | {ERR_REASON(DH_R_PARAMETER_ENCODING_ERROR),"parameter encoding error"}, |
diff --git a/src/lib/libssl/src/crypto/dh/dh_gen.c b/src/lib/libssl/src/crypto/dh/dh_gen.c index cfd5b11868..7b1fe9c9cb 100644 --- a/src/lib/libssl/src/crypto/dh/dh_gen.c +++ b/src/lib/libssl/src/crypto/dh/dh_gen.c | |||
@@ -66,12 +66,29 @@ | |||
66 | #include <openssl/bn.h> | 66 | #include <openssl/bn.h> |
67 | #include <openssl/dh.h> | 67 | #include <openssl/dh.h> |
68 | 68 | ||
69 | #ifdef OPENSSL_FIPS | ||
70 | #include <openssl/fips.h> | ||
71 | #endif | ||
72 | |||
69 | static int dh_builtin_genparams(DH *ret, int prime_len, int generator, BN_GENCB *cb); | 73 | static int dh_builtin_genparams(DH *ret, int prime_len, int generator, BN_GENCB *cb); |
70 | 74 | ||
71 | int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, BN_GENCB *cb) | 75 | int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, BN_GENCB *cb) |
72 | { | 76 | { |
77 | #ifdef OPENSSL_FIPS | ||
78 | if (FIPS_mode() && !(ret->meth->flags & DH_FLAG_FIPS_METHOD) | ||
79 | && !(ret->flags & DH_FLAG_NON_FIPS_ALLOW)) | ||
80 | { | ||
81 | DHerr(DH_F_DH_GENERATE_PARAMETERS_EX, DH_R_NON_FIPS_METHOD); | ||
82 | return 0; | ||
83 | } | ||
84 | #endif | ||
73 | if(ret->meth->generate_params) | 85 | if(ret->meth->generate_params) |
74 | return ret->meth->generate_params(ret, prime_len, generator, cb); | 86 | return ret->meth->generate_params(ret, prime_len, generator, cb); |
87 | #ifdef OPENSSL_FIPS | ||
88 | if (FIPS_mode()) | ||
89 | return FIPS_dh_generate_parameters_ex(ret, prime_len, | ||
90 | generator, cb); | ||
91 | #endif | ||
75 | return dh_builtin_genparams(ret, prime_len, generator, cb); | 92 | return dh_builtin_genparams(ret, prime_len, generator, cb); |
76 | } | 93 | } |
77 | 94 | ||
diff --git a/src/lib/libssl/src/crypto/dh/dh_key.c b/src/lib/libssl/src/crypto/dh/dh_key.c index e7db440342..89a74db4e6 100644 --- a/src/lib/libssl/src/crypto/dh/dh_key.c +++ b/src/lib/libssl/src/crypto/dh/dh_key.c | |||
@@ -73,11 +73,27 @@ static int dh_finish(DH *dh); | |||
73 | 73 | ||
74 | int DH_generate_key(DH *dh) | 74 | int DH_generate_key(DH *dh) |
75 | { | 75 | { |
76 | #ifdef OPENSSL_FIPS | ||
77 | if (FIPS_mode() && !(dh->meth->flags & DH_FLAG_FIPS_METHOD) | ||
78 | && !(dh->flags & DH_FLAG_NON_FIPS_ALLOW)) | ||
79 | { | ||
80 | DHerr(DH_F_DH_GENERATE_KEY, DH_R_NON_FIPS_METHOD); | ||
81 | return 0; | ||
82 | } | ||
83 | #endif | ||
76 | return dh->meth->generate_key(dh); | 84 | return dh->meth->generate_key(dh); |
77 | } | 85 | } |
78 | 86 | ||
79 | int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) | 87 | int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) |
80 | { | 88 | { |
89 | #ifdef OPENSSL_FIPS | ||
90 | if (FIPS_mode() && !(dh->meth->flags & DH_FLAG_FIPS_METHOD) | ||
91 | && !(dh->flags & DH_FLAG_NON_FIPS_ALLOW)) | ||
92 | { | ||
93 | DHerr(DH_F_DH_COMPUTE_KEY, DH_R_NON_FIPS_METHOD); | ||
94 | return 0; | ||
95 | } | ||
96 | #endif | ||
81 | return dh->meth->compute_key(key, pub_key, dh); | 97 | return dh->meth->compute_key(key, pub_key, dh); |
82 | } | 98 | } |
83 | 99 | ||
@@ -138,8 +154,21 @@ static int generate_key(DH *dh) | |||
138 | 154 | ||
139 | if (generate_new_key) | 155 | if (generate_new_key) |
140 | { | 156 | { |
141 | l = dh->length ? dh->length : BN_num_bits(dh->p)-1; /* secret exponent length */ | 157 | if (dh->q) |
142 | if (!BN_rand(priv_key, l, 0, 0)) goto err; | 158 | { |
159 | do | ||
160 | { | ||
161 | if (!BN_rand_range(priv_key, dh->q)) | ||
162 | goto err; | ||
163 | } | ||
164 | while (BN_is_zero(priv_key) || BN_is_one(priv_key)); | ||
165 | } | ||
166 | else | ||
167 | { | ||
168 | /* secret exponent length */ | ||
169 | l = dh->length ? dh->length : BN_num_bits(dh->p)-1; | ||
170 | if (!BN_rand(priv_key, l, 0, 0)) goto err; | ||
171 | } | ||
143 | } | 172 | } |
144 | 173 | ||
145 | { | 174 | { |
diff --git a/src/lib/libssl/src/crypto/dh/dh_lib.c b/src/lib/libssl/src/crypto/dh/dh_lib.c index 7aef080e7a..00218f2b92 100644 --- a/src/lib/libssl/src/crypto/dh/dh_lib.c +++ b/src/lib/libssl/src/crypto/dh/dh_lib.c | |||
@@ -64,6 +64,10 @@ | |||
64 | #include <openssl/engine.h> | 64 | #include <openssl/engine.h> |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #ifdef OPENSSL_FIPS | ||
68 | #include <openssl/fips.h> | ||
69 | #endif | ||
70 | |||
67 | const char DH_version[]="Diffie-Hellman" OPENSSL_VERSION_PTEXT; | 71 | const char DH_version[]="Diffie-Hellman" OPENSSL_VERSION_PTEXT; |
68 | 72 | ||
69 | static const DH_METHOD *default_DH_method = NULL; | 73 | static const DH_METHOD *default_DH_method = NULL; |
@@ -76,7 +80,16 @@ void DH_set_default_method(const DH_METHOD *meth) | |||
76 | const DH_METHOD *DH_get_default_method(void) | 80 | const DH_METHOD *DH_get_default_method(void) |
77 | { | 81 | { |
78 | if(!default_DH_method) | 82 | if(!default_DH_method) |
83 | { | ||
84 | #ifdef OPENSSL_FIPS | ||
85 | if (FIPS_mode()) | ||
86 | return FIPS_dh_openssl(); | ||
87 | else | ||
88 | return DH_OpenSSL(); | ||
89 | #else | ||
79 | default_DH_method = DH_OpenSSL(); | 90 | default_DH_method = DH_OpenSSL(); |
91 | #endif | ||
92 | } | ||
80 | return default_DH_method; | 93 | return default_DH_method; |
81 | } | 94 | } |
82 | 95 | ||
@@ -156,7 +169,7 @@ DH *DH_new_method(ENGINE *engine) | |||
156 | ret->counter = NULL; | 169 | ret->counter = NULL; |
157 | ret->method_mont_p=NULL; | 170 | ret->method_mont_p=NULL; |
158 | ret->references = 1; | 171 | ret->references = 1; |
159 | ret->flags=ret->meth->flags; | 172 | ret->flags=ret->meth->flags & ~DH_FLAG_NON_FIPS_ALLOW; |
160 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); | 173 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DH, ret, &ret->ex_data); |
161 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) | 174 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) |
162 | { | 175 | { |
diff --git a/src/lib/libssl/src/crypto/dsa/Makefile b/src/lib/libssl/src/crypto/dsa/Makefile index 8073c4ecfe..5fef4ca5ad 100644 --- a/src/lib/libssl/src/crypto/dsa/Makefile +++ b/src/lib/libssl/src/crypto/dsa/Makefile | |||
@@ -99,8 +99,9 @@ dsa_asn1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | |||
99 | dsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 99 | dsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
100 | dsa_asn1.o: ../../include/openssl/opensslconf.h | 100 | dsa_asn1.o: ../../include/openssl/opensslconf.h |
101 | dsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 101 | dsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
102 | dsa_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 102 | dsa_asn1.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h |
103 | dsa_asn1.o: ../../include/openssl/symhacks.h ../cryptlib.h dsa_asn1.c | 103 | dsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
104 | dsa_asn1.o: ../cryptlib.h dsa_asn1.c | ||
104 | dsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h | 105 | dsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h |
105 | dsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 106 | dsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
106 | dsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 107 | dsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -189,7 +190,7 @@ dsa_prn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | |||
189 | dsa_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 190 | dsa_prn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
190 | dsa_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 191 | dsa_prn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
191 | dsa_prn.o: ../cryptlib.h dsa_prn.c | 192 | dsa_prn.o: ../cryptlib.h dsa_prn.c |
192 | dsa_sign.o: ../../e_os.h ../../include/openssl/bio.h | 193 | dsa_sign.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h |
193 | dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 194 | dsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
194 | dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h | 195 | dsa_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h |
195 | dsa_sign.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 196 | dsa_sign.o: ../../include/openssl/err.h ../../include/openssl/lhash.h |
diff --git a/src/lib/libssl/src/crypto/dsa/dsa.h b/src/lib/libssl/src/crypto/dsa/dsa.h index ac50a5c846..a6f6d0b0b2 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa.h +++ b/src/lib/libssl/src/crypto/dsa/dsa.h | |||
@@ -97,6 +97,21 @@ | |||
97 | * be used for all exponents. | 97 | * be used for all exponents. |
98 | */ | 98 | */ |
99 | 99 | ||
100 | /* If this flag is set the DSA method is FIPS compliant and can be used | ||
101 | * in FIPS mode. This is set in the validated module method. If an | ||
102 | * application sets this flag in its own methods it is its reposibility | ||
103 | * to ensure the result is compliant. | ||
104 | */ | ||
105 | |||
106 | #define DSA_FLAG_FIPS_METHOD 0x0400 | ||
107 | |||
108 | /* If this flag is set the operations normally disabled in FIPS mode are | ||
109 | * permitted it is then the applications responsibility to ensure that the | ||
110 | * usage is compliant. | ||
111 | */ | ||
112 | |||
113 | #define DSA_FLAG_NON_FIPS_ALLOW 0x0400 | ||
114 | |||
100 | #ifdef __cplusplus | 115 | #ifdef __cplusplus |
101 | extern "C" { | 116 | extern "C" { |
102 | #endif | 117 | #endif |
@@ -272,6 +287,8 @@ void ERR_load_DSA_strings(void); | |||
272 | #define DSA_F_DSAPARAMS_PRINT_FP 101 | 287 | #define DSA_F_DSAPARAMS_PRINT_FP 101 |
273 | #define DSA_F_DSA_DO_SIGN 112 | 288 | #define DSA_F_DSA_DO_SIGN 112 |
274 | #define DSA_F_DSA_DO_VERIFY 113 | 289 | #define DSA_F_DSA_DO_VERIFY 113 |
290 | #define DSA_F_DSA_GENERATE_KEY 124 | ||
291 | #define DSA_F_DSA_GENERATE_PARAMETERS_EX 123 | ||
275 | #define DSA_F_DSA_NEW_METHOD 103 | 292 | #define DSA_F_DSA_NEW_METHOD 103 |
276 | #define DSA_F_DSA_PARAM_DECODE 119 | 293 | #define DSA_F_DSA_PARAM_DECODE 119 |
277 | #define DSA_F_DSA_PRINT_FP 105 | 294 | #define DSA_F_DSA_PRINT_FP 105 |
@@ -282,6 +299,7 @@ void ERR_load_DSA_strings(void); | |||
282 | #define DSA_F_DSA_SIGN 106 | 299 | #define DSA_F_DSA_SIGN 106 |
283 | #define DSA_F_DSA_SIGN_SETUP 107 | 300 | #define DSA_F_DSA_SIGN_SETUP 107 |
284 | #define DSA_F_DSA_SIG_NEW 109 | 301 | #define DSA_F_DSA_SIG_NEW 109 |
302 | #define DSA_F_DSA_SIG_PRINT 125 | ||
285 | #define DSA_F_DSA_VERIFY 108 | 303 | #define DSA_F_DSA_VERIFY 108 |
286 | #define DSA_F_I2D_DSA_SIG 111 | 304 | #define DSA_F_I2D_DSA_SIG 111 |
287 | #define DSA_F_OLD_DSA_PRIV_DECODE 122 | 305 | #define DSA_F_OLD_DSA_PRIV_DECODE 122 |
@@ -298,6 +316,8 @@ void ERR_load_DSA_strings(void); | |||
298 | #define DSA_R_INVALID_DIGEST_TYPE 106 | 316 | #define DSA_R_INVALID_DIGEST_TYPE 106 |
299 | #define DSA_R_MISSING_PARAMETERS 101 | 317 | #define DSA_R_MISSING_PARAMETERS 101 |
300 | #define DSA_R_MODULUS_TOO_LARGE 103 | 318 | #define DSA_R_MODULUS_TOO_LARGE 103 |
319 | #define DSA_R_NEED_NEW_SETUP_VALUES 110 | ||
320 | #define DSA_R_NON_FIPS_DSA_METHOD 111 | ||
301 | #define DSA_R_NO_PARAMETERS_SET 107 | 321 | #define DSA_R_NO_PARAMETERS_SET 107 |
302 | #define DSA_R_PARAMETER_ENCODING_ERROR 105 | 322 | #define DSA_R_PARAMETER_ENCODING_ERROR 105 |
303 | 323 | ||
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_asn1.c b/src/lib/libssl/src/crypto/dsa/dsa_asn1.c index c37460b2d6..6058534374 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_asn1.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_asn1.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <openssl/dsa.h> | 61 | #include <openssl/dsa.h> |
62 | #include <openssl/asn1.h> | 62 | #include <openssl/asn1.h> |
63 | #include <openssl/asn1t.h> | 63 | #include <openssl/asn1t.h> |
64 | #include <openssl/rand.h> | ||
64 | 65 | ||
65 | /* Override the default new methods */ | 66 | /* Override the default new methods */ |
66 | static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, | 67 | static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, |
@@ -87,7 +88,7 @@ ASN1_SEQUENCE_cb(DSA_SIG, sig_cb) = { | |||
87 | ASN1_SIMPLE(DSA_SIG, s, CBIGNUM) | 88 | ASN1_SIMPLE(DSA_SIG, s, CBIGNUM) |
88 | } ASN1_SEQUENCE_END_cb(DSA_SIG, DSA_SIG) | 89 | } ASN1_SEQUENCE_END_cb(DSA_SIG, DSA_SIG) |
89 | 90 | ||
90 | IMPLEMENT_ASN1_FUNCTIONS_const(DSA_SIG) | 91 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(DSA_SIG, DSA_SIG, DSA_SIG) |
91 | 92 | ||
92 | /* Override the default free and new methods */ | 93 | /* Override the default free and new methods */ |
93 | static int dsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, | 94 | static int dsa_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, |
@@ -148,3 +149,40 @@ DSA *DSAparams_dup(DSA *dsa) | |||
148 | { | 149 | { |
149 | return ASN1_item_dup(ASN1_ITEM_rptr(DSAparams), dsa); | 150 | return ASN1_item_dup(ASN1_ITEM_rptr(DSAparams), dsa); |
150 | } | 151 | } |
152 | |||
153 | int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, | ||
154 | unsigned int *siglen, DSA *dsa) | ||
155 | { | ||
156 | DSA_SIG *s; | ||
157 | RAND_seed(dgst, dlen); | ||
158 | s=DSA_do_sign(dgst,dlen,dsa); | ||
159 | if (s == NULL) | ||
160 | { | ||
161 | *siglen=0; | ||
162 | return(0); | ||
163 | } | ||
164 | *siglen=i2d_DSA_SIG(s,&sig); | ||
165 | DSA_SIG_free(s); | ||
166 | return(1); | ||
167 | } | ||
168 | |||
169 | /* data has already been hashed (probably with SHA or SHA-1). */ | ||
170 | /* returns | ||
171 | * 1: correct signature | ||
172 | * 0: incorrect signature | ||
173 | * -1: error | ||
174 | */ | ||
175 | int DSA_verify(int type, const unsigned char *dgst, int dgst_len, | ||
176 | const unsigned char *sigbuf, int siglen, DSA *dsa) | ||
177 | { | ||
178 | DSA_SIG *s; | ||
179 | int ret=-1; | ||
180 | |||
181 | s = DSA_SIG_new(); | ||
182 | if (s == NULL) return(ret); | ||
183 | if (d2i_DSA_SIG(&s,&sigbuf,siglen) == NULL) goto err; | ||
184 | ret=DSA_do_verify(dgst,dgst_len,s,dsa); | ||
185 | err: | ||
186 | DSA_SIG_free(s); | ||
187 | return(ret); | ||
188 | } | ||
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_err.c b/src/lib/libssl/src/crypto/dsa/dsa_err.c index bba984e92e..00545b7b9f 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_err.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/dsa/dsa_err.c */ | 1 | /* crypto/dsa/dsa_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -76,6 +76,8 @@ static ERR_STRING_DATA DSA_str_functs[]= | |||
76 | {ERR_FUNC(DSA_F_DSAPARAMS_PRINT_FP), "DSAparams_print_fp"}, | 76 | {ERR_FUNC(DSA_F_DSAPARAMS_PRINT_FP), "DSAparams_print_fp"}, |
77 | {ERR_FUNC(DSA_F_DSA_DO_SIGN), "DSA_do_sign"}, | 77 | {ERR_FUNC(DSA_F_DSA_DO_SIGN), "DSA_do_sign"}, |
78 | {ERR_FUNC(DSA_F_DSA_DO_VERIFY), "DSA_do_verify"}, | 78 | {ERR_FUNC(DSA_F_DSA_DO_VERIFY), "DSA_do_verify"}, |
79 | {ERR_FUNC(DSA_F_DSA_GENERATE_KEY), "DSA_generate_key"}, | ||
80 | {ERR_FUNC(DSA_F_DSA_GENERATE_PARAMETERS_EX), "DSA_generate_parameters_ex"}, | ||
79 | {ERR_FUNC(DSA_F_DSA_NEW_METHOD), "DSA_new_method"}, | 81 | {ERR_FUNC(DSA_F_DSA_NEW_METHOD), "DSA_new_method"}, |
80 | {ERR_FUNC(DSA_F_DSA_PARAM_DECODE), "DSA_PARAM_DECODE"}, | 82 | {ERR_FUNC(DSA_F_DSA_PARAM_DECODE), "DSA_PARAM_DECODE"}, |
81 | {ERR_FUNC(DSA_F_DSA_PRINT_FP), "DSA_print_fp"}, | 83 | {ERR_FUNC(DSA_F_DSA_PRINT_FP), "DSA_print_fp"}, |
@@ -86,6 +88,7 @@ static ERR_STRING_DATA DSA_str_functs[]= | |||
86 | {ERR_FUNC(DSA_F_DSA_SIGN), "DSA_sign"}, | 88 | {ERR_FUNC(DSA_F_DSA_SIGN), "DSA_sign"}, |
87 | {ERR_FUNC(DSA_F_DSA_SIGN_SETUP), "DSA_sign_setup"}, | 89 | {ERR_FUNC(DSA_F_DSA_SIGN_SETUP), "DSA_sign_setup"}, |
88 | {ERR_FUNC(DSA_F_DSA_SIG_NEW), "DSA_SIG_new"}, | 90 | {ERR_FUNC(DSA_F_DSA_SIG_NEW), "DSA_SIG_new"}, |
91 | {ERR_FUNC(DSA_F_DSA_SIG_PRINT), "DSA_SIG_PRINT"}, | ||
89 | {ERR_FUNC(DSA_F_DSA_VERIFY), "DSA_verify"}, | 92 | {ERR_FUNC(DSA_F_DSA_VERIFY), "DSA_verify"}, |
90 | {ERR_FUNC(DSA_F_I2D_DSA_SIG), "i2d_DSA_SIG"}, | 93 | {ERR_FUNC(DSA_F_I2D_DSA_SIG), "i2d_DSA_SIG"}, |
91 | {ERR_FUNC(DSA_F_OLD_DSA_PRIV_DECODE), "OLD_DSA_PRIV_DECODE"}, | 94 | {ERR_FUNC(DSA_F_OLD_DSA_PRIV_DECODE), "OLD_DSA_PRIV_DECODE"}, |
@@ -105,6 +108,8 @@ static ERR_STRING_DATA DSA_str_reasons[]= | |||
105 | {ERR_REASON(DSA_R_INVALID_DIGEST_TYPE) ,"invalid digest type"}, | 108 | {ERR_REASON(DSA_R_INVALID_DIGEST_TYPE) ,"invalid digest type"}, |
106 | {ERR_REASON(DSA_R_MISSING_PARAMETERS) ,"missing parameters"}, | 109 | {ERR_REASON(DSA_R_MISSING_PARAMETERS) ,"missing parameters"}, |
107 | {ERR_REASON(DSA_R_MODULUS_TOO_LARGE) ,"modulus too large"}, | 110 | {ERR_REASON(DSA_R_MODULUS_TOO_LARGE) ,"modulus too large"}, |
111 | {ERR_REASON(DSA_R_NEED_NEW_SETUP_VALUES) ,"need new setup values"}, | ||
112 | {ERR_REASON(DSA_R_NON_FIPS_DSA_METHOD) ,"non fips dsa method"}, | ||
108 | {ERR_REASON(DSA_R_NO_PARAMETERS_SET) ,"no parameters set"}, | 113 | {ERR_REASON(DSA_R_NO_PARAMETERS_SET) ,"no parameters set"}, |
109 | {ERR_REASON(DSA_R_PARAMETER_ENCODING_ERROR),"parameter encoding error"}, | 114 | {ERR_REASON(DSA_R_PARAMETER_ENCODING_ERROR),"parameter encoding error"}, |
110 | {0,NULL} | 115 | {0,NULL} |
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_gen.c b/src/lib/libssl/src/crypto/dsa/dsa_gen.c index cb0b4538a4..c398761d0d 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_gen.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_gen.c | |||
@@ -81,13 +81,33 @@ | |||
81 | #include <openssl/sha.h> | 81 | #include <openssl/sha.h> |
82 | #include "dsa_locl.h" | 82 | #include "dsa_locl.h" |
83 | 83 | ||
84 | #ifdef OPENSSL_FIPS | ||
85 | #include <openssl/fips.h> | ||
86 | #endif | ||
87 | |||
84 | int DSA_generate_parameters_ex(DSA *ret, int bits, | 88 | int DSA_generate_parameters_ex(DSA *ret, int bits, |
85 | const unsigned char *seed_in, int seed_len, | 89 | const unsigned char *seed_in, int seed_len, |
86 | int *counter_ret, unsigned long *h_ret, BN_GENCB *cb) | 90 | int *counter_ret, unsigned long *h_ret, BN_GENCB *cb) |
87 | { | 91 | { |
92 | #ifdef OPENSSL_FIPS | ||
93 | if (FIPS_mode() && !(ret->meth->flags & DSA_FLAG_FIPS_METHOD) | ||
94 | && !(ret->flags & DSA_FLAG_NON_FIPS_ALLOW)) | ||
95 | { | ||
96 | DSAerr(DSA_F_DSA_GENERATE_PARAMETERS_EX, DSA_R_NON_FIPS_DSA_METHOD); | ||
97 | return 0; | ||
98 | } | ||
99 | #endif | ||
88 | if(ret->meth->dsa_paramgen) | 100 | if(ret->meth->dsa_paramgen) |
89 | return ret->meth->dsa_paramgen(ret, bits, seed_in, seed_len, | 101 | return ret->meth->dsa_paramgen(ret, bits, seed_in, seed_len, |
90 | counter_ret, h_ret, cb); | 102 | counter_ret, h_ret, cb); |
103 | #ifdef OPENSSL_FIPS | ||
104 | else if (FIPS_mode()) | ||
105 | { | ||
106 | return FIPS_dsa_generate_parameters_ex(ret, bits, | ||
107 | seed_in, seed_len, | ||
108 | counter_ret, h_ret, cb); | ||
109 | } | ||
110 | #endif | ||
91 | else | 111 | else |
92 | { | 112 | { |
93 | const EVP_MD *evpmd; | 113 | const EVP_MD *evpmd; |
@@ -105,12 +125,13 @@ int DSA_generate_parameters_ex(DSA *ret, int bits, | |||
105 | } | 125 | } |
106 | 126 | ||
107 | return dsa_builtin_paramgen(ret, bits, qbits, evpmd, | 127 | return dsa_builtin_paramgen(ret, bits, qbits, evpmd, |
108 | seed_in, seed_len, counter_ret, h_ret, cb); | 128 | seed_in, seed_len, NULL, counter_ret, h_ret, cb); |
109 | } | 129 | } |
110 | } | 130 | } |
111 | 131 | ||
112 | int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, | 132 | int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, |
113 | const EVP_MD *evpmd, const unsigned char *seed_in, size_t seed_len, | 133 | const EVP_MD *evpmd, const unsigned char *seed_in, size_t seed_len, |
134 | unsigned char *seed_out, | ||
114 | int *counter_ret, unsigned long *h_ret, BN_GENCB *cb) | 135 | int *counter_ret, unsigned long *h_ret, BN_GENCB *cb) |
115 | { | 136 | { |
116 | int ok=0; | 137 | int ok=0; |
@@ -201,8 +222,10 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, | |||
201 | } | 222 | } |
202 | 223 | ||
203 | /* step 2 */ | 224 | /* step 2 */ |
204 | EVP_Digest(seed, qsize, md, NULL, evpmd, NULL); | 225 | if (!EVP_Digest(seed, qsize, md, NULL, evpmd, NULL)) |
205 | EVP_Digest(buf, qsize, buf2, NULL, evpmd, NULL); | 226 | goto err; |
227 | if (!EVP_Digest(buf, qsize, buf2, NULL, evpmd, NULL)) | ||
228 | goto err; | ||
206 | for (i = 0; i < qsize; i++) | 229 | for (i = 0; i < qsize; i++) |
207 | md[i]^=buf2[i]; | 230 | md[i]^=buf2[i]; |
208 | 231 | ||
@@ -251,7 +274,9 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, | |||
251 | break; | 274 | break; |
252 | } | 275 | } |
253 | 276 | ||
254 | EVP_Digest(buf, qsize, md ,NULL, evpmd, NULL); | 277 | if (!EVP_Digest(buf, qsize, md ,NULL, evpmd, |
278 | NULL)) | ||
279 | goto err; | ||
255 | 280 | ||
256 | /* step 8 */ | 281 | /* step 8 */ |
257 | if (!BN_bin2bn(md, qsize, r0)) | 282 | if (!BN_bin2bn(md, qsize, r0)) |
@@ -332,6 +357,8 @@ err: | |||
332 | } | 357 | } |
333 | if (counter_ret != NULL) *counter_ret=counter; | 358 | if (counter_ret != NULL) *counter_ret=counter; |
334 | if (h_ret != NULL) *h_ret=h; | 359 | if (h_ret != NULL) *h_ret=h; |
360 | if (seed_out) | ||
361 | memcpy(seed_out, seed, qsize); | ||
335 | } | 362 | } |
336 | if(ctx) | 363 | if(ctx) |
337 | { | 364 | { |
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_key.c b/src/lib/libssl/src/crypto/dsa/dsa_key.c index c4aa86bc6d..9cf669b921 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_key.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_key.c | |||
@@ -64,12 +64,28 @@ | |||
64 | #include <openssl/dsa.h> | 64 | #include <openssl/dsa.h> |
65 | #include <openssl/rand.h> | 65 | #include <openssl/rand.h> |
66 | 66 | ||
67 | #ifdef OPENSSL_FIPS | ||
68 | #include <openssl/fips.h> | ||
69 | #endif | ||
70 | |||
67 | static int dsa_builtin_keygen(DSA *dsa); | 71 | static int dsa_builtin_keygen(DSA *dsa); |
68 | 72 | ||
69 | int DSA_generate_key(DSA *dsa) | 73 | int DSA_generate_key(DSA *dsa) |
70 | { | 74 | { |
75 | #ifdef OPENSSL_FIPS | ||
76 | if (FIPS_mode() && !(dsa->meth->flags & DSA_FLAG_FIPS_METHOD) | ||
77 | && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) | ||
78 | { | ||
79 | DSAerr(DSA_F_DSA_GENERATE_KEY, DSA_R_NON_FIPS_DSA_METHOD); | ||
80 | return 0; | ||
81 | } | ||
82 | #endif | ||
71 | if(dsa->meth->dsa_keygen) | 83 | if(dsa->meth->dsa_keygen) |
72 | return dsa->meth->dsa_keygen(dsa); | 84 | return dsa->meth->dsa_keygen(dsa); |
85 | #ifdef OPENSSL_FIPS | ||
86 | if (FIPS_mode()) | ||
87 | return FIPS_dsa_generate_key(dsa); | ||
88 | #endif | ||
73 | return dsa_builtin_keygen(dsa); | 89 | return dsa_builtin_keygen(dsa); |
74 | } | 90 | } |
75 | 91 | ||
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_lib.c b/src/lib/libssl/src/crypto/dsa/dsa_lib.c index e9b75902db..96d8d0c4b4 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_lib.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_lib.c | |||
@@ -70,6 +70,10 @@ | |||
70 | #include <openssl/dh.h> | 70 | #include <openssl/dh.h> |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #ifdef OPENSSL_FIPS | ||
74 | #include <openssl/fips.h> | ||
75 | #endif | ||
76 | |||
73 | const char DSA_version[]="DSA" OPENSSL_VERSION_PTEXT; | 77 | const char DSA_version[]="DSA" OPENSSL_VERSION_PTEXT; |
74 | 78 | ||
75 | static const DSA_METHOD *default_DSA_method = NULL; | 79 | static const DSA_METHOD *default_DSA_method = NULL; |
@@ -82,7 +86,16 @@ void DSA_set_default_method(const DSA_METHOD *meth) | |||
82 | const DSA_METHOD *DSA_get_default_method(void) | 86 | const DSA_METHOD *DSA_get_default_method(void) |
83 | { | 87 | { |
84 | if(!default_DSA_method) | 88 | if(!default_DSA_method) |
89 | { | ||
90 | #ifdef OPENSSL_FIPS | ||
91 | if (FIPS_mode()) | ||
92 | return FIPS_dsa_openssl(); | ||
93 | else | ||
94 | return DSA_OpenSSL(); | ||
95 | #else | ||
85 | default_DSA_method = DSA_OpenSSL(); | 96 | default_DSA_method = DSA_OpenSSL(); |
97 | #endif | ||
98 | } | ||
86 | return default_DSA_method; | 99 | return default_DSA_method; |
87 | } | 100 | } |
88 | 101 | ||
@@ -163,7 +176,7 @@ DSA *DSA_new_method(ENGINE *engine) | |||
163 | ret->method_mont_p=NULL; | 176 | ret->method_mont_p=NULL; |
164 | 177 | ||
165 | ret->references=1; | 178 | ret->references=1; |
166 | ret->flags=ret->meth->flags; | 179 | ret->flags=ret->meth->flags & ~DSA_FLAG_NON_FIPS_ALLOW; |
167 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); | 180 | CRYPTO_new_ex_data(CRYPTO_EX_INDEX_DSA, ret, &ret->ex_data); |
168 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) | 181 | if ((ret->meth->init != NULL) && !ret->meth->init(ret)) |
169 | { | 182 | { |
@@ -276,7 +289,8 @@ void *DSA_get_ex_data(DSA *d, int idx) | |||
276 | DH *DSA_dup_DH(const DSA *r) | 289 | DH *DSA_dup_DH(const DSA *r) |
277 | { | 290 | { |
278 | /* DSA has p, q, g, optional pub_key, optional priv_key. | 291 | /* DSA has p, q, g, optional pub_key, optional priv_key. |
279 | * DH has p, optional length, g, optional pub_key, optional priv_key. | 292 | * DH has p, optional length, g, optional pub_key, optional priv_key, |
293 | * optional q. | ||
280 | */ | 294 | */ |
281 | 295 | ||
282 | DH *ret = NULL; | 296 | DH *ret = NULL; |
@@ -290,7 +304,11 @@ DH *DSA_dup_DH(const DSA *r) | |||
290 | if ((ret->p = BN_dup(r->p)) == NULL) | 304 | if ((ret->p = BN_dup(r->p)) == NULL) |
291 | goto err; | 305 | goto err; |
292 | if (r->q != NULL) | 306 | if (r->q != NULL) |
307 | { | ||
293 | ret->length = BN_num_bits(r->q); | 308 | ret->length = BN_num_bits(r->q); |
309 | if ((ret->q = BN_dup(r->q)) == NULL) | ||
310 | goto err; | ||
311 | } | ||
294 | if (r->g != NULL) | 312 | if (r->g != NULL) |
295 | if ((ret->g = BN_dup(r->g)) == NULL) | 313 | if ((ret->g = BN_dup(r->g)) == NULL) |
296 | goto err; | 314 | goto err; |
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c index a3ddd7d281..b3d78e524c 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c | |||
@@ -136,6 +136,7 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
136 | BN_CTX *ctx=NULL; | 136 | BN_CTX *ctx=NULL; |
137 | int reason=ERR_R_BN_LIB; | 137 | int reason=ERR_R_BN_LIB; |
138 | DSA_SIG *ret=NULL; | 138 | DSA_SIG *ret=NULL; |
139 | int noredo = 0; | ||
139 | 140 | ||
140 | BN_init(&m); | 141 | BN_init(&m); |
141 | BN_init(&xr); | 142 | BN_init(&xr); |
@@ -150,7 +151,7 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
150 | if (s == NULL) goto err; | 151 | if (s == NULL) goto err; |
151 | ctx=BN_CTX_new(); | 152 | ctx=BN_CTX_new(); |
152 | if (ctx == NULL) goto err; | 153 | if (ctx == NULL) goto err; |
153 | 154 | redo: | |
154 | if ((dsa->kinv == NULL) || (dsa->r == NULL)) | 155 | if ((dsa->kinv == NULL) || (dsa->r == NULL)) |
155 | { | 156 | { |
156 | if (!DSA_sign_setup(dsa,ctx,&kinv,&r)) goto err; | 157 | if (!DSA_sign_setup(dsa,ctx,&kinv,&r)) goto err; |
@@ -161,6 +162,7 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
161 | dsa->kinv=NULL; | 162 | dsa->kinv=NULL; |
162 | r=dsa->r; | 163 | r=dsa->r; |
163 | dsa->r=NULL; | 164 | dsa->r=NULL; |
165 | noredo = 1; | ||
164 | } | 166 | } |
165 | 167 | ||
166 | 168 | ||
@@ -181,6 +183,18 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
181 | 183 | ||
182 | ret=DSA_SIG_new(); | 184 | ret=DSA_SIG_new(); |
183 | if (ret == NULL) goto err; | 185 | if (ret == NULL) goto err; |
186 | /* Redo if r or s is zero as required by FIPS 186-3: this is | ||
187 | * very unlikely. | ||
188 | */ | ||
189 | if (BN_is_zero(r) || BN_is_zero(s)) | ||
190 | { | ||
191 | if (noredo) | ||
192 | { | ||
193 | reason = DSA_R_NEED_NEW_SETUP_VALUES; | ||
194 | goto err; | ||
195 | } | ||
196 | goto redo; | ||
197 | } | ||
184 | ret->r = r; | 198 | ret->r = r; |
185 | ret->s = s; | 199 | ret->s = s; |
186 | 200 | ||
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_sign.c b/src/lib/libssl/src/crypto/dsa/dsa_sign.c index 17555e5892..c3cc3642ce 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_sign.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_sign.c | |||
@@ -61,30 +61,54 @@ | |||
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/dsa.h> | 62 | #include <openssl/dsa.h> |
63 | #include <openssl/rand.h> | 63 | #include <openssl/rand.h> |
64 | #include <openssl/bn.h> | ||
64 | 65 | ||
65 | DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | 66 | DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) |
66 | { | 67 | { |
68 | #ifdef OPENSSL_FIPS | ||
69 | if (FIPS_mode() && !(dsa->meth->flags & DSA_FLAG_FIPS_METHOD) | ||
70 | && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) | ||
71 | { | ||
72 | DSAerr(DSA_F_DSA_DO_SIGN, DSA_R_NON_FIPS_DSA_METHOD); | ||
73 | return NULL; | ||
74 | } | ||
75 | #endif | ||
67 | return dsa->meth->dsa_do_sign(dgst, dlen, dsa); | 76 | return dsa->meth->dsa_do_sign(dgst, dlen, dsa); |
68 | } | 77 | } |
69 | 78 | ||
70 | int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, | 79 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) |
71 | unsigned int *siglen, DSA *dsa) | ||
72 | { | 80 | { |
73 | DSA_SIG *s; | 81 | #ifdef OPENSSL_FIPS |
74 | RAND_seed(dgst, dlen); | 82 | if (FIPS_mode() && !(dsa->meth->flags & DSA_FLAG_FIPS_METHOD) |
75 | s=DSA_do_sign(dgst,dlen,dsa); | 83 | && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) |
76 | if (s == NULL) | ||
77 | { | 84 | { |
78 | *siglen=0; | 85 | DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_NON_FIPS_DSA_METHOD); |
79 | return(0); | 86 | return 0; |
80 | } | 87 | } |
81 | *siglen=i2d_DSA_SIG(s,&sig); | 88 | #endif |
82 | DSA_SIG_free(s); | 89 | return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); |
83 | return(1); | ||
84 | } | 90 | } |
85 | 91 | ||
86 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) | 92 | DSA_SIG *DSA_SIG_new(void) |
87 | { | 93 | { |
88 | return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); | 94 | DSA_SIG *sig; |
95 | sig = OPENSSL_malloc(sizeof(DSA_SIG)); | ||
96 | if (!sig) | ||
97 | return NULL; | ||
98 | sig->r = NULL; | ||
99 | sig->s = NULL; | ||
100 | return sig; | ||
101 | } | ||
102 | |||
103 | void DSA_SIG_free(DSA_SIG *sig) | ||
104 | { | ||
105 | if (sig) | ||
106 | { | ||
107 | if (sig->r) | ||
108 | BN_free(sig->r); | ||
109 | if (sig->s) | ||
110 | BN_free(sig->s); | ||
111 | OPENSSL_free(sig); | ||
112 | } | ||
89 | } | 113 | } |
90 | 114 | ||
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_vrf.c b/src/lib/libssl/src/crypto/dsa/dsa_vrf.c index 226a75ff3f..674cb5fa5f 100644 --- a/src/lib/libssl/src/crypto/dsa/dsa_vrf.c +++ b/src/lib/libssl/src/crypto/dsa/dsa_vrf.c | |||
@@ -64,26 +64,13 @@ | |||
64 | int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, | 64 | int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, |
65 | DSA *dsa) | 65 | DSA *dsa) |
66 | { | 66 | { |
67 | #ifdef OPENSSL_FIPS | ||
68 | if (FIPS_mode() && !(dsa->meth->flags & DSA_FLAG_FIPS_METHOD) | ||
69 | && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) | ||
70 | { | ||
71 | DSAerr(DSA_F_DSA_DO_VERIFY, DSA_R_NON_FIPS_DSA_METHOD); | ||
72 | return -1; | ||
73 | } | ||
74 | #endif | ||
67 | return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); | 75 | return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); |
68 | } | 76 | } |
69 | |||
70 | /* data has already been hashed (probably with SHA or SHA-1). */ | ||
71 | /* returns | ||
72 | * 1: correct signature | ||
73 | * 0: incorrect signature | ||
74 | * -1: error | ||
75 | */ | ||
76 | int DSA_verify(int type, const unsigned char *dgst, int dgst_len, | ||
77 | const unsigned char *sigbuf, int siglen, DSA *dsa) | ||
78 | { | ||
79 | DSA_SIG *s; | ||
80 | int ret=-1; | ||
81 | |||
82 | s = DSA_SIG_new(); | ||
83 | if (s == NULL) return(ret); | ||
84 | if (d2i_DSA_SIG(&s,&sigbuf,siglen) == NULL) goto err; | ||
85 | ret=DSA_do_verify(dgst,dgst_len,s,dsa); | ||
86 | err: | ||
87 | DSA_SIG_free(s); | ||
88 | return(ret); | ||
89 | } | ||
diff --git a/src/lib/libssl/src/crypto/dso/dso_dlfcn.c b/src/lib/libssl/src/crypto/dso/dso_dlfcn.c index c2bc61760b..5f2254806c 100644 --- a/src/lib/libssl/src/crypto/dso/dso_dlfcn.c +++ b/src/lib/libssl/src/crypto/dso/dso_dlfcn.c | |||
@@ -86,7 +86,8 @@ DSO_METHOD *DSO_METHOD_dlfcn(void) | |||
86 | # if defined(_AIX) || defined(__CYGWIN__) || \ | 86 | # if defined(_AIX) || defined(__CYGWIN__) || \ |
87 | defined(__SCO_VERSION__) || defined(_SCO_ELF) || \ | 87 | defined(__SCO_VERSION__) || defined(_SCO_ELF) || \ |
88 | (defined(__osf__) && !defined(RTLD_NEXT)) || \ | 88 | (defined(__osf__) && !defined(RTLD_NEXT)) || \ |
89 | (defined(__OpenBSD__) && !defined(RTLD_SELF)) | 89 | (defined(__OpenBSD__) && !defined(RTLD_SELF)) || \ |
90 | defined(__ANDROID__) | ||
90 | # undef HAVE_DLINFO | 91 | # undef HAVE_DLINFO |
91 | # endif | 92 | # endif |
92 | #endif | 93 | #endif |
diff --git a/src/lib/libssl/src/crypto/ec/Makefile b/src/lib/libssl/src/crypto/ec/Makefile index db380ed16f..f85fc845ca 100644 --- a/src/lib/libssl/src/crypto/ec/Makefile +++ b/src/lib/libssl/src/crypto/ec/Makefile | |||
@@ -19,11 +19,15 @@ APPS= | |||
19 | LIB=$(TOP)/libcrypto.a | 19 | LIB=$(TOP)/libcrypto.a |
20 | LIBSRC= ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c\ | 20 | LIBSRC= ec_lib.c ecp_smpl.c ecp_mont.c ecp_nist.c ec_cvt.c ec_mult.c\ |
21 | ec_err.c ec_curve.c ec_check.c ec_print.c ec_asn1.c ec_key.c\ | 21 | ec_err.c ec_curve.c ec_check.c ec_print.c ec_asn1.c ec_key.c\ |
22 | ec2_smpl.c ec2_mult.c ec_ameth.c ec_pmeth.c eck_prn.c | 22 | ec2_smpl.c ec2_mult.c ec_ameth.c ec_pmeth.c eck_prn.c \ |
23 | ecp_nistp224.c ecp_nistp256.c ecp_nistp521.c ecp_nistputil.c \ | ||
24 | ecp_oct.c ec2_oct.c ec_oct.c | ||
23 | 25 | ||
24 | LIBOBJ= ec_lib.o ecp_smpl.o ecp_mont.o ecp_nist.o ec_cvt.o ec_mult.o\ | 26 | LIBOBJ= ec_lib.o ecp_smpl.o ecp_mont.o ecp_nist.o ec_cvt.o ec_mult.o\ |
25 | ec_err.o ec_curve.o ec_check.o ec_print.o ec_asn1.o ec_key.o\ | 27 | ec_err.o ec_curve.o ec_check.o ec_print.o ec_asn1.o ec_key.o\ |
26 | ec2_smpl.o ec2_mult.o ec_ameth.o ec_pmeth.o eck_prn.o | 28 | ec2_smpl.o ec2_mult.o ec_ameth.o ec_pmeth.o eck_prn.o \ |
29 | ecp_nistp224.o ecp_nistp256.o ecp_nistp521.o ecp_nistputil.o \ | ||
30 | ecp_oct.o ec2_oct.o ec_oct.o | ||
27 | 31 | ||
28 | SRC= $(LIBSRC) | 32 | SRC= $(LIBSRC) |
29 | 33 | ||
@@ -87,6 +91,14 @@ ec2_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | |||
87 | ec2_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 91 | ec2_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
88 | ec2_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 92 | ec2_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
89 | ec2_mult.o: ../../include/openssl/symhacks.h ec2_mult.c ec_lcl.h | 93 | ec2_mult.o: ../../include/openssl/symhacks.h ec2_mult.c ec_lcl.h |
94 | ec2_oct.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
95 | ec2_oct.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
96 | ec2_oct.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
97 | ec2_oct.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
98 | ec2_oct.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | ||
99 | ec2_oct.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
100 | ec2_oct.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
101 | ec2_oct.o: ../../include/openssl/symhacks.h ec2_oct.c ec_lcl.h | ||
90 | ec2_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 102 | ec2_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
91 | ec2_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 103 | ec2_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
92 | ec2_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 104 | ec2_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -174,6 +186,14 @@ ec_mult.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | |||
174 | ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 186 | ec_mult.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
175 | ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 187 | ec_mult.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
176 | ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c | 188 | ec_mult.o: ../../include/openssl/symhacks.h ec_lcl.h ec_mult.c |
189 | ec_oct.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
190 | ec_oct.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
191 | ec_oct.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
192 | ec_oct.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
193 | ec_oct.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | ||
194 | ec_oct.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
195 | ec_oct.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
196 | ec_oct.o: ../../include/openssl/symhacks.h ec_lcl.h ec_oct.c | ||
177 | ec_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h | 197 | ec_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h |
178 | ec_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | 198 | ec_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
179 | ec_pmeth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 199 | ec_pmeth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -221,6 +241,18 @@ ecp_nist.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | |||
221 | ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 241 | ecp_nist.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
222 | ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 242 | ecp_nist.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
223 | ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c | 243 | ecp_nist.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_nist.c |
244 | ecp_nistp224.o: ../../include/openssl/opensslconf.h ecp_nistp224.c | ||
245 | ecp_nistp256.o: ../../include/openssl/opensslconf.h ecp_nistp256.c | ||
246 | ecp_nistp521.o: ../../include/openssl/opensslconf.h ecp_nistp521.c | ||
247 | ecp_nistputil.o: ../../include/openssl/opensslconf.h ecp_nistputil.c | ||
248 | ecp_oct.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
249 | ecp_oct.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | ||
250 | ecp_oct.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
251 | ecp_oct.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | ||
252 | ecp_oct.o: ../../include/openssl/obj_mac.h ../../include/openssl/opensslconf.h | ||
253 | ecp_oct.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
254 | ecp_oct.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
255 | ecp_oct.o: ../../include/openssl/symhacks.h ec_lcl.h ecp_oct.c | ||
224 | ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 256 | ecp_smpl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
225 | ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 257 | ecp_smpl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
226 | ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 258 | ecp_smpl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
diff --git a/src/lib/libssl/src/crypto/ec/ec.h b/src/lib/libssl/src/crypto/ec/ec.h index ee7078130c..9d01325af3 100644 --- a/src/lib/libssl/src/crypto/ec/ec.h +++ b/src/lib/libssl/src/crypto/ec/ec.h | |||
@@ -151,7 +151,24 @@ const EC_METHOD *EC_GFp_mont_method(void); | |||
151 | */ | 151 | */ |
152 | const EC_METHOD *EC_GFp_nist_method(void); | 152 | const EC_METHOD *EC_GFp_nist_method(void); |
153 | 153 | ||
154 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
155 | /** Returns 64-bit optimized methods for nistp224 | ||
156 | * \return EC_METHOD object | ||
157 | */ | ||
158 | const EC_METHOD *EC_GFp_nistp224_method(void); | ||
159 | |||
160 | /** Returns 64-bit optimized methods for nistp256 | ||
161 | * \return EC_METHOD object | ||
162 | */ | ||
163 | const EC_METHOD *EC_GFp_nistp256_method(void); | ||
164 | |||
165 | /** Returns 64-bit optimized methods for nistp521 | ||
166 | * \return EC_METHOD object | ||
167 | */ | ||
168 | const EC_METHOD *EC_GFp_nistp521_method(void); | ||
169 | #endif | ||
154 | 170 | ||
171 | #ifndef OPENSSL_NO_EC2M | ||
155 | /********************************************************************/ | 172 | /********************************************************************/ |
156 | /* EC_METHOD for curves over GF(2^m) */ | 173 | /* EC_METHOD for curves over GF(2^m) */ |
157 | /********************************************************************/ | 174 | /********************************************************************/ |
@@ -161,6 +178,8 @@ const EC_METHOD *EC_GFp_nist_method(void); | |||
161 | */ | 178 | */ |
162 | const EC_METHOD *EC_GF2m_simple_method(void); | 179 | const EC_METHOD *EC_GF2m_simple_method(void); |
163 | 180 | ||
181 | #endif | ||
182 | |||
164 | 183 | ||
165 | /********************************************************************/ | 184 | /********************************************************************/ |
166 | /* EC_GROUP functions */ | 185 | /* EC_GROUP functions */ |
@@ -282,6 +301,7 @@ int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, co | |||
282 | */ | 301 | */ |
283 | int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | 302 | int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); |
284 | 303 | ||
304 | #ifndef OPENSSL_NO_EC2M | ||
285 | /** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b | 305 | /** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b |
286 | * \param group EC_GROUP object | 306 | * \param group EC_GROUP object |
287 | * \param p BIGNUM with the polynomial defining the underlying field | 307 | * \param p BIGNUM with the polynomial defining the underlying field |
@@ -301,7 +321,7 @@ int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, c | |||
301 | * \return 1 on success and 0 if an error occured | 321 | * \return 1 on success and 0 if an error occured |
302 | */ | 322 | */ |
303 | int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); | 323 | int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); |
304 | 324 | #endif | |
305 | /** Returns the number of bits needed to represent a field element | 325 | /** Returns the number of bits needed to represent a field element |
306 | * \param group EC_GROUP object | 326 | * \param group EC_GROUP object |
307 | * \return number of bits needed to represent a field element | 327 | * \return number of bits needed to represent a field element |
@@ -342,7 +362,7 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx); | |||
342 | * \return newly created EC_GROUP object with the specified parameters | 362 | * \return newly created EC_GROUP object with the specified parameters |
343 | */ | 363 | */ |
344 | EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); | 364 | EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
345 | 365 | #ifndef OPENSSL_NO_EC2M | |
346 | /** Creates a new EC_GROUP object with the specified parameters defined | 366 | /** Creates a new EC_GROUP object with the specified parameters defined |
347 | * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b) | 367 | * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b) |
348 | * \param p BIGNUM with the polynomial defining the underlying field | 368 | * \param p BIGNUM with the polynomial defining the underlying field |
@@ -352,7 +372,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
352 | * \return newly created EC_GROUP object with the specified parameters | 372 | * \return newly created EC_GROUP object with the specified parameters |
353 | */ | 373 | */ |
354 | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); | 374 | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); |
355 | 375 | #endif | |
356 | /** Creates a EC_GROUP object with a curve specified by a NID | 376 | /** Creates a EC_GROUP object with a curve specified by a NID |
357 | * \param nid NID of the OID of the curve name | 377 | * \param nid NID of the OID of the curve name |
358 | * \return newly created EC_GROUP object with specified curve or NULL | 378 | * \return newly created EC_GROUP object with specified curve or NULL |
@@ -481,7 +501,7 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, | |||
481 | */ | 501 | */ |
482 | int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, | 502 | int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, |
483 | const BIGNUM *x, int y_bit, BN_CTX *ctx); | 503 | const BIGNUM *x, int y_bit, BN_CTX *ctx); |
484 | 504 | #ifndef OPENSSL_NO_EC2M | |
485 | /** Sets the affine coordinates of a EC_POINT over GF2m | 505 | /** Sets the affine coordinates of a EC_POINT over GF2m |
486 | * \param group underlying EC_GROUP object | 506 | * \param group underlying EC_GROUP object |
487 | * \param p EC_POINT object | 507 | * \param p EC_POINT object |
@@ -514,7 +534,7 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, | |||
514 | */ | 534 | */ |
515 | int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, | 535 | int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, |
516 | const BIGNUM *x, int y_bit, BN_CTX *ctx); | 536 | const BIGNUM *x, int y_bit, BN_CTX *ctx); |
517 | 537 | #endif | |
518 | /** Encodes a EC_POINT object to a octet string | 538 | /** Encodes a EC_POINT object to a octet string |
519 | * \param group underlying EC_GROUP object | 539 | * \param group underlying EC_GROUP object |
520 | * \param p EC_POINT object | 540 | * \param p EC_POINT object |
@@ -653,9 +673,11 @@ int EC_GROUP_have_precompute_mult(const EC_GROUP *group); | |||
653 | /* EC_GROUP_get_basis_type() returns the NID of the basis type | 673 | /* EC_GROUP_get_basis_type() returns the NID of the basis type |
654 | * used to represent the field elements */ | 674 | * used to represent the field elements */ |
655 | int EC_GROUP_get_basis_type(const EC_GROUP *); | 675 | int EC_GROUP_get_basis_type(const EC_GROUP *); |
676 | #ifndef OPENSSL_NO_EC2M | ||
656 | int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); | 677 | int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); |
657 | int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, | 678 | int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, |
658 | unsigned int *k2, unsigned int *k3); | 679 | unsigned int *k2, unsigned int *k3); |
680 | #endif | ||
659 | 681 | ||
660 | #define OPENSSL_EC_NAMED_CURVE 0x001 | 682 | #define OPENSSL_EC_NAMED_CURVE 0x001 |
661 | 683 | ||
@@ -689,11 +711,21 @@ typedef struct ec_key_st EC_KEY; | |||
689 | #define EC_PKEY_NO_PARAMETERS 0x001 | 711 | #define EC_PKEY_NO_PARAMETERS 0x001 |
690 | #define EC_PKEY_NO_PUBKEY 0x002 | 712 | #define EC_PKEY_NO_PUBKEY 0x002 |
691 | 713 | ||
714 | /* some values for the flags field */ | ||
715 | #define EC_FLAG_NON_FIPS_ALLOW 0x1 | ||
716 | #define EC_FLAG_FIPS_CHECKED 0x2 | ||
717 | |||
692 | /** Creates a new EC_KEY object. | 718 | /** Creates a new EC_KEY object. |
693 | * \return EC_KEY object or NULL if an error occurred. | 719 | * \return EC_KEY object or NULL if an error occurred. |
694 | */ | 720 | */ |
695 | EC_KEY *EC_KEY_new(void); | 721 | EC_KEY *EC_KEY_new(void); |
696 | 722 | ||
723 | int EC_KEY_get_flags(const EC_KEY *key); | ||
724 | |||
725 | void EC_KEY_set_flags(EC_KEY *key, int flags); | ||
726 | |||
727 | void EC_KEY_clear_flags(EC_KEY *key, int flags); | ||
728 | |||
697 | /** Creates a new EC_KEY object using a named curve as underlying | 729 | /** Creates a new EC_KEY object using a named curve as underlying |
698 | * EC_GROUP object. | 730 | * EC_GROUP object. |
699 | * \param nid NID of the named curve. | 731 | * \param nid NID of the named curve. |
@@ -799,6 +831,15 @@ int EC_KEY_generate_key(EC_KEY *key); | |||
799 | */ | 831 | */ |
800 | int EC_KEY_check_key(const EC_KEY *key); | 832 | int EC_KEY_check_key(const EC_KEY *key); |
801 | 833 | ||
834 | /** Sets a public key from affine coordindates performing | ||
835 | * neccessary NIST PKV tests. | ||
836 | * \param key the EC_KEY object | ||
837 | * \param x public key x coordinate | ||
838 | * \param y public key y coordinate | ||
839 | * \return 1 on success and 0 otherwise. | ||
840 | */ | ||
841 | int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y); | ||
842 | |||
802 | 843 | ||
803 | /********************************************************************/ | 844 | /********************************************************************/ |
804 | /* de- and encoding functions for SEC1 ECPrivateKey */ | 845 | /* de- and encoding functions for SEC1 ECPrivateKey */ |
@@ -926,6 +967,7 @@ void ERR_load_EC_strings(void); | |||
926 | /* Error codes for the EC functions. */ | 967 | /* Error codes for the EC functions. */ |
927 | 968 | ||
928 | /* Function codes. */ | 969 | /* Function codes. */ |
970 | #define EC_F_BN_TO_FELEM 224 | ||
929 | #define EC_F_COMPUTE_WNAF 143 | 971 | #define EC_F_COMPUTE_WNAF 143 |
930 | #define EC_F_D2I_ECPARAMETERS 144 | 972 | #define EC_F_D2I_ECPARAMETERS 144 |
931 | #define EC_F_D2I_ECPKPARAMETERS 145 | 973 | #define EC_F_D2I_ECPKPARAMETERS 145 |
@@ -968,6 +1010,15 @@ void ERR_load_EC_strings(void); | |||
968 | #define EC_F_EC_GFP_MONT_FIELD_SQR 132 | 1010 | #define EC_F_EC_GFP_MONT_FIELD_SQR 132 |
969 | #define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 | 1011 | #define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 |
970 | #define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 | 1012 | #define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 |
1013 | #define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE 225 | ||
1014 | #define EC_F_EC_GFP_NISTP224_POINTS_MUL 228 | ||
1015 | #define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226 | ||
1016 | #define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE 230 | ||
1017 | #define EC_F_EC_GFP_NISTP256_POINTS_MUL 231 | ||
1018 | #define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232 | ||
1019 | #define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE 233 | ||
1020 | #define EC_F_EC_GFP_NISTP521_POINTS_MUL 234 | ||
1021 | #define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235 | ||
971 | #define EC_F_EC_GFP_NIST_FIELD_MUL 200 | 1022 | #define EC_F_EC_GFP_NIST_FIELD_MUL 200 |
972 | #define EC_F_EC_GFP_NIST_FIELD_SQR 201 | 1023 | #define EC_F_EC_GFP_NIST_FIELD_SQR 201 |
973 | #define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 | 1024 | #define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 |
@@ -1010,6 +1061,7 @@ void ERR_load_EC_strings(void); | |||
1010 | #define EC_F_EC_KEY_NEW 182 | 1061 | #define EC_F_EC_KEY_NEW 182 |
1011 | #define EC_F_EC_KEY_PRINT 180 | 1062 | #define EC_F_EC_KEY_PRINT 180 |
1012 | #define EC_F_EC_KEY_PRINT_FP 181 | 1063 | #define EC_F_EC_KEY_PRINT_FP 181 |
1064 | #define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES 229 | ||
1013 | #define EC_F_EC_POINTS_MAKE_AFFINE 136 | 1065 | #define EC_F_EC_POINTS_MAKE_AFFINE 136 |
1014 | #define EC_F_EC_POINT_ADD 112 | 1066 | #define EC_F_EC_POINT_ADD 112 |
1015 | #define EC_F_EC_POINT_CMP 113 | 1067 | #define EC_F_EC_POINT_CMP 113 |
@@ -1040,6 +1092,9 @@ void ERR_load_EC_strings(void); | |||
1040 | #define EC_F_I2D_ECPKPARAMETERS 191 | 1092 | #define EC_F_I2D_ECPKPARAMETERS 191 |
1041 | #define EC_F_I2D_ECPRIVATEKEY 192 | 1093 | #define EC_F_I2D_ECPRIVATEKEY 192 |
1042 | #define EC_F_I2O_ECPUBLICKEY 151 | 1094 | #define EC_F_I2O_ECPUBLICKEY 151 |
1095 | #define EC_F_NISTP224_PRE_COMP_NEW 227 | ||
1096 | #define EC_F_NISTP256_PRE_COMP_NEW 236 | ||
1097 | #define EC_F_NISTP521_PRE_COMP_NEW 237 | ||
1043 | #define EC_F_O2I_ECPUBLICKEY 152 | 1098 | #define EC_F_O2I_ECPUBLICKEY 152 |
1044 | #define EC_F_OLD_EC_PRIV_DECODE 222 | 1099 | #define EC_F_OLD_EC_PRIV_DECODE 222 |
1045 | #define EC_F_PKEY_EC_CTRL 197 | 1100 | #define EC_F_PKEY_EC_CTRL 197 |
@@ -1052,12 +1107,15 @@ void ERR_load_EC_strings(void); | |||
1052 | /* Reason codes. */ | 1107 | /* Reason codes. */ |
1053 | #define EC_R_ASN1_ERROR 115 | 1108 | #define EC_R_ASN1_ERROR 115 |
1054 | #define EC_R_ASN1_UNKNOWN_FIELD 116 | 1109 | #define EC_R_ASN1_UNKNOWN_FIELD 116 |
1110 | #define EC_R_BIGNUM_OUT_OF_RANGE 144 | ||
1055 | #define EC_R_BUFFER_TOO_SMALL 100 | 1111 | #define EC_R_BUFFER_TOO_SMALL 100 |
1112 | #define EC_R_COORDINATES_OUT_OF_RANGE 146 | ||
1056 | #define EC_R_D2I_ECPKPARAMETERS_FAILURE 117 | 1113 | #define EC_R_D2I_ECPKPARAMETERS_FAILURE 117 |
1057 | #define EC_R_DECODE_ERROR 142 | 1114 | #define EC_R_DECODE_ERROR 142 |
1058 | #define EC_R_DISCRIMINANT_IS_ZERO 118 | 1115 | #define EC_R_DISCRIMINANT_IS_ZERO 118 |
1059 | #define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 | 1116 | #define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 119 |
1060 | #define EC_R_FIELD_TOO_LARGE 143 | 1117 | #define EC_R_FIELD_TOO_LARGE 143 |
1118 | #define EC_R_GF2M_NOT_SUPPORTED 147 | ||
1061 | #define EC_R_GROUP2PKPARAMETERS_FAILURE 120 | 1119 | #define EC_R_GROUP2PKPARAMETERS_FAILURE 120 |
1062 | #define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 | 1120 | #define EC_R_I2D_ECPKPARAMETERS_FAILURE 121 |
1063 | #define EC_R_INCOMPATIBLE_OBJECTS 101 | 1121 | #define EC_R_INCOMPATIBLE_OBJECTS 101 |
@@ -1092,6 +1150,7 @@ void ERR_load_EC_strings(void); | |||
1092 | #define EC_R_UNKNOWN_GROUP 129 | 1150 | #define EC_R_UNKNOWN_GROUP 129 |
1093 | #define EC_R_UNKNOWN_ORDER 114 | 1151 | #define EC_R_UNKNOWN_ORDER 114 |
1094 | #define EC_R_UNSUPPORTED_FIELD 131 | 1152 | #define EC_R_UNSUPPORTED_FIELD 131 |
1153 | #define EC_R_WRONG_CURVE_PARAMETERS 145 | ||
1095 | #define EC_R_WRONG_ORDER 130 | 1154 | #define EC_R_WRONG_ORDER 130 |
1096 | 1155 | ||
1097 | #ifdef __cplusplus | 1156 | #ifdef __cplusplus |
diff --git a/src/lib/libssl/src/crypto/ec/ec_cvt.c b/src/lib/libssl/src/crypto/ec/ec_cvt.c index d45640bab9..bfcbab35fe 100644 --- a/src/lib/libssl/src/crypto/ec/ec_cvt.c +++ b/src/lib/libssl/src/crypto/ec/ec_cvt.c | |||
@@ -78,7 +78,32 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
78 | const EC_METHOD *meth; | 78 | const EC_METHOD *meth; |
79 | EC_GROUP *ret; | 79 | EC_GROUP *ret; |
80 | 80 | ||
81 | #if defined(OPENSSL_BN_ASM_MONT) | ||
82 | /* | ||
83 | * This might appear controversial, but the fact is that generic | ||
84 | * prime method was observed to deliver better performance even | ||
85 | * for NIST primes on a range of platforms, e.g.: 60%-15% | ||
86 | * improvement on IA-64, ~25% on ARM, 30%-90% on P4, 20%-25% | ||
87 | * in 32-bit build and 35%--12% in 64-bit build on Core2... | ||
88 | * Coefficients are relative to optimized bn_nist.c for most | ||
89 | * intensive ECDSA verify and ECDH operations for 192- and 521- | ||
90 | * bit keys respectively. Choice of these boundary values is | ||
91 | * arguable, because the dependency of improvement coefficient | ||
92 | * from key length is not a "monotone" curve. For example while | ||
93 | * 571-bit result is 23% on ARM, 384-bit one is -1%. But it's | ||
94 | * generally faster, sometimes "respectfully" faster, sometimes | ||
95 | * "tolerably" slower... What effectively happens is that loop | ||
96 | * with bn_mul_add_words is put against bn_mul_mont, and the | ||
97 | * latter "wins" on short vectors. Correct solution should be | ||
98 | * implementing dedicated NxN multiplication subroutines for | ||
99 | * small N. But till it materializes, let's stick to generic | ||
100 | * prime method... | ||
101 | * <appro> | ||
102 | */ | ||
103 | meth = EC_GFp_mont_method(); | ||
104 | #else | ||
81 | meth = EC_GFp_nist_method(); | 105 | meth = EC_GFp_nist_method(); |
106 | #endif | ||
82 | 107 | ||
83 | ret = EC_GROUP_new(meth); | 108 | ret = EC_GROUP_new(meth); |
84 | if (ret == NULL) | 109 | if (ret == NULL) |
@@ -122,7 +147,7 @@ EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
122 | return ret; | 147 | return ret; |
123 | } | 148 | } |
124 | 149 | ||
125 | 150 | #ifndef OPENSSL_NO_EC2M | |
126 | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | 151 | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
127 | { | 152 | { |
128 | const EC_METHOD *meth; | 153 | const EC_METHOD *meth; |
@@ -142,3 +167,4 @@ EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM | |||
142 | 167 | ||
143 | return ret; | 168 | return ret; |
144 | } | 169 | } |
170 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/ec/ec_err.c b/src/lib/libssl/src/crypto/ec/ec_err.c index 84b4833371..0d19398731 100644 --- a/src/lib/libssl/src/crypto/ec/ec_err.c +++ b/src/lib/libssl/src/crypto/ec/ec_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/ec/ec_err.c */ | 1 | /* crypto/ec/ec_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -70,6 +70,7 @@ | |||
70 | 70 | ||
71 | static ERR_STRING_DATA EC_str_functs[]= | 71 | static ERR_STRING_DATA EC_str_functs[]= |
72 | { | 72 | { |
73 | {ERR_FUNC(EC_F_BN_TO_FELEM), "BN_TO_FELEM"}, | ||
73 | {ERR_FUNC(EC_F_COMPUTE_WNAF), "COMPUTE_WNAF"}, | 74 | {ERR_FUNC(EC_F_COMPUTE_WNAF), "COMPUTE_WNAF"}, |
74 | {ERR_FUNC(EC_F_D2I_ECPARAMETERS), "d2i_ECParameters"}, | 75 | {ERR_FUNC(EC_F_D2I_ECPARAMETERS), "d2i_ECParameters"}, |
75 | {ERR_FUNC(EC_F_D2I_ECPKPARAMETERS), "d2i_ECPKParameters"}, | 76 | {ERR_FUNC(EC_F_D2I_ECPKPARAMETERS), "d2i_ECPKParameters"}, |
@@ -112,6 +113,15 @@ static ERR_STRING_DATA EC_str_functs[]= | |||
112 | {ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_SQR), "ec_GFp_mont_field_sqr"}, | 113 | {ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_SQR), "ec_GFp_mont_field_sqr"}, |
113 | {ERR_FUNC(EC_F_EC_GFP_MONT_GROUP_SET_CURVE), "ec_GFp_mont_group_set_curve"}, | 114 | {ERR_FUNC(EC_F_EC_GFP_MONT_GROUP_SET_CURVE), "ec_GFp_mont_group_set_curve"}, |
114 | {ERR_FUNC(EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP), "EC_GFP_MONT_GROUP_SET_CURVE_GFP"}, | 115 | {ERR_FUNC(EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP), "EC_GFP_MONT_GROUP_SET_CURVE_GFP"}, |
116 | {ERR_FUNC(EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE), "ec_GFp_nistp224_group_set_curve"}, | ||
117 | {ERR_FUNC(EC_F_EC_GFP_NISTP224_POINTS_MUL), "ec_GFp_nistp224_points_mul"}, | ||
118 | {ERR_FUNC(EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES), "ec_GFp_nistp224_point_get_affine_coordinates"}, | ||
119 | {ERR_FUNC(EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE), "ec_GFp_nistp256_group_set_curve"}, | ||
120 | {ERR_FUNC(EC_F_EC_GFP_NISTP256_POINTS_MUL), "ec_GFp_nistp256_points_mul"}, | ||
121 | {ERR_FUNC(EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES), "ec_GFp_nistp256_point_get_affine_coordinates"}, | ||
122 | {ERR_FUNC(EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE), "ec_GFp_nistp521_group_set_curve"}, | ||
123 | {ERR_FUNC(EC_F_EC_GFP_NISTP521_POINTS_MUL), "ec_GFp_nistp521_points_mul"}, | ||
124 | {ERR_FUNC(EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES), "ec_GFp_nistp521_point_get_affine_coordinates"}, | ||
115 | {ERR_FUNC(EC_F_EC_GFP_NIST_FIELD_MUL), "ec_GFp_nist_field_mul"}, | 125 | {ERR_FUNC(EC_F_EC_GFP_NIST_FIELD_MUL), "ec_GFp_nist_field_mul"}, |
116 | {ERR_FUNC(EC_F_EC_GFP_NIST_FIELD_SQR), "ec_GFp_nist_field_sqr"}, | 126 | {ERR_FUNC(EC_F_EC_GFP_NIST_FIELD_SQR), "ec_GFp_nist_field_sqr"}, |
117 | {ERR_FUNC(EC_F_EC_GFP_NIST_GROUP_SET_CURVE), "ec_GFp_nist_group_set_curve"}, | 127 | {ERR_FUNC(EC_F_EC_GFP_NIST_GROUP_SET_CURVE), "ec_GFp_nist_group_set_curve"}, |
@@ -154,6 +164,7 @@ static ERR_STRING_DATA EC_str_functs[]= | |||
154 | {ERR_FUNC(EC_F_EC_KEY_NEW), "EC_KEY_new"}, | 164 | {ERR_FUNC(EC_F_EC_KEY_NEW), "EC_KEY_new"}, |
155 | {ERR_FUNC(EC_F_EC_KEY_PRINT), "EC_KEY_print"}, | 165 | {ERR_FUNC(EC_F_EC_KEY_PRINT), "EC_KEY_print"}, |
156 | {ERR_FUNC(EC_F_EC_KEY_PRINT_FP), "EC_KEY_print_fp"}, | 166 | {ERR_FUNC(EC_F_EC_KEY_PRINT_FP), "EC_KEY_print_fp"}, |
167 | {ERR_FUNC(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES), "EC_KEY_set_public_key_affine_coordinates"}, | ||
157 | {ERR_FUNC(EC_F_EC_POINTS_MAKE_AFFINE), "EC_POINTs_make_affine"}, | 168 | {ERR_FUNC(EC_F_EC_POINTS_MAKE_AFFINE), "EC_POINTs_make_affine"}, |
158 | {ERR_FUNC(EC_F_EC_POINT_ADD), "EC_POINT_add"}, | 169 | {ERR_FUNC(EC_F_EC_POINT_ADD), "EC_POINT_add"}, |
159 | {ERR_FUNC(EC_F_EC_POINT_CMP), "EC_POINT_cmp"}, | 170 | {ERR_FUNC(EC_F_EC_POINT_CMP), "EC_POINT_cmp"}, |
@@ -184,6 +195,9 @@ static ERR_STRING_DATA EC_str_functs[]= | |||
184 | {ERR_FUNC(EC_F_I2D_ECPKPARAMETERS), "i2d_ECPKParameters"}, | 195 | {ERR_FUNC(EC_F_I2D_ECPKPARAMETERS), "i2d_ECPKParameters"}, |
185 | {ERR_FUNC(EC_F_I2D_ECPRIVATEKEY), "i2d_ECPrivateKey"}, | 196 | {ERR_FUNC(EC_F_I2D_ECPRIVATEKEY), "i2d_ECPrivateKey"}, |
186 | {ERR_FUNC(EC_F_I2O_ECPUBLICKEY), "i2o_ECPublicKey"}, | 197 | {ERR_FUNC(EC_F_I2O_ECPUBLICKEY), "i2o_ECPublicKey"}, |
198 | {ERR_FUNC(EC_F_NISTP224_PRE_COMP_NEW), "NISTP224_PRE_COMP_NEW"}, | ||
199 | {ERR_FUNC(EC_F_NISTP256_PRE_COMP_NEW), "NISTP256_PRE_COMP_NEW"}, | ||
200 | {ERR_FUNC(EC_F_NISTP521_PRE_COMP_NEW), "NISTP521_PRE_COMP_NEW"}, | ||
187 | {ERR_FUNC(EC_F_O2I_ECPUBLICKEY), "o2i_ECPublicKey"}, | 201 | {ERR_FUNC(EC_F_O2I_ECPUBLICKEY), "o2i_ECPublicKey"}, |
188 | {ERR_FUNC(EC_F_OLD_EC_PRIV_DECODE), "OLD_EC_PRIV_DECODE"}, | 202 | {ERR_FUNC(EC_F_OLD_EC_PRIV_DECODE), "OLD_EC_PRIV_DECODE"}, |
189 | {ERR_FUNC(EC_F_PKEY_EC_CTRL), "PKEY_EC_CTRL"}, | 203 | {ERR_FUNC(EC_F_PKEY_EC_CTRL), "PKEY_EC_CTRL"}, |
@@ -199,12 +213,15 @@ static ERR_STRING_DATA EC_str_reasons[]= | |||
199 | { | 213 | { |
200 | {ERR_REASON(EC_R_ASN1_ERROR) ,"asn1 error"}, | 214 | {ERR_REASON(EC_R_ASN1_ERROR) ,"asn1 error"}, |
201 | {ERR_REASON(EC_R_ASN1_UNKNOWN_FIELD) ,"asn1 unknown field"}, | 215 | {ERR_REASON(EC_R_ASN1_UNKNOWN_FIELD) ,"asn1 unknown field"}, |
216 | {ERR_REASON(EC_R_BIGNUM_OUT_OF_RANGE) ,"bignum out of range"}, | ||
202 | {ERR_REASON(EC_R_BUFFER_TOO_SMALL) ,"buffer too small"}, | 217 | {ERR_REASON(EC_R_BUFFER_TOO_SMALL) ,"buffer too small"}, |
218 | {ERR_REASON(EC_R_COORDINATES_OUT_OF_RANGE),"coordinates out of range"}, | ||
203 | {ERR_REASON(EC_R_D2I_ECPKPARAMETERS_FAILURE),"d2i ecpkparameters failure"}, | 219 | {ERR_REASON(EC_R_D2I_ECPKPARAMETERS_FAILURE),"d2i ecpkparameters failure"}, |
204 | {ERR_REASON(EC_R_DECODE_ERROR) ,"decode error"}, | 220 | {ERR_REASON(EC_R_DECODE_ERROR) ,"decode error"}, |
205 | {ERR_REASON(EC_R_DISCRIMINANT_IS_ZERO) ,"discriminant is zero"}, | 221 | {ERR_REASON(EC_R_DISCRIMINANT_IS_ZERO) ,"discriminant is zero"}, |
206 | {ERR_REASON(EC_R_EC_GROUP_NEW_BY_NAME_FAILURE),"ec group new by name failure"}, | 222 | {ERR_REASON(EC_R_EC_GROUP_NEW_BY_NAME_FAILURE),"ec group new by name failure"}, |
207 | {ERR_REASON(EC_R_FIELD_TOO_LARGE) ,"field too large"}, | 223 | {ERR_REASON(EC_R_FIELD_TOO_LARGE) ,"field too large"}, |
224 | {ERR_REASON(EC_R_GF2M_NOT_SUPPORTED) ,"gf2m not supported"}, | ||
208 | {ERR_REASON(EC_R_GROUP2PKPARAMETERS_FAILURE),"group2pkparameters failure"}, | 225 | {ERR_REASON(EC_R_GROUP2PKPARAMETERS_FAILURE),"group2pkparameters failure"}, |
209 | {ERR_REASON(EC_R_I2D_ECPKPARAMETERS_FAILURE),"i2d ecpkparameters failure"}, | 226 | {ERR_REASON(EC_R_I2D_ECPKPARAMETERS_FAILURE),"i2d ecpkparameters failure"}, |
210 | {ERR_REASON(EC_R_INCOMPATIBLE_OBJECTS) ,"incompatible objects"}, | 227 | {ERR_REASON(EC_R_INCOMPATIBLE_OBJECTS) ,"incompatible objects"}, |
@@ -239,6 +256,7 @@ static ERR_STRING_DATA EC_str_reasons[]= | |||
239 | {ERR_REASON(EC_R_UNKNOWN_GROUP) ,"unknown group"}, | 256 | {ERR_REASON(EC_R_UNKNOWN_GROUP) ,"unknown group"}, |
240 | {ERR_REASON(EC_R_UNKNOWN_ORDER) ,"unknown order"}, | 257 | {ERR_REASON(EC_R_UNKNOWN_ORDER) ,"unknown order"}, |
241 | {ERR_REASON(EC_R_UNSUPPORTED_FIELD) ,"unsupported field"}, | 258 | {ERR_REASON(EC_R_UNSUPPORTED_FIELD) ,"unsupported field"}, |
259 | {ERR_REASON(EC_R_WRONG_CURVE_PARAMETERS) ,"wrong curve parameters"}, | ||
242 | {ERR_REASON(EC_R_WRONG_ORDER) ,"wrong order"}, | 260 | {ERR_REASON(EC_R_WRONG_ORDER) ,"wrong order"}, |
243 | {0,NULL} | 261 | {0,NULL} |
244 | }; | 262 | }; |
diff --git a/src/lib/libssl/src/crypto/ec/ec_lcl.h b/src/lib/libssl/src/crypto/ec/ec_lcl.h index 3e2c34b0bc..da7967df38 100644 --- a/src/lib/libssl/src/crypto/ec/ec_lcl.h +++ b/src/lib/libssl/src/crypto/ec/ec_lcl.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
5 | /* ==================================================================== | 5 | /* ==================================================================== |
6 | * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. | 6 | * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved. |
7 | * | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions |
@@ -82,10 +82,15 @@ | |||
82 | # endif | 82 | # endif |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | /* Use default functions for poin2oct, oct2point and compressed coordinates */ | ||
86 | #define EC_FLAGS_DEFAULT_OCT 0x1 | ||
87 | |||
85 | /* Structure details are not part of the exported interface, | 88 | /* Structure details are not part of the exported interface, |
86 | * so all this may change in future versions. */ | 89 | * so all this may change in future versions. */ |
87 | 90 | ||
88 | struct ec_method_st { | 91 | struct ec_method_st { |
92 | /* Various method flags */ | ||
93 | int flags; | ||
89 | /* used by EC_METHOD_get_field_type: */ | 94 | /* used by EC_METHOD_get_field_type: */ |
90 | int field_type; /* a NID */ | 95 | int field_type; /* a NID */ |
91 | 96 | ||
@@ -244,6 +249,7 @@ struct ec_key_st { | |||
244 | point_conversion_form_t conv_form; | 249 | point_conversion_form_t conv_form; |
245 | 250 | ||
246 | int references; | 251 | int references; |
252 | int flags; | ||
247 | 253 | ||
248 | EC_EXTRA_DATA *method_data; | 254 | EC_EXTRA_DATA *method_data; |
249 | } /* EC_KEY */; | 255 | } /* EC_KEY */; |
@@ -391,3 +397,50 @@ int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | |||
391 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | 397 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); |
392 | int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | 398 | int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); |
393 | int ec_GF2m_have_precompute_mult(const EC_GROUP *group); | 399 | int ec_GF2m_have_precompute_mult(const EC_GROUP *group); |
400 | |||
401 | /* method functions in ec2_mult.c */ | ||
402 | int ec_GF2m_simple_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, | ||
403 | size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
404 | int ec_GF2m_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
405 | int ec_GF2m_have_precompute_mult(const EC_GROUP *group); | ||
406 | |||
407 | #ifndef OPENSSL_EC_NISTP_64_GCC_128 | ||
408 | /* method functions in ecp_nistp224.c */ | ||
409 | int ec_GFp_nistp224_group_init(EC_GROUP *group); | ||
410 | int ec_GFp_nistp224_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); | ||
411 | int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | ||
412 | int ec_GFp_nistp224_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
413 | int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); | ||
414 | int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
415 | int ec_GFp_nistp224_have_precompute_mult(const EC_GROUP *group); | ||
416 | |||
417 | /* method functions in ecp_nistp256.c */ | ||
418 | int ec_GFp_nistp256_group_init(EC_GROUP *group); | ||
419 | int ec_GFp_nistp256_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); | ||
420 | int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | ||
421 | int ec_GFp_nistp256_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
422 | int ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); | ||
423 | int ec_GFp_nistp256_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
424 | int ec_GFp_nistp256_have_precompute_mult(const EC_GROUP *group); | ||
425 | |||
426 | /* method functions in ecp_nistp521.c */ | ||
427 | int ec_GFp_nistp521_group_init(EC_GROUP *group); | ||
428 | int ec_GFp_nistp521_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *n, BN_CTX *); | ||
429 | int ec_GFp_nistp521_point_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); | ||
430 | int ec_GFp_nistp521_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *); | ||
431 | int ec_GFp_nistp521_points_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, size_t num, const EC_POINT *points[], const BIGNUM *scalars[], BN_CTX *ctx); | ||
432 | int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx); | ||
433 | int ec_GFp_nistp521_have_precompute_mult(const EC_GROUP *group); | ||
434 | |||
435 | /* utility functions in ecp_nistputil.c */ | ||
436 | void ec_GFp_nistp_points_make_affine_internal(size_t num, void *point_array, | ||
437 | size_t felem_size, void *tmp_felems, | ||
438 | void (*felem_one)(void *out), | ||
439 | int (*felem_is_zero)(const void *in), | ||
440 | void (*felem_assign)(void *out, const void *in), | ||
441 | void (*felem_square)(void *out, const void *in), | ||
442 | void (*felem_mul)(void *out, const void *in1, const void *in2), | ||
443 | void (*felem_inv)(void *out, const void *in), | ||
444 | void (*felem_contract)(void *out, const void *in)); | ||
445 | void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign, unsigned char *digit, unsigned char in); | ||
446 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/ec/ec_lib.c b/src/lib/libssl/src/crypto/ec/ec_lib.c index dd7da0fcf9..25247b5803 100644 --- a/src/lib/libssl/src/crypto/ec/ec_lib.c +++ b/src/lib/libssl/src/crypto/ec/ec_lib.c | |||
@@ -425,7 +425,7 @@ int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM * | |||
425 | return group->meth->group_get_curve(group, p, a, b, ctx); | 425 | return group->meth->group_get_curve(group, p, a, b, ctx); |
426 | } | 426 | } |
427 | 427 | ||
428 | 428 | #ifndef OPENSSL_NO_EC2M | |
429 | int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | 429 | int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) |
430 | { | 430 | { |
431 | if (group->meth->group_set_curve == 0) | 431 | if (group->meth->group_set_curve == 0) |
@@ -446,7 +446,7 @@ int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM | |||
446 | } | 446 | } |
447 | return group->meth->group_get_curve(group, p, a, b, ctx); | 447 | return group->meth->group_get_curve(group, p, a, b, ctx); |
448 | } | 448 | } |
449 | 449 | #endif | |
450 | 450 | ||
451 | int EC_GROUP_get_degree(const EC_GROUP *group) | 451 | int EC_GROUP_get_degree(const EC_GROUP *group) |
452 | { | 452 | { |
@@ -856,7 +856,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, | |||
856 | return group->meth->point_set_affine_coordinates(group, point, x, y, ctx); | 856 | return group->meth->point_set_affine_coordinates(group, point, x, y, ctx); |
857 | } | 857 | } |
858 | 858 | ||
859 | 859 | #ifndef OPENSSL_NO_EC2M | |
860 | int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point, | 860 | int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point, |
861 | const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) | 861 | const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) |
862 | { | 862 | { |
@@ -872,7 +872,7 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point, | |||
872 | } | 872 | } |
873 | return group->meth->point_set_affine_coordinates(group, point, x, y, ctx); | 873 | return group->meth->point_set_affine_coordinates(group, point, x, y, ctx); |
874 | } | 874 | } |
875 | 875 | #endif | |
876 | 876 | ||
877 | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point, | 877 | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point, |
878 | BIGNUM *x, BIGNUM *y, BN_CTX *ctx) | 878 | BIGNUM *x, BIGNUM *y, BN_CTX *ctx) |
@@ -890,7 +890,7 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p | |||
890 | return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); | 890 | return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); |
891 | } | 891 | } |
892 | 892 | ||
893 | 893 | #ifndef OPENSSL_NO_EC2M | |
894 | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *point, | 894 | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT *point, |
895 | BIGNUM *x, BIGNUM *y, BN_CTX *ctx) | 895 | BIGNUM *x, BIGNUM *y, BN_CTX *ctx) |
896 | { | 896 | { |
@@ -906,75 +906,7 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, const EC_POINT * | |||
906 | } | 906 | } |
907 | return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); | 907 | return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); |
908 | } | 908 | } |
909 | 909 | #endif | |
910 | |||
911 | int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, | ||
912 | const BIGNUM *x, int y_bit, BN_CTX *ctx) | ||
913 | { | ||
914 | if (group->meth->point_set_compressed_coordinates == 0) | ||
915 | { | ||
916 | ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
917 | return 0; | ||
918 | } | ||
919 | if (group->meth != point->meth) | ||
920 | { | ||
921 | ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP, EC_R_INCOMPATIBLE_OBJECTS); | ||
922 | return 0; | ||
923 | } | ||
924 | return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx); | ||
925 | } | ||
926 | |||
927 | |||
928 | int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *point, | ||
929 | const BIGNUM *x, int y_bit, BN_CTX *ctx) | ||
930 | { | ||
931 | if (group->meth->point_set_compressed_coordinates == 0) | ||
932 | { | ||
933 | ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
934 | return 0; | ||
935 | } | ||
936 | if (group->meth != point->meth) | ||
937 | { | ||
938 | ECerr(EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M, EC_R_INCOMPATIBLE_OBJECTS); | ||
939 | return 0; | ||
940 | } | ||
941 | return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx); | ||
942 | } | ||
943 | |||
944 | |||
945 | size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, | ||
946 | unsigned char *buf, size_t len, BN_CTX *ctx) | ||
947 | { | ||
948 | if (group->meth->point2oct == 0) | ||
949 | { | ||
950 | ECerr(EC_F_EC_POINT_POINT2OCT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
951 | return 0; | ||
952 | } | ||
953 | if (group->meth != point->meth) | ||
954 | { | ||
955 | ECerr(EC_F_EC_POINT_POINT2OCT, EC_R_INCOMPATIBLE_OBJECTS); | ||
956 | return 0; | ||
957 | } | ||
958 | return group->meth->point2oct(group, point, form, buf, len, ctx); | ||
959 | } | ||
960 | |||
961 | |||
962 | int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, | ||
963 | const unsigned char *buf, size_t len, BN_CTX *ctx) | ||
964 | { | ||
965 | if (group->meth->oct2point == 0) | ||
966 | { | ||
967 | ECerr(EC_F_EC_POINT_OCT2POINT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
968 | return 0; | ||
969 | } | ||
970 | if (group->meth != point->meth) | ||
971 | { | ||
972 | ECerr(EC_F_EC_POINT_OCT2POINT, EC_R_INCOMPATIBLE_OBJECTS); | ||
973 | return 0; | ||
974 | } | ||
975 | return group->meth->oct2point(group, point, buf, len, ctx); | ||
976 | } | ||
977 | |||
978 | 910 | ||
979 | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) | 911 | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) |
980 | { | 912 | { |
diff --git a/src/lib/libssl/src/crypto/ec/ecp_mont.c b/src/lib/libssl/src/crypto/ec/ecp_mont.c index 9fc4a466a5..079e47431b 100644 --- a/src/lib/libssl/src/crypto/ec/ecp_mont.c +++ b/src/lib/libssl/src/crypto/ec/ecp_mont.c | |||
@@ -63,12 +63,20 @@ | |||
63 | 63 | ||
64 | #include <openssl/err.h> | 64 | #include <openssl/err.h> |
65 | 65 | ||
66 | #ifdef OPENSSL_FIPS | ||
67 | #include <openssl/fips.h> | ||
68 | #endif | ||
69 | |||
66 | #include "ec_lcl.h" | 70 | #include "ec_lcl.h" |
67 | 71 | ||
68 | 72 | ||
69 | const EC_METHOD *EC_GFp_mont_method(void) | 73 | const EC_METHOD *EC_GFp_mont_method(void) |
70 | { | 74 | { |
75 | #ifdef OPENSSL_FIPS | ||
76 | return fips_ec_gfp_mont_method(); | ||
77 | #else | ||
71 | static const EC_METHOD ret = { | 78 | static const EC_METHOD ret = { |
79 | EC_FLAGS_DEFAULT_OCT, | ||
72 | NID_X9_62_prime_field, | 80 | NID_X9_62_prime_field, |
73 | ec_GFp_mont_group_init, | 81 | ec_GFp_mont_group_init, |
74 | ec_GFp_mont_group_finish, | 82 | ec_GFp_mont_group_finish, |
@@ -87,9 +95,7 @@ const EC_METHOD *EC_GFp_mont_method(void) | |||
87 | ec_GFp_simple_get_Jprojective_coordinates_GFp, | 95 | ec_GFp_simple_get_Jprojective_coordinates_GFp, |
88 | ec_GFp_simple_point_set_affine_coordinates, | 96 | ec_GFp_simple_point_set_affine_coordinates, |
89 | ec_GFp_simple_point_get_affine_coordinates, | 97 | ec_GFp_simple_point_get_affine_coordinates, |
90 | ec_GFp_simple_set_compressed_coordinates, | 98 | 0,0,0, |
91 | ec_GFp_simple_point2oct, | ||
92 | ec_GFp_simple_oct2point, | ||
93 | ec_GFp_simple_add, | 99 | ec_GFp_simple_add, |
94 | ec_GFp_simple_dbl, | 100 | ec_GFp_simple_dbl, |
95 | ec_GFp_simple_invert, | 101 | ec_GFp_simple_invert, |
@@ -108,7 +114,9 @@ const EC_METHOD *EC_GFp_mont_method(void) | |||
108 | ec_GFp_mont_field_decode, | 114 | ec_GFp_mont_field_decode, |
109 | ec_GFp_mont_field_set_to_one }; | 115 | ec_GFp_mont_field_set_to_one }; |
110 | 116 | ||
117 | |||
111 | return &ret; | 118 | return &ret; |
119 | #endif | ||
112 | } | 120 | } |
113 | 121 | ||
114 | 122 | ||
diff --git a/src/lib/libssl/src/crypto/ec/ecp_nist.c b/src/lib/libssl/src/crypto/ec/ecp_nist.c index 2a5682ea41..aad2d5f443 100644 --- a/src/lib/libssl/src/crypto/ec/ecp_nist.c +++ b/src/lib/libssl/src/crypto/ec/ecp_nist.c | |||
@@ -67,9 +67,17 @@ | |||
67 | #include <openssl/obj_mac.h> | 67 | #include <openssl/obj_mac.h> |
68 | #include "ec_lcl.h" | 68 | #include "ec_lcl.h" |
69 | 69 | ||
70 | #ifdef OPENSSL_FIPS | ||
71 | #include <openssl/fips.h> | ||
72 | #endif | ||
73 | |||
70 | const EC_METHOD *EC_GFp_nist_method(void) | 74 | const EC_METHOD *EC_GFp_nist_method(void) |
71 | { | 75 | { |
76 | #ifdef OPENSSL_FIPS | ||
77 | return fips_ec_gfp_nist_method(); | ||
78 | #else | ||
72 | static const EC_METHOD ret = { | 79 | static const EC_METHOD ret = { |
80 | EC_FLAGS_DEFAULT_OCT, | ||
73 | NID_X9_62_prime_field, | 81 | NID_X9_62_prime_field, |
74 | ec_GFp_simple_group_init, | 82 | ec_GFp_simple_group_init, |
75 | ec_GFp_simple_group_finish, | 83 | ec_GFp_simple_group_finish, |
@@ -88,9 +96,7 @@ const EC_METHOD *EC_GFp_nist_method(void) | |||
88 | ec_GFp_simple_get_Jprojective_coordinates_GFp, | 96 | ec_GFp_simple_get_Jprojective_coordinates_GFp, |
89 | ec_GFp_simple_point_set_affine_coordinates, | 97 | ec_GFp_simple_point_set_affine_coordinates, |
90 | ec_GFp_simple_point_get_affine_coordinates, | 98 | ec_GFp_simple_point_get_affine_coordinates, |
91 | ec_GFp_simple_set_compressed_coordinates, | 99 | 0,0,0, |
92 | ec_GFp_simple_point2oct, | ||
93 | ec_GFp_simple_oct2point, | ||
94 | ec_GFp_simple_add, | 100 | ec_GFp_simple_add, |
95 | ec_GFp_simple_dbl, | 101 | ec_GFp_simple_dbl, |
96 | ec_GFp_simple_invert, | 102 | ec_GFp_simple_invert, |
@@ -110,6 +116,7 @@ const EC_METHOD *EC_GFp_nist_method(void) | |||
110 | 0 /* field_set_to_one */ }; | 116 | 0 /* field_set_to_one */ }; |
111 | 117 | ||
112 | return &ret; | 118 | return &ret; |
119 | #endif | ||
113 | } | 120 | } |
114 | 121 | ||
115 | int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src) | 122 | int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src) |
diff --git a/src/lib/libssl/src/crypto/ec/ecp_smpl.c b/src/lib/libssl/src/crypto/ec/ecp_smpl.c index 66a92e2a90..7cbb321f9a 100644 --- a/src/lib/libssl/src/crypto/ec/ecp_smpl.c +++ b/src/lib/libssl/src/crypto/ec/ecp_smpl.c | |||
@@ -65,11 +65,19 @@ | |||
65 | #include <openssl/err.h> | 65 | #include <openssl/err.h> |
66 | #include <openssl/symhacks.h> | 66 | #include <openssl/symhacks.h> |
67 | 67 | ||
68 | #ifdef OPENSSL_FIPS | ||
69 | #include <openssl/fips.h> | ||
70 | #endif | ||
71 | |||
68 | #include "ec_lcl.h" | 72 | #include "ec_lcl.h" |
69 | 73 | ||
70 | const EC_METHOD *EC_GFp_simple_method(void) | 74 | const EC_METHOD *EC_GFp_simple_method(void) |
71 | { | 75 | { |
76 | #ifdef OPENSSL_FIPS | ||
77 | return fips_ec_gfp_simple_method(); | ||
78 | #else | ||
72 | static const EC_METHOD ret = { | 79 | static const EC_METHOD ret = { |
80 | EC_FLAGS_DEFAULT_OCT, | ||
73 | NID_X9_62_prime_field, | 81 | NID_X9_62_prime_field, |
74 | ec_GFp_simple_group_init, | 82 | ec_GFp_simple_group_init, |
75 | ec_GFp_simple_group_finish, | 83 | ec_GFp_simple_group_finish, |
@@ -88,9 +96,7 @@ const EC_METHOD *EC_GFp_simple_method(void) | |||
88 | ec_GFp_simple_get_Jprojective_coordinates_GFp, | 96 | ec_GFp_simple_get_Jprojective_coordinates_GFp, |
89 | ec_GFp_simple_point_set_affine_coordinates, | 97 | ec_GFp_simple_point_set_affine_coordinates, |
90 | ec_GFp_simple_point_get_affine_coordinates, | 98 | ec_GFp_simple_point_get_affine_coordinates, |
91 | ec_GFp_simple_set_compressed_coordinates, | 99 | 0,0,0, |
92 | ec_GFp_simple_point2oct, | ||
93 | ec_GFp_simple_oct2point, | ||
94 | ec_GFp_simple_add, | 100 | ec_GFp_simple_add, |
95 | ec_GFp_simple_dbl, | 101 | ec_GFp_simple_dbl, |
96 | ec_GFp_simple_invert, | 102 | ec_GFp_simple_invert, |
@@ -110,6 +116,7 @@ const EC_METHOD *EC_GFp_simple_method(void) | |||
110 | 0 /* field_set_to_one */ }; | 116 | 0 /* field_set_to_one */ }; |
111 | 117 | ||
112 | return &ret; | 118 | return &ret; |
119 | #endif | ||
113 | } | 120 | } |
114 | 121 | ||
115 | 122 | ||
@@ -633,372 +640,6 @@ int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group, const EC_P | |||
633 | return ret; | 640 | return ret; |
634 | } | 641 | } |
635 | 642 | ||
636 | |||
637 | int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point, | ||
638 | const BIGNUM *x_, int y_bit, BN_CTX *ctx) | ||
639 | { | ||
640 | BN_CTX *new_ctx = NULL; | ||
641 | BIGNUM *tmp1, *tmp2, *x, *y; | ||
642 | int ret = 0; | ||
643 | |||
644 | /* clear error queue*/ | ||
645 | ERR_clear_error(); | ||
646 | |||
647 | if (ctx == NULL) | ||
648 | { | ||
649 | ctx = new_ctx = BN_CTX_new(); | ||
650 | if (ctx == NULL) | ||
651 | return 0; | ||
652 | } | ||
653 | |||
654 | y_bit = (y_bit != 0); | ||
655 | |||
656 | BN_CTX_start(ctx); | ||
657 | tmp1 = BN_CTX_get(ctx); | ||
658 | tmp2 = BN_CTX_get(ctx); | ||
659 | x = BN_CTX_get(ctx); | ||
660 | y = BN_CTX_get(ctx); | ||
661 | if (y == NULL) goto err; | ||
662 | |||
663 | /* Recover y. We have a Weierstrass equation | ||
664 | * y^2 = x^3 + a*x + b, | ||
665 | * so y is one of the square roots of x^3 + a*x + b. | ||
666 | */ | ||
667 | |||
668 | /* tmp1 := x^3 */ | ||
669 | if (!BN_nnmod(x, x_, &group->field,ctx)) goto err; | ||
670 | if (group->meth->field_decode == 0) | ||
671 | { | ||
672 | /* field_{sqr,mul} work on standard representation */ | ||
673 | if (!group->meth->field_sqr(group, tmp2, x_, ctx)) goto err; | ||
674 | if (!group->meth->field_mul(group, tmp1, tmp2, x_, ctx)) goto err; | ||
675 | } | ||
676 | else | ||
677 | { | ||
678 | if (!BN_mod_sqr(tmp2, x_, &group->field, ctx)) goto err; | ||
679 | if (!BN_mod_mul(tmp1, tmp2, x_, &group->field, ctx)) goto err; | ||
680 | } | ||
681 | |||
682 | /* tmp1 := tmp1 + a*x */ | ||
683 | if (group->a_is_minus3) | ||
684 | { | ||
685 | if (!BN_mod_lshift1_quick(tmp2, x, &group->field)) goto err; | ||
686 | if (!BN_mod_add_quick(tmp2, tmp2, x, &group->field)) goto err; | ||
687 | if (!BN_mod_sub_quick(tmp1, tmp1, tmp2, &group->field)) goto err; | ||
688 | } | ||
689 | else | ||
690 | { | ||
691 | if (group->meth->field_decode) | ||
692 | { | ||
693 | if (!group->meth->field_decode(group, tmp2, &group->a, ctx)) goto err; | ||
694 | if (!BN_mod_mul(tmp2, tmp2, x, &group->field, ctx)) goto err; | ||
695 | } | ||
696 | else | ||
697 | { | ||
698 | /* field_mul works on standard representation */ | ||
699 | if (!group->meth->field_mul(group, tmp2, &group->a, x, ctx)) goto err; | ||
700 | } | ||
701 | |||
702 | if (!BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) goto err; | ||
703 | } | ||
704 | |||
705 | /* tmp1 := tmp1 + b */ | ||
706 | if (group->meth->field_decode) | ||
707 | { | ||
708 | if (!group->meth->field_decode(group, tmp2, &group->b, ctx)) goto err; | ||
709 | if (!BN_mod_add_quick(tmp1, tmp1, tmp2, &group->field)) goto err; | ||
710 | } | ||
711 | else | ||
712 | { | ||
713 | if (!BN_mod_add_quick(tmp1, tmp1, &group->b, &group->field)) goto err; | ||
714 | } | ||
715 | |||
716 | if (!BN_mod_sqrt(y, tmp1, &group->field, ctx)) | ||
717 | { | ||
718 | unsigned long err = ERR_peek_last_error(); | ||
719 | |||
720 | if (ERR_GET_LIB(err) == ERR_LIB_BN && ERR_GET_REASON(err) == BN_R_NOT_A_SQUARE) | ||
721 | { | ||
722 | ERR_clear_error(); | ||
723 | ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSED_POINT); | ||
724 | } | ||
725 | else | ||
726 | ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, ERR_R_BN_LIB); | ||
727 | goto err; | ||
728 | } | ||
729 | |||
730 | if (y_bit != BN_is_odd(y)) | ||
731 | { | ||
732 | if (BN_is_zero(y)) | ||
733 | { | ||
734 | int kron; | ||
735 | |||
736 | kron = BN_kronecker(x, &group->field, ctx); | ||
737 | if (kron == -2) goto err; | ||
738 | |||
739 | if (kron == 1) | ||
740 | ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSION_BIT); | ||
741 | else | ||
742 | /* BN_mod_sqrt() should have cought this error (not a square) */ | ||
743 | ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSED_POINT); | ||
744 | goto err; | ||
745 | } | ||
746 | if (!BN_usub(y, &group->field, y)) goto err; | ||
747 | } | ||
748 | if (y_bit != BN_is_odd(y)) | ||
749 | { | ||
750 | ECerr(EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES, ERR_R_INTERNAL_ERROR); | ||
751 | goto err; | ||
752 | } | ||
753 | |||
754 | if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; | ||
755 | |||
756 | ret = 1; | ||
757 | |||
758 | err: | ||
759 | BN_CTX_end(ctx); | ||
760 | if (new_ctx != NULL) | ||
761 | BN_CTX_free(new_ctx); | ||
762 | return ret; | ||
763 | } | ||
764 | |||
765 | |||
766 | size_t ec_GFp_simple_point2oct(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, | ||
767 | unsigned char *buf, size_t len, BN_CTX *ctx) | ||
768 | { | ||
769 | size_t ret; | ||
770 | BN_CTX *new_ctx = NULL; | ||
771 | int used_ctx = 0; | ||
772 | BIGNUM *x, *y; | ||
773 | size_t field_len, i, skip; | ||
774 | |||
775 | if ((form != POINT_CONVERSION_COMPRESSED) | ||
776 | && (form != POINT_CONVERSION_UNCOMPRESSED) | ||
777 | && (form != POINT_CONVERSION_HYBRID)) | ||
778 | { | ||
779 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, EC_R_INVALID_FORM); | ||
780 | goto err; | ||
781 | } | ||
782 | |||
783 | if (EC_POINT_is_at_infinity(group, point)) | ||
784 | { | ||
785 | /* encodes to a single 0 octet */ | ||
786 | if (buf != NULL) | ||
787 | { | ||
788 | if (len < 1) | ||
789 | { | ||
790 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, EC_R_BUFFER_TOO_SMALL); | ||
791 | return 0; | ||
792 | } | ||
793 | buf[0] = 0; | ||
794 | } | ||
795 | return 1; | ||
796 | } | ||
797 | |||
798 | |||
799 | /* ret := required output buffer length */ | ||
800 | field_len = BN_num_bytes(&group->field); | ||
801 | ret = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2*field_len; | ||
802 | |||
803 | /* if 'buf' is NULL, just return required length */ | ||
804 | if (buf != NULL) | ||
805 | { | ||
806 | if (len < ret) | ||
807 | { | ||
808 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, EC_R_BUFFER_TOO_SMALL); | ||
809 | goto err; | ||
810 | } | ||
811 | |||
812 | if (ctx == NULL) | ||
813 | { | ||
814 | ctx = new_ctx = BN_CTX_new(); | ||
815 | if (ctx == NULL) | ||
816 | return 0; | ||
817 | } | ||
818 | |||
819 | BN_CTX_start(ctx); | ||
820 | used_ctx = 1; | ||
821 | x = BN_CTX_get(ctx); | ||
822 | y = BN_CTX_get(ctx); | ||
823 | if (y == NULL) goto err; | ||
824 | |||
825 | if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; | ||
826 | |||
827 | if ((form == POINT_CONVERSION_COMPRESSED || form == POINT_CONVERSION_HYBRID) && BN_is_odd(y)) | ||
828 | buf[0] = form + 1; | ||
829 | else | ||
830 | buf[0] = form; | ||
831 | |||
832 | i = 1; | ||
833 | |||
834 | skip = field_len - BN_num_bytes(x); | ||
835 | if (skip > field_len) | ||
836 | { | ||
837 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR); | ||
838 | goto err; | ||
839 | } | ||
840 | while (skip > 0) | ||
841 | { | ||
842 | buf[i++] = 0; | ||
843 | skip--; | ||
844 | } | ||
845 | skip = BN_bn2bin(x, buf + i); | ||
846 | i += skip; | ||
847 | if (i != 1 + field_len) | ||
848 | { | ||
849 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR); | ||
850 | goto err; | ||
851 | } | ||
852 | |||
853 | if (form == POINT_CONVERSION_UNCOMPRESSED || form == POINT_CONVERSION_HYBRID) | ||
854 | { | ||
855 | skip = field_len - BN_num_bytes(y); | ||
856 | if (skip > field_len) | ||
857 | { | ||
858 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR); | ||
859 | goto err; | ||
860 | } | ||
861 | while (skip > 0) | ||
862 | { | ||
863 | buf[i++] = 0; | ||
864 | skip--; | ||
865 | } | ||
866 | skip = BN_bn2bin(y, buf + i); | ||
867 | i += skip; | ||
868 | } | ||
869 | |||
870 | if (i != ret) | ||
871 | { | ||
872 | ECerr(EC_F_EC_GFP_SIMPLE_POINT2OCT, ERR_R_INTERNAL_ERROR); | ||
873 | goto err; | ||
874 | } | ||
875 | } | ||
876 | |||
877 | if (used_ctx) | ||
878 | BN_CTX_end(ctx); | ||
879 | if (new_ctx != NULL) | ||
880 | BN_CTX_free(new_ctx); | ||
881 | return ret; | ||
882 | |||
883 | err: | ||
884 | if (used_ctx) | ||
885 | BN_CTX_end(ctx); | ||
886 | if (new_ctx != NULL) | ||
887 | BN_CTX_free(new_ctx); | ||
888 | return 0; | ||
889 | } | ||
890 | |||
891 | |||
892 | int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, | ||
893 | const unsigned char *buf, size_t len, BN_CTX *ctx) | ||
894 | { | ||
895 | point_conversion_form_t form; | ||
896 | int y_bit; | ||
897 | BN_CTX *new_ctx = NULL; | ||
898 | BIGNUM *x, *y; | ||
899 | size_t field_len, enc_len; | ||
900 | int ret = 0; | ||
901 | |||
902 | if (len == 0) | ||
903 | { | ||
904 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_BUFFER_TOO_SMALL); | ||
905 | return 0; | ||
906 | } | ||
907 | form = buf[0]; | ||
908 | y_bit = form & 1; | ||
909 | form = form & ~1U; | ||
910 | if ((form != 0) && (form != POINT_CONVERSION_COMPRESSED) | ||
911 | && (form != POINT_CONVERSION_UNCOMPRESSED) | ||
912 | && (form != POINT_CONVERSION_HYBRID)) | ||
913 | { | ||
914 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
915 | return 0; | ||
916 | } | ||
917 | if ((form == 0 || form == POINT_CONVERSION_UNCOMPRESSED) && y_bit) | ||
918 | { | ||
919 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
920 | return 0; | ||
921 | } | ||
922 | |||
923 | if (form == 0) | ||
924 | { | ||
925 | if (len != 1) | ||
926 | { | ||
927 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
928 | return 0; | ||
929 | } | ||
930 | |||
931 | return EC_POINT_set_to_infinity(group, point); | ||
932 | } | ||
933 | |||
934 | field_len = BN_num_bytes(&group->field); | ||
935 | enc_len = (form == POINT_CONVERSION_COMPRESSED) ? 1 + field_len : 1 + 2*field_len; | ||
936 | |||
937 | if (len != enc_len) | ||
938 | { | ||
939 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
940 | return 0; | ||
941 | } | ||
942 | |||
943 | if (ctx == NULL) | ||
944 | { | ||
945 | ctx = new_ctx = BN_CTX_new(); | ||
946 | if (ctx == NULL) | ||
947 | return 0; | ||
948 | } | ||
949 | |||
950 | BN_CTX_start(ctx); | ||
951 | x = BN_CTX_get(ctx); | ||
952 | y = BN_CTX_get(ctx); | ||
953 | if (y == NULL) goto err; | ||
954 | |||
955 | if (!BN_bin2bn(buf + 1, field_len, x)) goto err; | ||
956 | if (BN_ucmp(x, &group->field) >= 0) | ||
957 | { | ||
958 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
959 | goto err; | ||
960 | } | ||
961 | |||
962 | if (form == POINT_CONVERSION_COMPRESSED) | ||
963 | { | ||
964 | if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) goto err; | ||
965 | } | ||
966 | else | ||
967 | { | ||
968 | if (!BN_bin2bn(buf + 1 + field_len, field_len, y)) goto err; | ||
969 | if (BN_ucmp(y, &group->field) >= 0) | ||
970 | { | ||
971 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
972 | goto err; | ||
973 | } | ||
974 | if (form == POINT_CONVERSION_HYBRID) | ||
975 | { | ||
976 | if (y_bit != BN_is_odd(y)) | ||
977 | { | ||
978 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_INVALID_ENCODING); | ||
979 | goto err; | ||
980 | } | ||
981 | } | ||
982 | |||
983 | if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) goto err; | ||
984 | } | ||
985 | |||
986 | if (!EC_POINT_is_on_curve(group, point, ctx)) /* test required by X9.62 */ | ||
987 | { | ||
988 | ECerr(EC_F_EC_GFP_SIMPLE_OCT2POINT, EC_R_POINT_IS_NOT_ON_CURVE); | ||
989 | goto err; | ||
990 | } | ||
991 | |||
992 | ret = 1; | ||
993 | |||
994 | err: | ||
995 | BN_CTX_end(ctx); | ||
996 | if (new_ctx != NULL) | ||
997 | BN_CTX_free(new_ctx); | ||
998 | return ret; | ||
999 | } | ||
1000 | |||
1001 | |||
1002 | int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) | 643 | int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx) |
1003 | { | 644 | { |
1004 | int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); | 645 | int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *); |
diff --git a/src/lib/libssl/src/crypto/ec/ectest.c b/src/lib/libssl/src/crypto/ec/ectest.c index 7509cb9c7c..f107782de0 100644 --- a/src/lib/libssl/src/crypto/ec/ectest.c +++ b/src/lib/libssl/src/crypto/ec/ectest.c | |||
@@ -94,6 +94,7 @@ int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); retur | |||
94 | #include <openssl/objects.h> | 94 | #include <openssl/objects.h> |
95 | #include <openssl/rand.h> | 95 | #include <openssl/rand.h> |
96 | #include <openssl/bn.h> | 96 | #include <openssl/bn.h> |
97 | #include <openssl/opensslconf.h> | ||
97 | 98 | ||
98 | #if defined(_MSC_VER) && defined(_MIPS_) && (_MSC_VER/100==12) | 99 | #if defined(_MSC_VER) && defined(_MIPS_) && (_MSC_VER/100==12) |
99 | /* suppress "too big too optimize" warning */ | 100 | /* suppress "too big too optimize" warning */ |
@@ -107,10 +108,6 @@ int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); retur | |||
107 | EXIT(1); \ | 108 | EXIT(1); \ |
108 | } while (0) | 109 | } while (0) |
109 | 110 | ||
110 | void prime_field_tests(void); | ||
111 | void char2_field_tests(void); | ||
112 | void internal_curve_test(void); | ||
113 | |||
114 | #define TIMING_BASE_PT 0 | 111 | #define TIMING_BASE_PT 0 |
115 | #define TIMING_RAND_PT 1 | 112 | #define TIMING_RAND_PT 1 |
116 | #define TIMING_SIMUL 2 | 113 | #define TIMING_SIMUL 2 |
@@ -195,7 +192,50 @@ static void timings(EC_GROUP *group, int type, BN_CTX *ctx) | |||
195 | } | 192 | } |
196 | #endif | 193 | #endif |
197 | 194 | ||
198 | void prime_field_tests() | 195 | /* test multiplication with group order, long and negative scalars */ |
196 | static void group_order_tests(EC_GROUP *group) | ||
197 | { | ||
198 | BIGNUM *n1, *n2, *order; | ||
199 | EC_POINT *P = EC_POINT_new(group); | ||
200 | EC_POINT *Q = EC_POINT_new(group); | ||
201 | BN_CTX *ctx = BN_CTX_new(); | ||
202 | |||
203 | n1 = BN_new(); n2 = BN_new(); order = BN_new(); | ||
204 | fprintf(stdout, "verify group order ..."); | ||
205 | fflush(stdout); | ||
206 | if (!EC_GROUP_get_order(group, order, ctx)) ABORT; | ||
207 | if (!EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) ABORT; | ||
208 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
209 | fprintf(stdout, "."); | ||
210 | fflush(stdout); | ||
211 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
212 | if (!EC_POINT_mul(group, Q, order, NULL, NULL, ctx)) ABORT; | ||
213 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
214 | fprintf(stdout, " ok\n"); | ||
215 | fprintf(stdout, "long/negative scalar tests ... "); | ||
216 | if (!BN_one(n1)) ABORT; | ||
217 | /* n1 = 1 - order */ | ||
218 | if (!BN_sub(n1, n1, order)) ABORT; | ||
219 | if(!EC_POINT_mul(group, Q, NULL, P, n1, ctx)) ABORT; | ||
220 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | ||
221 | /* n2 = 1 + order */ | ||
222 | if (!BN_add(n2, order, BN_value_one())) ABORT; | ||
223 | if(!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; | ||
224 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | ||
225 | /* n2 = (1 - order) * (1 + order) */ | ||
226 | if (!BN_mul(n2, n1, n2, ctx)) ABORT; | ||
227 | if(!EC_POINT_mul(group, Q, NULL, P, n2, ctx)) ABORT; | ||
228 | if (0 != EC_POINT_cmp(group, Q, P, ctx)) ABORT; | ||
229 | fprintf(stdout, "ok\n"); | ||
230 | EC_POINT_free(P); | ||
231 | EC_POINT_free(Q); | ||
232 | BN_free(n1); | ||
233 | BN_free(n2); | ||
234 | BN_free(order); | ||
235 | BN_CTX_free(ctx); | ||
236 | } | ||
237 | |||
238 | static void prime_field_tests(void) | ||
199 | { | 239 | { |
200 | BN_CTX *ctx = NULL; | 240 | BN_CTX *ctx = NULL; |
201 | BIGNUM *p, *a, *b; | 241 | BIGNUM *p, *a, *b; |
@@ -321,21 +361,21 @@ void prime_field_tests() | |||
321 | if (len == 0) ABORT; | 361 | if (len == 0) ABORT; |
322 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; | 362 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; |
323 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; | 363 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; |
324 | fprintf(stdout, "Generator as octect string, compressed form:\n "); | 364 | fprintf(stdout, "Generator as octet string, compressed form:\n "); |
325 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 365 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
326 | 366 | ||
327 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx); | 367 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_UNCOMPRESSED, buf, sizeof buf, ctx); |
328 | if (len == 0) ABORT; | 368 | if (len == 0) ABORT; |
329 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; | 369 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; |
330 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; | 370 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; |
331 | fprintf(stdout, "\nGenerator as octect string, uncompressed form:\n "); | 371 | fprintf(stdout, "\nGenerator as octet string, uncompressed form:\n "); |
332 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 372 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
333 | 373 | ||
334 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx); | 374 | len = EC_POINT_point2oct(group, Q, POINT_CONVERSION_HYBRID, buf, sizeof buf, ctx); |
335 | if (len == 0) ABORT; | 375 | if (len == 0) ABORT; |
336 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; | 376 | if (!EC_POINT_oct2point(group, P, buf, len, ctx)) ABORT; |
337 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; | 377 | if (0 != EC_POINT_cmp(group, P, Q, ctx)) ABORT; |
338 | fprintf(stdout, "\nGenerator as octect string, hybrid form:\n "); | 378 | fprintf(stdout, "\nGenerator as octet string, hybrid form:\n "); |
339 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); | 379 | for (i = 0; i < len; i++) fprintf(stdout, "%02X", buf[i]); |
340 | 380 | ||
341 | if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) ABORT; | 381 | if (!EC_POINT_get_Jprojective_coordinates_GFp(group, R, x, y, z, ctx)) ABORT; |
@@ -381,17 +421,7 @@ void prime_field_tests() | |||
381 | if (EC_GROUP_get_degree(group) != 160) ABORT; | 421 | if (EC_GROUP_get_degree(group) != 160) ABORT; |
382 | fprintf(stdout, " ok\n"); | 422 | fprintf(stdout, " ok\n"); |
383 | 423 | ||
384 | fprintf(stdout, "verify group order ..."); | 424 | group_order_tests(group); |
385 | fflush(stdout); | ||
386 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
387 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
388 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
389 | fprintf(stdout, "."); | ||
390 | fflush(stdout); | ||
391 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
392 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
393 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
394 | fprintf(stdout, " ok\n"); | ||
395 | 425 | ||
396 | if (!(P_160 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 426 | if (!(P_160 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
397 | if (!EC_GROUP_copy(P_160, group)) ABORT; | 427 | if (!EC_GROUP_copy(P_160, group)) ABORT; |
@@ -425,17 +455,7 @@ void prime_field_tests() | |||
425 | if (EC_GROUP_get_degree(group) != 192) ABORT; | 455 | if (EC_GROUP_get_degree(group) != 192) ABORT; |
426 | fprintf(stdout, " ok\n"); | 456 | fprintf(stdout, " ok\n"); |
427 | 457 | ||
428 | fprintf(stdout, "verify group order ..."); | 458 | group_order_tests(group); |
429 | fflush(stdout); | ||
430 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
431 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
432 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
433 | fprintf(stdout, "."); | ||
434 | fflush(stdout); | ||
435 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
436 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
437 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
438 | fprintf(stdout, " ok\n"); | ||
439 | 459 | ||
440 | if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 460 | if (!(P_192 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
441 | if (!EC_GROUP_copy(P_192, group)) ABORT; | 461 | if (!EC_GROUP_copy(P_192, group)) ABORT; |
@@ -469,17 +489,7 @@ void prime_field_tests() | |||
469 | if (EC_GROUP_get_degree(group) != 224) ABORT; | 489 | if (EC_GROUP_get_degree(group) != 224) ABORT; |
470 | fprintf(stdout, " ok\n"); | 490 | fprintf(stdout, " ok\n"); |
471 | 491 | ||
472 | fprintf(stdout, "verify group order ..."); | 492 | group_order_tests(group); |
473 | fflush(stdout); | ||
474 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
475 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
476 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
477 | fprintf(stdout, "."); | ||
478 | fflush(stdout); | ||
479 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
480 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
481 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
482 | fprintf(stdout, " ok\n"); | ||
483 | 493 | ||
484 | if (!(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 494 | if (!(P_224 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
485 | if (!EC_GROUP_copy(P_224, group)) ABORT; | 495 | if (!EC_GROUP_copy(P_224, group)) ABORT; |
@@ -514,17 +524,7 @@ void prime_field_tests() | |||
514 | if (EC_GROUP_get_degree(group) != 256) ABORT; | 524 | if (EC_GROUP_get_degree(group) != 256) ABORT; |
515 | fprintf(stdout, " ok\n"); | 525 | fprintf(stdout, " ok\n"); |
516 | 526 | ||
517 | fprintf(stdout, "verify group order ..."); | 527 | group_order_tests(group); |
518 | fflush(stdout); | ||
519 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
520 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
521 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
522 | fprintf(stdout, "."); | ||
523 | fflush(stdout); | ||
524 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
525 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
526 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
527 | fprintf(stdout, " ok\n"); | ||
528 | 528 | ||
529 | if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 529 | if (!(P_256 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
530 | if (!EC_GROUP_copy(P_256, group)) ABORT; | 530 | if (!EC_GROUP_copy(P_256, group)) ABORT; |
@@ -563,18 +563,8 @@ void prime_field_tests() | |||
563 | fprintf(stdout, "verify degree ..."); | 563 | fprintf(stdout, "verify degree ..."); |
564 | if (EC_GROUP_get_degree(group) != 384) ABORT; | 564 | if (EC_GROUP_get_degree(group) != 384) ABORT; |
565 | fprintf(stdout, " ok\n"); | 565 | fprintf(stdout, " ok\n"); |
566 | 566 | ||
567 | fprintf(stdout, "verify group order ..."); | 567 | group_order_tests(group); |
568 | fflush(stdout); | ||
569 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
570 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
571 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
572 | fprintf(stdout, "."); | ||
573 | fflush(stdout); | ||
574 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
575 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
576 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
577 | fprintf(stdout, " ok\n"); | ||
578 | 568 | ||
579 | if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 569 | if (!(P_384 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
580 | if (!EC_GROUP_copy(P_384, group)) ABORT; | 570 | if (!EC_GROUP_copy(P_384, group)) ABORT; |
@@ -619,18 +609,8 @@ void prime_field_tests() | |||
619 | fprintf(stdout, "verify degree ..."); | 609 | fprintf(stdout, "verify degree ..."); |
620 | if (EC_GROUP_get_degree(group) != 521) ABORT; | 610 | if (EC_GROUP_get_degree(group) != 521) ABORT; |
621 | fprintf(stdout, " ok\n"); | 611 | fprintf(stdout, " ok\n"); |
622 | 612 | ||
623 | fprintf(stdout, "verify group order ..."); | 613 | group_order_tests(group); |
624 | fflush(stdout); | ||
625 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
626 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
627 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
628 | fprintf(stdout, "."); | ||
629 | fflush(stdout); | ||
630 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; | ||
631 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; | ||
632 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; | ||
633 | fprintf(stdout, " ok\n"); | ||
634 | 614 | ||
635 | if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; | 615 | if (!(P_521 = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; |
636 | if (!EC_GROUP_copy(P_521, group)) ABORT; | 616 | if (!EC_GROUP_copy(P_521, group)) ABORT; |
@@ -659,6 +639,7 @@ void prime_field_tests() | |||
659 | points[2] = Q; | 639 | points[2] = Q; |
660 | points[3] = Q; | 640 | points[3] = Q; |
661 | 641 | ||
642 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; | ||
662 | if (!BN_add(y, z, BN_value_one())) ABORT; | 643 | if (!BN_add(y, z, BN_value_one())) ABORT; |
663 | if (BN_is_odd(y)) ABORT; | 644 | if (BN_is_odd(y)) ABORT; |
664 | if (!BN_rshift1(y, y)) ABORT; | 645 | if (!BN_rshift1(y, y)) ABORT; |
@@ -792,22 +773,14 @@ void prime_field_tests() | |||
792 | fprintf(stdout, "verify degree ..."); \ | 773 | fprintf(stdout, "verify degree ..."); \ |
793 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ | 774 | if (EC_GROUP_get_degree(group) != _degree) ABORT; \ |
794 | fprintf(stdout, " ok\n"); \ | 775 | fprintf(stdout, " ok\n"); \ |
795 | fprintf(stdout, "verify group order ..."); \ | 776 | group_order_tests(group); \ |
796 | fflush(stdout); \ | ||
797 | if (!EC_GROUP_get_order(group, z, ctx)) ABORT; \ | ||
798 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \ | ||
799 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \ | ||
800 | fprintf(stdout, "."); \ | ||
801 | fflush(stdout); \ | ||
802 | if (!EC_GROUP_precompute_mult(group, ctx)) ABORT; \ | ||
803 | if (!EC_POINT_mul(group, Q, z, NULL, NULL, ctx)) ABORT; \ | ||
804 | if (!EC_POINT_is_at_infinity(group, Q)) ABORT; \ | ||
805 | fprintf(stdout, " ok\n"); \ | ||
806 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ | 777 | if (!(_variable = EC_GROUP_new(EC_GROUP_method_of(group)))) ABORT; \ |
807 | if (!EC_GROUP_copy(_variable, group)) ABORT; | 778 | if (!EC_GROUP_copy(_variable, group)) ABORT; \ |
808 | 779 | ||
809 | void char2_field_tests() | 780 | #ifndef OPENSSL_NO_EC2M |
810 | { | 781 | |
782 | static void char2_field_tests(void) | ||
783 | { | ||
811 | BN_CTX *ctx = NULL; | 784 | BN_CTX *ctx = NULL; |
812 | BIGNUM *p, *a, *b; | 785 | BIGNUM *p, *a, *b; |
813 | EC_GROUP *group; | 786 | EC_GROUP *group; |
@@ -1239,8 +1212,9 @@ void char2_field_tests() | |||
1239 | if (C2_B571) EC_GROUP_free(C2_B571); | 1212 | if (C2_B571) EC_GROUP_free(C2_B571); |
1240 | 1213 | ||
1241 | } | 1214 | } |
1215 | #endif | ||
1242 | 1216 | ||
1243 | void internal_curve_test(void) | 1217 | static void internal_curve_test(void) |
1244 | { | 1218 | { |
1245 | EC_builtin_curve *curves = NULL; | 1219 | EC_builtin_curve *curves = NULL; |
1246 | size_t crv_len = 0, n = 0; | 1220 | size_t crv_len = 0, n = 0; |
@@ -1287,13 +1261,189 @@ void internal_curve_test(void) | |||
1287 | EC_GROUP_free(group); | 1261 | EC_GROUP_free(group); |
1288 | } | 1262 | } |
1289 | if (ok) | 1263 | if (ok) |
1290 | fprintf(stdout, " ok\n"); | 1264 | fprintf(stdout, " ok\n\n"); |
1291 | else | 1265 | else |
1292 | fprintf(stdout, " failed\n"); | 1266 | { |
1267 | fprintf(stdout, " failed\n\n"); | ||
1268 | ABORT; | ||
1269 | } | ||
1293 | OPENSSL_free(curves); | 1270 | OPENSSL_free(curves); |
1294 | return; | 1271 | return; |
1295 | } | 1272 | } |
1296 | 1273 | ||
1274 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
1275 | /* nistp_test_params contains magic numbers for testing our optimized | ||
1276 | * implementations of several NIST curves with characteristic > 3. */ | ||
1277 | struct nistp_test_params | ||
1278 | { | ||
1279 | const EC_METHOD* (*meth) (); | ||
1280 | int degree; | ||
1281 | /* Qx, Qy and D are taken from | ||
1282 | * http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf | ||
1283 | * Otherwise, values are standard curve parameters from FIPS 180-3 */ | ||
1284 | const char *p, *a, *b, *Qx, *Qy, *Gx, *Gy, *order, *d; | ||
1285 | }; | ||
1286 | |||
1287 | static const struct nistp_test_params nistp_tests_params[] = | ||
1288 | { | ||
1289 | { | ||
1290 | /* P-224 */ | ||
1291 | EC_GFp_nistp224_method, | ||
1292 | 224, | ||
1293 | "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", /* p */ | ||
1294 | "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", /* a */ | ||
1295 | "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", /* b */ | ||
1296 | "E84FB0B8E7000CB657D7973CF6B42ED78B301674276DF744AF130B3E", /* Qx */ | ||
1297 | "4376675C6FC5612C21A0FF2D2A89D2987DF7A2BC52183B5982298555", /* Qy */ | ||
1298 | "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21", /* Gx */ | ||
1299 | "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", /* Gy */ | ||
1300 | "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", /* order */ | ||
1301 | "3F0C488E987C80BE0FEE521F8D90BE6034EC69AE11CA72AA777481E8", /* d */ | ||
1302 | }, | ||
1303 | { | ||
1304 | /* P-256 */ | ||
1305 | EC_GFp_nistp256_method, | ||
1306 | 256, | ||
1307 | "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", /* p */ | ||
1308 | "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", /* a */ | ||
1309 | "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", /* b */ | ||
1310 | "b7e08afdfe94bad3f1dc8c734798ba1c62b3a0ad1e9ea2a38201cd0889bc7a19", /* Qx */ | ||
1311 | "3603f747959dbf7a4bb226e41928729063adc7ae43529e61b563bbc606cc5e09", /* Qy */ | ||
1312 | "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", /* Gx */ | ||
1313 | "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", /* Gy */ | ||
1314 | "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", /* order */ | ||
1315 | "c477f9f65c22cce20657faa5b2d1d8122336f851a508a1ed04e479c34985bf96", /* d */ | ||
1316 | }, | ||
1317 | { | ||
1318 | /* P-521 */ | ||
1319 | EC_GFp_nistp521_method, | ||
1320 | 521, | ||
1321 | "1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", /* p */ | ||
1322 | "1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc", /* a */ | ||
1323 | "051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00", /* b */ | ||
1324 | "0098e91eef9a68452822309c52fab453f5f117c1da8ed796b255e9ab8f6410cca16e59df403a6bdc6ca467a37056b1e54b3005d8ac030decfeb68df18b171885d5c4", /* Qx */ | ||
1325 | "0164350c321aecfc1cca1ba4364c9b15656150b4b78d6a48d7d28e7f31985ef17be8554376b72900712c4b83ad668327231526e313f5f092999a4632fd50d946bc2e", /* Qy */ | ||
1326 | "c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66", /* Gx */ | ||
1327 | "11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", /* Gy */ | ||
1328 | "1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409", /* order */ | ||
1329 | "0100085f47b8e1b8b11b7eb33028c0b2888e304bfc98501955b45bba1478dc184eeedf09b86a5f7c21994406072787205e69a63709fe35aa93ba333514b24f961722", /* d */ | ||
1330 | }, | ||
1331 | }; | ||
1332 | |||
1333 | void nistp_single_test(const struct nistp_test_params *test) | ||
1334 | { | ||
1335 | BN_CTX *ctx; | ||
1336 | BIGNUM *p, *a, *b, *x, *y, *n, *m, *order; | ||
1337 | EC_GROUP *NISTP; | ||
1338 | EC_POINT *G, *P, *Q, *Q_CHECK; | ||
1339 | |||
1340 | fprintf(stdout, "\nNIST curve P-%d (optimised implementation):\n", test->degree); | ||
1341 | ctx = BN_CTX_new(); | ||
1342 | p = BN_new(); | ||
1343 | a = BN_new(); | ||
1344 | b = BN_new(); | ||
1345 | x = BN_new(); y = BN_new(); | ||
1346 | m = BN_new(); n = BN_new(); order = BN_new(); | ||
1347 | |||
1348 | NISTP = EC_GROUP_new(test->meth()); | ||
1349 | if(!NISTP) ABORT; | ||
1350 | if (!BN_hex2bn(&p, test->p)) ABORT; | ||
1351 | if (1 != BN_is_prime_ex(p, BN_prime_checks, ctx, NULL)) ABORT; | ||
1352 | if (!BN_hex2bn(&a, test->a)) ABORT; | ||
1353 | if (!BN_hex2bn(&b, test->b)) ABORT; | ||
1354 | if (!EC_GROUP_set_curve_GFp(NISTP, p, a, b, ctx)) ABORT; | ||
1355 | G = EC_POINT_new(NISTP); | ||
1356 | P = EC_POINT_new(NISTP); | ||
1357 | Q = EC_POINT_new(NISTP); | ||
1358 | Q_CHECK = EC_POINT_new(NISTP); | ||
1359 | if(!BN_hex2bn(&x, test->Qx)) ABORT; | ||
1360 | if(!BN_hex2bn(&y, test->Qy)) ABORT; | ||
1361 | if(!EC_POINT_set_affine_coordinates_GFp(NISTP, Q_CHECK, x, y, ctx)) ABORT; | ||
1362 | if (!BN_hex2bn(&x, test->Gx)) ABORT; | ||
1363 | if (!BN_hex2bn(&y, test->Gy)) ABORT; | ||
1364 | if (!EC_POINT_set_affine_coordinates_GFp(NISTP, G, x, y, ctx)) ABORT; | ||
1365 | if (!BN_hex2bn(&order, test->order)) ABORT; | ||
1366 | if (!EC_GROUP_set_generator(NISTP, G, order, BN_value_one())) ABORT; | ||
1367 | |||
1368 | fprintf(stdout, "verify degree ... "); | ||
1369 | if (EC_GROUP_get_degree(NISTP) != test->degree) ABORT; | ||
1370 | fprintf(stdout, "ok\n"); | ||
1371 | |||
1372 | fprintf(stdout, "NIST test vectors ... "); | ||
1373 | if (!BN_hex2bn(&n, test->d)) ABORT; | ||
1374 | /* fixed point multiplication */ | ||
1375 | EC_POINT_mul(NISTP, Q, n, NULL, NULL, ctx); | ||
1376 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1377 | /* random point multiplication */ | ||
1378 | EC_POINT_mul(NISTP, Q, NULL, G, n, ctx); | ||
1379 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1380 | |||
1381 | /* set generator to P = 2*G, where G is the standard generator */ | ||
1382 | if (!EC_POINT_dbl(NISTP, P, G, ctx)) ABORT; | ||
1383 | if (!EC_GROUP_set_generator(NISTP, P, order, BN_value_one())) ABORT; | ||
1384 | /* set the scalar to m=n/2, where n is the NIST test scalar */ | ||
1385 | if (!BN_rshift(m, n, 1)) ABORT; | ||
1386 | |||
1387 | /* test the non-standard generator */ | ||
1388 | /* fixed point multiplication */ | ||
1389 | EC_POINT_mul(NISTP, Q, m, NULL, NULL, ctx); | ||
1390 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1391 | /* random point multiplication */ | ||
1392 | EC_POINT_mul(NISTP, Q, NULL, P, m, ctx); | ||
1393 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1394 | |||
1395 | /* now repeat all tests with precomputation */ | ||
1396 | if (!EC_GROUP_precompute_mult(NISTP, ctx)) ABORT; | ||
1397 | |||
1398 | /* fixed point multiplication */ | ||
1399 | EC_POINT_mul(NISTP, Q, m, NULL, NULL, ctx); | ||
1400 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1401 | /* random point multiplication */ | ||
1402 | EC_POINT_mul(NISTP, Q, NULL, P, m, ctx); | ||
1403 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1404 | |||
1405 | /* reset generator */ | ||
1406 | if (!EC_GROUP_set_generator(NISTP, G, order, BN_value_one())) ABORT; | ||
1407 | /* fixed point multiplication */ | ||
1408 | EC_POINT_mul(NISTP, Q, n, NULL, NULL, ctx); | ||
1409 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1410 | /* random point multiplication */ | ||
1411 | EC_POINT_mul(NISTP, Q, NULL, G, n, ctx); | ||
1412 | if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; | ||
1413 | |||
1414 | fprintf(stdout, "ok\n"); | ||
1415 | group_order_tests(NISTP); | ||
1416 | #if 0 | ||
1417 | timings(NISTP, TIMING_BASE_PT, ctx); | ||
1418 | timings(NISTP, TIMING_RAND_PT, ctx); | ||
1419 | #endif | ||
1420 | EC_GROUP_free(NISTP); | ||
1421 | EC_POINT_free(G); | ||
1422 | EC_POINT_free(P); | ||
1423 | EC_POINT_free(Q); | ||
1424 | EC_POINT_free(Q_CHECK); | ||
1425 | BN_free(n); | ||
1426 | BN_free(m); | ||
1427 | BN_free(p); | ||
1428 | BN_free(a); | ||
1429 | BN_free(b); | ||
1430 | BN_free(x); | ||
1431 | BN_free(y); | ||
1432 | BN_free(order); | ||
1433 | BN_CTX_free(ctx); | ||
1434 | } | ||
1435 | |||
1436 | void nistp_tests() | ||
1437 | { | ||
1438 | unsigned i; | ||
1439 | |||
1440 | for (i = 0; i < sizeof(nistp_tests_params) / sizeof(struct nistp_test_params); i++) | ||
1441 | { | ||
1442 | nistp_single_test(&nistp_tests_params[i]); | ||
1443 | } | ||
1444 | } | ||
1445 | #endif | ||
1446 | |||
1297 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; | 1447 | static const char rnd_seed[] = "string to make the random number generator think it has entropy"; |
1298 | 1448 | ||
1299 | int main(int argc, char *argv[]) | 1449 | int main(int argc, char *argv[]) |
@@ -1317,7 +1467,12 @@ int main(int argc, char *argv[]) | |||
1317 | 1467 | ||
1318 | prime_field_tests(); | 1468 | prime_field_tests(); |
1319 | puts(""); | 1469 | puts(""); |
1470 | #ifndef OPENSSL_NO_EC2M | ||
1320 | char2_field_tests(); | 1471 | char2_field_tests(); |
1472 | #endif | ||
1473 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
1474 | nistp_tests(); | ||
1475 | #endif | ||
1321 | /* test the internal curves */ | 1476 | /* test the internal curves */ |
1322 | internal_curve_test(); | 1477 | internal_curve_test(); |
1323 | 1478 | ||
diff --git a/src/lib/libssl/src/crypto/engine/Makefile b/src/lib/libssl/src/crypto/engine/Makefile index 9c214824eb..d29bdd09a0 100644 --- a/src/lib/libssl/src/crypto/engine/Makefile +++ b/src/lib/libssl/src/crypto/engine/Makefile | |||
@@ -21,12 +21,14 @@ LIBSRC= eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c \ | |||
21 | eng_table.c eng_pkey.c eng_fat.c eng_all.c \ | 21 | eng_table.c eng_pkey.c eng_fat.c eng_all.c \ |
22 | tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c \ | 22 | tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c \ |
23 | tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c \ | 23 | tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c \ |
24 | eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c | 24 | eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c \ |
25 | eng_rsax.c eng_rdrand.c | ||
25 | LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \ | 26 | LIBOBJ= eng_err.o eng_lib.o eng_list.o eng_init.o eng_ctrl.o \ |
26 | eng_table.o eng_pkey.o eng_fat.o eng_all.o \ | 27 | eng_table.o eng_pkey.o eng_fat.o eng_all.o \ |
27 | tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o \ | 28 | tb_rsa.o tb_dsa.o tb_ecdsa.o tb_dh.o tb_ecdh.o tb_rand.o tb_store.o \ |
28 | tb_cipher.o tb_digest.o tb_pkmeth.o tb_asnmth.o \ | 29 | tb_cipher.o tb_digest.o tb_pkmeth.o tb_asnmth.o \ |
29 | eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o | 30 | eng_openssl.o eng_cnf.o eng_dyn.o eng_cryptodev.o \ |
31 | eng_rsax.o eng_rdrand.o | ||
30 | 32 | ||
31 | SRC= $(LIBSRC) | 33 | SRC= $(LIBSRC) |
32 | 34 | ||
@@ -249,6 +251,34 @@ eng_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | |||
249 | eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 251 | eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
250 | eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 252 | eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
251 | eng_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_pkey.c | 253 | eng_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_pkey.c |
254 | eng_rdrand.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
255 | eng_rdrand.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
256 | eng_rdrand.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
257 | eng_rdrand.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
258 | eng_rdrand.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
259 | eng_rdrand.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
260 | eng_rdrand.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
261 | eng_rdrand.o: ../../include/openssl/opensslconf.h | ||
262 | eng_rdrand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
263 | eng_rdrand.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
264 | eng_rdrand.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
265 | eng_rdrand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
266 | eng_rdrand.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
267 | eng_rdrand.o: eng_rdrand.c | ||
268 | eng_rsax.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
269 | eng_rsax.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | ||
270 | eng_rsax.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
271 | eng_rsax.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | ||
272 | eng_rsax.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h | ||
273 | eng_rsax.o: ../../include/openssl/err.h ../../include/openssl/evp.h | ||
274 | eng_rsax.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | ||
275 | eng_rsax.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
276 | eng_rsax.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
277 | eng_rsax.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | ||
278 | eng_rsax.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
279 | eng_rsax.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
280 | eng_rsax.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
281 | eng_rsax.o: eng_rsax.c | ||
252 | eng_table.o: ../../e_os.h ../../include/openssl/asn1.h | 282 | eng_table.o: ../../e_os.h ../../include/openssl/asn1.h |
253 | eng_table.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 283 | eng_table.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
254 | eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 284 | eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
diff --git a/src/lib/libssl/src/crypto/engine/eng_all.c b/src/lib/libssl/src/crypto/engine/eng_all.c index 22c120454f..6093376df4 100644 --- a/src/lib/libssl/src/crypto/engine/eng_all.c +++ b/src/lib/libssl/src/crypto/engine/eng_all.c | |||
@@ -61,6 +61,8 @@ | |||
61 | 61 | ||
62 | void ENGINE_load_builtin_engines(void) | 62 | void ENGINE_load_builtin_engines(void) |
63 | { | 63 | { |
64 | /* Some ENGINEs need this */ | ||
65 | OPENSSL_cpuid_setup(); | ||
64 | #if 0 | 66 | #if 0 |
65 | /* There's no longer any need for an "openssl" ENGINE unless, one day, | 67 | /* There's no longer any need for an "openssl" ENGINE unless, one day, |
66 | * it is the *only* way for standard builtin implementations to be be | 68 | * it is the *only* way for standard builtin implementations to be be |
@@ -71,6 +73,12 @@ void ENGINE_load_builtin_engines(void) | |||
71 | #if !defined(OPENSSL_NO_HW) && (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)) | 73 | #if !defined(OPENSSL_NO_HW) && (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)) |
72 | ENGINE_load_cryptodev(); | 74 | ENGINE_load_cryptodev(); |
73 | #endif | 75 | #endif |
76 | #ifndef OPENSSL_NO_RSAX | ||
77 | ENGINE_load_rsax(); | ||
78 | #endif | ||
79 | #ifndef OPENSSL_NO_RDRAND | ||
80 | ENGINE_load_rdrand(); | ||
81 | #endif | ||
74 | ENGINE_load_dynamic(); | 82 | ENGINE_load_dynamic(); |
75 | #ifndef OPENSSL_NO_STATIC_ENGINE | 83 | #ifndef OPENSSL_NO_STATIC_ENGINE |
76 | #ifndef OPENSSL_NO_HW | 84 | #ifndef OPENSSL_NO_HW |
@@ -112,6 +120,7 @@ void ENGINE_load_builtin_engines(void) | |||
112 | ENGINE_load_capi(); | 120 | ENGINE_load_capi(); |
113 | #endif | 121 | #endif |
114 | #endif | 122 | #endif |
123 | ENGINE_register_all_complete(); | ||
115 | } | 124 | } |
116 | 125 | ||
117 | #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) | 126 | #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) |
diff --git a/src/lib/libssl/src/crypto/engine/eng_cryptodev.c b/src/lib/libssl/src/crypto/engine/eng_cryptodev.c index 52f4ca3901..5a715aca4f 100644 --- a/src/lib/libssl/src/crypto/engine/eng_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/eng_cryptodev.c | |||
@@ -79,8 +79,6 @@ struct dev_crypto_state { | |||
79 | unsigned char digest_res[HASH_MAX_LEN]; | 79 | unsigned char digest_res[HASH_MAX_LEN]; |
80 | char *mac_data; | 80 | char *mac_data; |
81 | int mac_len; | 81 | int mac_len; |
82 | |||
83 | int copy; | ||
84 | #endif | 82 | #endif |
85 | }; | 83 | }; |
86 | 84 | ||
@@ -200,6 +198,7 @@ get_dev_crypto(void) | |||
200 | 198 | ||
201 | if ((fd = open_dev_crypto()) == -1) | 199 | if ((fd = open_dev_crypto()) == -1) |
202 | return (-1); | 200 | return (-1); |
201 | #ifndef CRIOGET_NOT_NEEDED | ||
203 | if (ioctl(fd, CRIOGET, &retfd) == -1) | 202 | if (ioctl(fd, CRIOGET, &retfd) == -1) |
204 | return (-1); | 203 | return (-1); |
205 | 204 | ||
@@ -208,9 +207,19 @@ get_dev_crypto(void) | |||
208 | close(retfd); | 207 | close(retfd); |
209 | return (-1); | 208 | return (-1); |
210 | } | 209 | } |
210 | #else | ||
211 | retfd = fd; | ||
212 | #endif | ||
211 | return (retfd); | 213 | return (retfd); |
212 | } | 214 | } |
213 | 215 | ||
216 | static void put_dev_crypto(int fd) | ||
217 | { | ||
218 | #ifndef CRIOGET_NOT_NEEDED | ||
219 | close(fd); | ||
220 | #endif | ||
221 | } | ||
222 | |||
214 | /* Caching version for asym operations */ | 223 | /* Caching version for asym operations */ |
215 | static int | 224 | static int |
216 | get_asym_dev_crypto(void) | 225 | get_asym_dev_crypto(void) |
@@ -252,7 +261,7 @@ get_cryptodev_ciphers(const int **cnids) | |||
252 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) | 261 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) |
253 | nids[count++] = ciphers[i].nid; | 262 | nids[count++] = ciphers[i].nid; |
254 | } | 263 | } |
255 | close(fd); | 264 | put_dev_crypto(fd); |
256 | 265 | ||
257 | if (count > 0) | 266 | if (count > 0) |
258 | *cnids = nids; | 267 | *cnids = nids; |
@@ -291,7 +300,7 @@ get_cryptodev_digests(const int **cnids) | |||
291 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) | 300 | ioctl(fd, CIOCFSESSION, &sess.ses) != -1) |
292 | nids[count++] = digests[i].nid; | 301 | nids[count++] = digests[i].nid; |
293 | } | 302 | } |
294 | close(fd); | 303 | put_dev_crypto(fd); |
295 | 304 | ||
296 | if (count > 0) | 305 | if (count > 0) |
297 | *cnids = nids; | 306 | *cnids = nids; |
@@ -436,7 +445,7 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
436 | sess->cipher = cipher; | 445 | sess->cipher = cipher; |
437 | 446 | ||
438 | if (ioctl(state->d_fd, CIOCGSESSION, sess) == -1) { | 447 | if (ioctl(state->d_fd, CIOCGSESSION, sess) == -1) { |
439 | close(state->d_fd); | 448 | put_dev_crypto(state->d_fd); |
440 | state->d_fd = -1; | 449 | state->d_fd = -1; |
441 | return (0); | 450 | return (0); |
442 | } | 451 | } |
@@ -473,7 +482,7 @@ cryptodev_cleanup(EVP_CIPHER_CTX *ctx) | |||
473 | } else { | 482 | } else { |
474 | ret = 1; | 483 | ret = 1; |
475 | } | 484 | } |
476 | close(state->d_fd); | 485 | put_dev_crypto(state->d_fd); |
477 | state->d_fd = -1; | 486 | state->d_fd = -1; |
478 | 487 | ||
479 | return (ret); | 488 | return (ret); |
@@ -686,7 +695,7 @@ static int cryptodev_digest_init(EVP_MD_CTX *ctx) | |||
686 | sess->mac = digest; | 695 | sess->mac = digest; |
687 | 696 | ||
688 | if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) { | 697 | if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) { |
689 | close(state->d_fd); | 698 | put_dev_crypto(state->d_fd); |
690 | state->d_fd = -1; | 699 | state->d_fd = -1; |
691 | printf("cryptodev_digest_init: Open session failed\n"); | 700 | printf("cryptodev_digest_init: Open session failed\n"); |
692 | return (0); | 701 | return (0); |
@@ -758,14 +767,12 @@ static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md) | |||
758 | if (! (ctx->flags & EVP_MD_CTX_FLAG_ONESHOT) ) { | 767 | if (! (ctx->flags & EVP_MD_CTX_FLAG_ONESHOT) ) { |
759 | /* if application doesn't support one buffer */ | 768 | /* if application doesn't support one buffer */ |
760 | memset(&cryp, 0, sizeof(cryp)); | 769 | memset(&cryp, 0, sizeof(cryp)); |
761 | |||
762 | cryp.ses = sess->ses; | 770 | cryp.ses = sess->ses; |
763 | cryp.flags = 0; | 771 | cryp.flags = 0; |
764 | cryp.len = state->mac_len; | 772 | cryp.len = state->mac_len; |
765 | cryp.src = state->mac_data; | 773 | cryp.src = state->mac_data; |
766 | cryp.dst = NULL; | 774 | cryp.dst = NULL; |
767 | cryp.mac = (caddr_t)md; | 775 | cryp.mac = (caddr_t)md; |
768 | |||
769 | if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) { | 776 | if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) { |
770 | printf("cryptodev_digest_final: digest failed\n"); | 777 | printf("cryptodev_digest_final: digest failed\n"); |
771 | return (0); | 778 | return (0); |
@@ -786,6 +793,9 @@ static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx) | |||
786 | struct dev_crypto_state *state = ctx->md_data; | 793 | struct dev_crypto_state *state = ctx->md_data; |
787 | struct session_op *sess = &state->d_sess; | 794 | struct session_op *sess = &state->d_sess; |
788 | 795 | ||
796 | if (state == NULL) | ||
797 | return 0; | ||
798 | |||
789 | if (state->d_fd < 0) { | 799 | if (state->d_fd < 0) { |
790 | printf("cryptodev_digest_cleanup: illegal input\n"); | 800 | printf("cryptodev_digest_cleanup: illegal input\n"); |
791 | return (0); | 801 | return (0); |
@@ -797,16 +807,13 @@ static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx) | |||
797 | state->mac_len = 0; | 807 | state->mac_len = 0; |
798 | } | 808 | } |
799 | 809 | ||
800 | if (state->copy) | ||
801 | return 1; | ||
802 | |||
803 | if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) { | 810 | if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) { |
804 | printf("cryptodev_digest_cleanup: failed to close session\n"); | 811 | printf("cryptodev_digest_cleanup: failed to close session\n"); |
805 | ret = 0; | 812 | ret = 0; |
806 | } else { | 813 | } else { |
807 | ret = 1; | 814 | ret = 1; |
808 | } | 815 | } |
809 | close(state->d_fd); | 816 | put_dev_crypto(state->d_fd); |
810 | state->d_fd = -1; | 817 | state->d_fd = -1; |
811 | 818 | ||
812 | return (ret); | 819 | return (ret); |
@@ -816,15 +823,39 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from) | |||
816 | { | 823 | { |
817 | struct dev_crypto_state *fstate = from->md_data; | 824 | struct dev_crypto_state *fstate = from->md_data; |
818 | struct dev_crypto_state *dstate = to->md_data; | 825 | struct dev_crypto_state *dstate = to->md_data; |
826 | struct session_op *sess; | ||
827 | int digest; | ||
819 | 828 | ||
820 | memcpy(dstate, fstate, sizeof(struct dev_crypto_state)); | 829 | if (dstate == NULL || fstate == NULL) |
830 | return 1; | ||
821 | 831 | ||
822 | if (fstate->mac_len != 0) { | 832 | memcpy(dstate, fstate, sizeof(struct dev_crypto_state)); |
823 | dstate->mac_data = OPENSSL_malloc(fstate->mac_len); | 833 | |
824 | memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len); | 834 | sess = &dstate->d_sess; |
835 | |||
836 | digest = digest_nid_to_cryptodev(to->digest->type); | ||
837 | |||
838 | sess->mackey = dstate->dummy_mac_key; | ||
839 | sess->mackeylen = digest_key_length(to->digest->type); | ||
840 | sess->mac = digest; | ||
841 | |||
842 | dstate->d_fd = get_dev_crypto(); | ||
843 | |||
844 | if (ioctl(dstate->d_fd, CIOCGSESSION, sess) < 0) { | ||
845 | put_dev_crypto(dstate->d_fd); | ||
846 | dstate->d_fd = -1; | ||
847 | printf("cryptodev_digest_init: Open session failed\n"); | ||
848 | return (0); | ||
825 | } | 849 | } |
826 | 850 | ||
827 | dstate->copy = 1; | 851 | if (fstate->mac_len != 0) { |
852 | if (fstate->mac_data != NULL) | ||
853 | { | ||
854 | dstate->mac_data = OPENSSL_malloc(fstate->mac_len); | ||
855 | memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len); | ||
856 | dstate->mac_len = fstate->mac_len; | ||
857 | } | ||
858 | } | ||
828 | 859 | ||
829 | return 1; | 860 | return 1; |
830 | } | 861 | } |
@@ -1347,11 +1378,11 @@ ENGINE_load_cryptodev(void) | |||
1347 | * find out what asymmetric crypto algorithms we support | 1378 | * find out what asymmetric crypto algorithms we support |
1348 | */ | 1379 | */ |
1349 | if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) { | 1380 | if (ioctl(fd, CIOCASYMFEAT, &cryptodev_asymfeat) == -1) { |
1350 | close(fd); | 1381 | put_dev_crypto(fd); |
1351 | ENGINE_free(engine); | 1382 | ENGINE_free(engine); |
1352 | return; | 1383 | return; |
1353 | } | 1384 | } |
1354 | close(fd); | 1385 | put_dev_crypto(fd); |
1355 | 1386 | ||
1356 | if (!ENGINE_set_id(engine, "cryptodev") || | 1387 | if (!ENGINE_set_id(engine, "cryptodev") || |
1357 | !ENGINE_set_name(engine, "BSD cryptodev engine") || | 1388 | !ENGINE_set_name(engine, "BSD cryptodev engine") || |
diff --git a/src/lib/libssl/src/crypto/engine/eng_fat.c b/src/lib/libssl/src/crypto/engine/eng_fat.c index db66e62350..789b8d57e5 100644 --- a/src/lib/libssl/src/crypto/engine/eng_fat.c +++ b/src/lib/libssl/src/crypto/engine/eng_fat.c | |||
@@ -176,6 +176,7 @@ int ENGINE_register_all_complete(void) | |||
176 | ENGINE *e; | 176 | ENGINE *e; |
177 | 177 | ||
178 | for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e)) | 178 | for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e)) |
179 | ENGINE_register_complete(e); | 179 | if (!(e->flags & ENGINE_FLAGS_NO_REGISTER_ALL)) |
180 | ENGINE_register_complete(e); | ||
180 | return 1; | 181 | return 1; |
181 | } | 182 | } |
diff --git a/src/lib/libssl/src/crypto/engine/engine.h b/src/lib/libssl/src/crypto/engine/engine.h index 943aeae215..f8be497724 100644 --- a/src/lib/libssl/src/crypto/engine/engine.h +++ b/src/lib/libssl/src/crypto/engine/engine.h | |||
@@ -141,6 +141,13 @@ extern "C" { | |||
141 | * the existing ENGINE's structural reference count. */ | 141 | * the existing ENGINE's structural reference count. */ |
142 | #define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 | 142 | #define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 |
143 | 143 | ||
144 | /* This flag if for an ENGINE that does not want its methods registered as | ||
145 | * part of ENGINE_register_all_complete() for example if the methods are | ||
146 | * not usable as default methods. | ||
147 | */ | ||
148 | |||
149 | #define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008 | ||
150 | |||
144 | /* ENGINEs can support their own command types, and these flags are used in | 151 | /* ENGINEs can support their own command types, and these flags are used in |
145 | * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each | 152 | * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each |
146 | * command expects. Currently only numeric and string input is supported. If a | 153 | * command expects. Currently only numeric and string input is supported. If a |
@@ -344,6 +351,8 @@ void ENGINE_load_gost(void); | |||
344 | #endif | 351 | #endif |
345 | #endif | 352 | #endif |
346 | void ENGINE_load_cryptodev(void); | 353 | void ENGINE_load_cryptodev(void); |
354 | void ENGINE_load_rsax(void); | ||
355 | void ENGINE_load_rdrand(void); | ||
347 | void ENGINE_load_builtin_engines(void); | 356 | void ENGINE_load_builtin_engines(void); |
348 | 357 | ||
349 | /* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation | 358 | /* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation |
diff --git a/src/lib/libssl/src/crypto/err/err.c b/src/lib/libssl/src/crypto/err/err.c index 69713a6e2f..fcdb244008 100644 --- a/src/lib/libssl/src/crypto/err/err.c +++ b/src/lib/libssl/src/crypto/err/err.c | |||
@@ -1066,6 +1066,13 @@ void ERR_set_error_data(char *data, int flags) | |||
1066 | void ERR_add_error_data(int num, ...) | 1066 | void ERR_add_error_data(int num, ...) |
1067 | { | 1067 | { |
1068 | va_list args; | 1068 | va_list args; |
1069 | va_start(args, num); | ||
1070 | ERR_add_error_vdata(num, args); | ||
1071 | va_end(args); | ||
1072 | } | ||
1073 | |||
1074 | void ERR_add_error_vdata(int num, va_list args) | ||
1075 | { | ||
1069 | int i,n,s; | 1076 | int i,n,s; |
1070 | char *str,*p,*a; | 1077 | char *str,*p,*a; |
1071 | 1078 | ||
@@ -1074,7 +1081,6 @@ void ERR_add_error_data(int num, ...) | |||
1074 | if (str == NULL) return; | 1081 | if (str == NULL) return; |
1075 | str[0]='\0'; | 1082 | str[0]='\0'; |
1076 | 1083 | ||
1077 | va_start(args, num); | ||
1078 | n=0; | 1084 | n=0; |
1079 | for (i=0; i<num; i++) | 1085 | for (i=0; i<num; i++) |
1080 | { | 1086 | { |
@@ -1090,7 +1096,7 @@ void ERR_add_error_data(int num, ...) | |||
1090 | if (p == NULL) | 1096 | if (p == NULL) |
1091 | { | 1097 | { |
1092 | OPENSSL_free(str); | 1098 | OPENSSL_free(str); |
1093 | goto err; | 1099 | return; |
1094 | } | 1100 | } |
1095 | else | 1101 | else |
1096 | str=p; | 1102 | str=p; |
@@ -1099,9 +1105,6 @@ void ERR_add_error_data(int num, ...) | |||
1099 | } | 1105 | } |
1100 | } | 1106 | } |
1101 | ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); | 1107 | ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); |
1102 | |||
1103 | err: | ||
1104 | va_end(args); | ||
1105 | } | 1108 | } |
1106 | 1109 | ||
1107 | int ERR_set_mark(void) | 1110 | int ERR_set_mark(void) |
diff --git a/src/lib/libssl/src/crypto/err/err.h b/src/lib/libssl/src/crypto/err/err.h index b9f8c16d47..974cc9cc6f 100644 --- a/src/lib/libssl/src/crypto/err/err.h +++ b/src/lib/libssl/src/crypto/err/err.h | |||
@@ -344,8 +344,9 @@ void ERR_print_errors_fp(FILE *fp); | |||
344 | #endif | 344 | #endif |
345 | #ifndef OPENSSL_NO_BIO | 345 | #ifndef OPENSSL_NO_BIO |
346 | void ERR_print_errors(BIO *bp); | 346 | void ERR_print_errors(BIO *bp); |
347 | void ERR_add_error_data(int num, ...); | ||
348 | #endif | 347 | #endif |
348 | void ERR_add_error_data(int num, ...); | ||
349 | void ERR_add_error_vdata(int num, va_list args); | ||
349 | void ERR_load_strings(int lib,ERR_STRING_DATA str[]); | 350 | void ERR_load_strings(int lib,ERR_STRING_DATA str[]); |
350 | void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); | 351 | void ERR_unload_strings(int lib,ERR_STRING_DATA str[]); |
351 | void ERR_load_ERR_strings(void); | 352 | void ERR_load_ERR_strings(void); |
diff --git a/src/lib/libssl/src/crypto/err/err_all.c b/src/lib/libssl/src/crypto/err/err_all.c index fc049e8e88..bd8946d8ba 100644 --- a/src/lib/libssl/src/crypto/err/err_all.c +++ b/src/lib/libssl/src/crypto/err/err_all.c | |||
@@ -104,6 +104,10 @@ | |||
104 | #endif | 104 | #endif |
105 | #include <openssl/comp.h> | 105 | #include <openssl/comp.h> |
106 | 106 | ||
107 | #ifdef OPENSSL_FIPS | ||
108 | #include <openssl/fips.h> | ||
109 | #endif | ||
110 | |||
107 | void ERR_load_crypto_strings(void) | 111 | void ERR_load_crypto_strings(void) |
108 | { | 112 | { |
109 | #ifndef OPENSSL_NO_ERR | 113 | #ifndef OPENSSL_NO_ERR |
@@ -157,4 +161,7 @@ void ERR_load_crypto_strings(void) | |||
157 | #endif | 161 | #endif |
158 | ERR_load_COMP_strings(); | 162 | ERR_load_COMP_strings(); |
159 | #endif | 163 | #endif |
164 | #ifdef OPENSSL_FIPS | ||
165 | ERR_load_FIPS_strings(); | ||
166 | #endif | ||
160 | } | 167 | } |
diff --git a/src/lib/libssl/src/crypto/evp/Makefile b/src/lib/libssl/src/crypto/evp/Makefile index 82825e5299..0fe1b96bff 100644 --- a/src/lib/libssl/src/crypto/evp/Makefile +++ b/src/lib/libssl/src/crypto/evp/Makefile | |||
@@ -28,7 +28,8 @@ LIBSRC= encode.c digest.c evp_enc.c evp_key.c evp_acnf.c \ | |||
28 | bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ | 28 | bio_md.c bio_b64.c bio_enc.c evp_err.c e_null.c \ |
29 | c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ | 29 | c_all.c c_allc.c c_alld.c evp_lib.c bio_ok.c \ |
30 | evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c \ | 30 | evp_pkey.c evp_pbe.c p5_crpt.c p5_crpt2.c \ |
31 | e_old.c pmeth_lib.c pmeth_fn.c pmeth_gn.c m_sigver.c | 31 | e_old.c pmeth_lib.c pmeth_fn.c pmeth_gn.c m_sigver.c evp_fips.c \ |
32 | e_aes_cbc_hmac_sha1.c e_rc4_hmac_md5.c | ||
32 | 33 | ||
33 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ | 34 | LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ |
34 | e_des.o e_bf.o e_idea.o e_des3.o e_camellia.o\ | 35 | e_des.o e_bf.o e_idea.o e_des3.o e_camellia.o\ |
@@ -40,7 +41,8 @@ LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ | |||
40 | bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ | 41 | bio_md.o bio_b64.o bio_enc.o evp_err.o e_null.o \ |
41 | c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \ | 42 | c_all.o c_allc.o c_alld.o evp_lib.o bio_ok.o \ |
42 | evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o \ | 43 | evp_pkey.o evp_pbe.o p5_crpt.o p5_crpt2.o \ |
43 | e_old.o pmeth_lib.o pmeth_fn.o pmeth_gn.o m_sigver.o | 44 | e_old.o pmeth_lib.o pmeth_fn.o pmeth_gn.o m_sigver.o evp_fips.o \ |
45 | e_aes_cbc_hmac_sha1.o e_rc4_hmac_md5.o | ||
44 | 46 | ||
45 | SRC= $(LIBSRC) | 47 | SRC= $(LIBSRC) |
46 | 48 | ||
@@ -189,11 +191,27 @@ e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | |||
189 | e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h | 191 | e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h |
190 | e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 192 | e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
191 | e_aes.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | 193 | e_aes.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h |
192 | e_aes.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 194 | e_aes.o: ../../include/openssl/modes.h ../../include/openssl/obj_mac.h |
193 | e_aes.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 195 | e_aes.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h |
194 | e_aes.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 196 | e_aes.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
195 | e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h e_aes.c | 197 | e_aes.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h |
196 | e_aes.o: evp_locl.h | 198 | e_aes.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
199 | e_aes.o: ../modes/modes_lcl.h e_aes.c evp_locl.h | ||
200 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h | ||
201 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/bio.h | ||
202 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/crypto.h | ||
203 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/e_os2.h | ||
204 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/evp.h | ||
205 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/obj_mac.h | ||
206 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/objects.h | ||
207 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/opensslconf.h | ||
208 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/opensslv.h | ||
209 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/ossl_typ.h | ||
210 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/safestack.h | ||
211 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/sha.h | ||
212 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/stack.h | ||
213 | e_aes_cbc_hmac_sha1.o: ../../include/openssl/symhacks.h e_aes_cbc_hmac_sha1.c | ||
214 | e_aes_cbc_hmac_sha1.o: evp_locl.h | ||
197 | e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 215 | e_bf.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
198 | e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h | 216 | e_bf.o: ../../include/openssl/blowfish.h ../../include/openssl/buffer.h |
199 | e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 217 | e_bf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
@@ -279,7 +297,18 @@ e_rc4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | |||
279 | e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 297 | e_rc4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
280 | e_rc4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h | 298 | e_rc4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h |
281 | e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 299 | e_rc4.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
282 | e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc4.c | 300 | e_rc4.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc4.c evp_locl.h |
301 | e_rc4_hmac_md5.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
302 | e_rc4_hmac_md5.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
303 | e_rc4_hmac_md5.o: ../../include/openssl/evp.h ../../include/openssl/md5.h | ||
304 | e_rc4_hmac_md5.o: ../../include/openssl/obj_mac.h | ||
305 | e_rc4_hmac_md5.o: ../../include/openssl/objects.h | ||
306 | e_rc4_hmac_md5.o: ../../include/openssl/opensslconf.h | ||
307 | e_rc4_hmac_md5.o: ../../include/openssl/opensslv.h | ||
308 | e_rc4_hmac_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h | ||
309 | e_rc4_hmac_md5.o: ../../include/openssl/safestack.h | ||
310 | e_rc4_hmac_md5.o: ../../include/openssl/stack.h | ||
311 | e_rc4_hmac_md5.o: ../../include/openssl/symhacks.h e_rc4_hmac_md5.c | ||
283 | e_rc5.o: ../../e_os.h ../../include/openssl/bio.h | 312 | e_rc5.o: ../../e_os.h ../../include/openssl/bio.h |
284 | e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 313 | e_rc5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
285 | e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h | 314 | e_rc5.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h |
@@ -349,6 +378,13 @@ evp_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | |||
349 | evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 378 | evp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
350 | evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 379 | evp_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
351 | evp_err.o: ../../include/openssl/symhacks.h evp_err.c | 380 | evp_err.o: ../../include/openssl/symhacks.h evp_err.c |
381 | evp_fips.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | ||
382 | evp_fips.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
383 | evp_fips.o: ../../include/openssl/evp.h ../../include/openssl/obj_mac.h | ||
384 | evp_fips.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | ||
385 | evp_fips.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
386 | evp_fips.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
387 | evp_fips.o: ../../include/openssl/symhacks.h evp_fips.c | ||
352 | evp_key.o: ../../e_os.h ../../include/openssl/asn1.h | 388 | evp_key.o: ../../e_os.h ../../include/openssl/asn1.h |
353 | evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 389 | evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
354 | evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 390 | evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
@@ -383,7 +419,7 @@ evp_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h | |||
383 | evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | 419 | evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h |
384 | evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 420 | evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
385 | evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 421 | evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
386 | evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_pbe.c | 422 | evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h evp_pbe.c |
387 | evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h | 423 | evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h |
388 | evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h | 424 | evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h |
389 | evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 425 | evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
@@ -456,7 +492,7 @@ m_md4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | |||
456 | m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 492 | m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
457 | m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 493 | m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
458 | m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 494 | m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
459 | m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md4.c | 495 | m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_md4.c |
460 | m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 496 | m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
461 | m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 497 | m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
462 | m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 498 | m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -469,7 +505,7 @@ m_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h | |||
469 | m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 505 | m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
470 | m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 506 | m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
471 | m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 507 | m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
472 | m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md5.c | 508 | m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_md5.c |
473 | m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 509 | m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
474 | m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 510 | m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
475 | m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | 511 | m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h |
@@ -484,7 +520,7 @@ m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | |||
484 | m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 520 | m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
485 | m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | 521 | m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
486 | m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h | 522 | m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h |
487 | m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_mdc2.c | 523 | m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_mdc2.c |
488 | m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 524 | m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
489 | m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 525 | m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
490 | m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 526 | m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -510,7 +546,8 @@ m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/ripemd.h | |||
510 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 546 | m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
511 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 547 | m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
512 | m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 548 | m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
513 | m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_ripemd.c | 549 | m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h |
550 | m_ripemd.o: m_ripemd.c | ||
514 | m_sha.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 551 | m_sha.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
515 | m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 552 | m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
516 | m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 553 | m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -523,7 +560,7 @@ m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | |||
523 | m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 560 | m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
524 | m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 561 | m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
525 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 562 | m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
526 | m_sha.o: ../cryptlib.h m_sha.c | 563 | m_sha.o: ../cryptlib.h evp_locl.h m_sha.c |
527 | m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 564 | m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
528 | m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 565 | m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
529 | m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 566 | m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -563,7 +600,7 @@ m_wp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | |||
563 | m_wp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 600 | m_wp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
564 | m_wp.o: ../../include/openssl/symhacks.h ../../include/openssl/whrlpool.h | 601 | m_wp.o: ../../include/openssl/symhacks.h ../../include/openssl/whrlpool.h |
565 | m_wp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | 602 | m_wp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h |
566 | m_wp.o: ../cryptlib.h m_wp.c | 603 | m_wp.o: ../cryptlib.h evp_locl.h m_wp.c |
567 | names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 604 | names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
568 | names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 605 | names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
569 | names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 606 | names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
@@ -601,7 +638,8 @@ p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
601 | p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | 638 | p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h |
602 | p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | 639 | p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h |
603 | p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | 640 | p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h |
604 | p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_crpt2.c | 641 | p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h |
642 | p5_crpt2.o: p5_crpt2.c | ||
605 | p_dec.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h | 643 | p_dec.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h |
606 | p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 644 | p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
607 | p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 645 | p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
diff --git a/src/lib/libssl/src/crypto/evp/bio_md.c b/src/lib/libssl/src/crypto/evp/bio_md.c index 9841e32e1a..144fdfd56a 100644 --- a/src/lib/libssl/src/crypto/evp/bio_md.c +++ b/src/lib/libssl/src/crypto/evp/bio_md.c | |||
@@ -153,8 +153,12 @@ static int md_write(BIO *b, const char *in, int inl) | |||
153 | { | 153 | { |
154 | if (ret > 0) | 154 | if (ret > 0) |
155 | { | 155 | { |
156 | EVP_DigestUpdate(ctx,(const unsigned char *)in, | 156 | if (!EVP_DigestUpdate(ctx,(const unsigned char *)in, |
157 | (unsigned int)ret); | 157 | (unsigned int)ret)) |
158 | { | ||
159 | BIO_clear_retry_flags(b); | ||
160 | return 0; | ||
161 | } | ||
158 | } | 162 | } |
159 | } | 163 | } |
160 | if(b->next_bio != NULL) | 164 | if(b->next_bio != NULL) |
@@ -220,7 +224,8 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
220 | case BIO_CTRL_DUP: | 224 | case BIO_CTRL_DUP: |
221 | dbio=ptr; | 225 | dbio=ptr; |
222 | dctx=dbio->ptr; | 226 | dctx=dbio->ptr; |
223 | EVP_MD_CTX_copy_ex(dctx,ctx); | 227 | if (!EVP_MD_CTX_copy_ex(dctx,ctx)) |
228 | return 0; | ||
224 | b->init=1; | 229 | b->init=1; |
225 | break; | 230 | break; |
226 | default: | 231 | default: |
diff --git a/src/lib/libssl/src/crypto/evp/bio_ok.c b/src/lib/libssl/src/crypto/evp/bio_ok.c index 98bc1ab409..e64335353f 100644 --- a/src/lib/libssl/src/crypto/evp/bio_ok.c +++ b/src/lib/libssl/src/crypto/evp/bio_ok.c | |||
@@ -133,10 +133,10 @@ static int ok_new(BIO *h); | |||
133 | static int ok_free(BIO *data); | 133 | static int ok_free(BIO *data); |
134 | static long ok_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); | 134 | static long ok_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); |
135 | 135 | ||
136 | static void sig_out(BIO* b); | 136 | static int sig_out(BIO* b); |
137 | static void sig_in(BIO* b); | 137 | static int sig_in(BIO* b); |
138 | static void block_out(BIO* b); | 138 | static int block_out(BIO* b); |
139 | static void block_in(BIO* b); | 139 | static int block_in(BIO* b); |
140 | #define OK_BLOCK_SIZE (1024*4) | 140 | #define OK_BLOCK_SIZE (1024*4) |
141 | #define OK_BLOCK_BLOCK 4 | 141 | #define OK_BLOCK_BLOCK 4 |
142 | #define IOBS (OK_BLOCK_SIZE+ OK_BLOCK_BLOCK+ 3*EVP_MAX_MD_SIZE) | 142 | #define IOBS (OK_BLOCK_SIZE+ OK_BLOCK_BLOCK+ 3*EVP_MAX_MD_SIZE) |
@@ -266,10 +266,24 @@ static int ok_read(BIO *b, char *out, int outl) | |||
266 | ctx->buf_len+= i; | 266 | ctx->buf_len+= i; |
267 | 267 | ||
268 | /* no signature yet -- check if we got one */ | 268 | /* no signature yet -- check if we got one */ |
269 | if (ctx->sigio == 1) sig_in(b); | 269 | if (ctx->sigio == 1) |
270 | { | ||
271 | if (!sig_in(b)) | ||
272 | { | ||
273 | BIO_clear_retry_flags(b); | ||
274 | return 0; | ||
275 | } | ||
276 | } | ||
270 | 277 | ||
271 | /* signature ok -- check if we got block */ | 278 | /* signature ok -- check if we got block */ |
272 | if (ctx->sigio == 0) block_in(b); | 279 | if (ctx->sigio == 0) |
280 | { | ||
281 | if (!block_in(b)) | ||
282 | { | ||
283 | BIO_clear_retry_flags(b); | ||
284 | return 0; | ||
285 | } | ||
286 | } | ||
273 | 287 | ||
274 | /* invalid block -- cancel */ | 288 | /* invalid block -- cancel */ |
275 | if (ctx->cont <= 0) break; | 289 | if (ctx->cont <= 0) break; |
@@ -293,7 +307,8 @@ static int ok_write(BIO *b, const char *in, int inl) | |||
293 | 307 | ||
294 | if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0); | 308 | if ((ctx == NULL) || (b->next_bio == NULL) || (b->init == 0)) return(0); |
295 | 309 | ||
296 | if(ctx->sigio) sig_out(b); | 310 | if(ctx->sigio && !sig_out(b)) |
311 | return 0; | ||
297 | 312 | ||
298 | do{ | 313 | do{ |
299 | BIO_clear_retry_flags(b); | 314 | BIO_clear_retry_flags(b); |
@@ -332,7 +347,11 @@ static int ok_write(BIO *b, const char *in, int inl) | |||
332 | 347 | ||
333 | if(ctx->buf_len >= OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) | 348 | if(ctx->buf_len >= OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) |
334 | { | 349 | { |
335 | block_out(b); | 350 | if (!block_out(b)) |
351 | { | ||
352 | BIO_clear_retry_flags(b); | ||
353 | return 0; | ||
354 | } | ||
336 | } | 355 | } |
337 | }while(inl > 0); | 356 | }while(inl > 0); |
338 | 357 | ||
@@ -379,7 +398,8 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
379 | case BIO_CTRL_FLUSH: | 398 | case BIO_CTRL_FLUSH: |
380 | /* do a final write */ | 399 | /* do a final write */ |
381 | if(ctx->blockout == 0) | 400 | if(ctx->blockout == 0) |
382 | block_out(b); | 401 | if (!block_out(b)) |
402 | return 0; | ||
383 | 403 | ||
384 | while (ctx->blockout) | 404 | while (ctx->blockout) |
385 | { | 405 | { |
@@ -408,7 +428,8 @@ static long ok_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
408 | break; | 428 | break; |
409 | case BIO_C_SET_MD: | 429 | case BIO_C_SET_MD: |
410 | md=ptr; | 430 | md=ptr; |
411 | EVP_DigestInit_ex(&ctx->md, md, NULL); | 431 | if (!EVP_DigestInit_ex(&ctx->md, md, NULL)) |
432 | return 0; | ||
412 | b->init=1; | 433 | b->init=1; |
413 | break; | 434 | break; |
414 | case BIO_C_GET_MD: | 435 | case BIO_C_GET_MD: |
@@ -455,7 +476,7 @@ static void longswap(void *_ptr, size_t len) | |||
455 | } | 476 | } |
456 | } | 477 | } |
457 | 478 | ||
458 | static void sig_out(BIO* b) | 479 | static int sig_out(BIO* b) |
459 | { | 480 | { |
460 | BIO_OK_CTX *ctx; | 481 | BIO_OK_CTX *ctx; |
461 | EVP_MD_CTX *md; | 482 | EVP_MD_CTX *md; |
@@ -463,9 +484,10 @@ static void sig_out(BIO* b) | |||
463 | ctx=b->ptr; | 484 | ctx=b->ptr; |
464 | md=&ctx->md; | 485 | md=&ctx->md; |
465 | 486 | ||
466 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return; | 487 | if(ctx->buf_len+ 2* md->digest->md_size > OK_BLOCK_SIZE) return 1; |
467 | 488 | ||
468 | EVP_DigestInit_ex(md, md->digest, NULL); | 489 | if (!EVP_DigestInit_ex(md, md->digest, NULL)) |
490 | goto berr; | ||
469 | /* FIXME: there's absolutely no guarantee this makes any sense at all, | 491 | /* FIXME: there's absolutely no guarantee this makes any sense at all, |
470 | * particularly now EVP_MD_CTX has been restructured. | 492 | * particularly now EVP_MD_CTX has been restructured. |
471 | */ | 493 | */ |
@@ -474,14 +496,20 @@ static void sig_out(BIO* b) | |||
474 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); | 496 | longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); |
475 | ctx->buf_len+= md->digest->md_size; | 497 | ctx->buf_len+= md->digest->md_size; |
476 | 498 | ||
477 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); | 499 | if (!EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN))) |
478 | EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL); | 500 | goto berr; |
501 | if (!EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL)) | ||
502 | goto berr; | ||
479 | ctx->buf_len+= md->digest->md_size; | 503 | ctx->buf_len+= md->digest->md_size; |
480 | ctx->blockout= 1; | 504 | ctx->blockout= 1; |
481 | ctx->sigio= 0; | 505 | ctx->sigio= 0; |
506 | return 1; | ||
507 | berr: | ||
508 | BIO_clear_retry_flags(b); | ||
509 | return 0; | ||
482 | } | 510 | } |
483 | 511 | ||
484 | static void sig_in(BIO* b) | 512 | static int sig_in(BIO* b) |
485 | { | 513 | { |
486 | BIO_OK_CTX *ctx; | 514 | BIO_OK_CTX *ctx; |
487 | EVP_MD_CTX *md; | 515 | EVP_MD_CTX *md; |
@@ -491,15 +519,18 @@ static void sig_in(BIO* b) | |||
491 | ctx=b->ptr; | 519 | ctx=b->ptr; |
492 | md=&ctx->md; | 520 | md=&ctx->md; |
493 | 521 | ||
494 | if((int)(ctx->buf_len-ctx->buf_off) < 2*md->digest->md_size) return; | 522 | if((int)(ctx->buf_len-ctx->buf_off) < 2*md->digest->md_size) return 1; |
495 | 523 | ||
496 | EVP_DigestInit_ex(md, md->digest, NULL); | 524 | if (!EVP_DigestInit_ex(md, md->digest, NULL)) |
525 | goto berr; | ||
497 | memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size); | 526 | memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size); |
498 | longswap(md->md_data, md->digest->md_size); | 527 | longswap(md->md_data, md->digest->md_size); |
499 | ctx->buf_off+= md->digest->md_size; | 528 | ctx->buf_off+= md->digest->md_size; |
500 | 529 | ||
501 | EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN)); | 530 | if (!EVP_DigestUpdate(md, WELLKNOWN, strlen(WELLKNOWN))) |
502 | EVP_DigestFinal_ex(md, tmp, NULL); | 531 | goto berr; |
532 | if (!EVP_DigestFinal_ex(md, tmp, NULL)) | ||
533 | goto berr; | ||
503 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; | 534 | ret= memcmp(&(ctx->buf[ctx->buf_off]), tmp, md->digest->md_size) == 0; |
504 | ctx->buf_off+= md->digest->md_size; | 535 | ctx->buf_off+= md->digest->md_size; |
505 | if(ret == 1) | 536 | if(ret == 1) |
@@ -516,9 +547,13 @@ static void sig_in(BIO* b) | |||
516 | { | 547 | { |
517 | ctx->cont= 0; | 548 | ctx->cont= 0; |
518 | } | 549 | } |
550 | return 1; | ||
551 | berr: | ||
552 | BIO_clear_retry_flags(b); | ||
553 | return 0; | ||
519 | } | 554 | } |
520 | 555 | ||
521 | static void block_out(BIO* b) | 556 | static int block_out(BIO* b) |
522 | { | 557 | { |
523 | BIO_OK_CTX *ctx; | 558 | BIO_OK_CTX *ctx; |
524 | EVP_MD_CTX *md; | 559 | EVP_MD_CTX *md; |
@@ -532,13 +567,20 @@ static void block_out(BIO* b) | |||
532 | ctx->buf[1]=(unsigned char)(tl>>16); | 567 | ctx->buf[1]=(unsigned char)(tl>>16); |
533 | ctx->buf[2]=(unsigned char)(tl>>8); | 568 | ctx->buf[2]=(unsigned char)(tl>>8); |
534 | ctx->buf[3]=(unsigned char)(tl); | 569 | ctx->buf[3]=(unsigned char)(tl); |
535 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | 570 | if (!EVP_DigestUpdate(md, |
536 | EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL); | 571 | (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl)) |
572 | goto berr; | ||
573 | if (!EVP_DigestFinal_ex(md, &(ctx->buf[ctx->buf_len]), NULL)) | ||
574 | goto berr; | ||
537 | ctx->buf_len+= md->digest->md_size; | 575 | ctx->buf_len+= md->digest->md_size; |
538 | ctx->blockout= 1; | 576 | ctx->blockout= 1; |
577 | return 1; | ||
578 | berr: | ||
579 | BIO_clear_retry_flags(b); | ||
580 | return 0; | ||
539 | } | 581 | } |
540 | 582 | ||
541 | static void block_in(BIO* b) | 583 | static int block_in(BIO* b) |
542 | { | 584 | { |
543 | BIO_OK_CTX *ctx; | 585 | BIO_OK_CTX *ctx; |
544 | EVP_MD_CTX *md; | 586 | EVP_MD_CTX *md; |
@@ -554,10 +596,13 @@ static void block_in(BIO* b) | |||
554 | tl|=ctx->buf[2]; tl<<=8; | 596 | tl|=ctx->buf[2]; tl<<=8; |
555 | tl|=ctx->buf[3]; | 597 | tl|=ctx->buf[3]; |
556 | 598 | ||
557 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return; | 599 | if (ctx->buf_len < tl+ OK_BLOCK_BLOCK+ md->digest->md_size) return 1; |
558 | 600 | ||
559 | EVP_DigestUpdate(md, (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl); | 601 | if (!EVP_DigestUpdate(md, |
560 | EVP_DigestFinal_ex(md, tmp, NULL); | 602 | (unsigned char*) &(ctx->buf[OK_BLOCK_BLOCK]), tl)) |
603 | goto berr; | ||
604 | if (!EVP_DigestFinal_ex(md, tmp, NULL)) | ||
605 | goto berr; | ||
561 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) | 606 | if(memcmp(&(ctx->buf[tl+ OK_BLOCK_BLOCK]), tmp, md->digest->md_size) == 0) |
562 | { | 607 | { |
563 | /* there might be parts from next block lurking around ! */ | 608 | /* there might be parts from next block lurking around ! */ |
@@ -571,5 +616,9 @@ static void block_in(BIO* b) | |||
571 | { | 616 | { |
572 | ctx->cont= 0; | 617 | ctx->cont= 0; |
573 | } | 618 | } |
619 | return 1; | ||
620 | berr: | ||
621 | BIO_clear_retry_flags(b); | ||
622 | return 0; | ||
574 | } | 623 | } |
575 | 624 | ||
diff --git a/src/lib/libssl/src/crypto/evp/c_allc.c b/src/lib/libssl/src/crypto/evp/c_allc.c index c5f9268378..2a45d435e5 100644 --- a/src/lib/libssl/src/crypto/evp/c_allc.c +++ b/src/lib/libssl/src/crypto/evp/c_allc.c | |||
@@ -98,6 +98,9 @@ void OpenSSL_add_all_ciphers(void) | |||
98 | #ifndef OPENSSL_NO_RC4 | 98 | #ifndef OPENSSL_NO_RC4 |
99 | EVP_add_cipher(EVP_rc4()); | 99 | EVP_add_cipher(EVP_rc4()); |
100 | EVP_add_cipher(EVP_rc4_40()); | 100 | EVP_add_cipher(EVP_rc4_40()); |
101 | #ifndef OPENSSL_NO_MD5 | ||
102 | EVP_add_cipher(EVP_rc4_hmac_md5()); | ||
103 | #endif | ||
101 | #endif | 104 | #endif |
102 | 105 | ||
103 | #ifndef OPENSSL_NO_IDEA | 106 | #ifndef OPENSSL_NO_IDEA |
@@ -166,9 +169,9 @@ void OpenSSL_add_all_ciphers(void) | |||
166 | EVP_add_cipher(EVP_aes_128_cfb1()); | 169 | EVP_add_cipher(EVP_aes_128_cfb1()); |
167 | EVP_add_cipher(EVP_aes_128_cfb8()); | 170 | EVP_add_cipher(EVP_aes_128_cfb8()); |
168 | EVP_add_cipher(EVP_aes_128_ofb()); | 171 | EVP_add_cipher(EVP_aes_128_ofb()); |
169 | #if 0 | ||
170 | EVP_add_cipher(EVP_aes_128_ctr()); | 172 | EVP_add_cipher(EVP_aes_128_ctr()); |
171 | #endif | 173 | EVP_add_cipher(EVP_aes_128_gcm()); |
174 | EVP_add_cipher(EVP_aes_128_xts()); | ||
172 | EVP_add_cipher_alias(SN_aes_128_cbc,"AES128"); | 175 | EVP_add_cipher_alias(SN_aes_128_cbc,"AES128"); |
173 | EVP_add_cipher_alias(SN_aes_128_cbc,"aes128"); | 176 | EVP_add_cipher_alias(SN_aes_128_cbc,"aes128"); |
174 | EVP_add_cipher(EVP_aes_192_ecb()); | 177 | EVP_add_cipher(EVP_aes_192_ecb()); |
@@ -177,9 +180,8 @@ void OpenSSL_add_all_ciphers(void) | |||
177 | EVP_add_cipher(EVP_aes_192_cfb1()); | 180 | EVP_add_cipher(EVP_aes_192_cfb1()); |
178 | EVP_add_cipher(EVP_aes_192_cfb8()); | 181 | EVP_add_cipher(EVP_aes_192_cfb8()); |
179 | EVP_add_cipher(EVP_aes_192_ofb()); | 182 | EVP_add_cipher(EVP_aes_192_ofb()); |
180 | #if 0 | ||
181 | EVP_add_cipher(EVP_aes_192_ctr()); | 183 | EVP_add_cipher(EVP_aes_192_ctr()); |
182 | #endif | 184 | EVP_add_cipher(EVP_aes_192_gcm()); |
183 | EVP_add_cipher_alias(SN_aes_192_cbc,"AES192"); | 185 | EVP_add_cipher_alias(SN_aes_192_cbc,"AES192"); |
184 | EVP_add_cipher_alias(SN_aes_192_cbc,"aes192"); | 186 | EVP_add_cipher_alias(SN_aes_192_cbc,"aes192"); |
185 | EVP_add_cipher(EVP_aes_256_ecb()); | 187 | EVP_add_cipher(EVP_aes_256_ecb()); |
@@ -188,11 +190,15 @@ void OpenSSL_add_all_ciphers(void) | |||
188 | EVP_add_cipher(EVP_aes_256_cfb1()); | 190 | EVP_add_cipher(EVP_aes_256_cfb1()); |
189 | EVP_add_cipher(EVP_aes_256_cfb8()); | 191 | EVP_add_cipher(EVP_aes_256_cfb8()); |
190 | EVP_add_cipher(EVP_aes_256_ofb()); | 192 | EVP_add_cipher(EVP_aes_256_ofb()); |
191 | #if 0 | ||
192 | EVP_add_cipher(EVP_aes_256_ctr()); | 193 | EVP_add_cipher(EVP_aes_256_ctr()); |
193 | #endif | 194 | EVP_add_cipher(EVP_aes_256_gcm()); |
195 | EVP_add_cipher(EVP_aes_256_xts()); | ||
194 | EVP_add_cipher_alias(SN_aes_256_cbc,"AES256"); | 196 | EVP_add_cipher_alias(SN_aes_256_cbc,"AES256"); |
195 | EVP_add_cipher_alias(SN_aes_256_cbc,"aes256"); | 197 | EVP_add_cipher_alias(SN_aes_256_cbc,"aes256"); |
198 | #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) | ||
199 | EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1()); | ||
200 | EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1()); | ||
201 | #endif | ||
196 | #endif | 202 | #endif |
197 | 203 | ||
198 | #ifndef OPENSSL_NO_CAMELLIA | 204 | #ifndef OPENSSL_NO_CAMELLIA |
diff --git a/src/lib/libssl/src/crypto/evp/digest.c b/src/lib/libssl/src/crypto/evp/digest.c index 982ba2b136..467e6b5ae9 100644 --- a/src/lib/libssl/src/crypto/evp/digest.c +++ b/src/lib/libssl/src/crypto/evp/digest.c | |||
@@ -117,6 +117,10 @@ | |||
117 | #include <openssl/engine.h> | 117 | #include <openssl/engine.h> |
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | #ifdef OPENSSL_FIPS | ||
121 | #include <openssl/fips.h> | ||
122 | #endif | ||
123 | |||
120 | void EVP_MD_CTX_init(EVP_MD_CTX *ctx) | 124 | void EVP_MD_CTX_init(EVP_MD_CTX *ctx) |
121 | { | 125 | { |
122 | memset(ctx,'\0',sizeof *ctx); | 126 | memset(ctx,'\0',sizeof *ctx); |
@@ -225,12 +229,26 @@ skip_to_init: | |||
225 | } | 229 | } |
226 | if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) | 230 | if (ctx->flags & EVP_MD_CTX_FLAG_NO_INIT) |
227 | return 1; | 231 | return 1; |
232 | #ifdef OPENSSL_FIPS | ||
233 | if (FIPS_mode()) | ||
234 | { | ||
235 | if (FIPS_digestinit(ctx, type)) | ||
236 | return 1; | ||
237 | OPENSSL_free(ctx->md_data); | ||
238 | ctx->md_data = NULL; | ||
239 | return 0; | ||
240 | } | ||
241 | #endif | ||
228 | return ctx->digest->init(ctx); | 242 | return ctx->digest->init(ctx); |
229 | } | 243 | } |
230 | 244 | ||
231 | int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count) | 245 | int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count) |
232 | { | 246 | { |
247 | #ifdef OPENSSL_FIPS | ||
248 | return FIPS_digestupdate(ctx, data, count); | ||
249 | #else | ||
233 | return ctx->update(ctx,data,count); | 250 | return ctx->update(ctx,data,count); |
251 | #endif | ||
234 | } | 252 | } |
235 | 253 | ||
236 | /* The caller can assume that this removes any secret data from the context */ | 254 | /* The caller can assume that this removes any secret data from the context */ |
@@ -245,8 +263,10 @@ int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | |||
245 | /* The caller can assume that this removes any secret data from the context */ | 263 | /* The caller can assume that this removes any secret data from the context */ |
246 | int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | 264 | int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) |
247 | { | 265 | { |
266 | #ifdef OPENSSL_FIPS | ||
267 | return FIPS_digestfinal(ctx, md, size); | ||
268 | #else | ||
248 | int ret; | 269 | int ret; |
249 | |||
250 | OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); | 270 | OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); |
251 | ret=ctx->digest->final(ctx,md); | 271 | ret=ctx->digest->final(ctx,md); |
252 | if (size != NULL) | 272 | if (size != NULL) |
@@ -258,6 +278,7 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | |||
258 | } | 278 | } |
259 | memset(ctx->md_data,0,ctx->digest->ctx_size); | 279 | memset(ctx->md_data,0,ctx->digest->ctx_size); |
260 | return ret; | 280 | return ret; |
281 | #endif | ||
261 | } | 282 | } |
262 | 283 | ||
263 | int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) | 284 | int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) |
@@ -351,6 +372,7 @@ void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) | |||
351 | /* This call frees resources associated with the context */ | 372 | /* This call frees resources associated with the context */ |
352 | int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) | 373 | int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) |
353 | { | 374 | { |
375 | #ifndef OPENSSL_FIPS | ||
354 | /* Don't assume ctx->md_data was cleaned in EVP_Digest_Final, | 376 | /* Don't assume ctx->md_data was cleaned in EVP_Digest_Final, |
355 | * because sometimes only copies of the context are ever finalised. | 377 | * because sometimes only copies of the context are ever finalised. |
356 | */ | 378 | */ |
@@ -363,6 +385,7 @@ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) | |||
363 | OPENSSL_cleanse(ctx->md_data,ctx->digest->ctx_size); | 385 | OPENSSL_cleanse(ctx->md_data,ctx->digest->ctx_size); |
364 | OPENSSL_free(ctx->md_data); | 386 | OPENSSL_free(ctx->md_data); |
365 | } | 387 | } |
388 | #endif | ||
366 | if (ctx->pctx) | 389 | if (ctx->pctx) |
367 | EVP_PKEY_CTX_free(ctx->pctx); | 390 | EVP_PKEY_CTX_free(ctx->pctx); |
368 | #ifndef OPENSSL_NO_ENGINE | 391 | #ifndef OPENSSL_NO_ENGINE |
@@ -371,6 +394,9 @@ int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) | |||
371 | * functional reference we held for this reason. */ | 394 | * functional reference we held for this reason. */ |
372 | ENGINE_finish(ctx->engine); | 395 | ENGINE_finish(ctx->engine); |
373 | #endif | 396 | #endif |
397 | #ifdef OPENSSL_FIPS | ||
398 | FIPS_md_ctx_cleanup(ctx); | ||
399 | #endif | ||
374 | memset(ctx,'\0',sizeof *ctx); | 400 | memset(ctx,'\0',sizeof *ctx); |
375 | 401 | ||
376 | return 1; | 402 | return 1; |
diff --git a/src/lib/libssl/src/crypto/evp/e_aes.c b/src/lib/libssl/src/crypto/evp/e_aes.c index bd6c0a3a62..1e4af0cb75 100644 --- a/src/lib/libssl/src/crypto/evp/e_aes.c +++ b/src/lib/libssl/src/crypto/evp/e_aes.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* ==================================================================== | 1 | /* ==================================================================== |
2 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | 2 | * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. |
3 | * | 3 | * |
4 | * Redistribution and use in source and binary forms, with or without | 4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions | 5 | * modification, are permitted provided that the following conditions |
@@ -56,57 +56,511 @@ | |||
56 | #include <assert.h> | 56 | #include <assert.h> |
57 | #include <openssl/aes.h> | 57 | #include <openssl/aes.h> |
58 | #include "evp_locl.h" | 58 | #include "evp_locl.h" |
59 | 59 | #ifndef OPENSSL_FIPS | |
60 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 60 | #include "modes_lcl.h" |
61 | const unsigned char *iv, int enc); | 61 | #include <openssl/rand.h> |
62 | 62 | ||
63 | typedef struct | 63 | typedef struct |
64 | { | 64 | { |
65 | AES_KEY ks; | 65 | AES_KEY ks; |
66 | block128_f block; | ||
67 | union { | ||
68 | cbc128_f cbc; | ||
69 | ctr128_f ctr; | ||
70 | } stream; | ||
66 | } EVP_AES_KEY; | 71 | } EVP_AES_KEY; |
67 | 72 | ||
68 | #define data(ctx) EVP_C_DATA(EVP_AES_KEY,ctx) | 73 | typedef struct |
69 | 74 | { | |
70 | IMPLEMENT_BLOCK_CIPHER(aes_128, ks, AES, EVP_AES_KEY, | 75 | AES_KEY ks; /* AES key schedule to use */ |
71 | NID_aes_128, 16, 16, 16, 128, | 76 | int key_set; /* Set if key initialised */ |
72 | 0, aes_init_key, NULL, | 77 | int iv_set; /* Set if an iv is set */ |
73 | EVP_CIPHER_set_asn1_iv, | 78 | GCM128_CONTEXT gcm; |
74 | EVP_CIPHER_get_asn1_iv, | 79 | unsigned char *iv; /* Temporary IV store */ |
75 | NULL) | 80 | int ivlen; /* IV length */ |
76 | IMPLEMENT_BLOCK_CIPHER(aes_192, ks, AES, EVP_AES_KEY, | 81 | int taglen; |
77 | NID_aes_192, 16, 24, 16, 128, | 82 | int iv_gen; /* It is OK to generate IVs */ |
78 | 0, aes_init_key, NULL, | 83 | int tls_aad_len; /* TLS AAD length */ |
79 | EVP_CIPHER_set_asn1_iv, | 84 | ctr128_f ctr; |
80 | EVP_CIPHER_get_asn1_iv, | 85 | } EVP_AES_GCM_CTX; |
81 | NULL) | 86 | |
82 | IMPLEMENT_BLOCK_CIPHER(aes_256, ks, AES, EVP_AES_KEY, | 87 | typedef struct |
83 | NID_aes_256, 16, 32, 16, 128, | 88 | { |
84 | 0, aes_init_key, NULL, | 89 | AES_KEY ks1, ks2; /* AES key schedules to use */ |
85 | EVP_CIPHER_set_asn1_iv, | 90 | XTS128_CONTEXT xts; |
86 | EVP_CIPHER_get_asn1_iv, | 91 | void (*stream)(const unsigned char *in, |
87 | NULL) | 92 | unsigned char *out, size_t length, |
88 | 93 | const AES_KEY *key1, const AES_KEY *key2, | |
89 | #define IMPLEMENT_AES_CFBR(ksize,cbits) IMPLEMENT_CFBR(aes,AES,EVP_AES_KEY,ks,ksize,cbits,16) | 94 | const unsigned char iv[16]); |
90 | 95 | } EVP_AES_XTS_CTX; | |
91 | IMPLEMENT_AES_CFBR(128,1) | 96 | |
92 | IMPLEMENT_AES_CFBR(192,1) | 97 | typedef struct |
93 | IMPLEMENT_AES_CFBR(256,1) | 98 | { |
94 | 99 | AES_KEY ks; /* AES key schedule to use */ | |
95 | IMPLEMENT_AES_CFBR(128,8) | 100 | int key_set; /* Set if key initialised */ |
96 | IMPLEMENT_AES_CFBR(192,8) | 101 | int iv_set; /* Set if an iv is set */ |
97 | IMPLEMENT_AES_CFBR(256,8) | 102 | int tag_set; /* Set if tag is valid */ |
103 | int len_set; /* Set if message length set */ | ||
104 | int L, M; /* L and M parameters from RFC3610 */ | ||
105 | CCM128_CONTEXT ccm; | ||
106 | ccm128_f str; | ||
107 | } EVP_AES_CCM_CTX; | ||
108 | |||
109 | #define MAXBITCHUNK ((size_t)1<<(sizeof(size_t)*8-4)) | ||
110 | |||
111 | #ifdef VPAES_ASM | ||
112 | int vpaes_set_encrypt_key(const unsigned char *userKey, int bits, | ||
113 | AES_KEY *key); | ||
114 | int vpaes_set_decrypt_key(const unsigned char *userKey, int bits, | ||
115 | AES_KEY *key); | ||
116 | |||
117 | void vpaes_encrypt(const unsigned char *in, unsigned char *out, | ||
118 | const AES_KEY *key); | ||
119 | void vpaes_decrypt(const unsigned char *in, unsigned char *out, | ||
120 | const AES_KEY *key); | ||
121 | |||
122 | void vpaes_cbc_encrypt(const unsigned char *in, | ||
123 | unsigned char *out, | ||
124 | size_t length, | ||
125 | const AES_KEY *key, | ||
126 | unsigned char *ivec, int enc); | ||
127 | #endif | ||
128 | #ifdef BSAES_ASM | ||
129 | void bsaes_cbc_encrypt(const unsigned char *in, unsigned char *out, | ||
130 | size_t length, const AES_KEY *key, | ||
131 | unsigned char ivec[16], int enc); | ||
132 | void bsaes_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out, | ||
133 | size_t len, const AES_KEY *key, | ||
134 | const unsigned char ivec[16]); | ||
135 | void bsaes_xts_encrypt(const unsigned char *inp, unsigned char *out, | ||
136 | size_t len, const AES_KEY *key1, | ||
137 | const AES_KEY *key2, const unsigned char iv[16]); | ||
138 | void bsaes_xts_decrypt(const unsigned char *inp, unsigned char *out, | ||
139 | size_t len, const AES_KEY *key1, | ||
140 | const AES_KEY *key2, const unsigned char iv[16]); | ||
141 | #endif | ||
142 | #ifdef AES_CTR_ASM | ||
143 | void AES_ctr32_encrypt(const unsigned char *in, unsigned char *out, | ||
144 | size_t blocks, const AES_KEY *key, | ||
145 | const unsigned char ivec[AES_BLOCK_SIZE]); | ||
146 | #endif | ||
147 | #ifdef AES_XTS_ASM | ||
148 | void AES_xts_encrypt(const char *inp,char *out,size_t len, | ||
149 | const AES_KEY *key1, const AES_KEY *key2, | ||
150 | const unsigned char iv[16]); | ||
151 | void AES_xts_decrypt(const char *inp,char *out,size_t len, | ||
152 | const AES_KEY *key1, const AES_KEY *key2, | ||
153 | const unsigned char iv[16]); | ||
154 | #endif | ||
155 | |||
156 | #if defined(AES_ASM) && !defined(I386_ONLY) && ( \ | ||
157 | ((defined(__i386) || defined(__i386__) || \ | ||
158 | defined(_M_IX86)) && defined(OPENSSL_IA32_SSE2))|| \ | ||
159 | defined(__x86_64) || defined(__x86_64__) || \ | ||
160 | defined(_M_AMD64) || defined(_M_X64) || \ | ||
161 | defined(__INTEL__) ) | ||
162 | |||
163 | extern unsigned int OPENSSL_ia32cap_P[2]; | ||
164 | |||
165 | #ifdef VPAES_ASM | ||
166 | #define VPAES_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(41-32))) | ||
167 | #endif | ||
168 | #ifdef BSAES_ASM | ||
169 | #define BSAES_CAPABLE VPAES_CAPABLE | ||
170 | #endif | ||
171 | /* | ||
172 | * AES-NI section | ||
173 | */ | ||
174 | #define AESNI_CAPABLE (OPENSSL_ia32cap_P[1]&(1<<(57-32))) | ||
175 | |||
176 | int aesni_set_encrypt_key(const unsigned char *userKey, int bits, | ||
177 | AES_KEY *key); | ||
178 | int aesni_set_decrypt_key(const unsigned char *userKey, int bits, | ||
179 | AES_KEY *key); | ||
180 | |||
181 | void aesni_encrypt(const unsigned char *in, unsigned char *out, | ||
182 | const AES_KEY *key); | ||
183 | void aesni_decrypt(const unsigned char *in, unsigned char *out, | ||
184 | const AES_KEY *key); | ||
185 | |||
186 | void aesni_ecb_encrypt(const unsigned char *in, | ||
187 | unsigned char *out, | ||
188 | size_t length, | ||
189 | const AES_KEY *key, | ||
190 | int enc); | ||
191 | void aesni_cbc_encrypt(const unsigned char *in, | ||
192 | unsigned char *out, | ||
193 | size_t length, | ||
194 | const AES_KEY *key, | ||
195 | unsigned char *ivec, int enc); | ||
196 | |||
197 | void aesni_ctr32_encrypt_blocks(const unsigned char *in, | ||
198 | unsigned char *out, | ||
199 | size_t blocks, | ||
200 | const void *key, | ||
201 | const unsigned char *ivec); | ||
202 | |||
203 | void aesni_xts_encrypt(const unsigned char *in, | ||
204 | unsigned char *out, | ||
205 | size_t length, | ||
206 | const AES_KEY *key1, const AES_KEY *key2, | ||
207 | const unsigned char iv[16]); | ||
208 | |||
209 | void aesni_xts_decrypt(const unsigned char *in, | ||
210 | unsigned char *out, | ||
211 | size_t length, | ||
212 | const AES_KEY *key1, const AES_KEY *key2, | ||
213 | const unsigned char iv[16]); | ||
214 | |||
215 | void aesni_ccm64_encrypt_blocks (const unsigned char *in, | ||
216 | unsigned char *out, | ||
217 | size_t blocks, | ||
218 | const void *key, | ||
219 | const unsigned char ivec[16], | ||
220 | unsigned char cmac[16]); | ||
221 | |||
222 | void aesni_ccm64_decrypt_blocks (const unsigned char *in, | ||
223 | unsigned char *out, | ||
224 | size_t blocks, | ||
225 | const void *key, | ||
226 | const unsigned char ivec[16], | ||
227 | unsigned char cmac[16]); | ||
228 | |||
229 | static int aesni_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
230 | const unsigned char *iv, int enc) | ||
231 | { | ||
232 | int ret, mode; | ||
233 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
234 | |||
235 | mode = ctx->cipher->flags & EVP_CIPH_MODE; | ||
236 | if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) | ||
237 | && !enc) | ||
238 | { | ||
239 | ret = aesni_set_decrypt_key(key, ctx->key_len*8, ctx->cipher_data); | ||
240 | dat->block = (block128_f)aesni_decrypt; | ||
241 | dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? | ||
242 | (cbc128_f)aesni_cbc_encrypt : | ||
243 | NULL; | ||
244 | } | ||
245 | else { | ||
246 | ret = aesni_set_encrypt_key(key, ctx->key_len*8, ctx->cipher_data); | ||
247 | dat->block = (block128_f)aesni_encrypt; | ||
248 | if (mode==EVP_CIPH_CBC_MODE) | ||
249 | dat->stream.cbc = (cbc128_f)aesni_cbc_encrypt; | ||
250 | else if (mode==EVP_CIPH_CTR_MODE) | ||
251 | dat->stream.ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; | ||
252 | else | ||
253 | dat->stream.cbc = NULL; | ||
254 | } | ||
255 | |||
256 | if(ret < 0) | ||
257 | { | ||
258 | EVPerr(EVP_F_AESNI_INIT_KEY,EVP_R_AES_KEY_SETUP_FAILED); | ||
259 | return 0; | ||
260 | } | ||
261 | |||
262 | return 1; | ||
263 | } | ||
264 | |||
265 | static int aesni_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
266 | const unsigned char *in, size_t len) | ||
267 | { | ||
268 | aesni_cbc_encrypt(in,out,len,ctx->cipher_data,ctx->iv,ctx->encrypt); | ||
269 | |||
270 | return 1; | ||
271 | } | ||
272 | |||
273 | static int aesni_ecb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
274 | const unsigned char *in, size_t len) | ||
275 | { | ||
276 | size_t bl = ctx->cipher->block_size; | ||
277 | |||
278 | if (len<bl) return 1; | ||
279 | |||
280 | aesni_ecb_encrypt(in,out,len,ctx->cipher_data,ctx->encrypt); | ||
281 | |||
282 | return 1; | ||
283 | } | ||
284 | |||
285 | #define aesni_ofb_cipher aes_ofb_cipher | ||
286 | static int aesni_ofb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
287 | const unsigned char *in,size_t len); | ||
288 | |||
289 | #define aesni_cfb_cipher aes_cfb_cipher | ||
290 | static int aesni_cfb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
291 | const unsigned char *in,size_t len); | ||
292 | |||
293 | #define aesni_cfb8_cipher aes_cfb8_cipher | ||
294 | static int aesni_cfb8_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
295 | const unsigned char *in,size_t len); | ||
296 | |||
297 | #define aesni_cfb1_cipher aes_cfb1_cipher | ||
298 | static int aesni_cfb1_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
299 | const unsigned char *in,size_t len); | ||
300 | |||
301 | #define aesni_ctr_cipher aes_ctr_cipher | ||
302 | static int aesni_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
303 | const unsigned char *in, size_t len); | ||
304 | |||
305 | static int aesni_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
306 | const unsigned char *iv, int enc) | ||
307 | { | ||
308 | EVP_AES_GCM_CTX *gctx = ctx->cipher_data; | ||
309 | if (!iv && !key) | ||
310 | return 1; | ||
311 | if (key) | ||
312 | { | ||
313 | aesni_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks); | ||
314 | CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, | ||
315 | (block128_f)aesni_encrypt); | ||
316 | gctx->ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; | ||
317 | /* If we have an iv can set it directly, otherwise use | ||
318 | * saved IV. | ||
319 | */ | ||
320 | if (iv == NULL && gctx->iv_set) | ||
321 | iv = gctx->iv; | ||
322 | if (iv) | ||
323 | { | ||
324 | CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); | ||
325 | gctx->iv_set = 1; | ||
326 | } | ||
327 | gctx->key_set = 1; | ||
328 | } | ||
329 | else | ||
330 | { | ||
331 | /* If key set use IV, otherwise copy */ | ||
332 | if (gctx->key_set) | ||
333 | CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); | ||
334 | else | ||
335 | memcpy(gctx->iv, iv, gctx->ivlen); | ||
336 | gctx->iv_set = 1; | ||
337 | gctx->iv_gen = 0; | ||
338 | } | ||
339 | return 1; | ||
340 | } | ||
341 | |||
342 | #define aesni_gcm_cipher aes_gcm_cipher | ||
343 | static int aesni_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
344 | const unsigned char *in, size_t len); | ||
345 | |||
346 | static int aesni_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
347 | const unsigned char *iv, int enc) | ||
348 | { | ||
349 | EVP_AES_XTS_CTX *xctx = ctx->cipher_data; | ||
350 | if (!iv && !key) | ||
351 | return 1; | ||
352 | |||
353 | if (key) | ||
354 | { | ||
355 | /* key_len is two AES keys */ | ||
356 | if (enc) | ||
357 | { | ||
358 | aesni_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1); | ||
359 | xctx->xts.block1 = (block128_f)aesni_encrypt; | ||
360 | xctx->stream = aesni_xts_encrypt; | ||
361 | } | ||
362 | else | ||
363 | { | ||
364 | aesni_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1); | ||
365 | xctx->xts.block1 = (block128_f)aesni_decrypt; | ||
366 | xctx->stream = aesni_xts_decrypt; | ||
367 | } | ||
368 | |||
369 | aesni_set_encrypt_key(key + ctx->key_len/2, | ||
370 | ctx->key_len * 4, &xctx->ks2); | ||
371 | xctx->xts.block2 = (block128_f)aesni_encrypt; | ||
372 | |||
373 | xctx->xts.key1 = &xctx->ks1; | ||
374 | } | ||
375 | |||
376 | if (iv) | ||
377 | { | ||
378 | xctx->xts.key2 = &xctx->ks2; | ||
379 | memcpy(ctx->iv, iv, 16); | ||
380 | } | ||
381 | |||
382 | return 1; | ||
383 | } | ||
384 | |||
385 | #define aesni_xts_cipher aes_xts_cipher | ||
386 | static int aesni_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
387 | const unsigned char *in, size_t len); | ||
388 | |||
389 | static int aesni_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
390 | const unsigned char *iv, int enc) | ||
391 | { | ||
392 | EVP_AES_CCM_CTX *cctx = ctx->cipher_data; | ||
393 | if (!iv && !key) | ||
394 | return 1; | ||
395 | if (key) | ||
396 | { | ||
397 | aesni_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks); | ||
398 | CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, | ||
399 | &cctx->ks, (block128_f)aesni_encrypt); | ||
400 | cctx->str = enc?(ccm128_f)aesni_ccm64_encrypt_blocks : | ||
401 | (ccm128_f)aesni_ccm64_decrypt_blocks; | ||
402 | cctx->key_set = 1; | ||
403 | } | ||
404 | if (iv) | ||
405 | { | ||
406 | memcpy(ctx->iv, iv, 15 - cctx->L); | ||
407 | cctx->iv_set = 1; | ||
408 | } | ||
409 | return 1; | ||
410 | } | ||
411 | |||
412 | #define aesni_ccm_cipher aes_ccm_cipher | ||
413 | static int aesni_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
414 | const unsigned char *in, size_t len); | ||
415 | |||
416 | #define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ | ||
417 | static const EVP_CIPHER aesni_##keylen##_##mode = { \ | ||
418 | nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \ | ||
419 | flags|EVP_CIPH_##MODE##_MODE, \ | ||
420 | aesni_init_key, \ | ||
421 | aesni_##mode##_cipher, \ | ||
422 | NULL, \ | ||
423 | sizeof(EVP_AES_KEY), \ | ||
424 | NULL,NULL,NULL,NULL }; \ | ||
425 | static const EVP_CIPHER aes_##keylen##_##mode = { \ | ||
426 | nid##_##keylen##_##nmode,blocksize, \ | ||
427 | keylen/8,ivlen, \ | ||
428 | flags|EVP_CIPH_##MODE##_MODE, \ | ||
429 | aes_init_key, \ | ||
430 | aes_##mode##_cipher, \ | ||
431 | NULL, \ | ||
432 | sizeof(EVP_AES_KEY), \ | ||
433 | NULL,NULL,NULL,NULL }; \ | ||
434 | const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ | ||
435 | { return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; } | ||
436 | |||
437 | #define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ | ||
438 | static const EVP_CIPHER aesni_##keylen##_##mode = { \ | ||
439 | nid##_##keylen##_##mode,blocksize, \ | ||
440 | (EVP_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE?2:1)*keylen/8, ivlen, \ | ||
441 | flags|EVP_CIPH_##MODE##_MODE, \ | ||
442 | aesni_##mode##_init_key, \ | ||
443 | aesni_##mode##_cipher, \ | ||
444 | aes_##mode##_cleanup, \ | ||
445 | sizeof(EVP_AES_##MODE##_CTX), \ | ||
446 | NULL,NULL,aes_##mode##_ctrl,NULL }; \ | ||
447 | static const EVP_CIPHER aes_##keylen##_##mode = { \ | ||
448 | nid##_##keylen##_##mode,blocksize, \ | ||
449 | (EVP_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE?2:1)*keylen/8, ivlen, \ | ||
450 | flags|EVP_CIPH_##MODE##_MODE, \ | ||
451 | aes_##mode##_init_key, \ | ||
452 | aes_##mode##_cipher, \ | ||
453 | aes_##mode##_cleanup, \ | ||
454 | sizeof(EVP_AES_##MODE##_CTX), \ | ||
455 | NULL,NULL,aes_##mode##_ctrl,NULL }; \ | ||
456 | const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ | ||
457 | { return AESNI_CAPABLE?&aesni_##keylen##_##mode:&aes_##keylen##_##mode; } | ||
458 | |||
459 | #else | ||
460 | |||
461 | #define BLOCK_CIPHER_generic(nid,keylen,blocksize,ivlen,nmode,mode,MODE,flags) \ | ||
462 | static const EVP_CIPHER aes_##keylen##_##mode = { \ | ||
463 | nid##_##keylen##_##nmode,blocksize,keylen/8,ivlen, \ | ||
464 | flags|EVP_CIPH_##MODE##_MODE, \ | ||
465 | aes_init_key, \ | ||
466 | aes_##mode##_cipher, \ | ||
467 | NULL, \ | ||
468 | sizeof(EVP_AES_KEY), \ | ||
469 | NULL,NULL,NULL,NULL }; \ | ||
470 | const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ | ||
471 | { return &aes_##keylen##_##mode; } | ||
472 | |||
473 | #define BLOCK_CIPHER_custom(nid,keylen,blocksize,ivlen,mode,MODE,flags) \ | ||
474 | static const EVP_CIPHER aes_##keylen##_##mode = { \ | ||
475 | nid##_##keylen##_##mode,blocksize, \ | ||
476 | (EVP_CIPH_##MODE##_MODE==EVP_CIPH_XTS_MODE?2:1)*keylen/8, ivlen, \ | ||
477 | flags|EVP_CIPH_##MODE##_MODE, \ | ||
478 | aes_##mode##_init_key, \ | ||
479 | aes_##mode##_cipher, \ | ||
480 | aes_##mode##_cleanup, \ | ||
481 | sizeof(EVP_AES_##MODE##_CTX), \ | ||
482 | NULL,NULL,aes_##mode##_ctrl,NULL }; \ | ||
483 | const EVP_CIPHER *EVP_aes_##keylen##_##mode(void) \ | ||
484 | { return &aes_##keylen##_##mode; } | ||
485 | #endif | ||
486 | |||
487 | #define BLOCK_CIPHER_generic_pack(nid,keylen,flags) \ | ||
488 | BLOCK_CIPHER_generic(nid,keylen,16,16,cbc,cbc,CBC,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \ | ||
489 | BLOCK_CIPHER_generic(nid,keylen,16,0,ecb,ecb,ECB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \ | ||
490 | BLOCK_CIPHER_generic(nid,keylen,1,16,ofb128,ofb,OFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \ | ||
491 | BLOCK_CIPHER_generic(nid,keylen,1,16,cfb128,cfb,CFB,flags|EVP_CIPH_FLAG_DEFAULT_ASN1) \ | ||
492 | BLOCK_CIPHER_generic(nid,keylen,1,16,cfb1,cfb1,CFB,flags) \ | ||
493 | BLOCK_CIPHER_generic(nid,keylen,1,16,cfb8,cfb8,CFB,flags) \ | ||
494 | BLOCK_CIPHER_generic(nid,keylen,1,16,ctr,ctr,CTR,flags) | ||
98 | 495 | ||
99 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 496 | static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
100 | const unsigned char *iv, int enc) | 497 | const unsigned char *iv, int enc) |
101 | { | 498 | { |
102 | int ret; | 499 | int ret, mode; |
500 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
103 | 501 | ||
104 | if ((ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_CFB_MODE | 502 | mode = ctx->cipher->flags & EVP_CIPH_MODE; |
105 | || (ctx->cipher->flags & EVP_CIPH_MODE) == EVP_CIPH_OFB_MODE | 503 | if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) |
106 | || enc) | 504 | && !enc) |
107 | ret=AES_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data); | 505 | #ifdef BSAES_CAPABLE |
506 | if (BSAES_CAPABLE && mode==EVP_CIPH_CBC_MODE) | ||
507 | { | ||
508 | ret = AES_set_decrypt_key(key,ctx->key_len*8,&dat->ks); | ||
509 | dat->block = (block128_f)AES_decrypt; | ||
510 | dat->stream.cbc = (cbc128_f)bsaes_cbc_encrypt; | ||
511 | } | ||
512 | else | ||
513 | #endif | ||
514 | #ifdef VPAES_CAPABLE | ||
515 | if (VPAES_CAPABLE) | ||
516 | { | ||
517 | ret = vpaes_set_decrypt_key(key,ctx->key_len*8,&dat->ks); | ||
518 | dat->block = (block128_f)vpaes_decrypt; | ||
519 | dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? | ||
520 | (cbc128_f)vpaes_cbc_encrypt : | ||
521 | NULL; | ||
522 | } | ||
523 | else | ||
524 | #endif | ||
525 | { | ||
526 | ret = AES_set_decrypt_key(key,ctx->key_len*8,&dat->ks); | ||
527 | dat->block = (block128_f)AES_decrypt; | ||
528 | dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? | ||
529 | (cbc128_f)AES_cbc_encrypt : | ||
530 | NULL; | ||
531 | } | ||
108 | else | 532 | else |
109 | ret=AES_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data); | 533 | #ifdef BSAES_CAPABLE |
534 | if (BSAES_CAPABLE && mode==EVP_CIPH_CTR_MODE) | ||
535 | { | ||
536 | ret = AES_set_encrypt_key(key,ctx->key_len*8,&dat->ks); | ||
537 | dat->block = (block128_f)AES_encrypt; | ||
538 | dat->stream.ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; | ||
539 | } | ||
540 | else | ||
541 | #endif | ||
542 | #ifdef VPAES_CAPABLE | ||
543 | if (VPAES_CAPABLE) | ||
544 | { | ||
545 | ret = vpaes_set_encrypt_key(key,ctx->key_len*8,&dat->ks); | ||
546 | dat->block = (block128_f)vpaes_encrypt; | ||
547 | dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? | ||
548 | (cbc128_f)vpaes_cbc_encrypt : | ||
549 | NULL; | ||
550 | } | ||
551 | else | ||
552 | #endif | ||
553 | { | ||
554 | ret = AES_set_encrypt_key(key,ctx->key_len*8,&dat->ks); | ||
555 | dat->block = (block128_f)AES_encrypt; | ||
556 | dat->stream.cbc = mode==EVP_CIPH_CBC_MODE ? | ||
557 | (cbc128_f)AES_cbc_encrypt : | ||
558 | NULL; | ||
559 | #ifdef AES_CTR_ASM | ||
560 | if (mode==EVP_CIPH_CTR_MODE) | ||
561 | dat->stream.ctr = (ctr128_f)AES_ctr32_encrypt; | ||
562 | #endif | ||
563 | } | ||
110 | 564 | ||
111 | if(ret < 0) | 565 | if(ret < 0) |
112 | { | 566 | { |
@@ -117,4 +571,743 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | |||
117 | return 1; | 571 | return 1; |
118 | } | 572 | } |
119 | 573 | ||
574 | static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
575 | const unsigned char *in, size_t len) | ||
576 | { | ||
577 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
578 | |||
579 | if (dat->stream.cbc) | ||
580 | (*dat->stream.cbc)(in,out,len,&dat->ks,ctx->iv,ctx->encrypt); | ||
581 | else if (ctx->encrypt) | ||
582 | CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block); | ||
583 | else | ||
584 | CRYPTO_cbc128_encrypt(in,out,len,&dat->ks,ctx->iv,dat->block); | ||
585 | |||
586 | return 1; | ||
587 | } | ||
588 | |||
589 | static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
590 | const unsigned char *in, size_t len) | ||
591 | { | ||
592 | size_t bl = ctx->cipher->block_size; | ||
593 | size_t i; | ||
594 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
595 | |||
596 | if (len<bl) return 1; | ||
597 | |||
598 | for (i=0,len-=bl;i<=len;i+=bl) | ||
599 | (*dat->block)(in+i,out+i,&dat->ks); | ||
600 | |||
601 | return 1; | ||
602 | } | ||
603 | |||
604 | static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
605 | const unsigned char *in,size_t len) | ||
606 | { | ||
607 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
608 | |||
609 | CRYPTO_ofb128_encrypt(in,out,len,&dat->ks, | ||
610 | ctx->iv,&ctx->num,dat->block); | ||
611 | return 1; | ||
612 | } | ||
613 | |||
614 | static int aes_cfb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
615 | const unsigned char *in,size_t len) | ||
616 | { | ||
617 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
618 | |||
619 | CRYPTO_cfb128_encrypt(in,out,len,&dat->ks, | ||
620 | ctx->iv,&ctx->num,ctx->encrypt,dat->block); | ||
621 | return 1; | ||
622 | } | ||
623 | |||
624 | static int aes_cfb8_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
625 | const unsigned char *in,size_t len) | ||
626 | { | ||
627 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
628 | |||
629 | CRYPTO_cfb128_8_encrypt(in,out,len,&dat->ks, | ||
630 | ctx->iv,&ctx->num,ctx->encrypt,dat->block); | ||
631 | return 1; | ||
632 | } | ||
633 | |||
634 | static int aes_cfb1_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out, | ||
635 | const unsigned char *in,size_t len) | ||
636 | { | ||
637 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
638 | |||
639 | if (ctx->flags&EVP_CIPH_FLAG_LENGTH_BITS) { | ||
640 | CRYPTO_cfb128_1_encrypt(in,out,len,&dat->ks, | ||
641 | ctx->iv,&ctx->num,ctx->encrypt,dat->block); | ||
642 | return 1; | ||
643 | } | ||
644 | |||
645 | while (len>=MAXBITCHUNK) { | ||
646 | CRYPTO_cfb128_1_encrypt(in,out,MAXBITCHUNK*8,&dat->ks, | ||
647 | ctx->iv,&ctx->num,ctx->encrypt,dat->block); | ||
648 | len-=MAXBITCHUNK; | ||
649 | } | ||
650 | if (len) | ||
651 | CRYPTO_cfb128_1_encrypt(in,out,len*8,&dat->ks, | ||
652 | ctx->iv,&ctx->num,ctx->encrypt,dat->block); | ||
653 | |||
654 | return 1; | ||
655 | } | ||
656 | |||
657 | static int aes_ctr_cipher (EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
658 | const unsigned char *in, size_t len) | ||
659 | { | ||
660 | unsigned int num = ctx->num; | ||
661 | EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; | ||
662 | |||
663 | if (dat->stream.ctr) | ||
664 | CRYPTO_ctr128_encrypt_ctr32(in,out,len,&dat->ks, | ||
665 | ctx->iv,ctx->buf,&num,dat->stream.ctr); | ||
666 | else | ||
667 | CRYPTO_ctr128_encrypt(in,out,len,&dat->ks, | ||
668 | ctx->iv,ctx->buf,&num,dat->block); | ||
669 | ctx->num = (size_t)num; | ||
670 | return 1; | ||
671 | } | ||
672 | |||
673 | BLOCK_CIPHER_generic_pack(NID_aes,128,EVP_CIPH_FLAG_FIPS) | ||
674 | BLOCK_CIPHER_generic_pack(NID_aes,192,EVP_CIPH_FLAG_FIPS) | ||
675 | BLOCK_CIPHER_generic_pack(NID_aes,256,EVP_CIPH_FLAG_FIPS) | ||
676 | |||
677 | static int aes_gcm_cleanup(EVP_CIPHER_CTX *c) | ||
678 | { | ||
679 | EVP_AES_GCM_CTX *gctx = c->cipher_data; | ||
680 | OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm)); | ||
681 | if (gctx->iv != c->iv) | ||
682 | OPENSSL_free(gctx->iv); | ||
683 | return 1; | ||
684 | } | ||
685 | |||
686 | /* increment counter (64-bit int) by 1 */ | ||
687 | static void ctr64_inc(unsigned char *counter) { | ||
688 | int n=8; | ||
689 | unsigned char c; | ||
690 | |||
691 | do { | ||
692 | --n; | ||
693 | c = counter[n]; | ||
694 | ++c; | ||
695 | counter[n] = c; | ||
696 | if (c) return; | ||
697 | } while (n); | ||
698 | } | ||
699 | |||
700 | static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | ||
701 | { | ||
702 | EVP_AES_GCM_CTX *gctx = c->cipher_data; | ||
703 | switch (type) | ||
704 | { | ||
705 | case EVP_CTRL_INIT: | ||
706 | gctx->key_set = 0; | ||
707 | gctx->iv_set = 0; | ||
708 | gctx->ivlen = c->cipher->iv_len; | ||
709 | gctx->iv = c->iv; | ||
710 | gctx->taglen = -1; | ||
711 | gctx->iv_gen = 0; | ||
712 | gctx->tls_aad_len = -1; | ||
713 | return 1; | ||
714 | |||
715 | case EVP_CTRL_GCM_SET_IVLEN: | ||
716 | if (arg <= 0) | ||
717 | return 0; | ||
718 | #ifdef OPENSSL_FIPS | ||
719 | if (FIPS_module_mode() && !(c->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) | ||
720 | && arg < 12) | ||
721 | return 0; | ||
722 | #endif | ||
723 | /* Allocate memory for IV if needed */ | ||
724 | if ((arg > EVP_MAX_IV_LENGTH) && (arg > gctx->ivlen)) | ||
725 | { | ||
726 | if (gctx->iv != c->iv) | ||
727 | OPENSSL_free(gctx->iv); | ||
728 | gctx->iv = OPENSSL_malloc(arg); | ||
729 | if (!gctx->iv) | ||
730 | return 0; | ||
731 | } | ||
732 | gctx->ivlen = arg; | ||
733 | return 1; | ||
734 | |||
735 | case EVP_CTRL_GCM_SET_TAG: | ||
736 | if (arg <= 0 || arg > 16 || c->encrypt) | ||
737 | return 0; | ||
738 | memcpy(c->buf, ptr, arg); | ||
739 | gctx->taglen = arg; | ||
740 | return 1; | ||
741 | |||
742 | case EVP_CTRL_GCM_GET_TAG: | ||
743 | if (arg <= 0 || arg > 16 || !c->encrypt || gctx->taglen < 0) | ||
744 | return 0; | ||
745 | memcpy(ptr, c->buf, arg); | ||
746 | return 1; | ||
747 | |||
748 | case EVP_CTRL_GCM_SET_IV_FIXED: | ||
749 | /* Special case: -1 length restores whole IV */ | ||
750 | if (arg == -1) | ||
751 | { | ||
752 | memcpy(gctx->iv, ptr, gctx->ivlen); | ||
753 | gctx->iv_gen = 1; | ||
754 | return 1; | ||
755 | } | ||
756 | /* Fixed field must be at least 4 bytes and invocation field | ||
757 | * at least 8. | ||
758 | */ | ||
759 | if ((arg < 4) || (gctx->ivlen - arg) < 8) | ||
760 | return 0; | ||
761 | if (arg) | ||
762 | memcpy(gctx->iv, ptr, arg); | ||
763 | if (c->encrypt && | ||
764 | RAND_bytes(gctx->iv + arg, gctx->ivlen - arg) <= 0) | ||
765 | return 0; | ||
766 | gctx->iv_gen = 1; | ||
767 | return 1; | ||
768 | |||
769 | case EVP_CTRL_GCM_IV_GEN: | ||
770 | if (gctx->iv_gen == 0 || gctx->key_set == 0) | ||
771 | return 0; | ||
772 | CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen); | ||
773 | if (arg <= 0 || arg > gctx->ivlen) | ||
774 | arg = gctx->ivlen; | ||
775 | memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); | ||
776 | /* Invocation field will be at least 8 bytes in size and | ||
777 | * so no need to check wrap around or increment more than | ||
778 | * last 8 bytes. | ||
779 | */ | ||
780 | ctr64_inc(gctx->iv + gctx->ivlen - 8); | ||
781 | gctx->iv_set = 1; | ||
782 | return 1; | ||
783 | |||
784 | case EVP_CTRL_GCM_SET_IV_INV: | ||
785 | if (gctx->iv_gen == 0 || gctx->key_set == 0 || c->encrypt) | ||
786 | return 0; | ||
787 | memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); | ||
788 | CRYPTO_gcm128_setiv(&gctx->gcm, gctx->iv, gctx->ivlen); | ||
789 | gctx->iv_set = 1; | ||
790 | return 1; | ||
791 | |||
792 | case EVP_CTRL_AEAD_TLS1_AAD: | ||
793 | /* Save the AAD for later use */ | ||
794 | if (arg != 13) | ||
795 | return 0; | ||
796 | memcpy(c->buf, ptr, arg); | ||
797 | gctx->tls_aad_len = arg; | ||
798 | { | ||
799 | unsigned int len=c->buf[arg-2]<<8|c->buf[arg-1]; | ||
800 | /* Correct length for explicit IV */ | ||
801 | len -= EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
802 | /* If decrypting correct for tag too */ | ||
803 | if (!c->encrypt) | ||
804 | len -= EVP_GCM_TLS_TAG_LEN; | ||
805 | c->buf[arg-2] = len>>8; | ||
806 | c->buf[arg-1] = len & 0xff; | ||
807 | } | ||
808 | /* Extra padding: tag appended to record */ | ||
809 | return EVP_GCM_TLS_TAG_LEN; | ||
810 | |||
811 | default: | ||
812 | return -1; | ||
813 | |||
814 | } | ||
815 | } | ||
816 | |||
817 | static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
818 | const unsigned char *iv, int enc) | ||
819 | { | ||
820 | EVP_AES_GCM_CTX *gctx = ctx->cipher_data; | ||
821 | if (!iv && !key) | ||
822 | return 1; | ||
823 | if (key) | ||
824 | { do { | ||
825 | #ifdef BSAES_CAPABLE | ||
826 | if (BSAES_CAPABLE) | ||
827 | { | ||
828 | AES_set_encrypt_key(key,ctx->key_len*8,&gctx->ks); | ||
829 | CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks, | ||
830 | (block128_f)AES_encrypt); | ||
831 | gctx->ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; | ||
832 | break; | ||
833 | } | ||
834 | else | ||
835 | #endif | ||
836 | #ifdef VPAES_CAPABLE | ||
837 | if (VPAES_CAPABLE) | ||
838 | { | ||
839 | vpaes_set_encrypt_key(key,ctx->key_len*8,&gctx->ks); | ||
840 | CRYPTO_gcm128_init(&gctx->gcm,&gctx->ks, | ||
841 | (block128_f)vpaes_encrypt); | ||
842 | gctx->ctr = NULL; | ||
843 | break; | ||
844 | } | ||
845 | #endif | ||
846 | AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks); | ||
847 | CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)AES_encrypt); | ||
848 | #ifdef AES_CTR_ASM | ||
849 | gctx->ctr = (ctr128_f)AES_ctr32_encrypt; | ||
850 | #else | ||
851 | gctx->ctr = NULL; | ||
852 | #endif | ||
853 | } while (0); | ||
854 | |||
855 | /* If we have an iv can set it directly, otherwise use | ||
856 | * saved IV. | ||
857 | */ | ||
858 | if (iv == NULL && gctx->iv_set) | ||
859 | iv = gctx->iv; | ||
860 | if (iv) | ||
861 | { | ||
862 | CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); | ||
863 | gctx->iv_set = 1; | ||
864 | } | ||
865 | gctx->key_set = 1; | ||
866 | } | ||
867 | else | ||
868 | { | ||
869 | /* If key set use IV, otherwise copy */ | ||
870 | if (gctx->key_set) | ||
871 | CRYPTO_gcm128_setiv(&gctx->gcm, iv, gctx->ivlen); | ||
872 | else | ||
873 | memcpy(gctx->iv, iv, gctx->ivlen); | ||
874 | gctx->iv_set = 1; | ||
875 | gctx->iv_gen = 0; | ||
876 | } | ||
877 | return 1; | ||
878 | } | ||
879 | |||
880 | /* Handle TLS GCM packet format. This consists of the last portion of the IV | ||
881 | * followed by the payload and finally the tag. On encrypt generate IV, | ||
882 | * encrypt payload and write the tag. On verify retrieve IV, decrypt payload | ||
883 | * and verify tag. | ||
884 | */ | ||
885 | |||
886 | static int aes_gcm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
887 | const unsigned char *in, size_t len) | ||
888 | { | ||
889 | EVP_AES_GCM_CTX *gctx = ctx->cipher_data; | ||
890 | int rv = -1; | ||
891 | /* Encrypt/decrypt must be performed in place */ | ||
892 | if (out != in || len < (EVP_GCM_TLS_EXPLICIT_IV_LEN+EVP_GCM_TLS_TAG_LEN)) | ||
893 | return -1; | ||
894 | /* Set IV from start of buffer or generate IV and write to start | ||
895 | * of buffer. | ||
896 | */ | ||
897 | if (EVP_CIPHER_CTX_ctrl(ctx, ctx->encrypt ? | ||
898 | EVP_CTRL_GCM_IV_GEN : EVP_CTRL_GCM_SET_IV_INV, | ||
899 | EVP_GCM_TLS_EXPLICIT_IV_LEN, out) <= 0) | ||
900 | goto err; | ||
901 | /* Use saved AAD */ | ||
902 | if (CRYPTO_gcm128_aad(&gctx->gcm, ctx->buf, gctx->tls_aad_len)) | ||
903 | goto err; | ||
904 | /* Fix buffer and length to point to payload */ | ||
905 | in += EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
906 | out += EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
907 | len -= EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN; | ||
908 | if (ctx->encrypt) | ||
909 | { | ||
910 | /* Encrypt payload */ | ||
911 | if (gctx->ctr) | ||
912 | { | ||
913 | if (CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, | ||
914 | in, out, len, | ||
915 | gctx->ctr)) | ||
916 | goto err; | ||
917 | } | ||
918 | else { | ||
919 | if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len)) | ||
920 | goto err; | ||
921 | } | ||
922 | out += len; | ||
923 | /* Finally write tag */ | ||
924 | CRYPTO_gcm128_tag(&gctx->gcm, out, EVP_GCM_TLS_TAG_LEN); | ||
925 | rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN; | ||
926 | } | ||
927 | else | ||
928 | { | ||
929 | /* Decrypt */ | ||
930 | if (gctx->ctr) | ||
931 | { | ||
932 | if (CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm, | ||
933 | in, out, len, | ||
934 | gctx->ctr)) | ||
935 | goto err; | ||
936 | } | ||
937 | else { | ||
938 | if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len)) | ||
939 | goto err; | ||
940 | } | ||
941 | /* Retrieve tag */ | ||
942 | CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, | ||
943 | EVP_GCM_TLS_TAG_LEN); | ||
944 | /* If tag mismatch wipe buffer */ | ||
945 | if (memcmp(ctx->buf, in + len, EVP_GCM_TLS_TAG_LEN)) | ||
946 | { | ||
947 | OPENSSL_cleanse(out, len); | ||
948 | goto err; | ||
949 | } | ||
950 | rv = len; | ||
951 | } | ||
952 | |||
953 | err: | ||
954 | gctx->iv_set = 0; | ||
955 | gctx->tls_aad_len = -1; | ||
956 | return rv; | ||
957 | } | ||
958 | |||
959 | static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
960 | const unsigned char *in, size_t len) | ||
961 | { | ||
962 | EVP_AES_GCM_CTX *gctx = ctx->cipher_data; | ||
963 | /* If not set up, return error */ | ||
964 | if (!gctx->key_set) | ||
965 | return -1; | ||
966 | |||
967 | if (gctx->tls_aad_len >= 0) | ||
968 | return aes_gcm_tls_cipher(ctx, out, in, len); | ||
969 | |||
970 | if (!gctx->iv_set) | ||
971 | return -1; | ||
972 | if (!ctx->encrypt && gctx->taglen < 0) | ||
973 | return -1; | ||
974 | if (in) | ||
975 | { | ||
976 | if (out == NULL) | ||
977 | { | ||
978 | if (CRYPTO_gcm128_aad(&gctx->gcm, in, len)) | ||
979 | return -1; | ||
980 | } | ||
981 | else if (ctx->encrypt) | ||
982 | { | ||
983 | if (gctx->ctr) | ||
984 | { | ||
985 | if (CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, | ||
986 | in, out, len, | ||
987 | gctx->ctr)) | ||
988 | return -1; | ||
989 | } | ||
990 | else { | ||
991 | if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len)) | ||
992 | return -1; | ||
993 | } | ||
994 | } | ||
995 | else | ||
996 | { | ||
997 | if (gctx->ctr) | ||
998 | { | ||
999 | if (CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm, | ||
1000 | in, out, len, | ||
1001 | gctx->ctr)) | ||
1002 | return -1; | ||
1003 | } | ||
1004 | else { | ||
1005 | if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len)) | ||
1006 | return -1; | ||
1007 | } | ||
1008 | } | ||
1009 | return len; | ||
1010 | } | ||
1011 | else | ||
1012 | { | ||
1013 | if (!ctx->encrypt) | ||
1014 | { | ||
1015 | if (CRYPTO_gcm128_finish(&gctx->gcm, | ||
1016 | ctx->buf, gctx->taglen) != 0) | ||
1017 | return -1; | ||
1018 | gctx->iv_set = 0; | ||
1019 | return 0; | ||
1020 | } | ||
1021 | CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, 16); | ||
1022 | gctx->taglen = 16; | ||
1023 | /* Don't reuse the IV */ | ||
1024 | gctx->iv_set = 0; | ||
1025 | return 0; | ||
1026 | } | ||
1027 | |||
1028 | } | ||
1029 | |||
1030 | #define CUSTOM_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 \ | ||
1031 | | EVP_CIPH_CUSTOM_IV | EVP_CIPH_FLAG_CUSTOM_CIPHER \ | ||
1032 | | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT) | ||
1033 | |||
1034 | BLOCK_CIPHER_custom(NID_aes,128,1,12,gcm,GCM, | ||
1035 | EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER|CUSTOM_FLAGS) | ||
1036 | BLOCK_CIPHER_custom(NID_aes,192,1,12,gcm,GCM, | ||
1037 | EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER|CUSTOM_FLAGS) | ||
1038 | BLOCK_CIPHER_custom(NID_aes,256,1,12,gcm,GCM, | ||
1039 | EVP_CIPH_FLAG_FIPS|EVP_CIPH_FLAG_AEAD_CIPHER|CUSTOM_FLAGS) | ||
1040 | |||
1041 | static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | ||
1042 | { | ||
1043 | EVP_AES_XTS_CTX *xctx = c->cipher_data; | ||
1044 | if (type != EVP_CTRL_INIT) | ||
1045 | return -1; | ||
1046 | /* key1 and key2 are used as an indicator both key and IV are set */ | ||
1047 | xctx->xts.key1 = NULL; | ||
1048 | xctx->xts.key2 = NULL; | ||
1049 | return 1; | ||
1050 | } | ||
1051 | |||
1052 | static int aes_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
1053 | const unsigned char *iv, int enc) | ||
1054 | { | ||
1055 | EVP_AES_XTS_CTX *xctx = ctx->cipher_data; | ||
1056 | if (!iv && !key) | ||
1057 | return 1; | ||
1058 | |||
1059 | if (key) do | ||
1060 | { | ||
1061 | #ifdef AES_XTS_ASM | ||
1062 | xctx->stream = enc ? AES_xts_encrypt : AES_xts_decrypt; | ||
1063 | #else | ||
1064 | xctx->stream = NULL; | ||
1065 | #endif | ||
1066 | /* key_len is two AES keys */ | ||
1067 | #ifdef BSAES_CAPABLE | ||
1068 | if (BSAES_CAPABLE) | ||
1069 | xctx->stream = enc ? bsaes_xts_encrypt : bsaes_xts_decrypt; | ||
1070 | else | ||
1071 | #endif | ||
1072 | #ifdef VPAES_CAPABLE | ||
1073 | if (VPAES_CAPABLE) | ||
1074 | { | ||
1075 | if (enc) | ||
1076 | { | ||
1077 | vpaes_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1); | ||
1078 | xctx->xts.block1 = (block128_f)vpaes_encrypt; | ||
1079 | } | ||
1080 | else | ||
1081 | { | ||
1082 | vpaes_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1); | ||
1083 | xctx->xts.block1 = (block128_f)vpaes_decrypt; | ||
1084 | } | ||
1085 | |||
1086 | vpaes_set_encrypt_key(key + ctx->key_len/2, | ||
1087 | ctx->key_len * 4, &xctx->ks2); | ||
1088 | xctx->xts.block2 = (block128_f)vpaes_encrypt; | ||
1089 | |||
1090 | xctx->xts.key1 = &xctx->ks1; | ||
1091 | break; | ||
1092 | } | ||
1093 | #endif | ||
1094 | if (enc) | ||
1095 | { | ||
1096 | AES_set_encrypt_key(key, ctx->key_len * 4, &xctx->ks1); | ||
1097 | xctx->xts.block1 = (block128_f)AES_encrypt; | ||
1098 | } | ||
1099 | else | ||
1100 | { | ||
1101 | AES_set_decrypt_key(key, ctx->key_len * 4, &xctx->ks1); | ||
1102 | xctx->xts.block1 = (block128_f)AES_decrypt; | ||
1103 | } | ||
1104 | |||
1105 | AES_set_encrypt_key(key + ctx->key_len/2, | ||
1106 | ctx->key_len * 4, &xctx->ks2); | ||
1107 | xctx->xts.block2 = (block128_f)AES_encrypt; | ||
1108 | |||
1109 | xctx->xts.key1 = &xctx->ks1; | ||
1110 | } while (0); | ||
1111 | |||
1112 | if (iv) | ||
1113 | { | ||
1114 | xctx->xts.key2 = &xctx->ks2; | ||
1115 | memcpy(ctx->iv, iv, 16); | ||
1116 | } | ||
1117 | |||
1118 | return 1; | ||
1119 | } | ||
1120 | |||
1121 | static int aes_xts_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
1122 | const unsigned char *in, size_t len) | ||
1123 | { | ||
1124 | EVP_AES_XTS_CTX *xctx = ctx->cipher_data; | ||
1125 | if (!xctx->xts.key1 || !xctx->xts.key2) | ||
1126 | return 0; | ||
1127 | if (!out || !in || len<AES_BLOCK_SIZE) | ||
1128 | return 0; | ||
1129 | #ifdef OPENSSL_FIPS | ||
1130 | /* Requirement of SP800-38E */ | ||
1131 | if (FIPS_module_mode() && !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW) && | ||
1132 | (len > (1UL<<20)*16)) | ||
1133 | { | ||
1134 | EVPerr(EVP_F_AES_XTS_CIPHER, EVP_R_TOO_LARGE); | ||
1135 | return 0; | ||
1136 | } | ||
1137 | #endif | ||
1138 | if (xctx->stream) | ||
1139 | (*xctx->stream)(in, out, len, | ||
1140 | xctx->xts.key1, xctx->xts.key2, ctx->iv); | ||
1141 | else if (CRYPTO_xts128_encrypt(&xctx->xts, ctx->iv, in, out, len, | ||
1142 | ctx->encrypt)) | ||
1143 | return 0; | ||
1144 | return 1; | ||
1145 | } | ||
1146 | |||
1147 | #define aes_xts_cleanup NULL | ||
1148 | |||
1149 | #define XTS_FLAGS (EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CUSTOM_IV \ | ||
1150 | | EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CTRL_INIT) | ||
1151 | |||
1152 | BLOCK_CIPHER_custom(NID_aes,128,1,16,xts,XTS,EVP_CIPH_FLAG_FIPS|XTS_FLAGS) | ||
1153 | BLOCK_CIPHER_custom(NID_aes,256,1,16,xts,XTS,EVP_CIPH_FLAG_FIPS|XTS_FLAGS) | ||
1154 | |||
1155 | static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) | ||
1156 | { | ||
1157 | EVP_AES_CCM_CTX *cctx = c->cipher_data; | ||
1158 | switch (type) | ||
1159 | { | ||
1160 | case EVP_CTRL_INIT: | ||
1161 | cctx->key_set = 0; | ||
1162 | cctx->iv_set = 0; | ||
1163 | cctx->L = 8; | ||
1164 | cctx->M = 12; | ||
1165 | cctx->tag_set = 0; | ||
1166 | cctx->len_set = 0; | ||
1167 | return 1; | ||
1168 | |||
1169 | case EVP_CTRL_CCM_SET_IVLEN: | ||
1170 | arg = 15 - arg; | ||
1171 | case EVP_CTRL_CCM_SET_L: | ||
1172 | if (arg < 2 || arg > 8) | ||
1173 | return 0; | ||
1174 | cctx->L = arg; | ||
1175 | return 1; | ||
1176 | |||
1177 | case EVP_CTRL_CCM_SET_TAG: | ||
1178 | if ((arg & 1) || arg < 4 || arg > 16) | ||
1179 | return 0; | ||
1180 | if ((c->encrypt && ptr) || (!c->encrypt && !ptr)) | ||
1181 | return 0; | ||
1182 | if (ptr) | ||
1183 | { | ||
1184 | cctx->tag_set = 1; | ||
1185 | memcpy(c->buf, ptr, arg); | ||
1186 | } | ||
1187 | cctx->M = arg; | ||
1188 | return 1; | ||
1189 | |||
1190 | case EVP_CTRL_CCM_GET_TAG: | ||
1191 | if (!c->encrypt || !cctx->tag_set) | ||
1192 | return 0; | ||
1193 | if(!CRYPTO_ccm128_tag(&cctx->ccm, ptr, (size_t)arg)) | ||
1194 | return 0; | ||
1195 | cctx->tag_set = 0; | ||
1196 | cctx->iv_set = 0; | ||
1197 | cctx->len_set = 0; | ||
1198 | return 1; | ||
1199 | |||
1200 | default: | ||
1201 | return -1; | ||
1202 | |||
1203 | } | ||
1204 | } | ||
1205 | |||
1206 | static int aes_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | ||
1207 | const unsigned char *iv, int enc) | ||
1208 | { | ||
1209 | EVP_AES_CCM_CTX *cctx = ctx->cipher_data; | ||
1210 | if (!iv && !key) | ||
1211 | return 1; | ||
1212 | if (key) do | ||
1213 | { | ||
1214 | #ifdef VPAES_CAPABLE | ||
1215 | if (VPAES_CAPABLE) | ||
1216 | { | ||
1217 | vpaes_set_encrypt_key(key, ctx->key_len*8, &cctx->ks); | ||
1218 | CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, | ||
1219 | &cctx->ks, (block128_f)vpaes_encrypt); | ||
1220 | cctx->key_set = 1; | ||
1221 | break; | ||
1222 | } | ||
1223 | #endif | ||
1224 | AES_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks); | ||
1225 | CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, | ||
1226 | &cctx->ks, (block128_f)AES_encrypt); | ||
1227 | cctx->str = NULL; | ||
1228 | cctx->key_set = 1; | ||
1229 | } while (0); | ||
1230 | if (iv) | ||
1231 | { | ||
1232 | memcpy(ctx->iv, iv, 15 - cctx->L); | ||
1233 | cctx->iv_set = 1; | ||
1234 | } | ||
1235 | return 1; | ||
1236 | } | ||
1237 | |||
1238 | static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | ||
1239 | const unsigned char *in, size_t len) | ||
1240 | { | ||
1241 | EVP_AES_CCM_CTX *cctx = ctx->cipher_data; | ||
1242 | CCM128_CONTEXT *ccm = &cctx->ccm; | ||
1243 | /* If not set up, return error */ | ||
1244 | if (!cctx->iv_set && !cctx->key_set) | ||
1245 | return -1; | ||
1246 | if (!ctx->encrypt && !cctx->tag_set) | ||
1247 | return -1; | ||
1248 | if (!out) | ||
1249 | { | ||
1250 | if (!in) | ||
1251 | { | ||
1252 | if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L,len)) | ||
1253 | return -1; | ||
1254 | cctx->len_set = 1; | ||
1255 | return len; | ||
1256 | } | ||
1257 | /* If have AAD need message length */ | ||
1258 | if (!cctx->len_set && len) | ||
1259 | return -1; | ||
1260 | CRYPTO_ccm128_aad(ccm, in, len); | ||
1261 | return len; | ||
1262 | } | ||
1263 | /* EVP_*Final() doesn't return any data */ | ||
1264 | if (!in) | ||
1265 | return 0; | ||
1266 | /* If not set length yet do it */ | ||
1267 | if (!cctx->len_set) | ||
1268 | { | ||
1269 | if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len)) | ||
1270 | return -1; | ||
1271 | cctx->len_set = 1; | ||
1272 | } | ||
1273 | if (ctx->encrypt) | ||
1274 | { | ||
1275 | if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, | ||
1276 | cctx->str) : | ||
1277 | CRYPTO_ccm128_encrypt(ccm, in, out, len)) | ||
1278 | return -1; | ||
1279 | cctx->tag_set = 1; | ||
1280 | return len; | ||
1281 | } | ||
1282 | else | ||
1283 | { | ||
1284 | int rv = -1; | ||
1285 | if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, | ||
1286 | cctx->str) : | ||
1287 | !CRYPTO_ccm128_decrypt(ccm, in, out, len)) | ||
1288 | { | ||
1289 | unsigned char tag[16]; | ||
1290 | if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) | ||
1291 | { | ||
1292 | if (!memcmp(tag, ctx->buf, cctx->M)) | ||
1293 | rv = len; | ||
1294 | } | ||
1295 | } | ||
1296 | if (rv == -1) | ||
1297 | OPENSSL_cleanse(out, len); | ||
1298 | cctx->iv_set = 0; | ||
1299 | cctx->tag_set = 0; | ||
1300 | cctx->len_set = 0; | ||
1301 | return rv; | ||
1302 | } | ||
1303 | |||
1304 | } | ||
1305 | |||
1306 | #define aes_ccm_cleanup NULL | ||
1307 | |||
1308 | BLOCK_CIPHER_custom(NID_aes,128,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS) | ||
1309 | BLOCK_CIPHER_custom(NID_aes,192,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS) | ||
1310 | BLOCK_CIPHER_custom(NID_aes,256,1,12,ccm,CCM,EVP_CIPH_FLAG_FIPS|CUSTOM_FLAGS) | ||
1311 | |||
1312 | #endif | ||
120 | #endif | 1313 | #endif |
diff --git a/src/lib/libssl/src/crypto/evp/e_des3.c b/src/lib/libssl/src/crypto/evp/e_des3.c index 3232cfe024..1e69972662 100644 --- a/src/lib/libssl/src/crypto/evp/e_des3.c +++ b/src/lib/libssl/src/crypto/evp/e_des3.c | |||
@@ -65,6 +65,8 @@ | |||
65 | #include <openssl/des.h> | 65 | #include <openssl/des.h> |
66 | #include <openssl/rand.h> | 66 | #include <openssl/rand.h> |
67 | 67 | ||
68 | #ifndef OPENSSL_FIPS | ||
69 | |||
68 | static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 70 | static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
69 | const unsigned char *iv,int enc); | 71 | const unsigned char *iv,int enc); |
70 | 72 | ||
@@ -311,3 +313,4 @@ const EVP_CIPHER *EVP_des_ede3(void) | |||
311 | return &des_ede3_ecb; | 313 | return &des_ede3_ecb; |
312 | } | 314 | } |
313 | #endif | 315 | #endif |
316 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/evp/e_null.c b/src/lib/libssl/src/crypto/evp/e_null.c index 7cf50e1416..f0c1f78b5f 100644 --- a/src/lib/libssl/src/crypto/evp/e_null.c +++ b/src/lib/libssl/src/crypto/evp/e_null.c | |||
@@ -61,6 +61,8 @@ | |||
61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
62 | #include <openssl/objects.h> | 62 | #include <openssl/objects.h> |
63 | 63 | ||
64 | #ifndef OPENSSL_FIPS | ||
65 | |||
64 | static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 66 | static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
65 | const unsigned char *iv,int enc); | 67 | const unsigned char *iv,int enc); |
66 | static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 68 | static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
@@ -99,4 +101,4 @@ static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | |||
99 | memcpy((char *)out,(const char *)in,inl); | 101 | memcpy((char *)out,(const char *)in,inl); |
100 | return 1; | 102 | return 1; |
101 | } | 103 | } |
102 | 104 | #endif | |
diff --git a/src/lib/libssl/src/crypto/evp/e_rc2.c b/src/lib/libssl/src/crypto/evp/e_rc2.c index f78d781129..d4c33b58d4 100644 --- a/src/lib/libssl/src/crypto/evp/e_rc2.c +++ b/src/lib/libssl/src/crypto/evp/e_rc2.c | |||
@@ -183,7 +183,8 @@ static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
183 | key_bits =rc2_magic_to_meth((int)num); | 183 | key_bits =rc2_magic_to_meth((int)num); |
184 | if (!key_bits) | 184 | if (!key_bits) |
185 | return(-1); | 185 | return(-1); |
186 | if(i > 0) EVP_CipherInit_ex(c, NULL, NULL, NULL, iv, -1); | 186 | if(i > 0 && !EVP_CipherInit_ex(c, NULL, NULL, NULL, iv, -1)) |
187 | return -1; | ||
187 | EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); | 188 | EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); |
188 | EVP_CIPHER_CTX_set_key_length(c, key_bits / 8); | 189 | EVP_CIPHER_CTX_set_key_length(c, key_bits / 8); |
189 | } | 190 | } |
diff --git a/src/lib/libssl/src/crypto/evp/e_rc4.c b/src/lib/libssl/src/crypto/evp/e_rc4.c index 8b5175e0fd..b4f6bda82d 100644 --- a/src/lib/libssl/src/crypto/evp/e_rc4.c +++ b/src/lib/libssl/src/crypto/evp/e_rc4.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #ifndef OPENSSL_NO_RC4 | 62 | #ifndef OPENSSL_NO_RC4 |
63 | 63 | ||
64 | #include <openssl/evp.h> | 64 | #include <openssl/evp.h> |
65 | #include "evp_locl.h" | ||
65 | #include <openssl/objects.h> | 66 | #include <openssl/objects.h> |
66 | #include <openssl/rc4.h> | 67 | #include <openssl/rc4.h> |
67 | 68 | ||
diff --git a/src/lib/libssl/src/crypto/evp/evp.h b/src/lib/libssl/src/crypto/evp/evp.h index 9f9795e2d9..0d1b20a7d3 100644 --- a/src/lib/libssl/src/crypto/evp/evp.h +++ b/src/lib/libssl/src/crypto/evp/evp.h | |||
@@ -83,7 +83,7 @@ | |||
83 | #define EVP_RC5_32_12_16_KEY_SIZE 16 | 83 | #define EVP_RC5_32_12_16_KEY_SIZE 16 |
84 | */ | 84 | */ |
85 | #define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ | 85 | #define EVP_MAX_MD_SIZE 64 /* longest known is SHA512 */ |
86 | #define EVP_MAX_KEY_LENGTH 32 | 86 | #define EVP_MAX_KEY_LENGTH 64 |
87 | #define EVP_MAX_IV_LENGTH 16 | 87 | #define EVP_MAX_IV_LENGTH 16 |
88 | #define EVP_MAX_BLOCK_LENGTH 32 | 88 | #define EVP_MAX_BLOCK_LENGTH 32 |
89 | 89 | ||
@@ -116,6 +116,7 @@ | |||
116 | #define EVP_PKEY_DH NID_dhKeyAgreement | 116 | #define EVP_PKEY_DH NID_dhKeyAgreement |
117 | #define EVP_PKEY_EC NID_X9_62_id_ecPublicKey | 117 | #define EVP_PKEY_EC NID_X9_62_id_ecPublicKey |
118 | #define EVP_PKEY_HMAC NID_hmac | 118 | #define EVP_PKEY_HMAC NID_hmac |
119 | #define EVP_PKEY_CMAC NID_cmac | ||
119 | 120 | ||
120 | #ifdef __cplusplus | 121 | #ifdef __cplusplus |
121 | extern "C" { | 122 | extern "C" { |
@@ -216,6 +217,8 @@ typedef int evp_verify_method(int type,const unsigned char *m, | |||
216 | 217 | ||
217 | #define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 | 218 | #define EVP_MD_FLAG_DIGALGID_CUSTOM 0x0018 |
218 | 219 | ||
220 | #define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */ | ||
221 | |||
219 | /* Digest ctrls */ | 222 | /* Digest ctrls */ |
220 | 223 | ||
221 | #define EVP_MD_CTRL_DIGALGID 0x1 | 224 | #define EVP_MD_CTRL_DIGALGID 0x1 |
@@ -325,6 +328,10 @@ struct evp_cipher_st | |||
325 | #define EVP_CIPH_CBC_MODE 0x2 | 328 | #define EVP_CIPH_CBC_MODE 0x2 |
326 | #define EVP_CIPH_CFB_MODE 0x3 | 329 | #define EVP_CIPH_CFB_MODE 0x3 |
327 | #define EVP_CIPH_OFB_MODE 0x4 | 330 | #define EVP_CIPH_OFB_MODE 0x4 |
331 | #define EVP_CIPH_CTR_MODE 0x5 | ||
332 | #define EVP_CIPH_GCM_MODE 0x6 | ||
333 | #define EVP_CIPH_CCM_MODE 0x7 | ||
334 | #define EVP_CIPH_XTS_MODE 0x10001 | ||
328 | #define EVP_CIPH_MODE 0xF0007 | 335 | #define EVP_CIPH_MODE 0xF0007 |
329 | /* Set if variable length cipher */ | 336 | /* Set if variable length cipher */ |
330 | #define EVP_CIPH_VARIABLE_LENGTH 0x8 | 337 | #define EVP_CIPH_VARIABLE_LENGTH 0x8 |
@@ -346,6 +353,15 @@ struct evp_cipher_st | |||
346 | #define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 | 353 | #define EVP_CIPH_FLAG_DEFAULT_ASN1 0x1000 |
347 | /* Buffer length in bits not bytes: CFB1 mode only */ | 354 | /* Buffer length in bits not bytes: CFB1 mode only */ |
348 | #define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 | 355 | #define EVP_CIPH_FLAG_LENGTH_BITS 0x2000 |
356 | /* Note if suitable for use in FIPS mode */ | ||
357 | #define EVP_CIPH_FLAG_FIPS 0x4000 | ||
358 | /* Allow non FIPS cipher in FIPS mode */ | ||
359 | #define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x8000 | ||
360 | /* Cipher handles any and all padding logic as well | ||
361 | * as finalisation. | ||
362 | */ | ||
363 | #define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x100000 | ||
364 | #define EVP_CIPH_FLAG_AEAD_CIPHER 0x200000 | ||
349 | 365 | ||
350 | /* ctrl() values */ | 366 | /* ctrl() values */ |
351 | 367 | ||
@@ -358,6 +374,34 @@ struct evp_cipher_st | |||
358 | #define EVP_CTRL_RAND_KEY 0x6 | 374 | #define EVP_CTRL_RAND_KEY 0x6 |
359 | #define EVP_CTRL_PBE_PRF_NID 0x7 | 375 | #define EVP_CTRL_PBE_PRF_NID 0x7 |
360 | #define EVP_CTRL_COPY 0x8 | 376 | #define EVP_CTRL_COPY 0x8 |
377 | #define EVP_CTRL_GCM_SET_IVLEN 0x9 | ||
378 | #define EVP_CTRL_GCM_GET_TAG 0x10 | ||
379 | #define EVP_CTRL_GCM_SET_TAG 0x11 | ||
380 | #define EVP_CTRL_GCM_SET_IV_FIXED 0x12 | ||
381 | #define EVP_CTRL_GCM_IV_GEN 0x13 | ||
382 | #define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_GCM_SET_IVLEN | ||
383 | #define EVP_CTRL_CCM_GET_TAG EVP_CTRL_GCM_GET_TAG | ||
384 | #define EVP_CTRL_CCM_SET_TAG EVP_CTRL_GCM_SET_TAG | ||
385 | #define EVP_CTRL_CCM_SET_L 0x14 | ||
386 | #define EVP_CTRL_CCM_SET_MSGLEN 0x15 | ||
387 | /* AEAD cipher deduces payload length and returns number of bytes | ||
388 | * required to store MAC and eventual padding. Subsequent call to | ||
389 | * EVP_Cipher even appends/verifies MAC. | ||
390 | */ | ||
391 | #define EVP_CTRL_AEAD_TLS1_AAD 0x16 | ||
392 | /* Used by composite AEAD ciphers, no-op in GCM, CCM... */ | ||
393 | #define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 | ||
394 | /* Set the GCM invocation field, decrypt only */ | ||
395 | #define EVP_CTRL_GCM_SET_IV_INV 0x18 | ||
396 | |||
397 | /* GCM TLS constants */ | ||
398 | /* Length of fixed part of IV derived from PRF */ | ||
399 | #define EVP_GCM_TLS_FIXED_IV_LEN 4 | ||
400 | /* Length of explicit part of IV part of TLS records */ | ||
401 | #define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 | ||
402 | /* Length of tag for TLS */ | ||
403 | #define EVP_GCM_TLS_TAG_LEN 16 | ||
404 | |||
361 | 405 | ||
362 | typedef struct evp_cipher_info_st | 406 | typedef struct evp_cipher_info_st |
363 | { | 407 | { |
@@ -375,7 +419,7 @@ struct evp_cipher_ctx_st | |||
375 | unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ | 419 | unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ |
376 | unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ | 420 | unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ |
377 | unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ | 421 | unsigned char buf[EVP_MAX_BLOCK_LENGTH];/* saved partial block */ |
378 | int num; /* used by cfb/ofb mode */ | 422 | int num; /* used by cfb/ofb/ctr mode */ |
379 | 423 | ||
380 | void *app_data; /* application stuff */ | 424 | void *app_data; /* application stuff */ |
381 | int key_len; /* May change for variable length cipher */ | 425 | int key_len; /* May change for variable length cipher */ |
@@ -695,6 +739,9 @@ const EVP_MD *EVP_dev_crypto_md5(void); | |||
695 | #ifndef OPENSSL_NO_RC4 | 739 | #ifndef OPENSSL_NO_RC4 |
696 | const EVP_CIPHER *EVP_rc4(void); | 740 | const EVP_CIPHER *EVP_rc4(void); |
697 | const EVP_CIPHER *EVP_rc4_40(void); | 741 | const EVP_CIPHER *EVP_rc4_40(void); |
742 | #ifndef OPENSSL_NO_MD5 | ||
743 | const EVP_CIPHER *EVP_rc4_hmac_md5(void); | ||
744 | #endif | ||
698 | #endif | 745 | #endif |
699 | #ifndef OPENSSL_NO_IDEA | 746 | #ifndef OPENSSL_NO_IDEA |
700 | const EVP_CIPHER *EVP_idea_ecb(void); | 747 | const EVP_CIPHER *EVP_idea_ecb(void); |
@@ -741,9 +788,10 @@ const EVP_CIPHER *EVP_aes_128_cfb8(void); | |||
741 | const EVP_CIPHER *EVP_aes_128_cfb128(void); | 788 | const EVP_CIPHER *EVP_aes_128_cfb128(void); |
742 | # define EVP_aes_128_cfb EVP_aes_128_cfb128 | 789 | # define EVP_aes_128_cfb EVP_aes_128_cfb128 |
743 | const EVP_CIPHER *EVP_aes_128_ofb(void); | 790 | const EVP_CIPHER *EVP_aes_128_ofb(void); |
744 | #if 0 | ||
745 | const EVP_CIPHER *EVP_aes_128_ctr(void); | 791 | const EVP_CIPHER *EVP_aes_128_ctr(void); |
746 | #endif | 792 | const EVP_CIPHER *EVP_aes_128_gcm(void); |
793 | const EVP_CIPHER *EVP_aes_128_ccm(void); | ||
794 | const EVP_CIPHER *EVP_aes_128_xts(void); | ||
747 | const EVP_CIPHER *EVP_aes_192_ecb(void); | 795 | const EVP_CIPHER *EVP_aes_192_ecb(void); |
748 | const EVP_CIPHER *EVP_aes_192_cbc(void); | 796 | const EVP_CIPHER *EVP_aes_192_cbc(void); |
749 | const EVP_CIPHER *EVP_aes_192_cfb1(void); | 797 | const EVP_CIPHER *EVP_aes_192_cfb1(void); |
@@ -751,9 +799,9 @@ const EVP_CIPHER *EVP_aes_192_cfb8(void); | |||
751 | const EVP_CIPHER *EVP_aes_192_cfb128(void); | 799 | const EVP_CIPHER *EVP_aes_192_cfb128(void); |
752 | # define EVP_aes_192_cfb EVP_aes_192_cfb128 | 800 | # define EVP_aes_192_cfb EVP_aes_192_cfb128 |
753 | const EVP_CIPHER *EVP_aes_192_ofb(void); | 801 | const EVP_CIPHER *EVP_aes_192_ofb(void); |
754 | #if 0 | ||
755 | const EVP_CIPHER *EVP_aes_192_ctr(void); | 802 | const EVP_CIPHER *EVP_aes_192_ctr(void); |
756 | #endif | 803 | const EVP_CIPHER *EVP_aes_192_gcm(void); |
804 | const EVP_CIPHER *EVP_aes_192_ccm(void); | ||
757 | const EVP_CIPHER *EVP_aes_256_ecb(void); | 805 | const EVP_CIPHER *EVP_aes_256_ecb(void); |
758 | const EVP_CIPHER *EVP_aes_256_cbc(void); | 806 | const EVP_CIPHER *EVP_aes_256_cbc(void); |
759 | const EVP_CIPHER *EVP_aes_256_cfb1(void); | 807 | const EVP_CIPHER *EVP_aes_256_cfb1(void); |
@@ -761,8 +809,13 @@ const EVP_CIPHER *EVP_aes_256_cfb8(void); | |||
761 | const EVP_CIPHER *EVP_aes_256_cfb128(void); | 809 | const EVP_CIPHER *EVP_aes_256_cfb128(void); |
762 | # define EVP_aes_256_cfb EVP_aes_256_cfb128 | 810 | # define EVP_aes_256_cfb EVP_aes_256_cfb128 |
763 | const EVP_CIPHER *EVP_aes_256_ofb(void); | 811 | const EVP_CIPHER *EVP_aes_256_ofb(void); |
764 | #if 0 | ||
765 | const EVP_CIPHER *EVP_aes_256_ctr(void); | 812 | const EVP_CIPHER *EVP_aes_256_ctr(void); |
813 | const EVP_CIPHER *EVP_aes_256_gcm(void); | ||
814 | const EVP_CIPHER *EVP_aes_256_ccm(void); | ||
815 | const EVP_CIPHER *EVP_aes_256_xts(void); | ||
816 | #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) | ||
817 | const EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void); | ||
818 | const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void); | ||
766 | #endif | 819 | #endif |
767 | #endif | 820 | #endif |
768 | #ifndef OPENSSL_NO_CAMELLIA | 821 | #ifndef OPENSSL_NO_CAMELLIA |
@@ -1047,13 +1100,22 @@ void EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth, | |||
1047 | #define EVP_PKEY_CTRL_CMS_DECRYPT 10 | 1100 | #define EVP_PKEY_CTRL_CMS_DECRYPT 10 |
1048 | #define EVP_PKEY_CTRL_CMS_SIGN 11 | 1101 | #define EVP_PKEY_CTRL_CMS_SIGN 11 |
1049 | 1102 | ||
1103 | #define EVP_PKEY_CTRL_CIPHER 12 | ||
1104 | |||
1050 | #define EVP_PKEY_ALG_CTRL 0x1000 | 1105 | #define EVP_PKEY_ALG_CTRL 0x1000 |
1051 | 1106 | ||
1052 | 1107 | ||
1053 | #define EVP_PKEY_FLAG_AUTOARGLEN 2 | 1108 | #define EVP_PKEY_FLAG_AUTOARGLEN 2 |
1109 | /* Method handles all operations: don't assume any digest related | ||
1110 | * defaults. | ||
1111 | */ | ||
1112 | #define EVP_PKEY_FLAG_SIGCTX_CUSTOM 4 | ||
1054 | 1113 | ||
1055 | const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); | 1114 | const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type); |
1056 | EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags); | 1115 | EVP_PKEY_METHOD* EVP_PKEY_meth_new(int id, int flags); |
1116 | void EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags, | ||
1117 | const EVP_PKEY_METHOD *meth); | ||
1118 | void EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src); | ||
1057 | void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); | 1119 | void EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth); |
1058 | int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); | 1120 | int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth); |
1059 | 1121 | ||
@@ -1071,7 +1133,7 @@ int EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx); | |||
1071 | void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); | 1133 | void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen); |
1072 | 1134 | ||
1073 | EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, | 1135 | EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, |
1074 | unsigned char *key, int keylen); | 1136 | const unsigned char *key, int keylen); |
1075 | 1137 | ||
1076 | void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); | 1138 | void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data); |
1077 | void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); | 1139 | void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx); |
@@ -1190,8 +1252,13 @@ void ERR_load_EVP_strings(void); | |||
1190 | /* Error codes for the EVP functions. */ | 1252 | /* Error codes for the EVP functions. */ |
1191 | 1253 | ||
1192 | /* Function codes. */ | 1254 | /* Function codes. */ |
1255 | #define EVP_F_AESNI_INIT_KEY 165 | ||
1256 | #define EVP_F_AESNI_XTS_CIPHER 176 | ||
1193 | #define EVP_F_AES_INIT_KEY 133 | 1257 | #define EVP_F_AES_INIT_KEY 133 |
1258 | #define EVP_F_AES_XTS 172 | ||
1259 | #define EVP_F_AES_XTS_CIPHER 175 | ||
1194 | #define EVP_F_CAMELLIA_INIT_KEY 159 | 1260 | #define EVP_F_CAMELLIA_INIT_KEY 159 |
1261 | #define EVP_F_CMAC_INIT 173 | ||
1195 | #define EVP_F_D2I_PKEY 100 | 1262 | #define EVP_F_D2I_PKEY 100 |
1196 | #define EVP_F_DO_SIGVER_INIT 161 | 1263 | #define EVP_F_DO_SIGVER_INIT 161 |
1197 | #define EVP_F_DSAPKEY2PKCS8 134 | 1264 | #define EVP_F_DSAPKEY2PKCS8 134 |
@@ -1246,15 +1313,24 @@ void ERR_load_EVP_strings(void); | |||
1246 | #define EVP_F_EVP_RIJNDAEL 126 | 1313 | #define EVP_F_EVP_RIJNDAEL 126 |
1247 | #define EVP_F_EVP_SIGNFINAL 107 | 1314 | #define EVP_F_EVP_SIGNFINAL 107 |
1248 | #define EVP_F_EVP_VERIFYFINAL 108 | 1315 | #define EVP_F_EVP_VERIFYFINAL 108 |
1316 | #define EVP_F_FIPS_CIPHERINIT 166 | ||
1317 | #define EVP_F_FIPS_CIPHER_CTX_COPY 170 | ||
1318 | #define EVP_F_FIPS_CIPHER_CTX_CTRL 167 | ||
1319 | #define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH 171 | ||
1320 | #define EVP_F_FIPS_DIGESTINIT 168 | ||
1321 | #define EVP_F_FIPS_MD_CTX_COPY 169 | ||
1322 | #define EVP_F_HMAC_INIT_EX 174 | ||
1249 | #define EVP_F_INT_CTX_NEW 157 | 1323 | #define EVP_F_INT_CTX_NEW 157 |
1250 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 | 1324 | #define EVP_F_PKCS5_PBE_KEYIVGEN 117 |
1251 | #define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 | 1325 | #define EVP_F_PKCS5_V2_PBE_KEYIVGEN 118 |
1326 | #define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN 164 | ||
1252 | #define EVP_F_PKCS8_SET_BROKEN 112 | 1327 | #define EVP_F_PKCS8_SET_BROKEN 112 |
1253 | #define EVP_F_PKEY_SET_TYPE 158 | 1328 | #define EVP_F_PKEY_SET_TYPE 158 |
1254 | #define EVP_F_RC2_MAGIC_TO_METH 109 | 1329 | #define EVP_F_RC2_MAGIC_TO_METH 109 |
1255 | #define EVP_F_RC5_CTRL 125 | 1330 | #define EVP_F_RC5_CTRL 125 |
1256 | 1331 | ||
1257 | /* Reason codes. */ | 1332 | /* Reason codes. */ |
1333 | #define EVP_R_AES_IV_SETUP_FAILED 162 | ||
1258 | #define EVP_R_AES_KEY_SETUP_FAILED 143 | 1334 | #define EVP_R_AES_KEY_SETUP_FAILED 143 |
1259 | #define EVP_R_ASN1_LIB 140 | 1335 | #define EVP_R_ASN1_LIB 140 |
1260 | #define EVP_R_BAD_BLOCK_LENGTH 136 | 1336 | #define EVP_R_BAD_BLOCK_LENGTH 136 |
@@ -1272,6 +1348,7 @@ void ERR_load_EVP_strings(void); | |||
1272 | #define EVP_R_DECODE_ERROR 114 | 1348 | #define EVP_R_DECODE_ERROR 114 |
1273 | #define EVP_R_DIFFERENT_KEY_TYPES 101 | 1349 | #define EVP_R_DIFFERENT_KEY_TYPES 101 |
1274 | #define EVP_R_DIFFERENT_PARAMETERS 153 | 1350 | #define EVP_R_DIFFERENT_PARAMETERS 153 |
1351 | #define EVP_R_DISABLED_FOR_FIPS 163 | ||
1275 | #define EVP_R_ENCODE_ERROR 115 | 1352 | #define EVP_R_ENCODE_ERROR 115 |
1276 | #define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 | 1353 | #define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 |
1277 | #define EVP_R_EXPECTING_AN_RSA_KEY 127 | 1354 | #define EVP_R_EXPECTING_AN_RSA_KEY 127 |
@@ -1303,6 +1380,7 @@ void ERR_load_EVP_strings(void); | |||
1303 | #define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 | 1380 | #define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 |
1304 | #define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 | 1381 | #define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 |
1305 | #define EVP_R_PUBLIC_KEY_NOT_RSA 106 | 1382 | #define EVP_R_PUBLIC_KEY_NOT_RSA 106 |
1383 | #define EVP_R_TOO_LARGE 164 | ||
1306 | #define EVP_R_UNKNOWN_CIPHER 160 | 1384 | #define EVP_R_UNKNOWN_CIPHER 160 |
1307 | #define EVP_R_UNKNOWN_DIGEST 161 | 1385 | #define EVP_R_UNKNOWN_DIGEST 161 |
1308 | #define EVP_R_UNKNOWN_PBE_ALGORITHM 121 | 1386 | #define EVP_R_UNKNOWN_PBE_ALGORITHM 121 |
diff --git a/src/lib/libssl/src/crypto/evp/evp_enc.c b/src/lib/libssl/src/crypto/evp/evp_enc.c index c268d25cb4..0c54f05e6e 100644 --- a/src/lib/libssl/src/crypto/evp/evp_enc.c +++ b/src/lib/libssl/src/crypto/evp/evp_enc.c | |||
@@ -64,8 +64,18 @@ | |||
64 | #ifndef OPENSSL_NO_ENGINE | 64 | #ifndef OPENSSL_NO_ENGINE |
65 | #include <openssl/engine.h> | 65 | #include <openssl/engine.h> |
66 | #endif | 66 | #endif |
67 | #ifdef OPENSSL_FIPS | ||
68 | #include <openssl/fips.h> | ||
69 | #endif | ||
67 | #include "evp_locl.h" | 70 | #include "evp_locl.h" |
68 | 71 | ||
72 | #ifdef OPENSSL_FIPS | ||
73 | #define M_do_cipher(ctx, out, in, inl) FIPS_cipher(ctx, out, in, inl) | ||
74 | #else | ||
75 | #define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) | ||
76 | #endif | ||
77 | |||
78 | |||
69 | const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; | 79 | const char EVP_version[]="EVP" OPENSSL_VERSION_PTEXT; |
70 | 80 | ||
71 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) | 81 | void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) |
@@ -115,10 +125,14 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp | |||
115 | /* Ensure a context left lying around from last time is cleared | 125 | /* Ensure a context left lying around from last time is cleared |
116 | * (the previous check attempted to avoid this if the same | 126 | * (the previous check attempted to avoid this if the same |
117 | * ENGINE and EVP_CIPHER could be used). */ | 127 | * ENGINE and EVP_CIPHER could be used). */ |
118 | EVP_CIPHER_CTX_cleanup(ctx); | 128 | if (ctx->cipher) |
119 | 129 | { | |
120 | /* Restore encrypt field: it is zeroed by cleanup */ | 130 | unsigned long flags = ctx->flags; |
121 | ctx->encrypt = enc; | 131 | EVP_CIPHER_CTX_cleanup(ctx); |
132 | /* Restore encrypt and flags */ | ||
133 | ctx->encrypt = enc; | ||
134 | ctx->flags = flags; | ||
135 | } | ||
122 | #ifndef OPENSSL_NO_ENGINE | 136 | #ifndef OPENSSL_NO_ENGINE |
123 | if(impl) | 137 | if(impl) |
124 | { | 138 | { |
@@ -155,6 +169,10 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp | |||
155 | ctx->engine = NULL; | 169 | ctx->engine = NULL; |
156 | #endif | 170 | #endif |
157 | 171 | ||
172 | #ifdef OPENSSL_FIPS | ||
173 | if (FIPS_mode()) | ||
174 | return FIPS_cipherinit(ctx, cipher, key, iv, enc); | ||
175 | #endif | ||
158 | ctx->cipher=cipher; | 176 | ctx->cipher=cipher; |
159 | if (ctx->cipher->ctx_size) | 177 | if (ctx->cipher->ctx_size) |
160 | { | 178 | { |
@@ -188,6 +206,10 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *imp | |||
188 | #ifndef OPENSSL_NO_ENGINE | 206 | #ifndef OPENSSL_NO_ENGINE |
189 | skip_to_init: | 207 | skip_to_init: |
190 | #endif | 208 | #endif |
209 | #ifdef OPENSSL_FIPS | ||
210 | if (FIPS_mode()) | ||
211 | return FIPS_cipherinit(ctx, cipher, key, iv, enc); | ||
212 | #endif | ||
191 | /* we assume block size is a power of 2 in *cryptUpdate */ | 213 | /* we assume block size is a power of 2 in *cryptUpdate */ |
192 | OPENSSL_assert(ctx->cipher->block_size == 1 | 214 | OPENSSL_assert(ctx->cipher->block_size == 1 |
193 | || ctx->cipher->block_size == 8 | 215 | || ctx->cipher->block_size == 8 |
@@ -214,6 +236,13 @@ skip_to_init: | |||
214 | memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx)); | 236 | memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx)); |
215 | break; | 237 | break; |
216 | 238 | ||
239 | case EVP_CIPH_CTR_MODE: | ||
240 | ctx->num = 0; | ||
241 | /* Don't reuse IV for CTR mode */ | ||
242 | if(iv) | ||
243 | memcpy(ctx->iv, iv, EVP_CIPHER_CTX_iv_length(ctx)); | ||
244 | break; | ||
245 | |||
217 | default: | 246 | default: |
218 | return 0; | 247 | return 0; |
219 | break; | 248 | break; |
@@ -280,6 +309,16 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | |||
280 | { | 309 | { |
281 | int i,j,bl; | 310 | int i,j,bl; |
282 | 311 | ||
312 | if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) | ||
313 | { | ||
314 | i = M_do_cipher(ctx, out, in, inl); | ||
315 | if (i < 0) | ||
316 | return 0; | ||
317 | else | ||
318 | *outl = i; | ||
319 | return 1; | ||
320 | } | ||
321 | |||
283 | if (inl <= 0) | 322 | if (inl <= 0) |
284 | { | 323 | { |
285 | *outl = 0; | 324 | *outl = 0; |
@@ -288,7 +327,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | |||
288 | 327 | ||
289 | if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) | 328 | if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) |
290 | { | 329 | { |
291 | if(ctx->cipher->do_cipher(ctx,out,in,inl)) | 330 | if(M_do_cipher(ctx,out,in,inl)) |
292 | { | 331 | { |
293 | *outl=inl; | 332 | *outl=inl; |
294 | return 1; | 333 | return 1; |
@@ -315,7 +354,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | |||
315 | { | 354 | { |
316 | j=bl-i; | 355 | j=bl-i; |
317 | memcpy(&(ctx->buf[i]),in,j); | 356 | memcpy(&(ctx->buf[i]),in,j); |
318 | if(!ctx->cipher->do_cipher(ctx,out,ctx->buf,bl)) return 0; | 357 | if(!M_do_cipher(ctx,out,ctx->buf,bl)) return 0; |
319 | inl-=j; | 358 | inl-=j; |
320 | in+=j; | 359 | in+=j; |
321 | out+=bl; | 360 | out+=bl; |
@@ -328,7 +367,7 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | |||
328 | inl-=i; | 367 | inl-=i; |
329 | if (inl > 0) | 368 | if (inl > 0) |
330 | { | 369 | { |
331 | if(!ctx->cipher->do_cipher(ctx,out,in,inl)) return 0; | 370 | if(!M_do_cipher(ctx,out,in,inl)) return 0; |
332 | *outl+=inl; | 371 | *outl+=inl; |
333 | } | 372 | } |
334 | 373 | ||
@@ -350,6 +389,16 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | |||
350 | int n,ret; | 389 | int n,ret; |
351 | unsigned int i, b, bl; | 390 | unsigned int i, b, bl; |
352 | 391 | ||
392 | if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) | ||
393 | { | ||
394 | ret = M_do_cipher(ctx, out, NULL, 0); | ||
395 | if (ret < 0) | ||
396 | return 0; | ||
397 | else | ||
398 | *outl = ret; | ||
399 | return 1; | ||
400 | } | ||
401 | |||
353 | b=ctx->cipher->block_size; | 402 | b=ctx->cipher->block_size; |
354 | OPENSSL_assert(b <= sizeof ctx->buf); | 403 | OPENSSL_assert(b <= sizeof ctx->buf); |
355 | if (b == 1) | 404 | if (b == 1) |
@@ -372,7 +421,7 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | |||
372 | n=b-bl; | 421 | n=b-bl; |
373 | for (i=bl; i<b; i++) | 422 | for (i=bl; i<b; i++) |
374 | ctx->buf[i]=n; | 423 | ctx->buf[i]=n; |
375 | ret=ctx->cipher->do_cipher(ctx,out,ctx->buf,b); | 424 | ret=M_do_cipher(ctx,out,ctx->buf,b); |
376 | 425 | ||
377 | 426 | ||
378 | if(ret) | 427 | if(ret) |
@@ -387,6 +436,19 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, | |||
387 | int fix_len; | 436 | int fix_len; |
388 | unsigned int b; | 437 | unsigned int b; |
389 | 438 | ||
439 | if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) | ||
440 | { | ||
441 | fix_len = M_do_cipher(ctx, out, in, inl); | ||
442 | if (fix_len < 0) | ||
443 | { | ||
444 | *outl = 0; | ||
445 | return 0; | ||
446 | } | ||
447 | else | ||
448 | *outl = fix_len; | ||
449 | return 1; | ||
450 | } | ||
451 | |||
390 | if (inl <= 0) | 452 | if (inl <= 0) |
391 | { | 453 | { |
392 | *outl = 0; | 454 | *outl = 0; |
@@ -440,8 +502,18 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | |||
440 | { | 502 | { |
441 | int i,n; | 503 | int i,n; |
442 | unsigned int b; | 504 | unsigned int b; |
443 | |||
444 | *outl=0; | 505 | *outl=0; |
506 | |||
507 | if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) | ||
508 | { | ||
509 | i = M_do_cipher(ctx, out, NULL, 0); | ||
510 | if (i < 0) | ||
511 | return 0; | ||
512 | else | ||
513 | *outl = i; | ||
514 | return 1; | ||
515 | } | ||
516 | |||
445 | b=ctx->cipher->block_size; | 517 | b=ctx->cipher->block_size; |
446 | if (ctx->flags & EVP_CIPH_NO_PADDING) | 518 | if (ctx->flags & EVP_CIPH_NO_PADDING) |
447 | { | 519 | { |
@@ -496,6 +568,7 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) | |||
496 | 568 | ||
497 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) | 569 | int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) |
498 | { | 570 | { |
571 | #ifndef OPENSSL_FIPS | ||
499 | if (c->cipher != NULL) | 572 | if (c->cipher != NULL) |
500 | { | 573 | { |
501 | if(c->cipher->cleanup && !c->cipher->cleanup(c)) | 574 | if(c->cipher->cleanup && !c->cipher->cleanup(c)) |
@@ -506,12 +579,16 @@ int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) | |||
506 | } | 579 | } |
507 | if (c->cipher_data) | 580 | if (c->cipher_data) |
508 | OPENSSL_free(c->cipher_data); | 581 | OPENSSL_free(c->cipher_data); |
582 | #endif | ||
509 | #ifndef OPENSSL_NO_ENGINE | 583 | #ifndef OPENSSL_NO_ENGINE |
510 | if (c->engine) | 584 | if (c->engine) |
511 | /* The EVP_CIPHER we used belongs to an ENGINE, release the | 585 | /* The EVP_CIPHER we used belongs to an ENGINE, release the |
512 | * functional reference we held for this reason. */ | 586 | * functional reference we held for this reason. */ |
513 | ENGINE_finish(c->engine); | 587 | ENGINE_finish(c->engine); |
514 | #endif | 588 | #endif |
589 | #ifdef OPENSSL_FIPS | ||
590 | FIPS_cipher_ctx_cleanup(c); | ||
591 | #endif | ||
515 | memset(c,0,sizeof(EVP_CIPHER_CTX)); | 592 | memset(c,0,sizeof(EVP_CIPHER_CTX)); |
516 | return 1; | 593 | return 1; |
517 | } | 594 | } |
diff --git a/src/lib/libssl/src/crypto/evp/evp_err.c b/src/lib/libssl/src/crypto/evp/evp_err.c index d8bfec0959..db0f76d59b 100644 --- a/src/lib/libssl/src/crypto/evp/evp_err.c +++ b/src/lib/libssl/src/crypto/evp/evp_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/evp/evp_err.c */ | 1 | /* crypto/evp/evp_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -70,8 +70,13 @@ | |||
70 | 70 | ||
71 | static ERR_STRING_DATA EVP_str_functs[]= | 71 | static ERR_STRING_DATA EVP_str_functs[]= |
72 | { | 72 | { |
73 | {ERR_FUNC(EVP_F_AESNI_INIT_KEY), "AESNI_INIT_KEY"}, | ||
74 | {ERR_FUNC(EVP_F_AESNI_XTS_CIPHER), "AESNI_XTS_CIPHER"}, | ||
73 | {ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"}, | 75 | {ERR_FUNC(EVP_F_AES_INIT_KEY), "AES_INIT_KEY"}, |
76 | {ERR_FUNC(EVP_F_AES_XTS), "AES_XTS"}, | ||
77 | {ERR_FUNC(EVP_F_AES_XTS_CIPHER), "AES_XTS_CIPHER"}, | ||
74 | {ERR_FUNC(EVP_F_CAMELLIA_INIT_KEY), "CAMELLIA_INIT_KEY"}, | 78 | {ERR_FUNC(EVP_F_CAMELLIA_INIT_KEY), "CAMELLIA_INIT_KEY"}, |
79 | {ERR_FUNC(EVP_F_CMAC_INIT), "CMAC_INIT"}, | ||
75 | {ERR_FUNC(EVP_F_D2I_PKEY), "D2I_PKEY"}, | 80 | {ERR_FUNC(EVP_F_D2I_PKEY), "D2I_PKEY"}, |
76 | {ERR_FUNC(EVP_F_DO_SIGVER_INIT), "DO_SIGVER_INIT"}, | 81 | {ERR_FUNC(EVP_F_DO_SIGVER_INIT), "DO_SIGVER_INIT"}, |
77 | {ERR_FUNC(EVP_F_DSAPKEY2PKCS8), "DSAPKEY2PKCS8"}, | 82 | {ERR_FUNC(EVP_F_DSAPKEY2PKCS8), "DSAPKEY2PKCS8"}, |
@@ -86,7 +91,7 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
86 | {ERR_FUNC(EVP_F_EVP_DIGESTINIT_EX), "EVP_DigestInit_ex"}, | 91 | {ERR_FUNC(EVP_F_EVP_DIGESTINIT_EX), "EVP_DigestInit_ex"}, |
87 | {ERR_FUNC(EVP_F_EVP_ENCRYPTFINAL_EX), "EVP_EncryptFinal_ex"}, | 92 | {ERR_FUNC(EVP_F_EVP_ENCRYPTFINAL_EX), "EVP_EncryptFinal_ex"}, |
88 | {ERR_FUNC(EVP_F_EVP_MD_CTX_COPY_EX), "EVP_MD_CTX_copy_ex"}, | 93 | {ERR_FUNC(EVP_F_EVP_MD_CTX_COPY_EX), "EVP_MD_CTX_copy_ex"}, |
89 | {ERR_FUNC(EVP_F_EVP_MD_SIZE), "EVP_MD_SIZE"}, | 94 | {ERR_FUNC(EVP_F_EVP_MD_SIZE), "EVP_MD_size"}, |
90 | {ERR_FUNC(EVP_F_EVP_OPENINIT), "EVP_OpenInit"}, | 95 | {ERR_FUNC(EVP_F_EVP_OPENINIT), "EVP_OpenInit"}, |
91 | {ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD), "EVP_PBE_alg_add"}, | 96 | {ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD), "EVP_PBE_alg_add"}, |
92 | {ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD_TYPE), "EVP_PBE_alg_add_type"}, | 97 | {ERR_FUNC(EVP_F_EVP_PBE_ALG_ADD_TYPE), "EVP_PBE_alg_add_type"}, |
@@ -126,9 +131,17 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
126 | {ERR_FUNC(EVP_F_EVP_RIJNDAEL), "EVP_RIJNDAEL"}, | 131 | {ERR_FUNC(EVP_F_EVP_RIJNDAEL), "EVP_RIJNDAEL"}, |
127 | {ERR_FUNC(EVP_F_EVP_SIGNFINAL), "EVP_SignFinal"}, | 132 | {ERR_FUNC(EVP_F_EVP_SIGNFINAL), "EVP_SignFinal"}, |
128 | {ERR_FUNC(EVP_F_EVP_VERIFYFINAL), "EVP_VerifyFinal"}, | 133 | {ERR_FUNC(EVP_F_EVP_VERIFYFINAL), "EVP_VerifyFinal"}, |
134 | {ERR_FUNC(EVP_F_FIPS_CIPHERINIT), "FIPS_CIPHERINIT"}, | ||
135 | {ERR_FUNC(EVP_F_FIPS_CIPHER_CTX_COPY), "FIPS_CIPHER_CTX_COPY"}, | ||
136 | {ERR_FUNC(EVP_F_FIPS_CIPHER_CTX_CTRL), "FIPS_CIPHER_CTX_CTRL"}, | ||
137 | {ERR_FUNC(EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH), "FIPS_CIPHER_CTX_SET_KEY_LENGTH"}, | ||
138 | {ERR_FUNC(EVP_F_FIPS_DIGESTINIT), "FIPS_DIGESTINIT"}, | ||
139 | {ERR_FUNC(EVP_F_FIPS_MD_CTX_COPY), "FIPS_MD_CTX_COPY"}, | ||
140 | {ERR_FUNC(EVP_F_HMAC_INIT_EX), "HMAC_Init_ex"}, | ||
129 | {ERR_FUNC(EVP_F_INT_CTX_NEW), "INT_CTX_NEW"}, | 141 | {ERR_FUNC(EVP_F_INT_CTX_NEW), "INT_CTX_NEW"}, |
130 | {ERR_FUNC(EVP_F_PKCS5_PBE_KEYIVGEN), "PKCS5_PBE_keyivgen"}, | 142 | {ERR_FUNC(EVP_F_PKCS5_PBE_KEYIVGEN), "PKCS5_PBE_keyivgen"}, |
131 | {ERR_FUNC(EVP_F_PKCS5_V2_PBE_KEYIVGEN), "PKCS5_v2_PBE_keyivgen"}, | 143 | {ERR_FUNC(EVP_F_PKCS5_V2_PBE_KEYIVGEN), "PKCS5_v2_PBE_keyivgen"}, |
144 | {ERR_FUNC(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN), "PKCS5_V2_PBKDF2_KEYIVGEN"}, | ||
132 | {ERR_FUNC(EVP_F_PKCS8_SET_BROKEN), "PKCS8_set_broken"}, | 145 | {ERR_FUNC(EVP_F_PKCS8_SET_BROKEN), "PKCS8_set_broken"}, |
133 | {ERR_FUNC(EVP_F_PKEY_SET_TYPE), "PKEY_SET_TYPE"}, | 146 | {ERR_FUNC(EVP_F_PKEY_SET_TYPE), "PKEY_SET_TYPE"}, |
134 | {ERR_FUNC(EVP_F_RC2_MAGIC_TO_METH), "RC2_MAGIC_TO_METH"}, | 147 | {ERR_FUNC(EVP_F_RC2_MAGIC_TO_METH), "RC2_MAGIC_TO_METH"}, |
@@ -138,6 +151,7 @@ static ERR_STRING_DATA EVP_str_functs[]= | |||
138 | 151 | ||
139 | static ERR_STRING_DATA EVP_str_reasons[]= | 152 | static ERR_STRING_DATA EVP_str_reasons[]= |
140 | { | 153 | { |
154 | {ERR_REASON(EVP_R_AES_IV_SETUP_FAILED) ,"aes iv setup failed"}, | ||
141 | {ERR_REASON(EVP_R_AES_KEY_SETUP_FAILED) ,"aes key setup failed"}, | 155 | {ERR_REASON(EVP_R_AES_KEY_SETUP_FAILED) ,"aes key setup failed"}, |
142 | {ERR_REASON(EVP_R_ASN1_LIB) ,"asn1 lib"}, | 156 | {ERR_REASON(EVP_R_ASN1_LIB) ,"asn1 lib"}, |
143 | {ERR_REASON(EVP_R_BAD_BLOCK_LENGTH) ,"bad block length"}, | 157 | {ERR_REASON(EVP_R_BAD_BLOCK_LENGTH) ,"bad block length"}, |
@@ -155,6 +169,7 @@ static ERR_STRING_DATA EVP_str_reasons[]= | |||
155 | {ERR_REASON(EVP_R_DECODE_ERROR) ,"decode error"}, | 169 | {ERR_REASON(EVP_R_DECODE_ERROR) ,"decode error"}, |
156 | {ERR_REASON(EVP_R_DIFFERENT_KEY_TYPES) ,"different key types"}, | 170 | {ERR_REASON(EVP_R_DIFFERENT_KEY_TYPES) ,"different key types"}, |
157 | {ERR_REASON(EVP_R_DIFFERENT_PARAMETERS) ,"different parameters"}, | 171 | {ERR_REASON(EVP_R_DIFFERENT_PARAMETERS) ,"different parameters"}, |
172 | {ERR_REASON(EVP_R_DISABLED_FOR_FIPS) ,"disabled for fips"}, | ||
158 | {ERR_REASON(EVP_R_ENCODE_ERROR) ,"encode error"}, | 173 | {ERR_REASON(EVP_R_ENCODE_ERROR) ,"encode error"}, |
159 | {ERR_REASON(EVP_R_EVP_PBE_CIPHERINIT_ERROR),"evp pbe cipherinit error"}, | 174 | {ERR_REASON(EVP_R_EVP_PBE_CIPHERINIT_ERROR),"evp pbe cipherinit error"}, |
160 | {ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY) ,"expecting an rsa key"}, | 175 | {ERR_REASON(EVP_R_EXPECTING_AN_RSA_KEY) ,"expecting an rsa key"}, |
@@ -186,6 +201,7 @@ static ERR_STRING_DATA EVP_str_reasons[]= | |||
186 | {ERR_REASON(EVP_R_PRIVATE_KEY_DECODE_ERROR),"private key decode error"}, | 201 | {ERR_REASON(EVP_R_PRIVATE_KEY_DECODE_ERROR),"private key decode error"}, |
187 | {ERR_REASON(EVP_R_PRIVATE_KEY_ENCODE_ERROR),"private key encode error"}, | 202 | {ERR_REASON(EVP_R_PRIVATE_KEY_ENCODE_ERROR),"private key encode error"}, |
188 | {ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA) ,"public key not rsa"}, | 203 | {ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA) ,"public key not rsa"}, |
204 | {ERR_REASON(EVP_R_TOO_LARGE) ,"too large"}, | ||
189 | {ERR_REASON(EVP_R_UNKNOWN_CIPHER) ,"unknown cipher"}, | 205 | {ERR_REASON(EVP_R_UNKNOWN_CIPHER) ,"unknown cipher"}, |
190 | {ERR_REASON(EVP_R_UNKNOWN_DIGEST) ,"unknown digest"}, | 206 | {ERR_REASON(EVP_R_UNKNOWN_DIGEST) ,"unknown digest"}, |
191 | {ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM) ,"unknown pbe algorithm"}, | 207 | {ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM) ,"unknown pbe algorithm"}, |
diff --git a/src/lib/libssl/src/crypto/evp/evp_key.c b/src/lib/libssl/src/crypto/evp/evp_key.c index 839d6a3a16..7961fbebf2 100644 --- a/src/lib/libssl/src/crypto/evp/evp_key.c +++ b/src/lib/libssl/src/crypto/evp/evp_key.c | |||
@@ -120,7 +120,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, | |||
120 | unsigned char md_buf[EVP_MAX_MD_SIZE]; | 120 | unsigned char md_buf[EVP_MAX_MD_SIZE]; |
121 | int niv,nkey,addmd=0; | 121 | int niv,nkey,addmd=0; |
122 | unsigned int mds=0,i; | 122 | unsigned int mds=0,i; |
123 | 123 | int rv = 0; | |
124 | nkey=type->key_len; | 124 | nkey=type->key_len; |
125 | niv=type->iv_len; | 125 | niv=type->iv_len; |
126 | OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH); | 126 | OPENSSL_assert(nkey <= EVP_MAX_KEY_LENGTH); |
@@ -134,17 +134,24 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, | |||
134 | if (!EVP_DigestInit_ex(&c,md, NULL)) | 134 | if (!EVP_DigestInit_ex(&c,md, NULL)) |
135 | return 0; | 135 | return 0; |
136 | if (addmd++) | 136 | if (addmd++) |
137 | EVP_DigestUpdate(&c,&(md_buf[0]),mds); | 137 | if (!EVP_DigestUpdate(&c,&(md_buf[0]),mds)) |
138 | EVP_DigestUpdate(&c,data,datal); | 138 | goto err; |
139 | if (!EVP_DigestUpdate(&c,data,datal)) | ||
140 | goto err; | ||
139 | if (salt != NULL) | 141 | if (salt != NULL) |
140 | EVP_DigestUpdate(&c,salt,PKCS5_SALT_LEN); | 142 | if (!EVP_DigestUpdate(&c,salt,PKCS5_SALT_LEN)) |
141 | EVP_DigestFinal_ex(&c,&(md_buf[0]),&mds); | 143 | goto err; |
144 | if (!EVP_DigestFinal_ex(&c,&(md_buf[0]),&mds)) | ||
145 | goto err; | ||
142 | 146 | ||
143 | for (i=1; i<(unsigned int)count; i++) | 147 | for (i=1; i<(unsigned int)count; i++) |
144 | { | 148 | { |
145 | EVP_DigestInit_ex(&c,md, NULL); | 149 | if (!EVP_DigestInit_ex(&c,md, NULL)) |
146 | EVP_DigestUpdate(&c,&(md_buf[0]),mds); | 150 | goto err; |
147 | EVP_DigestFinal_ex(&c,&(md_buf[0]),&mds); | 151 | if (!EVP_DigestUpdate(&c,&(md_buf[0]),mds)) |
152 | goto err; | ||
153 | if (!EVP_DigestFinal_ex(&c,&(md_buf[0]),&mds)) | ||
154 | goto err; | ||
148 | } | 155 | } |
149 | i=0; | 156 | i=0; |
150 | if (nkey) | 157 | if (nkey) |
@@ -173,8 +180,10 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, | |||
173 | } | 180 | } |
174 | if ((nkey == 0) && (niv == 0)) break; | 181 | if ((nkey == 0) && (niv == 0)) break; |
175 | } | 182 | } |
183 | rv = type->key_len; | ||
184 | err: | ||
176 | EVP_MD_CTX_cleanup(&c); | 185 | EVP_MD_CTX_cleanup(&c); |
177 | OPENSSL_cleanse(&(md_buf[0]),EVP_MAX_MD_SIZE); | 186 | OPENSSL_cleanse(&(md_buf[0]),EVP_MAX_MD_SIZE); |
178 | return(type->key_len); | 187 | return rv; |
179 | } | 188 | } |
180 | 189 | ||
diff --git a/src/lib/libssl/src/crypto/evp/evp_lib.c b/src/lib/libssl/src/crypto/evp/evp_lib.c index 40951a04f0..b180e4828a 100644 --- a/src/lib/libssl/src/crypto/evp/evp_lib.c +++ b/src/lib/libssl/src/crypto/evp/evp_lib.c | |||
@@ -67,6 +67,8 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
67 | 67 | ||
68 | if (c->cipher->set_asn1_parameters != NULL) | 68 | if (c->cipher->set_asn1_parameters != NULL) |
69 | ret=c->cipher->set_asn1_parameters(c,type); | 69 | ret=c->cipher->set_asn1_parameters(c,type); |
70 | else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) | ||
71 | ret=EVP_CIPHER_set_asn1_iv(c, type); | ||
70 | else | 72 | else |
71 | ret=-1; | 73 | ret=-1; |
72 | return(ret); | 74 | return(ret); |
@@ -78,6 +80,8 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) | |||
78 | 80 | ||
79 | if (c->cipher->get_asn1_parameters != NULL) | 81 | if (c->cipher->get_asn1_parameters != NULL) |
80 | ret=c->cipher->get_asn1_parameters(c,type); | 82 | ret=c->cipher->get_asn1_parameters(c,type); |
83 | else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) | ||
84 | ret=EVP_CIPHER_get_asn1_iv(c, type); | ||
81 | else | 85 | else |
82 | ret=-1; | 86 | ret=-1; |
83 | return(ret); | 87 | return(ret); |
diff --git a/src/lib/libssl/src/crypto/evp/evp_locl.h b/src/lib/libssl/src/crypto/evp/evp_locl.h index 292d74c188..08c0a66d39 100644 --- a/src/lib/libssl/src/crypto/evp/evp_locl.h +++ b/src/lib/libssl/src/crypto/evp/evp_locl.h | |||
@@ -343,3 +343,43 @@ struct evp_pkey_method_st | |||
343 | } /* EVP_PKEY_METHOD */; | 343 | } /* EVP_PKEY_METHOD */; |
344 | 344 | ||
345 | void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx); | 345 | void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx); |
346 | |||
347 | int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | ||
348 | ASN1_TYPE *param, | ||
349 | const EVP_CIPHER *c, const EVP_MD *md, int en_de); | ||
350 | |||
351 | #ifdef OPENSSL_FIPS | ||
352 | |||
353 | #ifdef OPENSSL_DOING_MAKEDEPEND | ||
354 | #undef SHA1_Init | ||
355 | #undef SHA1_Update | ||
356 | #undef SHA224_Init | ||
357 | #undef SHA256_Init | ||
358 | #undef SHA384_Init | ||
359 | #undef SHA512_Init | ||
360 | #undef DES_set_key_unchecked | ||
361 | #endif | ||
362 | |||
363 | #define RIPEMD160_Init private_RIPEMD160_Init | ||
364 | #define WHIRLPOOL_Init private_WHIRLPOOL_Init | ||
365 | #define MD5_Init private_MD5_Init | ||
366 | #define MD4_Init private_MD4_Init | ||
367 | #define MD2_Init private_MD2_Init | ||
368 | #define MDC2_Init private_MDC2_Init | ||
369 | #define SHA_Init private_SHA_Init | ||
370 | #define SHA1_Init private_SHA1_Init | ||
371 | #define SHA224_Init private_SHA224_Init | ||
372 | #define SHA256_Init private_SHA256_Init | ||
373 | #define SHA384_Init private_SHA384_Init | ||
374 | #define SHA512_Init private_SHA512_Init | ||
375 | |||
376 | #define BF_set_key private_BF_set_key | ||
377 | #define CAST_set_key private_CAST_set_key | ||
378 | #define idea_set_encrypt_key private_idea_set_encrypt_key | ||
379 | #define SEED_set_key private_SEED_set_key | ||
380 | #define RC2_set_key private_RC2_set_key | ||
381 | #define RC4_set_key private_RC4_set_key | ||
382 | #define DES_set_key_unchecked private_DES_set_key_unchecked | ||
383 | #define Camellia_set_key private_Camellia_set_key | ||
384 | |||
385 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/evp/evp_pbe.c b/src/lib/libssl/src/crypto/evp/evp_pbe.c index c9d932d205..f8c32d825e 100644 --- a/src/lib/libssl/src/crypto/evp/evp_pbe.c +++ b/src/lib/libssl/src/crypto/evp/evp_pbe.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <openssl/evp.h> | 61 | #include <openssl/evp.h> |
62 | #include <openssl/pkcs12.h> | 62 | #include <openssl/pkcs12.h> |
63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
64 | #include "evp_locl.h" | ||
64 | 65 | ||
65 | /* Password based encryption (PBE) functions */ | 66 | /* Password based encryption (PBE) functions */ |
66 | 67 | ||
@@ -87,6 +88,10 @@ static const EVP_PBE_CTL builtin_pbe[] = | |||
87 | {EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndRC2_CBC, | 88 | {EVP_PBE_TYPE_OUTER, NID_pbeWithSHA1AndRC2_CBC, |
88 | NID_rc2_64_cbc, NID_sha1, PKCS5_PBE_keyivgen}, | 89 | NID_rc2_64_cbc, NID_sha1, PKCS5_PBE_keyivgen}, |
89 | 90 | ||
91 | #ifndef OPENSSL_NO_HMAC | ||
92 | {EVP_PBE_TYPE_OUTER, NID_id_pbkdf2, -1, -1, PKCS5_v2_PBKDF2_keyivgen}, | ||
93 | #endif | ||
94 | |||
90 | {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC4, | 95 | {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And128BitRC4, |
91 | NID_rc4, NID_sha1, PKCS12_PBE_keyivgen}, | 96 | NID_rc4, NID_sha1, PKCS12_PBE_keyivgen}, |
92 | {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC4, | 97 | {EVP_PBE_TYPE_OUTER, NID_pbe_WithSHA1And40BitRC4, |
diff --git a/src/lib/libssl/src/crypto/evp/evptests.txt b/src/lib/libssl/src/crypto/evp/evptests.txt index beb12144b6..c273707c14 100644 --- a/src/lib/libssl/src/crypto/evp/evptests.txt +++ b/src/lib/libssl/src/crypto/evp/evptests.txt | |||
@@ -158,6 +158,19 @@ AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7B | |||
158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | 158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 |
159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | 159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 |
160 | 160 | ||
161 | # AES Counter test vectors from RFC3686 | ||
162 | aes-128-ctr:AE6852F8121067CC4BF7A5765577F39E:00000030000000000000000000000001:53696E676C6520626C6F636B206D7367:E4095D4FB7A7B3792D6175A3261311B8:1 | ||
163 | aes-128-ctr:7E24067817FAE0D743D6CE1F32539163:006CB6DBC0543B59DA48D90B00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28:1 | ||
164 | aes-128-ctr:7691BE035E5020A8AC6E618529F9A0DC:00E0017B27777F3F4A1786F000000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F:1 | ||
165 | |||
166 | aes-192-ctr:16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515:0000004836733C147D6D93CB00000001:53696E676C6520626C6F636B206D7367:4B55384FE259C9C84E7935A003CBE928:1 | ||
167 | aes-192-ctr:7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A:0096B03B020C6EADC2CB500D00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:453243FC609B23327EDFAAFA7131CD9F8490701C5AD4A79CFC1FE0FF42F4FB00:1 | ||
168 | aes-192-ctr:02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE:0007BDFD5CBD60278DCC091200000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:96893FC55E5C722F540B7DD1DDF7E758D288BC95C69165884536C811662F2188ABEE0935:1 | ||
169 | |||
170 | aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:00000060DB5672C97AA8F0B200000001:53696E676C6520626C6F636B206D7367:145AD01DBF824EC7560863DC71E3E0C0:1 | ||
171 | aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1 | ||
172 | aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1 | ||
173 | |||
161 | # DES ECB tests (from destest) | 174 | # DES ECB tests (from destest) |
162 | 175 | ||
163 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | 176 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 |
diff --git a/src/lib/libssl/src/crypto/evp/m_dss.c b/src/lib/libssl/src/crypto/evp/m_dss.c index 48c2689504..4ad63ada6f 100644 --- a/src/lib/libssl/src/crypto/evp/m_dss.c +++ b/src/lib/libssl/src/crypto/evp/m_dss.c | |||
@@ -66,6 +66,7 @@ | |||
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #ifndef OPENSSL_NO_SHA | 68 | #ifndef OPENSSL_NO_SHA |
69 | #ifndef OPENSSL_FIPS | ||
69 | 70 | ||
70 | static int init(EVP_MD_CTX *ctx) | 71 | static int init(EVP_MD_CTX *ctx) |
71 | { return SHA1_Init(ctx->md_data); } | 72 | { return SHA1_Init(ctx->md_data); } |
@@ -97,3 +98,4 @@ const EVP_MD *EVP_dss(void) | |||
97 | return(&dsa_md); | 98 | return(&dsa_md); |
98 | } | 99 | } |
99 | #endif | 100 | #endif |
101 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/evp/m_dss1.c b/src/lib/libssl/src/crypto/evp/m_dss1.c index 4f03fb70e0..f80170efeb 100644 --- a/src/lib/libssl/src/crypto/evp/m_dss1.c +++ b/src/lib/libssl/src/crypto/evp/m_dss1.c | |||
@@ -68,6 +68,8 @@ | |||
68 | #include <openssl/dsa.h> | 68 | #include <openssl/dsa.h> |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifndef OPENSSL_FIPS | ||
72 | |||
71 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
72 | { return SHA1_Init(ctx->md_data); } | 74 | { return SHA1_Init(ctx->md_data); } |
73 | 75 | ||
@@ -98,3 +100,4 @@ const EVP_MD *EVP_dss1(void) | |||
98 | return(&dss1_md); | 100 | return(&dss1_md); |
99 | } | 101 | } |
100 | #endif | 102 | #endif |
103 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/evp/m_md4.c b/src/lib/libssl/src/crypto/evp/m_md4.c index 1e0b7c5b42..6d47f61b27 100644 --- a/src/lib/libssl/src/crypto/evp/m_md4.c +++ b/src/lib/libssl/src/crypto/evp/m_md4.c | |||
@@ -69,6 +69,8 @@ | |||
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #include "evp_locl.h" | ||
73 | |||
72 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
73 | { return MD4_Init(ctx->md_data); } | 75 | { return MD4_Init(ctx->md_data); } |
74 | 76 | ||
diff --git a/src/lib/libssl/src/crypto/evp/m_md5.c b/src/lib/libssl/src/crypto/evp/m_md5.c index 63c142119e..9a8bae0258 100644 --- a/src/lib/libssl/src/crypto/evp/m_md5.c +++ b/src/lib/libssl/src/crypto/evp/m_md5.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #ifndef OPENSSL_NO_RSA | 68 | #ifndef OPENSSL_NO_RSA |
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #endif | 70 | #endif |
71 | #include "evp_locl.h" | ||
71 | 72 | ||
72 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
73 | { return MD5_Init(ctx->md_data); } | 74 | { return MD5_Init(ctx->md_data); } |
diff --git a/src/lib/libssl/src/crypto/evp/m_mdc2.c b/src/lib/libssl/src/crypto/evp/m_mdc2.c index b08d559803..3602bed316 100644 --- a/src/lib/libssl/src/crypto/evp/m_mdc2.c +++ b/src/lib/libssl/src/crypto/evp/m_mdc2.c | |||
@@ -69,6 +69,8 @@ | |||
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | #include "evp_locl.h" | ||
73 | |||
72 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
73 | { return MDC2_Init(ctx->md_data); } | 75 | { return MDC2_Init(ctx->md_data); } |
74 | 76 | ||
diff --git a/src/lib/libssl/src/crypto/evp/m_ripemd.c b/src/lib/libssl/src/crypto/evp/m_ripemd.c index a1d60ee78d..7bf4804cf8 100644 --- a/src/lib/libssl/src/crypto/evp/m_ripemd.c +++ b/src/lib/libssl/src/crypto/evp/m_ripemd.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #ifndef OPENSSL_NO_RSA | 68 | #ifndef OPENSSL_NO_RSA |
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #endif | 70 | #endif |
71 | #include "evp_locl.h" | ||
71 | 72 | ||
72 | static int init(EVP_MD_CTX *ctx) | 73 | static int init(EVP_MD_CTX *ctx) |
73 | { return RIPEMD160_Init(ctx->md_data); } | 74 | { return RIPEMD160_Init(ctx->md_data); } |
diff --git a/src/lib/libssl/src/crypto/evp/m_sha.c b/src/lib/libssl/src/crypto/evp/m_sha.c index acccc8f92d..8769cdd42f 100644 --- a/src/lib/libssl/src/crypto/evp/m_sha.c +++ b/src/lib/libssl/src/crypto/evp/m_sha.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #ifndef OPENSSL_NO_RSA | 67 | #ifndef OPENSSL_NO_RSA |
68 | #include <openssl/rsa.h> | 68 | #include <openssl/rsa.h> |
69 | #endif | 69 | #endif |
70 | #include "evp_locl.h" | ||
70 | 71 | ||
71 | static int init(EVP_MD_CTX *ctx) | 72 | static int init(EVP_MD_CTX *ctx) |
72 | { return SHA_Init(ctx->md_data); } | 73 | { return SHA_Init(ctx->md_data); } |
diff --git a/src/lib/libssl/src/crypto/evp/m_sha1.c b/src/lib/libssl/src/crypto/evp/m_sha1.c index 9a2790fdea..3cb11f1ebb 100644 --- a/src/lib/libssl/src/crypto/evp/m_sha1.c +++ b/src/lib/libssl/src/crypto/evp/m_sha1.c | |||
@@ -59,6 +59,8 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | 61 | ||
62 | #ifndef OPENSSL_FIPS | ||
63 | |||
62 | #ifndef OPENSSL_NO_SHA | 64 | #ifndef OPENSSL_NO_SHA |
63 | 65 | ||
64 | #include <openssl/evp.h> | 66 | #include <openssl/evp.h> |
@@ -68,6 +70,7 @@ | |||
68 | #include <openssl/rsa.h> | 70 | #include <openssl/rsa.h> |
69 | #endif | 71 | #endif |
70 | 72 | ||
73 | |||
71 | static int init(EVP_MD_CTX *ctx) | 74 | static int init(EVP_MD_CTX *ctx) |
72 | { return SHA1_Init(ctx->md_data); } | 75 | { return SHA1_Init(ctx->md_data); } |
73 | 76 | ||
@@ -202,3 +205,5 @@ static const EVP_MD sha512_md= | |||
202 | const EVP_MD *EVP_sha512(void) | 205 | const EVP_MD *EVP_sha512(void) |
203 | { return(&sha512_md); } | 206 | { return(&sha512_md); } |
204 | #endif /* ifndef OPENSSL_NO_SHA512 */ | 207 | #endif /* ifndef OPENSSL_NO_SHA512 */ |
208 | |||
209 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/evp/names.c b/src/lib/libssl/src/crypto/evp/names.c index f2869f5c78..6311ad7cfb 100644 --- a/src/lib/libssl/src/crypto/evp/names.c +++ b/src/lib/libssl/src/crypto/evp/names.c | |||
@@ -66,6 +66,10 @@ int EVP_add_cipher(const EVP_CIPHER *c) | |||
66 | { | 66 | { |
67 | int r; | 67 | int r; |
68 | 68 | ||
69 | if (c == NULL) return 0; | ||
70 | |||
71 | OPENSSL_init(); | ||
72 | |||
69 | r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); | 73 | r=OBJ_NAME_add(OBJ_nid2sn(c->nid),OBJ_NAME_TYPE_CIPHER_METH,(const char *)c); |
70 | if (r == 0) return(0); | 74 | if (r == 0) return(0); |
71 | check_defer(c->nid); | 75 | check_defer(c->nid); |
@@ -78,6 +82,7 @@ int EVP_add_digest(const EVP_MD *md) | |||
78 | { | 82 | { |
79 | int r; | 83 | int r; |
80 | const char *name; | 84 | const char *name; |
85 | OPENSSL_init(); | ||
81 | 86 | ||
82 | name=OBJ_nid2sn(md->type); | 87 | name=OBJ_nid2sn(md->type); |
83 | r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(const char *)md); | 88 | r=OBJ_NAME_add(name,OBJ_NAME_TYPE_MD_METH,(const char *)md); |
diff --git a/src/lib/libssl/src/crypto/evp/p5_crpt.c b/src/lib/libssl/src/crypto/evp/p5_crpt.c index 7ecfa8dad9..294cc90d87 100644 --- a/src/lib/libssl/src/crypto/evp/p5_crpt.c +++ b/src/lib/libssl/src/crypto/evp/p5_crpt.c | |||
@@ -82,6 +82,8 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, | |||
82 | unsigned char *salt; | 82 | unsigned char *salt; |
83 | const unsigned char *pbuf; | 83 | const unsigned char *pbuf; |
84 | int mdsize; | 84 | int mdsize; |
85 | int rv = 0; | ||
86 | EVP_MD_CTX_init(&ctx); | ||
85 | 87 | ||
86 | /* Extract useful info from parameter */ | 88 | /* Extract useful info from parameter */ |
87 | if (param == NULL || param->type != V_ASN1_SEQUENCE || | 89 | if (param == NULL || param->type != V_ASN1_SEQUENCE || |
@@ -104,29 +106,38 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *cctx, const char *pass, int passlen, | |||
104 | if(!pass) passlen = 0; | 106 | if(!pass) passlen = 0; |
105 | else if(passlen == -1) passlen = strlen(pass); | 107 | else if(passlen == -1) passlen = strlen(pass); |
106 | 108 | ||
107 | EVP_MD_CTX_init(&ctx); | 109 | if (!EVP_DigestInit_ex(&ctx, md, NULL)) |
108 | EVP_DigestInit_ex(&ctx, md, NULL); | 110 | goto err; |
109 | EVP_DigestUpdate(&ctx, pass, passlen); | 111 | if (!EVP_DigestUpdate(&ctx, pass, passlen)) |
110 | EVP_DigestUpdate(&ctx, salt, saltlen); | 112 | goto err; |
113 | if (!EVP_DigestUpdate(&ctx, salt, saltlen)) | ||
114 | goto err; | ||
111 | PBEPARAM_free(pbe); | 115 | PBEPARAM_free(pbe); |
112 | EVP_DigestFinal_ex(&ctx, md_tmp, NULL); | 116 | if (!EVP_DigestFinal_ex(&ctx, md_tmp, NULL)) |
117 | goto err; | ||
113 | mdsize = EVP_MD_size(md); | 118 | mdsize = EVP_MD_size(md); |
114 | if (mdsize < 0) | 119 | if (mdsize < 0) |
115 | return 0; | 120 | return 0; |
116 | for (i = 1; i < iter; i++) { | 121 | for (i = 1; i < iter; i++) { |
117 | EVP_DigestInit_ex(&ctx, md, NULL); | 122 | if (!EVP_DigestInit_ex(&ctx, md, NULL)) |
118 | EVP_DigestUpdate(&ctx, md_tmp, mdsize); | 123 | goto err; |
119 | EVP_DigestFinal_ex (&ctx, md_tmp, NULL); | 124 | if (!EVP_DigestUpdate(&ctx, md_tmp, mdsize)) |
125 | goto err; | ||
126 | if (!EVP_DigestFinal_ex (&ctx, md_tmp, NULL)) | ||
127 | goto err; | ||
120 | } | 128 | } |
121 | EVP_MD_CTX_cleanup(&ctx); | ||
122 | OPENSSL_assert(EVP_CIPHER_key_length(cipher) <= (int)sizeof(md_tmp)); | 129 | OPENSSL_assert(EVP_CIPHER_key_length(cipher) <= (int)sizeof(md_tmp)); |
123 | memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher)); | 130 | memcpy(key, md_tmp, EVP_CIPHER_key_length(cipher)); |
124 | OPENSSL_assert(EVP_CIPHER_iv_length(cipher) <= 16); | 131 | OPENSSL_assert(EVP_CIPHER_iv_length(cipher) <= 16); |
125 | memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), | 132 | memcpy(iv, md_tmp + (16 - EVP_CIPHER_iv_length(cipher)), |
126 | EVP_CIPHER_iv_length(cipher)); | 133 | EVP_CIPHER_iv_length(cipher)); |
127 | EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de); | 134 | if (!EVP_CipherInit_ex(cctx, cipher, NULL, key, iv, en_de)) |
135 | goto err; | ||
128 | OPENSSL_cleanse(md_tmp, EVP_MAX_MD_SIZE); | 136 | OPENSSL_cleanse(md_tmp, EVP_MAX_MD_SIZE); |
129 | OPENSSL_cleanse(key, EVP_MAX_KEY_LENGTH); | 137 | OPENSSL_cleanse(key, EVP_MAX_KEY_LENGTH); |
130 | OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH); | 138 | OPENSSL_cleanse(iv, EVP_MAX_IV_LENGTH); |
131 | return 1; | 139 | rv = 1; |
140 | err: | ||
141 | EVP_MD_CTX_cleanup(&ctx); | ||
142 | return rv; | ||
132 | } | 143 | } |
diff --git a/src/lib/libssl/src/crypto/evp/p5_crpt2.c b/src/lib/libssl/src/crypto/evp/p5_crpt2.c index 334379f310..975d004df4 100644 --- a/src/lib/libssl/src/crypto/evp/p5_crpt2.c +++ b/src/lib/libssl/src/crypto/evp/p5_crpt2.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <openssl/x509.h> | 62 | #include <openssl/x509.h> |
63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
64 | #include <openssl/hmac.h> | 64 | #include <openssl/hmac.h> |
65 | #include "evp_locl.h" | ||
65 | 66 | ||
66 | /* set this to print out info about the keygen algorithm */ | 67 | /* set this to print out info about the keygen algorithm */ |
67 | /* #define DEBUG_PKCS5V2 */ | 68 | /* #define DEBUG_PKCS5V2 */ |
@@ -110,10 +111,14 @@ int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, | |||
110 | itmp[1] = (unsigned char)((i >> 16) & 0xff); | 111 | itmp[1] = (unsigned char)((i >> 16) & 0xff); |
111 | itmp[2] = (unsigned char)((i >> 8) & 0xff); | 112 | itmp[2] = (unsigned char)((i >> 8) & 0xff); |
112 | itmp[3] = (unsigned char)(i & 0xff); | 113 | itmp[3] = (unsigned char)(i & 0xff); |
113 | HMAC_Init_ex(&hctx, pass, passlen, digest, NULL); | 114 | if (!HMAC_Init_ex(&hctx, pass, passlen, digest, NULL) |
114 | HMAC_Update(&hctx, salt, saltlen); | 115 | || !HMAC_Update(&hctx, salt, saltlen) |
115 | HMAC_Update(&hctx, itmp, 4); | 116 | || !HMAC_Update(&hctx, itmp, 4) |
116 | HMAC_Final(&hctx, digtmp, NULL); | 117 | || !HMAC_Final(&hctx, digtmp, NULL)) |
118 | { | ||
119 | HMAC_CTX_cleanup(&hctx); | ||
120 | return 0; | ||
121 | } | ||
117 | memcpy(p, digtmp, cplen); | 122 | memcpy(p, digtmp, cplen); |
118 | for(j = 1; j < iter; j++) | 123 | for(j = 1; j < iter; j++) |
119 | { | 124 | { |
@@ -168,27 +173,24 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
168 | ASN1_TYPE *param, const EVP_CIPHER *c, const EVP_MD *md, | 173 | ASN1_TYPE *param, const EVP_CIPHER *c, const EVP_MD *md, |
169 | int en_de) | 174 | int en_de) |
170 | { | 175 | { |
171 | unsigned char *salt, key[EVP_MAX_KEY_LENGTH]; | ||
172 | const unsigned char *pbuf; | 176 | const unsigned char *pbuf; |
173 | int saltlen, iter, plen; | 177 | int plen; |
174 | unsigned int keylen; | ||
175 | PBE2PARAM *pbe2 = NULL; | 178 | PBE2PARAM *pbe2 = NULL; |
176 | const EVP_CIPHER *cipher; | 179 | const EVP_CIPHER *cipher; |
177 | PBKDF2PARAM *kdf = NULL; | 180 | |
178 | const EVP_MD *prfmd; | 181 | int rv = 0; |
179 | int prf_nid, hmac_md_nid; | ||
180 | 182 | ||
181 | if (param == NULL || param->type != V_ASN1_SEQUENCE || | 183 | if (param == NULL || param->type != V_ASN1_SEQUENCE || |
182 | param->value.sequence == NULL) { | 184 | param->value.sequence == NULL) { |
183 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | 185 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); |
184 | return 0; | 186 | goto err; |
185 | } | 187 | } |
186 | 188 | ||
187 | pbuf = param->value.sequence->data; | 189 | pbuf = param->value.sequence->data; |
188 | plen = param->value.sequence->length; | 190 | plen = param->value.sequence->length; |
189 | if(!(pbe2 = d2i_PBE2PARAM(NULL, &pbuf, plen))) { | 191 | if(!(pbe2 = d2i_PBE2PARAM(NULL, &pbuf, plen))) { |
190 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | 192 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); |
191 | return 0; | 193 | goto err; |
192 | } | 194 | } |
193 | 195 | ||
194 | /* See if we recognise the key derivation function */ | 196 | /* See if we recognise the key derivation function */ |
@@ -211,38 +213,63 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
211 | } | 213 | } |
212 | 214 | ||
213 | /* Fixup cipher based on AlgorithmIdentifier */ | 215 | /* Fixup cipher based on AlgorithmIdentifier */ |
214 | EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, en_de); | 216 | if (!EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, en_de)) |
217 | goto err; | ||
215 | if(EVP_CIPHER_asn1_to_param(ctx, pbe2->encryption->parameter) < 0) { | 218 | if(EVP_CIPHER_asn1_to_param(ctx, pbe2->encryption->parameter) < 0) { |
216 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | 219 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, |
217 | EVP_R_CIPHER_PARAMETER_ERROR); | 220 | EVP_R_CIPHER_PARAMETER_ERROR); |
218 | goto err; | 221 | goto err; |
219 | } | 222 | } |
223 | rv = PKCS5_v2_PBKDF2_keyivgen(ctx, pass, passlen, | ||
224 | pbe2->keyfunc->parameter, c, md, en_de); | ||
225 | err: | ||
226 | PBE2PARAM_free(pbe2); | ||
227 | return rv; | ||
228 | } | ||
229 | |||
230 | int PKCS5_v2_PBKDF2_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | ||
231 | ASN1_TYPE *param, | ||
232 | const EVP_CIPHER *c, const EVP_MD *md, int en_de) | ||
233 | { | ||
234 | unsigned char *salt, key[EVP_MAX_KEY_LENGTH]; | ||
235 | const unsigned char *pbuf; | ||
236 | int saltlen, iter, plen; | ||
237 | int rv = 0; | ||
238 | unsigned int keylen = 0; | ||
239 | int prf_nid, hmac_md_nid; | ||
240 | PBKDF2PARAM *kdf = NULL; | ||
241 | const EVP_MD *prfmd; | ||
242 | |||
243 | if (EVP_CIPHER_CTX_cipher(ctx) == NULL) | ||
244 | { | ||
245 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN,EVP_R_NO_CIPHER_SET); | ||
246 | goto err; | ||
247 | } | ||
220 | keylen = EVP_CIPHER_CTX_key_length(ctx); | 248 | keylen = EVP_CIPHER_CTX_key_length(ctx); |
221 | OPENSSL_assert(keylen <= sizeof key); | 249 | OPENSSL_assert(keylen <= sizeof key); |
222 | 250 | ||
223 | /* Now decode key derivation function */ | 251 | /* Decode parameter */ |
224 | 252 | ||
225 | if(!pbe2->keyfunc->parameter || | 253 | if(!param || (param->type != V_ASN1_SEQUENCE)) |
226 | (pbe2->keyfunc->parameter->type != V_ASN1_SEQUENCE)) | ||
227 | { | 254 | { |
228 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | 255 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN,EVP_R_DECODE_ERROR); |
229 | goto err; | 256 | goto err; |
230 | } | 257 | } |
231 | 258 | ||
232 | pbuf = pbe2->keyfunc->parameter->value.sequence->data; | 259 | pbuf = param->value.sequence->data; |
233 | plen = pbe2->keyfunc->parameter->value.sequence->length; | 260 | plen = param->value.sequence->length; |
261 | |||
234 | if(!(kdf = d2i_PBKDF2PARAM(NULL, &pbuf, plen)) ) { | 262 | if(!(kdf = d2i_PBKDF2PARAM(NULL, &pbuf, plen)) ) { |
235 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN,EVP_R_DECODE_ERROR); | 263 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN,EVP_R_DECODE_ERROR); |
236 | goto err; | 264 | goto err; |
237 | } | 265 | } |
238 | 266 | ||
239 | PBE2PARAM_free(pbe2); | 267 | keylen = EVP_CIPHER_CTX_key_length(ctx); |
240 | pbe2 = NULL; | ||
241 | 268 | ||
242 | /* Now check the parameters of the kdf */ | 269 | /* Now check the parameters of the kdf */ |
243 | 270 | ||
244 | if(kdf->keylength && (ASN1_INTEGER_get(kdf->keylength) != (int)keylen)){ | 271 | if(kdf->keylength && (ASN1_INTEGER_get(kdf->keylength) != (int)keylen)){ |
245 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | 272 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN, |
246 | EVP_R_UNSUPPORTED_KEYLENGTH); | 273 | EVP_R_UNSUPPORTED_KEYLENGTH); |
247 | goto err; | 274 | goto err; |
248 | } | 275 | } |
@@ -254,19 +281,19 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
254 | 281 | ||
255 | if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, prf_nid, NULL, &hmac_md_nid, 0)) | 282 | if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, prf_nid, NULL, &hmac_md_nid, 0)) |
256 | { | 283 | { |
257 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, EVP_R_UNSUPPORTED_PRF); | 284 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN, EVP_R_UNSUPPORTED_PRF); |
258 | goto err; | 285 | goto err; |
259 | } | 286 | } |
260 | 287 | ||
261 | prfmd = EVP_get_digestbynid(hmac_md_nid); | 288 | prfmd = EVP_get_digestbynid(hmac_md_nid); |
262 | if (prfmd == NULL) | 289 | if (prfmd == NULL) |
263 | { | 290 | { |
264 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, EVP_R_UNSUPPORTED_PRF); | 291 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN, EVP_R_UNSUPPORTED_PRF); |
265 | goto err; | 292 | goto err; |
266 | } | 293 | } |
267 | 294 | ||
268 | if(kdf->salt->type != V_ASN1_OCTET_STRING) { | 295 | if(kdf->salt->type != V_ASN1_OCTET_STRING) { |
269 | EVPerr(EVP_F_PKCS5_V2_PBE_KEYIVGEN, | 296 | EVPerr(EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN, |
270 | EVP_R_UNSUPPORTED_SALT_TYPE); | 297 | EVP_R_UNSUPPORTED_SALT_TYPE); |
271 | goto err; | 298 | goto err; |
272 | } | 299 | } |
@@ -278,15 +305,11 @@ int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
278 | if(!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, prfmd, | 305 | if(!PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, prfmd, |
279 | keylen, key)) | 306 | keylen, key)) |
280 | goto err; | 307 | goto err; |
281 | EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL, en_de); | 308 | rv = EVP_CipherInit_ex(ctx, NULL, NULL, key, NULL, en_de); |
282 | OPENSSL_cleanse(key, keylen); | ||
283 | PBKDF2PARAM_free(kdf); | ||
284 | return 1; | ||
285 | |||
286 | err: | 309 | err: |
287 | PBE2PARAM_free(pbe2); | 310 | OPENSSL_cleanse(key, keylen); |
288 | PBKDF2PARAM_free(kdf); | 311 | PBKDF2PARAM_free(kdf); |
289 | return 0; | 312 | return rv; |
290 | } | 313 | } |
291 | 314 | ||
292 | #ifdef DEBUG_PKCS5V2 | 315 | #ifdef DEBUG_PKCS5V2 |
diff --git a/src/lib/libssl/src/crypto/evp/p_open.c b/src/lib/libssl/src/crypto/evp/p_open.c index 53a59a295c..c748fbea87 100644 --- a/src/lib/libssl/src/crypto/evp/p_open.c +++ b/src/lib/libssl/src/crypto/evp/p_open.c | |||
@@ -115,7 +115,8 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | |||
115 | int i; | 115 | int i; |
116 | 116 | ||
117 | i=EVP_DecryptFinal_ex(ctx,out,outl); | 117 | i=EVP_DecryptFinal_ex(ctx,out,outl); |
118 | EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL); | 118 | if (i) |
119 | i = EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL); | ||
119 | return(i); | 120 | return(i); |
120 | } | 121 | } |
121 | #else /* !OPENSSL_NO_RSA */ | 122 | #else /* !OPENSSL_NO_RSA */ |
diff --git a/src/lib/libssl/src/crypto/evp/p_seal.c b/src/lib/libssl/src/crypto/evp/p_seal.c index d8324526e7..e5919b0fbf 100644 --- a/src/lib/libssl/src/crypto/evp/p_seal.c +++ b/src/lib/libssl/src/crypto/evp/p_seal.c | |||
@@ -110,6 +110,7 @@ int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | |||
110 | { | 110 | { |
111 | int i; | 111 | int i; |
112 | i = EVP_EncryptFinal_ex(ctx,out,outl); | 112 | i = EVP_EncryptFinal_ex(ctx,out,outl); |
113 | EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL); | 113 | if (i) |
114 | i = EVP_EncryptInit_ex(ctx,NULL,NULL,NULL,NULL); | ||
114 | return i; | 115 | return i; |
115 | } | 116 | } |
diff --git a/src/lib/libssl/src/crypto/evp/p_sign.c b/src/lib/libssl/src/crypto/evp/p_sign.c index bb893f5bde..dfa48c157c 100644 --- a/src/lib/libssl/src/crypto/evp/p_sign.c +++ b/src/lib/libssl/src/crypto/evp/p_sign.c | |||
@@ -80,18 +80,20 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, | |||
80 | { | 80 | { |
81 | unsigned char m[EVP_MAX_MD_SIZE]; | 81 | unsigned char m[EVP_MAX_MD_SIZE]; |
82 | unsigned int m_len; | 82 | unsigned int m_len; |
83 | int i,ok=0,v; | 83 | int i=0,ok=0,v; |
84 | EVP_MD_CTX tmp_ctx; | 84 | EVP_MD_CTX tmp_ctx; |
85 | EVP_PKEY_CTX *pkctx = NULL; | ||
85 | 86 | ||
86 | *siglen=0; | 87 | *siglen=0; |
87 | EVP_MD_CTX_init(&tmp_ctx); | 88 | EVP_MD_CTX_init(&tmp_ctx); |
88 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); | 89 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx)) |
89 | EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); | 90 | goto err; |
91 | if (!EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len)) | ||
92 | goto err; | ||
90 | EVP_MD_CTX_cleanup(&tmp_ctx); | 93 | EVP_MD_CTX_cleanup(&tmp_ctx); |
91 | 94 | ||
92 | if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) | 95 | if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) |
93 | { | 96 | { |
94 | EVP_PKEY_CTX *pkctx = NULL; | ||
95 | size_t sltmp = (size_t)EVP_PKEY_size(pkey); | 97 | size_t sltmp = (size_t)EVP_PKEY_size(pkey); |
96 | i = 0; | 98 | i = 0; |
97 | pkctx = EVP_PKEY_CTX_new(pkey, NULL); | 99 | pkctx = EVP_PKEY_CTX_new(pkey, NULL); |
diff --git a/src/lib/libssl/src/crypto/evp/p_verify.c b/src/lib/libssl/src/crypto/evp/p_verify.c index 41d4b67130..5f5c409f45 100644 --- a/src/lib/libssl/src/crypto/evp/p_verify.c +++ b/src/lib/libssl/src/crypto/evp/p_verify.c | |||
@@ -67,17 +67,19 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, | |||
67 | { | 67 | { |
68 | unsigned char m[EVP_MAX_MD_SIZE]; | 68 | unsigned char m[EVP_MAX_MD_SIZE]; |
69 | unsigned int m_len; | 69 | unsigned int m_len; |
70 | int i,ok=0,v; | 70 | int i=-1,ok=0,v; |
71 | EVP_MD_CTX tmp_ctx; | 71 | EVP_MD_CTX tmp_ctx; |
72 | EVP_PKEY_CTX *pkctx = NULL; | ||
72 | 73 | ||
73 | EVP_MD_CTX_init(&tmp_ctx); | 74 | EVP_MD_CTX_init(&tmp_ctx); |
74 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); | 75 | if (!EVP_MD_CTX_copy_ex(&tmp_ctx,ctx)) |
75 | EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len); | 76 | goto err; |
77 | if (!EVP_DigestFinal_ex(&tmp_ctx,&(m[0]),&m_len)) | ||
78 | goto err; | ||
76 | EVP_MD_CTX_cleanup(&tmp_ctx); | 79 | EVP_MD_CTX_cleanup(&tmp_ctx); |
77 | 80 | ||
78 | if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) | 81 | if (ctx->digest->flags & EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) |
79 | { | 82 | { |
80 | EVP_PKEY_CTX *pkctx = NULL; | ||
81 | i = -1; | 83 | i = -1; |
82 | pkctx = EVP_PKEY_CTX_new(pkey, NULL); | 84 | pkctx = EVP_PKEY_CTX_new(pkey, NULL); |
83 | if (!pkctx) | 85 | if (!pkctx) |
diff --git a/src/lib/libssl/src/crypto/hmac/hmac.c b/src/lib/libssl/src/crypto/hmac/hmac.c index 6c98fc43a3..ba27cbf56f 100644 --- a/src/lib/libssl/src/crypto/hmac/hmac.c +++ b/src/lib/libssl/src/crypto/hmac/hmac.c | |||
@@ -61,12 +61,34 @@ | |||
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/hmac.h> | 62 | #include <openssl/hmac.h> |
63 | 63 | ||
64 | #ifdef OPENSSL_FIPS | ||
65 | #include <openssl/fips.h> | ||
66 | #endif | ||
67 | |||
64 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, | 68 | int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, |
65 | const EVP_MD *md, ENGINE *impl) | 69 | const EVP_MD *md, ENGINE *impl) |
66 | { | 70 | { |
67 | int i,j,reset=0; | 71 | int i,j,reset=0; |
68 | unsigned char pad[HMAC_MAX_MD_CBLOCK]; | 72 | unsigned char pad[HMAC_MAX_MD_CBLOCK]; |
69 | 73 | ||
74 | #ifdef OPENSSL_FIPS | ||
75 | if (FIPS_mode()) | ||
76 | { | ||
77 | /* If we have an ENGINE need to allow non FIPS */ | ||
78 | if ((impl || ctx->i_ctx.engine) | ||
79 | && !(ctx->i_ctx.flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW)) | ||
80 | { | ||
81 | EVPerr(EVP_F_HMAC_INIT_EX, EVP_R_DISABLED_FOR_FIPS); | ||
82 | return 0; | ||
83 | } | ||
84 | /* Other algorithm blocking will be done in FIPS_cmac_init, | ||
85 | * via FIPS_hmac_init_ex(). | ||
86 | */ | ||
87 | if (!impl && !ctx->i_ctx.engine) | ||
88 | return FIPS_hmac_init_ex(ctx, key, len, md, NULL); | ||
89 | } | ||
90 | #endif | ||
91 | |||
70 | if (md != NULL) | 92 | if (md != NULL) |
71 | { | 93 | { |
72 | reset=1; | 94 | reset=1; |
@@ -133,6 +155,10 @@ int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md) | |||
133 | 155 | ||
134 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len) | 156 | int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len) |
135 | { | 157 | { |
158 | #ifdef OPENSSL_FIPS | ||
159 | if (FIPS_mode() && !ctx->i_ctx.engine) | ||
160 | return FIPS_hmac_update(ctx, data, len); | ||
161 | #endif | ||
136 | return EVP_DigestUpdate(&ctx->md_ctx,data,len); | 162 | return EVP_DigestUpdate(&ctx->md_ctx,data,len); |
137 | } | 163 | } |
138 | 164 | ||
@@ -140,6 +166,10 @@ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) | |||
140 | { | 166 | { |
141 | unsigned int i; | 167 | unsigned int i; |
142 | unsigned char buf[EVP_MAX_MD_SIZE]; | 168 | unsigned char buf[EVP_MAX_MD_SIZE]; |
169 | #ifdef OPENSSL_FIPS | ||
170 | if (FIPS_mode() && !ctx->i_ctx.engine) | ||
171 | return FIPS_hmac_final(ctx, md, len); | ||
172 | #endif | ||
143 | 173 | ||
144 | if (!EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i)) | 174 | if (!EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i)) |
145 | goto err; | 175 | goto err; |
@@ -179,6 +209,13 @@ int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx) | |||
179 | 209 | ||
180 | void HMAC_CTX_cleanup(HMAC_CTX *ctx) | 210 | void HMAC_CTX_cleanup(HMAC_CTX *ctx) |
181 | { | 211 | { |
212 | #ifdef OPENSSL_FIPS | ||
213 | if (FIPS_mode() && !ctx->i_ctx.engine) | ||
214 | { | ||
215 | FIPS_hmac_ctx_cleanup(ctx); | ||
216 | return; | ||
217 | } | ||
218 | #endif | ||
182 | EVP_MD_CTX_cleanup(&ctx->i_ctx); | 219 | EVP_MD_CTX_cleanup(&ctx->i_ctx); |
183 | EVP_MD_CTX_cleanup(&ctx->o_ctx); | 220 | EVP_MD_CTX_cleanup(&ctx->o_ctx); |
184 | EVP_MD_CTX_cleanup(&ctx->md_ctx); | 221 | EVP_MD_CTX_cleanup(&ctx->md_ctx); |
diff --git a/src/lib/libssl/src/crypto/idea/Makefile b/src/lib/libssl/src/crypto/idea/Makefile index b2e7add666..8af0acdad9 100644 --- a/src/lib/libssl/src/crypto/idea/Makefile +++ b/src/lib/libssl/src/crypto/idea/Makefile | |||
@@ -82,5 +82,8 @@ i_ecb.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h | |||
82 | i_ecb.o: ../../include/openssl/opensslv.h i_ecb.c idea_lcl.h | 82 | i_ecb.o: ../../include/openssl/opensslv.h i_ecb.c idea_lcl.h |
83 | i_ofb64.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h | 83 | i_ofb64.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h |
84 | i_ofb64.o: i_ofb64.c idea_lcl.h | 84 | i_ofb64.o: i_ofb64.c idea_lcl.h |
85 | i_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
85 | i_skey.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h | 86 | i_skey.o: ../../include/openssl/idea.h ../../include/openssl/opensslconf.h |
86 | i_skey.o: i_skey.c idea_lcl.h | 87 | i_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
88 | i_skey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
89 | i_skey.o: ../../include/openssl/symhacks.h i_skey.c idea_lcl.h | ||
diff --git a/src/lib/libssl/src/crypto/idea/idea.h b/src/lib/libssl/src/crypto/idea/idea.h index 5782e54b0f..e9a1e7f1a5 100644 --- a/src/lib/libssl/src/crypto/idea/idea.h +++ b/src/lib/libssl/src/crypto/idea/idea.h | |||
@@ -83,6 +83,9 @@ typedef struct idea_key_st | |||
83 | const char *idea_options(void); | 83 | const char *idea_options(void); |
84 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, | 84 | void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, |
85 | IDEA_KEY_SCHEDULE *ks); | 85 | IDEA_KEY_SCHEDULE *ks); |
86 | #ifdef OPENSSL_FIPS | ||
87 | void private_idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); | ||
88 | #endif | ||
86 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); | 89 | void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); |
87 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); | 90 | void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); |
88 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, | 91 | void idea_cbc_encrypt(const unsigned char *in, unsigned char *out, |
diff --git a/src/lib/libssl/src/crypto/md2/md2.h b/src/lib/libssl/src/crypto/md2/md2.h index a46120e7d4..d59c9f2593 100644 --- a/src/lib/libssl/src/crypto/md2/md2.h +++ b/src/lib/libssl/src/crypto/md2/md2.h | |||
@@ -81,6 +81,9 @@ typedef struct MD2state_st | |||
81 | } MD2_CTX; | 81 | } MD2_CTX; |
82 | 82 | ||
83 | const char *MD2_options(void); | 83 | const char *MD2_options(void); |
84 | #ifdef OPENSSL_FIPS | ||
85 | int private_MD2_Init(MD2_CTX *c); | ||
86 | #endif | ||
84 | int MD2_Init(MD2_CTX *c); | 87 | int MD2_Init(MD2_CTX *c); |
85 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); | 88 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); |
86 | int MD2_Final(unsigned char *md, MD2_CTX *c); | 89 | int MD2_Final(unsigned char *md, MD2_CTX *c); |
diff --git a/src/lib/libssl/src/crypto/md2/md2_dgst.c b/src/lib/libssl/src/crypto/md2/md2_dgst.c index c57b3da288..bf89def73e 100644 --- a/src/lib/libssl/src/crypto/md2/md2_dgst.c +++ b/src/lib/libssl/src/crypto/md2/md2_dgst.c | |||
@@ -116,7 +116,7 @@ const char *MD2_options(void) | |||
116 | return("md2(int)"); | 116 | return("md2(int)"); |
117 | } | 117 | } |
118 | 118 | ||
119 | int MD2_Init(MD2_CTX *c) | 119 | fips_md_init(MD2) |
120 | { | 120 | { |
121 | c->num=0; | 121 | c->num=0; |
122 | memset(c->state,0,sizeof c->state); | 122 | memset(c->state,0,sizeof c->state); |
diff --git a/src/lib/libssl/src/crypto/md4/Makefile b/src/lib/libssl/src/crypto/md4/Makefile index c94a1398ed..e6f1e4478c 100644 --- a/src/lib/libssl/src/crypto/md4/Makefile +++ b/src/lib/libssl/src/crypto/md4/Makefile | |||
@@ -76,9 +76,11 @@ clean: | |||
76 | 76 | ||
77 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 77 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
78 | 78 | ||
79 | md4_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md4.h | 79 | md4_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
80 | md4_dgst.o: ../../include/openssl/opensslconf.h | 80 | md4_dgst.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h |
81 | md4_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md4_dgst.c | 81 | md4_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
82 | md4_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
83 | md4_dgst.o: ../../include/openssl/symhacks.h ../md32_common.h md4_dgst.c | ||
82 | md4_dgst.o: md4_locl.h | 84 | md4_dgst.o: md4_locl.h |
83 | md4_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 85 | md4_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
84 | md4_one.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h | 86 | md4_one.o: ../../include/openssl/md4.h ../../include/openssl/opensslconf.h |
diff --git a/src/lib/libssl/src/crypto/md4/md4.h b/src/lib/libssl/src/crypto/md4/md4.h index c3ed9b3f75..a55368a790 100644 --- a/src/lib/libssl/src/crypto/md4/md4.h +++ b/src/lib/libssl/src/crypto/md4/md4.h | |||
@@ -105,6 +105,9 @@ typedef struct MD4state_st | |||
105 | unsigned int num; | 105 | unsigned int num; |
106 | } MD4_CTX; | 106 | } MD4_CTX; |
107 | 107 | ||
108 | #ifdef OPENSSL_FIPS | ||
109 | int private_MD4_Init(MD4_CTX *c); | ||
110 | #endif | ||
108 | int MD4_Init(MD4_CTX *c); | 111 | int MD4_Init(MD4_CTX *c); |
109 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); | 112 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); |
110 | int MD4_Final(unsigned char *md, MD4_CTX *c); | 113 | int MD4_Final(unsigned char *md, MD4_CTX *c); |
diff --git a/src/lib/libssl/src/crypto/md4/md4_dgst.c b/src/lib/libssl/src/crypto/md4/md4_dgst.c index e0c42e8596..82c2cb2d98 100644 --- a/src/lib/libssl/src/crypto/md4/md4_dgst.c +++ b/src/lib/libssl/src/crypto/md4/md4_dgst.c | |||
@@ -57,8 +57,9 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "md4_locl.h" | ||
61 | #include <openssl/opensslv.h> | 60 | #include <openssl/opensslv.h> |
61 | #include <openssl/crypto.h> | ||
62 | #include "md4_locl.h" | ||
62 | 63 | ||
63 | const char MD4_version[]="MD4" OPENSSL_VERSION_PTEXT; | 64 | const char MD4_version[]="MD4" OPENSSL_VERSION_PTEXT; |
64 | 65 | ||
@@ -70,7 +71,7 @@ const char MD4_version[]="MD4" OPENSSL_VERSION_PTEXT; | |||
70 | #define INIT_DATA_C (unsigned long)0x98badcfeL | 71 | #define INIT_DATA_C (unsigned long)0x98badcfeL |
71 | #define INIT_DATA_D (unsigned long)0x10325476L | 72 | #define INIT_DATA_D (unsigned long)0x10325476L |
72 | 73 | ||
73 | int MD4_Init(MD4_CTX *c) | 74 | fips_md_init(MD4) |
74 | { | 75 | { |
75 | memset (c,0,sizeof(*c)); | 76 | memset (c,0,sizeof(*c)); |
76 | c->A=INIT_DATA_A; | 77 | c->A=INIT_DATA_A; |
diff --git a/src/lib/libssl/src/crypto/md5/Makefile b/src/lib/libssl/src/crypto/md5/Makefile index 9858d53d31..b9e2ce9a38 100644 --- a/src/lib/libssl/src/crypto/md5/Makefile +++ b/src/lib/libssl/src/crypto/md5/Makefile | |||
@@ -89,9 +89,11 @@ clean: | |||
89 | 89 | ||
90 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 90 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
91 | 91 | ||
92 | md5_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/md5.h | 92 | md5_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
93 | md5_dgst.o: ../../include/openssl/opensslconf.h | 93 | md5_dgst.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h |
94 | md5_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md5_dgst.c | 94 | md5_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
95 | md5_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
96 | md5_dgst.o: ../../include/openssl/symhacks.h ../md32_common.h md5_dgst.c | ||
95 | md5_dgst.o: md5_locl.h | 97 | md5_dgst.o: md5_locl.h |
96 | md5_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 98 | md5_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
97 | md5_one.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h | 99 | md5_one.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h |
diff --git a/src/lib/libssl/src/crypto/md5/md5.h b/src/lib/libssl/src/crypto/md5/md5.h index 4cbf84386b..541cc925fe 100644 --- a/src/lib/libssl/src/crypto/md5/md5.h +++ b/src/lib/libssl/src/crypto/md5/md5.h | |||
@@ -105,6 +105,9 @@ typedef struct MD5state_st | |||
105 | unsigned int num; | 105 | unsigned int num; |
106 | } MD5_CTX; | 106 | } MD5_CTX; |
107 | 107 | ||
108 | #ifdef OPENSSL_FIPS | ||
109 | int private_MD5_Init(MD5_CTX *c); | ||
110 | #endif | ||
108 | int MD5_Init(MD5_CTX *c); | 111 | int MD5_Init(MD5_CTX *c); |
109 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); | 112 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); |
110 | int MD5_Final(unsigned char *md, MD5_CTX *c); | 113 | int MD5_Final(unsigned char *md, MD5_CTX *c); |
diff --git a/src/lib/libssl/src/crypto/md5/md5_dgst.c b/src/lib/libssl/src/crypto/md5/md5_dgst.c index beace632e3..265890de52 100644 --- a/src/lib/libssl/src/crypto/md5/md5_dgst.c +++ b/src/lib/libssl/src/crypto/md5/md5_dgst.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "md5_locl.h" | 60 | #include "md5_locl.h" |
61 | #include <openssl/opensslv.h> | 61 | #include <openssl/opensslv.h> |
62 | #include <openssl/crypto.h> | ||
62 | 63 | ||
63 | const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT; | 64 | const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT; |
64 | 65 | ||
@@ -70,7 +71,7 @@ const char MD5_version[]="MD5" OPENSSL_VERSION_PTEXT; | |||
70 | #define INIT_DATA_C (unsigned long)0x98badcfeL | 71 | #define INIT_DATA_C (unsigned long)0x98badcfeL |
71 | #define INIT_DATA_D (unsigned long)0x10325476L | 72 | #define INIT_DATA_D (unsigned long)0x10325476L |
72 | 73 | ||
73 | int MD5_Init(MD5_CTX *c) | 74 | fips_md_init(MD5) |
74 | { | 75 | { |
75 | memset (c,0,sizeof(*c)); | 76 | memset (c,0,sizeof(*c)); |
76 | c->A=INIT_DATA_A; | 77 | c->A=INIT_DATA_A; |
diff --git a/src/lib/libssl/src/crypto/mdc2/Makefile b/src/lib/libssl/src/crypto/mdc2/Makefile index 1d064f17a6..141553149d 100644 --- a/src/lib/libssl/src/crypto/mdc2/Makefile +++ b/src/lib/libssl/src/crypto/mdc2/Makefile | |||
@@ -84,10 +84,10 @@ mdc2_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
84 | mdc2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | 84 | mdc2_one.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
85 | mdc2_one.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h | 85 | mdc2_one.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
86 | mdc2_one.o: ../../include/openssl/ui_compat.h ../cryptlib.h mdc2_one.c | 86 | mdc2_one.o: ../../include/openssl/ui_compat.h ../cryptlib.h mdc2_one.c |
87 | mdc2dgst.o: ../../include/openssl/des.h ../../include/openssl/des_old.h | 87 | mdc2dgst.o: ../../include/openssl/crypto.h ../../include/openssl/des.h |
88 | mdc2dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/mdc2.h | 88 | mdc2dgst.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h |
89 | mdc2dgst.o: ../../include/openssl/opensslconf.h | 89 | mdc2dgst.o: ../../include/openssl/mdc2.h ../../include/openssl/opensslconf.h |
90 | mdc2dgst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | 90 | mdc2dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
91 | mdc2dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 91 | mdc2dgst.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h |
92 | mdc2dgst.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h | 92 | mdc2dgst.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h |
93 | mdc2dgst.o: mdc2dgst.c | 93 | mdc2dgst.o: ../../include/openssl/ui_compat.h mdc2dgst.c |
diff --git a/src/lib/libssl/src/crypto/mdc2/mdc2.h b/src/lib/libssl/src/crypto/mdc2/mdc2.h index 72778a5212..f3e8e579d2 100644 --- a/src/lib/libssl/src/crypto/mdc2/mdc2.h +++ b/src/lib/libssl/src/crypto/mdc2/mdc2.h | |||
@@ -81,6 +81,9 @@ typedef struct mdc2_ctx_st | |||
81 | } MDC2_CTX; | 81 | } MDC2_CTX; |
82 | 82 | ||
83 | 83 | ||
84 | #ifdef OPENSSL_FIPS | ||
85 | int private_MDC2_Init(MDC2_CTX *c); | ||
86 | #endif | ||
84 | int MDC2_Init(MDC2_CTX *c); | 87 | int MDC2_Init(MDC2_CTX *c); |
85 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); | 88 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); |
86 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); | 89 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); |
diff --git a/src/lib/libssl/src/crypto/mem.c b/src/lib/libssl/src/crypto/mem.c index 6f80dd33eb..21c0011380 100644 --- a/src/lib/libssl/src/crypto/mem.c +++ b/src/lib/libssl/src/crypto/mem.c | |||
@@ -125,6 +125,7 @@ static long (*get_debug_options_func)(void) = NULL; | |||
125 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), | 125 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), |
126 | void (*f)(void *)) | 126 | void (*f)(void *)) |
127 | { | 127 | { |
128 | OPENSSL_init(); | ||
128 | if (!allow_customize) | 129 | if (!allow_customize) |
129 | return 0; | 130 | return 0; |
130 | if ((m == 0) || (r == 0) || (f == 0)) | 131 | if ((m == 0) || (r == 0) || (f == 0)) |
@@ -186,6 +187,7 @@ int CRYPTO_set_mem_debug_functions(void (*m)(void *,int,const char *,int,int), | |||
186 | { | 187 | { |
187 | if (!allow_customize_debug) | 188 | if (!allow_customize_debug) |
188 | return 0; | 189 | return 0; |
190 | OPENSSL_init(); | ||
189 | malloc_debug_func=m; | 191 | malloc_debug_func=m; |
190 | realloc_debug_func=r; | 192 | realloc_debug_func=r; |
191 | free_debug_func=f; | 193 | free_debug_func=f; |
@@ -361,6 +363,10 @@ void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file, | |||
361 | 363 | ||
362 | if (num <= 0) return NULL; | 364 | if (num <= 0) return NULL; |
363 | 365 | ||
366 | /* We don't support shrinking the buffer. Note the memcpy that copies | ||
367 | * |old_len| bytes to the new buffer, below. */ | ||
368 | if (num < old_len) return NULL; | ||
369 | |||
364 | if (realloc_debug_func != NULL) | 370 | if (realloc_debug_func != NULL) |
365 | realloc_debug_func(str, NULL, num, file, line, 0); | 371 | realloc_debug_func(str, NULL, num, file, line, 0); |
366 | ret=malloc_ex_func(num,file,line); | 372 | ret=malloc_ex_func(num,file,line); |
diff --git a/src/lib/libssl/src/crypto/objects/obj_dat.h b/src/lib/libssl/src/crypto/objects/obj_dat.h index 6449be6071..d404ad07c9 100644 --- a/src/lib/libssl/src/crypto/objects/obj_dat.h +++ b/src/lib/libssl/src/crypto/objects/obj_dat.h | |||
@@ -62,12 +62,12 @@ | |||
62 | * [including the GNU Public Licence.] | 62 | * [including the GNU Public Licence.] |
63 | */ | 63 | */ |
64 | 64 | ||
65 | #define NUM_NID 893 | 65 | #define NUM_NID 920 |
66 | #define NUM_SN 886 | 66 | #define NUM_SN 913 |
67 | #define NUM_LN 886 | 67 | #define NUM_LN 913 |
68 | #define NUM_OBJ 840 | 68 | #define NUM_OBJ 857 |
69 | 69 | ||
70 | static const unsigned char lvalues[5824]={ | 70 | static const unsigned char lvalues[5980]={ |
71 | 0x00, /* [ 0] OBJ_undef */ | 71 | 0x00, /* [ 0] OBJ_undef */ |
72 | 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */ | 72 | 0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 1] OBJ_rsadsi */ |
73 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */ | 73 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 7] OBJ_pkcs */ |
@@ -908,6 +908,23 @@ static const unsigned char lvalues[5824]={ | |||
908 | 0x55,0x04,0x34, /* [5814] OBJ_supportedAlgorithms */ | 908 | 0x55,0x04,0x34, /* [5814] OBJ_supportedAlgorithms */ |
909 | 0x55,0x04,0x35, /* [5817] OBJ_deltaRevocationList */ | 909 | 0x55,0x04,0x35, /* [5817] OBJ_deltaRevocationList */ |
910 | 0x55,0x04,0x36, /* [5820] OBJ_dmdName */ | 910 | 0x55,0x04,0x36, /* [5820] OBJ_dmdName */ |
911 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x09,0x10,0x03,0x09,/* [5823] OBJ_id_alg_PWRI_KEK */ | ||
912 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x06,/* [5834] OBJ_aes_128_gcm */ | ||
913 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x07,/* [5843] OBJ_aes_128_ccm */ | ||
914 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x08,/* [5852] OBJ_id_aes128_wrap_pad */ | ||
915 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1A,/* [5861] OBJ_aes_192_gcm */ | ||
916 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1B,/* [5870] OBJ_aes_192_ccm */ | ||
917 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x1C,/* [5879] OBJ_id_aes192_wrap_pad */ | ||
918 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2E,/* [5888] OBJ_aes_256_gcm */ | ||
919 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x2F,/* [5897] OBJ_aes_256_ccm */ | ||
920 | 0x60,0x86,0x48,0x01,0x65,0x03,0x04,0x01,0x30,/* [5906] OBJ_id_aes256_wrap_pad */ | ||
921 | 0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x02,/* [5915] OBJ_id_camellia128_wrap */ | ||
922 | 0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x03,/* [5926] OBJ_id_camellia192_wrap */ | ||
923 | 0x2A,0x83,0x08,0x8C,0x9A,0x4B,0x3D,0x01,0x01,0x03,0x04,/* [5937] OBJ_id_camellia256_wrap */ | ||
924 | 0x55,0x1D,0x25,0x00, /* [5948] OBJ_anyExtendedKeyUsage */ | ||
925 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x08,/* [5952] OBJ_mgf1 */ | ||
926 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x0A,/* [5961] OBJ_rsassaPss */ | ||
927 | 0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01,0x01,0x07,/* [5970] OBJ_rsaesOaep */ | ||
911 | }; | 928 | }; |
912 | 929 | ||
913 | static const ASN1_OBJECT nid_objs[NUM_NID]={ | 930 | static const ASN1_OBJECT nid_objs[NUM_NID]={ |
@@ -2351,28 +2368,74 @@ static const ASN1_OBJECT nid_objs[NUM_NID]={ | |||
2351 | {"deltaRevocationList","deltaRevocationList",NID_deltaRevocationList, | 2368 | {"deltaRevocationList","deltaRevocationList",NID_deltaRevocationList, |
2352 | 3,&(lvalues[5817]),0}, | 2369 | 3,&(lvalues[5817]),0}, |
2353 | {"dmdName","dmdName",NID_dmdName,3,&(lvalues[5820]),0}, | 2370 | {"dmdName","dmdName",NID_dmdName,3,&(lvalues[5820]),0}, |
2371 | {"id-alg-PWRI-KEK","id-alg-PWRI-KEK",NID_id_alg_PWRI_KEK,11, | ||
2372 | &(lvalues[5823]),0}, | ||
2373 | {"CMAC","cmac",NID_cmac,0,NULL,0}, | ||
2374 | {"id-aes128-GCM","aes-128-gcm",NID_aes_128_gcm,9,&(lvalues[5834]),0}, | ||
2375 | {"id-aes128-CCM","aes-128-ccm",NID_aes_128_ccm,9,&(lvalues[5843]),0}, | ||
2376 | {"id-aes128-wrap-pad","id-aes128-wrap-pad",NID_id_aes128_wrap_pad,9, | ||
2377 | &(lvalues[5852]),0}, | ||
2378 | {"id-aes192-GCM","aes-192-gcm",NID_aes_192_gcm,9,&(lvalues[5861]),0}, | ||
2379 | {"id-aes192-CCM","aes-192-ccm",NID_aes_192_ccm,9,&(lvalues[5870]),0}, | ||
2380 | {"id-aes192-wrap-pad","id-aes192-wrap-pad",NID_id_aes192_wrap_pad,9, | ||
2381 | &(lvalues[5879]),0}, | ||
2382 | {"id-aes256-GCM","aes-256-gcm",NID_aes_256_gcm,9,&(lvalues[5888]),0}, | ||
2383 | {"id-aes256-CCM","aes-256-ccm",NID_aes_256_ccm,9,&(lvalues[5897]),0}, | ||
2384 | {"id-aes256-wrap-pad","id-aes256-wrap-pad",NID_id_aes256_wrap_pad,9, | ||
2385 | &(lvalues[5906]),0}, | ||
2386 | {"AES-128-CTR","aes-128-ctr",NID_aes_128_ctr,0,NULL,0}, | ||
2387 | {"AES-192-CTR","aes-192-ctr",NID_aes_192_ctr,0,NULL,0}, | ||
2388 | {"AES-256-CTR","aes-256-ctr",NID_aes_256_ctr,0,NULL,0}, | ||
2389 | {"id-camellia128-wrap","id-camellia128-wrap",NID_id_camellia128_wrap, | ||
2390 | 11,&(lvalues[5915]),0}, | ||
2391 | {"id-camellia192-wrap","id-camellia192-wrap",NID_id_camellia192_wrap, | ||
2392 | 11,&(lvalues[5926]),0}, | ||
2393 | {"id-camellia256-wrap","id-camellia256-wrap",NID_id_camellia256_wrap, | ||
2394 | 11,&(lvalues[5937]),0}, | ||
2395 | {"anyExtendedKeyUsage","Any Extended Key Usage", | ||
2396 | NID_anyExtendedKeyUsage,4,&(lvalues[5948]),0}, | ||
2397 | {"MGF1","mgf1",NID_mgf1,9,&(lvalues[5952]),0}, | ||
2398 | {"RSASSA-PSS","rsassaPss",NID_rsassaPss,9,&(lvalues[5961]),0}, | ||
2399 | {"AES-128-XTS","aes-128-xts",NID_aes_128_xts,0,NULL,0}, | ||
2400 | {"AES-256-XTS","aes-256-xts",NID_aes_256_xts,0,NULL,0}, | ||
2401 | {"RC4-HMAC-MD5","rc4-hmac-md5",NID_rc4_hmac_md5,0,NULL,0}, | ||
2402 | {"AES-128-CBC-HMAC-SHA1","aes-128-cbc-hmac-sha1", | ||
2403 | NID_aes_128_cbc_hmac_sha1,0,NULL,0}, | ||
2404 | {"AES-192-CBC-HMAC-SHA1","aes-192-cbc-hmac-sha1", | ||
2405 | NID_aes_192_cbc_hmac_sha1,0,NULL,0}, | ||
2406 | {"AES-256-CBC-HMAC-SHA1","aes-256-cbc-hmac-sha1", | ||
2407 | NID_aes_256_cbc_hmac_sha1,0,NULL,0}, | ||
2408 | {"RSAES-OAEP","rsaesOaep",NID_rsaesOaep,9,&(lvalues[5970]),0}, | ||
2354 | }; | 2409 | }; |
2355 | 2410 | ||
2356 | static const unsigned int sn_objs[NUM_SN]={ | 2411 | static const unsigned int sn_objs[NUM_SN]={ |
2357 | 364, /* "AD_DVCS" */ | 2412 | 364, /* "AD_DVCS" */ |
2358 | 419, /* "AES-128-CBC" */ | 2413 | 419, /* "AES-128-CBC" */ |
2414 | 916, /* "AES-128-CBC-HMAC-SHA1" */ | ||
2359 | 421, /* "AES-128-CFB" */ | 2415 | 421, /* "AES-128-CFB" */ |
2360 | 650, /* "AES-128-CFB1" */ | 2416 | 650, /* "AES-128-CFB1" */ |
2361 | 653, /* "AES-128-CFB8" */ | 2417 | 653, /* "AES-128-CFB8" */ |
2418 | 904, /* "AES-128-CTR" */ | ||
2362 | 418, /* "AES-128-ECB" */ | 2419 | 418, /* "AES-128-ECB" */ |
2363 | 420, /* "AES-128-OFB" */ | 2420 | 420, /* "AES-128-OFB" */ |
2421 | 913, /* "AES-128-XTS" */ | ||
2364 | 423, /* "AES-192-CBC" */ | 2422 | 423, /* "AES-192-CBC" */ |
2423 | 917, /* "AES-192-CBC-HMAC-SHA1" */ | ||
2365 | 425, /* "AES-192-CFB" */ | 2424 | 425, /* "AES-192-CFB" */ |
2366 | 651, /* "AES-192-CFB1" */ | 2425 | 651, /* "AES-192-CFB1" */ |
2367 | 654, /* "AES-192-CFB8" */ | 2426 | 654, /* "AES-192-CFB8" */ |
2427 | 905, /* "AES-192-CTR" */ | ||
2368 | 422, /* "AES-192-ECB" */ | 2428 | 422, /* "AES-192-ECB" */ |
2369 | 424, /* "AES-192-OFB" */ | 2429 | 424, /* "AES-192-OFB" */ |
2370 | 427, /* "AES-256-CBC" */ | 2430 | 427, /* "AES-256-CBC" */ |
2431 | 918, /* "AES-256-CBC-HMAC-SHA1" */ | ||
2371 | 429, /* "AES-256-CFB" */ | 2432 | 429, /* "AES-256-CFB" */ |
2372 | 652, /* "AES-256-CFB1" */ | 2433 | 652, /* "AES-256-CFB1" */ |
2373 | 655, /* "AES-256-CFB8" */ | 2434 | 655, /* "AES-256-CFB8" */ |
2435 | 906, /* "AES-256-CTR" */ | ||
2374 | 426, /* "AES-256-ECB" */ | 2436 | 426, /* "AES-256-ECB" */ |
2375 | 428, /* "AES-256-OFB" */ | 2437 | 428, /* "AES-256-OFB" */ |
2438 | 914, /* "AES-256-XTS" */ | ||
2376 | 91, /* "BF-CBC" */ | 2439 | 91, /* "BF-CBC" */ |
2377 | 93, /* "BF-CFB" */ | 2440 | 93, /* "BF-CFB" */ |
2378 | 92, /* "BF-ECB" */ | 2441 | 92, /* "BF-ECB" */ |
@@ -2400,6 +2463,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2400 | 110, /* "CAST5-CFB" */ | 2463 | 110, /* "CAST5-CFB" */ |
2401 | 109, /* "CAST5-ECB" */ | 2464 | 109, /* "CAST5-ECB" */ |
2402 | 111, /* "CAST5-OFB" */ | 2465 | 111, /* "CAST5-OFB" */ |
2466 | 894, /* "CMAC" */ | ||
2403 | 13, /* "CN" */ | 2467 | 13, /* "CN" */ |
2404 | 141, /* "CRLReason" */ | 2468 | 141, /* "CRLReason" */ |
2405 | 417, /* "CSPName" */ | 2469 | 417, /* "CSPName" */ |
@@ -2451,6 +2515,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2451 | 4, /* "MD5" */ | 2515 | 4, /* "MD5" */ |
2452 | 114, /* "MD5-SHA1" */ | 2516 | 114, /* "MD5-SHA1" */ |
2453 | 95, /* "MDC2" */ | 2517 | 95, /* "MDC2" */ |
2518 | 911, /* "MGF1" */ | ||
2454 | 388, /* "Mail" */ | 2519 | 388, /* "Mail" */ |
2455 | 393, /* "NULL" */ | 2520 | 393, /* "NULL" */ |
2456 | 404, /* "NULL" */ | 2521 | 404, /* "NULL" */ |
@@ -2487,6 +2552,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2487 | 40, /* "RC2-OFB" */ | 2552 | 40, /* "RC2-OFB" */ |
2488 | 5, /* "RC4" */ | 2553 | 5, /* "RC4" */ |
2489 | 97, /* "RC4-40" */ | 2554 | 97, /* "RC4-40" */ |
2555 | 915, /* "RC4-HMAC-MD5" */ | ||
2490 | 120, /* "RC5-CBC" */ | 2556 | 120, /* "RC5-CBC" */ |
2491 | 122, /* "RC5-CFB" */ | 2557 | 122, /* "RC5-CFB" */ |
2492 | 121, /* "RC5-ECB" */ | 2558 | 121, /* "RC5-ECB" */ |
@@ -2507,6 +2573,8 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2507 | 668, /* "RSA-SHA256" */ | 2573 | 668, /* "RSA-SHA256" */ |
2508 | 669, /* "RSA-SHA384" */ | 2574 | 669, /* "RSA-SHA384" */ |
2509 | 670, /* "RSA-SHA512" */ | 2575 | 670, /* "RSA-SHA512" */ |
2576 | 919, /* "RSAES-OAEP" */ | ||
2577 | 912, /* "RSASSA-PSS" */ | ||
2510 | 777, /* "SEED-CBC" */ | 2578 | 777, /* "SEED-CBC" */ |
2511 | 779, /* "SEED-CFB" */ | 2579 | 779, /* "SEED-CFB" */ |
2512 | 776, /* "SEED-ECB" */ | 2580 | 776, /* "SEED-ECB" */ |
@@ -2540,6 +2608,7 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2540 | 363, /* "ad_timestamping" */ | 2608 | 363, /* "ad_timestamping" */ |
2541 | 376, /* "algorithm" */ | 2609 | 376, /* "algorithm" */ |
2542 | 405, /* "ansi-X9-62" */ | 2610 | 405, /* "ansi-X9-62" */ |
2611 | 910, /* "anyExtendedKeyUsage" */ | ||
2543 | 746, /* "anyPolicy" */ | 2612 | 746, /* "anyPolicy" */ |
2544 | 370, /* "archiveCutoff" */ | 2613 | 370, /* "archiveCutoff" */ |
2545 | 484, /* "associatedDomain" */ | 2614 | 484, /* "associatedDomain" */ |
@@ -2716,14 +2785,27 @@ static const unsigned int sn_objs[NUM_SN]={ | |||
2716 | 357, /* "id-aca-group" */ | 2785 | 357, /* "id-aca-group" */ |
2717 | 358, /* "id-aca-role" */ | 2786 | 358, /* "id-aca-role" */ |
2718 | 176, /* "id-ad" */ | 2787 | 176, /* "id-ad" */ |
2788 | 896, /* "id-aes128-CCM" */ | ||
2789 | 895, /* "id-aes128-GCM" */ | ||
2719 | 788, /* "id-aes128-wrap" */ | 2790 | 788, /* "id-aes128-wrap" */ |
2791 | 897, /* "id-aes128-wrap-pad" */ | ||
2792 | 899, /* "id-aes192-CCM" */ | ||
2793 | 898, /* "id-aes192-GCM" */ | ||
2720 | 789, /* "id-aes192-wrap" */ | 2794 | 789, /* "id-aes192-wrap" */ |
2795 | 900, /* "id-aes192-wrap-pad" */ | ||
2796 | 902, /* "id-aes256-CCM" */ | ||
2797 | 901, /* "id-aes256-GCM" */ | ||
2721 | 790, /* "id-aes256-wrap" */ | 2798 | 790, /* "id-aes256-wrap" */ |
2799 | 903, /* "id-aes256-wrap-pad" */ | ||
2722 | 262, /* "id-alg" */ | 2800 | 262, /* "id-alg" */ |
2801 | 893, /* "id-alg-PWRI-KEK" */ | ||
2723 | 323, /* "id-alg-des40" */ | 2802 | 323, /* "id-alg-des40" */ |
2724 | 326, /* "id-alg-dh-pop" */ | 2803 | 326, /* "id-alg-dh-pop" */ |
2725 | 325, /* "id-alg-dh-sig-hmac-sha1" */ | 2804 | 325, /* "id-alg-dh-sig-hmac-sha1" */ |
2726 | 324, /* "id-alg-noSignature" */ | 2805 | 324, /* "id-alg-noSignature" */ |
2806 | 907, /* "id-camellia128-wrap" */ | ||
2807 | 908, /* "id-camellia192-wrap" */ | ||
2808 | 909, /* "id-camellia256-wrap" */ | ||
2727 | 268, /* "id-cct" */ | 2809 | 268, /* "id-cct" */ |
2728 | 361, /* "id-cct-PKIData" */ | 2810 | 361, /* "id-cct-PKIData" */ |
2729 | 362, /* "id-cct-PKIResponse" */ | 2811 | 362, /* "id-cct-PKIResponse" */ |
@@ -3246,6 +3328,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3246 | 363, /* "AD Time Stamping" */ | 3328 | 363, /* "AD Time Stamping" */ |
3247 | 405, /* "ANSI X9.62" */ | 3329 | 405, /* "ANSI X9.62" */ |
3248 | 368, /* "Acceptable OCSP Responses" */ | 3330 | 368, /* "Acceptable OCSP Responses" */ |
3331 | 910, /* "Any Extended Key Usage" */ | ||
3249 | 664, /* "Any language" */ | 3332 | 664, /* "Any language" */ |
3250 | 177, /* "Authority Information Access" */ | 3333 | 177, /* "Authority Information Access" */ |
3251 | 365, /* "Basic OCSP Response" */ | 3334 | 365, /* "Basic OCSP Response" */ |
@@ -3386,23 +3469,37 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3386 | 364, /* "ad dvcs" */ | 3469 | 364, /* "ad dvcs" */ |
3387 | 606, /* "additional verification" */ | 3470 | 606, /* "additional verification" */ |
3388 | 419, /* "aes-128-cbc" */ | 3471 | 419, /* "aes-128-cbc" */ |
3472 | 916, /* "aes-128-cbc-hmac-sha1" */ | ||
3473 | 896, /* "aes-128-ccm" */ | ||
3389 | 421, /* "aes-128-cfb" */ | 3474 | 421, /* "aes-128-cfb" */ |
3390 | 650, /* "aes-128-cfb1" */ | 3475 | 650, /* "aes-128-cfb1" */ |
3391 | 653, /* "aes-128-cfb8" */ | 3476 | 653, /* "aes-128-cfb8" */ |
3477 | 904, /* "aes-128-ctr" */ | ||
3392 | 418, /* "aes-128-ecb" */ | 3478 | 418, /* "aes-128-ecb" */ |
3479 | 895, /* "aes-128-gcm" */ | ||
3393 | 420, /* "aes-128-ofb" */ | 3480 | 420, /* "aes-128-ofb" */ |
3481 | 913, /* "aes-128-xts" */ | ||
3394 | 423, /* "aes-192-cbc" */ | 3482 | 423, /* "aes-192-cbc" */ |
3483 | 917, /* "aes-192-cbc-hmac-sha1" */ | ||
3484 | 899, /* "aes-192-ccm" */ | ||
3395 | 425, /* "aes-192-cfb" */ | 3485 | 425, /* "aes-192-cfb" */ |
3396 | 651, /* "aes-192-cfb1" */ | 3486 | 651, /* "aes-192-cfb1" */ |
3397 | 654, /* "aes-192-cfb8" */ | 3487 | 654, /* "aes-192-cfb8" */ |
3488 | 905, /* "aes-192-ctr" */ | ||
3398 | 422, /* "aes-192-ecb" */ | 3489 | 422, /* "aes-192-ecb" */ |
3490 | 898, /* "aes-192-gcm" */ | ||
3399 | 424, /* "aes-192-ofb" */ | 3491 | 424, /* "aes-192-ofb" */ |
3400 | 427, /* "aes-256-cbc" */ | 3492 | 427, /* "aes-256-cbc" */ |
3493 | 918, /* "aes-256-cbc-hmac-sha1" */ | ||
3494 | 902, /* "aes-256-ccm" */ | ||
3401 | 429, /* "aes-256-cfb" */ | 3495 | 429, /* "aes-256-cfb" */ |
3402 | 652, /* "aes-256-cfb1" */ | 3496 | 652, /* "aes-256-cfb1" */ |
3403 | 655, /* "aes-256-cfb8" */ | 3497 | 655, /* "aes-256-cfb8" */ |
3498 | 906, /* "aes-256-ctr" */ | ||
3404 | 426, /* "aes-256-ecb" */ | 3499 | 426, /* "aes-256-ecb" */ |
3500 | 901, /* "aes-256-gcm" */ | ||
3405 | 428, /* "aes-256-ofb" */ | 3501 | 428, /* "aes-256-ofb" */ |
3502 | 914, /* "aes-256-xts" */ | ||
3406 | 376, /* "algorithm" */ | 3503 | 376, /* "algorithm" */ |
3407 | 484, /* "associatedDomain" */ | 3504 | 484, /* "associatedDomain" */ |
3408 | 485, /* "associatedName" */ | 3505 | 485, /* "associatedName" */ |
@@ -3467,6 +3564,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3467 | 407, /* "characteristic-two-field" */ | 3564 | 407, /* "characteristic-two-field" */ |
3468 | 395, /* "clearance" */ | 3565 | 395, /* "clearance" */ |
3469 | 633, /* "cleartext track 2" */ | 3566 | 633, /* "cleartext track 2" */ |
3567 | 894, /* "cmac" */ | ||
3470 | 13, /* "commonName" */ | 3568 | 13, /* "commonName" */ |
3471 | 513, /* "content types" */ | 3569 | 513, /* "content types" */ |
3472 | 50, /* "contentType" */ | 3570 | 50, /* "contentType" */ |
@@ -3602,13 +3700,20 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3602 | 358, /* "id-aca-role" */ | 3700 | 358, /* "id-aca-role" */ |
3603 | 176, /* "id-ad" */ | 3701 | 176, /* "id-ad" */ |
3604 | 788, /* "id-aes128-wrap" */ | 3702 | 788, /* "id-aes128-wrap" */ |
3703 | 897, /* "id-aes128-wrap-pad" */ | ||
3605 | 789, /* "id-aes192-wrap" */ | 3704 | 789, /* "id-aes192-wrap" */ |
3705 | 900, /* "id-aes192-wrap-pad" */ | ||
3606 | 790, /* "id-aes256-wrap" */ | 3706 | 790, /* "id-aes256-wrap" */ |
3707 | 903, /* "id-aes256-wrap-pad" */ | ||
3607 | 262, /* "id-alg" */ | 3708 | 262, /* "id-alg" */ |
3709 | 893, /* "id-alg-PWRI-KEK" */ | ||
3608 | 323, /* "id-alg-des40" */ | 3710 | 323, /* "id-alg-des40" */ |
3609 | 326, /* "id-alg-dh-pop" */ | 3711 | 326, /* "id-alg-dh-pop" */ |
3610 | 325, /* "id-alg-dh-sig-hmac-sha1" */ | 3712 | 325, /* "id-alg-dh-sig-hmac-sha1" */ |
3611 | 324, /* "id-alg-noSignature" */ | 3713 | 324, /* "id-alg-noSignature" */ |
3714 | 907, /* "id-camellia128-wrap" */ | ||
3715 | 908, /* "id-camellia192-wrap" */ | ||
3716 | 909, /* "id-camellia256-wrap" */ | ||
3612 | 268, /* "id-cct" */ | 3717 | 268, /* "id-cct" */ |
3613 | 361, /* "id-cct-PKIData" */ | 3718 | 361, /* "id-cct-PKIData" */ |
3614 | 362, /* "id-cct-PKIResponse" */ | 3719 | 362, /* "id-cct-PKIResponse" */ |
@@ -3806,6 +3911,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3806 | 602, /* "merchant initiated auth" */ | 3911 | 602, /* "merchant initiated auth" */ |
3807 | 514, /* "message extensions" */ | 3912 | 514, /* "message extensions" */ |
3808 | 51, /* "messageDigest" */ | 3913 | 51, /* "messageDigest" */ |
3914 | 911, /* "mgf1" */ | ||
3809 | 506, /* "mime-mhs-bodies" */ | 3915 | 506, /* "mime-mhs-bodies" */ |
3810 | 505, /* "mime-mhs-headings" */ | 3916 | 505, /* "mime-mhs-headings" */ |
3811 | 488, /* "mobileTelephoneNumber" */ | 3917 | 488, /* "mobileTelephoneNumber" */ |
@@ -3889,6 +3995,7 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3889 | 40, /* "rc2-ofb" */ | 3995 | 40, /* "rc2-ofb" */ |
3890 | 5, /* "rc4" */ | 3996 | 5, /* "rc4" */ |
3891 | 97, /* "rc4-40" */ | 3997 | 97, /* "rc4-40" */ |
3998 | 915, /* "rc4-hmac-md5" */ | ||
3892 | 120, /* "rc5-cbc" */ | 3999 | 120, /* "rc5-cbc" */ |
3893 | 122, /* "rc5-cfb" */ | 4000 | 122, /* "rc5-cfb" */ |
3894 | 121, /* "rc5-ecb" */ | 4001 | 121, /* "rc5-ecb" */ |
@@ -3905,6 +4012,8 @@ static const unsigned int ln_objs[NUM_LN]={ | |||
3905 | 6, /* "rsaEncryption" */ | 4012 | 6, /* "rsaEncryption" */ |
3906 | 644, /* "rsaOAEPEncryptionSET" */ | 4013 | 644, /* "rsaOAEPEncryptionSET" */ |
3907 | 377, /* "rsaSignature" */ | 4014 | 377, /* "rsaSignature" */ |
4015 | 919, /* "rsaesOaep" */ | ||
4016 | 912, /* "rsassaPss" */ | ||
3908 | 124, /* "run length compression" */ | 4017 | 124, /* "run length compression" */ |
3909 | 482, /* "sOARecord" */ | 4018 | 482, /* "sOARecord" */ |
3910 | 155, /* "safeContentsBag" */ | 4019 | 155, /* "safeContentsBag" */ |
@@ -4254,6 +4363,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4254 | 96, /* OBJ_mdc2WithRSA 2 5 8 3 100 */ | 4363 | 96, /* OBJ_mdc2WithRSA 2 5 8 3 100 */ |
4255 | 95, /* OBJ_mdc2 2 5 8 3 101 */ | 4364 | 95, /* OBJ_mdc2 2 5 8 3 101 */ |
4256 | 746, /* OBJ_any_policy 2 5 29 32 0 */ | 4365 | 746, /* OBJ_any_policy 2 5 29 32 0 */ |
4366 | 910, /* OBJ_anyExtendedKeyUsage 2 5 29 37 0 */ | ||
4257 | 519, /* OBJ_setct_PANData 2 23 42 0 0 */ | 4367 | 519, /* OBJ_setct_PANData 2 23 42 0 0 */ |
4258 | 520, /* OBJ_setct_PANToken 2 23 42 0 1 */ | 4368 | 520, /* OBJ_setct_PANToken 2 23 42 0 1 */ |
4259 | 521, /* OBJ_setct_PANOnly 2 23 42 0 2 */ | 4369 | 521, /* OBJ_setct_PANOnly 2 23 42 0 2 */ |
@@ -4720,6 +4830,9 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4720 | 8, /* OBJ_md5WithRSAEncryption 1 2 840 113549 1 1 4 */ | 4830 | 8, /* OBJ_md5WithRSAEncryption 1 2 840 113549 1 1 4 */ |
4721 | 65, /* OBJ_sha1WithRSAEncryption 1 2 840 113549 1 1 5 */ | 4831 | 65, /* OBJ_sha1WithRSAEncryption 1 2 840 113549 1 1 5 */ |
4722 | 644, /* OBJ_rsaOAEPEncryptionSET 1 2 840 113549 1 1 6 */ | 4832 | 644, /* OBJ_rsaOAEPEncryptionSET 1 2 840 113549 1 1 6 */ |
4833 | 919, /* OBJ_rsaesOaep 1 2 840 113549 1 1 7 */ | ||
4834 | 911, /* OBJ_mgf1 1 2 840 113549 1 1 8 */ | ||
4835 | 912, /* OBJ_rsassaPss 1 2 840 113549 1 1 10 */ | ||
4723 | 668, /* OBJ_sha256WithRSAEncryption 1 2 840 113549 1 1 11 */ | 4836 | 668, /* OBJ_sha256WithRSAEncryption 1 2 840 113549 1 1 11 */ |
4724 | 669, /* OBJ_sha384WithRSAEncryption 1 2 840 113549 1 1 12 */ | 4837 | 669, /* OBJ_sha384WithRSAEncryption 1 2 840 113549 1 1 12 */ |
4725 | 670, /* OBJ_sha512WithRSAEncryption 1 2 840 113549 1 1 13 */ | 4838 | 670, /* OBJ_sha512WithRSAEncryption 1 2 840 113549 1 1 13 */ |
@@ -4785,16 +4898,25 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4785 | 420, /* OBJ_aes_128_ofb128 2 16 840 1 101 3 4 1 3 */ | 4898 | 420, /* OBJ_aes_128_ofb128 2 16 840 1 101 3 4 1 3 */ |
4786 | 421, /* OBJ_aes_128_cfb128 2 16 840 1 101 3 4 1 4 */ | 4899 | 421, /* OBJ_aes_128_cfb128 2 16 840 1 101 3 4 1 4 */ |
4787 | 788, /* OBJ_id_aes128_wrap 2 16 840 1 101 3 4 1 5 */ | 4900 | 788, /* OBJ_id_aes128_wrap 2 16 840 1 101 3 4 1 5 */ |
4901 | 895, /* OBJ_aes_128_gcm 2 16 840 1 101 3 4 1 6 */ | ||
4902 | 896, /* OBJ_aes_128_ccm 2 16 840 1 101 3 4 1 7 */ | ||
4903 | 897, /* OBJ_id_aes128_wrap_pad 2 16 840 1 101 3 4 1 8 */ | ||
4788 | 422, /* OBJ_aes_192_ecb 2 16 840 1 101 3 4 1 21 */ | 4904 | 422, /* OBJ_aes_192_ecb 2 16 840 1 101 3 4 1 21 */ |
4789 | 423, /* OBJ_aes_192_cbc 2 16 840 1 101 3 4 1 22 */ | 4905 | 423, /* OBJ_aes_192_cbc 2 16 840 1 101 3 4 1 22 */ |
4790 | 424, /* OBJ_aes_192_ofb128 2 16 840 1 101 3 4 1 23 */ | 4906 | 424, /* OBJ_aes_192_ofb128 2 16 840 1 101 3 4 1 23 */ |
4791 | 425, /* OBJ_aes_192_cfb128 2 16 840 1 101 3 4 1 24 */ | 4907 | 425, /* OBJ_aes_192_cfb128 2 16 840 1 101 3 4 1 24 */ |
4792 | 789, /* OBJ_id_aes192_wrap 2 16 840 1 101 3 4 1 25 */ | 4908 | 789, /* OBJ_id_aes192_wrap 2 16 840 1 101 3 4 1 25 */ |
4909 | 898, /* OBJ_aes_192_gcm 2 16 840 1 101 3 4 1 26 */ | ||
4910 | 899, /* OBJ_aes_192_ccm 2 16 840 1 101 3 4 1 27 */ | ||
4911 | 900, /* OBJ_id_aes192_wrap_pad 2 16 840 1 101 3 4 1 28 */ | ||
4793 | 426, /* OBJ_aes_256_ecb 2 16 840 1 101 3 4 1 41 */ | 4912 | 426, /* OBJ_aes_256_ecb 2 16 840 1 101 3 4 1 41 */ |
4794 | 427, /* OBJ_aes_256_cbc 2 16 840 1 101 3 4 1 42 */ | 4913 | 427, /* OBJ_aes_256_cbc 2 16 840 1 101 3 4 1 42 */ |
4795 | 428, /* OBJ_aes_256_ofb128 2 16 840 1 101 3 4 1 43 */ | 4914 | 428, /* OBJ_aes_256_ofb128 2 16 840 1 101 3 4 1 43 */ |
4796 | 429, /* OBJ_aes_256_cfb128 2 16 840 1 101 3 4 1 44 */ | 4915 | 429, /* OBJ_aes_256_cfb128 2 16 840 1 101 3 4 1 44 */ |
4797 | 790, /* OBJ_id_aes256_wrap 2 16 840 1 101 3 4 1 45 */ | 4916 | 790, /* OBJ_id_aes256_wrap 2 16 840 1 101 3 4 1 45 */ |
4917 | 901, /* OBJ_aes_256_gcm 2 16 840 1 101 3 4 1 46 */ | ||
4918 | 902, /* OBJ_aes_256_ccm 2 16 840 1 101 3 4 1 47 */ | ||
4919 | 903, /* OBJ_id_aes256_wrap_pad 2 16 840 1 101 3 4 1 48 */ | ||
4798 | 672, /* OBJ_sha256 2 16 840 1 101 3 4 2 1 */ | 4920 | 672, /* OBJ_sha256 2 16 840 1 101 3 4 2 1 */ |
4799 | 673, /* OBJ_sha384 2 16 840 1 101 3 4 2 2 */ | 4921 | 673, /* OBJ_sha384 2 16 840 1 101 3 4 2 2 */ |
4800 | 674, /* OBJ_sha512 2 16 840 1 101 3 4 2 3 */ | 4922 | 674, /* OBJ_sha512 2 16 840 1 101 3 4 2 3 */ |
@@ -4901,6 +5023,9 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4901 | 751, /* OBJ_camellia_128_cbc 1 2 392 200011 61 1 1 1 2 */ | 5023 | 751, /* OBJ_camellia_128_cbc 1 2 392 200011 61 1 1 1 2 */ |
4902 | 752, /* OBJ_camellia_192_cbc 1 2 392 200011 61 1 1 1 3 */ | 5024 | 752, /* OBJ_camellia_192_cbc 1 2 392 200011 61 1 1 1 3 */ |
4903 | 753, /* OBJ_camellia_256_cbc 1 2 392 200011 61 1 1 1 4 */ | 5025 | 753, /* OBJ_camellia_256_cbc 1 2 392 200011 61 1 1 1 4 */ |
5026 | 907, /* OBJ_id_camellia128_wrap 1 2 392 200011 61 1 1 3 2 */ | ||
5027 | 908, /* OBJ_id_camellia192_wrap 1 2 392 200011 61 1 1 3 3 */ | ||
5028 | 909, /* OBJ_id_camellia256_wrap 1 2 392 200011 61 1 1 3 4 */ | ||
4904 | 196, /* OBJ_id_smime_mod_cms 1 2 840 113549 1 9 16 0 1 */ | 5029 | 196, /* OBJ_id_smime_mod_cms 1 2 840 113549 1 9 16 0 1 */ |
4905 | 197, /* OBJ_id_smime_mod_ess 1 2 840 113549 1 9 16 0 2 */ | 5030 | 197, /* OBJ_id_smime_mod_ess 1 2 840 113549 1 9 16 0 2 */ |
4906 | 198, /* OBJ_id_smime_mod_oid 1 2 840 113549 1 9 16 0 3 */ | 5031 | 198, /* OBJ_id_smime_mod_oid 1 2 840 113549 1 9 16 0 3 */ |
@@ -4956,6 +5081,7 @@ static const unsigned int obj_objs[NUM_OBJ]={ | |||
4956 | 246, /* OBJ_id_smime_alg_CMS3DESwrap 1 2 840 113549 1 9 16 3 6 */ | 5081 | 246, /* OBJ_id_smime_alg_CMS3DESwrap 1 2 840 113549 1 9 16 3 6 */ |
4957 | 247, /* OBJ_id_smime_alg_CMSRC2wrap 1 2 840 113549 1 9 16 3 7 */ | 5082 | 247, /* OBJ_id_smime_alg_CMSRC2wrap 1 2 840 113549 1 9 16 3 7 */ |
4958 | 125, /* OBJ_zlib_compression 1 2 840 113549 1 9 16 3 8 */ | 5083 | 125, /* OBJ_zlib_compression 1 2 840 113549 1 9 16 3 8 */ |
5084 | 893, /* OBJ_id_alg_PWRI_KEK 1 2 840 113549 1 9 16 3 9 */ | ||
4959 | 248, /* OBJ_id_smime_cd_ldap 1 2 840 113549 1 9 16 4 1 */ | 5085 | 248, /* OBJ_id_smime_cd_ldap 1 2 840 113549 1 9 16 4 1 */ |
4960 | 249, /* OBJ_id_smime_spq_ets_sqt_uri 1 2 840 113549 1 9 16 5 1 */ | 5086 | 249, /* OBJ_id_smime_spq_ets_sqt_uri 1 2 840 113549 1 9 16 5 1 */ |
4961 | 250, /* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */ | 5087 | 250, /* OBJ_id_smime_spq_ets_sqt_unotice 1 2 840 113549 1 9 16 5 2 */ |
diff --git a/src/lib/libssl/src/crypto/objects/obj_mac.h b/src/lib/libssl/src/crypto/objects/obj_mac.h index 282f11a8a8..b5ea7cdab4 100644 --- a/src/lib/libssl/src/crypto/objects/obj_mac.h +++ b/src/lib/libssl/src/crypto/objects/obj_mac.h | |||
@@ -580,6 +580,21 @@ | |||
580 | #define NID_sha1WithRSAEncryption 65 | 580 | #define NID_sha1WithRSAEncryption 65 |
581 | #define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L | 581 | #define OBJ_sha1WithRSAEncryption OBJ_pkcs1,5L |
582 | 582 | ||
583 | #define SN_rsaesOaep "RSAES-OAEP" | ||
584 | #define LN_rsaesOaep "rsaesOaep" | ||
585 | #define NID_rsaesOaep 919 | ||
586 | #define OBJ_rsaesOaep OBJ_pkcs1,7L | ||
587 | |||
588 | #define SN_mgf1 "MGF1" | ||
589 | #define LN_mgf1 "mgf1" | ||
590 | #define NID_mgf1 911 | ||
591 | #define OBJ_mgf1 OBJ_pkcs1,8L | ||
592 | |||
593 | #define SN_rsassaPss "RSASSA-PSS" | ||
594 | #define LN_rsassaPss "rsassaPss" | ||
595 | #define NID_rsassaPss 912 | ||
596 | #define OBJ_rsassaPss OBJ_pkcs1,10L | ||
597 | |||
583 | #define SN_sha256WithRSAEncryption "RSA-SHA256" | 598 | #define SN_sha256WithRSAEncryption "RSA-SHA256" |
584 | #define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" | 599 | #define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" |
585 | #define NID_sha256WithRSAEncryption 668 | 600 | #define NID_sha256WithRSAEncryption 668 |
@@ -981,6 +996,10 @@ | |||
981 | #define NID_id_smime_alg_CMSRC2wrap 247 | 996 | #define NID_id_smime_alg_CMSRC2wrap 247 |
982 | #define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L | 997 | #define OBJ_id_smime_alg_CMSRC2wrap OBJ_id_smime_alg,7L |
983 | 998 | ||
999 | #define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK" | ||
1000 | #define NID_id_alg_PWRI_KEK 893 | ||
1001 | #define OBJ_id_alg_PWRI_KEK OBJ_id_smime_alg,9L | ||
1002 | |||
984 | #define SN_id_smime_cd_ldap "id-smime-cd-ldap" | 1003 | #define SN_id_smime_cd_ldap "id-smime-cd-ldap" |
985 | #define NID_id_smime_cd_ldap 248 | 1004 | #define NID_id_smime_cd_ldap 248 |
986 | #define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L | 1005 | #define OBJ_id_smime_cd_ldap OBJ_id_smime_cd,1L |
@@ -2399,6 +2418,11 @@ | |||
2399 | #define NID_no_rev_avail 403 | 2418 | #define NID_no_rev_avail 403 |
2400 | #define OBJ_no_rev_avail OBJ_id_ce,56L | 2419 | #define OBJ_no_rev_avail OBJ_id_ce,56L |
2401 | 2420 | ||
2421 | #define SN_anyExtendedKeyUsage "anyExtendedKeyUsage" | ||
2422 | #define LN_anyExtendedKeyUsage "Any Extended Key Usage" | ||
2423 | #define NID_anyExtendedKeyUsage 910 | ||
2424 | #define OBJ_anyExtendedKeyUsage OBJ_ext_key_usage,0L | ||
2425 | |||
2402 | #define SN_netscape "Netscape" | 2426 | #define SN_netscape "Netscape" |
2403 | #define LN_netscape "Netscape Communications Corp." | 2427 | #define LN_netscape "Netscape Communications Corp." |
2404 | #define NID_netscape 57 | 2428 | #define NID_netscape 57 |
@@ -2586,6 +2610,24 @@ | |||
2586 | #define NID_aes_128_cfb128 421 | 2610 | #define NID_aes_128_cfb128 421 |
2587 | #define OBJ_aes_128_cfb128 OBJ_aes,4L | 2611 | #define OBJ_aes_128_cfb128 OBJ_aes,4L |
2588 | 2612 | ||
2613 | #define SN_id_aes128_wrap "id-aes128-wrap" | ||
2614 | #define NID_id_aes128_wrap 788 | ||
2615 | #define OBJ_id_aes128_wrap OBJ_aes,5L | ||
2616 | |||
2617 | #define SN_aes_128_gcm "id-aes128-GCM" | ||
2618 | #define LN_aes_128_gcm "aes-128-gcm" | ||
2619 | #define NID_aes_128_gcm 895 | ||
2620 | #define OBJ_aes_128_gcm OBJ_aes,6L | ||
2621 | |||
2622 | #define SN_aes_128_ccm "id-aes128-CCM" | ||
2623 | #define LN_aes_128_ccm "aes-128-ccm" | ||
2624 | #define NID_aes_128_ccm 896 | ||
2625 | #define OBJ_aes_128_ccm OBJ_aes,7L | ||
2626 | |||
2627 | #define SN_id_aes128_wrap_pad "id-aes128-wrap-pad" | ||
2628 | #define NID_id_aes128_wrap_pad 897 | ||
2629 | #define OBJ_id_aes128_wrap_pad OBJ_aes,8L | ||
2630 | |||
2589 | #define SN_aes_192_ecb "AES-192-ECB" | 2631 | #define SN_aes_192_ecb "AES-192-ECB" |
2590 | #define LN_aes_192_ecb "aes-192-ecb" | 2632 | #define LN_aes_192_ecb "aes-192-ecb" |
2591 | #define NID_aes_192_ecb 422 | 2633 | #define NID_aes_192_ecb 422 |
@@ -2606,6 +2648,24 @@ | |||
2606 | #define NID_aes_192_cfb128 425 | 2648 | #define NID_aes_192_cfb128 425 |
2607 | #define OBJ_aes_192_cfb128 OBJ_aes,24L | 2649 | #define OBJ_aes_192_cfb128 OBJ_aes,24L |
2608 | 2650 | ||
2651 | #define SN_id_aes192_wrap "id-aes192-wrap" | ||
2652 | #define NID_id_aes192_wrap 789 | ||
2653 | #define OBJ_id_aes192_wrap OBJ_aes,25L | ||
2654 | |||
2655 | #define SN_aes_192_gcm "id-aes192-GCM" | ||
2656 | #define LN_aes_192_gcm "aes-192-gcm" | ||
2657 | #define NID_aes_192_gcm 898 | ||
2658 | #define OBJ_aes_192_gcm OBJ_aes,26L | ||
2659 | |||
2660 | #define SN_aes_192_ccm "id-aes192-CCM" | ||
2661 | #define LN_aes_192_ccm "aes-192-ccm" | ||
2662 | #define NID_aes_192_ccm 899 | ||
2663 | #define OBJ_aes_192_ccm OBJ_aes,27L | ||
2664 | |||
2665 | #define SN_id_aes192_wrap_pad "id-aes192-wrap-pad" | ||
2666 | #define NID_id_aes192_wrap_pad 900 | ||
2667 | #define OBJ_id_aes192_wrap_pad OBJ_aes,28L | ||
2668 | |||
2609 | #define SN_aes_256_ecb "AES-256-ECB" | 2669 | #define SN_aes_256_ecb "AES-256-ECB" |
2610 | #define LN_aes_256_ecb "aes-256-ecb" | 2670 | #define LN_aes_256_ecb "aes-256-ecb" |
2611 | #define NID_aes_256_ecb 426 | 2671 | #define NID_aes_256_ecb 426 |
@@ -2626,6 +2686,24 @@ | |||
2626 | #define NID_aes_256_cfb128 429 | 2686 | #define NID_aes_256_cfb128 429 |
2627 | #define OBJ_aes_256_cfb128 OBJ_aes,44L | 2687 | #define OBJ_aes_256_cfb128 OBJ_aes,44L |
2628 | 2688 | ||
2689 | #define SN_id_aes256_wrap "id-aes256-wrap" | ||
2690 | #define NID_id_aes256_wrap 790 | ||
2691 | #define OBJ_id_aes256_wrap OBJ_aes,45L | ||
2692 | |||
2693 | #define SN_aes_256_gcm "id-aes256-GCM" | ||
2694 | #define LN_aes_256_gcm "aes-256-gcm" | ||
2695 | #define NID_aes_256_gcm 901 | ||
2696 | #define OBJ_aes_256_gcm OBJ_aes,46L | ||
2697 | |||
2698 | #define SN_aes_256_ccm "id-aes256-CCM" | ||
2699 | #define LN_aes_256_ccm "aes-256-ccm" | ||
2700 | #define NID_aes_256_ccm 902 | ||
2701 | #define OBJ_aes_256_ccm OBJ_aes,47L | ||
2702 | |||
2703 | #define SN_id_aes256_wrap_pad "id-aes256-wrap-pad" | ||
2704 | #define NID_id_aes256_wrap_pad 903 | ||
2705 | #define OBJ_id_aes256_wrap_pad OBJ_aes,48L | ||
2706 | |||
2629 | #define SN_aes_128_cfb1 "AES-128-CFB1" | 2707 | #define SN_aes_128_cfb1 "AES-128-CFB1" |
2630 | #define LN_aes_128_cfb1 "aes-128-cfb1" | 2708 | #define LN_aes_128_cfb1 "aes-128-cfb1" |
2631 | #define NID_aes_128_cfb1 650 | 2709 | #define NID_aes_128_cfb1 650 |
@@ -2650,6 +2728,26 @@ | |||
2650 | #define LN_aes_256_cfb8 "aes-256-cfb8" | 2728 | #define LN_aes_256_cfb8 "aes-256-cfb8" |
2651 | #define NID_aes_256_cfb8 655 | 2729 | #define NID_aes_256_cfb8 655 |
2652 | 2730 | ||
2731 | #define SN_aes_128_ctr "AES-128-CTR" | ||
2732 | #define LN_aes_128_ctr "aes-128-ctr" | ||
2733 | #define NID_aes_128_ctr 904 | ||
2734 | |||
2735 | #define SN_aes_192_ctr "AES-192-CTR" | ||
2736 | #define LN_aes_192_ctr "aes-192-ctr" | ||
2737 | #define NID_aes_192_ctr 905 | ||
2738 | |||
2739 | #define SN_aes_256_ctr "AES-256-CTR" | ||
2740 | #define LN_aes_256_ctr "aes-256-ctr" | ||
2741 | #define NID_aes_256_ctr 906 | ||
2742 | |||
2743 | #define SN_aes_128_xts "AES-128-XTS" | ||
2744 | #define LN_aes_128_xts "aes-128-xts" | ||
2745 | #define NID_aes_128_xts 913 | ||
2746 | |||
2747 | #define SN_aes_256_xts "AES-256-XTS" | ||
2748 | #define LN_aes_256_xts "aes-256-xts" | ||
2749 | #define NID_aes_256_xts 914 | ||
2750 | |||
2653 | #define SN_des_cfb1 "DES-CFB1" | 2751 | #define SN_des_cfb1 "DES-CFB1" |
2654 | #define LN_des_cfb1 "des-cfb1" | 2752 | #define LN_des_cfb1 "des-cfb1" |
2655 | #define NID_des_cfb1 656 | 2753 | #define NID_des_cfb1 656 |
@@ -2666,18 +2764,6 @@ | |||
2666 | #define LN_des_ede3_cfb8 "des-ede3-cfb8" | 2764 | #define LN_des_ede3_cfb8 "des-ede3-cfb8" |
2667 | #define NID_des_ede3_cfb8 659 | 2765 | #define NID_des_ede3_cfb8 659 |
2668 | 2766 | ||
2669 | #define SN_id_aes128_wrap "id-aes128-wrap" | ||
2670 | #define NID_id_aes128_wrap 788 | ||
2671 | #define OBJ_id_aes128_wrap OBJ_aes,5L | ||
2672 | |||
2673 | #define SN_id_aes192_wrap "id-aes192-wrap" | ||
2674 | #define NID_id_aes192_wrap 789 | ||
2675 | #define OBJ_id_aes192_wrap OBJ_aes,25L | ||
2676 | |||
2677 | #define SN_id_aes256_wrap "id-aes256-wrap" | ||
2678 | #define NID_id_aes256_wrap 790 | ||
2679 | #define OBJ_id_aes256_wrap OBJ_aes,45L | ||
2680 | |||
2681 | #define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L | 2767 | #define OBJ_nist_hashalgs OBJ_nistAlgorithms,2L |
2682 | 2768 | ||
2683 | #define SN_sha256 "SHA256" | 2769 | #define SN_sha256 "SHA256" |
@@ -3810,6 +3896,18 @@ | |||
3810 | #define NID_camellia_256_cbc 753 | 3896 | #define NID_camellia_256_cbc 753 |
3811 | #define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L | 3897 | #define OBJ_camellia_256_cbc 1L,2L,392L,200011L,61L,1L,1L,1L,4L |
3812 | 3898 | ||
3899 | #define SN_id_camellia128_wrap "id-camellia128-wrap" | ||
3900 | #define NID_id_camellia128_wrap 907 | ||
3901 | #define OBJ_id_camellia128_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,2L | ||
3902 | |||
3903 | #define SN_id_camellia192_wrap "id-camellia192-wrap" | ||
3904 | #define NID_id_camellia192_wrap 908 | ||
3905 | #define OBJ_id_camellia192_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,3L | ||
3906 | |||
3907 | #define SN_id_camellia256_wrap "id-camellia256-wrap" | ||
3908 | #define NID_id_camellia256_wrap 909 | ||
3909 | #define OBJ_id_camellia256_wrap 1L,2L,392L,200011L,61L,1L,1L,3L,4L | ||
3910 | |||
3813 | #define OBJ_ntt_ds 0L,3L,4401L,5L | 3911 | #define OBJ_ntt_ds 0L,3L,4401L,5L |
3814 | 3912 | ||
3815 | #define OBJ_camellia OBJ_ntt_ds,3L,1L,9L | 3913 | #define OBJ_camellia OBJ_ntt_ds,3L,1L,9L |
@@ -3912,3 +4010,23 @@ | |||
3912 | #define LN_hmac "hmac" | 4010 | #define LN_hmac "hmac" |
3913 | #define NID_hmac 855 | 4011 | #define NID_hmac 855 |
3914 | 4012 | ||
4013 | #define SN_cmac "CMAC" | ||
4014 | #define LN_cmac "cmac" | ||
4015 | #define NID_cmac 894 | ||
4016 | |||
4017 | #define SN_rc4_hmac_md5 "RC4-HMAC-MD5" | ||
4018 | #define LN_rc4_hmac_md5 "rc4-hmac-md5" | ||
4019 | #define NID_rc4_hmac_md5 915 | ||
4020 | |||
4021 | #define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1" | ||
4022 | #define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1" | ||
4023 | #define NID_aes_128_cbc_hmac_sha1 916 | ||
4024 | |||
4025 | #define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1" | ||
4026 | #define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1" | ||
4027 | #define NID_aes_192_cbc_hmac_sha1 917 | ||
4028 | |||
4029 | #define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1" | ||
4030 | #define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1" | ||
4031 | #define NID_aes_256_cbc_hmac_sha1 918 | ||
4032 | |||
diff --git a/src/lib/libssl/src/crypto/objects/obj_mac.num b/src/lib/libssl/src/crypto/objects/obj_mac.num index 8c50aac27f..1d0a7c802d 100644 --- a/src/lib/libssl/src/crypto/objects/obj_mac.num +++ b/src/lib/libssl/src/crypto/objects/obj_mac.num | |||
@@ -890,3 +890,30 @@ houseIdentifier 889 | |||
890 | supportedAlgorithms 890 | 890 | supportedAlgorithms 890 |
891 | deltaRevocationList 891 | 891 | deltaRevocationList 891 |
892 | dmdName 892 | 892 | dmdName 892 |
893 | id_alg_PWRI_KEK 893 | ||
894 | cmac 894 | ||
895 | aes_128_gcm 895 | ||
896 | aes_128_ccm 896 | ||
897 | id_aes128_wrap_pad 897 | ||
898 | aes_192_gcm 898 | ||
899 | aes_192_ccm 899 | ||
900 | id_aes192_wrap_pad 900 | ||
901 | aes_256_gcm 901 | ||
902 | aes_256_ccm 902 | ||
903 | id_aes256_wrap_pad 903 | ||
904 | aes_128_ctr 904 | ||
905 | aes_192_ctr 905 | ||
906 | aes_256_ctr 906 | ||
907 | id_camellia128_wrap 907 | ||
908 | id_camellia192_wrap 908 | ||
909 | id_camellia256_wrap 909 | ||
910 | anyExtendedKeyUsage 910 | ||
911 | mgf1 911 | ||
912 | rsassaPss 912 | ||
913 | aes_128_xts 913 | ||
914 | aes_256_xts 914 | ||
915 | rc4_hmac_md5 915 | ||
916 | aes_128_cbc_hmac_sha1 916 | ||
917 | aes_192_cbc_hmac_sha1 917 | ||
918 | aes_256_cbc_hmac_sha1 918 | ||
919 | rsaesOaep 919 | ||
diff --git a/src/lib/libssl/src/crypto/objects/objects.txt b/src/lib/libssl/src/crypto/objects/objects.txt index e61fe60cbf..d3bfad72a2 100644 --- a/src/lib/libssl/src/crypto/objects/objects.txt +++ b/src/lib/libssl/src/crypto/objects/objects.txt | |||
@@ -166,6 +166,10 @@ pkcs1 3 : RSA-MD4 : md4WithRSAEncryption | |||
166 | pkcs1 4 : RSA-MD5 : md5WithRSAEncryption | 166 | pkcs1 4 : RSA-MD5 : md5WithRSAEncryption |
167 | pkcs1 5 : RSA-SHA1 : sha1WithRSAEncryption | 167 | pkcs1 5 : RSA-SHA1 : sha1WithRSAEncryption |
168 | # According to PKCS #1 version 2.1 | 168 | # According to PKCS #1 version 2.1 |
169 | pkcs1 7 : RSAES-OAEP : rsaesOaep | ||
170 | pkcs1 8 : MGF1 : mgf1 | ||
171 | pkcs1 10 : RSASSA-PSS : rsassaPss | ||
172 | |||
169 | pkcs1 11 : RSA-SHA256 : sha256WithRSAEncryption | 173 | pkcs1 11 : RSA-SHA256 : sha256WithRSAEncryption |
170 | pkcs1 12 : RSA-SHA384 : sha384WithRSAEncryption | 174 | pkcs1 12 : RSA-SHA384 : sha384WithRSAEncryption |
171 | pkcs1 13 : RSA-SHA512 : sha512WithRSAEncryption | 175 | pkcs1 13 : RSA-SHA512 : sha512WithRSAEncryption |
@@ -299,6 +303,7 @@ id-smime-alg 4 : id-smime-alg-RC2wrap | |||
299 | id-smime-alg 5 : id-smime-alg-ESDH | 303 | id-smime-alg 5 : id-smime-alg-ESDH |
300 | id-smime-alg 6 : id-smime-alg-CMS3DESwrap | 304 | id-smime-alg 6 : id-smime-alg-CMS3DESwrap |
301 | id-smime-alg 7 : id-smime-alg-CMSRC2wrap | 305 | id-smime-alg 7 : id-smime-alg-CMSRC2wrap |
306 | id-smime-alg 9 : id-alg-PWRI-KEK | ||
302 | 307 | ||
303 | # S/MIME Certificate Distribution | 308 | # S/MIME Certificate Distribution |
304 | id-smime-cd 1 : id-smime-cd-ldap | 309 | id-smime-cd 1 : id-smime-cd-ldap |
@@ -770,6 +775,10 @@ id-ce 55 : targetInformation : X509v3 AC Targeting | |||
770 | !Cname no-rev-avail | 775 | !Cname no-rev-avail |
771 | id-ce 56 : noRevAvail : X509v3 No Revocation Available | 776 | id-ce 56 : noRevAvail : X509v3 No Revocation Available |
772 | 777 | ||
778 | # From RFC5280 | ||
779 | ext-key-usage 0 : anyExtendedKeyUsage : Any Extended Key Usage | ||
780 | |||
781 | |||
773 | !Cname netscape | 782 | !Cname netscape |
774 | 2 16 840 1 113730 : Netscape : Netscape Communications Corp. | 783 | 2 16 840 1 113730 : Netscape : Netscape Communications Corp. |
775 | !Cname netscape-cert-extension | 784 | !Cname netscape-cert-extension |
@@ -846,6 +855,10 @@ aes 2 : AES-128-CBC : aes-128-cbc | |||
846 | aes 3 : AES-128-OFB : aes-128-ofb | 855 | aes 3 : AES-128-OFB : aes-128-ofb |
847 | !Cname aes-128-cfb128 | 856 | !Cname aes-128-cfb128 |
848 | aes 4 : AES-128-CFB : aes-128-cfb | 857 | aes 4 : AES-128-CFB : aes-128-cfb |
858 | aes 5 : id-aes128-wrap | ||
859 | aes 6 : id-aes128-GCM : aes-128-gcm | ||
860 | aes 7 : id-aes128-CCM : aes-128-ccm | ||
861 | aes 8 : id-aes128-wrap-pad | ||
849 | 862 | ||
850 | aes 21 : AES-192-ECB : aes-192-ecb | 863 | aes 21 : AES-192-ECB : aes-192-ecb |
851 | aes 22 : AES-192-CBC : aes-192-cbc | 864 | aes 22 : AES-192-CBC : aes-192-cbc |
@@ -853,6 +866,10 @@ aes 22 : AES-192-CBC : aes-192-cbc | |||
853 | aes 23 : AES-192-OFB : aes-192-ofb | 866 | aes 23 : AES-192-OFB : aes-192-ofb |
854 | !Cname aes-192-cfb128 | 867 | !Cname aes-192-cfb128 |
855 | aes 24 : AES-192-CFB : aes-192-cfb | 868 | aes 24 : AES-192-CFB : aes-192-cfb |
869 | aes 25 : id-aes192-wrap | ||
870 | aes 26 : id-aes192-GCM : aes-192-gcm | ||
871 | aes 27 : id-aes192-CCM : aes-192-ccm | ||
872 | aes 28 : id-aes192-wrap-pad | ||
856 | 873 | ||
857 | aes 41 : AES-256-ECB : aes-256-ecb | 874 | aes 41 : AES-256-ECB : aes-256-ecb |
858 | aes 42 : AES-256-CBC : aes-256-cbc | 875 | aes 42 : AES-256-CBC : aes-256-cbc |
@@ -860,6 +877,10 @@ aes 42 : AES-256-CBC : aes-256-cbc | |||
860 | aes 43 : AES-256-OFB : aes-256-ofb | 877 | aes 43 : AES-256-OFB : aes-256-ofb |
861 | !Cname aes-256-cfb128 | 878 | !Cname aes-256-cfb128 |
862 | aes 44 : AES-256-CFB : aes-256-cfb | 879 | aes 44 : AES-256-CFB : aes-256-cfb |
880 | aes 45 : id-aes256-wrap | ||
881 | aes 46 : id-aes256-GCM : aes-256-gcm | ||
882 | aes 47 : id-aes256-CCM : aes-256-ccm | ||
883 | aes 48 : id-aes256-wrap-pad | ||
863 | 884 | ||
864 | # There are no OIDs for these modes... | 885 | # There are no OIDs for these modes... |
865 | 886 | ||
@@ -869,15 +890,16 @@ aes 44 : AES-256-CFB : aes-256-cfb | |||
869 | : AES-128-CFB8 : aes-128-cfb8 | 890 | : AES-128-CFB8 : aes-128-cfb8 |
870 | : AES-192-CFB8 : aes-192-cfb8 | 891 | : AES-192-CFB8 : aes-192-cfb8 |
871 | : AES-256-CFB8 : aes-256-cfb8 | 892 | : AES-256-CFB8 : aes-256-cfb8 |
893 | : AES-128-CTR : aes-128-ctr | ||
894 | : AES-192-CTR : aes-192-ctr | ||
895 | : AES-256-CTR : aes-256-ctr | ||
896 | : AES-128-XTS : aes-128-xts | ||
897 | : AES-256-XTS : aes-256-xts | ||
872 | : DES-CFB1 : des-cfb1 | 898 | : DES-CFB1 : des-cfb1 |
873 | : DES-CFB8 : des-cfb8 | 899 | : DES-CFB8 : des-cfb8 |
874 | : DES-EDE3-CFB1 : des-ede3-cfb1 | 900 | : DES-EDE3-CFB1 : des-ede3-cfb1 |
875 | : DES-EDE3-CFB8 : des-ede3-cfb8 | 901 | : DES-EDE3-CFB8 : des-ede3-cfb8 |
876 | 902 | ||
877 | aes 5 : id-aes128-wrap | ||
878 | aes 25 : id-aes192-wrap | ||
879 | aes 45 : id-aes256-wrap | ||
880 | |||
881 | # OIDs for SHA224, SHA256, SHA385 and SHA512, according to x9.84. | 903 | # OIDs for SHA224, SHA256, SHA385 and SHA512, according to x9.84. |
882 | !Alias nist_hashalgs nistAlgorithms 2 | 904 | !Alias nist_hashalgs nistAlgorithms 2 |
883 | nist_hashalgs 1 : SHA256 : sha256 | 905 | nist_hashalgs 1 : SHA256 : sha256 |
@@ -1211,6 +1233,9 @@ cryptocom 1 8 1 : id-GostR3410-2001-ParamSet-cc : GOST R 3410-2001 Parameter Se | |||
1211 | 1 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC : camellia-128-cbc | 1233 | 1 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC : camellia-128-cbc |
1212 | 1 2 392 200011 61 1 1 1 3 : CAMELLIA-192-CBC : camellia-192-cbc | 1234 | 1 2 392 200011 61 1 1 1 3 : CAMELLIA-192-CBC : camellia-192-cbc |
1213 | 1 2 392 200011 61 1 1 1 4 : CAMELLIA-256-CBC : camellia-256-cbc | 1235 | 1 2 392 200011 61 1 1 1 4 : CAMELLIA-256-CBC : camellia-256-cbc |
1236 | 1 2 392 200011 61 1 1 3 2 : id-camellia128-wrap | ||
1237 | 1 2 392 200011 61 1 1 3 3 : id-camellia192-wrap | ||
1238 | 1 2 392 200011 61 1 1 3 4 : id-camellia256-wrap | ||
1214 | 1239 | ||
1215 | # Definitions for Camellia cipher - ECB, CFB, OFB MODE | 1240 | # Definitions for Camellia cipher - ECB, CFB, OFB MODE |
1216 | 1241 | ||
@@ -1257,3 +1282,11 @@ kisa 1 6 : SEED-OFB : seed-ofb | |||
1257 | # There is no OID that just denotes "HMAC" oddly enough... | 1282 | # There is no OID that just denotes "HMAC" oddly enough... |
1258 | 1283 | ||
1259 | : HMAC : hmac | 1284 | : HMAC : hmac |
1285 | # Nor CMAC either | ||
1286 | : CMAC : cmac | ||
1287 | |||
1288 | # Synthetic composite ciphersuites | ||
1289 | : RC4-HMAC-MD5 : rc4-hmac-md5 | ||
1290 | : AES-128-CBC-HMAC-SHA1 : aes-128-cbc-hmac-sha1 | ||
1291 | : AES-192-CBC-HMAC-SHA1 : aes-192-cbc-hmac-sha1 | ||
1292 | : AES-256-CBC-HMAC-SHA1 : aes-256-cbc-hmac-sha1 | ||
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c b/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c index e92b86c060..a94dc838ee 100644 --- a/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c +++ b/src/lib/libssl/src/crypto/ocsp/ocsp_lib.c | |||
@@ -124,7 +124,8 @@ OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst, | |||
124 | if (!(ASN1_OCTET_STRING_set(cid->issuerNameHash, md, i))) goto err; | 124 | if (!(ASN1_OCTET_STRING_set(cid->issuerNameHash, md, i))) goto err; |
125 | 125 | ||
126 | /* Calculate the issuerKey hash, excluding tag and length */ | 126 | /* Calculate the issuerKey hash, excluding tag and length */ |
127 | EVP_Digest(issuerKey->data, issuerKey->length, md, &i, dgst, NULL); | 127 | if (!EVP_Digest(issuerKey->data, issuerKey->length, md, &i, dgst, NULL)) |
128 | goto err; | ||
128 | 129 | ||
129 | if (!(ASN1_OCTET_STRING_set(cid->issuerKeyHash, md, i))) goto err; | 130 | if (!(ASN1_OCTET_STRING_set(cid->issuerKeyHash, md, i))) goto err; |
130 | 131 | ||
diff --git a/src/lib/libssl/src/crypto/opensslconf.h b/src/lib/libssl/src/crypto/opensslconf.h index c21b3913f0..b18f4da496 100644 --- a/src/lib/libssl/src/crypto/opensslconf.h +++ b/src/lib/libssl/src/crypto/opensslconf.h | |||
@@ -5,6 +5,9 @@ | |||
5 | #ifndef OPENSSL_DOING_MAKEDEPEND | 5 | #ifndef OPENSSL_DOING_MAKEDEPEND |
6 | 6 | ||
7 | 7 | ||
8 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
9 | # define OPENSSL_NO_EC_NISTP_64_GCC_128 | ||
10 | #endif | ||
8 | #ifndef OPENSSL_NO_GMP | 11 | #ifndef OPENSSL_NO_GMP |
9 | # define OPENSSL_NO_GMP | 12 | # define OPENSSL_NO_GMP |
10 | #endif | 13 | #endif |
@@ -23,6 +26,9 @@ | |||
23 | #ifndef OPENSSL_NO_RFC3779 | 26 | #ifndef OPENSSL_NO_RFC3779 |
24 | # define OPENSSL_NO_RFC3779 | 27 | # define OPENSSL_NO_RFC3779 |
25 | #endif | 28 | #endif |
29 | #ifndef OPENSSL_NO_SCTP | ||
30 | # define OPENSSL_NO_SCTP | ||
31 | #endif | ||
26 | #ifndef OPENSSL_NO_STORE | 32 | #ifndef OPENSSL_NO_STORE |
27 | # define OPENSSL_NO_STORE | 33 | # define OPENSSL_NO_STORE |
28 | #endif | 34 | #endif |
@@ -38,6 +44,9 @@ | |||
38 | who haven't had the time to do the appropriate changes in their | 44 | who haven't had the time to do the appropriate changes in their |
39 | applications. */ | 45 | applications. */ |
40 | #ifdef OPENSSL_ALGORITHM_DEFINES | 46 | #ifdef OPENSSL_ALGORITHM_DEFINES |
47 | # if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) | ||
48 | # define NO_EC_NISTP_64_GCC_128 | ||
49 | # endif | ||
41 | # if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) | 50 | # if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) |
42 | # define NO_GMP | 51 | # define NO_GMP |
43 | # endif | 52 | # endif |
@@ -56,6 +65,9 @@ | |||
56 | # if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) | 65 | # if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) |
57 | # define NO_RFC3779 | 66 | # define NO_RFC3779 |
58 | # endif | 67 | # endif |
68 | # if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) | ||
69 | # define NO_SCTP | ||
70 | # endif | ||
59 | # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) | 71 | # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) |
60 | # define NO_STORE | 72 | # define NO_STORE |
61 | # endif | 73 | # endif |
diff --git a/src/lib/libssl/src/crypto/opensslv.h b/src/lib/libssl/src/crypto/opensslv.h index d6d61a0c7d..71be3590af 100644 --- a/src/lib/libssl/src/crypto/opensslv.h +++ b/src/lib/libssl/src/crypto/opensslv.h | |||
@@ -25,11 +25,11 @@ | |||
25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for | 25 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for |
26 | * major minor fix final patch/beta) | 26 | * major minor fix final patch/beta) |
27 | */ | 27 | */ |
28 | #define OPENSSL_VERSION_NUMBER 0x1000006fL | 28 | #define OPENSSL_VERSION_NUMBER 0x1000103fL |
29 | #ifdef OPENSSL_FIPS | 29 | #ifdef OPENSSL_FIPS |
30 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0f-fips 4 Jan 2012" | 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c-fips 10 May 2012" |
31 | #else | 31 | #else |
32 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0f 4 Jan 2012" | 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.1c 10 May 2012" |
33 | #endif | 33 | #endif |
34 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT | 34 | #define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT |
35 | 35 | ||
diff --git a/src/lib/libssl/src/crypto/ossl_typ.h b/src/lib/libssl/src/crypto/ossl_typ.h index 12bd7014de..ea9227f6f9 100644 --- a/src/lib/libssl/src/crypto/ossl_typ.h +++ b/src/lib/libssl/src/crypto/ossl_typ.h | |||
@@ -91,10 +91,12 @@ typedef struct asn1_string_st ASN1_TIME; | |||
91 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; | 91 | typedef struct asn1_string_st ASN1_GENERALIZEDTIME; |
92 | typedef struct asn1_string_st ASN1_VISIBLESTRING; | 92 | typedef struct asn1_string_st ASN1_VISIBLESTRING; |
93 | typedef struct asn1_string_st ASN1_UTF8STRING; | 93 | typedef struct asn1_string_st ASN1_UTF8STRING; |
94 | typedef struct asn1_string_st ASN1_STRING; | ||
94 | typedef int ASN1_BOOLEAN; | 95 | typedef int ASN1_BOOLEAN; |
95 | typedef int ASN1_NULL; | 96 | typedef int ASN1_NULL; |
96 | #endif | 97 | #endif |
97 | 98 | ||
99 | typedef struct ASN1_ITEM_st ASN1_ITEM; | ||
98 | typedef struct asn1_pctx_st ASN1_PCTX; | 100 | typedef struct asn1_pctx_st ASN1_PCTX; |
99 | 101 | ||
100 | #ifdef OPENSSL_SYS_WIN32 | 102 | #ifdef OPENSSL_SYS_WIN32 |
diff --git a/src/lib/libssl/src/crypto/perlasm/x86asm.pl b/src/lib/libssl/src/crypto/perlasm/x86asm.pl index 28080caaa6..eb543db2f6 100644 --- a/src/lib/libssl/src/crypto/perlasm/x86asm.pl +++ b/src/lib/libssl/src/crypto/perlasm/x86asm.pl | |||
@@ -80,6 +80,57 @@ sub ::movq | |||
80 | { &::generic("movq",@_); } | 80 | { &::generic("movq",@_); } |
81 | } | 81 | } |
82 | 82 | ||
83 | # SSE>2 instructions | ||
84 | my %regrm = ( "eax"=>0, "ecx"=>1, "edx"=>2, "ebx"=>3, | ||
85 | "esp"=>4, "ebp"=>5, "esi"=>6, "edi"=>7 ); | ||
86 | sub ::pextrd | ||
87 | { my($dst,$src,$imm)=@_; | ||
88 | if ("$dst:$src" =~ /(e[a-dsd][ixp]):xmm([0-7])/) | ||
89 | { &::data_byte(0x66,0x0f,0x3a,0x16,0xc0|($2<<3)|$regrm{$1},$imm); } | ||
90 | else | ||
91 | { &::generic("pextrd",@_); } | ||
92 | } | ||
93 | |||
94 | sub ::pinsrd | ||
95 | { my($dst,$src,$imm)=@_; | ||
96 | if ("$dst:$src" =~ /xmm([0-7]):(e[a-dsd][ixp])/) | ||
97 | { &::data_byte(0x66,0x0f,0x3a,0x22,0xc0|($1<<3)|$regrm{$2},$imm); } | ||
98 | else | ||
99 | { &::generic("pinsrd",@_); } | ||
100 | } | ||
101 | |||
102 | sub ::pshufb | ||
103 | { my($dst,$src)=@_; | ||
104 | if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) | ||
105 | { &data_byte(0x66,0x0f,0x38,0x00,0xc0|($1<<3)|$2); } | ||
106 | else | ||
107 | { &::generic("pshufb",@_); } | ||
108 | } | ||
109 | |||
110 | sub ::palignr | ||
111 | { my($dst,$src,$imm)=@_; | ||
112 | if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) | ||
113 | { &::data_byte(0x66,0x0f,0x3a,0x0f,0xc0|($1<<3)|$2,$imm); } | ||
114 | else | ||
115 | { &::generic("palignr",@_); } | ||
116 | } | ||
117 | |||
118 | sub ::pclmulqdq | ||
119 | { my($dst,$src,$imm)=@_; | ||
120 | if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) | ||
121 | { &::data_byte(0x66,0x0f,0x3a,0x44,0xc0|($1<<3)|$2,$imm); } | ||
122 | else | ||
123 | { &::generic("pclmulqdq",@_); } | ||
124 | } | ||
125 | |||
126 | sub ::rdrand | ||
127 | { my ($dst)=@_; | ||
128 | if ($dst =~ /(e[a-dsd][ixp])/) | ||
129 | { &::data_byte(0x0f,0xc7,0xf0|$regrm{$dst}); } | ||
130 | else | ||
131 | { &::generic("rdrand",@_); } | ||
132 | } | ||
133 | |||
83 | # label management | 134 | # label management |
84 | $lbdecor="L"; # local label decoration, set by package | 135 | $lbdecor="L"; # local label decoration, set by package |
85 | $label="000"; | 136 | $label="000"; |
@@ -167,7 +218,7 @@ sub ::asm_init | |||
167 | $filename=$fn; | 218 | $filename=$fn; |
168 | $i386=$cpu; | 219 | $i386=$cpu; |
169 | 220 | ||
170 | $elf=$cpp=$coff=$aout=$macosx=$win32=$netware=$mwerks=0; | 221 | $elf=$cpp=$coff=$aout=$macosx=$win32=$netware=$mwerks=$android=0; |
171 | if (($type eq "elf")) | 222 | if (($type eq "elf")) |
172 | { $elf=1; require "x86gas.pl"; } | 223 | { $elf=1; require "x86gas.pl"; } |
173 | elsif (($type eq "a\.out")) | 224 | elsif (($type eq "a\.out")) |
@@ -184,6 +235,8 @@ sub ::asm_init | |||
184 | { $win32=1; require "x86masm.pl"; } | 235 | { $win32=1; require "x86masm.pl"; } |
185 | elsif (($type eq "macosx")) | 236 | elsif (($type eq "macosx")) |
186 | { $aout=1; $macosx=1; require "x86gas.pl"; } | 237 | { $aout=1; $macosx=1; require "x86gas.pl"; } |
238 | elsif (($type eq "android")) | ||
239 | { $elf=1; $android=1; require "x86gas.pl"; } | ||
187 | else | 240 | else |
188 | { print STDERR <<"EOF"; | 241 | { print STDERR <<"EOF"; |
189 | Pick one target type from | 242 | Pick one target type from |
diff --git a/src/lib/libssl/src/crypto/perlasm/x86nasm.pl b/src/lib/libssl/src/crypto/perlasm/x86nasm.pl index ce2bed9bb2..ca2511c9eb 100644 --- a/src/lib/libssl/src/crypto/perlasm/x86nasm.pl +++ b/src/lib/libssl/src/crypto/perlasm/x86nasm.pl | |||
@@ -19,6 +19,8 @@ sub ::generic | |||
19 | { $_[0] = "NEAR $_[0]"; } | 19 | { $_[0] = "NEAR $_[0]"; } |
20 | elsif ($opcode eq "lea" && $#_==1) # wipe storage qualifier from lea | 20 | elsif ($opcode eq "lea" && $#_==1) # wipe storage qualifier from lea |
21 | { $_[1] =~ s/^[^\[]*\[/\[/o; } | 21 | { $_[1] =~ s/^[^\[]*\[/\[/o; } |
22 | elsif ($opcode eq "clflush" && $#_==0) | ||
23 | { $_[0] =~ s/^[^\[]*\[/\[/o; } | ||
22 | } | 24 | } |
23 | &::emit($opcode,@_); | 25 | &::emit($opcode,@_); |
24 | 1; | 26 | 1; |
@@ -67,6 +69,7 @@ sub get_mem | |||
67 | } | 69 | } |
68 | sub ::BP { &get_mem("BYTE",@_); } | 70 | sub ::BP { &get_mem("BYTE",@_); } |
69 | sub ::DWP { &get_mem("DWORD",@_); } | 71 | sub ::DWP { &get_mem("DWORD",@_); } |
72 | sub ::WP { &get_mem("WORD",@_); } | ||
70 | sub ::QWP { &get_mem("",@_); } | 73 | sub ::QWP { &get_mem("",@_); } |
71 | sub ::BC { (($::mwerks)?"":"BYTE ")."@_"; } | 74 | sub ::BC { (($::mwerks)?"":"BYTE ")."@_"; } |
72 | sub ::DWC { (($::mwerks)?"":"DWORD ")."@_"; } | 75 | sub ::DWC { (($::mwerks)?"":"DWORD ")."@_"; } |
@@ -114,7 +117,7 @@ sub ::file_end | |||
114 | { if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) | 117 | { if (grep {/\b${nmdecor}OPENSSL_ia32cap_P\b/i} @out) |
115 | { my $comm=<<___; | 118 | { my $comm=<<___; |
116 | ${drdecor}segment .bss | 119 | ${drdecor}segment .bss |
117 | ${drdecor}common ${nmdecor}OPENSSL_ia32cap_P 4 | 120 | ${drdecor}common ${nmdecor}OPENSSL_ia32cap_P 8 |
118 | ___ | 121 | ___ |
119 | # comment out OPENSSL_ia32cap_P declarations | 122 | # comment out OPENSSL_ia32cap_P declarations |
120 | grep {s/(^extern\s+${nmdecor}OPENSSL_ia32cap_P)/\;$1/} @out; | 123 | grep {s/(^extern\s+${nmdecor}OPENSSL_ia32cap_P)/\;$1/} @out; |
@@ -135,7 +138,8 @@ sub ::public_label | |||
135 | 138 | ||
136 | sub ::data_byte | 139 | sub ::data_byte |
137 | { push(@out,(($::mwerks)?".byte\t":"db\t").join(',',@_)."\n"); } | 140 | { push(@out,(($::mwerks)?".byte\t":"db\t").join(',',@_)."\n"); } |
138 | 141 | sub ::data_short | |
142 | { push(@out,(($::mwerks)?".word\t":"dw\t").join(',',@_)."\n"); } | ||
139 | sub ::data_word | 143 | sub ::data_word |
140 | { push(@out,(($::mwerks)?".long\t":"dd\t").join(',',@_)."\n"); } | 144 | { push(@out,(($::mwerks)?".long\t":"dd\t").join(',',@_)."\n"); } |
141 | 145 | ||
@@ -163,4 +167,11 @@ sub ::dataseg | |||
163 | else { push(@out,"section\t.data align=4\n"); } | 167 | else { push(@out,"section\t.data align=4\n"); } |
164 | } | 168 | } |
165 | 169 | ||
170 | sub ::safeseh | ||
171 | { my $nm=shift; | ||
172 | push(@out,"%if __NASM_VERSION_ID__ >= 0x02030000\n"); | ||
173 | push(@out,"safeseh ".&::LABEL($nm,$nmdecor.$nm)."\n"); | ||
174 | push(@out,"%endif\n"); | ||
175 | } | ||
176 | |||
166 | 1; | 177 | 1; |
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_decr.c b/src/lib/libssl/src/crypto/pkcs12/p12_decr.c index ba77dbbe32..9d3557e8d7 100644 --- a/src/lib/libssl/src/crypto/pkcs12/p12_decr.c +++ b/src/lib/libssl/src/crypto/pkcs12/p12_decr.c | |||
@@ -89,7 +89,14 @@ unsigned char * PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass, | |||
89 | goto err; | 89 | goto err; |
90 | } | 90 | } |
91 | 91 | ||
92 | EVP_CipherUpdate(&ctx, out, &i, in, inlen); | 92 | if (!EVP_CipherUpdate(&ctx, out, &i, in, inlen)) |
93 | { | ||
94 | OPENSSL_free(out); | ||
95 | out = NULL; | ||
96 | PKCS12err(PKCS12_F_PKCS12_PBE_CRYPT,ERR_R_EVP_LIB); | ||
97 | goto err; | ||
98 | } | ||
99 | |||
93 | outlen = i; | 100 | outlen = i; |
94 | if(!EVP_CipherFinal_ex(&ctx, out + i, &i)) { | 101 | if(!EVP_CipherFinal_ex(&ctx, out + i, &i)) { |
95 | OPENSSL_free(out); | 102 | OPENSSL_free(out); |
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_key.c b/src/lib/libssl/src/crypto/pkcs12/p12_key.c index 424203f648..c55c7b60b3 100644 --- a/src/lib/libssl/src/crypto/pkcs12/p12_key.c +++ b/src/lib/libssl/src/crypto/pkcs12/p12_key.c | |||
@@ -152,14 +152,16 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
152 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; | 152 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; |
153 | for (i = 0; i < Plen; i++) *p++ = pass[i % passlen]; | 153 | for (i = 0; i < Plen; i++) *p++ = pass[i % passlen]; |
154 | for (;;) { | 154 | for (;;) { |
155 | EVP_DigestInit_ex(&ctx, md_type, NULL); | 155 | if (!EVP_DigestInit_ex(&ctx, md_type, NULL) |
156 | EVP_DigestUpdate(&ctx, D, v); | 156 | || !EVP_DigestUpdate(&ctx, D, v) |
157 | EVP_DigestUpdate(&ctx, I, Ilen); | 157 | || !EVP_DigestUpdate(&ctx, I, Ilen) |
158 | EVP_DigestFinal_ex(&ctx, Ai, NULL); | 158 | || !EVP_DigestFinal_ex(&ctx, Ai, NULL)) |
159 | goto err; | ||
159 | for (j = 1; j < iter; j++) { | 160 | for (j = 1; j < iter; j++) { |
160 | EVP_DigestInit_ex(&ctx, md_type, NULL); | 161 | if (!EVP_DigestInit_ex(&ctx, md_type, NULL) |
161 | EVP_DigestUpdate(&ctx, Ai, u); | 162 | || !EVP_DigestUpdate(&ctx, Ai, u) |
162 | EVP_DigestFinal_ex(&ctx, Ai, NULL); | 163 | || !EVP_DigestFinal_ex(&ctx, Ai, NULL)) |
164 | goto err; | ||
163 | } | 165 | } |
164 | memcpy (out, Ai, min (n, u)); | 166 | memcpy (out, Ai, min (n, u)); |
165 | if (u >= n) { | 167 | if (u >= n) { |
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c b/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c index 292cc3ed4a..206b1b0b18 100644 --- a/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c +++ b/src/lib/libssl/src/crypto/pkcs12/p12_kiss.c | |||
@@ -167,7 +167,7 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | |||
167 | if (cert && *cert) | 167 | if (cert && *cert) |
168 | X509_free(*cert); | 168 | X509_free(*cert); |
169 | if (x) | 169 | if (x) |
170 | X509_free(*cert); | 170 | X509_free(x); |
171 | if (ocerts) | 171 | if (ocerts) |
172 | sk_X509_pop_free(ocerts, X509_free); | 172 | sk_X509_pop_free(ocerts, X509_free); |
173 | return 0; | 173 | return 0; |
diff --git a/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c b/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c index 9ab740d51f..96de1bd11e 100644 --- a/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c +++ b/src/lib/libssl/src/crypto/pkcs12/p12_mutl.c | |||
@@ -97,10 +97,14 @@ int PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen, | |||
97 | return 0; | 97 | return 0; |
98 | } | 98 | } |
99 | HMAC_CTX_init(&hmac); | 99 | HMAC_CTX_init(&hmac); |
100 | HMAC_Init_ex(&hmac, key, md_size, md_type, NULL); | 100 | if (!HMAC_Init_ex(&hmac, key, md_size, md_type, NULL) |
101 | HMAC_Update(&hmac, p12->authsafes->d.data->data, | 101 | || !HMAC_Update(&hmac, p12->authsafes->d.data->data, |
102 | p12->authsafes->d.data->length); | 102 | p12->authsafes->d.data->length) |
103 | HMAC_Final(&hmac, mac, maclen); | 103 | || !HMAC_Final(&hmac, mac, maclen)) |
104 | { | ||
105 | HMAC_CTX_cleanup(&hmac); | ||
106 | return 0; | ||
107 | } | ||
104 | HMAC_CTX_cleanup(&hmac); | 108 | HMAC_CTX_cleanup(&hmac); |
105 | return 1; | 109 | return 1; |
106 | } | 110 | } |
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c index 3bf1a367bb..77fda3b82a 100644 --- a/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c +++ b/src/lib/libssl/src/crypto/pkcs7/pk7_doit.c | |||
@@ -204,11 +204,11 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen, | |||
204 | unsigned char *ek = NULL; | 204 | unsigned char *ek = NULL; |
205 | size_t eklen; | 205 | size_t eklen; |
206 | 206 | ||
207 | int ret = 0; | 207 | int ret = -1; |
208 | 208 | ||
209 | pctx = EVP_PKEY_CTX_new(pkey, NULL); | 209 | pctx = EVP_PKEY_CTX_new(pkey, NULL); |
210 | if (!pctx) | 210 | if (!pctx) |
211 | return 0; | 211 | return -1; |
212 | 212 | ||
213 | if (EVP_PKEY_decrypt_init(pctx) <= 0) | 213 | if (EVP_PKEY_decrypt_init(pctx) <= 0) |
214 | goto err; | 214 | goto err; |
@@ -235,12 +235,19 @@ static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen, | |||
235 | if (EVP_PKEY_decrypt(pctx, ek, &eklen, | 235 | if (EVP_PKEY_decrypt(pctx, ek, &eklen, |
236 | ri->enc_key->data, ri->enc_key->length) <= 0) | 236 | ri->enc_key->data, ri->enc_key->length) <= 0) |
237 | { | 237 | { |
238 | ret = 0; | ||
238 | PKCS7err(PKCS7_F_PKCS7_DECRYPT_RINFO, ERR_R_EVP_LIB); | 239 | PKCS7err(PKCS7_F_PKCS7_DECRYPT_RINFO, ERR_R_EVP_LIB); |
239 | goto err; | 240 | goto err; |
240 | } | 241 | } |
241 | 242 | ||
242 | ret = 1; | 243 | ret = 1; |
243 | 244 | ||
245 | if (*pek) | ||
246 | { | ||
247 | OPENSSL_cleanse(*pek, *peklen); | ||
248 | OPENSSL_free(*pek); | ||
249 | } | ||
250 | |||
244 | *pek = ek; | 251 | *pek = ek; |
245 | *peklen = eklen; | 252 | *peklen = eklen; |
246 | 253 | ||
@@ -423,6 +430,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
423 | STACK_OF(X509_ALGOR) *md_sk=NULL; | 430 | STACK_OF(X509_ALGOR) *md_sk=NULL; |
424 | STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL; | 431 | STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL; |
425 | PKCS7_RECIP_INFO *ri=NULL; | 432 | PKCS7_RECIP_INFO *ri=NULL; |
433 | unsigned char *ek = NULL, *tkey = NULL; | ||
434 | int eklen = 0, tkeylen = 0; | ||
426 | 435 | ||
427 | i=OBJ_obj2nid(p7->type); | 436 | i=OBJ_obj2nid(p7->type); |
428 | p7->state=PKCS7_S_HEADER; | 437 | p7->state=PKCS7_S_HEADER; |
@@ -500,8 +509,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
500 | int max; | 509 | int max; |
501 | X509_OBJECT ret; | 510 | X509_OBJECT ret; |
502 | #endif | 511 | #endif |
503 | unsigned char *ek = NULL; | ||
504 | int eklen; | ||
505 | 512 | ||
506 | if ((etmp=BIO_new(BIO_f_cipher())) == NULL) | 513 | if ((etmp=BIO_new(BIO_f_cipher())) == NULL) |
507 | { | 514 | { |
@@ -534,29 +541,28 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
534 | } | 541 | } |
535 | 542 | ||
536 | /* If we haven't got a certificate try each ri in turn */ | 543 | /* If we haven't got a certificate try each ri in turn */ |
537 | |||
538 | if (pcert == NULL) | 544 | if (pcert == NULL) |
539 | { | 545 | { |
546 | /* Always attempt to decrypt all rinfo even | ||
547 | * after sucess as a defence against MMA timing | ||
548 | * attacks. | ||
549 | */ | ||
540 | for (i=0; i<sk_PKCS7_RECIP_INFO_num(rsk); i++) | 550 | for (i=0; i<sk_PKCS7_RECIP_INFO_num(rsk); i++) |
541 | { | 551 | { |
542 | ri=sk_PKCS7_RECIP_INFO_value(rsk,i); | 552 | ri=sk_PKCS7_RECIP_INFO_value(rsk,i); |
553 | |||
543 | if (pkcs7_decrypt_rinfo(&ek, &eklen, | 554 | if (pkcs7_decrypt_rinfo(&ek, &eklen, |
544 | ri, pkey) > 0) | 555 | ri, pkey) < 0) |
545 | break; | 556 | goto err; |
546 | ERR_clear_error(); | 557 | ERR_clear_error(); |
547 | ri = NULL; | ||
548 | } | ||
549 | if (ri == NULL) | ||
550 | { | ||
551 | PKCS7err(PKCS7_F_PKCS7_DATADECODE, | ||
552 | PKCS7_R_NO_RECIPIENT_MATCHES_KEY); | ||
553 | goto err; | ||
554 | } | 558 | } |
555 | } | 559 | } |
556 | else | 560 | else |
557 | { | 561 | { |
558 | if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey) <= 0) | 562 | /* Only exit on fatal errors, not decrypt failure */ |
563 | if (pkcs7_decrypt_rinfo(&ek, &eklen, ri, pkey) < 0) | ||
559 | goto err; | 564 | goto err; |
565 | ERR_clear_error(); | ||
560 | } | 566 | } |
561 | 567 | ||
562 | evp_ctx=NULL; | 568 | evp_ctx=NULL; |
@@ -565,6 +571,19 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
565 | goto err; | 571 | goto err; |
566 | if (EVP_CIPHER_asn1_to_param(evp_ctx,enc_alg->parameter) < 0) | 572 | if (EVP_CIPHER_asn1_to_param(evp_ctx,enc_alg->parameter) < 0) |
567 | goto err; | 573 | goto err; |
574 | /* Generate random key as MMA defence */ | ||
575 | tkeylen = EVP_CIPHER_CTX_key_length(evp_ctx); | ||
576 | tkey = OPENSSL_malloc(tkeylen); | ||
577 | if (!tkey) | ||
578 | goto err; | ||
579 | if (EVP_CIPHER_CTX_rand_key(evp_ctx, tkey) <= 0) | ||
580 | goto err; | ||
581 | if (ek == NULL) | ||
582 | { | ||
583 | ek = tkey; | ||
584 | eklen = tkeylen; | ||
585 | tkey = NULL; | ||
586 | } | ||
568 | 587 | ||
569 | if (eklen != EVP_CIPHER_CTX_key_length(evp_ctx)) { | 588 | if (eklen != EVP_CIPHER_CTX_key_length(evp_ctx)) { |
570 | /* Some S/MIME clients don't use the same key | 589 | /* Some S/MIME clients don't use the same key |
@@ -573,11 +592,16 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
573 | */ | 592 | */ |
574 | if(!EVP_CIPHER_CTX_set_key_length(evp_ctx, eklen)) | 593 | if(!EVP_CIPHER_CTX_set_key_length(evp_ctx, eklen)) |
575 | { | 594 | { |
576 | PKCS7err(PKCS7_F_PKCS7_DATADECODE, | 595 | /* Use random key as MMA defence */ |
577 | PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH); | 596 | OPENSSL_cleanse(ek, eklen); |
578 | goto err; | 597 | OPENSSL_free(ek); |
598 | ek = tkey; | ||
599 | eklen = tkeylen; | ||
600 | tkey = NULL; | ||
579 | } | 601 | } |
580 | } | 602 | } |
603 | /* Clear errors so we don't leak information useful in MMA */ | ||
604 | ERR_clear_error(); | ||
581 | if (EVP_CipherInit_ex(evp_ctx,NULL,NULL,ek,NULL,0) <= 0) | 605 | if (EVP_CipherInit_ex(evp_ctx,NULL,NULL,ek,NULL,0) <= 0) |
582 | goto err; | 606 | goto err; |
583 | 607 | ||
@@ -585,6 +609,13 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
585 | { | 609 | { |
586 | OPENSSL_cleanse(ek,eklen); | 610 | OPENSSL_cleanse(ek,eklen); |
587 | OPENSSL_free(ek); | 611 | OPENSSL_free(ek); |
612 | ek = NULL; | ||
613 | } | ||
614 | if (tkey) | ||
615 | { | ||
616 | OPENSSL_cleanse(tkey,tkeylen); | ||
617 | OPENSSL_free(tkey); | ||
618 | tkey = NULL; | ||
588 | } | 619 | } |
589 | 620 | ||
590 | if (out == NULL) | 621 | if (out == NULL) |
@@ -627,6 +658,16 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
627 | if (0) | 658 | if (0) |
628 | { | 659 | { |
629 | err: | 660 | err: |
661 | if (ek) | ||
662 | { | ||
663 | OPENSSL_cleanse(ek,eklen); | ||
664 | OPENSSL_free(ek); | ||
665 | } | ||
666 | if (tkey) | ||
667 | { | ||
668 | OPENSSL_cleanse(tkey,tkeylen); | ||
669 | OPENSSL_free(tkey); | ||
670 | } | ||
630 | if (out != NULL) BIO_free_all(out); | 671 | if (out != NULL) BIO_free_all(out); |
631 | if (btmp != NULL) BIO_free_all(btmp); | 672 | if (btmp != NULL) BIO_free_all(btmp); |
632 | if (etmp != NULL) BIO_free_all(etmp); | 673 | if (etmp != NULL) BIO_free_all(etmp); |
@@ -676,7 +717,11 @@ static int do_pkcs7_signed_attrib(PKCS7_SIGNER_INFO *si, EVP_MD_CTX *mctx) | |||
676 | } | 717 | } |
677 | 718 | ||
678 | /* Add digest */ | 719 | /* Add digest */ |
679 | EVP_DigestFinal_ex(mctx, md_data,&md_len); | 720 | if (!EVP_DigestFinal_ex(mctx, md_data,&md_len)) |
721 | { | ||
722 | PKCS7err(PKCS7_F_DO_PKCS7_SIGNED_ATTRIB, ERR_R_EVP_LIB); | ||
723 | return 0; | ||
724 | } | ||
680 | if (!PKCS7_add1_attrib_digest(si, md_data, md_len)) | 725 | if (!PKCS7_add1_attrib_digest(si, md_data, md_len)) |
681 | { | 726 | { |
682 | PKCS7err(PKCS7_F_DO_PKCS7_SIGNED_ATTRIB, ERR_R_MALLOC_FAILURE); | 727 | PKCS7err(PKCS7_F_DO_PKCS7_SIGNED_ATTRIB, ERR_R_MALLOC_FAILURE); |
@@ -784,7 +829,8 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) | |||
784 | 829 | ||
785 | /* We now have the EVP_MD_CTX, lets do the | 830 | /* We now have the EVP_MD_CTX, lets do the |
786 | * signing. */ | 831 | * signing. */ |
787 | EVP_MD_CTX_copy_ex(&ctx_tmp,mdc); | 832 | if (!EVP_MD_CTX_copy_ex(&ctx_tmp,mdc)) |
833 | goto err; | ||
788 | 834 | ||
789 | sk=si->auth_attr; | 835 | sk=si->auth_attr; |
790 | 836 | ||
@@ -822,7 +868,8 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) | |||
822 | if (!PKCS7_find_digest(&mdc, bio, | 868 | if (!PKCS7_find_digest(&mdc, bio, |
823 | OBJ_obj2nid(p7->d.digest->md->algorithm))) | 869 | OBJ_obj2nid(p7->d.digest->md->algorithm))) |
824 | goto err; | 870 | goto err; |
825 | EVP_DigestFinal_ex(mdc,md_data,&md_len); | 871 | if (!EVP_DigestFinal_ex(mdc,md_data,&md_len)) |
872 | goto err; | ||
826 | M_ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, md_len); | 873 | M_ASN1_OCTET_STRING_set(p7->d.digest->digest, md_data, md_len); |
827 | } | 874 | } |
828 | 875 | ||
@@ -1015,7 +1062,8 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, | |||
1015 | 1062 | ||
1016 | /* mdc is the digest ctx that we want, unless there are attributes, | 1063 | /* mdc is the digest ctx that we want, unless there are attributes, |
1017 | * in which case the digest is the signed attributes */ | 1064 | * in which case the digest is the signed attributes */ |
1018 | EVP_MD_CTX_copy_ex(&mdc_tmp,mdc); | 1065 | if (!EVP_MD_CTX_copy_ex(&mdc_tmp,mdc)) |
1066 | goto err; | ||
1019 | 1067 | ||
1020 | sk=si->auth_attr; | 1068 | sk=si->auth_attr; |
1021 | if ((sk != NULL) && (sk_X509_ATTRIBUTE_num(sk) != 0)) | 1069 | if ((sk != NULL) && (sk_X509_ATTRIBUTE_num(sk) != 0)) |
@@ -1025,7 +1073,8 @@ int PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si, | |||
1025 | int alen; | 1073 | int alen; |
1026 | ASN1_OCTET_STRING *message_digest; | 1074 | ASN1_OCTET_STRING *message_digest; |
1027 | 1075 | ||
1028 | EVP_DigestFinal_ex(&mdc_tmp,md_dat,&md_len); | 1076 | if (!EVP_DigestFinal_ex(&mdc_tmp,md_dat,&md_len)) |
1077 | goto err; | ||
1029 | message_digest=PKCS7_digest_from_attributes(sk); | 1078 | message_digest=PKCS7_digest_from_attributes(sk); |
1030 | if (!message_digest) | 1079 | if (!message_digest) |
1031 | { | 1080 | { |
@@ -1050,7 +1099,8 @@ for (ii=0; ii<md_len; ii++) printf("%02X",md_dat[ii]); printf(" calc\n"); | |||
1050 | goto err; | 1099 | goto err; |
1051 | } | 1100 | } |
1052 | 1101 | ||
1053 | EVP_VerifyInit_ex(&mdc_tmp,EVP_get_digestbynid(md_type), NULL); | 1102 | if (!EVP_VerifyInit_ex(&mdc_tmp,EVP_get_digestbynid(md_type), NULL)) |
1103 | goto err; | ||
1054 | 1104 | ||
1055 | alen = ASN1_item_i2d((ASN1_VALUE *)sk, &abuf, | 1105 | alen = ASN1_item_i2d((ASN1_VALUE *)sk, &abuf, |
1056 | ASN1_ITEM_rptr(PKCS7_ATTR_VERIFY)); | 1106 | ASN1_ITEM_rptr(PKCS7_ATTR_VERIFY)); |
@@ -1060,7 +1110,8 @@ for (ii=0; ii<md_len; ii++) printf("%02X",md_dat[ii]); printf(" calc\n"); | |||
1060 | ret = -1; | 1110 | ret = -1; |
1061 | goto err; | 1111 | goto err; |
1062 | } | 1112 | } |
1063 | EVP_VerifyUpdate(&mdc_tmp, abuf, alen); | 1113 | if (!EVP_VerifyUpdate(&mdc_tmp, abuf, alen)) |
1114 | goto err; | ||
1064 | 1115 | ||
1065 | OPENSSL_free(abuf); | 1116 | OPENSSL_free(abuf); |
1066 | } | 1117 | } |
diff --git a/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c b/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c index 86742d0dcd..a5104f8d05 100644 --- a/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c +++ b/src/lib/libssl/src/crypto/pkcs7/pk7_smime.c | |||
@@ -573,15 +573,34 @@ int PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data, int flags) | |||
573 | return 0; | 573 | return 0; |
574 | } | 574 | } |
575 | ret = SMIME_text(bread, data); | 575 | ret = SMIME_text(bread, data); |
576 | if (ret > 0 && BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) | ||
577 | { | ||
578 | if (!BIO_get_cipher_status(tmpmem)) | ||
579 | ret = 0; | ||
580 | } | ||
576 | BIO_free_all(bread); | 581 | BIO_free_all(bread); |
577 | return ret; | 582 | return ret; |
578 | } else { | 583 | } else { |
579 | for(;;) { | 584 | for(;;) { |
580 | i = BIO_read(tmpmem, buf, sizeof(buf)); | 585 | i = BIO_read(tmpmem, buf, sizeof(buf)); |
581 | if(i <= 0) break; | 586 | if(i <= 0) |
582 | BIO_write(data, buf, i); | 587 | { |
588 | ret = 1; | ||
589 | if (BIO_method_type(tmpmem) == BIO_TYPE_CIPHER) | ||
590 | { | ||
591 | if (!BIO_get_cipher_status(tmpmem)) | ||
592 | ret = 0; | ||
593 | } | ||
594 | |||
595 | break; | ||
596 | } | ||
597 | if (BIO_write(data, buf, i) != i) | ||
598 | { | ||
599 | ret = 0; | ||
600 | break; | ||
601 | } | ||
583 | } | 602 | } |
584 | BIO_free_all(tmpmem); | 603 | BIO_free_all(tmpmem); |
585 | return 1; | 604 | return ret; |
586 | } | 605 | } |
587 | } | 606 | } |
diff --git a/src/lib/libssl/src/crypto/rand/md_rand.c b/src/lib/libssl/src/crypto/rand/md_rand.c index b2f04ff13e..fcdd3f2a84 100644 --- a/src/lib/libssl/src/crypto/rand/md_rand.c +++ b/src/lib/libssl/src/crypto/rand/md_rand.c | |||
@@ -109,6 +109,8 @@ | |||
109 | * | 109 | * |
110 | */ | 110 | */ |
111 | 111 | ||
112 | #define OPENSSL_FIPSEVP | ||
113 | |||
112 | #ifdef MD_RAND_DEBUG | 114 | #ifdef MD_RAND_DEBUG |
113 | # ifndef NDEBUG | 115 | # ifndef NDEBUG |
114 | # define NDEBUG | 116 | # define NDEBUG |
@@ -157,13 +159,14 @@ const char RAND_version[]="RAND" OPENSSL_VERSION_PTEXT; | |||
157 | static void ssleay_rand_cleanup(void); | 159 | static void ssleay_rand_cleanup(void); |
158 | static void ssleay_rand_seed(const void *buf, int num); | 160 | static void ssleay_rand_seed(const void *buf, int num); |
159 | static void ssleay_rand_add(const void *buf, int num, double add_entropy); | 161 | static void ssleay_rand_add(const void *buf, int num, double add_entropy); |
160 | static int ssleay_rand_bytes(unsigned char *buf, int num); | 162 | static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo); |
163 | static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num); | ||
161 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num); | 164 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num); |
162 | static int ssleay_rand_status(void); | 165 | static int ssleay_rand_status(void); |
163 | 166 | ||
164 | RAND_METHOD rand_ssleay_meth={ | 167 | RAND_METHOD rand_ssleay_meth={ |
165 | ssleay_rand_seed, | 168 | ssleay_rand_seed, |
166 | ssleay_rand_bytes, | 169 | ssleay_rand_nopseudo_bytes, |
167 | ssleay_rand_cleanup, | 170 | ssleay_rand_cleanup, |
168 | ssleay_rand_add, | 171 | ssleay_rand_add, |
169 | ssleay_rand_pseudo_bytes, | 172 | ssleay_rand_pseudo_bytes, |
@@ -328,7 +331,7 @@ static void ssleay_rand_seed(const void *buf, int num) | |||
328 | ssleay_rand_add(buf, num, (double)num); | 331 | ssleay_rand_add(buf, num, (double)num); |
329 | } | 332 | } |
330 | 333 | ||
331 | static int ssleay_rand_bytes(unsigned char *buf, int num) | 334 | static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo) |
332 | { | 335 | { |
333 | static volatile int stirred_pool = 0; | 336 | static volatile int stirred_pool = 0; |
334 | int i,j,k,st_num,st_idx; | 337 | int i,j,k,st_num,st_idx; |
@@ -517,7 +520,9 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
517 | EVP_MD_CTX_cleanup(&m); | 520 | EVP_MD_CTX_cleanup(&m); |
518 | if (ok) | 521 | if (ok) |
519 | return(1); | 522 | return(1); |
520 | else | 523 | else if (pseudo) |
524 | return 0; | ||
525 | else | ||
521 | { | 526 | { |
522 | RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED); | 527 | RANDerr(RAND_F_SSLEAY_RAND_BYTES,RAND_R_PRNG_NOT_SEEDED); |
523 | ERR_add_error_data(1, "You need to read the OpenSSL FAQ, " | 528 | ERR_add_error_data(1, "You need to read the OpenSSL FAQ, " |
@@ -526,22 +531,16 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
526 | } | 531 | } |
527 | } | 532 | } |
528 | 533 | ||
534 | static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num) | ||
535 | { | ||
536 | return ssleay_rand_bytes(buf, num, 0); | ||
537 | } | ||
538 | |||
529 | /* pseudo-random bytes that are guaranteed to be unique but not | 539 | /* pseudo-random bytes that are guaranteed to be unique but not |
530 | unpredictable */ | 540 | unpredictable */ |
531 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) | 541 | static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num) |
532 | { | 542 | { |
533 | int ret; | 543 | return ssleay_rand_bytes(buf, num, 1); |
534 | unsigned long err; | ||
535 | |||
536 | ret = RAND_bytes(buf, num); | ||
537 | if (ret == 0) | ||
538 | { | ||
539 | err = ERR_peek_error(); | ||
540 | if (ERR_GET_LIB(err) == ERR_LIB_RAND && | ||
541 | ERR_GET_REASON(err) == RAND_R_PRNG_NOT_SEEDED) | ||
542 | ERR_clear_error(); | ||
543 | } | ||
544 | return (ret); | ||
545 | } | 544 | } |
546 | 545 | ||
547 | static int ssleay_rand_status(void) | 546 | static int ssleay_rand_status(void) |
diff --git a/src/lib/libssl/src/crypto/rand/rand.h b/src/lib/libssl/src/crypto/rand/rand.h index ac6c021763..dc8fcf94c5 100644 --- a/src/lib/libssl/src/crypto/rand/rand.h +++ b/src/lib/libssl/src/crypto/rand/rand.h | |||
@@ -119,6 +119,11 @@ int RAND_event(UINT, WPARAM, LPARAM); | |||
119 | 119 | ||
120 | #endif | 120 | #endif |
121 | 121 | ||
122 | #ifdef OPENSSL_FIPS | ||
123 | void RAND_set_fips_drbg_type(int type, int flags); | ||
124 | int RAND_init_fips(void); | ||
125 | #endif | ||
126 | |||
122 | /* BEGIN ERROR CODES */ | 127 | /* BEGIN ERROR CODES */ |
123 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 128 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
124 | * made after this point may be overwritten when the script is next run. | 129 | * made after this point may be overwritten when the script is next run. |
@@ -129,9 +134,13 @@ void ERR_load_RAND_strings(void); | |||
129 | 134 | ||
130 | /* Function codes. */ | 135 | /* Function codes. */ |
131 | #define RAND_F_RAND_GET_RAND_METHOD 101 | 136 | #define RAND_F_RAND_GET_RAND_METHOD 101 |
137 | #define RAND_F_RAND_INIT_FIPS 102 | ||
132 | #define RAND_F_SSLEAY_RAND_BYTES 100 | 138 | #define RAND_F_SSLEAY_RAND_BYTES 100 |
133 | 139 | ||
134 | /* Reason codes. */ | 140 | /* Reason codes. */ |
141 | #define RAND_R_ERROR_INITIALISING_DRBG 102 | ||
142 | #define RAND_R_ERROR_INSTANTIATING_DRBG 103 | ||
143 | #define RAND_R_NO_FIPS_RANDOM_METHOD_SET 101 | ||
135 | #define RAND_R_PRNG_NOT_SEEDED 100 | 144 | #define RAND_R_PRNG_NOT_SEEDED 100 |
136 | 145 | ||
137 | #ifdef __cplusplus | 146 | #ifdef __cplusplus |
diff --git a/src/lib/libssl/src/crypto/rand/rand_err.c b/src/lib/libssl/src/crypto/rand/rand_err.c index 03cda4dd92..b8586c8f4a 100644 --- a/src/lib/libssl/src/crypto/rand/rand_err.c +++ b/src/lib/libssl/src/crypto/rand/rand_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/rand/rand_err.c */ | 1 | /* crypto/rand/rand_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -71,12 +71,16 @@ | |||
71 | static ERR_STRING_DATA RAND_str_functs[]= | 71 | static ERR_STRING_DATA RAND_str_functs[]= |
72 | { | 72 | { |
73 | {ERR_FUNC(RAND_F_RAND_GET_RAND_METHOD), "RAND_get_rand_method"}, | 73 | {ERR_FUNC(RAND_F_RAND_GET_RAND_METHOD), "RAND_get_rand_method"}, |
74 | {ERR_FUNC(RAND_F_RAND_INIT_FIPS), "RAND_init_fips"}, | ||
74 | {ERR_FUNC(RAND_F_SSLEAY_RAND_BYTES), "SSLEAY_RAND_BYTES"}, | 75 | {ERR_FUNC(RAND_F_SSLEAY_RAND_BYTES), "SSLEAY_RAND_BYTES"}, |
75 | {0,NULL} | 76 | {0,NULL} |
76 | }; | 77 | }; |
77 | 78 | ||
78 | static ERR_STRING_DATA RAND_str_reasons[]= | 79 | static ERR_STRING_DATA RAND_str_reasons[]= |
79 | { | 80 | { |
81 | {ERR_REASON(RAND_R_ERROR_INITIALISING_DRBG),"error initialising drbg"}, | ||
82 | {ERR_REASON(RAND_R_ERROR_INSTANTIATING_DRBG),"error instantiating drbg"}, | ||
83 | {ERR_REASON(RAND_R_NO_FIPS_RANDOM_METHOD_SET),"no fips random method set"}, | ||
80 | {ERR_REASON(RAND_R_PRNG_NOT_SEEDED) ,"PRNG not seeded"}, | 84 | {ERR_REASON(RAND_R_PRNG_NOT_SEEDED) ,"PRNG not seeded"}, |
81 | {0,NULL} | 85 | {0,NULL} |
82 | }; | 86 | }; |
diff --git a/src/lib/libssl/src/crypto/rand/rand_lib.c b/src/lib/libssl/src/crypto/rand/rand_lib.c index 513e338985..daf1dab973 100644 --- a/src/lib/libssl/src/crypto/rand/rand_lib.c +++ b/src/lib/libssl/src/crypto/rand/rand_lib.c | |||
@@ -60,10 +60,16 @@ | |||
60 | #include <time.h> | 60 | #include <time.h> |
61 | #include "cryptlib.h" | 61 | #include "cryptlib.h" |
62 | #include <openssl/rand.h> | 62 | #include <openssl/rand.h> |
63 | |||
63 | #ifndef OPENSSL_NO_ENGINE | 64 | #ifndef OPENSSL_NO_ENGINE |
64 | #include <openssl/engine.h> | 65 | #include <openssl/engine.h> |
65 | #endif | 66 | #endif |
66 | 67 | ||
68 | #ifdef OPENSSL_FIPS | ||
69 | #include <openssl/fips.h> | ||
70 | #include <openssl/fips_rand.h> | ||
71 | #endif | ||
72 | |||
67 | #ifndef OPENSSL_NO_ENGINE | 73 | #ifndef OPENSSL_NO_ENGINE |
68 | /* non-NULL if default_RAND_meth is ENGINE-provided */ | 74 | /* non-NULL if default_RAND_meth is ENGINE-provided */ |
69 | static ENGINE *funct_ref =NULL; | 75 | static ENGINE *funct_ref =NULL; |
@@ -174,3 +180,116 @@ int RAND_status(void) | |||
174 | return meth->status(); | 180 | return meth->status(); |
175 | return 0; | 181 | return 0; |
176 | } | 182 | } |
183 | |||
184 | #ifdef OPENSSL_FIPS | ||
185 | |||
186 | /* FIPS DRBG initialisation code. This sets up the DRBG for use by the | ||
187 | * rest of OpenSSL. | ||
188 | */ | ||
189 | |||
190 | /* Entropy gatherer: use standard OpenSSL PRNG to seed (this will gather | ||
191 | * entropy internally through RAND_poll(). | ||
192 | */ | ||
193 | |||
194 | static size_t drbg_get_entropy(DRBG_CTX *ctx, unsigned char **pout, | ||
195 | int entropy, size_t min_len, size_t max_len) | ||
196 | { | ||
197 | /* Round up request to multiple of block size */ | ||
198 | min_len = ((min_len + 19) / 20) * 20; | ||
199 | *pout = OPENSSL_malloc(min_len); | ||
200 | if (!*pout) | ||
201 | return 0; | ||
202 | if (RAND_SSLeay()->bytes(*pout, min_len) <= 0) | ||
203 | { | ||
204 | OPENSSL_free(*pout); | ||
205 | *pout = NULL; | ||
206 | return 0; | ||
207 | } | ||
208 | return min_len; | ||
209 | } | ||
210 | |||
211 | static void drbg_free_entropy(DRBG_CTX *ctx, unsigned char *out, size_t olen) | ||
212 | { | ||
213 | OPENSSL_cleanse(out, olen); | ||
214 | OPENSSL_free(out); | ||
215 | } | ||
216 | |||
217 | /* Set "additional input" when generating random data. This uses the | ||
218 | * current PID, a time value and a counter. | ||
219 | */ | ||
220 | |||
221 | static size_t drbg_get_adin(DRBG_CTX *ctx, unsigned char **pout) | ||
222 | { | ||
223 | /* Use of static variables is OK as this happens under a lock */ | ||
224 | static unsigned char buf[16]; | ||
225 | static unsigned long counter; | ||
226 | FIPS_get_timevec(buf, &counter); | ||
227 | *pout = buf; | ||
228 | return sizeof(buf); | ||
229 | } | ||
230 | |||
231 | /* RAND_add() and RAND_seed() pass through to OpenSSL PRNG so it is | ||
232 | * correctly seeded by RAND_poll(). | ||
233 | */ | ||
234 | |||
235 | static int drbg_rand_add(DRBG_CTX *ctx, const void *in, int inlen, | ||
236 | double entropy) | ||
237 | { | ||
238 | RAND_SSLeay()->add(in, inlen, entropy); | ||
239 | return 1; | ||
240 | } | ||
241 | |||
242 | static int drbg_rand_seed(DRBG_CTX *ctx, const void *in, int inlen) | ||
243 | { | ||
244 | RAND_SSLeay()->seed(in, inlen); | ||
245 | return 1; | ||
246 | } | ||
247 | |||
248 | #ifndef OPENSSL_DRBG_DEFAULT_TYPE | ||
249 | #define OPENSSL_DRBG_DEFAULT_TYPE NID_aes_256_ctr | ||
250 | #endif | ||
251 | #ifndef OPENSSL_DRBG_DEFAULT_FLAGS | ||
252 | #define OPENSSL_DRBG_DEFAULT_FLAGS DRBG_FLAG_CTR_USE_DF | ||
253 | #endif | ||
254 | |||
255 | static int fips_drbg_type = OPENSSL_DRBG_DEFAULT_TYPE; | ||
256 | static int fips_drbg_flags = OPENSSL_DRBG_DEFAULT_FLAGS; | ||
257 | |||
258 | void RAND_set_fips_drbg_type(int type, int flags) | ||
259 | { | ||
260 | fips_drbg_type = type; | ||
261 | fips_drbg_flags = flags; | ||
262 | } | ||
263 | |||
264 | int RAND_init_fips(void) | ||
265 | { | ||
266 | DRBG_CTX *dctx; | ||
267 | size_t plen; | ||
268 | unsigned char pers[32], *p; | ||
269 | dctx = FIPS_get_default_drbg(); | ||
270 | if (FIPS_drbg_init(dctx, fips_drbg_type, fips_drbg_flags) <= 0) | ||
271 | { | ||
272 | RANDerr(RAND_F_RAND_INIT_FIPS, RAND_R_ERROR_INITIALISING_DRBG); | ||
273 | return 0; | ||
274 | } | ||
275 | |||
276 | FIPS_drbg_set_callbacks(dctx, | ||
277 | drbg_get_entropy, drbg_free_entropy, 20, | ||
278 | drbg_get_entropy, drbg_free_entropy); | ||
279 | FIPS_drbg_set_rand_callbacks(dctx, drbg_get_adin, 0, | ||
280 | drbg_rand_seed, drbg_rand_add); | ||
281 | /* Personalisation string: a string followed by date time vector */ | ||
282 | strcpy((char *)pers, "OpenSSL DRBG2.0"); | ||
283 | plen = drbg_get_adin(dctx, &p); | ||
284 | memcpy(pers + 16, p, plen); | ||
285 | |||
286 | if (FIPS_drbg_instantiate(dctx, pers, sizeof(pers)) <= 0) | ||
287 | { | ||
288 | RANDerr(RAND_F_RAND_INIT_FIPS, RAND_R_ERROR_INSTANTIATING_DRBG); | ||
289 | return 0; | ||
290 | } | ||
291 | FIPS_rand_set_method(FIPS_drbg_method()); | ||
292 | return 1; | ||
293 | } | ||
294 | |||
295 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/rand/randfile.c b/src/lib/libssl/src/crypto/rand/randfile.c index bc7d9c5804..030e07f418 100644 --- a/src/lib/libssl/src/crypto/rand/randfile.c +++ b/src/lib/libssl/src/crypto/rand/randfile.c | |||
@@ -137,7 +137,7 @@ int RAND_load_file(const char *file, long bytes) | |||
137 | in=fopen(file,"rb"); | 137 | in=fopen(file,"rb"); |
138 | #endif | 138 | #endif |
139 | if (in == NULL) goto err; | 139 | if (in == NULL) goto err; |
140 | #if defined(S_IFBLK) && defined(S_IFCHR) && !defined(OPNESSL_NO_POSIX_IO) | 140 | #if defined(S_IFBLK) && defined(S_IFCHR) && !defined(OPENSSL_NO_POSIX_IO) |
141 | if (sb.st_mode & (S_IFBLK | S_IFCHR)) { | 141 | if (sb.st_mode & (S_IFBLK | S_IFCHR)) { |
142 | /* this file is a device. we don't want read an infinite number | 142 | /* this file is a device. we don't want read an infinite number |
143 | * of bytes from a random device, nor do we want to use buffered | 143 | * of bytes from a random device, nor do we want to use buffered |
diff --git a/src/lib/libssl/src/crypto/rc2/Makefile b/src/lib/libssl/src/crypto/rc2/Makefile index 73eac347e7..8a9d49ab5e 100644 --- a/src/lib/libssl/src/crypto/rc2/Makefile +++ b/src/lib/libssl/src/crypto/rc2/Makefile | |||
@@ -78,7 +78,11 @@ rc2_cbc.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h | |||
78 | rc2_cbc.o: rc2_cbc.c rc2_locl.h | 78 | rc2_cbc.o: rc2_cbc.c rc2_locl.h |
79 | rc2_ecb.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 79 | rc2_ecb.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
80 | rc2_ecb.o: ../../include/openssl/rc2.h rc2_ecb.c rc2_locl.h | 80 | rc2_ecb.o: ../../include/openssl/rc2.h rc2_ecb.c rc2_locl.h |
81 | rc2_skey.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h | 81 | rc2_skey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
82 | rc2_skey.o: ../../include/openssl/opensslconf.h | ||
83 | rc2_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
84 | rc2_skey.o: ../../include/openssl/rc2.h ../../include/openssl/safestack.h | ||
85 | rc2_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
82 | rc2_skey.o: rc2_locl.h rc2_skey.c | 86 | rc2_skey.o: rc2_locl.h rc2_skey.c |
83 | rc2cfb64.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h | 87 | rc2cfb64.o: ../../include/openssl/opensslconf.h ../../include/openssl/rc2.h |
84 | rc2cfb64.o: rc2_locl.h rc2cfb64.c | 88 | rc2cfb64.o: rc2_locl.h rc2cfb64.c |
diff --git a/src/lib/libssl/src/crypto/rc2/rc2.h b/src/lib/libssl/src/crypto/rc2/rc2.h index 34c8362317..e542ec94ff 100644 --- a/src/lib/libssl/src/crypto/rc2/rc2.h +++ b/src/lib/libssl/src/crypto/rc2/rc2.h | |||
@@ -79,7 +79,9 @@ typedef struct rc2_key_st | |||
79 | RC2_INT data[64]; | 79 | RC2_INT data[64]; |
80 | } RC2_KEY; | 80 | } RC2_KEY; |
81 | 81 | ||
82 | 82 | #ifdef OPENSSL_FIPS | |
83 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); | ||
84 | #endif | ||
83 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); | 85 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,int bits); |
84 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, | 86 | void RC2_ecb_encrypt(const unsigned char *in,unsigned char *out,RC2_KEY *key, |
85 | int enc); | 87 | int enc); |
diff --git a/src/lib/libssl/src/crypto/rc2/rc2_skey.c b/src/lib/libssl/src/crypto/rc2/rc2_skey.c index 0150b0e035..6668ac011f 100644 --- a/src/lib/libssl/src/crypto/rc2/rc2_skey.c +++ b/src/lib/libssl/src/crypto/rc2/rc2_skey.c | |||
@@ -56,6 +56,7 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/crypto.h> | ||
59 | #include <openssl/rc2.h> | 60 | #include <openssl/rc2.h> |
60 | #include "rc2_locl.h" | 61 | #include "rc2_locl.h" |
61 | 62 | ||
@@ -95,6 +96,13 @@ static const unsigned char key_table[256]={ | |||
95 | * the same as specifying 1024 for the 'bits' parameter. Bsafe uses | 96 | * the same as specifying 1024 for the 'bits' parameter. Bsafe uses |
96 | * a version where the bits parameter is the same as len*8 */ | 97 | * a version where the bits parameter is the same as len*8 */ |
97 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | 98 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) |
99 | #ifdef OPENSSL_FIPS | ||
100 | { | ||
101 | fips_cipher_abort(RC2); | ||
102 | private_RC2_set_key(key, len, data, bits); | ||
103 | } | ||
104 | void private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits) | ||
105 | #endif | ||
98 | { | 106 | { |
99 | int i,j; | 107 | int i,j; |
100 | unsigned char *k; | 108 | unsigned char *k; |
diff --git a/src/lib/libssl/src/crypto/rc4/Makefile b/src/lib/libssl/src/crypto/rc4/Makefile index 264451a213..1614d47961 100644 --- a/src/lib/libssl/src/crypto/rc4/Makefile +++ b/src/lib/libssl/src/crypto/rc4/Makefile | |||
@@ -21,8 +21,8 @@ TEST=rc4test.c | |||
21 | APPS= | 21 | APPS= |
22 | 22 | ||
23 | LIB=$(TOP)/libcrypto.a | 23 | LIB=$(TOP)/libcrypto.a |
24 | LIBSRC=rc4_skey.c rc4_enc.c | 24 | LIBSRC=rc4_skey.c rc4_enc.c rc4_utl.c |
25 | LIBOBJ=$(RC4_ENC) | 25 | LIBOBJ=$(RC4_ENC) rc4_utl.o |
26 | 26 | ||
27 | SRC= $(LIBSRC) | 27 | SRC= $(LIBSRC) |
28 | 28 | ||
@@ -46,12 +46,14 @@ rc4-586.s: asm/rc4-586.pl ../perlasm/x86asm.pl | |||
46 | 46 | ||
47 | rc4-x86_64.s: asm/rc4-x86_64.pl | 47 | rc4-x86_64.s: asm/rc4-x86_64.pl |
48 | $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@ | 48 | $(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@ |
49 | rc4-md5-x86_64.s: asm/rc4-md5-x86_64.pl | ||
50 | $(PERL) asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME) > $@ | ||
49 | 51 | ||
50 | rc4-ia64.S: asm/rc4-ia64.pl | 52 | rc4-ia64.S: asm/rc4-ia64.pl |
51 | $(PERL) asm/rc4-ia64.pl $(CFLAGS) > $@ | 53 | $(PERL) asm/rc4-ia64.pl $(CFLAGS) > $@ |
52 | 54 | ||
53 | rc4-s390x.s: asm/rc4-s390x.pl | 55 | rc4-parisc.s: asm/rc4-parisc.pl |
54 | $(PERL) asm/rc4-s390x.pl > $@ | 56 | $(PERL) asm/rc4-parisc.pl $(PERLASM_SCHEME) $@ |
55 | 57 | ||
56 | rc4-ia64.s: rc4-ia64.S | 58 | rc4-ia64.s: rc4-ia64.S |
57 | @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \ | 59 | @case `awk '/^#define RC4_INT/{print$$NF}' $(TOP)/include/openssl/opensslconf.h` in \ |
@@ -60,6 +62,9 @@ rc4-ia64.s: rc4-ia64.S | |||
60 | *) exit 1 ;; \ | 62 | *) exit 1 ;; \ |
61 | esac | 63 | esac |
62 | 64 | ||
65 | # GNU make "catch all" | ||
66 | rc4-%.s: asm/rc4-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ | ||
67 | |||
63 | files: | 68 | files: |
64 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 69 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
65 | 70 | ||
@@ -113,3 +118,8 @@ rc4_skey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
113 | rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h | 118 | rc4_skey.o: ../../include/openssl/rc4.h ../../include/openssl/safestack.h |
114 | rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 119 | rc4_skey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
115 | rc4_skey.o: ../cryptlib.h rc4_locl.h rc4_skey.c | 120 | rc4_skey.o: ../cryptlib.h rc4_locl.h rc4_skey.c |
121 | rc4_utl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | ||
122 | rc4_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | ||
123 | rc4_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rc4.h | ||
124 | rc4_utl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h | ||
125 | rc4_utl.o: ../../include/openssl/symhacks.h rc4_utl.c | ||
diff --git a/src/lib/libssl/src/crypto/rc4/asm/rc4-586.pl b/src/lib/libssl/src/crypto/rc4/asm/rc4-586.pl index 38a44a70ef..5c9ac6ad28 100644 --- a/src/lib/libssl/src/crypto/rc4/asm/rc4-586.pl +++ b/src/lib/libssl/src/crypto/rc4/asm/rc4-586.pl | |||
@@ -28,6 +28,34 @@ | |||
28 | # | 28 | # |
29 | # <appro@fy.chalmers.se> | 29 | # <appro@fy.chalmers.se> |
30 | 30 | ||
31 | # May 2011 | ||
32 | # | ||
33 | # Optimize for Core2 and Westmere [and incidentally Opteron]. Current | ||
34 | # performance in cycles per processed byte (less is better) and | ||
35 | # improvement relative to previous version of this module is: | ||
36 | # | ||
37 | # Pentium 10.2 # original numbers | ||
38 | # Pentium III 7.8(*) | ||
39 | # Intel P4 7.5 | ||
40 | # | ||
41 | # Opteron 6.1/+20% # new MMX numbers | ||
42 | # Core2 5.3/+67%(**) | ||
43 | # Westmere 5.1/+94%(**) | ||
44 | # Sandy Bridge 5.0/+8% | ||
45 | # Atom 12.6/+6% | ||
46 | # | ||
47 | # (*) PIII can actually deliver 6.6 cycles per byte with MMX code, | ||
48 | # but this specific code performs poorly on Core2. And vice | ||
49 | # versa, below MMX/SSE code delivering 5.8/7.1 on Core2 performs | ||
50 | # poorly on PIII, at 8.0/14.5:-( As PIII is not a "hot" CPU | ||
51 | # [anymore], I chose to discard PIII-specific code path and opt | ||
52 | # for original IALU-only code, which is why MMX/SSE code path | ||
53 | # is guarded by SSE2 bit (see below), not MMX/SSE. | ||
54 | # (**) Performance vs. block size on Core2 and Westmere had a maximum | ||
55 | # at ... 64 bytes block size. And it was quite a maximum, 40-60% | ||
56 | # in comparison to largest 8KB block size. Above improvement | ||
57 | # coefficients are for the largest block size. | ||
58 | |||
31 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 59 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
32 | push(@INC,"${dir}","${dir}../../perlasm"); | 60 | push(@INC,"${dir}","${dir}../../perlasm"); |
33 | require "x86asm.pl"; | 61 | require "x86asm.pl"; |
@@ -62,6 +90,68 @@ sub RC4_loop { | |||
62 | &$func ($out,&DWP(0,$dat,$ty,4)); | 90 | &$func ($out,&DWP(0,$dat,$ty,4)); |
63 | } | 91 | } |
64 | 92 | ||
93 | if ($alt=0) { | ||
94 | # >20% faster on Atom and Sandy Bridge[!], 8% faster on Opteron, | ||
95 | # but ~40% slower on Core2 and Westmere... Attempt to add movz | ||
96 | # brings down Opteron by 25%, Atom and Sandy Bridge by 15%, yet | ||
97 | # on Core2 with movz it's almost 20% slower than below alternative | ||
98 | # code... Yes, it's a total mess... | ||
99 | my @XX=($xx,$out); | ||
100 | $RC4_loop_mmx = sub { # SSE actually... | ||
101 | my $i=shift; | ||
102 | my $j=$i<=0?0:$i>>1; | ||
103 | my $mm=$i<=0?"mm0":"mm".($i&1); | ||
104 | |||
105 | &add (&LB($yy),&LB($tx)); | ||
106 | &lea (@XX[1],&DWP(1,@XX[0])); | ||
107 | &pxor ("mm2","mm0") if ($i==0); | ||
108 | &psllq ("mm1",8) if ($i==0); | ||
109 | &and (@XX[1],0xff); | ||
110 | &pxor ("mm0","mm0") if ($i<=0); | ||
111 | &mov ($ty,&DWP(0,$dat,$yy,4)); | ||
112 | &mov (&DWP(0,$dat,$yy,4),$tx); | ||
113 | &pxor ("mm1","mm2") if ($i==0); | ||
114 | &mov (&DWP(0,$dat,$XX[0],4),$ty); | ||
115 | &add (&LB($ty),&LB($tx)); | ||
116 | &movd (@XX[0],"mm7") if ($i==0); | ||
117 | &mov ($tx,&DWP(0,$dat,@XX[1],4)); | ||
118 | &pxor ("mm1","mm1") if ($i==1); | ||
119 | &movq ("mm2",&QWP(0,$inp)) if ($i==1); | ||
120 | &movq (&QWP(-8,(@XX[0],$inp)),"mm1") if ($i==0); | ||
121 | &pinsrw ($mm,&DWP(0,$dat,$ty,4),$j); | ||
122 | |||
123 | push (@XX,shift(@XX)) if ($i>=0); | ||
124 | } | ||
125 | } else { | ||
126 | # Using pinsrw here improves performane on Intel CPUs by 2-3%, but | ||
127 | # brings down AMD by 7%... | ||
128 | $RC4_loop_mmx = sub { | ||
129 | my $i=shift; | ||
130 | |||
131 | &add (&LB($yy),&LB($tx)); | ||
132 | &psllq ("mm1",8*(($i-1)&7)) if (abs($i)!=1); | ||
133 | &mov ($ty,&DWP(0,$dat,$yy,4)); | ||
134 | &mov (&DWP(0,$dat,$yy,4),$tx); | ||
135 | &mov (&DWP(0,$dat,$xx,4),$ty); | ||
136 | &inc ($xx); | ||
137 | &add ($ty,$tx); | ||
138 | &movz ($xx,&LB($xx)); # (*) | ||
139 | &movz ($ty,&LB($ty)); # (*) | ||
140 | &pxor ("mm2",$i==1?"mm0":"mm1") if ($i>=0); | ||
141 | &movq ("mm0",&QWP(0,$inp)) if ($i<=0); | ||
142 | &movq (&QWP(-8,($out,$inp)),"mm2") if ($i==0); | ||
143 | &mov ($tx,&DWP(0,$dat,$xx,4)); | ||
144 | &movd ($i>0?"mm1":"mm2",&DWP(0,$dat,$ty,4)); | ||
145 | |||
146 | # (*) This is the key to Core2 and Westmere performance. | ||
147 | # Whithout movz out-of-order execution logic confuses | ||
148 | # itself and fails to reorder loads and stores. Problem | ||
149 | # appears to be fixed in Sandy Bridge... | ||
150 | } | ||
151 | } | ||
152 | |||
153 | &external_label("OPENSSL_ia32cap_P"); | ||
154 | |||
65 | # void RC4(RC4_KEY *key,size_t len,const unsigned char *inp,unsigned char *out); | 155 | # void RC4(RC4_KEY *key,size_t len,const unsigned char *inp,unsigned char *out); |
66 | &function_begin("RC4"); | 156 | &function_begin("RC4"); |
67 | &mov ($dat,&wparam(0)); # load key schedule pointer | 157 | &mov ($dat,&wparam(0)); # load key schedule pointer |
@@ -94,11 +184,56 @@ sub RC4_loop { | |||
94 | &and ($ty,-4); # how many 4-byte chunks? | 184 | &and ($ty,-4); # how many 4-byte chunks? |
95 | &jz (&label("loop1")); | 185 | &jz (&label("loop1")); |
96 | 186 | ||
187 | &test ($ty,-8); | ||
188 | &mov (&wparam(3),$out); # $out as accumulator in these loops | ||
189 | &jz (&label("go4loop4")); | ||
190 | |||
191 | &picmeup($out,"OPENSSL_ia32cap_P"); | ||
192 | &bt (&DWP(0,$out),26); # check SSE2 bit [could have been MMX] | ||
193 | &jnc (&label("go4loop4")); | ||
194 | |||
195 | &mov ($out,&wparam(3)) if (!$alt); | ||
196 | &movd ("mm7",&wparam(3)) if ($alt); | ||
197 | &and ($ty,-8); | ||
198 | &lea ($ty,&DWP(-8,$inp,$ty)); | ||
199 | &mov (&DWP(-4,$dat),$ty); # save input+(len/8)*8-8 | ||
200 | |||
201 | &$RC4_loop_mmx(-1); | ||
202 | &jmp(&label("loop_mmx_enter")); | ||
203 | |||
204 | &set_label("loop_mmx",16); | ||
205 | &$RC4_loop_mmx(0); | ||
206 | &set_label("loop_mmx_enter"); | ||
207 | for ($i=1;$i<8;$i++) { &$RC4_loop_mmx($i); } | ||
208 | &mov ($ty,$yy); | ||
209 | &xor ($yy,$yy); # this is second key to Core2 | ||
210 | &mov (&LB($yy),&LB($ty)); # and Westmere performance... | ||
211 | &cmp ($inp,&DWP(-4,$dat)); | ||
212 | &lea ($inp,&DWP(8,$inp)); | ||
213 | &jb (&label("loop_mmx")); | ||
214 | |||
215 | if ($alt) { | ||
216 | &movd ($out,"mm7"); | ||
217 | &pxor ("mm2","mm0"); | ||
218 | &psllq ("mm1",8); | ||
219 | &pxor ("mm1","mm2"); | ||
220 | &movq (&QWP(-8,$out,$inp),"mm1"); | ||
221 | } else { | ||
222 | &psllq ("mm1",56); | ||
223 | &pxor ("mm2","mm1"); | ||
224 | &movq (&QWP(-8,$out,$inp),"mm2"); | ||
225 | } | ||
226 | &emms (); | ||
227 | |||
228 | &cmp ($inp,&wparam(1)); # compare to input+len | ||
229 | &je (&label("done")); | ||
230 | &jmp (&label("loop1")); | ||
231 | |||
232 | &set_label("go4loop4",16); | ||
97 | &lea ($ty,&DWP(-4,$inp,$ty)); | 233 | &lea ($ty,&DWP(-4,$inp,$ty)); |
98 | &mov (&wparam(2),$ty); # save input+(len/4)*4-4 | 234 | &mov (&wparam(2),$ty); # save input+(len/4)*4-4 |
99 | &mov (&wparam(3),$out); # $out as accumulator in this loop | ||
100 | 235 | ||
101 | &set_label("loop4",16); | 236 | &set_label("loop4"); |
102 | for ($i=0;$i<4;$i++) { RC4_loop($i); } | 237 | for ($i=0;$i<4;$i++) { RC4_loop($i); } |
103 | &ror ($out,8); | 238 | &ror ($out,8); |
104 | &xor ($out,&DWP(0,$inp)); | 239 | &xor ($out,&DWP(0,$inp)); |
@@ -151,7 +286,7 @@ sub RC4_loop { | |||
151 | 286 | ||
152 | &set_label("done"); | 287 | &set_label("done"); |
153 | &dec (&LB($xx)); | 288 | &dec (&LB($xx)); |
154 | &mov (&BP(-4,$dat),&LB($yy)); # save key->y | 289 | &mov (&DWP(-4,$dat),$yy); # save key->y |
155 | &mov (&BP(-8,$dat),&LB($xx)); # save key->x | 290 | &mov (&BP(-8,$dat),&LB($xx)); # save key->x |
156 | &set_label("abort"); | 291 | &set_label("abort"); |
157 | &function_end("RC4"); | 292 | &function_end("RC4"); |
@@ -164,10 +299,8 @@ $idi="ebp"; | |||
164 | $ido="ecx"; | 299 | $ido="ecx"; |
165 | $idx="edx"; | 300 | $idx="edx"; |
166 | 301 | ||
167 | &external_label("OPENSSL_ia32cap_P"); | ||
168 | |||
169 | # void RC4_set_key(RC4_KEY *key,int len,const unsigned char *data); | 302 | # void RC4_set_key(RC4_KEY *key,int len,const unsigned char *data); |
170 | &function_begin("RC4_set_key"); | 303 | &function_begin("private_RC4_set_key"); |
171 | &mov ($out,&wparam(0)); # load key | 304 | &mov ($out,&wparam(0)); # load key |
172 | &mov ($idi,&wparam(1)); # load len | 305 | &mov ($idi,&wparam(1)); # load len |
173 | &mov ($inp,&wparam(2)); # load data | 306 | &mov ($inp,&wparam(2)); # load data |
@@ -245,7 +378,7 @@ $idx="edx"; | |||
245 | &xor ("eax","eax"); | 378 | &xor ("eax","eax"); |
246 | &mov (&DWP(-8,$out),"eax"); # key->x=0; | 379 | &mov (&DWP(-8,$out),"eax"); # key->x=0; |
247 | &mov (&DWP(-4,$out),"eax"); # key->y=0; | 380 | &mov (&DWP(-4,$out),"eax"); # key->y=0; |
248 | &function_end("RC4_set_key"); | 381 | &function_end("private_RC4_set_key"); |
249 | 382 | ||
250 | # const char *RC4_options(void); | 383 | # const char *RC4_options(void); |
251 | &function_begin_B("RC4_options"); | 384 | &function_begin_B("RC4_options"); |
@@ -254,14 +387,21 @@ $idx="edx"; | |||
254 | &blindpop("eax"); | 387 | &blindpop("eax"); |
255 | &lea ("eax",&DWP(&label("opts")."-".&label("pic_point"),"eax")); | 388 | &lea ("eax",&DWP(&label("opts")."-".&label("pic_point"),"eax")); |
256 | &picmeup("edx","OPENSSL_ia32cap_P"); | 389 | &picmeup("edx","OPENSSL_ia32cap_P"); |
257 | &bt (&DWP(0,"edx"),20); | 390 | &mov ("edx",&DWP(0,"edx")); |
258 | &jnc (&label("skip")); | 391 | &bt ("edx",20); |
259 | &add ("eax",12); | 392 | &jc (&label("1xchar")); |
260 | &set_label("skip"); | 393 | &bt ("edx",26); |
394 | &jnc (&label("ret")); | ||
395 | &add ("eax",25); | ||
396 | &ret (); | ||
397 | &set_label("1xchar"); | ||
398 | &add ("eax",12); | ||
399 | &set_label("ret"); | ||
261 | &ret (); | 400 | &ret (); |
262 | &set_label("opts",64); | 401 | &set_label("opts",64); |
263 | &asciz ("rc4(4x,int)"); | 402 | &asciz ("rc4(4x,int)"); |
264 | &asciz ("rc4(1x,char)"); | 403 | &asciz ("rc4(1x,char)"); |
404 | &asciz ("rc4(8x,mmx)"); | ||
265 | &asciz ("RC4 for x86, CRYPTOGAMS by <appro\@openssl.org>"); | 405 | &asciz ("RC4 for x86, CRYPTOGAMS by <appro\@openssl.org>"); |
266 | &align (64); | 406 | &align (64); |
267 | &function_end_B("RC4_options"); | 407 | &function_end_B("RC4_options"); |
diff --git a/src/lib/libssl/src/crypto/rc4/rc4.h b/src/lib/libssl/src/crypto/rc4/rc4.h index 29d1acccf5..88ceb46bc5 100644 --- a/src/lib/libssl/src/crypto/rc4/rc4.h +++ b/src/lib/libssl/src/crypto/rc4/rc4.h | |||
@@ -79,6 +79,7 @@ typedef struct rc4_key_st | |||
79 | 79 | ||
80 | const char *RC4_options(void); | 80 | const char *RC4_options(void); |
81 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); | 81 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); |
82 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); | ||
82 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | 83 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, |
83 | unsigned char *outdata); | 84 | unsigned char *outdata); |
84 | 85 | ||
diff --git a/src/lib/libssl/src/crypto/rc4/rc4_skey.c b/src/lib/libssl/src/crypto/rc4/rc4_skey.c index b22c40b0bd..fda27636e7 100644 --- a/src/lib/libssl/src/crypto/rc4/rc4_skey.c +++ b/src/lib/libssl/src/crypto/rc4/rc4_skey.c | |||
@@ -85,7 +85,7 @@ const char *RC4_options(void) | |||
85 | * Date: Wed, 14 Sep 1994 06:35:31 GMT | 85 | * Date: Wed, 14 Sep 1994 06:35:31 GMT |
86 | */ | 86 | */ |
87 | 87 | ||
88 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) | 88 | void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) |
89 | { | 89 | { |
90 | register RC4_INT tmp; | 90 | register RC4_INT tmp; |
91 | register int id1,id2; | 91 | register int id1,id2; |
@@ -104,40 +104,6 @@ void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) | |||
104 | d[(n)]=d[id2]; \ | 104 | d[(n)]=d[id2]; \ |
105 | d[id2]=tmp; } | 105 | d[id2]=tmp; } |
106 | 106 | ||
107 | #if defined(OPENSSL_CPUID_OBJ) && !defined(OPENSSL_NO_ASM) | ||
108 | # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ | ||
109 | defined(__INTEL__) || \ | ||
110 | defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) | ||
111 | if (sizeof(RC4_INT) > 1) { | ||
112 | /* | ||
113 | * Unlike all other x86 [and x86_64] implementations, | ||
114 | * Intel P4 core [including EM64T] was found to perform | ||
115 | * poorly with wider RC4_INT. Performance improvement | ||
116 | * for IA-32 hand-coded assembler turned out to be 2.8x | ||
117 | * if re-coded for RC4_CHAR! It's however inappropriate | ||
118 | * to just switch to RC4_CHAR for x86[_64], as non-P4 | ||
119 | * implementations suffer from significant performance | ||
120 | * losses then, e.g. PIII exhibits >2x deterioration, | ||
121 | * and so does Opteron. In order to assure optimal | ||
122 | * all-round performance, let us [try to] detect P4 at | ||
123 | * run-time by checking upon HTT bit in CPU capability | ||
124 | * vector and set up compressed key schedule, which is | ||
125 | * recognized by correspondingly updated assembler | ||
126 | * module... | ||
127 | * <appro@fy.chalmers.se> | ||
128 | */ | ||
129 | if (OPENSSL_ia32cap_P & (1<<28)) { | ||
130 | unsigned char *cp=(unsigned char *)d; | ||
131 | |||
132 | for (i=0;i<256;i++) cp[i]=i; | ||
133 | for (i=0;i<256;i++) SK_LOOP(cp,i); | ||
134 | /* mark schedule as compressed! */ | ||
135 | d[256/sizeof(RC4_INT)]=-1; | ||
136 | return; | ||
137 | } | ||
138 | } | ||
139 | # endif | ||
140 | #endif | ||
141 | for (i=0; i < 256; i++) d[i]=i; | 107 | for (i=0; i < 256; i++) d[i]=i; |
142 | for (i=0; i < 256; i+=4) | 108 | for (i=0; i < 256; i+=4) |
143 | { | 109 | { |
diff --git a/src/lib/libssl/src/crypto/rc4/rc4test.c b/src/lib/libssl/src/crypto/rc4/rc4test.c index 633a79e758..4312605ccb 100644 --- a/src/lib/libssl/src/crypto/rc4/rc4test.c +++ b/src/lib/libssl/src/crypto/rc4/rc4test.c | |||
@@ -120,6 +120,12 @@ int main(int argc, char *argv[]) | |||
120 | RC4_KEY key; | 120 | RC4_KEY key; |
121 | unsigned char obuf[512]; | 121 | unsigned char obuf[512]; |
122 | 122 | ||
123 | #if !defined(OPENSSL_PIC) | ||
124 | void OPENSSL_cpuid_setup(void); | ||
125 | |||
126 | OPENSSL_cpuid_setup(); | ||
127 | #endif | ||
128 | |||
123 | for (i=0; i<6; i++) | 129 | for (i=0; i<6; i++) |
124 | { | 130 | { |
125 | RC4_set_key(&key,keys[i][0],&(keys[i][1])); | 131 | RC4_set_key(&key,keys[i][0],&(keys[i][1])); |
diff --git a/src/lib/libssl/src/crypto/ripemd/Makefile b/src/lib/libssl/src/crypto/ripemd/Makefile index d5b1067dbe..25140b2a73 100644 --- a/src/lib/libssl/src/crypto/ripemd/Makefile +++ b/src/lib/libssl/src/crypto/ripemd/Makefile | |||
@@ -82,8 +82,11 @@ clean: | |||
82 | 82 | ||
83 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 83 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
84 | 84 | ||
85 | rmd_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 85 | rmd_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
86 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ripemd.h | 86 | rmd_dgst.o: ../../include/openssl/opensslconf.h |
87 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
88 | rmd_dgst.o: ../../include/openssl/ripemd.h ../../include/openssl/safestack.h | ||
89 | rmd_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
87 | rmd_dgst.o: ../md32_common.h rmd_dgst.c rmd_locl.h rmdconst.h | 90 | rmd_dgst.o: ../md32_common.h rmd_dgst.c rmd_locl.h rmdconst.h |
88 | rmd_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 91 | rmd_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
89 | rmd_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 92 | rmd_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
diff --git a/src/lib/libssl/src/crypto/ripemd/ripemd.h b/src/lib/libssl/src/crypto/ripemd/ripemd.h index 5942eb6180..189bd8c90e 100644 --- a/src/lib/libssl/src/crypto/ripemd/ripemd.h +++ b/src/lib/libssl/src/crypto/ripemd/ripemd.h | |||
@@ -91,6 +91,9 @@ typedef struct RIPEMD160state_st | |||
91 | unsigned int num; | 91 | unsigned int num; |
92 | } RIPEMD160_CTX; | 92 | } RIPEMD160_CTX; |
93 | 93 | ||
94 | #ifdef OPENSSL_FIPS | ||
95 | int private_RIPEMD160_Init(RIPEMD160_CTX *c); | ||
96 | #endif | ||
94 | int RIPEMD160_Init(RIPEMD160_CTX *c); | 97 | int RIPEMD160_Init(RIPEMD160_CTX *c); |
95 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); | 98 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); |
96 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); | 99 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); |
diff --git a/src/lib/libssl/src/crypto/ripemd/rmd_dgst.c b/src/lib/libssl/src/crypto/ripemd/rmd_dgst.c index 59b017f8c0..63f0d983f7 100644 --- a/src/lib/libssl/src/crypto/ripemd/rmd_dgst.c +++ b/src/lib/libssl/src/crypto/ripemd/rmd_dgst.c | |||
@@ -59,6 +59,7 @@ | |||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "rmd_locl.h" | 60 | #include "rmd_locl.h" |
61 | #include <openssl/opensslv.h> | 61 | #include <openssl/opensslv.h> |
62 | #include <openssl/crypto.h> | ||
62 | 63 | ||
63 | const char RMD160_version[]="RIPE-MD160" OPENSSL_VERSION_PTEXT; | 64 | const char RMD160_version[]="RIPE-MD160" OPENSSL_VERSION_PTEXT; |
64 | 65 | ||
@@ -69,7 +70,7 @@ const char RMD160_version[]="RIPE-MD160" OPENSSL_VERSION_PTEXT; | |||
69 | void ripemd160_block(RIPEMD160_CTX *c, unsigned long *p,size_t num); | 70 | void ripemd160_block(RIPEMD160_CTX *c, unsigned long *p,size_t num); |
70 | # endif | 71 | # endif |
71 | 72 | ||
72 | int RIPEMD160_Init(RIPEMD160_CTX *c) | 73 | fips_md_init(RIPEMD160) |
73 | { | 74 | { |
74 | memset (c,0,sizeof(*c)); | 75 | memset (c,0,sizeof(*c)); |
75 | c->A=RIPEMD160_A; | 76 | c->A=RIPEMD160_A; |
diff --git a/src/lib/libssl/src/crypto/rsa/Makefile b/src/lib/libssl/src/crypto/rsa/Makefile index bb64223e05..f798d2f749 100644 --- a/src/lib/libssl/src/crypto/rsa/Makefile +++ b/src/lib/libssl/src/crypto/rsa/Makefile | |||
@@ -20,11 +20,11 @@ LIB=$(TOP)/libcrypto.a | |||
20 | LIBSRC= rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c \ | 20 | LIBSRC= rsa_eay.c rsa_gen.c rsa_lib.c rsa_sign.c rsa_saos.c rsa_err.c \ |
21 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_null.c \ | 21 | rsa_pk1.c rsa_ssl.c rsa_none.c rsa_oaep.c rsa_chk.c rsa_null.c \ |
22 | rsa_pss.c rsa_x931.c rsa_asn1.c rsa_depr.c rsa_ameth.c rsa_prn.c \ | 22 | rsa_pss.c rsa_x931.c rsa_asn1.c rsa_depr.c rsa_ameth.c rsa_prn.c \ |
23 | rsa_pmeth.c | 23 | rsa_pmeth.c rsa_crpt.c |
24 | LIBOBJ= rsa_eay.o rsa_gen.o rsa_lib.o rsa_sign.o rsa_saos.o rsa_err.o \ | 24 | LIBOBJ= rsa_eay.o rsa_gen.o rsa_lib.o rsa_sign.o rsa_saos.o rsa_err.o \ |
25 | rsa_pk1.o rsa_ssl.o rsa_none.o rsa_oaep.o rsa_chk.o rsa_null.o \ | 25 | rsa_pk1.o rsa_ssl.o rsa_none.o rsa_oaep.o rsa_chk.o rsa_null.o \ |
26 | rsa_pss.o rsa_x931.o rsa_asn1.o rsa_depr.o rsa_ameth.o rsa_prn.o \ | 26 | rsa_pss.o rsa_x931.o rsa_asn1.o rsa_depr.o rsa_ameth.o rsa_prn.o \ |
27 | rsa_pmeth.o | 27 | rsa_pmeth.o rsa_crpt.o |
28 | 28 | ||
29 | SRC= $(LIBSRC) | 29 | SRC= $(LIBSRC) |
30 | 30 | ||
@@ -100,11 +100,16 @@ rsa_asn1.o: ../../e_os.h ../../include/openssl/asn1.h | |||
100 | rsa_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | 100 | rsa_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
101 | rsa_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 101 | rsa_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
102 | rsa_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 102 | rsa_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
103 | rsa_asn1.o: ../../include/openssl/err.h ../../include/openssl/lhash.h | 103 | rsa_asn1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h |
104 | rsa_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | ||
105 | rsa_asn1.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
106 | rsa_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
104 | rsa_asn1.o: ../../include/openssl/opensslconf.h | 107 | rsa_asn1.o: ../../include/openssl/opensslconf.h |
105 | rsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 108 | rsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
106 | rsa_asn1.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 109 | rsa_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
110 | rsa_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
107 | rsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 111 | rsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
112 | rsa_asn1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h | ||
108 | rsa_asn1.o: ../cryptlib.h rsa_asn1.c | 113 | rsa_asn1.o: ../cryptlib.h rsa_asn1.c |
109 | rsa_chk.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 114 | rsa_chk.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
110 | rsa_chk.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h | 115 | rsa_chk.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h |
@@ -114,6 +119,21 @@ rsa_chk.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
114 | rsa_chk.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | 119 | rsa_chk.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h |
115 | rsa_chk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 120 | rsa_chk.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
116 | rsa_chk.o: rsa_chk.c | 121 | rsa_chk.o: rsa_chk.c |
122 | rsa_crpt.o: ../../e_os.h ../../include/openssl/asn1.h | ||
123 | rsa_crpt.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | ||
124 | rsa_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | ||
125 | rsa_crpt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | ||
126 | rsa_crpt.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | ||
127 | rsa_crpt.o: ../../include/openssl/engine.h ../../include/openssl/err.h | ||
128 | rsa_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | ||
129 | rsa_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | ||
130 | rsa_crpt.o: ../../include/openssl/opensslconf.h | ||
131 | rsa_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
132 | rsa_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h | ||
133 | rsa_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h | ||
134 | rsa_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
135 | rsa_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
136 | rsa_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h rsa_crpt.c | ||
117 | rsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h | 137 | rsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h |
118 | rsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h | 138 | rsa_depr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h |
119 | rsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 139 | rsa_depr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
@@ -205,11 +225,12 @@ rsa_pk1.o: ../../include/openssl/symhacks.h ../cryptlib.h rsa_pk1.c | |||
205 | rsa_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h | 225 | rsa_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h |
206 | rsa_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h | 226 | rsa_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h |
207 | rsa_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h | 227 | rsa_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h |
208 | rsa_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 228 | rsa_pmeth.o: ../../include/openssl/cms.h ../../include/openssl/crypto.h |
209 | rsa_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h | 229 | rsa_pmeth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
210 | rsa_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h | 230 | rsa_pmeth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h |
211 | rsa_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h | 231 | rsa_pmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h |
212 | rsa_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h | 232 | rsa_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h |
233 | rsa_pmeth.o: ../../include/openssl/objects.h | ||
213 | rsa_pmeth.o: ../../include/openssl/opensslconf.h | 234 | rsa_pmeth.o: ../../include/openssl/opensslconf.h |
214 | rsa_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | 235 | rsa_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h |
215 | rsa_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h | 236 | rsa_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa.h b/src/lib/libssl/src/crypto/rsa/rsa.h index cf74343657..4814a2fc15 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa.h +++ b/src/lib/libssl/src/crypto/rsa/rsa.h | |||
@@ -222,12 +222,22 @@ struct rsa_st | |||
222 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \ | 222 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \ |
223 | pad, NULL) | 223 | pad, NULL) |
224 | 224 | ||
225 | #define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \ | ||
226 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \ | ||
227 | EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad) | ||
228 | |||
225 | #define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ | 229 | #define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ |
226 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ | 230 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ |
227 | (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ | 231 | (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ |
228 | EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \ | 232 | EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \ |
229 | len, NULL) | 233 | len, NULL) |
230 | 234 | ||
235 | #define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \ | ||
236 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ | ||
237 | (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ | ||
238 | EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \ | ||
239 | 0, plen) | ||
240 | |||
231 | #define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ | 241 | #define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ |
232 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ | 242 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ |
233 | EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) | 243 | EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) |
@@ -236,11 +246,24 @@ struct rsa_st | |||
236 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ | 246 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ |
237 | EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) | 247 | EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) |
238 | 248 | ||
249 | #define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \ | ||
250 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \ | ||
251 | EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md) | ||
252 | |||
253 | #define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \ | ||
254 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \ | ||
255 | EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd) | ||
256 | |||
239 | #define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) | 257 | #define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) |
240 | #define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) | 258 | #define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) |
241 | 259 | ||
242 | #define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) | 260 | #define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) |
243 | #define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) | 261 | #define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) |
262 | #define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5) | ||
263 | |||
264 | #define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6) | ||
265 | #define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7) | ||
266 | #define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8) | ||
244 | 267 | ||
245 | #define RSA_PKCS1_PADDING 1 | 268 | #define RSA_PKCS1_PADDING 1 |
246 | #define RSA_SSLV23_PADDING 2 | 269 | #define RSA_SSLV23_PADDING 2 |
@@ -300,6 +323,16 @@ const RSA_METHOD *RSA_null_method(void); | |||
300 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) | 323 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) |
301 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) | 324 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) |
302 | 325 | ||
326 | typedef struct rsa_pss_params_st | ||
327 | { | ||
328 | X509_ALGOR *hashAlgorithm; | ||
329 | X509_ALGOR *maskGenAlgorithm; | ||
330 | ASN1_INTEGER *saltLength; | ||
331 | ASN1_INTEGER *trailerField; | ||
332 | } RSA_PSS_PARAMS; | ||
333 | |||
334 | DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) | ||
335 | |||
303 | #ifndef OPENSSL_NO_FP_API | 336 | #ifndef OPENSSL_NO_FP_API |
304 | int RSA_print_fp(FILE *fp, const RSA *r,int offset); | 337 | int RSA_print_fp(FILE *fp, const RSA *r,int offset); |
305 | #endif | 338 | #endif |
@@ -380,6 +413,14 @@ int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, | |||
380 | const unsigned char *mHash, | 413 | const unsigned char *mHash, |
381 | const EVP_MD *Hash, int sLen); | 414 | const EVP_MD *Hash, int sLen); |
382 | 415 | ||
416 | int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, | ||
417 | const EVP_MD *Hash, const EVP_MD *mgf1Hash, | ||
418 | const unsigned char *EM, int sLen); | ||
419 | |||
420 | int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, | ||
421 | const unsigned char *mHash, | ||
422 | const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLen); | ||
423 | |||
383 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 424 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
384 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 425 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
385 | int RSA_set_ex_data(RSA *r,int idx,void *arg); | 426 | int RSA_set_ex_data(RSA *r,int idx,void *arg); |
@@ -388,6 +429,25 @@ void *RSA_get_ex_data(const RSA *r, int idx); | |||
388 | RSA *RSAPublicKey_dup(RSA *rsa); | 429 | RSA *RSAPublicKey_dup(RSA *rsa); |
389 | RSA *RSAPrivateKey_dup(RSA *rsa); | 430 | RSA *RSAPrivateKey_dup(RSA *rsa); |
390 | 431 | ||
432 | /* If this flag is set the RSA method is FIPS compliant and can be used | ||
433 | * in FIPS mode. This is set in the validated module method. If an | ||
434 | * application sets this flag in its own methods it is its responsibility | ||
435 | * to ensure the result is compliant. | ||
436 | */ | ||
437 | |||
438 | #define RSA_FLAG_FIPS_METHOD 0x0400 | ||
439 | |||
440 | /* If this flag is set the operations normally disabled in FIPS mode are | ||
441 | * permitted it is then the applications responsibility to ensure that the | ||
442 | * usage is compliant. | ||
443 | */ | ||
444 | |||
445 | #define RSA_FLAG_NON_FIPS_ALLOW 0x0400 | ||
446 | /* Application has decided PRNG is good enough to generate a key: don't | ||
447 | * check. | ||
448 | */ | ||
449 | #define RSA_FLAG_CHECKED 0x0800 | ||
450 | |||
391 | /* BEGIN ERROR CODES */ | 451 | /* BEGIN ERROR CODES */ |
392 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 452 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
393 | * made after this point may be overwritten when the script is next run. | 453 | * made after this point may be overwritten when the script is next run. |
@@ -405,6 +465,7 @@ void ERR_load_RSA_strings(void); | |||
405 | #define RSA_F_PKEY_RSA_CTRL 143 | 465 | #define RSA_F_PKEY_RSA_CTRL 143 |
406 | #define RSA_F_PKEY_RSA_CTRL_STR 144 | 466 | #define RSA_F_PKEY_RSA_CTRL_STR 144 |
407 | #define RSA_F_PKEY_RSA_SIGN 142 | 467 | #define RSA_F_PKEY_RSA_SIGN 142 |
468 | #define RSA_F_PKEY_RSA_VERIFY 154 | ||
408 | #define RSA_F_PKEY_RSA_VERIFYRECOVER 141 | 469 | #define RSA_F_PKEY_RSA_VERIFYRECOVER 141 |
409 | #define RSA_F_RSA_BUILTIN_KEYGEN 129 | 470 | #define RSA_F_RSA_BUILTIN_KEYGEN 129 |
410 | #define RSA_F_RSA_CHECK_KEY 123 | 471 | #define RSA_F_RSA_CHECK_KEY 123 |
@@ -413,6 +474,8 @@ void ERR_load_RSA_strings(void); | |||
413 | #define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 | 474 | #define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 |
414 | #define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 | 475 | #define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 |
415 | #define RSA_F_RSA_GENERATE_KEY 105 | 476 | #define RSA_F_RSA_GENERATE_KEY 105 |
477 | #define RSA_F_RSA_GENERATE_KEY_EX 155 | ||
478 | #define RSA_F_RSA_ITEM_VERIFY 156 | ||
416 | #define RSA_F_RSA_MEMORY_LOCK 130 | 479 | #define RSA_F_RSA_MEMORY_LOCK 130 |
417 | #define RSA_F_RSA_NEW_METHOD 106 | 480 | #define RSA_F_RSA_NEW_METHOD 106 |
418 | #define RSA_F_RSA_NULL 124 | 481 | #define RSA_F_RSA_NULL 124 |
@@ -424,6 +487,7 @@ void ERR_load_RSA_strings(void); | |||
424 | #define RSA_F_RSA_PADDING_ADD_NONE 107 | 487 | #define RSA_F_RSA_PADDING_ADD_NONE 107 |
425 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 | 488 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 |
426 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 | 489 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 |
490 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148 | ||
427 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 | 491 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 |
428 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 | 492 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 |
429 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 | 493 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 |
@@ -436,8 +500,12 @@ void ERR_load_RSA_strings(void); | |||
436 | #define RSA_F_RSA_PADDING_CHECK_X931 128 | 500 | #define RSA_F_RSA_PADDING_CHECK_X931 128 |
437 | #define RSA_F_RSA_PRINT 115 | 501 | #define RSA_F_RSA_PRINT 115 |
438 | #define RSA_F_RSA_PRINT_FP 116 | 502 | #define RSA_F_RSA_PRINT_FP 116 |
503 | #define RSA_F_RSA_PRIVATE_DECRYPT 150 | ||
504 | #define RSA_F_RSA_PRIVATE_ENCRYPT 151 | ||
439 | #define RSA_F_RSA_PRIV_DECODE 137 | 505 | #define RSA_F_RSA_PRIV_DECODE 137 |
440 | #define RSA_F_RSA_PRIV_ENCODE 138 | 506 | #define RSA_F_RSA_PRIV_ENCODE 138 |
507 | #define RSA_F_RSA_PUBLIC_DECRYPT 152 | ||
508 | #define RSA_F_RSA_PUBLIC_ENCRYPT 153 | ||
441 | #define RSA_F_RSA_PUB_DECODE 139 | 509 | #define RSA_F_RSA_PUB_DECODE 139 |
442 | #define RSA_F_RSA_SETUP_BLINDING 136 | 510 | #define RSA_F_RSA_SETUP_BLINDING 136 |
443 | #define RSA_F_RSA_SIGN 117 | 511 | #define RSA_F_RSA_SIGN 117 |
@@ -445,6 +513,7 @@ void ERR_load_RSA_strings(void); | |||
445 | #define RSA_F_RSA_VERIFY 119 | 513 | #define RSA_F_RSA_VERIFY 119 |
446 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 | 514 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 |
447 | #define RSA_F_RSA_VERIFY_PKCS1_PSS 126 | 515 | #define RSA_F_RSA_VERIFY_PKCS1_PSS 126 |
516 | #define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149 | ||
448 | 517 | ||
449 | /* Reason codes. */ | 518 | /* Reason codes. */ |
450 | #define RSA_R_ALGORITHM_MISMATCH 100 | 519 | #define RSA_R_ALGORITHM_MISMATCH 100 |
@@ -470,19 +539,24 @@ void ERR_load_RSA_strings(void); | |||
470 | #define RSA_R_INVALID_HEADER 137 | 539 | #define RSA_R_INVALID_HEADER 137 |
471 | #define RSA_R_INVALID_KEYBITS 145 | 540 | #define RSA_R_INVALID_KEYBITS 145 |
472 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 | 541 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 |
542 | #define RSA_R_INVALID_MGF1_MD 156 | ||
473 | #define RSA_R_INVALID_PADDING 138 | 543 | #define RSA_R_INVALID_PADDING 138 |
474 | #define RSA_R_INVALID_PADDING_MODE 141 | 544 | #define RSA_R_INVALID_PADDING_MODE 141 |
545 | #define RSA_R_INVALID_PSS_PARAMETERS 149 | ||
475 | #define RSA_R_INVALID_PSS_SALTLEN 146 | 546 | #define RSA_R_INVALID_PSS_SALTLEN 146 |
547 | #define RSA_R_INVALID_SALT_LENGTH 150 | ||
476 | #define RSA_R_INVALID_TRAILER 139 | 548 | #define RSA_R_INVALID_TRAILER 139 |
477 | #define RSA_R_INVALID_X931_DIGEST 142 | 549 | #define RSA_R_INVALID_X931_DIGEST 142 |
478 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 | 550 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 |
479 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 | 551 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 |
480 | #define RSA_R_LAST_OCTET_INVALID 134 | 552 | #define RSA_R_LAST_OCTET_INVALID 134 |
481 | #define RSA_R_MODULUS_TOO_LARGE 105 | 553 | #define RSA_R_MODULUS_TOO_LARGE 105 |
554 | #define RSA_R_NON_FIPS_RSA_METHOD 157 | ||
482 | #define RSA_R_NO_PUBLIC_EXPONENT 140 | 555 | #define RSA_R_NO_PUBLIC_EXPONENT 140 |
483 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 | 556 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 |
484 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 | 557 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 |
485 | #define RSA_R_OAEP_DECODING_ERROR 121 | 558 | #define RSA_R_OAEP_DECODING_ERROR 121 |
559 | #define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158 | ||
486 | #define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 | 560 | #define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 |
487 | #define RSA_R_PADDING_CHECK_FAILED 114 | 561 | #define RSA_R_PADDING_CHECK_FAILED 114 |
488 | #define RSA_R_P_NOT_PRIME 128 | 562 | #define RSA_R_P_NOT_PRIME 128 |
@@ -493,7 +567,12 @@ void ERR_load_RSA_strings(void); | |||
493 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 | 567 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 |
494 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 | 568 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 |
495 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 | 569 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 |
570 | #define RSA_R_UNKNOWN_MASK_DIGEST 151 | ||
496 | #define RSA_R_UNKNOWN_PADDING_TYPE 118 | 571 | #define RSA_R_UNKNOWN_PADDING_TYPE 118 |
572 | #define RSA_R_UNKNOWN_PSS_DIGEST 152 | ||
573 | #define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153 | ||
574 | #define RSA_R_UNSUPPORTED_MASK_PARAMETER 154 | ||
575 | #define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155 | ||
497 | #define RSA_R_VALUE_MISSING 147 | 576 | #define RSA_R_VALUE_MISSING 147 |
498 | #define RSA_R_WRONG_SIGNATURE_LENGTH 119 | 577 | #define RSA_R_WRONG_SIGNATURE_LENGTH 119 |
499 | 578 | ||
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_asn1.c b/src/lib/libssl/src/crypto/rsa/rsa_asn1.c index 4efca8cdc8..6ed5de3db4 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_asn1.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_asn1.c | |||
@@ -60,6 +60,7 @@ | |||
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include <openssl/bn.h> | 61 | #include <openssl/bn.h> |
62 | #include <openssl/rsa.h> | 62 | #include <openssl/rsa.h> |
63 | #include <openssl/x509.h> | ||
63 | #include <openssl/asn1t.h> | 64 | #include <openssl/asn1t.h> |
64 | 65 | ||
65 | /* Override the default free and new methods */ | 66 | /* Override the default free and new methods */ |
@@ -96,6 +97,15 @@ ASN1_SEQUENCE_cb(RSAPublicKey, rsa_cb) = { | |||
96 | ASN1_SIMPLE(RSA, e, BIGNUM), | 97 | ASN1_SIMPLE(RSA, e, BIGNUM), |
97 | } ASN1_SEQUENCE_END_cb(RSA, RSAPublicKey) | 98 | } ASN1_SEQUENCE_END_cb(RSA, RSAPublicKey) |
98 | 99 | ||
100 | ASN1_SEQUENCE(RSA_PSS_PARAMS) = { | ||
101 | ASN1_EXP_OPT(RSA_PSS_PARAMS, hashAlgorithm, X509_ALGOR,0), | ||
102 | ASN1_EXP_OPT(RSA_PSS_PARAMS, maskGenAlgorithm, X509_ALGOR,1), | ||
103 | ASN1_EXP_OPT(RSA_PSS_PARAMS, saltLength, ASN1_INTEGER,2), | ||
104 | ASN1_EXP_OPT(RSA_PSS_PARAMS, trailerField, ASN1_INTEGER,3) | ||
105 | } ASN1_SEQUENCE_END(RSA_PSS_PARAMS) | ||
106 | |||
107 | IMPLEMENT_ASN1_FUNCTIONS(RSA_PSS_PARAMS) | ||
108 | |||
99 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPrivateKey, RSAPrivateKey) | 109 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPrivateKey, RSAPrivateKey) |
100 | 110 | ||
101 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPublicKey, RSAPublicKey) | 111 | IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(RSA, RSAPublicKey, RSAPublicKey) |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_err.c b/src/lib/libssl/src/crypto/rsa/rsa_err.c index cf9f1106b0..46e0bf9980 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_err.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_err.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* crypto/rsa/rsa_err.c */ | 1 | /* crypto/rsa/rsa_err.c */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
@@ -78,6 +78,7 @@ static ERR_STRING_DATA RSA_str_functs[]= | |||
78 | {ERR_FUNC(RSA_F_PKEY_RSA_CTRL), "PKEY_RSA_CTRL"}, | 78 | {ERR_FUNC(RSA_F_PKEY_RSA_CTRL), "PKEY_RSA_CTRL"}, |
79 | {ERR_FUNC(RSA_F_PKEY_RSA_CTRL_STR), "PKEY_RSA_CTRL_STR"}, | 79 | {ERR_FUNC(RSA_F_PKEY_RSA_CTRL_STR), "PKEY_RSA_CTRL_STR"}, |
80 | {ERR_FUNC(RSA_F_PKEY_RSA_SIGN), "PKEY_RSA_SIGN"}, | 80 | {ERR_FUNC(RSA_F_PKEY_RSA_SIGN), "PKEY_RSA_SIGN"}, |
81 | {ERR_FUNC(RSA_F_PKEY_RSA_VERIFY), "PKEY_RSA_VERIFY"}, | ||
81 | {ERR_FUNC(RSA_F_PKEY_RSA_VERIFYRECOVER), "PKEY_RSA_VERIFYRECOVER"}, | 82 | {ERR_FUNC(RSA_F_PKEY_RSA_VERIFYRECOVER), "PKEY_RSA_VERIFYRECOVER"}, |
82 | {ERR_FUNC(RSA_F_RSA_BUILTIN_KEYGEN), "RSA_BUILTIN_KEYGEN"}, | 83 | {ERR_FUNC(RSA_F_RSA_BUILTIN_KEYGEN), "RSA_BUILTIN_KEYGEN"}, |
83 | {ERR_FUNC(RSA_F_RSA_CHECK_KEY), "RSA_check_key"}, | 84 | {ERR_FUNC(RSA_F_RSA_CHECK_KEY), "RSA_check_key"}, |
@@ -86,6 +87,8 @@ static ERR_STRING_DATA RSA_str_functs[]= | |||
86 | {ERR_FUNC(RSA_F_RSA_EAY_PUBLIC_DECRYPT), "RSA_EAY_PUBLIC_DECRYPT"}, | 87 | {ERR_FUNC(RSA_F_RSA_EAY_PUBLIC_DECRYPT), "RSA_EAY_PUBLIC_DECRYPT"}, |
87 | {ERR_FUNC(RSA_F_RSA_EAY_PUBLIC_ENCRYPT), "RSA_EAY_PUBLIC_ENCRYPT"}, | 88 | {ERR_FUNC(RSA_F_RSA_EAY_PUBLIC_ENCRYPT), "RSA_EAY_PUBLIC_ENCRYPT"}, |
88 | {ERR_FUNC(RSA_F_RSA_GENERATE_KEY), "RSA_generate_key"}, | 89 | {ERR_FUNC(RSA_F_RSA_GENERATE_KEY), "RSA_generate_key"}, |
90 | {ERR_FUNC(RSA_F_RSA_GENERATE_KEY_EX), "RSA_generate_key_ex"}, | ||
91 | {ERR_FUNC(RSA_F_RSA_ITEM_VERIFY), "RSA_ITEM_VERIFY"}, | ||
89 | {ERR_FUNC(RSA_F_RSA_MEMORY_LOCK), "RSA_memory_lock"}, | 92 | {ERR_FUNC(RSA_F_RSA_MEMORY_LOCK), "RSA_memory_lock"}, |
90 | {ERR_FUNC(RSA_F_RSA_NEW_METHOD), "RSA_new_method"}, | 93 | {ERR_FUNC(RSA_F_RSA_NEW_METHOD), "RSA_new_method"}, |
91 | {ERR_FUNC(RSA_F_RSA_NULL), "RSA_NULL"}, | 94 | {ERR_FUNC(RSA_F_RSA_NULL), "RSA_NULL"}, |
@@ -97,6 +100,7 @@ static ERR_STRING_DATA RSA_str_functs[]= | |||
97 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_NONE), "RSA_padding_add_none"}, | 100 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_NONE), "RSA_padding_add_none"}, |
98 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP), "RSA_padding_add_PKCS1_OAEP"}, | 101 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP), "RSA_padding_add_PKCS1_OAEP"}, |
99 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_PSS), "RSA_padding_add_PKCS1_PSS"}, | 102 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_PSS), "RSA_padding_add_PKCS1_PSS"}, |
103 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1), "RSA_padding_add_PKCS1_PSS_mgf1"}, | ||
100 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1), "RSA_padding_add_PKCS1_type_1"}, | 104 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1), "RSA_padding_add_PKCS1_type_1"}, |
101 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2), "RSA_padding_add_PKCS1_type_2"}, | 105 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2), "RSA_padding_add_PKCS1_type_2"}, |
102 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_SSLV23), "RSA_padding_add_SSLv23"}, | 106 | {ERR_FUNC(RSA_F_RSA_PADDING_ADD_SSLV23), "RSA_padding_add_SSLv23"}, |
@@ -109,8 +113,12 @@ static ERR_STRING_DATA RSA_str_functs[]= | |||
109 | {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_X931), "RSA_padding_check_X931"}, | 113 | {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_X931), "RSA_padding_check_X931"}, |
110 | {ERR_FUNC(RSA_F_RSA_PRINT), "RSA_print"}, | 114 | {ERR_FUNC(RSA_F_RSA_PRINT), "RSA_print"}, |
111 | {ERR_FUNC(RSA_F_RSA_PRINT_FP), "RSA_print_fp"}, | 115 | {ERR_FUNC(RSA_F_RSA_PRINT_FP), "RSA_print_fp"}, |
116 | {ERR_FUNC(RSA_F_RSA_PRIVATE_DECRYPT), "RSA_private_decrypt"}, | ||
117 | {ERR_FUNC(RSA_F_RSA_PRIVATE_ENCRYPT), "RSA_private_encrypt"}, | ||
112 | {ERR_FUNC(RSA_F_RSA_PRIV_DECODE), "RSA_PRIV_DECODE"}, | 118 | {ERR_FUNC(RSA_F_RSA_PRIV_DECODE), "RSA_PRIV_DECODE"}, |
113 | {ERR_FUNC(RSA_F_RSA_PRIV_ENCODE), "RSA_PRIV_ENCODE"}, | 119 | {ERR_FUNC(RSA_F_RSA_PRIV_ENCODE), "RSA_PRIV_ENCODE"}, |
120 | {ERR_FUNC(RSA_F_RSA_PUBLIC_DECRYPT), "RSA_public_decrypt"}, | ||
121 | {ERR_FUNC(RSA_F_RSA_PUBLIC_ENCRYPT), "RSA_public_encrypt"}, | ||
114 | {ERR_FUNC(RSA_F_RSA_PUB_DECODE), "RSA_PUB_DECODE"}, | 122 | {ERR_FUNC(RSA_F_RSA_PUB_DECODE), "RSA_PUB_DECODE"}, |
115 | {ERR_FUNC(RSA_F_RSA_SETUP_BLINDING), "RSA_setup_blinding"}, | 123 | {ERR_FUNC(RSA_F_RSA_SETUP_BLINDING), "RSA_setup_blinding"}, |
116 | {ERR_FUNC(RSA_F_RSA_SIGN), "RSA_sign"}, | 124 | {ERR_FUNC(RSA_F_RSA_SIGN), "RSA_sign"}, |
@@ -118,6 +126,7 @@ static ERR_STRING_DATA RSA_str_functs[]= | |||
118 | {ERR_FUNC(RSA_F_RSA_VERIFY), "RSA_verify"}, | 126 | {ERR_FUNC(RSA_F_RSA_VERIFY), "RSA_verify"}, |
119 | {ERR_FUNC(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING), "RSA_verify_ASN1_OCTET_STRING"}, | 127 | {ERR_FUNC(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING), "RSA_verify_ASN1_OCTET_STRING"}, |
120 | {ERR_FUNC(RSA_F_RSA_VERIFY_PKCS1_PSS), "RSA_verify_PKCS1_PSS"}, | 128 | {ERR_FUNC(RSA_F_RSA_VERIFY_PKCS1_PSS), "RSA_verify_PKCS1_PSS"}, |
129 | {ERR_FUNC(RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1), "RSA_verify_PKCS1_PSS_mgf1"}, | ||
121 | {0,NULL} | 130 | {0,NULL} |
122 | }; | 131 | }; |
123 | 132 | ||
@@ -146,19 +155,24 @@ static ERR_STRING_DATA RSA_str_reasons[]= | |||
146 | {ERR_REASON(RSA_R_INVALID_HEADER) ,"invalid header"}, | 155 | {ERR_REASON(RSA_R_INVALID_HEADER) ,"invalid header"}, |
147 | {ERR_REASON(RSA_R_INVALID_KEYBITS) ,"invalid keybits"}, | 156 | {ERR_REASON(RSA_R_INVALID_KEYBITS) ,"invalid keybits"}, |
148 | {ERR_REASON(RSA_R_INVALID_MESSAGE_LENGTH),"invalid message length"}, | 157 | {ERR_REASON(RSA_R_INVALID_MESSAGE_LENGTH),"invalid message length"}, |
158 | {ERR_REASON(RSA_R_INVALID_MGF1_MD) ,"invalid mgf1 md"}, | ||
149 | {ERR_REASON(RSA_R_INVALID_PADDING) ,"invalid padding"}, | 159 | {ERR_REASON(RSA_R_INVALID_PADDING) ,"invalid padding"}, |
150 | {ERR_REASON(RSA_R_INVALID_PADDING_MODE) ,"invalid padding mode"}, | 160 | {ERR_REASON(RSA_R_INVALID_PADDING_MODE) ,"invalid padding mode"}, |
161 | {ERR_REASON(RSA_R_INVALID_PSS_PARAMETERS),"invalid pss parameters"}, | ||
151 | {ERR_REASON(RSA_R_INVALID_PSS_SALTLEN) ,"invalid pss saltlen"}, | 162 | {ERR_REASON(RSA_R_INVALID_PSS_SALTLEN) ,"invalid pss saltlen"}, |
163 | {ERR_REASON(RSA_R_INVALID_SALT_LENGTH) ,"invalid salt length"}, | ||
152 | {ERR_REASON(RSA_R_INVALID_TRAILER) ,"invalid trailer"}, | 164 | {ERR_REASON(RSA_R_INVALID_TRAILER) ,"invalid trailer"}, |
153 | {ERR_REASON(RSA_R_INVALID_X931_DIGEST) ,"invalid x931 digest"}, | 165 | {ERR_REASON(RSA_R_INVALID_X931_DIGEST) ,"invalid x931 digest"}, |
154 | {ERR_REASON(RSA_R_IQMP_NOT_INVERSE_OF_Q) ,"iqmp not inverse of q"}, | 166 | {ERR_REASON(RSA_R_IQMP_NOT_INVERSE_OF_Q) ,"iqmp not inverse of q"}, |
155 | {ERR_REASON(RSA_R_KEY_SIZE_TOO_SMALL) ,"key size too small"}, | 167 | {ERR_REASON(RSA_R_KEY_SIZE_TOO_SMALL) ,"key size too small"}, |
156 | {ERR_REASON(RSA_R_LAST_OCTET_INVALID) ,"last octet invalid"}, | 168 | {ERR_REASON(RSA_R_LAST_OCTET_INVALID) ,"last octet invalid"}, |
157 | {ERR_REASON(RSA_R_MODULUS_TOO_LARGE) ,"modulus too large"}, | 169 | {ERR_REASON(RSA_R_MODULUS_TOO_LARGE) ,"modulus too large"}, |
170 | {ERR_REASON(RSA_R_NON_FIPS_RSA_METHOD) ,"non fips rsa method"}, | ||
158 | {ERR_REASON(RSA_R_NO_PUBLIC_EXPONENT) ,"no public exponent"}, | 171 | {ERR_REASON(RSA_R_NO_PUBLIC_EXPONENT) ,"no public exponent"}, |
159 | {ERR_REASON(RSA_R_NULL_BEFORE_BLOCK_MISSING),"null before block missing"}, | 172 | {ERR_REASON(RSA_R_NULL_BEFORE_BLOCK_MISSING),"null before block missing"}, |
160 | {ERR_REASON(RSA_R_N_DOES_NOT_EQUAL_P_Q) ,"n does not equal p q"}, | 173 | {ERR_REASON(RSA_R_N_DOES_NOT_EQUAL_P_Q) ,"n does not equal p q"}, |
161 | {ERR_REASON(RSA_R_OAEP_DECODING_ERROR) ,"oaep decoding error"}, | 174 | {ERR_REASON(RSA_R_OAEP_DECODING_ERROR) ,"oaep decoding error"}, |
175 | {ERR_REASON(RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE),"operation not allowed in fips mode"}, | ||
162 | {ERR_REASON(RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),"operation not supported for this keytype"}, | 176 | {ERR_REASON(RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),"operation not supported for this keytype"}, |
163 | {ERR_REASON(RSA_R_PADDING_CHECK_FAILED) ,"padding check failed"}, | 177 | {ERR_REASON(RSA_R_PADDING_CHECK_FAILED) ,"padding check failed"}, |
164 | {ERR_REASON(RSA_R_P_NOT_PRIME) ,"p not prime"}, | 178 | {ERR_REASON(RSA_R_P_NOT_PRIME) ,"p not prime"}, |
@@ -169,7 +183,12 @@ static ERR_STRING_DATA RSA_str_reasons[]= | |||
169 | {ERR_REASON(RSA_R_SSLV3_ROLLBACK_ATTACK) ,"sslv3 rollback attack"}, | 183 | {ERR_REASON(RSA_R_SSLV3_ROLLBACK_ATTACK) ,"sslv3 rollback attack"}, |
170 | {ERR_REASON(RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD),"the asn1 object identifier is not known for this md"}, | 184 | {ERR_REASON(RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD),"the asn1 object identifier is not known for this md"}, |
171 | {ERR_REASON(RSA_R_UNKNOWN_ALGORITHM_TYPE),"unknown algorithm type"}, | 185 | {ERR_REASON(RSA_R_UNKNOWN_ALGORITHM_TYPE),"unknown algorithm type"}, |
186 | {ERR_REASON(RSA_R_UNKNOWN_MASK_DIGEST) ,"unknown mask digest"}, | ||
172 | {ERR_REASON(RSA_R_UNKNOWN_PADDING_TYPE) ,"unknown padding type"}, | 187 | {ERR_REASON(RSA_R_UNKNOWN_PADDING_TYPE) ,"unknown padding type"}, |
188 | {ERR_REASON(RSA_R_UNKNOWN_PSS_DIGEST) ,"unknown pss digest"}, | ||
189 | {ERR_REASON(RSA_R_UNSUPPORTED_MASK_ALGORITHM),"unsupported mask algorithm"}, | ||
190 | {ERR_REASON(RSA_R_UNSUPPORTED_MASK_PARAMETER),"unsupported mask parameter"}, | ||
191 | {ERR_REASON(RSA_R_UNSUPPORTED_SIGNATURE_TYPE),"unsupported signature type"}, | ||
173 | {ERR_REASON(RSA_R_VALUE_MISSING) ,"value missing"}, | 192 | {ERR_REASON(RSA_R_VALUE_MISSING) ,"value missing"}, |
174 | {ERR_REASON(RSA_R_WRONG_SIGNATURE_LENGTH),"wrong signature length"}, | 193 | {ERR_REASON(RSA_R_WRONG_SIGNATURE_LENGTH),"wrong signature length"}, |
175 | {0,NULL} | 194 | {0,NULL} |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_gen.c b/src/lib/libssl/src/crypto/rsa/rsa_gen.c index 767f7ab682..42290cce66 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_gen.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_gen.c | |||
@@ -67,6 +67,9 @@ | |||
67 | #include "cryptlib.h" | 67 | #include "cryptlib.h" |
68 | #include <openssl/bn.h> | 68 | #include <openssl/bn.h> |
69 | #include <openssl/rsa.h> | 69 | #include <openssl/rsa.h> |
70 | #ifdef OPENSSL_FIPS | ||
71 | #include <openssl/fips.h> | ||
72 | #endif | ||
70 | 73 | ||
71 | static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); | 74 | static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb); |
72 | 75 | ||
@@ -77,8 +80,20 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) | |||
77 | * now just because key-generation is part of RSA_METHOD. */ | 80 | * now just because key-generation is part of RSA_METHOD. */ |
78 | int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) | 81 | int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) |
79 | { | 82 | { |
83 | #ifdef OPENSSL_FIPS | ||
84 | if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD) | ||
85 | && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW)) | ||
86 | { | ||
87 | RSAerr(RSA_F_RSA_GENERATE_KEY_EX, RSA_R_NON_FIPS_RSA_METHOD); | ||
88 | return 0; | ||
89 | } | ||
90 | #endif | ||
80 | if(rsa->meth->rsa_keygen) | 91 | if(rsa->meth->rsa_keygen) |
81 | return rsa->meth->rsa_keygen(rsa, bits, e_value, cb); | 92 | return rsa->meth->rsa_keygen(rsa, bits, e_value, cb); |
93 | #ifdef OPENSSL_FIPS | ||
94 | if (FIPS_mode()) | ||
95 | return FIPS_rsa_generate_key_ex(rsa, bits, e_value, cb); | ||
96 | #endif | ||
82 | return rsa_builtin_keygen(rsa, bits, e_value, cb); | 97 | return rsa_builtin_keygen(rsa, bits, e_value, cb); |
83 | } | 98 | } |
84 | 99 | ||
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_lib.c b/src/lib/libssl/src/crypto/rsa/rsa_lib.c index de45088d76..c95ceafc82 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_lib.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_lib.c | |||
@@ -67,6 +67,10 @@ | |||
67 | #include <openssl/engine.h> | 67 | #include <openssl/engine.h> |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #ifdef OPENSSL_FIPS | ||
71 | #include <openssl/fips.h> | ||
72 | #endif | ||
73 | |||
70 | const char RSA_version[]="RSA" OPENSSL_VERSION_PTEXT; | 74 | const char RSA_version[]="RSA" OPENSSL_VERSION_PTEXT; |
71 | 75 | ||
72 | static const RSA_METHOD *default_RSA_meth=NULL; | 76 | static const RSA_METHOD *default_RSA_meth=NULL; |
@@ -87,12 +91,15 @@ const RSA_METHOD *RSA_get_default_method(void) | |||
87 | { | 91 | { |
88 | if (default_RSA_meth == NULL) | 92 | if (default_RSA_meth == NULL) |
89 | { | 93 | { |
94 | #ifdef OPENSSL_FIPS | ||
95 | if (FIPS_mode()) | ||
96 | return FIPS_rsa_pkcs1_ssleay(); | ||
97 | else | ||
98 | return RSA_PKCS1_SSLeay(); | ||
99 | #else | ||
90 | #ifdef RSA_NULL | 100 | #ifdef RSA_NULL |
91 | default_RSA_meth=RSA_null_method(); | 101 | default_RSA_meth=RSA_null_method(); |
92 | #else | 102 | #else |
93 | #if 0 /* was: #ifdef RSAref */ | ||
94 | default_RSA_meth=RSA_PKCS1_RSAref(); | ||
95 | #else | ||
96 | default_RSA_meth=RSA_PKCS1_SSLeay(); | 103 | default_RSA_meth=RSA_PKCS1_SSLeay(); |
97 | #endif | 104 | #endif |
98 | #endif | 105 | #endif |
@@ -181,7 +188,7 @@ RSA *RSA_new_method(ENGINE *engine) | |||
181 | ret->blinding=NULL; | 188 | ret->blinding=NULL; |
182 | ret->mt_blinding=NULL; | 189 | ret->mt_blinding=NULL; |
183 | ret->bignum_data=NULL; | 190 | ret->bignum_data=NULL; |
184 | ret->flags=ret->meth->flags; | 191 | ret->flags=ret->meth->flags & ~RSA_FLAG_NON_FIPS_ALLOW; |
185 | if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) | 192 | if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_RSA, ret, &ret->ex_data)) |
186 | { | 193 | { |
187 | #ifndef OPENSSL_NO_ENGINE | 194 | #ifndef OPENSSL_NO_ENGINE |
@@ -280,163 +287,6 @@ void *RSA_get_ex_data(const RSA *r, int idx) | |||
280 | return(CRYPTO_get_ex_data(&r->ex_data,idx)); | 287 | return(CRYPTO_get_ex_data(&r->ex_data,idx)); |
281 | } | 288 | } |
282 | 289 | ||
283 | int RSA_size(const RSA *r) | ||
284 | { | ||
285 | return(BN_num_bytes(r->n)); | ||
286 | } | ||
287 | |||
288 | int RSA_public_encrypt(int flen, const unsigned char *from, unsigned char *to, | ||
289 | RSA *rsa, int padding) | ||
290 | { | ||
291 | return(rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding)); | ||
292 | } | ||
293 | |||
294 | int RSA_private_encrypt(int flen, const unsigned char *from, unsigned char *to, | ||
295 | RSA *rsa, int padding) | ||
296 | { | ||
297 | return(rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding)); | ||
298 | } | ||
299 | |||
300 | int RSA_private_decrypt(int flen, const unsigned char *from, unsigned char *to, | ||
301 | RSA *rsa, int padding) | ||
302 | { | ||
303 | return(rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding)); | ||
304 | } | ||
305 | |||
306 | int RSA_public_decrypt(int flen, const unsigned char *from, unsigned char *to, | ||
307 | RSA *rsa, int padding) | ||
308 | { | ||
309 | return(rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding)); | ||
310 | } | ||
311 | |||
312 | int RSA_flags(const RSA *r) | ||
313 | { | ||
314 | return((r == NULL)?0:r->meth->flags); | ||
315 | } | ||
316 | |||
317 | void RSA_blinding_off(RSA *rsa) | ||
318 | { | ||
319 | if (rsa->blinding != NULL) | ||
320 | { | ||
321 | BN_BLINDING_free(rsa->blinding); | ||
322 | rsa->blinding=NULL; | ||
323 | } | ||
324 | rsa->flags &= ~RSA_FLAG_BLINDING; | ||
325 | rsa->flags |= RSA_FLAG_NO_BLINDING; | ||
326 | } | ||
327 | |||
328 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx) | ||
329 | { | ||
330 | int ret=0; | ||
331 | |||
332 | if (rsa->blinding != NULL) | ||
333 | RSA_blinding_off(rsa); | ||
334 | |||
335 | rsa->blinding = RSA_setup_blinding(rsa, ctx); | ||
336 | if (rsa->blinding == NULL) | ||
337 | goto err; | ||
338 | |||
339 | rsa->flags |= RSA_FLAG_BLINDING; | ||
340 | rsa->flags &= ~RSA_FLAG_NO_BLINDING; | ||
341 | ret=1; | ||
342 | err: | ||
343 | return(ret); | ||
344 | } | ||
345 | |||
346 | static BIGNUM *rsa_get_public_exp(const BIGNUM *d, const BIGNUM *p, | ||
347 | const BIGNUM *q, BN_CTX *ctx) | ||
348 | { | ||
349 | BIGNUM *ret = NULL, *r0, *r1, *r2; | ||
350 | |||
351 | if (d == NULL || p == NULL || q == NULL) | ||
352 | return NULL; | ||
353 | |||
354 | BN_CTX_start(ctx); | ||
355 | r0 = BN_CTX_get(ctx); | ||
356 | r1 = BN_CTX_get(ctx); | ||
357 | r2 = BN_CTX_get(ctx); | ||
358 | if (r2 == NULL) | ||
359 | goto err; | ||
360 | |||
361 | if (!BN_sub(r1, p, BN_value_one())) goto err; | ||
362 | if (!BN_sub(r2, q, BN_value_one())) goto err; | ||
363 | if (!BN_mul(r0, r1, r2, ctx)) goto err; | ||
364 | |||
365 | ret = BN_mod_inverse(NULL, d, r0, ctx); | ||
366 | err: | ||
367 | BN_CTX_end(ctx); | ||
368 | return ret; | ||
369 | } | ||
370 | |||
371 | BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *in_ctx) | ||
372 | { | ||
373 | BIGNUM local_n; | ||
374 | BIGNUM *e,*n; | ||
375 | BN_CTX *ctx; | ||
376 | BN_BLINDING *ret = NULL; | ||
377 | |||
378 | if (in_ctx == NULL) | ||
379 | { | ||
380 | if ((ctx = BN_CTX_new()) == NULL) return 0; | ||
381 | } | ||
382 | else | ||
383 | ctx = in_ctx; | ||
384 | |||
385 | BN_CTX_start(ctx); | ||
386 | e = BN_CTX_get(ctx); | ||
387 | if (e == NULL) | ||
388 | { | ||
389 | RSAerr(RSA_F_RSA_SETUP_BLINDING, ERR_R_MALLOC_FAILURE); | ||
390 | goto err; | ||
391 | } | ||
392 | |||
393 | if (rsa->e == NULL) | ||
394 | { | ||
395 | e = rsa_get_public_exp(rsa->d, rsa->p, rsa->q, ctx); | ||
396 | if (e == NULL) | ||
397 | { | ||
398 | RSAerr(RSA_F_RSA_SETUP_BLINDING, RSA_R_NO_PUBLIC_EXPONENT); | ||
399 | goto err; | ||
400 | } | ||
401 | } | ||
402 | else | ||
403 | e = rsa->e; | ||
404 | |||
405 | |||
406 | if ((RAND_status() == 0) && rsa->d != NULL && rsa->d->d != NULL) | ||
407 | { | ||
408 | /* if PRNG is not properly seeded, resort to secret | ||
409 | * exponent as unpredictable seed */ | ||
410 | RAND_add(rsa->d->d, rsa->d->dmax * sizeof rsa->d->d[0], 0.0); | ||
411 | } | ||
412 | |||
413 | if (!(rsa->flags & RSA_FLAG_NO_CONSTTIME)) | ||
414 | { | ||
415 | /* Set BN_FLG_CONSTTIME flag */ | ||
416 | n = &local_n; | ||
417 | BN_with_flags(n, rsa->n, BN_FLG_CONSTTIME); | ||
418 | } | ||
419 | else | ||
420 | n = rsa->n; | ||
421 | |||
422 | ret = BN_BLINDING_create_param(NULL, e, n, ctx, | ||
423 | rsa->meth->bn_mod_exp, rsa->_method_mod_n); | ||
424 | if (ret == NULL) | ||
425 | { | ||
426 | RSAerr(RSA_F_RSA_SETUP_BLINDING, ERR_R_BN_LIB); | ||
427 | goto err; | ||
428 | } | ||
429 | CRYPTO_THREADID_current(BN_BLINDING_thread_id(ret)); | ||
430 | err: | ||
431 | BN_CTX_end(ctx); | ||
432 | if (in_ctx == NULL) | ||
433 | BN_CTX_free(ctx); | ||
434 | if(rsa->e == NULL) | ||
435 | BN_free(e); | ||
436 | |||
437 | return ret; | ||
438 | } | ||
439 | |||
440 | int RSA_memory_lock(RSA *r) | 290 | int RSA_memory_lock(RSA *r) |
441 | { | 291 | { |
442 | int i,j,k,off; | 292 | int i,j,k,off; |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_oaep.c b/src/lib/libssl/src/crypto/rsa/rsa_oaep.c index 18d307ea9e..553d212ebe 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_oaep.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_oaep.c | |||
@@ -56,7 +56,8 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, | |||
56 | seed = to + 1; | 56 | seed = to + 1; |
57 | db = to + SHA_DIGEST_LENGTH + 1; | 57 | db = to + SHA_DIGEST_LENGTH + 1; |
58 | 58 | ||
59 | EVP_Digest((void *)param, plen, db, NULL, EVP_sha1(), NULL); | 59 | if (!EVP_Digest((void *)param, plen, db, NULL, EVP_sha1(), NULL)) |
60 | return 0; | ||
60 | memset(db + SHA_DIGEST_LENGTH, 0, | 61 | memset(db + SHA_DIGEST_LENGTH, 0, |
61 | emlen - flen - 2 * SHA_DIGEST_LENGTH - 1); | 62 | emlen - flen - 2 * SHA_DIGEST_LENGTH - 1); |
62 | db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01; | 63 | db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01; |
@@ -145,7 +146,8 @@ int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, | |||
145 | for (i = 0; i < dblen; i++) | 146 | for (i = 0; i < dblen; i++) |
146 | db[i] ^= maskeddb[i]; | 147 | db[i] ^= maskeddb[i]; |
147 | 148 | ||
148 | EVP_Digest((void *)param, plen, phash, NULL, EVP_sha1(), NULL); | 149 | if (!EVP_Digest((void *)param, plen, phash, NULL, EVP_sha1(), NULL)) |
150 | return -1; | ||
149 | 151 | ||
150 | if (memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad) | 152 | if (memcmp(db, phash, SHA_DIGEST_LENGTH) != 0 || bad) |
151 | goto decoding_err; | 153 | goto decoding_err; |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_sign.c b/src/lib/libssl/src/crypto/rsa/rsa_sign.c index 0be4ec7fb0..b6f6037ae0 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_sign.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_sign.c | |||
@@ -77,6 +77,14 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len, | |||
77 | const unsigned char *s = NULL; | 77 | const unsigned char *s = NULL; |
78 | X509_ALGOR algor; | 78 | X509_ALGOR algor; |
79 | ASN1_OCTET_STRING digest; | 79 | ASN1_OCTET_STRING digest; |
80 | #ifdef OPENSSL_FIPS | ||
81 | if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD) | ||
82 | && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW)) | ||
83 | { | ||
84 | RSAerr(RSA_F_RSA_SIGN, RSA_R_NON_FIPS_RSA_METHOD); | ||
85 | return 0; | ||
86 | } | ||
87 | #endif | ||
80 | if((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign) | 88 | if((rsa->flags & RSA_FLAG_SIGN_VER) && rsa->meth->rsa_sign) |
81 | { | 89 | { |
82 | return rsa->meth->rsa_sign(type, m, m_len, | 90 | return rsa->meth->rsa_sign(type, m, m_len, |
@@ -153,6 +161,15 @@ int int_rsa_verify(int dtype, const unsigned char *m, | |||
153 | unsigned char *s; | 161 | unsigned char *s; |
154 | X509_SIG *sig=NULL; | 162 | X509_SIG *sig=NULL; |
155 | 163 | ||
164 | #ifdef OPENSSL_FIPS | ||
165 | if (FIPS_mode() && !(rsa->meth->flags & RSA_FLAG_FIPS_METHOD) | ||
166 | && !(rsa->flags & RSA_FLAG_NON_FIPS_ALLOW)) | ||
167 | { | ||
168 | RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_NON_FIPS_RSA_METHOD); | ||
169 | return 0; | ||
170 | } | ||
171 | #endif | ||
172 | |||
156 | if (siglen != (unsigned int)RSA_size(rsa)) | 173 | if (siglen != (unsigned int)RSA_size(rsa)) |
157 | { | 174 | { |
158 | RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_WRONG_SIGNATURE_LENGTH); | 175 | RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_WRONG_SIGNATURE_LENGTH); |
@@ -182,6 +199,22 @@ int int_rsa_verify(int dtype, const unsigned char *m, | |||
182 | i=RSA_public_decrypt((int)siglen,sigbuf,s,rsa,RSA_PKCS1_PADDING); | 199 | i=RSA_public_decrypt((int)siglen,sigbuf,s,rsa,RSA_PKCS1_PADDING); |
183 | 200 | ||
184 | if (i <= 0) goto err; | 201 | if (i <= 0) goto err; |
202 | /* Oddball MDC2 case: signature can be OCTET STRING. | ||
203 | * check for correct tag and length octets. | ||
204 | */ | ||
205 | if (dtype == NID_mdc2 && i == 18 && s[0] == 0x04 && s[1] == 0x10) | ||
206 | { | ||
207 | if (rm) | ||
208 | { | ||
209 | memcpy(rm, s + 2, 16); | ||
210 | *prm_len = 16; | ||
211 | ret = 1; | ||
212 | } | ||
213 | else if(memcmp(m, s + 2, 16)) | ||
214 | RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_BAD_SIGNATURE); | ||
215 | else | ||
216 | ret = 1; | ||
217 | } | ||
185 | 218 | ||
186 | /* Special case: SSL signature */ | 219 | /* Special case: SSL signature */ |
187 | if(dtype == NID_md5_sha1) { | 220 | if(dtype == NID_md5_sha1) { |
diff --git a/src/lib/libssl/src/crypto/sha/Makefile b/src/lib/libssl/src/crypto/sha/Makefile index e6eccb05f9..6d191d3936 100644 --- a/src/lib/libssl/src/crypto/sha/Makefile +++ b/src/lib/libssl/src/crypto/sha/Makefile | |||
@@ -56,8 +56,11 @@ sha256-ia64.s: asm/sha512-ia64.pl | |||
56 | sha512-ia64.s: asm/sha512-ia64.pl | 56 | sha512-ia64.s: asm/sha512-ia64.pl |
57 | (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS)) | 57 | (cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS)) |
58 | 58 | ||
59 | sha256-armv4.s: asm/sha256-armv4.pl | 59 | sha256-armv4.S: asm/sha256-armv4.pl |
60 | $(PERL) $< $@ | 60 | $(PERL) $< $(PERLASM_SCHEME) $@ |
61 | |||
62 | sha1-alpha.s: asm/sha1-alpha.pl | ||
63 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | ||
61 | 64 | ||
62 | # Solaris make has to be explicitly told | 65 | # Solaris make has to be explicitly told |
63 | sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@ | 66 | sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@ |
@@ -71,10 +74,22 @@ sha1-ppc.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@ | |||
71 | sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ | 74 | sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ |
72 | sha512-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ | 75 | sha512-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@ |
73 | 76 | ||
77 | sha1-parisc.s: asm/sha1-parisc.pl; $(PERL) asm/sha1-parisc.pl $(PERLASM_SCHEME) $@ | ||
78 | sha256-parisc.s:asm/sha512-parisc.pl; $(PERL) asm/sha512-parisc.pl $(PERLASM_SCHEME) $@ | ||
79 | sha512-parisc.s:asm/sha512-parisc.pl; $(PERL) asm/sha512-parisc.pl $(PERLASM_SCHEME) $@ | ||
80 | |||
81 | sha1-mips.S: asm/sha1-mips.pl; $(PERL) asm/sha1-mips.pl $(PERLASM_SCHEME) $@ | ||
82 | sha256-mips.S: asm/sha512-mips.pl; $(PERL) asm/sha512-mips.pl $(PERLASM_SCHEME) $@ | ||
83 | sha512-mips.S: asm/sha512-mips.pl; $(PERL) asm/sha512-mips.pl $(PERLASM_SCHEME) $@ | ||
84 | |||
74 | # GNU make "catch all" | 85 | # GNU make "catch all" |
75 | sha1-%.s: asm/sha1-%.pl; $(PERL) $< $@ | 86 | sha1-%.S: asm/sha1-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
76 | sha256-%.s: asm/sha512-%.pl; $(PERL) $< $@ | 87 | sha256-%.S: asm/sha512-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
77 | sha512-%.s: asm/sha512-%.pl; $(PERL) $< $@ | 88 | sha512-%.S: asm/sha512-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@ |
89 | |||
90 | sha1-armv4-large.o: sha1-armv4-large.S | ||
91 | sha256-armv4.o: sha256-armv4.S | ||
92 | sha512-armv4.o: sha512-armv4.S | ||
78 | 93 | ||
79 | files: | 94 | files: |
80 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO | 95 | $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO |
@@ -119,8 +134,11 @@ sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
119 | sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 134 | sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
120 | sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 135 | sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
121 | sha1_one.o: sha1_one.c | 136 | sha1_one.o: sha1_one.c |
122 | sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 137 | sha1dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
123 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 138 | sha1dgst.o: ../../include/openssl/opensslconf.h |
139 | sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
140 | sha1dgst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
141 | sha1dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
124 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h | 142 | sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h |
125 | sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 143 | sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
126 | sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 144 | sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
@@ -135,8 +153,11 @@ sha512.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | |||
135 | sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | 153 | sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h |
136 | sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 154 | sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
137 | sha512.o: ../cryptlib.h sha512.c | 155 | sha512.o: ../cryptlib.h sha512.c |
138 | sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h | 156 | sha_dgst.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
139 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h | 157 | sha_dgst.o: ../../include/openssl/opensslconf.h |
158 | sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
159 | sha_dgst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h | ||
160 | sha_dgst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | ||
140 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h | 161 | sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h |
141 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h | 162 | sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
142 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h | 163 | sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
diff --git a/src/lib/libssl/src/crypto/sha/asm/sha1-586.pl b/src/lib/libssl/src/crypto/sha/asm/sha1-586.pl index a1f876281a..1084d227fe 100644 --- a/src/lib/libssl/src/crypto/sha/asm/sha1-586.pl +++ b/src/lib/libssl/src/crypto/sha/asm/sha1-586.pl | |||
@@ -12,6 +12,8 @@ | |||
12 | # commentary below], and in 2006 the rest was rewritten in order to | 12 | # commentary below], and in 2006 the rest was rewritten in order to |
13 | # gain freedom to liberate licensing terms. | 13 | # gain freedom to liberate licensing terms. |
14 | 14 | ||
15 | # January, September 2004. | ||
16 | # | ||
15 | # It was noted that Intel IA-32 C compiler generates code which | 17 | # It was noted that Intel IA-32 C compiler generates code which |
16 | # performs ~30% *faster* on P4 CPU than original *hand-coded* | 18 | # performs ~30% *faster* on P4 CPU than original *hand-coded* |
17 | # SHA1 assembler implementation. To address this problem (and | 19 | # SHA1 assembler implementation. To address this problem (and |
@@ -31,12 +33,92 @@ | |||
31 | # ---------------------------------------------------------------- | 33 | # ---------------------------------------------------------------- |
32 | # <appro@fy.chalmers.se> | 34 | # <appro@fy.chalmers.se> |
33 | 35 | ||
36 | # August 2009. | ||
37 | # | ||
38 | # George Spelvin has tipped that F_40_59(b,c,d) can be rewritten as | ||
39 | # '(c&d) + (b&(c^d))', which allows to accumulate partial results | ||
40 | # and lighten "pressure" on scratch registers. This resulted in | ||
41 | # >12% performance improvement on contemporary AMD cores (with no | ||
42 | # degradation on other CPUs:-). Also, the code was revised to maximize | ||
43 | # "distance" between instructions producing input to 'lea' instruction | ||
44 | # and the 'lea' instruction itself, which is essential for Intel Atom | ||
45 | # core and resulted in ~15% improvement. | ||
46 | |||
47 | # October 2010. | ||
48 | # | ||
49 | # Add SSSE3, Supplemental[!] SSE3, implementation. The idea behind it | ||
50 | # is to offload message schedule denoted by Wt in NIST specification, | ||
51 | # or Xupdate in OpenSSL source, to SIMD unit. The idea is not novel, | ||
52 | # and in SSE2 context was first explored by Dean Gaudet in 2004, see | ||
53 | # http://arctic.org/~dean/crypto/sha1.html. Since then several things | ||
54 | # have changed that made it interesting again: | ||
55 | # | ||
56 | # a) XMM units became faster and wider; | ||
57 | # b) instruction set became more versatile; | ||
58 | # c) an important observation was made by Max Locktykhin, which made | ||
59 | # it possible to reduce amount of instructions required to perform | ||
60 | # the operation in question, for further details see | ||
61 | # http://software.intel.com/en-us/articles/improving-the-performance-of-the-secure-hash-algorithm-1/. | ||
62 | |||
63 | # April 2011. | ||
64 | # | ||
65 | # Add AVX code path, probably most controversial... The thing is that | ||
66 | # switch to AVX alone improves performance by as little as 4% in | ||
67 | # comparison to SSSE3 code path. But below result doesn't look like | ||
68 | # 4% improvement... Trouble is that Sandy Bridge decodes 'ro[rl]' as | ||
69 | # pair of µ-ops, and it's the additional µ-ops, two per round, that | ||
70 | # make it run slower than Core2 and Westmere. But 'sh[rl]d' is decoded | ||
71 | # as single µ-op by Sandy Bridge and it's replacing 'ro[rl]' with | ||
72 | # equivalent 'sh[rl]d' that is responsible for the impressive 5.1 | ||
73 | # cycles per processed byte. But 'sh[rl]d' is not something that used | ||
74 | # to be fast, nor does it appear to be fast in upcoming Bulldozer | ||
75 | # [according to its optimization manual]. Which is why AVX code path | ||
76 | # is guarded by *both* AVX and synthetic bit denoting Intel CPUs. | ||
77 | # One can argue that it's unfair to AMD, but without 'sh[rl]d' it | ||
78 | # makes no sense to keep the AVX code path. If somebody feels that | ||
79 | # strongly, it's probably more appropriate to discuss possibility of | ||
80 | # using vector rotate XOP on AMD... | ||
81 | |||
82 | ###################################################################### | ||
83 | # Current performance is summarized in following table. Numbers are | ||
84 | # CPU clock cycles spent to process single byte (less is better). | ||
85 | # | ||
86 | # x86 SSSE3 AVX | ||
87 | # Pentium 15.7 - | ||
88 | # PIII 11.5 - | ||
89 | # P4 10.6 - | ||
90 | # AMD K8 7.1 - | ||
91 | # Core2 7.3 6.1/+20% - | ||
92 | # Atom 12.5 9.5(*)/+32% - | ||
93 | # Westmere 7.3 5.6/+30% - | ||
94 | # Sandy Bridge 8.8 6.2/+40% 5.1(**)/+70% | ||
95 | # | ||
96 | # (*) Loop is 1056 instructions long and expected result is ~8.25. | ||
97 | # It remains mystery [to me] why ILP is limited to 1.7. | ||
98 | # | ||
99 | # (**) As per above comment, the result is for AVX *plus* sh[rl]d. | ||
100 | |||
34 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | 101 | $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; |
35 | push(@INC,"${dir}","${dir}../../perlasm"); | 102 | push(@INC,"${dir}","${dir}../../perlasm"); |
36 | require "x86asm.pl"; | 103 | require "x86asm.pl"; |
37 | 104 | ||
38 | &asm_init($ARGV[0],"sha1-586.pl",$ARGV[$#ARGV] eq "386"); | 105 | &asm_init($ARGV[0],"sha1-586.pl",$ARGV[$#ARGV] eq "386"); |
39 | 106 | ||
107 | $xmm=$ymm=0; | ||
108 | for (@ARGV) { $xmm=1 if (/-DOPENSSL_IA32_SSE2/); } | ||
109 | |||
110 | $ymm=1 if ($xmm && | ||
111 | `$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` | ||
112 | =~ /GNU assembler version ([2-9]\.[0-9]+)/ && | ||
113 | $1>=2.19); # first version supporting AVX | ||
114 | |||
115 | $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32n" && | ||
116 | `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)/ && | ||
117 | $1>=2.03); # first version supporting AVX | ||
118 | |||
119 | &external_label("OPENSSL_ia32cap_P") if ($xmm); | ||
120 | |||
121 | |||
40 | $A="eax"; | 122 | $A="eax"; |
41 | $B="ebx"; | 123 | $B="ebx"; |
42 | $C="ecx"; | 124 | $C="ecx"; |
@@ -47,6 +129,10 @@ $tmp1="ebp"; | |||
47 | 129 | ||
48 | @V=($A,$B,$C,$D,$E,$T); | 130 | @V=($A,$B,$C,$D,$E,$T); |
49 | 131 | ||
132 | $alt=0; # 1 denotes alternative IALU implementation, which performs | ||
133 | # 8% *worse* on P4, same on Westmere and Atom, 2% better on | ||
134 | # Sandy Bridge... | ||
135 | |||
50 | sub BODY_00_15 | 136 | sub BODY_00_15 |
51 | { | 137 | { |
52 | local($n,$a,$b,$c,$d,$e,$f)=@_; | 138 | local($n,$a,$b,$c,$d,$e,$f)=@_; |
@@ -59,16 +145,18 @@ sub BODY_00_15 | |||
59 | &rotl($tmp1,5); # tmp1=ROTATE(a,5) | 145 | &rotl($tmp1,5); # tmp1=ROTATE(a,5) |
60 | &xor($f,$d); | 146 | &xor($f,$d); |
61 | &add($tmp1,$e); # tmp1+=e; | 147 | &add($tmp1,$e); # tmp1+=e; |
62 | &and($f,$b); | 148 | &mov($e,&swtmp($n%16)); # e becomes volatile and is loaded |
63 | &mov($e,&swtmp($n%16)); # e becomes volatile and is loaded | ||
64 | # with xi, also note that e becomes | 149 | # with xi, also note that e becomes |
65 | # f in next round... | 150 | # f in next round... |
66 | &xor($f,$d); # f holds F_00_19(b,c,d) | 151 | &and($f,$b); |
67 | &rotr($b,2); # b=ROTATE(b,30) | 152 | &rotr($b,2); # b=ROTATE(b,30) |
68 | &lea($tmp1,&DWP(0x5a827999,$tmp1,$e)); # tmp1+=K_00_19+xi | 153 | &xor($f,$d); # f holds F_00_19(b,c,d) |
154 | &lea($tmp1,&DWP(0x5a827999,$tmp1,$e)); # tmp1+=K_00_19+xi | ||
69 | 155 | ||
70 | if ($n==15) { &add($f,$tmp1); } # f+=tmp1 | 156 | if ($n==15) { &mov($e,&swtmp(($n+1)%16));# pre-fetch f for next round |
157 | &add($f,$tmp1); } # f+=tmp1 | ||
71 | else { &add($tmp1,$f); } # f becomes a in next round | 158 | else { &add($tmp1,$f); } # f becomes a in next round |
159 | &mov($tmp1,$a) if ($alt && $n==15); | ||
72 | } | 160 | } |
73 | 161 | ||
74 | sub BODY_16_19 | 162 | sub BODY_16_19 |
@@ -77,22 +165,41 @@ sub BODY_16_19 | |||
77 | 165 | ||
78 | &comment("16_19 $n"); | 166 | &comment("16_19 $n"); |
79 | 167 | ||
80 | &mov($f,&swtmp($n%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) | 168 | if ($alt) { |
81 | &mov($tmp1,$c); # tmp1 to hold F_00_19(b,c,d) | 169 | &xor($c,$d); |
82 | &xor($f,&swtmp(($n+2)%16)); | 170 | &xor($f,&swtmp(($n+2)%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) |
83 | &xor($tmp1,$d); | 171 | &and($tmp1,$c); # tmp1 to hold F_00_19(b,c,d), b&=c^d |
84 | &xor($f,&swtmp(($n+8)%16)); | 172 | &xor($f,&swtmp(($n+8)%16)); |
85 | &and($tmp1,$b); # tmp1 holds F_00_19(b,c,d) | 173 | &xor($tmp1,$d); # tmp1=F_00_19(b,c,d) |
86 | &rotr($b,2); # b=ROTATE(b,30) | 174 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd |
175 | &rotl($f,1); # f=ROTATE(f,1) | ||
176 | &add($e,$tmp1); # e+=F_00_19(b,c,d) | ||
177 | &xor($c,$d); # restore $c | ||
178 | &mov($tmp1,$a); # b in next round | ||
179 | &rotr($b,$n==16?2:7); # b=ROTATE(b,30) | ||
180 | &mov(&swtmp($n%16),$f); # xi=f | ||
181 | &rotl($a,5); # ROTATE(a,5) | ||
182 | &lea($f,&DWP(0x5a827999,$f,$e));# f+=F_00_19(b,c,d)+e | ||
183 | &mov($e,&swtmp(($n+1)%16)); # pre-fetch f for next round | ||
184 | &add($f,$a); # f+=ROTATE(a,5) | ||
185 | } else { | ||
186 | &mov($tmp1,$c); # tmp1 to hold F_00_19(b,c,d) | ||
187 | &xor($f,&swtmp(($n+2)%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) | ||
188 | &xor($tmp1,$d); | ||
189 | &xor($f,&swtmp(($n+8)%16)); | ||
190 | &and($tmp1,$b); | ||
87 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd | 191 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd |
88 | &rotl($f,1); # f=ROTATE(f,1) | 192 | &rotl($f,1); # f=ROTATE(f,1) |
89 | &xor($tmp1,$d); # tmp1=F_00_19(b,c,d) | 193 | &xor($tmp1,$d); # tmp1=F_00_19(b,c,d) |
90 | &mov(&swtmp($n%16),$f); # xi=f | 194 | &add($e,$tmp1); # e+=F_00_19(b,c,d) |
91 | &lea($f,&DWP(0x5a827999,$f,$e));# f+=K_00_19+e | 195 | &mov($tmp1,$a); |
92 | &mov($e,$a); # e becomes volatile | 196 | &rotr($b,2); # b=ROTATE(b,30) |
93 | &rotl($e,5); # e=ROTATE(a,5) | 197 | &mov(&swtmp($n%16),$f); # xi=f |
94 | &add($f,$tmp1); # f+=F_00_19(b,c,d) | 198 | &rotl($tmp1,5); # ROTATE(a,5) |
95 | &add($f,$e); # f+=ROTATE(a,5) | 199 | &lea($f,&DWP(0x5a827999,$f,$e));# f+=F_00_19(b,c,d)+e |
200 | &mov($e,&swtmp(($n+1)%16)); # pre-fetch f for next round | ||
201 | &add($f,$tmp1); # f+=ROTATE(a,5) | ||
202 | } | ||
96 | } | 203 | } |
97 | 204 | ||
98 | sub BODY_20_39 | 205 | sub BODY_20_39 |
@@ -102,21 +209,41 @@ sub BODY_20_39 | |||
102 | 209 | ||
103 | &comment("20_39 $n"); | 210 | &comment("20_39 $n"); |
104 | 211 | ||
212 | if ($alt) { | ||
213 | &xor($tmp1,$c); # tmp1 to hold F_20_39(b,c,d), b^=c | ||
214 | &xor($f,&swtmp(($n+2)%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) | ||
215 | &xor($tmp1,$d); # tmp1 holds F_20_39(b,c,d) | ||
216 | &xor($f,&swtmp(($n+8)%16)); | ||
217 | &add($e,$tmp1); # e+=F_20_39(b,c,d) | ||
218 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd | ||
219 | &rotl($f,1); # f=ROTATE(f,1) | ||
220 | &mov($tmp1,$a); # b in next round | ||
221 | &rotr($b,7); # b=ROTATE(b,30) | ||
222 | &mov(&swtmp($n%16),$f) if($n<77);# xi=f | ||
223 | &rotl($a,5); # ROTATE(a,5) | ||
224 | &xor($b,$c) if($n==39);# warm up for BODY_40_59 | ||
225 | &and($tmp1,$b) if($n==39); | ||
226 | &lea($f,&DWP($K,$f,$e)); # f+=e+K_XX_YY | ||
227 | &mov($e,&swtmp(($n+1)%16)) if($n<79);# pre-fetch f for next round | ||
228 | &add($f,$a); # f+=ROTATE(a,5) | ||
229 | &rotr($a,5) if ($n==79); | ||
230 | } else { | ||
105 | &mov($tmp1,$b); # tmp1 to hold F_20_39(b,c,d) | 231 | &mov($tmp1,$b); # tmp1 to hold F_20_39(b,c,d) |
106 | &mov($f,&swtmp($n%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) | 232 | &xor($f,&swtmp(($n+2)%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) |
107 | &rotr($b,2); # b=ROTATE(b,30) | ||
108 | &xor($f,&swtmp(($n+2)%16)); | ||
109 | &xor($tmp1,$c); | 233 | &xor($tmp1,$c); |
110 | &xor($f,&swtmp(($n+8)%16)); | 234 | &xor($f,&swtmp(($n+8)%16)); |
111 | &xor($tmp1,$d); # tmp1 holds F_20_39(b,c,d) | 235 | &xor($tmp1,$d); # tmp1 holds F_20_39(b,c,d) |
112 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd | 236 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd |
113 | &rotl($f,1); # f=ROTATE(f,1) | 237 | &rotl($f,1); # f=ROTATE(f,1) |
114 | &add($tmp1,$e); | 238 | &add($e,$tmp1); # e+=F_20_39(b,c,d) |
115 | &mov(&swtmp($n%16),$f); # xi=f | 239 | &rotr($b,2); # b=ROTATE(b,30) |
116 | &mov($e,$a); # e becomes volatile | 240 | &mov($tmp1,$a); |
117 | &rotl($e,5); # e=ROTATE(a,5) | 241 | &rotl($tmp1,5); # ROTATE(a,5) |
118 | &lea($f,&DWP($K,$f,$tmp1)); # f+=K_20_39+e | 242 | &mov(&swtmp($n%16),$f) if($n<77);# xi=f |
119 | &add($f,$e); # f+=ROTATE(a,5) | 243 | &lea($f,&DWP($K,$f,$e)); # f+=e+K_XX_YY |
244 | &mov($e,&swtmp(($n+1)%16)) if($n<79);# pre-fetch f for next round | ||
245 | &add($f,$tmp1); # f+=ROTATE(a,5) | ||
246 | } | ||
120 | } | 247 | } |
121 | 248 | ||
122 | sub BODY_40_59 | 249 | sub BODY_40_59 |
@@ -125,41 +252,86 @@ sub BODY_40_59 | |||
125 | 252 | ||
126 | &comment("40_59 $n"); | 253 | &comment("40_59 $n"); |
127 | 254 | ||
128 | &mov($f,&swtmp($n%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) | 255 | if ($alt) { |
129 | &mov($tmp1,&swtmp(($n+2)%16)); | 256 | &add($e,$tmp1); # e+=b&(c^d) |
130 | &xor($f,$tmp1); | 257 | &xor($f,&swtmp(($n+2)%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) |
131 | &mov($tmp1,&swtmp(($n+8)%16)); | 258 | &mov($tmp1,$d); |
132 | &xor($f,$tmp1); | 259 | &xor($f,&swtmp(($n+8)%16)); |
133 | &mov($tmp1,&swtmp(($n+13)%16)); | 260 | &xor($c,$d); # restore $c |
134 | &xor($f,$tmp1); # f holds xa^xb^xc^xd | 261 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd |
135 | &mov($tmp1,$b); # tmp1 to hold F_40_59(b,c,d) | ||
136 | &rotl($f,1); # f=ROTATE(f,1) | 262 | &rotl($f,1); # f=ROTATE(f,1) |
137 | &or($tmp1,$c); | 263 | &and($tmp1,$c); |
138 | &mov(&swtmp($n%16),$f); # xi=f | 264 | &rotr($b,7); # b=ROTATE(b,30) |
139 | &and($tmp1,$d); | 265 | &add($e,$tmp1); # e+=c&d |
140 | &lea($f,&DWP(0x8f1bbcdc,$f,$e));# f+=K_40_59+e | 266 | &mov($tmp1,$a); # b in next round |
141 | &mov($e,$b); # e becomes volatile and is used | 267 | &mov(&swtmp($n%16),$f); # xi=f |
142 | # to calculate F_40_59(b,c,d) | 268 | &rotl($a,5); # ROTATE(a,5) |
269 | &xor($b,$c) if ($n<59); | ||
270 | &and($tmp1,$b) if ($n<59);# tmp1 to hold F_40_59(b,c,d) | ||
271 | &lea($f,&DWP(0x8f1bbcdc,$f,$e));# f+=K_40_59+e+(b&(c^d)) | ||
272 | &mov($e,&swtmp(($n+1)%16)); # pre-fetch f for next round | ||
273 | &add($f,$a); # f+=ROTATE(a,5) | ||
274 | } else { | ||
275 | &mov($tmp1,$c); # tmp1 to hold F_40_59(b,c,d) | ||
276 | &xor($f,&swtmp(($n+2)%16)); # f to hold Xupdate(xi,xa,xb,xc,xd) | ||
277 | &xor($tmp1,$d); | ||
278 | &xor($f,&swtmp(($n+8)%16)); | ||
279 | &and($tmp1,$b); | ||
280 | &xor($f,&swtmp(($n+13)%16)); # f holds xa^xb^xc^xd | ||
281 | &rotl($f,1); # f=ROTATE(f,1) | ||
282 | &add($tmp1,$e); # b&(c^d)+=e | ||
143 | &rotr($b,2); # b=ROTATE(b,30) | 283 | &rotr($b,2); # b=ROTATE(b,30) |
144 | &and($e,$c); | 284 | &mov($e,$a); # e becomes volatile |
145 | &or($tmp1,$e); # tmp1 holds F_40_59(b,c,d) | 285 | &rotl($e,5); # ROTATE(a,5) |
146 | &mov($e,$a); | 286 | &mov(&swtmp($n%16),$f); # xi=f |
147 | &rotl($e,5); # e=ROTATE(a,5) | 287 | &lea($f,&DWP(0x8f1bbcdc,$f,$tmp1));# f+=K_40_59+e+(b&(c^d)) |
148 | &add($f,$tmp1); # f+=tmp1; | 288 | &mov($tmp1,$c); |
149 | &add($f,$e); # f+=ROTATE(a,5) | 289 | &add($f,$e); # f+=ROTATE(a,5) |
290 | &and($tmp1,$d); | ||
291 | &mov($e,&swtmp(($n+1)%16)); # pre-fetch f for next round | ||
292 | &add($f,$tmp1); # f+=c&d | ||
293 | } | ||
150 | } | 294 | } |
151 | 295 | ||
152 | &function_begin("sha1_block_data_order"); | 296 | &function_begin("sha1_block_data_order"); |
297 | if ($xmm) { | ||
298 | &static_label("ssse3_shortcut"); | ||
299 | &static_label("avx_shortcut") if ($ymm); | ||
300 | &static_label("K_XX_XX"); | ||
301 | |||
302 | &call (&label("pic_point")); # make it PIC! | ||
303 | &set_label("pic_point"); | ||
304 | &blindpop($tmp1); | ||
305 | &picmeup($T,"OPENSSL_ia32cap_P",$tmp1,&label("pic_point")); | ||
306 | &lea ($tmp1,&DWP(&label("K_XX_XX")."-".&label("pic_point"),$tmp1)); | ||
307 | |||
308 | &mov ($A,&DWP(0,$T)); | ||
309 | &mov ($D,&DWP(4,$T)); | ||
310 | &test ($D,1<<9); # check SSSE3 bit | ||
311 | &jz (&label("x86")); | ||
312 | &test ($A,1<<24); # check FXSR bit | ||
313 | &jz (&label("x86")); | ||
314 | if ($ymm) { | ||
315 | &and ($D,1<<28); # mask AVX bit | ||
316 | &and ($A,1<<30); # mask "Intel CPU" bit | ||
317 | &or ($A,$D); | ||
318 | &cmp ($A,1<<28|1<<30); | ||
319 | &je (&label("avx_shortcut")); | ||
320 | } | ||
321 | &jmp (&label("ssse3_shortcut")); | ||
322 | &set_label("x86",16); | ||
323 | } | ||
153 | &mov($tmp1,&wparam(0)); # SHA_CTX *c | 324 | &mov($tmp1,&wparam(0)); # SHA_CTX *c |
154 | &mov($T,&wparam(1)); # const void *input | 325 | &mov($T,&wparam(1)); # const void *input |
155 | &mov($A,&wparam(2)); # size_t num | 326 | &mov($A,&wparam(2)); # size_t num |
156 | &stack_push(16); # allocate X[16] | 327 | &stack_push(16+3); # allocate X[16] |
157 | &shl($A,6); | 328 | &shl($A,6); |
158 | &add($A,$T); | 329 | &add($A,$T); |
159 | &mov(&wparam(2),$A); # pointer beyond the end of input | 330 | &mov(&wparam(2),$A); # pointer beyond the end of input |
160 | &mov($E,&DWP(16,$tmp1));# pre-load E | 331 | &mov($E,&DWP(16,$tmp1));# pre-load E |
332 | &jmp(&label("loop")); | ||
161 | 333 | ||
162 | &set_label("loop",16); | 334 | &set_label("loop",16); |
163 | 335 | ||
164 | # copy input chunk to X, but reversing byte order! | 336 | # copy input chunk to X, but reversing byte order! |
165 | for ($i=0; $i<16; $i+=4) | 337 | for ($i=0; $i<16; $i+=4) |
@@ -213,8 +385,845 @@ sub BODY_40_59 | |||
213 | &mov(&DWP(16,$tmp1),$C); | 385 | &mov(&DWP(16,$tmp1),$C); |
214 | &jb(&label("loop")); | 386 | &jb(&label("loop")); |
215 | 387 | ||
216 | &stack_pop(16); | 388 | &stack_pop(16+3); |
217 | &function_end("sha1_block_data_order"); | 389 | &function_end("sha1_block_data_order"); |
390 | |||
391 | if ($xmm) { | ||
392 | ###################################################################### | ||
393 | # The SSSE3 implementation. | ||
394 | # | ||
395 | # %xmm[0-7] are used as ring @X[] buffer containing quadruples of last | ||
396 | # 32 elements of the message schedule or Xupdate outputs. First 4 | ||
397 | # quadruples are simply byte-swapped input, next 4 are calculated | ||
398 | # according to method originally suggested by Dean Gaudet (modulo | ||
399 | # being implemented in SSSE3). Once 8 quadruples or 32 elements are | ||
400 | # collected, it switches to routine proposed by Max Locktyukhin. | ||
401 | # | ||
402 | # Calculations inevitably require temporary reqisters, and there are | ||
403 | # no %xmm registers left to spare. For this reason part of the ring | ||
404 | # buffer, X[2..4] to be specific, is offloaded to 3 quadriples ring | ||
405 | # buffer on the stack. Keep in mind that X[2] is alias X[-6], X[3] - | ||
406 | # X[-5], and X[4] - X[-4]... | ||
407 | # | ||
408 | # Another notable optimization is aggressive stack frame compression | ||
409 | # aiming to minimize amount of 9-byte instructions... | ||
410 | # | ||
411 | # Yet another notable optimization is "jumping" $B variable. It means | ||
412 | # that there is no register permanently allocated for $B value. This | ||
413 | # allowed to eliminate one instruction from body_20_39... | ||
414 | # | ||
415 | my $Xi=4; # 4xSIMD Xupdate round, start pre-seeded | ||
416 | my @X=map("xmm$_",(4..7,0..3)); # pre-seeded for $Xi=4 | ||
417 | my @V=($A,$B,$C,$D,$E); | ||
418 | my $j=0; # hash round | ||
419 | my @T=($T,$tmp1); | ||
420 | my $inp; | ||
421 | |||
422 | my $_rol=sub { &rol(@_) }; | ||
423 | my $_ror=sub { &ror(@_) }; | ||
424 | |||
425 | &function_begin("_sha1_block_data_order_ssse3"); | ||
426 | &call (&label("pic_point")); # make it PIC! | ||
427 | &set_label("pic_point"); | ||
428 | &blindpop($tmp1); | ||
429 | &lea ($tmp1,&DWP(&label("K_XX_XX")."-".&label("pic_point"),$tmp1)); | ||
430 | &set_label("ssse3_shortcut"); | ||
431 | |||
432 | &movdqa (@X[3],&QWP(0,$tmp1)); # K_00_19 | ||
433 | &movdqa (@X[4],&QWP(16,$tmp1)); # K_20_39 | ||
434 | &movdqa (@X[5],&QWP(32,$tmp1)); # K_40_59 | ||
435 | &movdqa (@X[6],&QWP(48,$tmp1)); # K_60_79 | ||
436 | &movdqa (@X[2],&QWP(64,$tmp1)); # pbswap mask | ||
437 | |||
438 | &mov ($E,&wparam(0)); # load argument block | ||
439 | &mov ($inp=@T[1],&wparam(1)); | ||
440 | &mov ($D,&wparam(2)); | ||
441 | &mov (@T[0],"esp"); | ||
442 | |||
443 | # stack frame layout | ||
444 | # | ||
445 | # +0 X[0]+K X[1]+K X[2]+K X[3]+K # XMM->IALU xfer area | ||
446 | # X[4]+K X[5]+K X[6]+K X[7]+K | ||
447 | # X[8]+K X[9]+K X[10]+K X[11]+K | ||
448 | # X[12]+K X[13]+K X[14]+K X[15]+K | ||
449 | # | ||
450 | # +64 X[0] X[1] X[2] X[3] # XMM->XMM backtrace area | ||
451 | # X[4] X[5] X[6] X[7] | ||
452 | # X[8] X[9] X[10] X[11] # even borrowed for K_00_19 | ||
453 | # | ||
454 | # +112 K_20_39 K_20_39 K_20_39 K_20_39 # constants | ||
455 | # K_40_59 K_40_59 K_40_59 K_40_59 | ||
456 | # K_60_79 K_60_79 K_60_79 K_60_79 | ||
457 | # K_00_19 K_00_19 K_00_19 K_00_19 | ||
458 | # pbswap mask | ||
459 | # | ||
460 | # +192 ctx # argument block | ||
461 | # +196 inp | ||
462 | # +200 end | ||
463 | # +204 esp | ||
464 | &sub ("esp",208); | ||
465 | &and ("esp",-64); | ||
466 | |||
467 | &movdqa (&QWP(112+0,"esp"),@X[4]); # copy constants | ||
468 | &movdqa (&QWP(112+16,"esp"),@X[5]); | ||
469 | &movdqa (&QWP(112+32,"esp"),@X[6]); | ||
470 | &shl ($D,6); # len*64 | ||
471 | &movdqa (&QWP(112+48,"esp"),@X[3]); | ||
472 | &add ($D,$inp); # end of input | ||
473 | &movdqa (&QWP(112+64,"esp"),@X[2]); | ||
474 | &add ($inp,64); | ||
475 | &mov (&DWP(192+0,"esp"),$E); # save argument block | ||
476 | &mov (&DWP(192+4,"esp"),$inp); | ||
477 | &mov (&DWP(192+8,"esp"),$D); | ||
478 | &mov (&DWP(192+12,"esp"),@T[0]); # save original %esp | ||
479 | |||
480 | &mov ($A,&DWP(0,$E)); # load context | ||
481 | &mov ($B,&DWP(4,$E)); | ||
482 | &mov ($C,&DWP(8,$E)); | ||
483 | &mov ($D,&DWP(12,$E)); | ||
484 | &mov ($E,&DWP(16,$E)); | ||
485 | &mov (@T[0],$B); # magic seed | ||
486 | |||
487 | &movdqu (@X[-4&7],&QWP(-64,$inp)); # load input to %xmm[0-3] | ||
488 | &movdqu (@X[-3&7],&QWP(-48,$inp)); | ||
489 | &movdqu (@X[-2&7],&QWP(-32,$inp)); | ||
490 | &movdqu (@X[-1&7],&QWP(-16,$inp)); | ||
491 | &pshufb (@X[-4&7],@X[2]); # byte swap | ||
492 | &pshufb (@X[-3&7],@X[2]); | ||
493 | &pshufb (@X[-2&7],@X[2]); | ||
494 | &movdqa (&QWP(112-16,"esp"),@X[3]); # borrow last backtrace slot | ||
495 | &pshufb (@X[-1&7],@X[2]); | ||
496 | &paddd (@X[-4&7],@X[3]); # add K_00_19 | ||
497 | &paddd (@X[-3&7],@X[3]); | ||
498 | &paddd (@X[-2&7],@X[3]); | ||
499 | &movdqa (&QWP(0,"esp"),@X[-4&7]); # X[]+K xfer to IALU | ||
500 | &psubd (@X[-4&7],@X[3]); # restore X[] | ||
501 | &movdqa (&QWP(0+16,"esp"),@X[-3&7]); | ||
502 | &psubd (@X[-3&7],@X[3]); | ||
503 | &movdqa (&QWP(0+32,"esp"),@X[-2&7]); | ||
504 | &psubd (@X[-2&7],@X[3]); | ||
505 | &movdqa (@X[0],@X[-3&7]); | ||
506 | &jmp (&label("loop")); | ||
507 | |||
508 | ###################################################################### | ||
509 | # SSE instruction sequence is first broken to groups of indepentent | ||
510 | # instructions, independent in respect to their inputs and shifter | ||
511 | # (not all architectures have more than one). Then IALU instructions | ||
512 | # are "knitted in" between the SSE groups. Distance is maintained for | ||
513 | # SSE latency of 2 in hope that it fits better upcoming AMD Bulldozer | ||
514 | # [which allegedly also implements SSSE3]... | ||
515 | # | ||
516 | # Temporary registers usage. X[2] is volatile at the entry and at the | ||
517 | # end is restored from backtrace ring buffer. X[3] is expected to | ||
518 | # contain current K_XX_XX constant and is used to caclulate X[-1]+K | ||
519 | # from previous round, it becomes volatile the moment the value is | ||
520 | # saved to stack for transfer to IALU. X[4] becomes volatile whenever | ||
521 | # X[-4] is accumulated and offloaded to backtrace ring buffer, at the | ||
522 | # end it is loaded with next K_XX_XX [which becomes X[3] in next | ||
523 | # round]... | ||
524 | # | ||
525 | sub Xupdate_ssse3_16_31() # recall that $Xi starts wtih 4 | ||
526 | { use integer; | ||
527 | my $body = shift; | ||
528 | my @insns = (&$body,&$body,&$body,&$body); # 40 instructions | ||
529 | my ($a,$b,$c,$d,$e); | ||
530 | |||
531 | eval(shift(@insns)); | ||
532 | eval(shift(@insns)); | ||
533 | &palignr(@X[0],@X[-4&7],8); # compose "X[-14]" in "X[0]" | ||
534 | &movdqa (@X[2],@X[-1&7]); | ||
535 | eval(shift(@insns)); | ||
536 | eval(shift(@insns)); | ||
537 | |||
538 | &paddd (@X[3],@X[-1&7]); | ||
539 | &movdqa (&QWP(64+16*(($Xi-4)%3),"esp"),@X[-4&7]);# save X[] to backtrace buffer | ||
540 | eval(shift(@insns)); | ||
541 | eval(shift(@insns)); | ||
542 | &psrldq (@X[2],4); # "X[-3]", 3 dwords | ||
543 | eval(shift(@insns)); | ||
544 | eval(shift(@insns)); | ||
545 | &pxor (@X[0],@X[-4&7]); # "X[0]"^="X[-16]" | ||
546 | eval(shift(@insns)); | ||
547 | eval(shift(@insns)); | ||
548 | |||
549 | &pxor (@X[2],@X[-2&7]); # "X[-3]"^"X[-8]" | ||
550 | eval(shift(@insns)); | ||
551 | eval(shift(@insns)); | ||
552 | eval(shift(@insns)); | ||
553 | eval(shift(@insns)); | ||
554 | |||
555 | &pxor (@X[0],@X[2]); # "X[0]"^="X[-3]"^"X[-8]" | ||
556 | eval(shift(@insns)); | ||
557 | eval(shift(@insns)); | ||
558 | &movdqa (&QWP(0+16*(($Xi-1)&3),"esp"),@X[3]); # X[]+K xfer to IALU | ||
559 | eval(shift(@insns)); | ||
560 | eval(shift(@insns)); | ||
561 | |||
562 | &movdqa (@X[4],@X[0]); | ||
563 | &movdqa (@X[2],@X[0]); | ||
564 | eval(shift(@insns)); | ||
565 | eval(shift(@insns)); | ||
566 | eval(shift(@insns)); | ||
567 | eval(shift(@insns)); | ||
568 | |||
569 | &pslldq (@X[4],12); # "X[0]"<<96, extract one dword | ||
570 | &paddd (@X[0],@X[0]); | ||
571 | eval(shift(@insns)); | ||
572 | eval(shift(@insns)); | ||
573 | eval(shift(@insns)); | ||
574 | eval(shift(@insns)); | ||
575 | |||
576 | &psrld (@X[2],31); | ||
577 | eval(shift(@insns)); | ||
578 | eval(shift(@insns)); | ||
579 | &movdqa (@X[3],@X[4]); | ||
580 | eval(shift(@insns)); | ||
581 | eval(shift(@insns)); | ||
582 | |||
583 | &psrld (@X[4],30); | ||
584 | &por (@X[0],@X[2]); # "X[0]"<<<=1 | ||
585 | eval(shift(@insns)); | ||
586 | eval(shift(@insns)); | ||
587 | &movdqa (@X[2],&QWP(64+16*(($Xi-6)%3),"esp")) if ($Xi>5); # restore X[] from backtrace buffer | ||
588 | eval(shift(@insns)); | ||
589 | eval(shift(@insns)); | ||
590 | |||
591 | &pslld (@X[3],2); | ||
592 | &pxor (@X[0],@X[4]); | ||
593 | eval(shift(@insns)); | ||
594 | eval(shift(@insns)); | ||
595 | &movdqa (@X[4],&QWP(112-16+16*(($Xi)/5),"esp")); # K_XX_XX | ||
596 | eval(shift(@insns)); | ||
597 | eval(shift(@insns)); | ||
598 | |||
599 | &pxor (@X[0],@X[3]); # "X[0]"^=("X[0]"<<96)<<<2 | ||
600 | &movdqa (@X[1],@X[-2&7]) if ($Xi<7); | ||
601 | eval(shift(@insns)); | ||
602 | eval(shift(@insns)); | ||
603 | |||
604 | foreach (@insns) { eval; } # remaining instructions [if any] | ||
605 | |||
606 | $Xi++; push(@X,shift(@X)); # "rotate" X[] | ||
607 | } | ||
608 | |||
609 | sub Xupdate_ssse3_32_79() | ||
610 | { use integer; | ||
611 | my $body = shift; | ||
612 | my @insns = (&$body,&$body,&$body,&$body); # 32 to 48 instructions | ||
613 | my ($a,$b,$c,$d,$e); | ||
614 | |||
615 | &movdqa (@X[2],@X[-1&7]) if ($Xi==8); | ||
616 | eval(shift(@insns)); # body_20_39 | ||
617 | &pxor (@X[0],@X[-4&7]); # "X[0]"="X[-32]"^"X[-16]" | ||
618 | &palignr(@X[2],@X[-2&7],8); # compose "X[-6]" | ||
619 | eval(shift(@insns)); | ||
620 | eval(shift(@insns)); | ||
621 | eval(shift(@insns)); # rol | ||
622 | |||
623 | &pxor (@X[0],@X[-7&7]); # "X[0]"^="X[-28]" | ||
624 | &movdqa (&QWP(64+16*(($Xi-4)%3),"esp"),@X[-4&7]); # save X[] to backtrace buffer | ||
625 | eval(shift(@insns)); | ||
626 | eval(shift(@insns)); | ||
627 | if ($Xi%5) { | ||
628 | &movdqa (@X[4],@X[3]); # "perpetuate" K_XX_XX... | ||
629 | } else { # ... or load next one | ||
630 | &movdqa (@X[4],&QWP(112-16+16*($Xi/5),"esp")); | ||
631 | } | ||
632 | &paddd (@X[3],@X[-1&7]); | ||
633 | eval(shift(@insns)); # ror | ||
634 | eval(shift(@insns)); | ||
635 | |||
636 | &pxor (@X[0],@X[2]); # "X[0]"^="X[-6]" | ||
637 | eval(shift(@insns)); # body_20_39 | ||
638 | eval(shift(@insns)); | ||
639 | eval(shift(@insns)); | ||
640 | eval(shift(@insns)); # rol | ||
641 | |||
642 | &movdqa (@X[2],@X[0]); | ||
643 | &movdqa (&QWP(0+16*(($Xi-1)&3),"esp"),@X[3]); # X[]+K xfer to IALU | ||
644 | eval(shift(@insns)); | ||
645 | eval(shift(@insns)); | ||
646 | eval(shift(@insns)); # ror | ||
647 | eval(shift(@insns)); | ||
648 | |||
649 | &pslld (@X[0],2); | ||
650 | eval(shift(@insns)); # body_20_39 | ||
651 | eval(shift(@insns)); | ||
652 | &psrld (@X[2],30); | ||
653 | eval(shift(@insns)); | ||
654 | eval(shift(@insns)); # rol | ||
655 | eval(shift(@insns)); | ||
656 | eval(shift(@insns)); | ||
657 | eval(shift(@insns)); # ror | ||
658 | eval(shift(@insns)); | ||
659 | |||
660 | &por (@X[0],@X[2]); # "X[0]"<<<=2 | ||
661 | eval(shift(@insns)); # body_20_39 | ||
662 | eval(shift(@insns)); | ||
663 | &movdqa (@X[2],&QWP(64+16*(($Xi-6)%3),"esp")) if($Xi<19); # restore X[] from backtrace buffer | ||
664 | eval(shift(@insns)); | ||
665 | eval(shift(@insns)); # rol | ||
666 | eval(shift(@insns)); | ||
667 | eval(shift(@insns)); | ||
668 | eval(shift(@insns)); # ror | ||
669 | &movdqa (@X[3],@X[0]) if ($Xi<19); | ||
670 | eval(shift(@insns)); | ||
671 | |||
672 | foreach (@insns) { eval; } # remaining instructions | ||
673 | |||
674 | $Xi++; push(@X,shift(@X)); # "rotate" X[] | ||
675 | } | ||
676 | |||
677 | sub Xuplast_ssse3_80() | ||
678 | { use integer; | ||
679 | my $body = shift; | ||
680 | my @insns = (&$body,&$body,&$body,&$body); # 32 instructions | ||
681 | my ($a,$b,$c,$d,$e); | ||
682 | |||
683 | eval(shift(@insns)); | ||
684 | &paddd (@X[3],@X[-1&7]); | ||
685 | eval(shift(@insns)); | ||
686 | eval(shift(@insns)); | ||
687 | eval(shift(@insns)); | ||
688 | eval(shift(@insns)); | ||
689 | |||
690 | &movdqa (&QWP(0+16*(($Xi-1)&3),"esp"),@X[3]); # X[]+K xfer IALU | ||
691 | |||
692 | foreach (@insns) { eval; } # remaining instructions | ||
693 | |||
694 | &mov ($inp=@T[1],&DWP(192+4,"esp")); | ||
695 | &cmp ($inp,&DWP(192+8,"esp")); | ||
696 | &je (&label("done")); | ||
697 | |||
698 | &movdqa (@X[3],&QWP(112+48,"esp")); # K_00_19 | ||
699 | &movdqa (@X[2],&QWP(112+64,"esp")); # pbswap mask | ||
700 | &movdqu (@X[-4&7],&QWP(0,$inp)); # load input | ||
701 | &movdqu (@X[-3&7],&QWP(16,$inp)); | ||
702 | &movdqu (@X[-2&7],&QWP(32,$inp)); | ||
703 | &movdqu (@X[-1&7],&QWP(48,$inp)); | ||
704 | &add ($inp,64); | ||
705 | &pshufb (@X[-4&7],@X[2]); # byte swap | ||
706 | &mov (&DWP(192+4,"esp"),$inp); | ||
707 | &movdqa (&QWP(112-16,"esp"),@X[3]); # borrow last backtrace slot | ||
708 | |||
709 | $Xi=0; | ||
710 | } | ||
711 | |||
712 | sub Xloop_ssse3() | ||
713 | { use integer; | ||
714 | my $body = shift; | ||
715 | my @insns = (&$body,&$body,&$body,&$body); # 32 instructions | ||
716 | my ($a,$b,$c,$d,$e); | ||
717 | |||
718 | eval(shift(@insns)); | ||
719 | eval(shift(@insns)); | ||
720 | &pshufb (@X[($Xi-3)&7],@X[2]); | ||
721 | eval(shift(@insns)); | ||
722 | eval(shift(@insns)); | ||
723 | &paddd (@X[($Xi-4)&7],@X[3]); | ||
724 | eval(shift(@insns)); | ||
725 | eval(shift(@insns)); | ||
726 | eval(shift(@insns)); | ||
727 | eval(shift(@insns)); | ||
728 | &movdqa (&QWP(0+16*$Xi,"esp"),@X[($Xi-4)&7]); # X[]+K xfer to IALU | ||
729 | eval(shift(@insns)); | ||
730 | eval(shift(@insns)); | ||
731 | &psubd (@X[($Xi-4)&7],@X[3]); | ||
732 | |||
733 | foreach (@insns) { eval; } | ||
734 | $Xi++; | ||
735 | } | ||
736 | |||
737 | sub Xtail_ssse3() | ||
738 | { use integer; | ||
739 | my $body = shift; | ||
740 | my @insns = (&$body,&$body,&$body,&$body); # 32 instructions | ||
741 | my ($a,$b,$c,$d,$e); | ||
742 | |||
743 | foreach (@insns) { eval; } | ||
744 | } | ||
745 | |||
746 | sub body_00_19 () { | ||
747 | ( | ||
748 | '($a,$b,$c,$d,$e)=@V;'. | ||
749 | '&add ($e,&DWP(4*($j&15),"esp"));', # X[]+K xfer | ||
750 | '&xor ($c,$d);', | ||
751 | '&mov (@T[1],$a);', # $b in next round | ||
752 | '&$_rol ($a,5);', | ||
753 | '&and (@T[0],$c);', # ($b&($c^$d)) | ||
754 | '&xor ($c,$d);', # restore $c | ||
755 | '&xor (@T[0],$d);', | ||
756 | '&add ($e,$a);', | ||
757 | '&$_ror ($b,$j?7:2);', # $b>>>2 | ||
758 | '&add ($e,@T[0]);' .'$j++; unshift(@V,pop(@V)); unshift(@T,pop(@T));' | ||
759 | ); | ||
760 | } | ||
761 | |||
762 | sub body_20_39 () { | ||
763 | ( | ||
764 | '($a,$b,$c,$d,$e)=@V;'. | ||
765 | '&add ($e,&DWP(4*($j++&15),"esp"));', # X[]+K xfer | ||
766 | '&xor (@T[0],$d);', # ($b^$d) | ||
767 | '&mov (@T[1],$a);', # $b in next round | ||
768 | '&$_rol ($a,5);', | ||
769 | '&xor (@T[0],$c);', # ($b^$d^$c) | ||
770 | '&add ($e,$a);', | ||
771 | '&$_ror ($b,7);', # $b>>>2 | ||
772 | '&add ($e,@T[0]);' .'unshift(@V,pop(@V)); unshift(@T,pop(@T));' | ||
773 | ); | ||
774 | } | ||
775 | |||
776 | sub body_40_59 () { | ||
777 | ( | ||
778 | '($a,$b,$c,$d,$e)=@V;'. | ||
779 | '&mov (@T[1],$c);', | ||
780 | '&xor ($c,$d);', | ||
781 | '&add ($e,&DWP(4*($j++&15),"esp"));', # X[]+K xfer | ||
782 | '&and (@T[1],$d);', | ||
783 | '&and (@T[0],$c);', # ($b&($c^$d)) | ||
784 | '&$_ror ($b,7);', # $b>>>2 | ||
785 | '&add ($e,@T[1]);', | ||
786 | '&mov (@T[1],$a);', # $b in next round | ||
787 | '&$_rol ($a,5);', | ||
788 | '&add ($e,@T[0]);', | ||
789 | '&xor ($c,$d);', # restore $c | ||
790 | '&add ($e,$a);' .'unshift(@V,pop(@V)); unshift(@T,pop(@T));' | ||
791 | ); | ||
792 | } | ||
793 | |||
794 | &set_label("loop",16); | ||
795 | &Xupdate_ssse3_16_31(\&body_00_19); | ||
796 | &Xupdate_ssse3_16_31(\&body_00_19); | ||
797 | &Xupdate_ssse3_16_31(\&body_00_19); | ||
798 | &Xupdate_ssse3_16_31(\&body_00_19); | ||
799 | &Xupdate_ssse3_32_79(\&body_00_19); | ||
800 | &Xupdate_ssse3_32_79(\&body_20_39); | ||
801 | &Xupdate_ssse3_32_79(\&body_20_39); | ||
802 | &Xupdate_ssse3_32_79(\&body_20_39); | ||
803 | &Xupdate_ssse3_32_79(\&body_20_39); | ||
804 | &Xupdate_ssse3_32_79(\&body_20_39); | ||
805 | &Xupdate_ssse3_32_79(\&body_40_59); | ||
806 | &Xupdate_ssse3_32_79(\&body_40_59); | ||
807 | &Xupdate_ssse3_32_79(\&body_40_59); | ||
808 | &Xupdate_ssse3_32_79(\&body_40_59); | ||
809 | &Xupdate_ssse3_32_79(\&body_40_59); | ||
810 | &Xupdate_ssse3_32_79(\&body_20_39); | ||
811 | &Xuplast_ssse3_80(\&body_20_39); # can jump to "done" | ||
812 | |||
813 | $saved_j=$j; @saved_V=@V; | ||
814 | |||
815 | &Xloop_ssse3(\&body_20_39); | ||
816 | &Xloop_ssse3(\&body_20_39); | ||
817 | &Xloop_ssse3(\&body_20_39); | ||
818 | |||
819 | &mov (@T[1],&DWP(192,"esp")); # update context | ||
820 | &add ($A,&DWP(0,@T[1])); | ||
821 | &add (@T[0],&DWP(4,@T[1])); # $b | ||
822 | &add ($C,&DWP(8,@T[1])); | ||
823 | &mov (&DWP(0,@T[1]),$A); | ||
824 | &add ($D,&DWP(12,@T[1])); | ||
825 | &mov (&DWP(4,@T[1]),@T[0]); | ||
826 | &add ($E,&DWP(16,@T[1])); | ||
827 | &mov (&DWP(8,@T[1]),$C); | ||
828 | &mov ($B,@T[0]); | ||
829 | &mov (&DWP(12,@T[1]),$D); | ||
830 | &mov (&DWP(16,@T[1]),$E); | ||
831 | &movdqa (@X[0],@X[-3&7]); | ||
832 | |||
833 | &jmp (&label("loop")); | ||
834 | |||
835 | &set_label("done",16); $j=$saved_j; @V=@saved_V; | ||
836 | |||
837 | &Xtail_ssse3(\&body_20_39); | ||
838 | &Xtail_ssse3(\&body_20_39); | ||
839 | &Xtail_ssse3(\&body_20_39); | ||
840 | |||
841 | &mov (@T[1],&DWP(192,"esp")); # update context | ||
842 | &add ($A,&DWP(0,@T[1])); | ||
843 | &mov ("esp",&DWP(192+12,"esp")); # restore %esp | ||
844 | &add (@T[0],&DWP(4,@T[1])); # $b | ||
845 | &add ($C,&DWP(8,@T[1])); | ||
846 | &mov (&DWP(0,@T[1]),$A); | ||
847 | &add ($D,&DWP(12,@T[1])); | ||
848 | &mov (&DWP(4,@T[1]),@T[0]); | ||
849 | &add ($E,&DWP(16,@T[1])); | ||
850 | &mov (&DWP(8,@T[1]),$C); | ||
851 | &mov (&DWP(12,@T[1]),$D); | ||
852 | &mov (&DWP(16,@T[1]),$E); | ||
853 | |||
854 | &function_end("_sha1_block_data_order_ssse3"); | ||
855 | |||
856 | if ($ymm) { | ||
857 | my $Xi=4; # 4xSIMD Xupdate round, start pre-seeded | ||
858 | my @X=map("xmm$_",(4..7,0..3)); # pre-seeded for $Xi=4 | ||
859 | my @V=($A,$B,$C,$D,$E); | ||
860 | my $j=0; # hash round | ||
861 | my @T=($T,$tmp1); | ||
862 | my $inp; | ||
863 | |||
864 | my $_rol=sub { &shld(@_[0],@_) }; | ||
865 | my $_ror=sub { &shrd(@_[0],@_) }; | ||
866 | |||
867 | &function_begin("_sha1_block_data_order_avx"); | ||
868 | &call (&label("pic_point")); # make it PIC! | ||
869 | &set_label("pic_point"); | ||
870 | &blindpop($tmp1); | ||
871 | &lea ($tmp1,&DWP(&label("K_XX_XX")."-".&label("pic_point"),$tmp1)); | ||
872 | &set_label("avx_shortcut"); | ||
873 | &vzeroall(); | ||
874 | |||
875 | &vmovdqa(@X[3],&QWP(0,$tmp1)); # K_00_19 | ||
876 | &vmovdqa(@X[4],&QWP(16,$tmp1)); # K_20_39 | ||
877 | &vmovdqa(@X[5],&QWP(32,$tmp1)); # K_40_59 | ||
878 | &vmovdqa(@X[6],&QWP(48,$tmp1)); # K_60_79 | ||
879 | &vmovdqa(@X[2],&QWP(64,$tmp1)); # pbswap mask | ||
880 | |||
881 | &mov ($E,&wparam(0)); # load argument block | ||
882 | &mov ($inp=@T[1],&wparam(1)); | ||
883 | &mov ($D,&wparam(2)); | ||
884 | &mov (@T[0],"esp"); | ||
885 | |||
886 | # stack frame layout | ||
887 | # | ||
888 | # +0 X[0]+K X[1]+K X[2]+K X[3]+K # XMM->IALU xfer area | ||
889 | # X[4]+K X[5]+K X[6]+K X[7]+K | ||
890 | # X[8]+K X[9]+K X[10]+K X[11]+K | ||
891 | # X[12]+K X[13]+K X[14]+K X[15]+K | ||
892 | # | ||
893 | # +64 X[0] X[1] X[2] X[3] # XMM->XMM backtrace area | ||
894 | # X[4] X[5] X[6] X[7] | ||
895 | # X[8] X[9] X[10] X[11] # even borrowed for K_00_19 | ||
896 | # | ||
897 | # +112 K_20_39 K_20_39 K_20_39 K_20_39 # constants | ||
898 | # K_40_59 K_40_59 K_40_59 K_40_59 | ||
899 | # K_60_79 K_60_79 K_60_79 K_60_79 | ||
900 | # K_00_19 K_00_19 K_00_19 K_00_19 | ||
901 | # pbswap mask | ||
902 | # | ||
903 | # +192 ctx # argument block | ||
904 | # +196 inp | ||
905 | # +200 end | ||
906 | # +204 esp | ||
907 | &sub ("esp",208); | ||
908 | &and ("esp",-64); | ||
909 | |||
910 | &vmovdqa(&QWP(112+0,"esp"),@X[4]); # copy constants | ||
911 | &vmovdqa(&QWP(112+16,"esp"),@X[5]); | ||
912 | &vmovdqa(&QWP(112+32,"esp"),@X[6]); | ||
913 | &shl ($D,6); # len*64 | ||
914 | &vmovdqa(&QWP(112+48,"esp"),@X[3]); | ||
915 | &add ($D,$inp); # end of input | ||
916 | &vmovdqa(&QWP(112+64,"esp"),@X[2]); | ||
917 | &add ($inp,64); | ||
918 | &mov (&DWP(192+0,"esp"),$E); # save argument block | ||
919 | &mov (&DWP(192+4,"esp"),$inp); | ||
920 | &mov (&DWP(192+8,"esp"),$D); | ||
921 | &mov (&DWP(192+12,"esp"),@T[0]); # save original %esp | ||
922 | |||
923 | &mov ($A,&DWP(0,$E)); # load context | ||
924 | &mov ($B,&DWP(4,$E)); | ||
925 | &mov ($C,&DWP(8,$E)); | ||
926 | &mov ($D,&DWP(12,$E)); | ||
927 | &mov ($E,&DWP(16,$E)); | ||
928 | &mov (@T[0],$B); # magic seed | ||
929 | |||
930 | &vmovdqu(@X[-4&7],&QWP(-64,$inp)); # load input to %xmm[0-3] | ||
931 | &vmovdqu(@X[-3&7],&QWP(-48,$inp)); | ||
932 | &vmovdqu(@X[-2&7],&QWP(-32,$inp)); | ||
933 | &vmovdqu(@X[-1&7],&QWP(-16,$inp)); | ||
934 | &vpshufb(@X[-4&7],@X[-4&7],@X[2]); # byte swap | ||
935 | &vpshufb(@X[-3&7],@X[-3&7],@X[2]); | ||
936 | &vpshufb(@X[-2&7],@X[-2&7],@X[2]); | ||
937 | &vmovdqa(&QWP(112-16,"esp"),@X[3]); # borrow last backtrace slot | ||
938 | &vpshufb(@X[-1&7],@X[-1&7],@X[2]); | ||
939 | &vpaddd (@X[0],@X[-4&7],@X[3]); # add K_00_19 | ||
940 | &vpaddd (@X[1],@X[-3&7],@X[3]); | ||
941 | &vpaddd (@X[2],@X[-2&7],@X[3]); | ||
942 | &vmovdqa(&QWP(0,"esp"),@X[0]); # X[]+K xfer to IALU | ||
943 | &vmovdqa(&QWP(0+16,"esp"),@X[1]); | ||
944 | &vmovdqa(&QWP(0+32,"esp"),@X[2]); | ||
945 | &jmp (&label("loop")); | ||
946 | |||
947 | sub Xupdate_avx_16_31() # recall that $Xi starts wtih 4 | ||
948 | { use integer; | ||
949 | my $body = shift; | ||
950 | my @insns = (&$body,&$body,&$body,&$body); # 40 instructions | ||
951 | my ($a,$b,$c,$d,$e); | ||
952 | |||
953 | eval(shift(@insns)); | ||
954 | eval(shift(@insns)); | ||
955 | &vpalignr(@X[0],@X[-3&7],@X[-4&7],8); # compose "X[-14]" in "X[0]" | ||
956 | eval(shift(@insns)); | ||
957 | eval(shift(@insns)); | ||
958 | |||
959 | &vpaddd (@X[3],@X[3],@X[-1&7]); | ||
960 | &vmovdqa (&QWP(64+16*(($Xi-4)%3),"esp"),@X[-4&7]);# save X[] to backtrace buffer | ||
961 | eval(shift(@insns)); | ||
962 | eval(shift(@insns)); | ||
963 | &vpsrldq(@X[2],@X[-1&7],4); # "X[-3]", 3 dwords | ||
964 | eval(shift(@insns)); | ||
965 | eval(shift(@insns)); | ||
966 | &vpxor (@X[0],@X[0],@X[-4&7]); # "X[0]"^="X[-16]" | ||
967 | eval(shift(@insns)); | ||
968 | eval(shift(@insns)); | ||
969 | |||
970 | &vpxor (@X[2],@X[2],@X[-2&7]); # "X[-3]"^"X[-8]" | ||
971 | eval(shift(@insns)); | ||
972 | eval(shift(@insns)); | ||
973 | &vmovdqa (&QWP(0+16*(($Xi-1)&3),"esp"),@X[3]); # X[]+K xfer to IALU | ||
974 | eval(shift(@insns)); | ||
975 | eval(shift(@insns)); | ||
976 | |||
977 | &vpxor (@X[0],@X[0],@X[2]); # "X[0]"^="X[-3]"^"X[-8]" | ||
978 | eval(shift(@insns)); | ||
979 | eval(shift(@insns)); | ||
980 | eval(shift(@insns)); | ||
981 | eval(shift(@insns)); | ||
982 | |||
983 | &vpsrld (@X[2],@X[0],31); | ||
984 | eval(shift(@insns)); | ||
985 | eval(shift(@insns)); | ||
986 | eval(shift(@insns)); | ||
987 | eval(shift(@insns)); | ||
988 | |||
989 | &vpslldq(@X[4],@X[0],12); # "X[0]"<<96, extract one dword | ||
990 | &vpaddd (@X[0],@X[0],@X[0]); | ||
991 | eval(shift(@insns)); | ||
992 | eval(shift(@insns)); | ||
993 | eval(shift(@insns)); | ||
994 | eval(shift(@insns)); | ||
995 | |||
996 | &vpsrld (@X[3],@X[4],30); | ||
997 | &vpor (@X[0],@X[0],@X[2]); # "X[0]"<<<=1 | ||
998 | eval(shift(@insns)); | ||
999 | eval(shift(@insns)); | ||
1000 | eval(shift(@insns)); | ||
1001 | eval(shift(@insns)); | ||
1002 | |||
1003 | &vpslld (@X[4],@X[4],2); | ||
1004 | &vmovdqa (@X[2],&QWP(64+16*(($Xi-6)%3),"esp")) if ($Xi>5); # restore X[] from backtrace buffer | ||
1005 | eval(shift(@insns)); | ||
1006 | eval(shift(@insns)); | ||
1007 | &vpxor (@X[0],@X[0],@X[3]); | ||
1008 | eval(shift(@insns)); | ||
1009 | eval(shift(@insns)); | ||
1010 | eval(shift(@insns)); | ||
1011 | eval(shift(@insns)); | ||
1012 | |||
1013 | &vpxor (@X[0],@X[0],@X[4]); # "X[0]"^=("X[0]"<<96)<<<2 | ||
1014 | eval(shift(@insns)); | ||
1015 | eval(shift(@insns)); | ||
1016 | &vmovdqa (@X[4],&QWP(112-16+16*(($Xi)/5),"esp")); # K_XX_XX | ||
1017 | eval(shift(@insns)); | ||
1018 | eval(shift(@insns)); | ||
1019 | |||
1020 | foreach (@insns) { eval; } # remaining instructions [if any] | ||
1021 | |||
1022 | $Xi++; push(@X,shift(@X)); # "rotate" X[] | ||
1023 | } | ||
1024 | |||
1025 | sub Xupdate_avx_32_79() | ||
1026 | { use integer; | ||
1027 | my $body = shift; | ||
1028 | my @insns = (&$body,&$body,&$body,&$body); # 32 to 48 instructions | ||
1029 | my ($a,$b,$c,$d,$e); | ||
1030 | |||
1031 | &vpalignr(@X[2],@X[-1&7],@X[-2&7],8); # compose "X[-6]" | ||
1032 | &vpxor (@X[0],@X[0],@X[-4&7]); # "X[0]"="X[-32]"^"X[-16]" | ||
1033 | eval(shift(@insns)); # body_20_39 | ||
1034 | eval(shift(@insns)); | ||
1035 | eval(shift(@insns)); | ||
1036 | eval(shift(@insns)); # rol | ||
1037 | |||
1038 | &vpxor (@X[0],@X[0],@X[-7&7]); # "X[0]"^="X[-28]" | ||
1039 | &vmovdqa (&QWP(64+16*(($Xi-4)%3),"esp"),@X[-4&7]); # save X[] to backtrace buffer | ||
1040 | eval(shift(@insns)); | ||
1041 | eval(shift(@insns)); | ||
1042 | if ($Xi%5) { | ||
1043 | &vmovdqa (@X[4],@X[3]); # "perpetuate" K_XX_XX... | ||
1044 | } else { # ... or load next one | ||
1045 | &vmovdqa (@X[4],&QWP(112-16+16*($Xi/5),"esp")); | ||
1046 | } | ||
1047 | &vpaddd (@X[3],@X[3],@X[-1&7]); | ||
1048 | eval(shift(@insns)); # ror | ||
1049 | eval(shift(@insns)); | ||
1050 | |||
1051 | &vpxor (@X[0],@X[0],@X[2]); # "X[0]"^="X[-6]" | ||
1052 | eval(shift(@insns)); # body_20_39 | ||
1053 | eval(shift(@insns)); | ||
1054 | eval(shift(@insns)); | ||
1055 | eval(shift(@insns)); # rol | ||
1056 | |||
1057 | &vpsrld (@X[2],@X[0],30); | ||
1058 | &vmovdqa (&QWP(0+16*(($Xi-1)&3),"esp"),@X[3]); # X[]+K xfer to IALU | ||
1059 | eval(shift(@insns)); | ||
1060 | eval(shift(@insns)); | ||
1061 | eval(shift(@insns)); # ror | ||
1062 | eval(shift(@insns)); | ||
1063 | |||
1064 | &vpslld (@X[0],@X[0],2); | ||
1065 | eval(shift(@insns)); # body_20_39 | ||
1066 | eval(shift(@insns)); | ||
1067 | eval(shift(@insns)); | ||
1068 | eval(shift(@insns)); # rol | ||
1069 | eval(shift(@insns)); | ||
1070 | eval(shift(@insns)); | ||
1071 | eval(shift(@insns)); # ror | ||
1072 | eval(shift(@insns)); | ||
1073 | |||
1074 | &vpor (@X[0],@X[0],@X[2]); # "X[0]"<<<=2 | ||
1075 | eval(shift(@insns)); # body_20_39 | ||
1076 | eval(shift(@insns)); | ||
1077 | &vmovdqa (@X[2],&QWP(64+16*(($Xi-6)%3),"esp")) if($Xi<19); # restore X[] from backtrace buffer | ||
1078 | eval(shift(@insns)); | ||
1079 | eval(shift(@insns)); # rol | ||
1080 | eval(shift(@insns)); | ||
1081 | eval(shift(@insns)); | ||
1082 | eval(shift(@insns)); # ror | ||
1083 | eval(shift(@insns)); | ||
1084 | |||
1085 | foreach (@insns) { eval; } # remaining instructions | ||
1086 | |||
1087 | $Xi++; push(@X,shift(@X)); # "rotate" X[] | ||
1088 | } | ||
1089 | |||
1090 | sub Xuplast_avx_80() | ||
1091 | { use integer; | ||
1092 | my $body = shift; | ||
1093 | my @insns = (&$body,&$body,&$body,&$body); # 32 instructions | ||
1094 | my ($a,$b,$c,$d,$e); | ||
1095 | |||
1096 | eval(shift(@insns)); | ||
1097 | &vpaddd (@X[3],@X[3],@X[-1&7]); | ||
1098 | eval(shift(@insns)); | ||
1099 | eval(shift(@insns)); | ||
1100 | eval(shift(@insns)); | ||
1101 | eval(shift(@insns)); | ||
1102 | |||
1103 | &vmovdqa (&QWP(0+16*(($Xi-1)&3),"esp"),@X[3]); # X[]+K xfer IALU | ||
1104 | |||
1105 | foreach (@insns) { eval; } # remaining instructions | ||
1106 | |||
1107 | &mov ($inp=@T[1],&DWP(192+4,"esp")); | ||
1108 | &cmp ($inp,&DWP(192+8,"esp")); | ||
1109 | &je (&label("done")); | ||
1110 | |||
1111 | &vmovdqa(@X[3],&QWP(112+48,"esp")); # K_00_19 | ||
1112 | &vmovdqa(@X[2],&QWP(112+64,"esp")); # pbswap mask | ||
1113 | &vmovdqu(@X[-4&7],&QWP(0,$inp)); # load input | ||
1114 | &vmovdqu(@X[-3&7],&QWP(16,$inp)); | ||
1115 | &vmovdqu(@X[-2&7],&QWP(32,$inp)); | ||
1116 | &vmovdqu(@X[-1&7],&QWP(48,$inp)); | ||
1117 | &add ($inp,64); | ||
1118 | &vpshufb(@X[-4&7],@X[-4&7],@X[2]); # byte swap | ||
1119 | &mov (&DWP(192+4,"esp"),$inp); | ||
1120 | &vmovdqa(&QWP(112-16,"esp"),@X[3]); # borrow last backtrace slot | ||
1121 | |||
1122 | $Xi=0; | ||
1123 | } | ||
1124 | |||
1125 | sub Xloop_avx() | ||
1126 | { use integer; | ||
1127 | my $body = shift; | ||
1128 | my @insns = (&$body,&$body,&$body,&$body); # 32 instructions | ||
1129 | my ($a,$b,$c,$d,$e); | ||
1130 | |||
1131 | eval(shift(@insns)); | ||
1132 | eval(shift(@insns)); | ||
1133 | &vpshufb (@X[($Xi-3)&7],@X[($Xi-3)&7],@X[2]); | ||
1134 | eval(shift(@insns)); | ||
1135 | eval(shift(@insns)); | ||
1136 | &vpaddd (@X[$Xi&7],@X[($Xi-4)&7],@X[3]); | ||
1137 | eval(shift(@insns)); | ||
1138 | eval(shift(@insns)); | ||
1139 | eval(shift(@insns)); | ||
1140 | eval(shift(@insns)); | ||
1141 | &vmovdqa (&QWP(0+16*$Xi,"esp"),@X[$Xi&7]); # X[]+K xfer to IALU | ||
1142 | eval(shift(@insns)); | ||
1143 | eval(shift(@insns)); | ||
1144 | |||
1145 | foreach (@insns) { eval; } | ||
1146 | $Xi++; | ||
1147 | } | ||
1148 | |||
1149 | sub Xtail_avx() | ||
1150 | { use integer; | ||
1151 | my $body = shift; | ||
1152 | my @insns = (&$body,&$body,&$body,&$body); # 32 instructions | ||
1153 | my ($a,$b,$c,$d,$e); | ||
1154 | |||
1155 | foreach (@insns) { eval; } | ||
1156 | } | ||
1157 | |||
1158 | &set_label("loop",16); | ||
1159 | &Xupdate_avx_16_31(\&body_00_19); | ||
1160 | &Xupdate_avx_16_31(\&body_00_19); | ||
1161 | &Xupdate_avx_16_31(\&body_00_19); | ||
1162 | &Xupdate_avx_16_31(\&body_00_19); | ||
1163 | &Xupdate_avx_32_79(\&body_00_19); | ||
1164 | &Xupdate_avx_32_79(\&body_20_39); | ||
1165 | &Xupdate_avx_32_79(\&body_20_39); | ||
1166 | &Xupdate_avx_32_79(\&body_20_39); | ||
1167 | &Xupdate_avx_32_79(\&body_20_39); | ||
1168 | &Xupdate_avx_32_79(\&body_20_39); | ||
1169 | &Xupdate_avx_32_79(\&body_40_59); | ||
1170 | &Xupdate_avx_32_79(\&body_40_59); | ||
1171 | &Xupdate_avx_32_79(\&body_40_59); | ||
1172 | &Xupdate_avx_32_79(\&body_40_59); | ||
1173 | &Xupdate_avx_32_79(\&body_40_59); | ||
1174 | &Xupdate_avx_32_79(\&body_20_39); | ||
1175 | &Xuplast_avx_80(\&body_20_39); # can jump to "done" | ||
1176 | |||
1177 | $saved_j=$j; @saved_V=@V; | ||
1178 | |||
1179 | &Xloop_avx(\&body_20_39); | ||
1180 | &Xloop_avx(\&body_20_39); | ||
1181 | &Xloop_avx(\&body_20_39); | ||
1182 | |||
1183 | &mov (@T[1],&DWP(192,"esp")); # update context | ||
1184 | &add ($A,&DWP(0,@T[1])); | ||
1185 | &add (@T[0],&DWP(4,@T[1])); # $b | ||
1186 | &add ($C,&DWP(8,@T[1])); | ||
1187 | &mov (&DWP(0,@T[1]),$A); | ||
1188 | &add ($D,&DWP(12,@T[1])); | ||
1189 | &mov (&DWP(4,@T[1]),@T[0]); | ||
1190 | &add ($E,&DWP(16,@T[1])); | ||
1191 | &mov (&DWP(8,@T[1]),$C); | ||
1192 | &mov ($B,@T[0]); | ||
1193 | &mov (&DWP(12,@T[1]),$D); | ||
1194 | &mov (&DWP(16,@T[1]),$E); | ||
1195 | |||
1196 | &jmp (&label("loop")); | ||
1197 | |||
1198 | &set_label("done",16); $j=$saved_j; @V=@saved_V; | ||
1199 | |||
1200 | &Xtail_avx(\&body_20_39); | ||
1201 | &Xtail_avx(\&body_20_39); | ||
1202 | &Xtail_avx(\&body_20_39); | ||
1203 | |||
1204 | &vzeroall(); | ||
1205 | |||
1206 | &mov (@T[1],&DWP(192,"esp")); # update context | ||
1207 | &add ($A,&DWP(0,@T[1])); | ||
1208 | &mov ("esp",&DWP(192+12,"esp")); # restore %esp | ||
1209 | &add (@T[0],&DWP(4,@T[1])); # $b | ||
1210 | &add ($C,&DWP(8,@T[1])); | ||
1211 | &mov (&DWP(0,@T[1]),$A); | ||
1212 | &add ($D,&DWP(12,@T[1])); | ||
1213 | &mov (&DWP(4,@T[1]),@T[0]); | ||
1214 | &add ($E,&DWP(16,@T[1])); | ||
1215 | &mov (&DWP(8,@T[1]),$C); | ||
1216 | &mov (&DWP(12,@T[1]),$D); | ||
1217 | &mov (&DWP(16,@T[1]),$E); | ||
1218 | &function_end("_sha1_block_data_order_avx"); | ||
1219 | } | ||
1220 | &set_label("K_XX_XX",64); | ||
1221 | &data_word(0x5a827999,0x5a827999,0x5a827999,0x5a827999); # K_00_19 | ||
1222 | &data_word(0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1); # K_20_39 | ||
1223 | &data_word(0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc); # K_40_59 | ||
1224 | &data_word(0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6); # K_60_79 | ||
1225 | &data_word(0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f); # pbswap mask | ||
1226 | } | ||
218 | &asciz("SHA1 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>"); | 1227 | &asciz("SHA1 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>"); |
219 | 1228 | ||
220 | &asm_finish(); | 1229 | &asm_finish(); |
diff --git a/src/lib/libssl/src/crypto/sha/asm/sha1-ia64.pl b/src/lib/libssl/src/crypto/sha/asm/sha1-ia64.pl index 51c4f47ecb..db28f0805a 100644 --- a/src/lib/libssl/src/crypto/sha/asm/sha1-ia64.pl +++ b/src/lib/libssl/src/crypto/sha/asm/sha1-ia64.pl | |||
@@ -15,7 +15,7 @@ | |||
15 | # is >50% better than HP C and >2x better than gcc. | 15 | # is >50% better than HP C and >2x better than gcc. |
16 | 16 | ||
17 | $code=<<___; | 17 | $code=<<___; |
18 | .ident \"sha1-ia64.s, version 1.2\" | 18 | .ident \"sha1-ia64.s, version 1.3\" |
19 | .ident \"IA-64 ISA artwork by Andy Polyakov <appro\@fy.chalmers.se>\" | 19 | .ident \"IA-64 ISA artwork by Andy Polyakov <appro\@fy.chalmers.se>\" |
20 | .explicit | 20 | .explicit |
21 | 21 | ||
@@ -26,14 +26,10 @@ if ($^O eq "hpux") { | |||
26 | $ADDP="addp4"; | 26 | $ADDP="addp4"; |
27 | for (@ARGV) { $ADDP="add" if (/[\+DD|\-mlp]64/); } | 27 | for (@ARGV) { $ADDP="add" if (/[\+DD|\-mlp]64/); } |
28 | } else { $ADDP="add"; } | 28 | } else { $ADDP="add"; } |
29 | for (@ARGV) { $big_endian=1 if (/\-DB_ENDIAN/); | ||
30 | $big_endian=0 if (/\-DL_ENDIAN/); } | ||
31 | if (!defined($big_endian)) | ||
32 | { $big_endian=(unpack('L',pack('N',1))==1); } | ||
33 | 29 | ||
34 | #$human=1; | 30 | #$human=1; |
35 | if ($human) { # useful for visual code auditing... | 31 | if ($human) { # useful for visual code auditing... |
36 | ($A,$B,$C,$D,$E,$T) = ("A","B","C","D","E","T"); | 32 | ($A,$B,$C,$D,$E) = ("A","B","C","D","E"); |
37 | ($h0,$h1,$h2,$h3,$h4) = ("h0","h1","h2","h3","h4"); | 33 | ($h0,$h1,$h2,$h3,$h4) = ("h0","h1","h2","h3","h4"); |
38 | ($K_00_19, $K_20_39, $K_40_59, $K_60_79) = | 34 | ($K_00_19, $K_20_39, $K_40_59, $K_60_79) = |
39 | ( "K_00_19","K_20_39","K_40_59","K_60_79" ); | 35 | ( "K_00_19","K_20_39","K_40_59","K_60_79" ); |
@@ -41,47 +37,50 @@ if ($human) { # useful for visual code auditing... | |||
41 | "X8", "X9","X10","X11","X12","X13","X14","X15" ); | 37 | "X8", "X9","X10","X11","X12","X13","X14","X15" ); |
42 | } | 38 | } |
43 | else { | 39 | else { |
44 | ($A,$B,$C,$D,$E,$T) = ("loc0","loc1","loc2","loc3","loc4","loc5"); | 40 | ($A,$B,$C,$D,$E) = ("loc0","loc1","loc2","loc3","loc4"); |
45 | ($h0,$h1,$h2,$h3,$h4) = ("loc6","loc7","loc8","loc9","loc10"); | 41 | ($h0,$h1,$h2,$h3,$h4) = ("loc5","loc6","loc7","loc8","loc9"); |
46 | ($K_00_19, $K_20_39, $K_40_59, $K_60_79) = | 42 | ($K_00_19, $K_20_39, $K_40_59, $K_60_79) = |
47 | ( "r14", "r15", "loc11", "loc12" ); | 43 | ( "r14", "r15", "loc10", "loc11" ); |
48 | @X= ( "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", | 44 | @X= ( "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", |
49 | "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" ); | 45 | "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31" ); |
50 | } | 46 | } |
51 | 47 | ||
52 | sub BODY_00_15 { | 48 | sub BODY_00_15 { |
53 | local *code=shift; | 49 | local *code=shift; |
54 | local ($i,$a,$b,$c,$d,$e,$f)=@_; | 50 | my ($i,$a,$b,$c,$d,$e)=@_; |
51 | my $j=$i+1; | ||
52 | my $Xn=@X[$j%16]; | ||
55 | 53 | ||
56 | $code.=<<___ if ($i==0); | 54 | $code.=<<___ if ($i==0); |
57 | { .mmi; ld1 $X[$i&0xf]=[inp],2 // MSB | 55 | { .mmi; ld1 $X[$i]=[inp],2 // MSB |
58 | ld1 tmp2=[tmp3],2 };; | 56 | ld1 tmp2=[tmp3],2 };; |
59 | { .mmi; ld1 tmp0=[inp],2 | 57 | { .mmi; ld1 tmp0=[inp],2 |
60 | ld1 tmp4=[tmp3],2 // LSB | 58 | ld1 tmp4=[tmp3],2 // LSB |
61 | dep $X[$i&0xf]=$X[$i&0xf],tmp2,8,8 };; | 59 | dep $X[$i]=$X[$i],tmp2,8,8 };; |
62 | ___ | 60 | ___ |
63 | if ($i<15) { | 61 | if ($i<15) { |
64 | $code.=<<___; | 62 | $code.=<<___; |
65 | { .mmi; ld1 $X[($i+1)&0xf]=[inp],2 // +1 | 63 | { .mmi; ld1 $Xn=[inp],2 // forward Xload |
64 | nop.m 0x0 | ||
66 | dep tmp1=tmp0,tmp4,8,8 };; | 65 | dep tmp1=tmp0,tmp4,8,8 };; |
67 | { .mmi; ld1 tmp2=[tmp3],2 // +1 | 66 | { .mmi; ld1 tmp2=[tmp3],2 // forward Xload |
68 | and tmp4=$c,$b | 67 | and tmp4=$c,$b |
69 | dep $X[$i&0xf]=$X[$i&0xf],tmp1,16,16 } //;; | 68 | dep $X[$i]=$X[$i],tmp1,16,16} //;; |
70 | { .mmi; andcm tmp1=$d,$b | 69 | { .mmi; add $e=$e,$K_00_19 // e+=K_00_19 |
71 | add tmp0=$e,$K_00_19 | 70 | andcm tmp1=$d,$b |
72 | dep.z tmp5=$a,5,27 };; // a<<5 | 71 | dep.z tmp5=$a,5,27 };; // a<<5 |
73 | { .mmi; or tmp4=tmp4,tmp1 // F_00_19(b,c,d)=(b&c)|(~b&d) | 72 | { .mmi; add $e=$e,$X[$i] // e+=Xload |
74 | add $f=tmp0,$X[$i&0xf] // f=xi+e+K_00_19 | 73 | or tmp4=tmp4,tmp1 // F_00_19(b,c,d)=(b&c)|(~b&d) |
75 | extr.u tmp1=$a,27,5 };; // a>>27 | 74 | extr.u tmp1=$a,27,5 };; // a>>27 |
76 | { .mmi; ld1 tmp0=[inp],2 // +1 | 75 | { .mmi; ld1 tmp0=[inp],2 // forward Xload |
77 | add $f=$f,tmp4 // f+=F_00_19(b,c,d) | 76 | add $e=$e,tmp4 // e+=F_00_19(b,c,d) |
78 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) | 77 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) |
79 | { .mmi; ld1 tmp4=[tmp3],2 // +1 | 78 | { .mmi; ld1 tmp4=[tmp3],2 // forward Xload |
80 | or tmp5=tmp1,tmp5 // ROTATE(a,5) | 79 | or tmp5=tmp1,tmp5 // ROTATE(a,5) |
81 | mux2 tmp6=$a,0x44 };; // see b in next iteration | 80 | mux2 tmp6=$a,0x44 };; // see b in next iteration |
82 | { .mii; add $f=$f,tmp5 // f+=ROTATE(a,5) | 81 | { .mii; add $e=$e,tmp5 // e+=ROTATE(a,5) |
83 | dep $X[($i+1)&0xf]=$X[($i+1)&0xf],tmp2,8,8 // +1 | 82 | dep $Xn=$Xn,tmp2,8,8 // forward Xload |
84 | mux2 $X[$i&0xf]=$X[$i&0xf],0x44 } //;; | 83 | mux2 $X[$i]=$X[$i],0x44 } //;; |
85 | 84 | ||
86 | ___ | 85 | ___ |
87 | } | 86 | } |
@@ -89,24 +88,24 @@ else { | |||
89 | $code.=<<___; | 88 | $code.=<<___; |
90 | { .mii; and tmp3=$c,$b | 89 | { .mii; and tmp3=$c,$b |
91 | dep tmp1=tmp0,tmp4,8,8;; | 90 | dep tmp1=tmp0,tmp4,8,8;; |
92 | dep $X[$i&0xf]=$X[$i&0xf],tmp1,16,16 } //;; | 91 | dep $X[$i]=$X[$i],tmp1,16,16} //;; |
93 | { .mmi; andcm tmp1=$d,$b | 92 | { .mmi; add $e=$e,$K_00_19 // e+=K_00_19 |
94 | add tmp0=$e,$K_00_19 | 93 | andcm tmp1=$d,$b |
95 | dep.z tmp5=$a,5,27 };; // a<<5 | 94 | dep.z tmp5=$a,5,27 };; // a<<5 |
96 | { .mmi; or tmp4=tmp3,tmp1 // F_00_19(b,c,d)=(b&c)|(~b&d) | 95 | { .mmi; add $e=$e,$X[$i] // e+=Xupdate |
97 | add $f=tmp0,$X[$i&0xf] // f=xi+e+K_00_19 | 96 | or tmp4=tmp3,tmp1 // F_00_19(b,c,d)=(b&c)|(~b&d) |
98 | extr.u tmp1=$a,27,5 } // a>>27 | 97 | extr.u tmp1=$a,27,5 } // a>>27 |
99 | { .mmi; xor tmp2=$X[($i+0+1)&0xf],$X[($i+2+1)&0xf] // +1 | 98 | { .mmi; xor $Xn=$Xn,$X[($j+2)%16] // forward Xupdate |
100 | xor tmp3=$X[($i+8+1)&0xf],$X[($i+13+1)&0xf] // +1 | 99 | xor tmp3=$X[($j+8)%16],$X[($j+13)%16] // forward Xupdate |
101 | nop.i 0 };; | 100 | nop.i 0 };; |
102 | { .mmi; add $f=$f,tmp4 // f+=F_00_19(b,c,d) | 101 | { .mmi; add $e=$e,tmp4 // e+=F_00_19(b,c,d) |
103 | xor tmp2=tmp2,tmp3 // +1 | 102 | xor $Xn=$Xn,tmp3 // forward Xupdate |
104 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) | 103 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) |
105 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) | 104 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) |
106 | mux2 tmp6=$a,0x44 };; // see b in next iteration | 105 | mux2 tmp6=$a,0x44 };; // see b in next iteration |
107 | { .mii; add $f=$f,tmp1 // f+=ROTATE(a,5) | 106 | { .mii; add $e=$e,tmp1 // e+=ROTATE(a,5) |
108 | shrp $e=tmp2,tmp2,31 // f+1=ROTATE(x[0]^x[2]^x[8]^x[13],1) | 107 | shrp $Xn=$Xn,$Xn,31 // ROTATE(x[0]^x[2]^x[8]^x[13],1) |
109 | mux2 $X[$i&0xf]=$X[$i&0xf],0x44 };; | 108 | mux2 $X[$i]=$X[$i],0x44 };; |
110 | 109 | ||
111 | ___ | 110 | ___ |
112 | } | 111 | } |
@@ -114,27 +113,28 @@ ___ | |||
114 | 113 | ||
115 | sub BODY_16_19 { | 114 | sub BODY_16_19 { |
116 | local *code=shift; | 115 | local *code=shift; |
117 | local ($i,$a,$b,$c,$d,$e,$f)=@_; | 116 | my ($i,$a,$b,$c,$d,$e)=@_; |
117 | my $j=$i+1; | ||
118 | my $Xn=@X[$j%16]; | ||
118 | 119 | ||
119 | $code.=<<___; | 120 | $code.=<<___; |
120 | { .mmi; mov $X[$i&0xf]=$f // Xupdate | 121 | { .mib; add $e=$e,$K_00_19 // e+=K_00_19 |
121 | and tmp0=$c,$b | ||
122 | dep.z tmp5=$a,5,27 } // a<<5 | 122 | dep.z tmp5=$a,5,27 } // a<<5 |
123 | { .mmi; andcm tmp1=$d,$b | 123 | { .mib; andcm tmp1=$d,$b |
124 | add tmp4=$e,$K_00_19 };; | 124 | and tmp0=$c,$b };; |
125 | { .mmi; or tmp0=tmp0,tmp1 // F_00_19(b,c,d)=(b&c)|(~b&d) | 125 | { .mmi; add $e=$e,$X[$i%16] // e+=Xupdate |
126 | add $f=$f,tmp4 // f+=e+K_00_19 | 126 | or tmp0=tmp0,tmp1 // F_00_19(b,c,d)=(b&c)|(~b&d) |
127 | extr.u tmp1=$a,27,5 } // a>>27 | 127 | extr.u tmp1=$a,27,5 } // a>>27 |
128 | { .mmi; xor tmp2=$X[($i+0+1)&0xf],$X[($i+2+1)&0xf] // +1 | 128 | { .mmi; xor $Xn=$Xn,$X[($j+2)%16] // forward Xupdate |
129 | xor tmp3=$X[($i+8+1)&0xf],$X[($i+13+1)&0xf] // +1 | 129 | xor tmp3=$X[($j+8)%16],$X[($j+13)%16] // forward Xupdate |
130 | nop.i 0 };; | 130 | nop.i 0 };; |
131 | { .mmi; add $f=$f,tmp0 // f+=F_00_19(b,c,d) | 131 | { .mmi; add $e=$e,tmp0 // f+=F_00_19(b,c,d) |
132 | xor tmp2=tmp2,tmp3 // +1 | 132 | xor $Xn=$Xn,tmp3 // forward Xupdate |
133 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) | 133 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) |
134 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) | 134 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) |
135 | mux2 tmp6=$a,0x44 };; // see b in next iteration | 135 | mux2 tmp6=$a,0x44 };; // see b in next iteration |
136 | { .mii; add $f=$f,tmp1 // f+=ROTATE(a,5) | 136 | { .mii; add $e=$e,tmp1 // e+=ROTATE(a,5) |
137 | shrp $e=tmp2,tmp2,31 // f+1=ROTATE(x[0]^x[2]^x[8]^x[13],1) | 137 | shrp $Xn=$Xn,$Xn,31 // ROTATE(x[0]^x[2]^x[8]^x[13],1) |
138 | nop.i 0 };; | 138 | nop.i 0 };; |
139 | 139 | ||
140 | ___ | 140 | ___ |
@@ -142,49 +142,47 @@ ___ | |||
142 | 142 | ||
143 | sub BODY_20_39 { | 143 | sub BODY_20_39 { |
144 | local *code=shift; | 144 | local *code=shift; |
145 | local ($i,$a,$b,$c,$d,$e,$f,$Konst)=@_; | 145 | my ($i,$a,$b,$c,$d,$e,$Konst)=@_; |
146 | $Konst = $K_20_39 if (!defined($Konst)); | 146 | $Konst = $K_20_39 if (!defined($Konst)); |
147 | my $j=$i+1; | ||
148 | my $Xn=@X[$j%16]; | ||
147 | 149 | ||
148 | if ($i<79) { | 150 | if ($i<79) { |
149 | $code.=<<___; | 151 | $code.=<<___; |
150 | { .mib; mov $X[$i&0xf]=$f // Xupdate | 152 | { .mib; add $e=$e,$Konst // e+=K_XX_XX |
151 | dep.z tmp5=$a,5,27 } // a<<5 | 153 | dep.z tmp5=$a,5,27 } // a<<5 |
152 | { .mib; xor tmp0=$c,$b | 154 | { .mib; xor tmp0=$c,$b |
153 | add tmp4=$e,$Konst };; | 155 | xor $Xn=$Xn,$X[($j+2)%16] };; // forward Xupdate |
154 | { .mmi; xor tmp0=tmp0,$d // F_20_39(b,c,d)=b^c^d | 156 | { .mib; add $e=$e,$X[$i%16] // e+=Xupdate |
155 | add $f=$f,tmp4 // f+=e+K_20_39 | ||
156 | extr.u tmp1=$a,27,5 } // a>>27 | 157 | extr.u tmp1=$a,27,5 } // a>>27 |
157 | { .mmi; xor tmp2=$X[($i+0+1)&0xf],$X[($i+2+1)&0xf] // +1 | 158 | { .mib; xor tmp0=tmp0,$d // F_20_39(b,c,d)=b^c^d |
158 | xor tmp3=$X[($i+8+1)&0xf],$X[($i+13+1)&0xf] // +1 | 159 | xor $Xn=$Xn,$X[($j+8)%16] };; // forward Xupdate |
159 | nop.i 0 };; | 160 | { .mmi; add $e=$e,tmp0 // e+=F_20_39(b,c,d) |
160 | { .mmi; add $f=$f,tmp0 // f+=F_20_39(b,c,d) | 161 | xor $Xn=$Xn,$X[($j+13)%16] // forward Xupdate |
161 | xor tmp2=tmp2,tmp3 // +1 | ||
162 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) | 162 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) |
163 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) | 163 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) |
164 | mux2 tmp6=$a,0x44 };; // see b in next iteration | 164 | mux2 tmp6=$a,0x44 };; // see b in next iteration |
165 | { .mii; add $f=$f,tmp1 // f+=ROTATE(a,5) | 165 | { .mii; add $e=$e,tmp1 // e+=ROTATE(a,5) |
166 | shrp $e=tmp2,tmp2,31 // f+1=ROTATE(x[0]^x[2]^x[8]^x[13],1) | 166 | shrp $Xn=$Xn,$Xn,31 // ROTATE(x[0]^x[2]^x[8]^x[13],1) |
167 | nop.i 0 };; | 167 | nop.i 0 };; |
168 | 168 | ||
169 | ___ | 169 | ___ |
170 | } | 170 | } |
171 | else { | 171 | else { |
172 | $code.=<<___; | 172 | $code.=<<___; |
173 | { .mib; mov $X[$i&0xf]=$f // Xupdate | 173 | { .mib; add $e=$e,$Konst // e+=K_60_79 |
174 | dep.z tmp5=$a,5,27 } // a<<5 | 174 | dep.z tmp5=$a,5,27 } // a<<5 |
175 | { .mib; xor tmp0=$c,$b | 175 | { .mib; xor tmp0=$c,$b |
176 | add tmp4=$e,$Konst };; | ||
177 | { .mib; xor tmp0=tmp0,$d // F_20_39(b,c,d)=b^c^d | ||
178 | extr.u tmp1=$a,27,5 } // a>>27 | ||
179 | { .mib; add $f=$f,tmp4 // f+=e+K_20_39 | ||
180 | add $h1=$h1,$a };; // wrap up | 176 | add $h1=$h1,$a };; // wrap up |
181 | { .mmi; add $f=$f,tmp0 // f+=F_20_39(b,c,d) | 177 | { .mib; add $e=$e,$X[$i%16] // e+=Xupdate |
182 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) ;;? | 178 | extr.u tmp1=$a,27,5 } // a>>27 |
183 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) | 179 | { .mib; xor tmp0=tmp0,$d // F_20_39(b,c,d)=b^c^d |
184 | add $h3=$h3,$c };; // wrap up | 180 | add $h3=$h3,$c };; // wrap up |
185 | { .mib; add tmp3=1,inp // used in unaligned codepath | 181 | { .mmi; add $e=$e,tmp0 // e+=F_20_39(b,c,d) |
186 | add $f=$f,tmp1 } // f+=ROTATE(a,5) | 182 | or tmp1=tmp1,tmp5 // ROTATE(a,5) |
187 | { .mib; add $h2=$h2,$b // wrap up | 183 | shrp $b=tmp6,tmp6,2 };; // b=ROTATE(b,30) ;;? |
184 | { .mmi; add $e=$e,tmp1 // e+=ROTATE(a,5) | ||
185 | add tmp3=1,inp // used in unaligned codepath | ||
188 | add $h4=$h4,$d };; // wrap up | 186 | add $h4=$h4,$d };; // wrap up |
189 | 187 | ||
190 | ___ | 188 | ___ |
@@ -193,29 +191,29 @@ ___ | |||
193 | 191 | ||
194 | sub BODY_40_59 { | 192 | sub BODY_40_59 { |
195 | local *code=shift; | 193 | local *code=shift; |
196 | local ($i,$a,$b,$c,$d,$e,$f)=@_; | 194 | my ($i,$a,$b,$c,$d,$e)=@_; |
195 | my $j=$i+1; | ||
196 | my $Xn=@X[$j%16]; | ||
197 | 197 | ||
198 | $code.=<<___; | 198 | $code.=<<___; |
199 | { .mmi; mov $X[$i&0xf]=$f // Xupdate | 199 | { .mib; add $e=$e,$K_40_59 // e+=K_40_59 |
200 | and tmp0=$c,$b | ||
201 | dep.z tmp5=$a,5,27 } // a<<5 | 200 | dep.z tmp5=$a,5,27 } // a<<5 |
202 | { .mmi; and tmp1=$d,$b | 201 | { .mib; and tmp1=$c,$d |
203 | add tmp4=$e,$K_40_59 };; | 202 | xor tmp0=$c,$d };; |
204 | { .mmi; or tmp0=tmp0,tmp1 // (b&c)|(b&d) | 203 | { .mmi; add $e=$e,$X[$i%16] // e+=Xupdate |
205 | add $f=$f,tmp4 // f+=e+K_40_59 | 204 | add tmp5=tmp5,tmp1 // a<<5+(c&d) |
206 | extr.u tmp1=$a,27,5 } // a>>27 | 205 | extr.u tmp1=$a,27,5 } // a>>27 |
207 | { .mmi; and tmp4=$c,$d | 206 | { .mmi; and tmp0=tmp0,$b |
208 | xor tmp2=$X[($i+0+1)&0xf],$X[($i+2+1)&0xf] // +1 | 207 | xor $Xn=$Xn,$X[($j+2)%16] // forward Xupdate |
209 | xor tmp3=$X[($i+8+1)&0xf],$X[($i+13+1)&0xf] // +1 | 208 | xor tmp3=$X[($j+8)%16],$X[($j+13)%16] };; // forward Xupdate |
210 | };; | 209 | { .mmi; add $e=$e,tmp0 // e+=b&(c^d) |
211 | { .mmi; or tmp1=tmp1,tmp5 // ROTATE(a,5) | 210 | add tmp5=tmp5,tmp1 // ROTATE(a,5)+(c&d) |
212 | xor tmp2=tmp2,tmp3 // +1 | ||
213 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) | 211 | shrp $b=tmp6,tmp6,2 } // b=ROTATE(b,30) |
214 | { .mmi; or tmp0=tmp0,tmp4 // F_40_59(b,c,d)=(b&c)|(b&d)|(c&d) | 212 | { .mmi; xor $Xn=$Xn,tmp3 |
215 | mux2 tmp6=$a,0x44 };; // see b in next iteration | 213 | mux2 tmp6=$a,0x44 };; // see b in next iteration |
216 | { .mii; add $f=$f,tmp0 // f+=F_40_59(b,c,d) | 214 | { .mii; add $e=$e,tmp5 // e+=ROTATE(a,5)+(c&d) |
217 | shrp $e=tmp2,tmp2,31;; // f+1=ROTATE(x[0]^x[2]^x[8]^x[13],1) | 215 | shrp $Xn=$Xn,$Xn,31 // ROTATE(x[0]^x[2]^x[8]^x[13],1) |
218 | add $f=$f,tmp1 };; // f+=ROTATE(a,5) | 216 | nop.i 0x0 };; |
219 | 217 | ||
220 | ___ | 218 | ___ |
221 | } | 219 | } |
@@ -237,7 +235,7 @@ inp=r33; // in1 | |||
237 | .align 32 | 235 | .align 32 |
238 | sha1_block_data_order: | 236 | sha1_block_data_order: |
239 | .prologue | 237 | .prologue |
240 | { .mmi; alloc tmp1=ar.pfs,3,15,0,0 | 238 | { .mmi; alloc tmp1=ar.pfs,3,14,0,0 |
241 | $ADDP tmp0=4,ctx | 239 | $ADDP tmp0=4,ctx |
242 | .save ar.lc,r3 | 240 | .save ar.lc,r3 |
243 | mov r3=ar.lc } | 241 | mov r3=ar.lc } |
@@ -245,8 +243,8 @@ sha1_block_data_order: | |||
245 | $ADDP inp=0,inp | 243 | $ADDP inp=0,inp |
246 | mov r2=pr };; | 244 | mov r2=pr };; |
247 | tmp4=in2; | 245 | tmp4=in2; |
248 | tmp5=loc13; | 246 | tmp5=loc12; |
249 | tmp6=loc14; | 247 | tmp6=loc13; |
250 | .body | 248 | .body |
251 | { .mlx; ld4 $h0=[ctx],8 | 249 | { .mlx; ld4 $h0=[ctx],8 |
252 | movl $K_00_19=0x5a827999 } | 250 | movl $K_00_19=0x5a827999 } |
@@ -273,7 +271,7 @@ tmp6=loc14; | |||
273 | 271 | ||
274 | ___ | 272 | ___ |
275 | 273 | ||
276 | { my $i,@V=($A,$B,$C,$D,$E,$T); | 274 | { my $i,@V=($A,$B,$C,$D,$E); |
277 | 275 | ||
278 | for($i=0;$i<16;$i++) { &BODY_00_15(\$code,$i,@V); unshift(@V,pop(@V)); } | 276 | for($i=0;$i<16;$i++) { &BODY_00_15(\$code,$i,@V); unshift(@V,pop(@V)); } |
279 | for(;$i<20;$i++) { &BODY_16_19(\$code,$i,@V); unshift(@V,pop(@V)); } | 277 | for(;$i<20;$i++) { &BODY_16_19(\$code,$i,@V); unshift(@V,pop(@V)); } |
@@ -281,12 +279,12 @@ ___ | |||
281 | for(;$i<60;$i++) { &BODY_40_59(\$code,$i,@V); unshift(@V,pop(@V)); } | 279 | for(;$i<60;$i++) { &BODY_40_59(\$code,$i,@V); unshift(@V,pop(@V)); } |
282 | for(;$i<80;$i++) { &BODY_60_79(\$code,$i,@V); unshift(@V,pop(@V)); } | 280 | for(;$i<80;$i++) { &BODY_60_79(\$code,$i,@V); unshift(@V,pop(@V)); } |
283 | 281 | ||
284 | (($V[5] eq $D) and ($V[0] eq $E)) or die; # double-check | 282 | (($V[0] eq $A) and ($V[4] eq $E)) or die; # double-check |
285 | } | 283 | } |
286 | 284 | ||
287 | $code.=<<___; | 285 | $code.=<<___; |
288 | { .mmb; add $h0=$h0,$E | 286 | { .mmb; add $h0=$h0,$A |
289 | nop.m 0 | 287 | add $h2=$h2,$C |
290 | br.ctop.dptk.many .Ldtop };; | 288 | br.ctop.dptk.many .Ldtop };; |
291 | .Ldend: | 289 | .Ldend: |
292 | { .mmi; add tmp0=4,ctx | 290 | { .mmi; add tmp0=4,ctx |
diff --git a/src/lib/libssl/src/crypto/sha/sha.h b/src/lib/libssl/src/crypto/sha/sha.h index 16cacf9fc0..8a6bf4bbbb 100644 --- a/src/lib/libssl/src/crypto/sha/sha.h +++ b/src/lib/libssl/src/crypto/sha/sha.h | |||
@@ -106,6 +106,9 @@ typedef struct SHAstate_st | |||
106 | } SHA_CTX; | 106 | } SHA_CTX; |
107 | 107 | ||
108 | #ifndef OPENSSL_NO_SHA0 | 108 | #ifndef OPENSSL_NO_SHA0 |
109 | #ifdef OPENSSL_FIPS | ||
110 | int private_SHA_Init(SHA_CTX *c); | ||
111 | #endif | ||
109 | int SHA_Init(SHA_CTX *c); | 112 | int SHA_Init(SHA_CTX *c); |
110 | int SHA_Update(SHA_CTX *c, const void *data, size_t len); | 113 | int SHA_Update(SHA_CTX *c, const void *data, size_t len); |
111 | int SHA_Final(unsigned char *md, SHA_CTX *c); | 114 | int SHA_Final(unsigned char *md, SHA_CTX *c); |
@@ -113,6 +116,9 @@ unsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md); | |||
113 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); | 116 | void SHA_Transform(SHA_CTX *c, const unsigned char *data); |
114 | #endif | 117 | #endif |
115 | #ifndef OPENSSL_NO_SHA1 | 118 | #ifndef OPENSSL_NO_SHA1 |
119 | #ifdef OPENSSL_FIPS | ||
120 | int private_SHA1_Init(SHA_CTX *c); | ||
121 | #endif | ||
116 | int SHA1_Init(SHA_CTX *c); | 122 | int SHA1_Init(SHA_CTX *c); |
117 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); | 123 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); |
118 | int SHA1_Final(unsigned char *md, SHA_CTX *c); | 124 | int SHA1_Final(unsigned char *md, SHA_CTX *c); |
@@ -135,6 +141,10 @@ typedef struct SHA256state_st | |||
135 | } SHA256_CTX; | 141 | } SHA256_CTX; |
136 | 142 | ||
137 | #ifndef OPENSSL_NO_SHA256 | 143 | #ifndef OPENSSL_NO_SHA256 |
144 | #ifdef OPENSSL_FIPS | ||
145 | int private_SHA224_Init(SHA256_CTX *c); | ||
146 | int private_SHA256_Init(SHA256_CTX *c); | ||
147 | #endif | ||
138 | int SHA224_Init(SHA256_CTX *c); | 148 | int SHA224_Init(SHA256_CTX *c); |
139 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); | 149 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); |
140 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); | 150 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); |
@@ -182,6 +192,10 @@ typedef struct SHA512state_st | |||
182 | #endif | 192 | #endif |
183 | 193 | ||
184 | #ifndef OPENSSL_NO_SHA512 | 194 | #ifndef OPENSSL_NO_SHA512 |
195 | #ifdef OPENSSL_FIPS | ||
196 | int private_SHA384_Init(SHA512_CTX *c); | ||
197 | int private_SHA512_Init(SHA512_CTX *c); | ||
198 | #endif | ||
185 | int SHA384_Init(SHA512_CTX *c); | 199 | int SHA384_Init(SHA512_CTX *c); |
186 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); | 200 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); |
187 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); | 201 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); |
diff --git a/src/lib/libssl/src/crypto/sha/sha1dgst.c b/src/lib/libssl/src/crypto/sha/sha1dgst.c index 50d1925cde..81219af088 100644 --- a/src/lib/libssl/src/crypto/sha/sha1dgst.c +++ b/src/lib/libssl/src/crypto/sha/sha1dgst.c | |||
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/opensslconf.h> | 59 | #include <openssl/opensslconf.h> |
60 | #include <openssl/crypto.h> | ||
60 | #if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_SHA) | 61 | #if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_SHA) |
61 | 62 | ||
62 | #undef SHA_0 | 63 | #undef SHA_0 |
diff --git a/src/lib/libssl/src/crypto/sha/sha_dgst.c b/src/lib/libssl/src/crypto/sha/sha_dgst.c index 70eb56032c..c946ad827d 100644 --- a/src/lib/libssl/src/crypto/sha/sha_dgst.c +++ b/src/lib/libssl/src/crypto/sha/sha_dgst.c | |||
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/opensslconf.h> | 59 | #include <openssl/opensslconf.h> |
60 | #include <openssl/crypto.h> | ||
60 | #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) | 61 | #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA) |
61 | 62 | ||
62 | #undef SHA_1 | 63 | #undef SHA_1 |
diff --git a/src/lib/libssl/src/crypto/sha/sha_locl.h b/src/lib/libssl/src/crypto/sha/sha_locl.h index 672c26eee1..7a0c3ca8d8 100644 --- a/src/lib/libssl/src/crypto/sha/sha_locl.h +++ b/src/lib/libssl/src/crypto/sha/sha_locl.h | |||
@@ -122,7 +122,11 @@ void sha1_block_data_order (SHA_CTX *c, const void *p,size_t num); | |||
122 | #define INIT_DATA_h3 0x10325476UL | 122 | #define INIT_DATA_h3 0x10325476UL |
123 | #define INIT_DATA_h4 0xc3d2e1f0UL | 123 | #define INIT_DATA_h4 0xc3d2e1f0UL |
124 | 124 | ||
125 | int HASH_INIT (SHA_CTX *c) | 125 | #ifdef SHA_0 |
126 | fips_md_init(SHA) | ||
127 | #else | ||
128 | fips_md_init_ctx(SHA1, SHA) | ||
129 | #endif | ||
126 | { | 130 | { |
127 | memset (c,0,sizeof(*c)); | 131 | memset (c,0,sizeof(*c)); |
128 | c->h0=INIT_DATA_h0; | 132 | c->h0=INIT_DATA_h0; |
diff --git a/src/lib/libssl/src/crypto/stack/safestack.h b/src/lib/libssl/src/crypto/stack/safestack.h index 3e76aa58f5..ea3aa0d800 100644 --- a/src/lib/libssl/src/crypto/stack/safestack.h +++ b/src/lib/libssl/src/crypto/stack/safestack.h | |||
@@ -1459,6 +1459,94 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
1459 | #define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) | 1459 | #define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st)) |
1460 | #define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) | 1460 | #define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st)) |
1461 | 1461 | ||
1462 | #define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp)) | ||
1463 | #define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN) | ||
1464 | #define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st)) | ||
1465 | #define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st)) | ||
1466 | #define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i)) | ||
1467 | #define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val)) | ||
1468 | #define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st)) | ||
1469 | #define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val)) | ||
1470 | #define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val)) | ||
1471 | #define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val)) | ||
1472 | #define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val)) | ||
1473 | #define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i)) | ||
1474 | #define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr)) | ||
1475 | #define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i)) | ||
1476 | #define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp)) | ||
1477 | #define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st) | ||
1478 | #define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func)) | ||
1479 | #define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st)) | ||
1480 | #define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st)) | ||
1481 | #define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st)) | ||
1482 | #define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st)) | ||
1483 | |||
1484 | #define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp)) | ||
1485 | #define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache) | ||
1486 | #define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st)) | ||
1487 | #define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st)) | ||
1488 | #define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i)) | ||
1489 | #define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val)) | ||
1490 | #define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st)) | ||
1491 | #define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val)) | ||
1492 | #define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val)) | ||
1493 | #define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val)) | ||
1494 | #define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val)) | ||
1495 | #define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i)) | ||
1496 | #define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr)) | ||
1497 | #define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i)) | ||
1498 | #define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp)) | ||
1499 | #define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st) | ||
1500 | #define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func)) | ||
1501 | #define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st)) | ||
1502 | #define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st)) | ||
1503 | #define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st)) | ||
1504 | #define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st)) | ||
1505 | |||
1506 | #define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp)) | ||
1507 | #define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd) | ||
1508 | #define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st)) | ||
1509 | #define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st)) | ||
1510 | #define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i)) | ||
1511 | #define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val)) | ||
1512 | #define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st)) | ||
1513 | #define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val)) | ||
1514 | #define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val)) | ||
1515 | #define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val)) | ||
1516 | #define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val)) | ||
1517 | #define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i)) | ||
1518 | #define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr)) | ||
1519 | #define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i)) | ||
1520 | #define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp)) | ||
1521 | #define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st) | ||
1522 | #define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func)) | ||
1523 | #define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st)) | ||
1524 | #define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st)) | ||
1525 | #define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st)) | ||
1526 | #define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st)) | ||
1527 | |||
1528 | #define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp)) | ||
1529 | #define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE) | ||
1530 | #define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st)) | ||
1531 | #define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st)) | ||
1532 | #define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i)) | ||
1533 | #define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val)) | ||
1534 | #define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st)) | ||
1535 | #define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val)) | ||
1536 | #define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val)) | ||
1537 | #define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val)) | ||
1538 | #define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val)) | ||
1539 | #define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i)) | ||
1540 | #define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr)) | ||
1541 | #define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i)) | ||
1542 | #define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp)) | ||
1543 | #define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st) | ||
1544 | #define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func)) | ||
1545 | #define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st)) | ||
1546 | #define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st)) | ||
1547 | #define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st)) | ||
1548 | #define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st)) | ||
1549 | |||
1462 | #define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp)) | 1550 | #define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp)) |
1463 | #define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER) | 1551 | #define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER) |
1464 | #define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st)) | 1552 | #define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st)) |
@@ -2056,31 +2144,6 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
2056 | #define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) | 2144 | #define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) |
2057 | 2145 | ||
2058 | 2146 | ||
2059 | #define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) | ||
2060 | #define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) | ||
2061 | #define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2062 | #define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2063 | #define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i)) | ||
2064 | #define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) | ||
2065 | #define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) | ||
2066 | #define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) | ||
2067 | #define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) | ||
2068 | #define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2069 | #define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) | ||
2070 | #define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2071 | #define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) | ||
2072 | #define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) | ||
2073 | #define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) | ||
2074 | #define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ | ||
2075 | ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ | ||
2076 | sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) | ||
2077 | #define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) | ||
2078 | #define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) | ||
2079 | #define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st)) | ||
2080 | #define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) | ||
2081 | #define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) | ||
2082 | |||
2083 | |||
2084 | #define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) | 2147 | #define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) |
2085 | #define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) | 2148 | #define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) |
2086 | #define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) | 2149 | #define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) |
@@ -2106,6 +2169,31 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
2106 | #define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) | 2169 | #define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) |
2107 | 2170 | ||
2108 | 2171 | ||
2172 | #define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) | ||
2173 | #define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) | ||
2174 | #define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2175 | #define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2176 | #define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i)) | ||
2177 | #define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) | ||
2178 | #define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) | ||
2179 | #define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) | ||
2180 | #define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) | ||
2181 | #define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2182 | #define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) | ||
2183 | #define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | ||
2184 | #define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) | ||
2185 | #define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) | ||
2186 | #define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) | ||
2187 | #define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ | ||
2188 | ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ | ||
2189 | sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) | ||
2190 | #define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) | ||
2191 | #define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) | ||
2192 | #define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st)) | ||
2193 | #define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) | ||
2194 | #define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) | ||
2195 | |||
2196 | |||
2109 | #define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2197 | #define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
2110 | SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) | 2198 | SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) |
2111 | #define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ | 2199 | #define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \ |
diff --git a/src/lib/libssl/src/crypto/symhacks.h b/src/lib/libssl/src/crypto/symhacks.h index 3fd4a81692..403f592dcd 100644 --- a/src/lib/libssl/src/crypto/symhacks.h +++ b/src/lib/libssl/src/crypto/symhacks.h | |||
@@ -176,7 +176,6 @@ | |||
176 | #define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud | 176 | #define SSL_CTX_set_default_passwd_cb_userdata SSL_CTX_set_def_passwd_cb_ud |
177 | #undef SSL_COMP_get_compression_methods | 177 | #undef SSL_COMP_get_compression_methods |
178 | #define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods | 178 | #define SSL_COMP_get_compression_methods SSL_COMP_get_compress_methods |
179 | |||
180 | #undef ssl_add_clienthello_renegotiate_ext | 179 | #undef ssl_add_clienthello_renegotiate_ext |
181 | #define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext | 180 | #define ssl_add_clienthello_renegotiate_ext ssl_add_clienthello_reneg_ext |
182 | #undef ssl_add_serverhello_renegotiate_ext | 181 | #undef ssl_add_serverhello_renegotiate_ext |
@@ -185,6 +184,26 @@ | |||
185 | #define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext | 184 | #define ssl_parse_clienthello_renegotiate_ext ssl_parse_clienthello_reneg_ext |
186 | #undef ssl_parse_serverhello_renegotiate_ext | 185 | #undef ssl_parse_serverhello_renegotiate_ext |
187 | #define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext | 186 | #define ssl_parse_serverhello_renegotiate_ext ssl_parse_serverhello_reneg_ext |
187 | #undef SSL_srp_server_param_with_username | ||
188 | #define SSL_srp_server_param_with_username SSL_srp_server_param_with_un | ||
189 | #undef SSL_CTX_set_srp_client_pwd_callback | ||
190 | #define SSL_CTX_set_srp_client_pwd_callback SSL_CTX_set_srp_client_pwd_cb | ||
191 | #undef SSL_CTX_set_srp_verify_param_callback | ||
192 | #define SSL_CTX_set_srp_verify_param_callback SSL_CTX_set_srp_vfy_param_cb | ||
193 | #undef SSL_CTX_set_srp_username_callback | ||
194 | #define SSL_CTX_set_srp_username_callback SSL_CTX_set_srp_un_cb | ||
195 | #undef ssl_add_clienthello_use_srtp_ext | ||
196 | #define ssl_add_clienthello_use_srtp_ext ssl_add_clihello_use_srtp_ext | ||
197 | #undef ssl_add_serverhello_use_srtp_ext | ||
198 | #define ssl_add_serverhello_use_srtp_ext ssl_add_serhello_use_srtp_ext | ||
199 | #undef ssl_parse_clienthello_use_srtp_ext | ||
200 | #define ssl_parse_clienthello_use_srtp_ext ssl_parse_clihello_use_srtp_ext | ||
201 | #undef ssl_parse_serverhello_use_srtp_ext | ||
202 | #define ssl_parse_serverhello_use_srtp_ext ssl_parse_serhello_use_srtp_ext | ||
203 | #undef SSL_CTX_set_next_protos_advertised_cb | ||
204 | #define SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_protos_adv_cb | ||
205 | #undef SSL_CTX_set_next_proto_select_cb | ||
206 | #define SSL_CTX_set_next_proto_select_cb SSL_CTX_set_next_proto_sel_cb | ||
188 | 207 | ||
189 | /* Hack some long ENGINE names */ | 208 | /* Hack some long ENGINE names */ |
190 | #undef ENGINE_get_default_BN_mod_exp_crt | 209 | #undef ENGINE_get_default_BN_mod_exp_crt |
@@ -238,6 +257,9 @@ | |||
238 | #define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form | 257 | #define EC_GROUP_get_point_conversion_form EC_GROUP_get_point_conv_form |
239 | #undef EC_GROUP_clear_free_all_extra_data | 258 | #undef EC_GROUP_clear_free_all_extra_data |
240 | #define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data | 259 | #define EC_GROUP_clear_free_all_extra_data EC_GROUP_clr_free_all_xtra_data |
260 | #undef EC_KEY_set_public_key_affine_coordinates | ||
261 | #define EC_KEY_set_public_key_affine_coordinates \ | ||
262 | EC_KEY_set_pub_key_aff_coords | ||
241 | #undef EC_POINT_set_Jprojective_coordinates_GFp | 263 | #undef EC_POINT_set_Jprojective_coordinates_GFp |
242 | #define EC_POINT_set_Jprojective_coordinates_GFp \ | 264 | #define EC_POINT_set_Jprojective_coordinates_GFp \ |
243 | EC_POINT_set_Jproj_coords_GFp | 265 | EC_POINT_set_Jproj_coords_GFp |
@@ -399,6 +421,12 @@ | |||
399 | #undef dtls1_retransmit_buffered_messages | 421 | #undef dtls1_retransmit_buffered_messages |
400 | #define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs | 422 | #define dtls1_retransmit_buffered_messages dtls1_retransmit_buffered_msgs |
401 | 423 | ||
424 | /* Hack some long SRP names */ | ||
425 | #undef SRP_generate_server_master_secret | ||
426 | #define SRP_generate_server_master_secret SRP_gen_server_master_secret | ||
427 | #undef SRP_generate_client_master_secret | ||
428 | #define SRP_generate_client_master_secret SRP_gen_client_master_secret | ||
429 | |||
402 | /* Hack some long UI names */ | 430 | /* Hack some long UI names */ |
403 | #undef UI_method_get_prompt_constructor | 431 | #undef UI_method_get_prompt_constructor |
404 | #define UI_method_get_prompt_constructor UI_method_get_prompt_constructr | 432 | #define UI_method_get_prompt_constructor UI_method_get_prompt_constructr |
diff --git a/src/lib/libssl/src/crypto/ui/ui.h b/src/lib/libssl/src/crypto/ui/ui.h index 2b1cfa2289..bd78aa413f 100644 --- a/src/lib/libssl/src/crypto/ui/ui.h +++ b/src/lib/libssl/src/crypto/ui/ui.h | |||
@@ -316,7 +316,7 @@ int (*UI_method_get_writer(UI_METHOD *method))(UI*,UI_STRING*); | |||
316 | int (*UI_method_get_flusher(UI_METHOD *method))(UI*); | 316 | int (*UI_method_get_flusher(UI_METHOD *method))(UI*); |
317 | int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); | 317 | int (*UI_method_get_reader(UI_METHOD *method))(UI*,UI_STRING*); |
318 | int (*UI_method_get_closer(UI_METHOD *method))(UI*); | 318 | int (*UI_method_get_closer(UI_METHOD *method))(UI*); |
319 | char* (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); | 319 | char * (*UI_method_get_prompt_constructor(UI_METHOD *method))(UI*, const char*, const char*); |
320 | 320 | ||
321 | /* The following functions are helpers for method writers to access relevant | 321 | /* The following functions are helpers for method writers to access relevant |
322 | data from a UI_STRING. */ | 322 | data from a UI_STRING. */ |
diff --git a/src/lib/libssl/src/crypto/ui/ui_openssl.c b/src/lib/libssl/src/crypto/ui/ui_openssl.c index 1bc25f48d5..5832a73cf5 100644 --- a/src/lib/libssl/src/crypto/ui/ui_openssl.c +++ b/src/lib/libssl/src/crypto/ui/ui_openssl.c | |||
@@ -122,7 +122,7 @@ | |||
122 | * sigaction and fileno included. -pedantic would be more appropriate for | 122 | * sigaction and fileno included. -pedantic would be more appropriate for |
123 | * the intended purposes, but we can't prevent users from adding -ansi. | 123 | * the intended purposes, but we can't prevent users from adding -ansi. |
124 | */ | 124 | */ |
125 | #ifndef _POSIX_C_SOURCE | 125 | #if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS) |
126 | #define _POSIX_C_SOURCE 2 | 126 | #define _POSIX_C_SOURCE 2 |
127 | #endif | 127 | #endif |
128 | #include <signal.h> | 128 | #include <signal.h> |
diff --git a/src/lib/libssl/src/crypto/x509/x509.h b/src/lib/libssl/src/crypto/x509/x509.h index e6f8a40395..092dd7450d 100644 --- a/src/lib/libssl/src/crypto/x509/x509.h +++ b/src/lib/libssl/src/crypto/x509/x509.h | |||
@@ -657,11 +657,15 @@ int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); | |||
657 | 657 | ||
658 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); | 658 | int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); |
659 | 659 | ||
660 | int X509_signature_dump(BIO *bp,const ASN1_STRING *sig, int indent); | ||
660 | int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); | 661 | int X509_signature_print(BIO *bp,X509_ALGOR *alg, ASN1_STRING *sig); |
661 | 662 | ||
662 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); | 663 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); |
664 | int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); | ||
663 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); | 665 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); |
666 | int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); | ||
664 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); | 667 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); |
668 | int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); | ||
665 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); | 669 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); |
666 | 670 | ||
667 | int X509_pubkey_digest(const X509 *data,const EVP_MD *type, | 671 | int X509_pubkey_digest(const X509 *data,const EVP_MD *type, |
@@ -763,6 +767,7 @@ X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); | |||
763 | int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); | 767 | int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval); |
764 | void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, | 768 | void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, |
765 | X509_ALGOR *algor); | 769 | X509_ALGOR *algor); |
770 | void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); | ||
766 | 771 | ||
767 | X509_NAME *X509_NAME_dup(X509_NAME *xn); | 772 | X509_NAME *X509_NAME_dup(X509_NAME *xn); |
768 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); | 773 | X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); |
@@ -896,6 +901,9 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, | |||
896 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, | 901 | int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, |
897 | ASN1_BIT_STRING *signature, | 902 | ASN1_BIT_STRING *signature, |
898 | void *data, EVP_PKEY *pkey, const EVP_MD *type); | 903 | void *data, EVP_PKEY *pkey, const EVP_MD *type); |
904 | int ASN1_item_sign_ctx(const ASN1_ITEM *it, | ||
905 | X509_ALGOR *algor1, X509_ALGOR *algor2, | ||
906 | ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx); | ||
899 | #endif | 907 | #endif |
900 | 908 | ||
901 | int X509_set_version(X509 *x,long version); | 909 | int X509_set_version(X509 *x,long version); |
@@ -1161,6 +1169,9 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, | |||
1161 | unsigned char *salt, int saltlen, | 1169 | unsigned char *salt, int saltlen, |
1162 | unsigned char *aiv, int prf_nid); | 1170 | unsigned char *aiv, int prf_nid); |
1163 | 1171 | ||
1172 | X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, | ||
1173 | int prf_nid, int keylen); | ||
1174 | |||
1164 | /* PKCS#8 utilities */ | 1175 | /* PKCS#8 utilities */ |
1165 | 1176 | ||
1166 | DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) | 1177 | DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) |
diff --git a/src/lib/libssl/src/crypto/x509/x509_cmp.c b/src/lib/libssl/src/crypto/x509/x509_cmp.c index 4bc9da07e0..7c2aaee2e9 100644 --- a/src/lib/libssl/src/crypto/x509/x509_cmp.c +++ b/src/lib/libssl/src/crypto/x509/x509_cmp.c | |||
@@ -87,15 +87,20 @@ unsigned long X509_issuer_and_serial_hash(X509 *a) | |||
87 | EVP_MD_CTX_init(&ctx); | 87 | EVP_MD_CTX_init(&ctx); |
88 | f=X509_NAME_oneline(a->cert_info->issuer,NULL,0); | 88 | f=X509_NAME_oneline(a->cert_info->issuer,NULL,0); |
89 | ret=strlen(f); | 89 | ret=strlen(f); |
90 | EVP_DigestInit_ex(&ctx, EVP_md5(), NULL); | 90 | if (!EVP_DigestInit_ex(&ctx, EVP_md5(), NULL)) |
91 | EVP_DigestUpdate(&ctx,(unsigned char *)f,ret); | 91 | goto err; |
92 | if (!EVP_DigestUpdate(&ctx,(unsigned char *)f,ret)) | ||
93 | goto err; | ||
92 | OPENSSL_free(f); | 94 | OPENSSL_free(f); |
93 | EVP_DigestUpdate(&ctx,(unsigned char *)a->cert_info->serialNumber->data, | 95 | if(!EVP_DigestUpdate(&ctx,(unsigned char *)a->cert_info->serialNumber->data, |
94 | (unsigned long)a->cert_info->serialNumber->length); | 96 | (unsigned long)a->cert_info->serialNumber->length)) |
95 | EVP_DigestFinal_ex(&ctx,&(md[0]),NULL); | 97 | goto err; |
98 | if (!EVP_DigestFinal_ex(&ctx,&(md[0]),NULL)) | ||
99 | goto err; | ||
96 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| | 100 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| |
97 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) | 101 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) |
98 | )&0xffffffffL; | 102 | )&0xffffffffL; |
103 | err: | ||
99 | EVP_MD_CTX_cleanup(&ctx); | 104 | EVP_MD_CTX_cleanup(&ctx); |
100 | return(ret); | 105 | return(ret); |
101 | } | 106 | } |
@@ -219,7 +224,9 @@ unsigned long X509_NAME_hash(X509_NAME *x) | |||
219 | 224 | ||
220 | /* Make sure X509_NAME structure contains valid cached encoding */ | 225 | /* Make sure X509_NAME structure contains valid cached encoding */ |
221 | i2d_X509_NAME(x,NULL); | 226 | i2d_X509_NAME(x,NULL); |
222 | EVP_Digest(x->canon_enc, x->canon_enclen, md, NULL, EVP_sha1(), NULL); | 227 | if (!EVP_Digest(x->canon_enc, x->canon_enclen, md, NULL, EVP_sha1(), |
228 | NULL)) | ||
229 | return 0; | ||
223 | 230 | ||
224 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| | 231 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| |
225 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) | 232 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) |
@@ -234,12 +241,18 @@ unsigned long X509_NAME_hash(X509_NAME *x) | |||
234 | 241 | ||
235 | unsigned long X509_NAME_hash_old(X509_NAME *x) | 242 | unsigned long X509_NAME_hash_old(X509_NAME *x) |
236 | { | 243 | { |
244 | EVP_MD_CTX md_ctx; | ||
237 | unsigned long ret=0; | 245 | unsigned long ret=0; |
238 | unsigned char md[16]; | 246 | unsigned char md[16]; |
239 | 247 | ||
240 | /* Make sure X509_NAME structure contains valid cached encoding */ | 248 | /* Make sure X509_NAME structure contains valid cached encoding */ |
241 | i2d_X509_NAME(x,NULL); | 249 | i2d_X509_NAME(x,NULL); |
242 | EVP_Digest(x->bytes->data, x->bytes->length, md, NULL, EVP_md5(), NULL); | 250 | EVP_MD_CTX_init(&md_ctx); |
251 | EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
252 | EVP_DigestInit_ex(&md_ctx, EVP_md5(), NULL); | ||
253 | EVP_DigestUpdate(&md_ctx, x->bytes->data, x->bytes->length); | ||
254 | EVP_DigestFinal_ex(&md_ctx,md,NULL); | ||
255 | EVP_MD_CTX_cleanup(&md_ctx); | ||
243 | 256 | ||
244 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| | 257 | ret=( ((unsigned long)md[0] )|((unsigned long)md[1]<<8L)| |
245 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) | 258 | ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L) |
diff --git a/src/lib/libssl/src/crypto/x509/x509_lu.c b/src/lib/libssl/src/crypto/x509/x509_lu.c index 3a6e04a1de..38525a8cdd 100644 --- a/src/lib/libssl/src/crypto/x509/x509_lu.c +++ b/src/lib/libssl/src/crypto/x509/x509_lu.c | |||
@@ -87,7 +87,7 @@ void X509_LOOKUP_free(X509_LOOKUP *ctx) | |||
87 | if (ctx == NULL) return; | 87 | if (ctx == NULL) return; |
88 | if ( (ctx->method != NULL) && | 88 | if ( (ctx->method != NULL) && |
89 | (ctx->method->free != NULL)) | 89 | (ctx->method->free != NULL)) |
90 | ctx->method->free(ctx); | 90 | (*ctx->method->free)(ctx); |
91 | OPENSSL_free(ctx); | 91 | OPENSSL_free(ctx); |
92 | } | 92 | } |
93 | 93 | ||
diff --git a/src/lib/libssl/src/crypto/x509/x509_vfy.c b/src/lib/libssl/src/crypto/x509/x509_vfy.c index 701ec565e9..b0779db023 100644 --- a/src/lib/libssl/src/crypto/x509/x509_vfy.c +++ b/src/lib/libssl/src/crypto/x509/x509_vfy.c | |||
@@ -153,7 +153,6 @@ static int x509_subject_cmp(X509 **a, X509 **b) | |||
153 | int X509_verify_cert(X509_STORE_CTX *ctx) | 153 | int X509_verify_cert(X509_STORE_CTX *ctx) |
154 | { | 154 | { |
155 | X509 *x,*xtmp,*chain_ss=NULL; | 155 | X509 *x,*xtmp,*chain_ss=NULL; |
156 | X509_NAME *xn; | ||
157 | int bad_chain = 0; | 156 | int bad_chain = 0; |
158 | X509_VERIFY_PARAM *param = ctx->param; | 157 | X509_VERIFY_PARAM *param = ctx->param; |
159 | int depth,i,ok=0; | 158 | int depth,i,ok=0; |
@@ -205,7 +204,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
205 | */ | 204 | */ |
206 | 205 | ||
207 | /* If we are self signed, we break */ | 206 | /* If we are self signed, we break */ |
208 | xn=X509_get_issuer_name(x); | ||
209 | if (ctx->check_issued(ctx, x,x)) break; | 207 | if (ctx->check_issued(ctx, x,x)) break; |
210 | 208 | ||
211 | /* If we were passed a cert chain, use it first */ | 209 | /* If we were passed a cert chain, use it first */ |
@@ -242,7 +240,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
242 | 240 | ||
243 | i=sk_X509_num(ctx->chain); | 241 | i=sk_X509_num(ctx->chain); |
244 | x=sk_X509_value(ctx->chain,i-1); | 242 | x=sk_X509_value(ctx->chain,i-1); |
245 | xn = X509_get_subject_name(x); | ||
246 | if (ctx->check_issued(ctx, x, x)) | 243 | if (ctx->check_issued(ctx, x, x)) |
247 | { | 244 | { |
248 | /* we have a self signed certificate */ | 245 | /* we have a self signed certificate */ |
@@ -291,7 +288,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
291 | if (depth < num) break; | 288 | if (depth < num) break; |
292 | 289 | ||
293 | /* If we are self signed, we break */ | 290 | /* If we are self signed, we break */ |
294 | xn=X509_get_issuer_name(x); | ||
295 | if (ctx->check_issued(ctx,x,x)) break; | 291 | if (ctx->check_issued(ctx,x,x)) break; |
296 | 292 | ||
297 | ok = ctx->get_issuer(&xtmp, ctx, x); | 293 | ok = ctx->get_issuer(&xtmp, ctx, x); |
@@ -310,7 +306,6 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
310 | } | 306 | } |
311 | 307 | ||
312 | /* we now have our chain, lets check it... */ | 308 | /* we now have our chain, lets check it... */ |
313 | xn=X509_get_issuer_name(x); | ||
314 | 309 | ||
315 | /* Is last certificate looked up self signed? */ | 310 | /* Is last certificate looked up self signed? */ |
316 | if (!ctx->check_issued(ctx,x,x)) | 311 | if (!ctx->check_issued(ctx,x,x)) |
diff --git a/src/lib/libssl/src/crypto/x509/x509type.c b/src/lib/libssl/src/crypto/x509/x509type.c index 3385ad3f67..9702ec5310 100644 --- a/src/lib/libssl/src/crypto/x509/x509type.c +++ b/src/lib/libssl/src/crypto/x509/x509type.c | |||
@@ -100,20 +100,26 @@ int X509_certificate_type(X509 *x, EVP_PKEY *pkey) | |||
100 | break; | 100 | break; |
101 | } | 101 | } |
102 | 102 | ||
103 | i=X509_get_signature_type(x); | 103 | i=OBJ_obj2nid(x->sig_alg->algorithm); |
104 | switch (i) | 104 | if (i && OBJ_find_sigid_algs(i, NULL, &i)) |
105 | { | 105 | { |
106 | case EVP_PKEY_RSA: | 106 | |
107 | ret|=EVP_PKS_RSA; | 107 | switch (i) |
108 | break; | 108 | { |
109 | case EVP_PKEY_DSA: | 109 | case NID_rsaEncryption: |
110 | ret|=EVP_PKS_DSA; | 110 | case NID_rsa: |
111 | break; | 111 | ret|=EVP_PKS_RSA; |
112 | case EVP_PKEY_EC: | 112 | break; |
113 | ret|=EVP_PKS_EC; | 113 | case NID_dsa: |
114 | break; | 114 | case NID_dsa_2: |
115 | default: | 115 | ret|=EVP_PKS_DSA; |
116 | break; | 116 | break; |
117 | case NID_X9_62_id_ecPublicKey: | ||
118 | ret|=EVP_PKS_EC; | ||
119 | break; | ||
120 | default: | ||
121 | break; | ||
122 | } | ||
117 | } | 123 | } |
118 | 124 | ||
119 | if (EVP_PKEY_size(pk) <= 1024/8)/* /8 because it's 1024 bits we look | 125 | if (EVP_PKEY_size(pk) <= 1024/8)/* /8 because it's 1024 bits we look |
diff --git a/src/lib/libssl/src/crypto/x509/x_all.c b/src/lib/libssl/src/crypto/x509/x_all.c index 8ec88c215a..b94aeeb873 100644 --- a/src/lib/libssl/src/crypto/x509/x_all.c +++ b/src/lib/libssl/src/crypto/x509/x_all.c | |||
@@ -95,12 +95,25 @@ int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) | |||
95 | x->sig_alg, x->signature, x->cert_info,pkey,md)); | 95 | x->sig_alg, x->signature, x->cert_info,pkey,md)); |
96 | } | 96 | } |
97 | 97 | ||
98 | int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx) | ||
99 | { | ||
100 | return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CINF), | ||
101 | x->cert_info->signature, | ||
102 | x->sig_alg, x->signature, x->cert_info, ctx); | ||
103 | } | ||
104 | |||
98 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) | 105 | int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) |
99 | { | 106 | { |
100 | return(ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO),x->sig_alg, NULL, | 107 | return(ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO),x->sig_alg, NULL, |
101 | x->signature, x->req_info,pkey,md)); | 108 | x->signature, x->req_info,pkey,md)); |
102 | } | 109 | } |
103 | 110 | ||
111 | int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx) | ||
112 | { | ||
113 | return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_REQ_INFO), | ||
114 | x->sig_alg, NULL, x->signature, x->req_info, ctx); | ||
115 | } | ||
116 | |||
104 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) | 117 | int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) |
105 | { | 118 | { |
106 | x->crl->enc.modified = 1; | 119 | x->crl->enc.modified = 1; |
@@ -108,6 +121,12 @@ int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) | |||
108 | x->sig_alg, x->signature, x->crl,pkey,md)); | 121 | x->sig_alg, x->signature, x->crl,pkey,md)); |
109 | } | 122 | } |
110 | 123 | ||
124 | int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx) | ||
125 | { | ||
126 | return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CRL_INFO), | ||
127 | x->crl->sig_alg, x->sig_alg, x->signature, x->crl, ctx); | ||
128 | } | ||
129 | |||
111 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) | 130 | int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) |
112 | { | 131 | { |
113 | return(ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor,NULL, | 132 | return(ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor,NULL, |
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_skey.c b/src/lib/libssl/src/crypto/x509v3/v3_skey.c index 202c9e4896..0a984fbaa8 100644 --- a/src/lib/libssl/src/crypto/x509v3/v3_skey.c +++ b/src/lib/libssl/src/crypto/x509v3/v3_skey.c | |||
@@ -129,7 +129,8 @@ static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, | |||
129 | goto err; | 129 | goto err; |
130 | } | 130 | } |
131 | 131 | ||
132 | EVP_Digest(pk->data, pk->length, pkey_dig, &diglen, EVP_sha1(), NULL); | 132 | if (!EVP_Digest(pk->data, pk->length, pkey_dig, &diglen, EVP_sha1(), NULL)) |
133 | goto err; | ||
133 | 134 | ||
134 | if(!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { | 135 | if(!M_ASN1_OCTET_STRING_set(oct, pkey_dig, diglen)) { |
135 | X509V3err(X509V3_F_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); | 136 | X509V3err(X509V3_F_S2I_SKEY_ID,ERR_R_MALLOC_FAILURE); |
diff --git a/src/lib/libssl/src/doc/HOWTO/proxy_certificates.txt b/src/lib/libssl/src/doc/HOWTO/proxy_certificates.txt index 3d36b02f6b..f98ec36076 100644 --- a/src/lib/libssl/src/doc/HOWTO/proxy_certificates.txt +++ b/src/lib/libssl/src/doc/HOWTO/proxy_certificates.txt | |||
@@ -57,7 +57,7 @@ following methods: | |||
57 | 57 | ||
58 | - in all other cases, proxy certificate validation can be enabled | 58 | - in all other cases, proxy certificate validation can be enabled |
59 | before starting the application by setting the envirnoment variable | 59 | before starting the application by setting the envirnoment variable |
60 | OPENSSL_ALLOW_PROXY with some non-empty value. | 60 | OPENSSL_ALLOW_PROXY_CERTS with some non-empty value. |
61 | 61 | ||
62 | There are thoughts to allow proxy certificates with a line in the | 62 | There are thoughts to allow proxy certificates with a line in the |
63 | default openssl.cnf, but that's still in the future. | 63 | default openssl.cnf, but that's still in the future. |
diff --git a/src/lib/libssl/src/doc/apps/openssl.pod b/src/lib/libssl/src/doc/apps/openssl.pod index 738142e9ff..64a160c20a 100644 --- a/src/lib/libssl/src/doc/apps/openssl.pod +++ b/src/lib/libssl/src/doc/apps/openssl.pod | |||
@@ -287,8 +287,6 @@ SHA Digest | |||
287 | 287 | ||
288 | SHA-1 Digest | 288 | SHA-1 Digest |
289 | 289 | ||
290 | =back | ||
291 | |||
292 | =item B<sha224> | 290 | =item B<sha224> |
293 | 291 | ||
294 | SHA-224 Digest | 292 | SHA-224 Digest |
@@ -305,6 +303,8 @@ SHA-384 Digest | |||
305 | 303 | ||
306 | SHA-512 Digest | 304 | SHA-512 Digest |
307 | 305 | ||
306 | =back | ||
307 | |||
308 | =head2 ENCODING AND CIPHER COMMANDS | 308 | =head2 ENCODING AND CIPHER COMMANDS |
309 | 309 | ||
310 | =over 10 | 310 | =over 10 |
diff --git a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod index 5b477ac6ec..367691cc7a 100644 --- a/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod +++ b/src/lib/libssl/src/doc/crypto/EVP_DigestInit.pod | |||
@@ -6,7 +6,8 @@ EVP_MD_CTX_init, EVP_MD_CTX_create, EVP_DigestInit_ex, EVP_DigestUpdate, | |||
6 | EVP_DigestFinal_ex, EVP_MD_CTX_cleanup, EVP_MD_CTX_destroy, EVP_MAX_MD_SIZE, | 6 | EVP_DigestFinal_ex, EVP_MD_CTX_cleanup, EVP_MD_CTX_destroy, EVP_MAX_MD_SIZE, |
7 | EVP_MD_CTX_copy_ex, EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, | 7 | EVP_MD_CTX_copy_ex, EVP_MD_CTX_copy, EVP_MD_type, EVP_MD_pkey_type, EVP_MD_size, |
8 | EVP_MD_block_size, EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type, | 8 | EVP_MD_block_size, EVP_MD_CTX_md, EVP_MD_CTX_size, EVP_MD_CTX_block_size, EVP_MD_CTX_type, |
9 | EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_dss, EVP_dss1, EVP_mdc2, | 9 | EVP_md_null, EVP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha224, EVP_sha256, |
10 | EVP_sha384, EVP_sha512, EVP_dss, EVP_dss1, EVP_mdc2, | ||
10 | EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj - | 11 | EVP_ripemd160, EVP_get_digestbyname, EVP_get_digestbynid, EVP_get_digestbyobj - |
11 | EVP digest routines | 12 | EVP digest routines |
12 | 13 | ||
@@ -33,16 +34,15 @@ EVP digest routines | |||
33 | 34 | ||
34 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); | 35 | int EVP_MD_CTX_copy(EVP_MD_CTX *out,EVP_MD_CTX *in); |
35 | 36 | ||
36 | #define EVP_MAX_MD_SIZE (16+20) /* The SSLv3 md5+sha1 type */ | 37 | #define EVP_MAX_MD_SIZE 64 /* SHA512 */ |
37 | 38 | ||
39 | int EVP_MD_type(const EVP_MD *md); | ||
40 | int EVP_MD_pkey_type(const EVP_MD *md); | ||
41 | int EVP_MD_size(const EVP_MD *md); | ||
42 | int EVP_MD_block_size(const EVP_MD *md); | ||
38 | 43 | ||
39 | #define EVP_MD_type(e) ((e)->type) | 44 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); |
40 | #define EVP_MD_pkey_type(e) ((e)->pkey_type) | 45 | #define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) |
41 | #define EVP_MD_size(e) ((e)->md_size) | ||
42 | #define EVP_MD_block_size(e) ((e)->block_size) | ||
43 | |||
44 | #define EVP_MD_CTX_md(e) (e)->digest) | ||
45 | #define EVP_MD_CTX_size(e) EVP_MD_size((e)->digest) | ||
46 | #define EVP_MD_CTX_block_size(e) EVP_MD_block_size((e)->digest) | 46 | #define EVP_MD_CTX_block_size(e) EVP_MD_block_size((e)->digest) |
47 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) | 47 | #define EVP_MD_CTX_type(e) EVP_MD_type((e)->digest) |
48 | 48 | ||
@@ -56,6 +56,11 @@ EVP digest routines | |||
56 | const EVP_MD *EVP_mdc2(void); | 56 | const EVP_MD *EVP_mdc2(void); |
57 | const EVP_MD *EVP_ripemd160(void); | 57 | const EVP_MD *EVP_ripemd160(void); |
58 | 58 | ||
59 | const EVP_MD *EVP_sha224(void); | ||
60 | const EVP_MD *EVP_sha256(void); | ||
61 | const EVP_MD *EVP_sha384(void); | ||
62 | const EVP_MD *EVP_sha512(void); | ||
63 | |||
59 | const EVP_MD *EVP_get_digestbyname(const char *name); | 64 | const EVP_MD *EVP_get_digestbyname(const char *name); |
60 | #define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) | 65 | #define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) |
61 | #define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) | 66 | #define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) |
@@ -124,12 +129,14 @@ B<EVP_MD_CTX>. | |||
124 | 129 | ||
125 | EVP_MD_pkey_type() returns the NID of the public key signing algorithm associated | 130 | EVP_MD_pkey_type() returns the NID of the public key signing algorithm associated |
126 | with this digest. For example EVP_sha1() is associated with RSA so this will | 131 | with this digest. For example EVP_sha1() is associated with RSA so this will |
127 | return B<NID_sha1WithRSAEncryption>. This "link" between digests and signature | 132 | return B<NID_sha1WithRSAEncryption>. Since digests and signature algorithms |
128 | algorithms may not be retained in future versions of OpenSSL. | 133 | are no longer linked this function is only retained for compatibility |
134 | reasons. | ||
129 | 135 | ||
130 | EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_mdc2() and EVP_ripemd160() | 136 | EVP_md2(), EVP_md5(), EVP_sha(), EVP_sha1(), EVP_sha224(), EVP_sha256(), |
131 | return B<EVP_MD> structures for the MD2, MD5, SHA, SHA1, MDC2 and RIPEMD160 digest | 137 | EVP_sha384(), EVP_sha512(), EVP_mdc2() and EVP_ripemd160() return B<EVP_MD> |
132 | algorithms respectively. The associated signature algorithm is RSA in each case. | 138 | structures for the MD2, MD5, SHA, SHA1, SHA224, SHA256, SHA384, SHA512, MDC2 |
139 | and RIPEMD160 digest algorithms respectively. | ||
133 | 140 | ||
134 | EVP_dss() and EVP_dss1() return B<EVP_MD> structures for SHA and SHA1 digest | 141 | EVP_dss() and EVP_dss1() return B<EVP_MD> structures for SHA and SHA1 digest |
135 | algorithms but using DSS (DSA) for the signature algorithm. Note: there is | 142 | algorithms but using DSS (DSA) for the signature algorithm. Note: there is |
@@ -171,8 +178,8 @@ The B<EVP> interface to message digests should almost always be used in | |||
171 | preference to the low level interfaces. This is because the code then becomes | 178 | preference to the low level interfaces. This is because the code then becomes |
172 | transparent to the digest used and much more flexible. | 179 | transparent to the digest used and much more flexible. |
173 | 180 | ||
174 | SHA1 is the digest of choice for new applications. The other digest algorithms | 181 | New applications should use the SHA2 digest algorithms such as SHA256. |
175 | are still in common use. | 182 | The other digest algorithms are still in common use. |
176 | 183 | ||
177 | For most applications the B<impl> parameter to EVP_DigestInit_ex() will be | 184 | For most applications the B<impl> parameter to EVP_DigestInit_ex() will be |
178 | set to NULL to use the default digest implementation. | 185 | set to NULL to use the default digest implementation. |
@@ -187,6 +194,19 @@ implementations of digests to be specified. | |||
187 | In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after use | 194 | In OpenSSL 0.9.7 and later if digest contexts are not cleaned up after use |
188 | memory leaks will occur. | 195 | memory leaks will occur. |
189 | 196 | ||
197 | Stack allocation of EVP_MD_CTX structures is common, for example: | ||
198 | |||
199 | EVP_MD_CTX mctx; | ||
200 | EVP_MD_CTX_init(&mctx); | ||
201 | |||
202 | This will cause binary compatibility issues if the size of EVP_MD_CTX | ||
203 | structure changes (this will only happen with a major release of OpenSSL). | ||
204 | Applications wishing to avoid this should use EVP_MD_CTX_create() instead: | ||
205 | |||
206 | EVP_MD_CTX *mctx; | ||
207 | mctx = EVP_MD_CTX_create(); | ||
208 | |||
209 | |||
190 | =head1 EXAMPLE | 210 | =head1 EXAMPLE |
191 | 211 | ||
192 | This example digests the data "Test Message\n" and "Hello World\n", using the | 212 | This example digests the data "Test Message\n" and "Hello World\n", using the |
@@ -197,7 +217,7 @@ digest name passed on the command line. | |||
197 | 217 | ||
198 | main(int argc, char *argv[]) | 218 | main(int argc, char *argv[]) |
199 | { | 219 | { |
200 | EVP_MD_CTX mdctx; | 220 | EVP_MD_CTX *mdctx; |
201 | const EVP_MD *md; | 221 | const EVP_MD *md; |
202 | char mess1[] = "Test Message\n"; | 222 | char mess1[] = "Test Message\n"; |
203 | char mess2[] = "Hello World\n"; | 223 | char mess2[] = "Hello World\n"; |
@@ -218,12 +238,12 @@ digest name passed on the command line. | |||
218 | exit(1); | 238 | exit(1); |
219 | } | 239 | } |
220 | 240 | ||
221 | EVP_MD_CTX_init(&mdctx); | 241 | mdctx = EVP_MD_CTX_create(); |
222 | EVP_DigestInit_ex(&mdctx, md, NULL); | 242 | EVP_DigestInit_ex(mdctx, md, NULL); |
223 | EVP_DigestUpdate(&mdctx, mess1, strlen(mess1)); | 243 | EVP_DigestUpdate(mdctx, mess1, strlen(mess1)); |
224 | EVP_DigestUpdate(&mdctx, mess2, strlen(mess2)); | 244 | EVP_DigestUpdate(mdctx, mess2, strlen(mess2)); |
225 | EVP_DigestFinal_ex(&mdctx, md_value, &md_len); | 245 | EVP_DigestFinal_ex(mdctx, md_value, &md_len); |
226 | EVP_MD_CTX_cleanup(&mdctx); | 246 | EVP_MD_CTX_destroy(mdctx); |
227 | 247 | ||
228 | printf("Digest is: "); | 248 | printf("Digest is: "); |
229 | for(i = 0; i < md_len; i++) printf("%02x", md_value[i]); | 249 | for(i = 0; i < md_len; i++) printf("%02x", md_value[i]); |
diff --git a/src/lib/libssl/src/doc/ssl/SSL_alert_type_string.pod b/src/lib/libssl/src/doc/ssl/SSL_alert_type_string.pod index 94e28cc307..0329c34869 100644 --- a/src/lib/libssl/src/doc/ssl/SSL_alert_type_string.pod +++ b/src/lib/libssl/src/doc/ssl/SSL_alert_type_string.pod | |||
@@ -214,6 +214,11 @@ satisfy a request; the process might receive security parameters | |||
214 | difficult to communicate changes to these parameters after that | 214 | difficult to communicate changes to these parameters after that |
215 | point. This message is always a warning. | 215 | point. This message is always a warning. |
216 | 216 | ||
217 | =item "UP"/"unknown PSK identity" | ||
218 | |||
219 | Sent by the server to indicate that it does not recognize a PSK | ||
220 | identity or an SRP identity. | ||
221 | |||
217 | =item "UK"/"unknown" | 222 | =item "UK"/"unknown" |
218 | 223 | ||
219 | This indicates that no description is available for this alert type. | 224 | This indicates that no description is available for this alert type. |
diff --git a/src/lib/libssl/src/e_os.h b/src/lib/libssl/src/e_os.h index 5ceeeeb950..79c1392573 100644 --- a/src/lib/libssl/src/e_os.h +++ b/src/lib/libssl/src/e_os.h | |||
@@ -99,7 +99,6 @@ extern "C" { | |||
99 | # ifndef MAC_OS_GUSI_SOURCE | 99 | # ifndef MAC_OS_GUSI_SOURCE |
100 | # define MAC_OS_pre_X | 100 | # define MAC_OS_pre_X |
101 | # define NO_SYS_TYPES_H | 101 | # define NO_SYS_TYPES_H |
102 | typedef long ssize_t; | ||
103 | # endif | 102 | # endif |
104 | # define NO_SYS_PARAM_H | 103 | # define NO_SYS_PARAM_H |
105 | # define NO_CHMOD | 104 | # define NO_CHMOD |
@@ -340,8 +339,6 @@ static unsigned int _strlen31(const char *str) | |||
340 | # define OPENSSL_NO_POSIX_IO | 339 | # define OPENSSL_NO_POSIX_IO |
341 | # endif | 340 | # endif |
342 | 341 | ||
343 | # define ssize_t long | ||
344 | |||
345 | # if defined (__BORLANDC__) | 342 | # if defined (__BORLANDC__) |
346 | # define _setmode setmode | 343 | # define _setmode setmode |
347 | # define _O_TEXT O_TEXT | 344 | # define _O_TEXT O_TEXT |
@@ -456,9 +453,6 @@ static unsigned int _strlen31(const char *str) | |||
456 | * (unless when compiling with -D_POSIX_SOURCE, | 453 | * (unless when compiling with -D_POSIX_SOURCE, |
457 | * which doesn't work for us) */ | 454 | * which doesn't work for us) */ |
458 | # endif | 455 | # endif |
459 | # if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS) | ||
460 | # define ssize_t int /* ditto */ | ||
461 | # endif | ||
462 | # ifdef OPENSSL_SYS_NEWS4 /* setvbuf is missing on mips-sony-bsd */ | 456 | # ifdef OPENSSL_SYS_NEWS4 /* setvbuf is missing on mips-sony-bsd */ |
463 | # define setvbuf(a, b, c, d) setbuffer((a), (b), (d)) | 457 | # define setvbuf(a, b, c, d) setbuffer((a), (b), (d)) |
464 | typedef unsigned long clock_t; | 458 | typedef unsigned long clock_t; |
@@ -637,12 +631,6 @@ static unsigned int _strlen31(const char *str) | |||
637 | 631 | ||
638 | #endif | 632 | #endif |
639 | 633 | ||
640 | #if defined(__ultrix) | ||
641 | # ifndef ssize_t | ||
642 | # define ssize_t int | ||
643 | # endif | ||
644 | #endif | ||
645 | |||
646 | #if defined(sun) && !defined(__svr4__) && !defined(__SVR4) | 634 | #if defined(sun) && !defined(__svr4__) && !defined(__SVR4) |
647 | /* include headers first, so our defines don't break it */ | 635 | /* include headers first, so our defines don't break it */ |
648 | #include <stdlib.h> | 636 | #include <stdlib.h> |
diff --git a/src/lib/libssl/src/e_os2.h b/src/lib/libssl/src/e_os2.h index d30724d304..d22c0368f8 100644 --- a/src/lib/libssl/src/e_os2.h +++ b/src/lib/libssl/src/e_os2.h | |||
@@ -289,6 +289,26 @@ extern "C" { | |||
289 | # define OPENSSL_GLOBAL_REF(name) _shadow_##name | 289 | # define OPENSSL_GLOBAL_REF(name) _shadow_##name |
290 | #endif | 290 | #endif |
291 | 291 | ||
292 | #if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE) | ||
293 | # define ossl_ssize_t long | ||
294 | #endif | ||
295 | |||
296 | #ifdef OPENSSL_SYS_MSDOS | ||
297 | # define ossl_ssize_t long | ||
298 | #endif | ||
299 | |||
300 | #if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS) | ||
301 | # define ssize_t int | ||
302 | #endif | ||
303 | |||
304 | #if defined(__ultrix) && !defined(ssize_t) | ||
305 | # define ossl_ssize_t int | ||
306 | #endif | ||
307 | |||
308 | #ifndef ossl_ssize_t | ||
309 | # define ossl_ssize_t ssize_t | ||
310 | #endif | ||
311 | |||
292 | #ifdef __cplusplus | 312 | #ifdef __cplusplus |
293 | } | 313 | } |
294 | #endif | 314 | #endif |
diff --git a/src/lib/libssl/src/makevms.com b/src/lib/libssl/src/makevms.com index eb22f20db2..de1dbd9058 100644 --- a/src/lib/libssl/src/makevms.com +++ b/src/lib/libssl/src/makevms.com | |||
@@ -263,8 +263,10 @@ $ CONFIG_LOGICALS := AES,- | |||
263 | DH,- | 263 | DH,- |
264 | DSA,- | 264 | DSA,- |
265 | EC,- | 265 | EC,- |
266 | EC2M,- | ||
266 | ECDH,- | 267 | ECDH,- |
267 | ECDSA,- | 268 | ECDSA,- |
269 | EC_NISTP_64_GCC_128,- | ||
268 | ENGINE,- | 270 | ENGINE,- |
269 | ERR,- | 271 | ERR,- |
270 | EVP,- | 272 | EVP,- |
@@ -296,7 +298,9 @@ $ CONFIG_LOGICALS := AES,- | |||
296 | SHA256,- | 298 | SHA256,- |
297 | SHA512,- | 299 | SHA512,- |
298 | SOCK,- | 300 | SOCK,- |
301 | SRP,- | ||
299 | SSL2,- | 302 | SSL2,- |
303 | SSL_INTERN,- | ||
300 | STACK,- | 304 | STACK,- |
301 | STATIC_ENGINE,- | 305 | STATIC_ENGINE,- |
302 | STDIO,- | 306 | STDIO,- |
@@ -335,7 +339,8 @@ $ CONFIG_DISABLE_RULES := RIJNDAEL/AES;- | |||
335 | DSA/GOST;- | 339 | DSA/GOST;- |
336 | DH/GOST;- | 340 | DH/GOST;- |
337 | /STATIC_ENGINE;- | 341 | /STATIC_ENGINE;- |
338 | /KRB5 | 342 | /KRB5;- |
343 | /EC_NISTP_64_GCC_128 | ||
339 | $ CONFIG_ENABLE_RULES := ZLIB_DYNAMIC/ZLIB;- | 344 | $ CONFIG_ENABLE_RULES := ZLIB_DYNAMIC/ZLIB;- |
340 | /THREADS | 345 | /THREADS |
341 | $ | 346 | $ |
@@ -498,6 +503,9 @@ $ WRITE H_FILE " * value _IONBF is not supported." | |||
498 | $ WRITE H_FILE " * So, skip it on VMS." | 503 | $ WRITE H_FILE " * So, skip it on VMS." |
499 | $ WRITE H_FILE " */" | 504 | $ WRITE H_FILE " */" |
500 | $ WRITE H_FILE "#define OPENSSL_NO_SETVBUF_IONBF" | 505 | $ WRITE H_FILE "#define OPENSSL_NO_SETVBUF_IONBF" |
506 | $ WRITE H_FILE "/* STCP support comes with TCPIP 5.7 ECO 2 " | ||
507 | $ WRITE H_FILE " * enable on newer systems / 2012-02-24 arpadffy */" | ||
508 | $ WRITE H_FILE "#define OPENSSL_NO_SCTP" | ||
501 | $ WRITE H_FILE "" | 509 | $ WRITE H_FILE "" |
502 | $! | 510 | $! |
503 | $! Add in the common "crypto/opensslconf.h.in". | 511 | $! Add in the common "crypto/opensslconf.h.in". |
@@ -704,7 +712,7 @@ $ SDIRS := , - | |||
704 | BUFFER, BIO, STACK, LHASH, RAND, ERR, - | 712 | BUFFER, BIO, STACK, LHASH, RAND, ERR, - |
705 | EVP, ASN1, PEM, X509, X509V3, CONF, TXT_DB, PKCS7, PKCS12, - | 713 | EVP, ASN1, PEM, X509, X509V3, CONF, TXT_DB, PKCS7, PKCS12, - |
706 | COMP, OCSP, UI, KRB5, - | 714 | COMP, OCSP, UI, KRB5, - |
707 | STORE, CMS, PQUEUE, TS, JPAKE | 715 | CMS, PQUEUE, TS, JPAKE, SRP, STORE, CMAC |
708 | $! | 716 | $! |
709 | $ EXHEADER_ := crypto.h, opensslv.h, ebcdic.h, symhacks.h, ossl_typ.h | 717 | $ EXHEADER_ := crypto.h, opensslv.h, ebcdic.h, symhacks.h, ossl_typ.h |
710 | $ EXHEADER_'ARCHD' := opensslconf.h | 718 | $ EXHEADER_'ARCHD' := opensslconf.h |
@@ -756,12 +764,14 @@ $ EXHEADER_COMP := comp.h | |||
756 | $ EXHEADER_OCSP := ocsp.h | 764 | $ EXHEADER_OCSP := ocsp.h |
757 | $ EXHEADER_UI := ui.h, ui_compat.h | 765 | $ EXHEADER_UI := ui.h, ui_compat.h |
758 | $ EXHEADER_KRB5 := krb5_asn.h | 766 | $ EXHEADER_KRB5 := krb5_asn.h |
759 | $!!! EXHEADER_STORE := store.h, str_compat.h | ||
760 | $ EXHEADER_STORE := store.h | ||
761 | $ EXHEADER_CMS := cms.h | 767 | $ EXHEADER_CMS := cms.h |
762 | $ EXHEADER_PQUEUE := pqueue.h | 768 | $ EXHEADER_PQUEUE := pqueue.h |
763 | $ EXHEADER_TS := ts.h | 769 | $ EXHEADER_TS := ts.h |
764 | $ EXHEADER_JPAKE := jpake.h | 770 | $ EXHEADER_JPAKE := jpake.h |
771 | $ EXHEADER_SRP := srp.h | ||
772 | $!!! EXHEADER_STORE := store.h, str_compat.h | ||
773 | $ EXHEADER_STORE := store.h | ||
774 | $ EXHEADER_CMAC := cmac.h | ||
765 | $! | 775 | $! |
766 | $ i = 0 | 776 | $ i = 0 |
767 | $ loop_sdirs: | 777 | $ loop_sdirs: |
@@ -777,7 +787,7 @@ $! | |||
777 | $! Copy All The ".H" Files From The [.SSL] Directory. | 787 | $! Copy All The ".H" Files From The [.SSL] Directory. |
778 | $! | 788 | $! |
779 | $! (keep these in the same order as ssl/Makefile) | 789 | $! (keep these in the same order as ssl/Makefile) |
780 | $ EXHEADER := ssl.h, ssl2.h, ssl3.h, ssl23.h, tls1.h, dtls1.h, kssl.h | 790 | $ EXHEADER := ssl.h, ssl2.h, ssl3.h, ssl23.h, tls1.h, dtls1.h, kssl.h, srtp.h |
781 | $ copy sys$disk:[.ssl]'exheader' sys$disk:[.include.openssl] | 791 | $ copy sys$disk:[.ssl]'exheader' sys$disk:[.include.openssl] |
782 | $! | 792 | $! |
783 | $! Purge the [.include.openssl] header files. | 793 | $! Purge the [.include.openssl] header files. |
diff --git a/src/lib/libssl/src/ms/do_win64a.bat b/src/lib/libssl/src/ms/do_win64a.bat index 495f1ea7d8..ff8b19ccfd 100755 --- a/src/lib/libssl/src/ms/do_win64a.bat +++ b/src/lib/libssl/src/ms/do_win64a.bat | |||
@@ -1,9 +1,19 @@ | |||
1 | |||
2 | perl util\mkfiles.pl >MINFO | 1 | perl util\mkfiles.pl >MINFO |
3 | perl ms\uplink.pl win64a > ms\uptable.asm | 2 | |
3 | cmd /c "nasm -f win64 -v" >NUL: 2>&1 | ||
4 | if %errorlevel% neq 0 goto ml64 | ||
5 | |||
6 | perl ms\uplink-x86_64.pl nasm > ms\uptable.asm | ||
7 | nasm -f win64 -o ms\uptable.obj ms\uptable.asm | ||
8 | goto proceed | ||
9 | |||
10 | :ml64 | ||
11 | perl ms\uplink-x86_64.pl masm > ms\uptable.asm | ||
4 | ml64 -c -Foms\uptable.obj ms\uptable.asm | 12 | ml64 -c -Foms\uptable.obj ms\uptable.asm |
5 | perl util\mk1mf.pl no-asm VC-WIN64A >ms\nt.mak | 13 | |
6 | perl util\mk1mf.pl dll no-asm VC-WIN64A >ms\ntdll.mak | 14 | :proceed |
15 | perl util\mk1mf.pl VC-WIN64A >ms\nt.mak | ||
16 | perl util\mk1mf.pl dll VC-WIN64A >ms\ntdll.mak | ||
7 | 17 | ||
8 | perl util\mkdef.pl 32 libeay > ms\libeay32.def | 18 | perl util\mkdef.pl 32 libeay > ms\libeay32.def |
9 | perl util\mkdef.pl 32 ssleay > ms\ssleay32.def | 19 | perl util\mkdef.pl 32 ssleay > ms\ssleay32.def |
diff --git a/src/lib/libssl/src/ms/do_win64i.bat b/src/lib/libssl/src/ms/do_win64i.bat index 15ebcaaeb6..088f5e1d0a 100755 --- a/src/lib/libssl/src/ms/do_win64i.bat +++ b/src/lib/libssl/src/ms/do_win64i.bat | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | perl util\mkfiles.pl >MINFO | 2 | perl util\mkfiles.pl >MINFO |
3 | perl ms\uplink.pl win64i > ms\uptable.asm | 3 | perl ms\uplink-ia64.pl > ms\uptable.asm |
4 | ias -o ms\uptable.obj ms\uptable.asm | 4 | ias -o ms\uptable.obj ms\uptable.asm |
5 | perl util\mk1mf.pl no-asm VC-WIN64I >ms\nt.mak | 5 | perl util\mk1mf.pl VC-WIN64I >ms\nt.mak |
6 | perl util\mk1mf.pl dll no-asm VC-WIN64I >ms\ntdll.mak | 6 | perl util\mk1mf.pl dll VC-WIN64I >ms\ntdll.mak |
7 | 7 | ||
8 | perl util\mkdef.pl 32 libeay > ms\libeay32.def | 8 | perl util\mkdef.pl 32 libeay > ms\libeay32.def |
9 | perl util\mkdef.pl 32 ssleay > ms\ssleay32.def | 9 | perl util\mkdef.pl 32 ssleay > ms\ssleay32.def |
diff --git a/src/lib/libssl/src/ms/uplink.h b/src/lib/libssl/src/ms/uplink.h index a4a67d3c14..4881ba7d42 100644 --- a/src/lib/libssl/src/ms/uplink.h +++ b/src/lib/libssl/src/ms/uplink.h | |||
@@ -23,7 +23,7 @@ extern void *OPENSSL_UplinkTable[]; | |||
23 | #define UP_fileno (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FILENO]) | 23 | #define UP_fileno (*(int (*)(void *))OPENSSL_UplinkTable[APPLINK_FILENO]) |
24 | 24 | ||
25 | #define UP_open (*(int (*)(const char *,int,...))OPENSSL_UplinkTable[APPLINK_OPEN]) | 25 | #define UP_open (*(int (*)(const char *,int,...))OPENSSL_UplinkTable[APPLINK_OPEN]) |
26 | #define UP_read (*(ssize_t (*)(int,void *,size_t))OPENSSL_UplinkTable[APPLINK_READ]) | 26 | #define UP_read (*(ossl_ssize_t (*)(int,void *,size_t))OPENSSL_UplinkTable[APPLINK_READ]) |
27 | #define UP_write (*(ssize_t (*)(int,const void *,size_t))OPENSSL_UplinkTable[APPLINK_WRITE]) | 27 | #define UP_write (*(ossl_ssize_t (*)(int,const void *,size_t))OPENSSL_UplinkTable[APPLINK_WRITE]) |
28 | #define UP_lseek (*(long (*)(int,long,int))OPENSSL_UplinkTable[APPLINK_LSEEK]) | 28 | #define UP_lseek (*(long (*)(int,long,int))OPENSSL_UplinkTable[APPLINK_LSEEK]) |
29 | #define UP_close (*(int (*)(int))OPENSSL_UplinkTable[APPLINK_CLOSE]) | 29 | #define UP_close (*(int (*)(int))OPENSSL_UplinkTable[APPLINK_CLOSE]) |
diff --git a/src/lib/libssl/src/openssl.spec b/src/lib/libssl/src/openssl.spec index 703cea2a5f..0d86222e43 100644 --- a/src/lib/libssl/src/openssl.spec +++ b/src/lib/libssl/src/openssl.spec | |||
@@ -1,8 +1,8 @@ | |||
1 | %define _unpackaged_files_terminate_build 0 | 1 | %define _unpackaged_files_terminate_build 0 |
2 | %define libmaj 1 | 2 | %define libmaj 1 |
3 | %define libmin 0 | 3 | %define libmin 0 |
4 | %define librel 0 | 4 | %define librel 1 |
5 | %define librev f | 5 | %define librev c |
6 | Release: 1 | 6 | Release: 1 |
7 | 7 | ||
8 | %define openssldir /var/ssl | 8 | %define openssldir /var/ssl |
diff --git a/src/lib/libssl/src/ssl/Makefile b/src/lib/libssl/src/ssl/Makefile index 2b275faf6a..feaf3e358a 100644 --- a/src/lib/libssl/src/ssl/Makefile +++ b/src/lib/libssl/src/ssl/Makefile | |||
@@ -26,26 +26,26 @@ LIBSRC= \ | |||
26 | s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c s23_pkt.c \ | 26 | s23_meth.c s23_srvr.c s23_clnt.c s23_lib.c s23_pkt.c \ |
27 | t1_meth.c t1_srvr.c t1_clnt.c t1_lib.c t1_enc.c \ | 27 | t1_meth.c t1_srvr.c t1_clnt.c t1_lib.c t1_enc.c \ |
28 | d1_meth.c d1_srvr.c d1_clnt.c d1_lib.c d1_pkt.c \ | 28 | d1_meth.c d1_srvr.c d1_clnt.c d1_lib.c d1_pkt.c \ |
29 | d1_both.c d1_enc.c \ | 29 | d1_both.c d1_enc.c d1_srtp.c \ |
30 | ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \ | 30 | ssl_lib.c ssl_err2.c ssl_cert.c ssl_sess.c \ |
31 | ssl_ciph.c ssl_stat.c ssl_rsa.c \ | 31 | ssl_ciph.c ssl_stat.c ssl_rsa.c \ |
32 | ssl_asn1.c ssl_txt.c ssl_algs.c \ | 32 | ssl_asn1.c ssl_txt.c ssl_algs.c \ |
33 | bio_ssl.c ssl_err.c kssl.c t1_reneg.c | 33 | bio_ssl.c ssl_err.c kssl.c tls_srp.c t1_reneg.c |
34 | LIBOBJ= \ | 34 | LIBOBJ= \ |
35 | s2_meth.o s2_srvr.o s2_clnt.o s2_lib.o s2_enc.o s2_pkt.o \ | 35 | s2_meth.o s2_srvr.o s2_clnt.o s2_lib.o s2_enc.o s2_pkt.o \ |
36 | s3_meth.o s3_srvr.o s3_clnt.o s3_lib.o s3_enc.o s3_pkt.o s3_both.o \ | 36 | s3_meth.o s3_srvr.o s3_clnt.o s3_lib.o s3_enc.o s3_pkt.o s3_both.o \ |
37 | s23_meth.o s23_srvr.o s23_clnt.o s23_lib.o s23_pkt.o \ | 37 | s23_meth.o s23_srvr.o s23_clnt.o s23_lib.o s23_pkt.o \ |
38 | t1_meth.o t1_srvr.o t1_clnt.o t1_lib.o t1_enc.o \ | 38 | t1_meth.o t1_srvr.o t1_clnt.o t1_lib.o t1_enc.o \ |
39 | d1_meth.o d1_srvr.o d1_clnt.o d1_lib.o d1_pkt.o \ | 39 | d1_meth.o d1_srvr.o d1_clnt.o d1_lib.o d1_pkt.o \ |
40 | d1_both.o d1_enc.o \ | 40 | d1_both.o d1_enc.o d1_srtp.o\ |
41 | ssl_lib.o ssl_err2.o ssl_cert.o ssl_sess.o \ | 41 | ssl_lib.o ssl_err2.o ssl_cert.o ssl_sess.o \ |
42 | ssl_ciph.o ssl_stat.o ssl_rsa.o \ | 42 | ssl_ciph.o ssl_stat.o ssl_rsa.o \ |
43 | ssl_asn1.o ssl_txt.o ssl_algs.o \ | 43 | ssl_asn1.o ssl_txt.o ssl_algs.o \ |
44 | bio_ssl.o ssl_err.o kssl.o t1_reneg.o | 44 | bio_ssl.o ssl_err.o kssl.o tls_srp.o t1_reneg.o |
45 | 45 | ||
46 | SRC= $(LIBSRC) | 46 | SRC= $(LIBSRC) |
47 | 47 | ||
48 | EXHEADER= ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h | 48 | EXHEADER= ssl.h ssl2.h ssl3.h ssl23.h tls1.h dtls1.h kssl.h srtp.h |
49 | HEADER= $(EXHEADER) ssl_locl.h kssl_lcl.h | 49 | HEADER= $(EXHEADER) ssl_locl.h kssl_lcl.h |
50 | 50 | ||
51 | ALL= $(GENERAL) $(SRC) $(HEADER) | 51 | ALL= $(GENERAL) $(SRC) $(HEADER) |
@@ -118,11 +118,11 @@ bio_ssl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
118 | bio_ssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 118 | bio_ssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
119 | bio_ssl.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 119 | bio_ssl.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
120 | bio_ssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 120 | bio_ssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
121 | bio_ssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 121 | bio_ssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
122 | bio_ssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 122 | bio_ssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
123 | bio_ssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 123 | bio_ssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
124 | bio_ssl.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 124 | bio_ssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
125 | bio_ssl.o: ../include/openssl/x509_vfy.h bio_ssl.c | 125 | bio_ssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bio_ssl.c |
126 | d1_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 126 | d1_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
127 | d1_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 127 | d1_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
128 | d1_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 128 | d1_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -137,12 +137,12 @@ d1_both.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
137 | d1_both.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 137 | d1_both.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
138 | d1_both.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 138 | d1_both.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
139 | d1_both.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 139 | d1_both.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
140 | d1_both.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 140 | d1_both.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
141 | d1_both.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 141 | d1_both.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
142 | d1_both.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 142 | d1_both.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
143 | d1_both.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 143 | d1_both.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
144 | d1_both.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_both.c | 144 | d1_both.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
145 | d1_both.o: ssl_locl.h | 145 | d1_both.o: ../include/openssl/x509_vfy.h d1_both.c ssl_locl.h |
146 | d1_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 146 | d1_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
147 | d1_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 147 | d1_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
148 | d1_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h | 148 | d1_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h |
@@ -159,11 +159,12 @@ d1_clnt.o: ../include/openssl/pem.h ../include/openssl/pem2.h | |||
159 | d1_clnt.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 159 | d1_clnt.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
160 | d1_clnt.o: ../include/openssl/rand.h ../include/openssl/rsa.h | 160 | d1_clnt.o: ../include/openssl/rand.h ../include/openssl/rsa.h |
161 | d1_clnt.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 161 | d1_clnt.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
162 | d1_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 162 | d1_clnt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
163 | d1_clnt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 163 | d1_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
164 | d1_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 164 | d1_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
165 | d1_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 165 | d1_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
166 | d1_clnt.o: ../include/openssl/x509_vfy.h d1_clnt.c kssl_lcl.h ssl_locl.h | 166 | d1_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_clnt.c |
167 | d1_clnt.o: kssl_lcl.h ssl_locl.h | ||
167 | d1_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 168 | d1_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
168 | d1_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 169 | d1_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
169 | d1_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 170 | d1_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -179,11 +180,12 @@ d1_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h | |||
179 | d1_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 180 | d1_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
180 | d1_enc.o: ../include/openssl/rand.h ../include/openssl/rsa.h | 181 | d1_enc.o: ../include/openssl/rand.h ../include/openssl/rsa.h |
181 | d1_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 182 | d1_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
182 | d1_enc.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 183 | d1_enc.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
183 | d1_enc.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 184 | d1_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
184 | d1_enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 185 | d1_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
185 | d1_enc.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 186 | d1_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
186 | d1_enc.o: ../include/openssl/x509_vfy.h d1_enc.c ssl_locl.h | 187 | d1_enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_enc.c |
188 | d1_enc.o: ssl_locl.h | ||
187 | d1_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 189 | d1_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
188 | d1_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 190 | d1_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
189 | d1_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 191 | d1_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -198,11 +200,12 @@ d1_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
198 | d1_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 200 | d1_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
199 | d1_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 201 | d1_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
200 | d1_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 202 | d1_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
201 | d1_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 203 | d1_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
202 | d1_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 204 | d1_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
203 | d1_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 205 | d1_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
204 | d1_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 206 | d1_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
205 | d1_lib.o: ../include/openssl/x509_vfy.h d1_lib.c ssl_locl.h | 207 | d1_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_lib.c |
208 | d1_lib.o: ssl_locl.h | ||
206 | d1_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 209 | d1_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
207 | d1_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 210 | d1_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
208 | d1_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 211 | d1_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -217,11 +220,12 @@ d1_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
217 | d1_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 220 | d1_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
218 | d1_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 221 | d1_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
219 | d1_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 222 | d1_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
220 | d1_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 223 | d1_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
221 | d1_meth.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 224 | d1_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
222 | d1_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 225 | d1_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
223 | d1_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 226 | d1_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
224 | d1_meth.o: ../include/openssl/x509_vfy.h d1_meth.c ssl_locl.h | 227 | d1_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_meth.c |
228 | d1_meth.o: ssl_locl.h | ||
225 | d1_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 229 | d1_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
226 | d1_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 230 | d1_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
227 | d1_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 231 | d1_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -236,12 +240,32 @@ d1_pkt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
236 | d1_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 240 | d1_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
237 | d1_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 241 | d1_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
238 | d1_pkt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 242 | d1_pkt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
239 | d1_pkt.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 243 | d1_pkt.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
240 | d1_pkt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 244 | d1_pkt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
241 | d1_pkt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 245 | d1_pkt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
242 | d1_pkt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 246 | d1_pkt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
243 | d1_pkt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_pkt.c | 247 | d1_pkt.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
244 | d1_pkt.o: ssl_locl.h | 248 | d1_pkt.o: ../include/openssl/x509_vfy.h d1_pkt.c ssl_locl.h |
249 | d1_srtp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
250 | d1_srtp.o: ../include/openssl/buffer.h ../include/openssl/comp.h | ||
251 | d1_srtp.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | ||
252 | d1_srtp.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h | ||
253 | d1_srtp.o: ../include/openssl/ec.h ../include/openssl/ecdh.h | ||
254 | d1_srtp.o: ../include/openssl/ecdsa.h ../include/openssl/err.h | ||
255 | d1_srtp.o: ../include/openssl/evp.h ../include/openssl/hmac.h | ||
256 | d1_srtp.o: ../include/openssl/kssl.h ../include/openssl/lhash.h | ||
257 | d1_srtp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
258 | d1_srtp.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
259 | d1_srtp.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | ||
260 | d1_srtp.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | ||
261 | d1_srtp.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | ||
262 | d1_srtp.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
263 | d1_srtp.o: ../include/openssl/srtp.h ../include/openssl/ssl.h | ||
264 | d1_srtp.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | ||
265 | d1_srtp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | ||
266 | d1_srtp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | ||
267 | d1_srtp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_srtp.c | ||
268 | d1_srtp.o: srtp.h ssl_locl.h | ||
245 | d1_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 269 | d1_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
246 | d1_srvr.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 270 | d1_srvr.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
247 | d1_srvr.o: ../include/openssl/comp.h ../include/openssl/crypto.h | 271 | d1_srvr.o: ../include/openssl/comp.h ../include/openssl/crypto.h |
@@ -258,11 +282,12 @@ d1_srvr.o: ../include/openssl/pem.h ../include/openssl/pem2.h | |||
258 | d1_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 282 | d1_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
259 | d1_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h | 283 | d1_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h |
260 | d1_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 284 | d1_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
261 | d1_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 285 | d1_srvr.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
262 | d1_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 286 | d1_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
263 | d1_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 287 | d1_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
264 | d1_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 288 | d1_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
265 | d1_srvr.o: ../include/openssl/x509_vfy.h d1_srvr.c ssl_locl.h | 289 | d1_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_srvr.c |
290 | d1_srvr.o: ssl_locl.h | ||
266 | kssl.o: ../include/openssl/asn1.h ../include/openssl/bio.h | 291 | kssl.o: ../include/openssl/asn1.h ../include/openssl/bio.h |
267 | kssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 292 | kssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
268 | kssl.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h | 293 | kssl.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h |
@@ -276,11 +301,12 @@ kssl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
276 | kssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 301 | kssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
277 | kssl.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 302 | kssl.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
278 | kssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 303 | kssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
279 | kssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 304 | kssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
280 | kssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 305 | kssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
281 | kssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 306 | kssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
282 | kssl.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 307 | kssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
283 | kssl.o: ../include/openssl/x509_vfy.h kssl.c kssl_lcl.h | 308 | kssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h kssl.c |
309 | kssl.o: kssl_lcl.h | ||
284 | s23_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 310 | s23_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
285 | s23_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 311 | s23_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
286 | s23_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 312 | s23_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -295,12 +321,12 @@ s23_clnt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
295 | s23_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 321 | s23_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
296 | s23_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 322 | s23_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
297 | s23_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 323 | s23_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
298 | s23_clnt.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 324 | s23_clnt.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
299 | s23_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 325 | s23_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
300 | s23_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 326 | s23_clnt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
301 | s23_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 327 | s23_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
302 | s23_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s23_clnt.c | 328 | s23_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
303 | s23_clnt.o: ssl_locl.h | 329 | s23_clnt.o: ../include/openssl/x509_vfy.h s23_clnt.c ssl_locl.h |
304 | s23_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 330 | s23_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
305 | s23_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 331 | s23_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
306 | s23_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 332 | s23_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -315,11 +341,12 @@ s23_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
315 | s23_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 341 | s23_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
316 | s23_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 342 | s23_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
317 | s23_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 343 | s23_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
318 | s23_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 344 | s23_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
319 | s23_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 345 | s23_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
320 | s23_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 346 | s23_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
321 | s23_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 347 | s23_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
322 | s23_lib.o: ../include/openssl/x509_vfy.h s23_lib.c ssl_locl.h | 348 | s23_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s23_lib.c |
349 | s23_lib.o: ssl_locl.h | ||
323 | s23_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 350 | s23_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
324 | s23_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 351 | s23_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
325 | s23_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 352 | s23_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -334,11 +361,12 @@ s23_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
334 | s23_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 361 | s23_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
335 | s23_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 362 | s23_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
336 | s23_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 363 | s23_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
337 | s23_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 364 | s23_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
338 | s23_meth.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 365 | s23_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
339 | s23_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 366 | s23_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
340 | s23_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 367 | s23_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
341 | s23_meth.o: ../include/openssl/x509_vfy.h s23_meth.c ssl_locl.h | 368 | s23_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s23_meth.c |
369 | s23_meth.o: ssl_locl.h | ||
342 | s23_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 370 | s23_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
343 | s23_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 371 | s23_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
344 | s23_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 372 | s23_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -353,11 +381,12 @@ s23_pkt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
353 | s23_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 381 | s23_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
354 | s23_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 382 | s23_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
355 | s23_pkt.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 383 | s23_pkt.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
356 | s23_pkt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 384 | s23_pkt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
357 | s23_pkt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 385 | s23_pkt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
358 | s23_pkt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 386 | s23_pkt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
359 | s23_pkt.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 387 | s23_pkt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
360 | s23_pkt.o: ../include/openssl/x509_vfy.h s23_pkt.c ssl_locl.h | 388 | s23_pkt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s23_pkt.c |
389 | s23_pkt.o: ssl_locl.h | ||
361 | s23_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 390 | s23_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
362 | s23_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 391 | s23_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
363 | s23_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 392 | s23_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -372,12 +401,12 @@ s23_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
372 | s23_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 401 | s23_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
373 | s23_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 402 | s23_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
374 | s23_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 403 | s23_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
375 | s23_srvr.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 404 | s23_srvr.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
376 | s23_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 405 | s23_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
377 | s23_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 406 | s23_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
378 | s23_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 407 | s23_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
379 | s23_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s23_srvr.c | 408 | s23_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
380 | s23_srvr.o: ssl_locl.h | 409 | s23_srvr.o: ../include/openssl/x509_vfy.h s23_srvr.c ssl_locl.h |
381 | s2_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 410 | s2_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
382 | s2_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 411 | s2_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
383 | s2_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 412 | s2_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -392,12 +421,12 @@ s2_clnt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
392 | s2_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 421 | s2_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
393 | s2_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 422 | s2_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
394 | s2_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 423 | s2_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
395 | s2_clnt.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 424 | s2_clnt.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
396 | s2_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 425 | s2_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
397 | s2_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 426 | s2_clnt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
398 | s2_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 427 | s2_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
399 | s2_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_clnt.c | 428 | s2_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
400 | s2_clnt.o: ssl_locl.h | 429 | s2_clnt.o: ../include/openssl/x509_vfy.h s2_clnt.c ssl_locl.h |
401 | s2_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 430 | s2_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
402 | s2_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 431 | s2_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
403 | s2_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 432 | s2_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -412,11 +441,12 @@ s2_enc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
412 | s2_enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 441 | s2_enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
413 | s2_enc.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 442 | s2_enc.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
414 | s2_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 443 | s2_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
415 | s2_enc.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 444 | s2_enc.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
416 | s2_enc.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 445 | s2_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
417 | s2_enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 446 | s2_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
418 | s2_enc.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 447 | s2_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
419 | s2_enc.o: ../include/openssl/x509_vfy.h s2_enc.c ssl_locl.h | 448 | s2_enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_enc.c |
449 | s2_enc.o: ssl_locl.h | ||
420 | s2_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 450 | s2_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
421 | s2_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 451 | s2_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
422 | s2_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 452 | s2_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -431,12 +461,12 @@ s2_lib.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
431 | s2_lib.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 461 | s2_lib.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
432 | s2_lib.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 462 | s2_lib.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
433 | s2_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 463 | s2_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
434 | s2_lib.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 464 | s2_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
435 | s2_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 465 | s2_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
436 | s2_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 466 | s2_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
437 | s2_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 467 | s2_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
438 | s2_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_lib.c | 468 | s2_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
439 | s2_lib.o: ssl_locl.h | 469 | s2_lib.o: ../include/openssl/x509_vfy.h s2_lib.c ssl_locl.h |
440 | s2_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 470 | s2_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
441 | s2_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 471 | s2_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
442 | s2_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 472 | s2_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -451,11 +481,12 @@ s2_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
451 | s2_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 481 | s2_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
452 | s2_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 482 | s2_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
453 | s2_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 483 | s2_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
454 | s2_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 484 | s2_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
455 | s2_meth.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 485 | s2_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
456 | s2_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 486 | s2_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
457 | s2_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 487 | s2_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
458 | s2_meth.o: ../include/openssl/x509_vfy.h s2_meth.c ssl_locl.h | 488 | s2_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_meth.c |
489 | s2_meth.o: ssl_locl.h | ||
459 | s2_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 490 | s2_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
460 | s2_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 491 | s2_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
461 | s2_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 492 | s2_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -470,11 +501,12 @@ s2_pkt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
470 | s2_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 501 | s2_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
471 | s2_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 502 | s2_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
472 | s2_pkt.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 503 | s2_pkt.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
473 | s2_pkt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 504 | s2_pkt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
474 | s2_pkt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 505 | s2_pkt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
475 | s2_pkt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 506 | s2_pkt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
476 | s2_pkt.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 507 | s2_pkt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
477 | s2_pkt.o: ../include/openssl/x509_vfy.h s2_pkt.c ssl_locl.h | 508 | s2_pkt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_pkt.c |
509 | s2_pkt.o: ssl_locl.h | ||
478 | s2_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 510 | s2_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
479 | s2_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 511 | s2_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
480 | s2_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 512 | s2_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -489,12 +521,12 @@ s2_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
489 | s2_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 521 | s2_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
490 | s2_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 522 | s2_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
491 | s2_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 523 | s2_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
492 | s2_srvr.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 524 | s2_srvr.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
493 | s2_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 525 | s2_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
494 | s2_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 526 | s2_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
495 | s2_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 527 | s2_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
496 | s2_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_srvr.c | 528 | s2_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
497 | s2_srvr.o: ssl_locl.h | 529 | s2_srvr.o: ../include/openssl/x509_vfy.h s2_srvr.c ssl_locl.h |
498 | s3_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 530 | s3_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
499 | s3_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 531 | s3_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
500 | s3_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 532 | s3_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -509,12 +541,12 @@ s3_both.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
509 | s3_both.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 541 | s3_both.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
510 | s3_both.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 542 | s3_both.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
511 | s3_both.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 543 | s3_both.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
512 | s3_both.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 544 | s3_both.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
513 | s3_both.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 545 | s3_both.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
514 | s3_both.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 546 | s3_both.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
515 | s3_both.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 547 | s3_both.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
516 | s3_both.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s3_both.c | 548 | s3_both.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
517 | s3_both.o: ssl_locl.h | 549 | s3_both.o: ../include/openssl/x509_vfy.h s3_both.c ssl_locl.h |
518 | s3_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 550 | s3_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
519 | s3_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 551 | s3_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
520 | s3_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h | 552 | s3_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h |
@@ -531,12 +563,12 @@ s3_clnt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
531 | s3_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 563 | s3_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
532 | s3_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 564 | s3_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
533 | s3_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 565 | s3_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
534 | s3_clnt.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 566 | s3_clnt.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
535 | s3_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 567 | s3_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
536 | s3_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 568 | s3_clnt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
537 | s3_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 569 | s3_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
538 | s3_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h kssl_lcl.h | 570 | s3_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
539 | s3_clnt.o: s3_clnt.c ssl_locl.h | 571 | s3_clnt.o: ../include/openssl/x509_vfy.h kssl_lcl.h s3_clnt.c ssl_locl.h |
540 | s3_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 572 | s3_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
541 | s3_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 573 | s3_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
542 | s3_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 574 | s3_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -551,12 +583,12 @@ s3_enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
551 | s3_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 583 | s3_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
552 | s3_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 584 | s3_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
553 | s3_enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 585 | s3_enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
554 | s3_enc.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 586 | s3_enc.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
555 | s3_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 587 | s3_enc.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
556 | s3_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 588 | s3_enc.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
557 | s3_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 589 | s3_enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
558 | s3_enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s3_enc.c | 590 | s3_enc.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
559 | s3_enc.o: ssl_locl.h | 591 | s3_enc.o: ../include/openssl/x509_vfy.h s3_enc.c ssl_locl.h |
560 | s3_lib.o: ../crypto/ec/ec_lcl.h ../e_os.h ../include/openssl/asn1.h | 592 | s3_lib.o: ../crypto/ec/ec_lcl.h ../e_os.h ../include/openssl/asn1.h |
561 | s3_lib.o: ../include/openssl/bio.h ../include/openssl/bn.h | 593 | s3_lib.o: ../include/openssl/bio.h ../include/openssl/bn.h |
562 | s3_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 594 | s3_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
@@ -573,11 +605,12 @@ s3_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
573 | s3_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 605 | s3_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
574 | s3_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 606 | s3_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
575 | s3_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 607 | s3_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
576 | s3_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 608 | s3_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
577 | s3_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 609 | s3_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
578 | s3_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 610 | s3_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
579 | s3_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 611 | s3_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
580 | s3_lib.o: ../include/openssl/x509_vfy.h kssl_lcl.h s3_lib.c ssl_locl.h | 612 | s3_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h kssl_lcl.h |
613 | s3_lib.o: s3_lib.c ssl_locl.h | ||
581 | s3_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 614 | s3_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
582 | s3_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 615 | s3_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
583 | s3_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 616 | s3_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -592,11 +625,12 @@ s3_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
592 | s3_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 625 | s3_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
593 | s3_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 626 | s3_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
594 | s3_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 627 | s3_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
595 | s3_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 628 | s3_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
596 | s3_meth.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 629 | s3_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
597 | s3_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 630 | s3_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
598 | s3_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 631 | s3_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
599 | s3_meth.o: ../include/openssl/x509_vfy.h s3_meth.c ssl_locl.h | 632 | s3_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s3_meth.c |
633 | s3_meth.o: ssl_locl.h | ||
600 | s3_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 634 | s3_pkt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
601 | s3_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 635 | s3_pkt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
602 | s3_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 636 | s3_pkt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -609,8 +643,9 @@ s3_pkt.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | |||
609 | s3_pkt.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | 643 | s3_pkt.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h |
610 | s3_pkt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 644 | s3_pkt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
611 | s3_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 645 | s3_pkt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
612 | s3_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 646 | s3_pkt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
613 | s3_pkt.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 647 | s3_pkt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
648 | s3_pkt.o: ../include/openssl/sha.h ../include/openssl/srtp.h | ||
614 | s3_pkt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 649 | s3_pkt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
615 | s3_pkt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 650 | s3_pkt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
616 | s3_pkt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 651 | s3_pkt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
@@ -632,12 +667,12 @@ s3_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
632 | s3_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 667 | s3_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
633 | s3_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 668 | s3_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
634 | s3_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 669 | s3_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
635 | s3_srvr.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 670 | s3_srvr.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
636 | s3_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 671 | s3_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
637 | s3_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 672 | s3_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
638 | s3_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 673 | s3_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
639 | s3_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h kssl_lcl.h | 674 | s3_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
640 | s3_srvr.o: s3_srvr.c ssl_locl.h | 675 | s3_srvr.o: ../include/openssl/x509_vfy.h kssl_lcl.h s3_srvr.c ssl_locl.h |
641 | ssl_algs.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 676 | ssl_algs.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
642 | ssl_algs.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 677 | ssl_algs.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
643 | ssl_algs.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 678 | ssl_algs.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -652,11 +687,12 @@ ssl_algs.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
652 | ssl_algs.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 687 | ssl_algs.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
653 | ssl_algs.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 688 | ssl_algs.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
654 | ssl_algs.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 689 | ssl_algs.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
655 | ssl_algs.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 690 | ssl_algs.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
656 | ssl_algs.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 691 | ssl_algs.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
657 | ssl_algs.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 692 | ssl_algs.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
658 | ssl_algs.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 693 | ssl_algs.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
659 | ssl_algs.o: ../include/openssl/x509_vfy.h ssl_algs.c ssl_locl.h | 694 | ssl_algs.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_algs.c |
695 | ssl_algs.o: ssl_locl.h | ||
660 | ssl_asn1.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/asn1_mac.h | 696 | ssl_asn1.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/asn1_mac.h |
661 | ssl_asn1.o: ../include/openssl/bio.h ../include/openssl/buffer.h | 697 | ssl_asn1.o: ../include/openssl/bio.h ../include/openssl/buffer.h |
662 | ssl_asn1.o: ../include/openssl/comp.h ../include/openssl/crypto.h | 698 | ssl_asn1.o: ../include/openssl/comp.h ../include/openssl/crypto.h |
@@ -671,12 +707,12 @@ ssl_asn1.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
671 | ssl_asn1.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 707 | ssl_asn1.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
672 | ssl_asn1.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 708 | ssl_asn1.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
673 | ssl_asn1.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 709 | ssl_asn1.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
674 | ssl_asn1.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 710 | ssl_asn1.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
675 | ssl_asn1.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 711 | ssl_asn1.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
676 | ssl_asn1.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 712 | ssl_asn1.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
677 | ssl_asn1.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 713 | ssl_asn1.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
678 | ssl_asn1.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_asn1.c | 714 | ssl_asn1.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
679 | ssl_asn1.o: ssl_locl.h | 715 | ssl_asn1.o: ../include/openssl/x509_vfy.h ssl_asn1.c ssl_locl.h |
680 | ssl_cert.o: ../crypto/o_dir.h ../e_os.h ../include/openssl/asn1.h | 716 | ssl_cert.o: ../crypto/o_dir.h ../e_os.h ../include/openssl/asn1.h |
681 | ssl_cert.o: ../include/openssl/bio.h ../include/openssl/bn.h | 717 | ssl_cert.o: ../include/openssl/bio.h ../include/openssl/bn.h |
682 | ssl_cert.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 718 | ssl_cert.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
@@ -693,12 +729,12 @@ ssl_cert.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
693 | ssl_cert.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 729 | ssl_cert.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
694 | ssl_cert.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 730 | ssl_cert.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
695 | ssl_cert.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 731 | ssl_cert.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
696 | ssl_cert.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 732 | ssl_cert.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
697 | ssl_cert.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 733 | ssl_cert.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
698 | ssl_cert.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 734 | ssl_cert.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
699 | ssl_cert.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 735 | ssl_cert.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
700 | ssl_cert.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h | 736 | ssl_cert.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h |
701 | ssl_cert.o: ssl_cert.c ssl_locl.h | 737 | ssl_cert.o: ../include/openssl/x509v3.h ssl_cert.c ssl_locl.h |
702 | ssl_ciph.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 738 | ssl_ciph.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
703 | ssl_ciph.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 739 | ssl_ciph.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
704 | ssl_ciph.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 740 | ssl_ciph.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -713,12 +749,12 @@ ssl_ciph.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
713 | ssl_ciph.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 749 | ssl_ciph.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
714 | ssl_ciph.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 750 | ssl_ciph.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
715 | ssl_ciph.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 751 | ssl_ciph.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
716 | ssl_ciph.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 752 | ssl_ciph.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
717 | ssl_ciph.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 753 | ssl_ciph.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
718 | ssl_ciph.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 754 | ssl_ciph.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
719 | ssl_ciph.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 755 | ssl_ciph.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
720 | ssl_ciph.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_ciph.c | 756 | ssl_ciph.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
721 | ssl_ciph.o: ssl_locl.h | 757 | ssl_ciph.o: ../include/openssl/x509_vfy.h ssl_ciph.c ssl_locl.h |
722 | ssl_err.o: ../include/openssl/asn1.h ../include/openssl/bio.h | 758 | ssl_err.o: ../include/openssl/asn1.h ../include/openssl/bio.h |
723 | ssl_err.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 759 | ssl_err.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
724 | ssl_err.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h | 760 | ssl_err.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h |
@@ -732,11 +768,11 @@ ssl_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
732 | ssl_err.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 768 | ssl_err.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
733 | ssl_err.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 769 | ssl_err.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
734 | ssl_err.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 770 | ssl_err.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
735 | ssl_err.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 771 | ssl_err.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
736 | ssl_err.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 772 | ssl_err.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
737 | ssl_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 773 | ssl_err.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
738 | ssl_err.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 774 | ssl_err.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
739 | ssl_err.o: ../include/openssl/x509_vfy.h ssl_err.c | 775 | ssl_err.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_err.c |
740 | ssl_err2.o: ../include/openssl/asn1.h ../include/openssl/bio.h | 776 | ssl_err2.o: ../include/openssl/asn1.h ../include/openssl/bio.h |
741 | ssl_err2.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 777 | ssl_err2.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
742 | ssl_err2.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h | 778 | ssl_err2.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h |
@@ -750,11 +786,11 @@ ssl_err2.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | |||
750 | ssl_err2.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 786 | ssl_err2.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
751 | ssl_err2.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 787 | ssl_err2.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
752 | ssl_err2.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 788 | ssl_err2.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
753 | ssl_err2.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 789 | ssl_err2.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
754 | ssl_err2.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 790 | ssl_err2.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
755 | ssl_err2.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 791 | ssl_err2.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
756 | ssl_err2.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 792 | ssl_err2.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
757 | ssl_err2.o: ../include/openssl/x509_vfy.h ssl_err2.c | 793 | ssl_err2.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_err2.c |
758 | ssl_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 794 | ssl_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
759 | ssl_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 795 | ssl_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
760 | ssl_lib.o: ../include/openssl/conf.h ../include/openssl/crypto.h | 796 | ssl_lib.o: ../include/openssl/conf.h ../include/openssl/crypto.h |
@@ -771,12 +807,13 @@ ssl_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
771 | ssl_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 807 | ssl_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
772 | ssl_lib.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 808 | ssl_lib.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
773 | ssl_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 809 | ssl_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
774 | ssl_lib.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 810 | ssl_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
775 | ssl_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 811 | ssl_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
776 | ssl_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 812 | ssl_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
777 | ssl_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 813 | ssl_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
778 | ssl_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h | 814 | ssl_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
779 | ssl_lib.o: ../include/openssl/x509v3.h kssl_lcl.h ssl_lib.c ssl_locl.h | 815 | ssl_lib.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h kssl_lcl.h |
816 | ssl_lib.o: ssl_lib.c ssl_locl.h | ||
780 | ssl_rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 817 | ssl_rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
781 | ssl_rsa.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 818 | ssl_rsa.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
782 | ssl_rsa.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 819 | ssl_rsa.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -791,11 +828,12 @@ ssl_rsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
791 | ssl_rsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 828 | ssl_rsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
792 | ssl_rsa.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 829 | ssl_rsa.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
793 | ssl_rsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 830 | ssl_rsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
794 | ssl_rsa.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 831 | ssl_rsa.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
795 | ssl_rsa.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 832 | ssl_rsa.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
796 | ssl_rsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 833 | ssl_rsa.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
797 | ssl_rsa.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 834 | ssl_rsa.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
798 | ssl_rsa.o: ../include/openssl/x509_vfy.h ssl_locl.h ssl_rsa.c | 835 | ssl_rsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h |
836 | ssl_rsa.o: ssl_rsa.c | ||
799 | ssl_sess.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 837 | ssl_sess.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
800 | ssl_sess.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 838 | ssl_sess.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
801 | ssl_sess.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 839 | ssl_sess.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -811,11 +849,12 @@ ssl_sess.o: ../include/openssl/pem.h ../include/openssl/pem2.h | |||
811 | ssl_sess.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 849 | ssl_sess.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
812 | ssl_sess.o: ../include/openssl/rand.h ../include/openssl/rsa.h | 850 | ssl_sess.o: ../include/openssl/rand.h ../include/openssl/rsa.h |
813 | ssl_sess.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 851 | ssl_sess.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
814 | ssl_sess.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 852 | ssl_sess.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
815 | ssl_sess.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 853 | ssl_sess.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
816 | ssl_sess.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 854 | ssl_sess.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
817 | ssl_sess.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 855 | ssl_sess.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
818 | ssl_sess.o: ../include/openssl/x509_vfy.h ssl_locl.h ssl_sess.c | 856 | ssl_sess.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h |
857 | ssl_sess.o: ssl_sess.c | ||
819 | ssl_stat.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 858 | ssl_stat.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
820 | ssl_stat.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 859 | ssl_stat.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
821 | ssl_stat.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 860 | ssl_stat.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -830,11 +869,12 @@ ssl_stat.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
830 | ssl_stat.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 869 | ssl_stat.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
831 | ssl_stat.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 870 | ssl_stat.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
832 | ssl_stat.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 871 | ssl_stat.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
833 | ssl_stat.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 872 | ssl_stat.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
834 | ssl_stat.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 873 | ssl_stat.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
835 | ssl_stat.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 874 | ssl_stat.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
836 | ssl_stat.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 875 | ssl_stat.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
837 | ssl_stat.o: ../include/openssl/x509_vfy.h ssl_locl.h ssl_stat.c | 876 | ssl_stat.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h |
877 | ssl_stat.o: ssl_stat.c | ||
838 | ssl_txt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 878 | ssl_txt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
839 | ssl_txt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 879 | ssl_txt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
840 | ssl_txt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 880 | ssl_txt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -849,11 +889,12 @@ ssl_txt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
849 | ssl_txt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 889 | ssl_txt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
850 | ssl_txt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 890 | ssl_txt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
851 | ssl_txt.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 891 | ssl_txt.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
852 | ssl_txt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 892 | ssl_txt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
853 | ssl_txt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 893 | ssl_txt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
854 | ssl_txt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 894 | ssl_txt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
855 | ssl_txt.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 895 | ssl_txt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
856 | ssl_txt.o: ../include/openssl/x509_vfy.h ssl_locl.h ssl_txt.c | 896 | ssl_txt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h |
897 | ssl_txt.o: ssl_txt.c | ||
857 | t1_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 898 | t1_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
858 | t1_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 899 | t1_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
859 | t1_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 900 | t1_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -868,12 +909,12 @@ t1_clnt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
868 | t1_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 909 | t1_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
869 | t1_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 910 | t1_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
870 | t1_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 911 | t1_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
871 | t1_clnt.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 912 | t1_clnt.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
872 | t1_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 913 | t1_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
873 | t1_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 914 | t1_clnt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
874 | t1_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 915 | t1_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
875 | t1_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h | 916 | t1_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
876 | t1_clnt.o: t1_clnt.c | 917 | t1_clnt.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_clnt.c |
877 | t1_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 918 | t1_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
878 | t1_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 919 | t1_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
879 | t1_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 920 | t1_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -887,8 +928,9 @@ t1_enc.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | |||
887 | t1_enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | 928 | t1_enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h |
888 | t1_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h | 929 | t1_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h |
889 | t1_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | 930 | t1_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h |
890 | t1_enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 931 | t1_enc.o: ../include/openssl/rand.h ../include/openssl/rsa.h |
891 | t1_enc.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 932 | t1_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
933 | t1_enc.o: ../include/openssl/srtp.h ../include/openssl/ssl.h | ||
892 | t1_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 934 | t1_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
893 | t1_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 935 | t1_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
894 | t1_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 936 | t1_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
@@ -907,8 +949,9 @@ t1_lib.o: ../include/openssl/objects.h ../include/openssl/ocsp.h | |||
907 | t1_lib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | 949 | t1_lib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h |
908 | t1_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | 950 | t1_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h |
909 | t1_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 951 | t1_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
910 | t1_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 952 | t1_lib.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
911 | t1_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 953 | t1_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
954 | t1_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h | ||
912 | t1_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 955 | t1_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
913 | t1_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 956 | t1_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
914 | t1_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 957 | t1_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
@@ -929,11 +972,12 @@ t1_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
929 | t1_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 972 | t1_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
930 | t1_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 973 | t1_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
931 | t1_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 974 | t1_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
932 | t1_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 975 | t1_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
933 | t1_meth.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 976 | t1_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
934 | t1_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 977 | t1_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
935 | t1_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 978 | t1_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
936 | t1_meth.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_meth.c | 979 | t1_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h |
980 | t1_meth.o: t1_meth.c | ||
937 | t1_reneg.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 981 | t1_reneg.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
938 | t1_reneg.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 982 | t1_reneg.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
939 | t1_reneg.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 983 | t1_reneg.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -948,11 +992,12 @@ t1_reneg.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
948 | t1_reneg.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 992 | t1_reneg.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
949 | t1_reneg.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h | 993 | t1_reneg.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h |
950 | t1_reneg.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 994 | t1_reneg.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
951 | t1_reneg.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | 995 | t1_reneg.o: ../include/openssl/srtp.h ../include/openssl/ssl.h |
952 | t1_reneg.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | 996 | t1_reneg.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
953 | t1_reneg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | 997 | t1_reneg.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
954 | t1_reneg.o: ../include/openssl/tls1.h ../include/openssl/x509.h | 998 | t1_reneg.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
955 | t1_reneg.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_reneg.c | 999 | t1_reneg.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h |
1000 | t1_reneg.o: t1_reneg.c | ||
956 | t1_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 1001 | t1_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
957 | t1_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h | 1002 | t1_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h |
958 | t1_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h | 1003 | t1_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h |
@@ -967,9 +1012,30 @@ t1_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
967 | t1_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 1012 | t1_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
968 | t1_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 1013 | t1_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
969 | t1_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 1014 | t1_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
970 | t1_srvr.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 1015 | t1_srvr.o: ../include/openssl/sha.h ../include/openssl/srtp.h |
971 | t1_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 1016 | t1_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h |
972 | t1_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 1017 | t1_srvr.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h |
973 | t1_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 1018 | t1_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h |
974 | t1_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssl_locl.h | 1019 | t1_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h |
975 | t1_srvr.o: t1_srvr.c | 1020 | t1_srvr.o: ../include/openssl/x509_vfy.h ssl_locl.h t1_srvr.c |
1021 | tls_srp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | ||
1022 | tls_srp.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
1023 | tls_srp.o: ../include/openssl/comp.h ../include/openssl/crypto.h | ||
1024 | tls_srp.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h | ||
1025 | tls_srp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
1026 | tls_srp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h | ||
1027 | tls_srp.o: ../include/openssl/err.h ../include/openssl/evp.h | ||
1028 | tls_srp.o: ../include/openssl/hmac.h ../include/openssl/kssl.h | ||
1029 | tls_srp.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h | ||
1030 | tls_srp.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | ||
1031 | tls_srp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | ||
1032 | tls_srp.o: ../include/openssl/pem.h ../include/openssl/pem2.h | ||
1033 | tls_srp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h | ||
1034 | tls_srp.o: ../include/openssl/rand.h ../include/openssl/rsa.h | ||
1035 | tls_srp.o: ../include/openssl/safestack.h ../include/openssl/sha.h | ||
1036 | tls_srp.o: ../include/openssl/srp.h ../include/openssl/srtp.h | ||
1037 | tls_srp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h | ||
1038 | tls_srp.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h | ||
1039 | tls_srp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h | ||
1040 | tls_srp.o: ../include/openssl/tls1.h ../include/openssl/x509.h | ||
1041 | tls_srp.o: ../include/openssl/x509_vfy.h ssl_locl.h tls_srp.c | ||
diff --git a/src/lib/libssl/src/ssl/bio_ssl.c b/src/lib/libssl/src/ssl/bio_ssl.c index eedac8a3fc..e9552caee2 100644 --- a/src/lib/libssl/src/ssl/bio_ssl.c +++ b/src/lib/libssl/src/ssl/bio_ssl.c | |||
@@ -538,6 +538,7 @@ err: | |||
538 | 538 | ||
539 | BIO *BIO_new_ssl_connect(SSL_CTX *ctx) | 539 | BIO *BIO_new_ssl_connect(SSL_CTX *ctx) |
540 | { | 540 | { |
541 | #ifndef OPENSSL_NO_SOCK | ||
541 | BIO *ret=NULL,*con=NULL,*ssl=NULL; | 542 | BIO *ret=NULL,*con=NULL,*ssl=NULL; |
542 | 543 | ||
543 | if ((con=BIO_new(BIO_s_connect())) == NULL) | 544 | if ((con=BIO_new(BIO_s_connect())) == NULL) |
@@ -549,6 +550,7 @@ BIO *BIO_new_ssl_connect(SSL_CTX *ctx) | |||
549 | return(ret); | 550 | return(ret); |
550 | err: | 551 | err: |
551 | if (con != NULL) BIO_free(con); | 552 | if (con != NULL) BIO_free(con); |
553 | #endif | ||
552 | return(NULL); | 554 | return(NULL); |
553 | } | 555 | } |
554 | 556 | ||
diff --git a/src/lib/libssl/src/ssl/install-ssl.com b/src/lib/libssl/src/ssl/install-ssl.com index 1bd6ccaa7a..afe6967f85 100755 --- a/src/lib/libssl/src/ssl/install-ssl.com +++ b/src/lib/libssl/src/ssl/install-ssl.com | |||
@@ -73,7 +73,7 @@ $ if f$parse("wrk_sslxexe:") .eqs. "" then - | |||
73 | $ if f$parse("wrk_sslxlib:") .eqs. "" then - | 73 | $ if f$parse("wrk_sslxlib:") .eqs. "" then - |
74 | create /directory /log wrk_sslxlib: | 74 | create /directory /log wrk_sslxlib: |
75 | $! | 75 | $! |
76 | $ exheader := ssl.h, ssl2.h, ssl3.h, ssl23.h, tls1.h, dtls1.h, kssl.h | 76 | $ exheader := ssl.h, ssl2.h, ssl3.h, ssl23.h, tls1.h, dtls1.h, kssl.h, srtp.h |
77 | $ e_exe := ssl_task | 77 | $ e_exe := ssl_task |
78 | $ libs := ssl_libssl | 78 | $ libs := ssl_libssl |
79 | $! | 79 | $! |
diff --git a/src/lib/libssl/src/ssl/kssl.c b/src/lib/libssl/src/ssl/kssl.c index b820e37464..fd7c67bb1f 100644 --- a/src/lib/libssl/src/ssl/kssl.c +++ b/src/lib/libssl/src/ssl/kssl.c | |||
@@ -2194,6 +2194,22 @@ krb5_error_code kssl_build_principal_2( | |||
2194 | return ENOMEM; | 2194 | return ENOMEM; |
2195 | } | 2195 | } |
2196 | 2196 | ||
2197 | void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx) | ||
2198 | { | ||
2199 | s->kssl_ctx = kctx; | ||
2200 | } | ||
2201 | |||
2202 | KSSL_CTX * SSL_get0_kssl_ctx(SSL *s) | ||
2203 | { | ||
2204 | return s->kssl_ctx; | ||
2205 | } | ||
2206 | |||
2207 | char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx) | ||
2208 | { | ||
2209 | if (kctx) | ||
2210 | return kctx->client_princ; | ||
2211 | return NULL; | ||
2212 | } | ||
2197 | 2213 | ||
2198 | #else /* !OPENSSL_NO_KRB5 */ | 2214 | #else /* !OPENSSL_NO_KRB5 */ |
2199 | 2215 | ||
diff --git a/src/lib/libssl/src/ssl/kssl.h b/src/lib/libssl/src/ssl/kssl.h index a3d20e1ccb..8242fd5eeb 100644 --- a/src/lib/libssl/src/ssl/kssl.h +++ b/src/lib/libssl/src/ssl/kssl.h | |||
@@ -172,6 +172,10 @@ krb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp, | |||
172 | krb5_timestamp *atimep, KSSL_ERR *kssl_err); | 172 | krb5_timestamp *atimep, KSSL_ERR *kssl_err); |
173 | unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); | 173 | unsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn); |
174 | 174 | ||
175 | void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx); | ||
176 | KSSL_CTX * SSL_get0_kssl_ctx(SSL *s); | ||
177 | char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx); | ||
178 | |||
175 | #ifdef __cplusplus | 179 | #ifdef __cplusplus |
176 | } | 180 | } |
177 | #endif | 181 | #endif |
diff --git a/src/lib/libssl/src/ssl/s23_clnt.c b/src/lib/libssl/src/ssl/s23_clnt.c index c4d8bf2eb3..47673e740a 100644 --- a/src/lib/libssl/src/ssl/s23_clnt.c +++ b/src/lib/libssl/src/ssl/s23_clnt.c | |||
@@ -129,6 +129,10 @@ static const SSL_METHOD *ssl23_get_client_method(int ver) | |||
129 | return(SSLv3_client_method()); | 129 | return(SSLv3_client_method()); |
130 | else if (ver == TLS1_VERSION) | 130 | else if (ver == TLS1_VERSION) |
131 | return(TLSv1_client_method()); | 131 | return(TLSv1_client_method()); |
132 | else if (ver == TLS1_1_VERSION) | ||
133 | return(TLSv1_1_client_method()); | ||
134 | else if (ver == TLS1_2_VERSION) | ||
135 | return(TLSv1_2_client_method()); | ||
132 | else | 136 | else |
133 | return(NULL); | 137 | return(NULL); |
134 | } | 138 | } |
@@ -278,24 +282,51 @@ static int ssl23_client_hello(SSL *s) | |||
278 | SSL_COMP *comp; | 282 | SSL_COMP *comp; |
279 | #endif | 283 | #endif |
280 | int ret; | 284 | int ret; |
285 | unsigned long mask, options = s->options; | ||
281 | 286 | ||
282 | ssl2_compat = (s->options & SSL_OP_NO_SSLv2) ? 0 : 1; | 287 | ssl2_compat = (options & SSL_OP_NO_SSLv2) ? 0 : 1; |
283 | 288 | ||
284 | if (ssl2_compat && ssl23_no_ssl2_ciphers(s)) | 289 | if (ssl2_compat && ssl23_no_ssl2_ciphers(s)) |
285 | ssl2_compat = 0; | 290 | ssl2_compat = 0; |
286 | 291 | ||
287 | if (!(s->options & SSL_OP_NO_TLSv1)) | 292 | /* |
288 | { | 293 | * SSL_OP_NO_X disables all protocols above X *if* there are |
294 | * some protocols below X enabled. This is required in order | ||
295 | * to maintain "version capability" vector contiguous. So | ||
296 | * that if application wants to disable TLS1.0 in favour of | ||
297 | * TLS1>=1, it would be insufficient to pass SSL_NO_TLSv1, the | ||
298 | * answer is SSL_OP_NO_TLSv1|SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2. | ||
299 | */ | ||
300 | mask = SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1 | ||
301 | #if !defined(OPENSSL_NO_SSL3) | ||
302 | |SSL_OP_NO_SSLv3 | ||
303 | #endif | ||
304 | #if !defined(OPENSSL_NO_SSL2) | ||
305 | |(ssl2_compat?SSL_OP_NO_SSLv2:0) | ||
306 | #endif | ||
307 | ; | ||
308 | #if !defined(OPENSSL_NO_TLS1_2_CLIENT) | ||
309 | version = TLS1_2_VERSION; | ||
310 | |||
311 | if ((options & SSL_OP_NO_TLSv1_2) && (options & mask) != mask) | ||
312 | version = TLS1_1_VERSION; | ||
313 | #else | ||
314 | version = TLS1_1_VERSION; | ||
315 | #endif | ||
316 | mask &= ~SSL_OP_NO_TLSv1_1; | ||
317 | if ((options & SSL_OP_NO_TLSv1_1) && (options & mask) != mask) | ||
289 | version = TLS1_VERSION; | 318 | version = TLS1_VERSION; |
290 | } | 319 | mask &= ~SSL_OP_NO_TLSv1; |
291 | else if (!(s->options & SSL_OP_NO_SSLv3)) | 320 | #if !defined(OPENSSL_NO_SSL3) |
292 | { | 321 | if ((options & SSL_OP_NO_TLSv1) && (options & mask) != mask) |
293 | version = SSL3_VERSION; | 322 | version = SSL3_VERSION; |
294 | } | 323 | mask &= ~SSL_OP_NO_SSLv3; |
295 | else if (!(s->options & SSL_OP_NO_SSLv2)) | 324 | #endif |
296 | { | 325 | #if !defined(OPENSSL_NO_SSL2) |
326 | if ((options & SSL_OP_NO_SSLv3) && (options & mask) != mask) | ||
297 | version = SSL2_VERSION; | 327 | version = SSL2_VERSION; |
298 | } | 328 | #endif |
329 | |||
299 | #ifndef OPENSSL_NO_TLSEXT | 330 | #ifndef OPENSSL_NO_TLSEXT |
300 | if (version != SSL2_VERSION) | 331 | if (version != SSL2_VERSION) |
301 | { | 332 | { |
@@ -329,11 +360,29 @@ static int ssl23_client_hello(SSL *s) | |||
329 | if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0) | 360 | if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE-4) <= 0) |
330 | return -1; | 361 | return -1; |
331 | 362 | ||
332 | if (version == TLS1_VERSION) | 363 | if (version == TLS1_2_VERSION) |
364 | { | ||
365 | version_major = TLS1_2_VERSION_MAJOR; | ||
366 | version_minor = TLS1_2_VERSION_MINOR; | ||
367 | } | ||
368 | else if (version == TLS1_1_VERSION) | ||
369 | { | ||
370 | version_major = TLS1_1_VERSION_MAJOR; | ||
371 | version_minor = TLS1_1_VERSION_MINOR; | ||
372 | } | ||
373 | else if (version == TLS1_VERSION) | ||
333 | { | 374 | { |
334 | version_major = TLS1_VERSION_MAJOR; | 375 | version_major = TLS1_VERSION_MAJOR; |
335 | version_minor = TLS1_VERSION_MINOR; | 376 | version_minor = TLS1_VERSION_MINOR; |
336 | } | 377 | } |
378 | #ifdef OPENSSL_FIPS | ||
379 | else if(FIPS_mode()) | ||
380 | { | ||
381 | SSLerr(SSL_F_SSL23_CLIENT_HELLO, | ||
382 | SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); | ||
383 | return -1; | ||
384 | } | ||
385 | #endif | ||
337 | else if (version == SSL3_VERSION) | 386 | else if (version == SSL3_VERSION) |
338 | { | 387 | { |
339 | version_major = SSL3_VERSION_MAJOR; | 388 | version_major = SSL3_VERSION_MAJOR; |
@@ -437,6 +486,15 @@ static int ssl23_client_hello(SSL *s) | |||
437 | SSLerr(SSL_F_SSL23_CLIENT_HELLO,SSL_R_NO_CIPHERS_AVAILABLE); | 486 | SSLerr(SSL_F_SSL23_CLIENT_HELLO,SSL_R_NO_CIPHERS_AVAILABLE); |
438 | return -1; | 487 | return -1; |
439 | } | 488 | } |
489 | #ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH | ||
490 | /* Some servers hang if client hello > 256 bytes | ||
491 | * as hack workaround chop number of supported ciphers | ||
492 | * to keep it well below this if we use TLS v1.2 | ||
493 | */ | ||
494 | if (TLS1_get_version(s) >= TLS1_2_VERSION | ||
495 | && i > OPENSSL_MAX_TLS1_2_CIPHER_LENGTH) | ||
496 | i = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1; | ||
497 | #endif | ||
440 | s2n(i,p); | 498 | s2n(i,p); |
441 | p+=i; | 499 | p+=i; |
442 | 500 | ||
@@ -491,8 +549,13 @@ static int ssl23_client_hello(SSL *s) | |||
491 | d=buf; | 549 | d=buf; |
492 | *(d++) = SSL3_RT_HANDSHAKE; | 550 | *(d++) = SSL3_RT_HANDSHAKE; |
493 | *(d++) = version_major; | 551 | *(d++) = version_major; |
494 | *(d++) = version_minor; /* arguably we should send the *lowest* suported version here | 552 | /* Some servers hang if we use long client hellos |
495 | * (indicating, e.g., TLS 1.0 in "SSL 3.0 format") */ | 553 | * and a record number > TLS 1.0. |
554 | */ | ||
555 | if (TLS1_get_client_version(s) > TLS1_VERSION) | ||
556 | *(d++) = 1; | ||
557 | else | ||
558 | *(d++) = version_minor; | ||
496 | s2n((int)l,d); | 559 | s2n((int)l,d); |
497 | 560 | ||
498 | /* number of bytes to write */ | 561 | /* number of bytes to write */ |
@@ -608,7 +671,7 @@ static int ssl23_get_server_hello(SSL *s) | |||
608 | #endif | 671 | #endif |
609 | } | 672 | } |
610 | else if (p[1] == SSL3_VERSION_MAJOR && | 673 | else if (p[1] == SSL3_VERSION_MAJOR && |
611 | (p[2] == SSL3_VERSION_MINOR || p[2] == TLS1_VERSION_MINOR) && | 674 | p[2] <= TLS1_2_VERSION_MINOR && |
612 | ((p[0] == SSL3_RT_HANDSHAKE && p[5] == SSL3_MT_SERVER_HELLO) || | 675 | ((p[0] == SSL3_RT_HANDSHAKE && p[5] == SSL3_MT_SERVER_HELLO) || |
613 | (p[0] == SSL3_RT_ALERT && p[3] == 0 && p[4] == 2))) | 676 | (p[0] == SSL3_RT_ALERT && p[3] == 0 && p[4] == 2))) |
614 | { | 677 | { |
@@ -617,6 +680,14 @@ static int ssl23_get_server_hello(SSL *s) | |||
617 | if ((p[2] == SSL3_VERSION_MINOR) && | 680 | if ((p[2] == SSL3_VERSION_MINOR) && |
618 | !(s->options & SSL_OP_NO_SSLv3)) | 681 | !(s->options & SSL_OP_NO_SSLv3)) |
619 | { | 682 | { |
683 | #ifdef OPENSSL_FIPS | ||
684 | if(FIPS_mode()) | ||
685 | { | ||
686 | SSLerr(SSL_F_SSL23_GET_SERVER_HELLO, | ||
687 | SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); | ||
688 | goto err; | ||
689 | } | ||
690 | #endif | ||
620 | s->version=SSL3_VERSION; | 691 | s->version=SSL3_VERSION; |
621 | s->method=SSLv3_client_method(); | 692 | s->method=SSLv3_client_method(); |
622 | } | 693 | } |
@@ -626,6 +697,18 @@ static int ssl23_get_server_hello(SSL *s) | |||
626 | s->version=TLS1_VERSION; | 697 | s->version=TLS1_VERSION; |
627 | s->method=TLSv1_client_method(); | 698 | s->method=TLSv1_client_method(); |
628 | } | 699 | } |
700 | else if ((p[2] == TLS1_1_VERSION_MINOR) && | ||
701 | !(s->options & SSL_OP_NO_TLSv1_1)) | ||
702 | { | ||
703 | s->version=TLS1_1_VERSION; | ||
704 | s->method=TLSv1_1_client_method(); | ||
705 | } | ||
706 | else if ((p[2] == TLS1_2_VERSION_MINOR) && | ||
707 | !(s->options & SSL_OP_NO_TLSv1_2)) | ||
708 | { | ||
709 | s->version=TLS1_2_VERSION; | ||
710 | s->method=TLSv1_2_client_method(); | ||
711 | } | ||
629 | else | 712 | else |
630 | { | 713 | { |
631 | SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); | 714 | SSLerr(SSL_F_SSL23_GET_SERVER_HELLO,SSL_R_UNSUPPORTED_PROTOCOL); |
diff --git a/src/lib/libssl/src/ssl/s23_meth.c b/src/lib/libssl/src/ssl/s23_meth.c index c6099efcf7..40eae0f0be 100644 --- a/src/lib/libssl/src/ssl/s23_meth.c +++ b/src/lib/libssl/src/ssl/s23_meth.c | |||
@@ -76,6 +76,10 @@ static const SSL_METHOD *ssl23_get_method(int ver) | |||
76 | #ifndef OPENSSL_NO_TLS1 | 76 | #ifndef OPENSSL_NO_TLS1 |
77 | if (ver == TLS1_VERSION) | 77 | if (ver == TLS1_VERSION) |
78 | return(TLSv1_method()); | 78 | return(TLSv1_method()); |
79 | else if (ver == TLS1_1_VERSION) | ||
80 | return(TLSv1_1_method()); | ||
81 | else if (ver == TLS1_2_VERSION) | ||
82 | return(TLSv1_2_method()); | ||
79 | else | 83 | else |
80 | #endif | 84 | #endif |
81 | return(NULL); | 85 | return(NULL); |
diff --git a/src/lib/libssl/src/ssl/s23_srvr.c b/src/lib/libssl/src/ssl/s23_srvr.c index 836dd1f1cf..4877849013 100644 --- a/src/lib/libssl/src/ssl/s23_srvr.c +++ b/src/lib/libssl/src/ssl/s23_srvr.c | |||
@@ -115,6 +115,9 @@ | |||
115 | #include <openssl/rand.h> | 115 | #include <openssl/rand.h> |
116 | #include <openssl/objects.h> | 116 | #include <openssl/objects.h> |
117 | #include <openssl/evp.h> | 117 | #include <openssl/evp.h> |
118 | #ifdef OPENSSL_FIPS | ||
119 | #include <openssl/fips.h> | ||
120 | #endif | ||
118 | 121 | ||
119 | static const SSL_METHOD *ssl23_get_server_method(int ver); | 122 | static const SSL_METHOD *ssl23_get_server_method(int ver); |
120 | int ssl23_get_client_hello(SSL *s); | 123 | int ssl23_get_client_hello(SSL *s); |
@@ -128,6 +131,10 @@ static const SSL_METHOD *ssl23_get_server_method(int ver) | |||
128 | return(SSLv3_server_method()); | 131 | return(SSLv3_server_method()); |
129 | else if (ver == TLS1_VERSION) | 132 | else if (ver == TLS1_VERSION) |
130 | return(TLSv1_server_method()); | 133 | return(TLSv1_server_method()); |
134 | else if (ver == TLS1_1_VERSION) | ||
135 | return(TLSv1_1_server_method()); | ||
136 | else if (ver == TLS1_2_VERSION) | ||
137 | return(TLSv1_2_server_method()); | ||
131 | else | 138 | else |
132 | return(NULL); | 139 | return(NULL); |
133 | } | 140 | } |
@@ -283,7 +290,20 @@ int ssl23_get_client_hello(SSL *s) | |||
283 | /* SSLv3/TLSv1 */ | 290 | /* SSLv3/TLSv1 */ |
284 | if (p[4] >= TLS1_VERSION_MINOR) | 291 | if (p[4] >= TLS1_VERSION_MINOR) |
285 | { | 292 | { |
286 | if (!(s->options & SSL_OP_NO_TLSv1)) | 293 | if (p[4] >= TLS1_2_VERSION_MINOR && |
294 | !(s->options & SSL_OP_NO_TLSv1_2)) | ||
295 | { | ||
296 | s->version=TLS1_2_VERSION; | ||
297 | s->state=SSL23_ST_SR_CLNT_HELLO_B; | ||
298 | } | ||
299 | else if (p[4] >= TLS1_1_VERSION_MINOR && | ||
300 | !(s->options & SSL_OP_NO_TLSv1_1)) | ||
301 | { | ||
302 | s->version=TLS1_1_VERSION; | ||
303 | /* type=2; */ /* done later to survive restarts */ | ||
304 | s->state=SSL23_ST_SR_CLNT_HELLO_B; | ||
305 | } | ||
306 | else if (!(s->options & SSL_OP_NO_TLSv1)) | ||
287 | { | 307 | { |
288 | s->version=TLS1_VERSION; | 308 | s->version=TLS1_VERSION; |
289 | /* type=2; */ /* done later to survive restarts */ | 309 | /* type=2; */ /* done later to survive restarts */ |
@@ -350,7 +370,19 @@ int ssl23_get_client_hello(SSL *s) | |||
350 | v[1]=p[10]; /* minor version according to client_version */ | 370 | v[1]=p[10]; /* minor version according to client_version */ |
351 | if (v[1] >= TLS1_VERSION_MINOR) | 371 | if (v[1] >= TLS1_VERSION_MINOR) |
352 | { | 372 | { |
353 | if (!(s->options & SSL_OP_NO_TLSv1)) | 373 | if (v[1] >= TLS1_2_VERSION_MINOR && |
374 | !(s->options & SSL_OP_NO_TLSv1_2)) | ||
375 | { | ||
376 | s->version=TLS1_2_VERSION; | ||
377 | type=3; | ||
378 | } | ||
379 | else if (v[1] >= TLS1_1_VERSION_MINOR && | ||
380 | !(s->options & SSL_OP_NO_TLSv1_1)) | ||
381 | { | ||
382 | s->version=TLS1_1_VERSION; | ||
383 | type=3; | ||
384 | } | ||
385 | else if (!(s->options & SSL_OP_NO_TLSv1)) | ||
354 | { | 386 | { |
355 | s->version=TLS1_VERSION; | 387 | s->version=TLS1_VERSION; |
356 | type=3; | 388 | type=3; |
@@ -393,6 +425,15 @@ int ssl23_get_client_hello(SSL *s) | |||
393 | } | 425 | } |
394 | } | 426 | } |
395 | 427 | ||
428 | #ifdef OPENSSL_FIPS | ||
429 | if (FIPS_mode() && (s->version < TLS1_VERSION)) | ||
430 | { | ||
431 | SSLerr(SSL_F_SSL23_GET_CLIENT_HELLO, | ||
432 | SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); | ||
433 | goto err; | ||
434 | } | ||
435 | #endif | ||
436 | |||
396 | if (s->state == SSL23_ST_SR_CLNT_HELLO_B) | 437 | if (s->state == SSL23_ST_SR_CLNT_HELLO_B) |
397 | { | 438 | { |
398 | /* we have SSLv3/TLSv1 in an SSLv2 header | 439 | /* we have SSLv3/TLSv1 in an SSLv2 header |
@@ -567,8 +608,11 @@ int ssl23_get_client_hello(SSL *s) | |||
567 | s->s3->rbuf.left=0; | 608 | s->s3->rbuf.left=0; |
568 | s->s3->rbuf.offset=0; | 609 | s->s3->rbuf.offset=0; |
569 | } | 610 | } |
570 | 611 | if (s->version == TLS1_2_VERSION) | |
571 | if (s->version == TLS1_VERSION) | 612 | s->method = TLSv1_2_server_method(); |
613 | else if (s->version == TLS1_1_VERSION) | ||
614 | s->method = TLSv1_1_server_method(); | ||
615 | else if (s->version == TLS1_VERSION) | ||
572 | s->method = TLSv1_server_method(); | 616 | s->method = TLSv1_server_method(); |
573 | else | 617 | else |
574 | s->method = SSLv3_server_method(); | 618 | s->method = SSLv3_server_method(); |
diff --git a/src/lib/libssl/src/ssl/s3_both.c b/src/lib/libssl/src/ssl/s3_both.c index a6d869df59..b63460a56d 100644 --- a/src/lib/libssl/src/ssl/s3_both.c +++ b/src/lib/libssl/src/ssl/s3_both.c | |||
@@ -202,15 +202,38 @@ int ssl3_send_finished(SSL *s, int a, int b, const char *sender, int slen) | |||
202 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); | 202 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); |
203 | } | 203 | } |
204 | 204 | ||
205 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
206 | /* ssl3_take_mac calculates the Finished MAC for the handshakes messages seen to far. */ | ||
207 | static void ssl3_take_mac(SSL *s) { | ||
208 | const char *sender; | ||
209 | int slen; | ||
210 | |||
211 | if (s->state & SSL_ST_CONNECT) | ||
212 | { | ||
213 | sender=s->method->ssl3_enc->server_finished_label; | ||
214 | slen=s->method->ssl3_enc->server_finished_label_len; | ||
215 | } | ||
216 | else | ||
217 | { | ||
218 | sender=s->method->ssl3_enc->client_finished_label; | ||
219 | slen=s->method->ssl3_enc->client_finished_label_len; | ||
220 | } | ||
221 | |||
222 | s->s3->tmp.peer_finish_md_len = s->method->ssl3_enc->final_finish_mac(s, | ||
223 | sender,slen,s->s3->tmp.peer_finish_md); | ||
224 | } | ||
225 | #endif | ||
226 | |||
205 | int ssl3_get_finished(SSL *s, int a, int b) | 227 | int ssl3_get_finished(SSL *s, int a, int b) |
206 | { | 228 | { |
207 | int al,i,ok; | 229 | int al,i,ok; |
208 | long n; | 230 | long n; |
209 | unsigned char *p; | 231 | unsigned char *p; |
210 | 232 | ||
211 | /* the mac has already been generated when we received the | 233 | #ifdef OPENSSL_NO_NEXTPROTONEG |
212 | * change cipher spec message and is in s->s3->tmp.peer_finish_md | 234 | /* the mac has already been generated when we received the change |
213 | */ | 235 | * cipher spec message and is in s->s3->tmp.peer_finish_md. */ |
236 | #endif | ||
214 | 237 | ||
215 | n=s->method->ssl_get_message(s, | 238 | n=s->method->ssl_get_message(s, |
216 | a, | 239 | a, |
@@ -514,6 +537,13 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) | |||
514 | s->init_num += i; | 537 | s->init_num += i; |
515 | n -= i; | 538 | n -= i; |
516 | } | 539 | } |
540 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
541 | /* If receiving Finished, record MAC of prior handshake messages for | ||
542 | * Finished verification. */ | ||
543 | if (*s->init_buf->data == SSL3_MT_FINISHED) | ||
544 | ssl3_take_mac(s); | ||
545 | #endif | ||
546 | /* Feed this message into MAC computation. */ | ||
517 | ssl3_finish_mac(s, (unsigned char *)s->init_buf->data, s->init_num + 4); | 547 | ssl3_finish_mac(s, (unsigned char *)s->init_buf->data, s->init_num + 4); |
518 | if (s->msg_callback) | 548 | if (s->msg_callback) |
519 | s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data, (size_t)s->init_num + 4, s, s->msg_callback_arg); | 549 | s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data, (size_t)s->init_num + 4, s, s->msg_callback_arg); |
diff --git a/src/lib/libssl/src/ssl/s3_clnt.c b/src/lib/libssl/src/ssl/s3_clnt.c index 53223bd38d..b80d052e1f 100644 --- a/src/lib/libssl/src/ssl/s3_clnt.c +++ b/src/lib/libssl/src/ssl/s3_clnt.c | |||
@@ -156,6 +156,9 @@ | |||
156 | #include <openssl/objects.h> | 156 | #include <openssl/objects.h> |
157 | #include <openssl/evp.h> | 157 | #include <openssl/evp.h> |
158 | #include <openssl/md5.h> | 158 | #include <openssl/md5.h> |
159 | #ifdef OPENSSL_FIPS | ||
160 | #include <openssl/fips.h> | ||
161 | #endif | ||
159 | #ifndef OPENSSL_NO_DH | 162 | #ifndef OPENSSL_NO_DH |
160 | #include <openssl/dh.h> | 163 | #include <openssl/dh.h> |
161 | #endif | 164 | #endif |
@@ -200,6 +203,18 @@ int ssl3_connect(SSL *s) | |||
200 | s->in_handshake++; | 203 | s->in_handshake++; |
201 | if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); | 204 | if (!SSL_in_init(s) || SSL_in_before(s)) SSL_clear(s); |
202 | 205 | ||
206 | #ifndef OPENSSL_NO_HEARTBEATS | ||
207 | /* If we're awaiting a HeartbeatResponse, pretend we | ||
208 | * already got and don't await it anymore, because | ||
209 | * Heartbeats don't make sense during handshakes anyway. | ||
210 | */ | ||
211 | if (s->tlsext_hb_pending) | ||
212 | { | ||
213 | s->tlsext_hb_pending = 0; | ||
214 | s->tlsext_hb_seq++; | ||
215 | } | ||
216 | #endif | ||
217 | |||
203 | for (;;) | 218 | for (;;) |
204 | { | 219 | { |
205 | state=s->state; | 220 | state=s->state; |
@@ -207,7 +222,7 @@ int ssl3_connect(SSL *s) | |||
207 | switch(s->state) | 222 | switch(s->state) |
208 | { | 223 | { |
209 | case SSL_ST_RENEGOTIATE: | 224 | case SSL_ST_RENEGOTIATE: |
210 | s->new_session=1; | 225 | s->renegotiate=1; |
211 | s->state=SSL_ST_CONNECT; | 226 | s->state=SSL_ST_CONNECT; |
212 | s->ctx->stats.sess_connect_renegotiate++; | 227 | s->ctx->stats.sess_connect_renegotiate++; |
213 | /* break */ | 228 | /* break */ |
@@ -280,7 +295,16 @@ int ssl3_connect(SSL *s) | |||
280 | if (ret <= 0) goto end; | 295 | if (ret <= 0) goto end; |
281 | 296 | ||
282 | if (s->hit) | 297 | if (s->hit) |
298 | { | ||
283 | s->state=SSL3_ST_CR_FINISHED_A; | 299 | s->state=SSL3_ST_CR_FINISHED_A; |
300 | #ifndef OPENSSL_NO_TLSEXT | ||
301 | if (s->tlsext_ticket_expected) | ||
302 | { | ||
303 | /* receive renewed session ticket */ | ||
304 | s->state=SSL3_ST_CR_SESSION_TICKET_A; | ||
305 | } | ||
306 | #endif | ||
307 | } | ||
284 | else | 308 | else |
285 | s->state=SSL3_ST_CR_CERT_A; | 309 | s->state=SSL3_ST_CR_CERT_A; |
286 | s->init_num=0; | 310 | s->init_num=0; |
@@ -358,6 +382,17 @@ int ssl3_connect(SSL *s) | |||
358 | case SSL3_ST_CR_SRVR_DONE_B: | 382 | case SSL3_ST_CR_SRVR_DONE_B: |
359 | ret=ssl3_get_server_done(s); | 383 | ret=ssl3_get_server_done(s); |
360 | if (ret <= 0) goto end; | 384 | if (ret <= 0) goto end; |
385 | #ifndef OPENSSL_NO_SRP | ||
386 | if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_kSRP) | ||
387 | { | ||
388 | if ((ret = SRP_Calc_A_param(s))<=0) | ||
389 | { | ||
390 | SSLerr(SSL_F_SSL3_CONNECT,SSL_R_SRP_A_CALC); | ||
391 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_INTERNAL_ERROR); | ||
392 | goto end; | ||
393 | } | ||
394 | } | ||
395 | #endif | ||
361 | if (s->s3->tmp.cert_req) | 396 | if (s->s3->tmp.cert_req) |
362 | s->state=SSL3_ST_CW_CERT_A; | 397 | s->state=SSL3_ST_CW_CERT_A; |
363 | else | 398 | else |
@@ -423,7 +458,16 @@ int ssl3_connect(SSL *s) | |||
423 | ret=ssl3_send_change_cipher_spec(s, | 458 | ret=ssl3_send_change_cipher_spec(s, |
424 | SSL3_ST_CW_CHANGE_A,SSL3_ST_CW_CHANGE_B); | 459 | SSL3_ST_CW_CHANGE_A,SSL3_ST_CW_CHANGE_B); |
425 | if (ret <= 0) goto end; | 460 | if (ret <= 0) goto end; |
461 | |||
462 | |||
463 | #if defined(OPENSSL_NO_TLSEXT) || defined(OPENSSL_NO_NEXTPROTONEG) | ||
426 | s->state=SSL3_ST_CW_FINISHED_A; | 464 | s->state=SSL3_ST_CW_FINISHED_A; |
465 | #else | ||
466 | if (s->s3->next_proto_neg_seen) | ||
467 | s->state=SSL3_ST_CW_NEXT_PROTO_A; | ||
468 | else | ||
469 | s->state=SSL3_ST_CW_FINISHED_A; | ||
470 | #endif | ||
427 | s->init_num=0; | 471 | s->init_num=0; |
428 | 472 | ||
429 | s->session->cipher=s->s3->tmp.new_cipher; | 473 | s->session->cipher=s->s3->tmp.new_cipher; |
@@ -451,6 +495,15 @@ int ssl3_connect(SSL *s) | |||
451 | 495 | ||
452 | break; | 496 | break; |
453 | 497 | ||
498 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
499 | case SSL3_ST_CW_NEXT_PROTO_A: | ||
500 | case SSL3_ST_CW_NEXT_PROTO_B: | ||
501 | ret=ssl3_send_next_proto(s); | ||
502 | if (ret <= 0) goto end; | ||
503 | s->state=SSL3_ST_CW_FINISHED_A; | ||
504 | break; | ||
505 | #endif | ||
506 | |||
454 | case SSL3_ST_CW_FINISHED_A: | 507 | case SSL3_ST_CW_FINISHED_A: |
455 | case SSL3_ST_CW_FINISHED_B: | 508 | case SSL3_ST_CW_FINISHED_B: |
456 | ret=ssl3_send_finished(s, | 509 | ret=ssl3_send_finished(s, |
@@ -546,6 +599,7 @@ int ssl3_connect(SSL *s) | |||
546 | /* else do it later in ssl3_write */ | 599 | /* else do it later in ssl3_write */ |
547 | 600 | ||
548 | s->init_num=0; | 601 | s->init_num=0; |
602 | s->renegotiate=0; | ||
549 | s->new_session=0; | 603 | s->new_session=0; |
550 | 604 | ||
551 | ssl_update_cache(s,SSL_SESS_CACHE_CLIENT); | 605 | ssl_update_cache(s,SSL_SESS_CACHE_CLIENT); |
@@ -635,9 +689,43 @@ int ssl3_client_hello(SSL *s) | |||
635 | /* Do the message type and length last */ | 689 | /* Do the message type and length last */ |
636 | d=p= &(buf[4]); | 690 | d=p= &(buf[4]); |
637 | 691 | ||
692 | /* version indicates the negotiated version: for example from | ||
693 | * an SSLv2/v3 compatible client hello). The client_version | ||
694 | * field is the maximum version we permit and it is also | ||
695 | * used in RSA encrypted premaster secrets. Some servers can | ||
696 | * choke if we initially report a higher version then | ||
697 | * renegotiate to a lower one in the premaster secret. This | ||
698 | * didn't happen with TLS 1.0 as most servers supported it | ||
699 | * but it can with TLS 1.1 or later if the server only supports | ||
700 | * 1.0. | ||
701 | * | ||
702 | * Possible scenario with previous logic: | ||
703 | * 1. Client hello indicates TLS 1.2 | ||
704 | * 2. Server hello says TLS 1.0 | ||
705 | * 3. RSA encrypted premaster secret uses 1.2. | ||
706 | * 4. Handhaked proceeds using TLS 1.0. | ||
707 | * 5. Server sends hello request to renegotiate. | ||
708 | * 6. Client hello indicates TLS v1.0 as we now | ||
709 | * know that is maximum server supports. | ||
710 | * 7. Server chokes on RSA encrypted premaster secret | ||
711 | * containing version 1.0. | ||
712 | * | ||
713 | * For interoperability it should be OK to always use the | ||
714 | * maximum version we support in client hello and then rely | ||
715 | * on the checking of version to ensure the servers isn't | ||
716 | * being inconsistent: for example initially negotiating with | ||
717 | * TLS 1.0 and renegotiating with TLS 1.2. We do this by using | ||
718 | * client_version in client hello and not resetting it to | ||
719 | * the negotiated version. | ||
720 | */ | ||
721 | #if 0 | ||
638 | *(p++)=s->version>>8; | 722 | *(p++)=s->version>>8; |
639 | *(p++)=s->version&0xff; | 723 | *(p++)=s->version&0xff; |
640 | s->client_version=s->version; | 724 | s->client_version=s->version; |
725 | #else | ||
726 | *(p++)=s->client_version>>8; | ||
727 | *(p++)=s->client_version&0xff; | ||
728 | #endif | ||
641 | 729 | ||
642 | /* Random stuff */ | 730 | /* Random stuff */ |
643 | memcpy(p,s->s3->client_random,SSL3_RANDOM_SIZE); | 731 | memcpy(p,s->s3->client_random,SSL3_RANDOM_SIZE); |
@@ -667,6 +755,15 @@ int ssl3_client_hello(SSL *s) | |||
667 | SSLerr(SSL_F_SSL3_CLIENT_HELLO,SSL_R_NO_CIPHERS_AVAILABLE); | 755 | SSLerr(SSL_F_SSL3_CLIENT_HELLO,SSL_R_NO_CIPHERS_AVAILABLE); |
668 | goto err; | 756 | goto err; |
669 | } | 757 | } |
758 | #ifdef OPENSSL_MAX_TLS1_2_CIPHER_LENGTH | ||
759 | /* Some servers hang if client hello > 256 bytes | ||
760 | * as hack workaround chop number of supported ciphers | ||
761 | * to keep it well below this if we use TLS v1.2 | ||
762 | */ | ||
763 | if (TLS1_get_version(s) >= TLS1_2_VERSION | ||
764 | && i > OPENSSL_MAX_TLS1_2_CIPHER_LENGTH) | ||
765 | i = OPENSSL_MAX_TLS1_2_CIPHER_LENGTH & ~1; | ||
766 | #endif | ||
670 | s2n(i,p); | 767 | s2n(i,p); |
671 | p+=i; | 768 | p+=i; |
672 | 769 | ||
@@ -847,6 +944,14 @@ int ssl3_get_server_hello(SSL *s) | |||
847 | SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_UNKNOWN_CIPHER_RETURNED); | 944 | SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_UNKNOWN_CIPHER_RETURNED); |
848 | goto f_err; | 945 | goto f_err; |
849 | } | 946 | } |
947 | /* TLS v1.2 only ciphersuites require v1.2 or later */ | ||
948 | if ((c->algorithm_ssl & SSL_TLSV1_2) && | ||
949 | (TLS1_get_version(s) < TLS1_2_VERSION)) | ||
950 | { | ||
951 | al=SSL_AD_ILLEGAL_PARAMETER; | ||
952 | SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_WRONG_CIPHER_RETURNED); | ||
953 | goto f_err; | ||
954 | } | ||
850 | p+=ssl_put_cipher_by_char(s,NULL,NULL); | 955 | p+=ssl_put_cipher_by_char(s,NULL,NULL); |
851 | 956 | ||
852 | sk=ssl_get_ciphers_by_id(s); | 957 | sk=ssl_get_ciphers_by_id(s); |
@@ -878,9 +983,11 @@ int ssl3_get_server_hello(SSL *s) | |||
878 | } | 983 | } |
879 | } | 984 | } |
880 | s->s3->tmp.new_cipher=c; | 985 | s->s3->tmp.new_cipher=c; |
881 | if (!ssl3_digest_cached_records(s)) | 986 | /* Don't digest cached records if TLS v1.2: we may need them for |
987 | * client authentication. | ||
988 | */ | ||
989 | if (TLS1_get_version(s) < TLS1_2_VERSION && !ssl3_digest_cached_records(s)) | ||
882 | goto f_err; | 990 | goto f_err; |
883 | |||
884 | /* lets get the compression algorithm */ | 991 | /* lets get the compression algorithm */ |
885 | /* COMPRESSION */ | 992 | /* COMPRESSION */ |
886 | #ifdef OPENSSL_NO_COMP | 993 | #ifdef OPENSSL_NO_COMP |
@@ -1159,6 +1266,7 @@ int ssl3_get_key_exchange(SSL *s) | |||
1159 | int al,i,j,param_len,ok; | 1266 | int al,i,j,param_len,ok; |
1160 | long n,alg_k,alg_a; | 1267 | long n,alg_k,alg_a; |
1161 | EVP_PKEY *pkey=NULL; | 1268 | EVP_PKEY *pkey=NULL; |
1269 | const EVP_MD *md = NULL; | ||
1162 | #ifndef OPENSSL_NO_RSA | 1270 | #ifndef OPENSSL_NO_RSA |
1163 | RSA *rsa=NULL; | 1271 | RSA *rsa=NULL; |
1164 | #endif | 1272 | #endif |
@@ -1282,6 +1390,86 @@ int ssl3_get_key_exchange(SSL *s) | |||
1282 | } | 1390 | } |
1283 | else | 1391 | else |
1284 | #endif /* !OPENSSL_NO_PSK */ | 1392 | #endif /* !OPENSSL_NO_PSK */ |
1393 | #ifndef OPENSSL_NO_SRP | ||
1394 | if (alg_k & SSL_kSRP) | ||
1395 | { | ||
1396 | n2s(p,i); | ||
1397 | param_len=i+2; | ||
1398 | if (param_len > n) | ||
1399 | { | ||
1400 | al=SSL_AD_DECODE_ERROR; | ||
1401 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SRP_N_LENGTH); | ||
1402 | goto f_err; | ||
1403 | } | ||
1404 | if (!(s->srp_ctx.N=BN_bin2bn(p,i,NULL))) | ||
1405 | { | ||
1406 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_BN_LIB); | ||
1407 | goto err; | ||
1408 | } | ||
1409 | p+=i; | ||
1410 | |||
1411 | n2s(p,i); | ||
1412 | param_len+=i+2; | ||
1413 | if (param_len > n) | ||
1414 | { | ||
1415 | al=SSL_AD_DECODE_ERROR; | ||
1416 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SRP_G_LENGTH); | ||
1417 | goto f_err; | ||
1418 | } | ||
1419 | if (!(s->srp_ctx.g=BN_bin2bn(p,i,NULL))) | ||
1420 | { | ||
1421 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_BN_LIB); | ||
1422 | goto err; | ||
1423 | } | ||
1424 | p+=i; | ||
1425 | |||
1426 | i = (unsigned int)(p[0]); | ||
1427 | p++; | ||
1428 | param_len+=i+1; | ||
1429 | if (param_len > n) | ||
1430 | { | ||
1431 | al=SSL_AD_DECODE_ERROR; | ||
1432 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SRP_S_LENGTH); | ||
1433 | goto f_err; | ||
1434 | } | ||
1435 | if (!(s->srp_ctx.s=BN_bin2bn(p,i,NULL))) | ||
1436 | { | ||
1437 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_BN_LIB); | ||
1438 | goto err; | ||
1439 | } | ||
1440 | p+=i; | ||
1441 | |||
1442 | n2s(p,i); | ||
1443 | param_len+=i+2; | ||
1444 | if (param_len > n) | ||
1445 | { | ||
1446 | al=SSL_AD_DECODE_ERROR; | ||
1447 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SRP_B_LENGTH); | ||
1448 | goto f_err; | ||
1449 | } | ||
1450 | if (!(s->srp_ctx.B=BN_bin2bn(p,i,NULL))) | ||
1451 | { | ||
1452 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_BN_LIB); | ||
1453 | goto err; | ||
1454 | } | ||
1455 | p+=i; | ||
1456 | n-=param_len; | ||
1457 | |||
1458 | /* We must check if there is a certificate */ | ||
1459 | #ifndef OPENSSL_NO_RSA | ||
1460 | if (alg_a & SSL_aRSA) | ||
1461 | pkey=X509_get_pubkey(s->session->sess_cert->peer_pkeys[SSL_PKEY_RSA_ENC].x509); | ||
1462 | #else | ||
1463 | if (0) | ||
1464 | ; | ||
1465 | #endif | ||
1466 | #ifndef OPENSSL_NO_DSA | ||
1467 | else if (alg_a & SSL_aDSS) | ||
1468 | pkey=X509_get_pubkey(s->session->sess_cert->peer_pkeys[SSL_PKEY_DSA_SIGN].x509); | ||
1469 | #endif | ||
1470 | } | ||
1471 | else | ||
1472 | #endif /* !OPENSSL_NO_SRP */ | ||
1285 | #ifndef OPENSSL_NO_RSA | 1473 | #ifndef OPENSSL_NO_RSA |
1286 | if (alg_k & SSL_kRSA) | 1474 | if (alg_k & SSL_kRSA) |
1287 | { | 1475 | { |
@@ -1529,6 +1717,38 @@ int ssl3_get_key_exchange(SSL *s) | |||
1529 | /* if it was signed, check the signature */ | 1717 | /* if it was signed, check the signature */ |
1530 | if (pkey != NULL) | 1718 | if (pkey != NULL) |
1531 | { | 1719 | { |
1720 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
1721 | { | ||
1722 | int sigalg = tls12_get_sigid(pkey); | ||
1723 | /* Should never happen */ | ||
1724 | if (sigalg == -1) | ||
1725 | { | ||
1726 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); | ||
1727 | goto err; | ||
1728 | } | ||
1729 | /* Check key type is consistent with signature */ | ||
1730 | if (sigalg != (int)p[1]) | ||
1731 | { | ||
1732 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_WRONG_SIGNATURE_TYPE); | ||
1733 | al=SSL_AD_DECODE_ERROR; | ||
1734 | goto f_err; | ||
1735 | } | ||
1736 | md = tls12_get_hash(p[0]); | ||
1737 | if (md == NULL) | ||
1738 | { | ||
1739 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_UNKNOWN_DIGEST); | ||
1740 | al=SSL_AD_DECODE_ERROR; | ||
1741 | goto f_err; | ||
1742 | } | ||
1743 | #ifdef SSL_DEBUG | ||
1744 | fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md)); | ||
1745 | #endif | ||
1746 | p += 2; | ||
1747 | n -= 2; | ||
1748 | } | ||
1749 | else | ||
1750 | md = EVP_sha1(); | ||
1751 | |||
1532 | n2s(p,i); | 1752 | n2s(p,i); |
1533 | n-=2; | 1753 | n-=2; |
1534 | j=EVP_PKEY_size(pkey); | 1754 | j=EVP_PKEY_size(pkey); |
@@ -1542,7 +1762,7 @@ int ssl3_get_key_exchange(SSL *s) | |||
1542 | } | 1762 | } |
1543 | 1763 | ||
1544 | #ifndef OPENSSL_NO_RSA | 1764 | #ifndef OPENSSL_NO_RSA |
1545 | if (pkey->type == EVP_PKEY_RSA) | 1765 | if (pkey->type == EVP_PKEY_RSA && TLS1_get_version(s) < TLS1_2_VERSION) |
1546 | { | 1766 | { |
1547 | int num; | 1767 | int num; |
1548 | 1768 | ||
@@ -1550,6 +1770,8 @@ int ssl3_get_key_exchange(SSL *s) | |||
1550 | q=md_buf; | 1770 | q=md_buf; |
1551 | for (num=2; num > 0; num--) | 1771 | for (num=2; num > 0; num--) |
1552 | { | 1772 | { |
1773 | EVP_MD_CTX_set_flags(&md_ctx, | ||
1774 | EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
1553 | EVP_DigestInit_ex(&md_ctx,(num == 2) | 1775 | EVP_DigestInit_ex(&md_ctx,(num == 2) |
1554 | ?s->ctx->md5:s->ctx->sha1, NULL); | 1776 | ?s->ctx->md5:s->ctx->sha1, NULL); |
1555 | EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); | 1777 | EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); |
@@ -1577,29 +1799,8 @@ int ssl3_get_key_exchange(SSL *s) | |||
1577 | } | 1799 | } |
1578 | else | 1800 | else |
1579 | #endif | 1801 | #endif |
1580 | #ifndef OPENSSL_NO_DSA | ||
1581 | if (pkey->type == EVP_PKEY_DSA) | ||
1582 | { | ||
1583 | /* lets do DSS */ | ||
1584 | EVP_VerifyInit_ex(&md_ctx,EVP_dss1(), NULL); | ||
1585 | EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); | ||
1586 | EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE); | ||
1587 | EVP_VerifyUpdate(&md_ctx,param,param_len); | ||
1588 | if (EVP_VerifyFinal(&md_ctx,p,(int)n,pkey) <= 0) | ||
1589 | { | ||
1590 | /* bad signature */ | ||
1591 | al=SSL_AD_DECRYPT_ERROR; | ||
1592 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,SSL_R_BAD_SIGNATURE); | ||
1593 | goto f_err; | ||
1594 | } | ||
1595 | } | ||
1596 | else | ||
1597 | #endif | ||
1598 | #ifndef OPENSSL_NO_ECDSA | ||
1599 | if (pkey->type == EVP_PKEY_EC) | ||
1600 | { | 1802 | { |
1601 | /* let's do ECDSA */ | 1803 | EVP_VerifyInit_ex(&md_ctx, md, NULL); |
1602 | EVP_VerifyInit_ex(&md_ctx,EVP_ecdsa(), NULL); | ||
1603 | EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); | 1804 | EVP_VerifyUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); |
1604 | EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE); | 1805 | EVP_VerifyUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE); |
1605 | EVP_VerifyUpdate(&md_ctx,param,param_len); | 1806 | EVP_VerifyUpdate(&md_ctx,param,param_len); |
@@ -1611,12 +1812,6 @@ int ssl3_get_key_exchange(SSL *s) | |||
1611 | goto f_err; | 1812 | goto f_err; |
1612 | } | 1813 | } |
1613 | } | 1814 | } |
1614 | else | ||
1615 | #endif | ||
1616 | { | ||
1617 | SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); | ||
1618 | goto err; | ||
1619 | } | ||
1620 | } | 1815 | } |
1621 | else | 1816 | else |
1622 | { | 1817 | { |
@@ -1663,7 +1858,7 @@ int ssl3_get_certificate_request(SSL *s) | |||
1663 | { | 1858 | { |
1664 | int ok,ret=0; | 1859 | int ok,ret=0; |
1665 | unsigned long n,nc,l; | 1860 | unsigned long n,nc,l; |
1666 | unsigned int llen,ctype_num,i; | 1861 | unsigned int llen, ctype_num,i; |
1667 | X509_NAME *xn=NULL; | 1862 | X509_NAME *xn=NULL; |
1668 | const unsigned char *p,*q; | 1863 | const unsigned char *p,*q; |
1669 | unsigned char *d; | 1864 | unsigned char *d; |
@@ -1683,6 +1878,14 @@ int ssl3_get_certificate_request(SSL *s) | |||
1683 | if (s->s3->tmp.message_type == SSL3_MT_SERVER_DONE) | 1878 | if (s->s3->tmp.message_type == SSL3_MT_SERVER_DONE) |
1684 | { | 1879 | { |
1685 | s->s3->tmp.reuse_message=1; | 1880 | s->s3->tmp.reuse_message=1; |
1881 | /* If we get here we don't need any cached handshake records | ||
1882 | * as we wont be doing client auth. | ||
1883 | */ | ||
1884 | if (s->s3->handshake_buffer) | ||
1885 | { | ||
1886 | if (!ssl3_digest_cached_records(s)) | ||
1887 | goto err; | ||
1888 | } | ||
1686 | return(1); | 1889 | return(1); |
1687 | } | 1890 | } |
1688 | 1891 | ||
@@ -1719,6 +1922,26 @@ int ssl3_get_certificate_request(SSL *s) | |||
1719 | for (i=0; i<ctype_num; i++) | 1922 | for (i=0; i<ctype_num; i++) |
1720 | s->s3->tmp.ctype[i]= p[i]; | 1923 | s->s3->tmp.ctype[i]= p[i]; |
1721 | p+=ctype_num; | 1924 | p+=ctype_num; |
1925 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
1926 | { | ||
1927 | n2s(p, llen); | ||
1928 | /* Check we have enough room for signature algorithms and | ||
1929 | * following length value. | ||
1930 | */ | ||
1931 | if ((unsigned long)(p - d + llen + 2) > n) | ||
1932 | { | ||
1933 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECODE_ERROR); | ||
1934 | SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,SSL_R_DATA_LENGTH_TOO_LONG); | ||
1935 | goto err; | ||
1936 | } | ||
1937 | if ((llen & 1) || !tls1_process_sigalgs(s, p, llen)) | ||
1938 | { | ||
1939 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECODE_ERROR); | ||
1940 | SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,SSL_R_SIGNATURE_ALGORITHMS_ERROR); | ||
1941 | goto err; | ||
1942 | } | ||
1943 | p += llen; | ||
1944 | } | ||
1722 | 1945 | ||
1723 | /* get the CA RDNs */ | 1946 | /* get the CA RDNs */ |
1724 | n2s(p,llen); | 1947 | n2s(p,llen); |
@@ -1731,7 +1954,7 @@ fclose(out); | |||
1731 | } | 1954 | } |
1732 | #endif | 1955 | #endif |
1733 | 1956 | ||
1734 | if ((llen+ctype_num+2+1) != n) | 1957 | if ((unsigned long)(p - d + llen) != n) |
1735 | { | 1958 | { |
1736 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECODE_ERROR); | 1959 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECODE_ERROR); |
1737 | SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,SSL_R_LENGTH_MISMATCH); | 1960 | SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST,SSL_R_LENGTH_MISMATCH); |
@@ -2553,6 +2776,39 @@ int ssl3_send_client_key_exchange(SSL *s) | |||
2553 | EVP_PKEY_free(pub_key); | 2776 | EVP_PKEY_free(pub_key); |
2554 | 2777 | ||
2555 | } | 2778 | } |
2779 | #ifndef OPENSSL_NO_SRP | ||
2780 | else if (alg_k & SSL_kSRP) | ||
2781 | { | ||
2782 | if (s->srp_ctx.A != NULL) | ||
2783 | { | ||
2784 | /* send off the data */ | ||
2785 | n=BN_num_bytes(s->srp_ctx.A); | ||
2786 | s2n(n,p); | ||
2787 | BN_bn2bin(s->srp_ctx.A,p); | ||
2788 | n+=2; | ||
2789 | } | ||
2790 | else | ||
2791 | { | ||
2792 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); | ||
2793 | goto err; | ||
2794 | } | ||
2795 | if (s->session->srp_username != NULL) | ||
2796 | OPENSSL_free(s->session->srp_username); | ||
2797 | s->session->srp_username = BUF_strdup(s->srp_ctx.login); | ||
2798 | if (s->session->srp_username == NULL) | ||
2799 | { | ||
2800 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, | ||
2801 | ERR_R_MALLOC_FAILURE); | ||
2802 | goto err; | ||
2803 | } | ||
2804 | |||
2805 | if ((s->session->master_key_length = SRP_generate_client_master_secret(s,s->session->master_key))<0) | ||
2806 | { | ||
2807 | SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); | ||
2808 | goto err; | ||
2809 | } | ||
2810 | } | ||
2811 | #endif | ||
2556 | #ifndef OPENSSL_NO_PSK | 2812 | #ifndef OPENSSL_NO_PSK |
2557 | else if (alg_k & SSL_kPSK) | 2813 | else if (alg_k & SSL_kPSK) |
2558 | { | 2814 | { |
@@ -2672,12 +2928,13 @@ int ssl3_send_client_verify(SSL *s) | |||
2672 | unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH]; | 2928 | unsigned char data[MD5_DIGEST_LENGTH+SHA_DIGEST_LENGTH]; |
2673 | EVP_PKEY *pkey; | 2929 | EVP_PKEY *pkey; |
2674 | EVP_PKEY_CTX *pctx=NULL; | 2930 | EVP_PKEY_CTX *pctx=NULL; |
2675 | #ifndef OPENSSL_NO_RSA | 2931 | EVP_MD_CTX mctx; |
2676 | unsigned u=0; | 2932 | unsigned u=0; |
2677 | #endif | ||
2678 | unsigned long n; | 2933 | unsigned long n; |
2679 | int j; | 2934 | int j; |
2680 | 2935 | ||
2936 | EVP_MD_CTX_init(&mctx); | ||
2937 | |||
2681 | if (s->state == SSL3_ST_CW_CERT_VRFY_A) | 2938 | if (s->state == SSL3_ST_CW_CERT_VRFY_A) |
2682 | { | 2939 | { |
2683 | d=(unsigned char *)s->init_buf->data; | 2940 | d=(unsigned char *)s->init_buf->data; |
@@ -2688,7 +2945,8 @@ int ssl3_send_client_verify(SSL *s) | |||
2688 | EVP_PKEY_sign_init(pctx); | 2945 | EVP_PKEY_sign_init(pctx); |
2689 | if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1())>0) | 2946 | if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1())>0) |
2690 | { | 2947 | { |
2691 | s->method->ssl3_enc->cert_verify_mac(s, | 2948 | if (TLS1_get_version(s) < TLS1_2_VERSION) |
2949 | s->method->ssl3_enc->cert_verify_mac(s, | ||
2692 | NID_sha1, | 2950 | NID_sha1, |
2693 | &(data[MD5_DIGEST_LENGTH])); | 2951 | &(data[MD5_DIGEST_LENGTH])); |
2694 | } | 2952 | } |
@@ -2696,6 +2954,41 @@ int ssl3_send_client_verify(SSL *s) | |||
2696 | { | 2954 | { |
2697 | ERR_clear_error(); | 2955 | ERR_clear_error(); |
2698 | } | 2956 | } |
2957 | /* For TLS v1.2 send signature algorithm and signature | ||
2958 | * using agreed digest and cached handshake records. | ||
2959 | */ | ||
2960 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
2961 | { | ||
2962 | long hdatalen = 0; | ||
2963 | void *hdata; | ||
2964 | const EVP_MD *md = s->cert->key->digest; | ||
2965 | hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, | ||
2966 | &hdata); | ||
2967 | if (hdatalen <= 0 || !tls12_get_sigandhash(p, pkey, md)) | ||
2968 | { | ||
2969 | SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, | ||
2970 | ERR_R_INTERNAL_ERROR); | ||
2971 | goto err; | ||
2972 | } | ||
2973 | p += 2; | ||
2974 | #ifdef SSL_DEBUG | ||
2975 | fprintf(stderr, "Using TLS 1.2 with client alg %s\n", | ||
2976 | EVP_MD_name(md)); | ||
2977 | #endif | ||
2978 | if (!EVP_SignInit_ex(&mctx, md, NULL) | ||
2979 | || !EVP_SignUpdate(&mctx, hdata, hdatalen) | ||
2980 | || !EVP_SignFinal(&mctx, p + 2, &u, pkey)) | ||
2981 | { | ||
2982 | SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, | ||
2983 | ERR_R_EVP_LIB); | ||
2984 | goto err; | ||
2985 | } | ||
2986 | s2n(u,p); | ||
2987 | n = u + 4; | ||
2988 | if (!ssl3_digest_cached_records(s)) | ||
2989 | goto err; | ||
2990 | } | ||
2991 | else | ||
2699 | #ifndef OPENSSL_NO_RSA | 2992 | #ifndef OPENSSL_NO_RSA |
2700 | if (pkey->type == EVP_PKEY_RSA) | 2993 | if (pkey->type == EVP_PKEY_RSA) |
2701 | { | 2994 | { |
@@ -2778,9 +3071,11 @@ int ssl3_send_client_verify(SSL *s) | |||
2778 | s->init_num=(int)n+4; | 3071 | s->init_num=(int)n+4; |
2779 | s->init_off=0; | 3072 | s->init_off=0; |
2780 | } | 3073 | } |
3074 | EVP_MD_CTX_cleanup(&mctx); | ||
2781 | EVP_PKEY_CTX_free(pctx); | 3075 | EVP_PKEY_CTX_free(pctx); |
2782 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); | 3076 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); |
2783 | err: | 3077 | err: |
3078 | EVP_MD_CTX_cleanup(&mctx); | ||
2784 | EVP_PKEY_CTX_free(pctx); | 3079 | EVP_PKEY_CTX_free(pctx); |
2785 | return(-1); | 3080 | return(-1); |
2786 | } | 3081 | } |
@@ -2904,7 +3199,7 @@ int ssl3_check_cert_and_algorithm(SSL *s) | |||
2904 | if (idx == SSL_PKEY_ECC) | 3199 | if (idx == SSL_PKEY_ECC) |
2905 | { | 3200 | { |
2906 | if (ssl_check_srvr_ecc_cert_and_alg(sc->peer_pkeys[idx].x509, | 3201 | if (ssl_check_srvr_ecc_cert_and_alg(sc->peer_pkeys[idx].x509, |
2907 | s->s3->tmp.new_cipher) == 0) | 3202 | s) == 0) |
2908 | { /* check failed */ | 3203 | { /* check failed */ |
2909 | SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,SSL_R_BAD_ECC_CERT); | 3204 | SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM,SSL_R_BAD_ECC_CERT); |
2910 | goto f_err; | 3205 | goto f_err; |
@@ -3000,6 +3295,32 @@ err: | |||
3000 | return(0); | 3295 | return(0); |
3001 | } | 3296 | } |
3002 | 3297 | ||
3298 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
3299 | int ssl3_send_next_proto(SSL *s) | ||
3300 | { | ||
3301 | unsigned int len, padding_len; | ||
3302 | unsigned char *d; | ||
3303 | |||
3304 | if (s->state == SSL3_ST_CW_NEXT_PROTO_A) | ||
3305 | { | ||
3306 | len = s->next_proto_negotiated_len; | ||
3307 | padding_len = 32 - ((len + 2) % 32); | ||
3308 | d = (unsigned char *)s->init_buf->data; | ||
3309 | d[4] = len; | ||
3310 | memcpy(d + 5, s->next_proto_negotiated, len); | ||
3311 | d[5 + len] = padding_len; | ||
3312 | memset(d + 6 + len, 0, padding_len); | ||
3313 | *(d++)=SSL3_MT_NEXT_PROTO; | ||
3314 | l2n3(2 + len + padding_len, d); | ||
3315 | s->state = SSL3_ST_CW_NEXT_PROTO_B; | ||
3316 | s->init_num = 4 + 2 + len + padding_len; | ||
3317 | s->init_off = 0; | ||
3318 | } | ||
3319 | |||
3320 | return ssl3_do_write(s, SSL3_RT_HANDSHAKE); | ||
3321 | } | ||
3322 | #endif /* !OPENSSL_NO_TLSEXT && !OPENSSL_NO_NEXTPROTONEG */ | ||
3323 | |||
3003 | /* Check to see if handshake is full or resumed. Usually this is just a | 3324 | /* Check to see if handshake is full or resumed. Usually this is just a |
3004 | * case of checking to see if a cache hit has occurred. In the case of | 3325 | * case of checking to see if a cache hit has occurred. In the case of |
3005 | * session tickets we have to check the next message to be sure. | 3326 | * session tickets we have to check the next message to be sure. |
diff --git a/src/lib/libssl/src/ssl/s3_enc.c b/src/lib/libssl/src/ssl/s3_enc.c index b14597076d..c5df2cb90a 100644 --- a/src/lib/libssl/src/ssl/s3_enc.c +++ b/src/lib/libssl/src/ssl/s3_enc.c | |||
@@ -170,6 +170,7 @@ static int ssl3_generate_key_block(SSL *s, unsigned char *km, int num) | |||
170 | #endif | 170 | #endif |
171 | k=0; | 171 | k=0; |
172 | EVP_MD_CTX_init(&m5); | 172 | EVP_MD_CTX_init(&m5); |
173 | EVP_MD_CTX_set_flags(&m5, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
173 | EVP_MD_CTX_init(&s1); | 174 | EVP_MD_CTX_init(&s1); |
174 | for (i=0; (int)i<num; i+=MD5_DIGEST_LENGTH) | 175 | for (i=0; (int)i<num; i+=MD5_DIGEST_LENGTH) |
175 | { | 176 | { |
@@ -571,12 +572,12 @@ void ssl3_free_digest_list(SSL *s) | |||
571 | OPENSSL_free(s->s3->handshake_dgst); | 572 | OPENSSL_free(s->s3->handshake_dgst); |
572 | s->s3->handshake_dgst=NULL; | 573 | s->s3->handshake_dgst=NULL; |
573 | } | 574 | } |
574 | 575 | ||
575 | 576 | ||
576 | 577 | ||
577 | void ssl3_finish_mac(SSL *s, const unsigned char *buf, int len) | 578 | void ssl3_finish_mac(SSL *s, const unsigned char *buf, int len) |
578 | { | 579 | { |
579 | if (s->s3->handshake_buffer) | 580 | if (s->s3->handshake_buffer && !(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) |
580 | { | 581 | { |
581 | BIO_write (s->s3->handshake_buffer,(void *)buf,len); | 582 | BIO_write (s->s3->handshake_buffer,(void *)buf,len); |
582 | } | 583 | } |
@@ -613,9 +614,16 @@ int ssl3_digest_cached_records(SSL *s) | |||
613 | /* Loop through bitso of algorithm2 field and create MD_CTX-es */ | 614 | /* Loop through bitso of algorithm2 field and create MD_CTX-es */ |
614 | for (i=0;ssl_get_handshake_digest(i,&mask,&md); i++) | 615 | for (i=0;ssl_get_handshake_digest(i,&mask,&md); i++) |
615 | { | 616 | { |
616 | if ((mask & s->s3->tmp.new_cipher->algorithm2) && md) | 617 | if ((mask & ssl_get_algorithm2(s)) && md) |
617 | { | 618 | { |
618 | s->s3->handshake_dgst[i]=EVP_MD_CTX_create(); | 619 | s->s3->handshake_dgst[i]=EVP_MD_CTX_create(); |
620 | #ifdef OPENSSL_FIPS | ||
621 | if (EVP_MD_nid(md) == NID_md5) | ||
622 | { | ||
623 | EVP_MD_CTX_set_flags(s->s3->handshake_dgst[i], | ||
624 | EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
625 | } | ||
626 | #endif | ||
619 | EVP_DigestInit_ex(s->s3->handshake_dgst[i],md,NULL); | 627 | EVP_DigestInit_ex(s->s3->handshake_dgst[i],md,NULL); |
620 | EVP_DigestUpdate(s->s3->handshake_dgst[i],hdata,hdatalen); | 628 | EVP_DigestUpdate(s->s3->handshake_dgst[i],hdata,hdatalen); |
621 | } | 629 | } |
@@ -624,9 +632,12 @@ int ssl3_digest_cached_records(SSL *s) | |||
624 | s->s3->handshake_dgst[i]=NULL; | 632 | s->s3->handshake_dgst[i]=NULL; |
625 | } | 633 | } |
626 | } | 634 | } |
627 | /* Free handshake_buffer BIO */ | 635 | if (!(s->s3->flags & TLS1_FLAGS_KEEP_HANDSHAKE)) |
628 | BIO_free(s->s3->handshake_buffer); | 636 | { |
629 | s->s3->handshake_buffer = NULL; | 637 | /* Free handshake_buffer BIO */ |
638 | BIO_free(s->s3->handshake_buffer); | ||
639 | s->s3->handshake_buffer = NULL; | ||
640 | } | ||
630 | 641 | ||
631 | return 1; | 642 | return 1; |
632 | } | 643 | } |
@@ -672,6 +683,7 @@ static int ssl3_handshake_mac(SSL *s, int md_nid, | |||
672 | return 0; | 683 | return 0; |
673 | } | 684 | } |
674 | EVP_MD_CTX_init(&ctx); | 685 | EVP_MD_CTX_init(&ctx); |
686 | EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
675 | EVP_MD_CTX_copy_ex(&ctx,d); | 687 | EVP_MD_CTX_copy_ex(&ctx,d); |
676 | n=EVP_MD_CTX_size(&ctx); | 688 | n=EVP_MD_CTX_size(&ctx); |
677 | if (n < 0) | 689 | if (n < 0) |
diff --git a/src/lib/libssl/src/ssl/s3_lib.c b/src/lib/libssl/src/ssl/s3_lib.c index 1130244aeb..fb60cde8ee 100644 --- a/src/lib/libssl/src/ssl/s3_lib.c +++ b/src/lib/libssl/src/ssl/s3_lib.c | |||
@@ -1071,6 +1071,103 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1071 | 256, | 1071 | 256, |
1072 | }, | 1072 | }, |
1073 | 1073 | ||
1074 | /* TLS v1.2 ciphersuites */ | ||
1075 | /* Cipher 3B */ | ||
1076 | { | ||
1077 | 1, | ||
1078 | TLS1_TXT_RSA_WITH_NULL_SHA256, | ||
1079 | TLS1_CK_RSA_WITH_NULL_SHA256, | ||
1080 | SSL_kRSA, | ||
1081 | SSL_aRSA, | ||
1082 | SSL_eNULL, | ||
1083 | SSL_SHA256, | ||
1084 | SSL_TLSV1_2, | ||
1085 | SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS, | ||
1086 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1087 | 0, | ||
1088 | 0, | ||
1089 | }, | ||
1090 | |||
1091 | /* Cipher 3C */ | ||
1092 | { | ||
1093 | 1, | ||
1094 | TLS1_TXT_RSA_WITH_AES_128_SHA256, | ||
1095 | TLS1_CK_RSA_WITH_AES_128_SHA256, | ||
1096 | SSL_kRSA, | ||
1097 | SSL_aRSA, | ||
1098 | SSL_AES128, | ||
1099 | SSL_SHA256, | ||
1100 | SSL_TLSV1_2, | ||
1101 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1102 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1103 | 128, | ||
1104 | 128, | ||
1105 | }, | ||
1106 | |||
1107 | /* Cipher 3D */ | ||
1108 | { | ||
1109 | 1, | ||
1110 | TLS1_TXT_RSA_WITH_AES_256_SHA256, | ||
1111 | TLS1_CK_RSA_WITH_AES_256_SHA256, | ||
1112 | SSL_kRSA, | ||
1113 | SSL_aRSA, | ||
1114 | SSL_AES256, | ||
1115 | SSL_SHA256, | ||
1116 | SSL_TLSV1_2, | ||
1117 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1118 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1119 | 256, | ||
1120 | 256, | ||
1121 | }, | ||
1122 | |||
1123 | /* Cipher 3E */ | ||
1124 | { | ||
1125 | 0, /* not implemented (non-ephemeral DH) */ | ||
1126 | TLS1_TXT_DH_DSS_WITH_AES_128_SHA256, | ||
1127 | TLS1_CK_DH_DSS_WITH_AES_128_SHA256, | ||
1128 | SSL_kDHr, | ||
1129 | SSL_aDH, | ||
1130 | SSL_AES128, | ||
1131 | SSL_SHA256, | ||
1132 | SSL_TLSV1_2, | ||
1133 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1134 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1135 | 128, | ||
1136 | 128, | ||
1137 | }, | ||
1138 | |||
1139 | /* Cipher 3F */ | ||
1140 | { | ||
1141 | 0, /* not implemented (non-ephemeral DH) */ | ||
1142 | TLS1_TXT_DH_RSA_WITH_AES_128_SHA256, | ||
1143 | TLS1_CK_DH_RSA_WITH_AES_128_SHA256, | ||
1144 | SSL_kDHr, | ||
1145 | SSL_aDH, | ||
1146 | SSL_AES128, | ||
1147 | SSL_SHA256, | ||
1148 | SSL_TLSV1_2, | ||
1149 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1150 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1151 | 128, | ||
1152 | 128, | ||
1153 | }, | ||
1154 | |||
1155 | /* Cipher 40 */ | ||
1156 | { | ||
1157 | 1, | ||
1158 | TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256, | ||
1159 | TLS1_CK_DHE_DSS_WITH_AES_128_SHA256, | ||
1160 | SSL_kEDH, | ||
1161 | SSL_aDSS, | ||
1162 | SSL_AES128, | ||
1163 | SSL_SHA256, | ||
1164 | SSL_TLSV1_2, | ||
1165 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1166 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1167 | 128, | ||
1168 | 128, | ||
1169 | }, | ||
1170 | |||
1074 | #ifndef OPENSSL_NO_CAMELLIA | 1171 | #ifndef OPENSSL_NO_CAMELLIA |
1075 | /* Camellia ciphersuites from RFC4132 (128-bit portion) */ | 1172 | /* Camellia ciphersuites from RFC4132 (128-bit portion) */ |
1076 | 1173 | ||
@@ -1287,6 +1384,122 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1287 | 128, | 1384 | 128, |
1288 | }, | 1385 | }, |
1289 | #endif | 1386 | #endif |
1387 | |||
1388 | /* TLS v1.2 ciphersuites */ | ||
1389 | /* Cipher 67 */ | ||
1390 | { | ||
1391 | 1, | ||
1392 | TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256, | ||
1393 | TLS1_CK_DHE_RSA_WITH_AES_128_SHA256, | ||
1394 | SSL_kEDH, | ||
1395 | SSL_aRSA, | ||
1396 | SSL_AES128, | ||
1397 | SSL_SHA256, | ||
1398 | SSL_TLSV1_2, | ||
1399 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1400 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1401 | 128, | ||
1402 | 128, | ||
1403 | }, | ||
1404 | |||
1405 | /* Cipher 68 */ | ||
1406 | { | ||
1407 | 0, /* not implemented (non-ephemeral DH) */ | ||
1408 | TLS1_TXT_DH_DSS_WITH_AES_256_SHA256, | ||
1409 | TLS1_CK_DH_DSS_WITH_AES_256_SHA256, | ||
1410 | SSL_kDHr, | ||
1411 | SSL_aDH, | ||
1412 | SSL_AES256, | ||
1413 | SSL_SHA256, | ||
1414 | SSL_TLSV1_2, | ||
1415 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1416 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1417 | 256, | ||
1418 | 256, | ||
1419 | }, | ||
1420 | |||
1421 | /* Cipher 69 */ | ||
1422 | { | ||
1423 | 0, /* not implemented (non-ephemeral DH) */ | ||
1424 | TLS1_TXT_DH_RSA_WITH_AES_256_SHA256, | ||
1425 | TLS1_CK_DH_RSA_WITH_AES_256_SHA256, | ||
1426 | SSL_kDHr, | ||
1427 | SSL_aDH, | ||
1428 | SSL_AES256, | ||
1429 | SSL_SHA256, | ||
1430 | SSL_TLSV1_2, | ||
1431 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1432 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1433 | 256, | ||
1434 | 256, | ||
1435 | }, | ||
1436 | |||
1437 | /* Cipher 6A */ | ||
1438 | { | ||
1439 | 1, | ||
1440 | TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256, | ||
1441 | TLS1_CK_DHE_DSS_WITH_AES_256_SHA256, | ||
1442 | SSL_kEDH, | ||
1443 | SSL_aDSS, | ||
1444 | SSL_AES256, | ||
1445 | SSL_SHA256, | ||
1446 | SSL_TLSV1_2, | ||
1447 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1448 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1449 | 256, | ||
1450 | 256, | ||
1451 | }, | ||
1452 | |||
1453 | /* Cipher 6B */ | ||
1454 | { | ||
1455 | 1, | ||
1456 | TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256, | ||
1457 | TLS1_CK_DHE_RSA_WITH_AES_256_SHA256, | ||
1458 | SSL_kEDH, | ||
1459 | SSL_aRSA, | ||
1460 | SSL_AES256, | ||
1461 | SSL_SHA256, | ||
1462 | SSL_TLSV1_2, | ||
1463 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1464 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1465 | 256, | ||
1466 | 256, | ||
1467 | }, | ||
1468 | |||
1469 | /* Cipher 6C */ | ||
1470 | { | ||
1471 | 1, | ||
1472 | TLS1_TXT_ADH_WITH_AES_128_SHA256, | ||
1473 | TLS1_CK_ADH_WITH_AES_128_SHA256, | ||
1474 | SSL_kEDH, | ||
1475 | SSL_aNULL, | ||
1476 | SSL_AES128, | ||
1477 | SSL_SHA256, | ||
1478 | SSL_TLSV1_2, | ||
1479 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1480 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1481 | 128, | ||
1482 | 128, | ||
1483 | }, | ||
1484 | |||
1485 | /* Cipher 6D */ | ||
1486 | { | ||
1487 | 1, | ||
1488 | TLS1_TXT_ADH_WITH_AES_256_SHA256, | ||
1489 | TLS1_CK_ADH_WITH_AES_256_SHA256, | ||
1490 | SSL_kEDH, | ||
1491 | SSL_aNULL, | ||
1492 | SSL_AES256, | ||
1493 | SSL_SHA256, | ||
1494 | SSL_TLSV1_2, | ||
1495 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1496 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
1497 | 256, | ||
1498 | 256, | ||
1499 | }, | ||
1500 | |||
1501 | /* GOST Ciphersuites */ | ||
1502 | |||
1290 | { | 1503 | { |
1291 | 1, | 1504 | 1, |
1292 | "GOST94-GOST89-GOST89", | 1505 | "GOST94-GOST89-GOST89", |
@@ -1610,6 +1823,200 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1610 | 1823 | ||
1611 | #endif /* OPENSSL_NO_SEED */ | 1824 | #endif /* OPENSSL_NO_SEED */ |
1612 | 1825 | ||
1826 | /* GCM ciphersuites from RFC5288 */ | ||
1827 | |||
1828 | /* Cipher 9C */ | ||
1829 | { | ||
1830 | 1, | ||
1831 | TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256, | ||
1832 | TLS1_CK_RSA_WITH_AES_128_GCM_SHA256, | ||
1833 | SSL_kRSA, | ||
1834 | SSL_aRSA, | ||
1835 | SSL_AES128GCM, | ||
1836 | SSL_AEAD, | ||
1837 | SSL_TLSV1_2, | ||
1838 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1839 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
1840 | 128, | ||
1841 | 128, | ||
1842 | }, | ||
1843 | |||
1844 | /* Cipher 9D */ | ||
1845 | { | ||
1846 | 1, | ||
1847 | TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384, | ||
1848 | TLS1_CK_RSA_WITH_AES_256_GCM_SHA384, | ||
1849 | SSL_kRSA, | ||
1850 | SSL_aRSA, | ||
1851 | SSL_AES256GCM, | ||
1852 | SSL_AEAD, | ||
1853 | SSL_TLSV1_2, | ||
1854 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1855 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
1856 | 256, | ||
1857 | 256, | ||
1858 | }, | ||
1859 | |||
1860 | /* Cipher 9E */ | ||
1861 | { | ||
1862 | 1, | ||
1863 | TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256, | ||
1864 | TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256, | ||
1865 | SSL_kEDH, | ||
1866 | SSL_aRSA, | ||
1867 | SSL_AES128GCM, | ||
1868 | SSL_AEAD, | ||
1869 | SSL_TLSV1_2, | ||
1870 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1871 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
1872 | 128, | ||
1873 | 128, | ||
1874 | }, | ||
1875 | |||
1876 | /* Cipher 9F */ | ||
1877 | { | ||
1878 | 1, | ||
1879 | TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384, | ||
1880 | TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384, | ||
1881 | SSL_kEDH, | ||
1882 | SSL_aRSA, | ||
1883 | SSL_AES256GCM, | ||
1884 | SSL_AEAD, | ||
1885 | SSL_TLSV1_2, | ||
1886 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1887 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
1888 | 256, | ||
1889 | 256, | ||
1890 | }, | ||
1891 | |||
1892 | /* Cipher A0 */ | ||
1893 | { | ||
1894 | 0, | ||
1895 | TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256, | ||
1896 | TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256, | ||
1897 | SSL_kDHr, | ||
1898 | SSL_aDH, | ||
1899 | SSL_AES128GCM, | ||
1900 | SSL_AEAD, | ||
1901 | SSL_TLSV1_2, | ||
1902 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1903 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
1904 | 128, | ||
1905 | 128, | ||
1906 | }, | ||
1907 | |||
1908 | /* Cipher A1 */ | ||
1909 | { | ||
1910 | 0, | ||
1911 | TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384, | ||
1912 | TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384, | ||
1913 | SSL_kDHr, | ||
1914 | SSL_aDH, | ||
1915 | SSL_AES256GCM, | ||
1916 | SSL_AEAD, | ||
1917 | SSL_TLSV1_2, | ||
1918 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1919 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
1920 | 256, | ||
1921 | 256, | ||
1922 | }, | ||
1923 | |||
1924 | /* Cipher A2 */ | ||
1925 | { | ||
1926 | 1, | ||
1927 | TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256, | ||
1928 | TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256, | ||
1929 | SSL_kEDH, | ||
1930 | SSL_aDSS, | ||
1931 | SSL_AES128GCM, | ||
1932 | SSL_AEAD, | ||
1933 | SSL_TLSV1_2, | ||
1934 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1935 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
1936 | 128, | ||
1937 | 128, | ||
1938 | }, | ||
1939 | |||
1940 | /* Cipher A3 */ | ||
1941 | { | ||
1942 | 1, | ||
1943 | TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384, | ||
1944 | TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384, | ||
1945 | SSL_kEDH, | ||
1946 | SSL_aDSS, | ||
1947 | SSL_AES256GCM, | ||
1948 | SSL_AEAD, | ||
1949 | SSL_TLSV1_2, | ||
1950 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1951 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
1952 | 256, | ||
1953 | 256, | ||
1954 | }, | ||
1955 | |||
1956 | /* Cipher A4 */ | ||
1957 | { | ||
1958 | 0, | ||
1959 | TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256, | ||
1960 | TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256, | ||
1961 | SSL_kDHr, | ||
1962 | SSL_aDH, | ||
1963 | SSL_AES128GCM, | ||
1964 | SSL_AEAD, | ||
1965 | SSL_TLSV1_2, | ||
1966 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1967 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
1968 | 128, | ||
1969 | 128, | ||
1970 | }, | ||
1971 | |||
1972 | /* Cipher A5 */ | ||
1973 | { | ||
1974 | 0, | ||
1975 | TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384, | ||
1976 | TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384, | ||
1977 | SSL_kDHr, | ||
1978 | SSL_aDH, | ||
1979 | SSL_AES256GCM, | ||
1980 | SSL_AEAD, | ||
1981 | SSL_TLSV1_2, | ||
1982 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1983 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
1984 | 256, | ||
1985 | 256, | ||
1986 | }, | ||
1987 | |||
1988 | /* Cipher A6 */ | ||
1989 | { | ||
1990 | 1, | ||
1991 | TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256, | ||
1992 | TLS1_CK_ADH_WITH_AES_128_GCM_SHA256, | ||
1993 | SSL_kEDH, | ||
1994 | SSL_aNULL, | ||
1995 | SSL_AES128GCM, | ||
1996 | SSL_AEAD, | ||
1997 | SSL_TLSV1_2, | ||
1998 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
1999 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2000 | 128, | ||
2001 | 128, | ||
2002 | }, | ||
2003 | |||
2004 | /* Cipher A7 */ | ||
2005 | { | ||
2006 | 1, | ||
2007 | TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384, | ||
2008 | TLS1_CK_ADH_WITH_AES_256_GCM_SHA384, | ||
2009 | SSL_kEDH, | ||
2010 | SSL_aNULL, | ||
2011 | SSL_AES256GCM, | ||
2012 | SSL_AEAD, | ||
2013 | SSL_TLSV1_2, | ||
2014 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2015 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2016 | 256, | ||
2017 | 256, | ||
2018 | }, | ||
2019 | |||
1613 | #ifndef OPENSSL_NO_ECDH | 2020 | #ifndef OPENSSL_NO_ECDH |
1614 | /* Cipher C001 */ | 2021 | /* Cipher C001 */ |
1615 | { | 2022 | { |
@@ -1621,7 +2028,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1621 | SSL_eNULL, | 2028 | SSL_eNULL, |
1622 | SSL_SHA1, | 2029 | SSL_SHA1, |
1623 | SSL_TLSV1, | 2030 | SSL_TLSV1, |
1624 | SSL_NOT_EXP|SSL_STRONG_NONE, | 2031 | SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS, |
1625 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2032 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1626 | 0, | 2033 | 0, |
1627 | 0, | 2034 | 0, |
@@ -1653,7 +2060,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1653 | SSL_3DES, | 2060 | SSL_3DES, |
1654 | SSL_SHA1, | 2061 | SSL_SHA1, |
1655 | SSL_TLSV1, | 2062 | SSL_TLSV1, |
1656 | SSL_NOT_EXP|SSL_HIGH, | 2063 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1657 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2064 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1658 | 168, | 2065 | 168, |
1659 | 168, | 2066 | 168, |
@@ -1669,7 +2076,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1669 | SSL_AES128, | 2076 | SSL_AES128, |
1670 | SSL_SHA1, | 2077 | SSL_SHA1, |
1671 | SSL_TLSV1, | 2078 | SSL_TLSV1, |
1672 | SSL_NOT_EXP|SSL_HIGH, | 2079 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1673 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2080 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1674 | 128, | 2081 | 128, |
1675 | 128, | 2082 | 128, |
@@ -1685,7 +2092,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1685 | SSL_AES256, | 2092 | SSL_AES256, |
1686 | SSL_SHA1, | 2093 | SSL_SHA1, |
1687 | SSL_TLSV1, | 2094 | SSL_TLSV1, |
1688 | SSL_NOT_EXP|SSL_HIGH, | 2095 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1689 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2096 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1690 | 256, | 2097 | 256, |
1691 | 256, | 2098 | 256, |
@@ -1701,7 +2108,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1701 | SSL_eNULL, | 2108 | SSL_eNULL, |
1702 | SSL_SHA1, | 2109 | SSL_SHA1, |
1703 | SSL_TLSV1, | 2110 | SSL_TLSV1, |
1704 | SSL_NOT_EXP|SSL_STRONG_NONE, | 2111 | SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS, |
1705 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2112 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1706 | 0, | 2113 | 0, |
1707 | 0, | 2114 | 0, |
@@ -1733,7 +2140,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1733 | SSL_3DES, | 2140 | SSL_3DES, |
1734 | SSL_SHA1, | 2141 | SSL_SHA1, |
1735 | SSL_TLSV1, | 2142 | SSL_TLSV1, |
1736 | SSL_NOT_EXP|SSL_HIGH, | 2143 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1737 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2144 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1738 | 168, | 2145 | 168, |
1739 | 168, | 2146 | 168, |
@@ -1749,7 +2156,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1749 | SSL_AES128, | 2156 | SSL_AES128, |
1750 | SSL_SHA1, | 2157 | SSL_SHA1, |
1751 | SSL_TLSV1, | 2158 | SSL_TLSV1, |
1752 | SSL_NOT_EXP|SSL_HIGH, | 2159 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1753 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2160 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1754 | 128, | 2161 | 128, |
1755 | 128, | 2162 | 128, |
@@ -1765,7 +2172,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1765 | SSL_AES256, | 2172 | SSL_AES256, |
1766 | SSL_SHA1, | 2173 | SSL_SHA1, |
1767 | SSL_TLSV1, | 2174 | SSL_TLSV1, |
1768 | SSL_NOT_EXP|SSL_HIGH, | 2175 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1769 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2176 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1770 | 256, | 2177 | 256, |
1771 | 256, | 2178 | 256, |
@@ -1781,7 +2188,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1781 | SSL_eNULL, | 2188 | SSL_eNULL, |
1782 | SSL_SHA1, | 2189 | SSL_SHA1, |
1783 | SSL_TLSV1, | 2190 | SSL_TLSV1, |
1784 | SSL_NOT_EXP|SSL_STRONG_NONE, | 2191 | SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS, |
1785 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2192 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1786 | 0, | 2193 | 0, |
1787 | 0, | 2194 | 0, |
@@ -1813,7 +2220,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1813 | SSL_3DES, | 2220 | SSL_3DES, |
1814 | SSL_SHA1, | 2221 | SSL_SHA1, |
1815 | SSL_TLSV1, | 2222 | SSL_TLSV1, |
1816 | SSL_NOT_EXP|SSL_HIGH, | 2223 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1817 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2224 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1818 | 168, | 2225 | 168, |
1819 | 168, | 2226 | 168, |
@@ -1829,7 +2236,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1829 | SSL_AES128, | 2236 | SSL_AES128, |
1830 | SSL_SHA1, | 2237 | SSL_SHA1, |
1831 | SSL_TLSV1, | 2238 | SSL_TLSV1, |
1832 | SSL_NOT_EXP|SSL_HIGH, | 2239 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1833 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2240 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1834 | 128, | 2241 | 128, |
1835 | 128, | 2242 | 128, |
@@ -1845,7 +2252,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1845 | SSL_AES256, | 2252 | SSL_AES256, |
1846 | SSL_SHA1, | 2253 | SSL_SHA1, |
1847 | SSL_TLSV1, | 2254 | SSL_TLSV1, |
1848 | SSL_NOT_EXP|SSL_HIGH, | 2255 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1849 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2256 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1850 | 256, | 2257 | 256, |
1851 | 256, | 2258 | 256, |
@@ -1861,7 +2268,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1861 | SSL_eNULL, | 2268 | SSL_eNULL, |
1862 | SSL_SHA1, | 2269 | SSL_SHA1, |
1863 | SSL_TLSV1, | 2270 | SSL_TLSV1, |
1864 | SSL_NOT_EXP|SSL_STRONG_NONE, | 2271 | SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS, |
1865 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2272 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1866 | 0, | 2273 | 0, |
1867 | 0, | 2274 | 0, |
@@ -1893,7 +2300,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1893 | SSL_3DES, | 2300 | SSL_3DES, |
1894 | SSL_SHA1, | 2301 | SSL_SHA1, |
1895 | SSL_TLSV1, | 2302 | SSL_TLSV1, |
1896 | SSL_NOT_EXP|SSL_HIGH, | 2303 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1897 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2304 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1898 | 168, | 2305 | 168, |
1899 | 168, | 2306 | 168, |
@@ -1909,7 +2316,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1909 | SSL_AES128, | 2316 | SSL_AES128, |
1910 | SSL_SHA1, | 2317 | SSL_SHA1, |
1911 | SSL_TLSV1, | 2318 | SSL_TLSV1, |
1912 | SSL_NOT_EXP|SSL_HIGH, | 2319 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1913 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2320 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1914 | 128, | 2321 | 128, |
1915 | 128, | 2322 | 128, |
@@ -1925,7 +2332,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1925 | SSL_AES256, | 2332 | SSL_AES256, |
1926 | SSL_SHA1, | 2333 | SSL_SHA1, |
1927 | SSL_TLSV1, | 2334 | SSL_TLSV1, |
1928 | SSL_NOT_EXP|SSL_HIGH, | 2335 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1929 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2336 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1930 | 256, | 2337 | 256, |
1931 | 256, | 2338 | 256, |
@@ -1941,7 +2348,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1941 | SSL_eNULL, | 2348 | SSL_eNULL, |
1942 | SSL_SHA1, | 2349 | SSL_SHA1, |
1943 | SSL_TLSV1, | 2350 | SSL_TLSV1, |
1944 | SSL_NOT_EXP|SSL_STRONG_NONE, | 2351 | SSL_NOT_EXP|SSL_STRONG_NONE|SSL_FIPS, |
1945 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2352 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1946 | 0, | 2353 | 0, |
1947 | 0, | 2354 | 0, |
@@ -1973,7 +2380,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1973 | SSL_3DES, | 2380 | SSL_3DES, |
1974 | SSL_SHA1, | 2381 | SSL_SHA1, |
1975 | SSL_TLSV1, | 2382 | SSL_TLSV1, |
1976 | SSL_NOT_EXP|SSL_HIGH, | 2383 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1977 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2384 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1978 | 168, | 2385 | 168, |
1979 | 168, | 2386 | 168, |
@@ -1989,7 +2396,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
1989 | SSL_AES128, | 2396 | SSL_AES128, |
1990 | SSL_SHA1, | 2397 | SSL_SHA1, |
1991 | SSL_TLSV1, | 2398 | SSL_TLSV1, |
1992 | SSL_NOT_EXP|SSL_HIGH, | 2399 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
1993 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2400 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
1994 | 128, | 2401 | 128, |
1995 | 128, | 2402 | 128, |
@@ -2005,13 +2412,423 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[]={ | |||
2005 | SSL_AES256, | 2412 | SSL_AES256, |
2006 | SSL_SHA1, | 2413 | SSL_SHA1, |
2007 | SSL_TLSV1, | 2414 | SSL_TLSV1, |
2008 | SSL_NOT_EXP|SSL_HIGH, | 2415 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, |
2009 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | 2416 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, |
2010 | 256, | 2417 | 256, |
2011 | 256, | 2418 | 256, |
2012 | }, | 2419 | }, |
2013 | #endif /* OPENSSL_NO_ECDH */ | 2420 | #endif /* OPENSSL_NO_ECDH */ |
2014 | 2421 | ||
2422 | #ifndef OPENSSL_NO_SRP | ||
2423 | /* Cipher C01A */ | ||
2424 | { | ||
2425 | 1, | ||
2426 | TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA, | ||
2427 | TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA, | ||
2428 | SSL_kSRP, | ||
2429 | SSL_aNULL, | ||
2430 | SSL_3DES, | ||
2431 | SSL_SHA1, | ||
2432 | SSL_TLSV1, | ||
2433 | SSL_NOT_EXP|SSL_HIGH, | ||
2434 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2435 | 168, | ||
2436 | 168, | ||
2437 | }, | ||
2438 | |||
2439 | /* Cipher C01B */ | ||
2440 | { | ||
2441 | 1, | ||
2442 | TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA, | ||
2443 | TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA, | ||
2444 | SSL_kSRP, | ||
2445 | SSL_aRSA, | ||
2446 | SSL_3DES, | ||
2447 | SSL_SHA1, | ||
2448 | SSL_TLSV1, | ||
2449 | SSL_NOT_EXP|SSL_HIGH, | ||
2450 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2451 | 168, | ||
2452 | 168, | ||
2453 | }, | ||
2454 | |||
2455 | /* Cipher C01C */ | ||
2456 | { | ||
2457 | 1, | ||
2458 | TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA, | ||
2459 | TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA, | ||
2460 | SSL_kSRP, | ||
2461 | SSL_aDSS, | ||
2462 | SSL_3DES, | ||
2463 | SSL_SHA1, | ||
2464 | SSL_TLSV1, | ||
2465 | SSL_NOT_EXP|SSL_HIGH, | ||
2466 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2467 | 168, | ||
2468 | 168, | ||
2469 | }, | ||
2470 | |||
2471 | /* Cipher C01D */ | ||
2472 | { | ||
2473 | 1, | ||
2474 | TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA, | ||
2475 | TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA, | ||
2476 | SSL_kSRP, | ||
2477 | SSL_aNULL, | ||
2478 | SSL_AES128, | ||
2479 | SSL_SHA1, | ||
2480 | SSL_TLSV1, | ||
2481 | SSL_NOT_EXP|SSL_HIGH, | ||
2482 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2483 | 128, | ||
2484 | 128, | ||
2485 | }, | ||
2486 | |||
2487 | /* Cipher C01E */ | ||
2488 | { | ||
2489 | 1, | ||
2490 | TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA, | ||
2491 | TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA, | ||
2492 | SSL_kSRP, | ||
2493 | SSL_aRSA, | ||
2494 | SSL_AES128, | ||
2495 | SSL_SHA1, | ||
2496 | SSL_TLSV1, | ||
2497 | SSL_NOT_EXP|SSL_HIGH, | ||
2498 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2499 | 128, | ||
2500 | 128, | ||
2501 | }, | ||
2502 | |||
2503 | /* Cipher C01F */ | ||
2504 | { | ||
2505 | 1, | ||
2506 | TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA, | ||
2507 | TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA, | ||
2508 | SSL_kSRP, | ||
2509 | SSL_aDSS, | ||
2510 | SSL_AES128, | ||
2511 | SSL_SHA1, | ||
2512 | SSL_TLSV1, | ||
2513 | SSL_NOT_EXP|SSL_HIGH, | ||
2514 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2515 | 128, | ||
2516 | 128, | ||
2517 | }, | ||
2518 | |||
2519 | /* Cipher C020 */ | ||
2520 | { | ||
2521 | 1, | ||
2522 | TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA, | ||
2523 | TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA, | ||
2524 | SSL_kSRP, | ||
2525 | SSL_aNULL, | ||
2526 | SSL_AES256, | ||
2527 | SSL_SHA1, | ||
2528 | SSL_TLSV1, | ||
2529 | SSL_NOT_EXP|SSL_HIGH, | ||
2530 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2531 | 256, | ||
2532 | 256, | ||
2533 | }, | ||
2534 | |||
2535 | /* Cipher C021 */ | ||
2536 | { | ||
2537 | 1, | ||
2538 | TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA, | ||
2539 | TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA, | ||
2540 | SSL_kSRP, | ||
2541 | SSL_aRSA, | ||
2542 | SSL_AES256, | ||
2543 | SSL_SHA1, | ||
2544 | SSL_TLSV1, | ||
2545 | SSL_NOT_EXP|SSL_HIGH, | ||
2546 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2547 | 256, | ||
2548 | 256, | ||
2549 | }, | ||
2550 | |||
2551 | /* Cipher C022 */ | ||
2552 | { | ||
2553 | 1, | ||
2554 | TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA, | ||
2555 | TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA, | ||
2556 | SSL_kSRP, | ||
2557 | SSL_aDSS, | ||
2558 | SSL_AES256, | ||
2559 | SSL_SHA1, | ||
2560 | SSL_TLSV1, | ||
2561 | SSL_NOT_EXP|SSL_HIGH, | ||
2562 | SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF, | ||
2563 | 256, | ||
2564 | 256, | ||
2565 | }, | ||
2566 | #endif /* OPENSSL_NO_SRP */ | ||
2567 | #ifndef OPENSSL_NO_ECDH | ||
2568 | |||
2569 | /* HMAC based TLS v1.2 ciphersuites from RFC5289 */ | ||
2570 | |||
2571 | /* Cipher C023 */ | ||
2572 | { | ||
2573 | 1, | ||
2574 | TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256, | ||
2575 | TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256, | ||
2576 | SSL_kEECDH, | ||
2577 | SSL_aECDSA, | ||
2578 | SSL_AES128, | ||
2579 | SSL_SHA256, | ||
2580 | SSL_TLSV1_2, | ||
2581 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2582 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2583 | 128, | ||
2584 | 128, | ||
2585 | }, | ||
2586 | |||
2587 | /* Cipher C024 */ | ||
2588 | { | ||
2589 | 1, | ||
2590 | TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384, | ||
2591 | TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384, | ||
2592 | SSL_kEECDH, | ||
2593 | SSL_aECDSA, | ||
2594 | SSL_AES256, | ||
2595 | SSL_SHA384, | ||
2596 | SSL_TLSV1_2, | ||
2597 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2598 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2599 | 256, | ||
2600 | 256, | ||
2601 | }, | ||
2602 | |||
2603 | /* Cipher C025 */ | ||
2604 | { | ||
2605 | 1, | ||
2606 | TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256, | ||
2607 | TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256, | ||
2608 | SSL_kECDHe, | ||
2609 | SSL_aECDH, | ||
2610 | SSL_AES128, | ||
2611 | SSL_SHA256, | ||
2612 | SSL_TLSV1_2, | ||
2613 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2614 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2615 | 128, | ||
2616 | 128, | ||
2617 | }, | ||
2618 | |||
2619 | /* Cipher C026 */ | ||
2620 | { | ||
2621 | 1, | ||
2622 | TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384, | ||
2623 | TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384, | ||
2624 | SSL_kECDHe, | ||
2625 | SSL_aECDH, | ||
2626 | SSL_AES256, | ||
2627 | SSL_SHA384, | ||
2628 | SSL_TLSV1_2, | ||
2629 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2630 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2631 | 256, | ||
2632 | 256, | ||
2633 | }, | ||
2634 | |||
2635 | /* Cipher C027 */ | ||
2636 | { | ||
2637 | 1, | ||
2638 | TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256, | ||
2639 | TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256, | ||
2640 | SSL_kEECDH, | ||
2641 | SSL_aRSA, | ||
2642 | SSL_AES128, | ||
2643 | SSL_SHA256, | ||
2644 | SSL_TLSV1_2, | ||
2645 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2646 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2647 | 128, | ||
2648 | 128, | ||
2649 | }, | ||
2650 | |||
2651 | /* Cipher C028 */ | ||
2652 | { | ||
2653 | 1, | ||
2654 | TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384, | ||
2655 | TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384, | ||
2656 | SSL_kEECDH, | ||
2657 | SSL_aRSA, | ||
2658 | SSL_AES256, | ||
2659 | SSL_SHA384, | ||
2660 | SSL_TLSV1_2, | ||
2661 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2662 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2663 | 256, | ||
2664 | 256, | ||
2665 | }, | ||
2666 | |||
2667 | /* Cipher C029 */ | ||
2668 | { | ||
2669 | 1, | ||
2670 | TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256, | ||
2671 | TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256, | ||
2672 | SSL_kECDHe, | ||
2673 | SSL_aECDH, | ||
2674 | SSL_AES128, | ||
2675 | SSL_SHA256, | ||
2676 | SSL_TLSV1_2, | ||
2677 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2678 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2679 | 128, | ||
2680 | 128, | ||
2681 | }, | ||
2682 | |||
2683 | /* Cipher C02A */ | ||
2684 | { | ||
2685 | 1, | ||
2686 | TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384, | ||
2687 | TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384, | ||
2688 | SSL_kECDHe, | ||
2689 | SSL_aECDH, | ||
2690 | SSL_AES256, | ||
2691 | SSL_SHA384, | ||
2692 | SSL_TLSV1_2, | ||
2693 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2694 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2695 | 256, | ||
2696 | 256, | ||
2697 | }, | ||
2698 | |||
2699 | /* GCM based TLS v1.2 ciphersuites from RFC5289 */ | ||
2700 | |||
2701 | /* Cipher C02B */ | ||
2702 | { | ||
2703 | 1, | ||
2704 | TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | ||
2705 | TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | ||
2706 | SSL_kEECDH, | ||
2707 | SSL_aECDSA, | ||
2708 | SSL_AES128GCM, | ||
2709 | SSL_AEAD, | ||
2710 | SSL_TLSV1_2, | ||
2711 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2712 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2713 | 128, | ||
2714 | 128, | ||
2715 | }, | ||
2716 | |||
2717 | /* Cipher C02C */ | ||
2718 | { | ||
2719 | 1, | ||
2720 | TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, | ||
2721 | TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, | ||
2722 | SSL_kEECDH, | ||
2723 | SSL_aECDSA, | ||
2724 | SSL_AES256GCM, | ||
2725 | SSL_AEAD, | ||
2726 | SSL_TLSV1_2, | ||
2727 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2728 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2729 | 256, | ||
2730 | 256, | ||
2731 | }, | ||
2732 | |||
2733 | /* Cipher C02D */ | ||
2734 | { | ||
2735 | 1, | ||
2736 | TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, | ||
2737 | TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, | ||
2738 | SSL_kECDHe, | ||
2739 | SSL_aECDH, | ||
2740 | SSL_AES128GCM, | ||
2741 | SSL_AEAD, | ||
2742 | SSL_TLSV1_2, | ||
2743 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2744 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2745 | 128, | ||
2746 | 128, | ||
2747 | }, | ||
2748 | |||
2749 | /* Cipher C02E */ | ||
2750 | { | ||
2751 | 1, | ||
2752 | TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, | ||
2753 | TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, | ||
2754 | SSL_kECDHe, | ||
2755 | SSL_aECDH, | ||
2756 | SSL_AES256GCM, | ||
2757 | SSL_AEAD, | ||
2758 | SSL_TLSV1_2, | ||
2759 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2760 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2761 | 256, | ||
2762 | 256, | ||
2763 | }, | ||
2764 | |||
2765 | /* Cipher C02F */ | ||
2766 | { | ||
2767 | 1, | ||
2768 | TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | ||
2769 | TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | ||
2770 | SSL_kEECDH, | ||
2771 | SSL_aRSA, | ||
2772 | SSL_AES128GCM, | ||
2773 | SSL_AEAD, | ||
2774 | SSL_TLSV1_2, | ||
2775 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2776 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2777 | 128, | ||
2778 | 128, | ||
2779 | }, | ||
2780 | |||
2781 | /* Cipher C030 */ | ||
2782 | { | ||
2783 | 1, | ||
2784 | TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384, | ||
2785 | TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384, | ||
2786 | SSL_kEECDH, | ||
2787 | SSL_aRSA, | ||
2788 | SSL_AES256GCM, | ||
2789 | SSL_AEAD, | ||
2790 | SSL_TLSV1_2, | ||
2791 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2792 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2793 | 256, | ||
2794 | 256, | ||
2795 | }, | ||
2796 | |||
2797 | /* Cipher C031 */ | ||
2798 | { | ||
2799 | 1, | ||
2800 | TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256, | ||
2801 | TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256, | ||
2802 | SSL_kECDHe, | ||
2803 | SSL_aECDH, | ||
2804 | SSL_AES128GCM, | ||
2805 | SSL_AEAD, | ||
2806 | SSL_TLSV1_2, | ||
2807 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2808 | SSL_HANDSHAKE_MAC_SHA256|TLS1_PRF_SHA256, | ||
2809 | 128, | ||
2810 | 128, | ||
2811 | }, | ||
2812 | |||
2813 | /* Cipher C032 */ | ||
2814 | { | ||
2815 | 1, | ||
2816 | TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384, | ||
2817 | TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384, | ||
2818 | SSL_kECDHe, | ||
2819 | SSL_aECDH, | ||
2820 | SSL_AES256GCM, | ||
2821 | SSL_AEAD, | ||
2822 | SSL_TLSV1_2, | ||
2823 | SSL_NOT_EXP|SSL_HIGH|SSL_FIPS, | ||
2824 | SSL_HANDSHAKE_MAC_SHA384|TLS1_PRF_SHA384, | ||
2825 | 256, | ||
2826 | 256, | ||
2827 | }, | ||
2828 | |||
2829 | #endif /* OPENSSL_NO_ECDH */ | ||
2830 | |||
2831 | |||
2015 | #ifdef TEMP_GOST_TLS | 2832 | #ifdef TEMP_GOST_TLS |
2016 | /* Cipher FF00 */ | 2833 | /* Cipher FF00 */ |
2017 | { | 2834 | { |
@@ -2087,6 +2904,9 @@ SSL3_ENC_METHOD SSLv3_enc_data={ | |||
2087 | SSL3_MD_CLIENT_FINISHED_CONST,4, | 2904 | SSL3_MD_CLIENT_FINISHED_CONST,4, |
2088 | SSL3_MD_SERVER_FINISHED_CONST,4, | 2905 | SSL3_MD_SERVER_FINISHED_CONST,4, |
2089 | ssl3_alert_code, | 2906 | ssl3_alert_code, |
2907 | (int (*)(SSL *, unsigned char *, size_t, const char *, | ||
2908 | size_t, const unsigned char *, size_t, | ||
2909 | int use_context))ssl_undefined_function, | ||
2090 | }; | 2910 | }; |
2091 | 2911 | ||
2092 | long ssl3_default_timeout(void) | 2912 | long ssl3_default_timeout(void) |
@@ -2128,6 +2948,9 @@ int ssl3_new(SSL *s) | |||
2128 | 2948 | ||
2129 | s->s3=s3; | 2949 | s->s3=s3; |
2130 | 2950 | ||
2951 | #ifndef OPENSSL_NO_SRP | ||
2952 | SSL_SRP_CTX_init(s); | ||
2953 | #endif | ||
2131 | s->method->ssl_clear(s); | 2954 | s->method->ssl_clear(s); |
2132 | return(1); | 2955 | return(1); |
2133 | err: | 2956 | err: |
@@ -2168,6 +2991,9 @@ void ssl3_free(SSL *s) | |||
2168 | BIO_free(s->s3->handshake_buffer); | 2991 | BIO_free(s->s3->handshake_buffer); |
2169 | } | 2992 | } |
2170 | if (s->s3->handshake_dgst) ssl3_free_digest_list(s); | 2993 | if (s->s3->handshake_dgst) ssl3_free_digest_list(s); |
2994 | #ifndef OPENSSL_NO_SRP | ||
2995 | SSL_SRP_CTX_free(s); | ||
2996 | #endif | ||
2171 | OPENSSL_cleanse(s->s3,sizeof *s->s3); | 2997 | OPENSSL_cleanse(s->s3,sizeof *s->s3); |
2172 | OPENSSL_free(s->s3); | 2998 | OPENSSL_free(s->s3); |
2173 | s->s3=NULL; | 2999 | s->s3=NULL; |
@@ -2239,8 +3065,24 @@ void ssl3_clear(SSL *s) | |||
2239 | s->s3->num_renegotiations=0; | 3065 | s->s3->num_renegotiations=0; |
2240 | s->s3->in_read_app_data=0; | 3066 | s->s3->in_read_app_data=0; |
2241 | s->version=SSL3_VERSION; | 3067 | s->version=SSL3_VERSION; |
3068 | |||
3069 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
3070 | if (s->next_proto_negotiated) | ||
3071 | { | ||
3072 | OPENSSL_free(s->next_proto_negotiated); | ||
3073 | s->next_proto_negotiated = NULL; | ||
3074 | s->next_proto_negotiated_len = 0; | ||
3075 | } | ||
3076 | #endif | ||
2242 | } | 3077 | } |
2243 | 3078 | ||
3079 | #ifndef OPENSSL_NO_SRP | ||
3080 | static char * MS_CALLBACK srp_password_from_info_cb(SSL *s, void *arg) | ||
3081 | { | ||
3082 | return BUF_strdup(s->srp_ctx.info) ; | ||
3083 | } | ||
3084 | #endif | ||
3085 | |||
2244 | long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) | 3086 | long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) |
2245 | { | 3087 | { |
2246 | int ret=0; | 3088 | int ret=0; |
@@ -2486,6 +3328,27 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) | |||
2486 | ret = 1; | 3328 | ret = 1; |
2487 | break; | 3329 | break; |
2488 | 3330 | ||
3331 | #ifndef OPENSSL_NO_HEARTBEATS | ||
3332 | case SSL_CTRL_TLS_EXT_SEND_HEARTBEAT: | ||
3333 | if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER) | ||
3334 | ret = dtls1_heartbeat(s); | ||
3335 | else | ||
3336 | ret = tls1_heartbeat(s); | ||
3337 | break; | ||
3338 | |||
3339 | case SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING: | ||
3340 | ret = s->tlsext_hb_pending; | ||
3341 | break; | ||
3342 | |||
3343 | case SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS: | ||
3344 | if (larg) | ||
3345 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_RECV_REQUESTS; | ||
3346 | else | ||
3347 | s->tlsext_heartbeat &= ~SSL_TLSEXT_HB_DONT_RECV_REQUESTS; | ||
3348 | ret = 1; | ||
3349 | break; | ||
3350 | #endif | ||
3351 | |||
2489 | #endif /* !OPENSSL_NO_TLSEXT */ | 3352 | #endif /* !OPENSSL_NO_TLSEXT */ |
2490 | default: | 3353 | default: |
2491 | break; | 3354 | break; |
@@ -2718,6 +3581,38 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) | |||
2718 | return 1; | 3581 | return 1; |
2719 | break; | 3582 | break; |
2720 | 3583 | ||
3584 | #ifndef OPENSSL_NO_SRP | ||
3585 | case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME: | ||
3586 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; | ||
3587 | if (ctx->srp_ctx.login != NULL) | ||
3588 | OPENSSL_free(ctx->srp_ctx.login); | ||
3589 | ctx->srp_ctx.login = NULL; | ||
3590 | if (parg == NULL) | ||
3591 | break; | ||
3592 | if (strlen((const char *)parg) > 255 || strlen((const char *)parg) < 1) | ||
3593 | { | ||
3594 | SSLerr(SSL_F_SSL3_CTX_CTRL, SSL_R_INVALID_SRP_USERNAME); | ||
3595 | return 0; | ||
3596 | } | ||
3597 | if ((ctx->srp_ctx.login = BUF_strdup((char *)parg)) == NULL) | ||
3598 | { | ||
3599 | SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_INTERNAL_ERROR); | ||
3600 | return 0; | ||
3601 | } | ||
3602 | break; | ||
3603 | case SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD: | ||
3604 | ctx->srp_ctx.SRP_give_srp_client_pwd_callback=srp_password_from_info_cb; | ||
3605 | ctx->srp_ctx.info=parg; | ||
3606 | break; | ||
3607 | case SSL_CTRL_SET_SRP_ARG: | ||
3608 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; | ||
3609 | ctx->srp_ctx.SRP_cb_arg=parg; | ||
3610 | break; | ||
3611 | |||
3612 | case SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH: | ||
3613 | ctx->srp_ctx.strength=larg; | ||
3614 | break; | ||
3615 | #endif | ||
2721 | #endif /* !OPENSSL_NO_TLSEXT */ | 3616 | #endif /* !OPENSSL_NO_TLSEXT */ |
2722 | 3617 | ||
2723 | /* A Thawte special :-) */ | 3618 | /* A Thawte special :-) */ |
@@ -2730,6 +3625,18 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) | |||
2730 | sk_X509_push(ctx->extra_certs,(X509 *)parg); | 3625 | sk_X509_push(ctx->extra_certs,(X509 *)parg); |
2731 | break; | 3626 | break; |
2732 | 3627 | ||
3628 | case SSL_CTRL_GET_EXTRA_CHAIN_CERTS: | ||
3629 | *(STACK_OF(X509) **)parg = ctx->extra_certs; | ||
3630 | break; | ||
3631 | |||
3632 | case SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS: | ||
3633 | if (ctx->extra_certs) | ||
3634 | { | ||
3635 | sk_X509_pop_free(ctx->extra_certs, X509_free); | ||
3636 | ctx->extra_certs = NULL; | ||
3637 | } | ||
3638 | break; | ||
3639 | |||
2733 | default: | 3640 | default: |
2734 | return(0); | 3641 | return(0); |
2735 | } | 3642 | } |
@@ -2787,6 +3694,20 @@ long ssl3_ctx_callback_ctrl(SSL_CTX *ctx, int cmd, void (*fp)(void)) | |||
2787 | HMAC_CTX *, int))fp; | 3694 | HMAC_CTX *, int))fp; |
2788 | break; | 3695 | break; |
2789 | 3696 | ||
3697 | #ifndef OPENSSL_NO_SRP | ||
3698 | case SSL_CTRL_SET_SRP_VERIFY_PARAM_CB: | ||
3699 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; | ||
3700 | ctx->srp_ctx.SRP_verify_param_callback=(int (*)(SSL *,void *))fp; | ||
3701 | break; | ||
3702 | case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB: | ||
3703 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; | ||
3704 | ctx->srp_ctx.TLS_ext_srp_username_callback=(int (*)(SSL *,int *,void *))fp; | ||
3705 | break; | ||
3706 | case SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB: | ||
3707 | ctx->srp_ctx.srp_Mask|=SSL_kSRP; | ||
3708 | ctx->srp_ctx.SRP_give_srp_client_pwd_callback=(char *(*)(SSL *,void *))fp; | ||
3709 | break; | ||
3710 | #endif | ||
2790 | #endif | 3711 | #endif |
2791 | default: | 3712 | default: |
2792 | return(0); | 3713 | return(0); |
@@ -2805,6 +3726,9 @@ const SSL_CIPHER *ssl3_get_cipher_by_char(const unsigned char *p) | |||
2805 | id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1]; | 3726 | id=0x03000000L|((unsigned long)p[0]<<8L)|(unsigned long)p[1]; |
2806 | c.id=id; | 3727 | c.id=id; |
2807 | cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS); | 3728 | cp = OBJ_bsearch_ssl_cipher_id(&c, ssl3_ciphers, SSL3_NUM_CIPHERS); |
3729 | #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES | ||
3730 | if (cp == NULL) fprintf(stderr, "Unknown cipher ID %x\n", (p[0] << 8) | p[1]); | ||
3731 | #endif | ||
2808 | if (cp == NULL || cp->valid == 0) | 3732 | if (cp == NULL || cp->valid == 0) |
2809 | return NULL; | 3733 | return NULL; |
2810 | else | 3734 | else |
@@ -2882,11 +3806,20 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, | |||
2882 | { | 3806 | { |
2883 | c=sk_SSL_CIPHER_value(prio,i); | 3807 | c=sk_SSL_CIPHER_value(prio,i); |
2884 | 3808 | ||
3809 | /* Skip TLS v1.2 only ciphersuites if lower than v1.2 */ | ||
3810 | if ((c->algorithm_ssl & SSL_TLSV1_2) && | ||
3811 | (TLS1_get_version(s) < TLS1_2_VERSION)) | ||
3812 | continue; | ||
3813 | |||
2885 | ssl_set_cert_masks(cert,c); | 3814 | ssl_set_cert_masks(cert,c); |
2886 | mask_k = cert->mask_k; | 3815 | mask_k = cert->mask_k; |
2887 | mask_a = cert->mask_a; | 3816 | mask_a = cert->mask_a; |
2888 | emask_k = cert->export_mask_k; | 3817 | emask_k = cert->export_mask_k; |
2889 | emask_a = cert->export_mask_a; | 3818 | emask_a = cert->export_mask_a; |
3819 | #ifndef OPENSSL_NO_SRP | ||
3820 | mask_k=cert->mask_k | s->srp_ctx.srp_Mask; | ||
3821 | emask_k=cert->export_mask_k | s->srp_ctx.srp_Mask; | ||
3822 | #endif | ||
2890 | 3823 | ||
2891 | #ifdef KSSL_DEBUG | 3824 | #ifdef KSSL_DEBUG |
2892 | /* printf("ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/ | 3825 | /* printf("ssl3_choose_cipher %d alg= %lx\n", i,c->algorithms);*/ |
@@ -3335,4 +4268,15 @@ need to go to SSL_ST_ACCEPT. | |||
3335 | } | 4268 | } |
3336 | return(ret); | 4269 | return(ret); |
3337 | } | 4270 | } |
3338 | 4271 | /* If we are using TLS v1.2 or later and default SHA1+MD5 algorithms switch | |
4272 | * to new SHA256 PRF and handshake macs | ||
4273 | */ | ||
4274 | long ssl_get_algorithm2(SSL *s) | ||
4275 | { | ||
4276 | long alg2 = s->s3->tmp.new_cipher->algorithm2; | ||
4277 | if (TLS1_get_version(s) >= TLS1_2_VERSION && | ||
4278 | alg2 == (SSL_HANDSHAKE_MAC_DEFAULT|TLS1_PRF)) | ||
4279 | return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256; | ||
4280 | return alg2; | ||
4281 | } | ||
4282 | |||
diff --git a/src/lib/libssl/src/ssl/s3_pkt.c b/src/lib/libssl/src/ssl/s3_pkt.c index f9b3629cf7..adf8c387cc 100644 --- a/src/lib/libssl/src/ssl/s3_pkt.c +++ b/src/lib/libssl/src/ssl/s3_pkt.c | |||
@@ -115,6 +115,7 @@ | |||
115 | #include "ssl_locl.h" | 115 | #include "ssl_locl.h" |
116 | #include <openssl/evp.h> | 116 | #include <openssl/evp.h> |
117 | #include <openssl/buffer.h> | 117 | #include <openssl/buffer.h> |
118 | #include <openssl/rand.h> | ||
118 | 119 | ||
119 | static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, | 120 | static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, |
120 | unsigned int len, int create_empty_fragment); | 121 | unsigned int len, int create_empty_fragment); |
@@ -630,6 +631,7 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, | |||
630 | unsigned char *p,*plen; | 631 | unsigned char *p,*plen; |
631 | int i,mac_size,clear=0; | 632 | int i,mac_size,clear=0; |
632 | int prefix_len=0; | 633 | int prefix_len=0; |
634 | int eivlen; | ||
633 | long align=0; | 635 | long align=0; |
634 | SSL3_RECORD *wr; | 636 | SSL3_RECORD *wr; |
635 | SSL3_BUFFER *wb=&(s->s3->wbuf); | 637 | SSL3_BUFFER *wb=&(s->s3->wbuf); |
@@ -662,10 +664,14 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, | |||
662 | if ( (sess == NULL) || | 664 | if ( (sess == NULL) || |
663 | (s->enc_write_ctx == NULL) || | 665 | (s->enc_write_ctx == NULL) || |
664 | (EVP_MD_CTX_md(s->write_hash) == NULL)) | 666 | (EVP_MD_CTX_md(s->write_hash) == NULL)) |
667 | { | ||
668 | #if 1 | ||
669 | clear=s->enc_write_ctx?0:1; /* must be AEAD cipher */ | ||
670 | #else | ||
665 | clear=1; | 671 | clear=1; |
666 | 672 | #endif | |
667 | if (clear) | ||
668 | mac_size=0; | 673 | mac_size=0; |
674 | } | ||
669 | else | 675 | else |
670 | { | 676 | { |
671 | mac_size=EVP_MD_CTX_size(s->write_hash); | 677 | mac_size=EVP_MD_CTX_size(s->write_hash); |
@@ -734,14 +740,39 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, | |||
734 | wr->type=type; | 740 | wr->type=type; |
735 | 741 | ||
736 | *(p++)=(s->version>>8); | 742 | *(p++)=(s->version>>8); |
737 | *(p++)=s->version&0xff; | 743 | /* Some servers hang if iniatial client hello is larger than 256 |
744 | * bytes and record version number > TLS 1.0 | ||
745 | */ | ||
746 | if (s->state == SSL3_ST_CW_CLNT_HELLO_B | ||
747 | && TLS1_get_version(s) > TLS1_VERSION) | ||
748 | *(p++) = 0x1; | ||
749 | else | ||
750 | *(p++)=s->version&0xff; | ||
738 | 751 | ||
739 | /* field where we are to write out packet length */ | 752 | /* field where we are to write out packet length */ |
740 | plen=p; | 753 | plen=p; |
741 | p+=2; | 754 | p+=2; |
755 | /* Explicit IV length, block ciphers and TLS version 1.1 or later */ | ||
756 | if (s->enc_write_ctx && s->version >= TLS1_1_VERSION) | ||
757 | { | ||
758 | int mode = EVP_CIPHER_CTX_mode(s->enc_write_ctx); | ||
759 | if (mode == EVP_CIPH_CBC_MODE) | ||
760 | { | ||
761 | eivlen = EVP_CIPHER_CTX_iv_length(s->enc_write_ctx); | ||
762 | if (eivlen <= 1) | ||
763 | eivlen = 0; | ||
764 | } | ||
765 | /* Need explicit part of IV for GCM mode */ | ||
766 | else if (mode == EVP_CIPH_GCM_MODE) | ||
767 | eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
768 | else | ||
769 | eivlen = 0; | ||
770 | } | ||
771 | else | ||
772 | eivlen = 0; | ||
742 | 773 | ||
743 | /* lets setup the record stuff. */ | 774 | /* lets setup the record stuff. */ |
744 | wr->data=p; | 775 | wr->data=p + eivlen; |
745 | wr->length=(int)len; | 776 | wr->length=(int)len; |
746 | wr->input=(unsigned char *)buf; | 777 | wr->input=(unsigned char *)buf; |
747 | 778 | ||
@@ -769,11 +800,19 @@ static int do_ssl3_write(SSL *s, int type, const unsigned char *buf, | |||
769 | 800 | ||
770 | if (mac_size != 0) | 801 | if (mac_size != 0) |
771 | { | 802 | { |
772 | if (s->method->ssl3_enc->mac(s,&(p[wr->length]),1) < 0) | 803 | if (s->method->ssl3_enc->mac(s,&(p[wr->length + eivlen]),1) < 0) |
773 | goto err; | 804 | goto err; |
774 | wr->length+=mac_size; | 805 | wr->length+=mac_size; |
775 | wr->input=p; | 806 | } |
776 | wr->data=p; | 807 | |
808 | wr->input=p; | ||
809 | wr->data=p; | ||
810 | |||
811 | if (eivlen) | ||
812 | { | ||
813 | /* if (RAND_pseudo_bytes(p, eivlen) <= 0) | ||
814 | goto err; */ | ||
815 | wr->length += eivlen; | ||
777 | } | 816 | } |
778 | 817 | ||
779 | /* ssl3_enc can only have an error on read */ | 818 | /* ssl3_enc can only have an error on read */ |
@@ -1042,6 +1081,19 @@ start: | |||
1042 | dest = s->s3->alert_fragment; | 1081 | dest = s->s3->alert_fragment; |
1043 | dest_len = &s->s3->alert_fragment_len; | 1082 | dest_len = &s->s3->alert_fragment_len; |
1044 | } | 1083 | } |
1084 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1085 | else if (rr->type == TLS1_RT_HEARTBEAT) | ||
1086 | { | ||
1087 | tls1_process_heartbeat(s); | ||
1088 | |||
1089 | /* Exit and notify application to read again */ | ||
1090 | rr->length = 0; | ||
1091 | s->rwstate=SSL_READING; | ||
1092 | BIO_clear_retry_flags(SSL_get_rbio(s)); | ||
1093 | BIO_set_retry_read(SSL_get_rbio(s)); | ||
1094 | return(-1); | ||
1095 | } | ||
1096 | #endif | ||
1045 | 1097 | ||
1046 | if (dest_maxlen > 0) | 1098 | if (dest_maxlen > 0) |
1047 | { | 1099 | { |
@@ -1185,6 +1237,10 @@ start: | |||
1185 | SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_NO_RENEGOTIATION); | 1237 | SSLerr(SSL_F_SSL3_READ_BYTES,SSL_R_NO_RENEGOTIATION); |
1186 | goto f_err; | 1238 | goto f_err; |
1187 | } | 1239 | } |
1240 | #ifdef SSL_AD_MISSING_SRP_USERNAME | ||
1241 | if (alert_descr == SSL_AD_MISSING_SRP_USERNAME) | ||
1242 | return(0); | ||
1243 | #endif | ||
1188 | } | 1244 | } |
1189 | else if (alert_level == 2) /* fatal */ | 1245 | else if (alert_level == 2) /* fatal */ |
1190 | { | 1246 | { |
@@ -1263,6 +1319,7 @@ start: | |||
1263 | #else | 1319 | #else |
1264 | s->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; | 1320 | s->state = s->server ? SSL_ST_ACCEPT : SSL_ST_CONNECT; |
1265 | #endif | 1321 | #endif |
1322 | s->renegotiate=1; | ||
1266 | s->new_session=1; | 1323 | s->new_session=1; |
1267 | } | 1324 | } |
1268 | i=s->handshake_func(s); | 1325 | i=s->handshake_func(s); |
@@ -1296,8 +1353,10 @@ start: | |||
1296 | { | 1353 | { |
1297 | default: | 1354 | default: |
1298 | #ifndef OPENSSL_NO_TLS | 1355 | #ifndef OPENSSL_NO_TLS |
1299 | /* TLS just ignores unknown message types */ | 1356 | /* TLS up to v1.1 just ignores unknown message types: |
1300 | if (s->version == TLS1_VERSION) | 1357 | * TLS v1.2 give an unexpected message alert. |
1358 | */ | ||
1359 | if (s->version >= TLS1_VERSION && s->version <= TLS1_1_VERSION) | ||
1301 | { | 1360 | { |
1302 | rr->length = 0; | 1361 | rr->length = 0; |
1303 | goto start; | 1362 | goto start; |
diff --git a/src/lib/libssl/src/ssl/s3_srvr.c b/src/lib/libssl/src/ssl/s3_srvr.c index d734c359fb..118939fabb 100644 --- a/src/lib/libssl/src/ssl/s3_srvr.c +++ b/src/lib/libssl/src/ssl/s3_srvr.c | |||
@@ -179,6 +179,31 @@ static const SSL_METHOD *ssl3_get_server_method(int ver) | |||
179 | return(NULL); | 179 | return(NULL); |
180 | } | 180 | } |
181 | 181 | ||
182 | #ifndef OPENSSL_NO_SRP | ||
183 | static int ssl_check_srp_ext_ClientHello(SSL *s, int *al) | ||
184 | { | ||
185 | int ret = SSL_ERROR_NONE; | ||
186 | |||
187 | *al = SSL_AD_UNRECOGNIZED_NAME; | ||
188 | |||
189 | if ((s->s3->tmp.new_cipher->algorithm_mkey & SSL_kSRP) && | ||
190 | (s->srp_ctx.TLS_ext_srp_username_callback != NULL)) | ||
191 | { | ||
192 | if(s->srp_ctx.login == NULL) | ||
193 | { | ||
194 | /* There isn't any srp login extension !!! */ | ||
195 | ret = SSL3_AL_FATAL; | ||
196 | *al = SSL_AD_UNKNOWN_PSK_IDENTITY; | ||
197 | } | ||
198 | else | ||
199 | { | ||
200 | ret = SSL_srp_server_param_with_username(s,al); | ||
201 | } | ||
202 | } | ||
203 | return ret; | ||
204 | } | ||
205 | #endif | ||
206 | |||
182 | IMPLEMENT_ssl3_meth_func(SSLv3_server_method, | 207 | IMPLEMENT_ssl3_meth_func(SSLv3_server_method, |
183 | ssl3_accept, | 208 | ssl3_accept, |
184 | ssl_undefined_function, | 209 | ssl_undefined_function, |
@@ -211,6 +236,18 @@ int ssl3_accept(SSL *s) | |||
211 | return(-1); | 236 | return(-1); |
212 | } | 237 | } |
213 | 238 | ||
239 | #ifndef OPENSSL_NO_HEARTBEATS | ||
240 | /* If we're awaiting a HeartbeatResponse, pretend we | ||
241 | * already got and don't await it anymore, because | ||
242 | * Heartbeats don't make sense during handshakes anyway. | ||
243 | */ | ||
244 | if (s->tlsext_hb_pending) | ||
245 | { | ||
246 | s->tlsext_hb_pending = 0; | ||
247 | s->tlsext_hb_seq++; | ||
248 | } | ||
249 | #endif | ||
250 | |||
214 | for (;;) | 251 | for (;;) |
215 | { | 252 | { |
216 | state=s->state; | 253 | state=s->state; |
@@ -218,7 +255,7 @@ int ssl3_accept(SSL *s) | |||
218 | switch (s->state) | 255 | switch (s->state) |
219 | { | 256 | { |
220 | case SSL_ST_RENEGOTIATE: | 257 | case SSL_ST_RENEGOTIATE: |
221 | s->new_session=1; | 258 | s->renegotiate=1; |
222 | /* s->state=SSL_ST_ACCEPT; */ | 259 | /* s->state=SSL_ST_ACCEPT; */ |
223 | 260 | ||
224 | case SSL_ST_BEFORE: | 261 | case SSL_ST_BEFORE: |
@@ -314,10 +351,34 @@ int ssl3_accept(SSL *s) | |||
314 | case SSL3_ST_SR_CLNT_HELLO_C: | 351 | case SSL3_ST_SR_CLNT_HELLO_C: |
315 | 352 | ||
316 | s->shutdown=0; | 353 | s->shutdown=0; |
317 | ret=ssl3_get_client_hello(s); | 354 | if (s->rwstate != SSL_X509_LOOKUP) |
318 | if (ret <= 0) goto end; | 355 | { |
319 | 356 | ret=ssl3_get_client_hello(s); | |
320 | s->new_session = 2; | 357 | if (ret <= 0) goto end; |
358 | } | ||
359 | #ifndef OPENSSL_NO_SRP | ||
360 | { | ||
361 | int al; | ||
362 | if ((ret = ssl_check_srp_ext_ClientHello(s,&al)) < 0) | ||
363 | { | ||
364 | /* callback indicates firther work to be done */ | ||
365 | s->rwstate=SSL_X509_LOOKUP; | ||
366 | goto end; | ||
367 | } | ||
368 | if (ret != SSL_ERROR_NONE) | ||
369 | { | ||
370 | ssl3_send_alert(s,SSL3_AL_FATAL,al); | ||
371 | /* This is not really an error but the only means to | ||
372 | for a client to detect whether srp is supported. */ | ||
373 | if (al != TLS1_AD_UNKNOWN_PSK_IDENTITY) | ||
374 | SSLerr(SSL_F_SSL3_ACCEPT,SSL_R_CLIENTHELLO_TLSEXT); | ||
375 | ret = SSL_TLSEXT_ERR_ALERT_FATAL; | ||
376 | ret= -1; | ||
377 | goto end; | ||
378 | } | ||
379 | } | ||
380 | #endif | ||
381 | s->renegotiate = 2; | ||
321 | s->state=SSL3_ST_SW_SRVR_HELLO_A; | 382 | s->state=SSL3_ST_SW_SRVR_HELLO_A; |
322 | s->init_num=0; | 383 | s->init_num=0; |
323 | break; | 384 | break; |
@@ -346,7 +407,7 @@ int ssl3_accept(SSL *s) | |||
346 | case SSL3_ST_SW_CERT_A: | 407 | case SSL3_ST_SW_CERT_A: |
347 | case SSL3_ST_SW_CERT_B: | 408 | case SSL3_ST_SW_CERT_B: |
348 | /* Check if it is anon DH or anon ECDH, */ | 409 | /* Check if it is anon DH or anon ECDH, */ |
349 | /* normal PSK or KRB5 */ | 410 | /* normal PSK or KRB5 or SRP */ |
350 | if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL) | 411 | if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL) |
351 | && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK) | 412 | && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK) |
352 | && !(s->s3->tmp.new_cipher->algorithm_auth & SSL_aKRB5)) | 413 | && !(s->s3->tmp.new_cipher->algorithm_auth & SSL_aKRB5)) |
@@ -411,6 +472,10 @@ int ssl3_accept(SSL *s) | |||
411 | #ifndef OPENSSL_NO_PSK | 472 | #ifndef OPENSSL_NO_PSK |
412 | || ((alg_k & SSL_kPSK) && s->ctx->psk_identity_hint) | 473 | || ((alg_k & SSL_kPSK) && s->ctx->psk_identity_hint) |
413 | #endif | 474 | #endif |
475 | #ifndef OPENSSL_NO_SRP | ||
476 | /* SRP: send ServerKeyExchange */ | ||
477 | || (alg_k & SSL_kSRP) | ||
478 | #endif | ||
414 | || (alg_k & (SSL_kDHr|SSL_kDHd|SSL_kEDH)) | 479 | || (alg_k & (SSL_kDHr|SSL_kDHd|SSL_kEDH)) |
415 | || (alg_k & SSL_kEECDH) | 480 | || (alg_k & SSL_kEECDH) |
416 | || ((alg_k & SSL_kRSA) | 481 | || ((alg_k & SSL_kRSA) |
@@ -457,6 +522,9 @@ int ssl3_accept(SSL *s) | |||
457 | skip=1; | 522 | skip=1; |
458 | s->s3->tmp.cert_request=0; | 523 | s->s3->tmp.cert_request=0; |
459 | s->state=SSL3_ST_SW_SRVR_DONE_A; | 524 | s->state=SSL3_ST_SW_SRVR_DONE_A; |
525 | if (s->s3->handshake_buffer) | ||
526 | if (!ssl3_digest_cached_records(s)) | ||
527 | return -1; | ||
460 | } | 528 | } |
461 | else | 529 | else |
462 | { | 530 | { |
@@ -539,9 +607,34 @@ int ssl3_accept(SSL *s) | |||
539 | * the client uses its key from the certificate | 607 | * the client uses its key from the certificate |
540 | * for key exchange. | 608 | * for key exchange. |
541 | */ | 609 | */ |
610 | #if defined(OPENSSL_NO_TLSEXT) || defined(OPENSSL_NO_NEXTPROTONEG) | ||
542 | s->state=SSL3_ST_SR_FINISHED_A; | 611 | s->state=SSL3_ST_SR_FINISHED_A; |
612 | #else | ||
613 | if (s->s3->next_proto_neg_seen) | ||
614 | s->state=SSL3_ST_SR_NEXT_PROTO_A; | ||
615 | else | ||
616 | s->state=SSL3_ST_SR_FINISHED_A; | ||
617 | #endif | ||
543 | s->init_num = 0; | 618 | s->init_num = 0; |
544 | } | 619 | } |
620 | else if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
621 | { | ||
622 | s->state=SSL3_ST_SR_CERT_VRFY_A; | ||
623 | s->init_num=0; | ||
624 | if (!s->session->peer) | ||
625 | break; | ||
626 | /* For TLS v1.2 freeze the handshake buffer | ||
627 | * at this point and digest cached records. | ||
628 | */ | ||
629 | if (!s->s3->handshake_buffer) | ||
630 | { | ||
631 | SSLerr(SSL_F_SSL3_ACCEPT,ERR_R_INTERNAL_ERROR); | ||
632 | return -1; | ||
633 | } | ||
634 | s->s3->flags |= TLS1_FLAGS_KEEP_HANDSHAKE; | ||
635 | if (!ssl3_digest_cached_records(s)) | ||
636 | return -1; | ||
637 | } | ||
545 | else | 638 | else |
546 | { | 639 | { |
547 | int offset=0; | 640 | int offset=0; |
@@ -582,23 +675,37 @@ int ssl3_accept(SSL *s) | |||
582 | ret=ssl3_get_cert_verify(s); | 675 | ret=ssl3_get_cert_verify(s); |
583 | if (ret <= 0) goto end; | 676 | if (ret <= 0) goto end; |
584 | 677 | ||
678 | #if defined(OPENSSL_NO_TLSEXT) || defined(OPENSSL_NO_NEXTPROTONEG) | ||
585 | s->state=SSL3_ST_SR_FINISHED_A; | 679 | s->state=SSL3_ST_SR_FINISHED_A; |
680 | #else | ||
681 | if (s->s3->next_proto_neg_seen) | ||
682 | s->state=SSL3_ST_SR_NEXT_PROTO_A; | ||
683 | else | ||
684 | s->state=SSL3_ST_SR_FINISHED_A; | ||
685 | #endif | ||
586 | s->init_num=0; | 686 | s->init_num=0; |
587 | break; | 687 | break; |
588 | 688 | ||
689 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
690 | case SSL3_ST_SR_NEXT_PROTO_A: | ||
691 | case SSL3_ST_SR_NEXT_PROTO_B: | ||
692 | ret=ssl3_get_next_proto(s); | ||
693 | if (ret <= 0) goto end; | ||
694 | s->init_num = 0; | ||
695 | s->state=SSL3_ST_SR_FINISHED_A; | ||
696 | break; | ||
697 | #endif | ||
698 | |||
589 | case SSL3_ST_SR_FINISHED_A: | 699 | case SSL3_ST_SR_FINISHED_A: |
590 | case SSL3_ST_SR_FINISHED_B: | 700 | case SSL3_ST_SR_FINISHED_B: |
591 | ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, | 701 | ret=ssl3_get_finished(s,SSL3_ST_SR_FINISHED_A, |
592 | SSL3_ST_SR_FINISHED_B); | 702 | SSL3_ST_SR_FINISHED_B); |
593 | if (ret <= 0) goto end; | 703 | if (ret <= 0) goto end; |
594 | #ifndef OPENSSL_NO_TLSEXT | ||
595 | if (s->tlsext_ticket_expected) | ||
596 | s->state=SSL3_ST_SW_SESSION_TICKET_A; | ||
597 | else if (s->hit) | ||
598 | s->state=SSL_ST_OK; | ||
599 | #else | ||
600 | if (s->hit) | 704 | if (s->hit) |
601 | s->state=SSL_ST_OK; | 705 | s->state=SSL_ST_OK; |
706 | #ifndef OPENSSL_NO_TLSEXT | ||
707 | else if (s->tlsext_ticket_expected) | ||
708 | s->state=SSL3_ST_SW_SESSION_TICKET_A; | ||
602 | #endif | 709 | #endif |
603 | else | 710 | else |
604 | s->state=SSL3_ST_SW_CHANGE_A; | 711 | s->state=SSL3_ST_SW_CHANGE_A; |
@@ -656,7 +763,16 @@ int ssl3_accept(SSL *s) | |||
656 | if (ret <= 0) goto end; | 763 | if (ret <= 0) goto end; |
657 | s->state=SSL3_ST_SW_FLUSH; | 764 | s->state=SSL3_ST_SW_FLUSH; |
658 | if (s->hit) | 765 | if (s->hit) |
766 | { | ||
767 | #if defined(OPENSSL_NO_TLSEXT) || defined(OPENSSL_NO_NEXTPROTONEG) | ||
659 | s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; | 768 | s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; |
769 | #else | ||
770 | if (s->s3->next_proto_neg_seen) | ||
771 | s->s3->tmp.next_state=SSL3_ST_SR_NEXT_PROTO_A; | ||
772 | else | ||
773 | s->s3->tmp.next_state=SSL3_ST_SR_FINISHED_A; | ||
774 | #endif | ||
775 | } | ||
660 | else | 776 | else |
661 | s->s3->tmp.next_state=SSL_ST_OK; | 777 | s->s3->tmp.next_state=SSL_ST_OK; |
662 | s->init_num=0; | 778 | s->init_num=0; |
@@ -674,11 +790,9 @@ int ssl3_accept(SSL *s) | |||
674 | 790 | ||
675 | s->init_num=0; | 791 | s->init_num=0; |
676 | 792 | ||
677 | if (s->new_session == 2) /* skipped if we just sent a HelloRequest */ | 793 | if (s->renegotiate == 2) /* skipped if we just sent a HelloRequest */ |
678 | { | 794 | { |
679 | /* actually not necessarily a 'new' session unless | 795 | s->renegotiate=0; |
680 | * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ | ||
681 | |||
682 | s->new_session=0; | 796 | s->new_session=0; |
683 | 797 | ||
684 | ssl_update_cache(s,SSL_SESS_CACHE_SERVER); | 798 | ssl_update_cache(s,SSL_SESS_CACHE_SERVER); |
@@ -756,14 +870,6 @@ int ssl3_check_client_hello(SSL *s) | |||
756 | int ok; | 870 | int ok; |
757 | long n; | 871 | long n; |
758 | 872 | ||
759 | /* We only allow the client to restart the handshake once per | ||
760 | * negotiation. */ | ||
761 | if (s->s3->flags & SSL3_FLAGS_SGC_RESTART_DONE) | ||
762 | { | ||
763 | SSLerr(SSL_F_SSL3_CHECK_CLIENT_HELLO, SSL_R_MULTIPLE_SGC_RESTARTS); | ||
764 | return -1; | ||
765 | } | ||
766 | |||
767 | /* this function is called when we really expect a Certificate message, | 873 | /* this function is called when we really expect a Certificate message, |
768 | * so permit appropriate message length */ | 874 | * so permit appropriate message length */ |
769 | n=s->method->ssl_get_message(s, | 875 | n=s->method->ssl_get_message(s, |
@@ -776,6 +882,13 @@ int ssl3_check_client_hello(SSL *s) | |||
776 | s->s3->tmp.reuse_message = 1; | 882 | s->s3->tmp.reuse_message = 1; |
777 | if (s->s3->tmp.message_type == SSL3_MT_CLIENT_HELLO) | 883 | if (s->s3->tmp.message_type == SSL3_MT_CLIENT_HELLO) |
778 | { | 884 | { |
885 | /* We only allow the client to restart the handshake once per | ||
886 | * negotiation. */ | ||
887 | if (s->s3->flags & SSL3_FLAGS_SGC_RESTART_DONE) | ||
888 | { | ||
889 | SSLerr(SSL_F_SSL3_CHECK_CLIENT_HELLO, SSL_R_MULTIPLE_SGC_RESTARTS); | ||
890 | return -1; | ||
891 | } | ||
779 | /* Throw away what we have done so far in the current handshake, | 892 | /* Throw away what we have done so far in the current handshake, |
780 | * which will now be aborted. (A full SSL_clear would be too much.) */ | 893 | * which will now be aborted. (A full SSL_clear would be too much.) */ |
781 | #ifndef OPENSSL_NO_DH | 894 | #ifndef OPENSSL_NO_DH |
@@ -817,7 +930,8 @@ int ssl3_get_client_hello(SSL *s) | |||
817 | * If we are SSLv3, we will respond with SSLv3, even if prompted with | 930 | * If we are SSLv3, we will respond with SSLv3, even if prompted with |
818 | * TLSv1. | 931 | * TLSv1. |
819 | */ | 932 | */ |
820 | if (s->state == SSL3_ST_SR_CLNT_HELLO_A) | 933 | if (s->state == SSL3_ST_SR_CLNT_HELLO_A |
934 | ) | ||
821 | { | 935 | { |
822 | s->state=SSL3_ST_SR_CLNT_HELLO_B; | 936 | s->state=SSL3_ST_SR_CLNT_HELLO_B; |
823 | } | 937 | } |
@@ -874,13 +988,16 @@ int ssl3_get_client_hello(SSL *s) | |||
874 | j= *(p++); | 988 | j= *(p++); |
875 | 989 | ||
876 | s->hit=0; | 990 | s->hit=0; |
877 | /* Versions before 0.9.7 always allow session reuse during renegotiation | 991 | /* Versions before 0.9.7 always allow clients to resume sessions in renegotiation. |
878 | * (i.e. when s->new_session is true), option | 992 | * 0.9.7 and later allow this by default, but optionally ignore resumption requests |
879 | * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is new with 0.9.7. | 993 | * with flag SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION (it's a new flag rather |
880 | * Maybe this optional behaviour should always have been the default, | 994 | * than a change to default behavior so that applications relying on this for security |
881 | * but we cannot safely change the default behaviour (or new applications | 995 | * won't even compile against older library versions). |
882 | * might be written that become totally unsecure when compiled with | 996 | * |
883 | * an earlier library version) | 997 | * 1.0.1 and later also have a function SSL_renegotiate_abbreviated() to request |
998 | * renegotiation but not a new session (s->new_session remains unset): for servers, | ||
999 | * this essentially just means that the SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
1000 | * setting will be ignored. | ||
884 | */ | 1001 | */ |
885 | if ((s->new_session && (s->options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION))) | 1002 | if ((s->new_session && (s->options & SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION))) |
886 | { | 1003 | { |
@@ -1269,8 +1386,11 @@ int ssl3_get_client_hello(SSL *s) | |||
1269 | s->s3->tmp.new_cipher=s->session->cipher; | 1386 | s->s3->tmp.new_cipher=s->session->cipher; |
1270 | } | 1387 | } |
1271 | 1388 | ||
1272 | if (!ssl3_digest_cached_records(s)) | 1389 | if (TLS1_get_version(s) < TLS1_2_VERSION || !(s->verify_mode & SSL_VERIFY_PEER)) |
1273 | goto f_err; | 1390 | { |
1391 | if (!ssl3_digest_cached_records(s)) | ||
1392 | goto f_err; | ||
1393 | } | ||
1274 | 1394 | ||
1275 | /* we now have the following setup. | 1395 | /* we now have the following setup. |
1276 | * client_random | 1396 | * client_random |
@@ -1325,20 +1445,20 @@ int ssl3_send_server_hello(SSL *s) | |||
1325 | memcpy(p,s->s3->server_random,SSL3_RANDOM_SIZE); | 1445 | memcpy(p,s->s3->server_random,SSL3_RANDOM_SIZE); |
1326 | p+=SSL3_RANDOM_SIZE; | 1446 | p+=SSL3_RANDOM_SIZE; |
1327 | 1447 | ||
1328 | /* now in theory we have 3 options to sending back the | 1448 | /* There are several cases for the session ID to send |
1329 | * session id. If it is a re-use, we send back the | 1449 | * back in the server hello: |
1330 | * old session-id, if it is a new session, we send | 1450 | * - For session reuse from the session cache, |
1331 | * back the new session-id or we send back a 0 length | 1451 | * we send back the old session ID. |
1332 | * session-id if we want it to be single use. | 1452 | * - If stateless session reuse (using a session ticket) |
1333 | * Currently I will not implement the '0' length session-id | 1453 | * is successful, we send back the client's "session ID" |
1334 | * 12-Jan-98 - I'll now support the '0' length stuff. | 1454 | * (which doesn't actually identify the session). |
1335 | * | 1455 | * - If it is a new session, we send back the new |
1336 | * We also have an additional case where stateless session | 1456 | * session ID. |
1337 | * resumption is successful: we always send back the old | 1457 | * - However, if we want the new session to be single-use, |
1338 | * session id. In this case s->hit is non zero: this can | 1458 | * we send back a 0-length session ID. |
1339 | * only happen if stateless session resumption is succesful | 1459 | * s->hit is non-zero in either case of session reuse, |
1340 | * if session caching is disabled so existing functionality | 1460 | * so the following won't overwrite an ID that we're supposed |
1341 | * is unaffected. | 1461 | * to send back. |
1342 | */ | 1462 | */ |
1343 | if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER) | 1463 | if (!(s->ctx->session_cache_mode & SSL_SESS_CACHE_SERVER) |
1344 | && !s->hit) | 1464 | && !s->hit) |
@@ -1439,6 +1559,7 @@ int ssl3_send_server_key_exchange(SSL *s) | |||
1439 | BN_CTX *bn_ctx = NULL; | 1559 | BN_CTX *bn_ctx = NULL; |
1440 | #endif | 1560 | #endif |
1441 | EVP_PKEY *pkey; | 1561 | EVP_PKEY *pkey; |
1562 | const EVP_MD *md = NULL; | ||
1442 | unsigned char *p,*d; | 1563 | unsigned char *p,*d; |
1443 | int al,i; | 1564 | int al,i; |
1444 | unsigned long type; | 1565 | unsigned long type; |
@@ -1679,21 +1800,44 @@ int ssl3_send_server_key_exchange(SSL *s) | |||
1679 | } | 1800 | } |
1680 | else | 1801 | else |
1681 | #endif /* !OPENSSL_NO_PSK */ | 1802 | #endif /* !OPENSSL_NO_PSK */ |
1803 | #ifndef OPENSSL_NO_SRP | ||
1804 | if (type & SSL_kSRP) | ||
1805 | { | ||
1806 | if ((s->srp_ctx.N == NULL) || | ||
1807 | (s->srp_ctx.g == NULL) || | ||
1808 | (s->srp_ctx.s == NULL) || | ||
1809 | (s->srp_ctx.B == NULL)) | ||
1810 | { | ||
1811 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,SSL_R_MISSING_SRP_PARAM); | ||
1812 | goto err; | ||
1813 | } | ||
1814 | r[0]=s->srp_ctx.N; | ||
1815 | r[1]=s->srp_ctx.g; | ||
1816 | r[2]=s->srp_ctx.s; | ||
1817 | r[3]=s->srp_ctx.B; | ||
1818 | } | ||
1819 | else | ||
1820 | #endif | ||
1682 | { | 1821 | { |
1683 | al=SSL_AD_HANDSHAKE_FAILURE; | 1822 | al=SSL_AD_HANDSHAKE_FAILURE; |
1684 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE); | 1823 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE); |
1685 | goto f_err; | 1824 | goto f_err; |
1686 | } | 1825 | } |
1687 | for (i=0; r[i] != NULL; i++) | 1826 | for (i=0; r[i] != NULL && i<4; i++) |
1688 | { | 1827 | { |
1689 | nr[i]=BN_num_bytes(r[i]); | 1828 | nr[i]=BN_num_bytes(r[i]); |
1829 | #ifndef OPENSSL_NO_SRP | ||
1830 | if ((i == 2) && (type & SSL_kSRP)) | ||
1831 | n+=1+nr[i]; | ||
1832 | else | ||
1833 | #endif | ||
1690 | n+=2+nr[i]; | 1834 | n+=2+nr[i]; |
1691 | } | 1835 | } |
1692 | 1836 | ||
1693 | if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL) | 1837 | if (!(s->s3->tmp.new_cipher->algorithm_auth & SSL_aNULL) |
1694 | && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) | 1838 | && !(s->s3->tmp.new_cipher->algorithm_mkey & SSL_kPSK)) |
1695 | { | 1839 | { |
1696 | if ((pkey=ssl_get_sign_pkey(s,s->s3->tmp.new_cipher)) | 1840 | if ((pkey=ssl_get_sign_pkey(s,s->s3->tmp.new_cipher,&md)) |
1697 | == NULL) | 1841 | == NULL) |
1698 | { | 1842 | { |
1699 | al=SSL_AD_DECODE_ERROR; | 1843 | al=SSL_AD_DECODE_ERROR; |
@@ -1715,8 +1859,16 @@ int ssl3_send_server_key_exchange(SSL *s) | |||
1715 | d=(unsigned char *)s->init_buf->data; | 1859 | d=(unsigned char *)s->init_buf->data; |
1716 | p= &(d[4]); | 1860 | p= &(d[4]); |
1717 | 1861 | ||
1718 | for (i=0; r[i] != NULL; i++) | 1862 | for (i=0; r[i] != NULL && i<4; i++) |
1719 | { | 1863 | { |
1864 | #ifndef OPENSSL_NO_SRP | ||
1865 | if ((i == 2) && (type & SSL_kSRP)) | ||
1866 | { | ||
1867 | *p = nr[i]; | ||
1868 | p++; | ||
1869 | } | ||
1870 | else | ||
1871 | #endif | ||
1720 | s2n(nr[i],p); | 1872 | s2n(nr[i],p); |
1721 | BN_bn2bin(r[i],p); | 1873 | BN_bn2bin(r[i],p); |
1722 | p+=nr[i]; | 1874 | p+=nr[i]; |
@@ -1764,12 +1916,15 @@ int ssl3_send_server_key_exchange(SSL *s) | |||
1764 | /* n is the length of the params, they start at &(d[4]) | 1916 | /* n is the length of the params, they start at &(d[4]) |
1765 | * and p points to the space at the end. */ | 1917 | * and p points to the space at the end. */ |
1766 | #ifndef OPENSSL_NO_RSA | 1918 | #ifndef OPENSSL_NO_RSA |
1767 | if (pkey->type == EVP_PKEY_RSA) | 1919 | if (pkey->type == EVP_PKEY_RSA |
1920 | && TLS1_get_version(s) < TLS1_2_VERSION) | ||
1768 | { | 1921 | { |
1769 | q=md_buf; | 1922 | q=md_buf; |
1770 | j=0; | 1923 | j=0; |
1771 | for (num=2; num > 0; num--) | 1924 | for (num=2; num > 0; num--) |
1772 | { | 1925 | { |
1926 | EVP_MD_CTX_set_flags(&md_ctx, | ||
1927 | EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
1773 | EVP_DigestInit_ex(&md_ctx,(num == 2) | 1928 | EVP_DigestInit_ex(&md_ctx,(num == 2) |
1774 | ?s->ctx->md5:s->ctx->sha1, NULL); | 1929 | ?s->ctx->md5:s->ctx->sha1, NULL); |
1775 | EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); | 1930 | EVP_DigestUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); |
@@ -1791,44 +1946,41 @@ int ssl3_send_server_key_exchange(SSL *s) | |||
1791 | } | 1946 | } |
1792 | else | 1947 | else |
1793 | #endif | 1948 | #endif |
1794 | #if !defined(OPENSSL_NO_DSA) | 1949 | if (md) |
1795 | if (pkey->type == EVP_PKEY_DSA) | ||
1796 | { | 1950 | { |
1797 | /* lets do DSS */ | 1951 | /* For TLS1.2 and later send signature |
1798 | EVP_SignInit_ex(&md_ctx,EVP_dss1(), NULL); | 1952 | * algorithm */ |
1799 | EVP_SignUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); | 1953 | if (TLS1_get_version(s) >= TLS1_2_VERSION) |
1800 | EVP_SignUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE); | ||
1801 | EVP_SignUpdate(&md_ctx,&(d[4]),n); | ||
1802 | if (!EVP_SignFinal(&md_ctx,&(p[2]), | ||
1803 | (unsigned int *)&i,pkey)) | ||
1804 | { | 1954 | { |
1805 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_DSA); | 1955 | if (!tls12_get_sigandhash(p, pkey, md)) |
1806 | goto err; | 1956 | { |
1957 | /* Should never happen */ | ||
1958 | al=SSL_AD_INTERNAL_ERROR; | ||
1959 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); | ||
1960 | goto f_err; | ||
1961 | } | ||
1962 | p+=2; | ||
1807 | } | 1963 | } |
1808 | s2n(i,p); | 1964 | #ifdef SSL_DEBUG |
1809 | n+=i+2; | 1965 | fprintf(stderr, "Using hash %s\n", |
1810 | } | 1966 | EVP_MD_name(md)); |
1811 | else | ||
1812 | #endif | 1967 | #endif |
1813 | #if !defined(OPENSSL_NO_ECDSA) | 1968 | EVP_SignInit_ex(&md_ctx, md, NULL); |
1814 | if (pkey->type == EVP_PKEY_EC) | ||
1815 | { | ||
1816 | /* let's do ECDSA */ | ||
1817 | EVP_SignInit_ex(&md_ctx,EVP_ecdsa(), NULL); | ||
1818 | EVP_SignUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); | 1969 | EVP_SignUpdate(&md_ctx,&(s->s3->client_random[0]),SSL3_RANDOM_SIZE); |
1819 | EVP_SignUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE); | 1970 | EVP_SignUpdate(&md_ctx,&(s->s3->server_random[0]),SSL3_RANDOM_SIZE); |
1820 | EVP_SignUpdate(&md_ctx,&(d[4]),n); | 1971 | EVP_SignUpdate(&md_ctx,&(d[4]),n); |
1821 | if (!EVP_SignFinal(&md_ctx,&(p[2]), | 1972 | if (!EVP_SignFinal(&md_ctx,&(p[2]), |
1822 | (unsigned int *)&i,pkey)) | 1973 | (unsigned int *)&i,pkey)) |
1823 | { | 1974 | { |
1824 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_ECDSA); | 1975 | SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE,ERR_LIB_EVP); |
1825 | goto err; | 1976 | goto err; |
1826 | } | 1977 | } |
1827 | s2n(i,p); | 1978 | s2n(i,p); |
1828 | n+=i+2; | 1979 | n+=i+2; |
1980 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
1981 | n+= 2; | ||
1829 | } | 1982 | } |
1830 | else | 1983 | else |
1831 | #endif | ||
1832 | { | 1984 | { |
1833 | /* Is this error check actually needed? */ | 1985 | /* Is this error check actually needed? */ |
1834 | al=SSL_AD_HANDSHAKE_FAILURE; | 1986 | al=SSL_AD_HANDSHAKE_FAILURE; |
@@ -1881,6 +2033,14 @@ int ssl3_send_certificate_request(SSL *s) | |||
1881 | p+=n; | 2033 | p+=n; |
1882 | n++; | 2034 | n++; |
1883 | 2035 | ||
2036 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
2037 | { | ||
2038 | nl = tls12_get_req_sig_algs(s, p + 2); | ||
2039 | s2n(nl, p); | ||
2040 | p += nl + 2; | ||
2041 | n += nl + 2; | ||
2042 | } | ||
2043 | |||
1884 | off=n; | 2044 | off=n; |
1885 | p+=2; | 2045 | p+=2; |
1886 | n+=2; | 2046 | n+=2; |
@@ -2600,6 +2760,44 @@ int ssl3_get_client_key_exchange(SSL *s) | |||
2600 | } | 2760 | } |
2601 | else | 2761 | else |
2602 | #endif | 2762 | #endif |
2763 | #ifndef OPENSSL_NO_SRP | ||
2764 | if (alg_k & SSL_kSRP) | ||
2765 | { | ||
2766 | int param_len; | ||
2767 | |||
2768 | n2s(p,i); | ||
2769 | param_len=i+2; | ||
2770 | if (param_len > n) | ||
2771 | { | ||
2772 | al=SSL_AD_DECODE_ERROR; | ||
2773 | SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_SRP_A_LENGTH); | ||
2774 | goto f_err; | ||
2775 | } | ||
2776 | if (!(s->srp_ctx.A=BN_bin2bn(p,i,NULL))) | ||
2777 | { | ||
2778 | SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_BN_LIB); | ||
2779 | goto err; | ||
2780 | } | ||
2781 | if (s->session->srp_username != NULL) | ||
2782 | OPENSSL_free(s->session->srp_username); | ||
2783 | s->session->srp_username = BUF_strdup(s->srp_ctx.login); | ||
2784 | if (s->session->srp_username == NULL) | ||
2785 | { | ||
2786 | SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, | ||
2787 | ERR_R_MALLOC_FAILURE); | ||
2788 | goto err; | ||
2789 | } | ||
2790 | |||
2791 | if ((s->session->master_key_length = SRP_generate_server_master_secret(s,s->session->master_key))<0) | ||
2792 | { | ||
2793 | SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_INTERNAL_ERROR); | ||
2794 | goto err; | ||
2795 | } | ||
2796 | |||
2797 | p+=i; | ||
2798 | } | ||
2799 | else | ||
2800 | #endif /* OPENSSL_NO_SRP */ | ||
2603 | if (alg_k & SSL_kGOST) | 2801 | if (alg_k & SSL_kGOST) |
2604 | { | 2802 | { |
2605 | int ret = 0; | 2803 | int ret = 0; |
@@ -2683,7 +2881,7 @@ int ssl3_get_client_key_exchange(SSL *s) | |||
2683 | return(1); | 2881 | return(1); |
2684 | f_err: | 2882 | f_err: |
2685 | ssl3_send_alert(s,SSL3_AL_FATAL,al); | 2883 | ssl3_send_alert(s,SSL3_AL_FATAL,al); |
2686 | #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_ECDH) | 2884 | #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_ECDH) || defined(OPENSSL_NO_SRP) |
2687 | err: | 2885 | err: |
2688 | #endif | 2886 | #endif |
2689 | #ifndef OPENSSL_NO_ECDH | 2887 | #ifndef OPENSSL_NO_ECDH |
@@ -2704,12 +2902,15 @@ int ssl3_get_cert_verify(SSL *s) | |||
2704 | long n; | 2902 | long n; |
2705 | int type=0,i,j; | 2903 | int type=0,i,j; |
2706 | X509 *peer; | 2904 | X509 *peer; |
2905 | const EVP_MD *md = NULL; | ||
2906 | EVP_MD_CTX mctx; | ||
2907 | EVP_MD_CTX_init(&mctx); | ||
2707 | 2908 | ||
2708 | n=s->method->ssl_get_message(s, | 2909 | n=s->method->ssl_get_message(s, |
2709 | SSL3_ST_SR_CERT_VRFY_A, | 2910 | SSL3_ST_SR_CERT_VRFY_A, |
2710 | SSL3_ST_SR_CERT_VRFY_B, | 2911 | SSL3_ST_SR_CERT_VRFY_B, |
2711 | -1, | 2912 | -1, |
2712 | 514, /* 514? */ | 2913 | 516, /* Enough for 4096 bit RSA key with TLS v1.2 */ |
2713 | &ok); | 2914 | &ok); |
2714 | 2915 | ||
2715 | if (!ok) return((int)n); | 2916 | if (!ok) return((int)n); |
@@ -2729,7 +2930,7 @@ int ssl3_get_cert_verify(SSL *s) | |||
2729 | if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) | 2930 | if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) |
2730 | { | 2931 | { |
2731 | s->s3->tmp.reuse_message=1; | 2932 | s->s3->tmp.reuse_message=1; |
2732 | if ((peer != NULL) && (type | EVP_PKT_SIGN)) | 2933 | if ((peer != NULL) && (type & EVP_PKT_SIGN)) |
2733 | { | 2934 | { |
2734 | al=SSL_AD_UNEXPECTED_MESSAGE; | 2935 | al=SSL_AD_UNEXPECTED_MESSAGE; |
2735 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE); | 2936 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_MISSING_VERIFY_MESSAGE); |
@@ -2772,6 +2973,36 @@ int ssl3_get_cert_verify(SSL *s) | |||
2772 | } | 2973 | } |
2773 | else | 2974 | else |
2774 | { | 2975 | { |
2976 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
2977 | { | ||
2978 | int sigalg = tls12_get_sigid(pkey); | ||
2979 | /* Should never happen */ | ||
2980 | if (sigalg == -1) | ||
2981 | { | ||
2982 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,ERR_R_INTERNAL_ERROR); | ||
2983 | al=SSL_AD_INTERNAL_ERROR; | ||
2984 | goto f_err; | ||
2985 | } | ||
2986 | /* Check key type is consistent with signature */ | ||
2987 | if (sigalg != (int)p[1]) | ||
2988 | { | ||
2989 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_WRONG_SIGNATURE_TYPE); | ||
2990 | al=SSL_AD_DECODE_ERROR; | ||
2991 | goto f_err; | ||
2992 | } | ||
2993 | md = tls12_get_hash(p[0]); | ||
2994 | if (md == NULL) | ||
2995 | { | ||
2996 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_UNKNOWN_DIGEST); | ||
2997 | al=SSL_AD_DECODE_ERROR; | ||
2998 | goto f_err; | ||
2999 | } | ||
3000 | #ifdef SSL_DEBUG | ||
3001 | fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md)); | ||
3002 | #endif | ||
3003 | p += 2; | ||
3004 | n -= 2; | ||
3005 | } | ||
2775 | n2s(p,i); | 3006 | n2s(p,i); |
2776 | n-=2; | 3007 | n-=2; |
2777 | if (i > n) | 3008 | if (i > n) |
@@ -2789,6 +3020,37 @@ int ssl3_get_cert_verify(SSL *s) | |||
2789 | goto f_err; | 3020 | goto f_err; |
2790 | } | 3021 | } |
2791 | 3022 | ||
3023 | if (TLS1_get_version(s) >= TLS1_2_VERSION) | ||
3024 | { | ||
3025 | long hdatalen = 0; | ||
3026 | void *hdata; | ||
3027 | hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); | ||
3028 | if (hdatalen <= 0) | ||
3029 | { | ||
3030 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); | ||
3031 | al=SSL_AD_INTERNAL_ERROR; | ||
3032 | goto f_err; | ||
3033 | } | ||
3034 | #ifdef SSL_DEBUG | ||
3035 | fprintf(stderr, "Using TLS 1.2 with client verify alg %s\n", | ||
3036 | EVP_MD_name(md)); | ||
3037 | #endif | ||
3038 | if (!EVP_VerifyInit_ex(&mctx, md, NULL) | ||
3039 | || !EVP_VerifyUpdate(&mctx, hdata, hdatalen)) | ||
3040 | { | ||
3041 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_EVP_LIB); | ||
3042 | al=SSL_AD_INTERNAL_ERROR; | ||
3043 | goto f_err; | ||
3044 | } | ||
3045 | |||
3046 | if (EVP_VerifyFinal(&mctx, p , i, pkey) <= 0) | ||
3047 | { | ||
3048 | al=SSL_AD_DECRYPT_ERROR; | ||
3049 | SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_BAD_SIGNATURE); | ||
3050 | goto f_err; | ||
3051 | } | ||
3052 | } | ||
3053 | else | ||
2792 | #ifndef OPENSSL_NO_RSA | 3054 | #ifndef OPENSSL_NO_RSA |
2793 | if (pkey->type == EVP_PKEY_RSA) | 3055 | if (pkey->type == EVP_PKEY_RSA) |
2794 | { | 3056 | { |
@@ -2879,6 +3141,13 @@ f_err: | |||
2879 | ssl3_send_alert(s,SSL3_AL_FATAL,al); | 3141 | ssl3_send_alert(s,SSL3_AL_FATAL,al); |
2880 | } | 3142 | } |
2881 | end: | 3143 | end: |
3144 | if (s->s3->handshake_buffer) | ||
3145 | { | ||
3146 | BIO_free(s->s3->handshake_buffer); | ||
3147 | s->s3->handshake_buffer = NULL; | ||
3148 | s->s3->flags &= ~TLS1_FLAGS_KEEP_HANDSHAKE; | ||
3149 | } | ||
3150 | EVP_MD_CTX_cleanup(&mctx); | ||
2882 | EVP_PKEY_free(pkey); | 3151 | EVP_PKEY_free(pkey); |
2883 | return(ret); | 3152 | return(ret); |
2884 | } | 3153 | } |
@@ -2991,6 +3260,12 @@ int ssl3_get_client_certificate(SSL *s) | |||
2991 | al=SSL_AD_HANDSHAKE_FAILURE; | 3260 | al=SSL_AD_HANDSHAKE_FAILURE; |
2992 | goto f_err; | 3261 | goto f_err; |
2993 | } | 3262 | } |
3263 | /* No client certificate so digest cached records */ | ||
3264 | if (s->s3->handshake_buffer && !ssl3_digest_cached_records(s)) | ||
3265 | { | ||
3266 | al=SSL_AD_INTERNAL_ERROR; | ||
3267 | goto f_err; | ||
3268 | } | ||
2994 | } | 3269 | } |
2995 | else | 3270 | else |
2996 | { | 3271 | { |
@@ -3067,13 +3342,17 @@ int ssl3_send_server_certificate(SSL *s) | |||
3067 | /* SSL3_ST_SW_CERT_B */ | 3342 | /* SSL3_ST_SW_CERT_B */ |
3068 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); | 3343 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); |
3069 | } | 3344 | } |
3345 | |||
3070 | #ifndef OPENSSL_NO_TLSEXT | 3346 | #ifndef OPENSSL_NO_TLSEXT |
3347 | /* send a new session ticket (not necessarily for a new session) */ | ||
3071 | int ssl3_send_newsession_ticket(SSL *s) | 3348 | int ssl3_send_newsession_ticket(SSL *s) |
3072 | { | 3349 | { |
3073 | if (s->state == SSL3_ST_SW_SESSION_TICKET_A) | 3350 | if (s->state == SSL3_ST_SW_SESSION_TICKET_A) |
3074 | { | 3351 | { |
3075 | unsigned char *p, *senc, *macstart; | 3352 | unsigned char *p, *senc, *macstart; |
3076 | int len, slen; | 3353 | const unsigned char *const_p; |
3354 | int len, slen_full, slen; | ||
3355 | SSL_SESSION *sess; | ||
3077 | unsigned int hlen; | 3356 | unsigned int hlen; |
3078 | EVP_CIPHER_CTX ctx; | 3357 | EVP_CIPHER_CTX ctx; |
3079 | HMAC_CTX hctx; | 3358 | HMAC_CTX hctx; |
@@ -3082,12 +3361,38 @@ int ssl3_send_newsession_ticket(SSL *s) | |||
3082 | unsigned char key_name[16]; | 3361 | unsigned char key_name[16]; |
3083 | 3362 | ||
3084 | /* get session encoding length */ | 3363 | /* get session encoding length */ |
3085 | slen = i2d_SSL_SESSION(s->session, NULL); | 3364 | slen_full = i2d_SSL_SESSION(s->session, NULL); |
3086 | /* Some length values are 16 bits, so forget it if session is | 3365 | /* Some length values are 16 bits, so forget it if session is |
3087 | * too long | 3366 | * too long |
3088 | */ | 3367 | */ |
3089 | if (slen > 0xFF00) | 3368 | if (slen_full > 0xFF00) |
3369 | return -1; | ||
3370 | senc = OPENSSL_malloc(slen_full); | ||
3371 | if (!senc) | ||
3372 | return -1; | ||
3373 | p = senc; | ||
3374 | i2d_SSL_SESSION(s->session, &p); | ||
3375 | |||
3376 | /* create a fresh copy (not shared with other threads) to clean up */ | ||
3377 | const_p = senc; | ||
3378 | sess = d2i_SSL_SESSION(NULL, &const_p, slen_full); | ||
3379 | if (sess == NULL) | ||
3380 | { | ||
3381 | OPENSSL_free(senc); | ||
3090 | return -1; | 3382 | return -1; |
3383 | } | ||
3384 | sess->session_id_length = 0; /* ID is irrelevant for the ticket */ | ||
3385 | |||
3386 | slen = i2d_SSL_SESSION(sess, NULL); | ||
3387 | if (slen > slen_full) /* shouldn't ever happen */ | ||
3388 | { | ||
3389 | OPENSSL_free(senc); | ||
3390 | return -1; | ||
3391 | } | ||
3392 | p = senc; | ||
3393 | i2d_SSL_SESSION(sess, &p); | ||
3394 | SSL_SESSION_free(sess); | ||
3395 | |||
3091 | /* Grow buffer if need be: the length calculation is as | 3396 | /* Grow buffer if need be: the length calculation is as |
3092 | * follows 1 (size of message name) + 3 (message length | 3397 | * follows 1 (size of message name) + 3 (message length |
3093 | * bytes) + 4 (ticket lifetime hint) + 2 (ticket length) + | 3398 | * bytes) + 4 (ticket lifetime hint) + 2 (ticket length) + |
@@ -3099,11 +3404,6 @@ int ssl3_send_newsession_ticket(SSL *s) | |||
3099 | 26 + EVP_MAX_IV_LENGTH + EVP_MAX_BLOCK_LENGTH + | 3404 | 26 + EVP_MAX_IV_LENGTH + EVP_MAX_BLOCK_LENGTH + |
3100 | EVP_MAX_MD_SIZE + slen)) | 3405 | EVP_MAX_MD_SIZE + slen)) |
3101 | return -1; | 3406 | return -1; |
3102 | senc = OPENSSL_malloc(slen); | ||
3103 | if (!senc) | ||
3104 | return -1; | ||
3105 | p = senc; | ||
3106 | i2d_SSL_SESSION(s->session, &p); | ||
3107 | 3407 | ||
3108 | p=(unsigned char *)s->init_buf->data; | 3408 | p=(unsigned char *)s->init_buf->data; |
3109 | /* do the header */ | 3409 | /* do the header */ |
@@ -3134,7 +3434,13 @@ int ssl3_send_newsession_ticket(SSL *s) | |||
3134 | tlsext_tick_md(), NULL); | 3434 | tlsext_tick_md(), NULL); |
3135 | memcpy(key_name, tctx->tlsext_tick_key_name, 16); | 3435 | memcpy(key_name, tctx->tlsext_tick_key_name, 16); |
3136 | } | 3436 | } |
3137 | l2n(s->session->tlsext_tick_lifetime_hint, p); | 3437 | |
3438 | /* Ticket lifetime hint (advisory only): | ||
3439 | * We leave this unspecified for resumed session (for simplicity), | ||
3440 | * and guess that tickets for new sessions will live as long | ||
3441 | * as their sessions. */ | ||
3442 | l2n(s->hit ? 0 : s->session->timeout, p); | ||
3443 | |||
3138 | /* Skip ticket length for now */ | 3444 | /* Skip ticket length for now */ |
3139 | p += 2; | 3445 | p += 2; |
3140 | /* Output key name */ | 3446 | /* Output key name */ |
@@ -3209,4 +3515,72 @@ int ssl3_send_cert_status(SSL *s) | |||
3209 | /* SSL3_ST_SW_CERT_STATUS_B */ | 3515 | /* SSL3_ST_SW_CERT_STATUS_B */ |
3210 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); | 3516 | return(ssl3_do_write(s,SSL3_RT_HANDSHAKE)); |
3211 | } | 3517 | } |
3518 | |||
3519 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
3520 | /* ssl3_get_next_proto reads a Next Protocol Negotiation handshake message. It | ||
3521 | * sets the next_proto member in s if found */ | ||
3522 | int ssl3_get_next_proto(SSL *s) | ||
3523 | { | ||
3524 | int ok; | ||
3525 | int proto_len, padding_len; | ||
3526 | long n; | ||
3527 | const unsigned char *p; | ||
3528 | |||
3529 | /* Clients cannot send a NextProtocol message if we didn't see the | ||
3530 | * extension in their ClientHello */ | ||
3531 | if (!s->s3->next_proto_neg_seen) | ||
3532 | { | ||
3533 | SSLerr(SSL_F_SSL3_GET_NEXT_PROTO,SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION); | ||
3534 | return -1; | ||
3535 | } | ||
3536 | |||
3537 | n=s->method->ssl_get_message(s, | ||
3538 | SSL3_ST_SR_NEXT_PROTO_A, | ||
3539 | SSL3_ST_SR_NEXT_PROTO_B, | ||
3540 | SSL3_MT_NEXT_PROTO, | ||
3541 | 514, /* See the payload format below */ | ||
3542 | &ok); | ||
3543 | |||
3544 | if (!ok) | ||
3545 | return((int)n); | ||
3546 | |||
3547 | /* s->state doesn't reflect whether ChangeCipherSpec has been received | ||
3548 | * in this handshake, but s->s3->change_cipher_spec does (will be reset | ||
3549 | * by ssl3_get_finished). */ | ||
3550 | if (!s->s3->change_cipher_spec) | ||
3551 | { | ||
3552 | SSLerr(SSL_F_SSL3_GET_NEXT_PROTO,SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS); | ||
3553 | return -1; | ||
3554 | } | ||
3555 | |||
3556 | if (n < 2) | ||
3557 | return 0; /* The body must be > 1 bytes long */ | ||
3558 | |||
3559 | p=(unsigned char *)s->init_msg; | ||
3560 | |||
3561 | /* The payload looks like: | ||
3562 | * uint8 proto_len; | ||
3563 | * uint8 proto[proto_len]; | ||
3564 | * uint8 padding_len; | ||
3565 | * uint8 padding[padding_len]; | ||
3566 | */ | ||
3567 | proto_len = p[0]; | ||
3568 | if (proto_len + 2 > s->init_num) | ||
3569 | return 0; | ||
3570 | padding_len = p[proto_len + 1]; | ||
3571 | if (proto_len + padding_len + 2 != s->init_num) | ||
3572 | return 0; | ||
3573 | |||
3574 | s->next_proto_negotiated = OPENSSL_malloc(proto_len); | ||
3575 | if (!s->next_proto_negotiated) | ||
3576 | { | ||
3577 | SSLerr(SSL_F_SSL3_GET_NEXT_PROTO,ERR_R_MALLOC_FAILURE); | ||
3578 | return 0; | ||
3579 | } | ||
3580 | memcpy(s->next_proto_negotiated, p + 1, proto_len); | ||
3581 | s->next_proto_negotiated_len = proto_len; | ||
3582 | |||
3583 | return 1; | ||
3584 | } | ||
3585 | # endif | ||
3212 | #endif | 3586 | #endif |
diff --git a/src/lib/libssl/src/ssl/ssl-lib.com b/src/lib/libssl/src/ssl/ssl-lib.com index 180f3a2d88..a77f7707f2 100644 --- a/src/lib/libssl/src/ssl/ssl-lib.com +++ b/src/lib/libssl/src/ssl/ssl-lib.com | |||
@@ -218,11 +218,11 @@ $ LIB_SSL = "s2_meth,s2_srvr,s2_clnt,s2_lib,s2_enc,s2_pkt,"+ - | |||
218 | "s23_meth,s23_srvr,s23_clnt,s23_lib,s23_pkt,"+ - | 218 | "s23_meth,s23_srvr,s23_clnt,s23_lib,s23_pkt,"+ - |
219 | "t1_meth,t1_srvr,t1_clnt,t1_lib,t1_enc,"+ - | 219 | "t1_meth,t1_srvr,t1_clnt,t1_lib,t1_enc,"+ - |
220 | "d1_meth,d1_srvr,d1_clnt,d1_lib,d1_pkt,"+ - | 220 | "d1_meth,d1_srvr,d1_clnt,d1_lib,d1_pkt,"+ - |
221 | "d1_both,d1_enc,"+ - | 221 | "d1_both,d1_enc,d1_srtp,"+ - |
222 | "ssl_lib,ssl_err2,ssl_cert,ssl_sess,"+ - | 222 | "ssl_lib,ssl_err2,ssl_cert,ssl_sess,"+ - |
223 | "ssl_ciph,ssl_stat,ssl_rsa,"+ - | 223 | "ssl_ciph,ssl_stat,ssl_rsa,"+ - |
224 | "ssl_asn1,ssl_txt,ssl_algs,"+ - | 224 | "ssl_asn1,ssl_txt,ssl_algs,"+ - |
225 | "bio_ssl,ssl_err,kssl,t1_reneg" | 225 | "bio_ssl,ssl_err,kssl,tls_srp,t1_reneg" |
226 | $! | 226 | $! |
227 | $ COMPILEWITH_CC5 = "" | 227 | $ COMPILEWITH_CC5 = "" |
228 | $! | 228 | $! |
diff --git a/src/lib/libssl/src/ssl/ssl.h b/src/lib/libssl/src/ssl/ssl.h index 8f922eea72..8b0c2a2dac 100644 --- a/src/lib/libssl/src/ssl/ssl.h +++ b/src/lib/libssl/src/ssl/ssl.h | |||
@@ -252,6 +252,7 @@ extern "C" { | |||
252 | #define SSL_TXT_kEECDH "kEECDH" | 252 | #define SSL_TXT_kEECDH "kEECDH" |
253 | #define SSL_TXT_kPSK "kPSK" | 253 | #define SSL_TXT_kPSK "kPSK" |
254 | #define SSL_TXT_kGOST "kGOST" | 254 | #define SSL_TXT_kGOST "kGOST" |
255 | #define SSL_TXT_kSRP "kSRP" | ||
255 | 256 | ||
256 | #define SSL_TXT_aRSA "aRSA" | 257 | #define SSL_TXT_aRSA "aRSA" |
257 | #define SSL_TXT_aDSS "aDSS" | 258 | #define SSL_TXT_aDSS "aDSS" |
@@ -275,6 +276,7 @@ extern "C" { | |||
275 | #define SSL_TXT_ECDSA "ECDSA" | 276 | #define SSL_TXT_ECDSA "ECDSA" |
276 | #define SSL_TXT_KRB5 "KRB5" | 277 | #define SSL_TXT_KRB5 "KRB5" |
277 | #define SSL_TXT_PSK "PSK" | 278 | #define SSL_TXT_PSK "PSK" |
279 | #define SSL_TXT_SRP "SRP" | ||
278 | 280 | ||
279 | #define SSL_TXT_DES "DES" | 281 | #define SSL_TXT_DES "DES" |
280 | #define SSL_TXT_3DES "3DES" | 282 | #define SSL_TXT_3DES "3DES" |
@@ -285,6 +287,7 @@ extern "C" { | |||
285 | #define SSL_TXT_AES128 "AES128" | 287 | #define SSL_TXT_AES128 "AES128" |
286 | #define SSL_TXT_AES256 "AES256" | 288 | #define SSL_TXT_AES256 "AES256" |
287 | #define SSL_TXT_AES "AES" | 289 | #define SSL_TXT_AES "AES" |
290 | #define SSL_TXT_AES_GCM "AESGCM" | ||
288 | #define SSL_TXT_CAMELLIA128 "CAMELLIA128" | 291 | #define SSL_TXT_CAMELLIA128 "CAMELLIA128" |
289 | #define SSL_TXT_CAMELLIA256 "CAMELLIA256" | 292 | #define SSL_TXT_CAMELLIA256 "CAMELLIA256" |
290 | #define SSL_TXT_CAMELLIA "CAMELLIA" | 293 | #define SSL_TXT_CAMELLIA "CAMELLIA" |
@@ -294,10 +297,14 @@ extern "C" { | |||
294 | #define SSL_TXT_SHA "SHA" /* same as "SHA1" */ | 297 | #define SSL_TXT_SHA "SHA" /* same as "SHA1" */ |
295 | #define SSL_TXT_GOST94 "GOST94" | 298 | #define SSL_TXT_GOST94 "GOST94" |
296 | #define SSL_TXT_GOST89MAC "GOST89MAC" | 299 | #define SSL_TXT_GOST89MAC "GOST89MAC" |
300 | #define SSL_TXT_SHA256 "SHA256" | ||
301 | #define SSL_TXT_SHA384 "SHA384" | ||
297 | 302 | ||
298 | #define SSL_TXT_SSLV2 "SSLv2" | 303 | #define SSL_TXT_SSLV2 "SSLv2" |
299 | #define SSL_TXT_SSLV3 "SSLv3" | 304 | #define SSL_TXT_SSLV3 "SSLv3" |
300 | #define SSL_TXT_TLSV1 "TLSv1" | 305 | #define SSL_TXT_TLSV1 "TLSv1" |
306 | #define SSL_TXT_TLSV1_1 "TLSv1.1" | ||
307 | #define SSL_TXT_TLSV1_2 "TLSv1.2" | ||
301 | 308 | ||
302 | #define SSL_TXT_EXP "EXP" | 309 | #define SSL_TXT_EXP "EXP" |
303 | #define SSL_TXT_EXPORT "EXPORT" | 310 | #define SSL_TXT_EXPORT "EXPORT" |
@@ -356,9 +363,29 @@ extern "C" { | |||
356 | * in SSL_CTX. */ | 363 | * in SSL_CTX. */ |
357 | typedef struct ssl_st *ssl_crock_st; | 364 | typedef struct ssl_st *ssl_crock_st; |
358 | typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT; | 365 | typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT; |
366 | typedef struct ssl_method_st SSL_METHOD; | ||
367 | typedef struct ssl_cipher_st SSL_CIPHER; | ||
368 | typedef struct ssl_session_st SSL_SESSION; | ||
369 | |||
370 | DECLARE_STACK_OF(SSL_CIPHER) | ||
371 | |||
372 | /* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/ | ||
373 | typedef struct srtp_protection_profile_st | ||
374 | { | ||
375 | const char *name; | ||
376 | unsigned long id; | ||
377 | } SRTP_PROTECTION_PROFILE; | ||
378 | |||
379 | DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE) | ||
380 | |||
381 | typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, int len, void *arg); | ||
382 | typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg); | ||
383 | |||
384 | |||
385 | #ifndef OPENSSL_NO_SSL_INTERN | ||
359 | 386 | ||
360 | /* used to hold info on the particular ciphers used */ | 387 | /* used to hold info on the particular ciphers used */ |
361 | typedef struct ssl_cipher_st | 388 | struct ssl_cipher_st |
362 | { | 389 | { |
363 | int valid; | 390 | int valid; |
364 | const char *name; /* text name */ | 391 | const char *name; /* text name */ |
@@ -375,15 +402,11 @@ typedef struct ssl_cipher_st | |||
375 | unsigned long algorithm2; /* Extra flags */ | 402 | unsigned long algorithm2; /* Extra flags */ |
376 | int strength_bits; /* Number of bits really used */ | 403 | int strength_bits; /* Number of bits really used */ |
377 | int alg_bits; /* Number of bits for algorithm */ | 404 | int alg_bits; /* Number of bits for algorithm */ |
378 | } SSL_CIPHER; | 405 | }; |
379 | |||
380 | DECLARE_STACK_OF(SSL_CIPHER) | ||
381 | 406 | ||
382 | typedef int (*tls_session_ticket_ext_cb_fn)(SSL *s, const unsigned char *data, int len, void *arg); | ||
383 | typedef int (*tls_session_secret_cb_fn)(SSL *s, void *secret, int *secret_len, STACK_OF(SSL_CIPHER) *peer_ciphers, SSL_CIPHER **cipher, void *arg); | ||
384 | 407 | ||
385 | /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ | 408 | /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ |
386 | typedef struct ssl_method_st | 409 | struct ssl_method_st |
387 | { | 410 | { |
388 | int version; | 411 | int version; |
389 | int (*ssl_new)(SSL *s); | 412 | int (*ssl_new)(SSL *s); |
@@ -416,7 +439,7 @@ typedef struct ssl_method_st | |||
416 | int (*ssl_version)(void); | 439 | int (*ssl_version)(void); |
417 | long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void)); | 440 | long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void)); |
418 | long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void)); | 441 | long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void)); |
419 | } SSL_METHOD; | 442 | }; |
420 | 443 | ||
421 | /* Lets make this into an ASN.1 type structure as follows | 444 | /* Lets make this into an ASN.1 type structure as follows |
422 | * SSL_SESSION_ID ::= SEQUENCE { | 445 | * SSL_SESSION_ID ::= SEQUENCE { |
@@ -433,14 +456,17 @@ typedef struct ssl_method_st | |||
433 | * Session_ID_context [ 4 ] EXPLICIT OCTET STRING, -- the Session ID context | 456 | * Session_ID_context [ 4 ] EXPLICIT OCTET STRING, -- the Session ID context |
434 | * Verify_result [ 5 ] EXPLICIT INTEGER, -- X509_V_... code for `Peer' | 457 | * Verify_result [ 5 ] EXPLICIT INTEGER, -- X509_V_... code for `Peer' |
435 | * HostName [ 6 ] EXPLICIT OCTET STRING, -- optional HostName from servername TLS extension | 458 | * HostName [ 6 ] EXPLICIT OCTET STRING, -- optional HostName from servername TLS extension |
436 | * ECPointFormatList [ 7 ] OCTET STRING, -- optional EC point format list from TLS extension | 459 | * PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint |
437 | * PSK_identity_hint [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity hint | 460 | * PSK_identity [ 8 ] EXPLICIT OCTET STRING, -- optional PSK identity |
438 | * PSK_identity [ 9 ] EXPLICIT OCTET STRING -- optional PSK identity | 461 | * Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket |
462 | * Ticket [10] EXPLICIT OCTET STRING, -- session ticket (clients only) | ||
463 | * Compression_meth [11] EXPLICIT OCTET STRING, -- optional compression method | ||
464 | * SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username | ||
439 | * } | 465 | * } |
440 | * Look in ssl/ssl_asn1.c for more details | 466 | * Look in ssl/ssl_asn1.c for more details |
441 | * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). | 467 | * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). |
442 | */ | 468 | */ |
443 | typedef struct ssl_session_st | 469 | struct ssl_session_st |
444 | { | 470 | { |
445 | int ssl_version; /* what ssl version session info is | 471 | int ssl_version; /* what ssl version session info is |
446 | * being kept in here? */ | 472 | * being kept in here? */ |
@@ -512,8 +538,12 @@ typedef struct ssl_session_st | |||
512 | size_t tlsext_ticklen; /* Session ticket length */ | 538 | size_t tlsext_ticklen; /* Session ticket length */ |
513 | long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */ | 539 | long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */ |
514 | #endif | 540 | #endif |
515 | } SSL_SESSION; | 541 | #ifndef OPENSSL_NO_SRP |
542 | char *srp_username; | ||
543 | #endif | ||
544 | }; | ||
516 | 545 | ||
546 | #endif | ||
517 | 547 | ||
518 | #define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L | 548 | #define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L |
519 | #define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L | 549 | #define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L |
@@ -536,7 +566,7 @@ typedef struct ssl_session_st | |||
536 | 566 | ||
537 | /* SSL_OP_ALL: various bug workarounds that should be rather harmless. | 567 | /* SSL_OP_ALL: various bug workarounds that should be rather harmless. |
538 | * This used to be 0x000FFFFFL before 0.9.7. */ | 568 | * This used to be 0x000FFFFFL before 0.9.7. */ |
539 | #define SSL_OP_ALL 0x80000FFFL | 569 | #define SSL_OP_ALL 0x80000BFFL |
540 | 570 | ||
541 | /* DTLS options */ | 571 | /* DTLS options */ |
542 | #define SSL_OP_NO_QUERY_MTU 0x00001000L | 572 | #define SSL_OP_NO_QUERY_MTU 0x00001000L |
@@ -572,11 +602,17 @@ typedef struct ssl_session_st | |||
572 | #define SSL_OP_NO_SSLv2 0x01000000L | 602 | #define SSL_OP_NO_SSLv2 0x01000000L |
573 | #define SSL_OP_NO_SSLv3 0x02000000L | 603 | #define SSL_OP_NO_SSLv3 0x02000000L |
574 | #define SSL_OP_NO_TLSv1 0x04000000L | 604 | #define SSL_OP_NO_TLSv1 0x04000000L |
605 | #define SSL_OP_NO_TLSv1_2 0x08000000L | ||
606 | #define SSL_OP_NO_TLSv1_1 0x10000000L | ||
575 | 607 | ||
608 | /* These next two were never actually used for anything since SSLeay | ||
609 | * zap so we have some more flags. | ||
610 | */ | ||
576 | /* The next flag deliberately changes the ciphertest, this is a check | 611 | /* The next flag deliberately changes the ciphertest, this is a check |
577 | * for the PKCS#1 attack */ | 612 | * for the PKCS#1 attack */ |
578 | #define SSL_OP_PKCS1_CHECK_1 0x08000000L | 613 | #define SSL_OP_PKCS1_CHECK_1 0x0 |
579 | #define SSL_OP_PKCS1_CHECK_2 0x10000000L | 614 | #define SSL_OP_PKCS1_CHECK_2 0x0 |
615 | |||
580 | #define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L | 616 | #define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L |
581 | #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L | 617 | #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L |
582 | /* Make server add server-hello extension from early version of | 618 | /* Make server add server-hello extension from early version of |
@@ -637,12 +673,53 @@ typedef struct ssl_session_st | |||
637 | #define SSL_get_secure_renegotiation_support(ssl) \ | 673 | #define SSL_get_secure_renegotiation_support(ssl) \ |
638 | SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) | 674 | SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL) |
639 | 675 | ||
676 | #ifndef OPENSSL_NO_HEARTBEATS | ||
677 | #define SSL_heartbeat(ssl) \ | ||
678 | SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL) | ||
679 | #endif | ||
680 | |||
640 | void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); | 681 | void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); |
641 | void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); | 682 | void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); |
642 | #define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) | 683 | #define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) |
643 | #define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) | 684 | #define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) |
644 | 685 | ||
686 | #ifndef OPENSSL_NO_SRP | ||
645 | 687 | ||
688 | #ifndef OPENSSL_NO_SSL_INTERN | ||
689 | |||
690 | typedef struct srp_ctx_st | ||
691 | { | ||
692 | /* param for all the callbacks */ | ||
693 | void *SRP_cb_arg; | ||
694 | /* set client Hello login callback */ | ||
695 | int (*TLS_ext_srp_username_callback)(SSL *, int *, void *); | ||
696 | /* set SRP N/g param callback for verification */ | ||
697 | int (*SRP_verify_param_callback)(SSL *, void *); | ||
698 | /* set SRP client passwd callback */ | ||
699 | char *(*SRP_give_srp_client_pwd_callback)(SSL *, void *); | ||
700 | |||
701 | char *login; | ||
702 | BIGNUM *N,*g,*s,*B,*A; | ||
703 | BIGNUM *a,*b,*v; | ||
704 | char *info; | ||
705 | int strength; | ||
706 | |||
707 | unsigned long srp_Mask; | ||
708 | } SRP_CTX; | ||
709 | |||
710 | #endif | ||
711 | |||
712 | /* see tls_srp.c */ | ||
713 | int SSL_SRP_CTX_init(SSL *s); | ||
714 | int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx); | ||
715 | int SSL_SRP_CTX_free(SSL *ctx); | ||
716 | int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx); | ||
717 | int SSL_srp_server_param_with_username(SSL *s, int *ad); | ||
718 | int SRP_generate_server_master_secret(SSL *s,unsigned char *master_key); | ||
719 | int SRP_Calc_A_param(SSL *s); | ||
720 | int SRP_generate_client_master_secret(SSL *s,unsigned char *master_key); | ||
721 | |||
722 | #endif | ||
646 | 723 | ||
647 | #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) | 724 | #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) |
648 | #define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */ | 725 | #define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */ |
@@ -668,7 +745,11 @@ void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int con | |||
668 | typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, | 745 | typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, |
669 | unsigned int *id_len); | 746 | unsigned int *id_len); |
670 | 747 | ||
671 | typedef struct ssl_comp_st | 748 | typedef struct ssl_comp_st SSL_COMP; |
749 | |||
750 | #ifndef OPENSSL_NO_SSL_INTERN | ||
751 | |||
752 | struct ssl_comp_st | ||
672 | { | 753 | { |
673 | int id; | 754 | int id; |
674 | const char *name; | 755 | const char *name; |
@@ -677,7 +758,7 @@ typedef struct ssl_comp_st | |||
677 | #else | 758 | #else |
678 | char *method; | 759 | char *method; |
679 | #endif | 760 | #endif |
680 | } SSL_COMP; | 761 | }; |
681 | 762 | ||
682 | DECLARE_STACK_OF(SSL_COMP) | 763 | DECLARE_STACK_OF(SSL_COMP) |
683 | DECLARE_LHASH_OF(SSL_SESSION); | 764 | DECLARE_LHASH_OF(SSL_SESSION); |
@@ -846,7 +927,6 @@ struct ssl_ctx_st | |||
846 | /* Callback for status request */ | 927 | /* Callback for status request */ |
847 | int (*tlsext_status_cb)(SSL *ssl, void *arg); | 928 | int (*tlsext_status_cb)(SSL *ssl, void *arg); |
848 | void *tlsext_status_arg; | 929 | void *tlsext_status_arg; |
849 | |||
850 | /* draft-rescorla-tls-opaque-prf-input-00.txt information */ | 930 | /* draft-rescorla-tls-opaque-prf-input-00.txt information */ |
851 | int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg); | 931 | int (*tlsext_opaque_prf_input_callback)(SSL *, void *peerinput, size_t len, void *arg); |
852 | void *tlsext_opaque_prf_input_callback_arg; | 932 | void *tlsext_opaque_prf_input_callback_arg; |
@@ -867,8 +947,36 @@ struct ssl_ctx_st | |||
867 | struct ssl3_buf_freelist_st *wbuf_freelist; | 947 | struct ssl3_buf_freelist_st *wbuf_freelist; |
868 | struct ssl3_buf_freelist_st *rbuf_freelist; | 948 | struct ssl3_buf_freelist_st *rbuf_freelist; |
869 | #endif | 949 | #endif |
950 | #ifndef OPENSSL_NO_SRP | ||
951 | SRP_CTX srp_ctx; /* ctx for SRP authentication */ | ||
952 | #endif | ||
953 | |||
954 | #ifndef OPENSSL_NO_TLSEXT | ||
955 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
956 | /* Next protocol negotiation information */ | ||
957 | /* (for experimental NPN extension). */ | ||
958 | |||
959 | /* For a server, this contains a callback function by which the set of | ||
960 | * advertised protocols can be provided. */ | ||
961 | int (*next_protos_advertised_cb)(SSL *s, const unsigned char **buf, | ||
962 | unsigned int *len, void *arg); | ||
963 | void *next_protos_advertised_cb_arg; | ||
964 | /* For a client, this contains a callback function that selects the | ||
965 | * next protocol from the list provided by the server. */ | ||
966 | int (*next_proto_select_cb)(SSL *s, unsigned char **out, | ||
967 | unsigned char *outlen, | ||
968 | const unsigned char *in, | ||
969 | unsigned int inlen, | ||
970 | void *arg); | ||
971 | void *next_proto_select_cb_arg; | ||
972 | # endif | ||
973 | /* SRTP profiles we are willing to do from RFC 5764 */ | ||
974 | STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; | ||
975 | #endif | ||
870 | }; | 976 | }; |
871 | 977 | ||
978 | #endif | ||
979 | |||
872 | #define SSL_SESS_CACHE_OFF 0x0000 | 980 | #define SSL_SESS_CACHE_OFF 0x0000 |
873 | #define SSL_SESS_CACHE_CLIENT 0x0001 | 981 | #define SSL_SESS_CACHE_CLIENT 0x0001 |
874 | #define SSL_SESS_CACHE_SERVER 0x0002 | 982 | #define SSL_SESS_CACHE_SERVER 0x0002 |
@@ -921,6 +1029,32 @@ int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e); | |||
921 | #endif | 1029 | #endif |
922 | void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)); | 1030 | void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)); |
923 | void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)); | 1031 | void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx, int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, unsigned int cookie_len)); |
1032 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1033 | void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s, | ||
1034 | int (*cb) (SSL *ssl, | ||
1035 | const unsigned char **out, | ||
1036 | unsigned int *outlen, | ||
1037 | void *arg), | ||
1038 | void *arg); | ||
1039 | void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s, | ||
1040 | int (*cb) (SSL *ssl, | ||
1041 | unsigned char **out, | ||
1042 | unsigned char *outlen, | ||
1043 | const unsigned char *in, | ||
1044 | unsigned int inlen, | ||
1045 | void *arg), | ||
1046 | void *arg); | ||
1047 | |||
1048 | int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, | ||
1049 | const unsigned char *in, unsigned int inlen, | ||
1050 | const unsigned char *client, unsigned int client_len); | ||
1051 | void SSL_get0_next_proto_negotiated(const SSL *s, | ||
1052 | const unsigned char **data, unsigned *len); | ||
1053 | |||
1054 | #define OPENSSL_NPN_UNSUPPORTED 0 | ||
1055 | #define OPENSSL_NPN_NEGOTIATED 1 | ||
1056 | #define OPENSSL_NPN_NO_OVERLAP 2 | ||
1057 | #endif | ||
924 | 1058 | ||
925 | #ifndef OPENSSL_NO_PSK | 1059 | #ifndef OPENSSL_NO_PSK |
926 | /* the maximum length of the buffer given to callbacks containing the | 1060 | /* the maximum length of the buffer given to callbacks containing the |
@@ -961,6 +1095,8 @@ const char *SSL_get_psk_identity(const SSL *s); | |||
961 | #define SSL_MAC_FLAG_READ_MAC_STREAM 1 | 1095 | #define SSL_MAC_FLAG_READ_MAC_STREAM 1 |
962 | #define SSL_MAC_FLAG_WRITE_MAC_STREAM 2 | 1096 | #define SSL_MAC_FLAG_WRITE_MAC_STREAM 2 |
963 | 1097 | ||
1098 | #ifndef OPENSSL_NO_SSL_INTERN | ||
1099 | |||
964 | struct ssl_st | 1100 | struct ssl_st |
965 | { | 1101 | { |
966 | /* protocol version | 1102 | /* protocol version |
@@ -1005,9 +1141,7 @@ struct ssl_st | |||
1005 | 1141 | ||
1006 | int server; /* are we the server side? - mostly used by SSL_clear*/ | 1142 | int server; /* are we the server side? - mostly used by SSL_clear*/ |
1007 | 1143 | ||
1008 | int new_session;/* 1 if we are to use a new session. | 1144 | int new_session;/* Generate a new session or reuse an old one. |
1009 | * 2 if we are a server and are inside a handshake | ||
1010 | * (i.e. not just sending a HelloRequest) | ||
1011 | * NB: For servers, the 'new' session may actually be a previously | 1145 | * NB: For servers, the 'new' session may actually be a previously |
1012 | * cached session or even the previous session unless | 1146 | * cached session or even the previous session unless |
1013 | * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ | 1147 | * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ |
@@ -1177,12 +1311,46 @@ struct ssl_st | |||
1177 | void *tls_session_secret_cb_arg; | 1311 | void *tls_session_secret_cb_arg; |
1178 | 1312 | ||
1179 | SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */ | 1313 | SSL_CTX * initial_ctx; /* initial ctx, used to store sessions */ |
1314 | |||
1315 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1316 | /* Next protocol negotiation. For the client, this is the protocol that | ||
1317 | * we sent in NextProtocol and is set when handling ServerHello | ||
1318 | * extensions. | ||
1319 | * | ||
1320 | * For a server, this is the client's selected_protocol from | ||
1321 | * NextProtocol and is set when handling the NextProtocol message, | ||
1322 | * before the Finished message. */ | ||
1323 | unsigned char *next_proto_negotiated; | ||
1324 | unsigned char next_proto_negotiated_len; | ||
1325 | #endif | ||
1326 | |||
1180 | #define session_ctx initial_ctx | 1327 | #define session_ctx initial_ctx |
1328 | |||
1329 | STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; /* What we'll do */ | ||
1330 | SRTP_PROTECTION_PROFILE *srtp_profile; /* What's been chosen */ | ||
1331 | |||
1332 | unsigned int tlsext_heartbeat; /* Is use of the Heartbeat extension negotiated? | ||
1333 | 0: disabled | ||
1334 | 1: enabled | ||
1335 | 2: enabled, but not allowed to send Requests | ||
1336 | */ | ||
1337 | unsigned int tlsext_hb_pending; /* Indicates if a HeartbeatRequest is in flight */ | ||
1338 | unsigned int tlsext_hb_seq; /* HeartbeatRequest sequence number */ | ||
1181 | #else | 1339 | #else |
1182 | #define session_ctx ctx | 1340 | #define session_ctx ctx |
1183 | #endif /* OPENSSL_NO_TLSEXT */ | 1341 | #endif /* OPENSSL_NO_TLSEXT */ |
1342 | |||
1343 | int renegotiate;/* 1 if we are renegotiating. | ||
1344 | * 2 if we are a server and are inside a handshake | ||
1345 | * (i.e. not just sending a HelloRequest) */ | ||
1346 | |||
1347 | #ifndef OPENSSL_NO_SRP | ||
1348 | SRP_CTX srp_ctx; /* ctx for SRP authentication */ | ||
1349 | #endif | ||
1184 | }; | 1350 | }; |
1185 | 1351 | ||
1352 | #endif | ||
1353 | |||
1186 | #ifdef __cplusplus | 1354 | #ifdef __cplusplus |
1187 | } | 1355 | } |
1188 | #endif | 1356 | #endif |
@@ -1192,6 +1360,7 @@ struct ssl_st | |||
1192 | #include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */ | 1360 | #include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */ |
1193 | #include <openssl/dtls1.h> /* Datagram TLS */ | 1361 | #include <openssl/dtls1.h> /* Datagram TLS */ |
1194 | #include <openssl/ssl23.h> | 1362 | #include <openssl/ssl23.h> |
1363 | #include <openssl/srtp.h> /* Support for the use_srtp extension */ | ||
1195 | 1364 | ||
1196 | #ifdef __cplusplus | 1365 | #ifdef __cplusplus |
1197 | extern "C" { | 1366 | extern "C" { |
@@ -1408,6 +1577,20 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) | |||
1408 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 | 1577 | #define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP 71 |
1409 | 1578 | ||
1410 | #define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 | 1579 | #define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB 72 |
1580 | |||
1581 | #define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB 75 | ||
1582 | #define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB 76 | ||
1583 | #define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB 77 | ||
1584 | |||
1585 | #define SSL_CTRL_SET_SRP_ARG 78 | ||
1586 | #define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME 79 | ||
1587 | #define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH 80 | ||
1588 | #define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD 81 | ||
1589 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1590 | #define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT 85 | ||
1591 | #define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING 86 | ||
1592 | #define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS 87 | ||
1593 | #endif | ||
1411 | #endif | 1594 | #endif |
1412 | 1595 | ||
1413 | #define DTLS_CTRL_GET_TIMEOUT 73 | 1596 | #define DTLS_CTRL_GET_TIMEOUT 73 |
@@ -1418,6 +1601,9 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) | |||
1418 | #define SSL_CTRL_CLEAR_OPTIONS 77 | 1601 | #define SSL_CTRL_CLEAR_OPTIONS 77 |
1419 | #define SSL_CTRL_CLEAR_MODE 78 | 1602 | #define SSL_CTRL_CLEAR_MODE 78 |
1420 | 1603 | ||
1604 | #define SSL_CTRL_GET_EXTRA_CHAIN_CERTS 82 | ||
1605 | #define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS 83 | ||
1606 | |||
1421 | #define DTLSv1_get_timeout(ssl, arg) \ | 1607 | #define DTLSv1_get_timeout(ssl, arg) \ |
1422 | SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg) | 1608 | SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg) |
1423 | #define DTLSv1_handle_timeout(ssl) \ | 1609 | #define DTLSv1_handle_timeout(ssl) \ |
@@ -1454,6 +1640,10 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) | |||
1454 | 1640 | ||
1455 | #define SSL_CTX_add_extra_chain_cert(ctx,x509) \ | 1641 | #define SSL_CTX_add_extra_chain_cert(ctx,x509) \ |
1456 | SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) | 1642 | SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) |
1643 | #define SSL_CTX_get_extra_chain_certs(ctx,px509) \ | ||
1644 | SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509) | ||
1645 | #define SSL_CTX_clear_extra_chain_certs(ctx) \ | ||
1646 | SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL) | ||
1457 | 1647 | ||
1458 | #ifndef OPENSSL_NO_BIO | 1648 | #ifndef OPENSSL_NO_BIO |
1459 | BIO_METHOD *BIO_f_ssl(void); | 1649 | BIO_METHOD *BIO_f_ssl(void); |
@@ -1481,6 +1671,7 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s); | |||
1481 | int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits); | 1671 | int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits); |
1482 | char * SSL_CIPHER_get_version(const SSL_CIPHER *c); | 1672 | char * SSL_CIPHER_get_version(const SSL_CIPHER *c); |
1483 | const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); | 1673 | const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); |
1674 | unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c); | ||
1484 | 1675 | ||
1485 | int SSL_get_fd(const SSL *s); | 1676 | int SSL_get_fd(const SSL *s); |
1486 | int SSL_get_rfd(const SSL *s); | 1677 | int SSL_get_rfd(const SSL *s); |
@@ -1546,10 +1737,14 @@ long SSL_SESSION_set_time(SSL_SESSION *s, long t); | |||
1546 | long SSL_SESSION_get_timeout(const SSL_SESSION *s); | 1737 | long SSL_SESSION_get_timeout(const SSL_SESSION *s); |
1547 | long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); | 1738 | long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); |
1548 | void SSL_copy_session_id(SSL *to,const SSL *from); | 1739 | void SSL_copy_session_id(SSL *to,const SSL *from); |
1740 | X509 *SSL_SESSION_get0_peer(SSL_SESSION *s); | ||
1741 | int SSL_SESSION_set1_id_context(SSL_SESSION *s,const unsigned char *sid_ctx, | ||
1742 | unsigned int sid_ctx_len); | ||
1549 | 1743 | ||
1550 | SSL_SESSION *SSL_SESSION_new(void); | 1744 | SSL_SESSION *SSL_SESSION_new(void); |
1551 | const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, | 1745 | const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, |
1552 | unsigned int *len); | 1746 | unsigned int *len); |
1747 | unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s); | ||
1553 | #ifndef OPENSSL_NO_FP_API | 1748 | #ifndef OPENSSL_NO_FP_API |
1554 | int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses); | 1749 | int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses); |
1555 | #endif | 1750 | #endif |
@@ -1612,6 +1807,30 @@ int SSL_set_trust(SSL *s, int trust); | |||
1612 | int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); | 1807 | int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm); |
1613 | int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm); | 1808 | int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm); |
1614 | 1809 | ||
1810 | #ifndef OPENSSL_NO_SRP | ||
1811 | int SSL_CTX_set_srp_username(SSL_CTX *ctx,char *name); | ||
1812 | int SSL_CTX_set_srp_password(SSL_CTX *ctx,char *password); | ||
1813 | int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength); | ||
1814 | int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx, | ||
1815 | char *(*cb)(SSL *,void *)); | ||
1816 | int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx, | ||
1817 | int (*cb)(SSL *,void *)); | ||
1818 | int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx, | ||
1819 | int (*cb)(SSL *,int *,void *)); | ||
1820 | int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg); | ||
1821 | |||
1822 | int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g, | ||
1823 | BIGNUM *sa, BIGNUM *v, char *info); | ||
1824 | int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass, | ||
1825 | const char *grp); | ||
1826 | |||
1827 | BIGNUM *SSL_get_srp_g(SSL *s); | ||
1828 | BIGNUM *SSL_get_srp_N(SSL *s); | ||
1829 | |||
1830 | char *SSL_get_srp_username(SSL *s); | ||
1831 | char *SSL_get_srp_userinfo(SSL *s); | ||
1832 | #endif | ||
1833 | |||
1615 | void SSL_free(SSL *ssl); | 1834 | void SSL_free(SSL *ssl); |
1616 | int SSL_accept(SSL *ssl); | 1835 | int SSL_accept(SSL *ssl); |
1617 | int SSL_connect(SSL *ssl); | 1836 | int SSL_connect(SSL *ssl); |
@@ -1647,6 +1866,15 @@ const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ | |||
1647 | const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ | 1866 | const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ |
1648 | const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ | 1867 | const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ |
1649 | 1868 | ||
1869 | const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */ | ||
1870 | const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */ | ||
1871 | const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */ | ||
1872 | |||
1873 | const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */ | ||
1874 | const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */ | ||
1875 | const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */ | ||
1876 | |||
1877 | |||
1650 | const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ | 1878 | const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ |
1651 | const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ | 1879 | const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ |
1652 | const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ | 1880 | const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ |
@@ -1655,6 +1883,7 @@ STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); | |||
1655 | 1883 | ||
1656 | int SSL_do_handshake(SSL *s); | 1884 | int SSL_do_handshake(SSL *s); |
1657 | int SSL_renegotiate(SSL *s); | 1885 | int SSL_renegotiate(SSL *s); |
1886 | int SSL_renegotiate_abbreviated(SSL *s); | ||
1658 | int SSL_renegotiate_pending(SSL *s); | 1887 | int SSL_renegotiate_pending(SSL *s); |
1659 | int SSL_shutdown(SSL *s); | 1888 | int SSL_shutdown(SSL *s); |
1660 | 1889 | ||
@@ -1706,6 +1935,7 @@ void SSL_set_info_callback(SSL *ssl, | |||
1706 | void (*cb)(const SSL *ssl,int type,int val)); | 1935 | void (*cb)(const SSL *ssl,int type,int val)); |
1707 | void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val); | 1936 | void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val); |
1708 | int SSL_state(const SSL *ssl); | 1937 | int SSL_state(const SSL *ssl); |
1938 | void SSL_set_state(SSL *ssl, int state); | ||
1709 | 1939 | ||
1710 | void SSL_set_verify_result(SSL *ssl,long v); | 1940 | void SSL_set_verify_result(SSL *ssl,long v); |
1711 | long SSL_get_verify_result(const SSL *ssl); | 1941 | long SSL_get_verify_result(const SSL *ssl); |
@@ -1806,6 +2036,9 @@ int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb, | |||
1806 | /* Pre-shared secret session resumption functions */ | 2036 | /* Pre-shared secret session resumption functions */ |
1807 | int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg); | 2037 | int SSL_set_session_secret_cb(SSL *s, tls_session_secret_cb_fn tls_session_secret_cb, void *arg); |
1808 | 2038 | ||
2039 | void SSL_set_debug(SSL *s, int debug); | ||
2040 | int SSL_cache_hit(SSL *s); | ||
2041 | |||
1809 | /* BEGIN ERROR CODES */ | 2042 | /* BEGIN ERROR CODES */ |
1810 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 2043 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
1811 | * made after this point may be overwritten when the script is next run. | 2044 | * made after this point may be overwritten when the script is next run. |
@@ -1825,6 +2058,7 @@ void ERR_load_SSL_strings(void); | |||
1825 | #define SSL_F_DTLS1_ACCEPT 246 | 2058 | #define SSL_F_DTLS1_ACCEPT 246 |
1826 | #define SSL_F_DTLS1_ADD_CERT_TO_BUF 295 | 2059 | #define SSL_F_DTLS1_ADD_CERT_TO_BUF 295 |
1827 | #define SSL_F_DTLS1_BUFFER_RECORD 247 | 2060 | #define SSL_F_DTLS1_BUFFER_RECORD 247 |
2061 | #define SSL_F_DTLS1_CHECK_TIMEOUT_NUM 316 | ||
1828 | #define SSL_F_DTLS1_CLIENT_HELLO 248 | 2062 | #define SSL_F_DTLS1_CLIENT_HELLO 248 |
1829 | #define SSL_F_DTLS1_CONNECT 249 | 2063 | #define SSL_F_DTLS1_CONNECT 249 |
1830 | #define SSL_F_DTLS1_ENC 250 | 2064 | #define SSL_F_DTLS1_ENC 250 |
@@ -1833,6 +2067,7 @@ void ERR_load_SSL_strings(void); | |||
1833 | #define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253 | 2067 | #define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 253 |
1834 | #define SSL_F_DTLS1_GET_RECORD 254 | 2068 | #define SSL_F_DTLS1_GET_RECORD 254 |
1835 | #define SSL_F_DTLS1_HANDLE_TIMEOUT 297 | 2069 | #define SSL_F_DTLS1_HANDLE_TIMEOUT 297 |
2070 | #define SSL_F_DTLS1_HEARTBEAT 305 | ||
1836 | #define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 | 2071 | #define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 |
1837 | #define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288 | 2072 | #define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288 |
1838 | #define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 | 2073 | #define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 |
@@ -1901,6 +2136,7 @@ void ERR_load_SSL_strings(void); | |||
1901 | #define SSL_F_SSL3_GET_KEY_EXCHANGE 141 | 2136 | #define SSL_F_SSL3_GET_KEY_EXCHANGE 141 |
1902 | #define SSL_F_SSL3_GET_MESSAGE 142 | 2137 | #define SSL_F_SSL3_GET_MESSAGE 142 |
1903 | #define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283 | 2138 | #define SSL_F_SSL3_GET_NEW_SESSION_TICKET 283 |
2139 | #define SSL_F_SSL3_GET_NEXT_PROTO 306 | ||
1904 | #define SSL_F_SSL3_GET_RECORD 143 | 2140 | #define SSL_F_SSL3_GET_RECORD 143 |
1905 | #define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 | 2141 | #define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 |
1906 | #define SSL_F_SSL3_GET_SERVER_DONE 145 | 2142 | #define SSL_F_SSL3_GET_SERVER_DONE 145 |
@@ -1925,10 +2161,12 @@ void ERR_load_SSL_strings(void); | |||
1925 | #define SSL_F_SSL3_WRITE_PENDING 159 | 2161 | #define SSL_F_SSL3_WRITE_PENDING 159 |
1926 | #define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298 | 2162 | #define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT 298 |
1927 | #define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277 | 2163 | #define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT 277 |
2164 | #define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT 307 | ||
1928 | #define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 | 2165 | #define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 |
1929 | #define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 | 2166 | #define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 |
1930 | #define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299 | 2167 | #define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT 299 |
1931 | #define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278 | 2168 | #define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT 278 |
2169 | #define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT 308 | ||
1932 | #define SSL_F_SSL_BAD_METHOD 160 | 2170 | #define SSL_F_SSL_BAD_METHOD 160 |
1933 | #define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 | 2171 | #define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 |
1934 | #define SSL_F_SSL_CERT_DUP 221 | 2172 | #define SSL_F_SSL_CERT_DUP 221 |
@@ -1945,6 +2183,7 @@ void ERR_load_SSL_strings(void); | |||
1945 | #define SSL_F_SSL_CREATE_CIPHER_LIST 166 | 2183 | #define SSL_F_SSL_CREATE_CIPHER_LIST 166 |
1946 | #define SSL_F_SSL_CTRL 232 | 2184 | #define SSL_F_SSL_CTRL 232 |
1947 | #define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 | 2185 | #define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 |
2186 | #define SSL_F_SSL_CTX_MAKE_PROFILES 309 | ||
1948 | #define SSL_F_SSL_CTX_NEW 169 | 2187 | #define SSL_F_SSL_CTX_NEW 169 |
1949 | #define SSL_F_SSL_CTX_SET_CIPHER_LIST 269 | 2188 | #define SSL_F_SSL_CTX_SET_CIPHER_LIST 269 |
1950 | #define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290 | 2189 | #define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE 290 |
@@ -1973,8 +2212,10 @@ void ERR_load_SSL_strings(void); | |||
1973 | #define SSL_F_SSL_NEW 186 | 2212 | #define SSL_F_SSL_NEW 186 |
1974 | #define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300 | 2213 | #define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT 300 |
1975 | #define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302 | 2214 | #define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT 302 |
2215 | #define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT 310 | ||
1976 | #define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301 | 2216 | #define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT 301 |
1977 | #define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303 | 2217 | #define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT 303 |
2218 | #define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 | ||
1978 | #define SSL_F_SSL_PEEK 270 | 2219 | #define SSL_F_SSL_PEEK 270 |
1979 | #define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281 | 2220 | #define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT 281 |
1980 | #define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282 | 2221 | #define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT 282 |
@@ -1983,6 +2224,7 @@ void ERR_load_SSL_strings(void); | |||
1983 | #define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 | 2224 | #define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 |
1984 | #define SSL_F_SSL_SESSION_NEW 189 | 2225 | #define SSL_F_SSL_SESSION_NEW 189 |
1985 | #define SSL_F_SSL_SESSION_PRINT_FP 190 | 2226 | #define SSL_F_SSL_SESSION_PRINT_FP 190 |
2227 | #define SSL_F_SSL_SESSION_SET1_ID_CONTEXT 312 | ||
1986 | #define SSL_F_SSL_SESS_CERT_NEW 225 | 2228 | #define SSL_F_SSL_SESS_CERT_NEW 225 |
1987 | #define SSL_F_SSL_SET_CERT 191 | 2229 | #define SSL_F_SSL_SET_CERT 191 |
1988 | #define SSL_F_SSL_SET_CIPHER_LIST 271 | 2230 | #define SSL_F_SSL_SET_CIPHER_LIST 271 |
@@ -1996,6 +2238,7 @@ void ERR_load_SSL_strings(void); | |||
1996 | #define SSL_F_SSL_SET_TRUST 228 | 2238 | #define SSL_F_SSL_SET_TRUST 228 |
1997 | #define SSL_F_SSL_SET_WFD 196 | 2239 | #define SSL_F_SSL_SET_WFD 196 |
1998 | #define SSL_F_SSL_SHUTDOWN 224 | 2240 | #define SSL_F_SSL_SHUTDOWN 224 |
2241 | #define SSL_F_SSL_SRP_CTX_INIT 313 | ||
1999 | #define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 | 2242 | #define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 |
2000 | #define SSL_F_SSL_UNDEFINED_FUNCTION 197 | 2243 | #define SSL_F_SSL_UNDEFINED_FUNCTION 197 |
2001 | #define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 | 2244 | #define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 |
@@ -2015,6 +2258,8 @@ void ERR_load_SSL_strings(void); | |||
2015 | #define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 | 2258 | #define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 |
2016 | #define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274 | 2259 | #define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT 274 |
2017 | #define SSL_F_TLS1_ENC 210 | 2260 | #define SSL_F_TLS1_ENC 210 |
2261 | #define SSL_F_TLS1_EXPORT_KEYING_MATERIAL 314 | ||
2262 | #define SSL_F_TLS1_HEARTBEAT 315 | ||
2018 | #define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275 | 2263 | #define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT 275 |
2019 | #define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276 | 2264 | #define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT 276 |
2020 | #define SSL_F_TLS1_PRF 284 | 2265 | #define SSL_F_TLS1_PRF 284 |
@@ -2054,6 +2299,13 @@ void ERR_load_SSL_strings(void); | |||
2054 | #define SSL_R_BAD_RSA_MODULUS_LENGTH 121 | 2299 | #define SSL_R_BAD_RSA_MODULUS_LENGTH 121 |
2055 | #define SSL_R_BAD_RSA_SIGNATURE 122 | 2300 | #define SSL_R_BAD_RSA_SIGNATURE 122 |
2056 | #define SSL_R_BAD_SIGNATURE 123 | 2301 | #define SSL_R_BAD_SIGNATURE 123 |
2302 | #define SSL_R_BAD_SRP_A_LENGTH 347 | ||
2303 | #define SSL_R_BAD_SRP_B_LENGTH 348 | ||
2304 | #define SSL_R_BAD_SRP_G_LENGTH 349 | ||
2305 | #define SSL_R_BAD_SRP_N_LENGTH 350 | ||
2306 | #define SSL_R_BAD_SRP_S_LENGTH 351 | ||
2307 | #define SSL_R_BAD_SRTP_MKI_VALUE 352 | ||
2308 | #define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST 353 | ||
2057 | #define SSL_R_BAD_SSL_FILETYPE 124 | 2309 | #define SSL_R_BAD_SSL_FILETYPE 124 |
2058 | #define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 | 2310 | #define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 |
2059 | #define SSL_R_BAD_STATE 126 | 2311 | #define SSL_R_BAD_STATE 126 |
@@ -2092,12 +2344,15 @@ void ERR_load_SSL_strings(void); | |||
2092 | #define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322 | 2344 | #define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE 322 |
2093 | #define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323 | 2345 | #define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE 323 |
2094 | #define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310 | 2346 | #define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 310 |
2347 | #define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST 354 | ||
2095 | #define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 | 2348 | #define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 |
2096 | #define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282 | 2349 | #define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 282 |
2097 | #define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 | 2350 | #define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 |
2098 | #define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 | 2351 | #define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 |
2099 | #define SSL_R_EXTRA_DATA_IN_MESSAGE 153 | 2352 | #define SSL_R_EXTRA_DATA_IN_MESSAGE 153 |
2100 | #define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 | 2353 | #define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 |
2354 | #define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS 355 | ||
2355 | #define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION 356 | ||
2101 | #define SSL_R_HTTPS_PROXY_REQUEST 155 | 2356 | #define SSL_R_HTTPS_PROXY_REQUEST 155 |
2102 | #define SSL_R_HTTP_REQUEST 156 | 2357 | #define SSL_R_HTTP_REQUEST 156 |
2103 | #define SSL_R_ILLEGAL_PADDING 283 | 2358 | #define SSL_R_ILLEGAL_PADDING 283 |
@@ -2106,6 +2361,7 @@ void ERR_load_SSL_strings(void); | |||
2106 | #define SSL_R_INVALID_COMMAND 280 | 2361 | #define SSL_R_INVALID_COMMAND 280 |
2107 | #define SSL_R_INVALID_COMPRESSION_ALGORITHM 341 | 2362 | #define SSL_R_INVALID_COMPRESSION_ALGORITHM 341 |
2108 | #define SSL_R_INVALID_PURPOSE 278 | 2363 | #define SSL_R_INVALID_PURPOSE 278 |
2364 | #define SSL_R_INVALID_SRP_USERNAME 357 | ||
2109 | #define SSL_R_INVALID_STATUS_RESPONSE 328 | 2365 | #define SSL_R_INVALID_STATUS_RESPONSE 328 |
2110 | #define SSL_R_INVALID_TICKET_KEYS_LENGTH 325 | 2366 | #define SSL_R_INVALID_TICKET_KEYS_LENGTH 325 |
2111 | #define SSL_R_INVALID_TRUST 279 | 2367 | #define SSL_R_INVALID_TRUST 279 |
@@ -2135,6 +2391,7 @@ void ERR_load_SSL_strings(void); | |||
2135 | #define SSL_R_MISSING_RSA_CERTIFICATE 168 | 2391 | #define SSL_R_MISSING_RSA_CERTIFICATE 168 |
2136 | #define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 | 2392 | #define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 |
2137 | #define SSL_R_MISSING_RSA_SIGNING_CERT 170 | 2393 | #define SSL_R_MISSING_RSA_SIGNING_CERT 170 |
2394 | #define SSL_R_MISSING_SRP_PARAM 358 | ||
2138 | #define SSL_R_MISSING_TMP_DH_KEY 171 | 2395 | #define SSL_R_MISSING_TMP_DH_KEY 171 |
2139 | #define SSL_R_MISSING_TMP_ECDH_KEY 311 | 2396 | #define SSL_R_MISSING_TMP_ECDH_KEY 311 |
2140 | #define SSL_R_MISSING_TMP_RSA_KEY 172 | 2397 | #define SSL_R_MISSING_TMP_RSA_KEY 172 |
@@ -2164,6 +2421,7 @@ void ERR_load_SSL_strings(void); | |||
2164 | #define SSL_R_NO_RENEGOTIATION 339 | 2421 | #define SSL_R_NO_RENEGOTIATION 339 |
2165 | #define SSL_R_NO_REQUIRED_DIGEST 324 | 2422 | #define SSL_R_NO_REQUIRED_DIGEST 324 |
2166 | #define SSL_R_NO_SHARED_CIPHER 193 | 2423 | #define SSL_R_NO_SHARED_CIPHER 193 |
2424 | #define SSL_R_NO_SRTP_PROFILES 359 | ||
2167 | #define SSL_R_NO_VERIFY_CALLBACK 194 | 2425 | #define SSL_R_NO_VERIFY_CALLBACK 194 |
2168 | #define SSL_R_NULL_SSL_CTX 195 | 2426 | #define SSL_R_NULL_SSL_CTX 195 |
2169 | #define SSL_R_NULL_SSL_METHOD_PASSED 196 | 2427 | #define SSL_R_NULL_SSL_METHOD_PASSED 196 |
@@ -2207,7 +2465,12 @@ void ERR_load_SSL_strings(void); | |||
2207 | #define SSL_R_SERVERHELLO_TLSEXT 275 | 2465 | #define SSL_R_SERVERHELLO_TLSEXT 275 |
2208 | #define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 | 2466 | #define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 |
2209 | #define SSL_R_SHORT_READ 219 | 2467 | #define SSL_R_SHORT_READ 219 |
2468 | #define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 | ||
2210 | #define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 | 2469 | #define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 |
2470 | #define SSL_R_SRP_A_CALC 361 | ||
2471 | #define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES 362 | ||
2472 | #define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG 363 | ||
2473 | #define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE 364 | ||
2211 | #define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 | 2474 | #define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 |
2212 | #define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 | 2475 | #define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 299 |
2213 | #define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321 | 2476 | #define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT 321 |
@@ -2252,6 +2515,9 @@ void ERR_load_SSL_strings(void); | |||
2252 | #define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 | 2515 | #define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112 |
2253 | #define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 | 2516 | #define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110 |
2254 | #define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 | 2517 | #define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 |
2518 | #define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT 365 | ||
2519 | #define SSL_R_TLS_HEARTBEAT_PENDING 366 | ||
2520 | #define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL 367 | ||
2255 | #define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 | 2521 | #define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 |
2256 | #define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 | 2522 | #define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 |
2257 | #define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 | 2523 | #define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 |
@@ -2273,6 +2539,7 @@ void ERR_load_SSL_strings(void); | |||
2273 | #define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 | 2539 | #define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 |
2274 | #define SSL_R_UNKNOWN_CIPHER_RETURNED 248 | 2540 | #define SSL_R_UNKNOWN_CIPHER_RETURNED 248 |
2275 | #define SSL_R_UNKNOWN_CIPHER_TYPE 249 | 2541 | #define SSL_R_UNKNOWN_CIPHER_TYPE 249 |
2542 | #define SSL_R_UNKNOWN_DIGEST 368 | ||
2276 | #define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 | 2543 | #define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 |
2277 | #define SSL_R_UNKNOWN_PKEY_TYPE 251 | 2544 | #define SSL_R_UNKNOWN_PKEY_TYPE 251 |
2278 | #define SSL_R_UNKNOWN_PROTOCOL 252 | 2545 | #define SSL_R_UNKNOWN_PROTOCOL 252 |
@@ -2287,12 +2554,14 @@ void ERR_load_SSL_strings(void); | |||
2287 | #define SSL_R_UNSUPPORTED_PROTOCOL 258 | 2554 | #define SSL_R_UNSUPPORTED_PROTOCOL 258 |
2288 | #define SSL_R_UNSUPPORTED_SSL_VERSION 259 | 2555 | #define SSL_R_UNSUPPORTED_SSL_VERSION 259 |
2289 | #define SSL_R_UNSUPPORTED_STATUS_TYPE 329 | 2556 | #define SSL_R_UNSUPPORTED_STATUS_TYPE 329 |
2557 | #define SSL_R_USE_SRTP_NOT_NEGOTIATED 369 | ||
2290 | #define SSL_R_WRITE_BIO_NOT_SET 260 | 2558 | #define SSL_R_WRITE_BIO_NOT_SET 260 |
2291 | #define SSL_R_WRONG_CIPHER_RETURNED 261 | 2559 | #define SSL_R_WRONG_CIPHER_RETURNED 261 |
2292 | #define SSL_R_WRONG_MESSAGE_TYPE 262 | 2560 | #define SSL_R_WRONG_MESSAGE_TYPE 262 |
2293 | #define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 | 2561 | #define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 |
2294 | #define SSL_R_WRONG_SIGNATURE_LENGTH 264 | 2562 | #define SSL_R_WRONG_SIGNATURE_LENGTH 264 |
2295 | #define SSL_R_WRONG_SIGNATURE_SIZE 265 | 2563 | #define SSL_R_WRONG_SIGNATURE_SIZE 265 |
2564 | #define SSL_R_WRONG_SIGNATURE_TYPE 370 | ||
2296 | #define SSL_R_WRONG_SSL_VERSION 266 | 2565 | #define SSL_R_WRONG_SSL_VERSION 266 |
2297 | #define SSL_R_WRONG_VERSION_NUMBER 267 | 2566 | #define SSL_R_WRONG_VERSION_NUMBER 267 |
2298 | #define SSL_R_X509_LIB 268 | 2567 | #define SSL_R_X509_LIB 268 |
diff --git a/src/lib/libssl/src/ssl/ssl2.h b/src/lib/libssl/src/ssl/ssl2.h index 99a52ea0dd..eb25dcb0bf 100644 --- a/src/lib/libssl/src/ssl/ssl2.h +++ b/src/lib/libssl/src/ssl/ssl2.h | |||
@@ -155,6 +155,8 @@ extern "C" { | |||
155 | #define CERT char | 155 | #define CERT char |
156 | #endif | 156 | #endif |
157 | 157 | ||
158 | #ifndef OPENSSL_NO_SSL_INTERN | ||
159 | |||
158 | typedef struct ssl2_state_st | 160 | typedef struct ssl2_state_st |
159 | { | 161 | { |
160 | int three_byte_header; | 162 | int three_byte_header; |
@@ -219,6 +221,8 @@ typedef struct ssl2_state_st | |||
219 | } tmp; | 221 | } tmp; |
220 | } SSL2_STATE; | 222 | } SSL2_STATE; |
221 | 223 | ||
224 | #endif | ||
225 | |||
222 | /* SSLv2 */ | 226 | /* SSLv2 */ |
223 | /* client */ | 227 | /* client */ |
224 | #define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT) | 228 | #define SSL2_ST_SEND_CLIENT_HELLO_A (0x10|SSL_ST_CONNECT) |
diff --git a/src/lib/libssl/src/ssl/ssl3.h b/src/lib/libssl/src/ssl/ssl3.h index 9c2c41287a..112e627de0 100644 --- a/src/lib/libssl/src/ssl/ssl3.h +++ b/src/lib/libssl/src/ssl/ssl3.h | |||
@@ -322,6 +322,7 @@ extern "C" { | |||
322 | #define SSL3_RT_ALERT 21 | 322 | #define SSL3_RT_ALERT 21 |
323 | #define SSL3_RT_HANDSHAKE 22 | 323 | #define SSL3_RT_HANDSHAKE 22 |
324 | #define SSL3_RT_APPLICATION_DATA 23 | 324 | #define SSL3_RT_APPLICATION_DATA 23 |
325 | #define TLS1_RT_HEARTBEAT 24 | ||
325 | 326 | ||
326 | #define SSL3_AL_WARNING 1 | 327 | #define SSL3_AL_WARNING 1 |
327 | #define SSL3_AL_FATAL 2 | 328 | #define SSL3_AL_FATAL 2 |
@@ -339,6 +340,11 @@ extern "C" { | |||
339 | #define SSL3_AD_CERTIFICATE_UNKNOWN 46 | 340 | #define SSL3_AD_CERTIFICATE_UNKNOWN 46 |
340 | #define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */ | 341 | #define SSL3_AD_ILLEGAL_PARAMETER 47 /* fatal */ |
341 | 342 | ||
343 | #define TLS1_HB_REQUEST 1 | ||
344 | #define TLS1_HB_RESPONSE 2 | ||
345 | |||
346 | #ifndef OPENSSL_NO_SSL_INTERN | ||
347 | |||
342 | typedef struct ssl3_record_st | 348 | typedef struct ssl3_record_st |
343 | { | 349 | { |
344 | /*r */ int type; /* type of record */ | 350 | /*r */ int type; /* type of record */ |
@@ -360,6 +366,8 @@ typedef struct ssl3_buffer_st | |||
360 | int left; /* how many bytes left */ | 366 | int left; /* how many bytes left */ |
361 | } SSL3_BUFFER; | 367 | } SSL3_BUFFER; |
362 | 368 | ||
369 | #endif | ||
370 | |||
363 | #define SSL3_CT_RSA_SIGN 1 | 371 | #define SSL3_CT_RSA_SIGN 1 |
364 | #define SSL3_CT_DSS_SIGN 2 | 372 | #define SSL3_CT_DSS_SIGN 2 |
365 | #define SSL3_CT_RSA_FIXED_DH 3 | 373 | #define SSL3_CT_RSA_FIXED_DH 3 |
@@ -379,6 +387,7 @@ typedef struct ssl3_buffer_st | |||
379 | #define SSL3_FLAGS_POP_BUFFER 0x0004 | 387 | #define SSL3_FLAGS_POP_BUFFER 0x0004 |
380 | #define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 | 388 | #define TLS1_FLAGS_TLS_PADDING_BUG 0x0008 |
381 | #define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 | 389 | #define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 |
390 | #define TLS1_FLAGS_KEEP_HANDSHAKE 0x0020 | ||
382 | 391 | ||
383 | /* SSL3_FLAGS_SGC_RESTART_DONE is set when we | 392 | /* SSL3_FLAGS_SGC_RESTART_DONE is set when we |
384 | * restart a handshake because of MS SGC and so prevents us | 393 | * restart a handshake because of MS SGC and so prevents us |
@@ -391,6 +400,8 @@ typedef struct ssl3_buffer_st | |||
391 | */ | 400 | */ |
392 | #define SSL3_FLAGS_SGC_RESTART_DONE 0x0040 | 401 | #define SSL3_FLAGS_SGC_RESTART_DONE 0x0040 |
393 | 402 | ||
403 | #ifndef OPENSSL_NO_SSL_INTERN | ||
404 | |||
394 | typedef struct ssl3_state_st | 405 | typedef struct ssl3_state_st |
395 | { | 406 | { |
396 | long flags; | 407 | long flags; |
@@ -475,7 +486,7 @@ typedef struct ssl3_state_st | |||
475 | int finish_md_len; | 486 | int finish_md_len; |
476 | unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2]; | 487 | unsigned char peer_finish_md[EVP_MAX_MD_SIZE*2]; |
477 | int peer_finish_md_len; | 488 | int peer_finish_md_len; |
478 | 489 | ||
479 | unsigned long message_size; | 490 | unsigned long message_size; |
480 | int message_type; | 491 | int message_type; |
481 | 492 | ||
@@ -523,13 +534,23 @@ typedef struct ssl3_state_st | |||
523 | unsigned char previous_server_finished[EVP_MAX_MD_SIZE]; | 534 | unsigned char previous_server_finished[EVP_MAX_MD_SIZE]; |
524 | unsigned char previous_server_finished_len; | 535 | unsigned char previous_server_finished_len; |
525 | int send_connection_binding; /* TODOEKR */ | 536 | int send_connection_binding; /* TODOEKR */ |
537 | |||
538 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
539 | /* Set if we saw the Next Protocol Negotiation extension from our peer. */ | ||
540 | int next_proto_neg_seen; | ||
541 | #endif | ||
526 | } SSL3_STATE; | 542 | } SSL3_STATE; |
527 | 543 | ||
544 | #endif | ||
528 | 545 | ||
529 | /* SSLv3 */ | 546 | /* SSLv3 */ |
530 | /*client */ | 547 | /*client */ |
531 | /* extra state */ | 548 | /* extra state */ |
532 | #define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT) | 549 | #define SSL3_ST_CW_FLUSH (0x100|SSL_ST_CONNECT) |
550 | #ifndef OPENSSL_NO_SCTP | ||
551 | #define DTLS1_SCTP_ST_CW_WRITE_SOCK (0x310|SSL_ST_CONNECT) | ||
552 | #define DTLS1_SCTP_ST_CR_READ_SOCK (0x320|SSL_ST_CONNECT) | ||
553 | #endif | ||
533 | /* write to server */ | 554 | /* write to server */ |
534 | #define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT) | 555 | #define SSL3_ST_CW_CLNT_HELLO_A (0x110|SSL_ST_CONNECT) |
535 | #define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT) | 556 | #define SSL3_ST_CW_CLNT_HELLO_B (0x111|SSL_ST_CONNECT) |
@@ -557,6 +578,8 @@ typedef struct ssl3_state_st | |||
557 | #define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT) | 578 | #define SSL3_ST_CW_CERT_VRFY_B (0x191|SSL_ST_CONNECT) |
558 | #define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT) | 579 | #define SSL3_ST_CW_CHANGE_A (0x1A0|SSL_ST_CONNECT) |
559 | #define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT) | 580 | #define SSL3_ST_CW_CHANGE_B (0x1A1|SSL_ST_CONNECT) |
581 | #define SSL3_ST_CW_NEXT_PROTO_A (0x200|SSL_ST_CONNECT) | ||
582 | #define SSL3_ST_CW_NEXT_PROTO_B (0x201|SSL_ST_CONNECT) | ||
560 | #define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT) | 583 | #define SSL3_ST_CW_FINISHED_A (0x1B0|SSL_ST_CONNECT) |
561 | #define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT) | 584 | #define SSL3_ST_CW_FINISHED_B (0x1B1|SSL_ST_CONNECT) |
562 | /* read from server */ | 585 | /* read from server */ |
@@ -572,6 +595,10 @@ typedef struct ssl3_state_st | |||
572 | /* server */ | 595 | /* server */ |
573 | /* extra state */ | 596 | /* extra state */ |
574 | #define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT) | 597 | #define SSL3_ST_SW_FLUSH (0x100|SSL_ST_ACCEPT) |
598 | #ifndef OPENSSL_NO_SCTP | ||
599 | #define DTLS1_SCTP_ST_SW_WRITE_SOCK (0x310|SSL_ST_ACCEPT) | ||
600 | #define DTLS1_SCTP_ST_SR_READ_SOCK (0x320|SSL_ST_ACCEPT) | ||
601 | #endif | ||
575 | /* read from client */ | 602 | /* read from client */ |
576 | /* Do not change the number values, they do matter */ | 603 | /* Do not change the number values, they do matter */ |
577 | #define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT) | 604 | #define SSL3_ST_SR_CLNT_HELLO_A (0x110|SSL_ST_ACCEPT) |
@@ -602,6 +629,8 @@ typedef struct ssl3_state_st | |||
602 | #define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT) | 629 | #define SSL3_ST_SR_CERT_VRFY_B (0x1A1|SSL_ST_ACCEPT) |
603 | #define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT) | 630 | #define SSL3_ST_SR_CHANGE_A (0x1B0|SSL_ST_ACCEPT) |
604 | #define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT) | 631 | #define SSL3_ST_SR_CHANGE_B (0x1B1|SSL_ST_ACCEPT) |
632 | #define SSL3_ST_SR_NEXT_PROTO_A (0x210|SSL_ST_ACCEPT) | ||
633 | #define SSL3_ST_SR_NEXT_PROTO_B (0x211|SSL_ST_ACCEPT) | ||
605 | #define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT) | 634 | #define SSL3_ST_SR_FINISHED_A (0x1C0|SSL_ST_ACCEPT) |
606 | #define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT) | 635 | #define SSL3_ST_SR_FINISHED_B (0x1C1|SSL_ST_ACCEPT) |
607 | /* write to client */ | 636 | /* write to client */ |
@@ -626,6 +655,7 @@ typedef struct ssl3_state_st | |||
626 | #define SSL3_MT_CLIENT_KEY_EXCHANGE 16 | 655 | #define SSL3_MT_CLIENT_KEY_EXCHANGE 16 |
627 | #define SSL3_MT_FINISHED 20 | 656 | #define SSL3_MT_FINISHED 20 |
628 | #define SSL3_MT_CERTIFICATE_STATUS 22 | 657 | #define SSL3_MT_CERTIFICATE_STATUS 22 |
658 | #define SSL3_MT_NEXT_PROTO 67 | ||
629 | #define DTLS1_MT_HELLO_VERIFY_REQUEST 3 | 659 | #define DTLS1_MT_HELLO_VERIFY_REQUEST 3 |
630 | 660 | ||
631 | 661 | ||
diff --git a/src/lib/libssl/src/ssl/ssl_algs.c b/src/lib/libssl/src/ssl/ssl_algs.c index 0967b2dfe4..d443143c59 100644 --- a/src/lib/libssl/src/ssl/ssl_algs.c +++ b/src/lib/libssl/src/ssl/ssl_algs.c | |||
@@ -73,6 +73,9 @@ int SSL_library_init(void) | |||
73 | #endif | 73 | #endif |
74 | #ifndef OPENSSL_NO_RC4 | 74 | #ifndef OPENSSL_NO_RC4 |
75 | EVP_add_cipher(EVP_rc4()); | 75 | EVP_add_cipher(EVP_rc4()); |
76 | #if !defined(OPENSSL_NO_MD5) && (defined(__x86_64) || defined(__x86_64__)) | ||
77 | EVP_add_cipher(EVP_rc4_hmac_md5()); | ||
78 | #endif | ||
76 | #endif | 79 | #endif |
77 | #ifndef OPENSSL_NO_RC2 | 80 | #ifndef OPENSSL_NO_RC2 |
78 | EVP_add_cipher(EVP_rc2_cbc()); | 81 | EVP_add_cipher(EVP_rc2_cbc()); |
@@ -85,6 +88,12 @@ int SSL_library_init(void) | |||
85 | EVP_add_cipher(EVP_aes_128_cbc()); | 88 | EVP_add_cipher(EVP_aes_128_cbc()); |
86 | EVP_add_cipher(EVP_aes_192_cbc()); | 89 | EVP_add_cipher(EVP_aes_192_cbc()); |
87 | EVP_add_cipher(EVP_aes_256_cbc()); | 90 | EVP_add_cipher(EVP_aes_256_cbc()); |
91 | EVP_add_cipher(EVP_aes_128_gcm()); | ||
92 | EVP_add_cipher(EVP_aes_256_gcm()); | ||
93 | #if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1) | ||
94 | EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1()); | ||
95 | EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1()); | ||
96 | #endif | ||
88 | #endif | 97 | #endif |
89 | #ifndef OPENSSL_NO_CAMELLIA | 98 | #ifndef OPENSSL_NO_CAMELLIA |
90 | EVP_add_cipher(EVP_camellia_128_cbc()); | 99 | EVP_add_cipher(EVP_camellia_128_cbc()); |
diff --git a/src/lib/libssl/src/ssl/ssl_asn1.c b/src/lib/libssl/src/ssl/ssl_asn1.c index d7f4c6087e..38540be1e5 100644 --- a/src/lib/libssl/src/ssl/ssl_asn1.c +++ b/src/lib/libssl/src/ssl/ssl_asn1.c | |||
@@ -114,6 +114,9 @@ typedef struct ssl_session_asn1_st | |||
114 | ASN1_OCTET_STRING psk_identity_hint; | 114 | ASN1_OCTET_STRING psk_identity_hint; |
115 | ASN1_OCTET_STRING psk_identity; | 115 | ASN1_OCTET_STRING psk_identity; |
116 | #endif /* OPENSSL_NO_PSK */ | 116 | #endif /* OPENSSL_NO_PSK */ |
117 | #ifndef OPENSSL_NO_SRP | ||
118 | ASN1_OCTET_STRING srp_username; | ||
119 | #endif /* OPENSSL_NO_SRP */ | ||
117 | } SSL_SESSION_ASN1; | 120 | } SSL_SESSION_ASN1; |
118 | 121 | ||
119 | int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | 122 | int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) |
@@ -130,6 +133,9 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
130 | unsigned char cbuf; | 133 | unsigned char cbuf; |
131 | int v11=0; | 134 | int v11=0; |
132 | #endif | 135 | #endif |
136 | #ifndef OPENSSL_NO_SRP | ||
137 | int v12=0; | ||
138 | #endif | ||
133 | long l; | 139 | long l; |
134 | SSL_SESSION_ASN1 a; | 140 | SSL_SESSION_ASN1 a; |
135 | M_ASN1_I2D_vars(in); | 141 | M_ASN1_I2D_vars(in); |
@@ -267,6 +273,14 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
267 | a.psk_identity.data=(unsigned char *)(in->psk_identity); | 273 | a.psk_identity.data=(unsigned char *)(in->psk_identity); |
268 | } | 274 | } |
269 | #endif /* OPENSSL_NO_PSK */ | 275 | #endif /* OPENSSL_NO_PSK */ |
276 | #ifndef OPENSSL_NO_SRP | ||
277 | if (in->srp_username) | ||
278 | { | ||
279 | a.srp_username.length=strlen(in->srp_username); | ||
280 | a.srp_username.type=V_ASN1_OCTET_STRING; | ||
281 | a.srp_username.data=(unsigned char *)(in->srp_username); | ||
282 | } | ||
283 | #endif /* OPENSSL_NO_SRP */ | ||
270 | 284 | ||
271 | M_ASN1_I2D_len(&(a.version), i2d_ASN1_INTEGER); | 285 | M_ASN1_I2D_len(&(a.version), i2d_ASN1_INTEGER); |
272 | M_ASN1_I2D_len(&(a.ssl_version), i2d_ASN1_INTEGER); | 286 | M_ASN1_I2D_len(&(a.ssl_version), i2d_ASN1_INTEGER); |
@@ -307,6 +321,10 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
307 | if (in->psk_identity) | 321 | if (in->psk_identity) |
308 | M_ASN1_I2D_len_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING,8,v8); | 322 | M_ASN1_I2D_len_EXP_opt(&(a.psk_identity), i2d_ASN1_OCTET_STRING,8,v8); |
309 | #endif /* OPENSSL_NO_PSK */ | 323 | #endif /* OPENSSL_NO_PSK */ |
324 | #ifndef OPENSSL_NO_SRP | ||
325 | if (in->srp_username) | ||
326 | M_ASN1_I2D_len_EXP_opt(&(a.srp_username), i2d_ASN1_OCTET_STRING,12,v12); | ||
327 | #endif /* OPENSSL_NO_SRP */ | ||
310 | 328 | ||
311 | M_ASN1_I2D_seq_total(); | 329 | M_ASN1_I2D_seq_total(); |
312 | 330 | ||
@@ -351,6 +369,10 @@ int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) | |||
351 | if (in->compress_meth) | 369 | if (in->compress_meth) |
352 | M_ASN1_I2D_put_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING,11,v11); | 370 | M_ASN1_I2D_put_EXP_opt(&(a.comp_id), i2d_ASN1_OCTET_STRING,11,v11); |
353 | #endif | 371 | #endif |
372 | #ifndef OPENSSL_NO_SRP | ||
373 | if (in->srp_username) | ||
374 | M_ASN1_I2D_put_EXP_opt(&(a.srp_username), i2d_ASN1_OCTET_STRING,12,v12); | ||
375 | #endif /* OPENSSL_NO_SRP */ | ||
354 | M_ASN1_I2D_finish(); | 376 | M_ASN1_I2D_finish(); |
355 | } | 377 | } |
356 | 378 | ||
@@ -549,6 +571,19 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, | |||
549 | } | 571 | } |
550 | else | 572 | else |
551 | ret->psk_identity_hint=NULL; | 573 | ret->psk_identity_hint=NULL; |
574 | |||
575 | os.length=0; | ||
576 | os.data=NULL; | ||
577 | M_ASN1_D2I_get_EXP_opt(osp,d2i_ASN1_OCTET_STRING,8); | ||
578 | if (os.data) | ||
579 | { | ||
580 | ret->psk_identity = BUF_strndup((char *)os.data, os.length); | ||
581 | OPENSSL_free(os.data); | ||
582 | os.data = NULL; | ||
583 | os.length = 0; | ||
584 | } | ||
585 | else | ||
586 | ret->psk_identity=NULL; | ||
552 | #endif /* OPENSSL_NO_PSK */ | 587 | #endif /* OPENSSL_NO_PSK */ |
553 | 588 | ||
554 | #ifndef OPENSSL_NO_TLSEXT | 589 | #ifndef OPENSSL_NO_TLSEXT |
@@ -588,5 +623,20 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, | |||
588 | } | 623 | } |
589 | #endif | 624 | #endif |
590 | 625 | ||
626 | #ifndef OPENSSL_NO_SRP | ||
627 | os.length=0; | ||
628 | os.data=NULL; | ||
629 | M_ASN1_D2I_get_EXP_opt(osp,d2i_ASN1_OCTET_STRING,12); | ||
630 | if (os.data) | ||
631 | { | ||
632 | ret->srp_username = BUF_strndup((char *)os.data, os.length); | ||
633 | OPENSSL_free(os.data); | ||
634 | os.data = NULL; | ||
635 | os.length = 0; | ||
636 | } | ||
637 | else | ||
638 | ret->srp_username=NULL; | ||
639 | #endif /* OPENSSL_NO_SRP */ | ||
640 | |||
591 | M_ASN1_D2I_Finish(a,SSL_SESSION_free,SSL_F_D2I_SSL_SESSION); | 641 | M_ASN1_D2I_Finish(a,SSL_SESSION_free,SSL_F_D2I_SSL_SESSION); |
592 | } | 642 | } |
diff --git a/src/lib/libssl/src/ssl/ssl_cert.c b/src/lib/libssl/src/ssl/ssl_cert.c index 27256eea81..917be31876 100644 --- a/src/lib/libssl/src/ssl/ssl_cert.c +++ b/src/lib/libssl/src/ssl/ssl_cert.c | |||
@@ -160,6 +160,21 @@ int SSL_get_ex_data_X509_STORE_CTX_idx(void) | |||
160 | return ssl_x509_store_ctx_idx; | 160 | return ssl_x509_store_ctx_idx; |
161 | } | 161 | } |
162 | 162 | ||
163 | static void ssl_cert_set_default_md(CERT *cert) | ||
164 | { | ||
165 | /* Set digest values to defaults */ | ||
166 | #ifndef OPENSSL_NO_DSA | ||
167 | cert->pkeys[SSL_PKEY_DSA_SIGN].digest = EVP_dss1(); | ||
168 | #endif | ||
169 | #ifndef OPENSSL_NO_RSA | ||
170 | cert->pkeys[SSL_PKEY_RSA_SIGN].digest = EVP_sha1(); | ||
171 | cert->pkeys[SSL_PKEY_RSA_ENC].digest = EVP_sha1(); | ||
172 | #endif | ||
173 | #ifndef OPENSSL_NO_ECDSA | ||
174 | cert->pkeys[SSL_PKEY_ECC].digest = EVP_ecdsa(); | ||
175 | #endif | ||
176 | } | ||
177 | |||
163 | CERT *ssl_cert_new(void) | 178 | CERT *ssl_cert_new(void) |
164 | { | 179 | { |
165 | CERT *ret; | 180 | CERT *ret; |
@@ -174,7 +189,7 @@ CERT *ssl_cert_new(void) | |||
174 | 189 | ||
175 | ret->key= &(ret->pkeys[SSL_PKEY_RSA_ENC]); | 190 | ret->key= &(ret->pkeys[SSL_PKEY_RSA_ENC]); |
176 | ret->references=1; | 191 | ret->references=1; |
177 | 192 | ssl_cert_set_default_md(ret); | |
178 | return(ret); | 193 | return(ret); |
179 | } | 194 | } |
180 | 195 | ||
@@ -307,6 +322,10 @@ CERT *ssl_cert_dup(CERT *cert) | |||
307 | * chain is held inside SSL_CTX */ | 322 | * chain is held inside SSL_CTX */ |
308 | 323 | ||
309 | ret->references=1; | 324 | ret->references=1; |
325 | /* Set digests to defaults. NB: we don't copy existing values as they | ||
326 | * will be set during handshake. | ||
327 | */ | ||
328 | ssl_cert_set_default_md(ret); | ||
310 | 329 | ||
311 | return(ret); | 330 | return(ret); |
312 | 331 | ||
diff --git a/src/lib/libssl/src/ssl/ssl_ciph.c b/src/lib/libssl/src/ssl/ssl_ciph.c index 54ba7ef5b4..92d1e94d6a 100644 --- a/src/lib/libssl/src/ssl/ssl_ciph.c +++ b/src/lib/libssl/src/ssl/ssl_ciph.c | |||
@@ -162,11 +162,13 @@ | |||
162 | #define SSL_ENC_CAMELLIA256_IDX 9 | 162 | #define SSL_ENC_CAMELLIA256_IDX 9 |
163 | #define SSL_ENC_GOST89_IDX 10 | 163 | #define SSL_ENC_GOST89_IDX 10 |
164 | #define SSL_ENC_SEED_IDX 11 | 164 | #define SSL_ENC_SEED_IDX 11 |
165 | #define SSL_ENC_NUM_IDX 12 | 165 | #define SSL_ENC_AES128GCM_IDX 12 |
166 | #define SSL_ENC_AES256GCM_IDX 13 | ||
167 | #define SSL_ENC_NUM_IDX 14 | ||
166 | 168 | ||
167 | 169 | ||
168 | static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]={ | 170 | static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX]={ |
169 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, | 171 | NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL |
170 | }; | 172 | }; |
171 | 173 | ||
172 | #define SSL_COMP_NULL_IDX 0 | 174 | #define SSL_COMP_NULL_IDX 0 |
@@ -179,28 +181,32 @@ static STACK_OF(SSL_COMP) *ssl_comp_methods=NULL; | |||
179 | #define SSL_MD_SHA1_IDX 1 | 181 | #define SSL_MD_SHA1_IDX 1 |
180 | #define SSL_MD_GOST94_IDX 2 | 182 | #define SSL_MD_GOST94_IDX 2 |
181 | #define SSL_MD_GOST89MAC_IDX 3 | 183 | #define SSL_MD_GOST89MAC_IDX 3 |
184 | #define SSL_MD_SHA256_IDX 4 | ||
185 | #define SSL_MD_SHA384_IDX 5 | ||
182 | /*Constant SSL_MAX_DIGEST equal to size of digests array should be | 186 | /*Constant SSL_MAX_DIGEST equal to size of digests array should be |
183 | * defined in the | 187 | * defined in the |
184 | * ssl_locl.h */ | 188 | * ssl_locl.h */ |
185 | #define SSL_MD_NUM_IDX SSL_MAX_DIGEST | 189 | #define SSL_MD_NUM_IDX SSL_MAX_DIGEST |
186 | static const EVP_MD *ssl_digest_methods[SSL_MD_NUM_IDX]={ | 190 | static const EVP_MD *ssl_digest_methods[SSL_MD_NUM_IDX]={ |
187 | NULL,NULL,NULL,NULL | 191 | NULL,NULL,NULL,NULL,NULL,NULL |
188 | }; | 192 | }; |
189 | /* PKEY_TYPE for GOST89MAC is known in advance, but, because | 193 | /* PKEY_TYPE for GOST89MAC is known in advance, but, because |
190 | * implementation is engine-provided, we'll fill it only if | 194 | * implementation is engine-provided, we'll fill it only if |
191 | * corresponding EVP_PKEY_METHOD is found | 195 | * corresponding EVP_PKEY_METHOD is found |
192 | */ | 196 | */ |
193 | static int ssl_mac_pkey_id[SSL_MD_NUM_IDX]={ | 197 | static int ssl_mac_pkey_id[SSL_MD_NUM_IDX]={ |
194 | EVP_PKEY_HMAC,EVP_PKEY_HMAC,EVP_PKEY_HMAC,NID_undef | 198 | EVP_PKEY_HMAC,EVP_PKEY_HMAC,EVP_PKEY_HMAC,NID_undef, |
199 | EVP_PKEY_HMAC,EVP_PKEY_HMAC | ||
195 | }; | 200 | }; |
196 | 201 | ||
197 | static int ssl_mac_secret_size[SSL_MD_NUM_IDX]={ | 202 | static int ssl_mac_secret_size[SSL_MD_NUM_IDX]={ |
198 | 0,0,0,0 | 203 | 0,0,0,0,0,0 |
199 | }; | 204 | }; |
200 | 205 | ||
201 | static int ssl_handshake_digest_flag[SSL_MD_NUM_IDX]={ | 206 | static int ssl_handshake_digest_flag[SSL_MD_NUM_IDX]={ |
202 | SSL_HANDSHAKE_MAC_MD5,SSL_HANDSHAKE_MAC_SHA, | 207 | SSL_HANDSHAKE_MAC_MD5,SSL_HANDSHAKE_MAC_SHA, |
203 | SSL_HANDSHAKE_MAC_GOST94,0 | 208 | SSL_HANDSHAKE_MAC_GOST94, 0, SSL_HANDSHAKE_MAC_SHA256, |
209 | SSL_HANDSHAKE_MAC_SHA384 | ||
204 | }; | 210 | }; |
205 | 211 | ||
206 | #define CIPHER_ADD 1 | 212 | #define CIPHER_ADD 1 |
@@ -247,6 +253,7 @@ static const SSL_CIPHER cipher_aliases[]={ | |||
247 | {0,SSL_TXT_ECDH,0, SSL_kECDHr|SSL_kECDHe|SSL_kEECDH,0,0,0,0,0,0,0,0}, | 253 | {0,SSL_TXT_ECDH,0, SSL_kECDHr|SSL_kECDHe|SSL_kEECDH,0,0,0,0,0,0,0,0}, |
248 | 254 | ||
249 | {0,SSL_TXT_kPSK,0, SSL_kPSK, 0,0,0,0,0,0,0,0}, | 255 | {0,SSL_TXT_kPSK,0, SSL_kPSK, 0,0,0,0,0,0,0,0}, |
256 | {0,SSL_TXT_kSRP,0, SSL_kSRP, 0,0,0,0,0,0,0,0}, | ||
250 | {0,SSL_TXT_kGOST,0, SSL_kGOST,0,0,0,0,0,0,0,0}, | 257 | {0,SSL_TXT_kGOST,0, SSL_kGOST,0,0,0,0,0,0,0,0}, |
251 | 258 | ||
252 | /* server authentication aliases */ | 259 | /* server authentication aliases */ |
@@ -273,6 +280,7 @@ static const SSL_CIPHER cipher_aliases[]={ | |||
273 | {0,SSL_TXT_ADH,0, SSL_kEDH,SSL_aNULL,0,0,0,0,0,0,0}, | 280 | {0,SSL_TXT_ADH,0, SSL_kEDH,SSL_aNULL,0,0,0,0,0,0,0}, |
274 | {0,SSL_TXT_AECDH,0, SSL_kEECDH,SSL_aNULL,0,0,0,0,0,0,0}, | 281 | {0,SSL_TXT_AECDH,0, SSL_kEECDH,SSL_aNULL,0,0,0,0,0,0,0}, |
275 | {0,SSL_TXT_PSK,0, SSL_kPSK,SSL_aPSK,0,0,0,0,0,0,0}, | 282 | {0,SSL_TXT_PSK,0, SSL_kPSK,SSL_aPSK,0,0,0,0,0,0,0}, |
283 | {0,SSL_TXT_SRP,0, SSL_kSRP,0,0,0,0,0,0,0,0}, | ||
276 | 284 | ||
277 | 285 | ||
278 | /* symmetric encryption aliases */ | 286 | /* symmetric encryption aliases */ |
@@ -283,9 +291,10 @@ static const SSL_CIPHER cipher_aliases[]={ | |||
283 | {0,SSL_TXT_IDEA,0, 0,0,SSL_IDEA, 0,0,0,0,0,0}, | 291 | {0,SSL_TXT_IDEA,0, 0,0,SSL_IDEA, 0,0,0,0,0,0}, |
284 | {0,SSL_TXT_SEED,0, 0,0,SSL_SEED, 0,0,0,0,0,0}, | 292 | {0,SSL_TXT_SEED,0, 0,0,SSL_SEED, 0,0,0,0,0,0}, |
285 | {0,SSL_TXT_eNULL,0, 0,0,SSL_eNULL, 0,0,0,0,0,0}, | 293 | {0,SSL_TXT_eNULL,0, 0,0,SSL_eNULL, 0,0,0,0,0,0}, |
286 | {0,SSL_TXT_AES128,0, 0,0,SSL_AES128,0,0,0,0,0,0}, | 294 | {0,SSL_TXT_AES128,0, 0,0,SSL_AES128|SSL_AES128GCM,0,0,0,0,0,0}, |
287 | {0,SSL_TXT_AES256,0, 0,0,SSL_AES256,0,0,0,0,0,0}, | 295 | {0,SSL_TXT_AES256,0, 0,0,SSL_AES256|SSL_AES256GCM,0,0,0,0,0,0}, |
288 | {0,SSL_TXT_AES,0, 0,0,SSL_AES128|SSL_AES256,0,0,0,0,0,0}, | 296 | {0,SSL_TXT_AES,0, 0,0,SSL_AES,0,0,0,0,0,0}, |
297 | {0,SSL_TXT_AES_GCM,0, 0,0,SSL_AES128GCM|SSL_AES256GCM,0,0,0,0,0,0}, | ||
289 | {0,SSL_TXT_CAMELLIA128,0,0,0,SSL_CAMELLIA128,0,0,0,0,0,0}, | 298 | {0,SSL_TXT_CAMELLIA128,0,0,0,SSL_CAMELLIA128,0,0,0,0,0,0}, |
290 | {0,SSL_TXT_CAMELLIA256,0,0,0,SSL_CAMELLIA256,0,0,0,0,0,0}, | 299 | {0,SSL_TXT_CAMELLIA256,0,0,0,SSL_CAMELLIA256,0,0,0,0,0,0}, |
291 | {0,SSL_TXT_CAMELLIA ,0,0,0,SSL_CAMELLIA128|SSL_CAMELLIA256,0,0,0,0,0,0}, | 300 | {0,SSL_TXT_CAMELLIA ,0,0,0,SSL_CAMELLIA128|SSL_CAMELLIA256,0,0,0,0,0,0}, |
@@ -296,6 +305,8 @@ static const SSL_CIPHER cipher_aliases[]={ | |||
296 | {0,SSL_TXT_SHA,0, 0,0,0,SSL_SHA1, 0,0,0,0,0}, | 305 | {0,SSL_TXT_SHA,0, 0,0,0,SSL_SHA1, 0,0,0,0,0}, |
297 | {0,SSL_TXT_GOST94,0, 0,0,0,SSL_GOST94, 0,0,0,0,0}, | 306 | {0,SSL_TXT_GOST94,0, 0,0,0,SSL_GOST94, 0,0,0,0,0}, |
298 | {0,SSL_TXT_GOST89MAC,0, 0,0,0,SSL_GOST89MAC, 0,0,0,0,0}, | 307 | {0,SSL_TXT_GOST89MAC,0, 0,0,0,SSL_GOST89MAC, 0,0,0,0,0}, |
308 | {0,SSL_TXT_SHA256,0, 0,0,0,SSL_SHA256, 0,0,0,0,0}, | ||
309 | {0,SSL_TXT_SHA384,0, 0,0,0,SSL_SHA384, 0,0,0,0,0}, | ||
299 | 310 | ||
300 | /* protocol version aliases */ | 311 | /* protocol version aliases */ |
301 | {0,SSL_TXT_SSLV2,0, 0,0,0,0,SSL_SSLV2, 0,0,0,0}, | 312 | {0,SSL_TXT_SSLV2,0, 0,0,0,0,SSL_SSLV2, 0,0,0,0}, |
@@ -379,6 +390,11 @@ void ssl_load_ciphers(void) | |||
379 | ssl_cipher_methods[SSL_ENC_SEED_IDX]= | 390 | ssl_cipher_methods[SSL_ENC_SEED_IDX]= |
380 | EVP_get_cipherbyname(SN_seed_cbc); | 391 | EVP_get_cipherbyname(SN_seed_cbc); |
381 | 392 | ||
393 | ssl_cipher_methods[SSL_ENC_AES128GCM_IDX]= | ||
394 | EVP_get_cipherbyname(SN_aes_128_gcm); | ||
395 | ssl_cipher_methods[SSL_ENC_AES256GCM_IDX]= | ||
396 | EVP_get_cipherbyname(SN_aes_256_gcm); | ||
397 | |||
382 | ssl_digest_methods[SSL_MD_MD5_IDX]= | 398 | ssl_digest_methods[SSL_MD_MD5_IDX]= |
383 | EVP_get_digestbyname(SN_md5); | 399 | EVP_get_digestbyname(SN_md5); |
384 | ssl_mac_secret_size[SSL_MD_MD5_IDX]= | 400 | ssl_mac_secret_size[SSL_MD_MD5_IDX]= |
@@ -404,6 +420,14 @@ void ssl_load_ciphers(void) | |||
404 | ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX]=32; | 420 | ssl_mac_secret_size[SSL_MD_GOST89MAC_IDX]=32; |
405 | } | 421 | } |
406 | 422 | ||
423 | ssl_digest_methods[SSL_MD_SHA256_IDX]= | ||
424 | EVP_get_digestbyname(SN_sha256); | ||
425 | ssl_mac_secret_size[SSL_MD_SHA256_IDX]= | ||
426 | EVP_MD_size(ssl_digest_methods[SSL_MD_SHA256_IDX]); | ||
427 | ssl_digest_methods[SSL_MD_SHA384_IDX]= | ||
428 | EVP_get_digestbyname(SN_sha384); | ||
429 | ssl_mac_secret_size[SSL_MD_SHA384_IDX]= | ||
430 | EVP_MD_size(ssl_digest_methods[SSL_MD_SHA384_IDX]); | ||
407 | } | 431 | } |
408 | #ifndef OPENSSL_NO_COMP | 432 | #ifndef OPENSSL_NO_COMP |
409 | 433 | ||
@@ -526,6 +550,12 @@ int ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc, | |||
526 | case SSL_SEED: | 550 | case SSL_SEED: |
527 | i=SSL_ENC_SEED_IDX; | 551 | i=SSL_ENC_SEED_IDX; |
528 | break; | 552 | break; |
553 | case SSL_AES128GCM: | ||
554 | i=SSL_ENC_AES128GCM_IDX; | ||
555 | break; | ||
556 | case SSL_AES256GCM: | ||
557 | i=SSL_ENC_AES256GCM_IDX; | ||
558 | break; | ||
529 | default: | 559 | default: |
530 | i= -1; | 560 | i= -1; |
531 | break; | 561 | break; |
@@ -549,6 +579,12 @@ int ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc, | |||
549 | case SSL_SHA1: | 579 | case SSL_SHA1: |
550 | i=SSL_MD_SHA1_IDX; | 580 | i=SSL_MD_SHA1_IDX; |
551 | break; | 581 | break; |
582 | case SSL_SHA256: | ||
583 | i=SSL_MD_SHA256_IDX; | ||
584 | break; | ||
585 | case SSL_SHA384: | ||
586 | i=SSL_MD_SHA384_IDX; | ||
587 | break; | ||
552 | case SSL_GOST94: | 588 | case SSL_GOST94: |
553 | i = SSL_MD_GOST94_IDX; | 589 | i = SSL_MD_GOST94_IDX; |
554 | break; | 590 | break; |
@@ -564,17 +600,45 @@ int ssl_cipher_get_evp(const SSL_SESSION *s, const EVP_CIPHER **enc, | |||
564 | *md=NULL; | 600 | *md=NULL; |
565 | if (mac_pkey_type!=NULL) *mac_pkey_type = NID_undef; | 601 | if (mac_pkey_type!=NULL) *mac_pkey_type = NID_undef; |
566 | if (mac_secret_size!=NULL) *mac_secret_size = 0; | 602 | if (mac_secret_size!=NULL) *mac_secret_size = 0; |
567 | 603 | if (c->algorithm_mac == SSL_AEAD) | |
604 | mac_pkey_type = NULL; | ||
568 | } | 605 | } |
569 | else | 606 | else |
570 | { | 607 | { |
571 | *md=ssl_digest_methods[i]; | 608 | *md=ssl_digest_methods[i]; |
572 | if (mac_pkey_type!=NULL) *mac_pkey_type = ssl_mac_pkey_id[i]; | 609 | if (mac_pkey_type!=NULL) *mac_pkey_type = ssl_mac_pkey_id[i]; |
573 | if (mac_secret_size!=NULL) *mac_secret_size = ssl_mac_secret_size[i]; | 610 | if (mac_secret_size!=NULL) *mac_secret_size = ssl_mac_secret_size[i]; |
574 | } | 611 | } |
612 | |||
613 | if ((*enc != NULL) && | ||
614 | (*md != NULL || (EVP_CIPHER_flags(*enc)&EVP_CIPH_FLAG_AEAD_CIPHER)) && | ||
615 | (!mac_pkey_type||*mac_pkey_type != NID_undef)) | ||
616 | { | ||
617 | const EVP_CIPHER *evp; | ||
618 | |||
619 | if (s->ssl_version>>8 != TLS1_VERSION_MAJOR || | ||
620 | s->ssl_version < TLS1_VERSION) | ||
621 | return 1; | ||
575 | 622 | ||
576 | if ((*enc != NULL) && (*md != NULL) && (!mac_pkey_type||*mac_pkey_type != NID_undef)) | 623 | #ifdef OPENSSL_FIPS |
624 | if (FIPS_mode()) | ||
625 | return 1; | ||
626 | #endif | ||
627 | |||
628 | if (c->algorithm_enc == SSL_RC4 && | ||
629 | c->algorithm_mac == SSL_MD5 && | ||
630 | (evp=EVP_get_cipherbyname("RC4-HMAC-MD5"))) | ||
631 | *enc = evp, *md = NULL; | ||
632 | else if (c->algorithm_enc == SSL_AES128 && | ||
633 | c->algorithm_mac == SSL_SHA1 && | ||
634 | (evp=EVP_get_cipherbyname("AES-128-CBC-HMAC-SHA1"))) | ||
635 | *enc = evp, *md = NULL; | ||
636 | else if (c->algorithm_enc == SSL_AES256 && | ||
637 | c->algorithm_mac == SSL_SHA1 && | ||
638 | (evp=EVP_get_cipherbyname("AES-256-CBC-HMAC-SHA1"))) | ||
639 | *enc = evp, *md = NULL; | ||
577 | return(1); | 640 | return(1); |
641 | } | ||
578 | else | 642 | else |
579 | return(0); | 643 | return(0); |
580 | } | 644 | } |
@@ -585,9 +649,11 @@ int ssl_get_handshake_digest(int idx, long *mask, const EVP_MD **md) | |||
585 | { | 649 | { |
586 | return 0; | 650 | return 0; |
587 | } | 651 | } |
588 | if (ssl_handshake_digest_flag[idx]==0) return 0; | ||
589 | *mask = ssl_handshake_digest_flag[idx]; | 652 | *mask = ssl_handshake_digest_flag[idx]; |
590 | *md = ssl_digest_methods[idx]; | 653 | if (*mask) |
654 | *md = ssl_digest_methods[idx]; | ||
655 | else | ||
656 | *md = NULL; | ||
591 | return 1; | 657 | return 1; |
592 | } | 658 | } |
593 | 659 | ||
@@ -662,6 +728,9 @@ static void ssl_cipher_get_disabled(unsigned long *mkey, unsigned long *auth, un | |||
662 | *mkey |= SSL_kPSK; | 728 | *mkey |= SSL_kPSK; |
663 | *auth |= SSL_aPSK; | 729 | *auth |= SSL_aPSK; |
664 | #endif | 730 | #endif |
731 | #ifdef OPENSSL_NO_SRP | ||
732 | *mkey |= SSL_kSRP; | ||
733 | #endif | ||
665 | /* Check for presence of GOST 34.10 algorithms, and if they | 734 | /* Check for presence of GOST 34.10 algorithms, and if they |
666 | * do not present, disable appropriate auth and key exchange */ | 735 | * do not present, disable appropriate auth and key exchange */ |
667 | if (!get_optional_pkey_id("gost94")) { | 736 | if (!get_optional_pkey_id("gost94")) { |
@@ -687,6 +756,8 @@ static void ssl_cipher_get_disabled(unsigned long *mkey, unsigned long *auth, un | |||
687 | *enc |= (ssl_cipher_methods[SSL_ENC_IDEA_IDX] == NULL) ? SSL_IDEA:0; | 756 | *enc |= (ssl_cipher_methods[SSL_ENC_IDEA_IDX] == NULL) ? SSL_IDEA:0; |
688 | *enc |= (ssl_cipher_methods[SSL_ENC_AES128_IDX] == NULL) ? SSL_AES128:0; | 757 | *enc |= (ssl_cipher_methods[SSL_ENC_AES128_IDX] == NULL) ? SSL_AES128:0; |
689 | *enc |= (ssl_cipher_methods[SSL_ENC_AES256_IDX] == NULL) ? SSL_AES256:0; | 758 | *enc |= (ssl_cipher_methods[SSL_ENC_AES256_IDX] == NULL) ? SSL_AES256:0; |
759 | *enc |= (ssl_cipher_methods[SSL_ENC_AES128GCM_IDX] == NULL) ? SSL_AES128GCM:0; | ||
760 | *enc |= (ssl_cipher_methods[SSL_ENC_AES256GCM_IDX] == NULL) ? SSL_AES256GCM:0; | ||
690 | *enc |= (ssl_cipher_methods[SSL_ENC_CAMELLIA128_IDX] == NULL) ? SSL_CAMELLIA128:0; | 761 | *enc |= (ssl_cipher_methods[SSL_ENC_CAMELLIA128_IDX] == NULL) ? SSL_CAMELLIA128:0; |
691 | *enc |= (ssl_cipher_methods[SSL_ENC_CAMELLIA256_IDX] == NULL) ? SSL_CAMELLIA256:0; | 762 | *enc |= (ssl_cipher_methods[SSL_ENC_CAMELLIA256_IDX] == NULL) ? SSL_CAMELLIA256:0; |
692 | *enc |= (ssl_cipher_methods[SSL_ENC_GOST89_IDX] == NULL) ? SSL_eGOST2814789CNT:0; | 763 | *enc |= (ssl_cipher_methods[SSL_ENC_GOST89_IDX] == NULL) ? SSL_eGOST2814789CNT:0; |
@@ -694,6 +765,8 @@ static void ssl_cipher_get_disabled(unsigned long *mkey, unsigned long *auth, un | |||
694 | 765 | ||
695 | *mac |= (ssl_digest_methods[SSL_MD_MD5_IDX ] == NULL) ? SSL_MD5 :0; | 766 | *mac |= (ssl_digest_methods[SSL_MD_MD5_IDX ] == NULL) ? SSL_MD5 :0; |
696 | *mac |= (ssl_digest_methods[SSL_MD_SHA1_IDX] == NULL) ? SSL_SHA1:0; | 767 | *mac |= (ssl_digest_methods[SSL_MD_SHA1_IDX] == NULL) ? SSL_SHA1:0; |
768 | *mac |= (ssl_digest_methods[SSL_MD_SHA256_IDX] == NULL) ? SSL_SHA256:0; | ||
769 | *mac |= (ssl_digest_methods[SSL_MD_SHA384_IDX] == NULL) ? SSL_SHA384:0; | ||
697 | *mac |= (ssl_digest_methods[SSL_MD_GOST94_IDX] == NULL) ? SSL_GOST94:0; | 770 | *mac |= (ssl_digest_methods[SSL_MD_GOST94_IDX] == NULL) ? SSL_GOST94:0; |
698 | *mac |= (ssl_digest_methods[SSL_MD_GOST89MAC_IDX] == NULL || ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX]==NID_undef)? SSL_GOST89MAC:0; | 771 | *mac |= (ssl_digest_methods[SSL_MD_GOST89MAC_IDX] == NULL || ssl_mac_pkey_id[SSL_MD_GOST89MAC_IDX]==NID_undef)? SSL_GOST89MAC:0; |
699 | 772 | ||
@@ -724,6 +797,9 @@ static void ssl_cipher_collect_ciphers(const SSL_METHOD *ssl_method, | |||
724 | c = ssl_method->get_cipher(i); | 797 | c = ssl_method->get_cipher(i); |
725 | /* drop those that use any of that is not available */ | 798 | /* drop those that use any of that is not available */ |
726 | if ((c != NULL) && c->valid && | 799 | if ((c != NULL) && c->valid && |
800 | #ifdef OPENSSL_FIPS | ||
801 | (!FIPS_mode() || (c->algo_strength & SSL_FIPS)) && | ||
802 | #endif | ||
727 | !(c->algorithm_mkey & disabled_mkey) && | 803 | !(c->algorithm_mkey & disabled_mkey) && |
728 | !(c->algorithm_auth & disabled_auth) && | 804 | !(c->algorithm_auth & disabled_auth) && |
729 | !(c->algorithm_enc & disabled_enc) && | 805 | !(c->algorithm_enc & disabled_enc) && |
@@ -1423,7 +1499,11 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_list(const SSL_METHOD *ssl_method, | |||
1423 | */ | 1499 | */ |
1424 | for (curr = head; curr != NULL; curr = curr->next) | 1500 | for (curr = head; curr != NULL; curr = curr->next) |
1425 | { | 1501 | { |
1502 | #ifdef OPENSSL_FIPS | ||
1503 | if (curr->active && (!FIPS_mode() || curr->cipher->algo_strength & SSL_FIPS)) | ||
1504 | #else | ||
1426 | if (curr->active) | 1505 | if (curr->active) |
1506 | #endif | ||
1427 | { | 1507 | { |
1428 | sk_SSL_CIPHER_push(cipherstack, curr->cipher); | 1508 | sk_SSL_CIPHER_push(cipherstack, curr->cipher); |
1429 | #ifdef CIPHER_DEBUG | 1509 | #ifdef CIPHER_DEBUG |
@@ -1480,6 +1560,8 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) | |||
1480 | ver="SSLv2"; | 1560 | ver="SSLv2"; |
1481 | else if (alg_ssl & SSL_SSLV3) | 1561 | else if (alg_ssl & SSL_SSLV3) |
1482 | ver="SSLv3"; | 1562 | ver="SSLv3"; |
1563 | else if (alg_ssl & SSL_TLSV1_2) | ||
1564 | ver="TLSv1.2"; | ||
1483 | else | 1565 | else |
1484 | ver="unknown"; | 1566 | ver="unknown"; |
1485 | 1567 | ||
@@ -1512,6 +1594,9 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) | |||
1512 | case SSL_kPSK: | 1594 | case SSL_kPSK: |
1513 | kx="PSK"; | 1595 | kx="PSK"; |
1514 | break; | 1596 | break; |
1597 | case SSL_kSRP: | ||
1598 | kx="SRP"; | ||
1599 | break; | ||
1515 | default: | 1600 | default: |
1516 | kx="unknown"; | 1601 | kx="unknown"; |
1517 | } | 1602 | } |
@@ -1574,6 +1659,12 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) | |||
1574 | case SSL_AES256: | 1659 | case SSL_AES256: |
1575 | enc="AES(256)"; | 1660 | enc="AES(256)"; |
1576 | break; | 1661 | break; |
1662 | case SSL_AES128GCM: | ||
1663 | enc="AESGCM(128)"; | ||
1664 | break; | ||
1665 | case SSL_AES256GCM: | ||
1666 | enc="AESGCM(256)"; | ||
1667 | break; | ||
1577 | case SSL_CAMELLIA128: | 1668 | case SSL_CAMELLIA128: |
1578 | enc="Camellia(128)"; | 1669 | enc="Camellia(128)"; |
1579 | break; | 1670 | break; |
@@ -1596,6 +1687,15 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) | |||
1596 | case SSL_SHA1: | 1687 | case SSL_SHA1: |
1597 | mac="SHA1"; | 1688 | mac="SHA1"; |
1598 | break; | 1689 | break; |
1690 | case SSL_SHA256: | ||
1691 | mac="SHA256"; | ||
1692 | break; | ||
1693 | case SSL_SHA384: | ||
1694 | mac="SHA384"; | ||
1695 | break; | ||
1696 | case SSL_AEAD: | ||
1697 | mac="AEAD"; | ||
1698 | break; | ||
1599 | default: | 1699 | default: |
1600 | mac="unknown"; | 1700 | mac="unknown"; |
1601 | break; | 1701 | break; |
@@ -1653,6 +1753,11 @@ int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits) | |||
1653 | return(ret); | 1753 | return(ret); |
1654 | } | 1754 | } |
1655 | 1755 | ||
1756 | unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c) | ||
1757 | { | ||
1758 | return c->id; | ||
1759 | } | ||
1760 | |||
1656 | SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n) | 1761 | SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n) |
1657 | { | 1762 | { |
1658 | SSL_COMP *ctmp; | 1763 | SSL_COMP *ctmp; |
diff --git a/src/lib/libssl/src/ssl/ssl_err.c b/src/lib/libssl/src/ssl/ssl_err.c index e9be77109f..2577c6895a 100644 --- a/src/lib/libssl/src/ssl/ssl_err.c +++ b/src/lib/libssl/src/ssl/ssl_err.c | |||
@@ -80,6 +80,7 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
80 | {ERR_FUNC(SSL_F_DTLS1_ACCEPT), "DTLS1_ACCEPT"}, | 80 | {ERR_FUNC(SSL_F_DTLS1_ACCEPT), "DTLS1_ACCEPT"}, |
81 | {ERR_FUNC(SSL_F_DTLS1_ADD_CERT_TO_BUF), "DTLS1_ADD_CERT_TO_BUF"}, | 81 | {ERR_FUNC(SSL_F_DTLS1_ADD_CERT_TO_BUF), "DTLS1_ADD_CERT_TO_BUF"}, |
82 | {ERR_FUNC(SSL_F_DTLS1_BUFFER_RECORD), "DTLS1_BUFFER_RECORD"}, | 82 | {ERR_FUNC(SSL_F_DTLS1_BUFFER_RECORD), "DTLS1_BUFFER_RECORD"}, |
83 | {ERR_FUNC(SSL_F_DTLS1_CHECK_TIMEOUT_NUM), "DTLS1_CHECK_TIMEOUT_NUM"}, | ||
83 | {ERR_FUNC(SSL_F_DTLS1_CLIENT_HELLO), "DTLS1_CLIENT_HELLO"}, | 84 | {ERR_FUNC(SSL_F_DTLS1_CLIENT_HELLO), "DTLS1_CLIENT_HELLO"}, |
84 | {ERR_FUNC(SSL_F_DTLS1_CONNECT), "DTLS1_CONNECT"}, | 85 | {ERR_FUNC(SSL_F_DTLS1_CONNECT), "DTLS1_CONNECT"}, |
85 | {ERR_FUNC(SSL_F_DTLS1_ENC), "DTLS1_ENC"}, | 86 | {ERR_FUNC(SSL_F_DTLS1_ENC), "DTLS1_ENC"}, |
@@ -88,6 +89,7 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
88 | {ERR_FUNC(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT), "DTLS1_GET_MESSAGE_FRAGMENT"}, | 89 | {ERR_FUNC(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT), "DTLS1_GET_MESSAGE_FRAGMENT"}, |
89 | {ERR_FUNC(SSL_F_DTLS1_GET_RECORD), "DTLS1_GET_RECORD"}, | 90 | {ERR_FUNC(SSL_F_DTLS1_GET_RECORD), "DTLS1_GET_RECORD"}, |
90 | {ERR_FUNC(SSL_F_DTLS1_HANDLE_TIMEOUT), "DTLS1_HANDLE_TIMEOUT"}, | 91 | {ERR_FUNC(SSL_F_DTLS1_HANDLE_TIMEOUT), "DTLS1_HANDLE_TIMEOUT"}, |
92 | {ERR_FUNC(SSL_F_DTLS1_HEARTBEAT), "DTLS1_HEARTBEAT"}, | ||
91 | {ERR_FUNC(SSL_F_DTLS1_OUTPUT_CERT_CHAIN), "DTLS1_OUTPUT_CERT_CHAIN"}, | 93 | {ERR_FUNC(SSL_F_DTLS1_OUTPUT_CERT_CHAIN), "DTLS1_OUTPUT_CERT_CHAIN"}, |
92 | {ERR_FUNC(SSL_F_DTLS1_PREPROCESS_FRAGMENT), "DTLS1_PREPROCESS_FRAGMENT"}, | 94 | {ERR_FUNC(SSL_F_DTLS1_PREPROCESS_FRAGMENT), "DTLS1_PREPROCESS_FRAGMENT"}, |
93 | {ERR_FUNC(SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE), "DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE"}, | 95 | {ERR_FUNC(SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE), "DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE"}, |
@@ -156,6 +158,7 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
156 | {ERR_FUNC(SSL_F_SSL3_GET_KEY_EXCHANGE), "SSL3_GET_KEY_EXCHANGE"}, | 158 | {ERR_FUNC(SSL_F_SSL3_GET_KEY_EXCHANGE), "SSL3_GET_KEY_EXCHANGE"}, |
157 | {ERR_FUNC(SSL_F_SSL3_GET_MESSAGE), "SSL3_GET_MESSAGE"}, | 159 | {ERR_FUNC(SSL_F_SSL3_GET_MESSAGE), "SSL3_GET_MESSAGE"}, |
158 | {ERR_FUNC(SSL_F_SSL3_GET_NEW_SESSION_TICKET), "SSL3_GET_NEW_SESSION_TICKET"}, | 160 | {ERR_FUNC(SSL_F_SSL3_GET_NEW_SESSION_TICKET), "SSL3_GET_NEW_SESSION_TICKET"}, |
161 | {ERR_FUNC(SSL_F_SSL3_GET_NEXT_PROTO), "SSL3_GET_NEXT_PROTO"}, | ||
159 | {ERR_FUNC(SSL_F_SSL3_GET_RECORD), "SSL3_GET_RECORD"}, | 162 | {ERR_FUNC(SSL_F_SSL3_GET_RECORD), "SSL3_GET_RECORD"}, |
160 | {ERR_FUNC(SSL_F_SSL3_GET_SERVER_CERTIFICATE), "SSL3_GET_SERVER_CERTIFICATE"}, | 163 | {ERR_FUNC(SSL_F_SSL3_GET_SERVER_CERTIFICATE), "SSL3_GET_SERVER_CERTIFICATE"}, |
161 | {ERR_FUNC(SSL_F_SSL3_GET_SERVER_DONE), "SSL3_GET_SERVER_DONE"}, | 164 | {ERR_FUNC(SSL_F_SSL3_GET_SERVER_DONE), "SSL3_GET_SERVER_DONE"}, |
@@ -180,10 +183,12 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
180 | {ERR_FUNC(SSL_F_SSL3_WRITE_PENDING), "SSL3_WRITE_PENDING"}, | 183 | {ERR_FUNC(SSL_F_SSL3_WRITE_PENDING), "SSL3_WRITE_PENDING"}, |
181 | {ERR_FUNC(SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT), "SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT"}, | 184 | {ERR_FUNC(SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT), "SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT"}, |
182 | {ERR_FUNC(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT), "SSL_ADD_CLIENTHELLO_TLSEXT"}, | 185 | {ERR_FUNC(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT), "SSL_ADD_CLIENTHELLO_TLSEXT"}, |
186 | {ERR_FUNC(SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT), "SSL_ADD_CLIENTHELLO_USE_SRTP_EXT"}, | ||
183 | {ERR_FUNC(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK), "SSL_add_dir_cert_subjects_to_stack"}, | 187 | {ERR_FUNC(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK), "SSL_add_dir_cert_subjects_to_stack"}, |
184 | {ERR_FUNC(SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK), "SSL_add_file_cert_subjects_to_stack"}, | 188 | {ERR_FUNC(SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK), "SSL_add_file_cert_subjects_to_stack"}, |
185 | {ERR_FUNC(SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT), "SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT"}, | 189 | {ERR_FUNC(SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT), "SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT"}, |
186 | {ERR_FUNC(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT), "SSL_ADD_SERVERHELLO_TLSEXT"}, | 190 | {ERR_FUNC(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT), "SSL_ADD_SERVERHELLO_TLSEXT"}, |
191 | {ERR_FUNC(SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT), "SSL_ADD_SERVERHELLO_USE_SRTP_EXT"}, | ||
187 | {ERR_FUNC(SSL_F_SSL_BAD_METHOD), "SSL_BAD_METHOD"}, | 192 | {ERR_FUNC(SSL_F_SSL_BAD_METHOD), "SSL_BAD_METHOD"}, |
188 | {ERR_FUNC(SSL_F_SSL_BYTES_TO_CIPHER_LIST), "SSL_BYTES_TO_CIPHER_LIST"}, | 193 | {ERR_FUNC(SSL_F_SSL_BYTES_TO_CIPHER_LIST), "SSL_BYTES_TO_CIPHER_LIST"}, |
189 | {ERR_FUNC(SSL_F_SSL_CERT_DUP), "SSL_CERT_DUP"}, | 194 | {ERR_FUNC(SSL_F_SSL_CERT_DUP), "SSL_CERT_DUP"}, |
@@ -200,6 +205,7 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
200 | {ERR_FUNC(SSL_F_SSL_CREATE_CIPHER_LIST), "SSL_CREATE_CIPHER_LIST"}, | 205 | {ERR_FUNC(SSL_F_SSL_CREATE_CIPHER_LIST), "SSL_CREATE_CIPHER_LIST"}, |
201 | {ERR_FUNC(SSL_F_SSL_CTRL), "SSL_ctrl"}, | 206 | {ERR_FUNC(SSL_F_SSL_CTRL), "SSL_ctrl"}, |
202 | {ERR_FUNC(SSL_F_SSL_CTX_CHECK_PRIVATE_KEY), "SSL_CTX_check_private_key"}, | 207 | {ERR_FUNC(SSL_F_SSL_CTX_CHECK_PRIVATE_KEY), "SSL_CTX_check_private_key"}, |
208 | {ERR_FUNC(SSL_F_SSL_CTX_MAKE_PROFILES), "SSL_CTX_MAKE_PROFILES"}, | ||
203 | {ERR_FUNC(SSL_F_SSL_CTX_NEW), "SSL_CTX_new"}, | 209 | {ERR_FUNC(SSL_F_SSL_CTX_NEW), "SSL_CTX_new"}, |
204 | {ERR_FUNC(SSL_F_SSL_CTX_SET_CIPHER_LIST), "SSL_CTX_set_cipher_list"}, | 210 | {ERR_FUNC(SSL_F_SSL_CTX_SET_CIPHER_LIST), "SSL_CTX_set_cipher_list"}, |
205 | {ERR_FUNC(SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE), "SSL_CTX_set_client_cert_engine"}, | 211 | {ERR_FUNC(SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE), "SSL_CTX_set_client_cert_engine"}, |
@@ -228,8 +234,10 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
228 | {ERR_FUNC(SSL_F_SSL_NEW), "SSL_new"}, | 234 | {ERR_FUNC(SSL_F_SSL_NEW), "SSL_new"}, |
229 | {ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT), "SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT"}, | 235 | {ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT), "SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT"}, |
230 | {ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT), "SSL_PARSE_CLIENTHELLO_TLSEXT"}, | 236 | {ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT), "SSL_PARSE_CLIENTHELLO_TLSEXT"}, |
237 | {ERR_FUNC(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT), "SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT"}, | ||
231 | {ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT), "SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT"}, | 238 | {ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT), "SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT"}, |
232 | {ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT), "SSL_PARSE_SERVERHELLO_TLSEXT"}, | 239 | {ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT), "SSL_PARSE_SERVERHELLO_TLSEXT"}, |
240 | {ERR_FUNC(SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT), "SSL_PARSE_SERVERHELLO_USE_SRTP_EXT"}, | ||
233 | {ERR_FUNC(SSL_F_SSL_PEEK), "SSL_peek"}, | 241 | {ERR_FUNC(SSL_F_SSL_PEEK), "SSL_peek"}, |
234 | {ERR_FUNC(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT), "SSL_PREPARE_CLIENTHELLO_TLSEXT"}, | 242 | {ERR_FUNC(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT), "SSL_PREPARE_CLIENTHELLO_TLSEXT"}, |
235 | {ERR_FUNC(SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT), "SSL_PREPARE_SERVERHELLO_TLSEXT"}, | 243 | {ERR_FUNC(SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT), "SSL_PREPARE_SERVERHELLO_TLSEXT"}, |
@@ -238,6 +246,7 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
238 | {ERR_FUNC(SSL_F_SSL_RSA_PUBLIC_ENCRYPT), "SSL_RSA_PUBLIC_ENCRYPT"}, | 246 | {ERR_FUNC(SSL_F_SSL_RSA_PUBLIC_ENCRYPT), "SSL_RSA_PUBLIC_ENCRYPT"}, |
239 | {ERR_FUNC(SSL_F_SSL_SESSION_NEW), "SSL_SESSION_new"}, | 247 | {ERR_FUNC(SSL_F_SSL_SESSION_NEW), "SSL_SESSION_new"}, |
240 | {ERR_FUNC(SSL_F_SSL_SESSION_PRINT_FP), "SSL_SESSION_print_fp"}, | 248 | {ERR_FUNC(SSL_F_SSL_SESSION_PRINT_FP), "SSL_SESSION_print_fp"}, |
249 | {ERR_FUNC(SSL_F_SSL_SESSION_SET1_ID_CONTEXT), "SSL_SESSION_set1_id_context"}, | ||
241 | {ERR_FUNC(SSL_F_SSL_SESS_CERT_NEW), "SSL_SESS_CERT_NEW"}, | 250 | {ERR_FUNC(SSL_F_SSL_SESS_CERT_NEW), "SSL_SESS_CERT_NEW"}, |
242 | {ERR_FUNC(SSL_F_SSL_SET_CERT), "SSL_SET_CERT"}, | 251 | {ERR_FUNC(SSL_F_SSL_SET_CERT), "SSL_SET_CERT"}, |
243 | {ERR_FUNC(SSL_F_SSL_SET_CIPHER_LIST), "SSL_set_cipher_list"}, | 252 | {ERR_FUNC(SSL_F_SSL_SET_CIPHER_LIST), "SSL_set_cipher_list"}, |
@@ -251,6 +260,7 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
251 | {ERR_FUNC(SSL_F_SSL_SET_TRUST), "SSL_set_trust"}, | 260 | {ERR_FUNC(SSL_F_SSL_SET_TRUST), "SSL_set_trust"}, |
252 | {ERR_FUNC(SSL_F_SSL_SET_WFD), "SSL_set_wfd"}, | 261 | {ERR_FUNC(SSL_F_SSL_SET_WFD), "SSL_set_wfd"}, |
253 | {ERR_FUNC(SSL_F_SSL_SHUTDOWN), "SSL_shutdown"}, | 262 | {ERR_FUNC(SSL_F_SSL_SHUTDOWN), "SSL_shutdown"}, |
263 | {ERR_FUNC(SSL_F_SSL_SRP_CTX_INIT), "SSL_SRP_CTX_init"}, | ||
254 | {ERR_FUNC(SSL_F_SSL_UNDEFINED_CONST_FUNCTION), "SSL_UNDEFINED_CONST_FUNCTION"}, | 264 | {ERR_FUNC(SSL_F_SSL_UNDEFINED_CONST_FUNCTION), "SSL_UNDEFINED_CONST_FUNCTION"}, |
255 | {ERR_FUNC(SSL_F_SSL_UNDEFINED_FUNCTION), "SSL_UNDEFINED_FUNCTION"}, | 265 | {ERR_FUNC(SSL_F_SSL_UNDEFINED_FUNCTION), "SSL_UNDEFINED_FUNCTION"}, |
256 | {ERR_FUNC(SSL_F_SSL_UNDEFINED_VOID_FUNCTION), "SSL_UNDEFINED_VOID_FUNCTION"}, | 266 | {ERR_FUNC(SSL_F_SSL_UNDEFINED_VOID_FUNCTION), "SSL_UNDEFINED_VOID_FUNCTION"}, |
@@ -270,6 +280,8 @@ static ERR_STRING_DATA SSL_str_functs[]= | |||
270 | {ERR_FUNC(SSL_F_TLS1_CHANGE_CIPHER_STATE), "TLS1_CHANGE_CIPHER_STATE"}, | 280 | {ERR_FUNC(SSL_F_TLS1_CHANGE_CIPHER_STATE), "TLS1_CHANGE_CIPHER_STATE"}, |
271 | {ERR_FUNC(SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT), "TLS1_CHECK_SERVERHELLO_TLSEXT"}, | 281 | {ERR_FUNC(SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT), "TLS1_CHECK_SERVERHELLO_TLSEXT"}, |
272 | {ERR_FUNC(SSL_F_TLS1_ENC), "TLS1_ENC"}, | 282 | {ERR_FUNC(SSL_F_TLS1_ENC), "TLS1_ENC"}, |
283 | {ERR_FUNC(SSL_F_TLS1_EXPORT_KEYING_MATERIAL), "TLS1_EXPORT_KEYING_MATERIAL"}, | ||
284 | {ERR_FUNC(SSL_F_TLS1_HEARTBEAT), "SSL_F_TLS1_HEARTBEAT"}, | ||
273 | {ERR_FUNC(SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT), "TLS1_PREPARE_CLIENTHELLO_TLSEXT"}, | 285 | {ERR_FUNC(SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT), "TLS1_PREPARE_CLIENTHELLO_TLSEXT"}, |
274 | {ERR_FUNC(SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT), "TLS1_PREPARE_SERVERHELLO_TLSEXT"}, | 286 | {ERR_FUNC(SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT), "TLS1_PREPARE_SERVERHELLO_TLSEXT"}, |
275 | {ERR_FUNC(SSL_F_TLS1_PRF), "tls1_prf"}, | 287 | {ERR_FUNC(SSL_F_TLS1_PRF), "tls1_prf"}, |
@@ -312,6 +324,13 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
312 | {ERR_REASON(SSL_R_BAD_RSA_MODULUS_LENGTH),"bad rsa modulus length"}, | 324 | {ERR_REASON(SSL_R_BAD_RSA_MODULUS_LENGTH),"bad rsa modulus length"}, |
313 | {ERR_REASON(SSL_R_BAD_RSA_SIGNATURE) ,"bad rsa signature"}, | 325 | {ERR_REASON(SSL_R_BAD_RSA_SIGNATURE) ,"bad rsa signature"}, |
314 | {ERR_REASON(SSL_R_BAD_SIGNATURE) ,"bad signature"}, | 326 | {ERR_REASON(SSL_R_BAD_SIGNATURE) ,"bad signature"}, |
327 | {ERR_REASON(SSL_R_BAD_SRP_A_LENGTH) ,"bad srp a length"}, | ||
328 | {ERR_REASON(SSL_R_BAD_SRP_B_LENGTH) ,"bad srp b length"}, | ||
329 | {ERR_REASON(SSL_R_BAD_SRP_G_LENGTH) ,"bad srp g length"}, | ||
330 | {ERR_REASON(SSL_R_BAD_SRP_N_LENGTH) ,"bad srp n length"}, | ||
331 | {ERR_REASON(SSL_R_BAD_SRP_S_LENGTH) ,"bad srp s length"}, | ||
332 | {ERR_REASON(SSL_R_BAD_SRTP_MKI_VALUE) ,"bad srtp mki value"}, | ||
333 | {ERR_REASON(SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST),"bad srtp protection profile list"}, | ||
315 | {ERR_REASON(SSL_R_BAD_SSL_FILETYPE) ,"bad ssl filetype"}, | 334 | {ERR_REASON(SSL_R_BAD_SSL_FILETYPE) ,"bad ssl filetype"}, |
316 | {ERR_REASON(SSL_R_BAD_SSL_SESSION_ID_LENGTH),"bad ssl session id length"}, | 335 | {ERR_REASON(SSL_R_BAD_SSL_SESSION_ID_LENGTH),"bad ssl session id length"}, |
317 | {ERR_REASON(SSL_R_BAD_STATE) ,"bad state"}, | 336 | {ERR_REASON(SSL_R_BAD_STATE) ,"bad state"}, |
@@ -350,12 +369,15 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
350 | {ERR_REASON(SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE),"ecc cert should have rsa signature"}, | 369 | {ERR_REASON(SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE),"ecc cert should have rsa signature"}, |
351 | {ERR_REASON(SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE),"ecc cert should have sha1 signature"}, | 370 | {ERR_REASON(SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE),"ecc cert should have sha1 signature"}, |
352 | {ERR_REASON(SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER),"ecgroup too large for cipher"}, | 371 | {ERR_REASON(SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER),"ecgroup too large for cipher"}, |
372 | {ERR_REASON(SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST),"empty srtp protection profile list"}, | ||
353 | {ERR_REASON(SSL_R_ENCRYPTED_LENGTH_TOO_LONG),"encrypted length too long"}, | 373 | {ERR_REASON(SSL_R_ENCRYPTED_LENGTH_TOO_LONG),"encrypted length too long"}, |
354 | {ERR_REASON(SSL_R_ERROR_GENERATING_TMP_RSA_KEY),"error generating tmp rsa key"}, | 374 | {ERR_REASON(SSL_R_ERROR_GENERATING_TMP_RSA_KEY),"error generating tmp rsa key"}, |
355 | {ERR_REASON(SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST),"error in received cipher list"}, | 375 | {ERR_REASON(SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST),"error in received cipher list"}, |
356 | {ERR_REASON(SSL_R_EXCESSIVE_MESSAGE_SIZE),"excessive message size"}, | 376 | {ERR_REASON(SSL_R_EXCESSIVE_MESSAGE_SIZE),"excessive message size"}, |
357 | {ERR_REASON(SSL_R_EXTRA_DATA_IN_MESSAGE) ,"extra data in message"}, | 377 | {ERR_REASON(SSL_R_EXTRA_DATA_IN_MESSAGE) ,"extra data in message"}, |
358 | {ERR_REASON(SSL_R_GOT_A_FIN_BEFORE_A_CCS),"got a fin before a ccs"}, | 378 | {ERR_REASON(SSL_R_GOT_A_FIN_BEFORE_A_CCS),"got a fin before a ccs"}, |
379 | {ERR_REASON(SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS),"got next proto before a ccs"}, | ||
380 | {ERR_REASON(SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION),"got next proto without seeing extension"}, | ||
359 | {ERR_REASON(SSL_R_HTTPS_PROXY_REQUEST) ,"https proxy request"}, | 381 | {ERR_REASON(SSL_R_HTTPS_PROXY_REQUEST) ,"https proxy request"}, |
360 | {ERR_REASON(SSL_R_HTTP_REQUEST) ,"http request"}, | 382 | {ERR_REASON(SSL_R_HTTP_REQUEST) ,"http request"}, |
361 | {ERR_REASON(SSL_R_ILLEGAL_PADDING) ,"illegal padding"}, | 383 | {ERR_REASON(SSL_R_ILLEGAL_PADDING) ,"illegal padding"}, |
@@ -364,6 +386,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
364 | {ERR_REASON(SSL_R_INVALID_COMMAND) ,"invalid command"}, | 386 | {ERR_REASON(SSL_R_INVALID_COMMAND) ,"invalid command"}, |
365 | {ERR_REASON(SSL_R_INVALID_COMPRESSION_ALGORITHM),"invalid compression algorithm"}, | 387 | {ERR_REASON(SSL_R_INVALID_COMPRESSION_ALGORITHM),"invalid compression algorithm"}, |
366 | {ERR_REASON(SSL_R_INVALID_PURPOSE) ,"invalid purpose"}, | 388 | {ERR_REASON(SSL_R_INVALID_PURPOSE) ,"invalid purpose"}, |
389 | {ERR_REASON(SSL_R_INVALID_SRP_USERNAME) ,"invalid srp username"}, | ||
367 | {ERR_REASON(SSL_R_INVALID_STATUS_RESPONSE),"invalid status response"}, | 390 | {ERR_REASON(SSL_R_INVALID_STATUS_RESPONSE),"invalid status response"}, |
368 | {ERR_REASON(SSL_R_INVALID_TICKET_KEYS_LENGTH),"invalid ticket keys length"}, | 391 | {ERR_REASON(SSL_R_INVALID_TICKET_KEYS_LENGTH),"invalid ticket keys length"}, |
369 | {ERR_REASON(SSL_R_INVALID_TRUST) ,"invalid trust"}, | 392 | {ERR_REASON(SSL_R_INVALID_TRUST) ,"invalid trust"}, |
@@ -393,6 +416,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
393 | {ERR_REASON(SSL_R_MISSING_RSA_CERTIFICATE),"missing rsa certificate"}, | 416 | {ERR_REASON(SSL_R_MISSING_RSA_CERTIFICATE),"missing rsa certificate"}, |
394 | {ERR_REASON(SSL_R_MISSING_RSA_ENCRYPTING_CERT),"missing rsa encrypting cert"}, | 417 | {ERR_REASON(SSL_R_MISSING_RSA_ENCRYPTING_CERT),"missing rsa encrypting cert"}, |
395 | {ERR_REASON(SSL_R_MISSING_RSA_SIGNING_CERT),"missing rsa signing cert"}, | 418 | {ERR_REASON(SSL_R_MISSING_RSA_SIGNING_CERT),"missing rsa signing cert"}, |
419 | {ERR_REASON(SSL_R_MISSING_SRP_PARAM) ,"can't find SRP server param"}, | ||
396 | {ERR_REASON(SSL_R_MISSING_TMP_DH_KEY) ,"missing tmp dh key"}, | 420 | {ERR_REASON(SSL_R_MISSING_TMP_DH_KEY) ,"missing tmp dh key"}, |
397 | {ERR_REASON(SSL_R_MISSING_TMP_ECDH_KEY) ,"missing tmp ecdh key"}, | 421 | {ERR_REASON(SSL_R_MISSING_TMP_ECDH_KEY) ,"missing tmp ecdh key"}, |
398 | {ERR_REASON(SSL_R_MISSING_TMP_RSA_KEY) ,"missing tmp rsa key"}, | 422 | {ERR_REASON(SSL_R_MISSING_TMP_RSA_KEY) ,"missing tmp rsa key"}, |
@@ -422,6 +446,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
422 | {ERR_REASON(SSL_R_NO_RENEGOTIATION) ,"no renegotiation"}, | 446 | {ERR_REASON(SSL_R_NO_RENEGOTIATION) ,"no renegotiation"}, |
423 | {ERR_REASON(SSL_R_NO_REQUIRED_DIGEST) ,"digest requred for handshake isn't computed"}, | 447 | {ERR_REASON(SSL_R_NO_REQUIRED_DIGEST) ,"digest requred for handshake isn't computed"}, |
424 | {ERR_REASON(SSL_R_NO_SHARED_CIPHER) ,"no shared cipher"}, | 448 | {ERR_REASON(SSL_R_NO_SHARED_CIPHER) ,"no shared cipher"}, |
449 | {ERR_REASON(SSL_R_NO_SRTP_PROFILES) ,"no srtp profiles"}, | ||
425 | {ERR_REASON(SSL_R_NO_VERIFY_CALLBACK) ,"no verify callback"}, | 450 | {ERR_REASON(SSL_R_NO_VERIFY_CALLBACK) ,"no verify callback"}, |
426 | {ERR_REASON(SSL_R_NULL_SSL_CTX) ,"null ssl ctx"}, | 451 | {ERR_REASON(SSL_R_NULL_SSL_CTX) ,"null ssl ctx"}, |
427 | {ERR_REASON(SSL_R_NULL_SSL_METHOD_PASSED),"null ssl method passed"}, | 452 | {ERR_REASON(SSL_R_NULL_SSL_METHOD_PASSED),"null ssl method passed"}, |
@@ -465,7 +490,12 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
465 | {ERR_REASON(SSL_R_SERVERHELLO_TLSEXT) ,"serverhello tlsext"}, | 490 | {ERR_REASON(SSL_R_SERVERHELLO_TLSEXT) ,"serverhello tlsext"}, |
466 | {ERR_REASON(SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED),"session id context uninitialized"}, | 491 | {ERR_REASON(SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED),"session id context uninitialized"}, |
467 | {ERR_REASON(SSL_R_SHORT_READ) ,"short read"}, | 492 | {ERR_REASON(SSL_R_SHORT_READ) ,"short read"}, |
493 | {ERR_REASON(SSL_R_SIGNATURE_ALGORITHMS_ERROR),"signature algorithms error"}, | ||
468 | {ERR_REASON(SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE),"signature for non signing certificate"}, | 494 | {ERR_REASON(SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE),"signature for non signing certificate"}, |
495 | {ERR_REASON(SSL_R_SRP_A_CALC) ,"error with the srp params"}, | ||
496 | {ERR_REASON(SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES),"srtp could not allocate profiles"}, | ||
497 | {ERR_REASON(SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG),"srtp protection profile list too long"}, | ||
498 | {ERR_REASON(SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE),"srtp unknown protection profile"}, | ||
469 | {ERR_REASON(SSL_R_SSL23_DOING_SESSION_ID_REUSE),"ssl23 doing session id reuse"}, | 499 | {ERR_REASON(SSL_R_SSL23_DOING_SESSION_ID_REUSE),"ssl23 doing session id reuse"}, |
470 | {ERR_REASON(SSL_R_SSL2_CONNECTION_ID_TOO_LONG),"ssl2 connection id too long"}, | 500 | {ERR_REASON(SSL_R_SSL2_CONNECTION_ID_TOO_LONG),"ssl2 connection id too long"}, |
471 | {ERR_REASON(SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT),"ssl3 ext invalid ecpointformat"}, | 501 | {ERR_REASON(SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT),"ssl3 ext invalid ecpointformat"}, |
@@ -510,6 +540,9 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
510 | {ERR_REASON(SSL_R_TLSV1_UNRECOGNIZED_NAME),"tlsv1 unrecognized name"}, | 540 | {ERR_REASON(SSL_R_TLSV1_UNRECOGNIZED_NAME),"tlsv1 unrecognized name"}, |
511 | {ERR_REASON(SSL_R_TLSV1_UNSUPPORTED_EXTENSION),"tlsv1 unsupported extension"}, | 541 | {ERR_REASON(SSL_R_TLSV1_UNSUPPORTED_EXTENSION),"tlsv1 unsupported extension"}, |
512 | {ERR_REASON(SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER),"tls client cert req with anon cipher"}, | 542 | {ERR_REASON(SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER),"tls client cert req with anon cipher"}, |
543 | {ERR_REASON(SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT),"peer does not accept heartbearts"}, | ||
544 | {ERR_REASON(SSL_R_TLS_HEARTBEAT_PENDING) ,"heartbeat request already pending"}, | ||
545 | {ERR_REASON(SSL_R_TLS_ILLEGAL_EXPORTER_LABEL),"tls illegal exporter label"}, | ||
513 | {ERR_REASON(SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST),"tls invalid ecpointformat list"}, | 546 | {ERR_REASON(SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST),"tls invalid ecpointformat list"}, |
514 | {ERR_REASON(SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST),"tls peer did not respond with certificate list"}, | 547 | {ERR_REASON(SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST),"tls peer did not respond with certificate list"}, |
515 | {ERR_REASON(SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG),"tls rsa encrypted value length is wrong"}, | 548 | {ERR_REASON(SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG),"tls rsa encrypted value length is wrong"}, |
@@ -531,6 +564,7 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
531 | {ERR_REASON(SSL_R_UNKNOWN_CERTIFICATE_TYPE),"unknown certificate type"}, | 564 | {ERR_REASON(SSL_R_UNKNOWN_CERTIFICATE_TYPE),"unknown certificate type"}, |
532 | {ERR_REASON(SSL_R_UNKNOWN_CIPHER_RETURNED),"unknown cipher returned"}, | 565 | {ERR_REASON(SSL_R_UNKNOWN_CIPHER_RETURNED),"unknown cipher returned"}, |
533 | {ERR_REASON(SSL_R_UNKNOWN_CIPHER_TYPE) ,"unknown cipher type"}, | 566 | {ERR_REASON(SSL_R_UNKNOWN_CIPHER_TYPE) ,"unknown cipher type"}, |
567 | {ERR_REASON(SSL_R_UNKNOWN_DIGEST) ,"unknown digest"}, | ||
534 | {ERR_REASON(SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE),"unknown key exchange type"}, | 568 | {ERR_REASON(SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE),"unknown key exchange type"}, |
535 | {ERR_REASON(SSL_R_UNKNOWN_PKEY_TYPE) ,"unknown pkey type"}, | 569 | {ERR_REASON(SSL_R_UNKNOWN_PKEY_TYPE) ,"unknown pkey type"}, |
536 | {ERR_REASON(SSL_R_UNKNOWN_PROTOCOL) ,"unknown protocol"}, | 570 | {ERR_REASON(SSL_R_UNKNOWN_PROTOCOL) ,"unknown protocol"}, |
@@ -545,12 +579,14 @@ static ERR_STRING_DATA SSL_str_reasons[]= | |||
545 | {ERR_REASON(SSL_R_UNSUPPORTED_PROTOCOL) ,"unsupported protocol"}, | 579 | {ERR_REASON(SSL_R_UNSUPPORTED_PROTOCOL) ,"unsupported protocol"}, |
546 | {ERR_REASON(SSL_R_UNSUPPORTED_SSL_VERSION),"unsupported ssl version"}, | 580 | {ERR_REASON(SSL_R_UNSUPPORTED_SSL_VERSION),"unsupported ssl version"}, |
547 | {ERR_REASON(SSL_R_UNSUPPORTED_STATUS_TYPE),"unsupported status type"}, | 581 | {ERR_REASON(SSL_R_UNSUPPORTED_STATUS_TYPE),"unsupported status type"}, |
582 | {ERR_REASON(SSL_R_USE_SRTP_NOT_NEGOTIATED),"use srtp not negotiated"}, | ||
548 | {ERR_REASON(SSL_R_WRITE_BIO_NOT_SET) ,"write bio not set"}, | 583 | {ERR_REASON(SSL_R_WRITE_BIO_NOT_SET) ,"write bio not set"}, |
549 | {ERR_REASON(SSL_R_WRONG_CIPHER_RETURNED) ,"wrong cipher returned"}, | 584 | {ERR_REASON(SSL_R_WRONG_CIPHER_RETURNED) ,"wrong cipher returned"}, |
550 | {ERR_REASON(SSL_R_WRONG_MESSAGE_TYPE) ,"wrong message type"}, | 585 | {ERR_REASON(SSL_R_WRONG_MESSAGE_TYPE) ,"wrong message type"}, |
551 | {ERR_REASON(SSL_R_WRONG_NUMBER_OF_KEY_BITS),"wrong number of key bits"}, | 586 | {ERR_REASON(SSL_R_WRONG_NUMBER_OF_KEY_BITS),"wrong number of key bits"}, |
552 | {ERR_REASON(SSL_R_WRONG_SIGNATURE_LENGTH),"wrong signature length"}, | 587 | {ERR_REASON(SSL_R_WRONG_SIGNATURE_LENGTH),"wrong signature length"}, |
553 | {ERR_REASON(SSL_R_WRONG_SIGNATURE_SIZE) ,"wrong signature size"}, | 588 | {ERR_REASON(SSL_R_WRONG_SIGNATURE_SIZE) ,"wrong signature size"}, |
589 | {ERR_REASON(SSL_R_WRONG_SIGNATURE_TYPE) ,"wrong signature type"}, | ||
554 | {ERR_REASON(SSL_R_WRONG_SSL_VERSION) ,"wrong ssl version"}, | 590 | {ERR_REASON(SSL_R_WRONG_SSL_VERSION) ,"wrong ssl version"}, |
555 | {ERR_REASON(SSL_R_WRONG_VERSION_NUMBER) ,"wrong version number"}, | 591 | {ERR_REASON(SSL_R_WRONG_VERSION_NUMBER) ,"wrong version number"}, |
556 | {ERR_REASON(SSL_R_X509_LIB) ,"x509 lib"}, | 592 | {ERR_REASON(SSL_R_X509_LIB) ,"x509 lib"}, |
diff --git a/src/lib/libssl/src/ssl/ssl_lib.c b/src/lib/libssl/src/ssl/ssl_lib.c index 8e89911f48..f82d071d6e 100644 --- a/src/lib/libssl/src/ssl/ssl_lib.c +++ b/src/lib/libssl/src/ssl/ssl_lib.c | |||
@@ -176,7 +176,10 @@ SSL3_ENC_METHOD ssl3_undef_enc_method={ | |||
176 | 0, /* client_finished_label_len */ | 176 | 0, /* client_finished_label_len */ |
177 | NULL, /* server_finished_label */ | 177 | NULL, /* server_finished_label */ |
178 | 0, /* server_finished_label_len */ | 178 | 0, /* server_finished_label_len */ |
179 | (int (*)(int))ssl_undefined_function | 179 | (int (*)(int))ssl_undefined_function, |
180 | (int (*)(SSL *, unsigned char *, size_t, const char *, | ||
181 | size_t, const unsigned char *, size_t, | ||
182 | int use_context)) ssl_undefined_function, | ||
180 | }; | 183 | }; |
181 | 184 | ||
182 | int SSL_clear(SSL *s) | 185 | int SSL_clear(SSL *s) |
@@ -202,9 +205,9 @@ int SSL_clear(SSL *s) | |||
202 | * needed because SSL_clear is not called when doing renegotiation) */ | 205 | * needed because SSL_clear is not called when doing renegotiation) */ |
203 | /* This is set if we are doing dynamic renegotiation so keep | 206 | /* This is set if we are doing dynamic renegotiation so keep |
204 | * the old cipher. It is sort of a SSL_clear_lite :-) */ | 207 | * the old cipher. It is sort of a SSL_clear_lite :-) */ |
205 | if (s->new_session) return(1); | 208 | if (s->renegotiate) return(1); |
206 | #else | 209 | #else |
207 | if (s->new_session) | 210 | if (s->renegotiate) |
208 | { | 211 | { |
209 | SSLerr(SSL_F_SSL_CLEAR,ERR_R_INTERNAL_ERROR); | 212 | SSLerr(SSL_F_SSL_CLEAR,ERR_R_INTERNAL_ERROR); |
210 | return 0; | 213 | return 0; |
@@ -353,6 +356,9 @@ SSL *SSL_new(SSL_CTX *ctx) | |||
353 | s->tlsext_ocsp_resplen = -1; | 356 | s->tlsext_ocsp_resplen = -1; |
354 | CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX); | 357 | CRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX); |
355 | s->initial_ctx=ctx; | 358 | s->initial_ctx=ctx; |
359 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
360 | s->next_proto_negotiated = NULL; | ||
361 | # endif | ||
356 | #endif | 362 | #endif |
357 | 363 | ||
358 | s->verify_result=X509_V_OK; | 364 | s->verify_result=X509_V_OK; |
@@ -586,6 +592,14 @@ void SSL_free(SSL *s) | |||
586 | kssl_ctx_free(s->kssl_ctx); | 592 | kssl_ctx_free(s->kssl_ctx); |
587 | #endif /* OPENSSL_NO_KRB5 */ | 593 | #endif /* OPENSSL_NO_KRB5 */ |
588 | 594 | ||
595 | #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG) | ||
596 | if (s->next_proto_negotiated) | ||
597 | OPENSSL_free(s->next_proto_negotiated); | ||
598 | #endif | ||
599 | |||
600 | if (s->srtp_profiles) | ||
601 | sk_SRTP_PROTECTION_PROFILE_free(s->srtp_profiles); | ||
602 | |||
589 | OPENSSL_free(s); | 603 | OPENSSL_free(s); |
590 | } | 604 | } |
591 | 605 | ||
@@ -1008,10 +1022,21 @@ int SSL_shutdown(SSL *s) | |||
1008 | 1022 | ||
1009 | int SSL_renegotiate(SSL *s) | 1023 | int SSL_renegotiate(SSL *s) |
1010 | { | 1024 | { |
1011 | if (s->new_session == 0) | 1025 | if (s->renegotiate == 0) |
1012 | { | 1026 | s->renegotiate=1; |
1013 | s->new_session=1; | 1027 | |
1014 | } | 1028 | s->new_session=1; |
1029 | |||
1030 | return(s->method->ssl_renegotiate(s)); | ||
1031 | } | ||
1032 | |||
1033 | int SSL_renegotiate_abbreviated(SSL *s) | ||
1034 | { | ||
1035 | if (s->renegotiate == 0) | ||
1036 | s->renegotiate=1; | ||
1037 | |||
1038 | s->new_session=0; | ||
1039 | |||
1015 | return(s->method->ssl_renegotiate(s)); | 1040 | return(s->method->ssl_renegotiate(s)); |
1016 | } | 1041 | } |
1017 | 1042 | ||
@@ -1019,7 +1044,7 @@ int SSL_renegotiate_pending(SSL *s) | |||
1019 | { | 1044 | { |
1020 | /* becomes true when negotiation is requested; | 1045 | /* becomes true when negotiation is requested; |
1021 | * false again once a handshake has finished */ | 1046 | * false again once a handshake has finished */ |
1022 | return (s->new_session != 0); | 1047 | return (s->renegotiate != 0); |
1023 | } | 1048 | } |
1024 | 1049 | ||
1025 | long SSL_ctrl(SSL *s,int cmd,long larg,void *parg) | 1050 | long SSL_ctrl(SSL *s,int cmd,long larg,void *parg) |
@@ -1054,8 +1079,10 @@ long SSL_ctrl(SSL *s,int cmd,long larg,void *parg) | |||
1054 | s->max_cert_list=larg; | 1079 | s->max_cert_list=larg; |
1055 | return(l); | 1080 | return(l); |
1056 | case SSL_CTRL_SET_MTU: | 1081 | case SSL_CTRL_SET_MTU: |
1082 | #ifndef OPENSSL_NO_DTLS1 | ||
1057 | if (larg < (long)dtls1_min_mtu()) | 1083 | if (larg < (long)dtls1_min_mtu()) |
1058 | return 0; | 1084 | return 0; |
1085 | #endif | ||
1059 | 1086 | ||
1060 | if (SSL_version(s) == DTLS1_VERSION || | 1087 | if (SSL_version(s) == DTLS1_VERSION || |
1061 | SSL_version(s) == DTLS1_BAD_VER) | 1088 | SSL_version(s) == DTLS1_BAD_VER) |
@@ -1358,6 +1385,10 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, | |||
1358 | for (i=0; i<sk_SSL_CIPHER_num(sk); i++) | 1385 | for (i=0; i<sk_SSL_CIPHER_num(sk); i++) |
1359 | { | 1386 | { |
1360 | c=sk_SSL_CIPHER_value(sk,i); | 1387 | c=sk_SSL_CIPHER_value(sk,i); |
1388 | /* Skip TLS v1.2 only ciphersuites if lower than v1.2 */ | ||
1389 | if ((c->algorithm_ssl & SSL_TLSV1_2) && | ||
1390 | (TLS1_get_client_version(s) < TLS1_2_VERSION)) | ||
1391 | continue; | ||
1361 | #ifndef OPENSSL_NO_KRB5 | 1392 | #ifndef OPENSSL_NO_KRB5 |
1362 | if (((c->algorithm_mkey & SSL_kKRB5) || (c->algorithm_auth & SSL_aKRB5)) && | 1393 | if (((c->algorithm_mkey & SSL_kKRB5) || (c->algorithm_auth & SSL_aKRB5)) && |
1363 | nokrb5) | 1394 | nokrb5) |
@@ -1375,7 +1406,7 @@ int ssl_cipher_list_to_bytes(SSL *s,STACK_OF(SSL_CIPHER) *sk,unsigned char *p, | |||
1375 | /* If p == q, no ciphers and caller indicates an error. Otherwise | 1406 | /* If p == q, no ciphers and caller indicates an error. Otherwise |
1376 | * add SCSV if not renegotiating. | 1407 | * add SCSV if not renegotiating. |
1377 | */ | 1408 | */ |
1378 | if (p != q && !s->new_session) | 1409 | if (p != q && !s->renegotiate) |
1379 | { | 1410 | { |
1380 | static SSL_CIPHER scsv = | 1411 | static SSL_CIPHER scsv = |
1381 | { | 1412 | { |
@@ -1422,7 +1453,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num, | |||
1422 | (p[n-1] == (SSL3_CK_SCSV & 0xff))) | 1453 | (p[n-1] == (SSL3_CK_SCSV & 0xff))) |
1423 | { | 1454 | { |
1424 | /* SCSV fatal if renegotiating */ | 1455 | /* SCSV fatal if renegotiating */ |
1425 | if (s->new_session) | 1456 | if (s->renegotiate) |
1426 | { | 1457 | { |
1427 | SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING); | 1458 | SSLerr(SSL_F_SSL_BYTES_TO_CIPHER_LIST,SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING); |
1428 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE); | 1459 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE); |
@@ -1479,8 +1510,137 @@ int SSL_get_servername_type(const SSL *s) | |||
1479 | return TLSEXT_NAMETYPE_host_name; | 1510 | return TLSEXT_NAMETYPE_host_name; |
1480 | return -1; | 1511 | return -1; |
1481 | } | 1512 | } |
1513 | |||
1514 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
1515 | /* SSL_select_next_proto implements the standard protocol selection. It is | ||
1516 | * expected that this function is called from the callback set by | ||
1517 | * SSL_CTX_set_next_proto_select_cb. | ||
1518 | * | ||
1519 | * The protocol data is assumed to be a vector of 8-bit, length prefixed byte | ||
1520 | * strings. The length byte itself is not included in the length. A byte | ||
1521 | * string of length 0 is invalid. No byte string may be truncated. | ||
1522 | * | ||
1523 | * The current, but experimental algorithm for selecting the protocol is: | ||
1524 | * | ||
1525 | * 1) If the server doesn't support NPN then this is indicated to the | ||
1526 | * callback. In this case, the client application has to abort the connection | ||
1527 | * or have a default application level protocol. | ||
1528 | * | ||
1529 | * 2) If the server supports NPN, but advertises an empty list then the | ||
1530 | * client selects the first protcol in its list, but indicates via the | ||
1531 | * API that this fallback case was enacted. | ||
1532 | * | ||
1533 | * 3) Otherwise, the client finds the first protocol in the server's list | ||
1534 | * that it supports and selects this protocol. This is because it's | ||
1535 | * assumed that the server has better information about which protocol | ||
1536 | * a client should use. | ||
1537 | * | ||
1538 | * 4) If the client doesn't support any of the server's advertised | ||
1539 | * protocols, then this is treated the same as case 2. | ||
1540 | * | ||
1541 | * It returns either | ||
1542 | * OPENSSL_NPN_NEGOTIATED if a common protocol was found, or | ||
1543 | * OPENSSL_NPN_NO_OVERLAP if the fallback case was reached. | ||
1544 | */ | ||
1545 | int SSL_select_next_proto(unsigned char **out, unsigned char *outlen, const unsigned char *server, unsigned int server_len, const unsigned char *client, unsigned int client_len) | ||
1546 | { | ||
1547 | unsigned int i, j; | ||
1548 | const unsigned char *result; | ||
1549 | int status = OPENSSL_NPN_UNSUPPORTED; | ||
1550 | |||
1551 | /* For each protocol in server preference order, see if we support it. */ | ||
1552 | for (i = 0; i < server_len; ) | ||
1553 | { | ||
1554 | for (j = 0; j < client_len; ) | ||
1555 | { | ||
1556 | if (server[i] == client[j] && | ||
1557 | memcmp(&server[i+1], &client[j+1], server[i]) == 0) | ||
1558 | { | ||
1559 | /* We found a match */ | ||
1560 | result = &server[i]; | ||
1561 | status = OPENSSL_NPN_NEGOTIATED; | ||
1562 | goto found; | ||
1563 | } | ||
1564 | j += client[j]; | ||
1565 | j++; | ||
1566 | } | ||
1567 | i += server[i]; | ||
1568 | i++; | ||
1569 | } | ||
1570 | |||
1571 | /* There's no overlap between our protocols and the server's list. */ | ||
1572 | result = client; | ||
1573 | status = OPENSSL_NPN_NO_OVERLAP; | ||
1574 | |||
1575 | found: | ||
1576 | *out = (unsigned char *) result + 1; | ||
1577 | *outlen = result[0]; | ||
1578 | return status; | ||
1579 | } | ||
1580 | |||
1581 | /* SSL_get0_next_proto_negotiated sets *data and *len to point to the client's | ||
1582 | * requested protocol for this connection and returns 0. If the client didn't | ||
1583 | * request any protocol, then *data is set to NULL. | ||
1584 | * | ||
1585 | * Note that the client can request any protocol it chooses. The value returned | ||
1586 | * from this function need not be a member of the list of supported protocols | ||
1587 | * provided by the callback. | ||
1588 | */ | ||
1589 | void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data, unsigned *len) | ||
1590 | { | ||
1591 | *data = s->next_proto_negotiated; | ||
1592 | if (!*data) { | ||
1593 | *len = 0; | ||
1594 | } else { | ||
1595 | *len = s->next_proto_negotiated_len; | ||
1596 | } | ||
1597 | } | ||
1598 | |||
1599 | /* SSL_CTX_set_next_protos_advertised_cb sets a callback that is called when a | ||
1600 | * TLS server needs a list of supported protocols for Next Protocol | ||
1601 | * Negotiation. The returned list must be in wire format. The list is returned | ||
1602 | * by setting |out| to point to it and |outlen| to its length. This memory will | ||
1603 | * not be modified, but one should assume that the SSL* keeps a reference to | ||
1604 | * it. | ||
1605 | * | ||
1606 | * The callback should return SSL_TLSEXT_ERR_OK if it wishes to advertise. Otherwise, no | ||
1607 | * such extension will be included in the ServerHello. */ | ||
1608 | void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *ctx, int (*cb) (SSL *ssl, const unsigned char **out, unsigned int *outlen, void *arg), void *arg) | ||
1609 | { | ||
1610 | ctx->next_protos_advertised_cb = cb; | ||
1611 | ctx->next_protos_advertised_cb_arg = arg; | ||
1612 | } | ||
1613 | |||
1614 | /* SSL_CTX_set_next_proto_select_cb sets a callback that is called when a | ||
1615 | * client needs to select a protocol from the server's provided list. |out| | ||
1616 | * must be set to point to the selected protocol (which may be within |in|). | ||
1617 | * The length of the protocol name must be written into |outlen|. The server's | ||
1618 | * advertised protocols are provided in |in| and |inlen|. The callback can | ||
1619 | * assume that |in| is syntactically valid. | ||
1620 | * | ||
1621 | * The client must select a protocol. It is fatal to the connection if this | ||
1622 | * callback returns a value other than SSL_TLSEXT_ERR_OK. | ||
1623 | */ | ||
1624 | void SSL_CTX_set_next_proto_select_cb(SSL_CTX *ctx, int (*cb) (SSL *s, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg), void *arg) | ||
1625 | { | ||
1626 | ctx->next_proto_select_cb = cb; | ||
1627 | ctx->next_proto_select_cb_arg = arg; | ||
1628 | } | ||
1629 | # endif | ||
1482 | #endif | 1630 | #endif |
1483 | 1631 | ||
1632 | int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, | ||
1633 | const char *label, size_t llen, const unsigned char *p, size_t plen, | ||
1634 | int use_context) | ||
1635 | { | ||
1636 | if (s->version < TLS1_VERSION) | ||
1637 | return -1; | ||
1638 | |||
1639 | return s->method->ssl3_enc->export_keying_material(s, out, olen, label, | ||
1640 | llen, p, plen, | ||
1641 | use_context); | ||
1642 | } | ||
1643 | |||
1484 | static unsigned long ssl_session_hash(const SSL_SESSION *a) | 1644 | static unsigned long ssl_session_hash(const SSL_SESSION *a) |
1485 | { | 1645 | { |
1486 | unsigned long l; | 1646 | unsigned long l; |
@@ -1524,6 +1684,14 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth) | |||
1524 | return(NULL); | 1684 | return(NULL); |
1525 | } | 1685 | } |
1526 | 1686 | ||
1687 | #ifdef OPENSSL_FIPS | ||
1688 | if (FIPS_mode() && (meth->version < TLS1_VERSION)) | ||
1689 | { | ||
1690 | SSLerr(SSL_F_SSL_CTX_NEW, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE); | ||
1691 | return NULL; | ||
1692 | } | ||
1693 | #endif | ||
1694 | |||
1527 | if (SSL_get_ex_data_X509_STORE_CTX_idx() < 0) | 1695 | if (SSL_get_ex_data_X509_STORE_CTX_idx() < 0) |
1528 | { | 1696 | { |
1529 | SSLerr(SSL_F_SSL_CTX_NEW,SSL_R_X509_VERIFICATION_SETUP_PROBLEMS); | 1697 | SSLerr(SSL_F_SSL_CTX_NEW,SSL_R_X509_VERIFICATION_SETUP_PROBLEMS); |
@@ -1643,12 +1811,19 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth) | |||
1643 | ret->tlsext_status_cb = 0; | 1811 | ret->tlsext_status_cb = 0; |
1644 | ret->tlsext_status_arg = NULL; | 1812 | ret->tlsext_status_arg = NULL; |
1645 | 1813 | ||
1814 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
1815 | ret->next_protos_advertised_cb = 0; | ||
1816 | ret->next_proto_select_cb = 0; | ||
1817 | # endif | ||
1646 | #endif | 1818 | #endif |
1647 | #ifndef OPENSSL_NO_PSK | 1819 | #ifndef OPENSSL_NO_PSK |
1648 | ret->psk_identity_hint=NULL; | 1820 | ret->psk_identity_hint=NULL; |
1649 | ret->psk_client_callback=NULL; | 1821 | ret->psk_client_callback=NULL; |
1650 | ret->psk_server_callback=NULL; | 1822 | ret->psk_server_callback=NULL; |
1651 | #endif | 1823 | #endif |
1824 | #ifndef OPENSSL_NO_SRP | ||
1825 | SSL_CTX_SRP_CTX_init(ret); | ||
1826 | #endif | ||
1652 | #ifndef OPENSSL_NO_BUF_FREELISTS | 1827 | #ifndef OPENSSL_NO_BUF_FREELISTS |
1653 | ret->freelist_max_len = SSL_MAX_BUF_FREELIST_LEN_DEFAULT; | 1828 | ret->freelist_max_len = SSL_MAX_BUF_FREELIST_LEN_DEFAULT; |
1654 | ret->rbuf_freelist = OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST)); | 1829 | ret->rbuf_freelist = OPENSSL_malloc(sizeof(SSL3_BUF_FREELIST)); |
@@ -1777,10 +1952,16 @@ void SSL_CTX_free(SSL_CTX *a) | |||
1777 | a->comp_methods = NULL; | 1952 | a->comp_methods = NULL; |
1778 | #endif | 1953 | #endif |
1779 | 1954 | ||
1955 | if (a->srtp_profiles) | ||
1956 | sk_SRTP_PROTECTION_PROFILE_free(a->srtp_profiles); | ||
1957 | |||
1780 | #ifndef OPENSSL_NO_PSK | 1958 | #ifndef OPENSSL_NO_PSK |
1781 | if (a->psk_identity_hint) | 1959 | if (a->psk_identity_hint) |
1782 | OPENSSL_free(a->psk_identity_hint); | 1960 | OPENSSL_free(a->psk_identity_hint); |
1783 | #endif | 1961 | #endif |
1962 | #ifndef OPENSSL_NO_SRP | ||
1963 | SSL_CTX_SRP_CTX_free(a); | ||
1964 | #endif | ||
1784 | #ifndef OPENSSL_NO_ENGINE | 1965 | #ifndef OPENSSL_NO_ENGINE |
1785 | if (a->client_cert_engine) | 1966 | if (a->client_cert_engine) |
1786 | ENGINE_finish(a->client_cert_engine); | 1967 | ENGINE_finish(a->client_cert_engine); |
@@ -2034,12 +2215,13 @@ void ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher) | |||
2034 | 2215 | ||
2035 | #ifndef OPENSSL_NO_EC | 2216 | #ifndef OPENSSL_NO_EC |
2036 | 2217 | ||
2037 | int ssl_check_srvr_ecc_cert_and_alg(X509 *x, const SSL_CIPHER *cs) | 2218 | int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s) |
2038 | { | 2219 | { |
2039 | unsigned long alg_k, alg_a; | 2220 | unsigned long alg_k, alg_a; |
2040 | EVP_PKEY *pkey = NULL; | 2221 | EVP_PKEY *pkey = NULL; |
2041 | int keysize = 0; | 2222 | int keysize = 0; |
2042 | int signature_nid = 0, md_nid = 0, pk_nid = 0; | 2223 | int signature_nid = 0, md_nid = 0, pk_nid = 0; |
2224 | const SSL_CIPHER *cs = s->s3->tmp.new_cipher; | ||
2043 | 2225 | ||
2044 | alg_k = cs->algorithm_mkey; | 2226 | alg_k = cs->algorithm_mkey; |
2045 | alg_a = cs->algorithm_auth; | 2227 | alg_a = cs->algorithm_auth; |
@@ -2069,7 +2251,7 @@ int ssl_check_srvr_ecc_cert_and_alg(X509 *x, const SSL_CIPHER *cs) | |||
2069 | SSLerr(SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT); | 2251 | SSLerr(SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT); |
2070 | return 0; | 2252 | return 0; |
2071 | } | 2253 | } |
2072 | if (alg_k & SSL_kECDHe) | 2254 | if ((alg_k & SSL_kECDHe) && TLS1_get_version(s) < TLS1_2_VERSION) |
2073 | { | 2255 | { |
2074 | /* signature alg must be ECDSA */ | 2256 | /* signature alg must be ECDSA */ |
2075 | if (pk_nid != NID_X9_62_id_ecPublicKey) | 2257 | if (pk_nid != NID_X9_62_id_ecPublicKey) |
@@ -2078,7 +2260,7 @@ int ssl_check_srvr_ecc_cert_and_alg(X509 *x, const SSL_CIPHER *cs) | |||
2078 | return 0; | 2260 | return 0; |
2079 | } | 2261 | } |
2080 | } | 2262 | } |
2081 | if (alg_k & SSL_kECDHr) | 2263 | if ((alg_k & SSL_kECDHr) && TLS1_get_version(s) < TLS1_2_VERSION) |
2082 | { | 2264 | { |
2083 | /* signature alg must be RSA */ | 2265 | /* signature alg must be RSA */ |
2084 | 2266 | ||
@@ -2168,34 +2350,36 @@ X509 *ssl_get_server_send_cert(SSL *s) | |||
2168 | return(c->pkeys[i].x509); | 2350 | return(c->pkeys[i].x509); |
2169 | } | 2351 | } |
2170 | 2352 | ||
2171 | EVP_PKEY *ssl_get_sign_pkey(SSL *s,const SSL_CIPHER *cipher) | 2353 | EVP_PKEY *ssl_get_sign_pkey(SSL *s,const SSL_CIPHER *cipher, const EVP_MD **pmd) |
2172 | { | 2354 | { |
2173 | unsigned long alg_a; | 2355 | unsigned long alg_a; |
2174 | CERT *c; | 2356 | CERT *c; |
2357 | int idx = -1; | ||
2175 | 2358 | ||
2176 | alg_a = cipher->algorithm_auth; | 2359 | alg_a = cipher->algorithm_auth; |
2177 | c=s->cert; | 2360 | c=s->cert; |
2178 | 2361 | ||
2179 | if ((alg_a & SSL_aDSS) && | 2362 | if ((alg_a & SSL_aDSS) && |
2180 | (c->pkeys[SSL_PKEY_DSA_SIGN].privatekey != NULL)) | 2363 | (c->pkeys[SSL_PKEY_DSA_SIGN].privatekey != NULL)) |
2181 | return(c->pkeys[SSL_PKEY_DSA_SIGN].privatekey); | 2364 | idx = SSL_PKEY_DSA_SIGN; |
2182 | else if (alg_a & SSL_aRSA) | 2365 | else if (alg_a & SSL_aRSA) |
2183 | { | 2366 | { |
2184 | if (c->pkeys[SSL_PKEY_RSA_SIGN].privatekey != NULL) | 2367 | if (c->pkeys[SSL_PKEY_RSA_SIGN].privatekey != NULL) |
2185 | return(c->pkeys[SSL_PKEY_RSA_SIGN].privatekey); | 2368 | idx = SSL_PKEY_RSA_SIGN; |
2186 | else if (c->pkeys[SSL_PKEY_RSA_ENC].privatekey != NULL) | 2369 | else if (c->pkeys[SSL_PKEY_RSA_ENC].privatekey != NULL) |
2187 | return(c->pkeys[SSL_PKEY_RSA_ENC].privatekey); | 2370 | idx = SSL_PKEY_RSA_ENC; |
2188 | else | ||
2189 | return(NULL); | ||
2190 | } | 2371 | } |
2191 | else if ((alg_a & SSL_aECDSA) && | 2372 | else if ((alg_a & SSL_aECDSA) && |
2192 | (c->pkeys[SSL_PKEY_ECC].privatekey != NULL)) | 2373 | (c->pkeys[SSL_PKEY_ECC].privatekey != NULL)) |
2193 | return(c->pkeys[SSL_PKEY_ECC].privatekey); | 2374 | idx = SSL_PKEY_ECC; |
2194 | else /* if (alg_a & SSL_aNULL) */ | 2375 | if (idx == -1) |
2195 | { | 2376 | { |
2196 | SSLerr(SSL_F_SSL_GET_SIGN_PKEY,ERR_R_INTERNAL_ERROR); | 2377 | SSLerr(SSL_F_SSL_GET_SIGN_PKEY,ERR_R_INTERNAL_ERROR); |
2197 | return(NULL); | 2378 | return(NULL); |
2198 | } | 2379 | } |
2380 | if (pmd) | ||
2381 | *pmd = c->pkeys[idx].digest; | ||
2382 | return c->pkeys[idx].privatekey; | ||
2199 | } | 2383 | } |
2200 | 2384 | ||
2201 | void ssl_update_cache(SSL *s,int mode) | 2385 | void ssl_update_cache(SSL *s,int mode) |
@@ -2420,6 +2604,10 @@ SSL_METHOD *ssl_bad_method(int ver) | |||
2420 | 2604 | ||
2421 | const char *SSL_get_version(const SSL *s) | 2605 | const char *SSL_get_version(const SSL *s) |
2422 | { | 2606 | { |
2607 | if (s->version == TLS1_2_VERSION) | ||
2608 | return("TLSv1.2"); | ||
2609 | else if (s->version == TLS1_1_VERSION) | ||
2610 | return("TLSv1.1"); | ||
2423 | if (s->version == TLS1_VERSION) | 2611 | if (s->version == TLS1_VERSION) |
2424 | return("TLSv1"); | 2612 | return("TLSv1"); |
2425 | else if (s->version == SSL3_VERSION) | 2613 | else if (s->version == SSL3_VERSION) |
@@ -2514,6 +2702,7 @@ SSL *SSL_dup(SSL *s) | |||
2514 | ret->in_handshake = s->in_handshake; | 2702 | ret->in_handshake = s->in_handshake; |
2515 | ret->handshake_func = s->handshake_func; | 2703 | ret->handshake_func = s->handshake_func; |
2516 | ret->server = s->server; | 2704 | ret->server = s->server; |
2705 | ret->renegotiate = s->renegotiate; | ||
2517 | ret->new_session = s->new_session; | 2706 | ret->new_session = s->new_session; |
2518 | ret->quiet_shutdown = s->quiet_shutdown; | 2707 | ret->quiet_shutdown = s->quiet_shutdown; |
2519 | ret->shutdown=s->shutdown; | 2708 | ret->shutdown=s->shutdown; |
@@ -2779,6 +2968,11 @@ int SSL_state(const SSL *ssl) | |||
2779 | return(ssl->state); | 2968 | return(ssl->state); |
2780 | } | 2969 | } |
2781 | 2970 | ||
2971 | void SSL_set_state(SSL *ssl, int state) | ||
2972 | { | ||
2973 | ssl->state = state; | ||
2974 | } | ||
2975 | |||
2782 | void SSL_set_verify_result(SSL *ssl,long arg) | 2976 | void SSL_set_verify_result(SSL *ssl,long arg) |
2783 | { | 2977 | { |
2784 | ssl->verify_result=arg; | 2978 | ssl->verify_result=arg; |
@@ -3037,6 +3231,16 @@ void ssl_clear_hash_ctx(EVP_MD_CTX **hash) | |||
3037 | *hash=NULL; | 3231 | *hash=NULL; |
3038 | } | 3232 | } |
3039 | 3233 | ||
3234 | void SSL_set_debug(SSL *s, int debug) | ||
3235 | { | ||
3236 | s->debug = debug; | ||
3237 | } | ||
3238 | |||
3239 | int SSL_cache_hit(SSL *s) | ||
3240 | { | ||
3241 | return s->hit; | ||
3242 | } | ||
3243 | |||
3040 | #if defined(_WINDLL) && defined(OPENSSL_SYS_WIN16) | 3244 | #if defined(_WINDLL) && defined(OPENSSL_SYS_WIN16) |
3041 | #include "../crypto/bio/bss_file.c" | 3245 | #include "../crypto/bio/bss_file.c" |
3042 | #endif | 3246 | #endif |
@@ -3045,4 +3249,3 @@ IMPLEMENT_STACK_OF(SSL_CIPHER) | |||
3045 | IMPLEMENT_STACK_OF(SSL_COMP) | 3249 | IMPLEMENT_STACK_OF(SSL_COMP) |
3046 | IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER, | 3250 | IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER, |
3047 | ssl_cipher_id); | 3251 | ssl_cipher_id); |
3048 | |||
diff --git a/src/lib/libssl/src/ssl/ssl_locl.h b/src/lib/libssl/src/ssl/ssl_locl.h index cea622a2a6..d87fd51cfa 100644 --- a/src/lib/libssl/src/ssl/ssl_locl.h +++ b/src/lib/libssl/src/ssl/ssl_locl.h | |||
@@ -170,7 +170,7 @@ | |||
170 | # define OPENSSL_EXTERN OPENSSL_EXPORT | 170 | # define OPENSSL_EXTERN OPENSSL_EXPORT |
171 | #endif | 171 | #endif |
172 | 172 | ||
173 | #define PKCS1_CHECK | 173 | #undef PKCS1_CHECK |
174 | 174 | ||
175 | #define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \ | 175 | #define c2l(c,l) (l = ((unsigned long)(*((c)++))) , \ |
176 | l|=(((unsigned long)(*((c)++)))<< 8), \ | 176 | l|=(((unsigned long)(*((c)++)))<< 8), \ |
@@ -289,6 +289,7 @@ | |||
289 | #define SSL_kEECDH 0x00000080L /* ephemeral ECDH */ | 289 | #define SSL_kEECDH 0x00000080L /* ephemeral ECDH */ |
290 | #define SSL_kPSK 0x00000100L /* PSK */ | 290 | #define SSL_kPSK 0x00000100L /* PSK */ |
291 | #define SSL_kGOST 0x00000200L /* GOST key exchange */ | 291 | #define SSL_kGOST 0x00000200L /* GOST key exchange */ |
292 | #define SSL_kSRP 0x00000400L /* SRP */ | ||
292 | 293 | ||
293 | /* Bits for algorithm_auth (server authentication) */ | 294 | /* Bits for algorithm_auth (server authentication) */ |
294 | #define SSL_aRSA 0x00000001L /* RSA auth */ | 295 | #define SSL_aRSA 0x00000001L /* RSA auth */ |
@@ -316,21 +317,29 @@ | |||
316 | #define SSL_CAMELLIA256 0x00000200L | 317 | #define SSL_CAMELLIA256 0x00000200L |
317 | #define SSL_eGOST2814789CNT 0x00000400L | 318 | #define SSL_eGOST2814789CNT 0x00000400L |
318 | #define SSL_SEED 0x00000800L | 319 | #define SSL_SEED 0x00000800L |
320 | #define SSL_AES128GCM 0x00001000L | ||
321 | #define SSL_AES256GCM 0x00002000L | ||
319 | 322 | ||
320 | #define SSL_AES (SSL_AES128|SSL_AES256) | 323 | #define SSL_AES (SSL_AES128|SSL_AES256|SSL_AES128GCM|SSL_AES256GCM) |
321 | #define SSL_CAMELLIA (SSL_CAMELLIA128|SSL_CAMELLIA256) | 324 | #define SSL_CAMELLIA (SSL_CAMELLIA128|SSL_CAMELLIA256) |
322 | 325 | ||
323 | 326 | ||
324 | /* Bits for algorithm_mac (symmetric authentication) */ | 327 | /* Bits for algorithm_mac (symmetric authentication) */ |
328 | |||
325 | #define SSL_MD5 0x00000001L | 329 | #define SSL_MD5 0x00000001L |
326 | #define SSL_SHA1 0x00000002L | 330 | #define SSL_SHA1 0x00000002L |
327 | #define SSL_GOST94 0x00000004L | 331 | #define SSL_GOST94 0x00000004L |
328 | #define SSL_GOST89MAC 0x00000008L | 332 | #define SSL_GOST89MAC 0x00000008L |
333 | #define SSL_SHA256 0x00000010L | ||
334 | #define SSL_SHA384 0x00000020L | ||
335 | /* Not a real MAC, just an indication it is part of cipher */ | ||
336 | #define SSL_AEAD 0x00000040L | ||
329 | 337 | ||
330 | /* Bits for algorithm_ssl (protocol version) */ | 338 | /* Bits for algorithm_ssl (protocol version) */ |
331 | #define SSL_SSLV2 0x00000001L | 339 | #define SSL_SSLV2 0x00000001L |
332 | #define SSL_SSLV3 0x00000002L | 340 | #define SSL_SSLV3 0x00000002L |
333 | #define SSL_TLSV1 SSL_SSLV3 /* for now */ | 341 | #define SSL_TLSV1 SSL_SSLV3 /* for now */ |
342 | #define SSL_TLSV1_2 0x00000004L | ||
334 | 343 | ||
335 | 344 | ||
336 | /* Bits for algorithm2 (handshake digests and other extra flags) */ | 345 | /* Bits for algorithm2 (handshake digests and other extra flags) */ |
@@ -338,15 +347,21 @@ | |||
338 | #define SSL_HANDSHAKE_MAC_MD5 0x10 | 347 | #define SSL_HANDSHAKE_MAC_MD5 0x10 |
339 | #define SSL_HANDSHAKE_MAC_SHA 0x20 | 348 | #define SSL_HANDSHAKE_MAC_SHA 0x20 |
340 | #define SSL_HANDSHAKE_MAC_GOST94 0x40 | 349 | #define SSL_HANDSHAKE_MAC_GOST94 0x40 |
350 | #define SSL_HANDSHAKE_MAC_SHA256 0x80 | ||
351 | #define SSL_HANDSHAKE_MAC_SHA384 0x100 | ||
341 | #define SSL_HANDSHAKE_MAC_DEFAULT (SSL_HANDSHAKE_MAC_MD5 | SSL_HANDSHAKE_MAC_SHA) | 352 | #define SSL_HANDSHAKE_MAC_DEFAULT (SSL_HANDSHAKE_MAC_MD5 | SSL_HANDSHAKE_MAC_SHA) |
342 | 353 | ||
343 | /* When adding new digest in the ssl_ciph.c and increment SSM_MD_NUM_IDX | 354 | /* When adding new digest in the ssl_ciph.c and increment SSM_MD_NUM_IDX |
344 | * make sure to update this constant too */ | 355 | * make sure to update this constant too */ |
345 | #define SSL_MAX_DIGEST 4 | 356 | #define SSL_MAX_DIGEST 6 |
357 | |||
358 | #define TLS1_PRF_DGST_MASK (0xff << TLS1_PRF_DGST_SHIFT) | ||
346 | 359 | ||
347 | #define TLS1_PRF_DGST_SHIFT 8 | 360 | #define TLS1_PRF_DGST_SHIFT 10 |
348 | #define TLS1_PRF_MD5 (SSL_HANDSHAKE_MAC_MD5 << TLS1_PRF_DGST_SHIFT) | 361 | #define TLS1_PRF_MD5 (SSL_HANDSHAKE_MAC_MD5 << TLS1_PRF_DGST_SHIFT) |
349 | #define TLS1_PRF_SHA1 (SSL_HANDSHAKE_MAC_SHA << TLS1_PRF_DGST_SHIFT) | 362 | #define TLS1_PRF_SHA1 (SSL_HANDSHAKE_MAC_SHA << TLS1_PRF_DGST_SHIFT) |
363 | #define TLS1_PRF_SHA256 (SSL_HANDSHAKE_MAC_SHA256 << TLS1_PRF_DGST_SHIFT) | ||
364 | #define TLS1_PRF_SHA384 (SSL_HANDSHAKE_MAC_SHA384 << TLS1_PRF_DGST_SHIFT) | ||
350 | #define TLS1_PRF_GOST94 (SSL_HANDSHAKE_MAC_GOST94 << TLS1_PRF_DGST_SHIFT) | 365 | #define TLS1_PRF_GOST94 (SSL_HANDSHAKE_MAC_GOST94 << TLS1_PRF_DGST_SHIFT) |
351 | #define TLS1_PRF (TLS1_PRF_MD5 | TLS1_PRF_SHA1) | 366 | #define TLS1_PRF (TLS1_PRF_MD5 | TLS1_PRF_SHA1) |
352 | 367 | ||
@@ -457,6 +472,8 @@ typedef struct cert_pkey_st | |||
457 | { | 472 | { |
458 | X509 *x509; | 473 | X509 *x509; |
459 | EVP_PKEY *privatekey; | 474 | EVP_PKEY *privatekey; |
475 | /* Digest to use when signing */ | ||
476 | const EVP_MD *digest; | ||
460 | } CERT_PKEY; | 477 | } CERT_PKEY; |
461 | 478 | ||
462 | typedef struct cert_st | 479 | typedef struct cert_st |
@@ -554,6 +571,10 @@ typedef struct ssl3_enc_method | |||
554 | const char *server_finished_label; | 571 | const char *server_finished_label; |
555 | int server_finished_label_len; | 572 | int server_finished_label_len; |
556 | int (*alert_value)(int); | 573 | int (*alert_value)(int); |
574 | int (*export_keying_material)(SSL *, unsigned char *, size_t, | ||
575 | const char *, size_t, | ||
576 | const unsigned char *, size_t, | ||
577 | int use_context); | ||
557 | } SSL3_ENC_METHOD; | 578 | } SSL3_ENC_METHOD; |
558 | 579 | ||
559 | #ifndef OPENSSL_NO_COMP | 580 | #ifndef OPENSSL_NO_COMP |
@@ -591,11 +612,12 @@ extern SSL3_ENC_METHOD TLSv1_enc_data; | |||
591 | extern SSL3_ENC_METHOD SSLv3_enc_data; | 612 | extern SSL3_ENC_METHOD SSLv3_enc_data; |
592 | extern SSL3_ENC_METHOD DTLSv1_enc_data; | 613 | extern SSL3_ENC_METHOD DTLSv1_enc_data; |
593 | 614 | ||
594 | #define IMPLEMENT_tls1_meth_func(func_name, s_accept, s_connect, s_get_meth) \ | 615 | #define IMPLEMENT_tls_meth_func(version, func_name, s_accept, s_connect, \ |
616 | s_get_meth) \ | ||
595 | const SSL_METHOD *func_name(void) \ | 617 | const SSL_METHOD *func_name(void) \ |
596 | { \ | 618 | { \ |
597 | static const SSL_METHOD func_name##_data= { \ | 619 | static const SSL_METHOD func_name##_data= { \ |
598 | TLS1_VERSION, \ | 620 | version, \ |
599 | tls1_new, \ | 621 | tls1_new, \ |
600 | tls1_clear, \ | 622 | tls1_clear, \ |
601 | tls1_free, \ | 623 | tls1_free, \ |
@@ -669,7 +691,7 @@ const SSL_METHOD *func_name(void) \ | |||
669 | const SSL_METHOD *func_name(void) \ | 691 | const SSL_METHOD *func_name(void) \ |
670 | { \ | 692 | { \ |
671 | static const SSL_METHOD func_name##_data= { \ | 693 | static const SSL_METHOD func_name##_data= { \ |
672 | TLS1_VERSION, \ | 694 | TLS1_2_VERSION, \ |
673 | tls1_new, \ | 695 | tls1_new, \ |
674 | tls1_clear, \ | 696 | tls1_clear, \ |
675 | tls1_free, \ | 697 | tls1_free, \ |
@@ -752,7 +774,7 @@ const SSL_METHOD *func_name(void) \ | |||
752 | ssl3_read, \ | 774 | ssl3_read, \ |
753 | ssl3_peek, \ | 775 | ssl3_peek, \ |
754 | ssl3_write, \ | 776 | ssl3_write, \ |
755 | ssl3_shutdown, \ | 777 | dtls1_shutdown, \ |
756 | ssl3_renegotiate, \ | 778 | ssl3_renegotiate, \ |
757 | ssl3_renegotiate_check, \ | 779 | ssl3_renegotiate_check, \ |
758 | dtls1_get_message, \ | 780 | dtls1_get_message, \ |
@@ -809,7 +831,7 @@ int ssl_undefined_function(SSL *s); | |||
809 | int ssl_undefined_void_function(void); | 831 | int ssl_undefined_void_function(void); |
810 | int ssl_undefined_const_function(const SSL *s); | 832 | int ssl_undefined_const_function(const SSL *s); |
811 | X509 *ssl_get_server_send_cert(SSL *); | 833 | X509 *ssl_get_server_send_cert(SSL *); |
812 | EVP_PKEY *ssl_get_sign_pkey(SSL *,const SSL_CIPHER *); | 834 | EVP_PKEY *ssl_get_sign_pkey(SSL *s,const SSL_CIPHER *c, const EVP_MD **pmd); |
813 | int ssl_cert_type(X509 *x,EVP_PKEY *pkey); | 835 | int ssl_cert_type(X509 *x,EVP_PKEY *pkey); |
814 | void ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher); | 836 | void ssl_set_cert_masks(CERT *c, const SSL_CIPHER *cipher); |
815 | STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s); | 837 | STACK_OF(SSL_CIPHER) *ssl_get_ciphers_by_id(SSL *s); |
@@ -943,6 +965,7 @@ void dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr); | |||
943 | void dtls1_reset_seq_numbers(SSL *s, int rw); | 965 | void dtls1_reset_seq_numbers(SSL *s, int rw); |
944 | long dtls1_default_timeout(void); | 966 | long dtls1_default_timeout(void); |
945 | struct timeval* dtls1_get_timeout(SSL *s, struct timeval* timeleft); | 967 | struct timeval* dtls1_get_timeout(SSL *s, struct timeval* timeleft); |
968 | int dtls1_check_timeout_num(SSL *s); | ||
946 | int dtls1_handle_timeout(SSL *s); | 969 | int dtls1_handle_timeout(SSL *s); |
947 | const SSL_CIPHER *dtls1_get_cipher(unsigned int u); | 970 | const SSL_CIPHER *dtls1_get_cipher(unsigned int u); |
948 | void dtls1_start_timer(SSL *s); | 971 | void dtls1_start_timer(SSL *s); |
@@ -968,6 +991,9 @@ int ssl3_get_server_certificate(SSL *s); | |||
968 | int ssl3_check_cert_and_algorithm(SSL *s); | 991 | int ssl3_check_cert_and_algorithm(SSL *s); |
969 | #ifndef OPENSSL_NO_TLSEXT | 992 | #ifndef OPENSSL_NO_TLSEXT |
970 | int ssl3_check_finished(SSL *s); | 993 | int ssl3_check_finished(SSL *s); |
994 | # ifndef OPENSSL_NO_NEXTPROTONEG | ||
995 | int ssl3_send_next_proto(SSL *s); | ||
996 | # endif | ||
971 | #endif | 997 | #endif |
972 | 998 | ||
973 | int dtls1_client_hello(SSL *s); | 999 | int dtls1_client_hello(SSL *s); |
@@ -986,6 +1012,9 @@ int ssl3_check_client_hello(SSL *s); | |||
986 | int ssl3_get_client_certificate(SSL *s); | 1012 | int ssl3_get_client_certificate(SSL *s); |
987 | int ssl3_get_client_key_exchange(SSL *s); | 1013 | int ssl3_get_client_key_exchange(SSL *s); |
988 | int ssl3_get_cert_verify(SSL *s); | 1014 | int ssl3_get_cert_verify(SSL *s); |
1015 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1016 | int ssl3_get_next_proto(SSL *s); | ||
1017 | #endif | ||
989 | 1018 | ||
990 | int dtls1_send_hello_request(SSL *s); | 1019 | int dtls1_send_hello_request(SSL *s); |
991 | int dtls1_send_server_hello(SSL *s); | 1020 | int dtls1_send_server_hello(SSL *s); |
@@ -1013,6 +1042,7 @@ int dtls1_connect(SSL *s); | |||
1013 | void dtls1_free(SSL *s); | 1042 | void dtls1_free(SSL *s); |
1014 | void dtls1_clear(SSL *s); | 1043 | void dtls1_clear(SSL *s); |
1015 | long dtls1_ctrl(SSL *s,int cmd, long larg, void *parg); | 1044 | long dtls1_ctrl(SSL *s,int cmd, long larg, void *parg); |
1045 | int dtls1_shutdown(SSL *s); | ||
1016 | 1046 | ||
1017 | long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); | 1047 | long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok); |
1018 | int dtls1_get_record(SSL *s); | 1048 | int dtls1_get_record(SSL *s); |
@@ -1033,12 +1063,15 @@ int tls1_cert_verify_mac(SSL *s, int md_nid, unsigned char *p); | |||
1033 | int tls1_mac(SSL *ssl, unsigned char *md, int snd); | 1063 | int tls1_mac(SSL *ssl, unsigned char *md, int snd); |
1034 | int tls1_generate_master_secret(SSL *s, unsigned char *out, | 1064 | int tls1_generate_master_secret(SSL *s, unsigned char *out, |
1035 | unsigned char *p, int len); | 1065 | unsigned char *p, int len); |
1066 | int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, | ||
1067 | const char *label, size_t llen, | ||
1068 | const unsigned char *p, size_t plen, int use_context); | ||
1036 | int tls1_alert_code(int code); | 1069 | int tls1_alert_code(int code); |
1037 | int ssl3_alert_code(int code); | 1070 | int ssl3_alert_code(int code); |
1038 | int ssl_ok(SSL *s); | 1071 | int ssl_ok(SSL *s); |
1039 | 1072 | ||
1040 | #ifndef OPENSSL_NO_ECDH | 1073 | #ifndef OPENSSL_NO_ECDH |
1041 | int ssl_check_srvr_ecc_cert_and_alg(X509 *x, const SSL_CIPHER *cs); | 1074 | int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s); |
1042 | #endif | 1075 | #endif |
1043 | 1076 | ||
1044 | SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n); | 1077 | SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n); |
@@ -1058,6 +1091,13 @@ int ssl_prepare_serverhello_tlsext(SSL *s); | |||
1058 | int ssl_check_clienthello_tlsext(SSL *s); | 1091 | int ssl_check_clienthello_tlsext(SSL *s); |
1059 | int ssl_check_serverhello_tlsext(SSL *s); | 1092 | int ssl_check_serverhello_tlsext(SSL *s); |
1060 | 1093 | ||
1094 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1095 | int tls1_heartbeat(SSL *s); | ||
1096 | int dtls1_heartbeat(SSL *s); | ||
1097 | int tls1_process_heartbeat(SSL *s); | ||
1098 | int dtls1_process_heartbeat(SSL *s); | ||
1099 | #endif | ||
1100 | |||
1061 | #ifdef OPENSSL_NO_SHA256 | 1101 | #ifdef OPENSSL_NO_SHA256 |
1062 | #define tlsext_tick_md EVP_sha1 | 1102 | #define tlsext_tick_md EVP_sha1 |
1063 | #else | 1103 | #else |
@@ -1065,6 +1105,12 @@ int ssl_check_serverhello_tlsext(SSL *s); | |||
1065 | #endif | 1105 | #endif |
1066 | int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, | 1106 | int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, |
1067 | const unsigned char *limit, SSL_SESSION **ret); | 1107 | const unsigned char *limit, SSL_SESSION **ret); |
1108 | |||
1109 | int tls12_get_sigandhash(unsigned char *p, const EVP_PKEY *pk, | ||
1110 | const EVP_MD *md); | ||
1111 | int tls12_get_sigid(const EVP_PKEY *pk); | ||
1112 | const EVP_MD *tls12_get_hash(unsigned char hash_alg); | ||
1113 | |||
1068 | #endif | 1114 | #endif |
1069 | EVP_MD_CTX* ssl_replace_hash(EVP_MD_CTX **hash,const EVP_MD *md) ; | 1115 | EVP_MD_CTX* ssl_replace_hash(EVP_MD_CTX **hash,const EVP_MD *md) ; |
1070 | void ssl_clear_hash_ctx(EVP_MD_CTX **hash); | 1116 | void ssl_clear_hash_ctx(EVP_MD_CTX **hash); |
@@ -1076,4 +1122,13 @@ int ssl_add_clienthello_renegotiate_ext(SSL *s, unsigned char *p, int *len, | |||
1076 | int maxlen); | 1122 | int maxlen); |
1077 | int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len, | 1123 | int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len, |
1078 | int *al); | 1124 | int *al); |
1125 | long ssl_get_algorithm2(SSL *s); | ||
1126 | int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize); | ||
1127 | int tls12_get_req_sig_algs(SSL *s, unsigned char *p); | ||
1128 | |||
1129 | int ssl_add_clienthello_use_srtp_ext(SSL *s, unsigned char *p, int *len, int maxlen); | ||
1130 | int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len,int *al); | ||
1131 | int ssl_add_serverhello_use_srtp_ext(SSL *s, unsigned char *p, int *len, int maxlen); | ||
1132 | int ssl_parse_serverhello_use_srtp_ext(SSL *s, unsigned char *d, int len,int *al); | ||
1133 | |||
1079 | #endif | 1134 | #endif |
diff --git a/src/lib/libssl/src/ssl/ssl_sess.c b/src/lib/libssl/src/ssl/ssl_sess.c index 8e5d8a0972..ad40fadd02 100644 --- a/src/lib/libssl/src/ssl/ssl_sess.c +++ b/src/lib/libssl/src/ssl/ssl_sess.c | |||
@@ -218,6 +218,9 @@ SSL_SESSION *SSL_SESSION_new(void) | |||
218 | ss->psk_identity_hint=NULL; | 218 | ss->psk_identity_hint=NULL; |
219 | ss->psk_identity=NULL; | 219 | ss->psk_identity=NULL; |
220 | #endif | 220 | #endif |
221 | #ifndef OPENSSL_NO_SRP | ||
222 | ss->srp_username=NULL; | ||
223 | #endif | ||
221 | return(ss); | 224 | return(ss); |
222 | } | 225 | } |
223 | 226 | ||
@@ -228,6 +231,11 @@ const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len) | |||
228 | return s->session_id; | 231 | return s->session_id; |
229 | } | 232 | } |
230 | 233 | ||
234 | unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s) | ||
235 | { | ||
236 | return s->compress_meth; | ||
237 | } | ||
238 | |||
231 | /* Even with SSLv2, we have 16 bytes (128 bits) of session ID space. SSLv3/TLSv1 | 239 | /* Even with SSLv2, we have 16 bytes (128 bits) of session ID space. SSLv3/TLSv1 |
232 | * has 32 bytes (256 bits). As such, filling the ID with random gunk repeatedly | 240 | * has 32 bytes (256 bits). As such, filling the ID with random gunk repeatedly |
233 | * until we have no conflict is going to complete in one iteration pretty much | 241 | * until we have no conflict is going to complete in one iteration pretty much |
@@ -300,6 +308,16 @@ int ssl_get_new_session(SSL *s, int session) | |||
300 | ss->ssl_version=TLS1_VERSION; | 308 | ss->ssl_version=TLS1_VERSION; |
301 | ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; | 309 | ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; |
302 | } | 310 | } |
311 | else if (s->version == TLS1_1_VERSION) | ||
312 | { | ||
313 | ss->ssl_version=TLS1_1_VERSION; | ||
314 | ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; | ||
315 | } | ||
316 | else if (s->version == TLS1_2_VERSION) | ||
317 | { | ||
318 | ss->ssl_version=TLS1_2_VERSION; | ||
319 | ss->session_id_length=SSL3_SSL_SESSION_ID_LENGTH; | ||
320 | } | ||
303 | else if (s->version == DTLS1_BAD_VER) | 321 | else if (s->version == DTLS1_BAD_VER) |
304 | { | 322 | { |
305 | ss->ssl_version=DTLS1_BAD_VER; | 323 | ss->ssl_version=DTLS1_BAD_VER; |
@@ -423,6 +441,25 @@ int ssl_get_new_session(SSL *s, int session) | |||
423 | return(1); | 441 | return(1); |
424 | } | 442 | } |
425 | 443 | ||
444 | /* ssl_get_prev attempts to find an SSL_SESSION to be used to resume this | ||
445 | * connection. It is only called by servers. | ||
446 | * | ||
447 | * session_id: points at the session ID in the ClientHello. This code will | ||
448 | * read past the end of this in order to parse out the session ticket | ||
449 | * extension, if any. | ||
450 | * len: the length of the session ID. | ||
451 | * limit: a pointer to the first byte after the ClientHello. | ||
452 | * | ||
453 | * Returns: | ||
454 | * -1: error | ||
455 | * 0: a session may have been found. | ||
456 | * | ||
457 | * Side effects: | ||
458 | * - If a session is found then s->session is pointed at it (after freeing an | ||
459 | * existing session if need be) and s->verify_result is set from the session. | ||
460 | * - Both for new and resumed sessions, s->tlsext_ticket_expected is set to 1 | ||
461 | * if the server should issue a new session ticket (to 0 otherwise). | ||
462 | */ | ||
426 | int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | 463 | int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, |
427 | const unsigned char *limit) | 464 | const unsigned char *limit) |
428 | { | 465 | { |
@@ -430,27 +467,39 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | |||
430 | 467 | ||
431 | SSL_SESSION *ret=NULL; | 468 | SSL_SESSION *ret=NULL; |
432 | int fatal = 0; | 469 | int fatal = 0; |
470 | int try_session_cache = 1; | ||
433 | #ifndef OPENSSL_NO_TLSEXT | 471 | #ifndef OPENSSL_NO_TLSEXT |
434 | int r; | 472 | int r; |
435 | #endif | 473 | #endif |
436 | 474 | ||
437 | if (len > SSL_MAX_SSL_SESSION_ID_LENGTH) | 475 | if (len > SSL_MAX_SSL_SESSION_ID_LENGTH) |
438 | goto err; | 476 | goto err; |
477 | |||
478 | if (len == 0) | ||
479 | try_session_cache = 0; | ||
480 | |||
439 | #ifndef OPENSSL_NO_TLSEXT | 481 | #ifndef OPENSSL_NO_TLSEXT |
440 | r = tls1_process_ticket(s, session_id, len, limit, &ret); | 482 | r = tls1_process_ticket(s, session_id, len, limit, &ret); /* sets s->tlsext_ticket_expected */ |
441 | if (r == -1) | 483 | switch (r) |
442 | { | 484 | { |
485 | case -1: /* Error during processing */ | ||
443 | fatal = 1; | 486 | fatal = 1; |
444 | goto err; | 487 | goto err; |
488 | case 0: /* No ticket found */ | ||
489 | case 1: /* Zero length ticket found */ | ||
490 | break; /* Ok to carry on processing session id. */ | ||
491 | case 2: /* Ticket found but not decrypted. */ | ||
492 | case 3: /* Ticket decrypted, *ret has been set. */ | ||
493 | try_session_cache = 0; | ||
494 | break; | ||
495 | default: | ||
496 | abort(); | ||
445 | } | 497 | } |
446 | else if (r == 0 || (!ret && !len)) | ||
447 | goto err; | ||
448 | else if (!ret && !(s->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) | ||
449 | #else | ||
450 | if (len == 0) | ||
451 | goto err; | ||
452 | if (!(s->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) | ||
453 | #endif | 498 | #endif |
499 | |||
500 | if (try_session_cache && | ||
501 | ret == NULL && | ||
502 | !(s->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) | ||
454 | { | 503 | { |
455 | SSL_SESSION data; | 504 | SSL_SESSION data; |
456 | data.ssl_version=s->version; | 505 | data.ssl_version=s->version; |
@@ -461,20 +510,22 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | |||
461 | CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX); | 510 | CRYPTO_r_lock(CRYPTO_LOCK_SSL_CTX); |
462 | ret=lh_SSL_SESSION_retrieve(s->session_ctx->sessions,&data); | 511 | ret=lh_SSL_SESSION_retrieve(s->session_ctx->sessions,&data); |
463 | if (ret != NULL) | 512 | if (ret != NULL) |
464 | /* don't allow other threads to steal it: */ | 513 | { |
465 | CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION); | 514 | /* don't allow other threads to steal it: */ |
515 | CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION); | ||
516 | } | ||
466 | CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX); | 517 | CRYPTO_r_unlock(CRYPTO_LOCK_SSL_CTX); |
518 | if (ret == NULL) | ||
519 | s->session_ctx->stats.sess_miss++; | ||
467 | } | 520 | } |
468 | 521 | ||
469 | if (ret == NULL) | 522 | if (try_session_cache && |
523 | ret == NULL && | ||
524 | s->session_ctx->get_session_cb != NULL) | ||
470 | { | 525 | { |
471 | int copy=1; | 526 | int copy=1; |
472 | 527 | ||
473 | s->session_ctx->stats.sess_miss++; | 528 | if ((ret=s->session_ctx->get_session_cb(s,session_id,len,©))) |
474 | ret=NULL; | ||
475 | if (s->session_ctx->get_session_cb != NULL | ||
476 | && (ret=s->session_ctx->get_session_cb(s,session_id,len,©)) | ||
477 | != NULL) | ||
478 | { | 529 | { |
479 | s->session_ctx->stats.sess_cb_hit++; | 530 | s->session_ctx->stats.sess_cb_hit++; |
480 | 531 | ||
@@ -493,23 +544,18 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | |||
493 | * things are very strange */ | 544 | * things are very strange */ |
494 | SSL_CTX_add_session(s->session_ctx,ret); | 545 | SSL_CTX_add_session(s->session_ctx,ret); |
495 | } | 546 | } |
496 | if (ret == NULL) | ||
497 | goto err; | ||
498 | } | 547 | } |
499 | 548 | ||
500 | /* Now ret is non-NULL, and we own one of its reference counts. */ | 549 | if (ret == NULL) |
550 | goto err; | ||
551 | |||
552 | /* Now ret is non-NULL and we own one of its reference counts. */ | ||
501 | 553 | ||
502 | if (ret->sid_ctx_length != s->sid_ctx_length | 554 | if (ret->sid_ctx_length != s->sid_ctx_length |
503 | || memcmp(ret->sid_ctx,s->sid_ctx,ret->sid_ctx_length)) | 555 | || memcmp(ret->sid_ctx,s->sid_ctx,ret->sid_ctx_length)) |
504 | { | 556 | { |
505 | /* We've found the session named by the client, but we don't | 557 | /* We have the session requested by the client, but we don't |
506 | * want to use it in this context. */ | 558 | * want to use it in this context. */ |
507 | |||
508 | #if 0 /* The client cannot always know when a session is not appropriate, | ||
509 | * so we shouldn't generate an error message. */ | ||
510 | |||
511 | SSLerr(SSL_F_SSL_GET_PREV_SESSION,SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); | ||
512 | #endif | ||
513 | goto err; /* treat like cache miss */ | 559 | goto err; /* treat like cache miss */ |
514 | } | 560 | } |
515 | 561 | ||
@@ -546,39 +592,38 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, | |||
546 | goto err; | 592 | goto err; |
547 | } | 593 | } |
548 | 594 | ||
549 | |||
550 | #if 0 /* This is way too late. */ | ||
551 | |||
552 | /* If a thread got the session, then 'swaped', and another got | ||
553 | * it and then due to a time-out decided to 'OPENSSL_free' it we could | ||
554 | * be in trouble. So I'll increment it now, then double decrement | ||
555 | * later - am I speaking rubbish?. */ | ||
556 | CRYPTO_add(&ret->references,1,CRYPTO_LOCK_SSL_SESSION); | ||
557 | #endif | ||
558 | |||
559 | if (ret->timeout < (long)(time(NULL) - ret->time)) /* timeout */ | 595 | if (ret->timeout < (long)(time(NULL) - ret->time)) /* timeout */ |
560 | { | 596 | { |
561 | s->session_ctx->stats.sess_timeout++; | 597 | s->session_ctx->stats.sess_timeout++; |
562 | /* remove it from the cache */ | 598 | if (try_session_cache) |
563 | SSL_CTX_remove_session(s->session_ctx,ret); | 599 | { |
600 | /* session was from the cache, so remove it */ | ||
601 | SSL_CTX_remove_session(s->session_ctx,ret); | ||
602 | } | ||
564 | goto err; | 603 | goto err; |
565 | } | 604 | } |
566 | 605 | ||
567 | s->session_ctx->stats.sess_hit++; | 606 | s->session_ctx->stats.sess_hit++; |
568 | 607 | ||
569 | /* ret->time=time(NULL); */ /* rezero timeout? */ | ||
570 | /* again, just leave the session | ||
571 | * if it is the same session, we have just incremented and | ||
572 | * then decremented the reference count :-) */ | ||
573 | if (s->session != NULL) | 608 | if (s->session != NULL) |
574 | SSL_SESSION_free(s->session); | 609 | SSL_SESSION_free(s->session); |
575 | s->session=ret; | 610 | s->session=ret; |
576 | s->verify_result = s->session->verify_result; | 611 | s->verify_result = s->session->verify_result; |
577 | return(1); | 612 | return 1; |
578 | 613 | ||
579 | err: | 614 | err: |
580 | if (ret != NULL) | 615 | if (ret != NULL) |
616 | { | ||
581 | SSL_SESSION_free(ret); | 617 | SSL_SESSION_free(ret); |
618 | #ifndef OPENSSL_NO_TLSEXT | ||
619 | if (!try_session_cache) | ||
620 | { | ||
621 | /* The session was from a ticket, so we should | ||
622 | * issue a ticket for the new session */ | ||
623 | s->tlsext_ticket_expected = 1; | ||
624 | } | ||
625 | #endif | ||
626 | } | ||
582 | if (fatal) | 627 | if (fatal) |
583 | return -1; | 628 | return -1; |
584 | else | 629 | else |
@@ -729,6 +774,10 @@ void SSL_SESSION_free(SSL_SESSION *ss) | |||
729 | if (ss->psk_identity != NULL) | 774 | if (ss->psk_identity != NULL) |
730 | OPENSSL_free(ss->psk_identity); | 775 | OPENSSL_free(ss->psk_identity); |
731 | #endif | 776 | #endif |
777 | #ifndef OPENSSL_NO_SRP | ||
778 | if (ss->srp_username != NULL) | ||
779 | OPENSSL_free(ss->srp_username); | ||
780 | #endif | ||
732 | OPENSSL_cleanse(ss,sizeof(*ss)); | 781 | OPENSSL_cleanse(ss,sizeof(*ss)); |
733 | OPENSSL_free(ss); | 782 | OPENSSL_free(ss); |
734 | } | 783 | } |
@@ -753,10 +802,6 @@ int SSL_set_session(SSL *s, SSL_SESSION *session) | |||
753 | { | 802 | { |
754 | if (!SSL_set_ssl_method(s,meth)) | 803 | if (!SSL_set_ssl_method(s,meth)) |
755 | return(0); | 804 | return(0); |
756 | if (s->ctx->session_timeout == 0) | ||
757 | session->timeout=SSL_get_default_timeout(s); | ||
758 | else | ||
759 | session->timeout=s->ctx->session_timeout; | ||
760 | } | 805 | } |
761 | 806 | ||
762 | #ifndef OPENSSL_NO_KRB5 | 807 | #ifndef OPENSSL_NO_KRB5 |
@@ -824,6 +869,25 @@ long SSL_SESSION_set_time(SSL_SESSION *s, long t) | |||
824 | return(t); | 869 | return(t); |
825 | } | 870 | } |
826 | 871 | ||
872 | X509 *SSL_SESSION_get0_peer(SSL_SESSION *s) | ||
873 | { | ||
874 | return s->peer; | ||
875 | } | ||
876 | |||
877 | int SSL_SESSION_set1_id_context(SSL_SESSION *s,const unsigned char *sid_ctx, | ||
878 | unsigned int sid_ctx_len) | ||
879 | { | ||
880 | if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH) | ||
881 | { | ||
882 | SSLerr(SSL_F_SSL_SESSION_SET1_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); | ||
883 | return 0; | ||
884 | } | ||
885 | s->sid_ctx_length=sid_ctx_len; | ||
886 | memcpy(s->sid_ctx,sid_ctx,sid_ctx_len); | ||
887 | |||
888 | return 1; | ||
889 | } | ||
890 | |||
827 | long SSL_CTX_set_timeout(SSL_CTX *s, long t) | 891 | long SSL_CTX_set_timeout(SSL_CTX *s, long t) |
828 | { | 892 | { |
829 | long l; | 893 | long l; |
diff --git a/src/lib/libssl/src/ssl/ssl_txt.c b/src/lib/libssl/src/ssl/ssl_txt.c index 3122440e26..6479d52c0c 100644 --- a/src/lib/libssl/src/ssl/ssl_txt.c +++ b/src/lib/libssl/src/ssl/ssl_txt.c | |||
@@ -115,6 +115,10 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) | |||
115 | s="SSLv2"; | 115 | s="SSLv2"; |
116 | else if (x->ssl_version == SSL3_VERSION) | 116 | else if (x->ssl_version == SSL3_VERSION) |
117 | s="SSLv3"; | 117 | s="SSLv3"; |
118 | else if (x->ssl_version == TLS1_2_VERSION) | ||
119 | s="TLSv1.2"; | ||
120 | else if (x->ssl_version == TLS1_1_VERSION) | ||
121 | s="TLSv1.1"; | ||
118 | else if (x->ssl_version == TLS1_VERSION) | 122 | else if (x->ssl_version == TLS1_VERSION) |
119 | s="TLSv1"; | 123 | s="TLSv1"; |
120 | else if (x->ssl_version == DTLS1_VERSION) | 124 | else if (x->ssl_version == DTLS1_VERSION) |
@@ -187,6 +191,10 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) | |||
187 | if (BIO_puts(bp,"\n PSK identity hint: ") <= 0) goto err; | 191 | if (BIO_puts(bp,"\n PSK identity hint: ") <= 0) goto err; |
188 | if (BIO_printf(bp, "%s", x->psk_identity_hint ? x->psk_identity_hint : "None") <= 0) goto err; | 192 | if (BIO_printf(bp, "%s", x->psk_identity_hint ? x->psk_identity_hint : "None") <= 0) goto err; |
189 | #endif | 193 | #endif |
194 | #ifndef OPENSSL_NO_SRP | ||
195 | if (BIO_puts(bp,"\n SRP username: ") <= 0) goto err; | ||
196 | if (BIO_printf(bp, "%s", x->srp_username ? x->srp_username : "None") <= 0) goto err; | ||
197 | #endif | ||
190 | #ifndef OPENSSL_NO_TLSEXT | 198 | #ifndef OPENSSL_NO_TLSEXT |
191 | if (x->tlsext_tick_lifetime_hint) | 199 | if (x->tlsext_tick_lifetime_hint) |
192 | { | 200 | { |
diff --git a/src/lib/libssl/src/ssl/ssltest.c b/src/lib/libssl/src/ssl/ssltest.c index 0bb4fa43bd..0f8fd3902d 100644 --- a/src/lib/libssl/src/ssl/ssltest.c +++ b/src/lib/libssl/src/ssl/ssltest.c | |||
@@ -181,6 +181,9 @@ | |||
181 | #ifndef OPENSSL_NO_DH | 181 | #ifndef OPENSSL_NO_DH |
182 | #include <openssl/dh.h> | 182 | #include <openssl/dh.h> |
183 | #endif | 183 | #endif |
184 | #ifndef OPENSSL_NO_SRP | ||
185 | #include <openssl/srp.h> | ||
186 | #endif | ||
184 | #include <openssl/bn.h> | 187 | #include <openssl/bn.h> |
185 | 188 | ||
186 | #define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly | 189 | #define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly |
@@ -246,6 +249,49 @@ static unsigned int psk_server_callback(SSL *ssl, const char *identity, unsigned | |||
246 | unsigned int max_psk_len); | 249 | unsigned int max_psk_len); |
247 | #endif | 250 | #endif |
248 | 251 | ||
252 | #ifndef OPENSSL_NO_SRP | ||
253 | /* SRP client */ | ||
254 | /* This is a context that we pass to all callbacks */ | ||
255 | typedef struct srp_client_arg_st | ||
256 | { | ||
257 | char *srppassin; | ||
258 | char *srplogin; | ||
259 | } SRP_CLIENT_ARG; | ||
260 | |||
261 | #define PWD_STRLEN 1024 | ||
262 | |||
263 | static char * MS_CALLBACK ssl_give_srp_client_pwd_cb(SSL *s, void *arg) | ||
264 | { | ||
265 | SRP_CLIENT_ARG *srp_client_arg = (SRP_CLIENT_ARG *)arg; | ||
266 | return BUF_strdup((char *)srp_client_arg->srppassin); | ||
267 | } | ||
268 | |||
269 | /* SRP server */ | ||
270 | /* This is a context that we pass to SRP server callbacks */ | ||
271 | typedef struct srp_server_arg_st | ||
272 | { | ||
273 | char *expected_user; | ||
274 | char *pass; | ||
275 | } SRP_SERVER_ARG; | ||
276 | |||
277 | static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg) | ||
278 | { | ||
279 | SRP_SERVER_ARG * p = (SRP_SERVER_ARG *) arg; | ||
280 | |||
281 | if (strcmp(p->expected_user, SSL_get_srp_username(s)) != 0) | ||
282 | { | ||
283 | fprintf(stderr, "User %s doesn't exist\n", SSL_get_srp_username(s)); | ||
284 | return SSL3_AL_FATAL; | ||
285 | } | ||
286 | if (SSL_set_srp_server_param_pw(s,p->expected_user,p->pass,"1024")<0) | ||
287 | { | ||
288 | *ad = SSL_AD_INTERNAL_ERROR; | ||
289 | return SSL3_AL_FATAL; | ||
290 | } | ||
291 | return SSL_ERROR_NONE; | ||
292 | } | ||
293 | #endif | ||
294 | |||
249 | static BIO *bio_err=NULL; | 295 | static BIO *bio_err=NULL; |
250 | static BIO *bio_stdout=NULL; | 296 | static BIO *bio_stdout=NULL; |
251 | 297 | ||
@@ -268,6 +314,9 @@ static void sv_usage(void) | |||
268 | { | 314 | { |
269 | fprintf(stderr,"usage: ssltest [args ...]\n"); | 315 | fprintf(stderr,"usage: ssltest [args ...]\n"); |
270 | fprintf(stderr,"\n"); | 316 | fprintf(stderr,"\n"); |
317 | #ifdef OPENSSL_FIPS | ||
318 | fprintf(stderr,"-F - run test in FIPS mode\n"); | ||
319 | #endif | ||
271 | fprintf(stderr," -server_auth - check server certificate\n"); | 320 | fprintf(stderr," -server_auth - check server certificate\n"); |
272 | fprintf(stderr," -client_auth - do client authentication\n"); | 321 | fprintf(stderr," -client_auth - do client authentication\n"); |
273 | fprintf(stderr," -proxy - allow proxy certificates\n"); | 322 | fprintf(stderr," -proxy - allow proxy certificates\n"); |
@@ -289,6 +338,10 @@ static void sv_usage(void) | |||
289 | #ifndef OPENSSL_NO_PSK | 338 | #ifndef OPENSSL_NO_PSK |
290 | fprintf(stderr," -psk arg - PSK in hex (without 0x)\n"); | 339 | fprintf(stderr," -psk arg - PSK in hex (without 0x)\n"); |
291 | #endif | 340 | #endif |
341 | #ifndef OPENSSL_NO_SRP | ||
342 | fprintf(stderr," -srpuser user - SRP username to use\n"); | ||
343 | fprintf(stderr," -srppass arg - password for 'user'\n"); | ||
344 | #endif | ||
292 | #ifndef OPENSSL_NO_SSL2 | 345 | #ifndef OPENSSL_NO_SSL2 |
293 | fprintf(stderr," -ssl2 - use SSLv2\n"); | 346 | fprintf(stderr," -ssl2 - use SSLv2\n"); |
294 | #endif | 347 | #endif |
@@ -476,6 +529,12 @@ int main(int argc, char *argv[]) | |||
476 | #ifndef OPENSSL_NO_ECDH | 529 | #ifndef OPENSSL_NO_ECDH |
477 | EC_KEY *ecdh = NULL; | 530 | EC_KEY *ecdh = NULL; |
478 | #endif | 531 | #endif |
532 | #ifndef OPENSSL_NO_SRP | ||
533 | /* client */ | ||
534 | SRP_CLIENT_ARG srp_client_arg = {NULL,NULL}; | ||
535 | /* server */ | ||
536 | SRP_SERVER_ARG srp_server_arg = {NULL,NULL}; | ||
537 | #endif | ||
479 | int no_dhe = 0; | 538 | int no_dhe = 0; |
480 | int no_ecdhe = 0; | 539 | int no_ecdhe = 0; |
481 | int no_psk = 0; | 540 | int no_psk = 0; |
@@ -487,6 +546,9 @@ int main(int argc, char *argv[]) | |||
487 | #endif | 546 | #endif |
488 | STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; | 547 | STACK_OF(SSL_COMP) *ssl_comp_methods = NULL; |
489 | int test_cipherlist = 0; | 548 | int test_cipherlist = 0; |
549 | #ifdef OPENSSL_FIPS | ||
550 | int fips_mode=0; | ||
551 | #endif | ||
490 | 552 | ||
491 | verbose = 0; | 553 | verbose = 0; |
492 | debug = 0; | 554 | debug = 0; |
@@ -518,7 +580,16 @@ int main(int argc, char *argv[]) | |||
518 | 580 | ||
519 | while (argc >= 1) | 581 | while (argc >= 1) |
520 | { | 582 | { |
521 | if (strcmp(*argv,"-server_auth") == 0) | 583 | if(!strcmp(*argv,"-F")) |
584 | { | ||
585 | #ifdef OPENSSL_FIPS | ||
586 | fips_mode=1; | ||
587 | #else | ||
588 | fprintf(stderr,"not compiled with FIPS support, so exitting without running.\n"); | ||
589 | EXIT(0); | ||
590 | #endif | ||
591 | } | ||
592 | else if (strcmp(*argv,"-server_auth") == 0) | ||
522 | server_auth=1; | 593 | server_auth=1; |
523 | else if (strcmp(*argv,"-client_auth") == 0) | 594 | else if (strcmp(*argv,"-client_auth") == 0) |
524 | client_auth=1; | 595 | client_auth=1; |
@@ -572,6 +643,20 @@ int main(int argc, char *argv[]) | |||
572 | no_psk=1; | 643 | no_psk=1; |
573 | #endif | 644 | #endif |
574 | } | 645 | } |
646 | #ifndef OPENSSL_NO_SRP | ||
647 | else if (strcmp(*argv,"-srpuser") == 0) | ||
648 | { | ||
649 | if (--argc < 1) goto bad; | ||
650 | srp_server_arg.expected_user = srp_client_arg.srplogin= *(++argv); | ||
651 | tls1=1; | ||
652 | } | ||
653 | else if (strcmp(*argv,"-srppass") == 0) | ||
654 | { | ||
655 | if (--argc < 1) goto bad; | ||
656 | srp_server_arg.pass = srp_client_arg.srppassin= *(++argv); | ||
657 | tls1=1; | ||
658 | } | ||
659 | #endif | ||
575 | else if (strcmp(*argv,"-ssl2") == 0) | 660 | else if (strcmp(*argv,"-ssl2") == 0) |
576 | ssl2=1; | 661 | ssl2=1; |
577 | else if (strcmp(*argv,"-tls1") == 0) | 662 | else if (strcmp(*argv,"-tls1") == 0) |
@@ -714,6 +799,20 @@ bad: | |||
714 | EXIT(1); | 799 | EXIT(1); |
715 | } | 800 | } |
716 | 801 | ||
802 | #ifdef OPENSSL_FIPS | ||
803 | if(fips_mode) | ||
804 | { | ||
805 | if(!FIPS_mode_set(1)) | ||
806 | { | ||
807 | ERR_load_crypto_strings(); | ||
808 | ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE)); | ||
809 | EXIT(1); | ||
810 | } | ||
811 | else | ||
812 | fprintf(stderr,"*** IN FIPS MODE ***\n"); | ||
813 | } | ||
814 | #endif | ||
815 | |||
717 | if (print_time) | 816 | if (print_time) |
718 | { | 817 | { |
719 | if (!bio_pair) | 818 | if (!bio_pair) |
@@ -837,7 +936,11 @@ bad: | |||
837 | } | 936 | } |
838 | } | 937 | } |
839 | else | 938 | else |
939 | #ifdef OPENSSL_NO_EC2M | ||
940 | nid = NID_X9_62_prime256v1; | ||
941 | #else | ||
840 | nid = NID_sect163r2; | 942 | nid = NID_sect163r2; |
943 | #endif | ||
841 | 944 | ||
842 | ecdh = EC_KEY_new_by_curve_name(nid); | 945 | ecdh = EC_KEY_new_by_curve_name(nid); |
843 | if (ecdh == NULL) | 946 | if (ecdh == NULL) |
@@ -940,6 +1043,26 @@ bad: | |||
940 | } | 1043 | } |
941 | #endif | 1044 | #endif |
942 | } | 1045 | } |
1046 | #ifndef OPENSSL_NO_SRP | ||
1047 | if (srp_client_arg.srplogin) | ||
1048 | { | ||
1049 | if (!SSL_CTX_set_srp_username(c_ctx, srp_client_arg.srplogin)) | ||
1050 | { | ||
1051 | BIO_printf(bio_err,"Unable to set SRP username\n"); | ||
1052 | goto end; | ||
1053 | } | ||
1054 | SSL_CTX_set_srp_cb_arg(c_ctx,&srp_client_arg); | ||
1055 | SSL_CTX_set_srp_client_pwd_callback(c_ctx, ssl_give_srp_client_pwd_cb); | ||
1056 | /*SSL_CTX_set_srp_strength(c_ctx, srp_client_arg.strength);*/ | ||
1057 | } | ||
1058 | |||
1059 | if (srp_server_arg.expected_user != NULL) | ||
1060 | { | ||
1061 | SSL_CTX_set_verify(s_ctx,SSL_VERIFY_NONE,verify_callback); | ||
1062 | SSL_CTX_set_srp_cb_arg(s_ctx, &srp_server_arg); | ||
1063 | SSL_CTX_set_srp_username_callback(s_ctx, ssl_srp_server_param_cb); | ||
1064 | } | ||
1065 | #endif | ||
943 | 1066 | ||
944 | c_ssl=SSL_new(c_ctx); | 1067 | c_ssl=SSL_new(c_ctx); |
945 | s_ssl=SSL_new(s_ctx); | 1068 | s_ssl=SSL_new(s_ctx); |
@@ -2164,15 +2287,7 @@ static int MS_CALLBACK app_verify_callback(X509_STORE_CTX *ctx, void *arg) | |||
2164 | } | 2287 | } |
2165 | 2288 | ||
2166 | #ifndef OPENSSL_NO_X509_VERIFY | 2289 | #ifndef OPENSSL_NO_X509_VERIFY |
2167 | # ifdef OPENSSL_FIPS | ||
2168 | if(s->version == TLS1_VERSION) | ||
2169 | FIPS_allow_md5(1); | ||
2170 | # endif | ||
2171 | ok = X509_verify_cert(ctx); | 2290 | ok = X509_verify_cert(ctx); |
2172 | # ifdef OPENSSL_FIPS | ||
2173 | if(s->version == TLS1_VERSION) | ||
2174 | FIPS_allow_md5(0); | ||
2175 | # endif | ||
2176 | #endif | 2291 | #endif |
2177 | 2292 | ||
2178 | if (cb_arg->proxy_auth) | 2293 | if (cb_arg->proxy_auth) |
diff --git a/src/lib/libssl/src/ssl/t1_clnt.c b/src/lib/libssl/src/ssl/t1_clnt.c index c87af17712..578617ed84 100644 --- a/src/lib/libssl/src/ssl/t1_clnt.c +++ b/src/lib/libssl/src/ssl/t1_clnt.c | |||
@@ -66,13 +66,26 @@ | |||
66 | static const SSL_METHOD *tls1_get_client_method(int ver); | 66 | static const SSL_METHOD *tls1_get_client_method(int ver); |
67 | static const SSL_METHOD *tls1_get_client_method(int ver) | 67 | static const SSL_METHOD *tls1_get_client_method(int ver) |
68 | { | 68 | { |
69 | if (ver == TLS1_2_VERSION) | ||
70 | return TLSv1_2_client_method(); | ||
71 | if (ver == TLS1_1_VERSION) | ||
72 | return TLSv1_1_client_method(); | ||
69 | if (ver == TLS1_VERSION) | 73 | if (ver == TLS1_VERSION) |
70 | return(TLSv1_client_method()); | 74 | return TLSv1_client_method(); |
71 | else | 75 | return NULL; |
72 | return(NULL); | ||
73 | } | 76 | } |
74 | 77 | ||
75 | IMPLEMENT_tls1_meth_func(TLSv1_client_method, | 78 | IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_client_method, |
79 | ssl_undefined_function, | ||
80 | ssl3_connect, | ||
81 | tls1_get_client_method) | ||
82 | |||
83 | IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_client_method, | ||
84 | ssl_undefined_function, | ||
85 | ssl3_connect, | ||
86 | tls1_get_client_method) | ||
87 | |||
88 | IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_client_method, | ||
76 | ssl_undefined_function, | 89 | ssl_undefined_function, |
77 | ssl3_connect, | 90 | ssl3_connect, |
78 | tls1_get_client_method) | 91 | tls1_get_client_method) |
diff --git a/src/lib/libssl/src/ssl/t1_enc.c b/src/lib/libssl/src/ssl/t1_enc.c index 793ea43e90..f7bdeb3b9d 100644 --- a/src/lib/libssl/src/ssl/t1_enc.c +++ b/src/lib/libssl/src/ssl/t1_enc.c | |||
@@ -143,6 +143,7 @@ | |||
143 | #include <openssl/evp.h> | 143 | #include <openssl/evp.h> |
144 | #include <openssl/hmac.h> | 144 | #include <openssl/hmac.h> |
145 | #include <openssl/md5.h> | 145 | #include <openssl/md5.h> |
146 | #include <openssl/rand.h> | ||
146 | #ifdef KSSL_DEBUG | 147 | #ifdef KSSL_DEBUG |
147 | #include <openssl/des.h> | 148 | #include <openssl/des.h> |
148 | #endif | 149 | #endif |
@@ -158,68 +159,75 @@ static int tls1_P_hash(const EVP_MD *md, const unsigned char *sec, | |||
158 | unsigned char *out, int olen) | 159 | unsigned char *out, int olen) |
159 | { | 160 | { |
160 | int chunk; | 161 | int chunk; |
161 | unsigned int j; | 162 | size_t j; |
162 | HMAC_CTX ctx; | 163 | EVP_MD_CTX ctx, ctx_tmp; |
163 | HMAC_CTX ctx_tmp; | 164 | EVP_PKEY *mac_key; |
164 | unsigned char A1[EVP_MAX_MD_SIZE]; | 165 | unsigned char A1[EVP_MAX_MD_SIZE]; |
165 | unsigned int A1_len; | 166 | size_t A1_len; |
166 | int ret = 0; | 167 | int ret = 0; |
167 | 168 | ||
168 | chunk=EVP_MD_size(md); | 169 | chunk=EVP_MD_size(md); |
169 | OPENSSL_assert(chunk >= 0); | 170 | OPENSSL_assert(chunk >= 0); |
170 | 171 | ||
171 | HMAC_CTX_init(&ctx); | 172 | EVP_MD_CTX_init(&ctx); |
172 | HMAC_CTX_init(&ctx_tmp); | 173 | EVP_MD_CTX_init(&ctx_tmp); |
173 | if (!HMAC_Init_ex(&ctx,sec,sec_len,md, NULL)) | 174 | EVP_MD_CTX_set_flags(&ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); |
175 | EVP_MD_CTX_set_flags(&ctx_tmp, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); | ||
176 | mac_key = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, NULL, sec, sec_len); | ||
177 | if (!mac_key) | ||
178 | goto err; | ||
179 | if (!EVP_DigestSignInit(&ctx,NULL,md, NULL, mac_key)) | ||
174 | goto err; | 180 | goto err; |
175 | if (!HMAC_Init_ex(&ctx_tmp,sec,sec_len,md, NULL)) | 181 | if (!EVP_DigestSignInit(&ctx_tmp,NULL,md, NULL, mac_key)) |
176 | goto err; | 182 | goto err; |
177 | if (seed1 != NULL && !HMAC_Update(&ctx,seed1,seed1_len)) | 183 | if (seed1 && !EVP_DigestSignUpdate(&ctx,seed1,seed1_len)) |
178 | goto err; | 184 | goto err; |
179 | if (seed2 != NULL && !HMAC_Update(&ctx,seed2,seed2_len)) | 185 | if (seed2 && !EVP_DigestSignUpdate(&ctx,seed2,seed2_len)) |
180 | goto err; | 186 | goto err; |
181 | if (seed3 != NULL && !HMAC_Update(&ctx,seed3,seed3_len)) | 187 | if (seed3 && !EVP_DigestSignUpdate(&ctx,seed3,seed3_len)) |
182 | goto err; | 188 | goto err; |
183 | if (seed4 != NULL && !HMAC_Update(&ctx,seed4,seed4_len)) | 189 | if (seed4 && !EVP_DigestSignUpdate(&ctx,seed4,seed4_len)) |
184 | goto err; | 190 | goto err; |
185 | if (seed5 != NULL && !HMAC_Update(&ctx,seed5,seed5_len)) | 191 | if (seed5 && !EVP_DigestSignUpdate(&ctx,seed5,seed5_len)) |
186 | goto err; | 192 | goto err; |
187 | if (!HMAC_Final(&ctx,A1,&A1_len)) | 193 | if (!EVP_DigestSignFinal(&ctx,A1,&A1_len)) |
188 | goto err; | 194 | goto err; |
189 | 195 | ||
190 | for (;;) | 196 | for (;;) |
191 | { | 197 | { |
192 | if (!HMAC_Init_ex(&ctx,NULL,0,NULL,NULL)) /* re-init */ | 198 | /* Reinit mac contexts */ |
199 | if (!EVP_DigestSignInit(&ctx,NULL,md, NULL, mac_key)) | ||
193 | goto err; | 200 | goto err; |
194 | if (!HMAC_Init_ex(&ctx_tmp,NULL,0,NULL,NULL)) /* re-init */ | 201 | if (!EVP_DigestSignInit(&ctx_tmp,NULL,md, NULL, mac_key)) |
195 | goto err; | 202 | goto err; |
196 | if (!HMAC_Update(&ctx,A1,A1_len)) | 203 | if (!EVP_DigestSignUpdate(&ctx,A1,A1_len)) |
197 | goto err; | 204 | goto err; |
198 | if (!HMAC_Update(&ctx_tmp,A1,A1_len)) | 205 | if (!EVP_DigestSignUpdate(&ctx_tmp,A1,A1_len)) |
199 | goto err; | 206 | goto err; |
200 | if (seed1 != NULL && !HMAC_Update(&ctx,seed1,seed1_len)) | 207 | if (seed1 && !EVP_DigestSignUpdate(&ctx,seed1,seed1_len)) |
201 | goto err; | 208 | goto err; |
202 | if (seed2 != NULL && !HMAC_Update(&ctx,seed2,seed2_len)) | 209 | if (seed2 && !EVP_DigestSignUpdate(&ctx,seed2,seed2_len)) |
203 | goto err; | 210 | goto err; |
204 | if (seed3 != NULL && !HMAC_Update(&ctx,seed3,seed3_len)) | 211 | if (seed3 && !EVP_DigestSignUpdate(&ctx,seed3,seed3_len)) |
205 | goto err; | 212 | goto err; |
206 | if (seed4 != NULL && !HMAC_Update(&ctx,seed4,seed4_len)) | 213 | if (seed4 && !EVP_DigestSignUpdate(&ctx,seed4,seed4_len)) |
207 | goto err; | 214 | goto err; |
208 | if (seed5 != NULL && !HMAC_Update(&ctx,seed5,seed5_len)) | 215 | if (seed5 && !EVP_DigestSignUpdate(&ctx,seed5,seed5_len)) |
209 | goto err; | 216 | goto err; |
210 | 217 | ||
211 | if (olen > chunk) | 218 | if (olen > chunk) |
212 | { | 219 | { |
213 | if (!HMAC_Final(&ctx,out,&j)) | 220 | if (!EVP_DigestSignFinal(&ctx,out,&j)) |
214 | goto err; | 221 | goto err; |
215 | out+=j; | 222 | out+=j; |
216 | olen-=j; | 223 | olen-=j; |
217 | if (!HMAC_Final(&ctx_tmp,A1,&A1_len)) /* calc the next A1 value */ | 224 | /* calc the next A1 value */ |
225 | if (!EVP_DigestSignFinal(&ctx_tmp,A1,&A1_len)) | ||
218 | goto err; | 226 | goto err; |
219 | } | 227 | } |
220 | else /* last one */ | 228 | else /* last one */ |
221 | { | 229 | { |
222 | if (!HMAC_Final(&ctx,A1,&A1_len)) | 230 | if (!EVP_DigestSignFinal(&ctx,A1,&A1_len)) |
223 | goto err; | 231 | goto err; |
224 | memcpy(out,A1,olen); | 232 | memcpy(out,A1,olen); |
225 | break; | 233 | break; |
@@ -227,8 +235,9 @@ static int tls1_P_hash(const EVP_MD *md, const unsigned char *sec, | |||
227 | } | 235 | } |
228 | ret = 1; | 236 | ret = 1; |
229 | err: | 237 | err: |
230 | HMAC_CTX_cleanup(&ctx); | 238 | EVP_PKEY_free(mac_key); |
231 | HMAC_CTX_cleanup(&ctx_tmp); | 239 | EVP_MD_CTX_cleanup(&ctx); |
240 | EVP_MD_CTX_cleanup(&ctx_tmp); | ||
232 | OPENSSL_cleanse(A1,sizeof(A1)); | 241 | OPENSSL_cleanse(A1,sizeof(A1)); |
233 | return ret; | 242 | return ret; |
234 | } | 243 | } |
@@ -256,6 +265,8 @@ static int tls1_PRF(long digest_mask, | |||
256 | if ((m<<TLS1_PRF_DGST_SHIFT) & digest_mask) count++; | 265 | if ((m<<TLS1_PRF_DGST_SHIFT) & digest_mask) count++; |
257 | } | 266 | } |
258 | len=slen/count; | 267 | len=slen/count; |
268 | if (count == 1) | ||
269 | slen = 0; | ||
259 | S1=sec; | 270 | S1=sec; |
260 | memset(out1,0,olen); | 271 | memset(out1,0,olen); |
261 | for (idx=0;ssl_get_handshake_digest(idx,&m,&md);idx++) { | 272 | for (idx=0;ssl_get_handshake_digest(idx,&m,&md);idx++) { |
@@ -284,7 +295,7 @@ static int tls1_generate_key_block(SSL *s, unsigned char *km, | |||
284 | unsigned char *tmp, int num) | 295 | unsigned char *tmp, int num) |
285 | { | 296 | { |
286 | int ret; | 297 | int ret; |
287 | ret = tls1_PRF(s->s3->tmp.new_cipher->algorithm2, | 298 | ret = tls1_PRF(ssl_get_algorithm2(s), |
288 | TLS_MD_KEY_EXPANSION_CONST,TLS_MD_KEY_EXPANSION_CONST_SIZE, | 299 | TLS_MD_KEY_EXPANSION_CONST,TLS_MD_KEY_EXPANSION_CONST_SIZE, |
289 | s->s3->server_random,SSL3_RANDOM_SIZE, | 300 | s->s3->server_random,SSL3_RANDOM_SIZE, |
290 | s->s3->client_random,SSL3_RANDOM_SIZE, | 301 | s->s3->client_random,SSL3_RANDOM_SIZE, |
@@ -358,7 +369,7 @@ int tls1_change_cipher_state(SSL *s, int which) | |||
358 | { | 369 | { |
359 | if (s->s3->tmp.new_cipher->algorithm2 & TLS1_STREAM_MAC) | 370 | if (s->s3->tmp.new_cipher->algorithm2 & TLS1_STREAM_MAC) |
360 | s->mac_flags |= SSL_MAC_FLAG_READ_MAC_STREAM; | 371 | s->mac_flags |= SSL_MAC_FLAG_READ_MAC_STREAM; |
361 | else | 372 | else |
362 | s->mac_flags &= ~SSL_MAC_FLAG_READ_MAC_STREAM; | 373 | s->mac_flags &= ~SSL_MAC_FLAG_READ_MAC_STREAM; |
363 | 374 | ||
364 | if (s->enc_read_ctx != NULL) | 375 | if (s->enc_read_ctx != NULL) |
@@ -445,7 +456,11 @@ int tls1_change_cipher_state(SSL *s, int which) | |||
445 | j=is_export ? (cl < SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher) ? | 456 | j=is_export ? (cl < SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher) ? |
446 | cl : SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher)) : cl; | 457 | cl : SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher)) : cl; |
447 | /* Was j=(exp)?5:EVP_CIPHER_key_length(c); */ | 458 | /* Was j=(exp)?5:EVP_CIPHER_key_length(c); */ |
448 | k=EVP_CIPHER_iv_length(c); | 459 | /* If GCM mode only part of IV comes from PRF */ |
460 | if (EVP_CIPHER_mode(c) == EVP_CIPH_GCM_MODE) | ||
461 | k = EVP_GCM_TLS_FIXED_IV_LEN; | ||
462 | else | ||
463 | k=EVP_CIPHER_iv_length(c); | ||
449 | if ( (which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) || | 464 | if ( (which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) || |
450 | (which == SSL3_CHANGE_CIPHER_SERVER_READ)) | 465 | (which == SSL3_CHANGE_CIPHER_SERVER_READ)) |
451 | { | 466 | { |
@@ -474,10 +489,14 @@ int tls1_change_cipher_state(SSL *s, int which) | |||
474 | } | 489 | } |
475 | 490 | ||
476 | memcpy(mac_secret,ms,i); | 491 | memcpy(mac_secret,ms,i); |
477 | mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, | 492 | |
478 | mac_secret,*mac_secret_size); | 493 | if (!(EVP_CIPHER_flags(c)&EVP_CIPH_FLAG_AEAD_CIPHER)) |
479 | EVP_DigestSignInit(mac_ctx,NULL,m,NULL,mac_key); | 494 | { |
480 | EVP_PKEY_free(mac_key); | 495 | mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, |
496 | mac_secret,*mac_secret_size); | ||
497 | EVP_DigestSignInit(mac_ctx,NULL,m,NULL,mac_key); | ||
498 | EVP_PKEY_free(mac_key); | ||
499 | } | ||
481 | #ifdef TLS_DEBUG | 500 | #ifdef TLS_DEBUG |
482 | printf("which = %04X\nmac key=",which); | 501 | printf("which = %04X\nmac key=",which); |
483 | { int z; for (z=0; z<i; z++) printf("%02X%c",ms[z],((z+1)%16)?' ':'\n'); } | 502 | { int z; for (z=0; z<i; z++) printf("%02X%c",ms[z],((z+1)%16)?' ':'\n'); } |
@@ -487,7 +506,7 @@ printf("which = %04X\nmac key=",which); | |||
487 | /* In here I set both the read and write key/iv to the | 506 | /* In here I set both the read and write key/iv to the |
488 | * same value since only the correct one will be used :-). | 507 | * same value since only the correct one will be used :-). |
489 | */ | 508 | */ |
490 | if (!tls1_PRF(s->s3->tmp.new_cipher->algorithm2, | 509 | if (!tls1_PRF(ssl_get_algorithm2(s), |
491 | exp_label,exp_label_len, | 510 | exp_label,exp_label_len, |
492 | s->s3->client_random,SSL3_RANDOM_SIZE, | 511 | s->s3->client_random,SSL3_RANDOM_SIZE, |
493 | s->s3->server_random,SSL3_RANDOM_SIZE, | 512 | s->s3->server_random,SSL3_RANDOM_SIZE, |
@@ -498,7 +517,7 @@ printf("which = %04X\nmac key=",which); | |||
498 | 517 | ||
499 | if (k > 0) | 518 | if (k > 0) |
500 | { | 519 | { |
501 | if (!tls1_PRF(s->s3->tmp.new_cipher->algorithm2, | 520 | if (!tls1_PRF(ssl_get_algorithm2(s), |
502 | TLS_MD_IV_BLOCK_CONST,TLS_MD_IV_BLOCK_CONST_SIZE, | 521 | TLS_MD_IV_BLOCK_CONST,TLS_MD_IV_BLOCK_CONST_SIZE, |
503 | s->s3->client_random,SSL3_RANDOM_SIZE, | 522 | s->s3->client_random,SSL3_RANDOM_SIZE, |
504 | s->s3->server_random,SSL3_RANDOM_SIZE, | 523 | s->s3->server_random,SSL3_RANDOM_SIZE, |
@@ -524,7 +543,19 @@ printf("which = %04X\nmac key=",which); | |||
524 | } | 543 | } |
525 | #endif /* KSSL_DEBUG */ | 544 | #endif /* KSSL_DEBUG */ |
526 | 545 | ||
527 | EVP_CipherInit_ex(dd,c,NULL,key,iv,(which & SSL3_CC_WRITE)); | 546 | if (EVP_CIPHER_mode(c) == EVP_CIPH_GCM_MODE) |
547 | { | ||
548 | EVP_CipherInit_ex(dd,c,NULL,key,NULL,(which & SSL3_CC_WRITE)); | ||
549 | EVP_CIPHER_CTX_ctrl(dd, EVP_CTRL_GCM_SET_IV_FIXED, k, iv); | ||
550 | } | ||
551 | else | ||
552 | EVP_CipherInit_ex(dd,c,NULL,key,iv,(which & SSL3_CC_WRITE)); | ||
553 | |||
554 | /* Needed for "composite" AEADs, such as RC4-HMAC-MD5 */ | ||
555 | if ((EVP_CIPHER_flags(c)&EVP_CIPH_FLAG_AEAD_CIPHER) && *mac_secret_size) | ||
556 | EVP_CIPHER_CTX_ctrl(dd,EVP_CTRL_AEAD_SET_MAC_KEY, | ||
557 | *mac_secret_size,mac_secret); | ||
558 | |||
528 | #ifdef TLS_DEBUG | 559 | #ifdef TLS_DEBUG |
529 | printf("which = %04X\nkey=",which); | 560 | printf("which = %04X\nkey=",which); |
530 | { int z; for (z=0; z<EVP_CIPHER_key_length(c); z++) printf("%02X%c",key[z],((z+1)%16)?' ':'\n'); } | 561 | { int z; for (z=0; z<EVP_CIPHER_key_length(c); z++) printf("%02X%c",key[z],((z+1)%16)?' ':'\n'); } |
@@ -606,7 +637,8 @@ printf("\nkey block\n"); | |||
606 | { int z; for (z=0; z<num; z++) printf("%02X%c",p1[z],((z+1)%16)?' ':'\n'); } | 637 | { int z; for (z=0; z<num; z++) printf("%02X%c",p1[z],((z+1)%16)?' ':'\n'); } |
607 | #endif | 638 | #endif |
608 | 639 | ||
609 | if (!(s->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) | 640 | if (!(s->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS) |
641 | && s->method->version <= TLS1_VERSION) | ||
610 | { | 642 | { |
611 | /* enable vulnerability countermeasure for CBC ciphers with | 643 | /* enable vulnerability countermeasure for CBC ciphers with |
612 | * known-IV problem (http://www.openssl.org/~bodo/tls-cbc.txt) | 644 | * known-IV problem (http://www.openssl.org/~bodo/tls-cbc.txt) |
@@ -640,14 +672,14 @@ int tls1_enc(SSL *s, int send) | |||
640 | SSL3_RECORD *rec; | 672 | SSL3_RECORD *rec; |
641 | EVP_CIPHER_CTX *ds; | 673 | EVP_CIPHER_CTX *ds; |
642 | unsigned long l; | 674 | unsigned long l; |
643 | int bs,i,ii,j,k,n=0; | 675 | int bs,i,ii,j,k,pad=0; |
644 | const EVP_CIPHER *enc; | 676 | const EVP_CIPHER *enc; |
645 | 677 | ||
646 | if (send) | 678 | if (send) |
647 | { | 679 | { |
648 | if (EVP_MD_CTX_md(s->write_hash)) | 680 | if (EVP_MD_CTX_md(s->write_hash)) |
649 | { | 681 | { |
650 | n=EVP_MD_CTX_size(s->write_hash); | 682 | int n=EVP_MD_CTX_size(s->write_hash); |
651 | OPENSSL_assert(n >= 0); | 683 | OPENSSL_assert(n >= 0); |
652 | } | 684 | } |
653 | ds=s->enc_write_ctx; | 685 | ds=s->enc_write_ctx; |
@@ -655,13 +687,34 @@ int tls1_enc(SSL *s, int send) | |||
655 | if (s->enc_write_ctx == NULL) | 687 | if (s->enc_write_ctx == NULL) |
656 | enc=NULL; | 688 | enc=NULL; |
657 | else | 689 | else |
690 | { | ||
691 | int ivlen; | ||
658 | enc=EVP_CIPHER_CTX_cipher(s->enc_write_ctx); | 692 | enc=EVP_CIPHER_CTX_cipher(s->enc_write_ctx); |
693 | /* For TLSv1.1 and later explicit IV */ | ||
694 | if (s->version >= TLS1_1_VERSION | ||
695 | && EVP_CIPHER_mode(enc) == EVP_CIPH_CBC_MODE) | ||
696 | ivlen = EVP_CIPHER_iv_length(enc); | ||
697 | else | ||
698 | ivlen = 0; | ||
699 | if (ivlen > 1) | ||
700 | { | ||
701 | if ( rec->data != rec->input) | ||
702 | /* we can't write into the input stream: | ||
703 | * Can this ever happen?? (steve) | ||
704 | */ | ||
705 | fprintf(stderr, | ||
706 | "%s:%d: rec->data != rec->input\n", | ||
707 | __FILE__, __LINE__); | ||
708 | else if (RAND_bytes(rec->input, ivlen) <= 0) | ||
709 | return -1; | ||
710 | } | ||
711 | } | ||
659 | } | 712 | } |
660 | else | 713 | else |
661 | { | 714 | { |
662 | if (EVP_MD_CTX_md(s->read_hash)) | 715 | if (EVP_MD_CTX_md(s->read_hash)) |
663 | { | 716 | { |
664 | n=EVP_MD_CTX_size(s->read_hash); | 717 | int n=EVP_MD_CTX_size(s->read_hash); |
665 | OPENSSL_assert(n >= 0); | 718 | OPENSSL_assert(n >= 0); |
666 | } | 719 | } |
667 | ds=s->enc_read_ctx; | 720 | ds=s->enc_read_ctx; |
@@ -687,7 +740,43 @@ int tls1_enc(SSL *s, int send) | |||
687 | l=rec->length; | 740 | l=rec->length; |
688 | bs=EVP_CIPHER_block_size(ds->cipher); | 741 | bs=EVP_CIPHER_block_size(ds->cipher); |
689 | 742 | ||
690 | if ((bs != 1) && send) | 743 | if (EVP_CIPHER_flags(ds->cipher)&EVP_CIPH_FLAG_AEAD_CIPHER) |
744 | { | ||
745 | unsigned char buf[13],*seq; | ||
746 | |||
747 | seq = send?s->s3->write_sequence:s->s3->read_sequence; | ||
748 | |||
749 | if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) | ||
750 | { | ||
751 | unsigned char dtlsseq[9],*p=dtlsseq; | ||
752 | |||
753 | s2n(send?s->d1->w_epoch:s->d1->r_epoch,p); | ||
754 | memcpy(p,&seq[2],6); | ||
755 | memcpy(buf,dtlsseq,8); | ||
756 | } | ||
757 | else | ||
758 | { | ||
759 | memcpy(buf,seq,8); | ||
760 | for (i=7; i>=0; i--) /* increment */ | ||
761 | { | ||
762 | ++seq[i]; | ||
763 | if (seq[i] != 0) break; | ||
764 | } | ||
765 | } | ||
766 | |||
767 | buf[8]=rec->type; | ||
768 | buf[9]=(unsigned char)(s->version>>8); | ||
769 | buf[10]=(unsigned char)(s->version); | ||
770 | buf[11]=rec->length>>8; | ||
771 | buf[12]=rec->length&0xff; | ||
772 | pad=EVP_CIPHER_CTX_ctrl(ds,EVP_CTRL_AEAD_TLS1_AAD,13,buf); | ||
773 | if (send) | ||
774 | { | ||
775 | l+=pad; | ||
776 | rec->length+=pad; | ||
777 | } | ||
778 | } | ||
779 | else if ((bs != 1) && send) | ||
691 | { | 780 | { |
692 | i=bs-((int)l%bs); | 781 | i=bs-((int)l%bs); |
693 | 782 | ||
@@ -728,13 +817,25 @@ int tls1_enc(SSL *s, int send) | |||
728 | { | 817 | { |
729 | if (l == 0 || l%bs != 0) | 818 | if (l == 0 || l%bs != 0) |
730 | { | 819 | { |
820 | if (s->version >= TLS1_1_VERSION) | ||
821 | return -1; | ||
731 | SSLerr(SSL_F_TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); | 822 | SSLerr(SSL_F_TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG); |
732 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); | 823 | ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED); |
733 | return 0; | 824 | return 0; |
734 | } | 825 | } |
735 | } | 826 | } |
736 | 827 | ||
737 | EVP_Cipher(ds,rec->data,rec->input,l); | 828 | i = EVP_Cipher(ds,rec->data,rec->input,l); |
829 | if ((EVP_CIPHER_flags(ds->cipher)&EVP_CIPH_FLAG_CUSTOM_CIPHER) | ||
830 | ?(i<0) | ||
831 | :(i==0)) | ||
832 | return -1; /* AEAD can fail to verify MAC */ | ||
833 | if (EVP_CIPHER_mode(enc) == EVP_CIPH_GCM_MODE && !send) | ||
834 | { | ||
835 | rec->data += EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
836 | rec->input += EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
837 | rec->length -= EVP_GCM_TLS_EXPLICIT_IV_LEN; | ||
838 | } | ||
738 | 839 | ||
739 | #ifdef KSSL_DEBUG | 840 | #ifdef KSSL_DEBUG |
740 | { | 841 | { |
@@ -784,8 +885,19 @@ int tls1_enc(SSL *s, int send) | |||
784 | return -1; | 885 | return -1; |
785 | } | 886 | } |
786 | } | 887 | } |
787 | rec->length-=i; | 888 | rec->length -=i; |
889 | if (s->version >= TLS1_1_VERSION | ||
890 | && EVP_CIPHER_CTX_mode(ds) == EVP_CIPH_CBC_MODE) | ||
891 | { | ||
892 | if (bs > (int)rec->length) | ||
893 | return -1; | ||
894 | rec->data += bs; /* skip the explicit IV */ | ||
895 | rec->input += bs; | ||
896 | rec->length -= bs; | ||
897 | } | ||
788 | } | 898 | } |
899 | if (pad && !send) | ||
900 | rec->length -= pad; | ||
789 | } | 901 | } |
790 | return(1); | 902 | return(1); |
791 | } | 903 | } |
@@ -841,7 +953,7 @@ int tls1_final_finish_mac(SSL *s, | |||
841 | 953 | ||
842 | for (idx=0;ssl_get_handshake_digest(idx,&mask,&md);idx++) | 954 | for (idx=0;ssl_get_handshake_digest(idx,&mask,&md);idx++) |
843 | { | 955 | { |
844 | if (mask & s->s3->tmp.new_cipher->algorithm2) | 956 | if (mask & ssl_get_algorithm2(s)) |
845 | { | 957 | { |
846 | int hashsize = EVP_MD_size(md); | 958 | int hashsize = EVP_MD_size(md); |
847 | if (hashsize < 0 || hashsize > (int)(sizeof buf - (size_t)(q-buf))) | 959 | if (hashsize < 0 || hashsize > (int)(sizeof buf - (size_t)(q-buf))) |
@@ -860,7 +972,7 @@ int tls1_final_finish_mac(SSL *s, | |||
860 | } | 972 | } |
861 | } | 973 | } |
862 | 974 | ||
863 | if (!tls1_PRF(s->s3->tmp.new_cipher->algorithm2, | 975 | if (!tls1_PRF(ssl_get_algorithm2(s), |
864 | str,slen, buf,(int)(q-buf), NULL,0, NULL,0, NULL,0, | 976 | str,slen, buf,(int)(q-buf), NULL,0, NULL,0, NULL,0, |
865 | s->session->master_key,s->session->master_key_length, | 977 | s->session->master_key,s->session->master_key_length, |
866 | out,buf2,sizeof buf2)) | 978 | out,buf2,sizeof buf2)) |
@@ -970,6 +1082,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, | |||
970 | const void *co = NULL, *so = NULL; | 1082 | const void *co = NULL, *so = NULL; |
971 | int col = 0, sol = 0; | 1083 | int col = 0, sol = 0; |
972 | 1084 | ||
1085 | |||
973 | #ifdef KSSL_DEBUG | 1086 | #ifdef KSSL_DEBUG |
974 | printf ("tls1_generate_master_secret(%p,%p, %p, %d)\n", s,out, p,len); | 1087 | printf ("tls1_generate_master_secret(%p,%p, %p, %d)\n", s,out, p,len); |
975 | #endif /* KSSL_DEBUG */ | 1088 | #endif /* KSSL_DEBUG */ |
@@ -986,7 +1099,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, | |||
986 | } | 1099 | } |
987 | #endif | 1100 | #endif |
988 | 1101 | ||
989 | tls1_PRF(s->s3->tmp.new_cipher->algorithm2, | 1102 | tls1_PRF(ssl_get_algorithm2(s), |
990 | TLS_MD_MASTER_SECRET_CONST,TLS_MD_MASTER_SECRET_CONST_SIZE, | 1103 | TLS_MD_MASTER_SECRET_CONST,TLS_MD_MASTER_SECRET_CONST_SIZE, |
991 | s->s3->client_random,SSL3_RANDOM_SIZE, | 1104 | s->s3->client_random,SSL3_RANDOM_SIZE, |
992 | co, col, | 1105 | co, col, |
@@ -994,6 +1107,16 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, | |||
994 | so, sol, | 1107 | so, sol, |
995 | p,len, | 1108 | p,len, |
996 | s->session->master_key,buff,sizeof buff); | 1109 | s->session->master_key,buff,sizeof buff); |
1110 | #ifdef SSL_DEBUG | ||
1111 | fprintf(stderr, "Premaster Secret:\n"); | ||
1112 | BIO_dump_fp(stderr, (char *)p, len); | ||
1113 | fprintf(stderr, "Client Random:\n"); | ||
1114 | BIO_dump_fp(stderr, (char *)s->s3->client_random, SSL3_RANDOM_SIZE); | ||
1115 | fprintf(stderr, "Server Random:\n"); | ||
1116 | BIO_dump_fp(stderr, (char *)s->s3->server_random, SSL3_RANDOM_SIZE); | ||
1117 | fprintf(stderr, "Master Secret:\n"); | ||
1118 | BIO_dump_fp(stderr, (char *)s->session->master_key, SSL3_MASTER_SECRET_SIZE); | ||
1119 | #endif | ||
997 | 1120 | ||
998 | #ifdef KSSL_DEBUG | 1121 | #ifdef KSSL_DEBUG |
999 | printf ("tls1_generate_master_secret() complete\n"); | 1122 | printf ("tls1_generate_master_secret() complete\n"); |
@@ -1001,6 +1124,95 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, | |||
1001 | return(SSL3_MASTER_SECRET_SIZE); | 1124 | return(SSL3_MASTER_SECRET_SIZE); |
1002 | } | 1125 | } |
1003 | 1126 | ||
1127 | int tls1_export_keying_material(SSL *s, unsigned char *out, size_t olen, | ||
1128 | const char *label, size_t llen, const unsigned char *context, | ||
1129 | size_t contextlen, int use_context) | ||
1130 | { | ||
1131 | unsigned char *buff; | ||
1132 | unsigned char *val = NULL; | ||
1133 | size_t vallen, currentvalpos; | ||
1134 | int rv; | ||
1135 | |||
1136 | #ifdef KSSL_DEBUG | ||
1137 | printf ("tls1_export_keying_material(%p,%p,%d,%s,%d,%p,%d)\n", s, out, olen, label, llen, p, plen); | ||
1138 | #endif /* KSSL_DEBUG */ | ||
1139 | |||
1140 | buff = OPENSSL_malloc(olen); | ||
1141 | if (buff == NULL) goto err2; | ||
1142 | |||
1143 | /* construct PRF arguments | ||
1144 | * we construct the PRF argument ourself rather than passing separate | ||
1145 | * values into the TLS PRF to ensure that the concatenation of values | ||
1146 | * does not create a prohibited label. | ||
1147 | */ | ||
1148 | vallen = llen + SSL3_RANDOM_SIZE * 2; | ||
1149 | if (use_context) | ||
1150 | { | ||
1151 | vallen += 2 + contextlen; | ||
1152 | } | ||
1153 | |||
1154 | val = OPENSSL_malloc(vallen); | ||
1155 | if (val == NULL) goto err2; | ||
1156 | currentvalpos = 0; | ||
1157 | memcpy(val + currentvalpos, (unsigned char *) label, llen); | ||
1158 | currentvalpos += llen; | ||
1159 | memcpy(val + currentvalpos, s->s3->client_random, SSL3_RANDOM_SIZE); | ||
1160 | currentvalpos += SSL3_RANDOM_SIZE; | ||
1161 | memcpy(val + currentvalpos, s->s3->server_random, SSL3_RANDOM_SIZE); | ||
1162 | currentvalpos += SSL3_RANDOM_SIZE; | ||
1163 | |||
1164 | if (use_context) | ||
1165 | { | ||
1166 | val[currentvalpos] = (contextlen >> 8) & 0xff; | ||
1167 | currentvalpos++; | ||
1168 | val[currentvalpos] = contextlen & 0xff; | ||
1169 | currentvalpos++; | ||
1170 | if ((contextlen > 0) || (context != NULL)) | ||
1171 | { | ||
1172 | memcpy(val + currentvalpos, context, contextlen); | ||
1173 | } | ||
1174 | } | ||
1175 | |||
1176 | /* disallow prohibited labels | ||
1177 | * note that SSL3_RANDOM_SIZE > max(prohibited label len) = | ||
1178 | * 15, so size of val > max(prohibited label len) = 15 and the | ||
1179 | * comparisons won't have buffer overflow | ||
1180 | */ | ||
1181 | if (memcmp(val, TLS_MD_CLIENT_FINISH_CONST, | ||
1182 | TLS_MD_CLIENT_FINISH_CONST_SIZE) == 0) goto err1; | ||
1183 | if (memcmp(val, TLS_MD_SERVER_FINISH_CONST, | ||
1184 | TLS_MD_SERVER_FINISH_CONST_SIZE) == 0) goto err1; | ||
1185 | if (memcmp(val, TLS_MD_MASTER_SECRET_CONST, | ||
1186 | TLS_MD_MASTER_SECRET_CONST_SIZE) == 0) goto err1; | ||
1187 | if (memcmp(val, TLS_MD_KEY_EXPANSION_CONST, | ||
1188 | TLS_MD_KEY_EXPANSION_CONST_SIZE) == 0) goto err1; | ||
1189 | |||
1190 | rv = tls1_PRF(s->s3->tmp.new_cipher->algorithm2, | ||
1191 | val, vallen, | ||
1192 | NULL, 0, | ||
1193 | NULL, 0, | ||
1194 | NULL, 0, | ||
1195 | NULL, 0, | ||
1196 | s->session->master_key,s->session->master_key_length, | ||
1197 | out,buff,olen); | ||
1198 | |||
1199 | #ifdef KSSL_DEBUG | ||
1200 | printf ("tls1_export_keying_material() complete\n"); | ||
1201 | #endif /* KSSL_DEBUG */ | ||
1202 | goto ret; | ||
1203 | err1: | ||
1204 | SSLerr(SSL_F_TLS1_EXPORT_KEYING_MATERIAL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL); | ||
1205 | rv = 0; | ||
1206 | goto ret; | ||
1207 | err2: | ||
1208 | SSLerr(SSL_F_TLS1_EXPORT_KEYING_MATERIAL, ERR_R_MALLOC_FAILURE); | ||
1209 | rv = 0; | ||
1210 | ret: | ||
1211 | if (buff != NULL) OPENSSL_free(buff); | ||
1212 | if (val != NULL) OPENSSL_free(val); | ||
1213 | return(rv); | ||
1214 | } | ||
1215 | |||
1004 | int tls1_alert_code(int code) | 1216 | int tls1_alert_code(int code) |
1005 | { | 1217 | { |
1006 | switch (code) | 1218 | switch (code) |
@@ -1042,4 +1254,3 @@ int tls1_alert_code(int code) | |||
1042 | default: return(-1); | 1254 | default: return(-1); |
1043 | } | 1255 | } |
1044 | } | 1256 | } |
1045 | |||
diff --git a/src/lib/libssl/src/ssl/t1_lib.c b/src/lib/libssl/src/ssl/t1_lib.c index 26cbae449e..27c8e3460d 100644 --- a/src/lib/libssl/src/ssl/t1_lib.c +++ b/src/lib/libssl/src/ssl/t1_lib.c | |||
@@ -114,6 +114,7 @@ | |||
114 | #include <openssl/evp.h> | 114 | #include <openssl/evp.h> |
115 | #include <openssl/hmac.h> | 115 | #include <openssl/hmac.h> |
116 | #include <openssl/ocsp.h> | 116 | #include <openssl/ocsp.h> |
117 | #include <openssl/rand.h> | ||
117 | #include "ssl_locl.h" | 118 | #include "ssl_locl.h" |
118 | 119 | ||
119 | const char tls1_version_str[]="TLSv1" OPENSSL_VERSION_PTEXT; | 120 | const char tls1_version_str[]="TLSv1" OPENSSL_VERSION_PTEXT; |
@@ -136,6 +137,7 @@ SSL3_ENC_METHOD TLSv1_enc_data={ | |||
136 | TLS_MD_CLIENT_FINISH_CONST,TLS_MD_CLIENT_FINISH_CONST_SIZE, | 137 | TLS_MD_CLIENT_FINISH_CONST,TLS_MD_CLIENT_FINISH_CONST_SIZE, |
137 | TLS_MD_SERVER_FINISH_CONST,TLS_MD_SERVER_FINISH_CONST_SIZE, | 138 | TLS_MD_SERVER_FINISH_CONST,TLS_MD_SERVER_FINISH_CONST_SIZE, |
138 | tls1_alert_code, | 139 | tls1_alert_code, |
140 | tls1_export_keying_material, | ||
139 | }; | 141 | }; |
140 | 142 | ||
141 | long tls1_default_timeout(void) | 143 | long tls1_default_timeout(void) |
@@ -166,10 +168,11 @@ void tls1_free(SSL *s) | |||
166 | void tls1_clear(SSL *s) | 168 | void tls1_clear(SSL *s) |
167 | { | 169 | { |
168 | ssl3_clear(s); | 170 | ssl3_clear(s); |
169 | s->version=TLS1_VERSION; | 171 | s->version = s->method->version; |
170 | } | 172 | } |
171 | 173 | ||
172 | #ifndef OPENSSL_NO_EC | 174 | #ifndef OPENSSL_NO_EC |
175 | |||
173 | static int nid_list[] = | 176 | static int nid_list[] = |
174 | { | 177 | { |
175 | NID_sect163k1, /* sect163k1 (1) */ | 178 | NID_sect163k1, /* sect163k1 (1) */ |
@@ -198,7 +201,36 @@ static int nid_list[] = | |||
198 | NID_secp384r1, /* secp384r1 (24) */ | 201 | NID_secp384r1, /* secp384r1 (24) */ |
199 | NID_secp521r1 /* secp521r1 (25) */ | 202 | NID_secp521r1 /* secp521r1 (25) */ |
200 | }; | 203 | }; |
201 | 204 | ||
205 | static int pref_list[] = | ||
206 | { | ||
207 | NID_sect571r1, /* sect571r1 (14) */ | ||
208 | NID_sect571k1, /* sect571k1 (13) */ | ||
209 | NID_secp521r1, /* secp521r1 (25) */ | ||
210 | NID_sect409k1, /* sect409k1 (11) */ | ||
211 | NID_sect409r1, /* sect409r1 (12) */ | ||
212 | NID_secp384r1, /* secp384r1 (24) */ | ||
213 | NID_sect283k1, /* sect283k1 (9) */ | ||
214 | NID_sect283r1, /* sect283r1 (10) */ | ||
215 | NID_secp256k1, /* secp256k1 (22) */ | ||
216 | NID_X9_62_prime256v1, /* secp256r1 (23) */ | ||
217 | NID_sect239k1, /* sect239k1 (8) */ | ||
218 | NID_sect233k1, /* sect233k1 (6) */ | ||
219 | NID_sect233r1, /* sect233r1 (7) */ | ||
220 | NID_secp224k1, /* secp224k1 (20) */ | ||
221 | NID_secp224r1, /* secp224r1 (21) */ | ||
222 | NID_sect193r1, /* sect193r1 (4) */ | ||
223 | NID_sect193r2, /* sect193r2 (5) */ | ||
224 | NID_secp192k1, /* secp192k1 (18) */ | ||
225 | NID_X9_62_prime192v1, /* secp192r1 (19) */ | ||
226 | NID_sect163k1, /* sect163k1 (1) */ | ||
227 | NID_sect163r1, /* sect163r1 (2) */ | ||
228 | NID_sect163r2, /* sect163r2 (3) */ | ||
229 | NID_secp160k1, /* secp160k1 (15) */ | ||
230 | NID_secp160r1, /* secp160r1 (16) */ | ||
231 | NID_secp160r2, /* secp160r2 (17) */ | ||
232 | }; | ||
233 | |||
202 | int tls1_ec_curve_id2nid(int curve_id) | 234 | int tls1_ec_curve_id2nid(int curve_id) |
203 | { | 235 | { |
204 | /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */ | 236 | /* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */ |
@@ -270,6 +302,64 @@ int tls1_ec_nid2curve_id(int nid) | |||
270 | #endif /* OPENSSL_NO_EC */ | 302 | #endif /* OPENSSL_NO_EC */ |
271 | 303 | ||
272 | #ifndef OPENSSL_NO_TLSEXT | 304 | #ifndef OPENSSL_NO_TLSEXT |
305 | |||
306 | /* List of supported signature algorithms and hashes. Should make this | ||
307 | * customisable at some point, for now include everything we support. | ||
308 | */ | ||
309 | |||
310 | #ifdef OPENSSL_NO_RSA | ||
311 | #define tlsext_sigalg_rsa(md) /* */ | ||
312 | #else | ||
313 | #define tlsext_sigalg_rsa(md) md, TLSEXT_signature_rsa, | ||
314 | #endif | ||
315 | |||
316 | #ifdef OPENSSL_NO_DSA | ||
317 | #define tlsext_sigalg_dsa(md) /* */ | ||
318 | #else | ||
319 | #define tlsext_sigalg_dsa(md) md, TLSEXT_signature_dsa, | ||
320 | #endif | ||
321 | |||
322 | #ifdef OPENSSL_NO_ECDSA | ||
323 | #define tlsext_sigalg_ecdsa(md) /* */ | ||
324 | #else | ||
325 | #define tlsext_sigalg_ecdsa(md) md, TLSEXT_signature_ecdsa, | ||
326 | #endif | ||
327 | |||
328 | #define tlsext_sigalg(md) \ | ||
329 | tlsext_sigalg_rsa(md) \ | ||
330 | tlsext_sigalg_dsa(md) \ | ||
331 | tlsext_sigalg_ecdsa(md) | ||
332 | |||
333 | static unsigned char tls12_sigalgs[] = { | ||
334 | #ifndef OPENSSL_NO_SHA512 | ||
335 | tlsext_sigalg(TLSEXT_hash_sha512) | ||
336 | tlsext_sigalg(TLSEXT_hash_sha384) | ||
337 | #endif | ||
338 | #ifndef OPENSSL_NO_SHA256 | ||
339 | tlsext_sigalg(TLSEXT_hash_sha256) | ||
340 | tlsext_sigalg(TLSEXT_hash_sha224) | ||
341 | #endif | ||
342 | #ifndef OPENSSL_NO_SHA | ||
343 | tlsext_sigalg(TLSEXT_hash_sha1) | ||
344 | #endif | ||
345 | #ifndef OPENSSL_NO_MD5 | ||
346 | tlsext_sigalg_rsa(TLSEXT_hash_md5) | ||
347 | #endif | ||
348 | }; | ||
349 | |||
350 | int tls12_get_req_sig_algs(SSL *s, unsigned char *p) | ||
351 | { | ||
352 | size_t slen = sizeof(tls12_sigalgs); | ||
353 | #ifdef OPENSSL_FIPS | ||
354 | /* If FIPS mode don't include MD5 which is last */ | ||
355 | if (FIPS_mode()) | ||
356 | slen -= 2; | ||
357 | #endif | ||
358 | if (p) | ||
359 | memcpy(p, tls12_sigalgs, slen); | ||
360 | return (int)slen; | ||
361 | } | ||
362 | |||
273 | unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) | 363 | unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) |
274 | { | 364 | { |
275 | int extdatalen=0; | 365 | int extdatalen=0; |
@@ -317,7 +407,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
317 | } | 407 | } |
318 | 408 | ||
319 | /* Add RI if renegotiating */ | 409 | /* Add RI if renegotiating */ |
320 | if (s->new_session) | 410 | if (s->renegotiate) |
321 | { | 411 | { |
322 | int el; | 412 | int el; |
323 | 413 | ||
@@ -341,6 +431,34 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
341 | ret += el; | 431 | ret += el; |
342 | } | 432 | } |
343 | 433 | ||
434 | #ifndef OPENSSL_NO_SRP | ||
435 | /* Add SRP username if there is one */ | ||
436 | if (s->srp_ctx.login != NULL) | ||
437 | { /* Add TLS extension SRP username to the Client Hello message */ | ||
438 | |||
439 | int login_len = strlen(s->srp_ctx.login); | ||
440 | if (login_len > 255 || login_len == 0) | ||
441 | { | ||
442 | SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); | ||
443 | return NULL; | ||
444 | } | ||
445 | |||
446 | /* check for enough space. | ||
447 | 4 for the srp type type and entension length | ||
448 | 1 for the srp user identity | ||
449 | + srp user identity length | ||
450 | */ | ||
451 | if ((limit - ret - 5 - login_len) < 0) return NULL; | ||
452 | |||
453 | /* fill in the extension */ | ||
454 | s2n(TLSEXT_TYPE_srp,ret); | ||
455 | s2n(login_len+1,ret); | ||
456 | (*ret++) = (unsigned char) login_len; | ||
457 | memcpy(ret, s->srp_ctx.login, login_len); | ||
458 | ret+=login_len; | ||
459 | } | ||
460 | #endif | ||
461 | |||
344 | #ifndef OPENSSL_NO_EC | 462 | #ifndef OPENSSL_NO_EC |
345 | if (s->tlsext_ecpointformatlist != NULL && | 463 | if (s->tlsext_ecpointformatlist != NULL && |
346 | s->version != DTLS1_VERSION) | 464 | s->version != DTLS1_VERSION) |
@@ -426,6 +544,17 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
426 | } | 544 | } |
427 | skip_ext: | 545 | skip_ext: |
428 | 546 | ||
547 | if (TLS1_get_client_version(s) >= TLS1_2_VERSION) | ||
548 | { | ||
549 | if ((size_t)(limit - ret) < sizeof(tls12_sigalgs) + 6) | ||
550 | return NULL; | ||
551 | s2n(TLSEXT_TYPE_signature_algorithms,ret); | ||
552 | s2n(sizeof(tls12_sigalgs) + 2, ret); | ||
553 | s2n(sizeof(tls12_sigalgs), ret); | ||
554 | memcpy(ret, tls12_sigalgs, sizeof(tls12_sigalgs)); | ||
555 | ret += sizeof(tls12_sigalgs); | ||
556 | } | ||
557 | |||
429 | #ifdef TLSEXT_TYPE_opaque_prf_input | 558 | #ifdef TLSEXT_TYPE_opaque_prf_input |
430 | if (s->s3->client_opaque_prf_input != NULL && | 559 | if (s->s3->client_opaque_prf_input != NULL && |
431 | s->version != DTLS1_VERSION) | 560 | s->version != DTLS1_VERSION) |
@@ -494,6 +623,51 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
494 | i2d_X509_EXTENSIONS(s->tlsext_ocsp_exts, &ret); | 623 | i2d_X509_EXTENSIONS(s->tlsext_ocsp_exts, &ret); |
495 | } | 624 | } |
496 | 625 | ||
626 | #ifndef OPENSSL_NO_HEARTBEATS | ||
627 | /* Add Heartbeat extension */ | ||
628 | s2n(TLSEXT_TYPE_heartbeat,ret); | ||
629 | s2n(1,ret); | ||
630 | /* Set mode: | ||
631 | * 1: peer may send requests | ||
632 | * 2: peer not allowed to send requests | ||
633 | */ | ||
634 | if (s->tlsext_heartbeat & SSL_TLSEXT_HB_DONT_RECV_REQUESTS) | ||
635 | *(ret++) = SSL_TLSEXT_HB_DONT_SEND_REQUESTS; | ||
636 | else | ||
637 | *(ret++) = SSL_TLSEXT_HB_ENABLED; | ||
638 | #endif | ||
639 | |||
640 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
641 | if (s->ctx->next_proto_select_cb && !s->s3->tmp.finish_md_len) | ||
642 | { | ||
643 | /* The client advertises an emtpy extension to indicate its | ||
644 | * support for Next Protocol Negotiation */ | ||
645 | if (limit - ret - 4 < 0) | ||
646 | return NULL; | ||
647 | s2n(TLSEXT_TYPE_next_proto_neg,ret); | ||
648 | s2n(0,ret); | ||
649 | } | ||
650 | #endif | ||
651 | |||
652 | if(SSL_get_srtp_profiles(s)) | ||
653 | { | ||
654 | int el; | ||
655 | |||
656 | ssl_add_clienthello_use_srtp_ext(s, 0, &el, 0); | ||
657 | |||
658 | if((limit - p - 4 - el) < 0) return NULL; | ||
659 | |||
660 | s2n(TLSEXT_TYPE_use_srtp,ret); | ||
661 | s2n(el,ret); | ||
662 | |||
663 | if(ssl_add_clienthello_use_srtp_ext(s, ret, &el, el)) | ||
664 | { | ||
665 | SSLerr(SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); | ||
666 | return NULL; | ||
667 | } | ||
668 | ret += el; | ||
669 | } | ||
670 | |||
497 | if ((extdatalen = ret-p-2)== 0) | 671 | if ((extdatalen = ret-p-2)== 0) |
498 | return p; | 672 | return p; |
499 | 673 | ||
@@ -505,6 +679,9 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
505 | { | 679 | { |
506 | int extdatalen=0; | 680 | int extdatalen=0; |
507 | unsigned char *ret = p; | 681 | unsigned char *ret = p; |
682 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
683 | int next_proto_neg_seen; | ||
684 | #endif | ||
508 | 685 | ||
509 | /* don't add extensions for SSLv3, unless doing secure renegotiation */ | 686 | /* don't add extensions for SSLv3, unless doing secure renegotiation */ |
510 | if (s->version == SSL3_VERSION && !s->s3->send_connection_binding) | 687 | if (s->version == SSL3_VERSION && !s->s3->send_connection_binding) |
@@ -603,6 +780,26 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
603 | ret += sol; | 780 | ret += sol; |
604 | } | 781 | } |
605 | #endif | 782 | #endif |
783 | |||
784 | if(s->srtp_profile) | ||
785 | { | ||
786 | int el; | ||
787 | |||
788 | ssl_add_serverhello_use_srtp_ext(s, 0, &el, 0); | ||
789 | |||
790 | if((limit - p - 4 - el) < 0) return NULL; | ||
791 | |||
792 | s2n(TLSEXT_TYPE_use_srtp,ret); | ||
793 | s2n(el,ret); | ||
794 | |||
795 | if(ssl_add_serverhello_use_srtp_ext(s, ret, &el, el)) | ||
796 | { | ||
797 | SSLerr(SSL_F_SSL_ADD_SERVERHELLO_TLSEXT, ERR_R_INTERNAL_ERROR); | ||
798 | return NULL; | ||
799 | } | ||
800 | ret+=el; | ||
801 | } | ||
802 | |||
606 | if (((s->s3->tmp.new_cipher->id & 0xFFFF)==0x80 || (s->s3->tmp.new_cipher->id & 0xFFFF)==0x81) | 803 | if (((s->s3->tmp.new_cipher->id & 0xFFFF)==0x80 || (s->s3->tmp.new_cipher->id & 0xFFFF)==0x81) |
607 | && (SSL_get_options(s) & SSL_OP_CRYPTOPRO_TLSEXT_BUG)) | 804 | && (SSL_get_options(s) & SSL_OP_CRYPTOPRO_TLSEXT_BUG)) |
608 | { const unsigned char cryptopro_ext[36] = { | 805 | { const unsigned char cryptopro_ext[36] = { |
@@ -618,6 +815,46 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned cha | |||
618 | 815 | ||
619 | } | 816 | } |
620 | 817 | ||
818 | #ifndef OPENSSL_NO_HEARTBEATS | ||
819 | /* Add Heartbeat extension if we've received one */ | ||
820 | if (s->tlsext_heartbeat & SSL_TLSEXT_HB_ENABLED) | ||
821 | { | ||
822 | s2n(TLSEXT_TYPE_heartbeat,ret); | ||
823 | s2n(1,ret); | ||
824 | /* Set mode: | ||
825 | * 1: peer may send requests | ||
826 | * 2: peer not allowed to send requests | ||
827 | */ | ||
828 | if (s->tlsext_heartbeat & SSL_TLSEXT_HB_DONT_RECV_REQUESTS) | ||
829 | *(ret++) = SSL_TLSEXT_HB_DONT_SEND_REQUESTS; | ||
830 | else | ||
831 | *(ret++) = SSL_TLSEXT_HB_ENABLED; | ||
832 | |||
833 | } | ||
834 | #endif | ||
835 | |||
836 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
837 | next_proto_neg_seen = s->s3->next_proto_neg_seen; | ||
838 | s->s3->next_proto_neg_seen = 0; | ||
839 | if (next_proto_neg_seen && s->ctx->next_protos_advertised_cb) | ||
840 | { | ||
841 | const unsigned char *npa; | ||
842 | unsigned int npalen; | ||
843 | int r; | ||
844 | |||
845 | r = s->ctx->next_protos_advertised_cb(s, &npa, &npalen, s->ctx->next_protos_advertised_cb_arg); | ||
846 | if (r == SSL_TLSEXT_ERR_OK) | ||
847 | { | ||
848 | if ((long)(limit - ret - 4 - npalen) < 0) return NULL; | ||
849 | s2n(TLSEXT_TYPE_next_proto_neg,ret); | ||
850 | s2n(npalen,ret); | ||
851 | memcpy(ret, npa, npalen); | ||
852 | ret += npalen; | ||
853 | s->s3->next_proto_neg_seen = 1; | ||
854 | } | ||
855 | } | ||
856 | #endif | ||
857 | |||
621 | if ((extdatalen = ret-p-2)== 0) | 858 | if ((extdatalen = ret-p-2)== 0) |
622 | return p; | 859 | return p; |
623 | 860 | ||
@@ -632,9 +869,18 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
632 | unsigned short len; | 869 | unsigned short len; |
633 | unsigned char *data = *p; | 870 | unsigned char *data = *p; |
634 | int renegotiate_seen = 0; | 871 | int renegotiate_seen = 0; |
872 | int sigalg_seen = 0; | ||
635 | 873 | ||
636 | s->servername_done = 0; | 874 | s->servername_done = 0; |
637 | s->tlsext_status_type = -1; | 875 | s->tlsext_status_type = -1; |
876 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
877 | s->s3->next_proto_neg_seen = 0; | ||
878 | #endif | ||
879 | |||
880 | #ifndef OPENSSL_NO_HEARTBEATS | ||
881 | s->tlsext_heartbeat &= ~(SSL_TLSEXT_HB_ENABLED | | ||
882 | SSL_TLSEXT_HB_DONT_SEND_REQUESTS); | ||
883 | #endif | ||
638 | 884 | ||
639 | if (data >= (d+n-2)) | 885 | if (data >= (d+n-2)) |
640 | goto ri_check; | 886 | goto ri_check; |
@@ -762,6 +1008,31 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
762 | } | 1008 | } |
763 | 1009 | ||
764 | } | 1010 | } |
1011 | #ifndef OPENSSL_NO_SRP | ||
1012 | else if (type == TLSEXT_TYPE_srp) | ||
1013 | { | ||
1014 | if (size <= 0 || ((len = data[0])) != (size -1)) | ||
1015 | { | ||
1016 | *al = SSL_AD_DECODE_ERROR; | ||
1017 | return 0; | ||
1018 | } | ||
1019 | if (s->srp_ctx.login != NULL) | ||
1020 | { | ||
1021 | *al = SSL_AD_DECODE_ERROR; | ||
1022 | return 0; | ||
1023 | } | ||
1024 | if ((s->srp_ctx.login = OPENSSL_malloc(len+1)) == NULL) | ||
1025 | return -1; | ||
1026 | memcpy(s->srp_ctx.login, &data[1], len); | ||
1027 | s->srp_ctx.login[len]='\0'; | ||
1028 | |||
1029 | if (strlen(s->srp_ctx.login) != len) | ||
1030 | { | ||
1031 | *al = SSL_AD_DECODE_ERROR; | ||
1032 | return 0; | ||
1033 | } | ||
1034 | } | ||
1035 | #endif | ||
765 | 1036 | ||
766 | #ifndef OPENSSL_NO_EC | 1037 | #ifndef OPENSSL_NO_EC |
767 | else if (type == TLSEXT_TYPE_ec_point_formats && | 1038 | else if (type == TLSEXT_TYPE_ec_point_formats && |
@@ -882,6 +1153,28 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
882 | return 0; | 1153 | return 0; |
883 | renegotiate_seen = 1; | 1154 | renegotiate_seen = 1; |
884 | } | 1155 | } |
1156 | else if (type == TLSEXT_TYPE_signature_algorithms) | ||
1157 | { | ||
1158 | int dsize; | ||
1159 | if (sigalg_seen || size < 2) | ||
1160 | { | ||
1161 | *al = SSL_AD_DECODE_ERROR; | ||
1162 | return 0; | ||
1163 | } | ||
1164 | sigalg_seen = 1; | ||
1165 | n2s(data,dsize); | ||
1166 | size -= 2; | ||
1167 | if (dsize != size || dsize & 1) | ||
1168 | { | ||
1169 | *al = SSL_AD_DECODE_ERROR; | ||
1170 | return 0; | ||
1171 | } | ||
1172 | if (!tls1_process_sigalgs(s, data, dsize)) | ||
1173 | { | ||
1174 | *al = SSL_AD_DECODE_ERROR; | ||
1175 | return 0; | ||
1176 | } | ||
1177 | } | ||
885 | else if (type == TLSEXT_TYPE_status_request && | 1178 | else if (type == TLSEXT_TYPE_status_request && |
886 | s->version != DTLS1_VERSION && s->ctx->tlsext_status_cb) | 1179 | s->version != DTLS1_VERSION && s->ctx->tlsext_status_cb) |
887 | { | 1180 | { |
@@ -994,8 +1287,54 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
994 | else | 1287 | else |
995 | s->tlsext_status_type = -1; | 1288 | s->tlsext_status_type = -1; |
996 | } | 1289 | } |
1290 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1291 | else if (type == TLSEXT_TYPE_heartbeat) | ||
1292 | { | ||
1293 | switch(data[0]) | ||
1294 | { | ||
1295 | case 0x01: /* Client allows us to send HB requests */ | ||
1296 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_ENABLED; | ||
1297 | break; | ||
1298 | case 0x02: /* Client doesn't accept HB requests */ | ||
1299 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_ENABLED; | ||
1300 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_SEND_REQUESTS; | ||
1301 | break; | ||
1302 | default: *al = SSL_AD_ILLEGAL_PARAMETER; | ||
1303 | return 0; | ||
1304 | } | ||
1305 | } | ||
1306 | #endif | ||
1307 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1308 | else if (type == TLSEXT_TYPE_next_proto_neg && | ||
1309 | s->s3->tmp.finish_md_len == 0) | ||
1310 | { | ||
1311 | /* We shouldn't accept this extension on a | ||
1312 | * renegotiation. | ||
1313 | * | ||
1314 | * s->new_session will be set on renegotiation, but we | ||
1315 | * probably shouldn't rely that it couldn't be set on | ||
1316 | * the initial renegotation too in certain cases (when | ||
1317 | * there's some other reason to disallow resuming an | ||
1318 | * earlier session -- the current code won't be doing | ||
1319 | * anything like that, but this might change). | ||
1320 | |||
1321 | * A valid sign that there's been a previous handshake | ||
1322 | * in this connection is if s->s3->tmp.finish_md_len > | ||
1323 | * 0. (We are talking about a check that will happen | ||
1324 | * in the Hello protocol round, well before a new | ||
1325 | * Finished message could have been computed.) */ | ||
1326 | s->s3->next_proto_neg_seen = 1; | ||
1327 | } | ||
1328 | #endif | ||
997 | 1329 | ||
998 | /* session ticket processed earlier */ | 1330 | /* session ticket processed earlier */ |
1331 | else if (type == TLSEXT_TYPE_use_srtp) | ||
1332 | { | ||
1333 | if(ssl_parse_clienthello_use_srtp_ext(s, data, size, | ||
1334 | al)) | ||
1335 | return 0; | ||
1336 | } | ||
1337 | |||
999 | data+=size; | 1338 | data+=size; |
1000 | } | 1339 | } |
1001 | 1340 | ||
@@ -1005,7 +1344,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
1005 | 1344 | ||
1006 | /* Need RI if renegotiating */ | 1345 | /* Need RI if renegotiating */ |
1007 | 1346 | ||
1008 | if (!renegotiate_seen && s->new_session && | 1347 | if (!renegotiate_seen && s->renegotiate && |
1009 | !(s->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) | 1348 | !(s->options & SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) |
1010 | { | 1349 | { |
1011 | *al = SSL_AD_HANDSHAKE_FAILURE; | 1350 | *al = SSL_AD_HANDSHAKE_FAILURE; |
@@ -1017,6 +1356,26 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
1017 | return 1; | 1356 | return 1; |
1018 | } | 1357 | } |
1019 | 1358 | ||
1359 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1360 | /* ssl_next_proto_validate validates a Next Protocol Negotiation block. No | ||
1361 | * elements of zero length are allowed and the set of elements must exactly fill | ||
1362 | * the length of the block. */ | ||
1363 | static char ssl_next_proto_validate(unsigned char *d, unsigned len) | ||
1364 | { | ||
1365 | unsigned int off = 0; | ||
1366 | |||
1367 | while (off < len) | ||
1368 | { | ||
1369 | if (d[off] == 0) | ||
1370 | return 0; | ||
1371 | off += d[off]; | ||
1372 | off++; | ||
1373 | } | ||
1374 | |||
1375 | return off == len; | ||
1376 | } | ||
1377 | #endif | ||
1378 | |||
1020 | int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al) | 1379 | int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, int n, int *al) |
1021 | { | 1380 | { |
1022 | unsigned short length; | 1381 | unsigned short length; |
@@ -1026,6 +1385,15 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
1026 | int tlsext_servername = 0; | 1385 | int tlsext_servername = 0; |
1027 | int renegotiate_seen = 0; | 1386 | int renegotiate_seen = 0; |
1028 | 1387 | ||
1388 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1389 | s->s3->next_proto_neg_seen = 0; | ||
1390 | #endif | ||
1391 | |||
1392 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1393 | s->tlsext_heartbeat &= ~(SSL_TLSEXT_HB_ENABLED | | ||
1394 | SSL_TLSEXT_HB_DONT_SEND_REQUESTS); | ||
1395 | #endif | ||
1396 | |||
1029 | if (data >= (d+n-2)) | 1397 | if (data >= (d+n-2)) |
1030 | goto ri_check; | 1398 | goto ri_check; |
1031 | 1399 | ||
@@ -1151,12 +1519,71 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in | |||
1151 | /* Set flag to expect CertificateStatus message */ | 1519 | /* Set flag to expect CertificateStatus message */ |
1152 | s->tlsext_status_expected = 1; | 1520 | s->tlsext_status_expected = 1; |
1153 | } | 1521 | } |
1522 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
1523 | else if (type == TLSEXT_TYPE_next_proto_neg && | ||
1524 | s->s3->tmp.finish_md_len == 0) | ||
1525 | { | ||
1526 | unsigned char *selected; | ||
1527 | unsigned char selected_len; | ||
1528 | |||
1529 | /* We must have requested it. */ | ||
1530 | if ((s->ctx->next_proto_select_cb == NULL)) | ||
1531 | { | ||
1532 | *al = TLS1_AD_UNSUPPORTED_EXTENSION; | ||
1533 | return 0; | ||
1534 | } | ||
1535 | /* The data must be valid */ | ||
1536 | if (!ssl_next_proto_validate(data, size)) | ||
1537 | { | ||
1538 | *al = TLS1_AD_DECODE_ERROR; | ||
1539 | return 0; | ||
1540 | } | ||
1541 | if (s->ctx->next_proto_select_cb(s, &selected, &selected_len, data, size, s->ctx->next_proto_select_cb_arg) != SSL_TLSEXT_ERR_OK) | ||
1542 | { | ||
1543 | *al = TLS1_AD_INTERNAL_ERROR; | ||
1544 | return 0; | ||
1545 | } | ||
1546 | s->next_proto_negotiated = OPENSSL_malloc(selected_len); | ||
1547 | if (!s->next_proto_negotiated) | ||
1548 | { | ||
1549 | *al = TLS1_AD_INTERNAL_ERROR; | ||
1550 | return 0; | ||
1551 | } | ||
1552 | memcpy(s->next_proto_negotiated, selected, selected_len); | ||
1553 | s->next_proto_negotiated_len = selected_len; | ||
1554 | s->s3->next_proto_neg_seen = 1; | ||
1555 | } | ||
1556 | #endif | ||
1154 | else if (type == TLSEXT_TYPE_renegotiate) | 1557 | else if (type == TLSEXT_TYPE_renegotiate) |
1155 | { | 1558 | { |
1156 | if(!ssl_parse_serverhello_renegotiate_ext(s, data, size, al)) | 1559 | if(!ssl_parse_serverhello_renegotiate_ext(s, data, size, al)) |
1157 | return 0; | 1560 | return 0; |
1158 | renegotiate_seen = 1; | 1561 | renegotiate_seen = 1; |
1159 | } | 1562 | } |
1563 | #ifndef OPENSSL_NO_HEARTBEATS | ||
1564 | else if (type == TLSEXT_TYPE_heartbeat) | ||
1565 | { | ||
1566 | switch(data[0]) | ||
1567 | { | ||
1568 | case 0x01: /* Server allows us to send HB requests */ | ||
1569 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_ENABLED; | ||
1570 | break; | ||
1571 | case 0x02: /* Server doesn't accept HB requests */ | ||
1572 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_ENABLED; | ||
1573 | s->tlsext_heartbeat |= SSL_TLSEXT_HB_DONT_SEND_REQUESTS; | ||
1574 | break; | ||
1575 | default: *al = SSL_AD_ILLEGAL_PARAMETER; | ||
1576 | return 0; | ||
1577 | } | ||
1578 | } | ||
1579 | #endif | ||
1580 | else if (type == TLSEXT_TYPE_use_srtp) | ||
1581 | { | ||
1582 | if(ssl_parse_serverhello_use_srtp_ext(s, data, size, | ||
1583 | al)) | ||
1584 | return 0; | ||
1585 | } | ||
1586 | |||
1160 | data+=size; | 1587 | data+=size; |
1161 | } | 1588 | } |
1162 | 1589 | ||
@@ -1236,7 +1663,7 @@ int ssl_prepare_clienthello_tlsext(SSL *s) | |||
1236 | break; | 1663 | break; |
1237 | } | 1664 | } |
1238 | } | 1665 | } |
1239 | using_ecc = using_ecc && (s->version == TLS1_VERSION); | 1666 | using_ecc = using_ecc && (s->version >= TLS1_VERSION); |
1240 | if (using_ecc) | 1667 | if (using_ecc) |
1241 | { | 1668 | { |
1242 | if (s->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->tlsext_ecpointformatlist); | 1669 | if (s->tlsext_ecpointformatlist != NULL) OPENSSL_free(s->tlsext_ecpointformatlist); |
@@ -1252,16 +1679,19 @@ int ssl_prepare_clienthello_tlsext(SSL *s) | |||
1252 | 1679 | ||
1253 | /* we support all named elliptic curves in draft-ietf-tls-ecc-12 */ | 1680 | /* we support all named elliptic curves in draft-ietf-tls-ecc-12 */ |
1254 | if (s->tlsext_ellipticcurvelist != NULL) OPENSSL_free(s->tlsext_ellipticcurvelist); | 1681 | if (s->tlsext_ellipticcurvelist != NULL) OPENSSL_free(s->tlsext_ellipticcurvelist); |
1255 | s->tlsext_ellipticcurvelist_length = sizeof(nid_list)/sizeof(nid_list[0]) * 2; | 1682 | s->tlsext_ellipticcurvelist_length = sizeof(pref_list)/sizeof(pref_list[0]) * 2; |
1256 | if ((s->tlsext_ellipticcurvelist = OPENSSL_malloc(s->tlsext_ellipticcurvelist_length)) == NULL) | 1683 | if ((s->tlsext_ellipticcurvelist = OPENSSL_malloc(s->tlsext_ellipticcurvelist_length)) == NULL) |
1257 | { | 1684 | { |
1258 | s->tlsext_ellipticcurvelist_length = 0; | 1685 | s->tlsext_ellipticcurvelist_length = 0; |
1259 | SSLerr(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT,ERR_R_MALLOC_FAILURE); | 1686 | SSLerr(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT,ERR_R_MALLOC_FAILURE); |
1260 | return -1; | 1687 | return -1; |
1261 | } | 1688 | } |
1262 | for (i = 1, j = s->tlsext_ellipticcurvelist; (unsigned int)i <= | 1689 | for (i = 0, j = s->tlsext_ellipticcurvelist; (unsigned int)i < |
1263 | sizeof(nid_list)/sizeof(nid_list[0]); i++) | 1690 | sizeof(pref_list)/sizeof(pref_list[0]); i++) |
1264 | s2n(i,j); | 1691 | { |
1692 | int id = tls1_ec_nid2curve_id(pref_list[i]); | ||
1693 | s2n(id,j); | ||
1694 | } | ||
1265 | } | 1695 | } |
1266 | #endif /* OPENSSL_NO_EC */ | 1696 | #endif /* OPENSSL_NO_EC */ |
1267 | 1697 | ||
@@ -1570,26 +2000,56 @@ int ssl_check_serverhello_tlsext(SSL *s) | |||
1570 | } | 2000 | } |
1571 | } | 2001 | } |
1572 | 2002 | ||
1573 | /* Since the server cache lookup is done early on in the processing of client | 2003 | /* Since the server cache lookup is done early on in the processing of the |
1574 | * hello and other operations depend on the result we need to handle any TLS | 2004 | * ClientHello, and other operations depend on the result, we need to handle |
1575 | * session ticket extension at the same time. | 2005 | * any TLS session ticket extension at the same time. |
2006 | * | ||
2007 | * session_id: points at the session ID in the ClientHello. This code will | ||
2008 | * read past the end of this in order to parse out the session ticket | ||
2009 | * extension, if any. | ||
2010 | * len: the length of the session ID. | ||
2011 | * limit: a pointer to the first byte after the ClientHello. | ||
2012 | * ret: (output) on return, if a ticket was decrypted, then this is set to | ||
2013 | * point to the resulting session. | ||
2014 | * | ||
2015 | * If s->tls_session_secret_cb is set then we are expecting a pre-shared key | ||
2016 | * ciphersuite, in which case we have no use for session tickets and one will | ||
2017 | * never be decrypted, nor will s->tlsext_ticket_expected be set to 1. | ||
2018 | * | ||
2019 | * Returns: | ||
2020 | * -1: fatal error, either from parsing or decrypting the ticket. | ||
2021 | * 0: no ticket was found (or was ignored, based on settings). | ||
2022 | * 1: a zero length extension was found, indicating that the client supports | ||
2023 | * session tickets but doesn't currently have one to offer. | ||
2024 | * 2: either s->tls_session_secret_cb was set, or a ticket was offered but | ||
2025 | * couldn't be decrypted because of a non-fatal error. | ||
2026 | * 3: a ticket was successfully decrypted and *ret was set. | ||
2027 | * | ||
2028 | * Side effects: | ||
2029 | * Sets s->tlsext_ticket_expected to 1 if the server will have to issue | ||
2030 | * a new session ticket to the client because the client indicated support | ||
2031 | * (and s->tls_session_secret_cb is NULL) but the client either doesn't have | ||
2032 | * a session ticket or we couldn't use the one it gave us, or if | ||
2033 | * s->ctx->tlsext_ticket_key_cb asked to renew the client's ticket. | ||
2034 | * Otherwise, s->tlsext_ticket_expected is set to 0. | ||
1576 | */ | 2035 | */ |
1577 | |||
1578 | int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, | 2036 | int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, |
1579 | const unsigned char *limit, SSL_SESSION **ret) | 2037 | const unsigned char *limit, SSL_SESSION **ret) |
1580 | { | 2038 | { |
1581 | /* Point after session ID in client hello */ | 2039 | /* Point after session ID in client hello */ |
1582 | const unsigned char *p = session_id + len; | 2040 | const unsigned char *p = session_id + len; |
1583 | unsigned short i; | 2041 | unsigned short i; |
1584 | 2042 | ||
2043 | *ret = NULL; | ||
2044 | s->tlsext_ticket_expected = 0; | ||
2045 | |||
1585 | /* If tickets disabled behave as if no ticket present | 2046 | /* If tickets disabled behave as if no ticket present |
1586 | * to permit stateful resumption. | 2047 | * to permit stateful resumption. |
1587 | */ | 2048 | */ |
1588 | if (SSL_get_options(s) & SSL_OP_NO_TICKET) | 2049 | if (SSL_get_options(s) & SSL_OP_NO_TICKET) |
1589 | return 1; | 2050 | return 0; |
1590 | |||
1591 | if ((s->version <= SSL3_VERSION) || !limit) | 2051 | if ((s->version <= SSL3_VERSION) || !limit) |
1592 | return 1; | 2052 | return 0; |
1593 | if (p >= limit) | 2053 | if (p >= limit) |
1594 | return -1; | 2054 | return -1; |
1595 | /* Skip past DTLS cookie */ | 2055 | /* Skip past DTLS cookie */ |
@@ -1612,7 +2072,7 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, | |||
1612 | return -1; | 2072 | return -1; |
1613 | /* Now at start of extensions */ | 2073 | /* Now at start of extensions */ |
1614 | if ((p + 2) >= limit) | 2074 | if ((p + 2) >= limit) |
1615 | return 1; | 2075 | return 0; |
1616 | n2s(p, i); | 2076 | n2s(p, i); |
1617 | while ((p + 4) <= limit) | 2077 | while ((p + 4) <= limit) |
1618 | { | 2078 | { |
@@ -1620,39 +2080,61 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, | |||
1620 | n2s(p, type); | 2080 | n2s(p, type); |
1621 | n2s(p, size); | 2081 | n2s(p, size); |
1622 | if (p + size > limit) | 2082 | if (p + size > limit) |
1623 | return 1; | 2083 | return 0; |
1624 | if (type == TLSEXT_TYPE_session_ticket) | 2084 | if (type == TLSEXT_TYPE_session_ticket) |
1625 | { | 2085 | { |
1626 | /* If tickets disabled indicate cache miss which will | 2086 | int r; |
1627 | * trigger a full handshake | ||
1628 | */ | ||
1629 | if (SSL_get_options(s) & SSL_OP_NO_TICKET) | ||
1630 | return 1; | ||
1631 | /* If zero length note client will accept a ticket | ||
1632 | * and indicate cache miss to trigger full handshake | ||
1633 | */ | ||
1634 | if (size == 0) | 2087 | if (size == 0) |
1635 | { | 2088 | { |
2089 | /* The client will accept a ticket but doesn't | ||
2090 | * currently have one. */ | ||
1636 | s->tlsext_ticket_expected = 1; | 2091 | s->tlsext_ticket_expected = 1; |
1637 | return 0; /* Cache miss */ | 2092 | return 1; |
1638 | } | 2093 | } |
1639 | if (s->tls_session_secret_cb) | 2094 | if (s->tls_session_secret_cb) |
1640 | { | 2095 | { |
1641 | /* Indicate cache miss here and instead of | 2096 | /* Indicate that the ticket couldn't be |
1642 | * generating the session from ticket now, | 2097 | * decrypted rather than generating the session |
1643 | * trigger abbreviated handshake based on | 2098 | * from ticket now, trigger abbreviated |
1644 | * external mechanism to calculate the master | 2099 | * handshake based on external mechanism to |
1645 | * secret later. */ | 2100 | * calculate the master secret later. */ |
1646 | return 0; | 2101 | return 2; |
2102 | } | ||
2103 | r = tls_decrypt_ticket(s, p, size, session_id, len, ret); | ||
2104 | switch (r) | ||
2105 | { | ||
2106 | case 2: /* ticket couldn't be decrypted */ | ||
2107 | s->tlsext_ticket_expected = 1; | ||
2108 | return 2; | ||
2109 | case 3: /* ticket was decrypted */ | ||
2110 | return r; | ||
2111 | case 4: /* ticket decrypted but need to renew */ | ||
2112 | s->tlsext_ticket_expected = 1; | ||
2113 | return 3; | ||
2114 | default: /* fatal error */ | ||
2115 | return -1; | ||
1647 | } | 2116 | } |
1648 | return tls_decrypt_ticket(s, p, size, session_id, len, | ||
1649 | ret); | ||
1650 | } | 2117 | } |
1651 | p += size; | 2118 | p += size; |
1652 | } | 2119 | } |
1653 | return 1; | 2120 | return 0; |
1654 | } | 2121 | } |
1655 | 2122 | ||
2123 | /* tls_decrypt_ticket attempts to decrypt a session ticket. | ||
2124 | * | ||
2125 | * etick: points to the body of the session ticket extension. | ||
2126 | * eticklen: the length of the session tickets extenion. | ||
2127 | * sess_id: points at the session ID. | ||
2128 | * sesslen: the length of the session ID. | ||
2129 | * psess: (output) on return, if a ticket was decrypted, then this is set to | ||
2130 | * point to the resulting session. | ||
2131 | * | ||
2132 | * Returns: | ||
2133 | * -1: fatal error, either from parsing or decrypting the ticket. | ||
2134 | * 2: the ticket couldn't be decrypted. | ||
2135 | * 3: a ticket was successfully decrypted and *psess was set. | ||
2136 | * 4: same as 3, but the ticket needs to be renewed. | ||
2137 | */ | ||
1656 | static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | 2138 | static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, |
1657 | const unsigned char *sess_id, int sesslen, | 2139 | const unsigned char *sess_id, int sesslen, |
1658 | SSL_SESSION **psess) | 2140 | SSL_SESSION **psess) |
@@ -1667,7 +2149,7 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | |||
1667 | SSL_CTX *tctx = s->initial_ctx; | 2149 | SSL_CTX *tctx = s->initial_ctx; |
1668 | /* Need at least keyname + iv + some encrypted data */ | 2150 | /* Need at least keyname + iv + some encrypted data */ |
1669 | if (eticklen < 48) | 2151 | if (eticklen < 48) |
1670 | goto tickerr; | 2152 | return 2; |
1671 | /* Initialize session ticket encryption and HMAC contexts */ | 2153 | /* Initialize session ticket encryption and HMAC contexts */ |
1672 | HMAC_CTX_init(&hctx); | 2154 | HMAC_CTX_init(&hctx); |
1673 | EVP_CIPHER_CTX_init(&ctx); | 2155 | EVP_CIPHER_CTX_init(&ctx); |
@@ -1679,7 +2161,7 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | |||
1679 | if (rv < 0) | 2161 | if (rv < 0) |
1680 | return -1; | 2162 | return -1; |
1681 | if (rv == 0) | 2163 | if (rv == 0) |
1682 | goto tickerr; | 2164 | return 2; |
1683 | if (rv == 2) | 2165 | if (rv == 2) |
1684 | renew_ticket = 1; | 2166 | renew_ticket = 1; |
1685 | } | 2167 | } |
@@ -1687,15 +2169,15 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | |||
1687 | { | 2169 | { |
1688 | /* Check key name matches */ | 2170 | /* Check key name matches */ |
1689 | if (memcmp(etick, tctx->tlsext_tick_key_name, 16)) | 2171 | if (memcmp(etick, tctx->tlsext_tick_key_name, 16)) |
1690 | goto tickerr; | 2172 | return 2; |
1691 | HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16, | 2173 | HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16, |
1692 | tlsext_tick_md(), NULL); | 2174 | tlsext_tick_md(), NULL); |
1693 | EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, | 2175 | EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, |
1694 | tctx->tlsext_tick_aes_key, etick + 16); | 2176 | tctx->tlsext_tick_aes_key, etick + 16); |
1695 | } | 2177 | } |
1696 | /* Attempt to process session ticket, first conduct sanity and | 2178 | /* Attempt to process session ticket, first conduct sanity and |
1697 | * integrity checks on ticket. | 2179 | * integrity checks on ticket. |
1698 | */ | 2180 | */ |
1699 | mlen = HMAC_size(&hctx); | 2181 | mlen = HMAC_size(&hctx); |
1700 | if (mlen < 0) | 2182 | if (mlen < 0) |
1701 | { | 2183 | { |
@@ -1708,7 +2190,7 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | |||
1708 | HMAC_Final(&hctx, tick_hmac, NULL); | 2190 | HMAC_Final(&hctx, tick_hmac, NULL); |
1709 | HMAC_CTX_cleanup(&hctx); | 2191 | HMAC_CTX_cleanup(&hctx); |
1710 | if (memcmp(tick_hmac, etick + eticklen, mlen)) | 2192 | if (memcmp(tick_hmac, etick + eticklen, mlen)) |
1711 | goto tickerr; | 2193 | return 2; |
1712 | /* Attempt to decrypt session data */ | 2194 | /* Attempt to decrypt session data */ |
1713 | /* Move p after IV to start of encrypted ticket, update length */ | 2195 | /* Move p after IV to start of encrypted ticket, update length */ |
1714 | p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx); | 2196 | p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx); |
@@ -1721,33 +2203,376 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, int eticklen, | |||
1721 | } | 2203 | } |
1722 | EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen); | 2204 | EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen); |
1723 | if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) | 2205 | if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) |
1724 | goto tickerr; | 2206 | return 2; |
1725 | slen += mlen; | 2207 | slen += mlen; |
1726 | EVP_CIPHER_CTX_cleanup(&ctx); | 2208 | EVP_CIPHER_CTX_cleanup(&ctx); |
1727 | p = sdec; | 2209 | p = sdec; |
1728 | 2210 | ||
1729 | sess = d2i_SSL_SESSION(NULL, &p, slen); | 2211 | sess = d2i_SSL_SESSION(NULL, &p, slen); |
1730 | OPENSSL_free(sdec); | 2212 | OPENSSL_free(sdec); |
1731 | if (sess) | 2213 | if (sess) |
1732 | { | 2214 | { |
1733 | /* The session ID if non-empty is used by some clients to | 2215 | /* The session ID, if non-empty, is used by some clients to |
1734 | * detect that the ticket has been accepted. So we copy it to | 2216 | * detect that the ticket has been accepted. So we copy it to |
1735 | * the session structure. If it is empty set length to zero | 2217 | * the session structure. If it is empty set length to zero |
1736 | * as required by standard. | 2218 | * as required by standard. |
1737 | */ | 2219 | */ |
1738 | if (sesslen) | 2220 | if (sesslen) |
1739 | memcpy(sess->session_id, sess_id, sesslen); | 2221 | memcpy(sess->session_id, sess_id, sesslen); |
1740 | sess->session_id_length = sesslen; | 2222 | sess->session_id_length = sesslen; |
1741 | *psess = sess; | 2223 | *psess = sess; |
1742 | s->tlsext_ticket_expected = renew_ticket; | 2224 | if (renew_ticket) |
2225 | return 4; | ||
2226 | else | ||
2227 | return 3; | ||
2228 | } | ||
2229 | ERR_clear_error(); | ||
2230 | /* For session parse failure, indicate that we need to send a new | ||
2231 | * ticket. */ | ||
2232 | return 2; | ||
2233 | } | ||
2234 | |||
2235 | /* Tables to translate from NIDs to TLS v1.2 ids */ | ||
2236 | |||
2237 | typedef struct | ||
2238 | { | ||
2239 | int nid; | ||
2240 | int id; | ||
2241 | } tls12_lookup; | ||
2242 | |||
2243 | static tls12_lookup tls12_md[] = { | ||
2244 | #ifndef OPENSSL_NO_MD5 | ||
2245 | {NID_md5, TLSEXT_hash_md5}, | ||
2246 | #endif | ||
2247 | #ifndef OPENSSL_NO_SHA | ||
2248 | {NID_sha1, TLSEXT_hash_sha1}, | ||
2249 | #endif | ||
2250 | #ifndef OPENSSL_NO_SHA256 | ||
2251 | {NID_sha224, TLSEXT_hash_sha224}, | ||
2252 | {NID_sha256, TLSEXT_hash_sha256}, | ||
2253 | #endif | ||
2254 | #ifndef OPENSSL_NO_SHA512 | ||
2255 | {NID_sha384, TLSEXT_hash_sha384}, | ||
2256 | {NID_sha512, TLSEXT_hash_sha512} | ||
2257 | #endif | ||
2258 | }; | ||
2259 | |||
2260 | static tls12_lookup tls12_sig[] = { | ||
2261 | #ifndef OPENSSL_NO_RSA | ||
2262 | {EVP_PKEY_RSA, TLSEXT_signature_rsa}, | ||
2263 | #endif | ||
2264 | #ifndef OPENSSL_NO_DSA | ||
2265 | {EVP_PKEY_DSA, TLSEXT_signature_dsa}, | ||
2266 | #endif | ||
2267 | #ifndef OPENSSL_NO_ECDSA | ||
2268 | {EVP_PKEY_EC, TLSEXT_signature_ecdsa} | ||
2269 | #endif | ||
2270 | }; | ||
2271 | |||
2272 | static int tls12_find_id(int nid, tls12_lookup *table, size_t tlen) | ||
2273 | { | ||
2274 | size_t i; | ||
2275 | for (i = 0; i < tlen; i++) | ||
2276 | { | ||
2277 | if (table[i].nid == nid) | ||
2278 | return table[i].id; | ||
2279 | } | ||
2280 | return -1; | ||
2281 | } | ||
2282 | #if 0 | ||
2283 | static int tls12_find_nid(int id, tls12_lookup *table, size_t tlen) | ||
2284 | { | ||
2285 | size_t i; | ||
2286 | for (i = 0; i < tlen; i++) | ||
2287 | { | ||
2288 | if (table[i].id == id) | ||
2289 | return table[i].nid; | ||
2290 | } | ||
2291 | return -1; | ||
2292 | } | ||
2293 | #endif | ||
2294 | |||
2295 | int tls12_get_sigandhash(unsigned char *p, const EVP_PKEY *pk, const EVP_MD *md) | ||
2296 | { | ||
2297 | int sig_id, md_id; | ||
2298 | if (!md) | ||
2299 | return 0; | ||
2300 | md_id = tls12_find_id(EVP_MD_type(md), tls12_md, | ||
2301 | sizeof(tls12_md)/sizeof(tls12_lookup)); | ||
2302 | if (md_id == -1) | ||
2303 | return 0; | ||
2304 | sig_id = tls12_get_sigid(pk); | ||
2305 | if (sig_id == -1) | ||
2306 | return 0; | ||
2307 | p[0] = (unsigned char)md_id; | ||
2308 | p[1] = (unsigned char)sig_id; | ||
2309 | return 1; | ||
2310 | } | ||
2311 | |||
2312 | int tls12_get_sigid(const EVP_PKEY *pk) | ||
2313 | { | ||
2314 | return tls12_find_id(pk->type, tls12_sig, | ||
2315 | sizeof(tls12_sig)/sizeof(tls12_lookup)); | ||
2316 | } | ||
2317 | |||
2318 | const EVP_MD *tls12_get_hash(unsigned char hash_alg) | ||
2319 | { | ||
2320 | switch(hash_alg) | ||
2321 | { | ||
2322 | #ifndef OPENSSL_NO_MD5 | ||
2323 | case TLSEXT_hash_md5: | ||
2324 | #ifdef OPENSSL_FIPS | ||
2325 | if (FIPS_mode()) | ||
2326 | return NULL; | ||
2327 | #endif | ||
2328 | return EVP_md5(); | ||
2329 | #endif | ||
2330 | #ifndef OPENSSL_NO_SHA | ||
2331 | case TLSEXT_hash_sha1: | ||
2332 | return EVP_sha1(); | ||
2333 | #endif | ||
2334 | #ifndef OPENSSL_NO_SHA256 | ||
2335 | case TLSEXT_hash_sha224: | ||
2336 | return EVP_sha224(); | ||
2337 | |||
2338 | case TLSEXT_hash_sha256: | ||
2339 | return EVP_sha256(); | ||
2340 | #endif | ||
2341 | #ifndef OPENSSL_NO_SHA512 | ||
2342 | case TLSEXT_hash_sha384: | ||
2343 | return EVP_sha384(); | ||
2344 | |||
2345 | case TLSEXT_hash_sha512: | ||
2346 | return EVP_sha512(); | ||
2347 | #endif | ||
2348 | default: | ||
2349 | return NULL; | ||
2350 | |||
2351 | } | ||
2352 | } | ||
2353 | |||
2354 | /* Set preferred digest for each key type */ | ||
2355 | |||
2356 | int tls1_process_sigalgs(SSL *s, const unsigned char *data, int dsize) | ||
2357 | { | ||
2358 | int i, idx; | ||
2359 | const EVP_MD *md; | ||
2360 | CERT *c = s->cert; | ||
2361 | /* Extension ignored for TLS versions below 1.2 */ | ||
2362 | if (TLS1_get_version(s) < TLS1_2_VERSION) | ||
1743 | return 1; | 2363 | return 1; |
2364 | /* Should never happen */ | ||
2365 | if (!c) | ||
2366 | return 0; | ||
2367 | |||
2368 | c->pkeys[SSL_PKEY_DSA_SIGN].digest = NULL; | ||
2369 | c->pkeys[SSL_PKEY_RSA_SIGN].digest = NULL; | ||
2370 | c->pkeys[SSL_PKEY_RSA_ENC].digest = NULL; | ||
2371 | c->pkeys[SSL_PKEY_ECC].digest = NULL; | ||
2372 | |||
2373 | for (i = 0; i < dsize; i += 2) | ||
2374 | { | ||
2375 | unsigned char hash_alg = data[i], sig_alg = data[i+1]; | ||
2376 | |||
2377 | switch(sig_alg) | ||
2378 | { | ||
2379 | #ifndef OPENSSL_NO_RSA | ||
2380 | case TLSEXT_signature_rsa: | ||
2381 | idx = SSL_PKEY_RSA_SIGN; | ||
2382 | break; | ||
2383 | #endif | ||
2384 | #ifndef OPENSSL_NO_DSA | ||
2385 | case TLSEXT_signature_dsa: | ||
2386 | idx = SSL_PKEY_DSA_SIGN; | ||
2387 | break; | ||
2388 | #endif | ||
2389 | #ifndef OPENSSL_NO_ECDSA | ||
2390 | case TLSEXT_signature_ecdsa: | ||
2391 | idx = SSL_PKEY_ECC; | ||
2392 | break; | ||
2393 | #endif | ||
2394 | default: | ||
2395 | continue; | ||
2396 | } | ||
2397 | |||
2398 | if (c->pkeys[idx].digest == NULL) | ||
2399 | { | ||
2400 | md = tls12_get_hash(hash_alg); | ||
2401 | if (md) | ||
2402 | { | ||
2403 | c->pkeys[idx].digest = md; | ||
2404 | if (idx == SSL_PKEY_RSA_SIGN) | ||
2405 | c->pkeys[SSL_PKEY_RSA_ENC].digest = md; | ||
2406 | } | ||
2407 | } | ||
2408 | |||
1744 | } | 2409 | } |
1745 | /* If session decrypt failure indicate a cache miss and set state to | 2410 | |
1746 | * send a new ticket | 2411 | |
1747 | */ | 2412 | /* Set any remaining keys to default values. NOTE: if alg is not |
1748 | tickerr: | 2413 | * supported it stays as NULL. |
1749 | s->tlsext_ticket_expected = 1; | 2414 | */ |
2415 | #ifndef OPENSSL_NO_DSA | ||
2416 | if (!c->pkeys[SSL_PKEY_DSA_SIGN].digest) | ||
2417 | c->pkeys[SSL_PKEY_DSA_SIGN].digest = EVP_dss1(); | ||
2418 | #endif | ||
2419 | #ifndef OPENSSL_NO_RSA | ||
2420 | if (!c->pkeys[SSL_PKEY_RSA_SIGN].digest) | ||
2421 | { | ||
2422 | c->pkeys[SSL_PKEY_RSA_SIGN].digest = EVP_sha1(); | ||
2423 | c->pkeys[SSL_PKEY_RSA_ENC].digest = EVP_sha1(); | ||
2424 | } | ||
2425 | #endif | ||
2426 | #ifndef OPENSSL_NO_ECDSA | ||
2427 | if (!c->pkeys[SSL_PKEY_ECC].digest) | ||
2428 | c->pkeys[SSL_PKEY_ECC].digest = EVP_ecdsa(); | ||
2429 | #endif | ||
2430 | return 1; | ||
2431 | } | ||
2432 | |||
2433 | #endif | ||
2434 | |||
2435 | #ifndef OPENSSL_NO_HEARTBEATS | ||
2436 | int | ||
2437 | tls1_process_heartbeat(SSL *s) | ||
2438 | { | ||
2439 | unsigned char *p = &s->s3->rrec.data[0], *pl; | ||
2440 | unsigned short hbtype; | ||
2441 | unsigned int payload; | ||
2442 | unsigned int padding = 16; /* Use minimum padding */ | ||
2443 | |||
2444 | /* Read type and payload length first */ | ||
2445 | hbtype = *p++; | ||
2446 | n2s(p, payload); | ||
2447 | pl = p; | ||
2448 | |||
2449 | if (s->msg_callback) | ||
2450 | s->msg_callback(0, s->version, TLS1_RT_HEARTBEAT, | ||
2451 | &s->s3->rrec.data[0], s->s3->rrec.length, | ||
2452 | s, s->msg_callback_arg); | ||
2453 | |||
2454 | if (hbtype == TLS1_HB_REQUEST) | ||
2455 | { | ||
2456 | unsigned char *buffer, *bp; | ||
2457 | int r; | ||
2458 | |||
2459 | /* Allocate memory for the response, size is 1 bytes | ||
2460 | * message type, plus 2 bytes payload length, plus | ||
2461 | * payload, plus padding | ||
2462 | */ | ||
2463 | buffer = OPENSSL_malloc(1 + 2 + payload + padding); | ||
2464 | bp = buffer; | ||
2465 | |||
2466 | /* Enter response type, length and copy payload */ | ||
2467 | *bp++ = TLS1_HB_RESPONSE; | ||
2468 | s2n(payload, bp); | ||
2469 | memcpy(bp, pl, payload); | ||
2470 | bp += payload; | ||
2471 | /* Random padding */ | ||
2472 | RAND_pseudo_bytes(bp, padding); | ||
2473 | |||
2474 | r = ssl3_write_bytes(s, TLS1_RT_HEARTBEAT, buffer, 3 + payload + padding); | ||
2475 | |||
2476 | if (r >= 0 && s->msg_callback) | ||
2477 | s->msg_callback(1, s->version, TLS1_RT_HEARTBEAT, | ||
2478 | buffer, 3 + payload + padding, | ||
2479 | s, s->msg_callback_arg); | ||
2480 | |||
2481 | OPENSSL_free(buffer); | ||
2482 | |||
2483 | if (r < 0) | ||
2484 | return r; | ||
2485 | } | ||
2486 | else if (hbtype == TLS1_HB_RESPONSE) | ||
2487 | { | ||
2488 | unsigned int seq; | ||
2489 | |||
2490 | /* We only send sequence numbers (2 bytes unsigned int), | ||
2491 | * and 16 random bytes, so we just try to read the | ||
2492 | * sequence number */ | ||
2493 | n2s(pl, seq); | ||
2494 | |||
2495 | if (payload == 18 && seq == s->tlsext_hb_seq) | ||
2496 | { | ||
2497 | s->tlsext_hb_seq++; | ||
2498 | s->tlsext_hb_pending = 0; | ||
2499 | } | ||
2500 | } | ||
2501 | |||
1750 | return 0; | 2502 | return 0; |
1751 | } | 2503 | } |
1752 | 2504 | ||
2505 | int | ||
2506 | tls1_heartbeat(SSL *s) | ||
2507 | { | ||
2508 | unsigned char *buf, *p; | ||
2509 | int ret; | ||
2510 | unsigned int payload = 18; /* Sequence number + random bytes */ | ||
2511 | unsigned int padding = 16; /* Use minimum padding */ | ||
2512 | |||
2513 | /* Only send if peer supports and accepts HB requests... */ | ||
2514 | if (!(s->tlsext_heartbeat & SSL_TLSEXT_HB_ENABLED) || | ||
2515 | s->tlsext_heartbeat & SSL_TLSEXT_HB_DONT_SEND_REQUESTS) | ||
2516 | { | ||
2517 | SSLerr(SSL_F_TLS1_HEARTBEAT,SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT); | ||
2518 | return -1; | ||
2519 | } | ||
2520 | |||
2521 | /* ...and there is none in flight yet... */ | ||
2522 | if (s->tlsext_hb_pending) | ||
2523 | { | ||
2524 | SSLerr(SSL_F_TLS1_HEARTBEAT,SSL_R_TLS_HEARTBEAT_PENDING); | ||
2525 | return -1; | ||
2526 | } | ||
2527 | |||
2528 | /* ...and no handshake in progress. */ | ||
2529 | if (SSL_in_init(s) || s->in_handshake) | ||
2530 | { | ||
2531 | SSLerr(SSL_F_TLS1_HEARTBEAT,SSL_R_UNEXPECTED_MESSAGE); | ||
2532 | return -1; | ||
2533 | } | ||
2534 | |||
2535 | /* Check if padding is too long, payload and padding | ||
2536 | * must not exceed 2^14 - 3 = 16381 bytes in total. | ||
2537 | */ | ||
2538 | OPENSSL_assert(payload + padding <= 16381); | ||
2539 | |||
2540 | /* Create HeartBeat message, we just use a sequence number | ||
2541 | * as payload to distuingish different messages and add | ||
2542 | * some random stuff. | ||
2543 | * - Message Type, 1 byte | ||
2544 | * - Payload Length, 2 bytes (unsigned int) | ||
2545 | * - Payload, the sequence number (2 bytes uint) | ||
2546 | * - Payload, random bytes (16 bytes uint) | ||
2547 | * - Padding | ||
2548 | */ | ||
2549 | buf = OPENSSL_malloc(1 + 2 + payload + padding); | ||
2550 | p = buf; | ||
2551 | /* Message Type */ | ||
2552 | *p++ = TLS1_HB_REQUEST; | ||
2553 | /* Payload length (18 bytes here) */ | ||
2554 | s2n(payload, p); | ||
2555 | /* Sequence number */ | ||
2556 | s2n(s->tlsext_hb_seq, p); | ||
2557 | /* 16 random bytes */ | ||
2558 | RAND_pseudo_bytes(p, 16); | ||
2559 | p += 16; | ||
2560 | /* Random padding */ | ||
2561 | RAND_pseudo_bytes(p, padding); | ||
2562 | |||
2563 | ret = ssl3_write_bytes(s, TLS1_RT_HEARTBEAT, buf, 3 + payload + padding); | ||
2564 | if (ret >= 0) | ||
2565 | { | ||
2566 | if (s->msg_callback) | ||
2567 | s->msg_callback(1, s->version, TLS1_RT_HEARTBEAT, | ||
2568 | buf, 3 + payload + padding, | ||
2569 | s, s->msg_callback_arg); | ||
2570 | |||
2571 | s->tlsext_hb_pending = 1; | ||
2572 | } | ||
2573 | |||
2574 | OPENSSL_free(buf); | ||
2575 | |||
2576 | return ret; | ||
2577 | } | ||
1753 | #endif | 2578 | #endif |
diff --git a/src/lib/libssl/src/ssl/t1_meth.c b/src/lib/libssl/src/ssl/t1_meth.c index 6ce7c0bbf5..53c807de28 100644 --- a/src/lib/libssl/src/ssl/t1_meth.c +++ b/src/lib/libssl/src/ssl/t1_meth.c | |||
@@ -60,16 +60,28 @@ | |||
60 | #include <openssl/objects.h> | 60 | #include <openssl/objects.h> |
61 | #include "ssl_locl.h" | 61 | #include "ssl_locl.h" |
62 | 62 | ||
63 | static const SSL_METHOD *tls1_get_method(int ver); | ||
64 | static const SSL_METHOD *tls1_get_method(int ver) | 63 | static const SSL_METHOD *tls1_get_method(int ver) |
65 | { | 64 | { |
65 | if (ver == TLS1_2_VERSION) | ||
66 | return TLSv1_2_method(); | ||
67 | if (ver == TLS1_1_VERSION) | ||
68 | return TLSv1_1_method(); | ||
66 | if (ver == TLS1_VERSION) | 69 | if (ver == TLS1_VERSION) |
67 | return(TLSv1_method()); | 70 | return TLSv1_method(); |
68 | else | 71 | return NULL; |
69 | return(NULL); | ||
70 | } | 72 | } |
71 | 73 | ||
72 | IMPLEMENT_tls1_meth_func(TLSv1_method, | 74 | IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_method, |
75 | ssl3_accept, | ||
76 | ssl3_connect, | ||
77 | tls1_get_method) | ||
78 | |||
79 | IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_method, | ||
80 | ssl3_accept, | ||
81 | ssl3_connect, | ||
82 | tls1_get_method) | ||
83 | |||
84 | IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_method, | ||
73 | ssl3_accept, | 85 | ssl3_accept, |
74 | ssl3_connect, | 86 | ssl3_connect, |
75 | tls1_get_method) | 87 | tls1_get_method) |
diff --git a/src/lib/libssl/src/ssl/t1_srvr.c b/src/lib/libssl/src/ssl/t1_srvr.c index 42525e9e89..f1d1565769 100644 --- a/src/lib/libssl/src/ssl/t1_srvr.c +++ b/src/lib/libssl/src/ssl/t1_srvr.c | |||
@@ -67,13 +67,26 @@ | |||
67 | static const SSL_METHOD *tls1_get_server_method(int ver); | 67 | static const SSL_METHOD *tls1_get_server_method(int ver); |
68 | static const SSL_METHOD *tls1_get_server_method(int ver) | 68 | static const SSL_METHOD *tls1_get_server_method(int ver) |
69 | { | 69 | { |
70 | if (ver == TLS1_2_VERSION) | ||
71 | return TLSv1_2_server_method(); | ||
72 | if (ver == TLS1_1_VERSION) | ||
73 | return TLSv1_1_server_method(); | ||
70 | if (ver == TLS1_VERSION) | 74 | if (ver == TLS1_VERSION) |
71 | return(TLSv1_server_method()); | 75 | return TLSv1_server_method(); |
72 | else | 76 | return NULL; |
73 | return(NULL); | ||
74 | } | 77 | } |
75 | 78 | ||
76 | IMPLEMENT_tls1_meth_func(TLSv1_server_method, | 79 | IMPLEMENT_tls_meth_func(TLS1_2_VERSION, TLSv1_2_server_method, |
80 | ssl3_accept, | ||
81 | ssl_undefined_function, | ||
82 | tls1_get_server_method) | ||
83 | |||
84 | IMPLEMENT_tls_meth_func(TLS1_1_VERSION, TLSv1_1_server_method, | ||
85 | ssl3_accept, | ||
86 | ssl_undefined_function, | ||
87 | tls1_get_server_method) | ||
88 | |||
89 | IMPLEMENT_tls_meth_func(TLS1_VERSION, TLSv1_server_method, | ||
77 | ssl3_accept, | 90 | ssl3_accept, |
78 | ssl_undefined_function, | 91 | ssl_undefined_function, |
79 | tls1_get_server_method) | 92 | tls1_get_server_method) |
diff --git a/src/lib/libssl/src/ssl/tls1.h b/src/lib/libssl/src/ssl/tls1.h index b3cc8f098b..c39c267f0b 100644 --- a/src/lib/libssl/src/ssl/tls1.h +++ b/src/lib/libssl/src/ssl/tls1.h | |||
@@ -159,10 +159,24 @@ extern "C" { | |||
159 | 159 | ||
160 | #define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 | 160 | #define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0 |
161 | 161 | ||
162 | #define TLS1_2_VERSION 0x0303 | ||
163 | #define TLS1_2_VERSION_MAJOR 0x03 | ||
164 | #define TLS1_2_VERSION_MINOR 0x03 | ||
165 | |||
166 | #define TLS1_1_VERSION 0x0302 | ||
167 | #define TLS1_1_VERSION_MAJOR 0x03 | ||
168 | #define TLS1_1_VERSION_MINOR 0x02 | ||
169 | |||
162 | #define TLS1_VERSION 0x0301 | 170 | #define TLS1_VERSION 0x0301 |
163 | #define TLS1_VERSION_MAJOR 0x03 | 171 | #define TLS1_VERSION_MAJOR 0x03 |
164 | #define TLS1_VERSION_MINOR 0x01 | 172 | #define TLS1_VERSION_MINOR 0x01 |
165 | 173 | ||
174 | #define TLS1_get_version(s) \ | ||
175 | ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0) | ||
176 | |||
177 | #define TLS1_get_client_version(s) \ | ||
178 | ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0) | ||
179 | |||
166 | #define TLS1_AD_DECRYPTION_FAILED 21 | 180 | #define TLS1_AD_DECRYPTION_FAILED 21 |
167 | #define TLS1_AD_RECORD_OVERFLOW 22 | 181 | #define TLS1_AD_RECORD_OVERFLOW 22 |
168 | #define TLS1_AD_UNKNOWN_CA 48 /* fatal */ | 182 | #define TLS1_AD_UNKNOWN_CA 48 /* fatal */ |
@@ -183,17 +197,42 @@ extern "C" { | |||
183 | #define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 | 197 | #define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 |
184 | #define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ | 198 | #define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 /* fatal */ |
185 | 199 | ||
186 | /* ExtensionType values from RFC3546 / RFC4366 */ | 200 | /* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */ |
187 | #define TLSEXT_TYPE_server_name 0 | 201 | #define TLSEXT_TYPE_server_name 0 |
188 | #define TLSEXT_TYPE_max_fragment_length 1 | 202 | #define TLSEXT_TYPE_max_fragment_length 1 |
189 | #define TLSEXT_TYPE_client_certificate_url 2 | 203 | #define TLSEXT_TYPE_client_certificate_url 2 |
190 | #define TLSEXT_TYPE_trusted_ca_keys 3 | 204 | #define TLSEXT_TYPE_trusted_ca_keys 3 |
191 | #define TLSEXT_TYPE_truncated_hmac 4 | 205 | #define TLSEXT_TYPE_truncated_hmac 4 |
192 | #define TLSEXT_TYPE_status_request 5 | 206 | #define TLSEXT_TYPE_status_request 5 |
207 | /* ExtensionType values from RFC4681 */ | ||
208 | #define TLSEXT_TYPE_user_mapping 6 | ||
209 | |||
210 | /* ExtensionType values from RFC5878 */ | ||
211 | #define TLSEXT_TYPE_client_authz 7 | ||
212 | #define TLSEXT_TYPE_server_authz 8 | ||
213 | |||
214 | /* ExtensionType values from RFC6091 */ | ||
215 | #define TLSEXT_TYPE_cert_type 9 | ||
216 | |||
193 | /* ExtensionType values from RFC4492 */ | 217 | /* ExtensionType values from RFC4492 */ |
194 | #define TLSEXT_TYPE_elliptic_curves 10 | 218 | #define TLSEXT_TYPE_elliptic_curves 10 |
195 | #define TLSEXT_TYPE_ec_point_formats 11 | 219 | #define TLSEXT_TYPE_ec_point_formats 11 |
220 | |||
221 | /* ExtensionType value from RFC5054 */ | ||
222 | #define TLSEXT_TYPE_srp 12 | ||
223 | |||
224 | /* ExtensionType values from RFC5246 */ | ||
225 | #define TLSEXT_TYPE_signature_algorithms 13 | ||
226 | |||
227 | /* ExtensionType value from RFC5764 */ | ||
228 | #define TLSEXT_TYPE_use_srtp 14 | ||
229 | |||
230 | /* ExtensionType value from RFC5620 */ | ||
231 | #define TLSEXT_TYPE_heartbeat 15 | ||
232 | |||
233 | /* ExtensionType value from RFC4507 */ | ||
196 | #define TLSEXT_TYPE_session_ticket 35 | 234 | #define TLSEXT_TYPE_session_ticket 35 |
235 | |||
197 | /* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */ | 236 | /* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */ |
198 | #if 0 /* will have to be provided externally for now , | 237 | #if 0 /* will have to be provided externally for now , |
199 | * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183 | 238 | * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183 |
@@ -204,6 +243,11 @@ extern "C" { | |||
204 | /* Temporary extension type */ | 243 | /* Temporary extension type */ |
205 | #define TLSEXT_TYPE_renegotiate 0xff01 | 244 | #define TLSEXT_TYPE_renegotiate 0xff01 |
206 | 245 | ||
246 | #ifndef OPENSSL_NO_NEXTPROTONEG | ||
247 | /* This is not an IANA defined extension number */ | ||
248 | #define TLSEXT_TYPE_next_proto_neg 13172 | ||
249 | #endif | ||
250 | |||
207 | /* NameType value from RFC 3546 */ | 251 | /* NameType value from RFC 3546 */ |
208 | #define TLSEXT_NAMETYPE_host_name 0 | 252 | #define TLSEXT_NAMETYPE_host_name 0 |
209 | /* status request value from RFC 3546 */ | 253 | /* status request value from RFC 3546 */ |
@@ -216,12 +260,37 @@ extern "C" { | |||
216 | #define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 | 260 | #define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 |
217 | #define TLSEXT_ECPOINTFORMAT_last 2 | 261 | #define TLSEXT_ECPOINTFORMAT_last 2 |
218 | 262 | ||
263 | /* Signature and hash algorithms from RFC 5246 */ | ||
264 | |||
265 | #define TLSEXT_signature_anonymous 0 | ||
266 | #define TLSEXT_signature_rsa 1 | ||
267 | #define TLSEXT_signature_dsa 2 | ||
268 | #define TLSEXT_signature_ecdsa 3 | ||
269 | |||
270 | #define TLSEXT_hash_none 0 | ||
271 | #define TLSEXT_hash_md5 1 | ||
272 | #define TLSEXT_hash_sha1 2 | ||
273 | #define TLSEXT_hash_sha224 3 | ||
274 | #define TLSEXT_hash_sha256 4 | ||
275 | #define TLSEXT_hash_sha384 5 | ||
276 | #define TLSEXT_hash_sha512 6 | ||
277 | |||
219 | #ifndef OPENSSL_NO_TLSEXT | 278 | #ifndef OPENSSL_NO_TLSEXT |
220 | 279 | ||
221 | #define TLSEXT_MAXLEN_host_name 255 | 280 | #define TLSEXT_MAXLEN_host_name 255 |
222 | 281 | ||
223 | const char *SSL_get_servername(const SSL *s, const int type) ; | 282 | const char *SSL_get_servername(const SSL *s, const int type); |
224 | int SSL_get_servername_type(const SSL *s) ; | 283 | int SSL_get_servername_type(const SSL *s); |
284 | /* SSL_export_keying_material exports a value derived from the master secret, | ||
285 | * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and | ||
286 | * optional context. (Since a zero length context is allowed, the |use_context| | ||
287 | * flag controls whether a context is included.) | ||
288 | * | ||
289 | * It returns 1 on success and zero otherwise. | ||
290 | */ | ||
291 | int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, | ||
292 | const char *label, size_t llen, const unsigned char *p, size_t plen, | ||
293 | int use_context); | ||
225 | 294 | ||
226 | #define SSL_set_tlsext_host_name(s,name) \ | 295 | #define SSL_set_tlsext_host_name(s,name) \ |
227 | SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) | 296 | SSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name) |
@@ -285,6 +354,16 @@ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg) | |||
285 | #define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ | 354 | #define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \ |
286 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | 355 | SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) |
287 | 356 | ||
357 | #ifndef OPENSSL_NO_HEARTBEATS | ||
358 | #define SSL_TLSEXT_HB_ENABLED 0x01 | ||
359 | #define SSL_TLSEXT_HB_DONT_SEND_REQUESTS 0x02 | ||
360 | #define SSL_TLSEXT_HB_DONT_RECV_REQUESTS 0x04 | ||
361 | |||
362 | #define SSL_get_tlsext_heartbeat_pending(ssl) \ | ||
363 | SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL) | ||
364 | #define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \ | ||
365 | SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL) | ||
366 | #endif | ||
288 | #endif | 367 | #endif |
289 | 368 | ||
290 | /* PSK ciphersuites from 4279 */ | 369 | /* PSK ciphersuites from 4279 */ |
@@ -322,6 +401,14 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | |||
322 | #define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 | 401 | #define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 |
323 | #define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A | 402 | #define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A |
324 | 403 | ||
404 | /* TLS v1.2 ciphersuites */ | ||
405 | #define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B | ||
406 | #define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C | ||
407 | #define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D | ||
408 | #define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E | ||
409 | #define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F | ||
410 | #define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040 | ||
411 | |||
325 | /* Camellia ciphersuites from RFC4132 */ | 412 | /* Camellia ciphersuites from RFC4132 */ |
326 | #define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 | 413 | #define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 |
327 | #define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 | 414 | #define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 |
@@ -330,6 +417,16 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | |||
330 | #define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 | 417 | #define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 |
331 | #define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 | 418 | #define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 |
332 | 419 | ||
420 | /* TLS v1.2 ciphersuites */ | ||
421 | #define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067 | ||
422 | #define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068 | ||
423 | #define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069 | ||
424 | #define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A | ||
425 | #define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B | ||
426 | #define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C | ||
427 | #define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D | ||
428 | |||
429 | /* Camellia ciphersuites from RFC4132 */ | ||
333 | #define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 | 430 | #define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 |
334 | #define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 | 431 | #define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 |
335 | #define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 | 432 | #define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 |
@@ -345,6 +442,20 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | |||
345 | #define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A | 442 | #define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A |
346 | #define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B | 443 | #define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B |
347 | 444 | ||
445 | /* TLS v1.2 GCM ciphersuites from RFC5288 */ | ||
446 | #define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C | ||
447 | #define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D | ||
448 | #define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E | ||
449 | #define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F | ||
450 | #define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0 | ||
451 | #define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1 | ||
452 | #define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2 | ||
453 | #define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3 | ||
454 | #define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4 | ||
455 | #define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5 | ||
456 | #define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6 | ||
457 | #define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7 | ||
458 | |||
348 | /* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */ | 459 | /* ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in draft 13 */ |
349 | #define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 | 460 | #define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 |
350 | #define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 | 461 | #define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 |
@@ -376,6 +487,38 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | |||
376 | #define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 | 487 | #define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 |
377 | #define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 | 488 | #define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 |
378 | 489 | ||
490 | /* SRP ciphersuites from RFC 5054 */ | ||
491 | #define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A | ||
492 | #define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B | ||
493 | #define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C | ||
494 | #define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D | ||
495 | #define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E | ||
496 | #define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F | ||
497 | #define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020 | ||
498 | #define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021 | ||
499 | #define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022 | ||
500 | |||
501 | /* ECDH HMAC based ciphersuites from RFC5289 */ | ||
502 | |||
503 | #define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023 | ||
504 | #define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024 | ||
505 | #define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025 | ||
506 | #define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026 | ||
507 | #define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027 | ||
508 | #define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028 | ||
509 | #define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029 | ||
510 | #define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A | ||
511 | |||
512 | /* ECDH GCM based ciphersuites from RFC5289 */ | ||
513 | #define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B | ||
514 | #define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C | ||
515 | #define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D | ||
516 | #define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E | ||
517 | #define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F | ||
518 | #define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030 | ||
519 | #define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031 | ||
520 | #define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032 | ||
521 | |||
379 | /* XXX | 522 | /* XXX |
380 | * Inconsistency alert: | 523 | * Inconsistency alert: |
381 | * The OpenSSL names of ciphers with ephemeral DH here include the string | 524 | * The OpenSSL names of ciphers with ephemeral DH here include the string |
@@ -443,6 +586,17 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | |||
443 | #define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA" | 586 | #define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA" |
444 | #define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA" | 587 | #define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA" |
445 | 588 | ||
589 | /* SRP ciphersuite from RFC 5054 */ | ||
590 | #define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA" | ||
591 | #define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA" | ||
592 | #define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA" | ||
593 | #define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA" | ||
594 | #define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA" | ||
595 | #define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA" | ||
596 | #define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA" | ||
597 | #define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA" | ||
598 | #define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA" | ||
599 | |||
446 | /* Camellia ciphersuites from RFC4132 */ | 600 | /* Camellia ciphersuites from RFC4132 */ |
447 | #define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" | 601 | #define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" |
448 | #define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" | 602 | #define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" |
@@ -466,6 +620,55 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) | |||
466 | #define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" | 620 | #define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" |
467 | #define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" | 621 | #define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" |
468 | 622 | ||
623 | /* TLS v1.2 ciphersuites */ | ||
624 | #define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256" | ||
625 | #define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256" | ||
626 | #define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256" | ||
627 | #define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256" | ||
628 | #define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256" | ||
629 | #define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256" | ||
630 | #define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256" | ||
631 | #define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256" | ||
632 | #define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256" | ||
633 | #define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256" | ||
634 | #define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256" | ||
635 | #define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256" | ||
636 | #define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256" | ||
637 | |||
638 | /* TLS v1.2 GCM ciphersuites from RFC5288 */ | ||
639 | #define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256" | ||
640 | #define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384" | ||
641 | #define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256" | ||
642 | #define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384" | ||
643 | #define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256" | ||
644 | #define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384" | ||
645 | #define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256" | ||
646 | #define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384" | ||
647 | #define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256" | ||
648 | #define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384" | ||
649 | #define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256" | ||
650 | #define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" | ||
651 | |||
652 | /* ECDH HMAC based ciphersuites from RFC5289 */ | ||
653 | |||
654 | #define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" | ||
655 | #define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384" | ||
656 | #define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256" | ||
657 | #define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384" | ||
658 | #define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256" | ||
659 | #define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384" | ||
660 | #define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256" | ||
661 | #define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384" | ||
662 | |||
663 | /* ECDH GCM based ciphersuites from RFC5289 */ | ||
664 | #define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 "ECDHE-ECDSA-AES128-GCM-SHA256" | ||
665 | #define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 "ECDHE-ECDSA-AES256-GCM-SHA384" | ||
666 | #define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 "ECDH-ECDSA-AES128-GCM-SHA256" | ||
667 | #define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 "ECDH-ECDSA-AES256-GCM-SHA384" | ||
668 | #define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256" | ||
669 | #define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384" | ||
670 | #define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256" | ||
671 | #define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384" | ||
469 | 672 | ||
470 | #define TLS_CT_RSA_SIGN 1 | 673 | #define TLS_CT_RSA_SIGN 1 |
471 | #define TLS_CT_DSS_SIGN 2 | 674 | #define TLS_CT_DSS_SIGN 2 |
diff --git a/src/lib/libssl/src/test/CAss.cnf b/src/lib/libssl/src/test/CAss.cnf index 20f8f05e3d..109bc8c10b 100644 --- a/src/lib/libssl/src/test/CAss.cnf +++ b/src/lib/libssl/src/test/CAss.cnf | |||
@@ -7,7 +7,7 @@ RANDFILE = ./.rnd | |||
7 | 7 | ||
8 | #################################################################### | 8 | #################################################################### |
9 | [ req ] | 9 | [ req ] |
10 | default_bits = 512 | 10 | default_bits = 2048 |
11 | default_keyfile = keySS.pem | 11 | default_keyfile = keySS.pem |
12 | distinguished_name = req_distinguished_name | 12 | distinguished_name = req_distinguished_name |
13 | encrypt_rsa_key = no | 13 | encrypt_rsa_key = no |
diff --git a/src/lib/libssl/src/test/Makefile b/src/lib/libssl/src/test/Makefile index 3912f82427..09e6848764 100644 --- a/src/lib/libssl/src/test/Makefile +++ b/src/lib/libssl/src/test/Makefile | |||
@@ -61,6 +61,7 @@ ENGINETEST= enginetest | |||
61 | EVPTEST= evp_test | 61 | EVPTEST= evp_test |
62 | IGETEST= igetest | 62 | IGETEST= igetest |
63 | JPAKETEST= jpaketest | 63 | JPAKETEST= jpaketest |
64 | SRPTEST= srptest | ||
64 | ASN1TEST= asn1test | 65 | ASN1TEST= asn1test |
65 | 66 | ||
66 | TESTS= alltests | 67 | TESTS= alltests |
@@ -72,7 +73,7 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST) | |||
72 | $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \ | 73 | $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \ |
73 | $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \ | 74 | $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \ |
74 | $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ | 75 | $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ |
75 | $(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) \ | 76 | $(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \ |
76 | $(ASN1TEST)$(EXE_EXT) | 77 | $(ASN1TEST)$(EXE_EXT) |
77 | 78 | ||
78 | # $(METHTEST)$(EXE_EXT) | 79 | # $(METHTEST)$(EXE_EXT) |
@@ -93,7 +94,7 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ | |||
93 | $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ | 94 | $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ |
94 | $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ | 95 | $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ |
95 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ | 96 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ |
96 | $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(ASN1TEST).c | 97 | $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(SRPTEST).c $(ASN1TEST).c |
97 | 98 | ||
98 | EXHEADER= | 99 | EXHEADER= |
99 | HEADER= $(EXHEADER) | 100 | HEADER= $(EXHEADER) |
@@ -136,7 +137,7 @@ alltests: \ | |||
136 | test_enc test_x509 test_rsa test_crl test_sid \ | 137 | test_enc test_x509 test_rsa test_crl test_sid \ |
137 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ | 138 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ |
138 | test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ | 139 | test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ |
139 | test_jpake test_cms | 140 | test_jpake test_srp test_cms |
140 | 141 | ||
141 | test_evp: | 142 | test_evp: |
142 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt | 143 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt |
@@ -274,6 +275,9 @@ test_engine: | |||
274 | test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ | 275 | test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ |
275 | intP1.ss intP2.ss | 276 | intP1.ss intP2.ss |
276 | @echo "test SSL protocol" | 277 | @echo "test SSL protocol" |
278 | @if [ -n "$(FIPSCANLIB)" ]; then \ | ||
279 | sh ./testfipsssl keyU.ss certU.ss certCA.ss; \ | ||
280 | fi | ||
277 | ../util/shlib_wrap.sh ./$(SSLTEST) -test_cipherlist | 281 | ../util/shlib_wrap.sh ./$(SSLTEST) -test_cipherlist |
278 | @sh ./testssl keyU.ss certU.ss certCA.ss | 282 | @sh ./testssl keyU.ss certU.ss certCA.ss |
279 | @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss | 283 | @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss |
@@ -310,6 +314,10 @@ test_cms: | |||
310 | @echo "CMS consistency test" | 314 | @echo "CMS consistency test" |
311 | $(PERL) cms-test.pl | 315 | $(PERL) cms-test.pl |
312 | 316 | ||
317 | test_srp: $(SRPTEST)$(EXE_EXT) | ||
318 | @echo "Test SRP" | ||
319 | ../util/shlib_wrap.sh ./srptest | ||
320 | |||
313 | lint: | 321 | lint: |
314 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 322 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
315 | 323 | ||
@@ -340,7 +348,19 @@ BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ | |||
340 | fi; \ | 348 | fi; \ |
341 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ | 349 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ |
342 | $(MAKE) -f $(TOP)/Makefile.shared -e \ | 350 | $(MAKE) -f $(TOP)/Makefile.shared -e \ |
343 | APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ | 351 | CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ |
352 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ | ||
353 | link_app.$${shlib_target} | ||
354 | |||
355 | FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ | ||
356 | shlib_target="$(SHLIB_TARGET)"; \ | ||
357 | fi; \ | ||
358 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ | ||
359 | if [ -z "$(SHARED_LIBS)" -a -n "$(FIPSCANLIB)" ] ; then \ | ||
360 | FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; export CC FIPSLD_CC; \ | ||
361 | fi; \ | ||
362 | $(MAKE) -f $(TOP)/Makefile.shared -e \ | ||
363 | CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ | ||
344 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ | 364 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ |
345 | link_app.$${shlib_target} | 365 | link_app.$${shlib_target} |
346 | 366 | ||
@@ -423,7 +443,7 @@ $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO) | |||
423 | @target=$(METHTEST); $(BUILD_CMD) | 443 | @target=$(METHTEST); $(BUILD_CMD) |
424 | 444 | ||
425 | $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) | 445 | $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) |
426 | @target=$(SSLTEST); $(BUILD_CMD) | 446 | @target=$(SSLTEST); $(FIPS_BUILD_CMD) |
427 | 447 | ||
428 | $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO) | 448 | $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO) |
429 | @target=$(ENGINETEST); $(BUILD_CMD) | 449 | @target=$(ENGINETEST); $(BUILD_CMD) |
@@ -446,6 +466,9 @@ $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO) | |||
446 | $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO) | 466 | $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO) |
447 | @target=$(ASN1TEST); $(BUILD_CMD) | 467 | @target=$(ASN1TEST); $(BUILD_CMD) |
448 | 468 | ||
469 | $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO) | ||
470 | @target=$(SRPTEST); $(BUILD_CMD) | ||
471 | |||
449 | #$(AESTEST).o: $(AESTEST).c | 472 | #$(AESTEST).o: $(AESTEST).c |
450 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c | 473 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c |
451 | 474 | ||
@@ -669,6 +692,13 @@ shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | |||
669 | shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | 692 | shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h |
670 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 693 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
671 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c | 694 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c |
695 | srptest.o: ../include/openssl/bio.h ../include/openssl/bn.h | ||
696 | srptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
697 | srptest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
698 | srptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
699 | srptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
700 | srptest.o: ../include/openssl/safestack.h ../include/openssl/srp.h | ||
701 | srptest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h srptest.c | ||
672 | ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 702 | ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
673 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 703 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
674 | ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h | 704 | ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h |
@@ -685,7 +715,8 @@ ssltest.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
685 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 715 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
686 | ssltest.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 716 | ssltest.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
687 | ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 717 | ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
688 | ssltest.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 718 | ssltest.o: ../include/openssl/sha.h ../include/openssl/srp.h |
719 | ssltest.o: ../include/openssl/srtp.h ../include/openssl/ssl.h | ||
689 | ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 720 | ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
690 | ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 721 | ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
691 | ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 722 | ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
diff --git a/src/lib/libssl/src/test/P1ss.cnf b/src/lib/libssl/src/test/P1ss.cnf index 876a0d35f8..326cce2ba8 100644 --- a/src/lib/libssl/src/test/P1ss.cnf +++ b/src/lib/libssl/src/test/P1ss.cnf | |||
@@ -7,7 +7,7 @@ RANDFILE = ./.rnd | |||
7 | 7 | ||
8 | #################################################################### | 8 | #################################################################### |
9 | [ req ] | 9 | [ req ] |
10 | default_bits = 512 | 10 | default_bits = 1024 |
11 | default_keyfile = keySS.pem | 11 | default_keyfile = keySS.pem |
12 | distinguished_name = req_distinguished_name | 12 | distinguished_name = req_distinguished_name |
13 | encrypt_rsa_key = no | 13 | encrypt_rsa_key = no |
diff --git a/src/lib/libssl/src/test/P2ss.cnf b/src/lib/libssl/src/test/P2ss.cnf index 373a87e7c2..8b502321b8 100644 --- a/src/lib/libssl/src/test/P2ss.cnf +++ b/src/lib/libssl/src/test/P2ss.cnf | |||
@@ -7,7 +7,7 @@ RANDFILE = ./.rnd | |||
7 | 7 | ||
8 | #################################################################### | 8 | #################################################################### |
9 | [ req ] | 9 | [ req ] |
10 | default_bits = 512 | 10 | default_bits = 1024 |
11 | default_keyfile = keySS.pem | 11 | default_keyfile = keySS.pem |
12 | distinguished_name = req_distinguished_name | 12 | distinguished_name = req_distinguished_name |
13 | encrypt_rsa_key = no | 13 | encrypt_rsa_key = no |
diff --git a/src/lib/libssl/src/test/Uss.cnf b/src/lib/libssl/src/test/Uss.cnf index 0c0ebb5f67..58ac0ca54d 100644 --- a/src/lib/libssl/src/test/Uss.cnf +++ b/src/lib/libssl/src/test/Uss.cnf | |||
@@ -7,11 +7,11 @@ RANDFILE = ./.rnd | |||
7 | 7 | ||
8 | #################################################################### | 8 | #################################################################### |
9 | [ req ] | 9 | [ req ] |
10 | default_bits = 512 | 10 | default_bits = 2048 |
11 | default_keyfile = keySS.pem | 11 | default_keyfile = keySS.pem |
12 | distinguished_name = req_distinguished_name | 12 | distinguished_name = req_distinguished_name |
13 | encrypt_rsa_key = no | 13 | encrypt_rsa_key = no |
14 | default_md = md2 | 14 | default_md = sha256 |
15 | 15 | ||
16 | [ req_distinguished_name ] | 16 | [ req_distinguished_name ] |
17 | countryName = Country Name (2 letter code) | 17 | countryName = Country Name (2 letter code) |
diff --git a/src/lib/libssl/src/test/evptests.txt b/src/lib/libssl/src/test/evptests.txt index beb12144b6..c273707c14 100644 --- a/src/lib/libssl/src/test/evptests.txt +++ b/src/lib/libssl/src/test/evptests.txt | |||
@@ -158,6 +158,19 @@ AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7B | |||
158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | 158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 |
159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | 159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 |
160 | 160 | ||
161 | # AES Counter test vectors from RFC3686 | ||
162 | aes-128-ctr:AE6852F8121067CC4BF7A5765577F39E:00000030000000000000000000000001:53696E676C6520626C6F636B206D7367:E4095D4FB7A7B3792D6175A3261311B8:1 | ||
163 | aes-128-ctr:7E24067817FAE0D743D6CE1F32539163:006CB6DBC0543B59DA48D90B00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28:1 | ||
164 | aes-128-ctr:7691BE035E5020A8AC6E618529F9A0DC:00E0017B27777F3F4A1786F000000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F:1 | ||
165 | |||
166 | aes-192-ctr:16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515:0000004836733C147D6D93CB00000001:53696E676C6520626C6F636B206D7367:4B55384FE259C9C84E7935A003CBE928:1 | ||
167 | aes-192-ctr:7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A:0096B03B020C6EADC2CB500D00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:453243FC609B23327EDFAAFA7131CD9F8490701C5AD4A79CFC1FE0FF42F4FB00:1 | ||
168 | aes-192-ctr:02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE:0007BDFD5CBD60278DCC091200000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:96893FC55E5C722F540B7DD1DDF7E758D288BC95C69165884536C811662F2188ABEE0935:1 | ||
169 | |||
170 | aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:00000060DB5672C97AA8F0B200000001:53696E676C6520626C6F636B206D7367:145AD01DBF824EC7560863DC71E3E0C0:1 | ||
171 | aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1 | ||
172 | aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1 | ||
173 | |||
161 | # DES ECB tests (from destest) | 174 | # DES ECB tests (from destest) |
162 | 175 | ||
163 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | 176 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 |
diff --git a/src/lib/libssl/src/test/maketests.com b/src/lib/libssl/src/test/maketests.com index 386e5cf3c1..9b64cba234 100644 --- a/src/lib/libssl/src/test/maketests.com +++ b/src/lib/libssl/src/test/maketests.com | |||
@@ -146,7 +146,8 @@ $ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ - | |||
146 | "MDC2TEST,RMDTEST,"+ - | 146 | "MDC2TEST,RMDTEST,"+ - |
147 | "RANDTEST,DHTEST,ENGINETEST,"+ - | 147 | "RANDTEST,DHTEST,ENGINETEST,"+ - |
148 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - | 148 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - |
149 | "EVP_TEST,IGETEST,JPAKETEST,ASN1TEST" | 149 | "EVP_TEST,IGETEST,JPAKETEST,SRPTEST,"+ - |
150 | "ASN1TEST" | ||
150 | $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well? | 151 | $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well? |
151 | $! | 152 | $! |
152 | $! Additional directory information. | 153 | $! Additional directory information. |
@@ -182,6 +183,7 @@ $ T_D_RSA_TEST := [-.crypto.rsa] | |||
182 | $ T_D_EVP_TEST := [-.crypto.evp] | 183 | $ T_D_EVP_TEST := [-.crypto.evp] |
183 | $ T_D_IGETEST := [-.test] | 184 | $ T_D_IGETEST := [-.test] |
184 | $ T_D_JPAKETEST := [-.crypto.jpake] | 185 | $ T_D_JPAKETEST := [-.crypto.jpake] |
186 | $ T_D_SRPTEST := [-.crypto.srp] | ||
185 | $ T_D_ASN1TEST := [-.test] | 187 | $ T_D_ASN1TEST := [-.test] |
186 | $! | 188 | $! |
187 | $ TCPIP_PROGRAMS = ",," | 189 | $ TCPIP_PROGRAMS = ",," |
diff --git a/src/lib/libssl/src/test/test.cnf b/src/lib/libssl/src/test/test.cnf index faad3914a8..10834442a1 100644 --- a/src/lib/libssl/src/test/test.cnf +++ b/src/lib/libssl/src/test/test.cnf | |||
@@ -56,7 +56,7 @@ emailAddress = optional | |||
56 | 56 | ||
57 | #################################################################### | 57 | #################################################################### |
58 | [ req ] | 58 | [ req ] |
59 | default_bits = 512 | 59 | default_bits = 1024 |
60 | default_keyfile = testkey.pem | 60 | default_keyfile = testkey.pem |
61 | distinguished_name = req_distinguished_name | 61 | distinguished_name = req_distinguished_name |
62 | encrypt_rsa_key = no | 62 | encrypt_rsa_key = no |
diff --git a/src/lib/libssl/src/test/tests.com b/src/lib/libssl/src/test/tests.com index 373dd16eac..a840d5078f 100644 --- a/src/lib/libssl/src/test/tests.com +++ b/src/lib/libssl/src/test/tests.com | |||
@@ -56,7 +56,7 @@ $ tests := - | |||
56 | test_enc,test_x509,test_rsa,test_crl,test_sid,- | 56 | test_enc,test_x509,test_rsa,test_crl,test_sid,- |
57 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- | 57 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- |
58 | test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,- | 58 | test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,- |
59 | test_jpake,test_cms | 59 | test_jpake,test_srp,test_cms |
60 | $ endif | 60 | $ endif |
61 | $ tests = f$edit(tests,"COLLAPSE") | 61 | $ tests = f$edit(tests,"COLLAPSE") |
62 | $ | 62 | $ |
@@ -68,6 +68,8 @@ $ EXPTEST := exptest | |||
68 | $ IDEATEST := ideatest | 68 | $ IDEATEST := ideatest |
69 | $ SHATEST := shatest | 69 | $ SHATEST := shatest |
70 | $ SHA1TEST := sha1test | 70 | $ SHA1TEST := sha1test |
71 | $ SHA256TEST := sha256t | ||
72 | $ SHA512TEST := sha512t | ||
71 | $ MDC2TEST := mdc2test | 73 | $ MDC2TEST := mdc2test |
72 | $ RMDTEST := rmdtest | 74 | $ RMDTEST := rmdtest |
73 | $ MD2TEST := md2test | 75 | $ MD2TEST := md2test |
@@ -91,6 +93,7 @@ $ ENGINETEST := enginetest | |||
91 | $ EVPTEST := evp_test | 93 | $ EVPTEST := evp_test |
92 | $ IGETEST := igetest | 94 | $ IGETEST := igetest |
93 | $ JPAKETEST := jpaketest | 95 | $ JPAKETEST := jpaketest |
96 | $ SRPTEST := srptest | ||
94 | $ ASN1TEST := asn1test | 97 | $ ASN1TEST := asn1test |
95 | $! | 98 | $! |
96 | $ tests_i = 0 | 99 | $ tests_i = 0 |
@@ -114,6 +117,8 @@ $ return | |||
114 | $ test_sha: | 117 | $ test_sha: |
115 | $ mcr 'texe_dir''shatest' | 118 | $ mcr 'texe_dir''shatest' |
116 | $ mcr 'texe_dir''sha1test' | 119 | $ mcr 'texe_dir''sha1test' |
120 | $ mcr 'texe_dir''sha256test' | ||
121 | $ mcr 'texe_dir''sha512test' | ||
117 | $ return | 122 | $ return |
118 | $ test_mdc2: | 123 | $ test_mdc2: |
119 | $ mcr 'texe_dir''mdc2test' | 124 | $ mcr 'texe_dir''mdc2test' |
@@ -357,6 +362,10 @@ $ ! Define the logical name used to find openssl.exe in the perl script. | |||
357 | $ define /user_mode osslx 'exe_dir' | 362 | $ define /user_mode osslx 'exe_dir' |
358 | $ perl CMS-TEST.PL | 363 | $ perl CMS-TEST.PL |
359 | $ return | 364 | $ return |
365 | $ test_srp: | ||
366 | $ write sys$output "Test SRP" | ||
367 | $ mcr 'texe_dir''srptest' | ||
368 | $ return | ||
360 | $ | 369 | $ |
361 | $ | 370 | $ |
362 | $ exit: | 371 | $ exit: |
diff --git a/src/lib/libssl/src/test/testssl b/src/lib/libssl/src/test/testssl index b55364ae88..5ae4dc8720 100644 --- a/src/lib/libssl/src/test/testssl +++ b/src/lib/libssl/src/test/testssl | |||
@@ -148,4 +148,14 @@ $ssltest -tls1 -cipher PSK -psk abc123 $extra || exit 1 | |||
148 | echo test tls1 with PSK via BIO pair | 148 | echo test tls1 with PSK via BIO pair |
149 | $ssltest -bio_pair -tls1 -cipher PSK -psk abc123 $extra || exit 1 | 149 | $ssltest -bio_pair -tls1 -cipher PSK -psk abc123 $extra || exit 1 |
150 | 150 | ||
151 | if ../util/shlib_wrap.sh ../apps/openssl no-srp; then | ||
152 | echo skipping SRP tests | ||
153 | else | ||
154 | echo test tls1 with SRP | ||
155 | $ssltest -tls1 -cipher SRP -srpuser test -srppass abc123 | ||
156 | |||
157 | echo test tls1 with SRP via BIO pair | ||
158 | $ssltest -bio_pair -tls1 -cipher SRP -srpuser test -srppass abc123 | ||
159 | fi | ||
160 | |||
151 | exit 0 | 161 | exit 0 |
diff --git a/src/lib/libssl/src/util/cygwin.sh b/src/lib/libssl/src/util/cygwin.sh index d6228521e6..cfdb04d2a4 100644 --- a/src/lib/libssl/src/util/cygwin.sh +++ b/src/lib/libssl/src/util/cygwin.sh | |||
@@ -11,6 +11,7 @@ CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5" | |||
11 | INSTALL_PREFIX=/tmp/install/INSTALL | 11 | INSTALL_PREFIX=/tmp/install/INSTALL |
12 | 12 | ||
13 | VERSION= | 13 | VERSION= |
14 | SHLIB_VERSION_NUMBER= | ||
14 | SUBVERSION=$1 | 15 | SUBVERSION=$1 |
15 | 16 | ||
16 | function cleanup() | 17 | function cleanup() |
@@ -28,6 +29,13 @@ function get_openssl_version() | |||
28 | echo " Check value of variable VERSION in Makefile." | 29 | echo " Check value of variable VERSION in Makefile." |
29 | exit 1 | 30 | exit 1 |
30 | fi | 31 | fi |
32 | eval `grep '^SHLIB_VERSION_NUMBER=' Makefile` | ||
33 | if [ -z "${SHLIB_VERSION_NUMBER}" ] | ||
34 | then | ||
35 | echo "Error: Couldn't retrieve OpenSSL shared lib version from Makefile." | ||
36 | echo " Check value of variable SHLIB_VERSION_NUMBER in Makefile." | ||
37 | exit 1 | ||
38 | fi | ||
31 | } | 39 | } |
32 | 40 | ||
33 | function base_install() | 41 | function base_install() |
@@ -124,7 +132,7 @@ strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so | |||
124 | chmod u-w usr/lib/engines/*.so | 132 | chmod u-w usr/lib/engines/*.so |
125 | 133 | ||
126 | # Runtime package | 134 | # Runtime package |
127 | tar cjf libopenssl${VERSION//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \ | 135 | tar cjf libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \ |
128 | usr/bin/cyg*dll | 136 | usr/bin/cyg*dll |
129 | # Base package | 137 | # Base package |
130 | find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \ | 138 | find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \ |
@@ -139,7 +147,7 @@ tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 - | |||
139 | 147 | ||
140 | ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2 | 148 | ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2 |
141 | ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 | 149 | ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 |
142 | ls -l libopenssl${VERSION//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 | 150 | ls -l libopenssl${SHLIB_VERSION_NUMBER//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 |
143 | 151 | ||
144 | cleanup | 152 | cleanup |
145 | 153 | ||
diff --git a/src/lib/libssl/src/util/libeay.num b/src/lib/libssl/src/util/libeay.num index b23619f20a..93f80ba0c6 100644 --- a/src/lib/libssl/src/util/libeay.num +++ b/src/lib/libssl/src/util/libeay.num | |||
@@ -1050,7 +1050,7 @@ ASN1_TYPE_get_octetstring 1077 EXIST::FUNCTION: | |||
1050 | ASN1_TYPE_set_int_octetstring 1078 EXIST::FUNCTION: | 1050 | ASN1_TYPE_set_int_octetstring 1078 EXIST::FUNCTION: |
1051 | ASN1_TYPE_set_octetstring 1079 EXIST::FUNCTION: | 1051 | ASN1_TYPE_set_octetstring 1079 EXIST::FUNCTION: |
1052 | ASN1_UTCTIME_set_string 1080 EXIST::FUNCTION: | 1052 | ASN1_UTCTIME_set_string 1080 EXIST::FUNCTION: |
1053 | ERR_add_error_data 1081 EXIST::FUNCTION:BIO | 1053 | ERR_add_error_data 1081 EXIST::FUNCTION: |
1054 | ERR_set_error_data 1082 EXIST::FUNCTION: | 1054 | ERR_set_error_data 1082 EXIST::FUNCTION: |
1055 | EVP_CIPHER_asn1_to_param 1083 EXIST::FUNCTION: | 1055 | EVP_CIPHER_asn1_to_param 1083 EXIST::FUNCTION: |
1056 | EVP_CIPHER_param_to_asn1 1084 EXIST::FUNCTION: | 1056 | EVP_CIPHER_param_to_asn1 1084 EXIST::FUNCTION: |
@@ -2808,7 +2808,7 @@ FIPS_corrupt_rsa 3249 NOEXIST::FUNCTION: | |||
2808 | FIPS_selftest_des 3250 NOEXIST::FUNCTION: | 2808 | FIPS_selftest_des 3250 NOEXIST::FUNCTION: |
2809 | EVP_aes_128_cfb1 3251 EXIST::FUNCTION:AES | 2809 | EVP_aes_128_cfb1 3251 EXIST::FUNCTION:AES |
2810 | EVP_aes_192_cfb8 3252 EXIST::FUNCTION:AES | 2810 | EVP_aes_192_cfb8 3252 EXIST::FUNCTION:AES |
2811 | FIPS_mode_set 3253 NOEXIST::FUNCTION: | 2811 | FIPS_mode_set 3253 EXIST::FUNCTION: |
2812 | FIPS_selftest_dsa 3254 NOEXIST::FUNCTION: | 2812 | FIPS_selftest_dsa 3254 NOEXIST::FUNCTION: |
2813 | EVP_aes_256_cfb8 3255 EXIST::FUNCTION:AES | 2813 | EVP_aes_256_cfb8 3255 EXIST::FUNCTION:AES |
2814 | FIPS_allow_md5 3256 NOEXIST::FUNCTION: | 2814 | FIPS_allow_md5 3256 NOEXIST::FUNCTION: |
@@ -2838,23 +2838,23 @@ AES_cfb1_encrypt 3279 EXIST::FUNCTION:AES | |||
2838 | EVP_des_ede3_cfb1 3280 EXIST::FUNCTION:DES | 2838 | EVP_des_ede3_cfb1 3280 EXIST::FUNCTION:DES |
2839 | FIPS_rand_check 3281 NOEXIST::FUNCTION: | 2839 | FIPS_rand_check 3281 NOEXIST::FUNCTION: |
2840 | FIPS_md5_allowed 3282 NOEXIST::FUNCTION: | 2840 | FIPS_md5_allowed 3282 NOEXIST::FUNCTION: |
2841 | FIPS_mode 3283 NOEXIST::FUNCTION: | 2841 | FIPS_mode 3283 EXIST::FUNCTION: |
2842 | FIPS_selftest_failed 3284 NOEXIST::FUNCTION: | 2842 | FIPS_selftest_failed 3284 NOEXIST::FUNCTION: |
2843 | sk_is_sorted 3285 EXIST::FUNCTION: | 2843 | sk_is_sorted 3285 EXIST::FUNCTION: |
2844 | X509_check_ca 3286 EXIST::FUNCTION: | 2844 | X509_check_ca 3286 EXIST::FUNCTION: |
2845 | private_idea_set_encrypt_key 3287 NOEXIST::FUNCTION: | 2845 | private_idea_set_encrypt_key 3287 EXIST:OPENSSL_FIPS:FUNCTION:IDEA |
2846 | HMAC_CTX_set_flags 3288 EXIST::FUNCTION:HMAC | 2846 | HMAC_CTX_set_flags 3288 EXIST::FUNCTION:HMAC |
2847 | private_SHA_Init 3289 NOEXIST::FUNCTION: | 2847 | private_SHA_Init 3289 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA0 |
2848 | private_CAST_set_key 3290 NOEXIST::FUNCTION: | 2848 | private_CAST_set_key 3290 EXIST:OPENSSL_FIPS:FUNCTION:CAST |
2849 | private_RIPEMD160_Init 3291 NOEXIST::FUNCTION: | 2849 | private_RIPEMD160_Init 3291 EXIST:OPENSSL_FIPS:FUNCTION:RIPEMD |
2850 | private_RC5_32_set_key 3292 NOEXIST::FUNCTION: | 2850 | private_RC5_32_set_key 3292 NOEXIST::FUNCTION: |
2851 | private_MD5_Init 3293 NOEXIST::FUNCTION: | 2851 | private_MD5_Init 3293 EXIST:OPENSSL_FIPS:FUNCTION:MD5 |
2852 | private_RC4_set_key 3294 NOEXIST::FUNCTION: | 2852 | private_RC4_set_key 3294 EXIST::FUNCTION:RC4 |
2853 | private_MDC2_Init 3295 NOEXIST::FUNCTION: | 2853 | private_MDC2_Init 3295 EXIST:OPENSSL_FIPS:FUNCTION:MDC2 |
2854 | private_RC2_set_key 3296 NOEXIST::FUNCTION: | 2854 | private_RC2_set_key 3296 EXIST:OPENSSL_FIPS:FUNCTION:RC2 |
2855 | private_MD4_Init 3297 NOEXIST::FUNCTION: | 2855 | private_MD4_Init 3297 EXIST:OPENSSL_FIPS:FUNCTION:MD4 |
2856 | private_BF_set_key 3298 NOEXIST::FUNCTION: | 2856 | private_BF_set_key 3298 EXIST:OPENSSL_FIPS:FUNCTION:BF |
2857 | private_MD2_Init 3299 NOEXIST::FUNCTION: | 2857 | private_MD2_Init 3299 EXIST:OPENSSL_FIPS:FUNCTION:MD2 |
2858 | d2i_PROXY_CERT_INFO_EXTENSION 3300 EXIST::FUNCTION: | 2858 | d2i_PROXY_CERT_INFO_EXTENSION 3300 EXIST::FUNCTION: |
2859 | PROXY_POLICY_it 3301 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: | 2859 | PROXY_POLICY_it 3301 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: |
2860 | PROXY_POLICY_it 3301 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION: | 2860 | PROXY_POLICY_it 3301 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION: |
@@ -2882,7 +2882,7 @@ RSA_verify_PKCS1_PSS 3321 EXIST::FUNCTION:RSA | |||
2882 | RSA_padding_add_X931 3322 EXIST::FUNCTION:RSA | 2882 | RSA_padding_add_X931 3322 EXIST::FUNCTION:RSA |
2883 | RSA_padding_add_PKCS1_PSS 3323 EXIST::FUNCTION:RSA | 2883 | RSA_padding_add_PKCS1_PSS 3323 EXIST::FUNCTION:RSA |
2884 | PKCS1_MGF1 3324 EXIST::FUNCTION:RSA | 2884 | PKCS1_MGF1 3324 EXIST::FUNCTION:RSA |
2885 | BN_X931_generate_Xpq 3325 NOEXIST::FUNCTION: | 2885 | BN_X931_generate_Xpq 3325 EXIST::FUNCTION: |
2886 | RSA_X931_generate_key 3326 NOEXIST::FUNCTION: | 2886 | RSA_X931_generate_key 3326 NOEXIST::FUNCTION: |
2887 | BN_X931_derive_prime 3327 NOEXIST::FUNCTION: | 2887 | BN_X931_derive_prime 3327 NOEXIST::FUNCTION: |
2888 | BN_X931_generate_prime 3328 NOEXIST::FUNCTION: | 2888 | BN_X931_generate_prime 3328 NOEXIST::FUNCTION: |
@@ -2906,7 +2906,7 @@ STORE_parse_attrs_start 3343 NOEXIST::FUNCTION: | |||
2906 | POLICY_CONSTRAINTS_free 3344 EXIST::FUNCTION: | 2906 | POLICY_CONSTRAINTS_free 3344 EXIST::FUNCTION: |
2907 | EVP_PKEY_add1_attr_by_NID 3345 EXIST::FUNCTION: | 2907 | EVP_PKEY_add1_attr_by_NID 3345 EXIST::FUNCTION: |
2908 | BN_nist_mod_192 3346 EXIST::FUNCTION: | 2908 | BN_nist_mod_192 3346 EXIST::FUNCTION: |
2909 | EC_GROUP_get_trinomial_basis 3347 EXIST::FUNCTION:EC | 2909 | EC_GROUP_get_trinomial_basis 3347 EXIST::FUNCTION:EC,EC2M |
2910 | STORE_set_method 3348 NOEXIST::FUNCTION: | 2910 | STORE_set_method 3348 NOEXIST::FUNCTION: |
2911 | GENERAL_SUBTREE_free 3349 EXIST::FUNCTION: | 2911 | GENERAL_SUBTREE_free 3349 EXIST::FUNCTION: |
2912 | NAME_CONSTRAINTS_it 3350 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: | 2912 | NAME_CONSTRAINTS_it 3350 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE: |
@@ -2921,14 +2921,14 @@ SHA512_Update 3356 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | |||
2921 | i2d_ECPrivateKey 3357 EXIST::FUNCTION:EC | 2921 | i2d_ECPrivateKey 3357 EXIST::FUNCTION:EC |
2922 | BN_get0_nist_prime_192 3358 EXIST::FUNCTION: | 2922 | BN_get0_nist_prime_192 3358 EXIST::FUNCTION: |
2923 | STORE_modify_certificate 3359 NOEXIST::FUNCTION: | 2923 | STORE_modify_certificate 3359 NOEXIST::FUNCTION: |
2924 | EC_POINT_set_affine_coordinates_GF2m 3360 EXIST:!VMS:FUNCTION:EC | 2924 | EC_POINT_set_affine_coordinates_GF2m 3360 EXIST:!VMS:FUNCTION:EC,EC2M |
2925 | EC_POINT_set_affine_coords_GF2m 3360 EXIST:VMS:FUNCTION:EC | 2925 | EC_POINT_set_affine_coords_GF2m 3360 EXIST:VMS:FUNCTION:EC,EC2M |
2926 | BN_GF2m_mod_exp_arr 3361 EXIST::FUNCTION: | 2926 | BN_GF2m_mod_exp_arr 3361 EXIST::FUNCTION:EC2M |
2927 | STORE_ATTR_INFO_modify_number 3362 NOEXIST::FUNCTION: | 2927 | STORE_ATTR_INFO_modify_number 3362 NOEXIST::FUNCTION: |
2928 | X509_keyid_get0 3363 EXIST::FUNCTION: | 2928 | X509_keyid_get0 3363 EXIST::FUNCTION: |
2929 | ENGINE_load_gmp 3364 EXIST::FUNCTION:ENGINE,GMP,STATIC_ENGINE | 2929 | ENGINE_load_gmp 3364 EXIST::FUNCTION:ENGINE,GMP,STATIC_ENGINE |
2930 | pitem_new 3365 EXIST::FUNCTION: | 2930 | pitem_new 3365 EXIST::FUNCTION: |
2931 | BN_GF2m_mod_mul_arr 3366 EXIST::FUNCTION: | 2931 | BN_GF2m_mod_mul_arr 3366 EXIST::FUNCTION:EC2M |
2932 | STORE_list_public_key_endp 3367 NOEXIST::FUNCTION: | 2932 | STORE_list_public_key_endp 3367 NOEXIST::FUNCTION: |
2933 | o2i_ECPublicKey 3368 EXIST::FUNCTION:EC | 2933 | o2i_ECPublicKey 3368 EXIST::FUNCTION:EC |
2934 | EC_KEY_copy 3369 EXIST::FUNCTION:EC | 2934 | EC_KEY_copy 3369 EXIST::FUNCTION:EC |
@@ -2945,7 +2945,7 @@ X509_VERIFY_PARAM_inherit 3378 EXIST::FUNCTION: | |||
2945 | EC_POINT_point2bn 3379 EXIST::FUNCTION:EC | 2945 | EC_POINT_point2bn 3379 EXIST::FUNCTION:EC |
2946 | STORE_ATTR_INFO_set_dn 3380 NOEXIST::FUNCTION: | 2946 | STORE_ATTR_INFO_set_dn 3380 NOEXIST::FUNCTION: |
2947 | X509_policy_tree_get0_policies 3381 EXIST::FUNCTION: | 2947 | X509_policy_tree_get0_policies 3381 EXIST::FUNCTION: |
2948 | EC_GROUP_new_curve_GF2m 3382 EXIST::FUNCTION:EC | 2948 | EC_GROUP_new_curve_GF2m 3382 EXIST::FUNCTION:EC,EC2M |
2949 | STORE_destroy_method 3383 NOEXIST::FUNCTION: | 2949 | STORE_destroy_method 3383 NOEXIST::FUNCTION: |
2950 | ENGINE_unregister_STORE 3384 EXIST::FUNCTION:ENGINE | 2950 | ENGINE_unregister_STORE 3384 EXIST::FUNCTION:ENGINE |
2951 | EVP_PKEY_get1_EC_KEY 3385 EXIST::FUNCTION:EC | 2951 | EVP_PKEY_get1_EC_KEY 3385 EXIST::FUNCTION:EC |
@@ -2961,7 +2961,7 @@ ENGINE_get_static_state 3393 EXIST::FUNCTION:ENGINE | |||
2961 | pqueue_iterator 3394 EXIST::FUNCTION: | 2961 | pqueue_iterator 3394 EXIST::FUNCTION: |
2962 | ECDSA_SIG_new 3395 EXIST::FUNCTION:ECDSA | 2962 | ECDSA_SIG_new 3395 EXIST::FUNCTION:ECDSA |
2963 | OPENSSL_DIR_end 3396 EXIST::FUNCTION: | 2963 | OPENSSL_DIR_end 3396 EXIST::FUNCTION: |
2964 | BN_GF2m_mod_sqr 3397 EXIST::FUNCTION: | 2964 | BN_GF2m_mod_sqr 3397 EXIST::FUNCTION:EC2M |
2965 | EC_POINT_bn2point 3398 EXIST::FUNCTION:EC | 2965 | EC_POINT_bn2point 3398 EXIST::FUNCTION:EC |
2966 | X509_VERIFY_PARAM_set_depth 3399 EXIST::FUNCTION: | 2966 | X509_VERIFY_PARAM_set_depth 3399 EXIST::FUNCTION: |
2967 | EC_KEY_set_asn1_flag 3400 EXIST::FUNCTION:EC | 2967 | EC_KEY_set_asn1_flag 3400 EXIST::FUNCTION:EC |
@@ -2974,7 +2974,7 @@ EC_GROUP_get_point_conv_form 3405 EXIST:VMS:FUNCTION:EC | |||
2974 | STORE_method_set_store_function 3406 NOEXIST::FUNCTION: | 2974 | STORE_method_set_store_function 3406 NOEXIST::FUNCTION: |
2975 | STORE_ATTR_INFO_in 3407 NOEXIST::FUNCTION: | 2975 | STORE_ATTR_INFO_in 3407 NOEXIST::FUNCTION: |
2976 | PEM_read_bio_ECPKParameters 3408 EXIST::FUNCTION:EC | 2976 | PEM_read_bio_ECPKParameters 3408 EXIST::FUNCTION:EC |
2977 | EC_GROUP_get_pentanomial_basis 3409 EXIST::FUNCTION:EC | 2977 | EC_GROUP_get_pentanomial_basis 3409 EXIST::FUNCTION:EC,EC2M |
2978 | EVP_PKEY_add1_attr_by_txt 3410 EXIST::FUNCTION: | 2978 | EVP_PKEY_add1_attr_by_txt 3410 EXIST::FUNCTION: |
2979 | BN_BLINDING_set_flags 3411 EXIST::FUNCTION: | 2979 | BN_BLINDING_set_flags 3411 EXIST::FUNCTION: |
2980 | X509_VERIFY_PARAM_set1_policies 3412 EXIST::FUNCTION: | 2980 | X509_VERIFY_PARAM_set1_policies 3412 EXIST::FUNCTION: |
@@ -2982,10 +2982,10 @@ X509_VERIFY_PARAM_set1_name 3413 EXIST::FUNCTION: | |||
2982 | X509_VERIFY_PARAM_set_purpose 3414 EXIST::FUNCTION: | 2982 | X509_VERIFY_PARAM_set_purpose 3414 EXIST::FUNCTION: |
2983 | STORE_get_number 3415 NOEXIST::FUNCTION: | 2983 | STORE_get_number 3415 NOEXIST::FUNCTION: |
2984 | ECDSA_sign_setup 3416 EXIST::FUNCTION:ECDSA | 2984 | ECDSA_sign_setup 3416 EXIST::FUNCTION:ECDSA |
2985 | BN_GF2m_mod_solve_quad_arr 3417 EXIST::FUNCTION: | 2985 | BN_GF2m_mod_solve_quad_arr 3417 EXIST::FUNCTION:EC2M |
2986 | EC_KEY_up_ref 3418 EXIST::FUNCTION:EC | 2986 | EC_KEY_up_ref 3418 EXIST::FUNCTION:EC |
2987 | POLICY_MAPPING_free 3419 EXIST::FUNCTION: | 2987 | POLICY_MAPPING_free 3419 EXIST::FUNCTION: |
2988 | BN_GF2m_mod_div 3420 EXIST::FUNCTION: | 2988 | BN_GF2m_mod_div 3420 EXIST::FUNCTION:EC2M |
2989 | X509_VERIFY_PARAM_set_flags 3421 EXIST::FUNCTION: | 2989 | X509_VERIFY_PARAM_set_flags 3421 EXIST::FUNCTION: |
2990 | EC_KEY_free 3422 EXIST::FUNCTION:EC | 2990 | EC_KEY_free 3422 EXIST::FUNCTION:EC |
2991 | STORE_meth_set_list_next_fn 3423 NOEXIST::FUNCTION: | 2991 | STORE_meth_set_list_next_fn 3423 NOEXIST::FUNCTION: |
@@ -2999,7 +2999,7 @@ STORE_method_set_list_end_function 3427 NOEXIST::FUNCTION: | |||
2999 | pqueue_print 3428 EXIST::FUNCTION: | 2999 | pqueue_print 3428 EXIST::FUNCTION: |
3000 | EC_GROUP_have_precompute_mult 3429 EXIST::FUNCTION:EC | 3000 | EC_GROUP_have_precompute_mult 3429 EXIST::FUNCTION:EC |
3001 | EC_KEY_print_fp 3430 EXIST::FUNCTION:EC,FP_API | 3001 | EC_KEY_print_fp 3430 EXIST::FUNCTION:EC,FP_API |
3002 | BN_GF2m_mod_arr 3431 EXIST::FUNCTION: | 3002 | BN_GF2m_mod_arr 3431 EXIST::FUNCTION:EC2M |
3003 | PEM_write_bio_X509_CERT_PAIR 3432 EXIST::FUNCTION: | 3003 | PEM_write_bio_X509_CERT_PAIR 3432 EXIST::FUNCTION: |
3004 | EVP_PKEY_cmp 3433 EXIST::FUNCTION: | 3004 | EVP_PKEY_cmp 3433 EXIST::FUNCTION: |
3005 | X509_policy_level_node_count 3434 EXIST::FUNCTION: | 3005 | X509_policy_level_node_count 3434 EXIST::FUNCTION: |
@@ -3020,7 +3020,7 @@ X509_policy_node_get0_qualifiers 3448 EXIST:!VMS:FUNCTION: | |||
3020 | X509_pcy_node_get0_qualifiers 3448 EXIST:VMS:FUNCTION: | 3020 | X509_pcy_node_get0_qualifiers 3448 EXIST:VMS:FUNCTION: |
3021 | STORE_list_crl_end 3449 NOEXIST::FUNCTION: | 3021 | STORE_list_crl_end 3449 NOEXIST::FUNCTION: |
3022 | EVP_PKEY_set1_EC_KEY 3450 EXIST::FUNCTION:EC | 3022 | EVP_PKEY_set1_EC_KEY 3450 EXIST::FUNCTION:EC |
3023 | BN_GF2m_mod_sqrt_arr 3451 EXIST::FUNCTION: | 3023 | BN_GF2m_mod_sqrt_arr 3451 EXIST::FUNCTION:EC2M |
3024 | i2d_ECPrivateKey_bio 3452 EXIST::FUNCTION:BIO,EC | 3024 | i2d_ECPrivateKey_bio 3452 EXIST::FUNCTION:BIO,EC |
3025 | ECPKParameters_print_fp 3453 EXIST::FUNCTION:EC,FP_API | 3025 | ECPKParameters_print_fp 3453 EXIST::FUNCTION:EC,FP_API |
3026 | pqueue_find 3454 EXIST::FUNCTION: | 3026 | pqueue_find 3454 EXIST::FUNCTION: |
@@ -3037,7 +3037,7 @@ PKCS12_add_safes 3464 EXIST::FUNCTION: | |||
3037 | BN_BLINDING_convert_ex 3465 EXIST::FUNCTION: | 3037 | BN_BLINDING_convert_ex 3465 EXIST::FUNCTION: |
3038 | X509_policy_tree_free 3466 EXIST::FUNCTION: | 3038 | X509_policy_tree_free 3466 EXIST::FUNCTION: |
3039 | OPENSSL_ia32cap_loc 3467 EXIST::FUNCTION: | 3039 | OPENSSL_ia32cap_loc 3467 EXIST::FUNCTION: |
3040 | BN_GF2m_poly2arr 3468 EXIST::FUNCTION: | 3040 | BN_GF2m_poly2arr 3468 EXIST::FUNCTION:EC2M |
3041 | STORE_ctrl 3469 NOEXIST::FUNCTION: | 3041 | STORE_ctrl 3469 NOEXIST::FUNCTION: |
3042 | STORE_ATTR_INFO_compare 3470 NOEXIST::FUNCTION: | 3042 | STORE_ATTR_INFO_compare 3470 NOEXIST::FUNCTION: |
3043 | BN_get0_nist_prime_224 3471 EXIST::FUNCTION: | 3043 | BN_get0_nist_prime_224 3471 EXIST::FUNCTION: |
@@ -3061,7 +3061,7 @@ STORE_method_set_delete_function 3486 NOEXIST::FUNCTION: | |||
3061 | STORE_list_certificate_next 3487 NOEXIST::FUNCTION: | 3061 | STORE_list_certificate_next 3487 NOEXIST::FUNCTION: |
3062 | ASN1_generate_nconf 3488 EXIST::FUNCTION: | 3062 | ASN1_generate_nconf 3488 EXIST::FUNCTION: |
3063 | BUF_memdup 3489 EXIST::FUNCTION: | 3063 | BUF_memdup 3489 EXIST::FUNCTION: |
3064 | BN_GF2m_mod_mul 3490 EXIST::FUNCTION: | 3064 | BN_GF2m_mod_mul 3490 EXIST::FUNCTION:EC2M |
3065 | STORE_meth_get_list_next_fn 3491 NOEXIST::FUNCTION: | 3065 | STORE_meth_get_list_next_fn 3491 NOEXIST::FUNCTION: |
3066 | STORE_method_get_list_next_function 3491 NOEXIST::FUNCTION: | 3066 | STORE_method_get_list_next_function 3491 NOEXIST::FUNCTION: |
3067 | STORE_ATTR_INFO_get0_dn 3492 NOEXIST::FUNCTION: | 3067 | STORE_ATTR_INFO_get0_dn 3492 NOEXIST::FUNCTION: |
@@ -3072,7 +3072,7 @@ STORE_ATTR_INFO_free 3496 NOEXIST::FUNCTION: | |||
3072 | STORE_get_private_key 3497 NOEXIST::FUNCTION: | 3072 | STORE_get_private_key 3497 NOEXIST::FUNCTION: |
3073 | EVP_PKEY_get_attr_count 3498 EXIST::FUNCTION: | 3073 | EVP_PKEY_get_attr_count 3498 EXIST::FUNCTION: |
3074 | STORE_ATTR_INFO_new 3499 NOEXIST::FUNCTION: | 3074 | STORE_ATTR_INFO_new 3499 NOEXIST::FUNCTION: |
3075 | EC_GROUP_get_curve_GF2m 3500 EXIST::FUNCTION:EC | 3075 | EC_GROUP_get_curve_GF2m 3500 EXIST::FUNCTION:EC,EC2M |
3076 | STORE_meth_set_revoke_fn 3501 NOEXIST::FUNCTION: | 3076 | STORE_meth_set_revoke_fn 3501 NOEXIST::FUNCTION: |
3077 | STORE_method_set_revoke_function 3501 NOEXIST::FUNCTION: | 3077 | STORE_method_set_revoke_function 3501 NOEXIST::FUNCTION: |
3078 | STORE_store_number 3502 NOEXIST::FUNCTION: | 3078 | STORE_store_number 3502 NOEXIST::FUNCTION: |
@@ -3088,7 +3088,7 @@ BIO_dump_indent_fp 3511 EXIST::FUNCTION:FP_API | |||
3088 | EC_KEY_set_group 3512 EXIST::FUNCTION:EC | 3088 | EC_KEY_set_group 3512 EXIST::FUNCTION:EC |
3089 | BUF_strndup 3513 EXIST::FUNCTION: | 3089 | BUF_strndup 3513 EXIST::FUNCTION: |
3090 | STORE_list_certificate_start 3514 NOEXIST::FUNCTION: | 3090 | STORE_list_certificate_start 3514 NOEXIST::FUNCTION: |
3091 | BN_GF2m_mod 3515 EXIST::FUNCTION: | 3091 | BN_GF2m_mod 3515 EXIST::FUNCTION:EC2M |
3092 | X509_REQ_check_private_key 3516 EXIST::FUNCTION: | 3092 | X509_REQ_check_private_key 3516 EXIST::FUNCTION: |
3093 | EC_GROUP_get_seed_len 3517 EXIST::FUNCTION:EC | 3093 | EC_GROUP_get_seed_len 3517 EXIST::FUNCTION:EC |
3094 | ERR_load_STORE_strings 3518 NOEXIST::FUNCTION: | 3094 | ERR_load_STORE_strings 3518 NOEXIST::FUNCTION: |
@@ -3117,19 +3117,19 @@ STORE_method_set_get_function 3536 NOEXIST::FUNCTION: | |||
3117 | STORE_modify_number 3537 NOEXIST::FUNCTION: | 3117 | STORE_modify_number 3537 NOEXIST::FUNCTION: |
3118 | STORE_method_get_store_function 3538 NOEXIST::FUNCTION: | 3118 | STORE_method_get_store_function 3538 NOEXIST::FUNCTION: |
3119 | STORE_store_private_key 3539 NOEXIST::FUNCTION: | 3119 | STORE_store_private_key 3539 NOEXIST::FUNCTION: |
3120 | BN_GF2m_mod_sqr_arr 3540 EXIST::FUNCTION: | 3120 | BN_GF2m_mod_sqr_arr 3540 EXIST::FUNCTION:EC2M |
3121 | RSA_setup_blinding 3541 EXIST::FUNCTION:RSA | 3121 | RSA_setup_blinding 3541 EXIST::FUNCTION:RSA |
3122 | BIO_s_datagram 3542 EXIST::FUNCTION:DGRAM | 3122 | BIO_s_datagram 3542 EXIST::FUNCTION:DGRAM |
3123 | STORE_Memory 3543 NOEXIST::FUNCTION: | 3123 | STORE_Memory 3543 NOEXIST::FUNCTION: |
3124 | sk_find_ex 3544 EXIST::FUNCTION: | 3124 | sk_find_ex 3544 EXIST::FUNCTION: |
3125 | EC_GROUP_set_curve_GF2m 3545 EXIST::FUNCTION:EC | 3125 | EC_GROUP_set_curve_GF2m 3545 EXIST::FUNCTION:EC,EC2M |
3126 | ENGINE_set_default_ECDSA 3546 EXIST::FUNCTION:ENGINE | 3126 | ENGINE_set_default_ECDSA 3546 EXIST::FUNCTION:ENGINE |
3127 | POLICY_CONSTRAINTS_new 3547 EXIST::FUNCTION: | 3127 | POLICY_CONSTRAINTS_new 3547 EXIST::FUNCTION: |
3128 | BN_GF2m_mod_sqrt 3548 EXIST::FUNCTION: | 3128 | BN_GF2m_mod_sqrt 3548 EXIST::FUNCTION:EC2M |
3129 | ECDH_set_default_method 3549 EXIST::FUNCTION:ECDH | 3129 | ECDH_set_default_method 3549 EXIST::FUNCTION:ECDH |
3130 | EC_KEY_generate_key 3550 EXIST::FUNCTION:EC | 3130 | EC_KEY_generate_key 3550 EXIST::FUNCTION:EC |
3131 | SHA384_Update 3551 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | 3131 | SHA384_Update 3551 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 |
3132 | BN_GF2m_arr2poly 3552 EXIST::FUNCTION: | 3132 | BN_GF2m_arr2poly 3552 EXIST::FUNCTION:EC2M |
3133 | STORE_method_get_get_function 3553 NOEXIST::FUNCTION: | 3133 | STORE_method_get_get_function 3553 NOEXIST::FUNCTION: |
3134 | STORE_meth_set_cleanup_fn 3554 NOEXIST::FUNCTION: | 3134 | STORE_meth_set_cleanup_fn 3554 NOEXIST::FUNCTION: |
3135 | STORE_method_set_cleanup_function 3554 NOEXIST::FUNCTION: | 3135 | STORE_method_set_cleanup_function 3554 NOEXIST::FUNCTION: |
@@ -3154,7 +3154,7 @@ EC_GROUP_get_degree 3570 EXIST::FUNCTION:EC | |||
3154 | ASN1_generate_v3 3571 EXIST::FUNCTION: | 3154 | ASN1_generate_v3 3571 EXIST::FUNCTION: |
3155 | STORE_ATTR_INFO_modify_cstr 3572 NOEXIST::FUNCTION: | 3155 | STORE_ATTR_INFO_modify_cstr 3572 NOEXIST::FUNCTION: |
3156 | X509_policy_tree_level_count 3573 EXIST::FUNCTION: | 3156 | X509_policy_tree_level_count 3573 EXIST::FUNCTION: |
3157 | BN_GF2m_add 3574 EXIST::FUNCTION: | 3157 | BN_GF2m_add 3574 EXIST::FUNCTION:EC2M |
3158 | EC_KEY_get0_group 3575 EXIST::FUNCTION:EC | 3158 | EC_KEY_get0_group 3575 EXIST::FUNCTION:EC |
3159 | STORE_generate_crl 3576 NOEXIST::FUNCTION: | 3159 | STORE_generate_crl 3576 NOEXIST::FUNCTION: |
3160 | STORE_store_public_key 3577 NOEXIST::FUNCTION: | 3160 | STORE_store_public_key 3577 NOEXIST::FUNCTION: |
@@ -3179,8 +3179,8 @@ STORE_store_certificate 3593 NOEXIST::FUNCTION: | |||
3179 | OBJ_bsearch_ex 3594 NOEXIST::FUNCTION: | 3179 | OBJ_bsearch_ex 3594 NOEXIST::FUNCTION: |
3180 | X509_STORE_CTX_set_default 3595 EXIST::FUNCTION: | 3180 | X509_STORE_CTX_set_default 3595 EXIST::FUNCTION: |
3181 | STORE_ATTR_INFO_set_sha1str 3596 NOEXIST::FUNCTION: | 3181 | STORE_ATTR_INFO_set_sha1str 3596 NOEXIST::FUNCTION: |
3182 | BN_GF2m_mod_inv 3597 EXIST::FUNCTION: | 3182 | BN_GF2m_mod_inv 3597 EXIST::FUNCTION:EC2M |
3183 | BN_GF2m_mod_exp 3598 EXIST::FUNCTION: | 3183 | BN_GF2m_mod_exp 3598 EXIST::FUNCTION:EC2M |
3184 | STORE_modify_public_key 3599 NOEXIST::FUNCTION: | 3184 | STORE_modify_public_key 3599 NOEXIST::FUNCTION: |
3185 | STORE_meth_get_list_start_fn 3600 NOEXIST::FUNCTION: | 3185 | STORE_meth_get_list_start_fn 3600 NOEXIST::FUNCTION: |
3186 | STORE_method_get_list_start_function 3600 NOEXIST::FUNCTION: | 3186 | STORE_method_get_list_start_function 3600 NOEXIST::FUNCTION: |
@@ -3188,7 +3188,7 @@ EC_GROUP_get0_seed 3601 EXIST::FUNCTION:EC | |||
3188 | STORE_store_arbitrary 3602 NOEXIST::FUNCTION: | 3188 | STORE_store_arbitrary 3602 NOEXIST::FUNCTION: |
3189 | STORE_meth_set_unlock_store_fn 3603 NOEXIST::FUNCTION: | 3189 | STORE_meth_set_unlock_store_fn 3603 NOEXIST::FUNCTION: |
3190 | STORE_method_set_unlock_store_function 3603 NOEXIST::FUNCTION: | 3190 | STORE_method_set_unlock_store_function 3603 NOEXIST::FUNCTION: |
3191 | BN_GF2m_mod_div_arr 3604 EXIST::FUNCTION: | 3191 | BN_GF2m_mod_div_arr 3604 EXIST::FUNCTION:EC2M |
3192 | ENGINE_set_ECDSA 3605 EXIST::FUNCTION:ENGINE | 3192 | ENGINE_set_ECDSA 3605 EXIST::FUNCTION:ENGINE |
3193 | STORE_create_method 3606 NOEXIST::FUNCTION: | 3193 | STORE_create_method 3606 NOEXIST::FUNCTION: |
3194 | ECPKParameters_print 3607 EXIST::FUNCTION:BIO,EC | 3194 | ECPKParameters_print 3607 EXIST::FUNCTION:BIO,EC |
@@ -3211,8 +3211,8 @@ EC_KEY_get_enc_flags 3622 EXIST::FUNCTION:EC | |||
3211 | ASN1_const_check_infinite_end 3623 EXIST::FUNCTION: | 3211 | ASN1_const_check_infinite_end 3623 EXIST::FUNCTION: |
3212 | EVP_PKEY_delete_attr 3624 EXIST::FUNCTION: | 3212 | EVP_PKEY_delete_attr 3624 EXIST::FUNCTION: |
3213 | ECDSA_set_default_method 3625 EXIST::FUNCTION:ECDSA | 3213 | ECDSA_set_default_method 3625 EXIST::FUNCTION:ECDSA |
3214 | EC_POINT_set_compressed_coordinates_GF2m 3626 EXIST:!VMS:FUNCTION:EC | 3214 | EC_POINT_set_compressed_coordinates_GF2m 3626 EXIST:!VMS:FUNCTION:EC,EC2M |
3215 | EC_POINT_set_compr_coords_GF2m 3626 EXIST:VMS:FUNCTION:EC | 3215 | EC_POINT_set_compr_coords_GF2m 3626 EXIST:VMS:FUNCTION:EC,EC2M |
3216 | EC_GROUP_cmp 3627 EXIST::FUNCTION:EC | 3216 | EC_GROUP_cmp 3627 EXIST::FUNCTION:EC |
3217 | STORE_revoke_certificate 3628 NOEXIST::FUNCTION: | 3217 | STORE_revoke_certificate 3628 NOEXIST::FUNCTION: |
3218 | BN_get0_nist_prime_256 3629 EXIST::FUNCTION: | 3218 | BN_get0_nist_prime_256 3629 EXIST::FUNCTION: |
@@ -3241,7 +3241,7 @@ POLICY_CONSTRAINTS_it 3649 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTI | |||
3241 | STORE_get_ex_new_index 3650 NOEXIST::FUNCTION: | 3241 | STORE_get_ex_new_index 3650 NOEXIST::FUNCTION: |
3242 | EVP_PKEY_get_attr_by_OBJ 3651 EXIST::FUNCTION: | 3242 | EVP_PKEY_get_attr_by_OBJ 3651 EXIST::FUNCTION: |
3243 | X509_VERIFY_PARAM_add0_policy 3652 EXIST::FUNCTION: | 3243 | X509_VERIFY_PARAM_add0_policy 3652 EXIST::FUNCTION: |
3244 | BN_GF2m_mod_solve_quad 3653 EXIST::FUNCTION: | 3244 | BN_GF2m_mod_solve_quad 3653 EXIST::FUNCTION:EC2M |
3245 | SHA256 3654 EXIST::FUNCTION:SHA,SHA256 | 3245 | SHA256 3654 EXIST::FUNCTION:SHA,SHA256 |
3246 | i2d_ECPrivateKey_fp 3655 EXIST::FUNCTION:EC,FP_API | 3246 | i2d_ECPrivateKey_fp 3655 EXIST::FUNCTION:EC,FP_API |
3247 | X509_policy_tree_get0_user_policies 3656 EXIST:!VMS:FUNCTION: | 3247 | X509_policy_tree_get0_user_policies 3656 EXIST:!VMS:FUNCTION: |
@@ -3249,8 +3249,8 @@ X509_pcy_tree_get0_usr_policies 3656 EXIST:VMS:FUNCTION: | |||
3249 | OPENSSL_DIR_read 3657 EXIST::FUNCTION: | 3249 | OPENSSL_DIR_read 3657 EXIST::FUNCTION: |
3250 | ENGINE_register_all_ECDSA 3658 EXIST::FUNCTION:ENGINE | 3250 | ENGINE_register_all_ECDSA 3658 EXIST::FUNCTION:ENGINE |
3251 | X509_VERIFY_PARAM_lookup 3659 EXIST::FUNCTION: | 3251 | X509_VERIFY_PARAM_lookup 3659 EXIST::FUNCTION: |
3252 | EC_POINT_get_affine_coordinates_GF2m 3660 EXIST:!VMS:FUNCTION:EC | 3252 | EC_POINT_get_affine_coordinates_GF2m 3660 EXIST:!VMS:FUNCTION:EC,EC2M |
3253 | EC_POINT_get_affine_coords_GF2m 3660 EXIST:VMS:FUNCTION:EC | 3253 | EC_POINT_get_affine_coords_GF2m 3660 EXIST:VMS:FUNCTION:EC,EC2M |
3254 | EC_GROUP_dup 3661 EXIST::FUNCTION:EC | 3254 | EC_GROUP_dup 3661 EXIST::FUNCTION:EC |
3255 | ENGINE_get_default_ECDSA 3662 EXIST::FUNCTION:ENGINE | 3255 | ENGINE_get_default_ECDSA 3662 EXIST::FUNCTION:ENGINE |
3256 | EC_KEY_new 3663 EXIST::FUNCTION:EC | 3256 | EC_KEY_new 3663 EXIST::FUNCTION:EC |
@@ -3332,7 +3332,7 @@ STORE_list_certificate_end 3734 NOEXIST::FUNCTION: | |||
3332 | STORE_get_crl 3735 NOEXIST::FUNCTION: | 3332 | STORE_get_crl 3735 NOEXIST::FUNCTION: |
3333 | X509_POLICY_NODE_print 3736 EXIST::FUNCTION: | 3333 | X509_POLICY_NODE_print 3736 EXIST::FUNCTION: |
3334 | SHA384_Init 3737 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | 3334 | SHA384_Init 3737 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 |
3335 | EC_GF2m_simple_method 3738 EXIST::FUNCTION:EC | 3335 | EC_GF2m_simple_method 3738 EXIST::FUNCTION:EC,EC2M |
3336 | ECDSA_set_ex_data 3739 EXIST::FUNCTION:ECDSA | 3336 | ECDSA_set_ex_data 3739 EXIST::FUNCTION:ECDSA |
3337 | SHA384_Final 3740 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 | 3337 | SHA384_Final 3740 EXIST:!VMSVAX:FUNCTION:SHA,SHA512 |
3338 | PKCS7_set_digest 3741 EXIST::FUNCTION: | 3338 | PKCS7_set_digest 3741 EXIST::FUNCTION: |
@@ -3364,7 +3364,7 @@ BIO_dump_cb 3764 EXIST::FUNCTION: | |||
3364 | SHA256_Update 3765 EXIST::FUNCTION:SHA,SHA256 | 3364 | SHA256_Update 3765 EXIST::FUNCTION:SHA,SHA256 |
3365 | pqueue_insert 3766 EXIST::FUNCTION: | 3365 | pqueue_insert 3766 EXIST::FUNCTION: |
3366 | pitem_free 3767 EXIST::FUNCTION: | 3366 | pitem_free 3767 EXIST::FUNCTION: |
3367 | BN_GF2m_mod_inv_arr 3768 EXIST::FUNCTION: | 3367 | BN_GF2m_mod_inv_arr 3768 EXIST::FUNCTION:EC2M |
3368 | ENGINE_unregister_ECDSA 3769 EXIST::FUNCTION:ENGINE | 3368 | ENGINE_unregister_ECDSA 3769 EXIST::FUNCTION:ENGINE |
3369 | BN_BLINDING_set_thread_id 3770 EXIST::FUNCTION:DEPRECATED | 3369 | BN_BLINDING_set_thread_id 3770 EXIST::FUNCTION:DEPRECATED |
3370 | get_rfc3526_prime_8192 3771 EXIST::FUNCTION: | 3370 | get_rfc3526_prime_8192 3771 EXIST::FUNCTION: |
@@ -3670,7 +3670,7 @@ int_EVP_MD_set_engine_callbacks 4056 NOEXIST::FUNCTION: | |||
3670 | int_CRYPTO_set_do_dynlock_callback 4057 NOEXIST::FUNCTION: | 3670 | int_CRYPTO_set_do_dynlock_callback 4057 NOEXIST::FUNCTION: |
3671 | FIPS_rng_stick 4058 NOEXIST::FUNCTION: | 3671 | FIPS_rng_stick 4058 NOEXIST::FUNCTION: |
3672 | EVP_CIPHER_CTX_set_flags 4059 EXIST::FUNCTION: | 3672 | EVP_CIPHER_CTX_set_flags 4059 EXIST::FUNCTION: |
3673 | BN_X931_generate_prime_ex 4060 NOEXIST::FUNCTION: | 3673 | BN_X931_generate_prime_ex 4060 EXIST::FUNCTION: |
3674 | FIPS_selftest_check 4061 NOEXIST::FUNCTION: | 3674 | FIPS_selftest_check 4061 NOEXIST::FUNCTION: |
3675 | FIPS_rand_set_dt 4062 NOEXIST::FUNCTION: | 3675 | FIPS_rand_set_dt 4062 NOEXIST::FUNCTION: |
3676 | CRYPTO_dbg_pop_info 4063 NOEXIST::FUNCTION: | 3676 | CRYPTO_dbg_pop_info 4063 NOEXIST::FUNCTION: |
@@ -3695,14 +3695,14 @@ FIPS_rand_test_mode 4081 NOEXIST::FUNCTION: | |||
3695 | FIPS_rand_reset 4082 NOEXIST::FUNCTION: | 3695 | FIPS_rand_reset 4082 NOEXIST::FUNCTION: |
3696 | FIPS_dsa_new 4083 NOEXIST::FUNCTION: | 3696 | FIPS_dsa_new 4083 NOEXIST::FUNCTION: |
3697 | int_RAND_set_callbacks 4084 NOEXIST::FUNCTION: | 3697 | int_RAND_set_callbacks 4084 NOEXIST::FUNCTION: |
3698 | BN_X931_derive_prime_ex 4085 NOEXIST::FUNCTION: | 3698 | BN_X931_derive_prime_ex 4085 EXIST::FUNCTION: |
3699 | int_ERR_lib_init 4086 NOEXIST::FUNCTION: | 3699 | int_ERR_lib_init 4086 NOEXIST::FUNCTION: |
3700 | int_EVP_CIPHER_init_engine_callbacks 4087 NOEXIST::FUNCTION: | 3700 | int_EVP_CIPHER_init_engine_callbacks 4087 NOEXIST::FUNCTION: |
3701 | FIPS_rsa_free 4088 NOEXIST::FUNCTION: | 3701 | FIPS_rsa_free 4088 NOEXIST::FUNCTION: |
3702 | FIPS_dsa_sig_encode 4089 NOEXIST::FUNCTION: | 3702 | FIPS_dsa_sig_encode 4089 NOEXIST::FUNCTION: |
3703 | CRYPTO_dbg_remove_all_info 4090 NOEXIST::FUNCTION: | 3703 | CRYPTO_dbg_remove_all_info 4090 NOEXIST::FUNCTION: |
3704 | OPENSSL_init 4091 NOEXIST::FUNCTION: | 3704 | OPENSSL_init 4091 EXIST::FUNCTION: |
3705 | private_Camellia_set_key 4092 NOEXIST::FUNCTION: | 3705 | private_Camellia_set_key 4092 EXIST:OPENSSL_FIPS:FUNCTION:CAMELLIA |
3706 | CRYPTO_strdup 4093 EXIST::FUNCTION: | 3706 | CRYPTO_strdup 4093 EXIST::FUNCTION: |
3707 | JPAKE_STEP3A_process 4094 EXIST::FUNCTION:JPAKE | 3707 | JPAKE_STEP3A_process 4094 EXIST::FUNCTION:JPAKE |
3708 | JPAKE_STEP1_release 4095 EXIST::FUNCTION:JPAKE | 3708 | JPAKE_STEP1_release 4095 EXIST::FUNCTION:JPAKE |
@@ -4194,3 +4194,119 @@ OPENSSL_memcmp 4565 EXIST::FUNCTION: | |||
4194 | OPENSSL_strncasecmp 4566 EXIST::FUNCTION: | 4194 | OPENSSL_strncasecmp 4566 EXIST::FUNCTION: |
4195 | OPENSSL_gmtime 4567 EXIST::FUNCTION: | 4195 | OPENSSL_gmtime 4567 EXIST::FUNCTION: |
4196 | OPENSSL_gmtime_adj 4568 EXIST::FUNCTION: | 4196 | OPENSSL_gmtime_adj 4568 EXIST::FUNCTION: |
4197 | SRP_VBASE_get_by_user 4569 EXIST::FUNCTION:SRP | ||
4198 | SRP_Calc_server_key 4570 EXIST::FUNCTION:SRP | ||
4199 | SRP_create_verifier 4571 EXIST::FUNCTION:SRP | ||
4200 | SRP_create_verifier_BN 4572 EXIST::FUNCTION:SRP | ||
4201 | SRP_Calc_u 4573 EXIST::FUNCTION:SRP | ||
4202 | SRP_VBASE_free 4574 EXIST::FUNCTION:SRP | ||
4203 | SRP_Calc_client_key 4575 EXIST::FUNCTION:SRP | ||
4204 | SRP_get_default_gN 4576 EXIST::FUNCTION:SRP | ||
4205 | SRP_Calc_x 4577 EXIST::FUNCTION:SRP | ||
4206 | SRP_Calc_B 4578 EXIST::FUNCTION:SRP | ||
4207 | SRP_VBASE_new 4579 EXIST::FUNCTION:SRP | ||
4208 | SRP_check_known_gN_param 4580 EXIST::FUNCTION:SRP | ||
4209 | SRP_Calc_A 4581 EXIST::FUNCTION:SRP | ||
4210 | SRP_Verify_A_mod_N 4582 EXIST::FUNCTION:SRP | ||
4211 | SRP_VBASE_init 4583 EXIST::FUNCTION:SRP | ||
4212 | SRP_Verify_B_mod_N 4584 EXIST::FUNCTION:SRP | ||
4213 | EC_KEY_set_public_key_affine_coordinates 4585 EXIST:!VMS:FUNCTION:EC | ||
4214 | EC_KEY_set_pub_key_aff_coords 4585 EXIST:VMS:FUNCTION:EC | ||
4215 | EVP_aes_192_ctr 4586 EXIST::FUNCTION:AES | ||
4216 | EVP_PKEY_meth_get0_info 4587 EXIST::FUNCTION: | ||
4217 | EVP_PKEY_meth_copy 4588 EXIST::FUNCTION: | ||
4218 | ERR_add_error_vdata 4589 EXIST::FUNCTION: | ||
4219 | EVP_aes_128_ctr 4590 EXIST::FUNCTION:AES | ||
4220 | EVP_aes_256_ctr 4591 EXIST::FUNCTION:AES | ||
4221 | EC_GFp_nistp224_method 4592 EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128 | ||
4222 | EC_KEY_get_flags 4593 EXIST::FUNCTION:EC | ||
4223 | RSA_padding_add_PKCS1_PSS_mgf1 4594 EXIST::FUNCTION:RSA | ||
4224 | EVP_aes_128_xts 4595 EXIST::FUNCTION:AES | ||
4225 | private_SHA224_Init 4596 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA256 | ||
4226 | private_AES_set_decrypt_key 4597 EXIST::FUNCTION:AES | ||
4227 | private_WHIRLPOOL_Init 4598 EXIST:OPENSSL_FIPS:FUNCTION:WHIRLPOOL | ||
4228 | EVP_aes_256_xts 4599 EXIST::FUNCTION:AES | ||
4229 | private_SHA512_Init 4600 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA512 | ||
4230 | EVP_aes_128_gcm 4601 EXIST::FUNCTION:AES | ||
4231 | EC_KEY_clear_flags 4602 EXIST::FUNCTION:EC | ||
4232 | EC_KEY_set_flags 4603 EXIST::FUNCTION:EC | ||
4233 | private_DES_set_key_unchecked 4604 EXIST:OPENSSL_FIPS:FUNCTION:DES | ||
4234 | EVP_aes_256_ccm 4605 EXIST::FUNCTION:AES | ||
4235 | private_AES_set_encrypt_key 4606 EXIST::FUNCTION:AES | ||
4236 | RSA_verify_PKCS1_PSS_mgf1 4607 EXIST::FUNCTION:RSA | ||
4237 | private_SHA1_Init 4608 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA1 | ||
4238 | EVP_aes_128_ccm 4609 EXIST::FUNCTION:AES | ||
4239 | private_SEED_set_key 4610 EXIST:OPENSSL_FIPS:FUNCTION:SEED | ||
4240 | EVP_aes_192_gcm 4611 EXIST::FUNCTION:AES | ||
4241 | X509_ALGOR_set_md 4612 EXIST::FUNCTION: | ||
4242 | private_SHA256_Init 4613 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA256 | ||
4243 | RAND_init_fips 4614 EXIST:OPENSSL_FIPS:FUNCTION: | ||
4244 | EVP_aes_256_gcm 4615 EXIST::FUNCTION:AES | ||
4245 | private_SHA384_Init 4616 EXIST:OPENSSL_FIPS:FUNCTION:SHA,SHA512 | ||
4246 | EVP_aes_192_ccm 4617 EXIST::FUNCTION:AES | ||
4247 | CMAC_CTX_copy 4618 EXIST::FUNCTION: | ||
4248 | CMAC_CTX_free 4619 EXIST::FUNCTION: | ||
4249 | CMAC_CTX_get0_cipher_ctx 4620 EXIST::FUNCTION: | ||
4250 | CMAC_CTX_cleanup 4621 EXIST::FUNCTION: | ||
4251 | CMAC_Init 4622 EXIST::FUNCTION: | ||
4252 | CMAC_Update 4623 EXIST::FUNCTION: | ||
4253 | CMAC_resume 4624 EXIST::FUNCTION: | ||
4254 | CMAC_CTX_new 4625 EXIST::FUNCTION: | ||
4255 | CMAC_Final 4626 EXIST::FUNCTION: | ||
4256 | CRYPTO_ctr128_encrypt_ctr32 4627 EXIST::FUNCTION: | ||
4257 | CRYPTO_gcm128_release 4628 EXIST::FUNCTION: | ||
4258 | CRYPTO_ccm128_decrypt_ccm64 4629 EXIST::FUNCTION: | ||
4259 | CRYPTO_ccm128_encrypt 4630 EXIST::FUNCTION: | ||
4260 | CRYPTO_gcm128_encrypt 4631 EXIST::FUNCTION: | ||
4261 | CRYPTO_xts128_encrypt 4632 EXIST::FUNCTION: | ||
4262 | EVP_rc4_hmac_md5 4633 EXIST::FUNCTION:MD5,RC4 | ||
4263 | CRYPTO_nistcts128_decrypt_block 4634 EXIST::FUNCTION: | ||
4264 | CRYPTO_gcm128_setiv 4635 EXIST::FUNCTION: | ||
4265 | CRYPTO_nistcts128_encrypt 4636 EXIST::FUNCTION: | ||
4266 | EVP_aes_128_cbc_hmac_sha1 4637 EXIST::FUNCTION:AES,SHA,SHA1 | ||
4267 | CRYPTO_gcm128_tag 4638 EXIST::FUNCTION: | ||
4268 | CRYPTO_ccm128_encrypt_ccm64 4639 EXIST::FUNCTION: | ||
4269 | ENGINE_load_rdrand 4640 EXIST::FUNCTION:ENGINE | ||
4270 | CRYPTO_ccm128_setiv 4641 EXIST::FUNCTION: | ||
4271 | CRYPTO_nistcts128_encrypt_block 4642 EXIST::FUNCTION: | ||
4272 | CRYPTO_gcm128_aad 4643 EXIST::FUNCTION: | ||
4273 | CRYPTO_ccm128_init 4644 EXIST::FUNCTION: | ||
4274 | CRYPTO_nistcts128_decrypt 4645 EXIST::FUNCTION: | ||
4275 | CRYPTO_gcm128_new 4646 EXIST::FUNCTION: | ||
4276 | CRYPTO_ccm128_tag 4647 EXIST::FUNCTION: | ||
4277 | CRYPTO_ccm128_decrypt 4648 EXIST::FUNCTION: | ||
4278 | CRYPTO_ccm128_aad 4649 EXIST::FUNCTION: | ||
4279 | CRYPTO_gcm128_init 4650 EXIST::FUNCTION: | ||
4280 | CRYPTO_gcm128_decrypt 4651 EXIST::FUNCTION: | ||
4281 | ENGINE_load_rsax 4652 EXIST::FUNCTION:ENGINE | ||
4282 | CRYPTO_gcm128_decrypt_ctr32 4653 EXIST::FUNCTION: | ||
4283 | CRYPTO_gcm128_encrypt_ctr32 4654 EXIST::FUNCTION: | ||
4284 | CRYPTO_gcm128_finish 4655 EXIST::FUNCTION: | ||
4285 | EVP_aes_256_cbc_hmac_sha1 4656 EXIST::FUNCTION:AES,SHA,SHA1 | ||
4286 | PKCS5_pbkdf2_set 4657 EXIST::FUNCTION: | ||
4287 | CMS_add0_recipient_password 4658 EXIST::FUNCTION:CMS | ||
4288 | CMS_decrypt_set1_password 4659 EXIST::FUNCTION:CMS | ||
4289 | CMS_RecipientInfo_set0_password 4660 EXIST::FUNCTION:CMS | ||
4290 | RAND_set_fips_drbg_type 4661 EXIST:OPENSSL_FIPS:FUNCTION: | ||
4291 | X509_REQ_sign_ctx 4662 EXIST::FUNCTION:EVP | ||
4292 | RSA_PSS_PARAMS_new 4663 EXIST::FUNCTION:RSA | ||
4293 | X509_CRL_sign_ctx 4664 EXIST::FUNCTION:EVP | ||
4294 | X509_signature_dump 4665 EXIST::FUNCTION:EVP | ||
4295 | d2i_RSA_PSS_PARAMS 4666 EXIST::FUNCTION:RSA | ||
4296 | RSA_PSS_PARAMS_it 4667 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:RSA | ||
4297 | RSA_PSS_PARAMS_it 4667 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:RSA | ||
4298 | RSA_PSS_PARAMS_free 4668 EXIST::FUNCTION:RSA | ||
4299 | X509_sign_ctx 4669 EXIST::FUNCTION:EVP | ||
4300 | i2d_RSA_PSS_PARAMS 4670 EXIST::FUNCTION:RSA | ||
4301 | ASN1_item_sign_ctx 4671 EXIST::FUNCTION:EVP | ||
4302 | EC_GFp_nistp521_method 4672 EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128 | ||
4303 | EC_GFp_nistp256_method 4673 EXIST::FUNCTION:EC,EC_NISTP_64_GCC_128 | ||
4304 | OPENSSL_stderr 4674 EXIST::FUNCTION: | ||
4305 | OPENSSL_cpuid_setup 4675 EXIST::FUNCTION: | ||
4306 | OPENSSL_showfatal 4676 EXIST::FUNCTION: | ||
4307 | BIO_new_dgram_sctp 4677 EXIST::FUNCTION:SCTP | ||
4308 | BIO_dgram_sctp_msg_waiting 4678 EXIST::FUNCTION:SCTP | ||
4309 | BIO_dgram_sctp_wait_for_dry 4679 EXIST::FUNCTION:SCTP | ||
4310 | BIO_s_datagram_sctp 4680 EXIST::FUNCTION:DGRAM,SCTP | ||
4311 | BIO_dgram_is_sctp 4681 EXIST::FUNCTION:SCTP | ||
4312 | BIO_dgram_sctp_notification_cb 4682 EXIST::FUNCTION:SCTP | ||
diff --git a/src/lib/libssl/src/util/mk1mf.pl b/src/lib/libssl/src/util/mk1mf.pl index afe8c7326d..72fa089f6b 100644 --- a/src/lib/libssl/src/util/mk1mf.pl +++ b/src/lib/libssl/src/util/mk1mf.pl | |||
@@ -18,6 +18,8 @@ local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic | |||
18 | local $zlib_lib = ""; | 18 | local $zlib_lib = ""; |
19 | local $perl_asm = 0; # 1 to autobuild asm files from perl scripts | 19 | local $perl_asm = 0; # 1 to autobuild asm files from perl scripts |
20 | 20 | ||
21 | my $ex_l_libs = ""; | ||
22 | |||
21 | # Options to import from top level Makefile | 23 | # Options to import from top level Makefile |
22 | 24 | ||
23 | my %mf_import = ( | 25 | my %mf_import = ( |
@@ -40,7 +42,9 @@ my %mf_import = ( | |||
40 | SHA1_ASM_OBJ => \$mf_sha_asm, | 42 | SHA1_ASM_OBJ => \$mf_sha_asm, |
41 | RMD160_ASM_OBJ => \$mf_rmd_asm, | 43 | RMD160_ASM_OBJ => \$mf_rmd_asm, |
42 | WP_ASM_OBJ => \$mf_wp_asm, | 44 | WP_ASM_OBJ => \$mf_wp_asm, |
43 | CMLL_ENC => \$mf_cm_asm | 45 | CMLL_ENC => \$mf_cm_asm, |
46 | BASEADDR => \$baseaddr, | ||
47 | FIPSDIR => \$fipsdir, | ||
44 | ); | 48 | ); |
45 | 49 | ||
46 | 50 | ||
@@ -104,6 +108,7 @@ and [options] can be one of | |||
104 | just-ssl - remove all non-ssl keys/digest | 108 | just-ssl - remove all non-ssl keys/digest |
105 | no-asm - No x86 asm | 109 | no-asm - No x86 asm |
106 | no-krb5 - No KRB5 | 110 | no-krb5 - No KRB5 |
111 | no-srp - No SRP | ||
107 | no-ec - No EC | 112 | no-ec - No EC |
108 | no-ecdsa - No ECDSA | 113 | no-ecdsa - No ECDSA |
109 | no-ecdh - No ECDH | 114 | no-ecdh - No ECDH |
@@ -228,6 +233,8 @@ else | |||
228 | $cflags.=' -DTERMIO'; | 233 | $cflags.=' -DTERMIO'; |
229 | } | 234 | } |
230 | 235 | ||
236 | $fipsdir =~ s/\//${o}/g; | ||
237 | |||
231 | $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":""); | 238 | $out_dir=(defined($VARS{'OUT'}))?$VARS{'OUT'}:$out_def.($debug?".dbg":""); |
232 | $tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":""); | 239 | $tmp_dir=(defined($VARS{'TMP'}))?$VARS{'TMP'}:$tmp_def.($debug?".dbg":""); |
233 | $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def; | 240 | $inc_dir=(defined($VARS{'INC'}))?$VARS{'INC'}:$inc_def; |
@@ -261,6 +268,7 @@ $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock; | |||
261 | $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; | 268 | $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; |
262 | $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; | 269 | $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; |
263 | $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; | 270 | $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; |
271 | $cflags.=" -DOPENSSL_NO_SRP" if $no_srp; | ||
264 | $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; | 272 | $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; |
265 | $cflags.=" -DOPENSSL_NO_ERR" if $no_err; | 273 | $cflags.=" -DOPENSSL_NO_ERR" if $no_err; |
266 | $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; | 274 | $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; |
@@ -270,7 +278,9 @@ $cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; | |||
270 | $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; | 278 | $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; |
271 | $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; | 279 | $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; |
272 | $cflags.=" -DOPENSSL_NO_HW" if $no_hw; | 280 | $cflags.=" -DOPENSSL_NO_HW" if $no_hw; |
281 | $cflags.=" -DOPENSSL_FIPS" if $fips; | ||
273 | $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; | 282 | $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; |
283 | $cflags.=" -DOPENSSL_NO_EC2M" if $no_ec2m; | ||
274 | $cflags.= " -DZLIB" if $zlib_opt; | 284 | $cflags.= " -DZLIB" if $zlib_opt; |
275 | $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; | 285 | $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; |
276 | 286 | ||
@@ -404,6 +414,11 @@ else | |||
404 | \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\" | 414 | \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\" |
405 | EOF | 415 | EOF |
406 | $ex_libs .= " $zlib_lib" if $zlib_opt == 1; | 416 | $ex_libs .= " $zlib_lib" if $zlib_opt == 1; |
417 | if ($fips) | ||
418 | { | ||
419 | $build_targets .= " \$(LIB_D)$o$crypto_compat \$(PREMAIN_DSO_EXE)"; | ||
420 | $ex_l_libs .= " \$(O_FIPSCANISTER)"; | ||
421 | } | ||
407 | } | 422 | } |
408 | 423 | ||
409 | $defs= <<"EOF"; | 424 | $defs= <<"EOF"; |
@@ -465,6 +480,18 @@ MKLIB=$bin_dir$mklib | |||
465 | MLFLAGS=$mlflags | 480 | MLFLAGS=$mlflags |
466 | ASM=$bin_dir$asm | 481 | ASM=$bin_dir$asm |
467 | 482 | ||
483 | # FIPS validated module and support file locations | ||
484 | |||
485 | FIPSDIR=$fipsdir | ||
486 | BASEADDR=$baseaddr | ||
487 | FIPSLIB_D=\$(FIPSDIR)${o}lib | ||
488 | FIPS_PREMAIN_SRC=\$(FIPSLIB_D)${o}fips_premain.c | ||
489 | O_FIPSCANISTER=\$(FIPSLIB_D)${o}fipscanister.lib | ||
490 | FIPS_SHA1_EXE=\$(FIPSDIR)${o}bin${o}fips_standalone_sha1${exep} | ||
491 | E_PREMAIN_DSO=fips_premain_dso | ||
492 | PREMAIN_DSO_EXE=\$(BIN_D)${o}fips_premain_dso$exep | ||
493 | FIPSLINK=\$(PERL) \$(FIPSDIR)${o}bin${o}fipslink.pl | ||
494 | |||
468 | ###################################################### | 495 | ###################################################### |
469 | # You should not need to touch anything below this point | 496 | # You should not need to touch anything below this point |
470 | ###################################################### | 497 | ###################################################### |
@@ -497,7 +524,7 @@ SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp | |||
497 | L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp | 524 | L_SSL= \$(LIB_D)$o$plib\$(SSL)$libp |
498 | L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp | 525 | L_CRYPTO= \$(LIB_D)$o$plib\$(CRYPTO)$libp |
499 | 526 | ||
500 | L_LIBS= \$(L_SSL) \$(L_CRYPTO) | 527 | L_LIBS= \$(L_SSL) \$(L_CRYPTO) $ex_l_libs |
501 | 528 | ||
502 | ###################################################### | 529 | ###################################################### |
503 | # Don't touch anything below this point | 530 | # Don't touch anything below this point |
@@ -513,7 +540,7 @@ LIBS_DEP=\$(O_CRYPTO) \$(O_SSL) | |||
513 | EOF | 540 | EOF |
514 | 541 | ||
515 | $rules=<<"EOF"; | 542 | $rules=<<"EOF"; |
516 | all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe | 543 | all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe $build_targets |
517 | 544 | ||
518 | banner: | 545 | banner: |
519 | $banner | 546 | $banner |
@@ -629,6 +656,16 @@ $rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)"); | |||
629 | $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); | 656 | $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); |
630 | $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); | 657 | $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); |
631 | 658 | ||
659 | # Special case rule for fips_premain_dso | ||
660 | |||
661 | if ($fips) | ||
662 | { | ||
663 | $rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj", | ||
664 | "\$(FIPS_PREMAIN_SRC)", | ||
665 | "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(SHLIB_CFLAGS)", ""); | ||
666 | $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1); | ||
667 | } | ||
668 | |||
632 | foreach (values %lib_nam) | 669 | foreach (values %lib_nam) |
633 | { | 670 | { |
634 | $lib_obj=$lib_obj{$_}; | 671 | $lib_obj=$lib_obj{$_}; |
@@ -677,7 +714,28 @@ foreach (split(/\s+/,$engines)) | |||
677 | 714 | ||
678 | 715 | ||
679 | $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); | 716 | $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); |
680 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)"); | 717 | |
718 | if ($fips) | ||
719 | { | ||
720 | if ($shlib) | ||
721 | { | ||
722 | $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)", | ||
723 | "\$(O_CRYPTO)", "$crypto", | ||
724 | $shlib, "\$(SO_CRYPTO)", "\$(BASEADDR)"); | ||
725 | } | ||
726 | else | ||
727 | { | ||
728 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)", | ||
729 | "\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)", ""); | ||
730 | $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)", | ||
731 | "\$(LIB_D)$o$crypto_compat",$crypto,$shlib,"\$(SO_CRYPTO)", ""); | ||
732 | } | ||
733 | } | ||
734 | else | ||
735 | { | ||
736 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib, | ||
737 | "\$(SO_CRYPTO)"); | ||
738 | } | ||
681 | 739 | ||
682 | foreach (split(" ",$otherlibs)) | 740 | foreach (split(" ",$otherlibs)) |
683 | { | 741 | { |
@@ -687,7 +745,7 @@ foreach (split(" ",$otherlibs)) | |||
687 | 745 | ||
688 | } | 746 | } |
689 | 747 | ||
690 | $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); | 748 | $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0); |
691 | 749 | ||
692 | print $defs; | 750 | print $defs; |
693 | 751 | ||
@@ -781,6 +839,8 @@ sub var_add | |||
781 | @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1; | 839 | @a=grep(!/(^sha1)|(_sha1$)|(m_dss1$)/,@a) if $no_sha1; |
782 | @a=grep(!/_mdc2$/,@a) if $no_mdc2; | 840 | @a=grep(!/_mdc2$/,@a) if $no_mdc2; |
783 | 841 | ||
842 | @a=grep(!/(srp)/,@a) if $no_srp; | ||
843 | |||
784 | @a=grep(!/^engine$/,@a) if $no_engine; | 844 | @a=grep(!/^engine$/,@a) if $no_engine; |
785 | @a=grep(!/^hw$/,@a) if $no_hw; | 845 | @a=grep(!/^hw$/,@a) if $no_hw; |
786 | @a=grep(!/(^rsa$)|(^genrsa$)/,@a) if $no_rsa; | 846 | @a=grep(!/(^rsa$)|(^genrsa$)/,@a) if $no_rsa; |
@@ -939,14 +999,15 @@ sub Sasm_compile_target | |||
939 | 999 | ||
940 | sub cc_compile_target | 1000 | sub cc_compile_target |
941 | { | 1001 | { |
942 | local($target,$source,$ex_flags)=@_; | 1002 | local($target,$source,$ex_flags, $srcd)=@_; |
943 | local($ret); | 1003 | local($ret); |
944 | 1004 | ||
945 | $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/); | 1005 | $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cversion/); |
946 | $target =~ s/\//$o/g if $o ne "/"; | 1006 | $target =~ s/\//$o/g if $o ne "/"; |
947 | $source =~ s/\//$o/g if $o ne "/"; | 1007 | $source =~ s/\//$o/g if $o ne "/"; |
948 | $ret ="$target: \$(SRC_D)$o$source\n\t"; | 1008 | $srcd = "\$(SRC_D)$o" unless defined $srcd; |
949 | $ret.="\$(CC) ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n"; | 1009 | $ret ="$target: $srcd$source\n\t"; |
1010 | $ret.="\$(CC) ${ofile}$target $ex_flags -c $srcd$source\n\n"; | ||
950 | return($ret); | 1011 | return($ret); |
951 | } | 1012 | } |
952 | 1013 | ||
@@ -1056,8 +1117,11 @@ sub read_options | |||
1056 | "no-ssl2" => \$no_ssl2, | 1117 | "no-ssl2" => \$no_ssl2, |
1057 | "no-ssl3" => \$no_ssl3, | 1118 | "no-ssl3" => \$no_ssl3, |
1058 | "no-tlsext" => \$no_tlsext, | 1119 | "no-tlsext" => \$no_tlsext, |
1120 | "no-srp" => \$no_srp, | ||
1059 | "no-cms" => \$no_cms, | 1121 | "no-cms" => \$no_cms, |
1122 | "no-ec2m" => \$no_ec2m, | ||
1060 | "no-jpake" => \$no_jpake, | 1123 | "no-jpake" => \$no_jpake, |
1124 | "no-ec_nistp_64_gcc_128" => 0, | ||
1061 | "no-err" => \$no_err, | 1125 | "no-err" => \$no_err, |
1062 | "no-sock" => \$no_sock, | 1126 | "no-sock" => \$no_sock, |
1063 | "no-krb5" => \$no_krb5, | 1127 | "no-krb5" => \$no_krb5, |
@@ -1067,11 +1131,12 @@ sub read_options | |||
1067 | "no-gost" => \$no_gost, | 1131 | "no-gost" => \$no_gost, |
1068 | "no-engine" => \$no_engine, | 1132 | "no-engine" => \$no_engine, |
1069 | "no-hw" => \$no_hw, | 1133 | "no-hw" => \$no_hw, |
1134 | "no-rsax" => 0, | ||
1070 | "just-ssl" => | 1135 | "just-ssl" => |
1071 | [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, | 1136 | [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, |
1072 | \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, | 1137 | \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, |
1073 | \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, | 1138 | \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, |
1074 | \$no_aes, \$no_camellia, \$no_seed], | 1139 | \$no_aes, \$no_camellia, \$no_seed, \$no_srp], |
1075 | "rsaref" => 0, | 1140 | "rsaref" => 0, |
1076 | "gcc" => \$gcc, | 1141 | "gcc" => \$gcc, |
1077 | "debug" => \$debug, | 1142 | "debug" => \$debug, |
@@ -1079,6 +1144,7 @@ sub read_options | |||
1079 | "shlib" => \$shlib, | 1144 | "shlib" => \$shlib, |
1080 | "dll" => \$shlib, | 1145 | "dll" => \$shlib, |
1081 | "shared" => 0, | 1146 | "shared" => 0, |
1147 | "no-sctp" => 0, | ||
1082 | "no-gmp" => 0, | 1148 | "no-gmp" => 0, |
1083 | "no-rfc3779" => 0, | 1149 | "no-rfc3779" => 0, |
1084 | "no-montasm" => 0, | 1150 | "no-montasm" => 0, |
@@ -1086,6 +1152,7 @@ sub read_options | |||
1086 | "no-store" => 0, | 1152 | "no-store" => 0, |
1087 | "no-zlib" => 0, | 1153 | "no-zlib" => 0, |
1088 | "no-zlib-dynamic" => 0, | 1154 | "no-zlib-dynamic" => 0, |
1155 | "fips" => \$fips | ||
1089 | ); | 1156 | ); |
1090 | 1157 | ||
1091 | if (exists $valid_options{$_}) | 1158 | if (exists $valid_options{$_}) |
diff --git a/src/lib/libssl/src/util/mkdef.pl b/src/lib/libssl/src/util/mkdef.pl index ab47329097..9a8c7b87d1 100644 --- a/src/lib/libssl/src/util/mkdef.pl +++ b/src/lib/libssl/src/util/mkdef.pl | |||
@@ -79,13 +79,15 @@ my $OS2=0; | |||
79 | my $safe_stack_def = 0; | 79 | my $safe_stack_def = 0; |
80 | 80 | ||
81 | my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT", | 81 | my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT", |
82 | "EXPORT_VAR_AS_FUNCTION", "ZLIB" ); | 82 | "EXPORT_VAR_AS_FUNCTION", "ZLIB", "OPENSSL_FIPS" ); |
83 | my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" ); | 83 | my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" ); |
84 | my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | 84 | my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", |
85 | "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1", | 85 | "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1", |
86 | "SHA256", "SHA512", "RIPEMD", | 86 | "SHA256", "SHA512", "RIPEMD", |
87 | "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", | 87 | "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", "EC2M", |
88 | "HMAC", "AES", "CAMELLIA", "SEED", "GOST", | 88 | "HMAC", "AES", "CAMELLIA", "SEED", "GOST", |
89 | # EC_NISTP_64_GCC_128 | ||
90 | "EC_NISTP_64_GCC_128", | ||
89 | # Envelope "algorithms" | 91 | # Envelope "algorithms" |
90 | "EVP", "X509", "ASN1_TYPEDEFS", | 92 | "EVP", "X509", "ASN1_TYPEDEFS", |
91 | # Helper "algorithms" | 93 | # Helper "algorithms" |
@@ -98,7 +100,7 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | |||
98 | # RFC3779 | 100 | # RFC3779 |
99 | "RFC3779", | 101 | "RFC3779", |
100 | # TLS | 102 | # TLS |
101 | "TLSEXT", "PSK", | 103 | "TLSEXT", "PSK", "SRP", "HEARTBEATS", |
102 | # CMS | 104 | # CMS |
103 | "CMS", | 105 | "CMS", |
104 | # CryptoAPI Engine | 106 | # CryptoAPI Engine |
@@ -107,8 +109,14 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | |||
107 | "SSL2", | 109 | "SSL2", |
108 | # JPAKE | 110 | # JPAKE |
109 | "JPAKE", | 111 | "JPAKE", |
112 | # NEXTPROTONEG | ||
113 | "NEXTPROTONEG", | ||
110 | # Deprecated functions | 114 | # Deprecated functions |
111 | "DEPRECATED" ); | 115 | "DEPRECATED", |
116 | # Hide SSL internals | ||
117 | "SSL_INTERN", | ||
118 | # SCTP | ||
119 | "SCTP"); | ||
112 | 120 | ||
113 | my $options=""; | 121 | my $options=""; |
114 | open(IN,"<Makefile") || die "unable to open Makefile!\n"; | 122 | open(IN,"<Makefile") || die "unable to open Makefile!\n"; |
@@ -127,7 +135,10 @@ my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5; | |||
127 | my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; | 135 | my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; |
128 | my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated; | 136 | my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated; |
129 | my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng; | 137 | my $no_rfc3779; my $no_psk; my $no_tlsext; my $no_cms; my $no_capieng; |
130 | my $no_jpake; my $no_ssl2; | 138 | my $no_jpake; my $no_srp; my $no_ssl2; my $no_ec2m; my $no_nistp_gcc; |
139 | my $no_nextprotoneg; my $no_sctp; | ||
140 | |||
141 | my $fips; | ||
131 | 142 | ||
132 | my $zlib; | 143 | my $zlib; |
133 | 144 | ||
@@ -151,6 +162,7 @@ foreach (@ARGV, split(/ /, $options)) | |||
151 | } | 162 | } |
152 | $VMS=1 if $_ eq "VMS"; | 163 | $VMS=1 if $_ eq "VMS"; |
153 | $OS2=1 if $_ eq "OS2"; | 164 | $OS2=1 if $_ eq "OS2"; |
165 | $fips=1 if /^fips/; | ||
154 | if ($_ eq "zlib" || $_ eq "enable-zlib" || $_ eq "zlib-dynamic" | 166 | if ($_ eq "zlib" || $_ eq "enable-zlib" || $_ eq "zlib-dynamic" |
155 | || $_ eq "enable-zlib-dynamic") { | 167 | || $_ eq "enable-zlib-dynamic") { |
156 | $zlib = 1; | 168 | $zlib = 1; |
@@ -215,9 +227,14 @@ foreach (@ARGV, split(/ /, $options)) | |||
215 | elsif (/^no-rfc3779$/) { $no_rfc3779=1; } | 227 | elsif (/^no-rfc3779$/) { $no_rfc3779=1; } |
216 | elsif (/^no-tlsext$/) { $no_tlsext=1; } | 228 | elsif (/^no-tlsext$/) { $no_tlsext=1; } |
217 | elsif (/^no-cms$/) { $no_cms=1; } | 229 | elsif (/^no-cms$/) { $no_cms=1; } |
230 | elsif (/^no-ec2m$/) { $no_ec2m=1; } | ||
231 | elsif (/^no-ec_nistp_64_gcc_128$/) { $no_nistp_gcc=1; } | ||
232 | elsif (/^no-nextprotoneg$/) { $no_nextprotoneg=1; } | ||
218 | elsif (/^no-ssl2$/) { $no_ssl2=1; } | 233 | elsif (/^no-ssl2$/) { $no_ssl2=1; } |
219 | elsif (/^no-capieng$/) { $no_capieng=1; } | 234 | elsif (/^no-capieng$/) { $no_capieng=1; } |
220 | elsif (/^no-jpake$/) { $no_jpake=1; } | 235 | elsif (/^no-jpake$/) { $no_jpake=1; } |
236 | elsif (/^no-srp$/) { $no_srp=1; } | ||
237 | elsif (/^no-sctp$/) { $no_sctp=1; } | ||
221 | } | 238 | } |
222 | 239 | ||
223 | 240 | ||
@@ -254,8 +271,10 @@ $max_crypto = $max_num; | |||
254 | my $ssl="ssl/ssl.h"; | 271 | my $ssl="ssl/ssl.h"; |
255 | $ssl.=" ssl/kssl.h"; | 272 | $ssl.=" ssl/kssl.h"; |
256 | $ssl.=" ssl/tls1.h"; | 273 | $ssl.=" ssl/tls1.h"; |
274 | $ssl.=" ssl/srtp.h"; | ||
257 | 275 | ||
258 | my $crypto ="crypto/crypto.h"; | 276 | my $crypto ="crypto/crypto.h"; |
277 | $crypto.=" crypto/cryptlib.h"; | ||
259 | $crypto.=" crypto/o_dir.h"; | 278 | $crypto.=" crypto/o_dir.h"; |
260 | $crypto.=" crypto/o_str.h"; | 279 | $crypto.=" crypto/o_str.h"; |
261 | $crypto.=" crypto/o_time.h"; | 280 | $crypto.=" crypto/o_time.h"; |
@@ -285,6 +304,7 @@ $crypto.=" crypto/ec/ec.h" ; # unless $no_ec; | |||
285 | $crypto.=" crypto/ecdsa/ecdsa.h" ; # unless $no_ecdsa; | 304 | $crypto.=" crypto/ecdsa/ecdsa.h" ; # unless $no_ecdsa; |
286 | $crypto.=" crypto/ecdh/ecdh.h" ; # unless $no_ecdh; | 305 | $crypto.=" crypto/ecdh/ecdh.h" ; # unless $no_ecdh; |
287 | $crypto.=" crypto/hmac/hmac.h" ; # unless $no_hmac; | 306 | $crypto.=" crypto/hmac/hmac.h" ; # unless $no_hmac; |
307 | $crypto.=" crypto/cmac/cmac.h" ; # unless $no_hmac; | ||
288 | 308 | ||
289 | $crypto.=" crypto/engine/engine.h"; # unless $no_engine; | 309 | $crypto.=" crypto/engine/engine.h"; # unless $no_engine; |
290 | $crypto.=" crypto/stack/stack.h" ; # unless $no_stack; | 310 | $crypto.=" crypto/stack/stack.h" ; # unless $no_stack; |
@@ -319,6 +339,7 @@ $crypto.=" crypto/pqueue/pqueue.h"; | |||
319 | $crypto.=" crypto/cms/cms.h"; | 339 | $crypto.=" crypto/cms/cms.h"; |
320 | $crypto.=" crypto/jpake/jpake.h"; | 340 | $crypto.=" crypto/jpake/jpake.h"; |
321 | $crypto.=" crypto/modes/modes.h"; | 341 | $crypto.=" crypto/modes/modes.h"; |
342 | $crypto.=" crypto/srp/srp.h"; | ||
322 | 343 | ||
323 | my $symhacks="crypto/symhacks.h"; | 344 | my $symhacks="crypto/symhacks.h"; |
324 | 345 | ||
@@ -1126,6 +1147,9 @@ sub is_valid | |||
1126 | if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) { | 1147 | if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) { |
1127 | return 1; | 1148 | return 1; |
1128 | } | 1149 | } |
1150 | if ($keyword eq "OPENSSL_FIPS" && $fips) { | ||
1151 | return 1; | ||
1152 | } | ||
1129 | if ($keyword eq "ZLIB" && $zlib) { return 1; } | 1153 | if ($keyword eq "ZLIB" && $zlib) { return 1; } |
1130 | return 0; | 1154 | return 0; |
1131 | } else { | 1155 | } else { |
@@ -1172,9 +1196,15 @@ sub is_valid | |||
1172 | if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } | 1196 | if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } |
1173 | if ($keyword eq "PSK" && $no_psk) { return 0; } | 1197 | if ($keyword eq "PSK" && $no_psk) { return 0; } |
1174 | if ($keyword eq "CMS" && $no_cms) { return 0; } | 1198 | if ($keyword eq "CMS" && $no_cms) { return 0; } |
1199 | if ($keyword eq "EC2M" && $no_ec2m) { return 0; } | ||
1200 | if ($keyword eq "NEXTPROTONEG" && $no_nextprotoneg) { return 0; } | ||
1201 | if ($keyword eq "EC_NISTP_64_GCC_128" && $no_nistp_gcc) | ||
1202 | { return 0; } | ||
1175 | if ($keyword eq "SSL2" && $no_ssl2) { return 0; } | 1203 | if ($keyword eq "SSL2" && $no_ssl2) { return 0; } |
1176 | if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } | 1204 | if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } |
1177 | if ($keyword eq "JPAKE" && $no_jpake) { return 0; } | 1205 | if ($keyword eq "JPAKE" && $no_jpake) { return 0; } |
1206 | if ($keyword eq "SRP" && $no_srp) { return 0; } | ||
1207 | if ($keyword eq "SCTP" && $no_sctp) { return 0; } | ||
1178 | if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } | 1208 | if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } |
1179 | 1209 | ||
1180 | # Nothing recognise as true | 1210 | # Nothing recognise as true |
diff --git a/src/lib/libssl/src/util/mkfiles.pl b/src/lib/libssl/src/util/mkfiles.pl index 6d15831450..7d9a9d5e5c 100644 --- a/src/lib/libssl/src/util/mkfiles.pl +++ b/src/lib/libssl/src/util/mkfiles.pl | |||
@@ -15,6 +15,7 @@ my @dirs = ( | |||
15 | "crypto/sha", | 15 | "crypto/sha", |
16 | "crypto/mdc2", | 16 | "crypto/mdc2", |
17 | "crypto/hmac", | 17 | "crypto/hmac", |
18 | "crypto/cmac", | ||
18 | "crypto/ripemd", | 19 | "crypto/ripemd", |
19 | "crypto/des", | 20 | "crypto/des", |
20 | "crypto/rc2", | 21 | "crypto/rc2", |
@@ -62,6 +63,7 @@ my @dirs = ( | |||
62 | "crypto/pqueue", | 63 | "crypto/pqueue", |
63 | "crypto/whrlpool", | 64 | "crypto/whrlpool", |
64 | "crypto/ts", | 65 | "crypto/ts", |
66 | "crypto/srp", | ||
65 | "ssl", | 67 | "ssl", |
66 | "apps", | 68 | "apps", |
67 | "engines", | 69 | "engines", |
diff --git a/src/lib/libssl/src/util/pl/VC-32.pl b/src/lib/libssl/src/util/pl/VC-32.pl index 5f25fc41bf..c503bd52b9 100644 --- a/src/lib/libssl/src/util/pl/VC-32.pl +++ b/src/lib/libssl/src/util/pl/VC-32.pl | |||
@@ -6,6 +6,16 @@ | |||
6 | $ssl= "ssleay32"; | 6 | $ssl= "ssleay32"; |
7 | $crypto="libeay32"; | 7 | $crypto="libeay32"; |
8 | 8 | ||
9 | if ($fips && !$shlib) | ||
10 | { | ||
11 | $crypto="libeayfips32"; | ||
12 | $crypto_compat = "libeaycompat32.lib"; | ||
13 | } | ||
14 | else | ||
15 | { | ||
16 | $crypto="libeay32"; | ||
17 | } | ||
18 | |||
9 | $o='\\'; | 19 | $o='\\'; |
10 | $cp='$(PERL) util/copy.pl'; | 20 | $cp='$(PERL) util/copy.pl'; |
11 | $mkdir='$(PERL) util/mkdir-p.pl'; | 21 | $mkdir='$(PERL) util/mkdir-p.pl'; |
@@ -33,7 +43,7 @@ if ($FLAVOR =~ /WIN64/) | |||
33 | # considered safe to ignore. | 43 | # considered safe to ignore. |
34 | # | 44 | # |
35 | $base_cflags= " $mf_cflag"; | 45 | $base_cflags= " $mf_cflag"; |
36 | my $f = $shlib?' /MD':' /MT'; | 46 | my $f = $shlib || $fips ?' /MD':' /MT'; |
37 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | 47 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib |
38 | $opt_cflags=$f.' /Ox'; | 48 | $opt_cflags=$f.' /Ox'; |
39 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | 49 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; |
@@ -114,7 +124,7 @@ elsif ($FLAVOR =~ /CE/) | |||
114 | else # Win32 | 124 | else # Win32 |
115 | { | 125 | { |
116 | $base_cflags= " $mf_cflag"; | 126 | $base_cflags= " $mf_cflag"; |
117 | my $f = $shlib?' /MD':' /MT'; | 127 | my $f = $shlib || $fips ?' /MD':' /MT'; |
118 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib | 128 | $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib |
119 | $opt_cflags=$f.' /Ox /O2 /Ob2'; | 129 | $opt_cflags=$f.' /Ox /O2 /Ob2'; |
120 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; | 130 | $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; |
@@ -266,10 +276,19 @@ elsif ($shlib && $FLAVOR =~ /CE/) | |||
266 | 276 | ||
267 | sub do_lib_rule | 277 | sub do_lib_rule |
268 | { | 278 | { |
269 | local($objs,$target,$name,$shlib)=@_; | 279 | my($objs,$target,$name,$shlib,$ign,$base_addr) = @_; |
270 | local($ret); | 280 | local($ret); |
271 | 281 | ||
272 | $taget =~ s/\//$o/g if $o ne '/'; | 282 | $taget =~ s/\//$o/g if $o ne '/'; |
283 | my $base_arg; | ||
284 | if ($base_addr ne "") | ||
285 | { | ||
286 | $base_arg= " /base:$base_addr"; | ||
287 | } | ||
288 | else | ||
289 | { | ||
290 | $base_arg = ""; | ||
291 | } | ||
273 | if ($name ne "") | 292 | if ($name ne "") |
274 | { | 293 | { |
275 | $name =~ tr/a-z/A-Z/; | 294 | $name =~ tr/a-z/A-Z/; |
@@ -277,17 +296,37 @@ sub do_lib_rule | |||
277 | } | 296 | } |
278 | 297 | ||
279 | # $target="\$(LIB_D)$o$target"; | 298 | # $target="\$(LIB_D)$o$target"; |
280 | $ret.="$target: $objs\n"; | 299 | # $ret.="$target: $objs\n"; |
281 | if (!$shlib) | 300 | if (!$shlib) |
282 | { | 301 | { |
283 | # $ret.="\t\$(RM) \$(O_$Name)\n"; | 302 | # $ret.="\t\$(RM) \$(O_$Name)\n"; |
303 | $ret.="$target: $objs\n"; | ||
284 | $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; | 304 | $ret.="\t\$(MKLIB) $lfile$target @<<\n $objs\n<<\n"; |
285 | } | 305 | } |
286 | else | 306 | else |
287 | { | 307 | { |
288 | local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)'; | 308 | local($ex)=($target =~ /O_CRYPTO/)?'':' $(L_CRYPTO)'; |
289 | $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; | 309 | $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; |
290 | $ret.="\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n"; | 310 | |
311 | if ($fips && $target =~ /O_CRYPTO/) | ||
312 | { | ||
313 | $ret.="$target: $objs \$(PREMAIN_DSO_EXE)"; | ||
314 | $ret.="\n\tSET FIPS_LINK=\$(LINK)\n"; | ||
315 | $ret.="\tSET FIPS_CC=\$(CC)\n"; | ||
316 | $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; | ||
317 | $ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n"; | ||
318 | $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; | ||
319 | $ret.="\tSET FIPS_TARGET=$target\n"; | ||
320 | $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; | ||
321 | $ret.="\t\$(FIPSLINK) \$(MLFLAGS) /map $base_arg $efile$target "; | ||
322 | $ret.="$name @<<\n \$(SHLIB_EX_OBJ) $objs \$(EX_LIBS) "; | ||
323 | $ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n"; | ||
324 | } | ||
325 | else | ||
326 | { | ||
327 | $ret.="$target: $objs"; | ||
328 | $ret.="\n\t\$(LINK) \$(MLFLAGS) $efile$target $name @<<\n \$(SHLIB_EX_OBJ) $objs $ex \$(EX_LIBS)\n<<\n"; | ||
329 | } | ||
291 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; | 330 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;2\n\n"; |
292 | } | 331 | } |
293 | $ret.="\n"; | 332 | $ret.="\n"; |
@@ -296,15 +335,35 @@ sub do_lib_rule | |||
296 | 335 | ||
297 | sub do_link_rule | 336 | sub do_link_rule |
298 | { | 337 | { |
299 | local($target,$files,$dep_libs,$libs)=@_; | 338 | my($target,$files,$dep_libs,$libs,$standalone)=@_; |
300 | local($ret,$_); | 339 | local($ret,$_); |
301 | |||
302 | $file =~ s/\//$o/g if $o ne '/'; | 340 | $file =~ s/\//$o/g if $o ne '/'; |
303 | $n=&bname($targer); | 341 | $n=&bname($targer); |
304 | $ret.="$target: $files $dep_libs\n"; | 342 | $ret.="$target: $files $dep_libs\n"; |
305 | $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; | 343 | if ($standalone == 1) |
306 | $ret.=" \$(APP_EX_OBJ) $files $libs\n<<\n"; | 344 | { |
307 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; | 345 | $ret.=" \$(LINK) \$(LFLAGS) $efile$target @<<\n\t"; |
346 | $ret.= "\$(EX_LIBS) " if ($files =~ /O_FIPSCANISTER/ && !$fipscanisterbuild); | ||
347 | $ret.="$files $libs\n<<\n"; | ||
348 | } | ||
349 | elsif ($standalone == 2) | ||
350 | { | ||
351 | $ret.="\tSET FIPS_LINK=\$(LINK)\n"; | ||
352 | $ret.="\tSET FIPS_CC=\$(CC)\n"; | ||
353 | $ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n"; | ||
354 | $ret.="\tSET PREMAIN_DSO_EXE=\n"; | ||
355 | $ret.="\tSET FIPS_TARGET=$target\n"; | ||
356 | $ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n"; | ||
357 | $ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n"; | ||
358 | $ret.="\t\$(FIPSLINK) \$(LFLAGS) /map $efile$target @<<\n"; | ||
359 | $ret.="\t\$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n"; | ||
360 | } | ||
361 | else | ||
362 | { | ||
363 | $ret.="\t\$(LINK) \$(LFLAGS) $efile$target @<<\n"; | ||
364 | $ret.="\t\$(APP_EX_OBJ) $files $libs\n<<\n"; | ||
365 | } | ||
366 | $ret.="\tIF EXIST \$@.manifest mt -nologo -manifest \$@.manifest -outputresource:\$@;1\n\n"; | ||
308 | return($ret); | 367 | return($ret); |
309 | } | 368 | } |
310 | 369 | ||
diff --git a/src/lib/libssl/src/util/ssleay.num b/src/lib/libssl/src/util/ssleay.num index 15a58e7b13..37655bc40a 100644 --- a/src/lib/libssl/src/util/ssleay.num +++ b/src/lib/libssl/src/util/ssleay.num | |||
@@ -259,3 +259,64 @@ SSL_set_session_secret_cb 307 EXIST::FUNCTION: | |||
259 | SSL_set_session_ticket_ext_cb 308 EXIST::FUNCTION: | 259 | SSL_set_session_ticket_ext_cb 308 EXIST::FUNCTION: |
260 | SSL_set1_param 309 EXIST::FUNCTION: | 260 | SSL_set1_param 309 EXIST::FUNCTION: |
261 | SSL_CTX_set1_param 310 EXIST::FUNCTION: | 261 | SSL_CTX_set1_param 310 EXIST::FUNCTION: |
262 | SSL_tls1_key_exporter 311 NOEXIST::FUNCTION: | ||
263 | SSL_renegotiate_abbreviated 312 EXIST::FUNCTION: | ||
264 | TLSv1_1_method 313 EXIST::FUNCTION: | ||
265 | TLSv1_1_client_method 314 EXIST::FUNCTION: | ||
266 | TLSv1_1_server_method 315 EXIST::FUNCTION: | ||
267 | SSL_CTX_set_srp_client_pwd_callback 316 EXIST:!VMS:FUNCTION:SRP | ||
268 | SSL_CTX_set_srp_client_pwd_cb 316 EXIST:VMS:FUNCTION:SRP | ||
269 | SSL_get_srp_g 317 EXIST::FUNCTION:SRP | ||
270 | SSL_CTX_set_srp_username_callback 318 EXIST:!VMS:FUNCTION:SRP | ||
271 | SSL_CTX_set_srp_un_cb 318 EXIST:VMS:FUNCTION:SRP | ||
272 | SSL_get_srp_userinfo 319 EXIST::FUNCTION:SRP | ||
273 | SSL_set_srp_server_param 320 EXIST::FUNCTION:SRP | ||
274 | SSL_set_srp_server_param_pw 321 EXIST::FUNCTION:SRP | ||
275 | SSL_get_srp_N 322 EXIST::FUNCTION:SRP | ||
276 | SSL_get_srp_username 323 EXIST::FUNCTION:SRP | ||
277 | SSL_CTX_set_srp_password 324 EXIST::FUNCTION:SRP | ||
278 | SSL_CTX_set_srp_strength 325 EXIST::FUNCTION:SRP | ||
279 | SSL_CTX_set_srp_verify_param_callback 326 EXIST:!VMS:FUNCTION:SRP | ||
280 | SSL_CTX_set_srp_vfy_param_cb 326 EXIST:VMS:FUNCTION:SRP | ||
281 | SSL_CTX_set_srp_miss_srp_un_cb 327 NOEXIST::FUNCTION: | ||
282 | SSL_CTX_set_srp_missing_srp_username_callback 327 NOEXIST::FUNCTION: | ||
283 | SSL_CTX_set_srp_cb_arg 328 EXIST::FUNCTION:SRP | ||
284 | SSL_CTX_set_srp_username 329 EXIST::FUNCTION:SRP | ||
285 | SSL_CTX_SRP_CTX_init 330 EXIST::FUNCTION:SRP | ||
286 | SSL_SRP_CTX_init 331 EXIST::FUNCTION:SRP | ||
287 | SRP_Calc_A_param 332 EXIST::FUNCTION:SRP | ||
288 | SRP_generate_server_master_secret 333 EXIST:!VMS:FUNCTION:SRP | ||
289 | SRP_gen_server_master_secret 333 EXIST:VMS:FUNCTION:SRP | ||
290 | SSL_CTX_SRP_CTX_free 334 EXIST::FUNCTION:SRP | ||
291 | SRP_generate_client_master_secret 335 EXIST:!VMS:FUNCTION:SRP | ||
292 | SRP_gen_client_master_secret 335 EXIST:VMS:FUNCTION:SRP | ||
293 | SSL_srp_server_param_with_username 336 EXIST:!VMS:FUNCTION:SRP | ||
294 | SSL_srp_server_param_with_un 336 EXIST:VMS:FUNCTION:SRP | ||
295 | SRP_have_to_put_srp_username 337 NOEXIST::FUNCTION: | ||
296 | SSL_SRP_CTX_free 338 EXIST::FUNCTION:SRP | ||
297 | SSL_set_debug 339 EXIST::FUNCTION: | ||
298 | SSL_SESSION_get0_peer 340 EXIST::FUNCTION: | ||
299 | TLSv1_2_client_method 341 EXIST::FUNCTION: | ||
300 | SSL_SESSION_set1_id_context 342 EXIST::FUNCTION: | ||
301 | TLSv1_2_server_method 343 EXIST::FUNCTION: | ||
302 | SSL_cache_hit 344 EXIST::FUNCTION: | ||
303 | SSL_get0_kssl_ctx 345 EXIST::FUNCTION:KRB5 | ||
304 | SSL_set0_kssl_ctx 346 EXIST::FUNCTION:KRB5 | ||
305 | SSL_SESSION_get0_id 347 NOEXIST::FUNCTION: | ||
306 | SSL_set_state 348 EXIST::FUNCTION: | ||
307 | SSL_CIPHER_get_id 349 EXIST::FUNCTION: | ||
308 | TLSv1_2_method 350 EXIST::FUNCTION: | ||
309 | SSL_SESSION_get_id_len 351 NOEXIST::FUNCTION: | ||
310 | kssl_ctx_get0_client_princ 352 EXIST::FUNCTION:KRB5 | ||
311 | SSL_export_keying_material 353 EXIST::FUNCTION:TLSEXT | ||
312 | SSL_set_tlsext_use_srtp 354 EXIST::FUNCTION: | ||
313 | SSL_CTX_set_next_protos_advertised_cb 355 EXIST:!VMS:FUNCTION:NEXTPROTONEG | ||
314 | SSL_CTX_set_next_protos_adv_cb 355 EXIST:VMS:FUNCTION:NEXTPROTONEG | ||
315 | SSL_get0_next_proto_negotiated 356 EXIST::FUNCTION:NEXTPROTONEG | ||
316 | SSL_get_selected_srtp_profile 357 EXIST::FUNCTION: | ||
317 | SSL_CTX_set_tlsext_use_srtp 358 EXIST::FUNCTION: | ||
318 | SSL_select_next_proto 359 EXIST::FUNCTION:NEXTPROTONEG | ||
319 | SSL_get_srtp_profiles 360 EXIST::FUNCTION: | ||
320 | SSL_CTX_set_next_proto_select_cb 361 EXIST:!VMS:FUNCTION:NEXTPROTONEG | ||
321 | SSL_CTX_set_next_proto_sel_cb 361 EXIST:VMS:FUNCTION:NEXTPROTONEG | ||
322 | SSL_SESSION_get_compress_id 362 EXIST::FUNCTION: | ||
diff --git a/src/lib/libssl/test/Makefile b/src/lib/libssl/test/Makefile index 3912f82427..09e6848764 100644 --- a/src/lib/libssl/test/Makefile +++ b/src/lib/libssl/test/Makefile | |||
@@ -61,6 +61,7 @@ ENGINETEST= enginetest | |||
61 | EVPTEST= evp_test | 61 | EVPTEST= evp_test |
62 | IGETEST= igetest | 62 | IGETEST= igetest |
63 | JPAKETEST= jpaketest | 63 | JPAKETEST= jpaketest |
64 | SRPTEST= srptest | ||
64 | ASN1TEST= asn1test | 65 | ASN1TEST= asn1test |
65 | 66 | ||
66 | TESTS= alltests | 67 | TESTS= alltests |
@@ -72,7 +73,7 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST) | |||
72 | $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \ | 73 | $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \ |
73 | $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \ | 74 | $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \ |
74 | $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ | 75 | $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ |
75 | $(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) \ | 76 | $(EVPTEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \ |
76 | $(ASN1TEST)$(EXE_EXT) | 77 | $(ASN1TEST)$(EXE_EXT) |
77 | 78 | ||
78 | # $(METHTEST)$(EXE_EXT) | 79 | # $(METHTEST)$(EXE_EXT) |
@@ -93,7 +94,7 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ | |||
93 | $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ | 94 | $(DESTEST).c $(SHATEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \ |
94 | $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ | 95 | $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ |
95 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ | 96 | $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ |
96 | $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(ASN1TEST).c | 97 | $(EVPTEST).c $(IGETEST).c $(JPAKETEST).c $(SRPTEST).c $(ASN1TEST).c |
97 | 98 | ||
98 | EXHEADER= | 99 | EXHEADER= |
99 | HEADER= $(EXHEADER) | 100 | HEADER= $(EXHEADER) |
@@ -136,7 +137,7 @@ alltests: \ | |||
136 | test_enc test_x509 test_rsa test_crl test_sid \ | 137 | test_enc test_x509 test_rsa test_crl test_sid \ |
137 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ | 138 | test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ |
138 | test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ | 139 | test_ss test_ca test_engine test_evp test_ssl test_tsa test_ige \ |
139 | test_jpake test_cms | 140 | test_jpake test_srp test_cms |
140 | 141 | ||
141 | test_evp: | 142 | test_evp: |
142 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt | 143 | ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt |
@@ -274,6 +275,9 @@ test_engine: | |||
274 | test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ | 275 | test_ssl: keyU.ss certU.ss certCA.ss certP1.ss keyP1.ss certP2.ss keyP2.ss \ |
275 | intP1.ss intP2.ss | 276 | intP1.ss intP2.ss |
276 | @echo "test SSL protocol" | 277 | @echo "test SSL protocol" |
278 | @if [ -n "$(FIPSCANLIB)" ]; then \ | ||
279 | sh ./testfipsssl keyU.ss certU.ss certCA.ss; \ | ||
280 | fi | ||
277 | ../util/shlib_wrap.sh ./$(SSLTEST) -test_cipherlist | 281 | ../util/shlib_wrap.sh ./$(SSLTEST) -test_cipherlist |
278 | @sh ./testssl keyU.ss certU.ss certCA.ss | 282 | @sh ./testssl keyU.ss certU.ss certCA.ss |
279 | @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss | 283 | @sh ./testsslproxy keyP1.ss certP1.ss intP1.ss |
@@ -310,6 +314,10 @@ test_cms: | |||
310 | @echo "CMS consistency test" | 314 | @echo "CMS consistency test" |
311 | $(PERL) cms-test.pl | 315 | $(PERL) cms-test.pl |
312 | 316 | ||
317 | test_srp: $(SRPTEST)$(EXE_EXT) | ||
318 | @echo "Test SRP" | ||
319 | ../util/shlib_wrap.sh ./srptest | ||
320 | |||
313 | lint: | 321 | lint: |
314 | lint -DLINT $(INCLUDES) $(SRC)>fluff | 322 | lint -DLINT $(INCLUDES) $(SRC)>fluff |
315 | 323 | ||
@@ -340,7 +348,19 @@ BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ | |||
340 | fi; \ | 348 | fi; \ |
341 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ | 349 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ |
342 | $(MAKE) -f $(TOP)/Makefile.shared -e \ | 350 | $(MAKE) -f $(TOP)/Makefile.shared -e \ |
343 | APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ | 351 | CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ |
352 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ | ||
353 | link_app.$${shlib_target} | ||
354 | |||
355 | FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ | ||
356 | shlib_target="$(SHLIB_TARGET)"; \ | ||
357 | fi; \ | ||
358 | LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ | ||
359 | if [ -z "$(SHARED_LIBS)" -a -n "$(FIPSCANLIB)" ] ; then \ | ||
360 | FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; export CC FIPSLD_CC; \ | ||
361 | fi; \ | ||
362 | $(MAKE) -f $(TOP)/Makefile.shared -e \ | ||
363 | CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ | ||
344 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ | 364 | LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ |
345 | link_app.$${shlib_target} | 365 | link_app.$${shlib_target} |
346 | 366 | ||
@@ -423,7 +443,7 @@ $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO) | |||
423 | @target=$(METHTEST); $(BUILD_CMD) | 443 | @target=$(METHTEST); $(BUILD_CMD) |
424 | 444 | ||
425 | $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) | 445 | $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) |
426 | @target=$(SSLTEST); $(BUILD_CMD) | 446 | @target=$(SSLTEST); $(FIPS_BUILD_CMD) |
427 | 447 | ||
428 | $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO) | 448 | $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO) |
429 | @target=$(ENGINETEST); $(BUILD_CMD) | 449 | @target=$(ENGINETEST); $(BUILD_CMD) |
@@ -446,6 +466,9 @@ $(JPAKETEST)$(EXE_EXT): $(JPAKETEST).o $(DLIBCRYPTO) | |||
446 | $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO) | 466 | $(ASN1TEST)$(EXE_EXT): $(ASN1TEST).o $(DLIBCRYPTO) |
447 | @target=$(ASN1TEST); $(BUILD_CMD) | 467 | @target=$(ASN1TEST); $(BUILD_CMD) |
448 | 468 | ||
469 | $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO) | ||
470 | @target=$(SRPTEST); $(BUILD_CMD) | ||
471 | |||
449 | #$(AESTEST).o: $(AESTEST).c | 472 | #$(AESTEST).o: $(AESTEST).c |
450 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c | 473 | # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c |
451 | 474 | ||
@@ -669,6 +692,13 @@ shatest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h | |||
669 | shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h | 692 | shatest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h |
670 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h | 693 | shatest.o: ../include/openssl/safestack.h ../include/openssl/sha.h |
671 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c | 694 | shatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h shatest.c |
695 | srptest.o: ../include/openssl/bio.h ../include/openssl/bn.h | ||
696 | srptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h | ||
697 | srptest.o: ../include/openssl/err.h ../include/openssl/lhash.h | ||
698 | srptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
699 | srptest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h | ||
700 | srptest.o: ../include/openssl/safestack.h ../include/openssl/srp.h | ||
701 | srptest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h srptest.c | ||
672 | ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h | 702 | ssltest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h |
673 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h | 703 | ssltest.o: ../include/openssl/bn.h ../include/openssl/buffer.h |
674 | ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h | 704 | ssltest.o: ../include/openssl/comp.h ../include/openssl/conf.h |
@@ -685,7 +715,8 @@ ssltest.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h | |||
685 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h | 715 | ssltest.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h |
686 | ssltest.o: ../include/openssl/pqueue.h ../include/openssl/rand.h | 716 | ssltest.o: ../include/openssl/pqueue.h ../include/openssl/rand.h |
687 | ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | 717 | ssltest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h |
688 | ssltest.o: ../include/openssl/sha.h ../include/openssl/ssl.h | 718 | ssltest.o: ../include/openssl/sha.h ../include/openssl/srp.h |
719 | ssltest.o: ../include/openssl/srtp.h ../include/openssl/ssl.h | ||
689 | ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h | 720 | ssltest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h |
690 | ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h | 721 | ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h |
691 | ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h | 722 | ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h |
diff --git a/src/lib/libssl/test/evptests.txt b/src/lib/libssl/test/evptests.txt index beb12144b6..c273707c14 100644 --- a/src/lib/libssl/test/evptests.txt +++ b/src/lib/libssl/test/evptests.txt | |||
@@ -158,6 +158,19 @@ AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7B | |||
158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 | 158 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 |
159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 | 159 | AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 |
160 | 160 | ||
161 | # AES Counter test vectors from RFC3686 | ||
162 | aes-128-ctr:AE6852F8121067CC4BF7A5765577F39E:00000030000000000000000000000001:53696E676C6520626C6F636B206D7367:E4095D4FB7A7B3792D6175A3261311B8:1 | ||
163 | aes-128-ctr:7E24067817FAE0D743D6CE1F32539163:006CB6DBC0543B59DA48D90B00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28:1 | ||
164 | aes-128-ctr:7691BE035E5020A8AC6E618529F9A0DC:00E0017B27777F3F4A1786F000000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F:1 | ||
165 | |||
166 | aes-192-ctr:16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515:0000004836733C147D6D93CB00000001:53696E676C6520626C6F636B206D7367:4B55384FE259C9C84E7935A003CBE928:1 | ||
167 | aes-192-ctr:7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A:0096B03B020C6EADC2CB500D00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:453243FC609B23327EDFAAFA7131CD9F8490701C5AD4A79CFC1FE0FF42F4FB00:1 | ||
168 | aes-192-ctr:02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE:0007BDFD5CBD60278DCC091200000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:96893FC55E5C722F540B7DD1DDF7E758D288BC95C69165884536C811662F2188ABEE0935:1 | ||
169 | |||
170 | aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:00000060DB5672C97AA8F0B200000001:53696E676C6520626C6F636B206D7367:145AD01DBF824EC7560863DC71E3E0C0:1 | ||
171 | aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1 | ||
172 | aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1 | ||
173 | |||
161 | # DES ECB tests (from destest) | 174 | # DES ECB tests (from destest) |
162 | 175 | ||
163 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 | 176 | DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 |
diff --git a/src/lib/libssl/test/maketests.com b/src/lib/libssl/test/maketests.com index 386e5cf3c1..9b64cba234 100644 --- a/src/lib/libssl/test/maketests.com +++ b/src/lib/libssl/test/maketests.com | |||
@@ -146,7 +146,8 @@ $ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ - | |||
146 | "MDC2TEST,RMDTEST,"+ - | 146 | "MDC2TEST,RMDTEST,"+ - |
147 | "RANDTEST,DHTEST,ENGINETEST,"+ - | 147 | "RANDTEST,DHTEST,ENGINETEST,"+ - |
148 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - | 148 | "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - |
149 | "EVP_TEST,IGETEST,JPAKETEST,ASN1TEST" | 149 | "EVP_TEST,IGETEST,JPAKETEST,SRPTEST,"+ - |
150 | "ASN1TEST" | ||
150 | $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well? | 151 | $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well? |
151 | $! | 152 | $! |
152 | $! Additional directory information. | 153 | $! Additional directory information. |
@@ -182,6 +183,7 @@ $ T_D_RSA_TEST := [-.crypto.rsa] | |||
182 | $ T_D_EVP_TEST := [-.crypto.evp] | 183 | $ T_D_EVP_TEST := [-.crypto.evp] |
183 | $ T_D_IGETEST := [-.test] | 184 | $ T_D_IGETEST := [-.test] |
184 | $ T_D_JPAKETEST := [-.crypto.jpake] | 185 | $ T_D_JPAKETEST := [-.crypto.jpake] |
186 | $ T_D_SRPTEST := [-.crypto.srp] | ||
185 | $ T_D_ASN1TEST := [-.test] | 187 | $ T_D_ASN1TEST := [-.test] |
186 | $! | 188 | $! |
187 | $ TCPIP_PROGRAMS = ",," | 189 | $ TCPIP_PROGRAMS = ",," |
diff --git a/src/lib/libssl/test/tests.com b/src/lib/libssl/test/tests.com index 373dd16eac..a840d5078f 100644 --- a/src/lib/libssl/test/tests.com +++ b/src/lib/libssl/test/tests.com | |||
@@ -56,7 +56,7 @@ $ tests := - | |||
56 | test_enc,test_x509,test_rsa,test_crl,test_sid,- | 56 | test_enc,test_x509,test_rsa,test_crl,test_sid,- |
57 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- | 57 | test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- |
58 | test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,- | 58 | test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,- |
59 | test_jpake,test_cms | 59 | test_jpake,test_srp,test_cms |
60 | $ endif | 60 | $ endif |
61 | $ tests = f$edit(tests,"COLLAPSE") | 61 | $ tests = f$edit(tests,"COLLAPSE") |
62 | $ | 62 | $ |
@@ -68,6 +68,8 @@ $ EXPTEST := exptest | |||
68 | $ IDEATEST := ideatest | 68 | $ IDEATEST := ideatest |
69 | $ SHATEST := shatest | 69 | $ SHATEST := shatest |
70 | $ SHA1TEST := sha1test | 70 | $ SHA1TEST := sha1test |
71 | $ SHA256TEST := sha256t | ||
72 | $ SHA512TEST := sha512t | ||
71 | $ MDC2TEST := mdc2test | 73 | $ MDC2TEST := mdc2test |
72 | $ RMDTEST := rmdtest | 74 | $ RMDTEST := rmdtest |
73 | $ MD2TEST := md2test | 75 | $ MD2TEST := md2test |
@@ -91,6 +93,7 @@ $ ENGINETEST := enginetest | |||
91 | $ EVPTEST := evp_test | 93 | $ EVPTEST := evp_test |
92 | $ IGETEST := igetest | 94 | $ IGETEST := igetest |
93 | $ JPAKETEST := jpaketest | 95 | $ JPAKETEST := jpaketest |
96 | $ SRPTEST := srptest | ||
94 | $ ASN1TEST := asn1test | 97 | $ ASN1TEST := asn1test |
95 | $! | 98 | $! |
96 | $ tests_i = 0 | 99 | $ tests_i = 0 |
@@ -114,6 +117,8 @@ $ return | |||
114 | $ test_sha: | 117 | $ test_sha: |
115 | $ mcr 'texe_dir''shatest' | 118 | $ mcr 'texe_dir''shatest' |
116 | $ mcr 'texe_dir''sha1test' | 119 | $ mcr 'texe_dir''sha1test' |
120 | $ mcr 'texe_dir''sha256test' | ||
121 | $ mcr 'texe_dir''sha512test' | ||
117 | $ return | 122 | $ return |
118 | $ test_mdc2: | 123 | $ test_mdc2: |
119 | $ mcr 'texe_dir''mdc2test' | 124 | $ mcr 'texe_dir''mdc2test' |
@@ -357,6 +362,10 @@ $ ! Define the logical name used to find openssl.exe in the perl script. | |||
357 | $ define /user_mode osslx 'exe_dir' | 362 | $ define /user_mode osslx 'exe_dir' |
358 | $ perl CMS-TEST.PL | 363 | $ perl CMS-TEST.PL |
359 | $ return | 364 | $ return |
365 | $ test_srp: | ||
366 | $ write sys$output "Test SRP" | ||
367 | $ mcr 'texe_dir''srptest' | ||
368 | $ return | ||
360 | $ | 369 | $ |
361 | $ | 370 | $ |
362 | $ exit: | 371 | $ exit: |