From rsalz at openssl.org Sat Aug 1 18:32:40 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 01 Aug 2015 18:32:40 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438453960.270715.11084.nullmailer@dev.openssl.org> The branch master has been updated via e36ce2d986a5edbd33d6d176fb95c8046fae9725 (commit) from 34750dc25d74e3db4c1ba43cd219d3f4825e4c65 (commit) - Log ----------------------------------------------------------------- commit e36ce2d986a5edbd33d6d176fb95c8046fae9725 Author: Dirk Wetter Date: Fri Jul 31 13:02:51 2015 -0400 GH336: Return an exit code if report fails Reviewed-by: Richard Levitte ----------------------------------------------------------------------- Summary of changes: util/selftest.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/util/selftest.pl b/util/selftest.pl index 7b32e9f..59842ef 100644 --- a/util/selftest.pl +++ b/util/selftest.pl @@ -199,3 +199,4 @@ while () { } print "\nTest report in file $report\n"; +die if $ok != 2; From rsalz at openssl.org Sat Aug 1 18:33:15 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 01 Aug 2015 18:33:15 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1438453995.849591.12027.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 49cc3f4038d81ffdad95c9e49e72bc497f4d3954 (commit) from a5e26349f73de74019892eb9e592965e633fe7d5 (commit) - Log ----------------------------------------------------------------- commit 49cc3f4038d81ffdad95c9e49e72bc497f4d3954 Author: Dirk Wetter Date: Fri Jul 31 13:02:51 2015 -0400 GH336: Return an exit code if report fails Reviewed-by: Richard Levitte (cherry picked from commit e36ce2d986a5edbd33d6d176fb95c8046fae9725) ----------------------------------------------------------------------- Summary of changes: util/selftest.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/util/selftest.pl b/util/selftest.pl index 7b32e9f..59842ef 100644 --- a/util/selftest.pl +++ b/util/selftest.pl @@ -199,3 +199,4 @@ while () { } print "\nTest report in file $report\n"; +die if $ok != 2; From rsalz at openssl.org Sat Aug 1 18:33:26 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 01 Aug 2015 18:33:26 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_1-stable update Message-ID: <1438454006.017590.12303.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_1-stable has been updated via 556803fc3d0c3a957056665d0eef1c6c80cf556e (commit) from 1a9a506cfbb3a57215dae72aadab8943b977bcf7 (commit) - Log ----------------------------------------------------------------- commit 556803fc3d0c3a957056665d0eef1c6c80cf556e Author: Dirk Wetter Date: Fri Jul 31 13:02:51 2015 -0400 GH336: Return an exit code if report fails Reviewed-by: Richard Levitte (cherry picked from commit e36ce2d986a5edbd33d6d176fb95c8046fae9725) ----------------------------------------------------------------------- Summary of changes: util/selftest.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/util/selftest.pl b/util/selftest.pl index 7b32e9f..59842ef 100644 --- a/util/selftest.pl +++ b/util/selftest.pl @@ -199,3 +199,4 @@ while () { } print "\nTest report in file $report\n"; +die if $ok != 2; From rsalz at openssl.org Sat Aug 1 18:33:39 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 01 Aug 2015 18:33:39 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_0-stable update Message-ID: <1438454019.811748.12581.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_0-stable has been updated via 519bd5013446d511d8d55e6770d1cc2641238da3 (commit) from 895c1b79dd7a76caea46d3185c8c2d3a27506b9d (commit) - Log ----------------------------------------------------------------- commit 519bd5013446d511d8d55e6770d1cc2641238da3 Author: Dirk Wetter Date: Fri Jul 31 13:02:51 2015 -0400 GH336: Return an exit code if report fails Reviewed-by: Richard Levitte (cherry picked from commit e36ce2d986a5edbd33d6d176fb95c8046fae9725) ----------------------------------------------------------------------- Summary of changes: util/selftest.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/util/selftest.pl b/util/selftest.pl index 7b32e9f..59842ef 100644 --- a/util/selftest.pl +++ b/util/selftest.pl @@ -199,3 +199,4 @@ while () { } print "\nTest report in file $report\n"; +die if $ok != 2; From ben at openssl.org Sat Aug 1 21:10:16 2015 From: ben at openssl.org (Ben Laurie) Date: Sat, 01 Aug 2015 21:10:16 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438463416.426965.329.nullmailer@dev.openssl.org> The branch master has been updated via 9e83e6cda97ae9cb3167e5d8548a7ca0b54cc4e6 (commit) from e36ce2d986a5edbd33d6d176fb95c8046fae9725 (commit) - Log ----------------------------------------------------------------- commit 9e83e6cda97ae9cb3167e5d8548a7ca0b54cc4e6 Author: Ben Laurie Date: Sat Aug 1 15:55:19 2015 +0100 Make BSD make happy with subdirectories. Reviewed-by: Richard Levitte ----------------------------------------------------------------------- Summary of changes: ssl/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ssl/Makefile b/ssl/Makefile index d1fc049..973276a 100644 --- a/ssl/Makefile +++ b/ssl/Makefile @@ -45,6 +45,10 @@ HEADER= ssl_locl.h record/record_locl.h record/record.h ALL= $(GENERAL) $(SRC) $(HEADER) +# BSD make and GNU make disagree on where output goes +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ + top: (cd ..; $(MAKE) DIRS=$(DIR) all) From ben at openssl.org Sun Aug 2 06:08:11 2015 From: ben at openssl.org (Ben Laurie) Date: Sun, 02 Aug 2015 06:08:11 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438495691.622632.13532.nullmailer@dev.openssl.org> The branch master has been updated via 480405e4a9a8f791324850c4f6b3d36d4e4de4f9 (commit) via d237a2739c91eb97a7be57989de0a18051f98963 (commit) from 9e83e6cda97ae9cb3167e5d8548a7ca0b54cc4e6 (commit) - Log ----------------------------------------------------------------- commit 480405e4a9a8f791324850c4f6b3d36d4e4de4f9 Author: Ben Laurie Date: Sun Aug 2 02:45:44 2015 +0100 Add -Wconditional-uninitialized to clang strict warnings. Reviewed-by: Rich Salz commit d237a2739c91eb97a7be57989de0a18051f98963 Author: Ben Laurie Date: Sun Aug 2 02:21:46 2015 +0100 Build with --strict-warnings on FreeBSD. Reviewed-by: Rich Salz ----------------------------------------------------------------------- Summary of changes: Configurations/10-main.conf | 2 +- Configure | 4 ++-- apps/s_client.c | 2 +- apps/verify.c | 46 ++++++++++++++++++++++----------------------- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index b5d32b6..15af87e 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -830,7 +830,7 @@ # expands it as -lc_r, which has to be accompanied by explicit # -D_THREAD_SAFE and sometimes -D_REENTRANT. FreeBSD 5.x # expands it as -lc_r, which seems to be sufficient? - cc => "gcc", + cc => "cc", cflags => "-Wall", debug_cflags => "-O0 -g", release_cflags => "-O3", diff --git a/Configure b/Configure index 6cc05bd..fb20e85 100755 --- a/Configure +++ b/Configure @@ -101,13 +101,13 @@ my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare # These are used in addition to $gcc_devteam_warn when the compiler is clang. # TODO(openssl-team): fix problems and investigate if (at least) the -# following warnings can also be enabled: -Wconditional-uninitialized, +# following warnings can also be enabled: # -Wswitch-enum, -Wunused-macros, -Wmissing-field-initializers, # -Wmissing-variable-declarations, # -Wincompatible-pointer-types-discards-qualifiers, -Wcast-align, # -Wunreachable-code -Wunused-parameter -Wlanguage-extension-token # -Wextended-offsetof -my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof"; +my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Wconditional-uninitialized -Qunused-arguments"; my $strict_warnings = 0; diff --git a/apps/s_client.c b/apps/s_client.c index f4132c8..5971f8a 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -656,7 +656,7 @@ int s_client_main(int argc, char **argv) int prexit = 0; int enable_timeouts = 0, sdebug = 0, peerlen = sizeof peer; int reconnect = 0, verify = SSL_VERIFY_NONE, vpmtouched = 0; - int ret = 1, in_init = 1, i, nbio_test = 0, s, k, width, state = 0; + int ret = 1, in_init = 1, i, nbio_test = 0, s = -1, k, width, state = 0; int sbuf_len, sbuf_off, socket_type = SOCK_STREAM, cmdletters = 1; int starttls_proto = PROTO_OFF, crl_format = FORMAT_PEM, crl_download = 0; int write_tty, read_tty, write_ssl, read_ssl, tty_on, ssl_pending; diff --git a/apps/verify.c b/apps/verify.c index 7fcd32a..8abc708 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -272,37 +272,35 @@ static int check(X509_STORE *ctx, char *file, if (crls) X509_STORE_CTX_set0_crls(csc, crls); i = X509_verify_cert(csc); - if (i > 0 && show_chain) { - chain = X509_STORE_CTX_get1_chain(csc); - num_untrusted = X509_STORE_CTX_get_num_untrusted(csc); + if (i > 0) { + printf("OK\n"); + ret = 1; + if (show_chain) { + chain = X509_STORE_CTX_get1_chain(csc); + num_untrusted = X509_STORE_CTX_get_num_untrusted(csc); + printf("Chain:\n"); + for (i = 0; i < sk_X509_num(chain); i++) { + X509 *cert = sk_X509_value(chain, i); + printf("depth=%d: ", i); + X509_NAME_print_ex_fp(stdout, + X509_get_subject_name(cert), + 0, XN_FLAG_ONELINE); + if (i < num_untrusted) + printf(" (untrusted)"); + printf("\n"); + } + sk_X509_pop_free(chain, X509_free); + } } X509_STORE_CTX_free(csc); ret = 0; end: - if (i > 0) { - printf("OK\n"); - ret = 1; - } else - ERR_print_errors(bio_err); - if (chain) { - printf("Chain:\n"); - for (i = 0; i < sk_X509_num(chain); i++) { - X509 *cert = sk_X509_value(chain, i); - printf("depth=%d: ", i); - X509_NAME_print_ex_fp(stdout, - X509_get_subject_name(cert), - 0, XN_FLAG_ONELINE); - if (i < num_untrusted) { - printf(" (untrusted)"); - } - printf("\n"); - } - sk_X509_pop_free(chain, X509_free); - } + if (i <= 0) + ERR_print_errors(bio_err); X509_free(x); - return (ret); + return ret; } static int cb(int ok, X509_STORE_CTX *ctx) From steve at openssl.org Sun Aug 2 13:49:20 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Sun, 02 Aug 2015 13:49:20 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438523360.630756.8048.nullmailer@dev.openssl.org> The branch master has been updated via 5a168057bc1cdf4151226545c4f2ed4d4ad9622b (commit) from 480405e4a9a8f791324850c4f6b3d36d4e4de4f9 (commit) - Log ----------------------------------------------------------------- commit 5a168057bc1cdf4151226545c4f2ed4d4ad9622b Author: Dr. Stephen Henson Date: Sun Aug 2 14:28:50 2015 +0100 don't reset return value to 0 Reviewed-by: Richard Levitte ----------------------------------------------------------------------- Summary of changes: apps/verify.c | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/verify.c b/apps/verify.c index 8abc708..740dae2 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -294,7 +294,6 @@ static int check(X509_STORE *ctx, char *file, } X509_STORE_CTX_free(csc); - ret = 0; end: if (i <= 0) ERR_print_errors(bio_err); From ben at openssl.org Sun Aug 2 17:58:49 2015 From: ben at openssl.org (Ben Laurie) Date: Sun, 02 Aug 2015 17:58:49 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438538329.111187.14130.nullmailer@dev.openssl.org> The branch master has been updated via bb484020c3f22bcb76cc3d18b5965c8b132770dc (commit) from 5a168057bc1cdf4151226545c4f2ed4d4ad9622b (commit) - Log ----------------------------------------------------------------- commit bb484020c3f22bcb76cc3d18b5965c8b132770dc Author: Ben Laurie Date: Sun Aug 2 16:04:27 2015 +0100 Fix refactoring breakage. Reviewed-by: Rich Salz ----------------------------------------------------------------------- Summary of changes: apps/verify.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/verify.c b/apps/verify.c index 740dae2..ce0ad24 100644 --- a/apps/verify.c +++ b/apps/verify.c @@ -276,16 +276,18 @@ static int check(X509_STORE *ctx, char *file, printf("OK\n"); ret = 1; if (show_chain) { + int j; + chain = X509_STORE_CTX_get1_chain(csc); num_untrusted = X509_STORE_CTX_get_num_untrusted(csc); printf("Chain:\n"); - for (i = 0; i < sk_X509_num(chain); i++) { - X509 *cert = sk_X509_value(chain, i); - printf("depth=%d: ", i); + for (j = 0; j < sk_X509_num(chain); j++) { + X509 *cert = sk_X509_value(chain, j); + printf("depth=%d: ", j); X509_NAME_print_ex_fp(stdout, X509_get_subject_name(cert), 0, XN_FLAG_ONELINE); - if (i < num_untrusted) + if (j < num_untrusted) printf(" (untrusted)"); printf("\n"); } From matt at openssl.org Mon Aug 3 10:02:57 2015 From: matt at openssl.org (Matt Caswell) Date: Mon, 03 Aug 2015 10:02:57 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438596177.695684.24637.nullmailer@dev.openssl.org> The branch master has been updated via 9ceb2426b0a7972434a49a34e78bdcc6437e04ad (commit) via 6fc2ef20a92a318aa5aacf9c907fa70df98f6a41 (commit) via 7e729bb5a3ff1b940061045d1f83b7fc01d32b4b (commit) from bb484020c3f22bcb76cc3d18b5965c8b132770dc (commit) - Log ----------------------------------------------------------------- commit 9ceb2426b0a7972434a49a34e78bdcc6437e04ad Author: Matt Caswell Date: Thu Apr 16 10:06:25 2015 +0100 PACKETise ClientHello processing Uses the new PACKET code to process the incoming ClientHello including all extensions etc. Reviewed-by: Tim Hudson commit 6fc2ef20a92a318aa5aacf9c907fa70df98f6a41 Author: Matt Caswell Date: Fri Apr 17 16:10:23 2015 +0100 PACKET unit tests Add some unit tests for the new PACKET API Reviewed-by: Tim Hudson commit 7e729bb5a3ff1b940061045d1f83b7fc01d32b4b Author: Matt Caswell Date: Tue Apr 14 17:01:29 2015 +0100 Add initial packet parsing code Provide more robust (inline) functions to replace n2s, n2l, etc. These functions do the same thing as the previous macros, but also keep track of the amount of data remaining and return an error if we try to read more data than we've got. Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: ssl/Makefile | 1246 +++++++++++++++++++++++++++-------------------------- ssl/d1_srtp.c | 57 +-- ssl/packet_locl.h | 394 +++++++++++++++++ ssl/s3_srvr.c | 169 ++++---- ssl/ssl_locl.h | 18 +- ssl/ssl_sess.c | 11 +- ssl/t1_lib.c | 407 +++++++++-------- ssl/t1_reneg.c | 19 +- test/Makefile | 49 ++- test/packettest.c | 317 ++++++++++++++ 10 files changed, 1730 insertions(+), 957 deletions(-) create mode 100644 ssl/packet_locl.h create mode 100644 test/packettest.c diff --git a/ssl/Makefile b/ssl/Makefile index 973276a..b8ae9c3 100644 --- a/ssl/Makefile +++ b/ssl/Makefile @@ -95,43 +95,45 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. bio_ssl.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -bio_ssl.o: ../include/openssl/buffer.h ../include/openssl/comp.h -bio_ssl.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -bio_ssl.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -bio_ssl.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -bio_ssl.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -bio_ssl.o: ../include/openssl/evp.h ../include/openssl/hmac.h -bio_ssl.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -bio_ssl.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -bio_ssl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -bio_ssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h -bio_ssl.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -bio_ssl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -bio_ssl.o: ../include/openssl/sha.h ../include/openssl/srtp.h -bio_ssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -bio_ssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -bio_ssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -bio_ssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bio_ssl.c +bio_ssl.o: ../include/openssl/bn.h ../include/openssl/buffer.h +bio_ssl.o: ../include/openssl/comp.h ../include/openssl/crypto.h +bio_ssl.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +bio_ssl.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +bio_ssl.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +bio_ssl.o: ../include/openssl/err.h ../include/openssl/evp.h +bio_ssl.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +bio_ssl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +bio_ssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +bio_ssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +bio_ssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +bio_ssl.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +bio_ssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h +bio_ssl.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +bio_ssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +bio_ssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +bio_ssl.o: ../include/openssl/tls1.h ../include/openssl/x509.h +bio_ssl.o: ../include/openssl/x509_vfy.h bio_ssl.c packet_locl.h bio_ssl.o: record/record.h ssl_locl.h d1_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -d1_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h -d1_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -d1_both.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -d1_both.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -d1_both.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -d1_both.o: ../include/openssl/evp.h ../include/openssl/hmac.h -d1_both.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -d1_both.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -d1_both.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -d1_both.o: ../include/openssl/pem.h ../include/openssl/pem2.h -d1_both.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -d1_both.o: ../include/openssl/rand.h ../include/openssl/rsa.h -d1_both.o: ../include/openssl/safestack.h ../include/openssl/sha.h -d1_both.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -d1_both.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -d1_both.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -d1_both.o: ../include/openssl/tls1.h ../include/openssl/x509.h -d1_both.o: ../include/openssl/x509_vfy.h d1_both.c record/record.h ssl_locl.h +d1_both.o: ../include/openssl/bn.h ../include/openssl/buffer.h +d1_both.o: ../include/openssl/comp.h ../include/openssl/crypto.h +d1_both.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +d1_both.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +d1_both.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +d1_both.o: ../include/openssl/err.h ../include/openssl/evp.h +d1_both.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +d1_both.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +d1_both.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +d1_both.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +d1_both.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +d1_both.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +d1_both.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +d1_both.o: ../include/openssl/sha.h ../include/openssl/srtp.h +d1_both.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +d1_both.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +d1_both.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +d1_both.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_both.c +d1_both.o: packet_locl.h record/record.h ssl_locl.h d1_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h d1_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h d1_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h @@ -152,82 +154,86 @@ d1_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h d1_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h d1_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h d1_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_clnt.c -d1_clnt.o: record/record.h ssl_locl.h +d1_clnt.o: packet_locl.h record/record.h ssl_locl.h d1_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -d1_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h -d1_lib.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -d1_lib.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -d1_lib.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -d1_lib.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -d1_lib.o: ../include/openssl/evp.h ../include/openssl/hmac.h -d1_lib.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -d1_lib.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -d1_lib.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -d1_lib.o: ../include/openssl/pem.h ../include/openssl/pem2.h -d1_lib.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -d1_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -d1_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h -d1_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -d1_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -d1_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -d1_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_lib.c -d1_lib.o: record/record.h ssl_locl.h +d1_lib.o: ../include/openssl/bn.h ../include/openssl/buffer.h +d1_lib.o: ../include/openssl/comp.h ../include/openssl/crypto.h +d1_lib.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +d1_lib.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +d1_lib.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +d1_lib.o: ../include/openssl/err.h ../include/openssl/evp.h +d1_lib.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +d1_lib.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +d1_lib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +d1_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +d1_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +d1_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +d1_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h +d1_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +d1_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +d1_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +d1_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h +d1_lib.o: ../include/openssl/x509_vfy.h d1_lib.c packet_locl.h record/record.h +d1_lib.o: ssl_locl.h d1_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -d1_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h -d1_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -d1_meth.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -d1_meth.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -d1_meth.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -d1_meth.o: ../include/openssl/evp.h ../include/openssl/hmac.h -d1_meth.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -d1_meth.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -d1_meth.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -d1_meth.o: ../include/openssl/pem.h ../include/openssl/pem2.h -d1_meth.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -d1_meth.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -d1_meth.o: ../include/openssl/sha.h ../include/openssl/srtp.h -d1_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -d1_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -d1_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -d1_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_meth.c +d1_meth.o: ../include/openssl/bn.h ../include/openssl/buffer.h +d1_meth.o: ../include/openssl/comp.h ../include/openssl/crypto.h +d1_meth.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +d1_meth.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +d1_meth.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +d1_meth.o: ../include/openssl/err.h ../include/openssl/evp.h +d1_meth.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +d1_meth.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +d1_meth.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +d1_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +d1_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +d1_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +d1_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h +d1_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +d1_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +d1_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +d1_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h +d1_meth.o: ../include/openssl/x509_vfy.h d1_meth.c packet_locl.h d1_meth.o: record/record.h ssl_locl.h d1_msg.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -d1_msg.o: ../include/openssl/buffer.h ../include/openssl/comp.h -d1_msg.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -d1_msg.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -d1_msg.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -d1_msg.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -d1_msg.o: ../include/openssl/evp.h ../include/openssl/hmac.h -d1_msg.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -d1_msg.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -d1_msg.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -d1_msg.o: ../include/openssl/pem.h ../include/openssl/pem2.h -d1_msg.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -d1_msg.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -d1_msg.o: ../include/openssl/sha.h ../include/openssl/srtp.h -d1_msg.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -d1_msg.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -d1_msg.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -d1_msg.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_msg.c -d1_msg.o: record/record.h ssl_locl.h +d1_msg.o: ../include/openssl/bn.h ../include/openssl/buffer.h +d1_msg.o: ../include/openssl/comp.h ../include/openssl/crypto.h +d1_msg.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +d1_msg.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +d1_msg.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +d1_msg.o: ../include/openssl/err.h ../include/openssl/evp.h +d1_msg.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +d1_msg.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +d1_msg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +d1_msg.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +d1_msg.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +d1_msg.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +d1_msg.o: ../include/openssl/safestack.h ../include/openssl/sha.h +d1_msg.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +d1_msg.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +d1_msg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +d1_msg.o: ../include/openssl/tls1.h ../include/openssl/x509.h +d1_msg.o: ../include/openssl/x509_vfy.h d1_msg.c packet_locl.h record/record.h +d1_msg.o: ssl_locl.h d1_srtp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -d1_srtp.o: ../include/openssl/buffer.h ../include/openssl/comp.h -d1_srtp.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -d1_srtp.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -d1_srtp.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -d1_srtp.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -d1_srtp.o: ../include/openssl/evp.h ../include/openssl/hmac.h -d1_srtp.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -d1_srtp.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -d1_srtp.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -d1_srtp.o: ../include/openssl/pem.h ../include/openssl/pem2.h -d1_srtp.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -d1_srtp.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -d1_srtp.o: ../include/openssl/sha.h ../include/openssl/srtp.h -d1_srtp.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -d1_srtp.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -d1_srtp.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -d1_srtp.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_srtp.c +d1_srtp.o: ../include/openssl/bn.h ../include/openssl/buffer.h +d1_srtp.o: ../include/openssl/comp.h ../include/openssl/crypto.h +d1_srtp.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +d1_srtp.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +d1_srtp.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +d1_srtp.o: ../include/openssl/err.h ../include/openssl/evp.h +d1_srtp.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +d1_srtp.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +d1_srtp.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +d1_srtp.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +d1_srtp.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +d1_srtp.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +d1_srtp.o: ../include/openssl/safestack.h ../include/openssl/sha.h +d1_srtp.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +d1_srtp.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +d1_srtp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +d1_srtp.o: ../include/openssl/tls1.h ../include/openssl/x509.h +d1_srtp.o: ../include/openssl/x509_vfy.h d1_srtp.c packet_locl.h d1_srtp.o: record/record.h ssl_locl.h d1_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h d1_srvr.o: ../include/openssl/bn.h ../include/openssl/buffer.h @@ -249,108 +255,113 @@ d1_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h d1_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h d1_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h d1_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h d1_srvr.c -d1_srvr.o: record/record.h ssl_locl.h +d1_srvr.o: packet_locl.h record/record.h ssl_locl.h dtls1_bitmap.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -dtls1_bitmap.o: ../include/openssl/buffer.h ../include/openssl/comp.h -dtls1_bitmap.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -dtls1_bitmap.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -dtls1_bitmap.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -dtls1_bitmap.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -dtls1_bitmap.o: ../include/openssl/evp.h ../include/openssl/hmac.h -dtls1_bitmap.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -dtls1_bitmap.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -dtls1_bitmap.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -dtls1_bitmap.o: ../include/openssl/pem.h ../include/openssl/pem2.h -dtls1_bitmap.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -dtls1_bitmap.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -dtls1_bitmap.o: ../include/openssl/sha.h ../include/openssl/srtp.h -dtls1_bitmap.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -dtls1_bitmap.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -dtls1_bitmap.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -dtls1_bitmap.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -dtls1_bitmap.o: dtls1_bitmap.c record/../record/record.h record/../ssl_locl.h -dtls1_bitmap.o: record/dtls1_bitmap.c record/record_locl.h +dtls1_bitmap.o: ../include/openssl/bn.h ../include/openssl/buffer.h +dtls1_bitmap.o: ../include/openssl/comp.h ../include/openssl/crypto.h +dtls1_bitmap.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +dtls1_bitmap.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +dtls1_bitmap.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +dtls1_bitmap.o: ../include/openssl/err.h ../include/openssl/evp.h +dtls1_bitmap.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +dtls1_bitmap.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +dtls1_bitmap.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dtls1_bitmap.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +dtls1_bitmap.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +dtls1_bitmap.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +dtls1_bitmap.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dtls1_bitmap.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +dtls1_bitmap.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +dtls1_bitmap.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +dtls1_bitmap.o: ../include/openssl/tls1.h ../include/openssl/x509.h +dtls1_bitmap.o: ../include/openssl/x509_vfy.h dtls1_bitmap.c +dtls1_bitmap.o: record/../packet_locl.h record/../record/record.h +dtls1_bitmap.o: record/../ssl_locl.h record/dtls1_bitmap.c record/record_locl.h rec_layer_d1.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -rec_layer_d1.o: ../include/openssl/buffer.h ../include/openssl/comp.h -rec_layer_d1.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -rec_layer_d1.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -rec_layer_d1.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -rec_layer_d1.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -rec_layer_d1.o: ../include/openssl/evp.h ../include/openssl/hmac.h -rec_layer_d1.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -rec_layer_d1.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -rec_layer_d1.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -rec_layer_d1.o: ../include/openssl/pem.h ../include/openssl/pem2.h -rec_layer_d1.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -rec_layer_d1.o: ../include/openssl/rand.h ../include/openssl/rsa.h -rec_layer_d1.o: ../include/openssl/safestack.h ../include/openssl/sha.h -rec_layer_d1.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -rec_layer_d1.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -rec_layer_d1.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -rec_layer_d1.o: ../include/openssl/tls1.h ../include/openssl/x509.h -rec_layer_d1.o: ../include/openssl/x509_vfy.h rec_layer_d1.c +rec_layer_d1.o: ../include/openssl/bn.h ../include/openssl/buffer.h +rec_layer_d1.o: ../include/openssl/comp.h ../include/openssl/crypto.h +rec_layer_d1.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +rec_layer_d1.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +rec_layer_d1.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +rec_layer_d1.o: ../include/openssl/err.h ../include/openssl/evp.h +rec_layer_d1.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +rec_layer_d1.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +rec_layer_d1.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +rec_layer_d1.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +rec_layer_d1.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +rec_layer_d1.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +rec_layer_d1.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +rec_layer_d1.o: ../include/openssl/sha.h ../include/openssl/srtp.h +rec_layer_d1.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +rec_layer_d1.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +rec_layer_d1.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +rec_layer_d1.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +rec_layer_d1.o: rec_layer_d1.c record/../packet_locl.h rec_layer_d1.o: record/../record/record.h record/../ssl_locl.h rec_layer_d1.o: record/rec_layer_d1.c record/record_locl.h rec_layer_s3.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -rec_layer_s3.o: ../include/openssl/buffer.h ../include/openssl/comp.h -rec_layer_s3.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -rec_layer_s3.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -rec_layer_s3.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -rec_layer_s3.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -rec_layer_s3.o: ../include/openssl/evp.h ../include/openssl/hmac.h -rec_layer_s3.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -rec_layer_s3.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -rec_layer_s3.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -rec_layer_s3.o: ../include/openssl/pem.h ../include/openssl/pem2.h -rec_layer_s3.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -rec_layer_s3.o: ../include/openssl/rand.h ../include/openssl/rsa.h -rec_layer_s3.o: ../include/openssl/safestack.h ../include/openssl/sha.h -rec_layer_s3.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -rec_layer_s3.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -rec_layer_s3.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -rec_layer_s3.o: ../include/openssl/tls1.h ../include/openssl/x509.h -rec_layer_s3.o: ../include/openssl/x509_vfy.h rec_layer_s3.c +rec_layer_s3.o: ../include/openssl/bn.h ../include/openssl/buffer.h +rec_layer_s3.o: ../include/openssl/comp.h ../include/openssl/crypto.h +rec_layer_s3.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +rec_layer_s3.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +rec_layer_s3.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +rec_layer_s3.o: ../include/openssl/err.h ../include/openssl/evp.h +rec_layer_s3.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +rec_layer_s3.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +rec_layer_s3.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +rec_layer_s3.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +rec_layer_s3.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +rec_layer_s3.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +rec_layer_s3.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +rec_layer_s3.o: ../include/openssl/sha.h ../include/openssl/srtp.h +rec_layer_s3.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +rec_layer_s3.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +rec_layer_s3.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +rec_layer_s3.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +rec_layer_s3.o: rec_layer_s3.c record/../packet_locl.h rec_layer_s3.o: record/../record/record.h record/../ssl_locl.h rec_layer_s3.o: record/rec_layer_s3.c record/record_locl.h s3_both.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -s3_both.o: ../include/openssl/buffer.h ../include/openssl/comp.h -s3_both.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -s3_both.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -s3_both.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -s3_both.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -s3_both.o: ../include/openssl/evp.h ../include/openssl/hmac.h -s3_both.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -s3_both.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -s3_both.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -s3_both.o: ../include/openssl/pem.h ../include/openssl/pem2.h -s3_both.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -s3_both.o: ../include/openssl/rand.h ../include/openssl/rsa.h -s3_both.o: ../include/openssl/safestack.h ../include/openssl/sha.h -s3_both.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -s3_both.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -s3_both.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -s3_both.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s3_both.o: ../include/openssl/x509_vfy.h record/record.h s3_both.c ssl_locl.h +s3_both.o: ../include/openssl/bn.h ../include/openssl/buffer.h +s3_both.o: ../include/openssl/comp.h ../include/openssl/crypto.h +s3_both.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +s3_both.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +s3_both.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +s3_both.o: ../include/openssl/err.h ../include/openssl/evp.h +s3_both.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +s3_both.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +s3_both.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +s3_both.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +s3_both.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +s3_both.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +s3_both.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +s3_both.o: ../include/openssl/sha.h ../include/openssl/srtp.h +s3_both.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +s3_both.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +s3_both.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +s3_both.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +s3_both.o: packet_locl.h record/record.h s3_both.c ssl_locl.h s3_cbc.o: ../e_os.h ../include/internal/constant_time_locl.h s3_cbc.o: ../include/openssl/asn1.h ../include/openssl/bio.h -s3_cbc.o: ../include/openssl/buffer.h ../include/openssl/comp.h -s3_cbc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -s3_cbc.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -s3_cbc.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -s3_cbc.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -s3_cbc.o: ../include/openssl/evp.h ../include/openssl/hmac.h -s3_cbc.o: ../include/openssl/lhash.h ../include/openssl/md5.h -s3_cbc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -s3_cbc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -s3_cbc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -s3_cbc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -s3_cbc.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h -s3_cbc.o: ../include/openssl/safestack.h ../include/openssl/sha.h -s3_cbc.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -s3_cbc.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -s3_cbc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -s3_cbc.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s3_cbc.o: ../include/openssl/x509_vfy.h record/record.h s3_cbc.c ssl_locl.h +s3_cbc.o: ../include/openssl/bn.h ../include/openssl/buffer.h +s3_cbc.o: ../include/openssl/comp.h ../include/openssl/crypto.h +s3_cbc.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +s3_cbc.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +s3_cbc.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +s3_cbc.o: ../include/openssl/err.h ../include/openssl/evp.h +s3_cbc.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +s3_cbc.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h +s3_cbc.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +s3_cbc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +s3_cbc.o: ../include/openssl/pem.h ../include/openssl/pem2.h +s3_cbc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +s3_cbc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +s3_cbc.o: ../include/openssl/sha.h ../include/openssl/srtp.h +s3_cbc.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +s3_cbc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +s3_cbc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +s3_cbc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h packet_locl.h +s3_cbc.o: record/record.h s3_cbc.c ssl_locl.h s3_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h s3_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h s3_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h @@ -371,65 +382,69 @@ s3_clnt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h s3_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h s3_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h s3_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s3_clnt.o: ../include/openssl/x509_vfy.h record/record.h s3_clnt.c ssl_locl.h +s3_clnt.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +s3_clnt.o: s3_clnt.c ssl_locl.h s3_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -s3_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h -s3_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -s3_enc.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -s3_enc.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -s3_enc.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -s3_enc.o: ../include/openssl/evp.h ../include/openssl/hmac.h -s3_enc.o: ../include/openssl/lhash.h ../include/openssl/md5.h -s3_enc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -s3_enc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -s3_enc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -s3_enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -s3_enc.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h -s3_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h -s3_enc.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -s3_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -s3_enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -s3_enc.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s3_enc.o: ../include/openssl/x509_vfy.h record/record.h s3_enc.c ssl_locl.h +s3_enc.o: ../include/openssl/bn.h ../include/openssl/buffer.h +s3_enc.o: ../include/openssl/comp.h ../include/openssl/crypto.h +s3_enc.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +s3_enc.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +s3_enc.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +s3_enc.o: ../include/openssl/err.h ../include/openssl/evp.h +s3_enc.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +s3_enc.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h +s3_enc.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +s3_enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +s3_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h +s3_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +s3_enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +s3_enc.o: ../include/openssl/sha.h ../include/openssl/srtp.h +s3_enc.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +s3_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +s3_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +s3_enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h packet_locl.h +s3_enc.o: record/record.h s3_enc.c ssl_locl.h s3_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -s3_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h -s3_lib.o: ../include/openssl/crypto.h ../include/openssl/dh.h -s3_lib.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h -s3_lib.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -s3_lib.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -s3_lib.o: ../include/openssl/err.h ../include/openssl/evp.h -s3_lib.o: ../include/openssl/hmac.h ../include/openssl/lhash.h -s3_lib.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h -s3_lib.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -s3_lib.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -s3_lib.o: ../include/openssl/pem.h ../include/openssl/pem2.h -s3_lib.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -s3_lib.o: ../include/openssl/rand.h ../include/openssl/rsa.h -s3_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h -s3_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -s3_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -s3_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -s3_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s3_lib.o: ../include/openssl/x509_vfy.h record/record.h s3_lib.c ssl_locl.h +s3_lib.o: ../include/openssl/bn.h ../include/openssl/buffer.h +s3_lib.o: ../include/openssl/comp.h ../include/openssl/crypto.h +s3_lib.o: ../include/openssl/dh.h ../include/openssl/dsa.h +s3_lib.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h +s3_lib.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +s3_lib.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +s3_lib.o: ../include/openssl/evp.h ../include/openssl/hmac.h +s3_lib.o: ../include/openssl/lhash.h ../include/openssl/md5.h +s3_lib.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +s3_lib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +s3_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +s3_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +s3_lib.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +s3_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +s3_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h +s3_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +s3_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +s3_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +s3_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h packet_locl.h +s3_lib.o: record/record.h s3_lib.c ssl_locl.h s3_msg.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -s3_msg.o: ../include/openssl/buffer.h ../include/openssl/comp.h -s3_msg.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -s3_msg.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -s3_msg.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -s3_msg.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -s3_msg.o: ../include/openssl/evp.h ../include/openssl/hmac.h -s3_msg.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -s3_msg.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -s3_msg.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -s3_msg.o: ../include/openssl/pem.h ../include/openssl/pem2.h -s3_msg.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -s3_msg.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -s3_msg.o: ../include/openssl/sha.h ../include/openssl/srtp.h -s3_msg.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -s3_msg.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -s3_msg.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -s3_msg.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -s3_msg.o: record/record.h s3_msg.c ssl_locl.h +s3_msg.o: ../include/openssl/bn.h ../include/openssl/buffer.h +s3_msg.o: ../include/openssl/comp.h ../include/openssl/crypto.h +s3_msg.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +s3_msg.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +s3_msg.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +s3_msg.o: ../include/openssl/err.h ../include/openssl/evp.h +s3_msg.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +s3_msg.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +s3_msg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +s3_msg.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +s3_msg.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +s3_msg.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +s3_msg.o: ../include/openssl/safestack.h ../include/openssl/sha.h +s3_msg.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +s3_msg.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +s3_msg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +s3_msg.o: ../include/openssl/tls1.h ../include/openssl/x509.h +s3_msg.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h s3_msg.c +s3_msg.o: ssl_locl.h s3_srvr.o: ../e_os.h ../include/internal/constant_time_locl.h s3_srvr.o: ../include/openssl/asn1.h ../include/openssl/bio.h s3_srvr.o: ../include/openssl/bn.h ../include/openssl/buffer.h @@ -451,87 +466,91 @@ s3_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h s3_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h s3_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h s3_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -s3_srvr.o: record/record.h s3_srvr.c ssl_locl.h +s3_srvr.o: packet_locl.h record/record.h s3_srvr.c ssl_locl.h ssl3_buffer.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl3_buffer.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl3_buffer.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl3_buffer.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl3_buffer.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl3_buffer.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl3_buffer.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl3_buffer.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl3_buffer.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl3_buffer.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl3_buffer.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl3_buffer.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl3_buffer.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl3_buffer.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl3_buffer.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl3_buffer.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl3_buffer.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl3_buffer.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ssl3_buffer.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl3_buffer.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl3_buffer.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl3_buffer.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl3_buffer.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl3_buffer.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl3_buffer.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl3_buffer.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl3_buffer.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl3_buffer.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl3_buffer.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl3_buffer.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl3_buffer.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl3_buffer.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl3_buffer.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl3_buffer.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl3_buffer.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl3_buffer.o: ../include/openssl/x509_vfy.h record/../packet_locl.h ssl3_buffer.o: record/../record/record.h record/../ssl_locl.h ssl3_buffer.o: record/record_locl.h record/ssl3_buffer.c ssl3_buffer.c ssl3_record.o: ../e_os.h ../include/internal/constant_time_locl.h ssl3_record.o: ../include/openssl/asn1.h ../include/openssl/bio.h -ssl3_record.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl3_record.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl3_record.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl3_record.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl3_record.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl3_record.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl3_record.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl3_record.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl3_record.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl3_record.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl3_record.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl3_record.o: ../include/openssl/rand.h ../include/openssl/rsa.h -ssl3_record.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ssl3_record.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -ssl3_record.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -ssl3_record.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ssl3_record.o: ../include/openssl/tls1.h ../include/openssl/x509.h -ssl3_record.o: ../include/openssl/x509_vfy.h record/../record/record.h +ssl3_record.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl3_record.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl3_record.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl3_record.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl3_record.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl3_record.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl3_record.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl3_record.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl3_record.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl3_record.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl3_record.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl3_record.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +ssl3_record.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +ssl3_record.o: ../include/openssl/sha.h ../include/openssl/srtp.h +ssl3_record.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ssl3_record.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ssl3_record.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ssl3_record.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ssl3_record.o: record/../packet_locl.h record/../record/record.h ssl3_record.o: record/../ssl_locl.h record/record_locl.h record/ssl3_record.c ssl3_record.o: ssl3_record.c ssl_algs.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_algs.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_algs.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_algs.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_algs.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_algs.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl_algs.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl_algs.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl_algs.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl_algs.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_algs.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_algs.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_algs.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_algs.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_algs.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_algs.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_algs.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_algs.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_algs.o: record/record.h ssl_algs.c ssl_locl.h +ssl_algs.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_algs.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_algs.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_algs.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_algs.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_algs.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl_algs.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl_algs.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl_algs.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_algs.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_algs.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_algs.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl_algs.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_algs.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_algs.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_algs.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_algs.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_algs.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_algs.o: ssl_algs.c ssl_locl.h ssl_asn1.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/asn1t.h -ssl_asn1.o: ../include/openssl/bio.h ../include/openssl/buffer.h -ssl_asn1.o: ../include/openssl/comp.h ../include/openssl/crypto.h -ssl_asn1.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h -ssl_asn1.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -ssl_asn1.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -ssl_asn1.o: ../include/openssl/err.h ../include/openssl/evp.h -ssl_asn1.o: ../include/openssl/hmac.h ../include/openssl/lhash.h -ssl_asn1.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ssl_asn1.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ssl_asn1.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ssl_asn1.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ssl_asn1.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h -ssl_asn1.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ssl_asn1.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -ssl_asn1.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -ssl_asn1.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ssl_asn1.o: ../include/openssl/tls1.h ../include/openssl/x509.h -ssl_asn1.o: ../include/openssl/x509_vfy.h record/record.h ssl_asn1.c ssl_locl.h +ssl_asn1.o: ../include/openssl/bio.h ../include/openssl/bn.h +ssl_asn1.o: ../include/openssl/buffer.h ../include/openssl/comp.h +ssl_asn1.o: ../include/openssl/crypto.h ../include/openssl/dsa.h +ssl_asn1.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h +ssl_asn1.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +ssl_asn1.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +ssl_asn1.o: ../include/openssl/evp.h ../include/openssl/hmac.h +ssl_asn1.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ssl_asn1.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +ssl_asn1.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ssl_asn1.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ssl_asn1.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +ssl_asn1.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +ssl_asn1.o: ../include/openssl/sha.h ../include/openssl/srtp.h +ssl_asn1.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ssl_asn1.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ssl_asn1.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ssl_asn1.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ssl_asn1.o: packet_locl.h record/record.h ssl_asn1.c ssl_locl.h ssl_cert.o: ../e_os.h ../include/internal/o_dir.h ../include/openssl/asn1.h ssl_cert.o: ../include/openssl/bio.h ../include/openssl/bn.h ssl_cert.o: ../include/openssl/buffer.h ../include/openssl/comp.h @@ -552,46 +571,49 @@ ssl_cert.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h ssl_cert.o: ../include/openssl/ssl3.h ../include/openssl/stack.h ssl_cert.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h ssl_cert.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_cert.o: ../include/openssl/x509v3.h record/record.h ssl_cert.c ssl_locl.h +ssl_cert.o: ../include/openssl/x509v3.h packet_locl.h record/record.h +ssl_cert.o: ssl_cert.c ssl_locl.h ssl_ciph.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_ciph.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_ciph.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_ciph.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_ciph.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_ciph.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ssl_ciph.o: ../include/openssl/err.h ../include/openssl/evp.h -ssl_ciph.o: ../include/openssl/hmac.h ../include/openssl/lhash.h -ssl_ciph.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ssl_ciph.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ssl_ciph.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ssl_ciph.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ssl_ciph.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h -ssl_ciph.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ssl_ciph.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -ssl_ciph.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -ssl_ciph.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ssl_ciph.o: ../include/openssl/tls1.h ../include/openssl/x509.h -ssl_ciph.o: ../include/openssl/x509_vfy.h record/record.h ssl_ciph.c ssl_locl.h +ssl_ciph.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_ciph.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_ciph.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_ciph.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_ciph.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_ciph.o: ../include/openssl/engine.h ../include/openssl/err.h +ssl_ciph.o: ../include/openssl/evp.h ../include/openssl/hmac.h +ssl_ciph.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ssl_ciph.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +ssl_ciph.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ssl_ciph.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ssl_ciph.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +ssl_ciph.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +ssl_ciph.o: ../include/openssl/sha.h ../include/openssl/srtp.h +ssl_ciph.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ssl_ciph.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ssl_ciph.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ssl_ciph.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ssl_ciph.o: packet_locl.h record/record.h ssl_ciph.c ssl_locl.h ssl_conf.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_conf.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_conf.o: ../include/openssl/conf.h ../include/openssl/crypto.h -ssl_conf.o: ../include/openssl/dh.h ../include/openssl/dsa.h -ssl_conf.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_conf.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_conf.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl_conf.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl_conf.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl_conf.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl_conf.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_conf.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_conf.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_conf.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_conf.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_conf.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_conf.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_conf.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_conf.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_conf.o: record/record.h ssl_conf.c ssl_locl.h +ssl_conf.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_conf.o: ../include/openssl/comp.h ../include/openssl/conf.h +ssl_conf.o: ../include/openssl/crypto.h ../include/openssl/dh.h +ssl_conf.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_conf.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_conf.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_conf.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl_conf.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl_conf.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl_conf.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_conf.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_conf.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_conf.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl_conf.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_conf.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_conf.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_conf.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_conf.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_conf.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_conf.o: ssl_conf.c ssl_locl.h ssl_err.o: ../include/openssl/asn1.h ../include/openssl/bio.h ssl_err.o: ../include/openssl/buffer.h ../include/openssl/comp.h ssl_err.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h @@ -627,181 +649,190 @@ ssl_err2.o: ../include/openssl/stack.h ../include/openssl/symhacks.h ssl_err2.o: ../include/openssl/tls1.h ../include/openssl/x509.h ssl_err2.o: ../include/openssl/x509_vfy.h ssl_err2.c ssl_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_lib.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_lib.o: ../include/openssl/conf.h ../include/openssl/crypto.h -ssl_lib.o: ../include/openssl/dh.h ../include/openssl/dsa.h -ssl_lib.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_lib.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_lib.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ssl_lib.o: ../include/openssl/err.h ../include/openssl/evp.h -ssl_lib.o: ../include/openssl/hmac.h ../include/openssl/lhash.h -ssl_lib.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ssl_lib.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h -ssl_lib.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_lib.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_lib.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_lib.o: ../include/openssl/rand.h ../include/openssl/rsa.h -ssl_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h -ssl_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -ssl_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -ssl_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ssl_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h -ssl_lib.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h -ssl_lib.o: record/record.h ssl_lib.c ssl_locl.h +ssl_lib.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_lib.o: ../include/openssl/comp.h ../include/openssl/conf.h +ssl_lib.o: ../include/openssl/crypto.h ../include/openssl/dh.h +ssl_lib.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_lib.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_lib.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_lib.o: ../include/openssl/engine.h ../include/openssl/err.h +ssl_lib.o: ../include/openssl/evp.h ../include/openssl/hmac.h +ssl_lib.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ssl_lib.o: ../include/openssl/objects.h ../include/openssl/ocsp.h +ssl_lib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_lib.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +ssl_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +ssl_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h +ssl_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ssl_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +ssl_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +ssl_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +ssl_lib.o: ../include/openssl/x509v3.h packet_locl.h record/record.h ssl_lib.c +ssl_lib.o: ssl_locl.h ssl_rsa.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_rsa.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_rsa.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_rsa.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_rsa.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_rsa.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl_rsa.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl_rsa.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl_rsa.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl_rsa.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_rsa.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_rsa.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_rsa.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_rsa.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_rsa.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_rsa.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_rsa.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_rsa.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_rsa.o: record/record.h ssl_locl.h ssl_rsa.c +ssl_rsa.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_rsa.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_rsa.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_rsa.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_rsa.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_rsa.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl_rsa.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl_rsa.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl_rsa.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_rsa.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_rsa.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_rsa.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl_rsa.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_rsa.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_rsa.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_rsa.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_rsa.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_rsa.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_rsa.o: ssl_locl.h ssl_rsa.c ssl_sess.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_sess.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_sess.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_sess.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_sess.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_sess.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h -ssl_sess.o: ../include/openssl/err.h ../include/openssl/evp.h -ssl_sess.o: ../include/openssl/hmac.h ../include/openssl/lhash.h -ssl_sess.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -ssl_sess.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -ssl_sess.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -ssl_sess.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -ssl_sess.o: ../include/openssl/pqueue.h ../include/openssl/rand.h -ssl_sess.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_sess.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_sess.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_sess.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_sess.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_sess.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_sess.o: record/record.h ssl_locl.h ssl_sess.c +ssl_sess.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_sess.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_sess.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_sess.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_sess.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_sess.o: ../include/openssl/engine.h ../include/openssl/err.h +ssl_sess.o: ../include/openssl/evp.h ../include/openssl/hmac.h +ssl_sess.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +ssl_sess.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +ssl_sess.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +ssl_sess.o: ../include/openssl/pem.h ../include/openssl/pem2.h +ssl_sess.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +ssl_sess.o: ../include/openssl/rand.h ../include/openssl/rsa.h +ssl_sess.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_sess.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_sess.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_sess.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_sess.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_sess.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_sess.o: ssl_locl.h ssl_sess.c ssl_stat.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_stat.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_stat.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_stat.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_stat.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_stat.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl_stat.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl_stat.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl_stat.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl_stat.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_stat.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_stat.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_stat.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_stat.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_stat.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_stat.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_stat.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_stat.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_stat.o: record/record.h ssl_locl.h ssl_stat.c +ssl_stat.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_stat.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_stat.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_stat.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_stat.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_stat.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl_stat.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl_stat.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl_stat.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_stat.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_stat.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_stat.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl_stat.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_stat.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_stat.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_stat.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_stat.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_stat.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_stat.o: ssl_locl.h ssl_stat.c ssl_txt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_txt.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_txt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_txt.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_txt.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_txt.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl_txt.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl_txt.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl_txt.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl_txt.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_txt.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_txt.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_txt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_txt.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_txt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_txt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_txt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_txt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_txt.o: record/record.h ssl_locl.h ssl_txt.c +ssl_txt.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_txt.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_txt.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_txt.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_txt.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_txt.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl_txt.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl_txt.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl_txt.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_txt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_txt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_txt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl_txt.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_txt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_txt.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_txt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_txt.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_txt.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_txt.o: ssl_locl.h ssl_txt.c ssl_utst.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -ssl_utst.o: ../include/openssl/buffer.h ../include/openssl/comp.h -ssl_utst.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -ssl_utst.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -ssl_utst.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -ssl_utst.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -ssl_utst.o: ../include/openssl/evp.h ../include/openssl/hmac.h -ssl_utst.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -ssl_utst.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -ssl_utst.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -ssl_utst.o: ../include/openssl/pem.h ../include/openssl/pem2.h -ssl_utst.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -ssl_utst.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -ssl_utst.o: ../include/openssl/sha.h ../include/openssl/srtp.h -ssl_utst.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -ssl_utst.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -ssl_utst.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -ssl_utst.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssl_utst.o: record/record.h ssl_locl.h ssl_utst.c +ssl_utst.o: ../include/openssl/bn.h ../include/openssl/buffer.h +ssl_utst.o: ../include/openssl/comp.h ../include/openssl/crypto.h +ssl_utst.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +ssl_utst.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssl_utst.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssl_utst.o: ../include/openssl/err.h ../include/openssl/evp.h +ssl_utst.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +ssl_utst.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssl_utst.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssl_utst.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssl_utst.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssl_utst.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +ssl_utst.o: ../include/openssl/safestack.h ../include/openssl/sha.h +ssl_utst.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +ssl_utst.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +ssl_utst.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssl_utst.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssl_utst.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +ssl_utst.o: ssl_locl.h ssl_utst.c t1_clnt.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_clnt.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_clnt.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_clnt.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_clnt.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_clnt.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_clnt.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_clnt.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -t1_clnt.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -t1_clnt.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -t1_clnt.o: ../include/openssl/pem.h ../include/openssl/pem2.h -t1_clnt.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -t1_clnt.o: ../include/openssl/rand.h ../include/openssl/rsa.h -t1_clnt.o: ../include/openssl/safestack.h ../include/openssl/sha.h -t1_clnt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -t1_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -t1_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -t1_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h -t1_clnt.o: ../include/openssl/x509_vfy.h record/record.h ssl_locl.h t1_clnt.c +t1_clnt.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_clnt.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_clnt.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_clnt.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_clnt.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_clnt.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_clnt.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_clnt.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +t1_clnt.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +t1_clnt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +t1_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +t1_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +t1_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +t1_clnt.o: ../include/openssl/sha.h ../include/openssl/srtp.h +t1_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +t1_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +t1_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +t1_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +t1_clnt.o: packet_locl.h record/record.h ssl_locl.h t1_clnt.c t1_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_enc.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_enc.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_enc.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_enc.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_enc.o: ../include/openssl/lhash.h ../include/openssl/md5.h -t1_enc.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h -t1_enc.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -t1_enc.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h -t1_enc.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -t1_enc.o: ../include/openssl/pqueue.h ../include/openssl/rand.h -t1_enc.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -t1_enc.o: ../include/openssl/sha.h ../include/openssl/srtp.h -t1_enc.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -t1_enc.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -t1_enc.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -t1_enc.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -t1_enc.o: record/record.h ssl_locl.h t1_enc.c +t1_enc.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_enc.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_enc.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_enc.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_enc.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_enc.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_enc.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_enc.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h +t1_enc.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +t1_enc.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +t1_enc.o: ../include/openssl/pem.h ../include/openssl/pem2.h +t1_enc.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +t1_enc.o: ../include/openssl/rand.h ../include/openssl/rsa.h +t1_enc.o: ../include/openssl/safestack.h ../include/openssl/sha.h +t1_enc.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +t1_enc.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +t1_enc.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +t1_enc.o: ../include/openssl/tls1.h ../include/openssl/x509.h +t1_enc.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +t1_enc.o: ssl_locl.h t1_enc.c t1_ext.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_ext.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_ext.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_ext.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_ext.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_ext.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_ext.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_ext.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -t1_ext.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -t1_ext.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -t1_ext.o: ../include/openssl/pem.h ../include/openssl/pem2.h -t1_ext.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -t1_ext.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -t1_ext.o: ../include/openssl/sha.h ../include/openssl/srtp.h -t1_ext.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -t1_ext.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -t1_ext.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -t1_ext.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -t1_ext.o: record/record.h ssl_locl.h t1_ext.c +t1_ext.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_ext.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_ext.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_ext.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_ext.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_ext.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_ext.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_ext.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +t1_ext.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +t1_ext.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +t1_ext.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +t1_ext.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +t1_ext.o: ../include/openssl/safestack.h ../include/openssl/sha.h +t1_ext.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +t1_ext.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +t1_ext.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +t1_ext.o: ../include/openssl/tls1.h ../include/openssl/x509.h +t1_ext.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +t1_ext.o: ssl_locl.h t1_ext.c t1_lib.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h t1_lib.o: ../include/openssl/bn.h ../include/openssl/buffer.h t1_lib.o: ../include/openssl/comp.h ../include/openssl/conf.h @@ -823,83 +854,87 @@ t1_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h t1_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h t1_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h t1_lib.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h -t1_lib.o: record/record.h ssl_locl.h t1_lib.c +t1_lib.o: packet_locl.h record/record.h ssl_locl.h t1_lib.c t1_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_meth.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_meth.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_meth.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_meth.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_meth.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -t1_meth.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -t1_meth.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -t1_meth.o: ../include/openssl/pem.h ../include/openssl/pem2.h -t1_meth.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -t1_meth.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -t1_meth.o: ../include/openssl/sha.h ../include/openssl/srtp.h -t1_meth.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -t1_meth.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -t1_meth.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -t1_meth.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -t1_meth.o: record/record.h ssl_locl.h t1_meth.c +t1_meth.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_meth.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_meth.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_meth.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_meth.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_meth.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_meth.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_meth.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +t1_meth.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +t1_meth.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +t1_meth.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +t1_meth.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +t1_meth.o: ../include/openssl/safestack.h ../include/openssl/sha.h +t1_meth.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +t1_meth.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +t1_meth.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +t1_meth.o: ../include/openssl/tls1.h ../include/openssl/x509.h +t1_meth.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +t1_meth.o: ssl_locl.h t1_meth.c t1_reneg.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_reneg.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_reneg.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_reneg.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_reneg.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_reneg.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_reneg.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_reneg.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -t1_reneg.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -t1_reneg.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -t1_reneg.o: ../include/openssl/pem.h ../include/openssl/pem2.h -t1_reneg.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -t1_reneg.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -t1_reneg.o: ../include/openssl/sha.h ../include/openssl/srtp.h -t1_reneg.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -t1_reneg.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -t1_reneg.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -t1_reneg.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -t1_reneg.o: record/record.h ssl_locl.h t1_reneg.c +t1_reneg.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_reneg.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_reneg.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_reneg.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_reneg.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_reneg.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_reneg.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_reneg.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +t1_reneg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +t1_reneg.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +t1_reneg.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +t1_reneg.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +t1_reneg.o: ../include/openssl/safestack.h ../include/openssl/sha.h +t1_reneg.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +t1_reneg.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +t1_reneg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +t1_reneg.o: ../include/openssl/tls1.h ../include/openssl/x509.h +t1_reneg.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +t1_reneg.o: ssl_locl.h t1_reneg.c t1_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_srvr.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_srvr.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_srvr.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_srvr.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_srvr.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -t1_srvr.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -t1_srvr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -t1_srvr.o: ../include/openssl/pem.h ../include/openssl/pem2.h -t1_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -t1_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h -t1_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h -t1_srvr.o: ../include/openssl/srtp.h ../include/openssl/ssl.h -t1_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h -t1_srvr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -t1_srvr.o: ../include/openssl/tls1.h ../include/openssl/x509.h -t1_srvr.o: ../include/openssl/x509_vfy.h record/record.h ssl_locl.h t1_srvr.c +t1_srvr.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_srvr.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_srvr.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_srvr.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_srvr.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_srvr.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_srvr.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_srvr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +t1_srvr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +t1_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +t1_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +t1_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rand.h +t1_srvr.o: ../include/openssl/rsa.h ../include/openssl/safestack.h +t1_srvr.o: ../include/openssl/sha.h ../include/openssl/srtp.h +t1_srvr.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +t1_srvr.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +t1_srvr.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +t1_srvr.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +t1_srvr.o: packet_locl.h record/record.h ssl_locl.h t1_srvr.c t1_trce.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -t1_trce.o: ../include/openssl/buffer.h ../include/openssl/comp.h -t1_trce.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -t1_trce.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -t1_trce.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -t1_trce.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -t1_trce.o: ../include/openssl/evp.h ../include/openssl/hmac.h -t1_trce.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -t1_trce.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -t1_trce.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -t1_trce.o: ../include/openssl/pem.h ../include/openssl/pem2.h -t1_trce.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -t1_trce.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -t1_trce.o: ../include/openssl/sha.h ../include/openssl/srtp.h -t1_trce.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -t1_trce.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -t1_trce.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -t1_trce.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -t1_trce.o: record/record.h ssl_locl.h t1_trce.c +t1_trce.o: ../include/openssl/bn.h ../include/openssl/buffer.h +t1_trce.o: ../include/openssl/comp.h ../include/openssl/crypto.h +t1_trce.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +t1_trce.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +t1_trce.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +t1_trce.o: ../include/openssl/err.h ../include/openssl/evp.h +t1_trce.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +t1_trce.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +t1_trce.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +t1_trce.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +t1_trce.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +t1_trce.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +t1_trce.o: ../include/openssl/safestack.h ../include/openssl/sha.h +t1_trce.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +t1_trce.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h +t1_trce.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +t1_trce.o: ../include/openssl/tls1.h ../include/openssl/x509.h +t1_trce.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +t1_trce.o: ssl_locl.h t1_trce.c tls_srp.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h tls_srp.o: ../include/openssl/bn.h ../include/openssl/buffer.h tls_srp.o: ../include/openssl/comp.h ../include/openssl/crypto.h @@ -919,4 +954,5 @@ tls_srp.o: ../include/openssl/srtp.h ../include/openssl/ssl.h tls_srp.o: ../include/openssl/ssl2.h ../include/openssl/ssl3.h tls_srp.o: ../include/openssl/stack.h ../include/openssl/symhacks.h tls_srp.o: ../include/openssl/tls1.h ../include/openssl/x509.h -tls_srp.o: ../include/openssl/x509_vfy.h record/record.h ssl_locl.h tls_srp.c +tls_srp.o: ../include/openssl/x509_vfy.h packet_locl.h record/record.h +tls_srp.o: ssl_locl.h tls_srp.c diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c index 19cf6ff..4384eda 100644 --- a/ssl/d1_srtp.c +++ b/ssl/d1_srtp.c @@ -266,38 +266,18 @@ int ssl_add_clienthello_use_srtp_ext(SSL *s, unsigned char *p, int *len, return 0; } -int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, - int *al) +int ssl_parse_clienthello_use_srtp_ext(SSL *s, PACKET *pkt, int *al) { SRTP_PROTECTION_PROFILE *sprof; STACK_OF(SRTP_PROTECTION_PROFILE) *srvr; - int ct; - int mki_len; + unsigned int ct, mki_len, id; int i, srtp_pref; - unsigned int id; - - /* Length value + the MKI length */ - if (len < 3) { - SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, - SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); - *al = SSL_AD_DECODE_ERROR; - return 1; - } - - /* Pull off the length of the cipher suite list */ - n2s(d, ct); - len -= 2; + PACKET subpkt; - /* Check that it is even */ - if (ct % 2) { - SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, - SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); - *al = SSL_AD_DECODE_ERROR; - return 1; - } - - /* Check that lengths are consistent */ - if (len < (ct + 1)) { + /* Pull off the length of the cipher suite list and check it is even */ + if (!PACKET_get_net_2(pkt, &ct) + || (ct & 1) != 0 + || !PACKET_get_sub_packet(pkt, &subpkt, ct)) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); *al = SSL_AD_DECODE_ERROR; @@ -309,10 +289,13 @@ int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, /* Search all profiles for a match initially */ srtp_pref = sk_SRTP_PROTECTION_PROFILE_num(srvr); - while (ct) { - n2s(d, id); - ct -= 2; - len -= 2; + while (PACKET_remaining(&subpkt)) { + if (!PACKET_get_net_2(&subpkt, &id)) { + SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, + SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + *al = SSL_AD_DECODE_ERROR; + return 1; + } /* * Only look for match in profiles of higher preference than @@ -333,11 +316,15 @@ int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, /* * Now extract the MKI value as a sanity check, but discard it for now */ - mki_len = *d; - d++; - len--; + if (!PACKET_get_1(pkt, &mki_len)) { + SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, + SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); + *al = SSL_AD_DECODE_ERROR; + return 1; + } - if (mki_len != len) { + if (!PACKET_forward(pkt, mki_len) + || PACKET_remaining(pkt)) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_MKI_VALUE); *al = SSL_AD_DECODE_ERROR; diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h new file mode 100644 index 0000000..4aab5cb --- /dev/null +++ b/ssl/packet_locl.h @@ -0,0 +1,394 @@ +/* ssl/packet_locl.h */ +/* + * Written by Matt Caswell for the OpenSSL project. + */ +/* ==================================================================== + * Copyright (c) 2015 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core at openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay at cryptsoft.com). This product includes software written by Tim + * Hudson (tjh at cryptsoft.com). + * + */ + +#ifndef HEADER_PACKET_LOCL_H +# define HEADER_PACKET_LOCL_H + +# include +# include +# include +# include "e_os.h" + +# ifdef __cplusplus +extern "C" { +# endif + +typedef struct { + /* Pointer to the start of the buffer data */ + unsigned char *start; + + /* Pointer to the first byte after the end of the buffer data */ + unsigned char *end; + + /* Pointer to where we are currently reading from */ + unsigned char *curr; +} PACKET; + +/* + * Returns 1 if there are exactly |len| bytes left to be read from |pkt| + * and 0 otherwise + */ +__owur static inline size_t PACKET_remaining(PACKET *pkt) +{ + return (size_t)(pkt->end - pkt->curr); +} + +/* + * Initialise a PACKET with |len| bytes held in |buf|. This does not make a + * copy of the data so |buf| must be present for the whole time that the PACKET + * is being used. + */ +static inline int PACKET_buf_init(PACKET *pkt, unsigned char *buf, size_t len) +{ + pkt->start = pkt->curr = buf; + pkt->end = pkt->start + len; + + /* Sanity checks */ + if (pkt->start > pkt->end + || pkt->curr < pkt->start + || pkt->curr > pkt->end + || len != (size_t)(pkt->end - pkt->start)) { + return 0; + } + + return 1; +} + +/* + * Peek ahead and initialize |subpkt| with the next |len| bytes read from |pkt|. + * Data is not copied: the |subpkt| packet will share its underlying buffer with + * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|. + */ +__owur static inline int PACKET_peek_sub_packet(PACKET *pkt, PACKET *subpkt, + size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + PACKET_buf_init(subpkt, pkt->curr, len); + + return 1; +} + +/* + * Initialize |subpkt| with the next |len| bytes read from |pkt|. Data is not + * copied: the |subpkt| packet will share its underlying buffer with the + * original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|. + */ +__owur static inline int PACKET_get_sub_packet(PACKET *pkt, PACKET *subpkt, + size_t len) +{ + if (!PACKET_peek_sub_packet(pkt, subpkt, len)) + return 0; + + pkt->curr += len; + + return 1; +} + +/* Peek ahead at 2 bytes in network order from |pkt| and store the value in + * |*data| + */ +__owur static inline int PACKET_peek_net_2(PACKET *pkt, unsigned int *data) +{ + if (PACKET_remaining(pkt) < 2) + return 0; + + *data = ((unsigned int)(*pkt->curr)) << 8; + *data |= *(pkt->curr + 1); + + return 1; +} + +/* Equivalent of n2s */ +/* Get 2 bytes in network order from |pkt| and store the value in |*data| */ +__owur static inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data) +{ + if (!PACKET_peek_net_2(pkt, data)) + return 0; + + pkt->curr += 2; + + return 1; +} + +/* Peek ahead at 3 bytes in network order from |pkt| and store the value in + * |*data| + */ +__owur static inline int PACKET_peek_net_3(PACKET *pkt, unsigned long *data) +{ + if (PACKET_remaining(pkt) < 3) + return 0; + + *data = ((unsigned long)(*pkt->curr)) << 16; + *data |= ((unsigned long)(*pkt->curr + 1)) << 8; + *data |= *pkt->curr + 2; + + return 1; +} + +/* Equivalent of n2l3 */ +/* Get 3 bytes in network order from |pkt| and store the value in |*data| */ +__owur static inline int PACKET_get_net_3(PACKET *pkt, unsigned long *data) +{ + if (!PACKET_peek_net_3(pkt, data)) + return 0; + + pkt->curr += 3; + + return 1; +} + +/* Peek ahead at 4 bytes in network order from |pkt| and store the value in + * |*data| + */ +__owur static inline int PACKET_peek_net_4(PACKET *pkt, unsigned long *data) +{ + if (PACKET_remaining(pkt) < 4) + return 0; + + *data = ((unsigned long)(*pkt->curr)) << 24; + *data |= ((unsigned long)(*pkt->curr + 1)) << 16; + *data |= ((unsigned long)(*pkt->curr + 2)) << 8; + *data |= *pkt->curr+3; + + return 1; +} + +/* Equivalent of n2l */ +/* Get 4 bytes in network order from |pkt| and store the value in |*data| */ +__owur static inline int PACKET_get_net_4(PACKET *pkt, unsigned long *data) +{ + if (!PACKET_peek_net_4(pkt, data)) + return 0; + + pkt->curr += 4; + + return 1; +} + +/* Peek ahead at 1 byte from |pkt| and store the value in |*data| */ +__owur static inline int PACKET_peek_1(PACKET *pkt, unsigned int *data) +{ + if (!PACKET_remaining(pkt)) + return 0; + + *data = *pkt->curr; + + return 1; +} + +/* Get 1 byte from |pkt| and store the value in |*data| */ +__owur static inline int PACKET_get_1(PACKET *pkt, unsigned int *data) +{ + if (!PACKET_peek_1(pkt, data)) + return 0; + + pkt->curr++; + + return 1; +} + +/* + * Peek ahead at 4 bytes in reverse network order from |pkt| and store the value + * in |*data| + */ +__owur static inline int PACKET_peek_4(PACKET *pkt, unsigned long *data) +{ + if (PACKET_remaining(pkt) < 4) + return 0; + + *data = *pkt->curr; + *data |= ((unsigned long)(*pkt->curr + 1)) << 8; + *data |= ((unsigned long)(*pkt->curr + 2)) << 16; + *data |= ((unsigned long)(*pkt->curr + 3)) << 24; + + return 1; +} + +/* Equivalent of c2l */ +/* + * Get 4 bytes in reverse network order from |pkt| and store the value in + * |*data| + */ +__owur static inline int PACKET_get_4(PACKET *pkt, unsigned long *data) +{ + if (!PACKET_peek_4(pkt, data)) + return 0; + + pkt->curr += 4; + + return 1; +} + +/* + * Peek ahead at |len| bytes from the |pkt| and store a pointer to them in + * |*data|. This just points at the underlying buffer that |pkt| is using. The + * caller should not free this data directly (it will be freed when the + * underlying buffer gets freed + */ +__owur static inline int PACKET_peek_bytes(PACKET *pkt, unsigned char **data, + size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + *data = pkt->curr; + + return 1; +} + +/* + * Read |len| bytes from the |pkt| and store a pointer to them in |*data|. This + * just points at the underlying buffer that |pkt| is using. The caller should + * not free this data directly (it will be freed when the underlying buffer gets + * freed + */ +__owur static inline int PACKET_get_bytes(PACKET *pkt, unsigned char **data, + size_t len) +{ + if (!PACKET_peek_bytes(pkt, data, len)) + return 0; + + pkt->curr += len; + + return 1; +} + +/* Peek ahead at |len| bytes from |pkt| and copy them to |data| */ +__owur static inline int PACKET_peek_copy_bytes(PACKET *pkt, + unsigned char *data, size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + memcpy(data, pkt->curr, len); + + return 1; +} + +/* Read |len| bytes from |pkt| and copy them to |data| */ +__owur static inline int PACKET_copy_bytes(PACKET *pkt, unsigned char *data, + size_t len) +{ + if (!PACKET_peek_copy_bytes(pkt, data, len)) + return 0; + + pkt->curr += len; + + return 1; +} + +/* Move the current reading position back |len| bytes */ +__owur static inline int PACKET_back(PACKET *pkt, size_t len) +{ + if (len > (size_t)(pkt->curr - pkt->start)) + return 0; + + pkt->curr -= len; + + return 1; +} + +/* Move the current reading position forward |len| bytes */ +__owur static inline int PACKET_forward(PACKET *pkt, size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + pkt->curr += len; + + return 1; +} + +/* Store a bookmark for the current reading position in |*bm| */ +__owur static inline int PACKET_get_bookmark(PACKET *pkt, size_t *bm) +{ + *bm = pkt->curr - pkt->start; + + return 1; +} + +/* Set the current reading position to the bookmark |bm| */ +__owur static inline int PACKET_goto_bookmark(PACKET *pkt, size_t bm) +{ + if (bm > (size_t)(pkt->end - pkt->start)) + return 0; + + pkt->curr = pkt->start + bm; + + return 1; +} + +/* + * Stores the total length of the packet we have in the underlying buffer in + * |*len| + */ +__owur static inline int PACKET_length(PACKET *pkt, size_t *len) +{ + *len = pkt->end - pkt->start; + + return 1; +} + +# ifdef __cplusplus +} +# endif + +#endif /* HEADER_PACKET_LOCL_H */ + diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 718ca2c..bc7f84f 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -862,11 +862,11 @@ int ssl3_send_hello_request(SSL *s) int ssl3_get_client_hello(SSL *s) { - int i, complen, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1; - unsigned int cookie_len; + int i, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1; + unsigned int j, cipherlen, complen; + unsigned int cookie_len = 0; long n; unsigned long id; - unsigned char *p, *d; SSL_CIPHER *c; #ifndef OPENSSL_NO_COMP unsigned char *q = NULL; @@ -874,6 +874,8 @@ int ssl3_get_client_hello(SSL *s) #endif STACK_OF(SSL_CIPHER) *ciphers = NULL; int protverr = 1; + PACKET pkt; + unsigned char *sess, *cdata; if (s->state == SSL3_ST_SR_CLNT_HELLO_C && !s->first_packet) goto retry_cert; @@ -897,10 +899,12 @@ int ssl3_get_client_hello(SSL *s) if (!ok) return ((int)n); s->first_packet = 0; - d = p = (unsigned char *)s->init_msg; + PACKET_buf_init(&pkt, s->init_msg, n); /* First lets get s->client_version set correctly */ if (RECORD_LAYER_is_sslv2_record(&s->rlayer)) { + unsigned int version; + unsigned int mt; /*- * An SSLv3/TLSv1 backwards-compatible CLIENT-HELLO in an SSLv2 * header is sent directly on the wire, not wrapped as a TLS @@ -916,7 +920,8 @@ int ssl3_get_client_hello(SSL *s) * ... ... */ - if (p[0] != SSL2_MT_CLIENT_HELLO) { + if (!PACKET_get_1(&pkt, &mt) + || mt != SSL2_MT_CLIENT_HELLO) { /* * Should never happen. We should have tested this in the record * layer in order to have determined that this is a SSLv2 record @@ -926,13 +931,18 @@ int ssl3_get_client_hello(SSL *s) goto err; } - if ((p[1] == 0x00) && (p[2] == 0x02)) { + if (!PACKET_get_net_2(&pkt, &version)) { + /* No protocol version supplied! */ + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL); + goto err; + } + if (version == 0x0002) { /* This is real SSLv2. We don't support it. */ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL); goto err; - } else if (p[1] == SSL3_VERSION_MAJOR) { + } else if ((version & 0xff00) == (SSL3_VERSION_MAJOR << 8)) { /* SSLv3/TLS */ - s->client_version = (((int)p[1]) << 8) | (int)p[2]; + s->client_version = version; } else { /* No idea what protocol this is */ SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_UNKNOWN_PROTOCOL); @@ -940,20 +950,14 @@ int ssl3_get_client_hello(SSL *s) } } else { /* - * 2 bytes for client version, SSL3_RANDOM_SIZE bytes for random, 1 byte - * for session id length + * use version from inside client hello, not from record header (may + * differ: see RFC 2246, Appendix E, second paragraph) */ - if (n < 2 + SSL3_RANDOM_SIZE + 1) { + if(!PACKET_get_net_2(&pkt, (unsigned int *)&s->client_version)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; } - - /* - * use version from inside client hello, not from record header (may - * differ: see RFC 2246, Appendix E, second paragraph) - */ - s->client_version = (((int)p[0]) << 8) | (int)p[1]; } /* Do SSL/TLS version negotiation if applicable */ @@ -1032,15 +1036,9 @@ int ssl3_get_client_hello(SSL *s) */ unsigned int csl, sil, cl; - p += 3; - n2s(p, csl); - n2s(p, sil); - n2s(p, cl); - - if (csl + sil + cl + MIN_SSL2_RECORD_LEN != (unsigned int) n) { - SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH); - al = SSL_AD_DECODE_ERROR; - goto f_err; + if (!PACKET_get_net_2(&pkt, &csl) + || !PACKET_get_net_2(&pkt, &sil) + || !PACKET_get_net_2(&pkt, &cl)) { } if (csl == 0) { @@ -1050,7 +1048,13 @@ int ssl3_get_client_hello(SSL *s) goto f_err; } - if (ssl_bytes_to_cipher_list(s, p, csl, &(ciphers), 1) == NULL) { + if (!PACKET_get_bytes(&pkt, &cdata, csl)) { + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + + if (ssl_bytes_to_cipher_list(s, cdata, csl, &(ciphers), 1) == NULL) { goto err; } @@ -1058,6 +1062,11 @@ int ssl3_get_client_hello(SSL *s) * Ignore any session id. We don't allow resumption in a backwards * compatible ClientHello */ + if (!PACKET_forward(&pkt, sil)) { + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } s->hit = 0; if (!ssl_get_new_session(s, 1)) @@ -1066,17 +1075,27 @@ int ssl3_get_client_hello(SSL *s) /* Load the client random */ i = (cl > SSL3_RANDOM_SIZE) ? SSL3_RANDOM_SIZE : cl; memset(s->s3->client_random, 0, SSL3_RANDOM_SIZE); - memcpy(s->s3->client_random, &(p[csl + sil]), i); - - /* Set p to end of packet to ensure we don't look for extensions */ - p = d + n; + if (!PACKET_peek_copy_bytes(&pkt, s->s3->client_random, i) + || !PACKET_forward(&pkt, cl) + || !PACKET_remaining(&pkt) == 0) { + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } /* No compression, so set complen to 0 */ complen = 0; } else { /* If we get here we've got SSLv3+ in an SSLv3+ record */ - p += 2; + /* load the client random and get the session-id */ + if (!PACKET_copy_bytes(&pkt, s->s3->client_random, SSL3_RANDOM_SIZE) + || !PACKET_get_1(&pkt, &j) + || !PACKET_get_bytes(&pkt, &sess, j)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); + goto f_err; + } /* * If we require cookies and this ClientHello doesn't contain one, just @@ -1084,34 +1103,17 @@ int ssl3_get_client_hello(SSL *s) * cookie length... */ if (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) { - unsigned int session_length, cookie_length; - session_length = *(p + SSL3_RANDOM_SIZE); - - if (p + SSL3_RANDOM_SIZE + session_length + 1 >= d + n) { + if (!PACKET_peek_1(&pkt, &cookie_len)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; } - cookie_length = *(p + SSL3_RANDOM_SIZE + session_length + 1); - if (cookie_length == 0) + if (cookie_len == 0) return 1; } - /* load the client random */ - memcpy(s->s3->client_random, p, SSL3_RANDOM_SIZE); - p += SSL3_RANDOM_SIZE; - - /* get the session-id */ - j = *(p++); - - if (p + j > d + n) { - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); - goto f_err; - } - s->hit = 0; /* * Versions before 0.9.7 always allow clients to resume sessions in @@ -1131,7 +1133,7 @@ int ssl3_get_client_hello(SSL *s) if (!ssl_get_new_session(s, 1)) goto err; } else { - i = ssl_get_prev_session(s, p, j, d + n); + i = ssl_get_prev_session(s, &pkt, sess, j); /* * Only resume if the session's version matches the negotiated * version. @@ -1153,23 +1155,12 @@ int ssl3_get_client_hello(SSL *s) } } - p += j; - if (SSL_IS_DTLS(s)) { - /* cookie stuff */ - if (p + 1 > d + n) { + if (!PACKET_get_1(&pkt, &cookie_len)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; } - cookie_len = *(p++); - - if (p + cookie_len > d + n) { - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); - goto f_err; - } - /* * The ClientHello may contain a cookie even if the * HelloVerify message has not been sent--make sure that it @@ -1185,7 +1176,13 @@ int ssl3_get_client_hello(SSL *s) /* verify the cookie if appropriate option is set. */ if ((SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) && cookie_len > 0) { - memcpy(s->d1->rcvd_cookie, p, cookie_len); + /* Get cookie */ + if (!PACKET_copy_bytes(&pkt, s->d1->rcvd_cookie, + cookie_len)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); + goto f_err; + } if (s->ctx->app_verify_cookie_cb != NULL) { if (s->ctx->app_verify_cookie_cb(s, s->d1->rcvd_cookie, @@ -1206,9 +1203,15 @@ int ssl3_get_client_hello(SSL *s) } /* Set to -2 so if successful we return 2 */ ret = -2; + } else { + /* Skip over cookie */ + if (!PACKET_forward(&pkt, cookie_len)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); + goto f_err; + } } - p += cookie_len; if (s->method->version == DTLS_ANY_VERSION) { /* Select version to use */ if (s->client_version <= DTLS1_2_VERSION && @@ -1236,30 +1239,28 @@ int ssl3_get_client_hello(SSL *s) } } - if (p + 2 > d + n) { + if (!PACKET_get_net_2(&pkt, &cipherlen)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; } - n2s(p, i); - if (i == 0) { + if (cipherlen == 0) { al = SSL_AD_ILLEGAL_PARAMETER; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_NO_CIPHERS_SPECIFIED); goto f_err; } - /* i bytes of cipher data + 1 byte for compression length later */ - if ((p + i + 1) > (d + n)) { + if (!PACKET_get_bytes(&pkt, &cdata, cipherlen)) { /* not enough data */ al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH); goto f_err; } - if (ssl_bytes_to_cipher_list(s, p, i, &(ciphers), 0) == NULL) { + + if (ssl_bytes_to_cipher_list(s, cdata, cipherlen, &(ciphers), 0) == NULL) { goto err; } - p += i; /* If it is a hit, check that the cipher is in the list */ if (s->hit) { @@ -1316,22 +1317,22 @@ int ssl3_get_client_hello(SSL *s) } /* compression */ - complen = *(p++); - if ((p + complen) > (d + n)) { + if (!PACKET_get_1(&pkt, &complen) + || !PACKET_get_bytes(&pkt, &cdata, complen)) { /* not enough data */ al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH); goto f_err; } + #ifndef OPENSSL_NO_COMP - q = p; + q = cdata; #endif for (j = 0; j < complen; j++) { - if (p[j] == 0) + if (cdata[j] == 0) break; } - p += complen; if (j >= complen) { /* no compress */ al = SSL_AD_DECODE_ERROR; @@ -1342,7 +1343,7 @@ int ssl3_get_client_hello(SSL *s) /* TLS extensions */ if (s->version >= SSL3_VERSION) { - if (!ssl_parse_clienthello_tlsext(s, &p, d, n)) { + if (!ssl_parse_clienthello_tlsext(s, &pkt)) { SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_PARSE_TLSEXT); goto err; } @@ -1407,6 +1408,7 @@ int ssl3_get_client_hello(SSL *s) /* This only happens if we have a cache hit */ if (s->session->compress_meth != 0) { int m, comp_id = s->session->compress_meth; + unsigned int k; /* Perform sanity checks on resumed compression algorithm */ /* Can't disable compression */ if (!ssl_allow_compression(s)) { @@ -1428,11 +1430,11 @@ int ssl3_get_client_hello(SSL *s) goto f_err; } /* Look for resumed method in compression list */ - for (m = 0; m < complen; m++) { - if (q[m] == comp_id) + for (k = 0; k < complen; k++) { + if (q[k] == comp_id) break; } - if (m >= complen) { + if (k >= complen) { al = SSL_AD_ILLEGAL_PARAMETER; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING); @@ -1442,7 +1444,8 @@ int ssl3_get_client_hello(SSL *s) comp = NULL; else if (ssl_allow_compression(s) && s->ctx->comp_methods) { /* See if we have a match */ - int m, nn, o, v, done = 0; + int m, nn, v, done = 0; + unsigned int o; nn = sk_SSL_COMP_num(s->ctx->comp_methods); for (m = 0; m < nn; m++) { diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index c75219b..0997566 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -166,6 +166,7 @@ # include #include "record/record.h" +#include "packet_locl.h" # ifdef OPENSSL_BUILD_SHLIBSSL # undef OPENSSL_EXTERN @@ -1853,8 +1854,8 @@ __owur CERT *ssl_cert_dup(CERT *cert); void ssl_cert_clear_certs(CERT *c); void ssl_cert_free(CERT *c); __owur int ssl_get_new_session(SSL *s, int session); -__owur int ssl_get_prev_session(SSL *s, unsigned char *session, int len, - const unsigned char *limit); +__owur int ssl_get_prev_session(SSL *s, PACKET *pkt, unsigned char *session, + int len); __owur SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket); __owur int ssl_cipher_id_cmp(const SSL_CIPHER *a, const SSL_CIPHER *b); DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(SSL_CIPHER, SSL_CIPHER, ssl_cipher_id); @@ -2087,8 +2088,7 @@ __owur unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit, int *al); __owur unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit, int *al); -__owur int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **data, - unsigned char *d, int n); +__owur int ssl_parse_clienthello_tlsext(SSL *s, PACKET *pkt); __owur int tls1_set_server_sigalgs(SSL *s); __owur int ssl_check_clienthello_tlsext_late(SSL *s); __owur int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data, @@ -2103,8 +2103,8 @@ __owur int tls1_process_heartbeat(SSL *s, unsigned char *p, unsigned int length) __owur int dtls1_process_heartbeat(SSL *s, unsigned char *p, unsigned int length); # endif -__owur int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, - const unsigned char *limit, SSL_SESSION **ret); +__owur int tls1_process_ticket(SSL *s, PACKET *pkt, unsigned char *session_id, + int len, SSL_SESSION **ret); __owur int tls12_get_sigandhash(unsigned char *p, const EVP_PKEY *pk, const EVP_MD *md); @@ -2133,8 +2133,7 @@ __owur int ssl_parse_serverhello_renegotiate_ext(SSL *s, unsigned char *d, int l int *al); __owur int ssl_add_clienthello_renegotiate_ext(SSL *s, unsigned char *p, int *len, int maxlen); -__owur int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len, - int *al); +__owur int ssl_parse_clienthello_renegotiate_ext(SSL *s, PACKET *pkt, int *al); __owur long ssl_get_algorithm2(SSL *s); __owur size_t tls12_copy_sigalgs(SSL *s, unsigned char *out, const unsigned char *psig, size_t psiglen); @@ -2148,8 +2147,7 @@ __owur int ssl_cipher_disabled(SSL *s, const SSL_CIPHER *c, int op); __owur int ssl_add_clienthello_use_srtp_ext(SSL *s, unsigned char *p, int *len, int maxlen); -__owur int ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, - int *al); +__owur int ssl_parse_clienthello_use_srtp_ext(SSL *s, PACKET *pkt, int *al); __owur int ssl_add_serverhello_use_srtp_ext(SSL *s, unsigned char *p, int *len, int maxlen); __owur int ssl_parse_serverhello_use_srtp_ext(SSL *s, unsigned char *d, int len, diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 9063bca..26a3c43 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -547,8 +547,8 @@ int ssl_get_new_session(SSL *s, int session) * - Both for new and resumed sessions, s->tlsext_ticket_expected is set to 1 * if the server should issue a new session ticket (to 0 otherwise). */ -int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, - const unsigned char *limit) +int ssl_get_prev_session(SSL *s, PACKET *pkt, unsigned char *session_id, + int len) { /* This is used only by servers. */ @@ -560,16 +560,11 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, if (len < 0 || len > SSL_MAX_SSL_SESSION_ID_LENGTH) goto err; - if (session_id + len > limit) { - fatal = 1; - goto err; - } - if (len == 0) try_session_cache = 0; /* sets s->tlsext_ticket_expected */ - r = tls1_process_ticket(s, session_id, len, limit, &ret); + r = tls1_process_ticket(s, pkt, session_id, len, &ret); switch (r) { case -1: /* Error during processing */ fatal = 1; diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 47abf2b..c0dd35f 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1756,46 +1756,33 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, * alert value to send in the event of a non-zero return. returns: 0 on * success. */ -static int tls1_alpn_handle_client_hello(SSL *s, const unsigned char *data, - unsigned data_len, int *al) +static int tls1_alpn_handle_client_hello(SSL *s, PACKET *pkt, int *al) { - unsigned i; - unsigned proto_len; + unsigned int data_len; + unsigned int proto_len; const unsigned char *selected; + unsigned char *data; unsigned char selected_len; int r; if (s->ctx->alpn_select_cb == NULL) return 0; - if (data_len < 2) - goto parse_error; - /* * data should contain a uint16 length followed by a series of 8-bit, * length-prefixed strings. */ - i = ((unsigned)data[0]) << 8 | ((unsigned)data[1]); - data_len -= 2; - data += 2; - if (data_len != i) - goto parse_error; - - if (data_len < 2) + if (!PACKET_get_net_2(pkt, &data_len) + || PACKET_remaining(pkt) != data_len + || !PACKET_peek_bytes(pkt, &data, data_len)) goto parse_error; - for (i = 0; i < data_len;) { - proto_len = data[i]; - i++; - - if (proto_len == 0) - goto parse_error; - - if (i + proto_len < i || i + proto_len > data_len) + do { + if (!PACKET_get_1(pkt, &proto_len) + || proto_len == 0 + || !PACKET_forward(pkt, proto_len)) goto parse_error; - - i += proto_len; - } + } while (PACKET_remaining(pkt)); r = s->ctx->alpn_select_cb(s, &selected, &selected_len, data, data_len, s->ctx->alpn_select_cb_arg); @@ -1830,10 +1817,11 @@ static int tls1_alpn_handle_client_hello(SSL *s, const unsigned char *data, * Sadly we cannot differentiate 10.6, 10.7 and 10.8.4 (which work), from * 10.8..10.8.3 (which don't work). */ -static void ssl_check_for_safari(SSL *s, const unsigned char *data, - const unsigned char *d, int n) +static void ssl_check_for_safari(SSL *s, PACKET *pkt) { - unsigned short type, size; + unsigned int type, size; + unsigned char *eblock1, *eblock2; + static const unsigned char kSafariExtensionsBlock[] = { 0x00, 0x0a, /* elliptic_curves extension */ 0x00, 0x08, /* 8 bytes */ @@ -1860,38 +1848,34 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, 0x02, 0x03, /* SHA-1/ECDSA */ }; - if (data >= (d + n - 2)) + if (!PACKET_forward(pkt, 2) + || !PACKET_get_net_2(pkt, &type) + || !PACKET_get_net_2(pkt, &size) + || !PACKET_forward(pkt, size)) return; - data += 2; - - if (data > (d + n - 4)) - return; - n2s(data, type); - n2s(data, size); if (type != TLSEXT_TYPE_server_name) return; - if (data + size > d + n) - return; - data += size; - if (TLS1_get_client_version(s) >= TLS1_2_VERSION) { const size_t len1 = sizeof(kSafariExtensionsBlock); const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock); - if (data + len1 + len2 != d + n) + if (!PACKET_get_bytes(pkt, &eblock1, len1) + || !PACKET_get_bytes(pkt, &eblock2, len2) + || PACKET_remaining(pkt)) return; - if (memcmp(data, kSafariExtensionsBlock, len1) != 0) + if (memcmp(eblock1, kSafariExtensionsBlock, len1) != 0) return; - if (memcmp(data + len1, kSafariTLS12ExtensionsBlock, len2) != 0) + if (memcmp(eblock2, kSafariTLS12ExtensionsBlock, len2) != 0) return; } else { const size_t len = sizeof(kSafariExtensionsBlock); - if (data + len != d + n) + if (!PACKET_get_bytes(pkt, &eblock1, len) + || PACKET_remaining(pkt)) return; - if (memcmp(data, kSafariExtensionsBlock, len) != 0) + if (memcmp(eblock1, kSafariExtensionsBlock, len) != 0) return; } @@ -1899,13 +1883,12 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, } #endif /* !OPENSSL_NO_EC */ -static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, - unsigned char *d, int n, int *al) +static int ssl_scan_clienthello_tlsext(SSL *s, PACKET *pkt, int *al) { - unsigned short type; - unsigned short size; - unsigned short len; - unsigned char *data = *p; + unsigned int type; + unsigned int size; + unsigned int len; + unsigned char *data; int renegotiate_seen = 0; s->servername_done = 0; @@ -1923,8 +1906,8 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, #ifndef OPENSSL_NO_EC if (s->options & SSL_OP_SAFARI_ECDHE_ECDSA_BUG) - ssl_check_for_safari(s, data, d, n); -#endif /* !OPENSSL_NO_EC */ + ssl_check_for_safari(s, pkt); +# endif /* !OPENSSL_NO_EC */ /* Clear any signature algorithms extension received */ OPENSSL_free(s->s3->tmp.peer_sigalgs); @@ -1940,27 +1923,26 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, s->srtp_profile = NULL; - if (data == d + n) + if (PACKET_remaining(pkt) == 0) goto ri_check; - if (data > (d + n - 2)) - goto err; - - n2s(data, len); - - if (data > (d + n - len)) + if (!PACKET_get_net_2(pkt, &len)) goto err; - while (data <= (d + n - 4)) { - n2s(data, type); - n2s(data, size); + while (PACKET_get_net_2(pkt, &type) && PACKET_get_net_2(pkt, &size)) { + PACKET subpkt; - if (data + size > (d + n)) + if (!PACKET_peek_bytes(pkt, &data, size)) goto err; + if (s->tlsext_debug_cb) s->tlsext_debug_cb(s, 0, type, data, size, s->tlsext_debug_arg); + + if (!PACKET_get_sub_packet(pkt, &subpkt, size)) + goto err; + if (type == TLSEXT_TYPE_renegotiate) { - if (!ssl_parse_clienthello_renegotiate_ext(s, data, size, al)) + if (!ssl_parse_clienthello_renegotiate_ext(s, &subpkt, al)) return 0; renegotiate_seen = 1; } else if (s->version == SSL3_VERSION) { @@ -1992,23 +1974,18 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, else if (type == TLSEXT_TYPE_server_name) { unsigned char *sdata; - int servname_type; - int dsize; + unsigned int servname_type; + unsigned int dsize; + PACKET ssubpkt; - if (size < 2) + if (!PACKET_get_net_2(&subpkt, &dsize) + || !PACKET_get_sub_packet(&subpkt, &ssubpkt, dsize)) goto err; - n2s(data, dsize); - size -= 2; - if (dsize > size) - goto err; - - sdata = data; - while (dsize > 3) { - servname_type = *(sdata++); - n2s(sdata, len); - dsize -= 3; - if (len > dsize) + while (PACKET_remaining(&ssubpkt) > 3) { + if (!PACKET_get_1(&ssubpkt, &servname_type) + || !PACKET_get_net_2(&ssubpkt, &len) + || PACKET_remaining(&ssubpkt) < len) goto err; if (s->servername_done == 0) @@ -2027,7 +2004,13 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, *al = TLS1_AD_INTERNAL_ERROR; return 0; } - memcpy(s->session->tlsext_hostname, sdata, len); + if (!PACKET_copy_bytes(&ssubpkt, + (unsigned char *)s->session + ->tlsext_hostname, + len)) { + *al = SSL_AD_DECODE_ERROR; + return 0; + } s->session->tlsext_hostname[len] = '\0'; if (strlen(s->session->tlsext_hostname) != len) { OPENSSL_free(s->session->tlsext_hostname); @@ -2037,48 +2020,55 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, } s->servername_done = 1; - } else + } else { + if (!PACKET_get_bytes(&ssubpkt, &sdata, len)) { + *al = SSL_AD_DECODE_ERROR; + return 0; + } s->servername_done = s->session->tlsext_hostname && strlen(s->session->tlsext_hostname) == len && strncmp(s->session->tlsext_hostname, (char *)sdata, len) == 0; + } break; default: break; } - - dsize -= len; } - if (dsize != 0) + /* We shouldn't have any bytes left */ + if (PACKET_remaining(&ssubpkt)) goto err; } #ifndef OPENSSL_NO_SRP else if (type == TLSEXT_TYPE_srp) { - if (size == 0 || ((len = data[0])) != (size - 1)) - goto err; - if (s->srp_ctx.login != NULL) + if (!PACKET_get_1(&subpkt, &len) + || s->srp_ctx.login != NULL) goto err; + if ((s->srp_ctx.login = OPENSSL_malloc(len + 1)) == NULL) return -1; - memcpy(s->srp_ctx.login, &data[1], len); + if (!PACKET_copy_bytes(&subpkt, (unsigned char *)s->srp_ctx.login, + len)) + goto err; s->srp_ctx.login[len] = '\0'; - if (strlen(s->srp_ctx.login) != len) + if (strlen(s->srp_ctx.login) != len + || PACKET_remaining(&subpkt)) goto err; } #endif #ifndef OPENSSL_NO_EC else if (type == TLSEXT_TYPE_ec_point_formats) { - unsigned char *sdata = data; - int ecpointformatlist_length = *(sdata++); + unsigned int ecpointformatlist_length; - if (ecpointformatlist_length != size - 1 || - ecpointformatlist_length < 1) + if (!PACKET_get_1(&subpkt, &ecpointformatlist_length) + || ecpointformatlist_length == 0) goto err; + if (!s->hit) { OPENSSL_free(s->session->tlsext_ecpointformatlist); s->session->tlsext_ecpointformatlist = NULL; @@ -2090,19 +2080,26 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, } s->session->tlsext_ecpointformatlist_length = ecpointformatlist_length; - memcpy(s->session->tlsext_ecpointformatlist, sdata, - ecpointformatlist_length); + if (!PACKET_copy_bytes(&subpkt, + s->session->tlsext_ecpointformatlist, + ecpointformatlist_length)) + goto err; + } else if (!PACKET_forward(&subpkt, ecpointformatlist_length)) { + goto err; + } + /* We should have consumed all the bytes by now */ + if (PACKET_remaining(&subpkt)) { + *al = TLS1_AD_DECODE_ERROR; + return 0; } } else if (type == TLSEXT_TYPE_elliptic_curves) { - unsigned char *sdata = data; - int ellipticcurvelist_length = (*(sdata++) << 8); - ellipticcurvelist_length += (*(sdata++)); + unsigned int ellipticcurvelist_length; - if (ellipticcurvelist_length != size - 2 || - ellipticcurvelist_length < 1 || - /* Each NamedCurve is 2 bytes. */ - ellipticcurvelist_length & 1) - goto err; + /* Each NamedCurve is 2 bytes and we must have at least 1 */ + if (!PACKET_get_net_2(&subpkt, &ellipticcurvelist_length) + || ellipticcurvelist_length == 0 + || (ellipticcurvelist_length & 1) != 0) + goto err; if (!s->hit) { if (s->session->tlsext_ellipticcurvelist) @@ -2116,54 +2113,63 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, } s->session->tlsext_ellipticcurvelist_length = ellipticcurvelist_length; - memcpy(s->session->tlsext_ellipticcurvelist, sdata, - ellipticcurvelist_length); + if (!PACKET_copy_bytes(&subpkt, + s->session->tlsext_ellipticcurvelist, + ellipticcurvelist_length)) + goto err; + } else if (!PACKET_forward(&subpkt, ellipticcurvelist_length)) { + goto err; + } + /* We should have consumed all the bytes by now */ + if (PACKET_remaining(&subpkt)) { + goto err; } } #endif /* OPENSSL_NO_EC */ else if (type == TLSEXT_TYPE_session_ticket) { - if (s->tls_session_ticket_ext_cb && - !s->tls_session_ticket_ext_cb(s, data, size, - s->tls_session_ticket_ext_cb_arg)) - { + if (!PACKET_forward(&subpkt, size) + || (s->tls_session_ticket_ext_cb && + !s->tls_session_ticket_ext_cb(s, data, size, + s->tls_session_ticket_ext_cb_arg))) { *al = TLS1_AD_INTERNAL_ERROR; return 0; } } else if (type == TLSEXT_TYPE_signature_algorithms) { - int dsize; - if (s->s3->tmp.peer_sigalgs || size < 2) - goto err; - n2s(data, dsize); - size -= 2; - if (dsize != size || dsize & 1 || !dsize) - goto err; - if (!tls1_save_sigalgs(s, data, dsize)) + unsigned int dsize; + + if (s->s3->tmp.peer_sigalgs + || !PACKET_get_net_2(&subpkt, &dsize) + || (dsize & 1) != 0 + || (dsize == 0) + || !PACKET_get_bytes(&subpkt, &data, dsize) + || PACKET_remaining(&subpkt) + || !tls1_save_sigalgs(s, data, dsize)) { goto err; + } } else if (type == TLSEXT_TYPE_status_request) { + PACKET ssubpkt; - if (size < 5) + if (!PACKET_get_1(&subpkt, + (unsigned int *)&s->tlsext_status_type)) goto err; - s->tlsext_status_type = *data++; - size--; if (s->tlsext_status_type == TLSEXT_STATUSTYPE_ocsp) { const unsigned char *sdata; - int dsize; + unsigned int dsize; /* Read in responder_id_list */ - n2s(data, dsize); - size -= 2; - if (dsize > size) + if (!PACKET_get_net_2(&subpkt, &dsize) + || !PACKET_get_sub_packet(&subpkt, &ssubpkt, dsize)) goto err; - while (dsize > 0) { + + while (PACKET_remaining(&ssubpkt)) { OCSP_RESPID *id; - int idsize; - if (dsize < 4) - goto err; - n2s(data, idsize); - dsize -= 2 + idsize; - size -= 2 + idsize; - if (dsize < 0) + unsigned int idsize; + + if (PACKET_remaining(&ssubpkt) < 4 + || !PACKET_get_net_2(&ssubpkt, &idsize) + || !PACKET_get_bytes(&ssubpkt, &data, idsize)) { goto err; + } sdata = data; data += idsize; id = d2i_OCSP_RESPID(NULL, &sdata, idsize); @@ -2188,12 +2194,11 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, } /* Read in request_extensions */ - if (size < 2) - goto err; - n2s(data, dsize); - size -= 2; - if (dsize != size) + if (!PACKET_get_net_2(&subpkt, &dsize) + || !PACKET_get_bytes(&subpkt, &data, dsize) + || PACKET_remaining(&subpkt)) { goto err; + } sdata = data; if (dsize > 0) { sk_X509_EXTENSION_pop_free(s->tlsext_ocsp_exts, @@ -2212,7 +2217,14 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, } #ifndef OPENSSL_NO_HEARTBEATS else if (type == TLSEXT_TYPE_heartbeat) { - switch (data[0]) { + unsigned int hbtype; + + if (!PACKET_get_1(&subpkt, &hbtype) + || PACKET_remaining(&subpkt)) { + *al = SSL_AD_DECODE_ERROR; + return 0; + } + switch (hbtype) { case 0x01: /* Client allows us to send HB requests */ s->tlsext_heartbeat |= SSL_TLSEXT_HB_ENABLED; break; @@ -2253,7 +2265,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, else if (type == TLSEXT_TYPE_application_layer_protocol_negotiation && s->ctx->alpn_select_cb && s->s3->tmp.finish_md_len == 0) { - if (tls1_alpn_handle_client_hello(s, data, size, al) != 0) + if (tls1_alpn_handle_client_hello(s, &subpkt, al) != 0) return 0; #ifndef OPENSSL_NO_NEXTPROTONEG /* ALPN takes precedence over NPN. */ @@ -2265,7 +2277,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, #ifndef OPENSSL_NO_SRTP else if (SSL_IS_DTLS(s) && SSL_get_srtp_profiles(s) && type == TLSEXT_TYPE_use_srtp) { - if (ssl_parse_clienthello_use_srtp_ext(s, data, size, al)) + if (ssl_parse_clienthello_use_srtp_ext(s, &subpkt, al)) return 0; } #endif @@ -2288,16 +2300,12 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, if (custom_ext_parse(s, 1, type, data, size, al) <= 0) return 0; } - - data += size; } /* Spurious data on the end */ - if (data != d + n) + if (PACKET_remaining(pkt) != 0) goto err; - *p = data; - ri_check: /* Need RI if renegotiating */ @@ -2316,12 +2324,11 @@ err: return 0; } -int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, - int n) +int ssl_parse_clienthello_tlsext(SSL *s, PACKET *pkt) { int al = -1; custom_ext_init(&s->cert->srv_ext); - if (ssl_scan_clienthello_tlsext(s, p, d, n, &al) <= 0) { + if (ssl_scan_clienthello_tlsext(s, pkt, &al) <= 0) { ssl3_send_alert(s, SSL3_AL_FATAL, al); return 0; } @@ -2934,12 +2941,12 @@ int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, unsigned char *d, * s->ctx->tlsext_ticket_key_cb asked to renew the client's ticket. * Otherwise, s->tlsext_ticket_expected is set to 0. */ -int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, - const unsigned char *limit, SSL_SESSION **ret) +int tls1_process_ticket(SSL *s, PACKET *pkt, unsigned char *session_id, + int len, SSL_SESSION **ret) { - /* Point after session ID in client hello */ - const unsigned char *p = session_id + len; - unsigned short i; + unsigned int i; + size_t bookmark = 0; + int retv = -1; *ret = NULL; s->tlsext_ticket_expected = 0; @@ -2950,46 +2957,60 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, */ if (!tls_use_ticket(s)) return 0; - if ((s->version <= SSL3_VERSION) || !limit) + if ((s->version <= SSL3_VERSION)) return 0; - if (p >= limit) + + if (!PACKET_get_bookmark(pkt, &bookmark)) { return -1; + } + /* Skip past DTLS cookie */ if (SSL_IS_DTLS(s)) { - i = *(p++); - p += i; - if (p >= limit) - return -1; + if (!PACKET_get_1(pkt, &i) + || !PACKET_forward(pkt, i)) { + retv = -1; + goto end; + } } - /* Skip past cipher list */ - n2s(p, i); - p += i; - if (p >= limit) - return -1; - /* Skip past compression algorithm list */ - i = *(p++); - p += i; - if (p > limit) - return -1; + /* Skip past cipher list and compression algorithm list */ + if (!PACKET_get_net_2(pkt, &i) + || !PACKET_forward(pkt, i) + || !PACKET_get_1(pkt, &i) + || !PACKET_forward(pkt, i)) { + retv = -1; + goto end; + } + /* Now at start of extensions */ - if ((p + 2) >= limit) - return 0; - n2s(p, i); - while ((p + 4) <= limit) { - unsigned short type, size; - n2s(p, type); - n2s(p, size); - if (p + size > limit) - return 0; + if (!PACKET_get_net_2(pkt, &i)) { + retv = 0; + goto end; + } + while (PACKET_remaining (pkt) >= 4) { + unsigned int type, size; + + if (!PACKET_get_net_2(pkt, &type) + || !PACKET_get_net_2(pkt, &size)) { + /* Shouldn't ever happen */ + retv = -1; + goto end; + } + if (PACKET_remaining(pkt) < size) { + retv = 0; + goto end; + } if (type == TLSEXT_TYPE_session_ticket) { int r; + unsigned char *etick; + if (size == 0) { /* * The client will accept a ticket but doesn't currently have * one. */ s->tlsext_ticket_expected = 1; - return 1; + retv = 1; + goto end; } if (s->tls_session_secret_cb) { /* @@ -2998,25 +3019,39 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, * abbreviated handshake based on external mechanism to * calculate the master secret later. */ - return 2; + retv = 2; + goto end; } - r = tls_decrypt_ticket(s, p, size, session_id, len, ret); + if (!PACKET_get_bytes(pkt, &etick, size)) { + /* Shouldn't ever happen */ + retv = -1; + goto end; + } + r = tls_decrypt_ticket(s, etick, size, session_id, len, ret); switch (r) { case 2: /* ticket couldn't be decrypted */ s->tlsext_ticket_expected = 1; - return 2; + retv = 2; + break; case 3: /* ticket was decrypted */ - return r; + retv = r; + break; case 4: /* ticket decrypted but need to renew */ s->tlsext_ticket_expected = 1; - return 3; + retv = 3; + break; default: /* fatal error */ - return -1; + retv = -1; + break; } + goto end; } - p += size; } - return 0; + retv = 0; +end: + if (!PACKET_goto_bookmark(pkt, bookmark)) + return -1; + return retv; } /*- diff --git a/ssl/t1_reneg.c b/ssl/t1_reneg.c index b9a35c7..22a71fe 100644 --- a/ssl/t1_reneg.c +++ b/ssl/t1_reneg.c @@ -143,23 +143,14 @@ int ssl_add_clienthello_renegotiate_ext(SSL *s, unsigned char *p, int *len, /* * Parse the client's renegotiation binding and abort if it's not right */ -int ssl_parse_clienthello_renegotiate_ext(SSL *s, unsigned char *d, int len, - int *al) +int ssl_parse_clienthello_renegotiate_ext(SSL *s, PACKET *pkt, int *al) { - int ilen; + unsigned int ilen; + unsigned char *d; /* Parse the length byte */ - if (len < 1) { - SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT, - SSL_R_RENEGOTIATION_ENCODING_ERR); - *al = SSL_AD_ILLEGAL_PARAMETER; - return 0; - } - ilen = *d; - d++; - - /* Consistency check */ - if ((ilen + 1) != len) { + if (!PACKET_get_1(pkt, &ilen) + || !PACKET_get_bytes(pkt, &d, ilen)) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT, SSL_R_RENEGOTIATION_ENCODING_ERR); *al = SSL_AD_ILLEGAL_PARAMETER; diff --git a/test/Makefile b/test/Makefile index 2e699dc..f49dc76 100644 --- a/test/Makefile +++ b/test/Makefile @@ -70,6 +70,7 @@ HEARTBEATTEST= heartbeat_test CONSTTIMETEST= constant_time_test VERIFYEXTRATEST= verify_extra_test CLIENTHELLOTEST= clienthellotest +PACKETTEST= packettest TESTS= alltests @@ -87,7 +88,7 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST) $(SRPTEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) \ $(HEARTBEATTEST)$(EXE_EXT) $(P5_CRPT2_TEST)$(EXE_EXT) \ $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT) \ - $(CLIENTHELLOTEST)$(EXE_EXT) + $(CLIENTHELLOTEST)$(EXE_EXT) $(PACKETTEST)$(EXE_EXT) # $(METHTEST)$(EXE_EXT) @@ -101,7 +102,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \ $(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(JPAKETEST).o $(V3NAMETEST).o \ $(GOST2814789TEST).o $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o \ - $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o $(CLIENTHELLOTEST).o testutil.o + $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o $(CLIENTHELLOTEST).o \ + $(PACKETTEST).o testutil.o SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ @@ -112,7 +114,8 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ $(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(JPAKETEST).c $(V3NAMETEST).c \ $(GOST2814789TEST).c $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c \ - $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c $(CLIENTHELLOTEST).c testutil.c + $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c $(CLIENTHELLOTEST).c \ + $(PACKETTEST).c testutil.c HEADER= testutil.h @@ -153,7 +156,7 @@ alltests: \ test_ige test_jpake test_secmem \ test_srp test_cms test_v3name test_ocsp \ test_gost2814789 test_heartbeat test_p5_crpt2 \ - test_constant_time test_verify_extra test_clienthello + test_constant_time test_verify_extra test_clienthello test_packet test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt @echo $(START) $@ @@ -410,6 +413,10 @@ test_clienthello: $(CLIENTHELLOTEST)$(EXE_EXT) @echo $(START) $@ ../util/shlib_wrap.sh ./$(CLIENTHELLOTEST) +test_packet: $(PACKETTEST)$(EXE_EXT) + @echo $(START) $@ + ../util/shlib_wrap.sh ./$(PACKETTEST) + update: local_depend @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi @@ -603,6 +610,9 @@ $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o @target=$(CLIENTHELLOTEST) $(BUILD_CMD) +$(PACKETTEST)$(EXE_EXT): $(PACKETTEST).o + @target=$(PACKETTEST) $(BUILD_CMD) + #$(AESTEST).o: $(AESTEST).c # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c @@ -774,14 +784,15 @@ gost2814789test.o: ../include/openssl/sha.h ../include/openssl/stack.h gost2814789test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h gost2814789test.o: ../include/openssl/x509_vfy.h gost2814789test.c heartbeat_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h -heartbeat_test.o: ../include/openssl/buffer.h ../include/openssl/comp.h -heartbeat_test.o: ../include/openssl/crypto.h ../include/openssl/dsa.h -heartbeat_test.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h -heartbeat_test.o: ../include/openssl/ec.h ../include/openssl/ecdh.h -heartbeat_test.o: ../include/openssl/ecdsa.h ../include/openssl/err.h -heartbeat_test.o: ../include/openssl/evp.h ../include/openssl/hmac.h -heartbeat_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -heartbeat_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +heartbeat_test.o: ../include/openssl/bn.h ../include/openssl/buffer.h +heartbeat_test.o: ../include/openssl/comp.h ../include/openssl/crypto.h +heartbeat_test.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h +heartbeat_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +heartbeat_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +heartbeat_test.o: ../include/openssl/err.h ../include/openssl/evp.h +heartbeat_test.o: ../include/openssl/hmac.h ../include/openssl/lhash.h +heartbeat_test.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +heartbeat_test.o: ../include/openssl/opensslconf.h heartbeat_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h heartbeat_test.o: ../include/openssl/pem.h ../include/openssl/pem2.h heartbeat_test.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h @@ -791,8 +802,8 @@ heartbeat_test.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h heartbeat_test.o: ../include/openssl/ssl3.h ../include/openssl/stack.h heartbeat_test.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h heartbeat_test.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -heartbeat_test.o: ../ssl/record/record.h ../ssl/ssl_locl.h heartbeat_test.c -heartbeat_test.o: testutil.h +heartbeat_test.o: ../ssl/packet_locl.h ../ssl/record/record.h ../ssl/ssl_locl.h +heartbeat_test.o: heartbeat_test.c testutil.h hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h hmactest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h hmactest.o: ../include/openssl/evp.h ../include/openssl/hmac.h @@ -846,6 +857,12 @@ p5_crpt2_test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h p5_crpt2_test.o: ../include/openssl/sha.h ../include/openssl/stack.h p5_crpt2_test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h p5_crpt2_test.o: ../include/openssl/x509_vfy.h p5_crpt2_test.c +packettest.o: ../e_os.h ../include/openssl/bn.h ../include/openssl/buffer.h +packettest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +packettest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +packettest.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h +packettest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +packettest.o: ../ssl/packet_locl.h packettest.c randtest.o: ../e_os.h ../include/openssl/e_os2.h randtest.o: ../include/openssl/opensslconf.h ../include/openssl/ossl_typ.h randtest.o: ../include/openssl/rand.h randtest.c @@ -899,8 +916,8 @@ ssltest.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h -ssltest.o: ../include/openssl/x509v3.h ../ssl/record/record.h ../ssl/ssl_locl.h -ssltest.o: ssltest.c +ssltest.o: ../include/openssl/x509v3.h ../ssl/packet_locl.h +ssltest.o: ../ssl/record/record.h ../ssl/ssl_locl.h ssltest.c testutil.o: ../e_os.h ../include/openssl/e_os2.h testutil.o: ../include/openssl/opensslconf.h testutil.c testutil.h v3nametest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h diff --git a/test/packettest.c b/test/packettest.c new file mode 100644 index 0000000..92181e6 --- /dev/null +++ b/test/packettest.c @@ -0,0 +1,317 @@ +/* test/packettest.c */ +/* + * Written by Matt Caswell for the OpenSSL project. + */ +/* ==================================================================== + * Copyright (c) 2015 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core at openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay at cryptsoft.com). This product includes software written by Tim + * Hudson (tjh at cryptsoft.com). + * + */ + + +#include "../ssl/packet_locl.h" + +#define BUF_LEN 255 + +static int test_PACKET_remaining(PACKET *pkt) +{ + if ( PACKET_remaining(pkt) != BUF_LEN + || !PACKET_forward(pkt, BUF_LEN - 1) + || PACKET_remaining(pkt) != 1 + || !PACKET_forward(pkt, 1) + || PACKET_remaining(pkt)) { + fprintf(stderr, "test_PACKET_remaining() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_1(PACKET *pkt, size_t start) +{ + unsigned int i; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_1(pkt, &i) + || i != 0x01 + || !PACKET_forward(pkt, BUF_LEN - 2) + || !PACKET_get_1(pkt, &i) + || i != 0xff + || PACKET_get_1(pkt, &i)) { + fprintf(stderr, "test_PACKET_get_1() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_4(PACKET *pkt, size_t start) +{ + unsigned long i; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_4(pkt, &i) + || i != 0x04030201UL + || !PACKET_forward(pkt, BUF_LEN - 8) + || !PACKET_get_4(pkt, &i) + || i != 0xfffefdfcUL + || PACKET_get_4(pkt, &i)) { + fprintf(stderr, "test_PACKET_get_4() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_net_2(PACKET *pkt, size_t start) +{ + unsigned int i; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_net_2(pkt, &i) + || i != 0x0102 + || !PACKET_forward(pkt, BUF_LEN - 4) + || !PACKET_get_net_2(pkt, &i) + || i != 0xfeff + || PACKET_get_net_2(pkt, &i)) { + fprintf(stderr, "test_PACKET_get_net_2() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_net_3(PACKET *pkt, size_t start) +{ + unsigned long i; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_net_3(pkt, &i) + || i != 0x010203UL + || !PACKET_forward(pkt, BUF_LEN - 6) + || !PACKET_get_net_3(pkt, &i) + || i != 0xfdfeffUL + || PACKET_get_net_3(pkt, &i)) { + fprintf(stderr, "test_PACKET_get_net_3() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_net_4(PACKET *pkt, size_t start) +{ + unsigned long i; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_net_4(pkt, &i) + || i != 0x01020304UL + || !PACKET_forward(pkt, BUF_LEN - 8) + || !PACKET_get_net_4(pkt, &i) + || i != 0xfcfdfeffUL + || PACKET_get_net_4(pkt, &i)) { + fprintf(stderr, "test_PACKET_get_net_4() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_sub_packet(PACKET *pkt, size_t start) +{ + PACKET subpkt; + unsigned long i; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_sub_packet(pkt, &subpkt, 4) + || !PACKET_get_net_4(&subpkt, &i) + || i != 0x01020304UL + || PACKET_remaining(&subpkt) + || !PACKET_forward(pkt, BUF_LEN - 8) + || !PACKET_get_sub_packet(pkt, &subpkt, 4) + || !PACKET_get_net_4(&subpkt, &i) + || i != 0xfcfdfeffUL + || PACKET_remaining(&subpkt) + || PACKET_get_sub_packet(pkt, &subpkt, 4)) { + fprintf(stderr, "test_PACKET_get_sub_packet() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_get_bytes(PACKET *pkt, size_t start) +{ + unsigned char *bytes; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_get_bytes(pkt, &bytes, 4) + || bytes[0] != 1 || bytes[1] != 2 + || bytes[2] != 3 || bytes[3] != 4 + || PACKET_remaining(pkt) != BUF_LEN -4 + || !PACKET_forward(pkt, BUF_LEN - 8) + || !PACKET_get_bytes(pkt, &bytes, 4) + || bytes[0] != 0xfc || bytes[1] != 0xfd + || bytes[2] != 0xfe || bytes[3] != 0xff + || PACKET_remaining(pkt)) { + fprintf(stderr, "test_PACKET_get_bytes() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_copy_bytes(PACKET *pkt, size_t start) +{ + unsigned char bytes[4]; + + if ( !PACKET_goto_bookmark(pkt, start) + || !PACKET_copy_bytes(pkt, bytes, 4) + || bytes[0] != 1 || bytes[1] != 2 + || bytes[2] != 3 || bytes[3] != 4 + || PACKET_remaining(pkt) != BUF_LEN - 4 + || !PACKET_forward(pkt, BUF_LEN - 8) + || !PACKET_copy_bytes(pkt, bytes, 4) + || bytes[0] != 0xfc || bytes[1] != 0xfd + || bytes[2] != 0xfe || bytes[3] != 0xff + || PACKET_remaining(pkt)) { + fprintf(stderr, "test_PACKET_copy_bytes() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_move_funcs(PACKET *pkt, size_t start) +{ + unsigned char *byte; + size_t bm; + + if ( !PACKET_goto_bookmark(pkt, start) + || PACKET_back(pkt, 1) + || !PACKET_forward(pkt, 1) + || !PACKET_get_bytes(pkt, &byte, 1) + || byte[0] != 2 + || !PACKET_get_bookmark(pkt, &bm) + || !PACKET_forward(pkt, BUF_LEN - 2) + || PACKET_forward(pkt, 1) + || !PACKET_back(pkt, 1) + || !PACKET_get_bytes(pkt, &byte, 1) + || byte[0] != 0xff + || !PACKET_goto_bookmark(pkt, bm) + || !PACKET_get_bytes(pkt, &byte, 1) + || byte[0] != 3) { + fprintf(stderr, "test_PACKET_move_funcs() failed\n"); + return 0; + } + + return 1; +} + +static int test_PACKET_buf_init() +{ + unsigned char buf[BUF_LEN]; + size_t len; + PACKET pkt; + + /* Also tests PACKET_get_len() */ + if ( !PACKET_buf_init(&pkt, buf, 4) + || !PACKET_length(&pkt, &len) + || len != 4 + || !PACKET_buf_init(&pkt, buf, BUF_LEN) + || !PACKET_length(&pkt, &len) + || len != BUF_LEN + || pkt.end - pkt.start != BUF_LEN + || pkt.end < pkt.start + || pkt.curr < pkt.start + || pkt.curr > pkt.end + || PACKET_buf_init(&pkt, buf, -1)) { + fprintf(stderr, "test_PACKET_buf_init() failed\n"); + return 0; + } + + return 1; +} + +int main(int argc, char **argv) +{ + unsigned char buf[BUF_LEN]; + unsigned int i; + size_t start = 0; + PACKET pkt; + + for (i=1; i<=BUF_LEN; i++) { + buf[i-1] = i; + } + i = 0; + + if ( !PACKET_buf_init(&pkt, buf, BUF_LEN) + || !PACKET_get_bookmark(&pkt, &start)) { + fprintf(stderr, "setup failed\n"); + return 0; + } + + if ( !test_PACKET_buf_init() + || !test_PACKET_remaining(&pkt) + || !test_PACKET_get_1(&pkt, start) + || !test_PACKET_get_4(&pkt, start) + || !test_PACKET_get_net_2(&pkt, start) + || !test_PACKET_get_net_3(&pkt, start) + || !test_PACKET_get_net_4(&pkt, start) + || !test_PACKET_get_sub_packet(&pkt, start) + || !test_PACKET_get_bytes(&pkt, start) + || !test_PACKET_copy_bytes(&pkt, start) + || !test_PACKET_move_funcs(&pkt, start)) { + return 1; + } + printf("PASS\n"); + return 0; +} From matt at openssl.org Mon Aug 3 12:02:37 2015 From: matt at openssl.org (Matt Caswell) Date: Mon, 03 Aug 2015 12:02:37 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438603357.145033.24816.nullmailer@dev.openssl.org> The branch master has been updated via 496dbe1855b486c39f42d673d56924d5f9ae3c78 (commit) via e9f6b9a1a5ba9feaeeef88d9f45508996ce43468 (commit) via c69f2adf71d888ba1a2090ec0be3319eb024efe3 (commit) via 657da85eea3a5825b2dd25ff25b99ec206c48136 (commit) from 9ceb2426b0a7972434a49a34e78bdcc6437e04ad (commit) - Log ----------------------------------------------------------------- commit 496dbe1855b486c39f42d673d56924d5f9ae3c78 Author: Matt Caswell Date: Thu Jul 30 11:14:44 2015 +0100 Fix make errors for the CCS changes The move of CCS into the state machine was causing make errors to fail. This fixes it. Reviewed-by: Tim Hudson commit e9f6b9a1a5ba9feaeeef88d9f45508996ce43468 Author: Matt Caswell Date: Tue Jun 30 11:30:44 2015 +0100 Fix ssl3_read_bytes handshake fragment bug The move of CCS into the state machine introduced a bug in ssl3_read_bytes. The value of |recvd_type| was not being set if we are satisfying the request from handshake fragment storage. This can occur, for example, with renegotiation and causes the handshake to fail. Reviewed-by: Tim Hudson commit c69f2adf71d888ba1a2090ec0be3319eb024efe3 Author: Matt Caswell Date: Tue Jun 2 11:33:07 2015 +0100 Move DTLS CCS processing into the state machine Continuing on from the previous commit this moves the processing of DTLS CCS messages out of the record layer and into the state machine. Reviewed-by: Tim Hudson commit 657da85eea3a5825b2dd25ff25b99ec206c48136 Author: Matt Caswell Date: Mon May 11 09:35:41 2015 +0100 Move TLS CCS processing into the state machine The handling of incoming CCS records is a little strange. Since CCS is not a handshake message it is handled differently to normal handshake messages. Unfortunately whilst technically it is not a handhshake message the reality is that it must be processed in accordance with the state of the handshake. Currently CCS records are processed entirely within the record layer. In order to ensure that it is handled in accordance with the handshake state a flag is used to indicate that it is an acceptable time to receive a CCS. Previously this flag did not exist (see CVE-2014-0224), but the flag should only really be considered a workaround for the problem that CCS is not visible to the state machine. Outgoing CCS messages are already handled within the state machine. This patch makes CCS visible to the TLS state machine. A separate commit will handle DTLS. Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: include/openssl/ssl.h | 1 + include/openssl/ssl3.h | 8 ++-- ssl/d1_both.c | 69 ++++++++++++++++++++++++++----- ssl/d1_clnt.c | 19 ++++++--- ssl/d1_srvr.c | 31 +++++++------- ssl/record/rec_layer_d1.c | 73 ++++++++------------------------- ssl/record/rec_layer_s3.c | 86 ++++++++++++++++++--------------------- ssl/record/record.h | 6 ++- ssl/s3_both.c | 101 ++++++++++++++++++++++++++++++++++++++++++++-- ssl/s3_clnt.c | 46 ++++++++++----------- ssl/s3_lib.c | 8 ++-- ssl/s3_srvr.c | 69 ++++++++++--------------------- ssl/ssl_err.c | 2 + ssl/ssl_locl.h | 10 ++--- 14 files changed, 301 insertions(+), 228 deletions(-) diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 6b6560d..06ac5c1 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1943,6 +1943,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 # define SSL_F_SSL3_GET_CERT_STATUS 289 # define SSL_F_SSL3_GET_CERT_VERIFY 136 +# define SSL_F_SSL3_GET_CHANGE_CIPHER_SPEC 349 # define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137 # define SSL_F_SSL3_GET_CLIENT_HELLO 138 # define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139 diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h index 43df925..ec339de 100644 --- a/include/openssl/ssl3.h +++ b/include/openssl/ssl3.h @@ -365,11 +365,6 @@ extern "C" { # define TLS1_FLAGS_TLS_PADDING_BUG 0x0 # define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 -/* - * Set when the handshake is ready to process peer's ChangeCipherSpec message. - * Cleared after the message has been processed. - */ -# define SSL3_FLAGS_CCS_OK 0x0080 /* Set if we encrypt then mac instead of usual mac then encrypt */ # define TLS1_FLAGS_ENCRYPT_THEN_MAC 0x0100 @@ -499,6 +494,9 @@ extern "C" { # endif # define DTLS1_MT_HELLO_VERIFY_REQUEST 3 +/* Dummy message type for handling CCS like a normal handshake message */ +# define SSL3_MT_CHANGE_CIPHER_SPEC 0x0101 + # define SSL3_MT_CCS 1 /* These are used when changing over to a new cipher */ diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 155b8bf..ec47b94 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -160,8 +160,8 @@ static void dtls1_set_message_header_int(SSL *s, unsigned char mt, unsigned short seq_num, unsigned long frag_off, unsigned long frag_len); -static long dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, - int *ok); +static long dtls1_get_message_fragment(SSL *s, int st1, int stn, int mt, + long max, int *ok); static hm_fragment *dtls1_hm_fragment_new(unsigned long frag_len, int reassembly) @@ -470,7 +470,7 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) memset(msg_hdr, 0, sizeof(*msg_hdr)); again: - i = dtls1_get_message_fragment(s, st1, stn, max, ok); + i = dtls1_get_message_fragment(s, st1, stn, mt, max, ok); if (i == DTLS1_HM_BAD_FRAGMENT || i == DTLS1_HM_FRAGMENT_RETRY) { /* bad fragment received */ goto again; @@ -485,6 +485,20 @@ long dtls1_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) } p = (unsigned char *)s->init_buf->data; + + if (mt == SSL3_MT_CHANGE_CIPHER_SPEC) { + if (s->msg_callback) { + s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, + p, 1, s, s->msg_callback_arg); + } + /* + * This isn't a real handshake message so skip the processing below. + * dtls1_get_message_fragment() will never return a CCS if mt == -1, + * so we are ok to continue in that case. + */ + return i; + } + msg_len = msg_hdr->msg_len; /* reconstruct message header */ @@ -679,7 +693,7 @@ dtls1_reassemble_fragment(SSL *s, const struct hm_header_st *msg_hdr, int *ok) unsigned char devnull[256]; while (frag_len) { - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, devnull, frag_len > sizeof(devnull) ? sizeof(devnull) : @@ -692,7 +706,7 @@ dtls1_reassemble_fragment(SSL *s, const struct hm_header_st *msg_hdr, int *ok) } /* read the body of the fragment (header has already been read */ - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, frag->fragment + msg_hdr->frag_off, frag_len, 0); if ((unsigned long)i != frag_len) @@ -775,7 +789,7 @@ dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st *msg_hdr, unsigned char devnull[256]; while (frag_len) { - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, devnull, frag_len > sizeof(devnull) ? sizeof(devnull) : @@ -801,7 +815,7 @@ dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st *msg_hdr, /* * read the body of the fragment (header has already been read */ - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, frag->fragment, frag_len, 0); if ((unsigned long)i != frag_len) i = -1; @@ -835,11 +849,11 @@ dtls1_process_out_of_seq_message(SSL *s, const struct hm_header_st *msg_hdr, } static long -dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) +dtls1_get_message_fragment(SSL *s, int st1, int stn, int mt, long max, int *ok) { unsigned char wire[DTLS1_HM_HEADER_LENGTH]; unsigned long len, frag_off, frag_len; - int i, al; + int i, al, recvd_type; struct hm_header_st msg_hdr; redo: @@ -851,13 +865,46 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) } /* read handshake message header */ - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, wire, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, &recvd_type, wire, DTLS1_HM_HEADER_LENGTH, 0); if (i <= 0) { /* nbio, or an error */ s->rwstate = SSL_READING; *ok = 0; return i; } + if(recvd_type == SSL3_RT_CHANGE_CIPHER_SPEC) { + /* This isn't a real handshake message - its a CCS. + * There is no message sequence number in a CCS to give us confidence + * that this was really intended to be at this point in the handshake + * sequence. Therefore we only allow this if we were explicitly looking + * for it (i.e. if |mt| is -1 we still don't allow it). + */ + if(mt == SSL3_MT_CHANGE_CIPHER_SPEC) { + if (wire[0] != SSL3_MT_CCS) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_DTLS1_GET_MESSAGE_FRAGMENT, SSL_R_BAD_CHANGE_CIPHER_SPEC); + goto f_err; + } + + memcpy(s->init_buf->data, wire, i); + s->init_num = i - 1; + s->init_msg = s->init_buf->data + 1; + s->s3->tmp.message_type = SSL3_MT_CHANGE_CIPHER_SPEC; + s->s3->tmp.message_size = i - 1; + s->state = stn; + *ok = 1; + return i-1; + } else { + /* + * We weren't expecting a CCS yet. Probably something got + * re-ordered or this is a retransmit. We should drop this and try + * again. + */ + s->init_num = 0; + goto redo; + } + } + /* Handshake fails if message header is incomplete */ if (i != DTLS1_HM_HEADER_LENGTH) { al = SSL_AD_UNEXPECTED_MESSAGE; @@ -926,7 +973,7 @@ dtls1_get_message_fragment(SSL *s, int st1, int stn, long max, int *ok) unsigned char *p = (unsigned char *)s->init_buf->data + DTLS1_HM_HEADER_LENGTH; - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, &p[frag_off], frag_len, 0); /* diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index fde0def..566c154 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -271,7 +271,6 @@ int dtls1_connect(SSL *s) memset(s->s3->client_random, 0, sizeof(s->s3->client_random)); s->d1->send_cookie = 0; s->hit = 0; - s->d1->change_cipher_spec_ok = 0; /* * Should have been reset by ssl3_get_finished, too. */ @@ -376,7 +375,7 @@ int dtls1_connect(SSL *s) sizeof(sctpauthkey), sctpauthkey); #endif - s->state = SSL3_ST_CR_FINISHED_A; + s->state = SSL3_ST_CR_CHANGE_A; } else s->state = DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A; } @@ -628,7 +627,7 @@ int dtls1_connect(SSL *s) if (s->tlsext_ticket_expected) s->s3->tmp.next_state = SSL3_ST_CR_SESSION_TICKET_A; else - s->s3->tmp.next_state = SSL3_ST_CR_FINISHED_A; + s->s3->tmp.next_state = SSL3_ST_CR_CHANGE_A; } s->init_num = 0; break; @@ -638,7 +637,7 @@ int dtls1_connect(SSL *s) ret = ssl3_get_new_session_ticket(s); if (ret <= 0) goto end; - s->state = SSL3_ST_CR_FINISHED_A; + s->state = SSL3_ST_CR_CHANGE_A; s->init_num = 0; break; @@ -651,9 +650,19 @@ int dtls1_connect(SSL *s) s->init_num = 0; break; + case SSL3_ST_CR_CHANGE_A: + case SSL3_ST_CR_CHANGE_B: + ret = ssl3_get_change_cipher_spec(s, SSL3_ST_CR_CHANGE_A, + SSL3_ST_CR_CHANGE_B); + if (ret <= 0) + goto end; + + s->state = SSL3_ST_CR_FINISHED_A; + s->init_num = 0; + break; + case SSL3_ST_CR_FINISHED_A: case SSL3_ST_CR_FINISHED_B: - s->d1->change_cipher_spec_ok = 1; ret = ssl3_get_finished(s, SSL3_ST_CR_FINISHED_A, SSL3_ST_CR_FINISHED_B); if (ret <= 0) diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 7a40d66..19562e1 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -257,7 +257,6 @@ int dtls1_accept(SSL *s) } s->init_num = 0; - s->d1->change_cipher_spec_ok = 0; /* * Should have been reset by ssl3_get_finished, too. */ @@ -378,7 +377,7 @@ int dtls1_accept(SSL *s) goto end; } - s->state = SSL3_ST_SR_FINISHED_A; + s->state = SSL3_ST_SR_CHANGE_A; break; case DTLS1_SCTP_ST_SW_WRITE_SOCK: @@ -624,7 +623,7 @@ int dtls1_accept(SSL *s) * pub key in a certificate, the CertificateVerify message is * not sent. */ - s->state = SSL3_ST_SR_FINISHED_A; + s->state = SSL3_ST_SR_CHANGE_A; s->init_num = 0; } else if (SSL_USE_SIGALGS(s)) { s->state = SSL3_ST_SR_CERT_VRFY_A; @@ -675,23 +674,23 @@ int dtls1_accept(SSL *s) s->state = DTLS1_SCTP_ST_SR_READ_SOCK; else #endif - s->state = SSL3_ST_SR_FINISHED_A; + s->state = SSL3_ST_SR_CHANGE_A; + s->init_num = 0; + break; + + case SSL3_ST_SR_CHANGE_A: + case SSL3_ST_SR_CHANGE_B: + ret = ssl3_get_change_cipher_spec(s, SSL3_ST_SR_CHANGE_A, + SSL3_ST_SR_CHANGE_B); + if (ret <= 0) + goto end; + + s->state = SSL3_ST_SR_FINISHED_A; s->init_num = 0; break; case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: - /* - * Enable CCS. Receiving a CCS clears the flag, so make - * sure not to re-enable it to ban duplicates. This *should* be the - * first time we have received one - but we check anyway to be - * cautious. - * s->s3->change_cipher_spec is set when a CCS is - * processed in d1_pkt.c, and remains set until - * the client's Finished message is read. - */ - if (!s->s3->change_cipher_spec) - s->d1->change_cipher_spec_ok = 1; ret = ssl3_get_finished(s, SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) @@ -779,7 +778,7 @@ int dtls1_accept(SSL *s) goto end; s->state = SSL3_ST_SW_FLUSH; if (s->hit) { - s->s3->tmp.next_state = SSL3_ST_SR_FINISHED_A; + s->s3->tmp.next_state = SSL3_ST_SR_CHANGE_A; #ifndef OPENSSL_NO_SCTP /* diff --git a/ssl/record/rec_layer_d1.c b/ssl/record/rec_layer_d1.c index 52ef8f0..3da4f11 100644 --- a/ssl/record/rec_layer_d1.c +++ b/ssl/record/rec_layer_d1.c @@ -379,8 +379,9 @@ int dtls1_process_buffered_records(SSL *s) * (possibly multiple records if we still don't have anything to return). * * This function must handle any surprises the peer may have for us, such as - * Alert records (e.g. close_notify), ChangeCipherSpec records (not really - * a surprise, but handled as if it were), or renegotiation requests. + * Alert records (e.g. close_notify) or renegotiation requests. ChangeCipherSpec + * messages are treated as if they were handshake messages *if* the |recd_type| + * argument is non NULL. * Also if record payloads contain fragments too small to process, we store * them until there is enough for the respective protocol (the record protocol * may use arbitrary fragmentation and even interleaving): @@ -395,7 +396,8 @@ int dtls1_process_buffered_records(SSL *s) * Application data protocol * none of our business */ -int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) +int dtls1_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, + int len, int peek) { int al, i, j, ret; unsigned int n; @@ -537,9 +539,14 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) return (0); } - if (type == SSL3_RECORD_get_type(rr)) { - /* SSL3_RT_APPLICATION_DATA or - * SSL3_RT_HANDSHAKE */ + if (type == SSL3_RECORD_get_type(rr) + || (SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC + && type == SSL3_RT_HANDSHAKE && recvd_type != NULL)) { + /* + * SSL3_RT_APPLICATION_DATA or + * SSL3_RT_HANDSHAKE or + * SSL3_RT_CHANGE_CIPHER_SPEC + */ /* * make sure that we are not getting application data when we are * doing a handshake for the first time @@ -551,6 +558,9 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) goto f_err; } + if (recvd_type != NULL) + *recvd_type = SSL3_RECORD_get_type(rr); + if (len <= 0) return (len); @@ -857,59 +867,11 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } if (SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC) { - unsigned int ccs_hdr_len = DTLS1_CCS_HEADER_LENGTH; - - if (s->version == DTLS1_BAD_VER) - ccs_hdr_len = 3; - - /* - * 'Change Cipher Spec' is just a single byte, so we know exactly - * what the record payload has to look like - */ - /* XDTLS: check that epoch is consistent */ - if ((SSL3_RECORD_get_length(rr) != ccs_hdr_len) - || (SSL3_RECORD_get_off(rr) != 0) - || (SSL3_RECORD_get_data(rr)[0] != SSL3_MT_CCS)) { - i = SSL_AD_ILLEGAL_PARAMETER; - SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_BAD_CHANGE_CIPHER_SPEC); - goto err; - } - - SSL3_RECORD_set_length(rr, 0); - - if (s->msg_callback) - s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, - SSL3_RECORD_get_data(rr), 1, s, s->msg_callback_arg); - /* * We can't process a CCS now, because previous handshake messages * are still missing, so just drop it. */ - if (!s->d1->change_cipher_spec_ok) { - goto start; - } - - s->d1->change_cipher_spec_ok = 0; - - s->s3->change_cipher_spec = 1; - if (!ssl3_do_change_cipher_spec(s)) - goto err; - - /* do this whenever CCS is processed */ - dtls1_reset_seq_numbers(s, SSL3_CC_READ); - - if (s->version == DTLS1_BAD_VER) - s->d1->handshake_read_seq++; - -#ifndef OPENSSL_NO_SCTP - /* - * Remember that a CCS has been received, so that an old key of - * SCTP-Auth can be deleted when a CCS is sent. Will be ignored if no - * SCTP is used - */ - BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD, 1, NULL); -#endif - + SSL3_RECORD_set_length(rr, 0); goto start; } @@ -1025,7 +987,6 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); - err: return (-1); } diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index d6e922c..8a9e303 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -955,8 +955,9 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, * (possibly multiple records if we still don't have anything to return). * * This function must handle any surprises the peer may have for us, such as - * Alert records (e.g. close_notify), ChangeCipherSpec records (not really - * a surprise, but handled as if it were), or renegotiation requests. + * Alert records (e.g. close_notify) or renegotiation requests. ChangeCipherSpec + * messages are treated as if they were handshake messages *if* the |recd_type| + * argument is non NULL. * Also if record payloads contain fragments too small to process, we store * them until there is enough for the respective protocol (the record protocol * may use arbitrary fragmentation and even interleaving): @@ -971,7 +972,8 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, * Application data protocol * none of our business */ -int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) +int ssl3_read_bytes(SSL *s, int type, int *recvd_type, unsigned char *buf, + int len, int peek) { int al, i, j, ret; unsigned int n; @@ -1010,6 +1012,10 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) /* move any remaining fragment bytes: */ for (k = 0; k < s->rlayer.handshake_fragment_len; k++) s->rlayer.handshake_fragment[k] = *src++; + + if (recvd_type != NULL) + *recvd_type = SSL3_RT_HANDSHAKE; + return n; } @@ -1066,9 +1072,14 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) return (0); } - if (type == SSL3_RECORD_get_type(rr)) { - /* SSL3_RT_APPLICATION_DATA or - * SSL3_RT_HANDSHAKE */ + if (type == SSL3_RECORD_get_type(rr) + || (SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC + && type == SSL3_RT_HANDSHAKE && recvd_type != NULL)) { + /* + * SSL3_RT_APPLICATION_DATA or + * SSL3_RT_HANDSHAKE or + * SSL3_RT_CHANGE_CIPHER_SPEC + */ /* * make sure that we are not getting application data when we are * doing a handshake for the first time @@ -1080,6 +1091,17 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) goto f_err; } + if (type == SSL3_RT_HANDSHAKE + && SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC + && s->rlayer.handshake_fragment_len > 0) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_CCS_RECEIVED_EARLY); + goto f_err; + } + + if (recvd_type != NULL) + *recvd_type = SSL3_RECORD_get_type(rr); + if (len <= 0) return (len); @@ -1105,9 +1127,16 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) /* * If we get here, then type != rr->type; if we have a handshake message, - * then it was unexpected (Hello Request or Client Hello). + * then it was unexpected (Hello Request or Client Hello) or invalid (we + * were actually expecting a CCS). */ + if (rr->type == SSL3_RT_HANDSHAKE && type == SSL3_RT_CHANGE_CIPHER_SPEC) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_UNEXPECTED_MESSAGE); + goto f_err; + } + /* * Lets just double check that we've not got an SSLv2 record */ @@ -1344,45 +1373,9 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) } if (SSL3_RECORD_get_type(rr) == SSL3_RT_CHANGE_CIPHER_SPEC) { - /* - * 'Change Cipher Spec' is just a single byte, so we know exactly - * what the record payload has to look like - */ - if ((SSL3_RECORD_get_length(rr) != 1) - || (SSL3_RECORD_get_off(rr) != 0) - || (SSL3_RECORD_get_data(rr)[0] != SSL3_MT_CCS)) { - al = SSL_AD_ILLEGAL_PARAMETER; - SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_BAD_CHANGE_CIPHER_SPEC); - goto f_err; - } - - /* Check we have a cipher to change to */ - if (s->s3->tmp.new_cipher == NULL) { - al = SSL_AD_UNEXPECTED_MESSAGE; - SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_CCS_RECEIVED_EARLY); - goto f_err; - } - - if (!(s->s3->flags & SSL3_FLAGS_CCS_OK)) { - al = SSL_AD_UNEXPECTED_MESSAGE; - SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_CCS_RECEIVED_EARLY); - goto f_err; - } - - s->s3->flags &= ~SSL3_FLAGS_CCS_OK; - - SSL3_RECORD_set_length(rr, 0); - - if (s->msg_callback) - s->msg_callback(0, s->version, SSL3_RT_CHANGE_CIPHER_SPEC, - SSL3_RECORD_get_data(rr), 1, s, - s->msg_callback_arg); - - s->s3->change_cipher_spec = 1; - if (!ssl3_do_change_cipher_spec(s)) - goto err; - else - goto start; + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_CCS_RECEIVED_EARLY); + goto f_err; } /* @@ -1477,7 +1470,6 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); - err: return (-1); } diff --git a/ssl/record/record.h b/ssl/record/record.h index 6931bb4..5c8fead 100644 --- a/ssl/record/record.h +++ b/ssl/record/record.h @@ -331,7 +331,8 @@ __owur int ssl3_pending(const SSL *s); __owur int ssl3_write_bytes(SSL *s, int type, const void *buf, int len); __owur int do_ssl3_write(SSL *s, int type, const unsigned char *buf, unsigned int len, int create_empty_fragment); -__owur int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); +__owur int ssl3_read_bytes(SSL *s, int type, int *recvd_type, + unsigned char *buf, int len, int peek); __owur int ssl3_setup_buffers(SSL *s); __owur int ssl3_enc(SSL *s, int send_data); __owur int n_ssl3_mac(SSL *ssl, unsigned char *md, int send_data); @@ -345,7 +346,8 @@ void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl); void DTLS_RECORD_LAYER_set_saved_w_epoch(RECORD_LAYER *rl, unsigned short e); void DTLS_RECORD_LAYER_clear(RECORD_LAYER *rl); void DTLS_RECORD_LAYER_resync_write(RECORD_LAYER *rl); -__owur int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek); +__owur int dtls1_read_bytes(SSL *s, int type, int *recvd_type, + unsigned char *buf, int len, int peek); __owur int dtls1_write_bytes(SSL *s, int type, const void *buf, int len); __owur int do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len, int create_empty_fragement); diff --git a/ssl/s3_both.c b/ssl/s3_both.c index 17a8054..943cf73 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -228,6 +228,74 @@ static void ssl3_take_mac(SSL *s) } #endif +int ssl3_get_change_cipher_spec(SSL *s, int a, int b) +{ + int ok, al; + long n; + + n = s->method->ssl_get_message(s, a, b, SSL3_MT_CHANGE_CIPHER_SPEC, 1, &ok); + + if (!ok) + return ((int)n); + + /* + * 'Change Cipher Spec' is just a single byte, which should already have + * been consumed by ssl_get_message() so there should be no bytes left, + * unless we're using DTLS1_BAD_VER, which has an extra 2 bytes + */ + if (SSL_IS_DTLS(s)) { + if ((s->version == DTLS1_BAD_VER && n != DTLS1_CCS_HEADER_LENGTH + 1) + || (s->version != DTLS1_BAD_VER + && n != DTLS1_CCS_HEADER_LENGTH - 1)) { + al = SSL_AD_ILLEGAL_PARAMETER; + SSLerr(SSL_F_SSL3_GET_CHANGE_CIPHER_SPEC, SSL_R_BAD_CHANGE_CIPHER_SPEC); + goto f_err; + } + } else { + if (n != 0) { + al = SSL_AD_ILLEGAL_PARAMETER; + SSLerr(SSL_F_SSL3_GET_CHANGE_CIPHER_SPEC, SSL_R_BAD_CHANGE_CIPHER_SPEC); + goto f_err; + } + } + + /* Check we have a cipher to change to */ + if (s->s3->tmp.new_cipher == NULL) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_GET_CHANGE_CIPHER_SPEC, SSL_R_CCS_RECEIVED_EARLY); + goto f_err; + } + + s->s3->change_cipher_spec = 1; + if (!ssl3_do_change_cipher_spec(s)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CHANGE_CIPHER_SPEC, ERR_R_INTERNAL_ERROR); + goto f_err; + } + + if (SSL_IS_DTLS(s)) { + dtls1_reset_seq_numbers(s, SSL3_CC_READ); + + if (s->version == DTLS1_BAD_VER) + s->d1->handshake_read_seq++; + +#ifndef OPENSSL_NO_SCTP + /* + * Remember that a CCS has been received, so that an old key of + * SCTP-Auth can be deleted when a CCS is sent. Will be ignored if no + * SCTP is used + */ + BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD, 1, NULL); +#endif + } + + return 1; + f_err: + ssl3_send_alert(s, SSL3_AL_FATAL, al); + return 0; +} + + int ssl3_get_finished(SSL *s, int a, int b) { int al, i, ok; @@ -345,7 +413,7 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) unsigned char *p; unsigned long l; long n; - int i, al; + int i, al, recvd_type; if (s->s3->tmp.reuse_message) { s->s3->tmp.reuse_message = 0; @@ -369,13 +437,38 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) do { while (s->init_num < SSL3_HM_HEADER_LENGTH) { - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, &recvd_type, &p[s->init_num], SSL3_HM_HEADER_LENGTH - s->init_num, 0); if (i <= 0) { s->rwstate = SSL_READING; *ok = 0; return i; } + if (s->init_num == 0 + && recvd_type == SSL3_RT_CHANGE_CIPHER_SPEC + && (mt < 0 || mt == SSL3_MT_CHANGE_CIPHER_SPEC)) { + if (*p != SSL3_MT_CCS) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_GET_MESSAGE, + SSL_R_UNEXPECTED_MESSAGE); + goto f_err; + } + s->init_num = i - 1; + s->init_msg = p + 1; + s->s3->tmp.message_type = SSL3_MT_CHANGE_CIPHER_SPEC; + s->s3->tmp.message_size = i - 1; + s->state = stn; + *ok = 1; + if (s->msg_callback) + s->msg_callback(0, s->version, + SSL3_RT_CHANGE_CIPHER_SPEC, p, 1, s, + s->msg_callback_arg); + return i - 1; + } else if (recvd_type != SSL3_RT_HANDSHAKE) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_CCS_RECEIVED_EARLY); + goto f_err; + } s->init_num += i; } @@ -458,8 +551,8 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) p = s->init_msg; n = s->s3->tmp.message_size - s->init_num; while (n > 0) { - i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, &p[s->init_num], - n, 0); + i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, NULL, + &p[s->init_num], n, 0); if (i <= 0) { s->rwstate = SSL_READING; *ok = 0; diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 080dbf0..cd6918a 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -165,7 +165,7 @@ static int ssl_set_version(SSL *s); static int ca_dn_cmp(const X509_NAME *const *a, const X509_NAME *const *b); -static int ssl3_check_finished(SSL *s); +static int ssl3_check_change(SSL *s); static int ssl_cipher_list_to_bytes(SSL *s, STACK_OF(SSL_CIPHER) *sk, unsigned char *p, int (*put_cb) (const SSL_CIPHER *, @@ -276,7 +276,6 @@ int ssl3_connect(SSL *s) s->state = SSL3_ST_CW_CLNT_HELLO_A; s->ctx->stats.sess_connect++; s->init_num = 0; - s->s3->flags &= ~SSL3_FLAGS_CCS_OK; /* * Should have been reset by ssl3_get_finished, too. */ @@ -306,7 +305,7 @@ int ssl3_connect(SSL *s) goto end; if (s->hit) { - s->state = SSL3_ST_CR_FINISHED_A; + s->state = SSL3_ST_CR_CHANGE_A; if (s->tlsext_ticket_expected) { /* receive renewed session ticket */ s->state = SSL3_ST_CR_SESSION_TICKET_A; @@ -319,12 +318,12 @@ int ssl3_connect(SSL *s) case SSL3_ST_CR_CERT_A: case SSL3_ST_CR_CERT_B: /* Noop (ret = 0) for everything but EAP-FAST. */ - ret = ssl3_check_finished(s); + ret = ssl3_check_change(s); if (ret < 0) goto end; if (ret == 1) { s->hit = 1; - s->state = SSL3_ST_CR_FINISHED_A; + s->state = SSL3_ST_CR_CHANGE_A; s->init_num = 0; break; } @@ -525,7 +524,7 @@ int ssl3_connect(SSL *s) if (s->tlsext_ticket_expected) s->s3->tmp.next_state = SSL3_ST_CR_SESSION_TICKET_A; else - s->s3->tmp.next_state = SSL3_ST_CR_FINISHED_A; + s->s3->tmp.next_state = SSL3_ST_CR_CHANGE_A; } s->init_num = 0; break; @@ -535,7 +534,7 @@ int ssl3_connect(SSL *s) ret = ssl3_get_new_session_ticket(s); if (ret <= 0) goto end; - s->state = SSL3_ST_CR_FINISHED_A; + s->state = SSL3_ST_CR_CHANGE_A; s->init_num = 0; break; @@ -548,10 +547,19 @@ int ssl3_connect(SSL *s) s->init_num = 0; break; + case SSL3_ST_CR_CHANGE_A: + case SSL3_ST_CR_CHANGE_B: + ret = ssl3_get_change_cipher_spec(s, SSL3_ST_CR_CHANGE_A, + SSL3_ST_CR_CHANGE_B); + if (ret <= 0) + goto end; + + s->state = SSL3_ST_CR_FINISHED_A; + s->init_num = 0; + break; + case SSL3_ST_CR_FINISHED_A: case SSL3_ST_CR_FINISHED_B: - if (!s->s3->change_cipher_spec) - s->s3->flags |= SSL3_FLAGS_CCS_OK; ret = ssl3_get_finished(s, SSL3_ST_CR_FINISHED_A, SSL3_ST_CR_FINISHED_B); if (ret <= 0) @@ -3368,11 +3376,11 @@ int ssl3_check_cert_and_algorithm(SSL *s) * the session ID. EAP-FAST (RFC 4851), however, relies on the next server * message after the ServerHello to determine if the server is resuming. * Therefore, we allow EAP-FAST to peek ahead. - * ssl3_check_finished returns 1 if we are resuming from an external - * pre-shared secret, we have a "ticket" and the next server handshake message - * is Finished; and 0 otherwise. It returns -1 upon an error. + * ssl3_check_change returns 1 if we are resuming from an external + * pre-shared secret, we have a "ticket" and the next server message + * is CCS; and 0 otherwise. It returns -1 upon an error. */ -static int ssl3_check_finished(SSL *s) +static int ssl3_check_change(SSL *s) { int ok = 0; @@ -3380,8 +3388,6 @@ static int ssl3_check_finished(SSL *s) !s->session->tlsext_tick) return 0; - /* Need to permit this temporarily, in case the next message is Finished. */ - s->s3->flags |= SSL3_FLAGS_CCS_OK; /* * This function is called when we might get a Certificate message instead, * so permit appropriate message length. @@ -3392,23 +3398,15 @@ static int ssl3_check_finished(SSL *s) SSL3_ST_CR_CERT_A, SSL3_ST_CR_CERT_B, -1, s->max_cert_list, &ok); - s->s3->flags &= ~SSL3_FLAGS_CCS_OK; if (!ok) return -1; s->s3->tmp.reuse_message = 1; - if (s->s3->tmp.message_type == SSL3_MT_FINISHED) + if (s->s3->tmp.message_type == SSL3_MT_CHANGE_CIPHER_SPEC) return 1; - /* If we're not done, then the CCS arrived early and we should bail. */ - if (s->s3->change_cipher_spec) { - SSLerr(SSL_F_SSL3_CHECK_FINISHED, SSL_R_CCS_RECEIVED_EARLY); - ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); - return -1; - } - return 0; } diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 0fc0881..d39346a 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4808,7 +4808,7 @@ int ssl3_shutdown(SSL *s) /* * If we are waiting for a close from our peer, we are closed */ - s->method->ssl_read_bytes(s, 0, NULL, 0, 0); + s->method->ssl_read_bytes(s, 0, NULL, NULL, 0, 0); if (!(s->shutdown & SSL_RECEIVED_SHUTDOWN)) { return (-1); /* return WANT_READ */ } @@ -4840,7 +4840,7 @@ static int ssl3_read_internal(SSL *s, void *buf, int len, int peek) ssl3_renegotiate_check(s); s->s3->in_read_app_data = 1; ret = - s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, buf, len, + s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, len, peek); if ((ret == -1) && (s->s3->in_read_app_data == 2)) { /* @@ -4852,8 +4852,8 @@ static int ssl3_read_internal(SSL *s, void *buf, int len, int peek) */ s->in_handshake++; ret = - s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, buf, len, - peek); + s->method->ssl_read_bytes(s, SSL3_RT_APPLICATION_DATA, NULL, buf, + len, peek); s->in_handshake--; } else s->s3->in_read_app_data = 0; diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index bc7f84f..fd4c87e 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -281,7 +281,6 @@ int ssl3_accept(SSL *s) s->init_num = 0; s->s3->flags &= ~TLS1_FLAGS_SKIP_CERT_VERIFY; - s->s3->flags &= ~SSL3_FLAGS_CCS_OK; /* * Should have been reset by ssl3_get_finished, too. */ @@ -576,14 +575,7 @@ int ssl3_accept(SSL *s) * not sent. Also for GOST ciphersuites when the client uses * its key from the certificate for key exchange. */ -#if defined(OPENSSL_NO_NEXTPROTONEG) - s->state = SSL3_ST_SR_FINISHED_A; -#else - if (s->s3->next_proto_neg_seen) - s->state = SSL3_ST_SR_NEXT_PROTO_A; - else - s->state = SSL3_ST_SR_FINISHED_A; -#endif + s->state = SSL3_ST_SR_CHANGE_A; s->init_num = 0; } else if (SSL_USE_SIGALGS(s)) { s->state = SSL3_ST_SR_CERT_VRFY_A; @@ -650,32 +642,13 @@ int ssl3_accept(SSL *s) if (ret <= 0) goto end; -#if defined(OPENSSL_NO_NEXTPROTONEG) - s->state = SSL3_ST_SR_FINISHED_A; -#else - if (s->s3->next_proto_neg_seen) - s->state = SSL3_ST_SR_NEXT_PROTO_A; - else - s->state = SSL3_ST_SR_FINISHED_A; -#endif + s->state = SSL3_ST_SR_CHANGE_A; s->init_num = 0; break; #if !defined(OPENSSL_NO_NEXTPROTONEG) case SSL3_ST_SR_NEXT_PROTO_A: case SSL3_ST_SR_NEXT_PROTO_B: - /* - * Enable CCS for NPN. Receiving a CCS clears the flag, so make - * sure not to re-enable it to ban duplicates. This *should* be the - * first time we have received one - but we check anyway to be - * cautious. - * s->s3->change_cipher_spec is set when a CCS is - * processed in s3_pkt.c, and remains set until - * the client's Finished message is read. - */ - if (!s->s3->change_cipher_spec) - s->s3->flags |= SSL3_FLAGS_CCS_OK; - ret = ssl3_get_next_proto(s); if (ret <= 0) goto end; @@ -684,18 +657,27 @@ int ssl3_accept(SSL *s) break; #endif + + case SSL3_ST_SR_CHANGE_A: + case SSL3_ST_SR_CHANGE_B: + ret = ssl3_get_change_cipher_spec(s, SSL3_ST_SR_CHANGE_A, + SSL3_ST_SR_CHANGE_B); + if (ret <= 0) + goto end; + +#if defined(OPENSSL_NO_NEXTPROTONEG) + s->state = SSL3_ST_SR_FINISHED_A; +#else + if (s->s3->next_proto_neg_seen) + s->state = SSL3_ST_SR_NEXT_PROTO_A; + else + s->state = SSL3_ST_SR_FINISHED_A; +#endif + s->init_num = 0; + break; + case SSL3_ST_SR_FINISHED_A: case SSL3_ST_SR_FINISHED_B: - /* - * Enable CCS for handshakes without NPN. In NPN the CCS flag has - * already been set. Receiving a CCS clears the flag, so make - * sure not to re-enable it to ban duplicates. - * s->s3->change_cipher_spec is set when a CCS is - * processed in s3_pkt.c, and remains set until - * the client's Finished message is read. - */ - if (!s->s3->change_cipher_spec) - s->s3->flags |= SSL3_FLAGS_CCS_OK; ret = ssl3_get_finished(s, SSL3_ST_SR_FINISHED_A, SSL3_ST_SR_FINISHED_B); if (ret <= 0) @@ -769,14 +751,7 @@ int ssl3_accept(SSL *s) goto end; s->state = SSL3_ST_SW_FLUSH; if (s->hit) { -#if defined(OPENSSL_NO_NEXTPROTONEG) - s->s3->tmp.next_state = SSL3_ST_SR_FINISHED_A; -#else - if (s->s3->next_proto_neg_seen) { - s->s3->tmp.next_state = SSL3_ST_SR_NEXT_PROTO_A; - } else - s->s3->tmp.next_state = SSL3_ST_SR_FINISHED_A; -#endif + s->s3->tmp.next_state = SSL3_ST_SR_CHANGE_A; } else s->s3->tmp.next_state = SSL_ST_OK; s->init_num = 0; diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 4b4d89c..539146f 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -131,6 +131,8 @@ static ERR_STRING_DATA SSL_str_functs[] = { "ssl3_get_certificate_request"}, {ERR_FUNC(SSL_F_SSL3_GET_CERT_STATUS), "ssl3_get_cert_status"}, {ERR_FUNC(SSL_F_SSL3_GET_CERT_VERIFY), "ssl3_get_cert_verify"}, + {ERR_FUNC(SSL_F_SSL3_GET_CHANGE_CIPHER_SPEC), + "ssl3_get_change_cipher_spec"}, {ERR_FUNC(SSL_F_SSL3_GET_CLIENT_CERTIFICATE), "ssl3_get_client_certificate"}, {ERR_FUNC(SSL_F_SSL3_GET_CLIENT_HELLO), "ssl3_get_client_hello"}, diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 0997566..bc8388a 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -563,8 +563,8 @@ struct ssl_method_st { int (*ssl_renegotiate_check) (SSL *s); long (*ssl_get_message) (SSL *s, int st1, int stn, int mt, long max, int *ok); - int (*ssl_read_bytes) (SSL *s, int type, unsigned char *buf, int len, - int peek); + int (*ssl_read_bytes) (SSL *s, int type, int *recvd_type, + unsigned char *buf, int len, int peek); int (*ssl_write_bytes) (SSL *s, int type, const void *buf_, int len); int (*ssl_dispatch_alert) (SSL *s); long (*ssl_ctrl) (SSL *s, int cmd, long larg, void *parg); @@ -1437,11 +1437,6 @@ typedef struct dtls1_state_st { unsigned short timeout_duration; unsigned int retransmitting; - /* - * Set when the handshake is ready to process peer's ChangeCipherSpec message. - * Cleared after the message has been processed. - */ - unsigned int change_cipher_spec_ok; # ifndef OPENSSL_NO_SCTP /* used when SSL_ST_XX_FLUSH is entered */ int next_state; @@ -1912,6 +1907,7 @@ void ssl3_init_finished_mac(SSL *s); __owur int ssl3_send_server_certificate(SSL *s); __owur int ssl3_send_newsession_ticket(SSL *s); __owur int ssl3_send_cert_status(SSL *s); +__owur int ssl3_get_change_cipher_spec(SSL *s, int a, int b); __owur int ssl3_get_finished(SSL *s, int state_a, int state_b); __owur int ssl3_setup_key_block(SSL *s); __owur int ssl3_send_change_cipher_spec(SSL *s, int state_a, int state_b); From matt at openssl.org Tue Aug 4 09:55:32 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 09:55:32 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438682132.706719.20501.nullmailer@dev.openssl.org> The branch master has been updated via 8d11b7c7ee84ad0aa243476088285d15b22c5470 (commit) from 496dbe1855b486c39f42d673d56924d5f9ae3c78 (commit) - Log ----------------------------------------------------------------- commit 8d11b7c7ee84ad0aa243476088285d15b22c5470 Author: Matt Caswell Date: Thu Jul 9 16:37:54 2015 +0100 Fix warning when compiling with no-ec2m EC_KEY_set_public_key_affine_coordinates was using some variables that only apply if OPENSSL_NO_EC2M is not defined. Reviewed-by: Viktor Dukhovni ----------------------------------------------------------------------- Summary of changes: crypto/ec/ec_key.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 620860c..a954c8e 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -346,7 +346,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BN_CTX *ctx = NULL; BIGNUM *tx, *ty; EC_POINT *point = NULL; - int ok = 0, tmp_nid, is_char_two = 0; + int ok = 0; +#ifndef OPENSSL_NO_EC2M + int tmp_nid, is_char_two = 0; +#endif if (!key || !key->group || !x || !y) { ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES, @@ -362,14 +365,15 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, if (!point) goto err; + tx = BN_CTX_get(ctx); + ty = BN_CTX_get(ctx); + +#ifndef OPENSSL_NO_EC2M tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group)); if (tmp_nid == NID_X9_62_characteristic_two_field) is_char_two = 1; - tx = BN_CTX_get(ctx); - ty = BN_CTX_get(ctx); -#ifndef OPENSSL_NO_EC2M if (is_char_two) { if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point, x, y, ctx)) From matt at openssl.org Tue Aug 4 09:55:43 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 09:55:43 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1438682143.055234.21425.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 5438e17de05cfd383790c63bd5770945ac1ccc7f (commit) from 49cc3f4038d81ffdad95c9e49e72bc497f4d3954 (commit) - Log ----------------------------------------------------------------- commit 5438e17de05cfd383790c63bd5770945ac1ccc7f Author: Matt Caswell Date: Thu Jul 9 16:37:54 2015 +0100 Fix warning when compiling with no-ec2m EC_KEY_set_public_key_affine_coordinates was using some variables that only apply if OPENSSL_NO_EC2M is not defined. Reviewed-by: Viktor Dukhovni (cherry picked from commit 8d11b7c7ee84ad0aa243476088285d15b22c5470) ----------------------------------------------------------------------- Summary of changes: crypto/ec/ec_key.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 55ce3fe..c784b6f 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -366,7 +366,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BN_CTX *ctx = NULL; BIGNUM *tx, *ty; EC_POINT *point = NULL; - int ok = 0, tmp_nid, is_char_two = 0; + int ok = 0; +#ifndef OPENSSL_NO_EC2M + int tmp_nid, is_char_two = 0; +#endif if (!key || !key->group || !x || !y) { ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES, @@ -382,14 +385,15 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, if (!point) goto err; + tx = BN_CTX_get(ctx); + ty = BN_CTX_get(ctx); + +#ifndef OPENSSL_NO_EC2M tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group)); if (tmp_nid == NID_X9_62_characteristic_two_field) is_char_two = 1; - tx = BN_CTX_get(ctx); - ty = BN_CTX_get(ctx); -#ifndef OPENSSL_NO_EC2M if (is_char_two) { if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point, x, y, ctx)) From matt at openssl.org Tue Aug 4 09:55:53 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 09:55:53 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_1-stable update Message-ID: <1438682153.546594.21779.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_1-stable has been updated via 507ea77b82f99af8cdae22bebb49fb2772d95330 (commit) from 556803fc3d0c3a957056665d0eef1c6c80cf556e (commit) - Log ----------------------------------------------------------------- commit 507ea77b82f99af8cdae22bebb49fb2772d95330 Author: Matt Caswell Date: Thu Jul 9 16:37:54 2015 +0100 Fix warning when compiling with no-ec2m EC_KEY_set_public_key_affine_coordinates was using some variables that only apply if OPENSSL_NO_EC2M is not defined. Reviewed-by: Viktor Dukhovni (cherry picked from commit 8d11b7c7ee84ad0aa243476088285d15b22c5470) ----------------------------------------------------------------------- Summary of changes: crypto/ec/ec_key.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 55ce3fe..c784b6f 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -366,7 +366,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BN_CTX *ctx = NULL; BIGNUM *tx, *ty; EC_POINT *point = NULL; - int ok = 0, tmp_nid, is_char_two = 0; + int ok = 0; +#ifndef OPENSSL_NO_EC2M + int tmp_nid, is_char_two = 0; +#endif if (!key || !key->group || !x || !y) { ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES, @@ -382,14 +385,15 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, if (!point) goto err; + tx = BN_CTX_get(ctx); + ty = BN_CTX_get(ctx); + +#ifndef OPENSSL_NO_EC2M tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group)); if (tmp_nid == NID_X9_62_characteristic_two_field) is_char_two = 1; - tx = BN_CTX_get(ctx); - ty = BN_CTX_get(ctx); -#ifndef OPENSSL_NO_EC2M if (is_char_two) { if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point, x, y, ctx)) From matt at openssl.org Tue Aug 4 12:29:49 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 12:29:49 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438691389.896207.5318.nullmailer@dev.openssl.org> The branch master has been updated via 0bc09ecd263acb25f04f373f31a50f50af8541bb (commit) via 44128847e8965ec64384ac48c65f5d28126b3666 (commit) from 8d11b7c7ee84ad0aa243476088285d15b22c5470 (commit) - Log ----------------------------------------------------------------- commit 0bc09ecd263acb25f04f373f31a50f50af8541bb Author: Matt Caswell Date: Tue Aug 4 11:44:52 2015 +0100 PACKETise ClientCertificate processing Use the PACKET API for processing ClientCertificate messages Reviewed-by: Tim Hudson commit 44128847e8965ec64384ac48c65f5d28126b3666 Author: Matt Caswell Date: Tue Aug 4 13:03:20 2015 +0100 Fix a bug in the new PACKET implementation Some of the PACKET functions were returning incorrect data. An unfortunate choice of test data in the unit test was masking the failure. Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: ssl/packet_locl.h | 16 ++++++++-------- ssl/s3_srvr.c | 33 ++++++++++++++++++++------------- test/packettest.c | 49 +++++++++++++++++++++++++------------------------ 3 files changed, 53 insertions(+), 45 deletions(-) diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h index 4aab5cb..80d0b93 100644 --- a/ssl/packet_locl.h +++ b/ssl/packet_locl.h @@ -176,8 +176,8 @@ __owur static inline int PACKET_peek_net_3(PACKET *pkt, unsigned long *data) return 0; *data = ((unsigned long)(*pkt->curr)) << 16; - *data |= ((unsigned long)(*pkt->curr + 1)) << 8; - *data |= *pkt->curr + 2; + *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; + *data |= *(pkt->curr + 2); return 1; } @@ -203,9 +203,9 @@ __owur static inline int PACKET_peek_net_4(PACKET *pkt, unsigned long *data) return 0; *data = ((unsigned long)(*pkt->curr)) << 24; - *data |= ((unsigned long)(*pkt->curr + 1)) << 16; - *data |= ((unsigned long)(*pkt->curr + 2)) << 8; - *data |= *pkt->curr+3; + *data |= ((unsigned long)(*(pkt->curr + 1))) << 16; + *data |= ((unsigned long)(*(pkt->curr + 2))) << 8; + *data |= *(pkt->curr+3); return 1; } @@ -254,9 +254,9 @@ __owur static inline int PACKET_peek_4(PACKET *pkt, unsigned long *data) return 0; *data = *pkt->curr; - *data |= ((unsigned long)(*pkt->curr + 1)) << 8; - *data |= ((unsigned long)(*pkt->curr + 2)) << 16; - *data |= ((unsigned long)(*pkt->curr + 3)) << 24; + *data |= ((unsigned long)(*(pkt->curr + 1))) << 8; + *data |= ((unsigned long)(*(pkt->curr + 2))) << 16; + *data |= ((unsigned long)(*(pkt->curr + 3))) << 24; return 1; } diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index fd4c87e..079d9be 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -3012,10 +3012,11 @@ int ssl3_get_client_certificate(SSL *s) { int i, ok, al, ret = -1; X509 *x = NULL; - unsigned long l, nc, llen, n; - const unsigned char *p, *q; - unsigned char *d; + unsigned long l, llen, n; + const unsigned char *certstart; + unsigned char *certbytes; STACK_OF(X509) *sk = NULL; + PACKET pkt, spkt; n = s->method->ssl_get_message(s, SSL3_ST_SR_CERT_A, @@ -3051,35 +3052,42 @@ int ssl3_get_client_certificate(SSL *s) SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, SSL_R_WRONG_MESSAGE_TYPE); goto f_err; } - p = d = (unsigned char *)s->init_msg; + + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, ERR_R_INTERNAL_ERROR); + goto f_err; + } if ((sk = sk_X509_new_null()) == NULL) { SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, ERR_R_MALLOC_FAILURE); goto done; } - n2l3(p, llen); - if (llen + 3 != n) { + if (!PACKET_get_net_3(&pkt, &llen) + || !PACKET_get_sub_packet(&pkt, &spkt, llen) + || PACKET_remaining(&pkt) != 0) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, SSL_R_LENGTH_MISMATCH); goto f_err; } - for (nc = 0; nc < llen;) { - n2l3(p, l); - if ((l + nc + 3) > llen) { + + while (PACKET_remaining(&spkt) > 0) { + if (!PACKET_get_net_3(&spkt, &l) + || !PACKET_get_bytes(&spkt, &certbytes, l)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, SSL_R_CERT_LENGTH_MISMATCH); goto f_err; } - q = p; - x = d2i_X509(NULL, &p, l); + certstart = certbytes; + x = d2i_X509(NULL, (const unsigned char **)&certbytes, l); if (x == NULL) { SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, ERR_R_ASN1_LIB); goto done; } - if (p != (q + l)) { + if (certbytes != (certstart + l)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, SSL_R_CERT_LENGTH_MISMATCH); @@ -3090,7 +3098,6 @@ int ssl3_get_client_certificate(SSL *s) goto done; } x = NULL; - nc += l + 3; } if (sk_X509_num(sk) <= 0) { diff --git a/test/packettest.c b/test/packettest.c index 92181e6..1ddb837 100644 --- a/test/packettest.c +++ b/test/packettest.c @@ -81,10 +81,10 @@ static int test_PACKET_get_1(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_1(pkt, &i) - || i != 0x01 + || i != 0x02 || !PACKET_forward(pkt, BUF_LEN - 2) || !PACKET_get_1(pkt, &i) - || i != 0xff + || i != 0xfe || PACKET_get_1(pkt, &i)) { fprintf(stderr, "test_PACKET_get_1() failed\n"); return 0; @@ -99,10 +99,10 @@ static int test_PACKET_get_4(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_4(pkt, &i) - || i != 0x04030201UL + || i != 0x08060402UL || !PACKET_forward(pkt, BUF_LEN - 8) || !PACKET_get_4(pkt, &i) - || i != 0xfffefdfcUL + || i != 0xfefcfaf8UL || PACKET_get_4(pkt, &i)) { fprintf(stderr, "test_PACKET_get_4() failed\n"); return 0; @@ -117,10 +117,10 @@ static int test_PACKET_get_net_2(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_net_2(pkt, &i) - || i != 0x0102 + || i != 0x0204 || !PACKET_forward(pkt, BUF_LEN - 4) || !PACKET_get_net_2(pkt, &i) - || i != 0xfeff + || i != 0xfcfe || PACKET_get_net_2(pkt, &i)) { fprintf(stderr, "test_PACKET_get_net_2() failed\n"); return 0; @@ -135,11 +135,12 @@ static int test_PACKET_get_net_3(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_net_3(pkt, &i) - || i != 0x010203UL + || i != 0x020406UL || !PACKET_forward(pkt, BUF_LEN - 6) || !PACKET_get_net_3(pkt, &i) - || i != 0xfdfeffUL + || i != 0xfafcfeUL || PACKET_get_net_3(pkt, &i)) { + fprintf(stderr, "i is %ld\n", i); fprintf(stderr, "test_PACKET_get_net_3() failed\n"); return 0; } @@ -153,10 +154,10 @@ static int test_PACKET_get_net_4(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_net_4(pkt, &i) - || i != 0x01020304UL + || i != 0x02040608UL || !PACKET_forward(pkt, BUF_LEN - 8) || !PACKET_get_net_4(pkt, &i) - || i != 0xfcfdfeffUL + || i != 0xf8fafcfeUL || PACKET_get_net_4(pkt, &i)) { fprintf(stderr, "test_PACKET_get_net_4() failed\n"); return 0; @@ -173,12 +174,12 @@ static int test_PACKET_get_sub_packet(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_sub_packet(pkt, &subpkt, 4) || !PACKET_get_net_4(&subpkt, &i) - || i != 0x01020304UL + || i != 0x02040608UL || PACKET_remaining(&subpkt) || !PACKET_forward(pkt, BUF_LEN - 8) || !PACKET_get_sub_packet(pkt, &subpkt, 4) || !PACKET_get_net_4(&subpkt, &i) - || i != 0xfcfdfeffUL + || i != 0xf8fafcfeUL || PACKET_remaining(&subpkt) || PACKET_get_sub_packet(pkt, &subpkt, 4)) { fprintf(stderr, "test_PACKET_get_sub_packet() failed\n"); @@ -194,13 +195,13 @@ static int test_PACKET_get_bytes(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_bytes(pkt, &bytes, 4) - || bytes[0] != 1 || bytes[1] != 2 - || bytes[2] != 3 || bytes[3] != 4 + || bytes[0] != 2 || bytes[1] != 4 + || bytes[2] != 6 || bytes[3] != 8 || PACKET_remaining(pkt) != BUF_LEN -4 || !PACKET_forward(pkt, BUF_LEN - 8) || !PACKET_get_bytes(pkt, &bytes, 4) - || bytes[0] != 0xfc || bytes[1] != 0xfd - || bytes[2] != 0xfe || bytes[3] != 0xff + || bytes[0] != 0xf8 || bytes[1] != 0xfa + || bytes[2] != 0xfc || bytes[3] != 0xfe || PACKET_remaining(pkt)) { fprintf(stderr, "test_PACKET_get_bytes() failed\n"); return 0; @@ -215,13 +216,13 @@ static int test_PACKET_copy_bytes(PACKET *pkt, size_t start) if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_copy_bytes(pkt, bytes, 4) - || bytes[0] != 1 || bytes[1] != 2 - || bytes[2] != 3 || bytes[3] != 4 + || bytes[0] != 2 || bytes[1] != 4 + || bytes[2] != 6 || bytes[3] != 8 || PACKET_remaining(pkt) != BUF_LEN - 4 || !PACKET_forward(pkt, BUF_LEN - 8) || !PACKET_copy_bytes(pkt, bytes, 4) - || bytes[0] != 0xfc || bytes[1] != 0xfd - || bytes[2] != 0xfe || bytes[3] != 0xff + || bytes[0] != 0xf8 || bytes[1] != 0xfa + || bytes[2] != 0xfc || bytes[3] != 0xfe || PACKET_remaining(pkt)) { fprintf(stderr, "test_PACKET_copy_bytes() failed\n"); return 0; @@ -239,16 +240,16 @@ static int test_PACKET_move_funcs(PACKET *pkt, size_t start) || PACKET_back(pkt, 1) || !PACKET_forward(pkt, 1) || !PACKET_get_bytes(pkt, &byte, 1) - || byte[0] != 2 + || byte[0] != 4 || !PACKET_get_bookmark(pkt, &bm) || !PACKET_forward(pkt, BUF_LEN - 2) || PACKET_forward(pkt, 1) || !PACKET_back(pkt, 1) || !PACKET_get_bytes(pkt, &byte, 1) - || byte[0] != 0xff + || byte[0] != 0xfe || !PACKET_goto_bookmark(pkt, bm) || !PACKET_get_bytes(pkt, &byte, 1) - || byte[0] != 3) { + || byte[0] != 6) { fprintf(stderr, "test_PACKET_move_funcs() failed\n"); return 0; } @@ -289,7 +290,7 @@ int main(int argc, char **argv) PACKET pkt; for (i=1; i<=BUF_LEN; i++) { - buf[i-1] = i; + buf[i-1] = (i * 2) & 0xff; } i = 0; From matt at openssl.org Tue Aug 4 12:59:30 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 12:59:30 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438693170.334573.14288.nullmailer@dev.openssl.org> The branch master has been updated via f532a35d2ac4364c4ce0f0a68170b2a2228469cc (commit) from 0bc09ecd263acb25f04f373f31a50f50af8541bb (commit) - Log ----------------------------------------------------------------- commit f532a35d2ac4364c4ce0f0a68170b2a2228469cc Author: Matt Caswell Date: Mon Aug 3 16:56:41 2015 +0100 PACKETise CertificateVerify processing Modify CertificateVerify processing to use the new PACKET API. Reviewed-by: Stephen Henson ----------------------------------------------------------------------- Summary of changes: ssl/s3_srvr.c | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 079d9be..3072270 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -2816,13 +2816,15 @@ int ssl3_get_client_key_exchange(SSL *s) int ssl3_get_cert_verify(SSL *s) { EVP_PKEY *pkey = NULL; - unsigned char *p; + unsigned char *sig, *data; int al, ok, ret = 0; long n; int type = 0, i, j; + unsigned int len; X509 *peer; const EVP_MD *md = NULL; EVP_MD_CTX mctx; + PACKET pkt; EVP_MD_CTX_init(&mctx); /* @@ -2859,7 +2861,11 @@ int ssl3_get_cert_verify(SSL *s) } /* we now have a signature that we need to verify */ - p = (unsigned char *)s->init_msg; + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); + al = SSL_AD_INTERNAL_ERROR; + goto f_err; + } /* Check for broken implementations of GOST ciphersuites */ /* * If key is GOST and n is exactly 64, it is bare signature without @@ -2867,10 +2873,16 @@ int ssl3_get_cert_verify(SSL *s) */ if (n == 64 && (pkey->type == NID_id_GostR3410_94 || pkey->type == NID_id_GostR3410_2001)) { - i = 64; + len = 64; } else { if (SSL_USE_SIGALGS(s)) { - int rv = tls12_check_peer_sigalg(&md, s, p, pkey); + int rv; + + if (!PACKET_get_bytes(&pkt, &sig, 2)) { + al = SSL_AD_DECODE_ERROR; + goto f_err; + } + rv = tls12_check_peer_sigalg(&md, s, sig, pkey); if (rv == -1) { al = SSL_AD_INTERNAL_ERROR; goto f_err; @@ -2881,23 +2893,24 @@ int ssl3_get_cert_verify(SSL *s) #ifdef SSL_DEBUG fprintf(stderr, "USING TLSv1.2 HASH %s\n", EVP_MD_name(md)); #endif - p += 2; - n -= 2; } - n2s(p, i); - n -= 2; - if (i > n) { + if (!PACKET_get_net_2(&pkt, &len)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_LENGTH_MISMATCH); al = SSL_AD_DECODE_ERROR; goto f_err; } } j = EVP_PKEY_size(pkey); - if ((i > j) || (n > j) || (n <= 0)) { + if (((int)len > j) || ((int)PACKET_remaining(&pkt) > j) || (n <= 0)) { SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_WRONG_SIGNATURE_SIZE); al = SSL_AD_DECODE_ERROR; goto f_err; } + if (!PACKET_get_bytes(&pkt, &data, len)) { + SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_LENGTH_MISMATCH); + al = SSL_AD_DECODE_ERROR; + goto f_err; + } if (SSL_USE_SIGALGS(s)) { long hdatalen = 0; @@ -2919,7 +2932,7 @@ int ssl3_get_cert_verify(SSL *s) goto f_err; } - if (EVP_VerifyFinal(&mctx, p, i, pkey) <= 0) { + if (EVP_VerifyFinal(&mctx, data, len, pkey) <= 0) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_BAD_SIGNATURE); goto f_err; @@ -2928,7 +2941,7 @@ int ssl3_get_cert_verify(SSL *s) #ifndef OPENSSL_NO_RSA if (pkey->type == EVP_PKEY_RSA) { i = RSA_verify(NID_md5_sha1, s->s3->tmp.cert_verify_md, - MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, p, i, + MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH, data, len, pkey->pkey.rsa); if (i < 0) { al = SSL_AD_DECRYPT_ERROR; @@ -2946,7 +2959,7 @@ int ssl3_get_cert_verify(SSL *s) if (pkey->type == EVP_PKEY_DSA) { j = DSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), - SHA_DIGEST_LENGTH, p, i, pkey->pkey.dsa); + SHA_DIGEST_LENGTH, data, len, pkey->pkey.dsa); if (j <= 0) { /* bad signature */ al = SSL_AD_DECRYPT_ERROR; @@ -2959,7 +2972,7 @@ int ssl3_get_cert_verify(SSL *s) if (pkey->type == EVP_PKEY_EC) { j = ECDSA_verify(pkey->save_type, &(s->s3->tmp.cert_verify_md[MD5_DIGEST_LENGTH]), - SHA_DIGEST_LENGTH, p, i, pkey->pkey.ec); + SHA_DIGEST_LENGTH, data, len, pkey->pkey.ec); if (j <= 0) { /* bad signature */ al = SSL_AD_DECRYPT_ERROR; @@ -2974,11 +2987,11 @@ int ssl3_get_cert_verify(SSL *s) int idx; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL); EVP_PKEY_verify_init(pctx); - if (i != 64) { - fprintf(stderr, "GOST signature length is %d", i); + if (len != 64) { + fprintf(stderr, "GOST signature length is %d", len); } for (idx = 0; idx < 64; idx++) { - signature[63 - idx] = p[idx]; + signature[63 - idx] = data[idx]; } j = EVP_PKEY_verify(pctx, signature, 64, s->s3->tmp.cert_verify_md, 32); From matt at openssl.org Tue Aug 4 13:11:22 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 13:11:22 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438693882.139298.18404.nullmailer@dev.openssl.org> The branch master has been updated via c3fc7eeab884b6876a1b4006163f190d325aa047 (commit) from f532a35d2ac4364c4ce0f0a68170b2a2228469cc (commit) - Log ----------------------------------------------------------------- commit c3fc7eeab884b6876a1b4006163f190d325aa047 Author: Matt Caswell Date: Tue Aug 4 13:52:03 2015 +0100 PACKETise NextProto Change NextProto message processing to use the PACKET API. Reviewed-by: Stephen Henson ----------------------------------------------------------------------- Summary of changes: ssl/s3_srvr.c | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 3072270..b60c962 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -3400,9 +3400,9 @@ int ssl3_send_cert_status(SSL *s) int ssl3_get_next_proto(SSL *s) { int ok; - int proto_len, padding_len; + unsigned int proto_len, padding_len; long n; - const unsigned char *p; + PACKET pkt; /* * Clients cannot send a NextProtocol message if we didn't see the @@ -3436,11 +3436,13 @@ int ssl3_get_next_proto(SSL *s) } if (n < 2) { - s->state = SSL_ST_ERR; - return 0; /* The body must be > 1 bytes long */ + goto err; /* The body must be > 1 bytes long */ } - p = (unsigned char *)s->init_msg; + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + SSLerr(SSL_F_SSL3_GET_NEXT_PROTO, ERR_R_INTERNAL_ERROR); + goto err; + } /*- * The payload looks like: @@ -3449,27 +3451,30 @@ int ssl3_get_next_proto(SSL *s) * uint8 padding_len; * uint8 padding[padding_len]; */ - proto_len = p[0]; - if (proto_len + 2 > s->init_num) { - s->state = SSL_ST_ERR; - return 0; - } - padding_len = p[proto_len + 1]; - if (proto_len + padding_len + 2 != s->init_num) { - s->state = SSL_ST_ERR; - return 0; + if (!PACKET_get_1(&pkt, &proto_len)){ + SSLerr(SSL_F_SSL3_GET_NEXT_PROTO, SSL_R_LENGTH_MISMATCH); + goto err; } s->next_proto_negotiated = OPENSSL_malloc(proto_len); - if (!s->next_proto_negotiated) { + if (s->next_proto_negotiated == NULL) { SSLerr(SSL_F_SSL3_GET_NEXT_PROTO, ERR_R_MALLOC_FAILURE); - s->state = SSL_ST_ERR; - return 0; + goto err; + } + + if (!PACKET_copy_bytes(&pkt, s->next_proto_negotiated, proto_len) + || !PACKET_get_1(&pkt, &padding_len) + || PACKET_remaining(&pkt) != padding_len) { + OPENSSL_free(s->next_proto_negotiated); + s->next_proto_negotiated = NULL; + SSLerr(SSL_F_SSL3_GET_NEXT_PROTO, SSL_R_LENGTH_MISMATCH); + goto err; } - memcpy(s->next_proto_negotiated, p + 1, proto_len); - s->next_proto_negotiated_len = proto_len; return 1; +err: + s->state = SSL_ST_ERR; + return 0; } #endif From matt at openssl.org Tue Aug 4 18:55:33 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 04 Aug 2015 18:55:33 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438714533.730652.1143.nullmailer@dev.openssl.org> The branch master has been updated via e77bdc7310fc8fb9e22fd481a991b3576d128b9f (commit) from c3fc7eeab884b6876a1b4006163f190d325aa047 (commit) - Log ----------------------------------------------------------------- commit e77bdc7310fc8fb9e22fd481a991b3576d128b9f Author: Matt Caswell Date: Tue Aug 4 19:18:02 2015 +0100 Fix SRTP s_client/s_server options The -use_srtp s_client/s_server option is supposed to take a colon separated string as an argument. In master this was incorrectly set to expect a filename. Reviewed-by: Rich Salz ----------------------------------------------------------------------- Summary of changes: apps/s_client.c | 2 +- apps/s_server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/s_client.c b/apps/s_client.c index 5971f8a..2b69355 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -519,7 +519,7 @@ OPTIONS s_client_options[] = { "Load the file(s) into the random number generator"}, {"sess_out", OPT_SESS_OUT, '>', "File to write SSL session to"}, {"sess_in", OPT_SESS_IN, '<', "File to read SSL session from"}, - {"use_srtp", OPT_USE_SRTP, '<', + {"use_srtp", OPT_USE_SRTP, 's', "Offer SRTP key management with a colon-separated profile list"}, {"keymatexport", OPT_KEYMATEXPORT, 's', "Export keying material using label"}, diff --git a/apps/s_server.c b/apps/s_server.c index a1fcb6e..e7c794c 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -949,7 +949,7 @@ OPTIONS s_server_options[] = { "Set the advertised protocols for the NPN extension (comma-separated list)"}, #endif #ifndef OPENSSL_NO_SRTP - {"use_srtp", OPT_SRTP_PROFILES, '<', + {"use_srtp", OPT_SRTP_PROFILES, 's', "Offer SRTP key management with a colon-separated profile list"}, {"alpn", OPT_ALPN, 's', "Set the advertised protocols for the ALPN extension (comma-separated list)"}, From rsalz at openssl.org Tue Aug 4 20:31:22 2015 From: rsalz at openssl.org (Rich Salz) Date: Tue, 04 Aug 2015 20:31:22 +0000 Subject: [openssl-commits] [web] master update Message-ID: <1438720282.643444.3760.nullmailer@dev.openssl.org> The branch master has been updated via 596c3f5934df1cbc1fc8fe61d0f690b48af753f5 (commit) from 7396e9b0e72bece0d79baa53e1459e8bdeb5cb76 (commit) - Log ----------------------------------------------------------------- commit 596c3f5934df1cbc1fc8fe61d0f690b48af753f5 Author: Rich Salz Date: Tue Aug 4 16:31:10 2015 -0400 Update non-profit org status ----------------------------------------------------------------------- Summary of changes: support/donations.wml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/support/donations.wml b/support/donations.wml index 04ad7fc..88c48e8 100644 --- a/support/donations.wml +++ b/support/donations.wml @@ -8,12 +8,15 @@

Your donation to the OpenSSL team will support the ongoing development activities of the team members.

-

Please note that the OpenSSL Software Foundation (OSF) is incorporated in the United States as a regular for-profit corporation. -It does not qualify as a non-profit, charitable organisation under Section 501(c)(3) -of the U.S. Internal Revenue Code. We looked into it and concluded that 501(c)(3) status would require more of an -investment in time and money than we can justify at present. This means that, for individuals within the U.S., donations -to the OSF are not tax-deductible. Corporate donations can of course be written off as a business expense. -

+

Please note that the OpenSSL +Software Foundation (OSF) is incorporated in the the state of Delware, +United States, as a non-profit corporation. It does not qualify as +a charitable organisation under Section 501(c)(3) of the U.S. Internal +Revenue Code. We looked into it and concluded that 501(c)(3) status +would require more of an investment in time and money than we can justify +at present. This means that, for individuals within the U.S., donations +to the OSF are not tax-deductible. Corporate donations can of course be +written off as a business expense.

In addition to direct financial contributions in the form of donations or sponsorship you may also support the OpenSSL project financially with the purchase of a support contract, From matt at openssl.org Wed Aug 5 10:14:54 2015 From: matt at openssl.org (Matt Caswell) Date: Wed, 05 Aug 2015 10:14:54 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438769694.255819.30096.nullmailer@dev.openssl.org> The branch master has been updated via 6f136aa6fc834fd841aee6c5267288ed13aae19d (commit) via 6c3cca5793b1ac57daceb8111d842f954a5ecf6a (commit) from e77bdc7310fc8fb9e22fd481a991b3576d128b9f (commit) - Log ----------------------------------------------------------------- commit 6f136aa6fc834fd841aee6c5267288ed13aae19d Author: Adam Eijdenberg Date: Tue Aug 4 15:15:38 2015 -0700 Change error reason to match previous behaviour. Reviewed-by: Tim Hudson Reviewed-by: Matt Caswell commit 6c3cca5793b1ac57daceb8111d842f954a5ecf6a Author: Adam Eijdenberg Date: Tue Aug 4 14:59:47 2015 -0700 Fix unhandled error condition in sslv2 client hello parsing. --strict-warnings started showing warnings for this today... Surely an error should be raised if these reads fail? Reviewed-by: Tim Hudson Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: ssl/s3_srvr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index b60c962..76f49bd 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -1014,6 +1014,9 @@ int ssl3_get_client_hello(SSL *s) if (!PACKET_get_net_2(&pkt, &csl) || !PACKET_get_net_2(&pkt, &sil) || !PACKET_get_net_2(&pkt, &cl)) { + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH); + al = SSL_AD_DECODE_ERROR; + goto f_err; } if (csl == 0) { From stevem at openssl.org Wed Aug 5 14:11:45 2015 From: stevem at openssl.org (Steve Marquess) Date: Wed, 05 Aug 2015 14:11:45 +0000 Subject: [openssl-commits] [web] master update Message-ID: <1438783905.391404.13165.nullmailer@dev.openssl.org> The branch master has been updated via e31df12862d63ba8ad09ec18461fb37c1698cd4b (commit) from 596c3f5934df1cbc1fc8fe61d0f690b48af753f5 (commit) - Log ----------------------------------------------------------------- commit e31df12862d63ba8ad09ec18461fb37c1698cd4b Author: Steve Marquess Date: Wed Aug 5 10:11:32 2015 -0400 Restore Nokia logo ----------------------------------------------------------------------- Summary of changes: support/acknowledgments.wml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/support/acknowledgments.wml b/support/acknowledgments.wml index 5c583ac..ca8345e 100644 --- a/support/acknowledgments.wml +++ b/support/acknowledgments.wml @@ -60,6 +60,9 @@ Platinum sponsors (listed chronologically, left to right). The sustainable fund + + + From rsalz at openssl.org Thu Aug 6 02:06:14 2015 From: rsalz at openssl.org (Rich Salz) Date: Thu, 06 Aug 2015 02:06:14 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438826774.984248.22034.nullmailer@dev.openssl.org> The branch master has been updated via 1125245997dac232a0c0867b6c858cda4e549c6d (commit) from 6f136aa6fc834fd841aee6c5267288ed13aae19d (commit) - Log ----------------------------------------------------------------- commit 1125245997dac232a0c0867b6c858cda4e549c6d Author: Anton Blanchard Date: Wed Aug 5 21:48:35 2015 -0400 RT3990: Fix #include path. Signed-off-by: Rich Salz Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: crypto/ppccap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/ppccap.c b/crypto/ppccap.c index 2b7f704..74af473 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -7,7 +7,7 @@ #if defined(__linux) || defined(_AIX) # include #endif -#include +#include #include #include "ppc_arch.h" From rsalz at openssl.org Thu Aug 6 02:06:30 2015 From: rsalz at openssl.org (Rich Salz) Date: Thu, 06 Aug 2015 02:06:30 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1438826790.859187.22871.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 9ea70e5b4097a1319d90fca289c2a3940e846f6b (commit) from 5438e17de05cfd383790c63bd5770945ac1ccc7f (commit) - Log ----------------------------------------------------------------- commit 9ea70e5b4097a1319d90fca289c2a3940e846f6b Author: Anton Blanchard Date: Wed Aug 5 21:48:35 2015 -0400 RT3990: Fix #include path. Signed-off-by: Rich Salz Reviewed-by: Tim Hudson (cherry picked from commit 1125245997dac232a0c0867b6c858cda4e549c6d) ----------------------------------------------------------------------- Summary of changes: crypto/ppccap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/ppccap.c b/crypto/ppccap.c index 2b7f704..74af473 100644 --- a/crypto/ppccap.c +++ b/crypto/ppccap.c @@ -7,7 +7,7 @@ #if defined(__linux) || defined(_AIX) # include #endif -#include +#include #include #include "ppc_arch.h" From stevem at openssl.org Thu Aug 6 13:59:49 2015 From: stevem at openssl.org (Steve Marquess) Date: Thu, 06 Aug 2015 13:59:49 +0000 Subject: [openssl-commits] [web] master update Message-ID: <1438869589.102858.16650.nullmailer@dev.openssl.org> The branch master has been updated via 3028310b6b3d3eb66b052f2fb5d065e783cafe76 (commit) from e31df12862d63ba8ad09ec18461fb37c1698cd4b (commit) - Log ----------------------------------------------------------------- commit 3028310b6b3d3eb66b052f2fb5d065e783cafe76 Author: Steve Marquess Date: Wed Aug 5 11:45:11 2015 -0400 Sort out legal entity references (long overdue!) ----------------------------------------------------------------------- Summary of changes: about/contacts.wml | 69 +++++++++++++++++++++++++++++++------ about/openssl-contact.wml | 22 ++++++++++++ docs/fips/fipsnotes.wml | 2 +- docs/fips/fipsvalidation.wml | 6 ++-- docs/fips/privatelabel.wml | 6 ++-- docs/index.wml | 2 +- support/acknowledgments.wml | 2 +- support/consulting.wml | 2 +- support/donations-cn.wml | 2 +- support/donations.wml | 8 ++--- support/funding/contract.wml | 2 +- support/funding/support-contact.wml | 12 +++---- 12 files changed, 102 insertions(+), 33 deletions(-) create mode 100644 about/openssl-contact.wml diff --git a/about/contacts.wml b/about/contacts.wml index e8d72db..658aa8d 100644 --- a/about/contacts.wml +++ b/about/contacts.wml @@ -20,36 +20,83 @@ to dispose of. You may request support, but it's the contact's responsability and freedom alone to decide if he wants to give any support or not, regardless of who makes the request.

+

The OpenSSL Software Foundation represents the OpenSSL project in most capacities including contributor license +agreements, managing donations, etc.

+

+
AddressArea covered


-OpenSSL SE
-c/o Richard Levitte
-Nordingr?gatan 20
-S-162 53 V?llingby
-Sweden
-E-mail: openssl-contact.SE at openssl.org +OpenSSL Software Foundation
+20-22 Wenlock Road
+London
+N1 7GU
+United Kingdom
++44 1785508015 (UK)
++1 877-OPENSSL(6775) (US toll free)
++1 301-956-2281 (US)
+E-mail: info at opensslfoundation.org
-Sweden only +Worldwide
-

The OpenSSL Software Foundation represents the OpenSSL project in some capacities, such as providing formal support contracts, brokering consulting contracts for OpenSSL team members, and disbursing dontations.

+

OpenSSL Software Services represents the OpenSSL project for selected commercial or quasi-commercial contexts, such +as providing formal support contracts and brokering consulting contracts for OpenSSL team members

+
AddressArea covered


-OpenSSL Software Foundation
+OpenSSL Software Services Inc.
+40 E Main St, Suite 744
+Newark DE 19711
+USA
++1 240-215-3103
+E-mail: info at opensslservices.com +
+Worldwide +
+ +

+Commercial activities specific to FIPS 140-2 validations and the OpenSSL FIPS Object Module are handled by OpenSSL Validation Services: +

+ + + + +
AddressArea covered


+OpenSSL Validation Services Inc.
1829 Mount Ephraim Road
Adamstown, MD 21710
USA
-+1 877 673 6775 -E-mail: info at opensslfoundation.com ++1 301-874-2571
+E-mail: info at openssl.com
Worldwide
+

+

+Some OpenSSL team members are available for selected consulting engagements: +

+ + + + + +
AddressArea covered


+OpenSSL SE
+c/o Richard Levitte
+Nordingr?gatan 20
+S-162 53 V?llingby
+Sweden
+E-mail: openssl-contact.SE at openssl.org +
+Sweden only +
+ diff --git a/about/openssl-contact.wml b/about/openssl-contact.wml new file mode 100644 index 0000000..8b9c590 --- /dev/null +++ b/about/openssl-contact.wml @@ -0,0 +1,22 @@ + +#use wml::openssl area=funding page=index + +OpenSSL Software Foundation Contact Info + +

OpenSSL Software Foundation Queries

+ +Direct queries concerning any non-commercial activites or issues to:
+
+OpenSSL Software Foundation
+20-22 Wenlock Road
+London
+N1 7GU
+United Kingdom
++44 1785508015 (UK)
++1 877-OPENSSL(6775) (US toll free)
++1 301-956-2281 (US)
+info at opensslfoundation.org +

+You will probably wind up talking to Steve Marquess who currently handles OpenSSL commercial contracting, he is +reachable directly at marquess at opensslfoundation.org or +the telephone numbers above. diff --git a/docs/fips/fipsnotes.wml b/docs/fips/fipsnotes.wml index 5ce62c8..ef2b234 100644 --- a/docs/fips/fipsnotes.wml +++ b/docs/fips/fipsnotes.wml @@ -84,7 +84,7 @@ no longer a suitable model for private label validations in its current form pas

Upcoming Validations

-No new validations are currently planned. The I.G. 9.5 +No new validations are currently planned. The I.G. 9.5 issue has effectively precluded consideration of new validations for much of 2013, but with the July 25 2013 update of the Implementation Guidance (I.G.) document such validations appear to be feasible again. We will be happy to discuss our current understanding of diff --git a/docs/fips/fipsvalidation.wml b/docs/fips/fipsvalidation.wml index f910477..b75ffb7 100644 --- a/docs/fips/fipsvalidation.wml +++ b/docs/fips/fipsvalidation.wml @@ -15,7 +15,7 @@ is documented in the 1.2 User Guide.

Important Note: Due to new requirements introduced in 2013 the current v2.0 Module is no longer suitable as a -reference for private label validations; see the I.G. 9.5 FAQ. +reference for private label validations; see the I.G. 9.5 FAQ. Due to earlier changes in the FIPS 140-2 validation requirements the v1.2 Module is no longer be a suitable model for private label validations in its current form past the year 2010; see the NIST @@ -83,7 +83,7 @@ remain valid for the platforms tested at the time those revisions were approved.

Sponsors

-The OpenSSL Software Foundation receives support from multiple sources for each +The OpenSSL FIPS Object Module validations receive support from multiple sources for each validation effort; however only those sponsors who have elected to be recognised for their contribution to OpenSSL are listed below.
    @@ -151,7 +151,7 @@ Directorate-sponsored Homeland Open Security Technology (HOST) program, algo

If you have an interest in sponsoring any changes or additions to this validation -please contact the OSF. +please contact OpenSSL Validation Services.

Some commercial software vendors ask us "what do we gain from sponsoring a validation that our competition can also use?". Our answer is "nothing, if you think in terms of diff --git a/docs/fips/privatelabel.wml b/docs/fips/privatelabel.wml index 81d2e0c..19a4f6e 100644 --- a/docs/fips/privatelabel.wml +++ b/docs/fips/privatelabel.wml @@ -21,8 +21,8 @@ The rest of this page is of historical interest only.

What It Is

-We have found that one of the most popular commercial services offered by the -OpenSSL Software Foundation is the private label validation. It's not a +We have found that one of the most popular commercial services offered by the OpenSSL team +is the private label validation. It's not a business we ever planned to be in, but as the originators of the source code based OpenSSL FIPS Object Module validations, and with lots of practice, we've gotten pretty good at it. The revenue we earn from these validations supports the OpenSSL project, and for some @@ -95,4 +95,4 @@ Note minor software modifications can often be accommodated in a change letter m


-Interested? Contact the OSF. +Interested? Contact OpenSSL Software Services. diff --git a/docs/index.wml b/docs/index.wml index bda3dc9..3ad49e6 100644 --- a/docs/index.wml +++ b/docs/index.wml @@ -31,7 +31,7 @@ features which are not present in other releases. HOWTO documents to introduce concepts or explain them in a way that is not possible in the manuals.

  • WIKI
    - A wiki providing information and guidance about openssl. Operated by the OpenSSL foundation. + A wiki providing information and guidance about openssl. Operated by the OpenSSL Software Foundation.

  • FIPS140:
    Data and documentation related to the FIPS140 validation support in OpenSSL diff --git a/support/acknowledgments.wml b/support/acknowledgments.wml index ca8345e..151c2fe 100644 --- a/support/acknowledgments.wml +++ b/support/acknowledgments.wml @@ -189,4 +189,4 @@ Please note that we ask permission to identify sponsors and that some sponsors w inclusion here have requested to remain anonymous.

    Additional sponsorship or financial support of any kind is always welcome; for more information please -contact the OpenSSL Software Foundation +contact the OpenSSL Software Foundation diff --git a/support/consulting.wml b/support/consulting.wml index c0fb199..12e773d 100644 --- a/support/consulting.wml +++ b/support/consulting.wml @@ -64,5 +64,5 @@ several formats such as our in mailing list announcements.

    -For further information please contact the OpenSSL Software Foundation. +For further information please contact our consulting organization, OpenSSL Software Services. diff --git a/support/donations-cn.wml b/support/donations-cn.wml index 5cad838..eef9802 100644 --- a/support/donations-cn.wml +++ b/support/donations-cn.wml @@ -116,4 +116,4 @@ We really appreciate your support of the OpenSSL project!

    As noted above these donations are currently not tax-deductible!
    -For further information please contact the OpenSSL Software Foundation. +For further information please contact the OpenSSL Software Foundation. diff --git a/support/donations.wml b/support/donations.wml index 88c48e8..33f0662 100644 --- a/support/donations.wml +++ b/support/donations.wml @@ -8,10 +8,10 @@

    Your donation to the OpenSSL team will support the ongoing development activities of the team members.

    -

    Please note that the OpenSSL -Software Foundation (OSF) is incorporated in the the state of Delware, +

    Please note that the OpenSSL +Software Foundation (OSF) is incorporated in the the state of Delaware, United States, as a non-profit corporation. It does not qualify as -a charitable organisation under Section 501(c)(3) of the U.S. Internal +a tax-exempt charitable organisation under Section 501(c)(3) of the U.S. Internal Revenue Code. We looked into it and concluded that 501(c)(3) status would require more of an investment in time and money than we can justify at present. This means that, for individuals within the U.S., donations @@ -103,4 +103,4 @@ We also accept donations in any amount via credit card or PayPal:

    As noted above these donations are currently not tax-deductible!
    -For further information please contact the OpenSSL Software Foundation. +For further information please contact the OpenSSL Software Foundation. diff --git a/support/funding/contract.wml b/support/funding/contract.wml index cd5c214..d45b6b1 100644 --- a/support/funding/contract.wml +++ b/support/funding/contract.wml @@ -33,5 +33,5 @@ custom arrangements. Per-incident support.

    -For further information please contact the OSF. +For further information please contact OpenSSL Software Services. diff --git a/support/funding/support-contact.wml b/support/funding/support-contact.wml index b6fbd07..b66b75a 100644 --- a/support/funding/support-contact.wml +++ b/support/funding/support-contact.wml @@ -7,13 +7,13 @@ Direct queries concerning support contracts, donations or consulting services to:

    -The OpenSSL Software Foundation
    -1829 Mount Ephraim Road
    -Adamstown, MD 21710
    +OpenSSL Software Services, Inc.
    +40 E Main St, Suite 744
    +Newark DE 19711
    USA
    -+1 877-OPENSSL (+1 877 673 6775)
    -info at opensslfoundation.com ++1 240-215-3103
    +info at opensslservices.com

    You will probably wind up talking to Steve Marquess who currently handles OpenSSL commercial contracting, he is -reachable directly at marquess at opensslfoundation.com or +reachable directly at marquess at openssl.com or the telephone number above. From ben at openssl.org Thu Aug 6 21:14:29 2015 From: ben at openssl.org (Ben Laurie) Date: Thu, 06 Aug 2015 21:14:29 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438895669.235719.19033.nullmailer@dev.openssl.org> The branch master has been updated via 704563f04a8401781b359906c1f88a30e12af69c (commit) from 1125245997dac232a0c0867b6c858cda4e549c6d (commit) - Log ----------------------------------------------------------------- commit 704563f04a8401781b359906c1f88a30e12af69c Author: Ben Laurie Date: Thu Aug 6 21:32:58 2015 +0100 Fix uninitalised warning. Reviewed-by: Rich Salz ----------------------------------------------------------------------- Summary of changes: test/packettest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/packettest.c b/test/packettest.c index 1ddb837..f7f9ec8 100644 --- a/test/packettest.c +++ b/test/packettest.c @@ -131,7 +131,7 @@ static int test_PACKET_get_net_2(PACKET *pkt, size_t start) static int test_PACKET_get_net_3(PACKET *pkt, size_t start) { - unsigned long i; + unsigned long i = 0; if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_net_3(pkt, &i) From matt at openssl.org Thu Aug 6 21:47:50 2015 From: matt at openssl.org (Matt Caswell) Date: Thu, 06 Aug 2015 21:47:50 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1438897670.651118.28408.nullmailer@dev.openssl.org> The branch master has been updated via e23a3fc8e38a889035bf0964c70c7699f4a38e5c (commit) via 04fe876b5616793b32e92e965a662bbbed7f71d1 (commit) from 704563f04a8401781b359906c1f88a30e12af69c (commit) - Log ----------------------------------------------------------------- commit e23a3fc8e38a889035bf0964c70c7699f4a38e5c Author: Adam Eijdenberg Date: Tue Aug 4 16:29:07 2015 -0700 Fix clang uninitialized variable warning. We could just initialize it, but to be consistent with the rest of the file it seemed to make more sense to just drop. Reviewed-by: Ben Laurie Reviewed-by: Matt Caswell commit 04fe876b5616793b32e92e965a662bbbed7f71d1 Author: Matt Caswell Date: Thu Aug 6 22:44:29 2015 +0100 Revert "Fix uninitalised warning." This reverts commit 704563f04a8401781b359906c1f88a30e12af69c. Reverting in favour of the next commit which removes the underlying cause of the warning. Reviewed-by: Ben Laurie ----------------------------------------------------------------------- Summary of changes: test/packettest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/packettest.c b/test/packettest.c index f7f9ec8..d6d0c08 100644 --- a/test/packettest.c +++ b/test/packettest.c @@ -131,7 +131,7 @@ static int test_PACKET_get_net_2(PACKET *pkt, size_t start) static int test_PACKET_get_net_3(PACKET *pkt, size_t start) { - unsigned long i = 0; + unsigned long i; if ( !PACKET_goto_bookmark(pkt, start) || !PACKET_get_net_3(pkt, &i) @@ -140,7 +140,6 @@ static int test_PACKET_get_net_3(PACKET *pkt, size_t start) || !PACKET_get_net_3(pkt, &i) || i != 0xfafcfeUL || PACKET_get_net_3(pkt, &i)) { - fprintf(stderr, "i is %ld\n", i); fprintf(stderr, "test_PACKET_get_net_3() failed\n"); return 0; } From kurt at openssl.org Fri Aug 7 20:34:26 2015 From: kurt at openssl.org (Kurt Roeckx) Date: Fri, 07 Aug 2015 20:34:26 +0000 Subject: [openssl-commits] [web] master update Message-ID: <1438979666.646377.19647.nullmailer@dev.openssl.org> The branch master has been updated via ae7d72147f98d0d1f6d20ca51a97b713446a67fc (commit) from 3028310b6b3d3eb66b052f2fb5d065e783cafe76 (commit) - Log ----------------------------------------------------------------- commit ae7d72147f98d0d1f6d20ca51a97b713446a67fc Author: Kurt Roeckx Date: Fri Aug 7 22:33:56 2015 +0200 1.0.2 is an LTS release ----------------------------------------------------------------------- Summary of changes: about/releasestrat.wml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/about/releasestrat.wml b/about/releasestrat.wml index a25b04b..fdd9163 100644 --- a/about/releasestrat.wml +++ b/about/releasestrat.wml @@ -55,7 +55,7 @@ fixes will be applied as appropriate.

    • Version 1.0.1 will be supported until 2016-12-31.

    • -
    • Version 1.0.2 will be supported until at least 2016-12-31.

    • +
    • Version 1.0.2 will be supported until 2019-12-31.

    At this time, we are not planning a 1.0.3 release.

    From rsalz at openssl.org Sat Aug 8 22:13:45 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 08 Aug 2015 22:13:45 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439072025.652867.14552.nullmailer@dev.openssl.org> The branch master has been updated via 2bfbeb264573342bea475f6dbb5b4c7fec8fdb0a (commit) from e23a3fc8e38a889035bf0964c70c7699f4a38e5c (commit) - Log ----------------------------------------------------------------- commit 2bfbeb264573342bea475f6dbb5b4c7fec8fdb0a Author: David Woodhouse Date: Fri Aug 7 22:18:26 2015 -0400 RT3998: fix X509_check_host.pod release to 1.0.2 Signed-off-by: Rich Salz Reviewed-by: Ben Laurie ----------------------------------------------------------------------- Summary of changes: doc/crypto/X509_check_host.pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/crypto/X509_check_host.pod b/doc/crypto/X509_check_host.pod index eab2586..5804115 100644 --- a/doc/crypto/X509_check_host.pod +++ b/doc/crypto/X509_check_host.pod @@ -135,6 +135,6 @@ L =head1 HISTORY -These functions were added in OpenSSL 1.1.0. +These functions were added in OpenSSL 1.0.2. =cut From rsalz at openssl.org Sat Aug 8 22:14:37 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 08 Aug 2015 22:14:37 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439072077.539107.19540.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 5d786e9e2d08900cb823b73b0095f85eb2cedc7e (commit) from 9ea70e5b4097a1319d90fca289c2a3940e846f6b (commit) - Log ----------------------------------------------------------------- commit 5d786e9e2d08900cb823b73b0095f85eb2cedc7e Author: David Woodhouse Date: Fri Aug 7 22:18:26 2015 -0400 RT3998: fix X509_check_host.pod release to 1.0.2 Signed-off-by: Rich Salz Reviewed-by: Ben Laurie (cherry picked from commit 2bfbeb264573342bea475f6dbb5b4c7fec8fdb0a) ----------------------------------------------------------------------- Summary of changes: doc/crypto/X509_check_host.pod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/crypto/X509_check_host.pod b/doc/crypto/X509_check_host.pod index 0def17a..521b9f5 100644 --- a/doc/crypto/X509_check_host.pod +++ b/doc/crypto/X509_check_host.pod @@ -135,6 +135,6 @@ L =head1 HISTORY -These functions were added in OpenSSL 1.1.0. +These functions were added in OpenSSL 1.0.2. =cut From rsalz at openssl.org Sat Aug 8 22:18:11 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 08 Aug 2015 22:18:11 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439072291.391057.26785.nullmailer@dev.openssl.org> The branch master has been updated via ff4a9394a2380140209a9ce2849f011063af1ecc (commit) from 2bfbeb264573342bea475f6dbb5b4c7fec8fdb0a (commit) - Log ----------------------------------------------------------------- commit ff4a9394a2380140209a9ce2849f011063af1ecc Author: bluelineXY Date: Tue Aug 4 13:23:00 2015 +0200 GH357: Update ocsp.c Add Host Header in OCSP query if no host header is set via -header Signed-off-by: Rich Salz Reviewed-by: Ben Laurie ----------------------------------------------------------------------- Summary of changes: apps/ocsp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/ocsp.c b/apps/ocsp.c index 44f5841..5b3092a 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1262,6 +1262,8 @@ OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, BIO *cbio = NULL; SSL_CTX *ctx = NULL; OCSP_RESPONSE *resp = NULL; + int found, i; + cbio = BIO_new_connect(host); if (!cbio) { BIO_printf(bio_err, "Error creating connect BIO\n"); @@ -1280,6 +1282,17 @@ OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, sbio = BIO_new_ssl(ctx, 1); cbio = BIO_push(sbio, cbio); } + for (found = i = 0; i < sk_CONF_VALUE_num(headers); i++) { + CONF_VALUE *hdr = sk_CONF_VALUE_value(headers, i); + if (strcasecmp("host", hdr->name) == 0) { + found = 1; + break; + } + } + + if (!found && !X509V3_add_value("Host", host, &headers)) + BIO_printf(bio_err, "Error setting HTTP Host header\n"); + resp = query_responder(cbio, path, headers, req, req_timeout); if (!resp) BIO_printf(bio_err, "Error querying OCSP responder\n"); From ben at openssl.org Mon Aug 10 12:29:13 2015 From: ben at openssl.org (Ben Laurie) Date: Mon, 10 Aug 2015 12:29:13 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439209753.382449.24187.nullmailer@dev.openssl.org> The branch master has been updated via 4b9cb35d85c32a8ebc973355bdb4833e719af108 (commit) from ff4a9394a2380140209a9ce2849f011063af1ecc (commit) - Log ----------------------------------------------------------------- commit 4b9cb35d85c32a8ebc973355bdb4833e719af108 Author: Ben Laurie Date: Sun Aug 9 10:47:03 2015 +0100 Find the right indent on *BSD. Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: util/openssl-format-source | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/openssl-format-source b/util/openssl-format-source index 4ea2f1b..7258836 100755 --- a/util/openssl-format-source +++ b/util/openssl-format-source @@ -21,6 +21,9 @@ HERE="`dirname $0`" set -e +INDENT=indent +uname -s | grep BSD > /dev/null && type gindent > /dev/null 2>&1 && INDENT=gindent + if [ $# -eq 0 ]; then echo "usage: $0 [-v] [-n] [-c] [sourcefile|sourcedir] ..." >&2 exit 1 @@ -120,11 +123,11 @@ do -e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \ -e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \ | \ - $DEBUG indent $INDENT_ARGS | \ + $DEBUG $INDENT $INDENT_ARGS | \ perl -np \ -e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \ -e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \ - | indent | \ + | $INDENT | \ perl -0 -np \ -e 's/\/\*\*INDENT-(ON|OFF)\*\*\/\n//g;' \ | perl -np \ @@ -133,7 +136,7 @@ do | perl "$HERE"/su-filter.pl \ > "$tmp" else - expand "$j" | indent $INDENT_ARGS > "$tmp" + expand "$j" | $INDENT $INDENT_ARGS > "$tmp" fi; if cmp -s "$tmp" "$j"; then if [ "$VERBOSE" = "true" ]; then From kurt at openssl.org Mon Aug 10 14:46:22 2015 From: kurt at openssl.org (Kurt Roeckx) Date: Mon, 10 Aug 2015 14:46:22 +0000 Subject: [openssl-commits] [web] master update Message-ID: <1439217982.053423.3089.nullmailer@dev.openssl.org> The branch master has been updated via 7054f23464d7f9062cd62034f4e91e346ddfd4f6 (commit) from ae7d72147f98d0d1f6d20ca51a97b713446a67fc (commit) - Log ----------------------------------------------------------------- commit 7054f23464d7f9062cd62034f4e91e346ddfd4f6 Author: Kurt Roeckx Date: Mon Aug 10 16:46:00 2015 +0200 Update last modified date ----------------------------------------------------------------------- Summary of changes: about/releasestrat.wml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/about/releasestrat.wml b/about/releasestrat.wml index fdd9163..cc20ee1 100644 --- a/about/releasestrat.wml +++ b/about/releasestrat.wml @@ -4,7 +4,7 @@ About, Release Strategy

    OpenSSL Release Strategy

    First issued 23rd December 2014

    -

    Last modified 23rd December 2014

    +

    Last modified 9th August 2015


    From rsalz at openssl.org Mon Aug 10 16:00:35 2015 From: rsalz at openssl.org (Rich Salz) Date: Mon, 10 Aug 2015 16:00:35 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439222435.711915.24168.nullmailer@dev.openssl.org> The branch master has been updated via 82c494276df9f594064688c920c4431c85759121 (commit) from 4b9cb35d85c32a8ebc973355bdb4833e719af108 (commit) - Log ----------------------------------------------------------------- commit 82c494276df9f594064688c920c4431c85759121 Author: Rich Salz Date: Mon Aug 10 11:37:48 2015 -0400 Fix build break. Reviewed-by: Viktor Dukhovni ----------------------------------------------------------------------- Summary of changes: apps/apps.h | 2 +- apps/ocsp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/apps.h b/apps/apps.h index f2dc812..99c5809 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -450,7 +450,7 @@ ENGINE *setup_engine(const char *engine, int debug); OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, const char *host, const char *path, const char *port, int use_ssl, - const STACK_OF(CONF_VALUE) *headers, + STACK_OF(CONF_VALUE) *headers, int req_timeout); # endif diff --git a/apps/ocsp.c b/apps/ocsp.c index 5b3092a..7193dae 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -1256,7 +1256,7 @@ static OCSP_RESPONSE *query_responder(BIO *cbio, const char *path, OCSP_RESPONSE *process_responder(OCSP_REQUEST *req, const char *host, const char *path, const char *port, int use_ssl, - const STACK_OF(CONF_VALUE) *headers, + STACK_OF(CONF_VALUE) *headers, int req_timeout) { BIO *cbio = NULL; From rsalz at openssl.org Mon Aug 10 16:13:51 2015 From: rsalz at openssl.org (Rich Salz) Date: Mon, 10 Aug 2015 16:13:51 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439223231.819303.5745.nullmailer@dev.openssl.org> The branch master has been updated via fbfcb2243941bc84b7585711feb906610f9111c4 (commit) from 82c494276df9f594064688c920c4431c85759121 (commit) - Log ----------------------------------------------------------------- commit fbfcb2243941bc84b7585711feb906610f9111c4 Author: Rich Salz Date: Fri Aug 7 17:09:30 2015 -0400 RT3999: Remove sub-component version strings Especially since after the #ifdef cleanups this is not useful. Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: crypto/aes/aes_misc.c | 2 -- crypto/asn1/asn1_lib.c | 1 - crypto/bf/bf_ecb.c | 2 -- crypto/bn/bn_lib.c | 2 -- crypto/camellia/cmll_misc.c | 2 -- crypto/cast/c_ecb.c | 2 -- crypto/conf/conf_def.c | 2 -- crypto/conf/conf_lib.c | 2 -- crypto/des/ecb_enc.c | 2 -- crypto/dh/dh_lib.c | 2 -- crypto/dsa/dsa_lib.c | 2 -- crypto/ec/ec_lib.c | 2 -- crypto/ecdh/ech_lib.c | 2 -- crypto/ecdsa/ecs_lib.c | 2 -- crypto/evp/evp_enc.c | 2 -- crypto/idea/i_ecb.c | 2 -- crypto/lhash/lhash.c | 2 -- crypto/md2/md2_dgst.c | 2 -- crypto/md4/md4_dgst.c | 2 -- crypto/md5/md5_dgst.c | 2 -- crypto/pem/pem_lib.c | 2 -- crypto/rand/md_rand.c | 2 -- crypto/rc2/rc2_ecb.c | 2 -- crypto/rc4/rc4_skey.c | 2 -- crypto/rc5/rc5_ecb.c | 2 -- crypto/ripemd/rmd_dgst.c | 2 -- crypto/rsa/rsa_lib.c | 2 -- crypto/sha/sha1dgst.c | 2 -- crypto/sha/sha256.c | 2 -- crypto/sha/sha512.c | 2 -- crypto/stack/stack.c | 2 -- crypto/txt_db/txt_db.c | 2 -- crypto/x509/x509_vfy.c | 1 - include/openssl/opensslv.h | 1 - ssl/d1_lib.c | 1 - ssl/s3_lib.c | 2 -- ssl/t1_lib.c | 2 -- 37 files changed, 70 deletions(-) diff --git a/crypto/aes/aes_misc.c b/crypto/aes/aes_misc.c index 68a48ba..1775442 100644 --- a/crypto/aes/aes_misc.c +++ b/crypto/aes/aes_misc.c @@ -53,8 +53,6 @@ #include #include "aes_locl.h" -const char AES_version[] = "AES" OPENSSL_VERSION_PTEXT; - const char *AES_options(void) { #ifdef FULL_UNROLL diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index b611f35..94b5ad5 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -64,7 +64,6 @@ static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, int max); static void asn1_put_length(unsigned char **pp, int length); -const char ASN1_version[] = "ASN.1" OPENSSL_VERSION_PTEXT; static int _asn1_check_infinite_end(const unsigned char **p, long len) { diff --git a/crypto/bf/bf_ecb.c b/crypto/bf/bf_ecb.c index 967a7f5..7a45a02 100644 --- a/crypto/bf/bf_ecb.c +++ b/crypto/bf/bf_ecb.c @@ -66,8 +66,6 @@ * SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993) */ -const char BF_version[] = "Blowfish" OPENSSL_VERSION_PTEXT; - const char *BF_options(void) { #ifdef BF_PTR diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c index f10f44a..4e133ce 100644 --- a/crypto/bn/bn_lib.c +++ b/crypto/bn/bn_lib.c @@ -66,8 +66,6 @@ #include "internal/cryptlib.h" #include "bn_lcl.h" -const char BN_version[] = "Big Number" OPENSSL_VERSION_PTEXT; - /* This stuff appears to be completely unused, so is deprecated */ #ifndef OPENSSL_NO_DEPRECATED /*- diff --git a/crypto/camellia/cmll_misc.c b/crypto/camellia/cmll_misc.c index 4e15906..d73499b 100644 --- a/crypto/camellia/cmll_misc.c +++ b/crypto/camellia/cmll_misc.c @@ -53,8 +53,6 @@ #include #include "cmll_locl.h" -const char CAMELLIA_version[] = "CAMELLIA" OPENSSL_VERSION_PTEXT; - int Camellia_set_key(const unsigned char *userKey, const int bits, CAMELLIA_KEY *key) { diff --git a/crypto/cast/c_ecb.c b/crypto/cast/c_ecb.c index 4793f28..2430bb5 100644 --- a/crypto/cast/c_ecb.c +++ b/crypto/cast/c_ecb.c @@ -60,8 +60,6 @@ #include "cast_lcl.h" #include -const char CAST_version[] = "CAST" OPENSSL_VERSION_PTEXT; - void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, const CAST_KEY *ks, int enc) { diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 098fc8e..b490377 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -88,8 +88,6 @@ static int def_dump(const CONF *conf, BIO *bp); static int def_is_number(const CONF *conf, char c); static int def_to_int(const CONF *conf, char c); -const char CONF_def_version[] = "CONF_def" OPENSSL_VERSION_PTEXT; - static CONF_METHOD default_method = { "OpenSSL default", def_create, diff --git a/crypto/conf/conf_lib.c b/crypto/conf/conf_lib.c index 838a645..12a061c 100644 --- a/crypto/conf/conf_lib.c +++ b/crypto/conf/conf_lib.c @@ -64,8 +64,6 @@ #include #include -const char CONF_version[] = "CONF" OPENSSL_VERSION_PTEXT; - static CONF_METHOD *default_CONF_method = NULL; /* Init a 'CONF' structure from an old LHASH */ diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c index f97fd97..d638a49 100644 --- a/crypto/des/ecb_enc.c +++ b/crypto/des/ecb_enc.c @@ -61,8 +61,6 @@ #include #include -OPENSSL_GLOBAL const char libdes_version[] = "libdes" OPENSSL_VERSION_PTEXT; -OPENSSL_GLOBAL const char DES_version[] = "DES" OPENSSL_VERSION_PTEXT; const char *DES_options(void) { diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index cce2514..4e087d0 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -64,8 +64,6 @@ # include #endif -const char DH_version[] = "Diffie-Hellman" OPENSSL_VERSION_PTEXT; - static const DH_METHOD *default_DH_method = NULL; void DH_set_default_method(const DH_METHOD *meth) diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index cb59e7e..a4a8163 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -70,8 +70,6 @@ # include #endif -const char DSA_version[] = "DSA" OPENSSL_VERSION_PTEXT; - static const DSA_METHOD *default_DSA_method = NULL; void DSA_set_default_method(const DSA_METHOD *meth) diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 3ddaa5d..cd08a55 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -68,8 +68,6 @@ #include "ec_lcl.h" -const char EC_version[] = "EC" OPENSSL_VERSION_PTEXT; - /* functions for EC_GROUP objects */ EC_GROUP *EC_GROUP_new(const EC_METHOD *meth) diff --git a/crypto/ecdh/ech_lib.c b/crypto/ecdh/ech_lib.c index 62734bc..363d2fe 100644 --- a/crypto/ecdh/ech_lib.c +++ b/crypto/ecdh/ech_lib.c @@ -74,8 +74,6 @@ #endif #include -const char ECDH_version[] = "ECDH" OPENSSL_VERSION_PTEXT; - static const ECDH_METHOD *default_ECDH_method = NULL; static void *ecdh_data_new(void); diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c index cabf6ec..0db3534 100644 --- a/crypto/ecdsa/ecs_lib.c +++ b/crypto/ecdsa/ecs_lib.c @@ -61,8 +61,6 @@ #include #include -const char ECDSA_version[] = "ECDSA" OPENSSL_VERSION_PTEXT; - static const ECDSA_METHOD *default_ECDSA_method = NULL; static void *ecdsa_data_new(void); diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 125556e..405cbb0 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -66,8 +66,6 @@ #endif #include "evp_locl.h" -const char EVP_version[] = "EVP" OPENSSL_VERSION_PTEXT; - void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { memset(ctx, 0, sizeof(*ctx)); diff --git a/crypto/idea/i_ecb.c b/crypto/idea/i_ecb.c index a6b879a..4ed206e 100644 --- a/crypto/idea/i_ecb.c +++ b/crypto/idea/i_ecb.c @@ -60,8 +60,6 @@ #include "idea_lcl.h" #include -const char IDEA_version[] = "IDEA" OPENSSL_VERSION_PTEXT; - const char *idea_options(void) { if (sizeof(short) != sizeof(IDEA_INT)) diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c index 083310e..0c9ce8f 100644 --- a/crypto/lhash/lhash.c +++ b/crypto/lhash/lhash.c @@ -101,8 +101,6 @@ #include #include -const char lh_version[] = "lhash" OPENSSL_VERSION_PTEXT; - #undef MIN_NODES #define MIN_NODES 16 #define UP_LOAD (2*LH_LOAD_MULT) /* load times 256 (default 2) */ diff --git a/crypto/md2/md2_dgst.c b/crypto/md2/md2_dgst.c index 70c19fb..bb0a7a3 100644 --- a/crypto/md2/md2_dgst.c +++ b/crypto/md2/md2_dgst.c @@ -63,8 +63,6 @@ #include #include -const char MD2_version[] = "MD2" OPENSSL_VERSION_PTEXT; - /* * Implemented from RFC1319 The MD2 Message-Digest Algorithm */ diff --git a/crypto/md4/md4_dgst.c b/crypto/md4/md4_dgst.c index 966cebe..2b7881e 100644 --- a/crypto/md4/md4_dgst.c +++ b/crypto/md4/md4_dgst.c @@ -60,8 +60,6 @@ #include #include "md4_locl.h" -const char MD4_version[] = "MD4" OPENSSL_VERSION_PTEXT; - /* * Implemented from RFC1186 The MD4 Message-Digest Algorithm */ diff --git a/crypto/md5/md5_dgst.c b/crypto/md5/md5_dgst.c index 335126c..f73ca7c 100644 --- a/crypto/md5/md5_dgst.c +++ b/crypto/md5/md5_dgst.c @@ -60,8 +60,6 @@ #include "md5_locl.h" #include -const char MD5_version[] = "MD5" OPENSSL_VERSION_PTEXT; - /* * Implemented from RFC1321 The MD5 Message-Digest Algorithm */ diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index 47be640..23b347f 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -74,8 +74,6 @@ # include #endif -const char PEM_version[] = "PEM" OPENSSL_VERSION_PTEXT; - #define MIN_LENGTH 4 static int load_iv(char **fromp, unsigned char *to, int num); diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c index 27e785d..c7d54ed 100644 --- a/crypto/rand/md_rand.c +++ b/crypto/rand/md_rand.c @@ -164,8 +164,6 @@ static CRYPTO_THREADID locking_threadid; int rand_predictable = 0; #endif -const char RAND_version[] = "RAND" OPENSSL_VERSION_PTEXT; - static void rand_hw_seed(EVP_MD_CTX *ctx); static void ssleay_rand_cleanup(void); diff --git a/crypto/rc2/rc2_ecb.c b/crypto/rc2/rc2_ecb.c index 48442a3..4cb1a80 100644 --- a/crypto/rc2/rc2_ecb.c +++ b/crypto/rc2/rc2_ecb.c @@ -60,8 +60,6 @@ #include "rc2_locl.h" #include -const char RC2_version[] = "RC2" OPENSSL_VERSION_PTEXT; - /*- * RC2 as implemented frm a posting from * Newsgroups: sci.crypt diff --git a/crypto/rc4/rc4_skey.c b/crypto/rc4/rc4_skey.c index ce38224..7b198bb 100644 --- a/crypto/rc4/rc4_skey.c +++ b/crypto/rc4/rc4_skey.c @@ -60,8 +60,6 @@ #include "rc4_locl.h" #include -const char RC4_version[] = "RC4" OPENSSL_VERSION_PTEXT; - const char *RC4_options(void) { #ifdef RC4_INDEX diff --git a/crypto/rc5/rc5_ecb.c b/crypto/rc5/rc5_ecb.c index e657a93..2b5fa2a 100644 --- a/crypto/rc5/rc5_ecb.c +++ b/crypto/rc5/rc5_ecb.c @@ -60,8 +60,6 @@ #include "rc5_locl.h" #include -const char RC5_version[] = "RC5" OPENSSL_VERSION_PTEXT; - void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out, RC5_32_KEY *ks, int encrypt) { diff --git a/crypto/ripemd/rmd_dgst.c b/crypto/ripemd/rmd_dgst.c index 2496c11..f351df1 100644 --- a/crypto/ripemd/rmd_dgst.c +++ b/crypto/ripemd/rmd_dgst.c @@ -60,8 +60,6 @@ #include "rmd_locl.h" #include -const char RMD160_version[] = "RIPE-MD160" OPENSSL_VERSION_PTEXT; - #ifdef RMD160_ASM void ripemd160_block_x86(RIPEMD160_CTX *c, unsigned long *p, size_t num); # define ripemd160_block ripemd160_block_x86 diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 2ec39e7..76c9796 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -67,8 +67,6 @@ # include #endif -const char RSA_version[] = "RSA" OPENSSL_VERSION_PTEXT; - static const RSA_METHOD *default_RSA_meth = NULL; RSA *RSA_new(void) diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c index 9f1b8f0..a6c6338 100644 --- a/crypto/sha/sha1dgst.c +++ b/crypto/sha/sha1dgst.c @@ -61,8 +61,6 @@ # include -const char SHA1_version[] = "SHA1" OPENSSL_VERSION_PTEXT; - /* The implementation is in ../md32_common.h */ # include "sha_locl.h" diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c index c112b04..096981b 100644 --- a/crypto/sha/sha256.c +++ b/crypto/sha/sha256.c @@ -13,8 +13,6 @@ #include #include -const char SHA256_version[] = "SHA-256" OPENSSL_VERSION_PTEXT; - int SHA224_Init(SHA256_CTX *c) { memset(c, 0, sizeof(*c)); diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c index ebae411..427cdf5 100644 --- a/crypto/sha/sha512.c +++ b/crypto/sha/sha512.c @@ -49,8 +49,6 @@ #include "internal/cryptlib.h" -const char SHA512_version[] = "SHA-512" OPENSSL_VERSION_PTEXT; - #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \ defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \ defined(__s390__) || defined(__s390x__) || \ diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c index a6182df..c7643db 100644 --- a/crypto/stack/stack.c +++ b/crypto/stack/stack.c @@ -71,8 +71,6 @@ struct stack_st { #undef MIN_NODES #define MIN_NODES 4 -const char STACK_version[] = "Stack" OPENSSL_VERSION_PTEXT; - #include int (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *))) diff --git a/crypto/txt_db/txt_db.c b/crypto/txt_db/txt_db.c index 5b1e592..2c4d2cd 100644 --- a/crypto/txt_db/txt_db.c +++ b/crypto/txt_db/txt_db.c @@ -66,8 +66,6 @@ #undef BUFSIZE #define BUFSIZE 512 -const char TXT_DB_version[] = "TXT_DB" OPENSSL_VERSION_PTEXT; - TXT_DB *TXT_DB_read(BIO *in, int num) { TXT_DB *ret = NULL; diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index df012dd..26867cb 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -138,7 +138,6 @@ static int check_crl_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *crl_path); static int internal_verify(X509_STORE_CTX *ctx); -const char X509_version[] = "X.509" OPENSSL_VERSION_PTEXT; static int null_callback(int ok, X509_STORE_CTX *e) { diff --git a/include/openssl/opensslv.h b/include/openssl/opensslv.h index 97c27e7..5b6abdf 100644 --- a/include/openssl/opensslv.h +++ b/include/openssl/opensslv.h @@ -36,7 +36,6 @@ extern "C" { # else # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0-dev xx XXX xxxx" # endif -# define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT /*- * The macros below are to be used for shared library (.so, .dll, ...) diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index c0ed8fb..fc1887a 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -75,7 +75,6 @@ static void get_current_time(struct timeval *t); static int dtls1_set_handshake_header(SSL *s, int type, unsigned long len); static int dtls1_handshake_write(SSL *s); -const char dtls1_version_str[] = "DTLSv1" OPENSSL_VERSION_PTEXT; int dtls1_listen(SSL *s, struct sockaddr *client); const SSL3_ENC_METHOD DTLSv1_enc_data = { diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index d39346a..83b8f68 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -157,8 +157,6 @@ #endif #include -const char ssl3_version_str[] = "SSLv3" OPENSSL_VERSION_PTEXT; - #define SSL3_NUM_CIPHERS OSSL_NELEM(ssl3_ciphers) /* list of available SSLv3 ciphers (sorted by id) */ diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index c0dd35f..ece2b72 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -121,8 +121,6 @@ #endif #include "ssl_locl.h" -const char tls1_version_str[] = "TLSv1" OPENSSL_VERSION_PTEXT; - static int tls_decrypt_ticket(SSL *s, const unsigned char *tick, int ticklen, const unsigned char *sess_id, int sesslen, SSL_SESSION **psess); From rsalz at openssl.org Mon Aug 10 16:18:00 2015 From: rsalz at openssl.org (Rich Salz) Date: Mon, 10 Aug 2015 16:18:00 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439223480.895286.10626.nullmailer@dev.openssl.org> The branch master has been updated via fd682e4cddc44b2869f43c910be49ab4f3a09b08 (commit) from fbfcb2243941bc84b7585711feb906610f9111c4 (commit) - Log ----------------------------------------------------------------- commit fd682e4cddc44b2869f43c910be49ab4f3a09b08 Author: Rich Salz Date: Thu Aug 6 12:22:31 2015 -0400 GH365: Missing #ifdef rename. Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: apps/speed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/speed.c b/apps/speed.c index 1a3027b..ca93d2c 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -429,7 +429,7 @@ OPT_PAIR doit_choices[] = { #ifndef OPENSSL_NO_WHIRLPOOL {"whirlpool", D_WHIRLPOOL}, #endif -#ifndef OPENSSL_NO_RIPEMD +#ifndef OPENSSL_NO_RMD160 {"ripemd", D_RMD160}, {"rmd160", D_RMD160}, {"ripemd160", D_RMD160}, @@ -605,7 +605,7 @@ int speed_main(int argc, char **argv) #ifndef OPENSSL_NO_WHIRLPOOL unsigned char whirlpool[WHIRLPOOL_DIGEST_LENGTH]; #endif -#ifndef OPENSSL_NO_RIPEMD +#ifndef OPENSSL_NO_RMD160 unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; #endif #ifndef OPENSSL_NO_RC4 From matt at openssl.org Tue Aug 11 19:26:29 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 19:26:29 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439321189.563068.29686.nullmailer@dev.openssl.org> The branch master has been updated via 6a009812b2e249fed01488f6f19f9fbfd9ee74c4 (commit) via 61e72d761c945e128ca13599a98a187ac23650dd (commit) via 870063c83db6514b0cb637b86cadbc9f5c2270a9 (commit) from fd682e4cddc44b2869f43c910be49ab4f3a09b08 (commit) - Log ----------------------------------------------------------------- commit 6a009812b2e249fed01488f6f19f9fbfd9ee74c4 Author: Matt Caswell Date: Mon Aug 10 12:00:29 2015 +0100 Check for 0 modulus in BN_MONT_CTX_set The function BN_MONT_CTX_set was assuming that the modulus was non-zero and therefore that |mod->top| > 0. In an error situation that may not be the case and could cause a seg fault. This is a follow on from CVE-2015-1794. Reviewed-by: Richard Levitte commit 61e72d761c945e128ca13599a98a187ac23650dd Author: Guy Leaver (guleaver) Date: Fri Aug 7 15:45:21 2015 +0100 Fix seg fault with 0 p val in SKE If a client receives a ServerKeyExchange for an anon DH ciphersuite with the value of p set to 0 then a seg fault can occur. This commits adds a test to reject p, g and pub key parameters that have a 0 value (in accordance with RFC 5246) The security vulnerability only affects master and 1.0.2, but the fix is additionally applied to 1.0.1 for additional confidence. CVE-2015-1794 Reviewed-by: Richard Levitte Reviewed-by: Matt Caswell commit 870063c83db6514b0cb637b86cadbc9f5c2270a9 Author: Matt Caswell Date: Fri Aug 7 15:42:37 2015 +0100 Normalise make errors output make errors wants things in a different order to the way things are currently defined in the header files. The easiest fix is to just let it reorder it. Reviewed-by: Richard Levitte ----------------------------------------------------------------------- Summary of changes: crypto/bn/bn_mont.c | 3 +++ include/openssl/ssl.h | 5 ++++- ssl/s3_clnt.c | 16 ++++++++++++++++ ssl/ssl_err.c | 5 ++++- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index 1580e97..d4d817a 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -351,6 +351,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) int ret = 0; BIGNUM *Ri, *R; + if (BN_is_zero(mod)) + return 0; + BN_CTX_start(ctx); if ((Ri = BN_CTX_get(ctx)) == NULL) goto err; diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 06ac5c1..28c2fb9 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -2016,7 +2016,6 @@ void ERR_load_SSL_strings(void); # define SSL_F_SSL_CTX_SET_TRUST 229 # define SSL_F_SSL_CTX_USE_CERTIFICATE 171 # define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172 -# define SSL_F_USE_CERTIFICATE_CHAIN_FILE 220 # define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173 # define SSL_F_SSL_CTX_USE_PRIVATEKEY 174 # define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175 @@ -2097,6 +2096,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_TLS1_PROCESS_HEARTBEAT 341 # define SSL_F_TLS1_SETUP_KEY_BLOCK 211 # define SSL_F_TLS1_SET_SERVER_SIGALGS 335 +# define SSL_F_USE_CERTIFICATE_CHAIN_FILE 220 /* Reason codes. */ # define SSL_R_APP_DATA_IN_HANDSHAKE 100 @@ -2107,8 +2107,11 @@ void ERR_load_SSL_strings(void); # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 # define SSL_R_BAD_DECOMPRESSION 107 # define SSL_R_BAD_DH_G_LENGTH 108 +# define SSL_R_BAD_DH_G_VALUE 375 # define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 # define SSL_R_BAD_DH_P_LENGTH 110 +# define SSL_R_BAD_DH_P_VALUE 395 # define SSL_R_BAD_DIGEST_LENGTH 111 # define SSL_R_BAD_DSA_SIGNATURE 112 # define SSL_R_BAD_ECC_CERT 304 diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index cd6918a..1661b0e 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -1693,6 +1693,12 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->p)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE); + goto f_err; + } + + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1713,6 +1719,11 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->g)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE); + goto f_err; + } + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1734,6 +1745,11 @@ int ssl3_get_key_exchange(SSL *s) p += i; n -= param_len; + if (BN_is_zero(dh->pub_key)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_PUB_KEY_VALUE); + goto f_err; + } + if (!ssl_security(s, SSL_SECOP_TMP_DH, DH_security_bits(dh), 0, dh)) { al = SSL_AD_HANDSHAKE_FAILURE; SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_DH_KEY_TOO_SMALL); diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 539146f..21836d8 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -226,7 +226,6 @@ static ERR_STRING_DATA SSL_str_functs[] = { {ERR_FUNC(SSL_F_SSL_CTX_USE_CERTIFICATE), "SSL_CTX_use_certificate"}, {ERR_FUNC(SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1), "SSL_CTX_use_certificate_ASN1"}, - {ERR_FUNC(SSL_F_USE_CERTIFICATE_CHAIN_FILE), "use_certificate_chain_file"}, {ERR_FUNC(SSL_F_SSL_CTX_USE_CERTIFICATE_FILE), "SSL_CTX_use_certificate_file"}, {ERR_FUNC(SSL_F_SSL_CTX_USE_PRIVATEKEY), "SSL_CTX_use_PrivateKey"}, @@ -331,6 +330,7 @@ static ERR_STRING_DATA SSL_str_functs[] = { {ERR_FUNC(SSL_F_TLS1_PROCESS_HEARTBEAT), "tls1_process_heartbeat"}, {ERR_FUNC(SSL_F_TLS1_SETUP_KEY_BLOCK), "tls1_setup_key_block"}, {ERR_FUNC(SSL_F_TLS1_SET_SERVER_SIGALGS), "tls1_set_server_sigalgs"}, + {ERR_FUNC(SSL_F_USE_CERTIFICATE_CHAIN_FILE), "use_certificate_chain_file"}, {0, NULL} }; @@ -345,8 +345,11 @@ static ERR_STRING_DATA SSL_str_reasons[] = { "bad data returned by callback"}, {ERR_REASON(SSL_R_BAD_DECOMPRESSION), "bad decompression"}, {ERR_REASON(SSL_R_BAD_DH_G_LENGTH), "bad dh g length"}, + {ERR_REASON(SSL_R_BAD_DH_G_VALUE), "bad dh g value"}, {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_LENGTH), "bad dh pub key length"}, + {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_VALUE), "bad dh pub key value"}, {ERR_REASON(SSL_R_BAD_DH_P_LENGTH), "bad dh p length"}, + {ERR_REASON(SSL_R_BAD_DH_P_VALUE), "bad dh p value"}, {ERR_REASON(SSL_R_BAD_DIGEST_LENGTH), "bad digest length"}, {ERR_REASON(SSL_R_BAD_DSA_SIGNATURE), "bad dsa signature"}, {ERR_REASON(SSL_R_BAD_ECC_CERT), "bad ecc cert"}, From matt at openssl.org Tue Aug 11 19:26:39 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 19:26:39 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439321199.710729.30602.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 512368c9ed4d53fb230000e83071eb81bf628b22 (commit) via ada57746b6b80beae73111fe1291bf8dd89af91c (commit) from 5d786e9e2d08900cb823b73b0095f85eb2cedc7e (commit) - Log ----------------------------------------------------------------- commit 512368c9ed4d53fb230000e83071eb81bf628b22 Author: Matt Caswell Date: Mon Aug 10 12:00:29 2015 +0100 Check for 0 modulus in BN_MONT_CTX_set The function BN_MONT_CTX_set was assuming that the modulus was non-zero and therefore that |mod->top| > 0. In an error situation that may not be the case and could cause a seg fault. This is a follow on from CVE-2015-1794. Reviewed-by: Richard Levitte commit ada57746b6b80beae73111fe1291bf8dd89af91c Author: Guy Leaver (guleaver) Date: Fri Aug 7 15:45:21 2015 +0100 Fix seg fault with 0 p val in SKE If a client receives a ServerKeyExchange for an anon DH ciphersuite with the value of p set to 0 then a seg fault can occur. This commits adds a test to reject p, g and pub key parameters that have a 0 value (in accordance with RFC 5246) The security vulnerability only affects master and 1.0.2, but the fix is additionally applied to 1.0.1 for additional confidence. CVE-2015-1794 Reviewed-by: Richard Levitte Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: crypto/bn/bn_mont.c | 3 +++ ssl/s3_clnt.c | 16 ++++++++++++++++ ssl/ssl.h | 3 +++ ssl/ssl_err.c | 3 +++ 4 files changed, 25 insertions(+) diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index aafd1b8..be95bd5 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) int ret = 0; BIGNUM *Ri, *R; + if (BN_is_zero(mod)) + return 0; + BN_CTX_start(ctx); if ((Ri = BN_CTX_get(ctx)) == NULL) goto err; diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 6af145a..2059151 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -1699,6 +1699,12 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->p)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE); + goto f_err; + } + + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1719,6 +1725,11 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->g)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE); + goto f_err; + } + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1740,6 +1751,11 @@ int ssl3_get_key_exchange(SSL *s) p += i; n -= param_len; + if (BN_is_zero(dh->pub_key)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_PUB_KEY_VALUE); + goto f_err; + } + # ifndef OPENSSL_NO_RSA if (alg_a & SSL_aRSA) pkey = diff --git a/ssl/ssl.h b/ssl/ssl.h index 6fe1a24..c6c5bce 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -2846,8 +2846,11 @@ void ERR_load_SSL_strings(void); # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 # define SSL_R_BAD_DECOMPRESSION 107 # define SSL_R_BAD_DH_G_LENGTH 108 +# define SSL_R_BAD_DH_G_VALUE 375 # define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 # define SSL_R_BAD_DH_P_LENGTH 110 +# define SSL_R_BAD_DH_P_VALUE 395 # define SSL_R_BAD_DIGEST_LENGTH 111 # define SSL_R_BAD_DSA_SIGNATURE 112 # define SSL_R_BAD_ECC_CERT 304 diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 1a6030e..202228b 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -386,8 +386,11 @@ static ERR_STRING_DATA SSL_str_reasons[] = { "bad data returned by callback"}, {ERR_REASON(SSL_R_BAD_DECOMPRESSION), "bad decompression"}, {ERR_REASON(SSL_R_BAD_DH_G_LENGTH), "bad dh g length"}, + {ERR_REASON(SSL_R_BAD_DH_G_VALUE), "bad dh g value"}, {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_LENGTH), "bad dh pub key length"}, + {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_VALUE), "bad dh pub key value"}, {ERR_REASON(SSL_R_BAD_DH_P_LENGTH), "bad dh p length"}, + {ERR_REASON(SSL_R_BAD_DH_P_VALUE), "bad dh p value"}, {ERR_REASON(SSL_R_BAD_DIGEST_LENGTH), "bad digest length"}, {ERR_REASON(SSL_R_BAD_DSA_SIGNATURE), "bad dsa signature"}, {ERR_REASON(SSL_R_BAD_ECC_CERT), "bad ecc cert"}, From matt at openssl.org Tue Aug 11 19:26:51 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 19:26:51 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_1-stable update Message-ID: <1439321211.091742.30987.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_1-stable has been updated via b11980d79a52ec08844f08bea0e66c04b691840b (commit) via f15c99f4d4a96b692bdbb6f343c9112f2fa5a8ed (commit) from 507ea77b82f99af8cdae22bebb49fb2772d95330 (commit) - Log ----------------------------------------------------------------- commit b11980d79a52ec08844f08bea0e66c04b691840b Author: Matt Caswell Date: Mon Aug 10 12:00:29 2015 +0100 Check for 0 modulus in BN_MONT_CTX_set The function BN_MONT_CTX_set was assuming that the modulus was non-zero and therefore that |mod->top| > 0. In an error situation that may not be the case and could cause a seg fault. This is a follow on from CVE-2015-1794. Reviewed-by: Richard Levitte commit f15c99f4d4a96b692bdbb6f343c9112f2fa5a8ed Author: Guy Leaver (guleaver) Date: Fri Aug 7 15:45:21 2015 +0100 Fix seg fault with 0 p val in SKE If a client receives a ServerKeyExchange for an anon DH ciphersuite with the value of p set to 0 then a seg fault can occur. This commits adds a test to reject p, g and pub key parameters that have a 0 value (in accordance with RFC 5246) The security vulnerability only affects master and 1.0.2, but the fix is additionally applied to 1.0.1 for additional confidence. CVE-2015-1794 Reviewed-by: Richard Levitte Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: crypto/bn/bn_mont.c | 3 +++ ssl/s3_clnt.c | 16 ++++++++++++++++ ssl/ssl.h | 3 +++ ssl/ssl_err.c | 3 +++ 4 files changed, 25 insertions(+) diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c index aafd1b8..be95bd5 100644 --- a/crypto/bn/bn_mont.c +++ b/crypto/bn/bn_mont.c @@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) int ret = 0; BIGNUM *Ri, *R; + if (BN_is_zero(mod)) + return 0; + BN_CTX_start(ctx); if ((Ri = BN_CTX_get(ctx)) == NULL) goto err; diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 35ad121..c89564b 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -1624,6 +1624,12 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->p)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE); + goto f_err; + } + + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1644,6 +1650,11 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->g)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE); + goto f_err; + } + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1665,6 +1676,11 @@ int ssl3_get_key_exchange(SSL *s) p += i; n -= param_len; + if (BN_is_zero(dh->pub_key)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_PUB_KEY_VALUE); + goto f_err; + } + # ifndef OPENSSL_NO_RSA if (alg_a & SSL_aRSA) pkey = diff --git a/ssl/ssl.h b/ssl/ssl.h index d2ab0c0..d9657eb 100644 --- a/ssl/ssl.h +++ b/ssl/ssl.h @@ -2465,8 +2465,11 @@ void ERR_load_SSL_strings(void); # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 # define SSL_R_BAD_DECOMPRESSION 107 # define SSL_R_BAD_DH_G_LENGTH 108 +# define SSL_R_BAD_DH_G_VALUE 375 # define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 # define SSL_R_BAD_DH_P_LENGTH 110 +# define SSL_R_BAD_DH_P_VALUE 395 # define SSL_R_BAD_DIGEST_LENGTH 111 # define SSL_R_BAD_DSA_SIGNATURE 112 # define SSL_R_BAD_ECC_CERT 304 diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c index 88621b7..26f149e 100644 --- a/ssl/ssl_err.c +++ b/ssl/ssl_err.c @@ -369,8 +369,11 @@ static ERR_STRING_DATA SSL_str_reasons[] = { "bad data returned by callback"}, {ERR_REASON(SSL_R_BAD_DECOMPRESSION), "bad decompression"}, {ERR_REASON(SSL_R_BAD_DH_G_LENGTH), "bad dh g length"}, + {ERR_REASON(SSL_R_BAD_DH_G_VALUE), "bad dh g value"}, {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_LENGTH), "bad dh pub key length"}, + {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_VALUE), "bad dh pub key value"}, {ERR_REASON(SSL_R_BAD_DH_P_LENGTH), "bad dh p length"}, + {ERR_REASON(SSL_R_BAD_DH_P_VALUE), "bad dh p value"}, {ERR_REASON(SSL_R_BAD_DIGEST_LENGTH), "bad digest length"}, {ERR_REASON(SSL_R_BAD_DSA_SIGNATURE), "bad dsa signature"}, {ERR_REASON(SSL_R_BAD_ECC_CERT), "bad ecc cert"}, From matt at openssl.org Tue Aug 11 19:34:59 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 19:34:59 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439321699.256684.6586.nullmailer@dev.openssl.org> The branch master has been updated via 6142f5c640f98429d4798b8418e8cc2cf6cc1fb8 (commit) via c0cbb4c19bb6e22b338dd17c096be323f7414faf (commit) via c2a34c58f56980b80f034e8295210146b5c247c3 (commit) via a1accbb1d704da9a25b18e7053ee191a8f510d93 (commit) via 011467ee55aa82a96cd8a539560c46fd4504a82b (commit) via 631c1206334adfb21758220362a56fa157a47596 (commit) via 2d5d70b15559f9813054ddb11b30b816daf62ebe (commit) from 6a009812b2e249fed01488f6f19f9fbfd9ee74c4 (commit) - Log ----------------------------------------------------------------- commit 6142f5c640f98429d4798b8418e8cc2cf6cc1fb8 Author: Matt Caswell Date: Tue Aug 11 11:41:51 2015 +0100 make update Run a "make update" for the OSSLTest Engine changes Reviewed-by: Richard Levitte commit c0cbb4c19bb6e22b338dd17c096be323f7414faf Author: Richard Levitte Date: Mon Aug 10 10:46:27 2015 +0100 Use dynamic engine for libssl test harness Use a dynamic engine for ossltest engine so that we can build it without subsequently deploying it during install. We do not want people accidentally using this engine. Reviewed-by: Richard Levitte Reviewed-by: Matt Caswell commit c2a34c58f56980b80f034e8295210146b5c247c3 Author: Matt Caswell Date: Fri Aug 7 14:40:00 2015 +0100 Add a test for 0 p value in anon DH SKE When using an anon DH ciphersuite a client should reject a 0 value for p. Reviewed-by: Richard Levitte commit a1accbb1d704da9a25b18e7053ee191a8f510d93 Author: Matt Caswell Date: Fri Aug 7 14:38:21 2015 +0100 Extend TLSProxy capabilities Add ServerHello parsing to TLSProxy. Also add some (very) limited ServerKeyExchange parsing. Add the capability to set client and server cipher lists Fix a bug with fragment lengths Reviewed-by: Richard Levitte commit 011467ee55aa82a96cd8a539560c46fd4504a82b Author: Matt Caswell Date: Tue Jun 16 13:12:37 2015 +0100 Add some libssl tests Two tests are added: one is a simple version tolerance test; the second is a test to ensure that OpenSSL operates correctly in the case of a zero length extensions block. The latter was broken inadvertently (now fixed) and it would have been helpful to have a test case for it. Reviewed-by: Richard Levitte commit 631c1206334adfb21758220362a56fa157a47596 Author: Matt Caswell Date: Tue Jun 16 13:06:41 2015 +0100 Add a libssl test harness This commit provides a set of perl modules that support the testing of libssl. The test harness operates as a man-in-the-middle proxy between s_server and s_client. Both s_server and s_client must be started using the "-testmode" option which loads the new OSSLTEST engine. The test harness enables scripts to be written that can examine the packets sent during a handshake, as well as (potentially) modifying them so that otherwise illegal handshake messages can be sent. Reviewed-by: Richard Levitte commit 2d5d70b15559f9813054ddb11b30b816daf62ebe Author: Matt Caswell Date: Tue Jun 16 12:59:37 2015 +0100 Add OSSLTest Engine This engine is for testing purposes only. It provides crippled crypto implementations and therefore must not be used in any instance where security is required. This will be used by the forthcoming libssl test harness which will operate as a man-in-the-middle proxy. The test harness will be able to modify TLS packets and read their contents. By using this test engine packets are not encrypted and MAC codes always verify. Reviewed-by: Richard Levitte ----------------------------------------------------------------------- Summary of changes: engines/Makefile | 29 +- engines/e_ossltest.c | 542 ++++++++++++++++++++++++++++++ engines/e_ossltest.ec | 1 + engines/{e_gmp_err.c => e_ossltest_err.c} | 70 ++-- engines/{e_gmp_err.h => e_ossltest_err.h} | 23 +- test/Makefile | 22 +- test/sslextensiontest.pl | 89 +++++ test/sslskewith0ptest.pl | 89 +++++ test/sslvertoltest.pl | 93 +++++ util/TLSProxy/ClientHello.pm | 272 +++++++++++++++ util/TLSProxy/Message.pm | 457 +++++++++++++++++++++++++ util/TLSProxy/Proxy.pm | 394 ++++++++++++++++++++++ util/TLSProxy/Record.pm | 360 ++++++++++++++++++++ util/TLSProxy/ServerHello.pm | 235 +++++++++++++ util/TLSProxy/ServerKeyExchange.pm | 176 ++++++++++ 15 files changed, 2796 insertions(+), 56 deletions(-) create mode 100644 engines/e_ossltest.c create mode 100644 engines/e_ossltest.ec copy engines/{e_gmp_err.c => e_ossltest_err.c} (65%) copy engines/{e_gmp_err.h => e_ossltest_err.h} (80%) create mode 100755 test/sslextensiontest.pl create mode 100755 test/sslskewith0ptest.pl create mode 100755 test/sslvertoltest.pl create mode 100644 util/TLSProxy/ClientHello.pm create mode 100644 util/TLSProxy/Message.pm create mode 100644 util/TLSProxy/Proxy.pm create mode 100644 util/TLSProxy/Record.pm create mode 100644 util/TLSProxy/ServerHello.pm create mode 100644 util/TLSProxy/ServerKeyExchange.pm diff --git a/engines/Makefile b/engines/Makefile index e9dc1c4..a1ea0a6 100644 --- a/engines/Makefile +++ b/engines/Makefile @@ -32,7 +32,6 @@ GENERAL=Makefile engines.com install.com engine_vector.mar LIB=$(TOP)/libcrypto.a LIBNAMES= 4758cca gmp padlock capi - LIBSRC= e_4758cca.c \ e_gmp.c \ e_padlock.c \ @@ -43,6 +42,10 @@ LIBOBJ= e_4758cca.o \ e_capi.o \ $(ENGINES_ASM_OBJ) +TESTLIBNAMES= ossltest +TESTLIBSRC= e_ossltest.c +TESTLIBOBJ= e_ossltest.o + SRC= $(LIBSRC) HEADER= e_4758cca_err.c e_4758cca_err.h \ @@ -51,7 +54,8 @@ HEADER= e_4758cca_err.c e_4758cca_err.h \ e_nuron_err.c e_nuron_err.h \ e_sureware_err.c e_sureware_err.h \ e_ubsec_err.c e_ubsec_err.h \ - e_capi_err.c e_capi_err.h + e_capi_err.c e_capi_err.h \ + e_ossltest_err.c e_ossltest_err.h ALL= $(GENERAL) $(SRC) $(HEADER) @@ -60,10 +64,10 @@ top: all: lib subdirs -lib: $(LIBOBJ) +lib: $(LIBOBJ) $(TESTLIBOBJ) @if [ -n "$(SHARED_LIBS)" ]; then \ set -e; \ - for l in $(LIBNAMES); do \ + for l in $(LIBNAMES) $(TESTLIBNAMES); do \ $(MAKE) -f ../Makefile.shared -e \ LIBNAME=$$l LIBEXTRAS="e_$$l*.o" \ LIBDEPS='-L.. -lcrypto $(EX_LIBS)' \ @@ -142,7 +146,7 @@ depend: local_depend @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) ) local_depend: - @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) + @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC) $(TESTLIBSRC) dclean: $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new @@ -196,6 +200,21 @@ e_gmp.o: ../include/openssl/rsa.h ../include/openssl/safestack.h e_gmp.o: ../include/openssl/sha.h ../include/openssl/stack.h e_gmp.o: ../include/openssl/symhacks.h ../include/openssl/x509.h e_gmp.o: ../include/openssl/x509_vfy.h e_gmp.c +e_ossltest.o: ../include/openssl/aes.h ../include/openssl/asn1.h +e_ossltest.o: ../include/openssl/bio.h ../include/openssl/buffer.h +e_ossltest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +e_ossltest.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +e_ossltest.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h +e_ossltest.o: ../include/openssl/err.h ../include/openssl/evp.h +e_ossltest.o: ../include/openssl/lhash.h ../include/openssl/md5.h +e_ossltest.o: ../include/openssl/modes.h ../include/openssl/obj_mac.h +e_ossltest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +e_ossltest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +e_ossltest.o: ../include/openssl/pkcs7.h ../include/openssl/rsa.h +e_ossltest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +e_ossltest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +e_ossltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +e_ossltest.o: e_ossltest.c e_ossltest_err.c e_ossltest_err.h e_padlock.o: ../include/openssl/aes.h ../include/openssl/asn1.h e_padlock.o: ../include/openssl/bio.h ../include/openssl/buffer.h e_padlock.o: ../include/openssl/crypto.h ../include/openssl/dso.h diff --git a/engines/e_ossltest.c b/engines/e_ossltest.c new file mode 100644 index 0000000..6e50a5f --- /dev/null +++ b/engines/e_ossltest.c @@ -0,0 +1,542 @@ +/* engines/e_ossltest.c */ +/* + * Written by Matt Caswell (matt at openssl.org) for the OpenSSL project. + */ +/* ==================================================================== + * Copyright (c) 2015 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing at OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + */ + +/* + * This is the OSSLTEST engine. It provides deliberately crippled digest + * implementations for test purposes. It is highly insecure and must NOT be + * used for any purpose except testing + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define OSSLTEST_LIB_NAME "OSSLTEST" +#include "e_ossltest_err.c" + +/* Engine Id and Name */ +static const char *engine_ossltest_id = "ossltest"; +static const char *engine_ossltest_name = "OpenSSL Test engine support"; + + +/* Engine Lifetime functions */ +static int ossltest_destroy(ENGINE *e); +static int ossltest_init(ENGINE *e); +static int ossltest_finish(ENGINE *e); +void ENGINE_load_ossltest(void); + + +/* Set up digests */ +static int ossltest_digests(ENGINE *e, const EVP_MD **digest, + const int **nids, int nid); + +static int ossltest_digest_nids[] = { + NID_md5, NID_sha1, NID_sha256, NID_sha384, NID_sha512, 0 +}; + +/* MD5 */ +static int digest_md5_init(EVP_MD_CTX *ctx); +static int digest_md5_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count); +static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md); + +static const EVP_MD digest_md5 = { + NID_md5, + NID_md5WithRSAEncryption, + MD5_DIGEST_LENGTH, + 0, + digest_md5_init, + digest_md5_update, + digest_md5_final, + NULL, + NULL, + EVP_PKEY_RSA_method, + MD5_CBLOCK, + sizeof(EVP_MD *) + sizeof(MD5_CTX), +}; + +/* SHA1 */ +static int digest_sha1_init(EVP_MD_CTX *ctx); +static int digest_sha1_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count); +static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md); + +static const EVP_MD digest_sha1 = { + NID_sha1, + NID_sha1WithRSAEncryption, + SHA_DIGEST_LENGTH, + EVP_MD_FLAG_PKEY_METHOD_SIGNATURE | EVP_MD_FLAG_DIGALGID_ABSENT, + digest_sha1_init, + digest_sha1_update, + digest_sha1_final, + NULL, + NULL, + EVP_PKEY_NULL_method, + SHA_CBLOCK, + sizeof(EVP_MD *) + sizeof(SHA_CTX), +}; + +/* SHA256 */ +static int digest_sha256_init(EVP_MD_CTX *ctx); +static int digest_sha256_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count); +static int digest_sha256_final(EVP_MD_CTX *ctx, unsigned char *md); + +static const EVP_MD digest_sha256 = { + NID_sha256, + NID_sha256WithRSAEncryption, + SHA256_DIGEST_LENGTH, + EVP_MD_FLAG_PKEY_METHOD_SIGNATURE | EVP_MD_FLAG_DIGALGID_ABSENT, + digest_sha256_init, + digest_sha256_update, + digest_sha256_final, + NULL, + NULL, + EVP_PKEY_NULL_method, + SHA256_CBLOCK, + sizeof(EVP_MD *) + sizeof(SHA256_CTX), +}; + +/* SHA384/SHA512 */ +static int digest_sha384_init(EVP_MD_CTX *ctx); +static int digest_sha512_init(EVP_MD_CTX *ctx); +static int digest_sha512_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count); +static int digest_sha384_final(EVP_MD_CTX *ctx, unsigned char *md); +static int digest_sha512_final(EVP_MD_CTX *ctx, unsigned char *md); + +static const EVP_MD digest_sha384 = { + NID_sha384, + NID_sha384WithRSAEncryption, + SHA384_DIGEST_LENGTH, + EVP_MD_FLAG_PKEY_METHOD_SIGNATURE | EVP_MD_FLAG_DIGALGID_ABSENT, + digest_sha384_init, + digest_sha512_update, + digest_sha384_final, + NULL, + NULL, + EVP_PKEY_NULL_method, + SHA512_CBLOCK, + sizeof(EVP_MD *) + sizeof(SHA512_CTX), +}; + +static const EVP_MD digest_sha512 = { + NID_sha512, + NID_sha512WithRSAEncryption, + SHA512_DIGEST_LENGTH, + EVP_MD_FLAG_PKEY_METHOD_SIGNATURE | EVP_MD_FLAG_DIGALGID_ABSENT, + digest_sha512_init, + digest_sha512_update, + digest_sha512_final, + NULL, + NULL, + EVP_PKEY_NULL_method, + SHA512_CBLOCK, + sizeof(EVP_MD *) + sizeof(SHA512_CTX), +}; + +/* Setup ciphers */ +static int ossltest_ciphers(ENGINE *, const EVP_CIPHER **, + const int **, int); + +static int ossltest_cipher_nids[] = { + NID_aes_128_cbc, 0 +}; + +/* AES128 */ + +int ossltest_aes128_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc); +int ossltest_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + const unsigned char *in, size_t inl); + +/* + * Copy of the definition in crypto/evp/e_aes.c. Only used for the "sizeof" + * below + */ +typedef struct { + union { + double align; + AES_KEY ks; + } ks; + block128_f block; + union { + cbc128_f cbc; + ctr128_f ctr; + } stream; +} EVP_AES_KEY; + + +static const EVP_CIPHER ossltest_aes_128_cbc = { \ + NID_aes_128_cbc, + 16, /* block size */ + 16, /* key len */ + 16, /* iv len */ + EVP_CIPH_FLAG_DEFAULT_ASN1 | EVP_CIPH_CBC_MODE, + ossltest_aes128_init_key, + ossltest_aes128_cbc_cipher, + NULL, + sizeof(EVP_AES_KEY), + NULL,NULL,NULL,NULL +}; + + +static int bind_ossltest(ENGINE *e) +{ + /* Ensure the ossltest error handling is set up */ + ERR_load_OSSLTEST_strings(); + + if (!ENGINE_set_id(e, engine_ossltest_id) + || !ENGINE_set_name(e, engine_ossltest_name) + || !ENGINE_set_digests(e, ossltest_digests) + || !ENGINE_set_ciphers(e, ossltest_ciphers) + || !ENGINE_set_destroy_function(e, ossltest_destroy) + || !ENGINE_set_init_function(e, ossltest_init) + || !ENGINE_set_finish_function(e, ossltest_finish)) { + OSSLTESTerr(OSSLTEST_F_BIND_OSSLTEST, OSSLTEST_R_INIT_FAILED); + return 0; + } + + return 1; +} + +#ifndef OPENSSL_NO_DYNAMIC_ENGINE +static int bind_helper(ENGINE *e, const char *id) +{ + if (id && (strcmp(id, engine_ossltest_id) != 0)) + return 0; + if (!bind_ossltest(e)) + return 0; + return 1; +} + +IMPLEMENT_DYNAMIC_CHECK_FN() + IMPLEMENT_DYNAMIC_BIND_FN(bind_helper) +#endif + +static ENGINE *engine_ossltest(void) +{ + ENGINE *ret = ENGINE_new(); + if (!ret) + return NULL; + if (!bind_ossltest(ret)) { + ENGINE_free(ret); + return NULL; + } + return ret; +} + +void ENGINE_load_ossltest(void) +{ + /* Copied from eng_[openssl|dyn].c */ + ENGINE *toadd = engine_ossltest(); + if (!toadd) + return; + ENGINE_add(toadd); + ENGINE_free(toadd); + ERR_clear_error(); +} + + +static int ossltest_init(ENGINE *e) +{ + return 1; +} + + +static int ossltest_finish(ENGINE *e) +{ + return 1; +} + + +static int ossltest_destroy(ENGINE *e) +{ + ERR_unload_OSSLTEST_strings(); + return 1; +} + +static int ossltest_digests(ENGINE *e, const EVP_MD **digest, + const int **nids, int nid) +{ + int ok = 1; + if (!digest) { + /* We are returning a list of supported nids */ + *nids = ossltest_digest_nids; + return (sizeof(ossltest_digest_nids) - + 1) / sizeof(ossltest_digest_nids[0]); + } + /* We are being asked for a specific digest */ + switch (nid) { + case NID_md5: + *digest = &digest_md5; + break; + case NID_sha1: + *digest = &digest_sha1; + break; + case NID_sha256: + *digest = &digest_sha256; + break; + case NID_sha384: + *digest = &digest_sha384; + break; + case NID_sha512: + *digest = &digest_sha512; + break; + default: + ok = 0; + *digest = NULL; + break; + } + return ok; +} + +static int ossltest_ciphers(ENGINE *e, const EVP_CIPHER **cipher, + const int **nids, int nid) +{ + int ok = 1; + if (!cipher) { + /* We are returning a list of supported nids */ + *nids = ossltest_cipher_nids; + return (sizeof(ossltest_cipher_nids) - 1) + / sizeof(ossltest_cipher_nids[0]); + } + /* We are being asked for a specific cipher */ + switch (nid) { + case NID_aes_128_cbc: + *cipher = &ossltest_aes_128_cbc; + break; + default: + ok = 0; + *cipher = NULL; + break; + } + return ok; +} + +static void fill_known_data(unsigned char *md, unsigned int len) +{ + unsigned int i; + + for (i=0; imd_data) +static int digest_md5_init(EVP_MD_CTX *ctx) +{ + return MD5_Init(data(ctx)); +} + +static int digest_md5_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count) +{ + return MD5_Update(data(ctx), data, (size_t)count); +} + +static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md) +{ + int ret; + ret = MD5_Final(md, data(ctx)); + + if (ret > 0) { + fill_known_data(md, MD5_DIGEST_LENGTH); + } + return ret; +} + +/* + * SHA1 implementation. + */ +#undef data +#define data(ctx) ((SHA_CTX *)(ctx)->md_data) +static int digest_sha1_init(EVP_MD_CTX *ctx) +{ + return SHA1_Init(data(ctx)); +} + +static int digest_sha1_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count) +{ + return SHA1_Update(data(ctx), data, (size_t)count); +} + +static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md) +{ + int ret; + ret = SHA1_Final(md, data(ctx)); + + if (ret > 0) { + fill_known_data(md, SHA_DIGEST_LENGTH); + } + return ret; +} + +/* + * SHA256 implementation. + */ +#undef data +#define data(ctx) ((SHA256_CTX *)(ctx)->md_data) +static int digest_sha256_init(EVP_MD_CTX *ctx) +{ + return SHA256_Init(data(ctx)); +} + +static int digest_sha256_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count) +{ + return SHA256_Update(data(ctx), data, (size_t)count); +} + +static int digest_sha256_final(EVP_MD_CTX *ctx, unsigned char *md) +{ + int ret; + ret = SHA256_Final(md, data(ctx)); + + if (ret > 0) { + fill_known_data(md, SHA256_DIGEST_LENGTH); + } + return ret; +} + +/* + * SHA384/512 implementation. + */ +#undef data +#define data(ctx) ((SHA512_CTX *)(ctx)->md_data) +static int digest_sha384_init(EVP_MD_CTX *ctx) +{ + return SHA384_Init(data(ctx)); +} + +static int digest_sha512_init(EVP_MD_CTX *ctx) +{ + return SHA512_Init(data(ctx)); +} + +static int digest_sha512_update(EVP_MD_CTX *ctx, const void *data, + unsigned long count) +{ + return SHA512_Update(data(ctx), data, (size_t)count); +} + +static int digest_sha384_final(EVP_MD_CTX *ctx, unsigned char *md) +{ + int ret; + /* Actually uses SHA512_Final! */ + ret = SHA512_Final(md, data(ctx)); + + if (ret > 0) { + fill_known_data(md, SHA384_DIGEST_LENGTH); + } + return ret; +} + +static int digest_sha512_final(EVP_MD_CTX *ctx, unsigned char *md) +{ + int ret; + ret = SHA512_Final(md, data(ctx)); + + if (ret > 0) { + fill_known_data(md, SHA512_DIGEST_LENGTH); + } + return ret; +} + +/* + * AES128 Implementation + */ + +int ossltest_aes128_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, + const unsigned char *iv, int enc) +{ + return EVP_aes_128_cbc()->init(ctx, key, iv, enc); +} + +int ossltest_aes128_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + const unsigned char *in, size_t inl) +{ + unsigned char *tmpbuf; + int ret; + + tmpbuf = OPENSSL_malloc(inl); + if (tmpbuf == NULL) + return -1; + + /* Remember what we were asked to encrypt */ + memcpy(tmpbuf, in, inl); + + /* Go through the motions of encrypting it */ + ret = EVP_aes_128_cbc()->do_cipher(ctx, out, in, inl); + + /* Throw it all away and just use the plaintext as the output */ + memcpy(out, tmpbuf, inl); + OPENSSL_free(tmpbuf); + + return ret; +} diff --git a/engines/e_ossltest.ec b/engines/e_ossltest.ec new file mode 100644 index 0000000..d8a1bef --- /dev/null +++ b/engines/e_ossltest.ec @@ -0,0 +1 @@ +L OSSLTEST e_ossltest_err.h e_ossltest_err.c diff --git a/engines/e_gmp_err.c b/engines/e_ossltest_err.c similarity index 65% copy from engines/e_gmp_err.c copy to engines/e_ossltest_err.c index 002a3ab..c1b0063 100644 --- a/engines/e_gmp_err.c +++ b/engines/e_ossltest_err.c @@ -1,6 +1,6 @@ -/* e_gmp_err.c */ +/* e_ossltest_err.c */ /* ==================================================================== - * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -61,7 +61,7 @@ #include #include -#include "e_gmp_err.h" +#include "e_ossltest_err.h" /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR @@ -69,69 +69,65 @@ # define ERR_FUNC(func) ERR_PACK(0,func,0) # define ERR_REASON(reason) ERR_PACK(0,0,reason) -static ERR_STRING_DATA GMP_str_functs[] = { - {ERR_FUNC(GMP_F_E_GMP_CTRL), "E_GMP_CTRL"}, - {ERR_FUNC(GMP_F_E_GMP_RSA_MOD_EXP), "E_GMP_RSA_MOD_EXP"}, +static ERR_STRING_DATA OSSLTEST_str_functs[] = { + {ERR_FUNC(OSSLTEST_F_BIND_OSSLTEST), "BIND_OSSLTEST"}, {0, NULL} }; -static ERR_STRING_DATA GMP_str_reasons[] = { - {ERR_REASON(GMP_R_CTRL_COMMAND_NOT_IMPLEMENTED), - "ctrl command not implemented"}, - {ERR_REASON(GMP_R_KEY_CONTEXT_ERROR), "key context error"}, - {ERR_REASON(GMP_R_MISSING_KEY_COMPONENTS), "missing key components"}, +static ERR_STRING_DATA OSSLTEST_str_reasons[] = { + {ERR_REASON(OSSLTEST_R_INIT_FAILED), "init failed"}, {0, NULL} }; #endif -#ifdef GMP_LIB_NAME -static ERR_STRING_DATA GMP_lib_name[] = { - {0, GMP_LIB_NAME}, +#ifdef OSSLTEST_LIB_NAME +static ERR_STRING_DATA OSSLTEST_lib_name[] = { + {0, OSSLTEST_LIB_NAME}, {0, NULL} }; #endif -static int GMP_lib_error_code = 0; -static int GMP_error_init = 1; +static int OSSLTEST_lib_error_code = 0; +static int OSSLTEST_error_init = 1; -static void ERR_load_GMP_strings(void) +static void ERR_load_OSSLTEST_strings(void) { - if (GMP_lib_error_code == 0) - GMP_lib_error_code = ERR_get_next_error_library(); + if (OSSLTEST_lib_error_code == 0) + OSSLTEST_lib_error_code = ERR_get_next_error_library(); - if (GMP_error_init) { - GMP_error_init = 0; + if (OSSLTEST_error_init) { + OSSLTEST_error_init = 0; #ifndef OPENSSL_NO_ERR - ERR_load_strings(GMP_lib_error_code, GMP_str_functs); - ERR_load_strings(GMP_lib_error_code, GMP_str_reasons); + ERR_load_strings(OSSLTEST_lib_error_code, OSSLTEST_str_functs); + ERR_load_strings(OSSLTEST_lib_error_code, OSSLTEST_str_reasons); #endif -#ifdef GMP_LIB_NAME - GMP_lib_name->error = ERR_PACK(GMP_lib_error_code, 0, 0); - ERR_load_strings(0, GMP_lib_name); +#ifdef OSSLTEST_LIB_NAME + OSSLTEST_lib_name->error = ERR_PACK(OSSLTEST_lib_error_code, 0, 0); + ERR_load_strings(0, OSSLTEST_lib_name); #endif } } -static void ERR_unload_GMP_strings(void) +static void ERR_unload_OSSLTEST_strings(void) { - if (GMP_error_init == 0) { + if (OSSLTEST_error_init == 0) { #ifndef OPENSSL_NO_ERR - ERR_unload_strings(GMP_lib_error_code, GMP_str_functs); - ERR_unload_strings(GMP_lib_error_code, GMP_str_reasons); + ERR_unload_strings(OSSLTEST_lib_error_code, OSSLTEST_str_functs); + ERR_unload_strings(OSSLTEST_lib_error_code, OSSLTEST_str_reasons); #endif -#ifdef GMP_LIB_NAME - ERR_unload_strings(0, GMP_lib_name); +#ifdef OSSLTEST_LIB_NAME + ERR_unload_strings(0, OSSLTEST_lib_name); #endif - GMP_error_init = 1; + OSSLTEST_error_init = 1; } } -static void ERR_GMP_error(int function, int reason, char *file, int line) +static void ERR_OSSLTEST_error(int function, int reason, char *file, int line) { - if (GMP_lib_error_code == 0) - GMP_lib_error_code = ERR_get_next_error_library(); - ERR_PUT_error(GMP_lib_error_code, function, reason, file, line); + if (OSSLTEST_lib_error_code == 0) + OSSLTEST_lib_error_code = ERR_get_next_error_library(); + ERR_PUT_error(OSSLTEST_lib_error_code, function, reason, file, line); } diff --git a/engines/e_gmp_err.h b/engines/e_ossltest_err.h similarity index 80% copy from engines/e_gmp_err.h copy to engines/e_ossltest_err.h index 637abbc..8f874e0 100644 --- a/engines/e_gmp_err.h +++ b/engines/e_ossltest_err.h @@ -1,5 +1,5 @@ /* ==================================================================== - * Copyright (c) 2001-2002 The OpenSSL Project. All rights reserved. + * Copyright (c) 2015 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -52,8 +52,8 @@ * */ -#ifndef HEADER_GMP_ERR_H -# define HEADER_GMP_ERR_H +#ifndef HEADER_OSSLTEST_ERR_H +# define HEADER_OSSLTEST_ERR_H #ifdef __cplusplus extern "C" { @@ -64,21 +64,18 @@ extern "C" { * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ -static void ERR_load_GMP_strings(void); -static void ERR_unload_GMP_strings(void); -static void ERR_GMP_error(int function, int reason, char *file, int line); -# define GMPerr(f,r) ERR_GMP_error((f),(r),__FILE__,__LINE__) +static void ERR_load_OSSLTEST_strings(void); +static void ERR_unload_OSSLTEST_strings(void); +static void ERR_OSSLTEST_error(int function, int reason, char *file, int line); +# define OSSLTESTerr(f,r) ERR_OSSLTEST_error((f),(r),__FILE__,__LINE__) -/* Error codes for the GMP functions. */ +/* Error codes for the OSSLTEST functions. */ /* Function codes. */ -# define GMP_F_E_GMP_CTRL 100 -# define GMP_F_E_GMP_RSA_MOD_EXP 101 +# define OSSLTEST_F_BIND_OSSLTEST 100 /* Reason codes. */ -# define GMP_R_CTRL_COMMAND_NOT_IMPLEMENTED 100 -# define GMP_R_KEY_CONTEXT_ERROR 101 -# define GMP_R_MISSING_KEY_COMPONENTS 102 +# define OSSLTEST_R_INIT_FAILED 100 #ifdef __cplusplus } diff --git a/test/Makefile b/test/Makefile index f49dc76..31b3796 100644 --- a/test/Makefile +++ b/test/Makefile @@ -71,6 +71,9 @@ CONSTTIMETEST= constant_time_test VERIFYEXTRATEST= verify_extra_test CLIENTHELLOTEST= clienthellotest PACKETTEST= packettest +SSLVERTOLTEST= sslvertoltest.pl +SSLEXTENSIONTEST= sslextensiontest.pl +SSLSKEWITH0PTEST= sslskewith0ptest.pl TESTS= alltests @@ -156,7 +159,8 @@ alltests: \ test_ige test_jpake test_secmem \ test_srp test_cms test_v3name test_ocsp \ test_gost2814789 test_heartbeat test_p5_crpt2 \ - test_constant_time test_verify_extra test_clienthello test_packet + test_constant_time test_verify_extra test_clienthello test_packet \ + test_sslvertol test_sslextension test_sslskewith0p test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt @echo $(START) $@ @@ -417,6 +421,22 @@ test_packet: $(PACKETTEST)$(EXE_EXT) @echo $(START) $@ ../util/shlib_wrap.sh ./$(PACKETTEST) +#OPENSSL_ia32cap=... in ssl tests below ensures AES-NI is switched off (AES-NI does not go through the testmode engine) +test_sslvertol: ../apps/openssl$(EXE_EXT) + @echo $(START) $@ + [ -z "$(SHARED_LIBS)" ] || PERL5LIB=$$PERL5LIB:../util OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh ./$(SSLVERTOLTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem + @[ -n "$(SHARED_LIBS)" ] || echo test_sslvertol can only be performed with OpenSSL configured shared + +test_sslextension: ../apps/openssl$(EXE_EXT) + @echo $(START) $@ + [ -z "$(SHARED_LIBS)" ] || PERL5LIB=$$PERL5LIB:../util OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh ./$(SSLEXTENSIONTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem + @[ -n "$(SHARED_LIBS)" ] || echo test_sslextension can only be performed with OpenSSL configured shared + +test_sslskewith0p: ../apps/openssl$(EXE_EXT) + @echo $(START) $@ + [ -z "$(SHARED_LIBS)" ] || PERL5LIB=$$PERL5LIB:../util OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh ./$(SSLSKEWITH0PTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem + @[ -n "$(SHARED_LIBS)" ] || echo test_sslskewith0p can only be performed with OpenSSL configured shared + update: local_depend @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi diff --git a/test/sslextensiontest.pl b/test/sslextensiontest.pl new file mode 100755 index 0000000..802bac1 --- /dev/null +++ b/test/sslextensiontest.pl @@ -0,0 +1,89 @@ +#!/usr/bin/perl +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; +use TLSProxy::Proxy; + +my $proxy = TLSProxy::Proxy->new( + \&extension_filter, + @ARGV +); + +#Test 1: Sending a zero length extension block should pass +$proxy->start(); +TLSProxy::Message->success or die "FAILED: Zero extension length test\n"; + +print "SUCCESS: Extension test\n"; + +sub extension_filter +{ + my $proxy = shift; + + # We're only interested in the initial ClientHello + if ($proxy->flight != 0) { + return; + } + + foreach my $message (@{$proxy->message_list}) { + if ($message->mt == TLSProxy::Message::MT_CLIENT_HELLO) { + #Remove all extensions and set the extension len to zero + $message->extension_data({}); + $message->extensions_len(0); + #Extensions have been removed so make sure we don't try to use them + $message->process_extensions(); + + $message->repack(); + } + } +} diff --git a/test/sslskewith0ptest.pl b/test/sslskewith0ptest.pl new file mode 100755 index 0000000..63f8398 --- /dev/null +++ b/test/sslskewith0ptest.pl @@ -0,0 +1,89 @@ +#!/usr/bin/perl +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; +use TLSProxy::Proxy; + +my $proxy = TLSProxy::Proxy->new( + \&ske_0_p_filter, + @ARGV +); + +#We must use an anon DHE cipher for this test +$proxy->cipherc('ADH-AES128-SHA:@SECLEVEL=0'); +$proxy->ciphers('ADH-AES128-SHA:@SECLEVEL=0'); + +$proxy->start(); +TLSProxy::Message->fail or die "FAILED: ServerKeyExchange with 0 p\n"; + +print "SUCCESS: ServerKeyExchange with 0 p\n"; + +sub ske_0_p_filter +{ + my $proxy = shift; + + # We're only interested in the SKE - always in flight 1 + if ($proxy->flight != 1) { + return; + } + + foreach my $message (@{$proxy->message_list}) { + if ($message->mt == TLSProxy::Message::MT_SERVER_KEY_EXCHANGE) { + #Set p to a value of 0 + $message->p(pack('C', 0)); + + $message->repack(); + } + } +} diff --git a/test/sslvertoltest.pl b/test/sslvertoltest.pl new file mode 100755 index 0000000..1828a7d --- /dev/null +++ b/test/sslvertoltest.pl @@ -0,0 +1,93 @@ +#!/usr/bin/perl +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; +use TLSProxy::Proxy; + +my $proxy = TLSProxy::Proxy->new( + \&vers_tolerance_filter, + @ARGV +); + +#Test 1: Asking for TLS1.3 should pass +my $client_version = TLSProxy::Record::VERS_TLS_1_3; +$proxy->start(); +TLSProxy::Message->success or die "FAILED: Version tolerance test\n"; + +#Test 2: Testing something below SSLv3 should fail +$client_version = TLSProxy::Record::VERS_SSL_3_0 - 1; +$proxy->restart(); +TLSProxy::Message->success and die "FAILED: Version tolerance test\n"; + +print "SUCCESS: Version tolerance test\n"; + +sub vers_tolerance_filter +{ + my $proxy = shift; + + # We're only interested in the initial ClientHello + if ($proxy->flight != 0) { + return; + } + + foreach my $message (@{$proxy->message_list}) { + if ($message->mt == TLSProxy::Message::MT_CLIENT_HELLO) { + #Set the client version + #Anything above the max supported version (TLS1.2) should succeed + #Anything below SSLv3 should fail + $message->client_version($client_version); + $message->repack(); + } + } +} diff --git a/util/TLSProxy/ClientHello.pm b/util/TLSProxy/ClientHello.pm new file mode 100644 index 0000000..54fb5bb --- /dev/null +++ b/util/TLSProxy/ClientHello.pm @@ -0,0 +1,272 @@ +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; + +package TLSProxy::ClientHello; + +use parent 'TLSProxy::Message'; + +use constant { + EXT_ENCRYPT_THEN_MAC => 22 +}; + +sub new +{ + my $class = shift; + my ($server, + $data, + $records, + $startoffset, + $message_frag_lens) = @_; + + my $self = $class->SUPER::new( + $server, + 1, + $data, + $records, + $startoffset, + $message_frag_lens); + + $self->{client_version} = 0; + $self->{random} = []; + $self->{session_id_len} = 0; + $self->{session} = ""; + $self->{ciphersuite_len} = 0; + $self->{ciphersuites} = []; + $self->{comp_meth_len} = 0; + $self->{comp_meths} = []; + $self->{extensions_len} = 0; + $self->{extensions_data} = ""; + + return $self; +} + +sub parse +{ + my $self = shift; + my $ptr = 2; + my ($client_version) = unpack('n', $self->data); + my $random = substr($self->data, $ptr, 32); + $ptr += 32; + my $session_id_len = unpack('C', substr($self->data, $ptr)); + $ptr++; + my $session = substr($self->data, $ptr, $session_id_len); + $ptr += $session_id_len; + my $ciphersuite_len = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + my @ciphersuites = unpack('n*', substr($self->data, $ptr, + $ciphersuite_len)); + $ptr += $ciphersuite_len; + my $comp_meth_len = unpack('C', substr($self->data, $ptr)); + $ptr++; + my @comp_meths = unpack('C*', substr($self->data, $ptr, $comp_meth_len)); + $ptr += $comp_meth_len; + my $extensions_len = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + #For now we just deal with this as a block of data. In the future we will + #want to parse this + my $extension_data = substr($self->data, $ptr); + + if (length($extension_data) != $extensions_len) { + die "Invalid extension length\n"; + } + my %extensions = (); + while (length($extension_data) >= 4) { + my ($type, $size) = unpack("nn", $extension_data); + my $extdata = substr($extension_data, 4, $size); + $extension_data = substr($extension_data, 4 + $size); + $extensions{$type} = $extdata; + } + + $self->client_version($client_version); + $self->random($random); + $self->session_id_len($session_id_len); + $self->session($session); + $self->ciphersuite_len($ciphersuite_len); + $self->ciphersuites(\@ciphersuites); + $self->comp_meth_len($comp_meth_len); + $self->comp_meths(\@comp_meths); + $self->extensions_len($extensions_len); + $self->extension_data(\%extensions); + + $self->process_extensions(); + + print " Client Version:".$client_version."\n"; + print " Session ID Len:".$session_id_len."\n"; + print " Ciphersuite len:".$ciphersuite_len."\n"; + print " Compression Method Len:".$comp_meth_len."\n"; + print " Extensions Len:".$extensions_len."\n"; +} + +#Perform any actions necessary based on the extensions we've seen +sub process_extensions +{ + my $self = shift; + my %extensions = %{$self->extension_data}; + + #Clear any state from a previous run + TLSProxy::Record->etm(0); + + if (exists $extensions{&EXT_ENCRYPT_THEN_MAC}) { + TLSProxy::Record->etm(1); + } +} + +#Reconstruct the on-the-wire message data following changes +sub set_message_contents +{ + my $self = shift; + my $data; + + $data = pack('n', $self->client_version); + $data .= $self->random; + $data .= pack('C', $self->session_id_len); + $data .= $self->session; + $data .= pack('n', $self->ciphersuite_len); + $data .= pack("n*", @{$self->ciphersuites}); + $data .= pack('C', $self->comp_meth_len); + $data .= pack("C*", @{$self->comp_meths}); + $data .= pack('n', $self->extensions_len); + foreach my $key (keys %{$self->extension_data}) { + my $extdata = ${$self->extension_data}{$key}; + $data .= pack("n", $key); + $data .= pack("n", length($extdata)); + $data .= $extdata; + } + + $self->data($data); +} + +#Read/write accessors +sub client_version +{ + my $self = shift; + if (@_) { + $self->{client_version} = shift; + } + return $self->{client_version}; +} +sub random +{ + my $self = shift; + if (@_) { + $self->{random} = shift; + } + return $self->{random}; +} +sub session_id_len +{ + my $self = shift; + if (@_) { + $self->{session_id_len} = shift; + } + return $self->{session_id_len}; +} +sub session +{ + my $self = shift; + if (@_) { + $self->{session} = shift; + } + return $self->{session}; +} +sub ciphersuite_len +{ + my $self = shift; + if (@_) { + $self->{ciphersuite_len} = shift; + } + return $self->{ciphersuite_len}; +} +sub ciphersuites +{ + my $self = shift; + if (@_) { + $self->{ciphersuites} = shift; + } + return $self->{ciphersuites}; +} +sub comp_meth_len +{ + my $self = shift; + if (@_) { + $self->{comp_meth_len} = shift; + } + return $self->{comp_meth_len}; +} +sub comp_meths +{ + my $self = shift; + if (@_) { + $self->{comp_meths} = shift; + } + return $self->{comp_meths}; +} +sub extensions_len +{ + my $self = shift; + if (@_) { + $self->{extensions_len} = shift; + } + return $self->{extensions_len}; +} +sub extension_data +{ + my $self = shift; + if (@_) { + $self->{extension_data} = shift; + } + return $self->{extension_data}; +} +1; diff --git a/util/TLSProxy/Message.pm b/util/TLSProxy/Message.pm new file mode 100644 index 0000000..66a4a7b --- /dev/null +++ b/util/TLSProxy/Message.pm @@ -0,0 +1,457 @@ +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; + +package TLSProxy::Message; + +use constant TLS_MESSAGE_HEADER_LENGTH => 4; + +#Message types +use constant { + MT_HELLO_REQUEST => 0, + MT_CLIENT_HELLO => 1, + MT_SERVER_HELLO => 2, + MT_NEW_SESSION_TICKET => 4, + MT_CERTIFICATE => 11, + MT_SERVER_KEY_EXCHANGE => 12, + MT_CERTIFICATE_REQUEST => 13, + MT_SERVER_HELLO_DONE => 14, + MT_CERTIFICATE_VERIFY => 15, + MT_CLIENT_KEY_EXCHANGE => 16, + MT_FINISHED => 20, + MT_CERTIFICATE_STATUS => 22, + MT_NEXT_PROTO => 67 +}; +my %message_type = ( + MT_HELLO_REQUEST, "HelloRequest", + MT_CLIENT_HELLO, "ClientHello", + MT_SERVER_HELLO, "ServerHello", + MT_NEW_SESSION_TICKET, "NewSessionTicket", + MT_CERTIFICATE, "Certificate", + MT_SERVER_KEY_EXCHANGE, "ServerKeyExchange", + MT_CERTIFICATE_REQUEST, "CertificateRequest", + MT_SERVER_HELLO_DONE, "ServerHelloDone", + MT_CERTIFICATE_VERIFY, "CertificateVerify", + MT_CLIENT_KEY_EXCHANGE, "ClientKeyExchange", + MT_FINISHED, "Finished", + MT_CERTIFICATE_STATUS, "CertificateStatus", + MT_NEXT_PROTO, "NextProto" +); + +my $payload = ""; +my $messlen = -1; +my $mt; +my $startoffset = -1; +my $server = 0; +my $success = 0; +my $end = 0; +my @message_rec_list = (); +my @message_frag_lens = (); +my $ciphersuite = 0; + +sub clear +{ + $payload = ""; + $messlen = -1; + $startoffset = -1; + $server = 0; + $success = 0; + $end = 0; + @message_rec_list = (); + @message_frag_lens = (); +} + +#Class method to extract messages from a record +sub get_messages +{ + my $class = shift; + my $serverin = shift; + my $record = shift; + my @messages = (); + my $message; + + @message_frag_lens = (); + + if ($serverin != $server && length($payload) != 0) { + die "Changed peer, but we still have fragment data\n"; + } + $server = $serverin; + + if ($record->content_type == TLSProxy::Record::RT_CCS) { + if ($payload ne "") { + #We can't handle this yet + die "CCS received before message data complete\n"; + } + if ($server) { + TLSProxy::Record->server_ccs_seen(1); + } else { + TLSProxy::Record->client_ccs_seen(1); + } + } elsif ($record->content_type == TLSProxy::Record::RT_HANDSHAKE) { + if ($record->len == 0 || $record->len_real == 0) { + print " Message truncated\n"; + } else { + my $recoffset = 0; + + if (length $payload > 0) { + #We are continuing processing a message started in a previous + #record. Add this record to the list associated with this + #message + push @message_rec_list, $record; + + if ($messlen <= length($payload)) { + #Shouldn't happen + die "Internal error: invalid messlen: ".$messlen + ." payload length:".length($payload)."\n"; + } + if (length($payload) + $record->decrypt_len >= $messlen) { + #We can complete the message with this record + $recoffset = $messlen - length($payload); + $payload .= substr($record->decrypt_data, 0, $recoffset); + push @message_frag_lens, $recoffset; + $message = create_message($server, $mt, $payload, + $startoffset); + push @messages, $message; + + #Check if we have finished the handshake + if ($mt == MT_FINISHED && $server) { + $success = 1; + $end = 1; + } + $payload = ""; + } else { + #This is just part of the total message + $payload .= $record->decrypt_data; + $recoffset = $record->decrypt_len; + push @message_frag_lens, $record->decrypt_len; + } + print " Partial message data read: ".$recoffset." bytes\n"; + } + + while ($record->decrypt_len > $recoffset) { + #We are at the start of a new message + if ($record->decrypt_len - $recoffset < 4) { + #Whilst technically probably valid we can't cope with this + die "End of record in the middle of a message header\n"; + } + @message_rec_list = ($record); + my $lenhi; + my $lenlo; + ($mt, $lenhi, $lenlo) = unpack('CnC', + substr($record->decrypt_data, + $recoffset)); + $messlen = ($lenhi << 8) | $lenlo; + print " Message type: $message_type{$mt}\n"; + print " Message Length: $messlen\n"; + $startoffset = $recoffset; + $recoffset += 4; + $payload = ""; + + if ($recoffset < $record->decrypt_len) { + #Some payload data is present in this record + if ($record->decrypt_len - $recoffset >= $messlen) { + #We can complete the message with this record + $payload .= substr($record->decrypt_data, $recoffset, + $messlen); + $recoffset += $messlen; + push @message_frag_lens, $messlen; + $message = create_message($server, $mt, $payload, + $startoffset); + push @messages, $message; + + #Check if we have finished the handshake + if ($mt == MT_FINISHED && $server) { + $success = 1; + $end = 1; + } + $payload = ""; + } else { + #This is just part of the total message + $payload .= substr($record->decrypt_data, $recoffset, + $record->decrypt_len - $recoffset); + $recoffset = $record->decrypt_len; + push @message_frag_lens, $recoffset; + } + } + } + } + } elsif ($record->content_type == TLSProxy::Record::RT_APPLICATION_DATA) { + print " [ENCRYPTED APPLICATION DATA]\n"; + print " [".$record->decrypt_data."]\n"; + } elsif ($record->content_type == TLSProxy::Record::RT_ALERT) { + #For now assume all alerts are fatal + $end = 1; + } + + return @messages; +} + +#Function to work out which sub-class we need to create and then +#construct it +sub create_message +{ + my ($server, $mt, $data, $startoffset) = @_; + my $message; + + #We only support ClientHello in this version...needs to be extended for + #others + if ($mt == MT_CLIENT_HELLO) { + $message = TLSProxy::ClientHello->new( + $server, + $data, + [@message_rec_list], + $startoffset, + [@message_frag_lens] + ); + $message->parse(); + } elsif ($mt == MT_SERVER_HELLO) { + $message = TLSProxy::ServerHello->new( + $server, + $data, + [@message_rec_list], + $startoffset, + [@message_frag_lens] + ); + $message->parse(); + } elsif ($mt == MT_SERVER_KEY_EXCHANGE) { + $message = TLSProxy::ServerKeyExchange->new( + $server, + $data, + [@message_rec_list], + $startoffset, + [@message_frag_lens] + ); + $message->parse(); + } else { + #Unknown message type + $message = TLSProxy::Message->new( + $server, + $mt, + $data, + [@message_rec_list], + $startoffset, + [@message_frag_lens] + ); + } + + return $message; +} + +sub end +{ + my $class = shift; + return $end; +} +sub success +{ + my $class = shift; + return $success; +} +sub fail +{ + my $class = shift; + return !$success && $end; +} +sub new +{ + my $class = shift; + my ($server, + $mt, + $data, + $records, + $startoffset, + $message_frag_lens) = @_; + + my $self = { + server => $server, + data => $data, + records => $records, + mt => $mt, + startoffset => $startoffset, + message_frag_lens => $message_frag_lens + }; + + return bless $self, $class; +} + +sub ciphersuite +{ + my $class = shift; + if (@_) { + $ciphersuite = shift; + } + return $ciphersuite; +} + +#Update all the underlying records with the modified data from this message +#Note: Does not currently support re-encrypting +sub repack +{ + my $self = shift; + my $msgdata; + + my $numrecs = $#{$self->records}; + + $self->set_message_contents(); + + my $lenhi; + my $lenlo; + + $lenlo = length($self->data) & 0xff; + $lenhi = length($self->data) >> 8; + my $msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data; + + + if ($numrecs == 0) { + #The message is fully contained within one record + my ($rec) = @{$self->records}; + my $recdata = $rec->decrypt_data; + + if (length($msgdata) != ${$self->message_frag_lens}[0] + + TLS_MESSAGE_HEADER_LENGTH) { + #Message length has changed! Better adjust the record length + my $diff = length($msgdata) - ${$self->message_frag_lens}[0] + - TLS_MESSAGE_HEADER_LENGTH; + $rec->len($rec->len + $diff); + } + + $rec->data(substr($recdata, 0, $self->startoffset) + .($msgdata) + .substr($recdata, ${$self->message_frag_lens}[0] + + TLS_MESSAGE_HEADER_LENGTH)); + + #Update the fragment len in case we changed it above + ${$self->message_frag_lens}[0] = length($msgdata) + - TLS_MESSAGE_HEADER_LENGTH; + return; + } + + #Note we don't currently support changing a fragmented message length + my $recctr = 0; + my $datadone = 0; + foreach my $rec (@{$self->records}) { + my $recdata = $rec->decrypt_data; + if ($recctr == 0) { + #This is the first record + my $remainlen = length($recdata) - $self->startoffset; + $rec->data(substr($recdata, 0, $self->startoffset) + .substr(($msgdata), 0, $remainlen)); + $datadone += $remainlen; + } elsif ($recctr + 1 == $numrecs) { + #This is the last record + $rec->data(substr($msgdata, $datadone)); + } else { + #This is a middle record + $rec->data(substr($msgdata, $datadone, length($rec->data))); + $datadone += length($rec->data); + } + $recctr++; + } +} + +#To be overridden by sub-classes +sub set_message_contents +{ +} + +#Read only accessors +sub server +{ + my $self = shift; + return $self->{server}; +} + +#Read/write accessors +sub mt +{ + my $self = shift; + if (@_) { + $self->{mt} = shift; + } + return $self->{mt}; +} +sub data +{ + my $self = shift; + if (@_) { + $self->{data} = shift; + } + return $self->{data}; +} +sub records +{ + my $self = shift; + if (@_) { + $self->{records} = shift; + } + return $self->{records}; +} +sub startoffset +{ + my $self = shift; + if (@_) { + $self->{startoffset} = shift; + } + return $self->{startoffset}; +} +sub message_frag_lens +{ + my $self = shift; + if (@_) { + $self->{message_frag_lens} = shift; + } + return $self->{message_frag_lens}; +} + +1; diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm new file mode 100644 index 0000000..c033c29 --- /dev/null +++ b/util/TLSProxy/Proxy.pm @@ -0,0 +1,394 @@ +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; + +package TLSProxy::Proxy; + +use File::Spec; +use IO::Socket; +use IO::Select; +use TLSProxy::Record; +use TLSProxy::Message; +use TLSProxy::ClientHello; +use TLSProxy::ServerHello; +use TLSProxy::ServerKeyExchange; + +sub new +{ + my $class = shift; + my ($filter, + $execute, + $cert, + $debug) = @_; + + my $self = { + #Public read/write + proxy_addr => "localhost", + proxy_port => 4453, + server_addr => "localhost", + server_port => 4443, + filter => $filter, + + #Public read + execute => $execute, + cert => $cert, + debug => $debug, + cipherc => "AES128-SHA", + ciphers => "", + flight => 0, + record_list => [], + message_list => [], + + #Private + message_rec_list => [] + }; + + return bless $self, $class; +} + +sub clear +{ + my $self = shift; + + $self->{cipherc} = "AES128-SHA"; + $self->{ciphers} = ""; + $self->{flight} = 0; + $self->{record_list} = []; + $self->{message_list} = []; + $self->{message_rec_list} = []; + + TLSProxy::Message->clear(); + TLSProxy::Record->clear(); +} + +sub restart +{ + my $self = shift; + + $self->clear; + $self->start; +} + +sub start +{ + my ($self) = shift; + my $pid; + + $pid = fork(); + if ($pid == 0) { + open(STDOUT, ">", File::Spec->devnull()) + or die "Failed to redirect stdout"; + open(STDERR, ">&STDOUT"); + my $execcmd = $self->execute." s_server -engine ossltest -accept " + .($self->server_port) + ." -cert ".$self->cert." -naccept 1"; + if ($self->ciphers ne "") { + $execcmd .= " -cipher ".$self->ciphers; + } + exec($execcmd); + } + + my $oldstdout; + + if(!$self->debug) { + $oldstdout = select(File::Spec->devnull()); + } + + # Create the Proxy socket + my $proxy_sock = new IO::Socket::INET( + LocalHost => $self->proxy_addr, + LocalPort => $self->proxy_port, + Proto => "tcp", + Listen => SOMAXCONN, + Reuse => 1 + ); + + if ($proxy_sock) { + print "Proxy started on port ".$self->proxy_port."\n"; + } else { + die "Failed creating proxy socket\n"; + } + + if ($self->execute) { + my $pid = fork(); + if ($pid == 0) { + open(STDOUT, ">", File::Spec->devnull()) + or die "Failed to redirect stdout"; + open(STDERR, ">&STDOUT"); + my $execcmd = $self->execute + ." s_client -engine ossltest -connect " + .($self->proxy_addr).":".($self->proxy_port); + if ($self->cipherc ne "") { + $execcmd .= " -cipher ".$self->cipherc; + } + exec($execcmd); + } + } + + # Wait for incoming connection from client + my $client_sock = $proxy_sock->accept() + or die "Failed accepting incoming connection\n"; + + print "Connection opened\n"; + + # Now connect to the server + my $retry = 3; + my $server_sock; + #We loop over this a few times because sometimes s_server can take a while + #to start up + do { + $server_sock = new IO::Socket::INET( + PeerAddr => $self->server_addr, + PeerPort => $self->server_port, + Proto => 'tcp' + ); + + $retry--; + if (!$server_sock) { + if ($retry) { + #Sleep for a short while + select(undef, undef, undef, 0.1); + } else { + die "Failed to start up server\n"; + } + } + } while (!$server_sock); + + my $sel = IO::Select->new($server_sock, $client_sock); + my $indata; + my @handles = ($server_sock, $client_sock); + + #Wait for either the server socket or the client socket to become readable + my @ready; + while(!(TLSProxy::Message->end) && (@ready = $sel->can_read)) { + foreach my $hand (@ready) { + if ($hand == $server_sock) { + $server_sock->sysread($indata, 16384) or goto END; + $indata = $self->process_packet(1, $indata); + $client_sock->syswrite($indata); + } elsif ($hand == $client_sock) { + $client_sock->sysread($indata, 16384) or goto END; + $indata = $self->process_packet(0, $indata); + $server_sock->syswrite($indata); + } else { + print "Err\n"; + goto END; + } + } + } + + END: + print "Connection closed\n"; + if($server_sock) { + $server_sock->close(); + } + if($client_sock) { + #Closing this also kills the child process + $client_sock->close(); + } + if($proxy_sock) { + $proxy_sock->close(); + } + if(!$self->debug) { + select($oldstdout); + } +} + + +sub process_packet +{ + my ($self, $server, $packet) = @_; + my $len_real; + my $decrypt_len; + my $data; + my $recnum; + + if ($server) { + print "Received server packet\n"; + } else { + print "Received client packet\n"; + } + + print "Packet length = ".length($packet)."\n"; + print "Processing flight ".$self->flight."\n"; + + #Return contains the list of record found in the packet followed by the + #list of messages in those records + my @ret = TLSProxy::Record->get_records($server, $self->flight, $packet); + push @{$self->record_list}, @{$ret[0]}; + $self->{message_rec_list} = $ret[0]; + push @{$self->{message_list}}, @{$ret[1]}; + + print "\n"; + + #Finished parsing. Call user provided filter here + $self->filter->($self); + + #Reconstruct the packet + $packet = ""; + foreach my $record (@{$self->record_list}) { + #We only replay the records for the current flight + if ($record->flight != $self->flight) { + next; + } + $packet .= $record->reconstruct_record(); + } + + $self->{flight} = $self->{flight} + 1; + + print "Forwarded packet length = ".length($packet)."\n\n"; + + return $packet; +} + +#Read accessors +sub execute +{ + my $self = shift; + return $self->{execute}; +} +sub cert +{ + my $self = shift; + return $self->{cert}; +} +sub debug +{ + my $self = shift; + return $self->{debug}; +} +sub flight +{ + my $self = shift; + return $self->{flight}; +} +sub record_list +{ + my $self = shift; + return $self->{record_list}; +} +sub message_list +{ + my $self = shift; + return $self->{message_list}; +} +sub success +{ + my $self = shift; + return $self->{success}; +} +sub end +{ + my $self = shift; + return $self->{end}; +} + +#Read/write accessors +sub proxy_addr +{ + my $self = shift; + if (@_) { + $self->{proxy_addr} = shift; + } + return $self->{proxy_addr}; +} +sub proxy_port +{ + my $self = shift; + if (@_) { + $self->{proxy_port} = shift; + } + return $self->{proxy_port}; +} +sub server_addr +{ + my $self = shift; + if (@_) { + $self->{server_addr} = shift; + } + return $self->{server_addr}; +} +sub server_port +{ + my $self = shift; + if (@_) { + $self->{server_port} = shift; + } + return $self->{server_port}; +} +sub filter +{ + my $self = shift; + if (@_) { + $self->{filter} = shift; + } + return $self->{filter}; +} +sub cipherc +{ + my $self = shift; + if (@_) { + $self->{cipherc} = shift; + } + return $self->{cipherc}; +} +sub ciphers +{ + my $self = shift; + if (@_) { + $self->{ciphers} = shift; + } + return $self->{ciphers}; +} +1; diff --git a/util/TLSProxy/Record.pm b/util/TLSProxy/Record.pm new file mode 100644 index 0000000..1d10508 --- /dev/null +++ b/util/TLSProxy/Record.pm @@ -0,0 +1,360 @@ +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; + +use TLSProxy::Proxy; + +package TLSProxy::Record; + +my $server_ccs_seen = 0; +my $client_ccs_seen = 0; +my $etm = 0; + +use constant TLS_RECORD_HEADER_LENGTH => 5; + +#Record types +use constant { + RT_APPLICATION_DATA => 23, + RT_HANDSHAKE => 22, + RT_ALERT => 21, + RT_CCS => 20 +}; + +my %record_type = ( + RT_APPLICATION_DATA, "APPLICATION DATA", + RT_HANDSHAKE, "HANDSHAKE", + RT_ALERT, "ALERT", + RT_CCS, "CCS" +); + +use constant { + VERS_TLS_1_3 => 772, + VERS_TLS_1_2 => 771, + VERS_TLS_1_1 => 770, + VERS_TLS_1_0 => 769, + VERS_SSL_3_0 => 768 +}; + +my %tls_version = ( + VERS_TLS_1_3, "TLS1.3", + VERS_TLS_1_2, "TLS1.2", + VERS_TLS_1_1, "TLS1.1", + VERS_TLS_1_0, "TLS1.0", + VERS_SSL_3_0, "SSL3" +); + +#Class method to extract records from a packet of data +sub get_records +{ + my $class = shift; + my $server = shift; + my $flight = shift; + my $packet = shift; + my @record_list = (); + my @message_list = (); + my $data; + my $content_type; + my $version; + my $len; + my $len_real; + my $decrypt_len; + + my $recnum = 1; + while (length ($packet) > 0) { + print " Record $recnum"; + if ($server) { + print " (server -> client)\n"; + } else { + print " (client -> server)\n"; + } + #Get the record header + if (length($packet) < TLS_RECORD_HEADER_LENGTH) { + print "Partial data : ".length($packet)." bytes\n"; + $packet = ""; + } else { + ($content_type, $version, $len) = unpack('CnnC*', $packet); + $data = substr($packet, 5, $len); + + print " Content type: ".$record_type{$content_type}."\n"; + print " Version: $tls_version{$version}\n"; + print " Length: $len"; + if ($len == length($data)) { + print "\n"; + $decrypt_len = $len_real = $len; + } else { + print " (expected), ".length($data)." (actual)\n"; + $decrypt_len = $len_real = length($data); + } + + my $record = TLSProxy::Record->new( + $flight, + $content_type, + $version, + $len, + $len_real, + $decrypt_len, + substr($packet, TLS_RECORD_HEADER_LENGTH, $len_real), + substr($packet, TLS_RECORD_HEADER_LENGTH, $len_real) + ); + + if (($server && $server_ccs_seen) + || (!$server && $client_ccs_seen)) { + if ($etm) { + $record->decryptETM(); + } else { + $record->decrypt(); + } + } + + push @record_list, $record; + + #Now figure out what messages are contained within this record + my @messages = TLSProxy::Message->get_messages($server, $record); + push @message_list, @messages; + + $packet = substr($packet, TLS_RECORD_HEADER_LENGTH + $len_real); + $recnum++; + } + } + + return (\@record_list, \@message_list); +} + +sub clear +{ + $server_ccs_seen = 0; + $client_ccs_seen = 0; +} + +#Class level accessors +sub server_ccs_seen +{ + my $class = shift; + if (@_) { + $server_ccs_seen = shift; + } + return $server_ccs_seen; +} +sub client_ccs_seen +{ + my $class = shift; + if (@_) { + $client_ccs_seen = shift; + } + return $client_ccs_seen; +} +#Enable/Disable Encrypt-then-MAC +sub etm +{ + my $class = shift; + if (@_) { + $etm = shift; + } + return $etm; +} + +sub new +{ + my $class = shift; + my ($flight, + $content_type, + $version, + $len, + $len_real, + $decrypt_len, + $data, + $decrypt_data) = @_; + + my $self = { + flight => $flight, + content_type => $content_type, + version => $version, + len => $len, + len_real => $len_real, + decrypt_len => $decrypt_len, + data => $data, + decrypt_data => $decrypt_data, + orig_decrypt_data => $decrypt_data + }; + + return bless $self, $class; +} + +#Decrypt using encrypt-then-MAC +sub decryptETM +{ + my ($self) = shift; + + my $data = $self->data; + + if($self->version >= VERS_TLS_1_1()) { + #TLS1.1+ has an explicit IV. Throw it away + $data = substr($data, 16); + } + + #Throw away the MAC (assumes MAC is 20 bytes for now. FIXME) + $data = substr($data, 0, length($data) - 20); + + #Find out what the padding byte is + my $padval = unpack("C", substr($data, length($data) - 1)); + + #Throw away the padding + $data = substr($data, 0, length($data) - ($padval + 1)); + + $self->decrypt_data($data); + $self->decrypt_len(length($data)); + + return $data; +} + +#Standard decrypt +sub decrypt() +{ + my ($self) = shift; + + my $data = $self->data; + + if($self->version >= VERS_TLS_1_1()) { + #TLS1.1+ has an explicit IV. Throw it away + $data = substr($data, 16); + } + + #Find out what the padding byte is + my $padval = unpack("C", substr($data, length($data) - 1)); + + #Throw away the padding + $data = substr($data, 0, length($data) - ($padval + 1)); + + #Throw away the MAC (assumes MAC is 20 bytes for now. FIXME) + $data = substr($data, 0, length($data) - 20); + + $self->decrypt_data($data); + $self->decrypt_len(length($data)); + + return $data; +} + +#Reconstruct the on-the-wire record representation +sub reconstruct_record +{ + my $self = shift; + my $data; + + $data = pack('Cnn', $self->content_type, $self->version, $self->len); + $data .= $self->data; + + return $data; +} + +#Read only accessors +sub flight +{ + my $self = shift; + return $self->{flight}; +} +sub content_type +{ + my $self = shift; + return $self->{content_type}; +} +sub version +{ + my $self = shift; + return $self->{version}; +} +sub len_real +{ + my $self = shift; + return $self->{len_real}; +} +sub orig_decrypt_data +{ + my $self = shift; + return $self->{orig_decrypt_data}; +} + +#Read/write accessors +sub decrypt_len +{ + my $self = shift; + if (@_) { + $self->{decrypt_len} = shift; + } + return $self->{decrypt_len}; +} +sub data +{ + my $self = shift; + if (@_) { + $self->{data} = shift; + } + return $self->{data}; +} +sub decrypt_data +{ + my $self = shift; + if (@_) { + $self->{decrypt_data} = shift; + } + return $self->{decrypt_data}; +} +sub len +{ + my $self = shift; + if (@_) { + $self->{len} = shift; + } + return $self->{len}; +} +1; diff --git a/util/TLSProxy/ServerHello.pm b/util/TLSProxy/ServerHello.pm new file mode 100644 index 0000000..693430e --- /dev/null +++ b/util/TLSProxy/ServerHello.pm @@ -0,0 +1,235 @@ +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; + +package TLSProxy::ServerHello; + +use parent 'TLSProxy::Message'; + +sub new +{ + my $class = shift; + my ($server, + $data, + $records, + $startoffset, + $message_frag_lens) = @_; + + my $self = $class->SUPER::new( + $server, + TLSProxy::Message::MT_SERVER_HELLO, + $data, + $records, + $startoffset, + $message_frag_lens); + + $self->{server_version} = 0; + $self->{random} = []; + $self->{session_id_len} = 0; + $self->{session} = ""; + $self->{ciphersuite} = 0; + $self->{comp_meth} = 0; + $self->{extensions_len} = 0; + $self->{extensions_data} = ""; + + return $self; +} + +sub parse +{ + my $self = shift; + my $ptr = 2; + my ($server_version) = unpack('n', $self->data); + my $random = substr($self->data, $ptr, 32); + $ptr += 32; + my $session_id_len = unpack('C', substr($self->data, $ptr)); + $ptr++; + my $session = substr($self->data, $ptr, $session_id_len); + $ptr += $session_id_len; + my $ciphersuite = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + my $comp_meth = unpack('C', substr($self->data, $ptr)); + $ptr++; + my $extensions_len = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + #For now we just deal with this as a block of data. In the future we will + #want to parse this + my $extension_data = substr($self->data, $ptr); + + if (length($extension_data) != $extensions_len) { + die "Invalid extension length\n"; + } + my %extensions = (); + while (length($extension_data) >= 4) { + my ($type, $size) = unpack("nn", $extension_data); + my $extdata = substr($extension_data, 4, $size); + $extension_data = substr($extension_data, 4 + $size); + $extensions{$type} = $extdata; + } + + $self->server_version($server_version); + $self->random($random); + $self->session_id_len($session_id_len); + $self->session($session); + $self->ciphersuite($ciphersuite); + $self->comp_meth($comp_meth); + $self->extensions_len($extensions_len); + $self->extension_data(\%extensions); + + $self->process_data(); + + print " Server Version:".$server_version."\n"; + print " Session ID Len:".$session_id_len."\n"; + print " Ciphersuite:".$ciphersuite."\n"; + print " Compression Method:".$comp_meth."\n"; + print " Extensions Len:".$extensions_len."\n"; +} + +#Perform any actions necessary based on the data we've seen +sub process_data +{ + my $self = shift; + + TLSProxy::Message->ciphersuite($self->ciphersuite); +} + +#Reconstruct the on-the-wire message data following changes +sub set_message_contents +{ + my $self = shift; + my $data; + + $data = pack('n', $self->server_version); + $data .= $self->random; + $data .= pack('C', $self->session_id_len); + $data .= $self->session; + $data .= pack('n', $self->ciphersuite); + $data .= pack('C', $self->comp_meth); + $data .= pack('n', $self->extensions_len); + foreach my $key (keys %{$self->extension_data}) { + my $extdata = ${$self->extension_data}{$key}; + $data .= pack("n", $key); + $data .= pack("n", length($extdata)); + $data .= $extdata; + } + + $self->data($data); +} + +#Read/write accessors +sub server_version +{ + my $self = shift; + if (@_) { + $self->{client_version} = shift; + } + return $self->{client_version}; +} +sub random +{ + my $self = shift; + if (@_) { + $self->{random} = shift; + } + return $self->{random}; +} +sub session_id_len +{ + my $self = shift; + if (@_) { + $self->{session_id_len} = shift; + } + return $self->{session_id_len}; +} +sub session +{ + my $self = shift; + if (@_) { + $self->{session} = shift; + } + return $self->{session}; +} +sub ciphersuite +{ + my $self = shift; + if (@_) { + $self->{ciphersuite} = shift; + } + return $self->{ciphersuite}; +} +sub comp_meth +{ + my $self = shift; + if (@_) { + $self->{comp_meth} = shift; + } + return $self->{comp_meth}; +} +sub extensions_len +{ + my $self = shift; + if (@_) { + $self->{extensions_len} = shift; + } + return $self->{extensions_len}; +} +sub extension_data +{ + my $self = shift; + if (@_) { + $self->{extension_data} = shift; + } + return $self->{extension_data}; +} +1; diff --git a/util/TLSProxy/ServerKeyExchange.pm b/util/TLSProxy/ServerKeyExchange.pm new file mode 100644 index 0000000..3a91d17 --- /dev/null +++ b/util/TLSProxy/ServerKeyExchange.pm @@ -0,0 +1,176 @@ +# Written by Matt Caswell for the OpenSSL project. +# ==================================================================== +# Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# +# 3. All advertising materials mentioning features or use of this +# software must display the following acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit. (http://www.openssl.org/)" +# +# 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to +# endorse or promote products derived from this software without +# prior written permission. For written permission, please contact +# openssl-core at openssl.org. +# +# 5. Products derived from this software may not be called "OpenSSL" +# nor may "OpenSSL" appear in their names without prior written +# permission of the OpenSSL Project. +# +# 6. Redistributions of any form whatsoever must retain the following +# acknowledgment: +# "This product includes software developed by the OpenSSL Project +# for use in the OpenSSL Toolkit (http://www.openssl.org/)" +# +# THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +# OF THE POSSIBILITY OF SUCH DAMAGE. +# ==================================================================== +# +# This product includes cryptographic software written by Eric Young +# (eay at cryptsoft.com). This product includes software written by Tim +# Hudson (tjh at cryptsoft.com). + +use strict; + +package TLSProxy::ServerKeyExchange; + +use parent 'TLSProxy::Message'; + +sub new +{ + my $class = shift; + my ($server, + $data, + $records, + $startoffset, + $message_frag_lens) = @_; + + my $self = $class->SUPER::new( + $server, + TLSProxy::Message::MT_SERVER_KEY_EXCHANGE, + $data, + $records, + $startoffset, + $message_frag_lens); + + #DHE + $self->{p} = ""; + $self->{g} = ""; + $self->{pub_key} = ""; + $self->{sig} = ""; + + return $self; +} + +sub parse +{ + my $self = shift; + + #Minimal SKE parsing. Only supports DHE at the moment (if its not DHE + #the parsing data will be trash...which is ok as long as we don't try to + #use it) + + my $p_len = unpack('n', $self->data); + my $ptr = 2; + my $p = substr($self->data, $ptr, $p_len); + $ptr += $p_len; + + my $g_len = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + my $g = substr($self->data, $ptr, $g_len); + $ptr += $g_len; + + my $pub_key_len = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + my $pub_key = substr($self->data, $ptr, $pub_key_len); + $ptr += $g_len; + + #We assume its signed + my $sig_len = unpack('n', substr($self->data, $ptr)); + $ptr += 2; + my $sig = substr($self->data, $ptr, $sig_len); + $ptr += $sig_len; + + $self->p($p); + $self->g($g); + $self->pub_key($pub_key); + $self->sig($sig); +} + + +#Reconstruct the on-the-wire message data following changes +sub set_message_contents +{ + my $self = shift; + my $data; + + $data = pack('n', length($self->p)); + $data .= $self->p; + $data .= pack('n', length($self->g)); + $data .= $self->g; + $data .= pack('n', length($self->pub_key)); + $data .= $self->pub_key; + if (length($self->sig) > 0) { + $data .= pack('n', length($self->sig)); + $data .= $self->sig; + } + + $self->data($data); +} + +#Read/write accessors +#DHE +sub p +{ + my $self = shift; + if (@_) { + $self->{p} = shift; + } + return $self->{p}; +} +sub g +{ + my $self = shift; + if (@_) { + $self->{g} = shift; + } + return $self->{g}; +} +sub pub_key +{ + my $self = shift; + if (@_) { + $self->{pub_key} = shift; + } + return $self->{pub_key}; +} +sub sig +{ + my $self = shift; + if (@_) { + $self->{sig} = shift; + } + return $self->{sig}; +} +1; From matt at openssl.org Tue Aug 11 21:21:47 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 21:21:47 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439328107.223090.22666.nullmailer@dev.openssl.org> The branch master has been updated via f75d5171be0b3b5419c8974133e1573cf976a8bb (commit) via d8e8590ed90eba6ef651d09d77befb14f980de2c (commit) from 6142f5c640f98429d4798b8418e8cc2cf6cc1fb8 (commit) - Log ----------------------------------------------------------------- commit f75d5171be0b3b5419c8974133e1573cf976a8bb Author: Matt Caswell Date: Tue Aug 11 19:38:39 2015 +0100 Fix "make test" seg fault with SCTP enabled When config'd with "sctp" running "make test" causes a seg fault. This is actually due to the way ssltest works - it dives under the covers and frees up BIOs manually and so some BIOs are NULL when the SCTP code does not expect it. The simplest fix is just to add some sanity checks to make sure the BIOs aren't NULL before we use them. This problem occurs in master and 1.0.2. The fix has also been applied to 1.0.1 to keep the code in sync. Reviewed-by: Tim Hudson commit d8e8590ed90eba6ef651d09d77befb14f980de2c Author: Matt Caswell Date: Tue Aug 11 19:36:43 2015 +0100 Fix missing return value checks in SCTP There are some missing return value checks in the SCTP code. In master this was causing a compilation failure when config'd with "--strict-warnings sctp". Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: ssl/d1_both.c | 7 +++++-- ssl/d1_clnt.c | 16 ++++++++++++---- ssl/d1_srvr.c | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ssl/d1_both.c b/ssl/d1_both.c index ec47b94..2c3ab54 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1365,9 +1365,12 @@ int dtls1_shutdown(SSL *s) { int ret; #ifndef OPENSSL_NO_SCTP - if (BIO_dgram_is_sctp(SSL_get_wbio(s)) && + BIO *wbio; + + wbio = SSL_get_wbio(s); + if (wbio != NULL && BIO_dgram_is_sctp(wbio) && !(s->shutdown & SSL_SENT_SHUTDOWN)) { - ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(s)); + ret = BIO_dgram_sctp_wait_for_dry(wbio); if (ret < 0) return -1; diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 566c154..d411614 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -364,11 +364,15 @@ int dtls1_connect(SSL *s) sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, sizeof(labelbuffer), NULL, 0, - 0); + 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, @@ -493,9 +497,13 @@ int dtls1_connect(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 19562e1..555bbdf 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -417,9 +417,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, - sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + if (SSL_export_keying_material(s, sctpauthkey, + sizeof(sctpauthkey), labelbuffer, + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); @@ -606,9 +610,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); From matt at openssl.org Tue Aug 11 21:26:45 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 21:26:45 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439328405.003681.28472.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 0b12fa75c9df5c2c9c2f5094514323360c0af981 (commit) via b3a62dc0323082b30121b3232c572a43172b47b9 (commit) from 512368c9ed4d53fb230000e83071eb81bf628b22 (commit) - Log ----------------------------------------------------------------- commit 0b12fa75c9df5c2c9c2f5094514323360c0af981 Author: Matt Caswell Date: Tue Aug 11 19:38:39 2015 +0100 Fix "make test" seg fault with SCTP enabled When config'd with "sctp" running "make test" causes a seg fault. This is actually due to the way ssltest works - it dives under the covers and frees up BIOs manually and so some BIOs are NULL when the SCTP code does not expect it. The simplest fix is just to add some sanity checks to make sure the BIOs aren't NULL before we use them. This problem occurs in master and 1.0.2. The fix has also been applied to 1.0.1 to keep the code in sync. Reviewed-by: Tim Hudson (cherry picked from commit f75d5171be0b3b5419c8974133e1573cf976a8bb) commit b3a62dc0323082b30121b3232c572a43172b47b9 Author: Matt Caswell Date: Tue Aug 11 19:36:43 2015 +0100 Fix missing return value checks in SCTP There are some missing return value checks in the SCTP code. In master this was causing a compilation failure when config'd with "--strict-warnings sctp". Reviewed-by: Tim Hudson (cherry picked from commit d8e8590ed90eba6ef651d09d77befb14f980de2c) ----------------------------------------------------------------------- Summary of changes: ssl/d1_both.c | 7 +++++-- ssl/d1_clnt.c | 16 ++++++++++++---- ssl/d1_srvr.c | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ssl/d1_both.c b/ssl/d1_both.c index b4ee7ab..c2c8d57 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1370,9 +1370,12 @@ int dtls1_shutdown(SSL *s) { int ret; #ifndef OPENSSL_NO_SCTP - if (BIO_dgram_is_sctp(SSL_get_wbio(s)) && + BIO *wbio; + + wbio = SSL_get_wbio(s); + if (wbio != NULL && BIO_dgram_is_sctp(wbio) && !(s->shutdown & SSL_SENT_SHUTDOWN)) { - ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(s)); + ret = BIO_dgram_sctp_wait_for_dry(wbio); if (ret < 0) return -1; diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 4c2ccbf..c84df98 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -366,11 +366,15 @@ int dtls1_connect(SSL *s) sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, sizeof(labelbuffer), NULL, 0, - 0); + 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, @@ -500,9 +504,13 @@ int dtls1_connect(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 655333a..6c3bfb8 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -421,9 +421,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, - sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + if (SSL_export_keying_material(s, sctpauthkey, + sizeof(sctpauthkey), labelbuffer, + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); @@ -635,9 +639,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); From matt at openssl.org Tue Aug 11 21:30:13 2015 From: matt at openssl.org (Matt Caswell) Date: Tue, 11 Aug 2015 21:30:13 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_1-stable update Message-ID: <1439328613.582206.32362.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_1-stable has been updated via 396e30044910df29b81a416de42a94eb4355cd70 (commit) via 402634f8aaf2f2c83b2cc648a0ae376247b029f4 (commit) from b11980d79a52ec08844f08bea0e66c04b691840b (commit) - Log ----------------------------------------------------------------- commit 396e30044910df29b81a416de42a94eb4355cd70 Author: Matt Caswell Date: Tue Aug 11 19:38:39 2015 +0100 Fix "make test" seg fault with SCTP enabled When config'd with "sctp" running "make test" causes a seg fault. This is actually due to the way ssltest works - it dives under the covers and frees up BIOs manually and so some BIOs are NULL when the SCTP code does not expect it. The simplest fix is just to add some sanity checks to make sure the BIOs aren't NULL before we use them. This problem occurs in master and 1.0.2. The fix has also been applied to 1.0.1 to keep the code in sync. Reviewed-by: Tim Hudson (cherry picked from commit f75d5171be0b3b5419c8974133e1573cf976a8bb) commit 402634f8aaf2f2c83b2cc648a0ae376247b029f4 Author: Matt Caswell Date: Tue Aug 11 19:36:43 2015 +0100 Fix missing return value checks in SCTP There are some missing return value checks in the SCTP code. In master this was causing a compilation failure when config'd with "--strict-warnings sctp". Reviewed-by: Tim Hudson (cherry picked from commit d8e8590ed90eba6ef651d09d77befb14f980de2c) ----------------------------------------------------------------------- Summary of changes: ssl/d1_both.c | 7 +++++-- ssl/d1_clnt.c | 16 ++++++++++++---- ssl/d1_srvr.c | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/ssl/d1_both.c b/ssl/d1_both.c index 8dd8ea3..d453c07 100644 --- a/ssl/d1_both.c +++ b/ssl/d1_both.c @@ -1490,9 +1490,12 @@ int dtls1_shutdown(SSL *s) { int ret; #ifndef OPENSSL_NO_SCTP - if (BIO_dgram_is_sctp(SSL_get_wbio(s)) && + BIO *wbio; + + wbio = SSL_get_wbio(s); + if (wbio != NULL && BIO_dgram_is_sctp(wbio) && !(s->shutdown & SSL_SENT_SHUTDOWN)) { - ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(s)); + ret = BIO_dgram_sctp_wait_for_dry(wbio); if (ret < 0) return -1; diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c index 377c1e6..a9c4ed0 100644 --- a/ssl/d1_clnt.c +++ b/ssl/d1_clnt.c @@ -350,11 +350,15 @@ int dtls1_connect(SSL *s) sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, sizeof(labelbuffer), NULL, 0, - 0); + 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, @@ -484,9 +488,13 @@ int dtls1_connect(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index 41c7dc5..d716f0a 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -405,9 +405,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, - sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + if (SSL_export_keying_material(s, sctpauthkey, + sizeof(sctpauthkey), labelbuffer, + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); @@ -628,9 +632,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); From rsalz at openssl.org Tue Aug 11 22:27:24 2015 From: rsalz at openssl.org (Rich Salz) Date: Tue, 11 Aug 2015 22:27:24 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439332044.855632.29681.nullmailer@dev.openssl.org> The branch master has been updated via ade44dcb16141c8a30ca6c56a1fd1a0b14dcc360 (commit) from f75d5171be0b3b5419c8974133e1573cf976a8bb (commit) - Log ----------------------------------------------------------------- commit ade44dcb16141c8a30ca6c56a1fd1a0b14dcc360 Author: Rich Salz Date: Tue Aug 4 12:32:40 2015 -0400 Remove Gost94 signature algorithm. This was obsolete in 2001. This is not the same as Gost94 digest. Thanks to Dmitry Belyavsky for review and advice. Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: apps/s_cb.c | 1 - crypto/x509/x509type.c | 1 - doc/apps/ciphers.pod | 5 - engines/ccgost/Makefile | 63 ++------ engines/ccgost/e_gost_err.c | 18 --- engines/ccgost/gost2001.c | 1 - engines/ccgost/gost94_keyx.c | 281 --------------------------------- engines/ccgost/gost_ameth.c | 316 +++---------------------------------- engines/ccgost/gost_asn1.c | 16 ++ engines/ccgost/gost_crypt.c | 1 - engines/ccgost/gost_eng.c | 41 ++--- engines/ccgost/gost_lcl.h | 28 ++-- engines/ccgost/gost_params.c | 129 +-------------- engines/ccgost/gost_params.h | 34 ---- engines/ccgost/gost_pmeth.c | 164 +++---------------- engines/ccgost/gost_sign.c | 365 ------------------------------------------- include/openssl/tls1.h | 1 - ssl/s3_both.c | 4 +- ssl/s3_clnt.c | 3 +- ssl/s3_lib.c | 90 +---------- ssl/s3_srvr.c | 10 +- ssl/ssl_ciph.c | 12 +- ssl/ssl_lib.c | 5 - ssl/ssl_locl.h | 3 - 24 files changed, 118 insertions(+), 1474 deletions(-) delete mode 100644 engines/ccgost/gost94_keyx.c delete mode 100644 engines/ccgost/gost_params.h delete mode 100644 engines/ccgost/gost_sign.c diff --git a/apps/s_cb.c b/apps/s_cb.c index a14e00c..2a18f74 100644 --- a/apps/s_cb.c +++ b/apps/s_cb.c @@ -288,7 +288,6 @@ static STRINT_PAIR cert_type_list[] = { {"ECDSA sign", TLS_CT_ECDSA_SIGN}, {"RSA fixed ECDH", TLS_CT_RSA_FIXED_ECDH}, {"ECDSA fixed ECDH", TLS_CT_ECDSA_FIXED_ECDH}, - {"GOST94 Sign", TLS_CT_GOST94_SIGN}, {"GOST01 Sign", TLS_CT_GOST01_SIGN}, {NULL} }; diff --git a/crypto/x509/x509type.c b/crypto/x509/x509type.c index 97e5bab..232ba9b 100644 --- a/crypto/x509/x509type.c +++ b/crypto/x509/x509type.c @@ -93,7 +93,6 @@ int X509_certificate_type(X509 *x, EVP_PKEY *pkey) case EVP_PKEY_DH: ret = EVP_PK_DH | EVP_PKT_EXCH; break; - case NID_id_GostR3410_94: case NID_id_GostR3410_2001: ret = EVP_PKT_EXCH | EVP_PKT_SIGN; break; diff --git a/doc/apps/ciphers.pod b/doc/apps/ciphers.pod index d7b7bea..5a4a4fd 100644 --- a/doc/apps/ciphers.pod +++ b/doc/apps/ciphers.pod @@ -310,11 +310,6 @@ cipher suites using GOST R 34.10 (either 2001 or 94) for authentication cipher suites using GOST R 34.10-2001 authentication. -=item B - -cipher suites using GOST R 34.10-94 authentication (note that R 34.10-94 -standard has been expired so use GOST R 34.10-2001) - =item B cipher suites, using VKO 34.10 key exchange, specified in the RFC 4357. diff --git a/engines/ccgost/Makefile b/engines/ccgost/Makefile index 57b9c59..3c1e4f9 100644 --- a/engines/ccgost/Makefile +++ b/engines/ccgost/Makefile @@ -8,9 +8,9 @@ AR= ar r CFLAGS= $(INCLUDES) $(CFLAG) LIB=$(TOP)/libcrypto.a -LIBSRC= gost2001.c gost2001_keyx.c gost89.c gost94_keyx.c gost_ameth.c gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c gosthash.c gost_keywrap.c gost_md.c gost_params.c gost_pmeth.c gost_sign.c +LIBSRC= gost2001.c gost2001_keyx.c gost89.c gost_ameth.c gost_asn1.c gost_crypt.c gost_ctl.c gost_eng.c gosthash.c gost_keywrap.c gost_md.c gost_pmeth.c gost_params.c -LIBOBJ= e_gost_err.o gost2001_keyx.o gost2001.o gost89.o gost94_keyx.o gost_ameth.o gost_asn1.o gost_crypt.o gost_ctl.o gost_eng.o gosthash.o gost_keywrap.o gost_md.o gost_params.o gost_pmeth.o gost_sign.o +LIBOBJ= e_gost_err.o gost2001_keyx.o gost2001.o gost89.o gost_ameth.o gost_asn1.o gost_crypt.o gost_ctl.o gost_eng.o gosthash.o gost_keywrap.o gost_md.o gost_pmeth.o gost_params.o SRC=$(LIBSRC) @@ -100,8 +100,7 @@ gost2001.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h gost2001.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h gost2001.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h gost2001.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -gost2001.o: e_gost_err.h gost2001.c gost89.h gost_lcl.h gost_params.h -gost2001.o: gosthash.h +gost2001.o: e_gost_err.h gost2001.c gost89.h gost_lcl.h gosthash.h gost2001_keyx.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h gost2001_keyx.o: ../../include/openssl/bio.h ../../include/openssl/bn.h gost2001_keyx.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h @@ -120,23 +119,6 @@ gost2001_keyx.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h gost2001_keyx.o: ../../include/openssl/x509_vfy.h e_gost_err.h gost2001_keyx.c gost2001_keyx.o: gost2001_keyx.h gost89.h gost_keywrap.h gost_lcl.h gosthash.h gost89.o: gost89.c gost89.h -gost94_keyx.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h -gost94_keyx.o: ../../include/openssl/bio.h ../../include/openssl/bn.h -gost94_keyx.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h -gost94_keyx.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -gost94_keyx.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h -gost94_keyx.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h -gost94_keyx.o: ../../include/openssl/engine.h ../../include/openssl/err.h -gost94_keyx.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h -gost94_keyx.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h -gost94_keyx.o: ../../include/openssl/opensslconf.h -gost94_keyx.o: ../../include/openssl/opensslv.h -gost94_keyx.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h -gost94_keyx.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h -gost94_keyx.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -gost94_keyx.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -gost94_keyx.o: ../../include/openssl/x509_vfy.h e_gost_err.h gost89.h -gost94_keyx.o: gost94_keyx.c gost_keywrap.h gost_lcl.h gosthash.h gost_ameth.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h gost_ameth.o: ../../include/openssl/bio.h ../../include/openssl/bn.h gost_ameth.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h @@ -152,7 +134,7 @@ gost_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h gost_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h gost_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h gost_ameth.o: ../../include/openssl/x509_vfy.h e_gost_err.h gost89.h -gost_ameth.o: gost_ameth.c gost_lcl.h gost_params.h gosthash.h +gost_ameth.o: gost_ameth.c gost_lcl.h gosthash.h gost_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h gost_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h gost_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h @@ -229,14 +211,21 @@ gost_md.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h gost_md.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h gost_md.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h gost_md.o: e_gost_err.h gost89.h gost_lcl.h gost_md.c gosthash.h -gost_params.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -gost_params.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h +gost_params.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h +gost_params.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +gost_params.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +gost_params.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +gost_params.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h +gost_params.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h +gost_params.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h gost_params.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h gost_params.o: ../../include/openssl/opensslconf.h gost_params.o: ../../include/openssl/opensslv.h -gost_params.o: ../../include/openssl/ossl_typ.h -gost_params.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -gost_params.o: ../../include/openssl/symhacks.h gost_params.c gost_params.h +gost_params.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h +gost_params.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h +gost_params.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h +gost_params.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h +gost_params.o: gost89.h gost_lcl.h gost_params.c gosthash.h gost_pmeth.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h gost_pmeth.o: ../../include/openssl/bio.h ../../include/openssl/bn.h gost_pmeth.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h @@ -252,23 +241,5 @@ gost_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h gost_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h gost_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h gost_pmeth.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h -gost_pmeth.o: e_gost_err.h gost89.h gost_lcl.h gost_params.h gost_pmeth.c -gost_pmeth.o: gosthash.h -gost_sign.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h -gost_sign.o: ../../include/openssl/bio.h ../../include/openssl/bn.h -gost_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h -gost_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -gost_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h -gost_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h -gost_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h -gost_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h -gost_sign.o: ../../include/openssl/objects.h -gost_sign.o: ../../include/openssl/opensslconf.h -gost_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h -gost_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h -gost_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -gost_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -gost_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -gost_sign.o: e_gost_err.h gost89.h gost_lcl.h gost_params.h gost_sign.c -gost_sign.o: gosthash.h +gost_pmeth.o: e_gost_err.h gost89.h gost_lcl.h gost_pmeth.c gosthash.h gosthash.o: gost89.h gosthash.c gosthash.h diff --git a/engines/ccgost/e_gost_err.c b/engines/ccgost/e_gost_err.c index 0afd913..d05ef61 100644 --- a/engines/ccgost/e_gost_err.c +++ b/engines/ccgost/e_gost_err.c @@ -73,7 +73,6 @@ static ERR_STRING_DATA GOST_str_functs[] = { {ERR_FUNC(GOST_F_DECODE_GOST_ALGOR_PARAMS), "DECODE_GOST_ALGOR_PARAMS"}, {ERR_FUNC(GOST_F_ENCODE_GOST_ALGOR_PARAMS), "ENCODE_GOST_ALGOR_PARAMS"}, {ERR_FUNC(GOST_F_FILL_GOST2001_PARAMS), "FILL_GOST2001_PARAMS"}, - {ERR_FUNC(GOST_F_FILL_GOST94_PARAMS), "FILL_GOST94_PARAMS"}, {ERR_FUNC(GOST_F_GET_ENCRYPTION_PARAMS), "GET_ENCRYPTION_PARAMS"}, {ERR_FUNC(GOST_F_GOST2001_COMPUTE_PUBLIC), "GOST2001_COMPUTE_PUBLIC"}, {ERR_FUNC(GOST_F_GOST2001_DO_SIGN), "GOST2001_DO_SIGN"}, @@ -83,37 +82,24 @@ static ERR_STRING_DATA GOST_str_functs[] = { "GOST89_GET_ASN1_PARAMETERS"}, {ERR_FUNC(GOST_F_GOST89_SET_ASN1_PARAMETERS), "GOST89_SET_ASN1_PARAMETERS"}, - {ERR_FUNC(GOST_F_GOST94_COMPUTE_PUBLIC), "GOST94_COMPUTE_PUBLIC"}, {ERR_FUNC(GOST_F_GOST_CIPHER_CTL), "GOST_CIPHER_CTL"}, - {ERR_FUNC(GOST_F_GOST_DO_SIGN), "GOST_DO_SIGN"}, - {ERR_FUNC(GOST_F_GOST_DO_VERIFY), "GOST_DO_VERIFY"}, {ERR_FUNC(GOST_F_GOST_IMIT_CTRL), "GOST_IMIT_CTRL"}, {ERR_FUNC(GOST_F_GOST_IMIT_FINAL), "GOST_IMIT_FINAL"}, {ERR_FUNC(GOST_F_GOST_IMIT_UPDATE), "GOST_IMIT_UPDATE"}, - {ERR_FUNC(GOST_F_GOST_SIGN_KEYGEN), "GOST_SIGN_KEYGEN"}, {ERR_FUNC(GOST_F_PARAM_COPY_GOST01), "PARAM_COPY_GOST01"}, - {ERR_FUNC(GOST_F_PARAM_COPY_GOST94), "PARAM_COPY_GOST94"}, {ERR_FUNC(GOST_F_PKEY_GOST01CP_DECRYPT), "PKEY_GOST01CP_DECRYPT"}, {ERR_FUNC(GOST_F_PKEY_GOST01CP_ENCRYPT), "PKEY_GOST01CP_ENCRYPT"}, - {ERR_FUNC(GOST_F_PKEY_GOST01CP_KEYGEN), "PKEY_GOST01CP_KEYGEN"}, {ERR_FUNC(GOST_F_PKEY_GOST01_PARAMGEN), "PKEY_GOST01_PARAMGEN"}, {ERR_FUNC(GOST_F_PKEY_GOST2001_DERIVE), "PKEY_GOST2001_DERIVE"}, - {ERR_FUNC(GOST_F_PKEY_GOST94CP_DECRYPT), "PKEY_GOST94CP_DECRYPT"}, - {ERR_FUNC(GOST_F_PKEY_GOST94CP_ENCRYPT), "PKEY_GOST94CP_ENCRYPT"}, - {ERR_FUNC(GOST_F_PKEY_GOST94CP_KEYGEN), "PKEY_GOST94CP_KEYGEN"}, - {ERR_FUNC(GOST_F_PKEY_GOST94_PARAMGEN), "PKEY_GOST94_PARAMGEN"}, {ERR_FUNC(GOST_F_PKEY_GOST_CTRL), "PKEY_GOST_CTRL"}, {ERR_FUNC(GOST_F_PKEY_GOST_CTRL01_STR), "PKEY_GOST_CTRL01_STR"}, - {ERR_FUNC(GOST_F_PKEY_GOST_CTRL94_STR), "PKEY_GOST_CTRL94_STR"}, {ERR_FUNC(GOST_F_PKEY_GOST_MAC_CTRL), "PKEY_GOST_MAC_CTRL"}, {ERR_FUNC(GOST_F_PKEY_GOST_MAC_CTRL_STR), "PKEY_GOST_MAC_CTRL_STR"}, {ERR_FUNC(GOST_F_PKEY_GOST_MAC_KEYGEN), "PKEY_GOST_MAC_KEYGEN"}, {ERR_FUNC(GOST_F_PRINT_GOST_01), "PRINT_GOST_01"}, {ERR_FUNC(GOST_F_PRIV_DECODE_GOST), "PRIV_DECODE_GOST"}, {ERR_FUNC(GOST_F_PUB_DECODE_GOST01), "PUB_DECODE_GOST01"}, - {ERR_FUNC(GOST_F_PUB_DECODE_GOST94), "PUB_DECODE_GOST94"}, {ERR_FUNC(GOST_F_PUB_ENCODE_GOST01), "PUB_ENCODE_GOST01"}, - {ERR_FUNC(GOST_F_UNPACK_CC_SIGNATURE), "UNPACK_CC_SIGNATURE"}, {ERR_FUNC(GOST_F_UNPACK_CP_SIGNATURE), "UNPACK_CP_SIGNATURE"}, {0, NULL} }; @@ -128,8 +114,6 @@ static ERR_STRING_DATA GOST_str_reasons[] = { {ERR_REASON(GOST_R_CTRL_CALL_FAILED), "ctrl call failed"}, {ERR_REASON(GOST_R_ERROR_COMPUTING_SHARED_KEY), "error computing shared key"}, - {ERR_REASON(GOST_R_ERROR_PACKING_KEY_TRANSPORT_INFO), - "error packing key transport info"}, {ERR_REASON(GOST_R_ERROR_PARSING_KEY_TRANSPORT_INFO), "error parsing key transport info"}, {ERR_REASON(GOST_R_INCOMPATIBLE_ALGORITHMS), "incompatible algorithms"}, @@ -137,11 +121,9 @@ static ERR_STRING_DATA GOST_str_reasons[] = { {ERR_REASON(GOST_R_INVALID_CIPHER_PARAMS), "invalid cipher params"}, {ERR_REASON(GOST_R_INVALID_CIPHER_PARAM_OID), "invalid cipher param oid"}, {ERR_REASON(GOST_R_INVALID_DIGEST_TYPE), "invalid digest type"}, - {ERR_REASON(GOST_R_INVALID_GOST94_PARMSET), "invalid gost94 parmset"}, {ERR_REASON(GOST_R_INVALID_IV_LENGTH), "invalid iv length"}, {ERR_REASON(GOST_R_INVALID_MAC_KEY_LENGTH), "invalid mac key length"}, {ERR_REASON(GOST_R_INVALID_PARAMSET), "invalid paramset"}, - {ERR_REASON(GOST_R_KEY_IS_NOT_INITALIZED), "key is not initalized"}, {ERR_REASON(GOST_R_KEY_IS_NOT_INITIALIZED), "key is not initialized"}, {ERR_REASON(GOST_R_KEY_PARAMETERS_MISSING), "key parameters missing"}, {ERR_REASON(GOST_R_MAC_KEY_NOT_SET), "mac key not set"}, diff --git a/engines/ccgost/gost2001.c b/engines/ccgost/gost2001.c index 6d41f31..985795e 100644 --- a/engines/ccgost/gost2001.c +++ b/engines/ccgost/gost2001.c @@ -7,7 +7,6 @@ * Requires OpenSSL 0.9.9 for compilation * **********************************************************************/ #include "gost_lcl.h" -#include "gost_params.h" #include #include #include diff --git a/engines/ccgost/gost94_keyx.c b/engines/ccgost/gost94_keyx.c deleted file mode 100644 index b529c8e..0000000 --- a/engines/ccgost/gost94_keyx.c +++ /dev/null @@ -1,281 +0,0 @@ -/********************************************************************** - * gost94_keyx.c * - * Copyright (c) 2005-2006 Cryptocom LTD * - * This file is distributed under the same license as OpenSSL * - * * - * Implements generation and parsing of GOST_KEY_TRANSPORT for * - * GOST R 34.10-94 algorithms * - * * - * Requires OpenSSL 0.9.9 for compilation * - **********************************************************************/ -#include -#include -#include -#include -#include -#include - -#include "gost89.h" -#include "gosthash.h" -#include "e_gost_err.h" -#include "gost_keywrap.h" -#include "gost_lcl.h" -/* Common functions for both 94 and 2001 key exchange schemes */ -/* - * Implementation of the Diffi-Hellman key agreement scheme based on GOST-94 - * keys - */ - -/* - * Computes Diffie-Hellman key and stores it into buffer in little-endian - * byte order as expected by both versions of GOST 94 algorithm - */ -static int compute_pair_key_le(unsigned char *pair_key, BIGNUM *pub_key, - DH *dh) -{ - unsigned char be_key[128]; - int i, key_size; - key_size = DH_compute_key(be_key, pub_key, dh); - if (!key_size) - return 0; - memset(pair_key, 0, 128); - for (i = 0; i < key_size; i++) { - pair_key[i] = be_key[key_size - 1 - i]; - } - return key_size; -} - -/* - * Computes 256 bit Key exchange key as specified in RFC 4357 - */ -static int make_cp_exchange_key(BIGNUM *priv_key, EVP_PKEY *pubk, - unsigned char *shared_key) -{ - unsigned char dh_key[128]; - int ret; - gost_hash_ctx hash_ctx; - DH *dh = DH_new(); - - if (!dh) - return 0; - memset(dh_key, 0, 128); - dh->g = BN_dup(pubk->pkey.dsa->g); - dh->p = BN_dup(pubk->pkey.dsa->p); - dh->priv_key = BN_dup(priv_key); - ret = - compute_pair_key_le(dh_key, ((DSA *)(EVP_PKEY_get0(pubk)))->pub_key, - dh); - DH_free(dh); - if (!ret) - return 0; - init_gost_hash_ctx(&hash_ctx, &GostR3411_94_CryptoProParamSet); - start_hash(&hash_ctx); - hash_block(&hash_ctx, dh_key, 128); - finish_hash(&hash_ctx, shared_key); - done_gost_hash_ctx(&hash_ctx); - return 1; -} - -/* EVP_PKEY_METHOD callback derive. Implements VKO R 34.10-94 */ - -int pkey_gost94_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) -{ - EVP_PKEY *pubk = EVP_PKEY_CTX_get0_peerkey(ctx); - EVP_PKEY *mykey = EVP_PKEY_CTX_get0_pkey(ctx); - *keylen = 32; - if (key == NULL) - return 1; - - return make_cp_exchange_key(gost_get0_priv_key(mykey), pubk, key); -} - -/* - * EVP_PKEY_METHOD callback encrypt for GOST R 34.10-94 cryptopro - * modification - */ - -int pkey_GOST94cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, - size_t *outlen, const unsigned char *key, - size_t key_len) -{ - GOST_KEY_TRANSPORT *gkt = NULL; - unsigned char shared_key[32], ukm[8], crypted_key[44]; - const struct gost_cipher_info *param = get_encryption_params(NULL); - EVP_PKEY *pubk = EVP_PKEY_CTX_get0_pkey(ctx); - struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); - gost_ctx cctx; - int key_is_ephemeral = 1; - int tmp_outlen; - EVP_PKEY *mykey = EVP_PKEY_CTX_get0_peerkey(ctx); - - /* Do not use vizir cipher parameters with cryptopro */ - if (!get_gost_engine_param(GOST_PARAM_CRYPT_PARAMS) - && param == gost_cipher_list) { - param = gost_cipher_list + 1; - } - - if (mykey) { - /* If key already set, it is not ephemeral */ - key_is_ephemeral = 0; - if (!gost_get0_priv_key(mykey)) { - GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT, - GOST_R_NO_PRIVATE_PART_OF_NON_EPHEMERAL_KEYPAIR); - goto err; - } - } else { - /* Otherwise generate ephemeral key */ - key_is_ephemeral = 1; - if (out) { - mykey = EVP_PKEY_new(); - EVP_PKEY_assign(mykey, EVP_PKEY_base_id(pubk), DSA_new()); - EVP_PKEY_copy_parameters(mykey, pubk); - if (!gost_sign_keygen(EVP_PKEY_get0(mykey))) { - goto err; - } - } - } - if (out) - make_cp_exchange_key(gost_get0_priv_key(mykey), pubk, shared_key); - if (data->shared_ukm) { - memcpy(ukm, data->shared_ukm, 8); - } else if (out) { - if (RAND_bytes(ukm, 8) <= 0) { - GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT, - GOST_R_RANDOM_GENERATOR_FAILURE); - goto err; - } - } - - if (out) { - gost_init(&cctx, param->sblock); - keyWrapCryptoPro(&cctx, shared_key, ukm, key, crypted_key); - } - gkt = GOST_KEY_TRANSPORT_new(); - if (!gkt) { - goto memerr; - } - if (!ASN1_OCTET_STRING_set(gkt->key_agreement_info->eph_iv, ukm, 8)) { - goto memerr; - } - if (!ASN1_OCTET_STRING_set(gkt->key_info->imit, crypted_key + 40, 4)) { - goto memerr; - } - if (!ASN1_OCTET_STRING_set - (gkt->key_info->encrypted_key, crypted_key + 8, 32)) { - goto memerr; - } - if (key_is_ephemeral) { - if (!X509_PUBKEY_set - (&gkt->key_agreement_info->ephem_key, out ? mykey : pubk)) { - GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT, - GOST_R_CANNOT_PACK_EPHEMERAL_KEY); - goto err; - } - if (out) - EVP_PKEY_free(mykey); - } - ASN1_OBJECT_free(gkt->key_agreement_info->cipher); - gkt->key_agreement_info->cipher = OBJ_nid2obj(param->nid); - tmp_outlen = i2d_GOST_KEY_TRANSPORT(gkt, out ? &out : NULL); - if (tmp_outlen <= 0) { - GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT, - GOST_R_ERROR_PACKING_KEY_TRANSPORT_INFO); - goto err; - } - *outlen = tmp_outlen; - if (!key_is_ephemeral) { - /* Set control "public key from client certificate used" */ - if (EVP_PKEY_CTX_ctrl(ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 3, NULL) <= - 0) { - GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT, GOST_R_CTRL_CALL_FAILED); - goto err; - } - } - GOST_KEY_TRANSPORT_free(gkt); - return 1; - memerr: - if (key_is_ephemeral) { - EVP_PKEY_free(mykey); - } - GOSTerr(GOST_F_PKEY_GOST94CP_ENCRYPT, ERR_R_MALLOC_FAILURE); - err: - GOST_KEY_TRANSPORT_free(gkt); - return -1; -} - -/* - * EVP_PLEY_METHOD callback decrypt for GOST R 34.10-94 cryptopro - * modification - */ -int pkey_GOST94cp_decrypt(EVP_PKEY_CTX *ctx, unsigned char *key, - size_t *key_len, const unsigned char *in, - size_t in_len) -{ - const unsigned char *p = in; - GOST_KEY_TRANSPORT *gkt = NULL; - unsigned char wrappedKey[44]; - unsigned char sharedKey[32]; - gost_ctx cctx; - const struct gost_cipher_info *param = NULL; - EVP_PKEY *eph_key = NULL, *peerkey = NULL; - EVP_PKEY *priv = EVP_PKEY_CTX_get0_pkey(ctx); - - if (!key) { - *key_len = 32; - return 1; - } - - gkt = d2i_GOST_KEY_TRANSPORT(NULL, (const unsigned char **)&p, in_len); - if (!gkt) { - GOSTerr(GOST_F_PKEY_GOST94CP_DECRYPT, - GOST_R_ERROR_PARSING_KEY_TRANSPORT_INFO); - return 0; - } - eph_key = X509_PUBKEY_get(gkt->key_agreement_info->ephem_key); - if (eph_key) { - if (EVP_PKEY_derive_set_peer(ctx, eph_key) <= 0) { - GOSTerr(GOST_F_PKEY_GOST94CP_DECRYPT, - GOST_R_INCOMPATIBLE_PEER_KEY); - goto err; - } - } else { - /* Set control "public key from client certificate used" */ - if (EVP_PKEY_CTX_ctrl(ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 3, NULL) <= - 0) { - GOSTerr(GOST_F_PKEY_GOST94CP_DECRYPT, GOST_R_CTRL_CALL_FAILED); - goto err; - } - } - peerkey = EVP_PKEY_CTX_get0_peerkey(ctx); - if (!peerkey) { - GOSTerr(GOST_F_PKEY_GOST94CP_DECRYPT, GOST_R_NO_PEER_KEY); - goto err; - } - - param = get_encryption_params(gkt->key_agreement_info->cipher); - if (!param) { - goto err; - } - - gost_init(&cctx, param->sblock); - OPENSSL_assert(gkt->key_agreement_info->eph_iv->length == 8); - memcpy(wrappedKey, gkt->key_agreement_info->eph_iv->data, 8); - OPENSSL_assert(gkt->key_info->encrypted_key->length == 32); - memcpy(wrappedKey + 8, gkt->key_info->encrypted_key->data, 32); - OPENSSL_assert(gkt->key_info->imit->length == 4); - memcpy(wrappedKey + 40, gkt->key_info->imit->data, 4); - make_cp_exchange_key(gost_get0_priv_key(priv), peerkey, sharedKey); - if (!keyUnwrapCryptoPro(&cctx, sharedKey, wrappedKey, key)) { - GOSTerr(GOST_F_PKEY_GOST94CP_DECRYPT, - GOST_R_ERROR_COMPUTING_SHARED_KEY); - goto err; - } - - EVP_PKEY_free(eph_key); - GOST_KEY_TRANSPORT_free(gkt); - return 1; - err: - EVP_PKEY_free(eph_key); - GOST_KEY_TRANSPORT_free(gkt); - return -1; -} diff --git a/engines/ccgost/gost_ameth.c b/engines/ccgost/gost_ameth.c index 5ca3a6e..4f3bd90 100644 --- a/engines/ccgost/gost_ameth.c +++ b/engines/ccgost/gost_ameth.c @@ -16,23 +16,32 @@ #ifndef OPENSSL_NO_CMS # include #endif -#include "gost_params.h" #include "gost_lcl.h" #include "e_gost_err.h" -int gost94_nid_by_params(DSA *p) + +/* Convert little-endian byte array into bignum */ +BIGNUM *hashsum2bn(const unsigned char *dgst) { - R3410_params *gost_params; - BIGNUM *q = BN_new(); - for (gost_params = R3410_paramset; gost_params->q != NULL; gost_params++) { - BN_dec2bn(&q, gost_params->q); - if (!BN_cmp(q, p->q)) { - BN_free(q); - return gost_params->nid; - } - } - BN_free(q); - return NID_undef; + unsigned char buf[32]; + + BUF_reverse(buf, (unsigned char*)dgst, 32); + return BN_bin2bn(buf, 32, NULL); +} + +/* + * Pack bignum into byte buffer of given size, filling all leading bytes by + * zeros + */ +int store_bignum(BIGNUM *bn, unsigned char *buf, int len) +{ + int bytes = BN_num_bytes(bn); + + if (bytes > len) + return 0; + memset(buf, 0, len); + BN_bn2bin(bn, buf + len - bytes); + return 1; } static ASN1_STRING *encode_gost_algor_params(const EVP_PKEY *key) @@ -53,17 +62,6 @@ static ASN1_STRING *encode_gost_algor_params(const EVP_PKEY *key) EC_GROUP_get_curve_name(EC_KEY_get0_group (EVP_PKEY_get0((EVP_PKEY *)key))); break; - case NID_id_GostR3410_94: - pkey_param_nid = - (int)gost94_nid_by_params(EVP_PKEY_get0((EVP_PKEY *)key)); - if (pkey_param_nid == NID_undef) { - GOSTerr(GOST_F_ENCODE_GOST_ALGOR_PARAMS, - GOST_R_INVALID_GOST94_PARMSET); - ASN1_STRING_free(params); - params = NULL; - goto err; - } - break; } gkp->key_params = OBJ_nid2obj(pkey_param_nid); gkp->hash_params = OBJ_nid2obj(NID_id_GostR3411_94_CryptoProParamSet); @@ -120,18 +118,6 @@ static int decode_gost_algor_params(EVP_PKEY *pkey, X509_ALGOR *palg) return 0; } switch (pkey_nid) { - case NID_id_GostR3410_94: - { - DSA *dsa = EVP_PKEY_get0(pkey); - if (!dsa) { - dsa = DSA_new(); - if (!EVP_PKEY_assign(pkey, pkey_nid, dsa)) - return 0; - } - if (!fill_GOST94_params(dsa, param_nid)) - return 0; - break; - } case NID_id_GostR3410_2001: { EC_KEY *ec = EVP_PKEY_get0(pkey); @@ -151,18 +137,6 @@ static int decode_gost_algor_params(EVP_PKEY *pkey, X509_ALGOR *palg) static int gost_set_priv_key(EVP_PKEY *pkey, BIGNUM *priv) { switch (EVP_PKEY_base_id(pkey)) { - case NID_id_GostR3410_94: - { - DSA *dsa = EVP_PKEY_get0(pkey); - if (!dsa) { - dsa = DSA_new(); - EVP_PKEY_assign(pkey, EVP_PKEY_base_id(pkey), dsa); - } - dsa->priv_key = BN_dup(priv); - if (!EVP_PKEY_missing_parameters(pkey)) - gost94_compute_public(dsa); - break; - } case NID_id_GostR3410_2001: { EC_KEY *ec = EVP_PKEY_get0(pkey); @@ -183,16 +157,6 @@ static int gost_set_priv_key(EVP_PKEY *pkey, BIGNUM *priv) BIGNUM *gost_get0_priv_key(const EVP_PKEY *pkey) { switch (EVP_PKEY_base_id(pkey)) { - case NID_id_GostR3410_94: - { - DSA *dsa = EVP_PKEY_get0((EVP_PKEY *)pkey); - if (!dsa) { - return NULL; - } - if (!dsa->priv_key) - return NULL; - return dsa->priv_key; - } case NID_id_GostR3410_2001: { EC_KEY *ec = EVP_PKEY_get0((EVP_PKEY *)pkey); @@ -277,11 +241,6 @@ static int pkey_ctrl_gost(EVP_PKEY *pkey, int op, long arg1, void *arg2) } /* --------------------- free functions * ------------------------------*/ -static void pkey_free_gost94(EVP_PKEY *key) -{ - DSA_free(key->pkey.dsa); -} - static void pkey_free_gost01(EVP_PKEY *key) { EC_KEY_free(key->pkey.ec); @@ -355,58 +314,6 @@ static int priv_encode_gost(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk) } /* --------- printing keys --------------------------------*/ -static int print_gost_94(BIO *out, const EVP_PKEY *pkey, int indent, - ASN1_PCTX *pctx, int type) -{ - int param_nid = NID_undef; - - if (type == 2) { - BIGNUM *key; - - if (!BIO_indent(out, indent, 128)) - return 0; - BIO_printf(out, "Private key: "); - key = gost_get0_priv_key(pkey); - if (!key) - BIO_printf(out, ""); - else - BN_print(out, key); - BIO_printf(out, "\n"); - } - if (type >= 1) { - BIGNUM *pubkey; - - pubkey = ((DSA *)EVP_PKEY_get0((EVP_PKEY *)pkey))->pub_key; - BIO_indent(out, indent, 128); - BIO_printf(out, "Public key: "); - BN_print(out, pubkey); - BIO_printf(out, "\n"); - } - - param_nid = gost94_nid_by_params(EVP_PKEY_get0((EVP_PKEY *)pkey)); - BIO_indent(out, indent, 128); - BIO_printf(out, "Parameter set: %s\n", OBJ_nid2ln(param_nid)); - return 1; -} - -static int param_print_gost94(BIO *out, const EVP_PKEY *pkey, int indent, - ASN1_PCTX *pctx) -{ - return print_gost_94(out, pkey, indent, pctx, 0); -} - -static int pub_print_gost94(BIO *out, const EVP_PKEY *pkey, int indent, - ASN1_PCTX *pctx) -{ - return print_gost_94(out, pkey, indent, pctx, 1); -} - -static int priv_print_gost94(BIO *out, const EVP_PKEY *pkey, int indent, - ASN1_PCTX *pctx) -{ - return print_gost_94(out, pkey, indent, pctx, 2); -} - static int print_gost_01(BIO *out, const EVP_PKEY *pkey, int indent, ASN1_PCTX *pctx, int type) { @@ -489,16 +396,6 @@ static int priv_print_gost01(BIO *out, const EVP_PKEY *pkey, int indent, } /* ---------------------------------------------------------------------*/ -static int param_missing_gost94(const EVP_PKEY *pk) -{ - const DSA *dsa = EVP_PKEY_get0((EVP_PKEY *)pk); - if (!dsa) - return 1; - if (!dsa->q) - return 1; - return 0; -} - static int param_missing_gost01(const EVP_PKEY *pk) { const EC_KEY *ec = EVP_PKEY_get0((EVP_PKEY *)pk); @@ -509,33 +406,6 @@ static int param_missing_gost01(const EVP_PKEY *pk) return 0; } -static int param_copy_gost94(EVP_PKEY *to, const EVP_PKEY *from) -{ - const DSA *dfrom = EVP_PKEY_get0((EVP_PKEY *)from); - DSA *dto = EVP_PKEY_get0(to); - if (EVP_PKEY_base_id(from) != EVP_PKEY_base_id(to)) { - GOSTerr(GOST_F_PARAM_COPY_GOST94, GOST_R_INCOMPATIBLE_ALGORITHMS); - return 0; - } - if (!dfrom) { - GOSTerr(GOST_F_PARAM_COPY_GOST94, GOST_R_KEY_PARAMETERS_MISSING); - return 0; - } - if (!dto) { - dto = DSA_new(); - EVP_PKEY_assign(to, EVP_PKEY_base_id(from), dto); - } - BN_free(dto->p); - dto->p = BN_dup(dfrom->p); - BN_free(dto->q); - dto->q = BN_dup(dfrom->q); - BN_free(dto->g); - dto->g = BN_dup(dfrom->g); - - if (dto->priv_key) - gost94_compute_public(dto); - return 1; -} static int param_copy_gost01(EVP_PKEY *to, const EVP_PKEY *from) { @@ -570,15 +440,6 @@ static int param_copy_gost01(EVP_PKEY *to, const EVP_PKEY *from) return 1; } -static int param_cmp_gost94(const EVP_PKEY *a, const EVP_PKEY *b) -{ - const DSA *da = EVP_PKEY_get0((EVP_PKEY *)a); - const DSA *db = EVP_PKEY_get0((EVP_PKEY *)b); - if (!BN_cmp(da->q, db->q)) - return 1; - return 0; -} - static int param_cmp_gost01(const EVP_PKEY *a, const EVP_PKEY *b) { if (EC_GROUP_get_curve_name @@ -592,84 +453,6 @@ static int param_cmp_gost01(const EVP_PKEY *a, const EVP_PKEY *b) } /* ---------- Public key functions * --------------------------------------*/ -static int pub_decode_gost94(EVP_PKEY *pk, X509_PUBKEY *pub) -{ - X509_ALGOR *palg = NULL; - const unsigned char *pubkey_buf = NULL; - unsigned char *databuf; - ASN1_OBJECT *palgobj = NULL; - int pub_len, i, j; - DSA *dsa; - ASN1_OCTET_STRING *octet = NULL; - - if (!X509_PUBKEY_get0_param(&palgobj, &pubkey_buf, &pub_len, &palg, pub)) - return 0; - EVP_PKEY_assign(pk, OBJ_obj2nid(palgobj), NULL); - if (!decode_gost_algor_params(pk, palg)) - return 0; - octet = d2i_ASN1_OCTET_STRING(NULL, &pubkey_buf, pub_len); - if (!octet) { - GOSTerr(GOST_F_PUB_DECODE_GOST94, ERR_R_MALLOC_FAILURE); - return 0; - } - databuf = OPENSSL_malloc(octet->length); - if (databuf == NULL) { - GOSTerr(GOST_F_PUB_DECODE_GOST94, ERR_R_MALLOC_FAILURE); - ASN1_OCTET_STRING_free(octet); - return 0; - } - for (i = 0, j = octet->length - 1; i < octet->length; i++, j--) { - databuf[j] = octet->data[i]; - } - dsa = EVP_PKEY_get0(pk); - dsa->pub_key = BN_bin2bn(databuf, octet->length, NULL); - ASN1_OCTET_STRING_free(octet); - OPENSSL_free(databuf); - return 1; - -} - -static int pub_encode_gost94(X509_PUBKEY *pub, const EVP_PKEY *pk) -{ - ASN1_OBJECT *algobj = NULL; - ASN1_OCTET_STRING *octet = NULL; - void *pval = NULL; - unsigned char *buf = NULL, *databuf, *sptr; - int i, j, data_len, ret = 0; - - int ptype = V_ASN1_UNDEF; - DSA *dsa = EVP_PKEY_get0((EVP_PKEY *)pk); - algobj = OBJ_nid2obj(EVP_PKEY_base_id(pk)); - if (pk->save_parameters) { - ASN1_STRING *params = encode_gost_algor_params(pk); - pval = params; - ptype = V_ASN1_SEQUENCE; - } - data_len = BN_num_bytes(dsa->pub_key); - databuf = OPENSSL_malloc(data_len); - if (databuf == NULL) { - GOSTerr(GOST_F_PUB_ENCODE_GOST94, ERR_R_MALLOC_FAILURE); - return 0; - } - BN_bn2bin(dsa->pub_key, databuf); - octet = ASN1_OCTET_STRING_new(); - if (octet == NULL) { - GOSTerr(GOST_F_PUB_ENCODE_GOST94, ERR_R_MALLOC_FAILURE); - OPENSSL_free(databuf); - return 0; - } - ASN1_STRING_set(octet, NULL, data_len); - sptr = ASN1_STRING_data(octet); - for (i = 0, j = data_len - 1; i < data_len; i++, j--) { - sptr[i] = databuf[j]; - } - OPENSSL_free(databuf); - ret = i2d_ASN1_OCTET_STRING(octet, &buf); - ASN1_BIT_STRING_free(octet); - if (ret < 0) - return 0; - return X509_PUBKEY_set0_param(pub, algobj, ptype, pval, buf, ret); -} static int pub_decode_gost01(EVP_PKEY *pk, X509_PUBKEY *pub) { @@ -808,17 +591,6 @@ static int pub_encode_gost01(X509_PUBKEY *pub, const EVP_PKEY *pk) return X509_PUBKEY_set0_param(pub, algobj, ptype, pval, buf, ret); } -static int pub_cmp_gost94(const EVP_PKEY *a, const EVP_PKEY *b) -{ - const DSA *da = EVP_PKEY_get0((EVP_PKEY *)a); - const DSA *db = EVP_PKEY_get0((EVP_PKEY *)b); - if (da && db && da->pub_key && db->pub_key - && !BN_cmp(da->pub_key, db->pub_key)) { - return 1; - } - return 0; -} - static int pub_cmp_gost01(const EVP_PKEY *a, const EVP_PKEY *b) { const EC_KEY *ea = EVP_PKEY_get0((EVP_PKEY *)a); @@ -861,12 +633,6 @@ static int mac_ctrl_gost(EVP_PKEY *pkey, int op, long arg1, void *arg2) return -2; } -static int gost94_param_encode(const EVP_PKEY *pkey, unsigned char **pder) -{ - int nid = gost94_nid_by_params(EVP_PKEY_get0((EVP_PKEY *)pkey)); - return i2d_ASN1_OBJECT(OBJ_nid2obj(nid), pder); -} - static int gost2001_param_encode(const EVP_PKEY *pkey, unsigned char **pder) { int nid = @@ -875,27 +641,6 @@ static int gost2001_param_encode(const EVP_PKEY *pkey, unsigned char **pder) return i2d_ASN1_OBJECT(OBJ_nid2obj(nid), pder); } -static int gost94_param_decode(EVP_PKEY *pkey, const unsigned char **pder, - int derlen) -{ - ASN1_OBJECT *obj = NULL; - DSA *dsa = EVP_PKEY_get0(pkey); - int nid; - if (d2i_ASN1_OBJECT(&obj, pder, derlen) == NULL) { - return 0; - } - nid = OBJ_obj2nid(obj); - ASN1_OBJECT_free(obj); - if (!dsa) { - dsa = DSA_new(); - if (!EVP_PKEY_assign(pkey, NID_id_GostR3410_94, dsa)) - return 0; - } - if (!fill_GOST94_params(dsa, nid)) - return 0; - return 1; -} - static int gost2001_param_decode(EVP_PKEY *pkey, const unsigned char **pder, int derlen) { @@ -925,23 +670,6 @@ int register_ameth_gost(int nid, EVP_PKEY_ASN1_METHOD **ameth, if (!*ameth) return 0; switch (nid) { - case NID_id_GostR3410_94: - EVP_PKEY_asn1_set_free(*ameth, pkey_free_gost94); - EVP_PKEY_asn1_set_private(*ameth, - priv_decode_gost, priv_encode_gost, - priv_print_gost94); - - EVP_PKEY_asn1_set_param(*ameth, - gost94_param_decode, gost94_param_encode, - param_missing_gost94, param_copy_gost94, - param_cmp_gost94, param_print_gost94); - EVP_PKEY_asn1_set_public(*ameth, - pub_decode_gost94, pub_encode_gost94, - pub_cmp_gost94, pub_print_gost94, - pkey_size_gost, pkey_bits_gost); - - EVP_PKEY_asn1_set_ctrl(*ameth, pkey_ctrl_gost); - break; case NID_id_GostR3410_2001: EVP_PKEY_asn1_set_free(*ameth, pkey_free_gost01); EVP_PKEY_asn1_set_private(*ameth, diff --git a/engines/ccgost/gost_asn1.c b/engines/ccgost/gost_asn1.c index 1168633..0412d2c 100644 --- a/engines/ccgost/gost_asn1.c +++ b/engines/ccgost/gost_asn1.c @@ -54,3 +54,19 @@ ASN1_NDEF_SEQUENCE(GOST_CLIENT_KEY_EXCHANGE_PARAMS) = { /* FIXME incomplete */ ASN1_NDEF_SEQUENCE_END(GOST_CLIENT_KEY_EXCHANGE_PARAMS) IMPLEMENT_ASN1_FUNCTIONS(GOST_CLIENT_KEY_EXCHANGE_PARAMS) + +/* Convert byte buffer to bignum, skipping leading zeros*/ +BIGNUM *getbnfrombuf(const unsigned char *buf, size_t len) +{ + BIGNUM *b; + + while (*buf == 0 && len > 0) { + buf++; + len--; + } + if (len) + return BN_bin2bn(buf, len, NULL); + b = BN_new(); + BN_zero(b); + return b; +} diff --git a/engines/ccgost/gost_crypt.c b/engines/ccgost/gost_crypt.c index 5f50fcc..e2a2ff6 100644 --- a/engines/ccgost/gost_crypt.c +++ b/engines/ccgost/gost_crypt.c @@ -118,7 +118,6 @@ struct gost_cipher_info gost_cipher_list[] = { /* * {NID_id_GostR3411_94_CryptoProParamSet,&GostR3411_94_CryptoProParamSet,0}, */ - {NID_id_Gost28147_89_cc, &GostR3411_94_CryptoProParamSet, 0}, {NID_id_Gost28147_89_CryptoPro_A_ParamSet, &Gost28147_CryptoProParamSetA, 1}, {NID_id_Gost28147_89_CryptoPro_B_ParamSet, &Gost28147_CryptoProParamSetB, diff --git a/engines/ccgost/gost_eng.c b/engines/ccgost/gost_eng.c index 5924791..4129260 100644 --- a/engines/ccgost/gost_eng.c +++ b/engines/ccgost/gost_eng.c @@ -19,6 +19,10 @@ static const char *engine_gost_id = "gost"; static const char *engine_gost_name = "Reference implementation of GOST engine"; +static int gost_pkey_meth_nids[] = { + NID_id_GostR3410_2001, NID_id_Gost28147_89_MAC, 0 +}; + /* Symmetric cipher and digest function registrar */ static int gost_ciphers(ENGINE *e, const EVP_CIPHER **cipher, @@ -38,15 +42,11 @@ static int gost_cipher_nids[] = { NID_id_Gost28147_89, NID_gost89_cnt, 0 }; static int gost_digest_nids[] = { NID_id_GostR3411_94, NID_id_Gost28147_89_MAC, 0 }; -static int gost_pkey_meth_nids[] = { NID_id_GostR3410_94, - NID_id_GostR3410_2001, NID_id_Gost28147_89_MAC, 0 -}; - -static EVP_PKEY_METHOD *pmeth_GostR3410_94 = NULL, - *pmeth_GostR3410_2001 = NULL, *pmeth_Gost28147_MAC = NULL; +static EVP_PKEY_METHOD *pmeth_GostR3410_2001 = NULL; +static EVP_PKEY_METHOD *pmeth_Gost28147_MAC = NULL; -static EVP_PKEY_ASN1_METHOD *ameth_GostR3410_94 = NULL, - *ameth_GostR3410_2001 = NULL, *ameth_Gost28147_MAC = NULL; +static EVP_PKEY_ASN1_METHOD *ameth_GostR3410_2001 = NULL; +static EVP_PKEY_ASN1_METHOD *ameth_Gost28147_MAC = NULL; static int gost_engine_init(ENGINE *e) { @@ -62,10 +62,8 @@ static int gost_engine_destroy(ENGINE *e) { gost_param_free(); - pmeth_GostR3410_94 = NULL; pmeth_GostR3410_2001 = NULL; pmeth_Gost28147_MAC = NULL; - ameth_GostR3410_94 = NULL; ameth_GostR3410_2001 = NULL; ameth_Gost28147_MAC = NULL; return 1; @@ -76,7 +74,7 @@ static int bind_gost(ENGINE *e, const char *id) int ret = 0; if (id && strcmp(id, engine_gost_id)) return 0; - if (ameth_GostR3410_94) { + if (ameth_GostR3410_2001) { printf("GOST engine already loaded\n"); goto end; } @@ -121,10 +119,6 @@ static int bind_gost(ENGINE *e, const char *id) } if (!register_ameth_gost - (NID_id_GostR3410_94, &ameth_GostR3410_94, "GOST94", - "GOST R 34.10-94")) - goto end; - if (!register_ameth_gost (NID_id_GostR3410_2001, &ameth_GostR3410_2001, "GOST2001", "GOST R 34.10-2001")) goto end; @@ -132,12 +126,9 @@ static int bind_gost(ENGINE *e, const char *id) "GOST-MAC", "GOST 28147-89 MAC")) goto end; - if (!register_pmeth_gost(NID_id_GostR3410_94, &pmeth_GostR3410_94, 0)) - goto end; if (!register_pmeth_gost(NID_id_GostR3410_2001, &pmeth_GostR3410_2001, 0)) goto end; - if (!register_pmeth_gost - (NID_id_Gost28147_89_MAC, &pmeth_Gost28147_MAC, 0)) + if (!register_pmeth_gost(NID_id_Gost28147_89_MAC, &pmeth_Gost28147_MAC, 0)) goto end; if (!ENGINE_register_ciphers(e) || !ENGINE_register_digests(e) @@ -208,13 +199,10 @@ static int gost_pkey_meths(ENGINE *e, EVP_PKEY_METHOD **pmeth, { if (!pmeth) { *nids = gost_pkey_meth_nids; - return 3; + return 2; } switch (nid) { - case NID_id_GostR3410_94: - *pmeth = pmeth_GostR3410_94; - return 1; case NID_id_GostR3410_2001: *pmeth = pmeth_GostR3410_2001; return 1; @@ -233,12 +221,9 @@ static int gost_pkey_asn1_meths(ENGINE *e, EVP_PKEY_ASN1_METHOD **ameth, { if (!ameth) { *nids = gost_pkey_meth_nids; - return 3; + return 2; } switch (nid) { - case NID_id_GostR3410_94: - *ameth = ameth_GostR3410_94; - return 1; case NID_id_GostR3410_2001: *ameth = ameth_GostR3410_2001; return 1; @@ -269,7 +254,7 @@ static ENGINE *engine_gost(void) void ENGINE_load_gost(void) { ENGINE *toadd; - if (pmeth_GostR3410_94) + if (pmeth_GostR3410_2001) return; toadd = engine_gost(); if (!toadd) diff --git a/engines/ccgost/gost_lcl.h b/engines/ccgost/gost_lcl.h index 3a2c7d5..27fe0e7 100644 --- a/engines/ccgost/gost_lcl.h +++ b/engines/ccgost/gost_lcl.h @@ -23,6 +23,18 @@ # define GOST_PARAM_MAX 0 # define GOST_CTRL_CRYPT_PARAMS (ENGINE_CMD_BASE+GOST_PARAM_CRYPT_PARAMS) +typedef struct R3410_2001 { + int nid; + char *a; + char *b; + char *p; + char *q; + char *x; + char *y; +} R3410_2001_params; + +extern R3410_2001_params R3410_2001_paramset[]; + extern const ENGINE_CMD_DEFN gost_cmds[]; int gost_control_func(ENGINE *e, int cmd, long i, void *p, void (*f) (void)); const char *get_gost_engine_param(int param); @@ -167,14 +179,6 @@ extern EVP_CIPHER cipher_gost_cpacnt; # define EVP_MD_CTRL_KEY_LEN (EVP_MD_CTRL_ALG_CTRL+3) # define EVP_MD_CTRL_SET_KEY (EVP_MD_CTRL_ALG_CTRL+4) /* EVP_PKEY_METHOD key encryption callbacks */ -/* From gost94_keyx.c */ -int pkey_GOST94cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, - size_t *outlen, const unsigned char *key, - size_t key_len); - -int pkey_GOST94cp_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, - size_t *outlen, const unsigned char *in, - size_t in_len); /* From gost2001_keyx.c */ int pkey_GOST01cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, const unsigned char *key, @@ -187,10 +191,7 @@ int pkey_GOST01cp_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, /* From gost2001_keyx.c */ int pkey_gost2001_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); -/* From gost94_keyx.c */ -int pkey_gost94_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); /* Internal functions for signature algorithms */ -int fill_GOST94_params(DSA *dsa, int nid); int fill_GOST2001_params(EC_KEY *eckey, int nid); int gost_sign_keygen(DSA *dsa); int gost2001_keygen(EC_KEY *ec); @@ -203,7 +204,6 @@ int gost_do_verify(const unsigned char *dgst, int dgst_len, int gost2001_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, EC_KEY *ec); int gost2001_compute_public(EC_KEY *ec); -int gost94_compute_public(DSA *dsa); /*============== miscellaneous functions============================= */ /* from gost_sign.c */ /* Convert GOST R 34.11 hash sum to bignum according to standard */ @@ -220,10 +220,8 @@ int pack_sign_cp(DSA_SIG *s, int order, unsigned char *sig, size_t *siglen); /* Unpack GOST R 34.10 signature according to CryptoPro rules */ DSA_SIG *unpack_cp_signature(const unsigned char *sig, size_t siglen); /* from ameth.c */ -/* Get private key as BIGNUM from both R 34.10-94 and R 34.10-2001 keys*/ +/* Get private key as BIGNUM from both 34.10-2001 keys*/ /* Returns pointer into EVP_PKEY structure */ BIGNUM *gost_get0_priv_key(const EVP_PKEY *pkey); -/* Find NID by GOST 94 parameters */ -int gost94_nid_by_params(DSA *p); #endif diff --git a/engines/ccgost/gost_params.c b/engines/ccgost/gost_params.c index 0411534..2371c9a 100644 --- a/engines/ccgost/gost_params.c +++ b/engines/ccgost/gost_params.c @@ -7,138 +7,11 @@ * OpenSSL 0.9.9 libraries required to compile and use * * this code * **********************************************************************/ -#include "gost_params.h" +#include "gost_lcl.h" #include /* Parameters of GOST 34.10 */ -R3410_params R3410_paramset[] = { -/* Paramset A */ - {NID_id_GostR3410_94_CryptoPro_A_ParamSet, - "100997906755055304772081815535925224869" - "8410825720534578748235158755771479905292727772441528526992987964833" - "5669968284202797289605274717317548059048560713474685214192868091256" - "1502802222185647539190902656116367847270145019066794290930185446216" - "3997308722217328898303231940973554032134009725883228768509467406639" - "62", - "127021248288932417465907042777176443525" - "7876535089165358128175072657050312609850984974231883334834011809259" - "9999512098893413065920561499672425412104927434935707492031276956145" - "1689224110579311248812610229678534638401693520013288995000362260684" - "2227508135323070045173416336850045410625869714168836867788425378203" - "83", - "683631961449557007844441656118272528951" - "02170888761442055095051287550314083023"} - , - {NID_id_GostR3410_94_CryptoPro_B_ParamSet, - "429418261486158041438734477379555023926" - "7234596860714306679811299408947123142002706038521669956384871995765" - "7284814898909770759462613437669456364882730370838934791080835932647" - "9767786019153434744009610342313166725786869204821949328786333602033" - "8479709268434224762105576023501613261478065276102850944540333865234" - "1", - "139454871199115825601409655107690713107" - "0417070599280317977580014543757653577229840941243685222882398330391" - "1468164807668823692122073732267216074074777170091113455043205380464" - "7694904686120113087816240740184800477047157336662926249423571248823" - "9685422217536601433914856808405203368594584948031873412885804895251" - "63", - "79885141663410976897627118935756323747307951916507639758300472692338873533959"} - , - {NID_id_GostR3410_94_CryptoPro_C_ParamSet, - "816552717970881016017893191415300348226" - "2544051353358162468249467681876621283478212884286545844013955142622" - "2087723485023722868022275009502224827866201744494021697716482008353" - "6398202298024892620480898699335508064332313529725332208819456895108" - "5155178100221003459370588291073071186553005962149936840737128710832" - "3", - "110624679233511963040518952417017040248" - "5862954819831383774196396298584395948970608956170224210628525560327" - "8638246716655439297654402921844747893079518669992827880792192992701" - "1428546551433875806377110443534293554066712653034996277099320715774" - "3542287621283671843703709141350171945045805050291770503634517804938" - "01", - "113468861199819350564868233378875198043" - "267947776488510997961231672532899549103"} - , - {NID_id_GostR3410_94_CryptoPro_D_ParamSet, - "756976611021707301782128757801610628085" - "5283803109571158829574281419208532589041660017017859858216341400371" - "4687551412794400562878935266630754392677014598582103365983119173924" - "4732511225464712252386803315902707727668715343476086350472025298282" - "7271461690125050616858238384366331089777463541013033926723743254833" - "7", - "905457649621929965904290958774625315611" - "3056083907389766971404812524422262512556054474620855996091570786713" - "5849550236741915584185990627801066465809510095784713989819413820871" - "5964648914493053407920737078890520482730623038837767710173664838239" - "8574828787891286471201460474326612697849693665518073864436497893214" - "9", - "108988435796353506912374591498972192620" - "190487557619582334771735390599299211593"} - , - - {NID_id_GostR3410_94_CryptoPro_XchA_ParamSet, - "1335318132727206734338595199483190012179423759678474868994823595993" - "6964252873471246159040332773182141032801252925387191478859899310331" - "0567744136196364803064721377826656898686468463277710150809401182608" - "7702016153249904683329312949209127762411378780302243557466062839716" - "59376426832674269780880061631528163475887", - "14201174159756348119636828602231808974327613839524373876287257344192" - "74593935127189736311660784676003608489466235676257952827747192122419" - "29071046134208380636394084512691828894000571524625445295769349356752" - "72895683154177544176313938445719175509684710784659566254794231229333" - "8483924514339614727760681880609734239", - "91771529896554605945588149018382750217296858393520724172743325725474" - "374979801"} - , - {NID_id_GostR3410_94_CryptoPro_XchB_ParamSet, - "8890864727828423151699995801875757891031463338652579140051973659" - "3048131440685857067369829407947744496306656291505503608252399443" - "7900272386749145996230867832228661977543992816745254823298629859" - "8753575466286051738837854736167685769017780335804511440773337196" - "2538423532919394477873664752824509986617878992443177", - "1028946126624994859676552074360530315217970499989304888248413244" - "8474923022758470167998871003604670704877377286176171227694098633" - "1539089568784129110109512690503345393869871295783467257264868341" - "7200196629860561193666752429682367397084815179752036423595736533" - "68957392061769855284593965042530895046088067160269433", - "9109671391802626916582318050603555673628769498182593088388796888" - "5281641595199"} - , - {NID_id_GostR3410_94_CryptoPro_XchC_ParamSet, - "4430618464297584182473135030809859326863990650118941756995270074" - "8609973181426950235239623239110557450826919295792878938752101867" - "7047181623251027516953100431855964837602657827828194249605561893" - "6965865325513137194483136247773653468410118796740709840825496997" - "9375560722345106704721086025979309968763193072908334", - "1246996366993477513607147265794064436203408861395055989217248455" - "7299870737698999651480662364723992859320868822848751165438350943" - "3276647222625940615560580450040947211826027729977563540237169063" - "0448079715771649447778447000597419032457722226253269698374446528" - "35352729304393746106576383349151001715930924115499549", - "6787876137336591234380295020065682527118129468050147943114675429" - "4748422492761"} - , - - {NID_undef, NULL, NULL, NULL} -}; - R3410_2001_params R3410_2001_paramset[] = { - /* default_cc_sign01_param 1.2.643.2.9.1.8.1 */ - {NID_id_GostR3410_2001_ParamSet_cc, - /* A */ - "C0000000000000000000000000000000000000000000000000000000000003c4", - /* B */ - "2d06B4265ebc749ff7d0f1f1f88232e81632e9088fd44b7787d5e407e955080c", - /* P */ - "C0000000000000000000000000000000000000000000000000000000000003C7", - /* Q */ - "5fffffffffffffffffffffffffffffff606117a2f4bde428b7458a54b6e87b85", - /* X */ - "2", - /* Y */ - "a20e034bf8813ef5c18d01105e726a17eb248b264ae9706f440bedc8ccb6b22c"} - , /* 1.2.643.2.2.35.0 */ {NID_id_GostR3410_2001_TestParamSet, "7", diff --git a/engines/ccgost/gost_params.h b/engines/ccgost/gost_params.h deleted file mode 100644 index 0773cbf..0000000 --- a/engines/ccgost/gost_params.h +++ /dev/null @@ -1,34 +0,0 @@ -/********************************************************************** - * gost_params.h * - * Copyright (c) 2005-2006 Cryptocom LTD * - * This file is distributed under the same license as OpenSSL * - * * - * Declaration of structures used to represent GOST R 34.10 * - * parameter sets, defined in RFC 4357 * - * OpenSSL 0.9.9 libraries required to compile and use * - * this code * - **********************************************************************/ -#ifndef GOST_PARAMSET_H -# define GOST_PARAMSET_H -typedef struct R3410 { - int nid; - char *a; - char *p; - char *q; -} R3410_params; - -extern R3410_params R3410_paramset[]; - -typedef struct R3410_2001 { - int nid; - char *a; - char *b; - char *p; - char *q; - char *x; - char *y; -} R3410_2001_params; - -extern R3410_2001_params R3410_2001_paramset[]; - -#endif diff --git a/engines/ccgost/gost_pmeth.c b/engines/ccgost/gost_pmeth.c index af1d29e..0574d6e 100644 --- a/engines/ccgost/gost_pmeth.c +++ b/engines/ccgost/gost_pmeth.c @@ -15,7 +15,6 @@ #include #include #include -#include "gost_params.h" #include "gost_lcl.h" #include "e_gost_err.h" /* -----init, cleanup, copy - uniform for all algs ---------------*/ @@ -31,9 +30,6 @@ static int pkey_gost_init(EVP_PKEY_CTX *ctx) memset(data, 0, sizeof(*data)); if (pkey && EVP_PKEY_get0(pkey)) { switch (EVP_PKEY_base_id(pkey)) { - case NID_id_GostR3410_94: - data->sign_param_nid = gost94_nid_by_params(EVP_PKEY_get0(pkey)); - break; case NID_id_GostR3410_2001: data->sign_param_nid = EC_GROUP_get_curve_name(EC_KEY_get0_group @@ -126,69 +122,6 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return -2; } -static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx, - const char *type, const char *value) -{ - int param_nid = 0; - - if (strcmp(type, param_ctrl_string) == 0) { - if (!value) { - return 0; - } - if (strlen(value) == 1) { - switch (toupper((unsigned char)value[0])) { - case 'A': - param_nid = NID_id_GostR3410_94_CryptoPro_A_ParamSet; - break; - case 'B': - param_nid = NID_id_GostR3410_94_CryptoPro_B_ParamSet; - break; - case 'C': - param_nid = NID_id_GostR3410_94_CryptoPro_C_ParamSet; - break; - case 'D': - param_nid = NID_id_GostR3410_94_CryptoPro_D_ParamSet; - break; - default: - return 0; - } - } else if ((strlen(value) == 2) - && (toupper((unsigned char)value[0]) == 'X')) { - switch (toupper((unsigned char)value[1])) { - case 'A': - param_nid = NID_id_GostR3410_94_CryptoPro_XchA_ParamSet; - break; - case 'B': - param_nid = NID_id_GostR3410_94_CryptoPro_XchB_ParamSet; - break; - case 'C': - param_nid = NID_id_GostR3410_94_CryptoPro_XchC_ParamSet; - break; - default: - return 0; - } - } else { - R3410_params *p = R3410_paramset; - param_nid = OBJ_txt2nid(value); - if (param_nid == NID_undef) { - return 0; - } - for (; p->nid != NID_undef; p++) { - if (p->nid == param_nid) - break; - } - if (p->nid == NID_undef) { - GOSTerr(GOST_F_PKEY_GOST_CTRL94_STR, GOST_R_INVALID_PARAMSET); - return 0; - } - } - - return pkey_gost_ctrl(ctx, EVP_PKEY_CTRL_GOST_PARAMSET, - param_nid, NULL); - } - return -2; -} - static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx, const char *type, const char *value) { @@ -256,23 +189,6 @@ static int pkey_gost_paramgen_init(EVP_PKEY_CTX *ctx) return 1; } -static int pkey_gost94_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) -{ - struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); - DSA *dsa = NULL; - if (data->sign_param_nid == NID_undef) { - GOSTerr(GOST_F_PKEY_GOST94_PARAMGEN, GOST_R_NO_PARAMETERS_SET); - return 0; - } - dsa = DSA_new(); - if (!fill_GOST94_params(dsa, data->sign_param_nid)) { - DSA_free(dsa); - return 0; - } - EVP_PKEY_assign(pkey, NID_id_GostR3410_94, dsa); - return 1; -} - static int pkey_gost01_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx); @@ -292,17 +208,6 @@ static int pkey_gost01_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) return 1; } -/* Generates Gost_R3410_94_cp key */ -static int pkey_gost94cp_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) -{ - DSA *dsa; - if (!pkey_gost94_paramgen(ctx, pkey)) - return 0; - dsa = EVP_PKEY_get0(pkey); - gost_sign_keygen(dsa); - return 1; -} - /* Generates GOST_R3410 2001 key and assigns it using specified type */ static int pkey_gost01cp_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { @@ -315,26 +220,21 @@ static int pkey_gost01cp_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) } /* ----------- sign callbacks --------------------------------------*/ - -static int pkey_gost94_cp_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, - size_t *siglen, const unsigned char *tbs, - size_t tbs_len) +/* + * Packs signature according to Cryptopro rules + * and frees up DSA_SIG structure + */ +int pack_sign_cp(DSA_SIG *s, int order, unsigned char *sig, size_t *siglen) { - DSA_SIG *unpacked_sig = NULL; - EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(ctx); - if (!siglen) - return 0; - if (!sig) { - *siglen = 64; /* better to check size of pkey->pkey.dsa-q */ - return 1; - } - unpacked_sig = gost_do_sign(tbs, tbs_len, EVP_PKEY_get0(pkey)); - if (!unpacked_sig) { - return 0; - } - return pack_sign_cp(unpacked_sig, 32, sig, siglen); + *siglen = 2 * order; + memset(sig, 0, *siglen); + store_bignum(s->s, sig, order); + store_bignum(s->r, sig + order, order); + DSA_SIG_free(s); + return 1; } + static int pkey_gost01_cp_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbs_len) @@ -355,22 +255,22 @@ static int pkey_gost01_cp_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, } /* ------------------- verify callbacks ---------------------------*/ - -static int pkey_gost94_cp_verify(EVP_PKEY_CTX *ctx, const unsigned char *sig, - size_t siglen, const unsigned char *tbs, - size_t tbs_len) +/* Unpack signature according to cryptopro rules */ +DSA_SIG *unpack_cp_signature(const unsigned char *sig, size_t siglen) { - int ok = 0; - EVP_PKEY *pub_key = EVP_PKEY_CTX_get0_pkey(ctx); - DSA_SIG *s = unpack_cp_signature(sig, siglen); - if (!s) - return 0; - if (pub_key) - ok = gost_do_verify(tbs, tbs_len, s, EVP_PKEY_get0(pub_key)); - DSA_SIG_free(s); - return ok; + DSA_SIG *s; + + s = DSA_SIG_new(); + if (s == NULL) { + GOSTerr(GOST_F_UNPACK_CP_SIGNATURE, ERR_R_MALLOC_FAILURE); + return NULL; + } + s->s = BN_bin2bn(sig, siglen / 2, NULL); + s->r = BN_bin2bn(sig + siglen / 2, siglen / 2, NULL); + return s; } + static int pkey_gost01_cp_verify(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, const unsigned char *tbs, size_t tbs_len) @@ -570,20 +470,6 @@ int register_pmeth_gost(int id, EVP_PKEY_METHOD **pmeth, int flags) return 0; switch (id) { - case NID_id_GostR3410_94: - EVP_PKEY_meth_set_ctrl(*pmeth, pkey_gost_ctrl, pkey_gost_ctrl94_str); - EVP_PKEY_meth_set_keygen(*pmeth, NULL, pkey_gost94cp_keygen); - EVP_PKEY_meth_set_sign(*pmeth, NULL, pkey_gost94_cp_sign); - EVP_PKEY_meth_set_verify(*pmeth, NULL, pkey_gost94_cp_verify); - EVP_PKEY_meth_set_encrypt(*pmeth, - pkey_gost_encrypt_init, - pkey_GOST94cp_encrypt); - EVP_PKEY_meth_set_decrypt(*pmeth, NULL, pkey_GOST94cp_decrypt); - EVP_PKEY_meth_set_derive(*pmeth, - pkey_gost_derive_init, pkey_gost94_derive); - EVP_PKEY_meth_set_paramgen(*pmeth, pkey_gost_paramgen_init, - pkey_gost94_paramgen); - break; case NID_id_GostR3410_2001: EVP_PKEY_meth_set_ctrl(*pmeth, pkey_gost_ctrl, pkey_gost_ctrl01_str); EVP_PKEY_meth_set_sign(*pmeth, NULL, pkey_gost01_cp_sign); diff --git a/engines/ccgost/gost_sign.c b/engines/ccgost/gost_sign.c deleted file mode 100644 index 543c399..0000000 --- a/engines/ccgost/gost_sign.c +++ /dev/null @@ -1,365 +0,0 @@ -/********************************************************************** - * gost_sign.c * - * Copyright (c) 2005-2006 Cryptocom LTD * - * This file is distributed under the same license as OpenSSL * - * * - * Implementation of GOST R 34.10-94 signature algorithm * - * for OpenSSL * - * Requires OpenSSL 0.9.9 for compilation * - **********************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -#include "gost_params.h" -#include "gost_lcl.h" -#include "e_gost_err.h" - -#ifdef DEBUG_SIGN -void dump_signature(const char *message, const unsigned char *buffer, - size_t len) -{ - size_t i; - fprintf(stderr, "signature %s Length=%d", message, len); - for (i = 0; i < len; i++) { - if (i % 16 == 0) - fputc('\n', stderr); - fprintf(stderr, " %02x", buffer[i]); - } - fprintf(stderr, "\nEnd of signature\n"); -} - -void dump_dsa_sig(const char *message, DSA_SIG *sig) -{ - fprintf(stderr, "%s\nR=", message); - BN_print_fp(stderr, sig->r); - fprintf(stderr, "\nS="); - BN_print_fp(stderr, sig->s); - fprintf(stderr, "\n"); -} - -#else - -# define dump_signature(a,b,c) -# define dump_dsa_sig(a,b) -#endif - -/* - * Computes signature and returns it as DSA_SIG structure - */ -DSA_SIG *gost_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) -{ - BIGNUM *k = NULL, *tmp = NULL, *tmp2 = NULL; - DSA_SIG *newsig = NULL, *ret = NULL; - BIGNUM *md = hashsum2bn(dgst); - /* check if H(M) mod q is zero */ - BN_CTX *ctx = BN_CTX_new(); - if (!ctx) { - GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE); - goto err; - } - BN_CTX_start(ctx); - newsig = DSA_SIG_new(); - if (!newsig) { - GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE); - goto err; - } - tmp = BN_CTX_get(ctx); - k = BN_CTX_get(ctx); - tmp2 = BN_CTX_get(ctx); - if (!tmp || !k || !tmp2) { - GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE); - goto err; - } - BN_mod(tmp, md, dsa->q, ctx); - if (BN_is_zero(tmp)) { - BN_one(md); - } - do { - do { - /* - * Generate random number k less than q - */ - BN_rand_range(k, dsa->q); - /* generate r = (a^x mod p) mod q */ - BN_mod_exp(tmp, dsa->g, k, dsa->p, ctx); - if (!(newsig->r)) { - newsig->r = BN_new(); - if (!newsig->r) { - GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE); - goto err; - } - } - BN_mod(newsig->r, tmp, dsa->q, ctx); - } - while (BN_is_zero(newsig->r)); - /* generate s = (xr + k(Hm)) mod q */ - BN_mod_mul(tmp, dsa->priv_key, newsig->r, dsa->q, ctx); - BN_mod_mul(tmp2, k, md, dsa->q, ctx); - if (!newsig->s) { - newsig->s = BN_new(); - if (!newsig->s) { - GOSTerr(GOST_F_GOST_DO_SIGN, ERR_R_MALLOC_FAILURE); - goto err; - } - } - BN_mod_add(newsig->s, tmp, tmp2, dsa->q, ctx); - } - while (BN_is_zero(newsig->s)); - - ret = newsig; - err: - BN_free(md); - if (ctx) - BN_CTX_end(ctx); - BN_CTX_free(ctx); - if (!ret) - DSA_SIG_free(newsig); - return ret; -} - -/* - * Packs signature according to Cryptocom rules - * and frees up DSA_SIG structure - */ -/*- -int pack_sign_cc(DSA_SIG *s,int order,unsigned char *sig, size_t *siglen) - { - *siglen = 2*order; - memset(sig,0,*siglen); - store_bignum(s->r, sig,order); - store_bignum(s->s, sig + order,order); - dump_signature("serialized",sig,*siglen); - DSA_SIG_free(s); - return 1; - } -*/ -/* - * Packs signature according to Cryptopro rules - * and frees up DSA_SIG structure - */ -int pack_sign_cp(DSA_SIG *s, int order, unsigned char *sig, size_t *siglen) -{ - *siglen = 2 * order; - memset(sig, 0, *siglen); - store_bignum(s->s, sig, order); - store_bignum(s->r, sig + order, order); - dump_signature("serialized", sig, *siglen); - DSA_SIG_free(s); - return 1; -} - -/* - * Verifies signature passed as DSA_SIG structure - * - */ - -int gost_do_verify(const unsigned char *dgst, int dgst_len, - DSA_SIG *sig, DSA *dsa) -{ - BIGNUM *md = NULL, *tmp = NULL; - BIGNUM *q2 = NULL; - BIGNUM *u = NULL, *v = NULL, *z1 = NULL, *z2 = NULL; - BIGNUM *tmp2 = NULL, *tmp3 = NULL; - int ok = 0; - BN_CTX *ctx = BN_CTX_new(); - if (!ctx) { - GOSTerr(GOST_F_GOST_DO_VERIFY, ERR_R_MALLOC_FAILURE); - goto err; - } - - BN_CTX_start(ctx); - if (BN_cmp(sig->s, dsa->q) >= 1 || BN_cmp(sig->r, dsa->q) >= 1) { - GOSTerr(GOST_F_GOST_DO_VERIFY, GOST_R_SIGNATURE_PARTS_GREATER_THAN_Q); - goto err; - } - md = hashsum2bn(dgst); - - tmp = BN_CTX_get(ctx); - v = BN_CTX_get(ctx); - q2 = BN_CTX_get(ctx); - z1 = BN_CTX_get(ctx); - z2 = BN_CTX_get(ctx); - tmp2 = BN_CTX_get(ctx); - tmp3 = BN_CTX_get(ctx); - u = BN_CTX_get(ctx); - if (!tmp || !v || !q2 || !z1 || !z2 || !tmp2 || !tmp3 || !u) { - GOSTerr(GOST_F_GOST_DO_VERIFY, ERR_R_MALLOC_FAILURE); - goto err; - } - - BN_mod(tmp, md, dsa->q, ctx); - if (BN_is_zero(tmp)) { - BN_one(md); - } - BN_copy(q2, dsa->q); - BN_sub_word(q2, 2); - BN_mod_exp(v, md, q2, dsa->q, ctx); - BN_mod_mul(z1, sig->s, v, dsa->q, ctx); - BN_sub(tmp, dsa->q, sig->r); - BN_mod_mul(z2, tmp, v, dsa->p, ctx); - BN_mod_exp(tmp, dsa->g, z1, dsa->p, ctx); - BN_mod_exp(tmp2, dsa->pub_key, z2, dsa->p, ctx); - BN_mod_mul(tmp3, tmp, tmp2, dsa->p, ctx); - BN_mod(u, tmp3, dsa->q, ctx); - ok = (BN_cmp(u, sig->r) == 0); - - if (!ok) { - GOSTerr(GOST_F_GOST_DO_VERIFY, GOST_R_SIGNATURE_MISMATCH); - } -err: - BN_free(md); - if (ctx) - BN_CTX_end(ctx); - BN_CTX_free(ctx); - return (ok == 0); -} - -/* - * Computes public keys for GOST R 34.10-94 algorithm - * - */ -int gost94_compute_public(DSA *dsa) -{ - /* Now fill algorithm parameters with correct values */ - BN_CTX *ctx; - if (!dsa->g) { - GOSTerr(GOST_F_GOST94_COMPUTE_PUBLIC, GOST_R_KEY_IS_NOT_INITALIZED); - return 0; - } - ctx = BN_CTX_new(); - if (!ctx) { - GOSTerr(GOST_F_GOST94_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE); - return 0; - } - - dsa->pub_key = BN_new(); - if (!dsa->pub_key) { - GOSTerr(GOST_F_GOST94_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE); - BN_CTX_free(ctx); - return 0; - } - /* Compute public key y = a^x mod p */ - BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx); - BN_CTX_free(ctx); - return 1; -} - -/* - * Fill GOST 94 params, searching them in R3410_paramset array - * by nid of paramset - * - */ -int fill_GOST94_params(DSA *dsa, int nid) -{ - R3410_params *params = R3410_paramset; - while (params->nid != NID_undef && params->nid != nid) - params++; - if (params->nid == NID_undef) { - GOSTerr(GOST_F_FILL_GOST94_PARAMS, GOST_R_UNSUPPORTED_PARAMETER_SET); - return 0; - } -#define dump_signature(a,b,c) - BN_free(dsa->p); - dsa->p = NULL; - BN_dec2bn(&(dsa->p), params->p); - BN_free(dsa->q); - dsa->q = NULL; - BN_dec2bn(&(dsa->q), params->q); - BN_free(dsa->g); - dsa->g = NULL; - BN_dec2bn(&(dsa->g), params->a); - return 1; -} - -/* - * Generate GOST R 34.10-94 keypair - * - * - */ -int gost_sign_keygen(DSA *dsa) -{ - dsa->priv_key = BN_new(); - if (!dsa->priv_key) { - GOSTerr(GOST_F_GOST_SIGN_KEYGEN, ERR_R_MALLOC_FAILURE); - return 0; - } - BN_rand_range(dsa->priv_key, dsa->q); - return gost94_compute_public(dsa); -} - -/* Unpack signature according to cryptocom rules */ -/*- -DSA_SIG *unpack_cc_signature(const unsigned char *sig,size_t siglen) - { - DSA_SIG *s; - s = DSA_SIG_new(); - if (s == NULL) - { - GOSTerr(GOST_F_UNPACK_CC_SIGNATURE,ERR_R_MALLOC_FAILURE); - return(NULL); - } - s->r = getbnfrombuf(sig, siglen/2); - s->s = getbnfrombuf(sig + siglen/2, siglen/2); - return s; - } -*/ -/* Unpack signature according to cryptopro rules */ -DSA_SIG *unpack_cp_signature(const unsigned char *sig, size_t siglen) -{ - DSA_SIG *s; - - s = DSA_SIG_new(); - if (s == NULL) { - GOSTerr(GOST_F_UNPACK_CP_SIGNATURE, ERR_R_MALLOC_FAILURE); - return NULL; - } - s->s = getbnfrombuf(sig, siglen / 2); - s->r = getbnfrombuf(sig + siglen / 2, siglen / 2); - return s; -} - -/* Convert little-endian byte array into bignum */ -BIGNUM *hashsum2bn(const unsigned char *dgst) -{ - unsigned char buf[32]; - int i; - for (i = 0; i < 32; i++) { - buf[31 - i] = dgst[i]; - } - return getbnfrombuf(buf, 32); -} - -/* Convert byte buffer to bignum, skipping leading zeros*/ -BIGNUM *getbnfrombuf(const unsigned char *buf, size_t len) -{ - while (*buf == 0 && len > 0) { - buf++; - len--; - } - if (len) { - return BN_bin2bn(buf, len, NULL); - } else { - BIGNUM *b = BN_new(); - BN_zero(b); - return b; - } -} - -/* - * Pack bignum into byte buffer of given size, filling all leading bytes by - * zeros - */ -int store_bignum(BIGNUM *bn, unsigned char *buf, int len) -{ - int bytes = BN_num_bytes(bn); - if (bytes > len) - return 0; - memset(buf, 0, len); - BN_bn2bin(bn, buf + len - bytes); - return 1; -} diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h index 1eef9cc..6e98784 100644 --- a/include/openssl/tls1.h +++ b/include/openssl/tls1.h @@ -878,7 +878,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS_CT_ECDSA_SIGN 64 # define TLS_CT_RSA_FIXED_ECDH 65 # define TLS_CT_ECDSA_FIXED_ECDH 66 -# define TLS_CT_GOST94_SIGN 21 # define TLS_CT_GOST01_SIGN 22 /* * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see diff --git a/ssl/s3_both.c b/ssl/s3_both.c index 943cf73..4d69c2a 100644 --- a/ssl/s3_both.c +++ b/ssl/s3_both.c @@ -618,9 +618,7 @@ int ssl_cert_type(X509 *x, EVP_PKEY *pkey) ret = SSL_PKEY_ECC; } #endif - else if (i == NID_id_GostR3410_94 || i == NID_id_GostR3410_94_cc) { - ret = SSL_PKEY_GOST94; - } else if (i == NID_id_GostR3410_2001 || i == NID_id_GostR3410_2001_cc) { + else if (i == NID_id_GostR3410_2001) { ret = SSL_PKEY_GOST01; } else if (x && (i == EVP_PKEY_DH || i == EVP_PKEY_DHX)) { /* diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 1661b0e..01a0a8c 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -3059,8 +3059,7 @@ int ssl3_send_client_verify(SSL *s) n = j + 2; } else #endif - if (pkey->type == NID_id_GostR3410_94 - || pkey->type == NID_id_GostR3410_2001) { + if (pkey->type == NID_id_GostR3410_2001) { unsigned char signbuf[64]; int i; size_t sigsize = 64; diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 83b8f68..0a3bba4 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -1147,19 +1147,6 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = { { 1, - "GOST94-GOST89-GOST89", - 0x3000080, - SSL_kGOST, - SSL_aGOST94, - SSL_eGOST2814789CNT, - SSL_GOST89MAC, - SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, - SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC, - 256, - 256}, - { - 1, "GOST2001-GOST89-GOST89", 0x3000081, SSL_kGOST, @@ -1170,20 +1157,8 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = { SSL_NOT_EXP | SSL_HIGH, SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94 | TLS1_STREAM_MAC, 256, - 256}, - { - 1, - "GOST94-NULL-GOST94", - 0x3000082, - SSL_kGOST, - SSL_aGOST94, - SSL_eNULL, - SSL_GOST94, - SSL_TLSV1, - SSL_NOT_EXP | SSL_STRONG_NONE, - SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94, - 0, - 0}, + 256 + }, { 1, "GOST2001-NULL-GOST94", @@ -1196,7 +1171,8 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = { SSL_NOT_EXP | SSL_STRONG_NONE, SSL_HANDSHAKE_MAC_GOST94 | TLS1_PRF_GOST94, 0, - 0}, + 0 + }, #ifndef OPENSSL_NO_CAMELLIA /* Camellia ciphersuites from RFC4132 (256-bit portion) */ @@ -3474,63 +3450,6 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = { 256}, #endif -#ifdef TEMP_GOST_TLS -/* Cipher FF00 */ - { - 1, - "GOST-MD5", - 0x0300ff00, - SSL_kRSA, - SSL_aRSA, - SSL_eGOST2814789CNT, - SSL_MD5, - SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, - SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, - 256, - 256, - }, - { - 1, - "GOST-GOST94", - 0x0300ff01, - SSL_kRSA, - SSL_aRSA, - SSL_eGOST2814789CNT, - SSL_GOST94, - SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, - SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, - 256, - 256}, - { - 1, - "GOST-GOST89MAC", - 0x0300ff02, - SSL_kRSA, - SSL_aRSA, - SSL_eGOST2814789CNT, - SSL_GOST89MAC, - SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, - SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, - 256, - 256}, - { - 1, - "GOST-GOST89STREAM", - 0x0300ff03, - SSL_kRSA, - SSL_aRSA, - SSL_eGOST2814789CNT, - SSL_GOST89MAC, - SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, - SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF | TLS1_STREAM_MAC, - 256, - 256}, -#endif - /* end of list */ }; @@ -4694,7 +4613,6 @@ int ssl3_get_req_cert_type(SSL *s, unsigned char *p) #ifndef OPENSSL_NO_GOST if (s->version >= TLS1_VERSION) { if (alg_k & SSL_kGOST) { - p[ret++] = TLS_CT_GOST94_SIGN; p[ret++] = TLS_CT_GOST01_SIGN; return (ret); } diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index 76f49bd..acb2fa9 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -2736,9 +2736,7 @@ int ssl3_get_client_key_exchange(SSL *s) /* Get our certificate private key */ alg_a = s->s3->tmp.new_cipher->algorithm_auth; - if (alg_a & SSL_aGOST94) - pk = s->cert->pkeys[SSL_PKEY_GOST94].privatekey; - else if (alg_a & SSL_aGOST01) + if (alg_a & SSL_aGOST01) pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey; pkey_ctx = EVP_PKEY_CTX_new(pk, NULL); @@ -2874,8 +2872,7 @@ int ssl3_get_cert_verify(SSL *s) * If key is GOST and n is exactly 64, it is bare signature without * length field */ - if (n == 64 && (pkey->type == NID_id_GostR3410_94 || - pkey->type == NID_id_GostR3410_2001)) { + if (n == 64 && pkey->type == NID_id_GostR3410_2001) { len = 64; } else { if (SSL_USE_SIGALGS(s)) { @@ -2984,8 +2981,7 @@ int ssl3_get_cert_verify(SSL *s) } } else #endif - if (pkey->type == NID_id_GostR3410_94 - || pkey->type == NID_id_GostR3410_2001) { + if (pkey->type == NID_id_GostR3410_2001) { unsigned char signature[64]; int idx; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL); diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index da64301..08a95f9 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -331,9 +331,8 @@ static const SSL_CIPHER cipher_aliases[] = { {0, SSL_TXT_aECDSA, 0, 0, SSL_aECDSA, 0, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_ECDSA, 0, 0, SSL_aECDSA, 0, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_aPSK, 0, 0, SSL_aPSK, 0, 0, 0, 0, 0, 0, 0}, - {0, SSL_TXT_aGOST94, 0, 0, SSL_aGOST94, 0, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_aGOST01, 0, 0, SSL_aGOST01, 0, 0, 0, 0, 0, 0, 0}, - {0, SSL_TXT_aGOST, 0, 0, SSL_aGOST94 | SSL_aGOST01, 0, 0, 0, 0, 0, 0, 0}, + {0, SSL_TXT_aGOST, 0, 0, SSL_aGOST01, 0, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_aSRP, 0, 0, SSL_aSRP, 0, 0, 0, 0, 0, 0, 0}, /* aliases combining key exchange and server authentication */ @@ -528,14 +527,12 @@ void ssl_load_ciphers(void) disabled_mac_mask |= SSL_GOST89MAC; } - if (!get_optional_pkey_id("gost94")) - disabled_auth_mask |= SSL_aGOST94; if (!get_optional_pkey_id("gost2001")) disabled_auth_mask |= SSL_aGOST01; /* * Disable GOST key exchange if no GOST signature algs are available * */ - if ((disabled_auth_mask & (SSL_aGOST94 | SSL_aGOST01)) == (SSL_aGOST94 | SSL_aGOST01)) + if ((disabled_auth_mask & SSL_aGOST01) == SSL_aGOST01) disabled_mkey_mask |= SSL_kGOST; } @@ -1673,9 +1670,6 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) case SSL_aSRP: au = "SRP"; break; - case SSL_aGOST94: - au = "GOST94"; - break; case SSL_aGOST01: au = "GOST01"; break; @@ -1961,8 +1955,6 @@ int ssl_cipher_get_cert_index(const SSL_CIPHER *c) return SSL_PKEY_DSA_SIGN; else if (alg_a & SSL_aRSA) return SSL_PKEY_RSA_ENC; - else if (alg_a & SSL_aGOST94) - return SSL_PKEY_GOST94; else if (alg_a & SSL_aGOST01) return SSL_PKEY_GOST01; return -1; diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 5a0ec8a..2a2eb78 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -2007,11 +2007,6 @@ void ssl_set_masks(SSL *s, const SSL_CIPHER *cipher) mask_k |= SSL_kGOST; mask_a |= SSL_aGOST01; } - cpk = &(c->pkeys[SSL_PKEY_GOST94]); - if (cpk->x509 != NULL && cpk->privatekey != NULL) { - mask_k |= SSL_kGOST; - mask_a |= SSL_aGOST94; - } if (rsa_enc || (rsa_tmp && rsa_sign)) mask_k |= SSL_kRSA; diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index bc8388a..63b547a 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -339,8 +339,6 @@ # define SSL_aECDSA 0x00000040L /* PSK auth */ # define SSL_aPSK 0x00000080L -/* GOST R 34.10-94 signature auth */ -# define SSL_aGOST94 0x00000100L /* GOST R 34.10-2001 signature auth */ # define SSL_aGOST01 0x00000200L /* SRP auth */ @@ -508,7 +506,6 @@ # define SSL_PKEY_DH_RSA 3 # define SSL_PKEY_DH_DSA 4 # define SSL_PKEY_ECC 5 -# define SSL_PKEY_GOST94 6 # define SSL_PKEY_GOST01 7 # define SSL_PKEY_NUM 8 From steve at openssl.org Wed Aug 12 12:57:02 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Wed, 12 Aug 2015 12:57:02 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439384222.067808.29006.nullmailer@dev.openssl.org> The branch master has been updated via 2acdef5e97977958e9bb3b4a139039599ef1aefe (commit) via 891eac4604b5f05413e59602fae1f11136f4719a (commit) via a187e08d856690b5c1da3184d0ff560d572f893b (commit) from ade44dcb16141c8a30ca6c56a1fd1a0b14dcc360 (commit) - Log ----------------------------------------------------------------- commit 2acdef5e97977958e9bb3b4a139039599ef1aefe Author: Dr. Stephen Henson Date: Sat Aug 1 15:38:11 2015 +0100 Return error for unsupported modes. PR#3974 PR#3975 Reviewed-by: Matt Caswell commit 891eac4604b5f05413e59602fae1f11136f4719a Author: Dr. Stephen Henson Date: Sat Aug 1 15:37:44 2015 +0100 Fix memory leak if setup fails. Reviewed-by: Matt Caswell commit a187e08d856690b5c1da3184d0ff560d572f893b Author: Dr. Stephen Henson Date: Sat Aug 1 15:37:01 2015 +0100 Err isn't always malloc failure. Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: crypto/cms/cms_enc.c | 2 +- crypto/cms/cms_smime.c | 2 +- crypto/evp/evp_lib.c | 35 ++++++++++++++++++++++++++++++----- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index f9556ac..16b4225 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -194,7 +194,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) ok = 1; err: - if (!keep_key) { + if (!keep_key || !ok) { OPENSSL_clear_free(ec->key, ec->keylen); ec->key = NULL; } diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index b33bc1d..6bed211 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -804,7 +804,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) int ret = 0; if ((cmsbio = CMS_dataInit(cms, dcont)) == NULL) { - CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE); + CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB); return 0; } diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 1fdde9a..5ee3dcb 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -68,11 +68,22 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->set_asn1_parameters != NULL) ret = c->cipher->set_asn1_parameters(c, type); else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { - if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) { + switch (EVP_CIPHER_CTX_mode(c)) { + case EVP_CIPH_WRAP_MODE: ASN1_TYPE_set(type, V_ASN1_NULL, NULL); ret = 1; - } else + break; + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + case EVP_CIPH_OCB_MODE: + ret = -1; + break; + + default: ret = EVP_CIPHER_set_asn1_iv(c, type); + } } else ret = -1; return (ret); @@ -85,9 +96,23 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->get_asn1_parameters != NULL) ret = c->cipher->get_asn1_parameters(c, type); else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { - if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) - return 1; - ret = EVP_CIPHER_get_asn1_iv(c, type); + switch (EVP_CIPHER_CTX_mode(c)) { + + case EVP_CIPH_WRAP_MODE: + ret = 1; + break; + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + case EVP_CIPH_OCB_MODE: + ret = -1; + break; + + default: + ret = EVP_CIPHER_get_asn1_iv(c, type); + break; + } } else ret = -1; return (ret); From steve at openssl.org Wed Aug 12 13:15:42 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Wed, 12 Aug 2015 13:15:42 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439385342.543413.7305.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 5859bc62f3dc79aea2844f0349cfa9dcbd570dfb (commit) via 056df45ed12527bea484c952227c09ad49e31d2d (commit) via e9da86627a271d9d1ad04e47115d26fab4a21c1b (commit) from 0b12fa75c9df5c2c9c2f5094514323360c0af981 (commit) - Log ----------------------------------------------------------------- commit 5859bc62f3dc79aea2844f0349cfa9dcbd570dfb Author: Dr. Stephen Henson Date: Sat Aug 1 15:38:11 2015 +0100 Return error for unsupported modes. PR#3974 PR#3975 Reviewed-by: Matt Caswell commit 056df45ed12527bea484c952227c09ad49e31d2d Author: Dr. Stephen Henson Date: Sat Aug 1 15:37:44 2015 +0100 Fix memory leak if setup fails. Reviewed-by: Matt Caswell (cherry picked from commit 891eac4604b5f05413e59602fae1f11136f4719a) Conflicts: crypto/cms/cms_enc.c commit e9da86627a271d9d1ad04e47115d26fab4a21c1b Author: Dr. Stephen Henson Date: Sat Aug 1 15:37:01 2015 +0100 Err isn't always malloc failure. Reviewed-by: Matt Caswell (cherry picked from commit a187e08d856690b5c1da3184d0ff560d572f893b) Conflicts: crypto/cms/cms_smime.c ----------------------------------------------------------------------- Summary of changes: crypto/cms/cms_enc.c | 2 +- crypto/cms/cms_smime.c | 2 +- crypto/evp/evp_lib.c | 33 ++++++++++++++++++++++++++++----- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index 85ae928..b14b4b6 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) ok = 1; err: - if (ec->key && !keep_key) { + if (ec->key && (!keep_key || !ok)) { OPENSSL_cleanse(ec->key, ec->keylen); OPENSSL_free(ec->key); ec->key = NULL; diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 5522a37..07e3472 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -754,7 +754,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) BIO *cmsbio; int ret = 0; if (!(cmsbio = CMS_dataInit(cms, dcont))) { - CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE); + CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB); return 0; } diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index a53a27c..d2c9ae4 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -72,11 +72,21 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->set_asn1_parameters != NULL) ret = c->cipher->set_asn1_parameters(c, type); else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { - if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) { + switch (EVP_CIPHER_CTX_mode(c)) { + case EVP_CIPH_WRAP_MODE: ASN1_TYPE_set(type, V_ASN1_NULL, NULL); ret = 1; - } else + break; + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + ret = -1; + break; + + default: ret = EVP_CIPHER_set_asn1_iv(c, type); + } } else ret = -1; return (ret); @@ -89,9 +99,22 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->get_asn1_parameters != NULL) ret = c->cipher->get_asn1_parameters(c, type); else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { - if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) - return 1; - ret = EVP_CIPHER_get_asn1_iv(c, type); + switch (EVP_CIPHER_CTX_mode(c)) { + + case EVP_CIPH_WRAP_MODE: + ret = 1; + break; + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + ret = -1; + break; + + default: + ret = EVP_CIPHER_get_asn1_iv(c, type); + break; + } } else ret = -1; return (ret); From matt at openssl.org Thu Aug 13 08:33:15 2015 From: matt at openssl.org (Matt Caswell) Date: Thu, 13 Aug 2015 08:33:15 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439454795.820763.3881.nullmailer@dev.openssl.org> The branch master has been updated via df758a8569efe9e124baaa16aba4ac3fc35bbd9d (commit) from 2acdef5e97977958e9bb3b4a139039599ef1aefe (commit) - Log ----------------------------------------------------------------- commit df758a8569efe9e124baaa16aba4ac3fc35bbd9d Author: Matt Caswell Date: Tue Aug 4 20:10:06 2015 +0100 PACKETise Server Certificate processing Use the PACKET API to process an incoming server Certificate message. Reviewed-by: Emilia K?sper ----------------------------------------------------------------------- Summary of changes: ssl/s3_clnt.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 01a0a8c..4ebd7aa 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -1232,12 +1232,12 @@ int ssl3_get_server_hello(SSL *s) int ssl3_get_server_certificate(SSL *s) { int al, i, ok, ret = -1, exp_idx; - unsigned long n, nc, llen, l; + unsigned long n, cert_list_len, cert_len; X509 *x = NULL; - const unsigned char *q, *p; - unsigned char *d; + unsigned char *certstart, *certbytes; STACK_OF(X509) *sk = NULL; EVP_PKEY *pkey = NULL; + PACKET pkt; n = s->method->ssl_get_message(s, SSL3_ST_CR_CERT_A, @@ -1257,36 +1257,41 @@ int ssl3_get_server_certificate(SSL *s) SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, SSL_R_BAD_MESSAGE_TYPE); goto f_err; } - p = d = (unsigned char *)s->init_msg; + + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, ERR_R_INTERNAL_ERROR); + goto f_err; + } if ((sk = sk_X509_new_null()) == NULL) { SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, ERR_R_MALLOC_FAILURE); goto err; } - n2l3(p, llen); - if (llen + 3 != n) { + if (!PACKET_get_net_3(&pkt, &cert_list_len) + || PACKET_remaining(&pkt) != cert_list_len) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, SSL_R_LENGTH_MISMATCH); goto f_err; } - for (nc = 0; nc < llen;) { - n2l3(p, l); - if ((l + nc + 3) > llen) { + while (PACKET_remaining(&pkt)) { + if (!PACKET_get_net_3(&pkt, &cert_len) + || !PACKET_get_bytes(&pkt, &certbytes, cert_len)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, SSL_R_CERT_LENGTH_MISMATCH); goto f_err; } - q = p; - x = d2i_X509(NULL, &q, l); + certstart = certbytes; + x = d2i_X509(NULL, (const unsigned char **)&certbytes, cert_len); if (x == NULL) { al = SSL_AD_BAD_CERTIFICATE; SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, ERR_R_ASN1_LIB); goto f_err; } - if (q != (p + l)) { + if (certbytes != (certstart + cert_len)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, SSL_R_CERT_LENGTH_MISMATCH); @@ -1297,8 +1302,6 @@ int ssl3_get_server_certificate(SSL *s) goto err; } x = NULL; - nc += l + 3; - p = q; } i = ssl_verify_cert_chain(s, sk); From rsalz at openssl.org Thu Aug 13 16:15:16 2015 From: rsalz at openssl.org (Rich Salz) Date: Thu, 13 Aug 2015 16:15:16 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439482516.436396.30452.nullmailer@dev.openssl.org> The branch master has been updated via cc2829e6641092abed8360433dbe67e883fd1cc6 (commit) from df758a8569efe9e124baaa16aba4ac3fc35bbd9d (commit) - Log ----------------------------------------------------------------- commit cc2829e6641092abed8360433dbe67e883fd1cc6 Author: Ismo Puustinen Date: Fri Aug 7 22:11:28 2015 -0400 GH364: Free memory on an error path Part of RT 3997 Per Ben, just jump to common exit code. Signed-off-by: Rich Salz Reviewed-by: Richard Levitte ----------------------------------------------------------------------- Summary of changes: crypto/x509/x509_vfy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 26867cb..6b1f7fe 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -348,7 +348,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (!sk_X509_push(ctx->chain, x)) { X509_free(xtmp); X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); - return 0; + ok = 0; + goto done; } num++; } From rsalz at openssl.org Thu Aug 13 16:15:27 2015 From: rsalz at openssl.org (Rich Salz) Date: Thu, 13 Aug 2015 16:15:27 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439482527.505986.31234.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 25efcb44ac88ab34f60047e16a96c9462fad39c1 (commit) from 5859bc62f3dc79aea2844f0349cfa9dcbd570dfb (commit) - Log ----------------------------------------------------------------- commit 25efcb44ac88ab34f60047e16a96c9462fad39c1 Author: Ismo Puustinen Date: Fri Aug 7 22:11:28 2015 -0400 GH364: Free memory on an error path Part of RT 3997 Per Ben, just jump to common exit code. Signed-off-by: Rich Salz Reviewed-by: Richard Levitte (cherry picked from commit cc2829e6641092abed8360433dbe67e883fd1cc6) ----------------------------------------------------------------------- Summary of changes: crypto/x509/x509_vfy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index a2f1dbe..26c6bb3 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -354,7 +354,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (!sk_X509_push(ctx->chain, x)) { X509_free(xtmp); X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); - return 0; + ok = 0; + goto done; } num++; } From matt at openssl.org Thu Aug 13 19:37:31 2015 From: matt at openssl.org (Matt Caswell) Date: Thu, 13 Aug 2015 19:37:31 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439494651.710048.18445.nullmailer@dev.openssl.org> The branch master has been updated via bc6616a4347d4c30bce1d1918da09f09f84c0403 (commit) via f9f6053442a2918d0445866252256b2cb54a1187 (commit) from cc2829e6641092abed8360433dbe67e883fd1cc6 (commit) - Log ----------------------------------------------------------------- commit bc6616a4347d4c30bce1d1918da09f09f84c0403 Author: Matt Caswell Date: Mon Aug 3 17:20:47 2015 +0100 Enhance PACKET readability Enhance the PACKET code readability, and fix a stale comment. Thanks to Ben Kaduk (bkaduk at akamai.com) for pointing this out. Reviewed-by: Emilia K?sper commit f9f6053442a2918d0445866252256b2cb54a1187 Author: Matt Caswell Date: Mon Aug 3 17:20:07 2015 +0100 Add missing return check for PACKET_buf_init The new ClientHello PACKET code is missing a return value check. Reviewed-by: Emilia K?sper ----------------------------------------------------------------------- Summary of changes: ssl/packet_locl.h | 3 +-- ssl/s3_srvr.c | 8 ++++++-- ssl/t1_lib.c | 4 ++-- test/packettest.c | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h index 80d0b93..a5e4d00 100644 --- a/ssl/packet_locl.h +++ b/ssl/packet_locl.h @@ -80,8 +80,7 @@ typedef struct { } PACKET; /* - * Returns 1 if there are exactly |len| bytes left to be read from |pkt| - * and 0 otherwise + * Returns the number of bytes remaining to be read in the PACKET */ __owur static inline size_t PACKET_remaining(PACKET *pkt) { diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index acb2fa9..a015a49 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -874,7 +874,11 @@ int ssl3_get_client_hello(SSL *s) if (!ok) return ((int)n); s->first_packet = 0; - PACKET_buf_init(&pkt, s->init_msg, n); + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, ERR_R_INTERNAL_ERROR); + al = SSL_AD_INTERNAL_ERROR; + goto f_err; + } /* First lets get s->client_version set correctly */ if (RECORD_LAYER_is_sslv2_record(&s->rlayer)) { @@ -1055,7 +1059,7 @@ int ssl3_get_client_hello(SSL *s) memset(s->s3->client_random, 0, SSL3_RANDOM_SIZE); if (!PACKET_peek_copy_bytes(&pkt, s->s3->client_random, i) || !PACKET_forward(&pkt, cl) - || !PACKET_remaining(&pkt) == 0) { + || PACKET_remaining(&pkt) != 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH); al = SSL_AD_DECODE_ERROR; goto f_err; diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index ece2b72..e37411c 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -2036,7 +2036,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, PACKET *pkt, int *al) } } /* We shouldn't have any bytes left */ - if (PACKET_remaining(&ssubpkt)) + if (PACKET_remaining(&ssubpkt) != 0) goto err; } @@ -2140,7 +2140,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, PACKET *pkt, int *al) || (dsize & 1) != 0 || (dsize == 0) || !PACKET_get_bytes(&subpkt, &data, dsize) - || PACKET_remaining(&subpkt) + || PACKET_remaining(&subpkt) != 0 || !tls1_save_sigalgs(s, data, dsize)) { goto err; } diff --git a/test/packettest.c b/test/packettest.c index d6d0c08..c3ac53b 100644 --- a/test/packettest.c +++ b/test/packettest.c @@ -67,7 +67,7 @@ static int test_PACKET_remaining(PACKET *pkt) || !PACKET_forward(pkt, BUF_LEN - 1) || PACKET_remaining(pkt) != 1 || !PACKET_forward(pkt, 1) - || PACKET_remaining(pkt)) { + || PACKET_remaining(pkt) != 0) { fprintf(stderr, "test_PACKET_remaining() failed\n"); return 0; } From matt at openssl.org Thu Aug 13 19:43:28 2015 From: matt at openssl.org (Matt Caswell) Date: Thu, 13 Aug 2015 19:43:28 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439495008.543546.19753.nullmailer@dev.openssl.org> The branch master has been updated via ac63710a3d718cad5c4d151f0e039ce2fe9c732e (commit) from bc6616a4347d4c30bce1d1918da09f09f84c0403 (commit) - Log ----------------------------------------------------------------- commit ac63710a3d718cad5c4d151f0e039ce2fe9c732e Author: Matt Caswell Date: Wed Aug 5 15:52:26 2015 +0100 PACKETise Certificate Status message Process the Certificate Status message using the PACKET API Reviewed-by: Emilia K?sper ----------------------------------------------------------------------- Summary of changes: ssl/s3_clnt.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 4ebd7aa..dedbfea 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -2271,7 +2271,8 @@ int ssl3_get_cert_status(SSL *s) { int ok, al; unsigned long resplen, n; - const unsigned char *p; + unsigned int type; + PACKET pkt; n = s->method->ssl_get_message(s, SSL3_ST_CR_CERT_STATUS_A, @@ -2280,31 +2281,36 @@ int ssl3_get_cert_status(SSL *s) if (!ok) return ((int)n); - if (n < 4) { - /* need at least status type + length */ - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); + + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_STATUS, ERR_R_INTERNAL_ERROR); goto f_err; } - p = (unsigned char *)s->init_msg; - if (*p++ != TLSEXT_STATUSTYPE_ocsp) { + if (!PACKET_get_1(&pkt, &type) + || type != TLSEXT_STATUSTYPE_ocsp) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_UNSUPPORTED_STATUS_TYPE); goto f_err; } - n2l3(p, resplen); - if (resplen + 4 != n) { + if (!PACKET_get_net_3(&pkt, &resplen) + || PACKET_remaining(&pkt) != resplen) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); goto f_err; } OPENSSL_free(s->tlsext_ocsp_resp); - s->tlsext_ocsp_resp = BUF_memdup(p, resplen); + s->tlsext_ocsp_resp = OPENSSL_malloc(resplen); if (!s->tlsext_ocsp_resp) { al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_SSL3_GET_CERT_STATUS, ERR_R_MALLOC_FAILURE); goto f_err; } + if (!PACKET_copy_bytes(&pkt, s->tlsext_ocsp_resp, resplen)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); + goto f_err; + } s->tlsext_ocsp_resplen = resplen; if (s->ctx->tlsext_status_cb) { int ret; From rsalz at openssl.org Thu Aug 13 19:48:03 2015 From: rsalz at openssl.org (Rich Salz) Date: Thu, 13 Aug 2015 19:48:03 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439495283.336692.21386.nullmailer@dev.openssl.org> The branch master has been updated via f25825c218efb71c13ef7c60c1acbe13cfdfe78b (commit) from ac63710a3d718cad5c4d151f0e039ce2fe9c732e (commit) - Log ----------------------------------------------------------------- commit f25825c218efb71c13ef7c60c1acbe13cfdfe78b Author: Rich Salz Date: Thu Aug 13 11:22:10 2015 -0400 Fix FAQ formatting for new website. Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: FAQ | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/FAQ b/FAQ index 2579d51..0ff792b 100644 --- a/FAQ +++ b/FAQ @@ -861,22 +861,25 @@ with the i2d_*_bio() or d2i_*_bio() functions or you can use the i2d_*(), d2i_*() functions directly. Since these are often the cause of grief here are some code fragments using PKCS7 as an example: +----- snip:start ----- unsigned char *buf, *p; - int len; + int len = i2d_PKCS7(p7, NULL); - len = i2d_PKCS7(p7, NULL); - buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */ + buf = OPENSSL_malloc(len); /* error checking omitted */ p = buf; i2d_PKCS7(p7, &p); +----- snip:end ----- At this point buf contains the len bytes of the DER encoding of p7. The opposite assumes we already have len bytes in buf: - unsigned char *p; - p = buf; +----- snip:start ----- + unsigned char *p = buf; + p7 = d2i_PKCS7(NULL, &p, len); +----- snip:end ----- At this point p7 contains a valid PKCS7 structure or NULL if an error occurred. If an error occurred ERR_print_errors(bio) should give more @@ -893,14 +896,17 @@ because it no longer points to the same address. Memory allocation and encoding can also be combined in a single operation by the ASN1 routines: - unsigned char *buf = NULL; /* mandatory */ - int len; - len = i2d_PKCS7(p7, &buf); - if (len < 0) - /* Error */ +----- snip:start ----- + unsigned char *buf = NULL; + int len = i2d_PKCS7(p7, &buf); + + if (len < 0) { + /* Error */ + } /* Do some things with 'buf' */ /* Finished with buf: free it */ OPENSSL_free(buf); +----- snip:end ----- In this special case the "buf" parameter is *not* incremented, it points to the start of the encoding. From levitte at openssl.org Thu Aug 13 20:06:37 2015 From: levitte at openssl.org (Richard Levitte) Date: Thu, 13 Aug 2015 20:06:37 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439496397.719483.31506.nullmailer@dev.openssl.org> The branch master has been updated via 00bf5001f72144062fe3f7973b968be534ac1246 (commit) via 4deefd6567cce43ef6c6b910693c093e9598f556 (commit) via b3a231db49f864a40f999bf5b3843bebec5e3730 (commit) from f25825c218efb71c13ef7c60c1acbe13cfdfe78b (commit) - Log ----------------------------------------------------------------- commit 00bf5001f72144062fe3f7973b968be534ac1246 Author: Richard Levitte Date: Thu Aug 13 19:15:45 2015 +0200 for test_sslvertol, add a value to display SSL version < 3 in debug Reviewed-by: Matt Caswell commit 4deefd6567cce43ef6c6b910693c093e9598f556 Author: Richard Levitte Date: Thu Aug 13 19:14:34 2015 +0200 Fixups in libssl test harness - select an actual file handle for devnull - do not declare $msgdata twice - SKE records sometimes seem to come without sig - in SKE parsing, use and use $pub_key_len when parsing $pub_key Reviewed-by: Matt Caswell commit b3a231db49f864a40f999bf5b3843bebec5e3730 Author: Richard Levitte Date: Thu Aug 13 19:13:16 2015 +0200 Use -I to add to @INC, and use -w to produce warnings Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: test/Makefile | 6 +++--- util/TLSProxy/Message.pm | 2 +- util/TLSProxy/Proxy.pm | 3 ++- util/TLSProxy/Record.pm | 6 ++++-- util/TLSProxy/ServerKeyExchange.pm | 11 +++++++---- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/test/Makefile b/test/Makefile index 31b3796..b59613c 100644 --- a/test/Makefile +++ b/test/Makefile @@ -424,17 +424,17 @@ test_packet: $(PACKETTEST)$(EXE_EXT) #OPENSSL_ia32cap=... in ssl tests below ensures AES-NI is switched off (AES-NI does not go through the testmode engine) test_sslvertol: ../apps/openssl$(EXE_EXT) @echo $(START) $@ - [ -z "$(SHARED_LIBS)" ] || PERL5LIB=$$PERL5LIB:../util OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh ./$(SSLVERTOLTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem + [ -z "$(SHARED_LIBS)" ] || OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh $(PERL) -I../util -w ./$(SSLVERTOLTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem @[ -n "$(SHARED_LIBS)" ] || echo test_sslvertol can only be performed with OpenSSL configured shared test_sslextension: ../apps/openssl$(EXE_EXT) @echo $(START) $@ - [ -z "$(SHARED_LIBS)" ] || PERL5LIB=$$PERL5LIB:../util OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh ./$(SSLEXTENSIONTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem + [ -z "$(SHARED_LIBS)" ] || OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh $(PERL) -I../util -w ./$(SSLEXTENSIONTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem @[ -n "$(SHARED_LIBS)" ] || echo test_sslextension can only be performed with OpenSSL configured shared test_sslskewith0p: ../apps/openssl$(EXE_EXT) @echo $(START) $@ - [ -z "$(SHARED_LIBS)" ] || PERL5LIB=$$PERL5LIB:../util OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh ./$(SSLSKEWITH0PTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem + [ -z "$(SHARED_LIBS)" ] || OPENSSL_ENGINES=../engines ../util/shlib_wrap.sh $(PERL) -I../util -w ./$(SSLSKEWITH0PTEST) "OPENSSL_ia32cap='~0x200000200000000' ../apps/openssl$(EXE_EXT)" ../apps/server.pem @[ -n "$(SHARED_LIBS)" ] || echo test_sslskewith0p can only be performed with OpenSSL configured shared update: local_depend diff --git a/util/TLSProxy/Message.pm b/util/TLSProxy/Message.pm index 66a4a7b..028322b 100644 --- a/util/TLSProxy/Message.pm +++ b/util/TLSProxy/Message.pm @@ -350,7 +350,7 @@ sub repack $lenlo = length($self->data) & 0xff; $lenhi = length($self->data) >> 8; - my $msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data; + $msgdata = pack('CnC', $self->mt, $lenhi, $lenlo).$self->data; if ($numrecs == 0) { diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm index c033c29..571ab10 100644 --- a/util/TLSProxy/Proxy.pm +++ b/util/TLSProxy/Proxy.pm @@ -142,7 +142,8 @@ sub start my $oldstdout; if(!$self->debug) { - $oldstdout = select(File::Spec->devnull()); + open DEVNULL, ">", File::Spec->devnull(); + $oldstdout = select(DEVNULL); } # Create the Proxy socket diff --git a/util/TLSProxy/Record.pm b/util/TLSProxy/Record.pm index 1d10508..124f924 100644 --- a/util/TLSProxy/Record.pm +++ b/util/TLSProxy/Record.pm @@ -83,7 +83,8 @@ use constant { VERS_TLS_1_2 => 771, VERS_TLS_1_1 => 770, VERS_TLS_1_0 => 769, - VERS_SSL_3_0 => 768 + VERS_SSL_3_0 => 768, + VERS_SSL_LT_3_0 => 767 }; my %tls_version = ( @@ -91,7 +92,8 @@ my %tls_version = ( VERS_TLS_1_2, "TLS1.2", VERS_TLS_1_1, "TLS1.1", VERS_TLS_1_0, "TLS1.0", - VERS_SSL_3_0, "SSL3" + VERS_SSL_3_0, "SSL3", + VERS_SSL_LT_3_0, "SSL<3" ); #Class method to extract records from a packet of data diff --git a/util/TLSProxy/ServerKeyExchange.pm b/util/TLSProxy/ServerKeyExchange.pm index 3a91d17..b85b8ad 100644 --- a/util/TLSProxy/ServerKeyExchange.pm +++ b/util/TLSProxy/ServerKeyExchange.pm @@ -104,13 +104,16 @@ sub parse my $pub_key_len = unpack('n', substr($self->data, $ptr)); $ptr += 2; my $pub_key = substr($self->data, $ptr, $pub_key_len); - $ptr += $g_len; + $ptr += $pub_key_len; #We assume its signed my $sig_len = unpack('n', substr($self->data, $ptr)); - $ptr += 2; - my $sig = substr($self->data, $ptr, $sig_len); - $ptr += $sig_len; + my $sig = ""; + if (defined $sig_len) { + $ptr += 2; + $sig = substr($self->data, $ptr, $sig_len); + $ptr += $sig_len; + } $self->p($p); $self->g($g); From rsalz at openssl.org Fri Aug 14 12:21:43 2015 From: rsalz at openssl.org (Rich Salz) Date: Fri, 14 Aug 2015 12:21:43 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439554903.908822.29911.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 56353962e7da7e385c3d577581ccc3015ed6d1dc (commit) from 25efcb44ac88ab34f60047e16a96c9462fad39c1 (commit) - Log ----------------------------------------------------------------- commit 56353962e7da7e385c3d577581ccc3015ed6d1dc Author: Rich Salz Date: Fri Aug 14 08:21:19 2015 -0400 Fix 1.0.2 build break Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: crypto/x509/x509_vfy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c index 26c6bb3..15a4fb9 100644 --- a/crypto/x509/x509_vfy.c +++ b/crypto/x509/x509_vfy.c @@ -355,7 +355,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) X509_free(xtmp); X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); ok = 0; - goto done; + goto end; } num++; } From steve at openssl.org Fri Aug 14 12:41:57 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 12:41:57 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_1-stable update Message-ID: <1439556117.682846.32243.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_1-stable has been updated via 50e56c1d8c681b8e8a070487645370f0f7c1ee9e (commit) via 2d172503687dd4c05193edf4d8242625fedc5806 (commit) via aa701624b1b1fd0fa4ad692b86b25e0e79a7eaa2 (commit) from 396e30044910df29b81a416de42a94eb4355cd70 (commit) - Log ----------------------------------------------------------------- commit 50e56c1d8c681b8e8a070487645370f0f7c1ee9e Author: Dr. Stephen Henson Date: Sat Aug 1 15:38:11 2015 +0100 Return error for unsupported modes. PR#3974 PR#3975 Reviewed-by: Matt Caswell Conflicts: crypto/evp/evp_lib.c commit 2d172503687dd4c05193edf4d8242625fedc5806 Author: Dr. Stephen Henson Date: Sat Aug 1 15:37:44 2015 +0100 Fix memory leak if setup fails. Reviewed-by: Matt Caswell (cherry picked from commit 891eac4604b5f05413e59602fae1f11136f4719a) Conflicts: crypto/cms/cms_enc.c commit aa701624b1b1fd0fa4ad692b86b25e0e79a7eaa2 Author: Dr. Stephen Henson Date: Sat Aug 1 15:37:01 2015 +0100 Err isn't always malloc failure. Reviewed-by: Matt Caswell (cherry picked from commit a187e08d856690b5c1da3184d0ff560d572f893b) Conflicts: crypto/cms/cms_smime.c ----------------------------------------------------------------------- Summary of changes: crypto/cms/cms_enc.c | 2 +- crypto/cms/cms_smime.c | 2 +- crypto/evp/evp_lib.c | 33 +++++++++++++++++++++++++++------ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index 85ae928..b14b4b6 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) ok = 1; err: - if (ec->key && !keep_key) { + if (ec->key && (!keep_key || !ok)) { OPENSSL_cleanse(ec->key, ec->keylen); OPENSSL_free(ec->key); ec->key = NULL; diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 8b37560..f45693a 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -714,7 +714,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) BIO *cmsbio; int ret = 0; if (!(cmsbio = CMS_dataInit(cms, dcont))) { - CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE); + CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB); return 0; } diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index d4d2b4b..b16d623 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -67,9 +67,19 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->set_asn1_parameters != NULL) ret = c->cipher->set_asn1_parameters(c, type); - else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) - ret = EVP_CIPHER_set_asn1_iv(c, type); - else + else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { + switch (EVP_CIPHER_CTX_mode(c)) { + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + ret = -1; + break; + + default: + ret = EVP_CIPHER_set_asn1_iv(c, type); + } + } else ret = -1; return (ret); } @@ -80,9 +90,20 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->get_asn1_parameters != NULL) ret = c->cipher->get_asn1_parameters(c, type); - else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) - ret = EVP_CIPHER_get_asn1_iv(c, type); - else + else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { + switch (EVP_CIPHER_CTX_mode(c)) { + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + ret = -1; + break; + + default: + ret = EVP_CIPHER_get_asn1_iv(c, type); + break; + } + } else ret = -1; return (ret); } From steve at openssl.org Fri Aug 14 12:41:57 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 12:41:57 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439556117.837416.32267.nullmailer@dev.openssl.org> The branch master has been updated via 6d5f8265ce6c4a8ed528462f519d9e8f2b7cfafd (commit) from 00bf5001f72144062fe3f7973b968be534ac1246 (commit) - Log ----------------------------------------------------------------- commit 6d5f8265ce6c4a8ed528462f519d9e8f2b7cfafd Author: Dr. Stephen Henson Date: Thu Jul 23 16:38:58 2015 +0100 Documentation for SSL_check_chain() Reviewed-by: Matt Caswell ----------------------------------------------------------------------- Summary of changes: doc/ssl/SSL_check_chain.pod | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 doc/ssl/SSL_check_chain.pod diff --git a/doc/ssl/SSL_check_chain.pod b/doc/ssl/SSL_check_chain.pod new file mode 100644 index 0000000..d3b7601 --- /dev/null +++ b/doc/ssl/SSL_check_chain.pod @@ -0,0 +1,85 @@ +=pod + +=head1 NAME + +SSL_check_chain - check certificate chain suitability + +=head1 SYNOPSIS + + #include + + int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + +=head1 DESCRIPTION + +SSL_check_chain() checks whether certificate B, private key B and +certificate chain B is suitable for use with the current session +B. + +=head1 RETURN VALUES + +SSL_check_chain() returns a bitmap of flags indicating the validity of the +chain. + +B: the chain can be used with the current session. +If this flag is B set then the certificate will never be used even +if the application tries to set it because it is inconsistent with the +peer preferences. + +B: the EE key can be used for signing. + +B: the signature algorithm of the EE certificate is +acceptable. + +B: the signature algorithms of all CA certificates +are acceptable. + +B: the parameters of the end entity certificate are +acceptable (e.g. it is a supported curve). + +B: the parameters of all CA certificates are acceptable. + +B: the end entity certificate algorithm +can be used explicitly for signing (i.e. it is mentioned in the signature +algorithms extension). + +B: the issuer name is acceptable. This is only +meaningful for client authentication. + +B: the certificate type is acceptable. Only meaningful +for client authentication. + +B: chain is suitable for Suite B use. + +=head1 NOTES + +SSL_check_chain() must be called in servers after a client hello message or in +clients after a certificate request message. It will typically be called +in the certificate callback. + +An application wishing to support multiple certificate chains may call this +function on each chain in turn: starting with the one it considers the +most secure. It could then use the chain of the first set which returns +suitable flags. + +As a minimum the flag B must be set for a chain to be +usable. An application supporting multiple chains with different CA signature +algorithms may also wish to check B too. If no +chain is suitable a server should fall back to the most secure chain which +sets B. + +The validity of a chain is determined by checking if it matches a supported +signature algorithm, supported curves and in the case of client authentication +certificate types and issuer names. + +Since the supported signature algorithms extension is only used in TLS 1.2 +and DTLS 1.2 the results for earlier versions of TLS and DTLS may not be +very useful. Applications may wish to specify a different "legacy" chain +for earlier versions of TLS or DTLS. + +=head1 SEE ALSO + +L, +L + +=cut From steve at openssl.org Fri Aug 14 12:43:29 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 12:43:29 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439556209.378102.7685.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 8d2e7c0dec6e0c0edbd2db0d712cc7407143eb65 (commit) from 56353962e7da7e385c3d577581ccc3015ed6d1dc (commit) - Log ----------------------------------------------------------------- commit 8d2e7c0dec6e0c0edbd2db0d712cc7407143eb65 Author: Dr. Stephen Henson Date: Thu Jul 23 16:38:58 2015 +0100 Documentation for SSL_check_chain() Reviewed-by: Matt Caswell (cherry picked from commit 6d5f8265ce6c4a8ed528462f519d9e8f2b7cfafd) ----------------------------------------------------------------------- Summary of changes: doc/ssl/SSL_check_chain.pod | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 doc/ssl/SSL_check_chain.pod diff --git a/doc/ssl/SSL_check_chain.pod b/doc/ssl/SSL_check_chain.pod new file mode 100644 index 0000000..d3b7601 --- /dev/null +++ b/doc/ssl/SSL_check_chain.pod @@ -0,0 +1,85 @@ +=pod + +=head1 NAME + +SSL_check_chain - check certificate chain suitability + +=head1 SYNOPSIS + + #include + + int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + +=head1 DESCRIPTION + +SSL_check_chain() checks whether certificate B, private key B and +certificate chain B is suitable for use with the current session +B. + +=head1 RETURN VALUES + +SSL_check_chain() returns a bitmap of flags indicating the validity of the +chain. + +B: the chain can be used with the current session. +If this flag is B set then the certificate will never be used even +if the application tries to set it because it is inconsistent with the +peer preferences. + +B: the EE key can be used for signing. + +B: the signature algorithm of the EE certificate is +acceptable. + +B: the signature algorithms of all CA certificates +are acceptable. + +B: the parameters of the end entity certificate are +acceptable (e.g. it is a supported curve). + +B: the parameters of all CA certificates are acceptable. + +B: the end entity certificate algorithm +can be used explicitly for signing (i.e. it is mentioned in the signature +algorithms extension). + +B: the issuer name is acceptable. This is only +meaningful for client authentication. + +B: the certificate type is acceptable. Only meaningful +for client authentication. + +B: chain is suitable for Suite B use. + +=head1 NOTES + +SSL_check_chain() must be called in servers after a client hello message or in +clients after a certificate request message. It will typically be called +in the certificate callback. + +An application wishing to support multiple certificate chains may call this +function on each chain in turn: starting with the one it considers the +most secure. It could then use the chain of the first set which returns +suitable flags. + +As a minimum the flag B must be set for a chain to be +usable. An application supporting multiple chains with different CA signature +algorithms may also wish to check B too. If no +chain is suitable a server should fall back to the most secure chain which +sets B. + +The validity of a chain is determined by checking if it matches a supported +signature algorithm, supported curves and in the case of client authentication +certificate types and issuer names. + +Since the supported signature algorithms extension is only used in TLS 1.2 +and DTLS 1.2 the results for earlier versions of TLS and DTLS may not be +very useful. Applications may wish to specify a different "legacy" chain +for earlier versions of TLS or DTLS. + +=head1 SEE ALSO + +L, +L + +=cut From steve at openssl.org Fri Aug 14 12:51:51 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 12:51:51 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439556711.139932.9159.nullmailer@dev.openssl.org> The branch master has been updated via 2fd7fb99dba9f56fbcb7ee1686bef30c7aef4754 (commit) from 6d5f8265ce6c4a8ed528462f519d9e8f2b7cfafd (commit) - Log ----------------------------------------------------------------- commit 2fd7fb99dba9f56fbcb7ee1686bef30c7aef4754 Author: Dr. Stephen Henson Date: Wed Jun 17 01:13:40 2015 +0100 Update docs. Clarify and update documention for extra chain certificates. PR#3878. Reviewed-by: Rich Salz ----------------------------------------------------------------------- Summary of changes: doc/ssl/SSL_CTX_add_extra_chain_cert.pod | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doc/ssl/SSL_CTX_add_extra_chain_cert.pod b/doc/ssl/SSL_CTX_add_extra_chain_cert.pod index 8e832a5..04300fb 100644 --- a/doc/ssl/SSL_CTX_add_extra_chain_cert.pod +++ b/doc/ssl/SSL_CTX_add_extra_chain_cert.pod @@ -2,29 +2,39 @@ =head1 NAME -SSL_CTX_add_extra_chain_cert - add certificate to chain +SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs - add or clear +extra chain certificates =head1 SYNOPSIS #include - long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509) + long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); =head1 DESCRIPTION -SSL_CTX_add_extra_chain_cert() adds the certificate B to the certificate -chain presented together with the certificate. Several certificates -can be added one after the other. +SSL_CTX_add_extra_chain_cert() adds the certificate B to the extra chain +certificates associated with B. Several certificates can be added one +after another. + +SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates +associated with B. + +These functions are implemented as macros. =head1 NOTES -When constructing the certificate chain, the chain will be formed from -these certificates explicitly specified. If no chain is specified, -the library will try to complete the chain from the available CA -certificates in the trusted CA storage, see +When sending a certificate chain, extra chain certificates are sent in order +following the end entity certificate. + +If no chain is specified, the library will try to complete the chain from the +available CA certificates in the trusted CA storage, see L. -The B certificate provided to SSL_CTX_add_extra_chain_cert() will be freed by the library when the B is destroyed. An application B free the B object. +The B certificate provided to SSL_CTX_add_extra_chain_cert() will be +freed by the library when the B is destroyed. An application +B free the B object. =head1 RESTRICTIONS @@ -37,8 +47,9 @@ be used instead. =head1 RETURN VALUES -SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the -error stack to find out the reason for failure otherwise. +SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return +1 on success and 0 for failure. Check out the error stack to find out the +reason for failure. =head1 SEE ALSO From steve at openssl.org Fri Aug 14 12:55:40 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 12:55:40 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_1-stable update Message-ID: <1439556940.685132.17313.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_1-stable has been updated via 2cf51451f3a94be3fdf7d281b122eb74d72a839e (commit) from 50e56c1d8c681b8e8a070487645370f0f7c1ee9e (commit) - Log ----------------------------------------------------------------- commit 2cf51451f3a94be3fdf7d281b122eb74d72a839e Author: Dr. Stephen Henson Date: Wed Jun 17 01:13:40 2015 +0100 Update docs. Clarify and update documention for extra chain certificates. PR#3878. Reviewed-by: Rich Salz (cherry picked from commit 2fd7fb99dba9f56fbcb7ee1686bef30c7aef4754) ----------------------------------------------------------------------- Summary of changes: doc/ssl/SSL_CTX_add_extra_chain_cert.pod | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doc/ssl/SSL_CTX_add_extra_chain_cert.pod b/doc/ssl/SSL_CTX_add_extra_chain_cert.pod index 5955ee1..18fb2e2 100644 --- a/doc/ssl/SSL_CTX_add_extra_chain_cert.pod +++ b/doc/ssl/SSL_CTX_add_extra_chain_cert.pod @@ -2,29 +2,39 @@ =head1 NAME -SSL_CTX_add_extra_chain_cert - add certificate to chain +SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs - add or clear +extra chain certificates =head1 SYNOPSIS #include - long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509) + long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); =head1 DESCRIPTION -SSL_CTX_add_extra_chain_cert() adds the certificate B to the certificate -chain presented together with the certificate. Several certificates -can be added one after the other. +SSL_CTX_add_extra_chain_cert() adds the certificate B to the extra chain +certificates associated with B. Several certificates can be added one +after another. + +SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates +associated with B. + +These functions are implemented as macros. =head1 NOTES -When constructing the certificate chain, the chain will be formed from -these certificates explicitly specified. If no chain is specified, -the library will try to complete the chain from the available CA -certificates in the trusted CA storage, see +When sending a certificate chain, extra chain certificates are sent in order +following the end entity certificate. + +If no chain is specified, the library will try to complete the chain from the +available CA certificates in the trusted CA storage, see L. -The B certificate provided to SSL_CTX_add_extra_chain_cert() will be freed by the library when the B is destroyed. An application B free the B object. +The B certificate provided to SSL_CTX_add_extra_chain_cert() will be +freed by the library when the B is destroyed. An application +B free the B object. =head1 RESTRICTIONS @@ -36,8 +46,9 @@ function. =head1 RETURN VALUES -SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the -error stack to find out the reason for failure otherwise. +SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return +1 on success and 0 for failure. Check out the error stack to find out the +reason for failure. =head1 SEE ALSO From steve at openssl.org Fri Aug 14 12:55:40 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 12:55:40 +0000 Subject: [openssl-commits] [openssl] OpenSSL_1_0_2-stable update Message-ID: <1439556940.764659.17335.nullmailer@dev.openssl.org> The branch OpenSSL_1_0_2-stable has been updated via 3d23b2c255e194ebb9dabd198d263028b475d012 (commit) from 8d2e7c0dec6e0c0edbd2db0d712cc7407143eb65 (commit) - Log ----------------------------------------------------------------- commit 3d23b2c255e194ebb9dabd198d263028b475d012 Author: Dr. Stephen Henson Date: Wed Jun 17 01:13:40 2015 +0100 Update docs. Clarify and update documention for extra chain certificates. PR#3878. Reviewed-by: Rich Salz (cherry picked from commit 2fd7fb99dba9f56fbcb7ee1686bef30c7aef4754) ----------------------------------------------------------------------- Summary of changes: doc/ssl/SSL_CTX_add_extra_chain_cert.pod | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/doc/ssl/SSL_CTX_add_extra_chain_cert.pod b/doc/ssl/SSL_CTX_add_extra_chain_cert.pod index 8e832a5..04300fb 100644 --- a/doc/ssl/SSL_CTX_add_extra_chain_cert.pod +++ b/doc/ssl/SSL_CTX_add_extra_chain_cert.pod @@ -2,29 +2,39 @@ =head1 NAME -SSL_CTX_add_extra_chain_cert - add certificate to chain +SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs - add or clear +extra chain certificates =head1 SYNOPSIS #include - long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509) + long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); =head1 DESCRIPTION -SSL_CTX_add_extra_chain_cert() adds the certificate B to the certificate -chain presented together with the certificate. Several certificates -can be added one after the other. +SSL_CTX_add_extra_chain_cert() adds the certificate B to the extra chain +certificates associated with B. Several certificates can be added one +after another. + +SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates +associated with B. + +These functions are implemented as macros. =head1 NOTES -When constructing the certificate chain, the chain will be formed from -these certificates explicitly specified. If no chain is specified, -the library will try to complete the chain from the available CA -certificates in the trusted CA storage, see +When sending a certificate chain, extra chain certificates are sent in order +following the end entity certificate. + +If no chain is specified, the library will try to complete the chain from the +available CA certificates in the trusted CA storage, see L. -The B certificate provided to SSL_CTX_add_extra_chain_cert() will be freed by the library when the B is destroyed. An application B free the B object. +The B certificate provided to SSL_CTX_add_extra_chain_cert() will be +freed by the library when the B is destroyed. An application +B free the B object. =head1 RESTRICTIONS @@ -37,8 +47,9 @@ be used instead. =head1 RETURN VALUES -SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the -error stack to find out the reason for failure otherwise. +SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return +1 on success and 0 for failure. Check out the error stack to find out the +reason for failure. =head1 SEE ALSO From steve at openssl.org Fri Aug 14 13:21:52 2015 From: steve at openssl.org (Dr. Stephen Henson) Date: Fri, 14 Aug 2015 13:21:52 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439558512.180811.20503.nullmailer@dev.openssl.org> The branch master has been updated via f8f5f8369d1d76fd8ec28d3d2422a47f8440f452 (commit) via 176f85a28ec73b16f68a4f1737fb4645b9e9ae7b (commit) via 3d3701ea20ca36215e3af5ac090797cfec5fca2a (commit) via e75c5a794e71baa3d76214be3ac8dc6e082e4a1a (commit) from 2fd7fb99dba9f56fbcb7ee1686bef30c7aef4754 (commit) - Log ----------------------------------------------------------------- commit f8f5f8369d1d76fd8ec28d3d2422a47f8440f452 Author: Dr. Stephen Henson Date: Mon Aug 10 19:17:50 2015 +0100 add CCM docs Reviewed-by: Tim Hudson commit 176f85a28ec73b16f68a4f1737fb4645b9e9ae7b Author: Dr. Stephen Henson Date: Fri Jul 31 16:53:45 2015 +0100 Add CCM ciphersuites from RFC6655 and RFC7251 Reviewed-by: Tim Hudson commit 3d3701ea20ca36215e3af5ac090797cfec5fca2a Author: Dr. Stephen Henson Date: Fri Jul 31 16:59:45 2015 +0100 ccm8 support Reviewed-by: Tim Hudson commit e75c5a794e71baa3d76214be3ac8dc6e082e4a1a Author: Dr. Stephen Henson Date: Fri Jul 31 16:54:35 2015 +0100 CCM support. Reviewed-by: Tim Hudson ----------------------------------------------------------------------- Summary of changes: crypto/evp/e_aes.c | 92 ++++++++++++- doc/apps/ciphers.pod | 29 +++++ include/openssl/evp.h | 10 +- include/openssl/ssl.h | 2 + include/openssl/tls1.h | 54 ++++++++ ssl/record/rec_layer_d1.c | 2 + ssl/record/rec_layer_s3.c | 2 + ssl/record/ssl3_record.c | 14 +- ssl/s3_lib.c | 320 ++++++++++++++++++++++++++++++++++++++++++++++ ssl/ssl_algs.c | 2 + ssl/ssl_ciph.c | 36 +++++- ssl/ssl_locl.h | 6 +- ssl/t1_enc.c | 18 ++- 13 files changed, 570 insertions(+), 17 deletions(-) diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index f8365a2..b02cf6e 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -110,6 +110,7 @@ typedef struct { int tag_set; /* Set if tag is valid */ int len_set; /* Set if message length set */ int L, M; /* L and M parameters from RFC3610 */ + int tls_aad_len; /* TLS AAD length */ CCM128_CONTEXT ccm; ccm128_f str; } EVP_AES_CCM_CTX; @@ -1853,6 +1854,34 @@ static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) cctx->M = 12; cctx->tag_set = 0; cctx->len_set = 0; + cctx->tls_aad_len = -1; + return 1; + + case EVP_CTRL_AEAD_TLS1_AAD: + /* Save the AAD for later use */ + if (arg != EVP_AEAD_TLS1_AAD_LEN) + return 0; + memcpy(c->buf, ptr, arg); + cctx->tls_aad_len = arg; + { + uint16_t len = c->buf[arg - 2] << 8 | c->buf[arg - 1]; + /* Correct length for explicit IV */ + len -= EVP_CCM_TLS_EXPLICIT_IV_LEN; + /* If decrypting correct for tag too */ + if (!c->encrypt) + len -= cctx->M; + c->buf[arg - 2] = len >> 8; + c->buf[arg - 1] = len & 0xff; + } + /* Extra padding: tag appended to record */ + return cctx->M; + + case EVP_CTRL_CCM_SET_IV_FIXED: + /* Sanity check length */ + if (arg != EVP_CCM_TLS_FIXED_IV_LEN) + return 0; + /* Just copy to first part of IV */ + memcpy(c->iv, ptr, arg); return 1; case EVP_CTRL_AEAD_SET_IVLEN: @@ -1945,14 +1974,66 @@ static int aes_ccm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, return 1; } +static int aes_ccm_tls_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, + const unsigned char *in, size_t len) +{ + EVP_AES_CCM_CTX *cctx = ctx->cipher_data; + CCM128_CONTEXT *ccm = &cctx->ccm; + /* Encrypt/decrypt must be performed in place */ + if (out != in || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->M)) + return -1; + /* If encrypting set explicit IV from sequence number (start of AAD) */ + if (ctx->encrypt) + memcpy(out, ctx->buf, EVP_CCM_TLS_EXPLICIT_IV_LEN); + /* Get rest of IV from explicit IV */ + memcpy(ctx->iv + EVP_CCM_TLS_FIXED_IV_LEN, in, EVP_CCM_TLS_EXPLICIT_IV_LEN); + /* Correct length value */ + len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M; + if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len)) + return -1; + /* Use saved AAD */ + CRYPTO_ccm128_aad(ccm, ctx->buf, cctx->tls_aad_len); + /* Fix buffer to point to payload */ + in += EVP_CCM_TLS_EXPLICIT_IV_LEN; + out += EVP_CCM_TLS_EXPLICIT_IV_LEN; + if (ctx->encrypt) { + if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, + cctx->str) : + CRYPTO_ccm128_encrypt(ccm, in, out, len)) + return -1; + if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M)) + return -1; + return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M; + } else { + if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, + cctx->str) : + !CRYPTO_ccm128_decrypt(ccm, in, out, len)) { + unsigned char tag[16]; + if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) { + if (!CRYPTO_memcmp(tag, in + len, cctx->M)) + return len; + } + } + OPENSSL_cleanse(out, len); + return -1; + } +} + static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t len) { EVP_AES_CCM_CTX *cctx = ctx->cipher_data; CCM128_CONTEXT *ccm = &cctx->ccm; /* If not set up, return error */ - if (!cctx->iv_set && !cctx->key_set) + if (!cctx->key_set) + return -1; + + if (cctx->tls_aad_len >= 0) + return aes_ccm_tls_cipher(ctx, out, in, len); + + if (!cctx->iv_set) return -1; + if (!ctx->encrypt && !cctx->tag_set) return -1; if (!out) { @@ -2007,9 +2088,12 @@ static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, # define aes_ccm_cleanup NULL -BLOCK_CIPHER_custom(NID_aes, 128, 1, 12, ccm, CCM, CUSTOM_FLAGS) - BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, ccm, CCM, CUSTOM_FLAGS) - BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, ccm, CCM, CUSTOM_FLAGS) +BLOCK_CIPHER_custom(NID_aes, 128, 1, 12, ccm, CCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 192, 1, 12, ccm, CCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) + BLOCK_CIPHER_custom(NID_aes, 256, 1, 12, ccm, CCM, + EVP_CIPH_FLAG_AEAD_CIPHER | CUSTOM_FLAGS) typedef struct { union { diff --git a/doc/apps/ciphers.pod b/doc/apps/ciphers.pod index 5a4a4fd..3f146e8 100644 --- a/doc/apps/ciphers.pod +++ b/doc/apps/ciphers.pod @@ -260,6 +260,13 @@ cipher suites using 128 bit AES, 256 bit AES or either 128 or 256 bit AES. AES in Galois Counter Mode (GCM): these ciphersuites are only supported in TLS v1.2. +=item B, B + +AES in Cipher Block Chaining - Message Authentication Mode (CCM): these +ciphersuites are only supported in TLS v1.2. B references CCM +cipher suites using both 16 and 8 octet Integrity Check Value (ICV) +while B only references 8 octet ICV. + =item B, B, B cipher suites using 128 bit CAMELLIA, 256 bit CAMELLIA or either 128 or 256 bit @@ -576,6 +583,19 @@ Note: these ciphers can also be used in SSL v3. TLS_DH_anon_WITH_AES_128_GCM_SHA256 ADH-AES128-GCM-SHA256 TLS_DH_anon_WITH_AES_256_GCM_SHA384 ADH-AES256-GCM-SHA384 + RSA_WITH_AES_128_CCM AES128-CCM + RSA_WITH_AES_256_CCM AES256-CCM + DHE_RSA_WITH_AES_128_CCM DHE-RSA-AES128-CCM + DHE_RSA_WITH_AES_256_CCM DHE-RSA-AES256-CCM + RSA_WITH_AES_128_CCM_8 AES128-CCM8 + RSA_WITH_AES_256_CCM_8 AES256-CCM8 + DHE_RSA_WITH_AES_128_CCM_8 DHE-RSA-AES128-CCM8 + DHE_RSA_WITH_AES_256_CCM_8 DHE-RSA-AES256-CCM8 + ECDHE_ECDSA_WITH_AES_128_CCM ECDHE-ECDSA-AES128-CCM + ECDHE_ECDSA_WITH_AES_256_CCM ECDHE-ECDSA-AES256-CCM + ECDHE_ECDSA_WITH_AES_128_CCM_8 ECDHE-ECDSA-AES128-CCM8 + ECDHE_ECDSA_WITH_AES_256_CCM_8 ECDHE-ECDSA-AES256-CCM8 + =head2 Camellia HMAC-Based ciphersuites from RFC6367, extending TLS v1.2 TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 ECDHE-ECDSA-CAMELLIA128-SHA256 @@ -652,6 +672,15 @@ Note: these ciphers can also be used in SSL v3. ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 ECDHE-PSK-CAMELLIA128-SHA256 ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 ECDHE-PSK-CAMELLIA256-SHA384 + PSK_WITH_AES_128_CCM PSK-AES128-CCM + PSK_WITH_AES_256_CCM PSK-AES256-CCM + DHE_PSK_WITH_AES_128_CCM DHE-PSK-AES128-CCM + DHE_PSK_WITH_AES_256_CCM DHE-PSK-AES256-CCM + PSK_WITH_AES_128_CCM_8 PSK-AES128-CCM8 + PSK_WITH_AES_256_CCM_8 PSK-AES256-CCM8 + DHE_PSK_WITH_AES_128_CCM_8 DHE-PSK-AES128-CCM8 + DHE_PSK_WITH_AES_256_CCM_8 DHE-PSK-AES256-CCM8 + =head1 NOTES Some compiled versions of OpenSSL may not include all the ciphers diff --git a/include/openssl/evp.h b/include/openssl/evp.h index dff81b0..ddefbf6 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -399,14 +399,16 @@ struct evp_cipher_st { # define EVP_CTRL_AEAD_SET_IVLEN 0x9 # define EVP_CTRL_AEAD_GET_TAG 0x10 # define EVP_CTRL_AEAD_SET_TAG 0x11 +# define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 # define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN # define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG # define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG -# define EVP_CTRL_GCM_SET_IV_FIXED 0x12 +# define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED # define EVP_CTRL_GCM_IV_GEN 0x13 # define EVP_CTRL_CCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN # define EVP_CTRL_CCM_GET_TAG EVP_CTRL_AEAD_GET_TAG # define EVP_CTRL_CCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +# define EVP_CTRL_CCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED # define EVP_CTRL_CCM_SET_L 0x14 # define EVP_CTRL_CCM_SET_MSGLEN 0x15 /* @@ -443,6 +445,12 @@ typedef struct { /* Length of tag for TLS */ # define EVP_GCM_TLS_TAG_LEN 16 +/* CCM TLS constants */ +/* Length of fixed part of IV derived from PRF */ +# define EVP_CCM_TLS_FIXED_IV_LEN 4 +/* Length of explicit part of IV part of TLS records */ +# define EVP_CCM_TLS_EXPLICIT_IV_LEN 8 + typedef struct evp_cipher_info_st { const EVP_CIPHER *cipher; unsigned char iv[EVP_MAX_IV_LENGTH]; diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 28c2fb9..10f8041 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -245,6 +245,8 @@ extern "C" { # define SSL_TXT_AES256 "AES256" # define SSL_TXT_AES "AES" # define SSL_TXT_AES_GCM "AESGCM" +# define SSL_TXT_AES_CCM "AESCCM" +# define SSL_TXT_AES_CCM_8 "AESCCM8" # define SSL_TXT_CAMELLIA128 "CAMELLIA128" # define SSL_TXT_CAMELLIA256 "CAMELLIA256" # define SSL_TXT_CAMELLIA "CAMELLIA" diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h index 6e98784..6adfcf3 100644 --- a/include/openssl/tls1.h +++ b/include/openssl/tls1.h @@ -519,6 +519,31 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6 # define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7 +/* CCM ciphersuites from RFC6655 */ +# define TLS1_CK_RSA_WITH_AES_128_CCM 0x0300C09C +# define TLS1_CK_RSA_WITH_AES_256_CCM 0x0300C09D +# define TLS1_CK_DHE_RSA_WITH_AES_128_CCM 0x0300C09E +# define TLS1_CK_DHE_RSA_WITH_AES_256_CCM 0x0300C09F +# define TLS1_CK_RSA_WITH_AES_128_CCM_8 0x0300C0A0 +# define TLS1_CK_RSA_WITH_AES_256_CCM_8 0x0300C0A1 +# define TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8 0x0300C0A2 +# define TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8 0x0300C0A3 +# define TLS1_CK_PSK_WITH_AES_128_CCM 0x0300C0A4 +# define TLS1_CK_PSK_WITH_AES_256_CCM 0x0300C0A5 +# define TLS1_CK_DHE_PSK_WITH_AES_128_CCM 0x0300C0A6 +# define TLS1_CK_DHE_PSK_WITH_AES_256_CCM 0x0300C0A7 +# define TLS1_CK_PSK_WITH_AES_128_CCM_8 0x0300C0A8 +# define TLS1_CK_PSK_WITH_AES_256_CCM_8 0x0300C0A9 +# define TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8 0x0300C0AA +# define TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8 0x0300C0AB + +/* CCM ciphersuites from RFC7251 */ + +# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM 0x0300C0AC +# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM 0x0300C0AD +# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8 0x0300C0AE +# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8 0x0300C0AF + /* TLS 1.2 Camellia SHA-256 ciphersuites from RFC5932 */ # define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA256 0x030000BA # define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 0x030000BB @@ -823,6 +848,35 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256" # define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" +/* CCM ciphersuites from RFC6655 */ + +# define TLS1_TXT_RSA_WITH_AES_128_CCM "AES128-CCM" +# define TLS1_TXT_RSA_WITH_AES_256_CCM "AES256-CCM" +# define TLS1_TXT_DHE_RSA_WITH_AES_128_CCM "DHE-RSA-AES128-CCM" +# define TLS1_TXT_DHE_RSA_WITH_AES_256_CCM "DHE-RSA-AES256-CCM" + +# define TLS1_TXT_RSA_WITH_AES_128_CCM_8 "AES128-CCM8" +# define TLS1_TXT_RSA_WITH_AES_256_CCM_8 "AES256-CCM8" +# define TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8 "DHE-RSA-AES128-CCM8" +# define TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8 "DHE-RSA-AES256-CCM8" + +# define TLS1_TXT_PSK_WITH_AES_128_CCM "PSK-AES128-CCM" +# define TLS1_TXT_PSK_WITH_AES_256_CCM "PSK-AES256-CCM" +# define TLS1_TXT_DHE_PSK_WITH_AES_128_CCM "DHE-PSK-AES128-CCM" +# define TLS1_TXT_DHE_PSK_WITH_AES_256_CCM "DHE-PSK-AES256-CCM" + +# define TLS1_TXT_PSK_WITH_AES_128_CCM_8 "PSK-AES128-CCM8" +# define TLS1_TXT_PSK_WITH_AES_256_CCM_8 "PSK-AES256-CCM8" +# define TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8 "DHE-PSK-AES128-CCM8" +# define TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8 "DHE-PSK-AES256-CCM8" + +/* CCM ciphersuites from RFC7251 */ + +# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM "ECDHE-ECDSA-AES128-CCM" +# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM "ECDHE-ECDSA-AES256-CCM" +# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8 "ECDHE-ECDSA-AES128-CCM8" +# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8 "ECDHE-ECDSA-AES256-CCM8" + /* ECDH HMAC based ciphersuites from RFC5289 */ # define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" diff --git a/ssl/record/rec_layer_d1.c b/ssl/record/rec_layer_d1.c index 3da4f11..74796be 100644 --- a/ssl/record/rec_layer_d1.c +++ b/ssl/record/rec_layer_d1.c @@ -1120,6 +1120,8 @@ int do_dtls1_write(SSL *s, int type, const unsigned char *buf, /* Need explicit part of IV for GCM mode */ else if (mode == EVP_CIPH_GCM_MODE) eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN; + else if (mode == EVP_CIPH_CCM_MODE) + eivlen = EVP_CCM_TLS_EXPLICIT_IV_LEN; else eivlen = 0; } else diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c index 8a9e303..5b28663 100644 --- a/ssl/record/rec_layer_s3.c +++ b/ssl/record/rec_layer_s3.c @@ -799,6 +799,8 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, /* Need explicit part of IV for GCM mode */ else if (mode == EVP_CIPH_GCM_MODE) eivlen = EVP_GCM_TLS_EXPLICIT_IV_LEN; + else if (mode == EVP_CIPH_CCM_MODE) + eivlen = EVP_CCM_TLS_EXPLICIT_IV_LEN; else eivlen = 0; } else diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c index 1865f24..1fa1710 100644 --- a/ssl/record/ssl3_record.c +++ b/ssl/record/ssl3_record.c @@ -764,10 +764,16 @@ int tls1_enc(SSL *s, int send) ? (i < 0) : (i == 0)) return -1; /* AEAD can fail to verify MAC */ - if (EVP_CIPHER_mode(enc) == EVP_CIPH_GCM_MODE && !send) { - rec->data += EVP_GCM_TLS_EXPLICIT_IV_LEN; - rec->input += EVP_GCM_TLS_EXPLICIT_IV_LEN; - rec->length -= EVP_GCM_TLS_EXPLICIT_IV_LEN; + if (send == 0) { + if (EVP_CIPHER_mode(enc) == EVP_CIPH_GCM_MODE) { + rec->data += EVP_GCM_TLS_EXPLICIT_IV_LEN; + rec->input += EVP_GCM_TLS_EXPLICIT_IV_LEN; + rec->length -= EVP_GCM_TLS_EXPLICIT_IV_LEN; + } else if (EVP_CIPHER_mode(enc) == EVP_CIPH_CCM_MODE) { + rec->data += EVP_CCM_TLS_EXPLICIT_IV_LEN; + rec->input += EVP_CCM_TLS_EXPLICIT_IV_LEN; + rec->length -= EVP_CCM_TLS_EXPLICIT_IV_LEN; + } } ret = 1; diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 0a3bba4..47d28e7 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -3450,6 +3450,326 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl3_ciphers[] = { 256}, #endif + /* Cipher C09C */ + { + 1, + TLS1_TXT_RSA_WITH_AES_128_CCM, + TLS1_CK_RSA_WITH_AES_128_CCM, + SSL_kRSA, + SSL_aRSA, + SSL_AES128CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C09D */ + { + 1, + TLS1_TXT_RSA_WITH_AES_256_CCM, + TLS1_CK_RSA_WITH_AES_256_CCM, + SSL_kRSA, + SSL_aRSA, + SSL_AES256CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C09E */ + { + 1, + TLS1_TXT_DHE_RSA_WITH_AES_128_CCM, + TLS1_CK_DHE_RSA_WITH_AES_128_CCM, + SSL_kDHE, + SSL_aRSA, + SSL_AES128CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C09F */ + { + 1, + TLS1_TXT_DHE_RSA_WITH_AES_256_CCM, + TLS1_CK_DHE_RSA_WITH_AES_256_CCM, + SSL_kDHE, + SSL_aRSA, + SSL_AES256CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0A0 */ + { + 1, + TLS1_TXT_RSA_WITH_AES_128_CCM_8, + TLS1_CK_RSA_WITH_AES_128_CCM_8, + SSL_kRSA, + SSL_aRSA, + SSL_AES128CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0A1 */ + { + 1, + TLS1_TXT_RSA_WITH_AES_256_CCM_8, + TLS1_CK_RSA_WITH_AES_256_CCM_8, + SSL_kRSA, + SSL_aRSA, + SSL_AES256CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0A2 */ + { + 1, + TLS1_TXT_DHE_RSA_WITH_AES_128_CCM_8, + TLS1_CK_DHE_RSA_WITH_AES_128_CCM_8, + SSL_kDHE, + SSL_aRSA, + SSL_AES128CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0A3 */ + { + 1, + TLS1_TXT_DHE_RSA_WITH_AES_256_CCM_8, + TLS1_CK_DHE_RSA_WITH_AES_256_CCM_8, + SSL_kDHE, + SSL_aRSA, + SSL_AES256CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0A4 */ + { + 1, + TLS1_TXT_PSK_WITH_AES_128_CCM, + TLS1_CK_PSK_WITH_AES_128_CCM, + SSL_kPSK, + SSL_aPSK, + SSL_AES128CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0A4 */ + { + 1, + TLS1_TXT_PSK_WITH_AES_256_CCM, + TLS1_CK_PSK_WITH_AES_256_CCM, + SSL_kPSK, + SSL_aPSK, + SSL_AES256CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0A6 */ + { + 1, + TLS1_TXT_DHE_PSK_WITH_AES_128_CCM, + TLS1_CK_DHE_PSK_WITH_AES_128_CCM, + SSL_kDHEPSK, + SSL_aPSK, + SSL_AES128CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0A7 */ + { + 1, + TLS1_TXT_DHE_PSK_WITH_AES_256_CCM, + TLS1_CK_DHE_PSK_WITH_AES_256_CCM, + SSL_kDHEPSK, + SSL_aPSK, + SSL_AES256CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0A8 */ + { + 1, + TLS1_TXT_PSK_WITH_AES_128_CCM_8, + TLS1_CK_PSK_WITH_AES_128_CCM_8, + SSL_kPSK, + SSL_aPSK, + SSL_AES128CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0A9 */ + { + 1, + TLS1_TXT_PSK_WITH_AES_256_CCM_8, + TLS1_CK_PSK_WITH_AES_256_CCM_8, + SSL_kPSK, + SSL_aPSK, + SSL_AES256CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0AA */ + { + 1, + TLS1_TXT_DHE_PSK_WITH_AES_128_CCM_8, + TLS1_CK_DHE_PSK_WITH_AES_128_CCM_8, + SSL_kDHEPSK, + SSL_aPSK, + SSL_AES128CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0AB */ + { + 1, + TLS1_TXT_DHE_PSK_WITH_AES_256_CCM_8, + TLS1_CK_DHE_PSK_WITH_AES_256_CCM_8, + SSL_kDHEPSK, + SSL_aPSK, + SSL_AES256CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0AC */ + { + 1, + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM, + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES128CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0AD */ + { + 1, + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM, + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES256CCM, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + + /* Cipher C0AE */ + { + 1, + TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CCM_8, + TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CCM_8, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES128CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 128, + 128, + }, + + /* Cipher C0AF */ + { + 1, + TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CCM_8, + TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CCM_8, + SSL_kECDHE, + SSL_aECDSA, + SSL_AES256CCM8, + SSL_AEAD, + SSL_TLSV1_2, + SSL_NOT_EXP | SSL_HIGH, + SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256, + 256, + 256, + }, + /* end of list */ }; diff --git a/ssl/ssl_algs.c b/ssl/ssl_algs.c index ba9fc48..f4827fd 100644 --- a/ssl/ssl_algs.c +++ b/ssl/ssl_algs.c @@ -91,6 +91,8 @@ int SSL_library_init(void) EVP_add_cipher(EVP_aes_256_cbc()); EVP_add_cipher(EVP_aes_128_gcm()); EVP_add_cipher(EVP_aes_256_gcm()); + EVP_add_cipher(EVP_aes_128_ccm()); + EVP_add_cipher(EVP_aes_256_ccm()); EVP_add_cipher(EVP_aes_128_cbc_hmac_sha1()); EVP_add_cipher(EVP_aes_256_cbc_hmac_sha1()); EVP_add_cipher(EVP_aes_128_cbc_hmac_sha256()); diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 08a95f9..c048fc2 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -164,7 +164,11 @@ #define SSL_ENC_SEED_IDX 11 #define SSL_ENC_AES128GCM_IDX 12 #define SSL_ENC_AES256GCM_IDX 13 -#define SSL_ENC_NUM_IDX 14 +#define SSL_ENC_AES128CCM_IDX 14 +#define SSL_ENC_AES256CCM_IDX 15 +#define SSL_ENC_AES128CCM8_IDX 16 +#define SSL_ENC_AES256CCM8_IDX 17 +#define SSL_ENC_NUM_IDX 18 /* NB: make sure indices in these tables match values above */ @@ -188,7 +192,11 @@ static const ssl_cipher_table ssl_cipher_table_cipher[SSL_ENC_NUM_IDX] = { {SSL_eGOST2814789CNT, NID_gost89_cnt}, /* SSL_ENC_GOST89_IDX 10 */ {SSL_SEED, NID_seed_cbc}, /* SSL_ENC_SEED_IDX 11 */ {SSL_AES128GCM, NID_aes_128_gcm}, /* SSL_ENC_AES128GCM_IDX 12 */ - {SSL_AES256GCM, NID_aes_256_gcm} /* SSL_ENC_AES256GCM_IDX 13 */ + {SSL_AES256GCM, NID_aes_256_gcm}, /* SSL_ENC_AES256GCM_IDX 13 */ + {SSL_AES128CCM, NID_aes_128_ccm}, /* SSL_ENC_AES128CCM_IDX 14 */ + {SSL_AES256CCM, NID_aes_256_ccm}, /* SSL_ENC_AES256CCM_IDX 15 */ + {SSL_AES128CCM8, NID_aes_128_ccm}, /* SSL_ENC_AES128CCM8_IDX 16 */ + {SSL_AES256CCM8, NID_aes_256_ccm} /* SSL_ENC_AES256CCM8_IDX 17 */ }; static const EVP_CIPHER *ssl_cipher_methods[SSL_ENC_NUM_IDX] = { @@ -355,13 +363,17 @@ static const SSL_CIPHER cipher_aliases[] = { {0, SSL_TXT_IDEA, 0, 0, 0, SSL_IDEA, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_SEED, 0, 0, 0, SSL_SEED, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_eNULL, 0, 0, 0, SSL_eNULL, 0, 0, 0, 0, 0, 0}, - {0, SSL_TXT_AES128, 0, 0, 0, SSL_AES128 | SSL_AES128GCM, 0, 0, 0, 0, 0, - 0}, - {0, SSL_TXT_AES256, 0, 0, 0, SSL_AES256 | SSL_AES256GCM, 0, 0, 0, 0, 0, - 0}, + {0, SSL_TXT_AES128, 0, 0, 0, SSL_AES128 | SSL_AES128GCM | SSL_AES128CCM | SSL_AES128CCM8, 0, + 0, 0, 0, 0, 0}, + {0, SSL_TXT_AES256, 0, 0, 0, SSL_AES256 | SSL_AES256GCM | SSL_AES256CCM | SSL_AES256CCM8, 0, + 0, 0, 0, 0, 0}, {0, SSL_TXT_AES, 0, 0, 0, SSL_AES, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_AES_GCM, 0, 0, 0, SSL_AES128GCM | SSL_AES256GCM, 0, 0, 0, 0, 0, 0}, + {0, SSL_TXT_AES_CCM, 0, 0, 0, SSL_AES128CCM | SSL_AES256CCM | SSL_AES128CCM8 | SSL_AES256CCM8, 0, 0, 0, 0, + 0, 0}, + {0, SSL_TXT_AES_CCM_8, 0, 0, 0, SSL_AES128CCM8 | SSL_AES256CCM8, 0, 0, 0, 0, + 0, 0}, {0, SSL_TXT_CAMELLIA128, 0, 0, 0, SSL_CAMELLIA128, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_CAMELLIA256, 0, 0, 0, SSL_CAMELLIA256, 0, 0, 0, 0, 0, 0}, {0, SSL_TXT_CAMELLIA, 0, 0, 0, SSL_CAMELLIA128 | SSL_CAMELLIA256, 0, 0, 0, @@ -1709,6 +1721,18 @@ char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) case SSL_AES256GCM: enc = "AESGCM(256)"; break; + case SSL_AES128CCM: + enc = "AESCCM(128)"; + break; + case SSL_AES256CCM: + enc = "AESCCM(256)"; + break; + case SSL_AES128CCM8: + enc = "AESCCM8(128)"; + break; + case SSL_AES256CCM8: + enc = "AESCCM8(256)"; + break; case SSL_CAMELLIA128: enc = "Camellia(128)"; break; diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h index 63b547a..79926ff 100644 --- a/ssl/ssl_locl.h +++ b/ssl/ssl_locl.h @@ -359,8 +359,12 @@ # define SSL_SEED 0x00000800L # define SSL_AES128GCM 0x00001000L # define SSL_AES256GCM 0x00002000L +# define SSL_AES128CCM 0x00004000L +# define SSL_AES256CCM 0x00008000L +# define SSL_AES128CCM8 0x00010000L +# define SSL_AES256CCM8 0x00020000L -# define SSL_AES (SSL_AES128|SSL_AES256|SSL_AES128GCM|SSL_AES256GCM) +# define SSL_AES (SSL_AES128|SSL_AES256|SSL_AES128GCM|SSL_AES256GCM|SSL_AES128CCM|SSL_AES256CCM|SSL_AES128CCM8|SSL_AES256CCM8) # define SSL_CAMELLIA (SSL_CAMELLIA128|SSL_CAMELLIA256) /* Bits for algorithm_mac (symmetric authentication) */ diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 9942bb4..1f539aa 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -422,9 +422,11 @@ int tls1_change_cipher_state(SSL *s, int which) j = is_export ? (cl < SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher) ? cl : SSL_C_EXPORT_KEYLENGTH(s->s3->tmp.new_cipher)) : cl; /* Was j=(exp)?5:EVP_CIPHER_key_length(c); */ - /* If GCM mode only part of IV comes from PRF */ + /* If GCM/CCM mode only part of IV comes from PRF */ if (EVP_CIPHER_mode(c) == EVP_CIPH_GCM_MODE) k = EVP_GCM_TLS_FIXED_IV_LEN; + else if (EVP_CIPHER_mode(c) == EVP_CIPH_CCM_MODE) + k = EVP_CCM_TLS_FIXED_IV_LEN; else k = EVP_CIPHER_iv_length(c); if ((which == SSL3_CHANGE_CIPHER_CLIENT_WRITE) || @@ -506,6 +508,20 @@ int tls1_change_cipher_state(SSL *s, int which) SSLerr(SSL_F_TLS1_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); goto err2; } + } else if (EVP_CIPHER_mode(c) == EVP_CIPH_CCM_MODE) { + int taglen; + if (s->s3->tmp.new_cipher->algorithm_enc & (SSL_AES128CCM8|SSL_AES256CCM8)) + taglen = 8; + else + taglen = 16; + if (!EVP_CipherInit_ex(dd, c, NULL, NULL, NULL, (which & SSL3_CC_WRITE)) + || !EVP_CIPHER_CTX_ctrl(dd, EVP_CTRL_AEAD_SET_IVLEN, 12, NULL) + || !EVP_CIPHER_CTX_ctrl(dd, EVP_CTRL_AEAD_SET_TAG, taglen, NULL) + || !EVP_CIPHER_CTX_ctrl(dd, EVP_CTRL_CCM_SET_IV_FIXED, k, iv) + || !EVP_CipherInit_ex(dd, NULL, NULL, key, NULL, -1)) { + SSLerr(SSL_F_TLS1_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); + goto err2; + } } else { if (!EVP_CipherInit_ex(dd, c, NULL, key, iv, (which & SSL3_CC_WRITE))) { SSLerr(SSL_F_TLS1_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); From matt at openssl.org Fri Aug 14 16:04:07 2015 From: matt at openssl.org (Matt Caswell) Date: Fri, 14 Aug 2015 16:04:07 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439568247.100944.14469.nullmailer@dev.openssl.org> The branch master has been updated via c83eda8c22f08346d5434662643de523a469c81e (commit) from f8f5f8369d1d76fd8ec28d3d2422a47f8440f452 (commit) - Log ----------------------------------------------------------------- commit c83eda8c22f08346d5434662643de523a469c81e Author: Matt Caswell Date: Thu Aug 13 10:04:23 2015 +0100 Fix session tickets Commit 9ceb2426b0 (PACKETise ClientHello) broke session tickets by failing to detect the session ticket extension in an incoming ClientHello. This commit fixes the bug. Reviewed-by: Emilia K?sper ----------------------------------------------------------------------- Summary of changes: ssl/t1_lib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index e37411c..f004288 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -3043,6 +3043,11 @@ int tls1_process_ticket(SSL *s, PACKET *pkt, unsigned char *session_id, break; } goto end; + } else { + if (!PACKET_forward(pkt, size)) { + retv = -1; + goto end; + } } } retv = 0; From matt at openssl.org Fri Aug 14 16:11:42 2015 From: matt at openssl.org (Matt Caswell) Date: Fri, 14 Aug 2015 16:11:42 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439568702.535343.15960.nullmailer@dev.openssl.org> The branch master has been updated via 561e12bbb0a85c44d2b5501ccd430f2fb2fd63aa (commit) from c83eda8c22f08346d5434662643de523a469c81e (commit) - Log ----------------------------------------------------------------- commit 561e12bbb0a85c44d2b5501ccd430f2fb2fd63aa Author: Matt Caswell Date: Wed Aug 5 14:50:24 2015 +0100 PACKETise NewSessionTicket Process NewSessionTicket messages using the new PACKET API Reviewed-by: Emilia K?sper ----------------------------------------------------------------------- Summary of changes: ssl/s3_clnt.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index dedbfea..1394293 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -2174,10 +2174,10 @@ static int ca_dn_cmp(const X509_NAME *const *a, const X509_NAME *const *b) int ssl3_get_new_session_ticket(SSL *s) { - int ok, al, ret = 0, ticklen; + int ok, al, ret = 0; + unsigned int ticklen; long n; - const unsigned char *p; - unsigned char *d; + PACKET pkt; n = s->method->ssl_get_message(s, SSL3_ST_CR_SESSION_TICKET_A, @@ -2187,15 +2187,12 @@ int ssl3_get_new_session_ticket(SSL *s) if (!ok) return ((int)n); - if (n < 6) { - /* need at least ticket_lifetime_hint + ticket length */ - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH); + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_INTERNAL_ERROR); goto f_err; } - p = d = (unsigned char *)s->init_msg; - if (s->session->session_id_length > 0) { int i = s->session_ctx->session_cache_mode; SSL_SESSION *new_sess; @@ -2227,10 +2224,9 @@ int ssl3_get_new_session_ticket(SSL *s) s->session = new_sess; } - n2l(p, s->session->tlsext_tick_lifetime_hint); - n2s(p, ticklen); - /* ticket_lifetime_hint + ticket_length + ticket */ - if (ticklen + 6 != n) { + if (!PACKET_get_net_4(&pkt, &s->session->tlsext_tick_lifetime_hint) + || !PACKET_get_net_2(&pkt, &ticklen) + || PACKET_remaining(&pkt) != ticklen) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH); goto f_err; @@ -2242,7 +2238,11 @@ int ssl3_get_new_session_ticket(SSL *s) SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, ERR_R_MALLOC_FAILURE); goto err; } - memcpy(s->session->tlsext_tick, p, ticklen); + if (!PACKET_copy_bytes(&pkt, s->session->tlsext_tick, ticklen)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH); + goto f_err; + } s->session->tlsext_ticklen = ticklen; /* * There are two ways to detect a resumed ticket session. One is to set @@ -2255,7 +2255,7 @@ int ssl3_get_new_session_ticket(SSL *s) * elsewhere in OpenSSL. The session ID is set to the SHA256 (or SHA1 is * SHA256 is disabled) hash of the ticket. */ - EVP_Digest(p, ticklen, + EVP_Digest(s->session->tlsext_tick, ticklen, s->session->session_id, &s->session->session_id_length, EVP_sha256(), NULL); ret = 1; From matt at openssl.org Fri Aug 14 16:22:20 2015 From: matt at openssl.org (Matt Caswell) Date: Fri, 14 Aug 2015 16:22:20 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439569340.223809.17966.nullmailer@dev.openssl.org> The branch master has been updated via efcdbcbeda556876c0147dca21d51610de30dfd9 (commit) from 561e12bbb0a85c44d2b5501ccd430f2fb2fd63aa (commit) - Log ----------------------------------------------------------------- commit efcdbcbeda556876c0147dca21d51610de30dfd9 Author: Matt Caswell Date: Mon Aug 3 12:57:51 2015 +0100 PACKETise ClientKeyExchange processing Use the new PACKET code to process the CKE message Reviewed-by: Stephen Henson ----------------------------------------------------------------------- Summary of changes: ssl/s3_srvr.c | 183 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 119 insertions(+), 64 deletions(-) diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c index a015a49..8bdb082 100644 --- a/ssl/s3_srvr.c +++ b/ssl/s3_srvr.c @@ -2211,10 +2211,10 @@ int ssl3_send_certificate_request(SSL *s) int ssl3_get_client_key_exchange(SSL *s) { - int i, al, ok; + unsigned int i; + int al, ok; long n; unsigned long alg_k; - unsigned char *p; #ifndef OPENSSL_NO_RSA RSA *rsa = NULL; EVP_PKEY *pkey = NULL; @@ -2229,6 +2229,9 @@ int ssl3_get_client_key_exchange(SSL *s) EC_POINT *clnt_ecpoint = NULL; BN_CTX *bn_ctx = NULL; #endif + PACKET pkt; + unsigned char *data; + size_t remain; n = s->method->ssl_get_message(s, SSL3_ST_SR_KEY_EXCH_A, @@ -2237,7 +2240,11 @@ int ssl3_get_client_key_exchange(SSL *s) if (!ok) return ((int)n); - p = (unsigned char *)s->init_msg; + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); + goto f_err; + } alg_k = s->s3->tmp.new_cipher->algorithm_mkey; @@ -2246,13 +2253,8 @@ int ssl3_get_client_key_exchange(SSL *s) if (alg_k & SSL_PSK) { unsigned char psk[PSK_MAX_PSK_LEN]; size_t psklen; - if (n < 2) { - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH); - goto f_err; - } - n2s(p, i); - if (i + 2 > n) { + + if (!PACKET_get_net_2(&pkt, &i)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH); goto f_err; @@ -2271,14 +2273,20 @@ int ssl3_get_client_key_exchange(SSL *s) } OPENSSL_free(s->session->psk_identity); - s->session->psk_identity = BUF_strndup((char *)p, i); - + s->session->psk_identity = OPENSSL_malloc(i + 1); if (s->session->psk_identity == NULL) { al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE); goto f_err; } + if (!PACKET_copy_bytes(&pkt, (unsigned char *)s->session->psk_identity, + i)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH); + goto f_err; + } + s->session->psk_identity[i] = '\0'; psklen = s->psk_server_callback(s, s->session->psk_identity, psk, sizeof(psk)); @@ -2308,13 +2316,10 @@ int ssl3_get_client_key_exchange(SSL *s) } s->s3->tmp.psklen = psklen; - - n -= i + 2; - p += i; } if (alg_k & SSL_kPSK) { /* Identity extracted earlier: should be nothing left */ - if (n != 0) { + if (PACKET_remaining(&pkt) != 0) { al = SSL_AD_HANDSHAKE_FAILURE; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH); goto f_err; @@ -2362,17 +2367,34 @@ int ssl3_get_client_key_exchange(SSL *s) /* TLS and [incidentally] DTLS{0xFEFF} */ if (s->version > SSL3_VERSION && s->version != DTLS1_BAD_VER) { - n2s(p, i); - if (n != i + 2) { + if (!PACKET_get_net_2(&pkt, &i)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH); + goto f_err; + } + remain = PACKET_remaining(&pkt); + if (remain != i) { if (!(s->options & SSL_OP_TLS_D5_BUG)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG); goto f_err; - } else - p -= 2; - } else - n = i; + } else { + remain += 2; + if (!PACKET_back(&pkt, 2)) { + /* + * We already read these 2 bytes so this should never + * fail + */ + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto f_err; + } + } + } + } else { + remain = PACKET_remaining(&pkt); } /* @@ -2382,13 +2404,20 @@ int ssl3_get_client_key_exchange(SSL *s) * actual expected size is larger due to RSA padding, but the * bound is sufficient to be safe. */ - if (n < SSL_MAX_MASTER_KEY_LENGTH) { + + if (remain < SSL_MAX_MASTER_KEY_LENGTH) { al = SSL_AD_DECRYPT_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG); goto f_err; } + if (!PACKET_get_bytes(&pkt, &data, remain)) { + /* We already checked we had enough data so this shouldn't happen */ + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); + goto f_err; + } /* * We must not leak whether a decryption failure occurs because of * Bleichenbacher's attack on PKCS #1 v1.5 RSA padding (see RFC 2246, @@ -2401,7 +2430,7 @@ int ssl3_get_client_key_exchange(SSL *s) sizeof(rand_premaster_secret)) <= 0) goto err; decrypt_len = - RSA_private_decrypt((int)n, p, p, rsa, RSA_PKCS1_PADDING); + RSA_private_decrypt(remain, data, data, rsa, RSA_PKCS1_PADDING); ERR_clear_error(); /* @@ -2420,9 +2449,9 @@ int ssl3_get_client_key_exchange(SSL *s) * constant time and are treated like any other decryption error. */ version_good = - constant_time_eq_8(p[0], (unsigned)(s->client_version >> 8)); + constant_time_eq_8(data[0], (unsigned)(s->client_version >> 8)); version_good &= - constant_time_eq_8(p[1], (unsigned)(s->client_version & 0xff)); + constant_time_eq_8(data[1], (unsigned)(s->client_version & 0xff)); /* * The premaster secret must contain the same version number as the @@ -2436,9 +2465,9 @@ int ssl3_get_client_key_exchange(SSL *s) if (s->options & SSL_OP_TLS_ROLLBACK_BUG) { unsigned char workaround_good; workaround_good = - constant_time_eq_8(p[0], (unsigned)(s->version >> 8)); + constant_time_eq_8(data[0], (unsigned)(s->version >> 8)); workaround_good &= - constant_time_eq_8(p[1], (unsigned)(s->version & 0xff)); + constant_time_eq_8(data[1], (unsigned)(s->version & 0xff)); version_good |= workaround_good; } @@ -2455,11 +2484,12 @@ int ssl3_get_client_key_exchange(SSL *s) * it is still sufficiently large to read from. */ for (j = 0; j < sizeof(rand_premaster_secret); j++) { - p[j] = constant_time_select_8(decrypt_good, p[j], + data[j] = constant_time_select_8(decrypt_good, data[j], rand_premaster_secret[j]); } - if (!ssl_generate_master_secret(s, p, sizeof(rand_premaster_secret), 0)) { + if (!ssl_generate_master_secret(s, data, sizeof(rand_premaster_secret), + 0)) { al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto f_err; @@ -2470,9 +2500,15 @@ int ssl3_get_client_key_exchange(SSL *s) if (alg_k & (SSL_kDHE | SSL_kDHr | SSL_kDHd | SSL_kDHEPSK)) { int idx = -1; EVP_PKEY *skey = NULL; - if (n > 1) { - n2s(p, i); - } else { + size_t bookm; + unsigned char shared[(OPENSSL_DH_MAX_MODULUS_BITS + 7) / 8]; + + if (!PACKET_get_bookmark(&pkt, &bookm)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); + goto f_err; + } + if (!PACKET_get_net_2(&pkt, &i)) { if (alg_k & (SSL_kDHE | SSL_kDHEPSK)) { al = SSL_AD_HANDSHAKE_FAILURE; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, @@ -2481,14 +2517,19 @@ int ssl3_get_client_key_exchange(SSL *s) } i = 0; } - if (n && n != i + 2) { + if (PACKET_remaining(&pkt) != i) { if (!(s->options & SSL_OP_SSLEAY_080_CLIENT_DH_BUG)) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG); goto err; } else { - p -= 2; - i = (int)n; + if (!PACKET_goto_bookmark(&pkt, bookm)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto f_err; + } + i = PACKET_remaining(&pkt); } } if (alg_k & SSL_kDHr) @@ -2528,14 +2569,22 @@ int ssl3_get_client_key_exchange(SSL *s) } EVP_PKEY_free(clkey); pub = dh_clnt->pub_key; - } else - pub = BN_bin2bn(p, i, NULL); + } else { + if (!PACKET_get_bytes(&pkt, &data, i)) { + /* We already checked we have enough data */ + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto f_err; + } + pub = BN_bin2bn(data, i, NULL); + } if (pub == NULL) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_BN_LIB); goto err; } - i = DH_compute_key(p, pub, dh_srvr); + i = DH_compute_key(shared, pub, dh_srvr); if (i <= 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_DH_LIB); @@ -2550,7 +2599,7 @@ int ssl3_get_client_key_exchange(SSL *s) else BN_clear_free(pub); pub = NULL; - if (!ssl_generate_master_secret(s, p, i, 0)) { + if (!ssl_generate_master_secret(s, shared, i, 0)) { al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto f_err; @@ -2567,6 +2616,7 @@ int ssl3_get_client_key_exchange(SSL *s) const EC_KEY *tkey; const EC_GROUP *group; const BIGNUM *priv_key; + unsigned char *shared; /* initialize structures for server's ECDH key pair */ if ((srvr_ecdh = EC_KEY_new()) == NULL) { @@ -2645,21 +2695,21 @@ int ssl3_get_client_key_exchange(SSL *s) } /* Get encoded point length */ - i = *p; - p += 1; - if (n != 1 + i) { + if (!PACKET_get_1(&pkt, &i)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, + SSL_R_LENGTH_MISMATCH); + goto f_err; + } + if (!PACKET_get_bytes(&pkt, &data, i) + || PACKET_remaining(&pkt) != 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_EC_LIB); goto err; } - if (EC_POINT_oct2point(group, clnt_ecpoint, p, i, bn_ctx) == 0) { + if (EC_POINT_oct2point(group, clnt_ecpoint, data, i, bn_ctx) == 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_EC_LIB); goto err; } - /* - * p is pointing to somewhere in the buffer currently, so set it - * to the start - */ - p = (unsigned char *)s->init_buf->data; } /* Compute the shared pre-master secret */ @@ -2668,10 +2718,16 @@ int ssl3_get_client_key_exchange(SSL *s) SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_ECDH_LIB); goto err; } - i = ECDH_compute_key(p, (field_size + 7) / 8, clnt_ecpoint, srvr_ecdh, - NULL); + shared = OPENSSL_malloc((field_size + 7) / 8); + if (shared == NULL) { + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE); + goto err; + } + i = ECDH_compute_key(shared, (field_size + 7) / 8, clnt_ecpoint, + srvr_ecdh, NULL); if (i <= 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_ECDH_LIB); + OPENSSL_free(shared); goto err; } @@ -2682,7 +2738,7 @@ int ssl3_get_client_key_exchange(SSL *s) EC_KEY_free(s->s3->tmp.ecdh); s->s3->tmp.ecdh = NULL; - if (!ssl_generate_master_secret(s, p, i, 0)) { + if (!ssl_generate_master_secret(s, shared, i, 1)) { al = SSL_AD_INTERNAL_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto f_err; @@ -2692,17 +2748,13 @@ int ssl3_get_client_key_exchange(SSL *s) #endif #ifndef OPENSSL_NO_SRP if (alg_k & SSL_kSRP) { - int param_len; - - n2s(p, i); - param_len = i + 2; - if (param_len > n) { + if (!PACKET_get_net_2(&pkt, &i) + || !PACKET_get_bytes(&pkt, &data, i)) { al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, - SSL_R_BAD_SRP_A_LENGTH); + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_BAD_SRP_A_LENGTH); goto f_err; } - if ((s->srp_ctx.A = BN_bin2bn(p, i, NULL)) == NULL) { + if ((s->srp_ctx.A = BN_bin2bn(data, i, NULL)) == NULL) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_BN_LIB); goto err; } @@ -2724,8 +2776,6 @@ int ssl3_get_client_key_exchange(SSL *s) SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); goto err; } - - p += i; } else #endif /* OPENSSL_NO_SRP */ if (alg_k & SSL_kGOST) { @@ -2757,15 +2807,20 @@ int ssl3_get_client_key_exchange(SSL *s) ERR_clear_error(); } /* Decrypt session key */ + if (!PACKET_get_bytes(&pkt, &data, n)) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); + goto f_err; + } if (ASN1_get_object - ((const unsigned char **)&p, &Tlen, &Ttag, &Tclass, + ((const unsigned char **)&data, &Tlen, &Ttag, &Tclass, n) != V_ASN1_CONSTRUCTED || Ttag != V_ASN1_SEQUENCE || Tclass != V_ASN1_UNIVERSAL) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_DECRYPTION_FAILED); goto gerr; } - start = p; + start = data; inlen = Tlen; if (EVP_PKEY_decrypt (pkey_ctx, premaster_secret, &outlen, start, inlen) <= 0) { From matt at openssl.org Fri Aug 14 16:31:46 2015 From: matt at openssl.org (Matt Caswell) Date: Fri, 14 Aug 2015 16:31:46 +0000 Subject: [openssl-commits] [openssl] master update Message-ID: <1439569906.456767.19667.nullmailer@dev.openssl.org> The branch master has been updated via ac1123320145f731fb04a4cc3df1fbd9c3d5e513 (commit) from efcdbcbeda556876c0147dca21d51610de30dfd9 (commit) - Log ----------------------------------------------------------------- commit ac1123320145f731fb04a4cc3df1fbd9c3d5e513 Author: Matt Caswell Date: Tue Aug 4 22:12:53 2015 +0100 PACKETise CertificateRequest Process CertificateRequest messages using the PACKET API Reviewed-by: Emilia K?sper ----------------------------------------------------------------------- Summary of changes: ssl/s3_clnt.c | 66 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 1394293..e7bbfc9 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -2011,12 +2011,13 @@ int ssl3_get_key_exchange(SSL *s) int ssl3_get_certificate_request(SSL *s) { int ok, ret = 0; - unsigned long n, nc, l; - unsigned int llen, ctype_num, i; + unsigned long n; + unsigned int list_len, ctype_num, i, name_len; X509_NAME *xn = NULL; - const unsigned char *p, *q; - unsigned char *d; + unsigned char *data; + unsigned char *namestart, *namebytes; STACK_OF(X509_NAME) *ca_sk = NULL; + PACKET pkt; n = s->method->ssl_get_message(s, SSL3_ST_CR_CERT_REQ_A, @@ -2055,7 +2056,11 @@ int ssl3_get_certificate_request(SSL *s) } } - p = d = (unsigned char *)s->init_msg; + if (!PACKET_buf_init(&pkt, s->init_msg, n)) { + ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_INTERNAL_ERROR); + goto err; + } if ((ca_sk = sk_X509_NAME_new(ca_dn_cmp)) == NULL) { SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_MALLOC_FAILURE); @@ -2063,7 +2068,12 @@ int ssl3_get_certificate_request(SSL *s) } /* get the certificate types */ - ctype_num = *(p++); + if (!PACKET_get_1(&pkt, &ctype_num) + || !PACKET_get_bytes(&pkt, &data, ctype_num)) { + ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_LENGTH_MISMATCH); + goto err; + } OPENSSL_free(s->cert->ctypes); s->cert->ctypes = NULL; if (ctype_num > SSL3_CT_NUMBER) { @@ -2073,31 +2083,27 @@ int ssl3_get_certificate_request(SSL *s) SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_MALLOC_FAILURE); goto err; } - memcpy(s->cert->ctypes, p, ctype_num); + memcpy(s->cert->ctypes, data, ctype_num); s->cert->ctype_num = (size_t)ctype_num; ctype_num = SSL3_CT_NUMBER; } for (i = 0; i < ctype_num; i++) - s->s3->tmp.ctype[i] = p[i]; - p += p[-1]; + s->s3->tmp.ctype[i] = data[i]; + if (SSL_USE_SIGALGS(s)) { - n2s(p, llen); - /* - * Check we have enough room for signature algorithms and following - * length value. - */ - if ((unsigned long)(p - d + llen + 2) > n) { + if (!PACKET_get_net_2(&pkt, &list_len) + || !PACKET_get_bytes(&pkt, &data, list_len)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, - SSL_R_DATA_LENGTH_TOO_LONG); + SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_LENGTH_MISMATCH); goto err; } + /* Clear certificate digests and validity flags */ for (i = 0; i < SSL_PKEY_NUM; i++) { s->s3->tmp.md[i] = NULL; s->s3->tmp.valid_flags[i] = 0; } - if ((llen & 1) || !tls1_save_sigalgs(s, p, llen)) { + if ((list_len & 1) || !tls1_save_sigalgs(s, data, list_len)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_SIGNATURE_ALGORITHMS_ERROR); @@ -2108,35 +2114,34 @@ int ssl3_get_certificate_request(SSL *s) SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_MALLOC_FAILURE); goto err; } - p += llen; } /* get the CA RDNs */ - n2s(p, llen); - - if ((unsigned long)(p - d + llen) != n) { + if (!PACKET_get_net_2(&pkt, &list_len) + || PACKET_remaining(&pkt) != list_len) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_LENGTH_MISMATCH); goto err; } - for (nc = 0; nc < llen;) { - n2s(p, l); - if ((l + nc + 2) > llen) { + while (PACKET_remaining(&pkt)) { + if (!PACKET_get_net_2(&pkt, &name_len) + || !PACKET_get_bytes(&pkt, &namebytes, name_len)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_CA_DN_TOO_LONG); + SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_LENGTH_MISMATCH); goto err; } - q = p; + namestart = namebytes; - if ((xn = d2i_X509_NAME(NULL, &q, l)) == NULL) { + if ((xn = d2i_X509_NAME(NULL, (const unsigned char **)&namebytes, + name_len)) == NULL) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_ASN1_LIB); goto err; } - if (q != (p + l)) { + if (namebytes != (namestart + name_len)) { ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_CA_DN_LENGTH_MISMATCH); @@ -2146,9 +2151,6 @@ int ssl3_get_certificate_request(SSL *s) SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_MALLOC_FAILURE); goto err; } - - p += l; - nc += l + 2; } /* we should setup a certificate to return.... */ From rsalz at openssl.org Sat Aug 15 17:08:33 2015 From: rsalz at openssl.org (Rich Salz) Date: Sat, 15 Aug 2015 17:08:33 +0000 Subject: [openssl-commits] [web] master update Message-ID: <1439658513.299096.14418.nullmailer@dev.openssl.org> The branch master has been updated via e42ef50e5b67be76e0a2e0b14d3ec85fdc88d7ec (commit) from 7054f23464d7f9062cd62034f4e91e346ddfd4f6 (commit) - Log ----------------------------------------------------------------- commit e42ef50e5b67be76e0a2e0b14d3ec85fdc88d7ec Author: Rich Salz Date: Sat Aug 15 13:07:34 2015 -0400 FLIP THE SWITCH First commit of the new website. Things probably broke. Now to start fixing. ----------------------------------------------------------------------- Summary of changes: .gitignore | 31 +- .htaccess | 3 - .wmkrc | 1 - .wmlrc | 11 - .wmlsnb | 13 - Makefile | 121 +- README | 12 - about/.wmlrc | 10 - about/.wmlsnb | 16 - about/binaries.wml | 36 - about/contacts.wml | 102 -- about/credits.wml | 53 - about/index.wml | 106 -- about/openssl-contact.wml | 22 - about/releasestrat.wml | 67 - about/roadmap.wml | 364 ----- about/secpolicy.wml | 167 --- bin/mk-changelog | 48 + run-faq.pl => bin/mk-faq | 96 +- bin/mk-filelist | 52 + bin/mk-sitemap | 40 + bin/vulnerabilities.xsl | 141 ++ community/binaries.html | 67 + community/contacts.html | 107 ++ community/index.html | 91 ++ community/mailinglists.html | 100 ++ community/sidebar.inc | 32 + community/team.html | 174 +++ community/thanks.html | 75 + docs/.gitignore | 3 - docs/.wmlrc | 10 - docs/.wmlsnb | 15 - docs/HOWTO/.gitignore | 1 - docs/faq.html | 31 + docs/fips.html | 65 + docs/fips/SecurityPolicy-1.1.1.pdf | Bin 0 -> 1395381 bytes docs/fips/SecurityPolicy-1.1.2.pdf | Bin 0 -> 429420 bytes docs/fips/SecurityPolicy-1.2.2.pdf | Bin 0 -> 645167 bytes docs/fips/SecurityPolicy-1.2.3.pdf | Bin 0 -> 399521 bytes docs/fips/SecurityPolicy-1.2.4.pdf | Bin 0 -> 399888 bytes docs/fips/SecurityPolicy-1.2.pdf | Bin 0 -> 860211 bytes docs/fips/SecurityPolicy-2.0.1.pdf | Bin 0 -> 453385 bytes docs/fips/SecurityPolicy-2.0.2.pdf | Bin 0 -> 450201 bytes docs/fips/SecurityPolicy-2.0.3.pdf | Bin 0 -> 462896 bytes docs/fips/SecurityPolicy-2.0.4.pdf | Bin 0 -> 464520 bytes docs/fips/SecurityPolicy-2.0.5.pdf | Bin 0 -> 467374 bytes docs/fips/SecurityPolicy-2.0.6.pdf | Bin 0 -> 509654 bytes docs/fips/SecurityPolicy-2.0.7.pdf | Bin 0 -> 517313 bytes docs/fips/SecurityPolicy-2.0.8.pdf | Bin 0 -> 520606 bytes docs/fips/SecurityPolicy-2.0.9.odt | Bin 0 -> 812096 bytes docs/fips/SecurityPolicy-2.0.9.pdf | Bin 0 -> 525392 bytes docs/fips/SecurityPolicy-2.0.pdf | Bin 0 -> 525392 bytes docs/fips/UserGuide-1.1.1.pdf | Bin 0 -> 681420 bytes docs/fips/UserGuide-1.2.pdf | Bin 0 -> 925694 bytes docs/fips/UserGuide-2.0.pdf | Bin 0 -> 1842937 bytes docs/fips/UserGuide.pdf | Bin 0 -> 223576 bytes docs/fips/fips-2.0-tv.tar.gz | Bin 0 -> 82787660 bytes docs/fips/fipsnotes.wml | 115 -- docs/fips/fipsvalidation.wml | 164 -- docs/fips/incore.gz | Bin 0 -> 1936 bytes docs/fips/index.wml | 24 - docs/fips/privatelabel.html | 133 ++ docs/fips/privatelabel.wml | 98 -- docs/fips/rsp.HP-UX.2005-07-01.tar.gz | Bin 0 -> 5660011 bytes docs/fips/rsp.SuSE.2005-06-30.tar.gz | Bin 0 -> 5699128 bytes docs/fips/rsp.SuSE.2005-07-01.tar.gz | Bin 0 -> 5700115 bytes ...-09.zip => testvectors-linux-2007-10-10.tar.gz} | Bin 9112982 -> 8947798 bytes docs/fips/testvectors.HP-UX.tar.gz | Bin 0 -> 4149860 bytes docs/fips/testvectors.SuSE.tar.gz | Bin 0 -> 4249118 bytes docs/fipsnotes.html | 133 ++ docs/fipsvalidation.html | 121 ++ docs/index.html | 51 + docs/index.wml | 54 - docs/sidebar.inc | 15 + images/page-corner-bl.gif | Bin 143 -> 0 bytes images/page-corner-br.gif | Bin 144 -> 0 bytes images/page-corner-tr.gif | Bin 146 -> 0 bytes images/page-head-bl.jpg | Bin 653 -> 0 bytes images/page-head-bm.jpg | Bin 608 -> 0 bytes images/page-head-tl.jpg | Bin 2991 -> 0 bytes images/page-head-tm.jpg | Bin 6546 -> 0 bytes images/page-navbar-ab-n.jpg | Bin 887 -> 0 bytes images/page-navbar-ab-s.jpg | Bin 1035 -> 0 bytes images/page-navbar-bot.jpg | Bin 642 -> 0 bytes images/page-navbar-do-n.jpg | Bin 1138 -> 0 bytes images/page-navbar-do-s.jpg | Bin 1313 -> 0 bytes images/page-navbar-fq-n.jpg | Bin 1242 -> 0 bytes images/page-navbar-fq-s.jpg | Bin 1336 -> 0 bytes images/page-navbar-ne-n.jpg | Bin 865 -> 0 bytes images/page-navbar-ne-s.jpg | Bin 993 -> 0 bytes images/page-navbar-re-n.jpg | Bin 965 -> 0 bytes images/page-navbar-re-s.jpg | Bin 1135 -> 0 bytes images/page-navbar-se-n.jpg | Bin 1571 -> 0 bytes images/page-navbar-se-s.jpg | Bin 1650 -> 0 bytes images/page-navbar-so-n.jpg | Bin 934 -> 0 bytes images/page-navbar-so-s.jpg | Bin 1076 -> 0 bytes images/page-navbar-su-n.jpg | Bin 1002 -> 0 bytes images/page-navbar-su-s.jpg | Bin 1165 -> 0 bytes images/page-navbar-ti-n.jpg | Bin 810 -> 0 bytes images/page-navbar-ti-s.jpg | Bin 931 -> 0 bytes images/page-navbar-top.jpg | Bin 622 -> 0 bytes {images => img}/DHS-logo-med.jpg | Bin {images => img}/acano-logo.jpg | Bin {images => img}/akamai-logo-med.png | Bin {images => img}/cerberus-logo-med.jpg | Bin {images => img}/cii-logo-med.png | Bin {images => img}/citrix-logo-med.jpg | Bin {images => img}/globalsign-logo-med.jpg | Bin {images => img}/huawei-logo-med.jpg | Bin {images => img}/innominate-logo-med.jpg | Bin {images => img}/lf-logo-med.png | Bin {images => img}/milton-logo-med.jpg | Bin {images => img}/nokia-logo-med.jpg | Bin {images => img}/opengear-logo-med.jpg | Bin {images => img}/oracle-logo-med.jpg | Bin {images => img}/pkware-logo-med.jpg | Bin {images => img}/psw-logo-med.jpg | Bin {images => img}/psw-logo.gif | Bin {images => img}/qualsys-logo-med.jpg | Bin {images => img}/quintessence-logo-med.jpg | Bin {images => img}/smartisan-logo-med.png | Bin support/UnionPay.jpg => img/unionpay.jpg | Bin img/up.gif | Bin 0 -> 76 bytes inc/README | 1 + inc/banner.inc | 33 + inc/footer.inc | 7 + inc/head.inc | 25 + inc/legalities.inc | 21 + inc/libs/jquery.min.js | 5 + inc/modernizr-2.0.js | 5 + inc/octopress.js | 78 + inc/screen.css | 1569 ++++++++++++++++++++ index.html | 56 + index.wml | 38 - news/.wmlrc | 10 - news/.wmlsnb | 12 - news/announce-098.txt | 43 - news/announce-100.txt | 44 - news/announce-beta.txt | 62 - news/announce.txt | 44 - news/changelog.html | 36 + news/changelog.wml | 15 - news/index.html | 46 + news/index.wml | 14 - news/internet.wml | 46 - news/news.wml | 22 - news/newsflash.txt | 445 +++--- news/newslog.html | 33 + news/notice_20120425.txt | 14 - news/openssl-0.9.8-notes.wml | 4 - news/openssl-1.0.0-notes.wml | 4 - news/openssl-1.0.1-notes.wml | 5 - news/openssl-1.0.2-notes.wml | 4 - news/openssl-notes.wml | 20 - news/openssl-old-notes.wml | 25 - news/patch-CAN-2005-2969.txt | 13 - news/patch-CVE-2006-4339.txt | 53 - news/patch-CVE-2007-3108.txt | 126 -- news/patch-CVE-2007-5502-1.txt | 20 - news/patch-CVE-2007-5502-2.txt | 29 - news/patch_20020730_0_9_6d.txt | 518 ------- news/patch_20020730_0_9_7.txt | 665 --------- news/pgpkey.html | 37 + news/{secadv_20020730.txt => secadv/20020730.txt} | 0 news/{secadv_20030219.txt => secadv/20030219.txt} | 0 news/{secadv_20030317.txt => secadv/20030317.txt} | 0 news/{secadv_20030319.txt => secadv/20030319.txt} | 0 news/{secadv_20030930.txt => secadv/20030930.txt} | 0 news/{secadv_20031104.txt => secadv/20031104.txt} | 0 news/{secadv_20040317.txt => secadv/20040317.txt} | 0 news/{secadv_20051011.txt => secadv/20051011.txt} | 0 news/{secadv_20060905.txt => secadv/20060905.txt} | 0 news/{secadv_20060928.txt => secadv/20060928.txt} | 0 news/{secadv_20071012.txt => secadv/20071012.txt} | 0 news/{secadv_20071129.txt => secadv/20071129.txt} | 0 news/{secadv_20080528.txt => secadv/20080528.txt} | 0 news/{secadv_20090107.txt => secadv/20090107.txt} | 0 news/{secadv_20090325.txt => secadv/20090325.txt} | 0 news/{secadv_20091111.txt => secadv/20091111.txt} | 0 news/{secadv_20100324.txt => secadv/20100324.txt} | 0 news/{secadv_20100601.txt => secadv/20100601.txt} | 0 .../20101116-2.txt} | 0 news/{secadv_20101116.txt => secadv/20101116.txt} | 0 news/{secadv_20101202.txt => secadv/20101202.txt} | 0 news/{secadv_20110208.txt => secadv/20110208.txt} | 0 news/{secadv_20110906.txt => secadv/20110906.txt} | 0 news/{secadv_20120104.txt => secadv/20120104.txt} | 0 news/{secadv_20120118.txt => secadv/20120118.txt} | 0 news/{secadv_20120312.txt => secadv/20120312.txt} | 0 news/{secadv_20120419.txt => secadv/20120419.txt} | 0 news/{secadv_20120424.txt => secadv/20120424.txt} | 0 news/{secadv_20120510.txt => secadv/20120510.txt} | 0 news/{secadv_20130204.txt => secadv/20130204.txt} | 0 news/{secadv_20130205.txt => secadv/20130205.txt} | 0 news/{secadv_20140407.txt => secadv/20140407.txt} | 0 news/{secadv_20140605.txt => secadv/20140605.txt} | 0 news/{secadv_20140806.txt => secadv/20140806.txt} | 0 news/{secadv_20141015.txt => secadv/20141015.txt} | 0 news/{secadv_20150108.txt => secadv/20150108.txt} | 0 news/{secadv_20150319.txt => secadv/20150319.txt} | 0 news/{secadv_20150611.txt => secadv/20150611.txt} | 0 news/{secadv_20150709.txt => secadv/20150709.txt} | 0 news/{secadv_hack.txt => secadv/hack.txt} | 0 news/{secadv_prng.txt => secadv/prng.txt} | 0 news/sidebar.inc | 18 + news/state.wml | 31 - news/vulnerabilities.xml | 196 +-- news/vulnerabilities.xsl | 129 -- news/vulnerabilitiesdates.xsl | 54 - openssl.wml | 603 -------- {about => policies}/buglist.txt | 0 policies/cla.html | 80 + policies/codingstyle.html | 40 + {about => policies}/codingstyle.txt | 0 policies/index.html | 65 + {licenses => policies}/openssl_ccla.pdf | Bin {licenses => policies}/openssl_icla.pdf | Bin policies/releasestrat.html | 106 ++ policies/roadmap.html | 421 ++++++ policies/secpolicy.html | 201 +++ policies/sidebar.inc | 24 + {about => policies}/ticket-activity.png | Bin run-changelog.pl | 15 - run-fundingfaq.pl | 97 -- sidebar.inc | 31 + source/.gitignore | 7 - source/.wmlrc | 10 - source/.wmlsnb | 12 - source/gitrepo.html | 76 + source/index.current | 2 - source/index.html | 69 + source/index.wml | 34 - source/license.html | 38 + source/license.wml | 12 - source/mirror.html | 74 + source/mirror.wml | 20 - source/old/0.9.x/index.html | 31 + source/old/0.9.x/index.wml | 16 - source/old/1.0.0/index.html | 31 + source/old/1.0.0/index.wml | 16 - source/old/1.0.1/index.html | 31 + source/old/1.0.1/index.wml | 16 - source/old/1.0.2/index.html | 31 + source/old/1.0.2/index.wml | 16 - source/old/fips/index.html | 31 + source/old/fips/index.wml | 16 - source/old/index.html | 37 + source/old/index.wml | 17 - source/repos.wml | 87 -- source/sidebar.inc | 18 + support/.wmlrc | 10 - support/.wmlsnb | 14 - support/acknowledgments.wml | 192 --- support/acks.html | 75 + support/community.wml | 91 -- support/consulting.wml | 68 - support/contracts.html | 168 +++ support/{donations-cn.wml => donations-cn.html} | 2 +- support/donations.html | 88 ++ support/donations.wml | 106 -- support/faq.wml | 8 - support/funding/contract.wml | 37 - support/funding/support-basic.wml | 22 - support/funding/support-contact.wml | 19 - support/funding/support-definitions.wml | 24 - support/funding/support-faq.txt | 229 --- support/funding/support-faq.wml | 7 - support/funding/support-incident.wml | 10 - support/funding/support-premium.wml | 30 - support/funding/support-vendor.wml | 24 - support/funding/wishlist.wml | 20 - support/index.html | 45 + support/index.wml | 28 - support/majordomo.wml | 8 - support/other.wml | 36 - support/rt.wml | 55 - support/sidebar.inc | 18 + template-file.html | 31 + 278 files changed, 5785 insertions(+), 5977 deletions(-) delete mode 100644 .wmkrc delete mode 100644 .wmlrc delete mode 100644 .wmlsnb delete mode 100644 README delete mode 100644 about/.wmlrc delete mode 100644 about/.wmlsnb delete mode 100644 about/binaries.wml delete mode 100644 about/contacts.wml delete mode 100644 about/credits.wml delete mode 100644 about/index.wml delete mode 100644 about/openssl-contact.wml delete mode 100644 about/releasestrat.wml delete mode 100644 about/roadmap.wml delete mode 100644 about/secpolicy.wml create mode 100755 bin/mk-changelog rename run-faq.pl => bin/mk-faq (52%) create mode 100755 bin/mk-filelist create mode 100755 bin/mk-sitemap create mode 100644 bin/vulnerabilities.xsl create mode 100644 community/binaries.html create mode 100644 community/contacts.html create mode 100644 community/index.html create mode 100644 community/mailinglists.html create mode 100644 community/sidebar.inc create mode 100644 community/team.html create mode 100644 community/thanks.html delete mode 100644 docs/.gitignore delete mode 100644 docs/.wmlrc delete mode 100644 docs/.wmlsnb delete mode 100644 docs/HOWTO/.gitignore create mode 100644 docs/faq.html create mode 100644 docs/fips.html create mode 100644 docs/fips/SecurityPolicy-1.1.1.pdf create mode 100644 docs/fips/SecurityPolicy-1.1.2.pdf create mode 100644 docs/fips/SecurityPolicy-1.2.2.pdf create mode 100644 docs/fips/SecurityPolicy-1.2.3.pdf create mode 100644 docs/fips/SecurityPolicy-1.2.4.pdf create mode 100644 docs/fips/SecurityPolicy-1.2.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.1.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.2.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.3.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.4.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.5.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.6.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.7.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.8.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.9.odt create mode 100644 docs/fips/SecurityPolicy-2.0.9.pdf create mode 100644 docs/fips/SecurityPolicy-2.0.pdf create mode 100644 docs/fips/UserGuide-1.1.1.pdf create mode 100644 docs/fips/UserGuide-1.2.pdf create mode 100644 docs/fips/UserGuide-2.0.pdf create mode 100644 docs/fips/UserGuide.pdf create mode 100644 docs/fips/fips-2.0-tv.tar.gz delete mode 100644 docs/fips/fipsnotes.wml delete mode 100644 docs/fips/fipsvalidation.wml create mode 100644 docs/fips/incore.gz delete mode 100644 docs/fips/index.wml create mode 100644 docs/fips/privatelabel.html delete mode 100644 docs/fips/privatelabel.wml create mode 100644 docs/fips/rsp.HP-UX.2005-07-01.tar.gz create mode 100644 docs/fips/rsp.SuSE.2005-06-30.tar.gz create mode 100644 docs/fips/rsp.SuSE.2005-07-01.tar.gz copy docs/fips/{testvectors-XP-2007-10-09.zip => testvectors-linux-2007-10-10.tar.gz} (52%) create mode 100644 docs/fips/testvectors.HP-UX.tar.gz create mode 100644 docs/fips/testvectors.SuSE.tar.gz create mode 100644 docs/fipsnotes.html create mode 100644 docs/fipsvalidation.html create mode 100644 docs/index.html delete mode 100644 docs/index.wml create mode 100644 docs/sidebar.inc delete mode 100644 images/page-corner-bl.gif delete mode 100644 images/page-corner-br.gif delete mode 100644 images/page-corner-tr.gif delete mode 100644 images/page-head-bl.jpg delete mode 100644 images/page-head-bm.jpg delete mode 100644 images/page-head-tl.jpg delete mode 100644 images/page-head-tm.jpg delete mode 100644 images/page-navbar-ab-n.jpg delete mode 100644 images/page-navbar-ab-s.jpg delete mode 100644 images/page-navbar-bot.jpg delete mode 100644 images/page-navbar-do-n.jpg delete mode 100644 images/page-navbar-do-s.jpg delete mode 100755 images/page-navbar-fq-n.jpg delete mode 100755 images/page-navbar-fq-s.jpg delete mode 100644 images/page-navbar-ne-n.jpg delete mode 100644 images/page-navbar-ne-s.jpg delete mode 100644 images/page-navbar-re-n.jpg delete mode 100644 images/page-navbar-re-s.jpg delete mode 100644 images/page-navbar-se-n.jpg delete mode 100644 images/page-navbar-se-s.jpg delete mode 100644 images/page-navbar-so-n.jpg delete mode 100644 images/page-navbar-so-s.jpg delete mode 100644 images/page-navbar-su-n.jpg delete mode 100644 images/page-navbar-su-s.jpg delete mode 100644 images/page-navbar-ti-n.jpg delete mode 100644 images/page-navbar-ti-s.jpg delete mode 100644 images/page-navbar-top.jpg rename {images => img}/DHS-logo-med.jpg (100%) rename {images => img}/acano-logo.jpg (100%) rename {images => img}/akamai-logo-med.png (100%) rename {images => img}/cerberus-logo-med.jpg (100%) rename {images => img}/cii-logo-med.png (100%) rename {images => img}/citrix-logo-med.jpg (100%) rename {images => img}/globalsign-logo-med.jpg (100%) rename {images => img}/huawei-logo-med.jpg (100%) rename {images => img}/innominate-logo-med.jpg (100%) rename {images => img}/lf-logo-med.png (100%) rename {images => img}/milton-logo-med.jpg (100%) rename {images => img}/nokia-logo-med.jpg (100%) rename {images => img}/opengear-logo-med.jpg (100%) rename {images => img}/oracle-logo-med.jpg (100%) rename {images => img}/pkware-logo-med.jpg (100%) rename {images => img}/psw-logo-med.jpg (100%) rename {images => img}/psw-logo.gif (100%) rename {images => img}/qualsys-logo-med.jpg (100%) rename {images => img}/quintessence-logo-med.jpg (100%) rename {images => img}/smartisan-logo-med.png (100%) rename support/UnionPay.jpg => img/unionpay.jpg (100%) create mode 100644 img/up.gif create mode 100644 inc/README create mode 100644 inc/banner.inc create mode 100644 inc/footer.inc create mode 100644 inc/head.inc create mode 100644 inc/legalities.inc create mode 100644 inc/libs/jquery.min.js create mode 100644 inc/modernizr-2.0.js create mode 100644 inc/octopress.js create mode 100644 inc/screen.css create mode 100644 index.html delete mode 100644 index.wml delete mode 100644 news/.wmlrc delete mode 100644 news/.wmlsnb delete mode 100644 news/announce-098.txt delete mode 100644 news/announce-100.txt delete mode 100644 news/announce-beta.txt delete mode 100644 news/announce.txt create mode 100644 news/changelog.html delete mode 100644 news/changelog.wml create mode 100644 news/index.html delete mode 100644 news/index.wml delete mode 100644 news/internet.wml delete mode 100644 news/news.wml create mode 100644 news/newslog.html delete mode 100644 news/notice_20120425.txt delete mode 100644 news/openssl-0.9.8-notes.wml delete mode 100644 news/openssl-1.0.0-notes.wml delete mode 100644 news/openssl-1.0.1-notes.wml delete mode 100644 news/openssl-1.0.2-notes.wml delete mode 100644 news/openssl-notes.wml delete mode 100644 news/openssl-old-notes.wml delete mode 100644 news/patch-CAN-2005-2969.txt delete mode 100644 news/patch-CVE-2006-4339.txt delete mode 100644 news/patch-CVE-2007-3108.txt delete mode 100644 news/patch-CVE-2007-5502-1.txt delete mode 100644 news/patch-CVE-2007-5502-2.txt delete mode 100644 news/patch_20020730_0_9_6d.txt delete mode 100644 news/patch_20020730_0_9_7.txt create mode 100644 news/pgpkey.html rename news/{secadv_20020730.txt => secadv/20020730.txt} (100%) rename news/{secadv_20030219.txt => secadv/20030219.txt} (100%) rename news/{secadv_20030317.txt => secadv/20030317.txt} (100%) rename news/{secadv_20030319.txt => secadv/20030319.txt} (100%) rename news/{secadv_20030930.txt => secadv/20030930.txt} (100%) rename news/{secadv_20031104.txt => secadv/20031104.txt} (100%) rename news/{secadv_20040317.txt => secadv/20040317.txt} (100%) rename news/{secadv_20051011.txt => secadv/20051011.txt} (100%) rename news/{secadv_20060905.txt => secadv/20060905.txt} (100%) rename news/{secadv_20060928.txt => secadv/20060928.txt} (100%) rename news/{secadv_20071012.txt => secadv/20071012.txt} (100%) rename news/{secadv_20071129.txt => secadv/20071129.txt} (100%) rename news/{secadv_20080528.txt => secadv/20080528.txt} (100%) rename news/{secadv_20090107.txt => secadv/20090107.txt} (100%) rename news/{secadv_20090325.txt => secadv/20090325.txt} (100%) rename news/{secadv_20091111.txt => secadv/20091111.txt} (100%) rename news/{secadv_20100324.txt => secadv/20100324.txt} (100%) rename news/{secadv_20100601.txt => secadv/20100601.txt} (100%) rename news/{secadv_20101116-2.txt => secadv/20101116-2.txt} (100%) rename news/{secadv_20101116.txt => secadv/20101116.txt} (100%) rename news/{secadv_20101202.txt => secadv/20101202.txt} (100%) rename news/{secadv_20110208.txt => secadv/20110208.txt} (100%) rename news/{secadv_20110906.txt => secadv/20110906.txt} (100%) rename news/{secadv_20120104.txt => secadv/20120104.txt} (100%) rename news/{secadv_20120118.txt => secadv/20120118.txt} (100%) rename news/{secadv_20120312.txt => secadv/20120312.txt} (100%) rename news/{secadv_20120419.txt => secadv/20120419.txt} (100%) rename news/{secadv_20120424.txt => secadv/20120424.txt} (100%) rename news/{secadv_20120510.txt => secadv/20120510.txt} (100%) rename news/{secadv_20130204.txt => secadv/20130204.txt} (100%) rename news/{secadv_20130205.txt => secadv/20130205.txt} (100%) rename news/{secadv_20140407.txt => secadv/20140407.txt} (100%) rename news/{secadv_20140605.txt => secadv/20140605.txt} (100%) rename news/{secadv_20140806.txt => secadv/20140806.txt} (100%) rename news/{secadv_20141015.txt => secadv/20141015.txt} (100%) rename news/{secadv_20150108.txt => secadv/20150108.txt} (100%) rename news/{secadv_20150319.txt => secadv/20150319.txt} (100%) rename news/{secadv_20150611.txt => secadv/20150611.txt} (100%) rename news/{secadv_20150709.txt => secadv/20150709.txt} (100%) rename news/{secadv_hack.txt => secadv/hack.txt} (100%) rename news/{secadv_prng.txt => secadv/prng.txt} (100%) create mode 100644 news/sidebar.inc delete mode 100644 news/state.wml delete mode 100644 news/vulnerabilities.xsl delete mode 100644 news/vulnerabilitiesdates.xsl delete mode 100644 openssl.wml rename {about => policies}/buglist.txt (100%) create mode 100644 policies/cla.html create mode 100644 policies/codingstyle.html rename {about => policies}/codingstyle.txt (100%) create mode 100644 policies/index.html copy {licenses => policies}/openssl_ccla.pdf (100%) copy {licenses => policies}/openssl_icla.pdf (100%) create mode 100644 policies/releasestrat.html create mode 100644 policies/roadmap.html create mode 100644 policies/secpolicy.html create mode 100644 policies/sidebar.inc rename {about => policies}/ticket-activity.png (100%) delete mode 100644 run-changelog.pl delete mode 100755 run-fundingfaq.pl create mode 100644 sidebar.inc delete mode 100644 source/.gitignore delete mode 100644 source/.wmlrc delete mode 100644 source/.wmlsnb create mode 100644 source/gitrepo.html delete mode 100644 source/index.current create mode 100644 source/index.html delete mode 100644 source/index.wml create mode 100644 source/license.html delete mode 100644 source/license.wml create mode 100644 source/mirror.html delete mode 100644 source/mirror.wml create mode 100644 source/old/0.9.x/index.html delete mode 100644 source/old/0.9.x/index.wml create mode 100644 source/old/1.0.0/index.html delete mode 100644 source/old/1.0.0/index.wml create mode 100644 source/old/1.0.1/index.html delete mode 100644 source/old/1.0.1/index.wml create mode 100644 source/old/1.0.2/index.html delete mode 100644 source/old/1.0.2/index.wml create mode 100644 source/old/fips/index.html delete mode 100644 source/old/fips/index.wml create mode 100644 source/old/index.html delete mode 100644 source/old/index.wml delete mode 100644 source/repos.wml create mode 100644 source/sidebar.inc delete mode 100644 support/.wmlrc delete mode 100644 support/.wmlsnb delete mode 100644 support/acknowledgments.wml create mode 100644 support/acks.html delete mode 100644 support/community.wml delete mode 100644 support/consulting.wml create mode 100644 support/contracts.html rename support/{donations-cn.wml => donations-cn.html} (98%) create mode 100644 support/donations.html delete mode 100644 support/donations.wml delete mode 100644 support/faq.wml delete mode 100644 support/funding/contract.wml delete mode 100644 support/funding/support-basic.wml delete mode 100644 support/funding/support-contact.wml delete mode 100644 support/funding/support-definitions.wml delete mode 100644 support/funding/support-faq.txt delete mode 100644 support/funding/support-faq.wml delete mode 100644 support/funding/support-incident.wml delete mode 100644 support/funding/support-premium.wml delete mode 100644 support/funding/support-vendor.wml delete mode 100644 support/funding/wishlist.wml create mode 100644 support/index.html delete mode 100644 support/index.wml delete mode 100644 support/majordomo.wml delete mode 100644 support/other.wml delete mode 100644 support/rt.wml create mode 100644 support/sidebar.inc create mode 100644 template-file.html diff --git a/.gitignore b/.gitignore index f6bef20..4e9329d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,20 @@ -*.html -*.pdf -*.gz* -pod2htmd.tmp -pod2htmi.tmp -blog +*.swp +sitemap.txt +docs/faq.inc +docs/faq.txt +docs/fips.inc news/changelog.inc -news/vulnerabilities.wml -source/license.inc -support/faq.inc -support/funding/support-faq.inc -.ssh -.cache +news/changelog.txt +news/newsflash.inc +news/vulnerabilities.html +news/vulnerabilities.inc +newsflash.inc +source/index.inc +source/license.txt +docs/HOWTO/*.txt +source/*.gz +source/*.gz.asc +source/*.gz.md5 +source/*.gz.sha1 +source/*.tar.gz.sig +source/*.patch diff --git a/.htaccess b/.htaccess index 92b86ae..ac417dd 100644 --- a/.htaccess +++ b/.htaccess @@ -4,9 +4,6 @@ RewriteEngine on Options +ExecCGI +FollowSymLinks -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule related/(.*) /about/$1 - ForceType application/binary diff --git a/.wmkrc b/.wmkrc deleted file mode 100644 index b320886..0000000 --- a/.wmkrc +++ /dev/null @@ -1 +0,0 @@ --F openssl.wml diff --git a/.wmlrc b/.wmlrc deleted file mode 100644 index 31104f3..0000000 --- a/.wmlrc +++ /dev/null @@ -1,11 +0,0 @@ -## -## .wmlrc -- Global WML RC file for www.openssl.org -## - --DROOT~. --DBASE_URL=http://www.openssl.org --DBASE_DIR~. --DIMG~images --DIMGDOT_BASE~images/misc-space --I. - diff --git a/.wmlsnb b/.wmlsnb deleted file mode 100644 index b9a20bb..0000000 --- a/.wmlsnb +++ /dev/null @@ -1,13 +0,0 @@ -## -## .wmlsnb -- Sub Navigation Bar Specification for WML -## - - -## - - - - - - - diff --git a/Makefile b/Makefile index ddb9619..1e0ddaa 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,92 @@ ## -## Makefile -- Top-level build procedure for www.openssl.org -## +## Build procedure for www.openssl.org + +## Snapshot directory +SNAP = /var/cache/openssl/checkouts/openssl +RELEASEDIR = /var/www/openssl/source -# Used to have a hack with a lockfile. -# Not needed since this is fast now. +# All simple generated files. +SIMPLE = newsflash.inc sitemap.txt \ + docs/faq.txt docs/faq.inc docs/fips.inc \ + news/changelog.inc news/changelog.txt \ + news/newsflash.inc \ + news/vulnerabilities.inc \ + source/license.txt \ + source/index.inc +SRCLISTS = source/old/index.inc \ + source/old/0.9.x/index.inc \ + source/old/1.0.0/index.inc \ + source/old/1.0.1/index.inc \ + source/old/1.0.2/index.inc \ + source/old/fips/index.inc \ -SNAP=/var/cache/openssl/checkouts/openssl -PODSHOME=$(SNAP)/doc +all: $(SIMPLE) $(SRCLISTS) -FORCE=#-f -QUIET=--quiet +# Legacy targets +simple: all +generated: all +manpages: all +rebuild: all +relupd: all -DIRS= about docs news source support +# To be fixed. +hack-source_htaccess: + exit 1; -all: generated simple manpages +clean: + rm -f $(SIMPLE) -generated: - cp -f $(SNAP)/LICENSE source/license.inc - cp -f $(PODSHOME)/HOWTO/*.txt docs/HOWTO/. - perl run-changelog.pl <$(SNAP)/CHANGES >news/changelog.inc - perl run-faq.pl <$(SNAP)/FAQ >support/faq.inc - perl run-fundingfaq.pl < support/funding/support-faq.txt >support/funding/support-faq.inc - ( cd news && xsltproc vulnerabilities.xsl vulnerabilities.xml > vulnerabilities.wml ) +newsflash.inc: news/newsflash.inc + @rm -f $@ + head -6 $? >$@ +sitemap.txt: + @rm -f $@ + ./bin/mk-sitemap >$@ -simple: rebuild hack-source_htaccess -rebuild: - wmk $(FORCE) -I $(SNAP) -a $(DIRS) index.wml -hack-source_htaccess: - ( cd source && wml -o .htaccess .htaccess.wml ) - -manpages: - sh ./run-pod2html.sh $(PODSHOME) - -# Update release notes (and other items, but relnotes is the use-case) -relupd: - if [ "`id -un`" != openssl; then \ - echo "**** you must do 'sudo -u openssl -H bash'"; \ - exit 1; \ - fi - cd $(SNAP)/.. ; for dir in openssl* ; do \ - echo Updating $$dir ; ( cd $$dir ; git pull $(QUIET) ) ; \ - done - git pull $(QUIET) - $(MAKE) generated simple +news/changelog.inc: news/changelog.txt bin/mk-changelog + @rm -f $@ + ./bin/mk-changelog $@ +news/changelog.txt: $(SNAP)/CHANGES + @rm -f $@ + cp $? $@ +news/newsflash.inc: news/newsflash.txt + sed <$? >$@ \ + -e 's@^@@' \ + -e 's@: @@' \ + -e 's@$$@@' +news/vulnerabilities.inc: bin/vulnerabilities.xsl news/vulnerabilities.xml + @rm -f $@ + xsltproc bin/vulnerabilities.xsl news/vulnerabilities.xml >$@ + +docs/faq.txt: $(SNAP)/FAQ + @rm -f $@ + cp $? $@ +docs/faq.inc: docs/faq.txt + @rm -f $@ + ./bin/mk-faq <$? >$@ +docs/fips.inc: + @rm -f $@ + ./bin/mk-filelist docs/fips fips/ '*' >$@ + +source/license.txt: $(SNAP)/LICENSE + @rm -f $@ + cp $? $@ +source/index.inc: + @rm -f $@ + ./bin/mk-filelist $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@ + +source/old/0.9.x/index.inc: + @rm -f $@ + ./bin/mk-filelist source/old/0.9.8 '' '*.gz' >$@ +source/old/1.0.0/index.inc: + @rm -f $@ + ./bin/mk-filelist source/old/1.0.0 '' '*.gz' >$@ +source/old/1.0.1/index.inc: + @rm -f $@ + ./bin/mk-filelist source/old/1.0.1 '' '*.gz' >$@ +source/old/1.0.2/index.inc: + @rm -f $@ + ./bin/mk-filelist source/old/1.0.2 '' '*.gz' >$@ +source/old/fips/index.inc: + @rm -f $@ + ./bin/mk-filelist source/old/fips '' '*.gz' >$@ diff --git a/README b/README deleted file mode 100644 index 61f945f..0000000 --- a/README +++ /dev/null @@ -1,12 +0,0 @@ - -This is the source for www.openssl.org - -The images were generated with Photoshop. The text is written using -Website META Language (WML) for markup. WML can (hopefully) be -found at http://thewml.org; the last release was in 2006. - -The Makefile rebuilds the website. It needs a copy of a checked-out -tree, pointed to by the SNAP variable. - -Not included in the repository are the .tar.gz files for download. -They are kept in the FTP area and within the URI tree. diff --git a/about/.wmlrc b/about/.wmlrc deleted file mode 100644 index ab44064..0000000 --- a/about/.wmlrc +++ /dev/null @@ -1,10 +0,0 @@ -## -## .wmlrc -- Local RC file for WML -## - -# define where the URL root of the Sub Navigation Bar (SNB) -# is located [SNB_ROOT] and where it's buttons are defined [SNB_RC] --DSNB_ROOT~. --DSNB_RC=.wmlsnb --I. - diff --git a/about/.wmlsnb b/about/.wmlsnb deleted file mode 100644 index 03ecfd4..0000000 --- a/about/.wmlsnb +++ /dev/null @@ -1,16 +0,0 @@ -## -## .wmlsnb -- Sub Navigation Bar Specification for WML -## - - - - - - - - - - - - - diff --git a/about/binaries.wml b/about/binaries.wml deleted file mode 100644 index 21b745f..0000000 --- a/about/binaries.wml +++ /dev/null @@ -1,36 +0,0 @@ - -#use wml::openssl area=about page=binaries - -OpenSSL Binary Distributions - -

    Binary Distributions

    - -

    Some people have offered to provide OpenSSL binary distributions for -selected operating systems. The condition to get a link here is that the -link is stable and can provide continued support for OpenSSL for a while.

    - -

    Note: many Linux distributions come with pre-compiled OpenSSL packages. -Those are already well-known among the users of said distributions, and -will therefore not be mentioned here. If you are such a user, -we ask you to get in touch with your distributor first. This service is -primarly for operating systems where there are no pre-compiled OpenSSL -packages.

    - -
      - -
    - -
      - -
    - -
      - -
    diff --git a/about/contacts.wml b/about/contacts.wml deleted file mode 100644 index 658aa8d..0000000 --- a/about/contacts.wml +++ /dev/null @@ -1,102 +0,0 @@ - -#use wml::openssl area=about page=contacts - -About, Contacts - -

    About the OpenSSL Project

    - -

    Physical Addresses

    - -

    Apart from mail addresses and names, some organizations require a physical -address as contact for open source projects. Physical addresses can be -useful in other cases as well. Therefore, some people have stepped forward -and volunteered as "official" contacts for OpenSSL. If you want to get in -touch with any of these people, please consider using email first, since -that will also reach other team members in case your contact is temporarly -not available.

    - -

    Please remember to be kind to the contacts. Their time is their own -to dispose of. You may request support, but it's the contact's -responsability and freedom alone to decide if he wants to give any support -or not, regardless of who makes the request.

    - -

    The OpenSSL Software Foundation represents the OpenSSL project in most capacities including contributor license -agreements, managing donations, etc.

    -

    - - - - - -
    AddressArea covered


    -OpenSSL Software Foundation
    -20-22 Wenlock Road
    -London
    -N1 7GU
    -United Kingdom
    -+44 1785508015 (UK)
    -+1 877-OPENSSL(6775) (US toll free)
    -+1 301-956-2281 (US)
    -E-mail: info at opensslfoundation.org -
    -Worldwide -
    - -

    OpenSSL Software Services represents the OpenSSL project for selected commercial or quasi-commercial contexts, such -as providing formal support contracts and brokering consulting contracts for OpenSSL team members

    -

    - - - - - -
    AddressArea covered


    -OpenSSL Software Services Inc.
    -40 E Main St, Suite 744
    -Newark DE 19711
    -USA
    -+1 240-215-3103
    -E-mail: info at opensslservices.com -
    -Worldwide -
    - -

    -Commercial activities specific to FIPS 140-2 validations and the OpenSSL FIPS Object Module are handled by OpenSSL Validation Services: -

    - - - - - -
    AddressArea covered


    -OpenSSL Validation Services Inc.
    -1829 Mount Ephraim Road
    -Adamstown, MD 21710
    -USA
    -+1 301-874-2571
    -E-mail: info at openssl.com -
    -Worldwide -
    - -

    -

    -Some OpenSSL team members are available for selected consulting engagements: -

    - - - - - -
    AddressArea covered


    -OpenSSL SE
    -c/o Richard Levitte
    -Nordingr?gatan 20
    -S-162 53 V?llingby
    -Sweden
    -E-mail: openssl-contact.SE at openssl.org -
    -Sweden only -
    - diff --git a/about/credits.wml b/about/credits.wml deleted file mode 100644 index 27db0b1..0000000 --- a/about/credits.wml +++ /dev/null @@ -1,53 +0,0 @@ - -#use wml::openssl area=about page=credits - -About, Credits - -

    Credits

    - -This page gives credit to the various individuals and -companies who contributed to the OpenSSL project. - -
      - -
    • -Our current hosting is provided courtesy of -SpaceNet AG. -

      - -

    • -Thanks to GMO GlobalSign for -providing free TLS certificates. -

      - -

    • Thanks to rsync.net for providing free -backup storage. -

      - -

    • -Thanks to Eric Young and Tim Hudson for the SSLeay -package on which OpenSSL is based. -

      - -

    • -Thanks to C2Net for contributing back to the Open Source community the -SSLeay version 0.9.1b, which was the last internal SSLeay version Eric -and Tim created while working for C2Net. -

      - -

    • -Thanks to the Development Team of Internet Services at Cable & Wireless Munich, Germany, for -providing the hardware and network resources for some time after 2002. -

      - -

    • -Thanks to the IT Support Group of the Department of -Information Technology and Electrical Engineering at the Swiss Federal Institute of Technology -Zurich (ETHZ) for providing the hardware and network resources -from 1998 to 2002. -

      - -

    - diff --git a/about/index.wml b/about/index.wml deleted file mode 100644 index cf363e5..0000000 --- a/about/index.wml +++ /dev/null @@ -1,106 +0,0 @@ - -#use wml::openssl area=about page=general - -About, General - -

    About the OpenSSL Project

    - -

    The goal of the project

    - -The OpenSSL Project is a collaborative effort to develop a robust, -commercial-grade, full-featured, and Open Source toolkit implementing the -Secure Sockets Layer (SSL v2/v3) and -Transport Layer Security (TLS -v1.0/v1.1/v1.2) protocols as well as a full-strength general purpose cryptography library -managed by a worldwide community of volunteers that use the Internet to -communicate, plan, and develop the OpenSSL toolkit and its related -documentation. - -

    Derivation and License

    - -OpenSSL is based on the SSLeay library -developed by Eric Young and -Tim Hudson. The OpenSSL toolkit -is licensed under an Apache-style licence which basically means that you are free -to get and use it for commercial and non-commercial purposes. - -

    The OpenSSL Core and Development Team

    - -The OpenSSL project is volunteer-driven. We do not have any specific -requirement for volunteers other than a strong willingness to really -contribute while following the projects goal. The OpenSSL project is formed -by a development team, which consists of the current active developers -and other major contributors. Additionally a subset of the developers form the -OpenSSL core team which globally manages the OpenSSL project. Anyone wanting -to join the development effort should subscribe to the developers mailing list -openssl-dev at openssl.org, where all development efforts are coordinated. - -

    -The current OpenSSL core team consists of (in alphabetical order): -

    -

    - - - - - - -
    Individual Email Location Key ID / Fingerprint




    Mark J. Cox mark at openssl.org UK B00CFE33, 49A563D9 (old key)
    Dr. Stephen Henson steve at openssl.org UK FA40E9E2, F295C759 (old key)
    Ben Laurie ben at openssl.org UK 2118CF83
    Andy Polyakov appro at openssl.org SE 1FE8E023
    - -

    -The current OpenSSL development team consists of (in alphabetical order): -

    -

    - - - - - - - - - - - - - - - - - - - - - -
    Individual Email Location  Key ID




    Matt Caswell matt at openssl.org UK 0E604491
    Mark J. Cox mark at openssl.org UK B00CFE33, 49A563D9 (old key)
    Viktor Dukhovni viktor at openssl.org US
    Dr. Stephen Henson steve at openssl.org UK FA40E9E2, F295C759 (old key)
    Tim Hudson tjh at openssl.org AU 41FBF7DD
    Lutz Jänicke jaenicke at openssl.org DE BDD52F1C, 9C58A66D (old key)
    Emilia Käsper emilia at openssl.org CH
    Ben Laurie ben at openssl.org UK 2118CF83
    Steve Marquess marquess at openssl.org US 6D1892F5(old key: CE69424E)
    Richard Levitte levitte at openssl.org SE 7DF9EE8C (old key: F709453B)
    Bodo Möller bodo at openssl.org CH 5A6A9B85
    Andy Polyakov appro at openssl.org SE 1FE8E023
    Kurt Roeckx kurt at openssl.org BE 41C25E5D
    Rich Salzrsalz at openssl.orgUS5C51B27C
    D099 684D C7C2 1E02 E14A 8AFE F234 7945 5C51 B27C
    Geoff Thorpe geoff at openssl.org QC E18C1C32
    - -

    -Currently inactive OpenSSL members (in alphabetical order): -

    -

    - -
    - - -
    Individual Email Location  Key ID



    Ralf S. Engelschall rse at openssl.org DE
    Nils Larsch nils at openssl.org DE
    - - -

    -OpenSSL Emeritae - old members now off doing other things (in alphabetical order): -

    -

    - - - - -
    Individual Email Location



    Holger Reif holger at openssl.org DE
    Paul C. Sutton paul at openssl.org UK
    - -

    -In Memoriam - members sadly no longer with us: -

    -

    - - - -
    Individual Location


    Ulf Möller DE
    diff --git a/about/openssl-contact.wml b/about/openssl-contact.wml deleted file mode 100644 index 8b9c590..0000000 --- a/about/openssl-contact.wml +++ /dev/null @@ -1,22 +0,0 @@ - -#use wml::openssl area=funding page=index - -OpenSSL Software Foundation Contact Info - -

    OpenSSL Software Foundation Queries

    - -Direct queries concerning any non-commercial activites or issues to:
    -
    -OpenSSL Software Foundation
    -20-22 Wenlock Road
    -London
    -N1 7GU
    -United Kingdom
    -+44 1785508015 (UK)
    -+1 877-OPENSSL(6775) (US toll free)
    -+1 301-956-2281 (US)
    -info at opensslfoundation.org -

    -You will probably wind up talking to Steve Marquess who currently handles OpenSSL commercial contracting, he is -reachable directly at marquess at opensslfoundation.org or -the telephone numbers above. diff --git a/about/releasestrat.wml b/about/releasestrat.wml deleted file mode 100644 index cc20ee1..0000000 --- a/about/releasestrat.wml +++ /dev/null @@ -1,67 +0,0 @@ - -#use wml::openssl area=about page=releasestrat - -About, Release Strategy -

    OpenSSL Release Strategy

    -

    First issued 23rd December 2014

    -

    Last modified 9th August 2015

    -

    -
    -

    -

    As of release 1.0.0 the OpenSSL versioning scheme was improved to -better meet developers' and vendors' expectations. Letter releases, such as -1.0.1a, exclusively contain bug and security fixes and no new features. -Minor releases that change the last digit, e.g. 1.0.1 vs. 1.0.2, can and -are likely to contain new features, but in a way that does not break -binary compatibility. This means that an application compiled and -dynamically linked with 1.0.0 does not need to be recompiled when the shared -library is updated to 1.0.2. It should be noted that some features are -transparent to the application such as the maximum negotiated TLS version and -cipher suites, performance improvements and so on. There is no need to recompile -applications to benefit from these features.

    - -

    Binary compatibility also allows other possibilities. For example, consider an -application that wishes to utilize a new cipher provided in a specific 1.0.x -release, but it is also desirable to maintain the application in a 1.0.0 context. -Customarily this would be resolved at compile time resulting in two binary -packages targeting different OpenSSL versions. However, depending on the feature, -it might be possible to check for its availability at run-time, thus cutting -down on the maintenance of multiple binary packages. Admittedly it takes a certain -discipline and some extra coding, but we would like to encourage such -practice. This is because we want to see later releases being adopted -faster, because new features can improve security.

    - -

    With regards to current and future releases the OpenSSL project has adopted the -following policy:

    - -
      -
    • Support for version 0.9.8 will cease on 2015-12-31. No further releases of 0.9.8 -will be made after that date. Security fixes only will be applied to 0.9.8 until -then.

    • - -
    • Support for version 1.0.0 will cease on 2015-12-31. No further releases of 1.0.0 -will be made after that date. Security fixes only will be applied to 1.0.0 until -then.

    • -
    - -

    We may designate a release as a Long Term Support (LTS) release. LTS releases -will be supported for at least five years and we will specify one at least every -four years. Non-LTS releases will be supported for at least two years.

    - -

    As implied by the above paragraphs, during the final year of support, we do not -commit to anything other than security fixes. Before that, bug and security -fixes will be applied as appropriate.

    - -
      -
    • Version 1.0.1 will be supported until 2016-12-31.

    • - -
    • Version 1.0.2 will be supported until 2019-12-31.

    • -
    - -

    At this time, we are not planning a 1.0.3 release.

    - -

    Version 1.1.0 will (moderately) break source compatibility (for example we will -make most structures opaque etc). We expect a preview version to be available -mid 2015, with an expected release by the end of 2015. Preview means that we are -not planning or expecting major API changes between the preview release and the -final release (but are not categorically precluding that possibility).

    diff --git a/about/roadmap.wml b/about/roadmap.wml deleted file mode 100644 index 05f6587..0000000 --- a/about/roadmap.wml +++ /dev/null @@ -1,364 +0,0 @@ - -#use wml::openssl area=about page=roadmap - -About, Roadmap -

    OpenSSL Project Roadmap

    -

    First issued 30th June 2014

    -

    Last modified 14th October 2014

    -

    -
    -

    -

    -This document is intended to outline the OpenSSL project roadmap. It -is a living document and is expected to change over time. Objectives -and dates should be considered aspirational.

    -

    -The OpenSSL project is increasingly perceived as slow-moving and -insular. This roadmap will attempt to address this by setting out -some objectives for improvement, along with defined timescales.

    -

    Current Issues

    -

    -The OpenSSL project is currently experiencing a number of issues. -These are:

    -
      -
    1. - RT Backlog

      Over a period of some considerable time - open tickets have been building up in RT (our bug tracking system) to - the point that now there are a very significant number of them. A large - proportion of these issues have been open for years. Some of these have - in fact been dealt with and should be closed, but this has not been - recorded in the system. Most however have not been looked at.

      -

      -
    2. - Incomplete/incorrect documentation

      Documentation of - OpenSSL is patchy at best. Some areas are well documented, while - many others suffer from incomplete or incorrect documentation. There - are also many areas which have no documentation at all.

      -

      -
    3. - Library complexity

      The OpenSSL libraries and - applications are complex, both from a maintainer's perspective and - from a user's perspective. The public API contains many things which - should probably be internal. The code has been ported to a large - number of platforms, many of which are no longer relevant to us - today, and this complicates the codebase. Some parts of the code - have been in place for a very long time, and are in need of a - refresh. It is further complicated by the support for FIPS.

      This - complexity causes maintenance problems, and can also be the source - of obscure and difficult to spot security vulnerabilities. It can - also make users' lives much more difficult especially when - combined with (2) above.

      The current memory management code has - also been a source of problems and vulnerabilities.

      -

      -
    4. - Inconsistent coding style

      There have been numerous - developers working on the codebase over many years. There are many - different styles used within the code, which is confusing and makes - maintenance more difficult than it should be. Even if strictly - consistent, the current code layout is unusual and idiosyncratic and - unlike any other open source software.

      -

      -
    5. - - Lack of code review

      We don't have a code review system - and we don't mandate code reviews.

      -
      -

      -
    6. - No clear release plan

      Historically OpenSSL has made new - feature releases on an infrequent basis and no forward plan of releases - has been published. It is difficult for users to plan for new releases, - and understand when new features might become available, or when support - will end for a release. In addition a large number of stable releases - are maintained by the OpenSSL development team - diverting effort away - from the most up to date versions.

      -

      -
    7. - No clear platform strategy

      Historically OpenSSL has - supported a very wide range of platforms. Typically platform support has - been added through "ifdef" conditional compilation on a per - platform basis. This approach has led to a number of problems:

      -
    -
      -
    • - The code has become very cluttered and is difficult to effectively - maintain

      -
    • - There is support still in the code for a number of legacy platforms - which are unlikely to be widely deployed today - if the code even - still works on those platforms

      -
    • - In practice the development team do not have access to many of the - platforms that the codebase supports and testing typically takes - place on a very limited set (usually Linux, FreeBSD and Windows)

      -

      -
    - -
      -
    1. - No published security strategy

      We do not have a well-known - and published approach for how we appropriately inform all interested - parties of security advisories.

      -

      -
    -
    - -

    Objectives

    -

    -Each of the issues identified above can be translated into high level -objectives. Some of these objectives can be achieved more easily and -quickly than others.

    -

    -An important principle is that the priority and focus of effort -will be on achieving these objectives over and above the delivery of -new features.

    -

    RT Backlog

    -
      -
    1. - Manage all newly submitted RT tickets in a timely manner such as an - initial response within four working days. (Timescale: Now)

      -
    2. - Reduce over time the existing RT backlog (Timescale: Ongoing). This - may include the mass closure of very old tickets, such as those - raised before the release of any currently supported version

      -

      Update (8th September 2014): - we have made a great deal of progress on the backlog. - A graph of ticket activity - is available, as is the raw data - for every bug showing when it was open, and resolved. We will - update these files periodically. -

    -

    Incomplete/incorrect documentation

    -
      -
    1. - Provide complete documentation for all of the public API (excluding - deprecated APIs) (Timescale: Within one year)

      -
        -
      1. - This may include introducing a new documentation system

        -
      2. - Some parts of the API have historically been public but were not - intended for public use, such as low level cipher and digest APIs. - These parts may not be documented, and if they are will be marked - as deprecated (Timescale: within nine months).

        -
      -
    -

    Library complexity

    -
      -
    1. - Review and revise the public API with a view to reducing complexity - (Timescale: Within one year)

      -
    2. - Document a platform strategy: see below (Timescale: Within three - months)

      -
    3. - Review and refactor the FIPS code to make it far less intrusive - (Timescale: Within one year)

      -
    4. - Review and refactor the memory management code (Timescale: Within - six months)

      -
    -

    Inconsistent coding style

    -
      -
    1. - Define a clear coding standard for the project. This will cover not - only code layout but also items such as how to handle platform - dependencies, unit testing and optional code. (Timescale: Within - three months) -

      -
    2. - Format the entire codebase according to the agreed standard. - (Timescale: Within three months of coding standard being defined) -

      -
    3. - Refactor code to follow other parts of the style guide. (Timescale: - Within one year)

      -
    -

    Code review

    -
      -
    1. - - Agree and implement a process such that all new commits should first - be reviewed by a team member conversant with the relevant code and - updated until the reviewer's issues are addressed. This is - contingent on recruiting sufficient team members that reviewers are - more-or-less always available. (Timescale: Within three months)

      - -

      - Objective met (16th July 2014): All changes are first reviewed by - another team member prior to being committed to the public openssl - repository. -

      -
    2. - Agree on a code review system. (Timescale: Within six months)

      -
    -

    Audit

    -
      -
    1. - Externally audit the current code base. (Timescale: Dependent on - external body)

      -

      -

      Update (14th October 2014): - Auditors selected and funded; schedule being worked on.

      -
    -

    Static/Dynamic Analysis

    -
      -
    1. - Regularly audit the code using appropriate analysis tools. - (Timescale: Within six months) -

      -
    -

    Release Strategy

    -

    -We intend to develop a release strategy which will set out our plans -for how frequently we plan to release, and when. It will also cover -how long releases will be supported for, and when their EOL (End Of -Life) will be. (Timescale: Within three months)

    -

    -There are a number of objectives that we would be seeking to address -within the release strategy. Some of these objectives compete with -each other, and so from necessity there will have to be compromises. -The objectives are:

    -
      -
    1. - We need security fix releases with very low chance of breaking - anything. This is largely met by prohibiting new features in stable - branches (i.e. letter releases).

      -
    2. - If something is broken in a release a fixed version should be made - available shortly afterwards (i.e. more letter releases more often)

      -
    3. - We need a way to get new binary compatible features into OpenSSL - relatively quickly.

      -
    4. - We don't want to have to maintain too many branches. This is likely - to include a timescale for the EOL of version 0.9.8

      -
    5. - We need a way to refactor code and make necessary binary - incompatible changes, deprecating APIs etc.

      -
    -

    Platform Strategy

    -

    -Moving forward OpenSSL will adopt the following policy:

    -
      -
    • - There will be a defined set of primary platforms. The primary - platforms will be Linux and FreeBSD. A primary platform is one where - most development occurs.

      -
    • - In addition there will be a list of secondary platforms which are - supported by the development team.

      -
    • - Platform specific code will be moved out of the main codebase - (removing overuse of "ifdef").

      -
    • - Legacy platforms that are unlikely to have wide deployment will be - removed from the code.

      -
    • - Non-supported platforms requiring regular maintenance activities - will eventually be removed from the code after first seeking - community owners to support the platforms in platform specific - repositories.

      -
    -

    -Necessary criteria for a platform to be included in the secondary -platform list includes:

    -
      -
    • - Currency, i.e. a platform is widely deployed and in current use

      -
    • - Vendor support

      -
    • - Available to the dev team, i.e. the dev team have access to a - suitable environment in which to test builds and deal with tickets - and issues

      -
    • - Dev team ownership, i.e. at least one person on the team is willing - to take some responsibility for a platform

      -
    -

    -In addition the secondary list will be as small as possible so as not -to spread the development team too thinly.

    -

    -The secondary platforms are still to be defined but will be based on -the above criteria. For each primary/secondary platform, we should -have, at least, a continuous integration box and a dev machine we can -access for test/debug. We will seek support from the platform vendors -or the community to provide access to these platforms. The secondary -platform list will change over time, but an initial list will be -produced within three months.

    -

    -The Platform Strategy will be phased in over a period of time based -on how quickly we can refactor the code.

    -

    Security Strategy

    - -

    -We will be documenting a security strategy which will define our -policy on:

    -
      -
    • - How we make security fixes

      -
    • - What (if any) pre-notification of forthcoming security releases will - be provided (and to whom) (Timescale: Within two months)

      -
    -
    -

    -Objective met (7th September 2014): The OpenSSL security policy is available -here -

    -

    Forthcoming Features

    -

    -The primary focus of effort will be on achieving the objectives -detailed above, however we are evaluating the following new features.

    -
      -
    • - IPv6 support

      -
    • - AEAD updates (API review, Poly/ChaCha support, /dev/crypto - operations coalescing)

      -
    • - TLS 1.3. -

      -
    • - Certificate Transparency support. -

      -
    • - Support for new ciphersuites e.g. CCM.

      -
    • - Extended SSL_CONF support.

      -
    • - DANE support.

      -
    • - Security levels (currently experimental in master)

      -
    • - OCB

      -
    • - FIPS code review and refactor

      -
    • - Support for emerging platforms, e.g. ARMv8, POWER8

      -
    • - Built-in MT support for two major threading "flavours", POSIX - threads and Win32.

      -
    - -

    Roadmap Update History

    -

    -The following changes have been made since the roadmap was first -issued 30-June-2014. -

    -
      -
    • - 14-October-2014. - Updated audit; added TLS 1.3 and Certificate - Transparency to features.

      -
    • - 8-September-2014. Updated status on the RT backlog objective.

      -
    • - 7-September-2014. Updated security policy section.

      -
    • - 16-July-2014. Updated code review section.

      -
    • - 1-July-2014. Noted RT is our bug tracking system.

      -
    - diff --git a/about/secpolicy.wml b/about/secpolicy.wml deleted file mode 100644 index 6301a29..0000000 --- a/about/secpolicy.wml +++ /dev/null @@ -1,167 +0,0 @@ - -#use wml::openssl area=about page=secpol - -About, Security Policy -

    OpenSSL Security Policy

    -

    Last modified 7th September 2014

    -

    -
    -

    - - -

    Introduction

    - -

    -Recent flaws have captured the attention of the media and highlighted -how much of the internet infrastructure is based on OpenSSL. We've -never published our policy on how we internally handle security issues; -that process being based on experience and has evolved -over the years. -

    - -

    Reporting security issues

    - -

    -We have an email address which can be used to notify us of possible -security vulnerabilities. A subset of OpenSSL team members receive -this mail, and messages can be sent using PGP encryption. Full -details are at https://www.openssl.org/news/vulnerabilities.html -

    - -

    -When we are notified about an issue we engage resources within the -OpenSSL team to investigate and prioritise it. We may also utilise -resources from the employers of our team members, as well as others -we have worked with before. -

    - -

    Background

    - -

    -Everyone would like to get advance notice of security issues in OpenSSL. -This is a complex topic and we need to set out some background -with our findings: -

    -
      -
    • The more people you tell in advance the higher the likelihood that a - leak will occur. We have seen this happen before, both with OpenSSL - and other projects.

      - -
    • A huge number of products from an equally large number of - organisations use OpenSSL. It's not just secure websites, you're - just as likely to find OpenSSL inside your smart TV, car, or fridge.

      - -
    • We strongly believe that the right to advance patches/info - should not be based in any way on paid membership to some forum. You - can not pay us to get security patches in advance.

      - -
    • We can benefit from peer review of the patches and advisory. Keeping - security issues private means they can't get the level of testing or - scrutiny that they otherwise would.

      - -
    • It is not acceptable for organisations to use advance notice in marketing - as a competitive advantage. For example "if you had bought our - product/used our service you would have been protected a week ago".

      - -
    • There are actually not a large number of serious vulnerabilities in - OpenSSL which make it worth spending significant time keeping our - own list of vendors we trust, or signing framework agreements, or - dealing with changes, and policing the policy. This is a - significant amount of effort per issue that is better spent on other - things.

      - -
    • We have previously used third parties to handle notification for us - including CPNI, oCERT, or CERT/CC, but none were suitable.

      - -
    • It's in the best interests of the Internet as a whole to get fixes - for OpenSSL security issues out quickly. OpenSSL embargoes should be - measured in days and weeks, not months or years.

      - -
    • Many sites affected by OpenSSL issues will be running a version of - OpenSSL they got from some vendor (and likely bundled with an - operating system). The most effective way for these sites to get - protected is to get an updated version from that vendor. Sites who - use their own OpenSSL compilations should be able to handle a quick - patch and recompile once the issue is public.

      -
    - -

    Internal handling of security issues

    - -

    This leads us to our policy for security issues notified to us or -found by our team which are not yet public.

    - -

    "private" means kept within the OpenSSL development team.

    - -

    We will determine the risk of each issue being addressed. We will -take into account our experience dealing with past issues, versions -affected, common defaults, and use cases. We divide the issues into -the following categories:

    - -
      - -
    • low severity issues. This includes issues such as those that only - affect the openssl command line utility, unlikely configurations, or - hard to exploit timing (side channel) attacks. These will in - general be fixed immediately in latest development versions, and may - be backported to older versions that are still getting updates. We - will update the vulnerabilities page and note the issue CVE in the - changelog and commit message, but they may not trigger new releases.

      - -
    • moderate severity issues. This includes issues like crashes in - client applications, flaws in protocols that are less commonly used - (such as DTLS), and local flaws. These will in general be kept - private until the next release, and that release will be scheduled - so that it can roll up several such flaws at one time.

      - -
    • high severity issues. This includes issues affecting common - configurations which are also likely to be exploitable. Examples - include a server DoS, a significant leak of server memory, and - remote code execution. These issues will be kept private and will - trigger a new release of all supported versions. We will attempt to - keep the time these issues are private to a minimum; our aim would - be no longer than a month where this is something under our control, - and significantly quicker if there is a significant risk or we are - aware the issue is being exploited.

      -
    - -

    During the investigation of issues we may work with individuals and -organisations who are not on the development team. We do this because -past experience has shown that they can add value to our understanding -of the issue and the ability to test patches. In cases where -protocols are affected this is the best way to mitigate the risk that -a poorly reviewed update causes signficiant breakage, or to detect if -issues are being exploited in the wild. We have a strict policy on -what these organisations and individuals can do with the information -and will review the need on a case by case basis.

    - -

    Prenotification policy

    - -

    Where we are planning an update that fixes security issues we will -notify the openssl-announce list and update the home page to give our -scheduled update release date and time and the severity of issues -being fixed by the update. No futher information about the issues -will be given. This is to aid organisations that need to ensure they -have staff available to handle triaging our announcement and what it -means to their organisation.

    - -

    For updates that include high severity issues we will also prenotify -with more details and patches. Our policy is to let the organisations -that have a general purpose OS that uses OpenSSL have a few days -notice in order to prepare packages for their users and feedback test -results.

    - -

    We use the mailing list described at -http://oss-security.openwall.org/wiki/mailing-lists/distros for this. -We may also include other organisations that would otherwise qualify -for list membership. We may withdraw notifying individual -organisations from future prenotifications if they leak issues before -they are public or over time do not add value (value can be added by -providing feedback, corrections, test results, etc.)

    - -

    Finally, note that not all security issues are notified to us -directly; some come from third parties such as companies that pay for -vulnerabilities, some come from country CERTs. These intermediaries, -or the researchers themselves, may follow a different style of -notification. This is within their rights and outside of the control -of the OpenSSL team.

    - diff --git a/bin/mk-changelog b/bin/mk-changelog new file mode 100755 index 0000000..60135c9 --- /dev/null +++ b/bin/mk-changelog @@ -0,0 +1,48 @@ +#! /usr/bin/perl -w +use strict; + +# Read whole input. +my $page; +{ + local $/; + $page .= ; +} + +# HTML entities. +$page =~ s|&|&|sg; +$page =~ s|<|<|sg; +$page =~ s|>|>|sg; + +# Make sub-headings. +$page =~ s|^.+?(Changes.+?\n+)|$1|s; +$page =~ s|(Changes between.+?)\n|\n

    $1

    \n
    \n|sg;
    +
    +# Wrap it, and remove empty 
    
    +$page = '
    ' . $page . '
    '; +$page =~ s|
    ||g;
    +
    +# Make a TOC
    +my $ctr = 0;
    +my $toc;
    +my $out;
    +my $top = '  ';
    +for (split /^/, $page) {
    +    if ( /

    / ) { + my $name = $_; + $name =~ s|

    (.*)

    |$1|; + chop ($name); + $out .= '

    ' . $name . "$top

    \n"; + $toc .= '
  • ' . $name . "
  • \n"; + $ctr++; + } else { + $out .= $_; + } +} + +print "

    Table of contents

    \n"; +print "
      "; +print $toc; +print "
    "; +print $out; + +exit(0); diff --git a/run-faq.pl b/bin/mk-faq similarity index 52% rename from run-faq.pl rename to bin/mk-faq index f1e38f5..803d53a 100755 --- a/run-faq.pl +++ b/bin/mk-faq @@ -1,48 +1,73 @@ -#!/usr/bin/perl -## read a FAQ file and pretty-print it as html +#! /usr/bin/perl -w +use strict; + +sub escape +{ + s/\&/\&/g; + s/\/\>/g; +} -$|++; # TOC -$i=0; $l=""; $n=0; -print "
      \n"; -print "
        \n"; +my $l = ""; +my $n = 0; +print "

        Table of Contents

        \n"; +my $dirty = 0; while () { escape($_); last if /^=+$/; next if /^\w*$/; if (/^\[([^\[]+)\] (.*)/) { - $l=$1; - $n=0; - print "
      \n"; - print "
    • $1 $2\n"; + print "\n" if $dirty; + $l = $1; + $n = 0; + $dirty = 1; + print "

      $1 $2

      \n"; print "
        \n"; } elsif (/^\* (.*)/) { $n++; - print "
      1. $1\n"; + print "
      2. $1
      3. \n"; } } -print "
      \n"; -print "
    \n\n"; +print "\n" if $dirty; # Contents -$l=""; $n=0; $pre=0; $snip=0; +my $top = ' '; +$l = ""; +$n = 0; +my $pre = 0; +my $snip = 0; while () { next if /^=+$/; if (/^----- snip:start -----/) { - print "
    " unless $snip;
    -	$snip=1;
    +	print "
    ";
    +	$snip = 1;
    +	next;
         }
         if ($snip) {
    +	if (/^----- snip:end -----/) {
    +	    print "
    "; + $snip = 0; + } else { + escape($_); + print; + } + next; + } + if (/^ /) { + print "
    " unless $pre;
    +	$pre = 1;
     	escape($_);
     	print;
    +	next;
         }
    -    if ($snip && /^----- snip:end -----/) {
    -	print "
    "; - $snip=0; - goto cont; + if ($pre) { + print "
    \n"; + $pre = 0; } - if ($snip) { - goto cont; + if (/^$/) { + print "

    "; + next; } if (//) { chomp; @@ -53,7 +78,7 @@ while () { s/\@\@\@(.*?)\@\@\@/$1<\/a>/; if (s/\((.?)\)/XX$1XX/g) { while (/([A-Za-z_\.]*)XX(.?)XX/) { - foreach $section ("apps", "ssl", "crypto") { + foreach my $section ("apps", "ssl", "crypto") { if (-f "../docs/$section/$1.html") { s|([A-Za-z_\.]*)XX(.?)XX|$1($2)|; goto found; @@ -64,32 +89,19 @@ while () { } } if (/^\[([^\[]+)\] =+/) { - $l=$1; - $n=0; + $l = $1; + $n = 0; print "


    \n"; - print "

    [$1]

    \n"; + print "

    [$1] $top

    \n"; } elsif (/^\* (.*)/) { $n++; - print "\n

    $n. $1

    \n"; + print "\n

    $n. $1$top

    \n"; } elsif (/^$/) { print "

    "; - } elsif (/^ /) { - print "

    " unless $pre;
    -	$pre=1;
    -	print;
    -    } else {
    -	print "
    \n" if $pre; - $pre=0; + } + else { print; } - cont: } exit(0); - -sub escape -{ - s/\&/\&/g; - s/\/\>/g; -} diff --git a/bin/mk-filelist b/bin/mk-filelist new file mode 100755 index 0000000..e6b6088 --- /dev/null +++ b/bin/mk-filelist @@ -0,0 +1,52 @@ +#! /usr/bin/perl -w +use strict; + +die "Missing args\n" if $#ARGV < 2; +my $SRCDIR = $ARGV[0]; shift; +my $URLBASE = $ARGV[0]; shift; +my $GLOB = join(' ', @ARGV); + +my @months = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); + +sub ls { + my ($pat) = @_; + my @F = sort { (stat($b))[9] <=> (stat($a))[9]; } (glob($pat)); + my @R = (); + foreach my $f (@F) { + next if ($f =~ m|^index.*|); + next if -d $f; + my @S = stat($f); + my @T = localtime($S[9]); + push(@R, sprintf("%d %d-%s-%02d %02d:%02d:%02d %s", + $S[7] / 1024, + 1900+$T[5], $months[$T[4]], $T[3], + $T[2], $T[1], $T[0], + $f)); + } + return @R; +} + +chdir $SRCDIR || die "Can't chdir $SRCDIR, $!"; +my @L = &ls($GLOB); +foreach my $l (@L) { + next if $l =~ m|^\s*$|; + my @fields = split / /, $l; + # Size, date, time, filename + my $fs = $fields[0]; + my $fd = $fields[1] . " " . $fields[2]; + my $ff = $fields[3]; + my $url = $URLBASE . $ff; + my $r = "$ff"; + $r .= " (SHA256)" if -f "$ff.sha256"; + $r .= " (PGP sign)" if -f "$ff.asc"; + $r .= " (SHA1)" if -f "$ff.sha1"; + # $r .= " (MD5)" if -f "$ff.md5"; + print "\n"; + print " $fs \n"; + print " $fd \n"; + print " $r\n"; + print "\n"; +} + +exit(0); diff --git a/bin/mk-sitemap b/bin/mk-sitemap new file mode 100755 index 0000000..d53d3cb --- /dev/null +++ b/bin/mk-sitemap @@ -0,0 +1,40 @@ +#! /usr/bin/perl -w +use strict; + +sub +dodir() +{ + my $dir = shift; + my $level = shift || 1; + my @files = (); + my @dirs = (); + + foreach my $entry ( glob($dir . "/*")) { + if (-f $entry ) { + next unless $entry =~ m/.*\.(html|pdf|txt|png)$/; + push @files, $entry; + } elsif ( -d $entry ) { + push @dirs, $entry; + } + } + + foreach my $entry ( @files ) { + $entry =~ s at .*/@@; + next if $entry eq 'template-file.html'; + print "\t" x $level, $entry, "\n"; + } + + foreach my $entry ( @dirs) { + $entry =~ s@^\.\/@@; + next if $entry =~ m/.git|inc|img|bin/; + next if $entry =~ m/secadv/; + my $simple = $entry; + $simple =~ s at .*/@@; + print "\n", "\t" x $level, $simple, "/\n"; + &dodir($entry, $level + 1); + } +} + +print "/\n"; +&dodir('.', 0); +exit(0); diff --git a/bin/vulnerabilities.xsl b/bin/vulnerabilities.xsl new file mode 100644 index 0000000..83971a6 --- /dev/null +++ b/bin/vulnerabilities.xsl @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + st + nd + rd + th + + + + + January + February + March + April + May + June + July + August + September + October + November + December + + + + + + + + + + + + + Do not edit this file; edit vulnerabilities.xml + + +

    Table of Contents

    +
      + + + +
    • +
      +
    + + + + + +

    + +

    +
    + + + +
    +
    +
    + + +
    + + + (OpenSSL advisory) + + + [ severity] + + + + + : <a href="#toc"><img src="/img/up.gif"/></a> +
    +
    + + + Reported by . + +
      + +
    • Fixed in OpenSSL + + + (git commit) + + + + + + (Affected + + + + ? + + + , + + + ) + + +
    • +
      +
    +
    +
    + + + + + + The Common Vulnerabilities and Exposures project + has assigned the name + + CVE- + + to this issue. + + + + + +
    diff --git a/community/binaries.html b/community/binaries.html new file mode 100644 index 0000000..7774af5 --- /dev/null +++ b/community/binaries.html @@ -0,0 +1,67 @@ + + + + + + + + +
    +
    +
    +
    +

    Binaries

    +
    +

    Some people have offered to provide OpenSSL binary + distributions for selected operating systems. The condition to + get a link here is that the link is stable and can provide + continued support for OpenSSL for a while.

    + +

    Note: many Linux distributions come with pre-compiled OpenSSL + packages. Those are already well-known among the users of said + distributions, and will therefore not be mentioned here. + If you are such a user, we ask you to get in touch with your + distributor first. This service is primarly for operating systems + where there are no pre-compiled OpenSSL packages.

    + +
    +
    OpenSSL for Windows
    +
    Works with MSVC++, Builder 3/4/5, and MinGW. Comes in form + of self-install executables. + http://www.slproweb.com/products/Win32OpenSSL.html +
    + +
    OpenSSL for Windows
    +
    Pre-compiled Win32/64 libraries without external + dependencies to the Microsoft Visual Studio Runtime DLLs, except + for the system provided msvcrt.dll. + http://indy.fulgan.com/SSL/ +
    + +
    OpenSSL for Solaris
    +
    Versions for Solaris 2.5 - 11 SPARC and X86 + http://www.unixpackages.com/ +
    +
    +

    +
    + +
    +
    + +
    +
    + + + + + + diff --git a/community/contacts.html b/community/contacts.html new file mode 100644 index 0000000..a18948b --- /dev/null +++ b/community/contacts.html @@ -0,0 +1,107 @@ +

    About the OpenSSL Project

    + + + + + + + +
    +
    +
    +
    +

    Contact Us

    +
    +

    + +

    Apart from email addresses and names, some organizations require + a physical address as contact for open source projects. Physical + addresses can be useful in other cases as well. Therefore, some + people have stepped forward and volunteered as "official" contacts + for OpenSSL. If you want to get in touch with any of these + people, please consider using email first, since that will also + reach other team members in case your contact is temporarly not + available.

    + +

    Please remember to be kind to the contacts. Their time is + their own to dispose of. You may request support, but + it's the contact's responsability and freedom alone to decide if + he wants to give any support or not, regardless of who makes the + request.

    + +

    TheOpenSSL Software Foundation represents the OpenSSL + project in most capacities including contributor license + agreements, managing donations, and so on. + +

    + OpenSSL Software Foundation
    + 20-22 Wenlock Road
    + London
    + N1 7GU
    + United Kingdom
    + +44 1785508015 (UK)
    + +1 877-OPENSSL(6775) (US toll free)
    + +1 301-956-2281 (US)
    + info at opensslfoundation.org +
    +

    + +

    OpenSSL Software Services represents the OpenSSL + project for selected commercial or quasi-commercial contexts, such + as providing formal support contracts and brokering consulting + contracts for OpenSSL team members. +

    + OpenSSL Software Services Inc.
    + 40 E Main St, Suite 744
    + Newark DE 19711
    + USA
    + +1 240-215-3103
    + info at opensslservices.com +
    +

    + +

    Commercial activities specific to FIPS 140-2 validations and + the OpenSSL FIPS Object Module are handled by + OpenSSL Validation Services. +

    + OpenSSL Validation Services Inc.
    + 1829 Mount Ephraim Road
    + Adamstown, MD 21710
    + USA
    + +1 301-874-2571
    + info at openssl.com +
    +

    + +

    Some OpenSSL team members are available for selected consulting + engagements.

    + +

    In Sweden:

    + +
    + OpenSSL SE
    + c/o Richard Levitte
    + Nordingr?gatan 20
    + S-162 53 V?llingby
    + Sweden
    + openssl-contact.SE at openssl.org +
    +

    + +
    + +
    +
    + +
    +
    + + + + + diff --git a/community/index.html b/community/index.html new file mode 100644 index 0000000..091bff5 --- /dev/null +++ b/community/index.html @@ -0,0 +1,91 @@ + + + + + + + +
    +
    +
    +
    +

    Community

    +
    +

    + OpenSSL is a a collaborative effort of a worldwide community of + volunteers. Here are some of the ways you can join the + community and contribute. + The list of development team members is + available, as is a description of how to + contact us off-line. We'd also like + to thank several groups for help with + the project infrastructure over time. +

    + +

    + We maintain several mailing lists. + Anyone can join, but you must be a member of a list to post to it. + We have a public wiki, + and anyone can request an account and start adding content. + We have a team blog, where members of + the development team will occasionally post. +

    + +

    + While we only distribute source, some members of the community + make binaries available. +

    + +

    Reporting Bugs

    + +

    If you think have found a security bug, please see our + vulnerabilities page + for information on how to report it.

    + +

    We have set up a request tracker at + http://rt.openssl.org, + with read-only access using guest as the name + and password. + Requests can be viewed on-line by using the following URL, + replacing NNNN with the request number: + http://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=NNNN +

    + +

    To report a bug or make an enhancement request, send email + to rt at openssl.org. + In the subject line, please make sure to indicate if its a + bug, a fix, and a brief description of the issue. In the + body of your mail, please include the version of operationg + system and OpenSSL you are using. If you have a patch or diff, + please send it as an attachment, and not inline in + the message body.

    + +

    The easiest way to respond to an existing request is to reply + to the relevant message in openssl-dev at openssl.org. + To help avoid duplicate copies, edit the recipient list so that + only rt at openssl.org is listed and remove any quoted + material. +

    + +

    You can also create a pull request in + GitHub, + but if you do that, please also use RT and refer to the + request number. That way we are less likely to lose track + of things.

    + + +
    +
    + +
    +
    + + + + + + diff --git a/community/mailinglists.html b/community/mailinglists.html new file mode 100644 index 0000000..5ca5d4c --- /dev/null +++ b/community/mailinglists.html @@ -0,0 +1,100 @@ + + + + + + + +
    +
    +
    +
    +

    Mailing Lists

    +
    +

    + Here is are the + mailing lists we run. + You must be a member of the list to post to it. +

    + + + + + + + + + + + + + + + + + + + +
    ListPurpose
    openssl-announceOfficial Project Announcements; low-volume read-only.
    openssl-commitsCommits to the source repository; read-only
    openssl-devDiscussions on development of the OpenSSL library. + This is not the place for application development + questions!
    openssl-usersApplication Development, installing and configuring + OpenSSL, etc.
    +

    + +

    Archives

    + +

    + Public archives can be found at the following locations: +

    + + + + + +
    ListArchives
    openssl-announce + http://marc.info/?l=openssl-announce
    + http://www.mail-archive.com/openssl-announce at openssl.org/ +
    openssl-users + http://marc.info/?l=openssl-users
    + http://www.mail-archive.com/openssl-users at openssl.org/
    + http://groups.google.com/groups?group=mailing.openssl.users
    +
    openssl-dev + http://marc.info/?l=openssl-dev
    + http://www.mail-archive.com/openssl-dev at openssl.org/
    + http://groups.google.com/groups?group=mailing.openssl.dev +
    openssl-commits + http://marc.info/?l=openssl-cvs + http://groups.google.com/groups?group=mailing.openssl.cvs +
    +
    + +
    +
    + +
    +
    + + + + + + diff --git a/community/sidebar.inc b/community/sidebar.inc new file mode 100644 index 0000000..4cbbebb --- /dev/null +++ b/community/sidebar.inc @@ -0,0 +1,32 @@ + + + + + diff --git a/community/team.html b/community/team.html new file mode 100644 index 0000000..b733f82 --- /dev/null +++ b/community/team.html @@ -0,0 +1,174 @@ + + + + + + + +
    +
    +
    +
    +

    Team

    +
    +

    + The OpenSSL development team consists of people who have commit + access to the source repository. + Policies and procedures are adopted after a majority vote of + the dev-team. + +

    + The current OpenSSL development team consists of (in alphabetical + order): +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameEmailLocale PGP Key ID
    Matt Caswellmatt at openssl.orgUKD9C4D26D0E604491
    Mark J. Cox*mark at openssl.orgUK27585B2E26B927CA29D660CFEAC0FF30DCE1DD5A +
    Viktor Dukhovniviktor at openssl.orgUS 
    Dr. Stephen Henson*steve at openssl.orgUKD3577507FA40E9E2 +
    Tim Hudsontjh at openssl.orgAU9195C48241FBF7DD
    Lutz Jänickejaenicke at openssl.orgDEDFAB592ABDD52F1C +
    Emilia Käsperemilia at openssl.orgCH
    Ben Laurie*ben at openssl.orgUK4F6DE1562118CF83
    Steve Marquessmarquess at openssl.orgUSCE1AE41903B0216376DCC2357E5776CE7D86D554 +
    Richard Levittelevitte at openssl.orgSE98BB1B36A0210D0139948153DC137F72BE01CD05 +
    Bodo Möllerbodo at openssl.orgCHAA589DAC5A6A9B85
    Andy Polyakov*appro at openssl.orgSEBA6CDA461FE8E023
    Kurt Roeckxkurt at openssl.orgBE2064C53641C25E5D
    Rich Salzrsalz at openssl.orgUSF23479455C51B27C
    Geoff Thorpegeoff at openssl.orgQC0833F510E18C1C32
    + *Names with an asterisk indicate members of the core team. +

     

    + +

    + In addition, we gratefully acknowledge the contributions of the + following alumni: Ralf S. Engelschall, Nils Larsch, Holger Reif, and + Paul C. Sutton. We also respectfully remember Ulf Möller who + is no longer with us. +

    +
    + + +
    +
    + +
    +
    + + + diff --git a/community/thanks.html b/community/thanks.html new file mode 100644 index 0000000..8433046 --- /dev/null +++ b/community/thanks.html @@ -0,0 +1,75 @@ + + + + + + + +
    +
    +
    +
    +

    Thanks!

    +
    +

    + We'd like to thank the following individuals and organizations + who contribute to the OpenSSL project. +

    + +
      +
    • Our current hosting is provided courtesy of + SpaceNet AG.
    • +
    • Thanks to + GMO GlobalSign + for providing free TLS certificates.
    • +
    • Thanks to rsync.net for + providing free backup storage.
    • +
    • Thanks to Eric Young and Tim Hudson for the SSLeay + package on which OpenSSL is based.
    • +
    • Thanks to Tony Arcieri for the updated logo and some + important tweaks to the CSS.
    • +
    • Thanks to Octopress + for providing the CSS basis for the redesign, as well as + our entire blog machinery.
    • +
    + +

    + We'd also like to recognize the following for their prior + support: +

    +
      +
    • Thanks to C2Net for contributing back to the Open Source + community the SSLeay version 0.9.1b, which was the last internal + SSLeay version Eric and Tim created while working for + C2Net.
    • + +
    • Thanks to the Development Team of Internet Services at + Cable & Wireless Munich, + Germany, for providing the hardware and network resources for + some time after 2002.
    • + +
    • Thanks to the IT Support Group of the Department of + Information Technology and Electrical Engineering at the + Swiss Federal Institute of Technology Zurich + (ETHZ) for providing the hardware and network resources + from 1998 to 2002. +
    • +
    + +
    + +
    +
    + +
    +
    + + + + + diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index ea742a5..0000000 --- a/docs/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -crypto -ssl -apps diff --git a/docs/.wmlrc b/docs/.wmlrc deleted file mode 100644 index ab44064..0000000 --- a/docs/.wmlrc +++ /dev/null @@ -1,10 +0,0 @@ -## -## .wmlrc -- Local RC file for WML -## - -# define where the URL root of the Sub Navigation Bar (SNB) -# is located [SNB_ROOT] and where it's buttons are defined [SNB_RC] --DSNB_ROOT~. --DSNB_RC=.wmlsnb --I. - diff --git a/docs/.wmlsnb b/docs/.wmlsnb deleted file mode 100644 index e53d69d..0000000 --- a/docs/.wmlsnb +++ /dev/null @@ -1,15 +0,0 @@ -## -## .wmlsnb -- Sub Navigation Bar Specification for WML -## - - - - - - - - - - - - diff --git a/docs/HOWTO/.gitignore b/docs/HOWTO/.gitignore deleted file mode 100644 index 2211df6..0000000 --- a/docs/HOWTO/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.txt diff --git a/docs/faq.html b/docs/faq.html new file mode 100644 index 0000000..0f8a061 --- /dev/null +++ b/docs/faq.html @@ -0,0 +1,31 @@ + + + + + + + +
    +
    +
    + +
    + +
    +
    + + + + + diff --git a/docs/fips.html b/docs/fips.html new file mode 100644 index 0000000..61b4378 --- /dev/null +++ b/docs/fips.html @@ -0,0 +1,65 @@ + + + + + +
    +
    +
    +
    +

    FIPS-140

    +
    + +

    The OpenSSL project has collaborated with the Open Source Software Institute + on the groundbreaking OpenSSL FIPS Object Module and other + validations. For a basic introduction and some general + background see Important Notes About OpenSSL and FIPS 140-2. + For information about sponsorship and support, see + OpenSSL and FIPS 140-2 +

    + + +

    The most recent open source based validation of a cryptographic + module (Module) compatible with the OpenSSL libraries is v2.0.1, + FIPS 140-2 certificate #1747. + This Module is documented in the + 2.0 User Guide. +

    + +

    Thanks to multiple platform sponsorships the 2.0 validation + includes the largest number of formally tested platforms for any + validated module.

    + + The source code and + User Guide are available. + Here is the complete set of files:

    + + + + + + + + + +
    KBytes Date  File 
    +

     

    + +
    + +
    +
    + +
    +
    + + + diff --git a/docs/fips/SecurityPolicy-1.1.1.pdf b/docs/fips/SecurityPolicy-1.1.1.pdf new file mode 100644 index 0000000..e79ba44 Binary files /dev/null and b/docs/fips/SecurityPolicy-1.1.1.pdf differ diff --git a/docs/fips/SecurityPolicy-1.1.2.pdf b/docs/fips/SecurityPolicy-1.1.2.pdf new file mode 100644 index 0000000..4cab221 Binary files /dev/null and b/docs/fips/SecurityPolicy-1.1.2.pdf differ diff --git a/docs/fips/SecurityPolicy-1.2.2.pdf b/docs/fips/SecurityPolicy-1.2.2.pdf new file mode 100644 index 0000000..0cf6e9e Binary files /dev/null and b/docs/fips/SecurityPolicy-1.2.2.pdf differ diff --git a/docs/fips/SecurityPolicy-1.2.3.pdf b/docs/fips/SecurityPolicy-1.2.3.pdf new file mode 100644 index 0000000..b4e8c71 Binary files /dev/null and b/docs/fips/SecurityPolicy-1.2.3.pdf differ diff --git a/docs/fips/SecurityPolicy-1.2.4.pdf b/docs/fips/SecurityPolicy-1.2.4.pdf new file mode 100644 index 0000000..2bb1ace Binary files /dev/null and b/docs/fips/SecurityPolicy-1.2.4.pdf differ diff --git a/docs/fips/SecurityPolicy-1.2.pdf b/docs/fips/SecurityPolicy-1.2.pdf new file mode 100644 index 0000000..9ac0515 Binary files /dev/null and b/docs/fips/SecurityPolicy-1.2.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.1.pdf b/docs/fips/SecurityPolicy-2.0.1.pdf new file mode 100644 index 0000000..e93e0e1 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.1.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.2.pdf b/docs/fips/SecurityPolicy-2.0.2.pdf new file mode 100644 index 0000000..088b749 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.2.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.3.pdf b/docs/fips/SecurityPolicy-2.0.3.pdf new file mode 100644 index 0000000..5e5fccc Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.3.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.4.pdf b/docs/fips/SecurityPolicy-2.0.4.pdf new file mode 100644 index 0000000..1cca3ac Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.4.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.5.pdf b/docs/fips/SecurityPolicy-2.0.5.pdf new file mode 100644 index 0000000..5b54047 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.5.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.6.pdf b/docs/fips/SecurityPolicy-2.0.6.pdf new file mode 100644 index 0000000..78a5945 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.6.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.7.pdf b/docs/fips/SecurityPolicy-2.0.7.pdf new file mode 100644 index 0000000..0f1a607 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.7.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.8.pdf b/docs/fips/SecurityPolicy-2.0.8.pdf new file mode 100644 index 0000000..95da962 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.8.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.9.odt b/docs/fips/SecurityPolicy-2.0.9.odt new file mode 100644 index 0000000..8c285b0 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.9.odt differ diff --git a/docs/fips/SecurityPolicy-2.0.9.pdf b/docs/fips/SecurityPolicy-2.0.9.pdf new file mode 100644 index 0000000..b4ff166 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.9.pdf differ diff --git a/docs/fips/SecurityPolicy-2.0.pdf b/docs/fips/SecurityPolicy-2.0.pdf new file mode 100644 index 0000000..b4ff166 Binary files /dev/null and b/docs/fips/SecurityPolicy-2.0.pdf differ diff --git a/docs/fips/UserGuide-1.1.1.pdf b/docs/fips/UserGuide-1.1.1.pdf new file mode 100644 index 0000000..edb94fa Binary files /dev/null and b/docs/fips/UserGuide-1.1.1.pdf differ diff --git a/docs/fips/UserGuide-1.2.pdf b/docs/fips/UserGuide-1.2.pdf new file mode 100644 index 0000000..a0d0155 Binary files /dev/null and b/docs/fips/UserGuide-1.2.pdf differ diff --git a/docs/fips/UserGuide-2.0.pdf b/docs/fips/UserGuide-2.0.pdf new file mode 100644 index 0000000..6150d8d Binary files /dev/null and b/docs/fips/UserGuide-2.0.pdf differ diff --git a/docs/fips/UserGuide.pdf b/docs/fips/UserGuide.pdf new file mode 100644 index 0000000..126ef28 Binary files /dev/null and b/docs/fips/UserGuide.pdf differ diff --git a/docs/fips/fips-2.0-tv.tar.gz b/docs/fips/fips-2.0-tv.tar.gz new file mode 100644 index 0000000..0c9a275 Binary files /dev/null and b/docs/fips/fips-2.0-tv.tar.gz differ diff --git a/docs/fips/fipsnotes.wml b/docs/fips/fipsnotes.wml deleted file mode 100644 index ef2b234..0000000 --- a/docs/fips/fipsnotes.wml +++ /dev/null @@ -1,115 +0,0 @@ - -#use wml::openssl area=documents page=FIPS140 - -Important Notes about OpenSSL and FIPS 140-2 - -

    OpenSSL and FIPS 140-2

    - -Please please read the User Guide. Nothing will make sense otherwise (it still may not afterwards, but at least you've a better chance). - -

    FIPS What? Where Do I Start?

    - -Ok, so your company needs FIPS validated cryptography to land that big sale, and your product currently uses OpenSSL. -You haven't worked up the motivation to wade through the entire User Guide and want the -quick "executive summary". Here is a grossly oversimplified account: -

    -

      - -
    • OpenSSL itself is not validated, and never will be. Instead a special carefully defined software component called the -OpenSSL FIPS Object Module has been created. This Module was designed for compatibility with OpenSSL so that products using -the OpenSSL API can be converted to use validated cryptography with minimal effort. -

      - -

    • The OpenSSL FIPS Object Module validation is unique among all FIPS 140-2 validations in that the product is "delivered" -in source code form, meaning that if you can use it exactly as is and can build it (according to the very specific documented -instructions) for your platform, then you can use it as validated cryptography on a "vendor affirmed" basis. -

      - -

    • If even the tiniest source code or build process changes are required for your intended application, you cannot use -the open source based validated module directly. You must obtain your own validation. This situation is common; see "Private -Label" validation, below. -

      - -

    • New FIPS 140-2 validations (of any type) are slow (6-12 months is typical), expensive -(US$50,000 is probably typical for an uncomplicated validation), and unpredictable -(completion dates are not only uncertain when first beginning a validation, but remain so -during the process). - -
    -Note that FIPS 140-2 validation is a complicated topic that the above summary does not adequately address. You have been warned! - - -

    The "Private Label" Validation

    -
    - -We refer to validations based directly on the OpenSSL FIPS Object Module as -"private label" validations. These are also sometimes referred to as "cookie cutter" -validations. The usual reason for such separate validations is the need for small -modifications which forces a complete new validation, but some vendors, -for marketing or risk management reasons, have obtained private label validations for binaries -produced from unmodified (or only cosmetically modified) source code. -

    -The OSF would really prefer to work on open source based validations of benefit -to the OpenSSL user community at large, but financial support for that objective -is intermittent at best. On the other hand many vendors are interested in private label -validations and the OSF will assist in such efforts on a paid basis. We've done enough -of these to be very cost competitive, and for uncomplicated validations we typically work -on a fixed price basis. - -

    -Update: As of 2015 we are no longer performing -private label validations. -We are still adding new -platforms to the - #1747 -or related validations. - -

    Current Validations

    - -The most recent open source based validation is the -OpenSSL FIPS Object Module v2.0, -FIPS 140-2 certificate - #1747. You will need the - Security Policy and - source at a minimum. Note that for this validation a -new "secure installation" requirement has been imposed. -And did we mention the User Guide? -

    - -Important Note: - -Due to changes in the FIPS 140-2 validation requirements the current v2.0 Module is -no longer a suitable model for private label validations in its current form past the year 2014. -

    - -

    Upcoming Validations

    -

    -No new validations are currently planned. The I.G. 9.5 -issue has effectively precluded consideration of new validations for much of 2013, but with the July 25 2013 update of the -Implementation Guidance -(I.G.) document such validations appear to be feasible again. We will be happy to discuss our current understanding of -the risks with interested sponsors. - -

    Technical Notes

    -

    Performance at Startup

    -We have had many complaints about poor performance of the Power-On Self Test (POST) on low -powered computers, as with some embedded devices. In the worst cases the POST can take several minutes. -Such devices were not included as test platforms at the time the code was originally written. -

    -The current FIPS validated code performs a very comprehensive set of mandatory -algorithm self tests when it enter FIPS mode covering many algorithm -combinations. There is a DSA parameter generation self test which is -especially CPU intensive. -

    -As a result of the POST performance issue we revisited the KAT (Known Answer Test) -requirements in the POST process that were burning up most of those -cycle. In consultation with a CMVP test lab we determined that it should -be possible to substantially reduce that performance penalty in a new -validation. Unfortunately such a change can only be undertaken in the context -of a new validation, and not as a change letter modification. -

    -Another factor affecting performance is the use (or not) of platform specific -optimizations. The x86/x64 Windows and Linux code makes use of assembly language -optimizations for FIPS cryptographic algorithms. The C only version -is much slower and so the POST is slower too. - diff --git a/docs/fips/fipsvalidation.wml b/docs/fips/fipsvalidation.wml deleted file mode 100644 index b75ffb7..0000000 --- a/docs/fips/fipsvalidation.wml +++ /dev/null @@ -1,164 +0,0 @@ - -#use wml::openssl area=documents page=FIPS140 - -OpenSSL and FIPS 140-2 - -

    OpenSSL and FIPS 140-2 Validation Status

    - -The most recent open source based validation of a cryptographic module (Module) compatible with the -OpenSSL libraries is v2.0.1, FIPS 140-2 certificate - #1747. -This Module is documented in the 2.0 User Guide. -It substantially updates and improves the earlier v1.2 module, FIPS 140-2 certificate - #1051, which -is documented in the 1.2 User Guide. -

    -Important Note: -Due to new requirements introduced in 2013 the current v2.0 Module is no longer suitable as a -reference for private label validations; see the I.G. 9.5 FAQ. -Due to earlier changes in the FIPS 140-2 validation -requirements the v1.2 Module is no longer be a suitable model for private label validations -in its current form past the year 2010; see the NIST - Notices, -discussion paper and -Draft 800-131. -

    -

    The 2.0 Validation

    -On January 4, 2011 we began work on the new open source FIPS 140-2 Level 1 validation. -This validation covers most of the objectives we have been wanting to achieve in a new validation, -including: -
      - -
    • Satisfying the new CMVP testing guidelines. -

      -

    • One or more new PRNG implementations. -

      - -

    • Algorithm test programs for the AESGCM and ECDSA algorithms. -

      - -

    • RSA encryption. -

      - -

    • Upgrade DSA2 for key sizes greater then 1024. -

      - -

    • Any mandatory additional tests or algorithm modifications for the testing guidelines. -

      -

    • An extensive re-design of the FIPS Module to eliminate OpenSSL revision dependencies. The new module -will live in a completely separate purpose-built source distribution. In contrast to the current module, -this new module will at least in principle be useful in some stand-alone contexts requiring only low -level cryptographic primitives. - -
    -In addition this validation also includes: -
      - -
    • Suite B cryptography, and a "Suite B" mode of operation enforcement similar -to that provided by the current "FIPS capable" OpenSSL. - -
    - -Thanks to multiple platform sponsorships the 2.0 validation includes the largest number -of formally tested platforms for any validated module. - -

    Current Status

    -The validation was awarded on June 27, 2012, certificate number -#1747. -The source code and -User Guide document can be downloaded from the -OpenSSL web site. - -On July 9, 2012 the first "change letter" update was approved, adding six additional platforms and a new -revision number of 2.0.1. The revised source code can be used -for all tested platforms, though the older 2.0 -source distribution remains valid for the platforms tested -at that time. - -On October 24, 2012, the second "change letter" update was approved, adding two additional platforms and a new -revision number of 2.0.2. The revised source code can be used -for all tested platforms, though the older 2.0 and 2.0.1 revisions -remain valid for the platforms tested at the time those revisions were approved. - - -

    Sponsors

    -
    -The OpenSSL FIPS Object Module validations receive support from multiple sources for each -validation effort; however only those sponsors who have elected to be recognised -for their contribution to OpenSSL are listed below. - -

    -If you have an interest in sponsoring any changes or additions to this validation -please contact OpenSSL Validation Services. -

    -Some commercial software vendors ask us "what do we gain from sponsoring a validation -that our competition can also use?". Our answer is "nothing, if you think in terms of -obstructing your competition". If, on the other hand, you compete primarily on the -merits of you products what others may do with the validation is less of a threat as -they derive no more advantage from it than you do. Your advantage is that your sponsorship -will probably cost less that the commercial software license you would otherwise have to buy, -and you will retain backwards compatibility with the regular OpenSSL API while avoiding -vendor lock-in. - diff --git a/docs/fips/incore.gz b/docs/fips/incore.gz new file mode 100644 index 0000000..c6171f0 Binary files /dev/null and b/docs/fips/incore.gz differ diff --git a/docs/fips/index.wml b/docs/fips/index.wml deleted file mode 100644 index 0bb9a6a..0000000 --- a/docs/fips/index.wml +++ /dev/null @@ -1,24 +0,0 @@ - -#use wml::openssl area=documents page=FIPS140 - -FIPS140 Files - -

    FIPS140 Files

    - -Here you can find a number of FIPS140 related files including the user -guide and test vectors. -The latest User Guide is the best place to start. For a basic -introduction and some general background see -Important Notes About OpenSSL and FIPS 140-2, also note the -summary and status of the ongoing open source based OpenSSL FIPS Object Module validation. -

    - -

    -Note FIPS module and FIPS validation support is included in some of the -OpenSSL support plans. Assistance -with private label validation is also available on a - consultancy basis. -

    -The OpenSSL project has collaborated with the -Open Source Software Institute on the groundbreaking OpenSSL FIPS Object Module -and other validations. diff --git a/docs/fips/privatelabel.html b/docs/fips/privatelabel.html new file mode 100644 index 0000000..00a9740 --- /dev/null +++ b/docs/fips/privatelabel.html @@ -0,0 +1,133 @@ + + + + + + +

    +
    +
    +
    +

    OpenSSL FIPS 140-2 Private Label Validations

    +
    +

    If you haven't already, please read our FIPS 140-2 Notes page.

    + +

    IMPORTANT NOTE: The addition of multiple new + formal requirements since the #1747 validation was first approved + in 2012, and recent unfavorable experiences with increasingly + unpredictable outcomes from the validation process, have increased + to the point where private label validations are no longer + economically feasible for a small organization of limited means; + the risk doesn't justify the substantial investment of time and + money required to pursue new validations. As of 2015 we are no + longer performing any private label validations. The addition of + new platforms to the existing #1747 or comparable + validations is still possible and those validation actions are still + being performed.

    + +

    The rest of this page is of historical interest only.

    + +

    What It Is

    + +

    We have found that one of the most popular commercial services + offered by the OpenSSL team is the private label validation. + It's not a business we ever planned to be in, but as the + originators of the source code based OpenSSL FIPS Object Module + validations, and with lots of practice, we've gotten pretty good + at it. The revenue we earn from these validations supports the + OpenSSL project, and for some validations also results in useful + additions to the OpenSSL baseline.

    + + +

    What You Get

    + +

    For a total fixed price we will obtain a Level 1 FIPS 140-2 + validation in your name using the OpenSSL FIPS Object Module v2.0 + for two common platforms using unmodified source code. A common + platform is a computing device (hardware and operating system) + that is available and familiar to us and the test lab(s). + Examples of common platforms are:

    +
      +
    • Microsoft Windows (32 bit) on x86 hardware
    • +
    • Microsoft Windows (64 bit) on x64 hardware
    • +
    • Linux on 32 bit x86 hardware
    • +
    • Linux (64 bit) on x64 hardware +
    • The Android operating system on some common smart phones + using ARM processors
    • +
    • HP-UX 11 on Itanium
    • +
    • Solaris on x64 hardware
    • +
    + +

    Additional common platforms can be added to your validation for + US$4000 (Linux/Unix/Android) or US$4500 (desktop/server Windows) + each.

    + +

    We will handle all interaction with the accredited testing lab + and the CMVP. + You sign one contract with the OSF with half of the price due as a + down payment and the remainder due only when your certificate is posted + by the CMVP.

    + +

    Within two weeks of executing your contract with us, your + pending validation will also appear on the pre-val list. + The presence of your product on this list is sufficient + to satisfy FIPS 140-2 requirements for some procurements.

    + +

    What Qualifies

    + +

    This turnkey validation package is applicable in the following + circumstances:

    +
      +
    • You have already confirmed that the module generated from + the OpenSSL FIPS Object Module v2.0 source distribution, + possibly with modifications, works on your platform(s).
    • +
    • Your modifications to the OpenSSL source code, if any, are + not "cryptographically significant". Roughly speaking, that + means the modifications do not affect the actual cryptographic + algorithms. Modifications for portability, such as changing + #include statements or redefining macros, or changes to + the build process such as new compiler or linker options, are + generally acceptable.
    • +
    • Your application does not require cross-compilation (the + build system and the target platform can be the same system), + or your cross-compiled platform is one for which the + complete build process, including generation of the integrity + test digest, is already known and tested.
    • +
    • The actual platform, hardware and software, is either + already available to the OSF and the lab or is supplied by you. + We will need at least two complete sets of platform hardware and + software for customer provided equipment. This equipment can be + returned once the validation is awarded, though some customers + have preferred to leave that equipment with us for regression + testing of future revisions.You have determined that the performance of the module is + satisfactory on your specific target platform. We continually + make performance enhancements to OpenSSL, only some of which can + readily be incorporated into routine private label + validations.
    • +
    +

    Note that we can still help you if not all of these + circumstances apply, but we'll have to look at your specific + situation more closely. Note minor software modifications can + often be accommodated in a change letter modification.

    + +
    +

    Interested? Contact + OpenSSL Software Services. +

    + +
    +
    +
    +
    +
    + + + diff --git a/docs/fips/privatelabel.wml b/docs/fips/privatelabel.wml deleted file mode 100644 index 19a4f6e..0000000 --- a/docs/fips/privatelabel.wml +++ /dev/null @@ -1,98 +0,0 @@ - -#use wml::openssl area=documents page=FIPS140 - -OpenSSL FIPS 140-2 Private Label Validations - -

    One Stop Package Deal for Private Label Validations

    - -If you haven't already, please read our FIPS 140-2 Notes page. - -

    -IMPORTANT NOTE: The addition of -multiple new formal requirements since the #1747 validation was first approved in 2012, and -recent unfavorable experiences with increasingly unpredictable outcomes from the validation process, have increased -to the point where private label validations are no longer economically feasible for a small -organization of limited means; the risk doesn't justify the substantial investment of time and money required -to pursue new validations. As of 2015 we are no longer performing any private label validations. The addition of -new platforms to the existing #1747 or comparable validations -is still possible and those validation actions are still being performed. -

    -The rest of this page is of historical interest only. - -

    What It Is

    - -We have found that one of the most popular commercial services offered by the OpenSSL team -is the private label validation. It's not a -business we ever planned to be in, but as the originators of the source code based -OpenSSL FIPS Object Module validations, and with lots of practice, we've gotten pretty good at it. -The revenue we earn from these validations supports the OpenSSL project, and for some -validations also results in useful additions to the OpenSSL baseline. -

    - - -

    What You Get

    - -For the total fixed price of as little as US$[TBD] we will obtain a Level 1 FIPS 140-2 validation -in your name using the OpenSSL FIPS Object Module v2.0 for two common platforms using unmodified -source code. A common platform is a computing device (hardware and operating system) -that is available and familiar to us and the test lab(s). Examples of common platforms are: -
      -
    • Microsoft Windows (32 bit) on x86 hardware -
    • Microsoft Windows (64 bit) on x64 hardware -
    • Linux on 32 bit x86 hardware -
    • Linux (64 bit) on x64 hardware -
    • The Android operating system on some common smart phones using ARM processors -
    • HP-UX 11 on Itanium -
    • Solaris on x64 hardware -
    -

    -Additional common platforms can be added to your validation for US$4000 (Linux/Unix/Android) -or US$4500 (desktop/server Windows) each. -

    -We will handle all interaction with the accredited testing lab and the -CMVP. You sign one contract with the -OSF with half of the price due as a down payment and the remainder due only when your certificate is -posted by the CMVP. - -

    -Within two weeks of executing your contract with us, your pending validation will also appear on the -pre-val list. The presence of your product on -this list is sufficient to satisfy FIPS 140-2 requirements for some procurements. - -

    -

    What Qualifies

    -

    -This turnkey validation package is applicable in the following circumstances: -

      -
    • You have already confirmed that the module generated from the -OpenSSL FIPS Object Module v2.0 -source distribution, possibly with modifications, works on your platform(s). -

      -

    • Your modifications to the OpenSSL source code, if any, are not "cryptographically - significant". Roughly speaking, that means the modifications do not affect the - actual cryptographic algorithms. Modifications for portability, such - as changing #include statements or redefining macros, or changes to the build process such - as new compiler or linker options, are generally acceptable. -

      -

    • Your application does not require cross-compilation (the build system and the - target platform can be the same system), or your cross-compiled platform - is one for which the complete build process, including generation of the - integrity test digest, is already known and tested. -

      -

    • The actual platform, hardware and software, is either already available to the OSF and the lab or is supplied by you. - We will need at least two complete sets of platform hardware and software for customer provided equipment. This - equipment can be returned once the validation is awarded, though some customers have preferred - to leave that equipment with us for regression testing of future revisions. -

      -

    • You have determined that the performance of the module is satisfactory on your - specific target platform. We continually make performance enhancements to OpenSSL, - only some of which can readily be incorporated into routine private label validations. -
    -

    -Note that we can still help you if not all of these circumstances apply, but we'll -have to look at your specific situation more closely. -Note minor software modifications can often be accommodated in a change letter modification. -

    -


    - -Interested? Contact OpenSSL Software Services. diff --git a/docs/fips/rsp.HP-UX.2005-07-01.tar.gz b/docs/fips/rsp.HP-UX.2005-07-01.tar.gz new file mode 100644 index 0000000..8313592 Binary files /dev/null and b/docs/fips/rsp.HP-UX.2005-07-01.tar.gz differ diff --git a/docs/fips/rsp.SuSE.2005-06-30.tar.gz b/docs/fips/rsp.SuSE.2005-06-30.tar.gz new file mode 100644 index 0000000..f978047 Binary files /dev/null and b/docs/fips/rsp.SuSE.2005-06-30.tar.gz differ diff --git a/docs/fips/rsp.SuSE.2005-07-01.tar.gz b/docs/fips/rsp.SuSE.2005-07-01.tar.gz new file mode 100644 index 0000000..c5c1ba6 Binary files /dev/null and b/docs/fips/rsp.SuSE.2005-07-01.tar.gz differ diff --git a/docs/fips/testvectors-XP-2007-10-09.zip b/docs/fips/testvectors-linux-2007-10-10.tar.gz similarity index 52% copy from docs/fips/testvectors-XP-2007-10-09.zip copy to docs/fips/testvectors-linux-2007-10-10.tar.gz index e87a4f9..e70c1c1 100644 Binary files a/docs/fips/testvectors-XP-2007-10-09.zip and b/docs/fips/testvectors-linux-2007-10-10.tar.gz differ diff --git a/docs/fips/testvectors.HP-UX.tar.gz b/docs/fips/testvectors.HP-UX.tar.gz new file mode 100644 index 0000000..5b23df6 Binary files /dev/null and b/docs/fips/testvectors.HP-UX.tar.gz differ diff --git a/docs/fips/testvectors.SuSE.tar.gz b/docs/fips/testvectors.SuSE.tar.gz new file mode 100644 index 0000000..fe27023 Binary files /dev/null and b/docs/fips/testvectors.SuSE.tar.gz differ diff --git a/docs/fipsnotes.html b/docs/fipsnotes.html new file mode 100644 index 0000000..56bcc55 --- /dev/null +++ b/docs/fipsnotes.html @@ -0,0 +1,133 @@ + + + + + +
    +
    +
    +
    +

    Important Notes about OpenSSL and FIPS 140

    +
    +

    Please please read the User Guide. + Nothing will make sense otherwise (it still may not afterwards, + but at least you've a better chance).

    + +

    No new validations are currently planned.

    + +

    FIPS What? Where Do I Start?

    + +

    Ok, so your company needs FIPS validated cryptography to land + that big sale, and your product currently uses OpenSSL. You + haven't worked up the motivation to wade through the entire User Guide and want the quick "executive + summary". Here is a grossly oversimplified account:

    +

    + +

      + +
    • OpenSSL itself is not validated, and never will be. Instead + a special carefully defined software component called the + OpenSSL FIPS Object Module has been created. This Module was + designed for compatibility with OpenSSL so that products using + the OpenSSL API can be converted to use validated cryptography + with minimal effort.
    • + +
    • The OpenSSL FIPS Object Module validation is unique among + all FIPS 140-2 validations in that the product is "delivered" in + source code form, meaning that if you can use it exactly as is + and can build it (according to the very specific documented + instructions) for your platform, then you can use it as + validated cryptography on a "vendor affirmed" basis.
    • + +
    • If even the tiniest source code or build process changes are + required for your intended application, you cannot use the open + source based validated module directly. You must obtain your + own validation. This situation is common; see "Private Label" + validation, below.
    • + +
    • New FIPS 140-2 validations (of any type) are slow (6-12 + months is typical), expensive (US$50,000 is probably typical for + an uncomplicated validation), and unpredictable (completion + dates are not only uncertain when first beginning a validation, + but remain so during the process).
    • + +
    + +

    Note that FIPS 140-2 validation is a complicated topic that the + above summary does not adequately address. You have been + warned!

    + +

    The "Private Label" Validation

    + +

    We refer to validations based directly on the OpenSSL FIPS + Object Module as "private label" validations. These are also + sometimes referred to as "cookie cutter" validations. The usual + reason for such separate validations is the need for small + modifications which forces a complete new validation, but some + vendors, for marketing or risk management reasons, have obtained + private label validations for binaries produced from unmodified + (or only cosmetically modified) source code.

    + +

    The OSF would really prefer to work on open source based + validations of benefit to the OpenSSL user community at large, but + financial support for that objective is intermittent at best. On + the other hand many vendors are interested in private label + validations and the OSF will assist in such efforts on a paid + basis. We've done enough of these to be very cost competitive, + and for uncomplicated validations we typically work on a fixed + price basis.

    + +

    Update: As of 2015 we are no longer performing private label validations. We are still adding new platforms to the #1747 + or related validations.

    + +

    Current Validations

    + +

    The most recent open source based validation is the FIPS 140-2 + certificate #1747. + You will need the Security Policy + and source + at a minimum. And did we mention the + User Guide?

    + +

    Performance at Startup

    + +

    We have had many complaints about poor performance of the + Power-On Self Test (POST) on low powered computers, as with some + embedded devices. In the worst cases the POST can take several + minutes. Such devices were not included as test platforms at the + time the code was originally written.

    +

    The current FIPS validated code performs a very comprehensive + set of mandatory algorithm self tests when it enter FIPS mode + covering many algorithm combinations. There is a DSA parameter + generation self test which is especially CPU intensive.

    +

    As a result of the POST performance issue we revisited the KAT + (Known Answer Test) requirements in the POST process that were + burning up most of those cycle. In consultation with a CMVP test + lab we determined that it should be possible to substantially + reduce that performance penalty in a new validation. + Unfortunately such a change can only be undertaken in the context + of a new validation, and not as a change letter modification.

    +

    Another factor affecting performance is the use (or not) of + platform specific optimizations. The x86/x64 Windows and Linux + code makes use of assembly language optimizations for FIPS + cryptographic algorithms. The C only version is much slower and so + the POST is slower too.

    +
    + +
    +
    + +
    +
    + + + diff --git a/docs/fipsvalidation.html b/docs/fipsvalidation.html new file mode 100644 index 0000000..534c87b --- /dev/null +++ b/docs/fipsvalidation.html @@ -0,0 +1,121 @@ + + + + + +
    +
    +
    +
    +

    OpenSSL and FIPS 140-2

    + +
    +

    The most recent open source based validation of a cryptographic + module (Module) compatible with the OpenSSL libraries is v2.0.1, + FIPS 140-2 certificate #1747. + This Module is documented in the + 2.0 User Guide. It substantially + updates and improves the earlier v1.2 module, FIPS 140-2 + certificate + #1051, + which is documented in the + 1.2 User Guide.

    + +

    Important Note: + Due to new requirements introduced in 2013 the current v2.0 Module + is no longer suitable as a reference for private label + validations; see the I.G. 9.5 FAQ. + Due to earlier changes in the FIPS 140-2 validation requirements + the v1.2 Module is no longer be a suitable model for private label + validations in its current form past the year 2010; see the NIST Notices, + discussion paper + and Draft 800-131.

    + +

    Sponsors

    +

    The OpenSSL FIPS Object Module validations receive support + from multiple sources for each validation effort; however only + those sponsors who have elected to be recognised for their + contribution to OpenSSL are listed below.

    + +
    + Defense Advanced Research Projects Agency (DARPA) Transformative Apps Program, + original primary sponsor of the overall validation with several Android on ARMv7 platforms. + +
    + Intersoft International, Inc., + platform sponsor (VC++ Win32/x86 asm optimisation) + +
    + + Opengear, Inc., platform sponsor + (uCLinux ARMv4 asm optimisation) + +
    + + QuintessenceLabs Pty Ltd, + platform sponsor (Fedora 14 x86-64 asm optimisation) + +
    + + PKWARE, Inc., platform sponsor + (HPUX 11i on Itanium 32, 64 bit with asm optimisation) + +
    + + Cerberus, LLC, general sponsor +
    + + DHS Science and Technology Directorate-sponsored Homeland Open Security Technology (HOST) program, + algorithm sponsor (CMAC, AES-CCM) + +
    + + Innominate Security Technologies AG, + platform sponsor (Linux on Freescale MPC8313) + +
    + + PSW GROUP, + general sponsor + +
    + + Citrix Systems, Inc., + platform sponsor (multiple platforms) + +
    + +

    If you have an interest in sponsoring any changes or additions + to this validation please contact OpenSSL Validation Services.

    +

    Some commercial software vendors ask us "what do we gain from + sponsoring a validation that our competition can also use?". Our + answer is "nothing, if you think in terms of obstructing your + competition". If, on the other hand, you compete primarily on the + merits of you products what others may do with the validation is + less of a threat as they derive no more advantage from it than you + do. Your advantage is that your sponsorship will probably cost + less that the commercial software license you would otherwise have + to buy, and you will retain backwards compatibility with the + regular OpenSSL API while avoiding vendor lock-in.

    +
    + +
    +
    + +
    +
    + + + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..72e3f1e --- /dev/null +++ b/docs/index.html @@ -0,0 +1,51 @@ + + + + + + + +
    +
    +
    +
    +

    Documentation

    +
    +

    We have an online copy of our + FAQ. It is + also part of the distribution.

    +

    +

    Information about the first-ever open source + FIPS-140 validation is also + available.

    + +

    Ivan Ristić, the creator of + https://ssllabs.com, + has a free download of his OpenSSL Cookbook + that covers the most frequently used OpenSSL features + and commands. It is updated often, and is available + at + https://www.feistyduck.com/books/openssl-cookbook/. + It is highly recommended. +

    + +

    Online versions of the manpages are not yet available, + but will be shortly.

    +
    + +
    +
    + +
    +
    + + + + + + diff --git a/docs/index.wml b/docs/index.wml deleted file mode 100644 index 3ad49e6..0000000 --- a/docs/index.wml +++ /dev/null @@ -1,54 +0,0 @@ - -#use wml::openssl area=docs page=index - -Documentation - -

    OpenSSL Documents

    - -

    -Here are copies of the manpages from the latest snapshot, and other -useful documentation. Since they are from the snapshot, they may describe -features which are not present in other releases. - -

    -

      -
    • openssl(1)
      - Manual page documenting the openssl command line tool, - or the full command list. - (Opens in new page or tab.) -

      -

    • ssl(3)
      - Manual page documenting the OpenSSL SSL/TLS library, - or the full list of SSL API's. - (Opens in new page or tab.) -

      -

    • crypto(3)
      - Manual page documenting the OpenSSL Crypto library, - or the full list of crypto API's. - (Opens in new page or tab.) -

      -

    • HOWTO
      - HOWTO documents to introduce concepts or explain them in a way that is not possible in the manuals. -

      -

    • WIKI
      - A wiki providing information and guidance about openssl. Operated by the OpenSSL Software Foundation. -

      -

    • FIPS140:
      - Data and documentation related to the FIPS140 validation support in OpenSSL -

      -

    - -

    -Other standards and documentation: -

      - - - -
    - diff --git a/docs/sidebar.inc b/docs/sidebar.inc new file mode 100644 index 0000000..13d62a7 --- /dev/null +++ b/docs/sidebar.inc @@ -0,0 +1,15 @@ + + + diff --git a/images/page-corner-bl.gif b/images/page-corner-bl.gif deleted file mode 100644 index 8ac02c7..0000000 Binary files a/images/page-corner-bl.gif and /dev/null differ diff --git a/images/page-corner-br.gif b/images/page-corner-br.gif deleted file mode 100644 index 33e830d..0000000 Binary files a/images/page-corner-br.gif and /dev/null differ diff --git a/images/page-corner-tr.gif b/images/page-corner-tr.gif deleted file mode 100644 index 6a63e13..0000000 Binary files a/images/page-corner-tr.gif and /dev/null differ diff --git a/images/page-head-bl.jpg b/images/page-head-bl.jpg deleted file mode 100644 index 2604f71..0000000 Binary files a/images/page-head-bl.jpg and /dev/null differ diff --git a/images/page-head-bm.jpg b/images/page-head-bm.jpg deleted file mode 100644 index 8b02a1b..0000000 Binary files a/images/page-head-bm.jpg and /dev/null differ diff --git a/images/page-head-tl.jpg b/images/page-head-tl.jpg deleted file mode 100644 index b603f89..0000000 Binary files a/images/page-head-tl.jpg and /dev/null differ diff --git a/images/page-head-tm.jpg b/images/page-head-tm.jpg deleted file mode 100644 index 73051b9..0000000 Binary files a/images/page-head-tm.jpg and /dev/null differ diff --git a/images/page-navbar-ab-n.jpg b/images/page-navbar-ab-n.jpg deleted file mode 100644 index 5c84066..0000000 Binary files a/images/page-navbar-ab-n.jpg and /dev/null differ diff --git a/images/page-navbar-ab-s.jpg b/images/page-navbar-ab-s.jpg deleted file mode 100644 index 7ccba47..0000000 Binary files a/images/page-navbar-ab-s.jpg and /dev/null differ diff --git a/images/page-navbar-bot.jpg b/images/page-navbar-bot.jpg deleted file mode 100644 index 1c00c62..0000000 Binary files a/images/page-navbar-bot.jpg and /dev/null differ diff --git a/images/page-navbar-do-n.jpg b/images/page-navbar-do-n.jpg deleted file mode 100644 index dc7e04c..0000000 Binary files a/images/page-navbar-do-n.jpg and /dev/null differ diff --git a/images/page-navbar-do-s.jpg b/images/page-navbar-do-s.jpg deleted file mode 100644 index 0bff78b..0000000 Binary files a/images/page-navbar-do-s.jpg and /dev/null differ diff --git a/images/page-navbar-fq-n.jpg b/images/page-navbar-fq-n.jpg deleted file mode 100755 index de3b582..0000000 Binary files a/images/page-navbar-fq-n.jpg and /dev/null differ diff --git a/images/page-navbar-fq-s.jpg b/images/page-navbar-fq-s.jpg deleted file mode 100755 index 8fa2409..0000000 Binary files a/images/page-navbar-fq-s.jpg and /dev/null differ diff --git a/images/page-navbar-ne-n.jpg b/images/page-navbar-ne-n.jpg deleted file mode 100644 index 828731b..0000000 Binary files a/images/page-navbar-ne-n.jpg and /dev/null differ diff --git a/images/page-navbar-ne-s.jpg b/images/page-navbar-ne-s.jpg deleted file mode 100644 index 0025056..0000000 Binary files a/images/page-navbar-ne-s.jpg and /dev/null differ diff --git a/images/page-navbar-re-n.jpg b/images/page-navbar-re-n.jpg deleted file mode 100644 index f915322..0000000 Binary files a/images/page-navbar-re-n.jpg and /dev/null differ diff --git a/images/page-navbar-re-s.jpg b/images/page-navbar-re-s.jpg deleted file mode 100644 index 65bd3fb..0000000 Binary files a/images/page-navbar-re-s.jpg and /dev/null differ diff --git a/images/page-navbar-se-n.jpg b/images/page-navbar-se-n.jpg deleted file mode 100644 index 96cc9b2..0000000 Binary files a/images/page-navbar-se-n.jpg and /dev/null differ diff --git a/images/page-navbar-se-s.jpg b/images/page-navbar-se-s.jpg deleted file mode 100644 index 3db5d5f..0000000 Binary files a/images/page-navbar-se-s.jpg and /dev/null differ diff --git a/images/page-navbar-so-n.jpg b/images/page-navbar-so-n.jpg deleted file mode 100644 index 40f070b..0000000 Binary files a/images/page-navbar-so-n.jpg and /dev/null differ diff --git a/images/page-navbar-so-s.jpg b/images/page-navbar-so-s.jpg deleted file mode 100644 index 35af201..0000000 Binary files a/images/page-navbar-so-s.jpg and /dev/null differ diff --git a/images/page-navbar-su-n.jpg b/images/page-navbar-su-n.jpg deleted file mode 100644 index 6b165ec..0000000 Binary files a/images/page-navbar-su-n.jpg and /dev/null differ diff --git a/images/page-navbar-su-s.jpg b/images/page-navbar-su-s.jpg deleted file mode 100644 index 037b9ea..0000000 Binary files a/images/page-navbar-su-s.jpg and /dev/null differ diff --git a/images/page-navbar-ti-n.jpg b/images/page-navbar-ti-n.jpg deleted file mode 100644 index 765d8f1..0000000 Binary files a/images/page-navbar-ti-n.jpg and /dev/null differ diff --git a/images/page-navbar-ti-s.jpg b/images/page-navbar-ti-s.jpg deleted file mode 100644 index 4bc05e8..0000000 Binary files a/images/page-navbar-ti-s.jpg and /dev/null differ diff --git a/images/page-navbar-top.jpg b/images/page-navbar-top.jpg deleted file mode 100644 index 3703213..0000000 Binary files a/images/page-navbar-top.jpg and /dev/null differ diff --git a/images/DHS-logo-med.jpg b/img/DHS-logo-med.jpg similarity index 100% rename from images/DHS-logo-med.jpg rename to img/DHS-logo-med.jpg diff --git a/images/acano-logo.jpg b/img/acano-logo.jpg similarity index 100% rename from images/acano-logo.jpg rename to img/acano-logo.jpg diff --git a/images/akamai-logo-med.png b/img/akamai-logo-med.png similarity index 100% rename from images/akamai-logo-med.png rename to img/akamai-logo-med.png diff --git a/images/cerberus-logo-med.jpg b/img/cerberus-logo-med.jpg similarity index 100% rename from images/cerberus-logo-med.jpg rename to img/cerberus-logo-med.jpg diff --git a/images/cii-logo-med.png b/img/cii-logo-med.png similarity index 100% rename from images/cii-logo-med.png rename to img/cii-logo-med.png diff --git a/images/citrix-logo-med.jpg b/img/citrix-logo-med.jpg similarity index 100% rename from images/citrix-logo-med.jpg rename to img/citrix-logo-med.jpg diff --git a/images/globalsign-logo-med.jpg b/img/globalsign-logo-med.jpg similarity index 100% rename from images/globalsign-logo-med.jpg rename to img/globalsign-logo-med.jpg diff --git a/images/huawei-logo-med.jpg b/img/huawei-logo-med.jpg similarity index 100% rename from images/huawei-logo-med.jpg rename to img/huawei-logo-med.jpg diff --git a/images/innominate-logo-med.jpg b/img/innominate-logo-med.jpg similarity index 100% rename from images/innominate-logo-med.jpg rename to img/innominate-logo-med.jpg diff --git a/images/lf-logo-med.png b/img/lf-logo-med.png similarity index 100% rename from images/lf-logo-med.png rename to img/lf-logo-med.png diff --git a/images/milton-logo-med.jpg b/img/milton-logo-med.jpg similarity index 100% rename from images/milton-logo-med.jpg rename to img/milton-logo-med.jpg diff --git a/images/nokia-logo-med.jpg b/img/nokia-logo-med.jpg similarity index 100% rename from images/nokia-logo-med.jpg rename to img/nokia-logo-med.jpg diff --git a/images/opengear-logo-med.jpg b/img/opengear-logo-med.jpg similarity index 100% rename from images/opengear-logo-med.jpg rename to img/opengear-logo-med.jpg diff --git a/images/oracle-logo-med.jpg b/img/oracle-logo-med.jpg similarity index 100% rename from images/oracle-logo-med.jpg rename to img/oracle-logo-med.jpg diff --git a/images/pkware-logo-med.jpg b/img/pkware-logo-med.jpg similarity index 100% rename from images/pkware-logo-med.jpg rename to img/pkware-logo-med.jpg diff --git a/images/psw-logo-med.jpg b/img/psw-logo-med.jpg similarity index 100% rename from images/psw-logo-med.jpg rename to img/psw-logo-med.jpg diff --git a/images/psw-logo.gif b/img/psw-logo.gif similarity index 100% rename from images/psw-logo.gif rename to img/psw-logo.gif diff --git a/images/qualsys-logo-med.jpg b/img/qualsys-logo-med.jpg similarity index 100% rename from images/qualsys-logo-med.jpg rename to img/qualsys-logo-med.jpg diff --git a/images/quintessence-logo-med.jpg b/img/quintessence-logo-med.jpg similarity index 100% rename from images/quintessence-logo-med.jpg rename to img/quintessence-logo-med.jpg diff --git a/images/smartisan-logo-med.png b/img/smartisan-logo-med.png similarity index 100% rename from images/smartisan-logo-med.png rename to img/smartisan-logo-med.png diff --git a/support/UnionPay.jpg b/img/unionpay.jpg similarity index 100% rename from support/UnionPay.jpg rename to img/unionpay.jpg diff --git a/img/up.gif b/img/up.gif new file mode 100644 index 0000000..a169e3c Binary files /dev/null and b/img/up.gif differ diff --git a/inc/README b/inc/README new file mode 100644 index 0000000..09edd38 --- /dev/null +++ b/inc/README @@ -0,0 +1 @@ +Directory for files that are used in multiple places. diff --git a/inc/banner.inc b/inc/banner.inc new file mode 100644 index 0000000..e9ce3a0 --- /dev/null +++ b/inc/banner.inc @@ -0,0 +1,33 @@ + +
    +
    +

    + + OpenSSL + +

    +

    + Cryptography and SSL/TLS Toolkit +

    +
    +
    + + + diff --git a/inc/footer.inc b/inc/footer.inc new file mode 100644 index 0000000..e09888e --- /dev/null +++ b/inc/footer.inc @@ -0,0 +1,7 @@ + +
    +

    + Copyright © 2015, OpenSSL Software Foundation. +

    +
    + diff --git a/inc/head.inc b/inc/head.inc new file mode 100644 index 0000000..9367a7f --- /dev/null +++ b/inc/head.inc @@ -0,0 +1,25 @@ + + OpenSSL + + + + + + + + + + + + + + + + + + + + + diff --git a/inc/legalities.inc b/inc/legalities.inc new file mode 100644 index 0000000..2a2a3c8 --- /dev/null +++ b/inc/legalities.inc @@ -0,0 +1,21 @@ +

    Legalities

    +

    +Please remember that export/import and/or use of strong +cryptography software, providing cryptography hooks, or even just +communicating technical details about cryptography software is +illegal in some parts of the world. So when you import this +package to your country, re-distribute it from there or even +just email technical suggestions or even source patches to the +authors or other people you are strongly advised to pay close +attention to any laws or regulations which apply to +you. The authors of openssl are not liable for any violations +you make here. So be careful, it is your responsibility. +

    + +

    Acknowledgement

    +

    +This product includes cryptographic software written by Eric +Young. This product includes software written by Tim Hudson +(tjh at cryptsoft.com). +

    + diff --git a/inc/libs/jquery.min.js b/inc/libs/jquery.min.js new file mode 100644 index 0000000..32d50cb --- /dev/null +++ b/inc/libs/jquery.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license +//@ sourceMappingURL=jquery.min.map +*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="
    t
    ",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
    ",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj; +return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="
    ",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&>(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l) +}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("