aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-05-19move masks out of CERT structureDr. Stephen Henson7-53/+39
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-19Don't add write errors into bytecountsRobert Swiecki1-2/+4
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-18Move certificate validity flags out of CERT.Dr. Stephen Henson6-35/+36
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-18Move signing digest out of CERT.Dr. Stephen Henson6-49/+45
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-18CERT tidyDr. Stephen Henson7-63/+54
Move per-connection state out of the CERT structure: which should just be for shared configuration data (e.g. certificates to use). In particular move temporary premaster secret, raw ciphers, peer signature algorithms and shared signature algorithms. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-18ASN1 INTEGER refactor.Dr. Stephen Henson8-578/+521
Rewrite and tidy ASN1_INTEGER and ASN1_ENUMERATED handling. Remove code duplication. New functions to convert between int64_t and ASN.1 types without the quirks of the old long conversion functions. Add documentation. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-17Add types to indent.proDr. Stephen Henson1-0/+8
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-16Further version negotiation updatesMatt Caswell2-46/+23
More miscellaneous updates to version negotiation following feedback. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Move SSLv3_*method() functionsMatt Caswell7-101/+18
Move these functions into t1_clnt.c, t1_srvr.c and t1_meth.c and take advantage of the existing tls1_get*_method() functions that all the other methods are using. Since these now have to support SSLv3 anyway we might as well use the same set of get functions for both TLS and SSLv3. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Updates following review commentsMatt Caswell13-325/+345
Miscellaneous updates following review comments on the version negotiation rewrite patches. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Version negotiation rewrite doc updatesMatt Caswell6-27/+36
Update various documentation references to the new TLS_*_method names. Also add a CHANGES entry. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Version negotiation rewrite cleanupMatt Caswell17-2104/+283
Following the version negotiation rewrite all of the previous code that was dedicated to version negotiation can now be deleted - all six source files of it!! Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Client side version negotiation rewriteMatt Caswell15-38/+127
Continuing from the previous commit this changes the way we do client side version negotiation. Similarly all of the s23* "up front" state machine code has been avoided and again things now work much the same way as they already did for DTLS, i.e. we just do most of the work in the ssl3_get_server_hello() function. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-16Server side version negotiation rewriteMatt Caswell26-322/+645
This commit changes the way that we do server side protocol version negotiation. Previously we had a whole set of code that had an "up front" state machine dedicated to the negotiating the protocol version. This adds significant complexity to the state machine. Historically the justification for doing this was the support of SSLv2 which works quite differently to SSLv3+. However, we have now removed support for SSLv2 so there is little reason to maintain this complexity. The one slight difficulty is that, although we no longer support SSLv2, we do still support an SSLv3+ ClientHello in an SSLv2 backward compatible ClientHello format. This is generally only used by legacy clients. This commit adds support within the SSLv3 code for these legacy format ClientHellos. Server side version negotiation now works in much the same was as DTLS, i.e. we introduce the concept of TLS_ANY_VERSION. If s->version is set to that then when a ClientHello is received it will work out the most appropriate version to respond with. Also, SSLv23_method and SSLv23_server_method have been replaced with TLS_method and TLS_server_method respectively. The old SSLv23* names still exist as macros pointing at the new name, although they are deprecated. Subsequent commits will look at client side version negotiation, as well of removal of the old s23* code. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-05-15Remove unused #ifdef's from header filesRich Salz2-40/+0
And remove a duplicate comment, probably from a merge hiccup. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-15Use #error in openssl/srp.hRich Salz5-28/+48
Follow the same convention the other OPENSSL_NO_xxx header files do, and use #error instead of making the header file be a no-op. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-15Make up for a missed 'make update' update.Rich Salz1-25/+25
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14Update mkdef for moved header file.Rich Salz1-1/+1
crypto/cryptlib.h moved to crypto/include/internal; update the script. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-14make dependRichard Levitte42-457/+633
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-14Add -Iinclude to crypto/ compilesRichard Levitte1-1/+1
The move of headers from crypto/ to crypto/include/internal/ needs this extra inclusion directory or the build fails. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte380-378/+378
There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-14Adjust unixly mk1mf after introduction of tkeyRichard Levitte2-3/+9
Added depencies on the public variants of some keys in test to Makefile. Added the newly introduced key files from test/ in the list of files to copy in util/pl/unix.pl. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-14make dependRichard Levitte4-67/+68
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14Identify and move OpenSSL internal header filesRichard Levitte17-17/+16
There are header files in crypto/ that are used by the rest of OpenSSL. Move those to include/internal and adapt the affected source code, Makefiles and scripts. The header files that got moved are: crypto/constant_time_locl.h crypto/o_dir.h crypto/o_str.h Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14Move definition of INTxx_MIN et al to internal headerRichard Levitte2-19/+109
Having the INTxx_MIN et al macros defined in a public header is unnecessary and risky. Also, it wasn't done for all platforms that might need it. So we move those numbers to an internal header file, do the math ourselves and make sure to account for the integer representations we know of. This introduces include/internal, which is unproblematic since we already use -I$(TOP)/include everywhere. This directory is different from crypto/include/internal, as the former is more general internal headers for all of OpenSSL, while the latter is for libcrypto only. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14use unit64_t for CPUID and timestamp codeDr. Stephen Henson2-23/+11
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-14Allow use of standard integer types.Dr. Stephen Henson1-0/+39
Include appropriate headers for standard integer types in e_os2.h This should use stdint.h, inttypes.h or a workaround for systems which have neither. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13Add missing ctype.hRich Salz1-0/+1
Had old patch, forgot to push/patch this to master Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13Fix ocsp bugsRich Salz1-21/+37
Various bugs found by Viktor, Emilia, Matt, etc. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13RT3841: memset() cipher_data when allocatedRich Salz1-0/+1
If an EVP implementation (such as an engine) fails out early, it's possible to call EVP_CIPHER_CTX_cleanup() which will call ctx->cipher->cleanup() before the cipher_data has been initialized via ctx->cipher->init(). Guarantee it's all-bytes-zero as soon as it is allocated. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13RT1207: document SSL_COMP_free_compression_methods.Rich Salz1-3/+9
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13Remove some outdated #defines.Rich Salz1-15/+0
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13util/incore update.Andy Polyakov1-2/+5
Support cross-compile platforms that don't support FINGERPRINT_premain, e.g. VxWorks. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13bn/Makefile: give MacOS X hand to compiler armv8-mont module.Andy Polyakov1-0/+1
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13bn/asm/armv8-mont.pl: boost performance.Andy Polyakov2-19/+1275
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13Configurations/10-main.conf: update iOS commentary.Andy Polyakov1-1/+1
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13aes/asm/bsaes-armv7.pl: fix compilation with Xcode 6.3.Andy Polyakov1-2/+2
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-13aes/asm/aesni-sha256-x86_64.pl: fix Windows compilation failure with old ↵Andy Polyakov1-3/+3
assembler. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-13Call of memcmp with null pointers in obj_cmp()Hanno Böck1-0/+2
The function obj_cmp() (file crypto/objects/obj_dat.c) can in some situations call memcmp() with a null pointer and a zero length. This is invalid behaviour. When compiling openssl with undefined behaviour sanitizer (add -fsanitize=undefined to compile flags) this can be seen. One example that triggers this behaviour is the pkcs7 command (but there are others, e.g. I've seen it with the timestamp function): apps/openssl pkcs7 -in test/testp7.pem What happens is that obj_cmp takes objects of the type ASN1_OBJECT and passes their ->data pointer to memcmp. Zero-sized ASN1_OBJECT structures can have a null pointer as data. RT#3816 Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-13Add CHANGES entry for Kerberos removalMatt Caswell1-1/+5
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-13Remove remaining Kerberos referencesMatt Caswell18-305/+113
Following on from the removal of libcrypto and libssl support for Kerberos this commit removes all remaining references to Kerberos. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-13Remove Kerberos support from libcryptoMatt Caswell5-659/+1
Remove libcrypto support for Kerberos following on from the previous commit which removed it from libssl. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-13Remove Kerberos support from libsslMatt Caswell31-4406/+839
Remove RFC2712 Kerberos support from libssl. This code and the associated standard is no longer considered fit-for-purpose. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-13Remove Kerberos support from appsMatt Caswell3-78/+5
Remove Kerberos related options from the apps to prepare for the subsequent commits which will remove libcrypto and libssl support for Kerberos. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-13Don't allow a CCS when expecting a CertificateVerifyMatt Caswell2-64/+28
Currently we set change_cipher_spec_ok to 1 before calling ssl3_get_cert_verify(). This is because this message is optional and if it is not sent then the next thing we would expect to get is the CCS. However, although it is optional, we do actually know whether we should be receiving one in advance. If we have received a client cert then we should expect a CertificateVerify message. By the time we get to this point we will already have bombed out if we didn't get a Certificate when we should have done, so it is safe just to check whether |peer| is NULL or not. If it is we won't get a CertificateVerify, otherwise we will. Therefore we should change the logic so that we only attempt to get the CertificateVerify if we are expecting one, and not allow a CCS in this scenario. Whilst this is good practice for TLS it is even more important for DTLS. In DTLS messages can be lost. Therefore we may be in a situation where a CertificateVerify message does not arrive even though one was sent. In that case the next message the server will receive will be the CCS. This could also happen if messages get re-ordered in-flight. In DTLS if |change_cipher_spec_ok| is not set and a CCS is received it is ignored. However if |change_cipher_spec_ok| *is* set then a CCS arrival will immediately move the server into the next epoch. Any messages arriving for the previous epoch will be ignored. This means that, in this scenario, the handshake can never complete. The client will attempt to retransmit missing messages, but the server will ignore them because they are the wrong epoch. The server meanwhile will still be waiting for the CertificateVerify which is never going to arrive. RT#2958 Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-05-13Fix the heap corruption in libeay32!OBJ_add_object.Gunnar Kudrjavets1-4/+4
Original 'sizeof(ADDED_OBJ)' was replaced with 'sizeof(*ao)'. However, they return different sizes. Therefore as the result heap gets corrupted and at some point later debug version of malloc() detects the corruption. On x86 we can observe that as follows: sizeof(*ao) == 4 sizeof(*ao[0]) == sizeof(ADDED_OBJ) == 8 Issue reproduces with either enabling CRT debug heap or Application Verifier's full-page heap. Basic debugging data from the moment the corruption is first detected: 0:000:x86> | . 0 id: 283c create name: openssl.exe 0:000:x86> kcn # 00 MSVCR120D!_heap_alloc_dbg_impl 01 MSVCR120D!_nh_malloc_dbg_impl 02 MSVCR120D!_nh_malloc_dbg 03 MSVCR120D!malloc 04 LIBEAY32!default_malloc_ex 05 LIBEAY32!CRYPTO_malloc 06 LIBEAY32!lh_insert 07 LIBEAY32!OBJ_add_object 08 LIBEAY32!OBJ_create 09 openssl!add_oid_section 0a openssl!req_main 0b openssl!do_cmd 0c openssl!main 0d openssl!__tmainCRTStartup 0e openssl!mainCRTStartup 0f KERNEL32!BaseThreadInitThunk 10 ntdll_77d60000!__RtlUserThreadStart 11 ntdll_77d60000!_RtlUserThreadStart Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-12Fix cipherlist order.Dr. Stephen Henson1-15/+17
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-12Make COMP_CTX and COMP_METHOD opaqueRich Salz14-125/+327
Since COMP_METHOD is now defined in comp_lcl.h, it is no longer possible to create new TLS compression methods without using the OpenSSL source. Only ZLIB is supported by default. Also, since the types are opaque, #ifdef guards to use "char *" instead of the real type aren't necessary. The changes are actually minor. Adding missing copyright to some files makes the diff misleadingly big. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-05-12Additional X509_ALGOR documentationDr. Stephen Henson1-4/+29
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-11Use p==NULL not !p (in if statements, mainly)Rich Salz118-724/+754
Reviewed-by: Tim Hudson <tjh@openssl.org>