summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-02-10Remove default value initialisers for ASN1_ITEM. Minor changes to generatedJoel Sing
assembly due to switches between .quad and .zero for structs.
2015-02-10Remove unnecessary include of assert.hMiod Vallat
2015-02-10Remove assert() or OPENSSL_assert() of pointers being non-NULL. The policyMiod Vallat
for libraries in OpenBSD is to deliberately let NULL pointers cause a SIGSEGV. ok doug@ jsing@
2015-02-10Expand IMPLEMENT_ASN1_TYPE macros - no change to generated assembly.Joel Sing
2015-02-10The IMPLEMENT_STACK_OF and IMPLEMENT_ASN1_SET_OF macros were turned intoJoel Sing
noops around 15 years ago. Remove multiple occurances of both that still exist in the code today.
2015-02-10Place the IMPLEMENT_ASN1_.*FUNCTION.* macros under an #ifndefJoel Sing
LIBRESSL_INTERNAL - we do not need them any more.
2015-02-10Expand IMPLEMENT_ASN1_NDEF_FUNCTION and IMPLEMENT_ASN1_PRINT_FUNCTIONJoel Sing
macros so that the code is visible and functions can be readily located. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
2015-02-10Expand IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname macros that got missed.Joel Sing
2015-02-10Expand the IMPLEMENT_ASN1_ALLOC_FUNCTIONS macro so that the code is visibleJoel Sing
and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-10Manually expand ASN1_ITEM_rptr macros that should have been expanded withJoel Sing
the IMPLEMENT_ASN1_DUP_FUNCTION macro.
2015-02-10Expand the -IMPLEMENT_ASN1_ENCODE_FUNCTIONS_(const_)?fname macros so thatJoel Sing
the code is visible and functions can be readily located. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
2015-02-10Expand the IMPLEMENT_ASN1_DUP_FUNCTION macro so that the code is visibleJoel Sing
and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-10Expand the IMPLEMENT_ASN1_FUNCTIONS_{const,fname,name} macros so that theJoel Sing
code is visible and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-09Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible andJoel Sing
functions can be readily located. Change has been scripted and there is no change to the generated assembly. Discussed with beck@ miod@ tedu@
2015-02-09Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible andJoel Sing
functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-09BN_CTX_get() can fail - consistently check its return value.Joel Sing
There are currently cases where the return from each call is checked, the return from only the last call is checked and cases where it is not checked at all (including code in bn, ec and engine). Checking the last return value is valid as once the function fails it will continue to return NULL. However, in order to be consistent check each call with the same idiom. This makes it easy to verify. Note there are still a handful of cases that do not follow the idiom - these will be handled separately. ok beck@ doug@
2015-02-09Expand the IMPLEMENT_ASN1_FUNCTIONS macro so that the code is visible andJoel Sing
functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-09Jettison SCTP support in BIO dgram.Joel Sing
OpenBSD does not have SCTP support and it sees little use in the wild. OPENSSL_NO_SCTP is already specified via opensslfeatures.h, hence this is a code removal only and symbols should remain unchanged. ok beck@ miod@ tedu@
2015-02-09Jettison DTLS over SCTP.Joel Sing
OpenBSD does not have SCTP support and it sees little use in the wild. OPENSSL_NO_SCTP is already specified via opensslfeatures.h, hence this is a code removal only and symbols should remain unchanged. ok beck@ miod@ tedu@
2015-02-09Return NULL when there are no shared ciphers.Doug Hogan
OpenSSL added this change to avoid an out-of-bounds write since they're accessing p[-1]. We initialize buf and use strrchr() so we aren't subject to the same OOB write. However, we should return NULL rather than an empty string when there are no shared ciphers. Also, KNF a particularly bad section above here that miod noticed. Based on OpenSSL commits: 4ee356686f72ff849f6f3d58562224ace732b1a6 308505b838e4e3ce8485bb30f5b26e2766dc7f8b ok miod@
2015-02-09This is neither code not proper documentation.Miod Vallat
2015-02-09Remove unused GOST test that prevents clang from building libcrypto.Doug Hogan
clang warns that it is unused and we have -Werror enabled. This test isn't hooked up to anything yet. We can add it back with a future GOST update. clang 3.5 can now build libssl and libcrypto as long as you use CFLAGS=-Wno-pointer-sign. "seems reasonable" bcook@, miod@
2015-02-08Use `> 0' instead of `!= 0' as a successful condition forMiod Vallat
EC_POINT_is_at_infinity() and EC_POINT_is_on_curve(), for they may return -1 should an error arise. ok doug@ jsing@
2015-02-08Move a few typedef up in this file in order to be able to use them in env_md_stMiod Vallat
and get rid of a silly FIXME comment. ok doug@ jsing@
2015-02-08Check memory allocation results in EVP_PBE_alg_add_type().Miod Vallat
ok doug@ jsing@
2015-02-08Check memory allocation results, as well as stack pushes.Miod Vallat
Also fix a memory leak in one of the error paths of SMIME_read_ASN1(), spotted by doug@ tweaks&ok doug@ jsing@
2015-02-08Rely upon enc_flags rather than the tls version, to upgrade SHA1+MD5 toMiod Vallat
SHA256 in ssl_get_algorithm2(). From OpenSSL HEAD; ok jsing@
2015-02-08Lob a KNF grenade into the ecdsa code.Joel Sing
2015-02-07Don't leak addresses in error messages.Miod Vallat
2015-02-07Remove useless variables and use the values directly.Doug Hogan
From OpenSSL commit 3d47c1d331fdc7574d2275cda1a630ccdb624b08. ok miod@, jsing@
2015-02-07Don't support very old versions of Netscape (is there any other kind?).Doug Hogan
Apparently "very old" Netscape versions illegally included empty content and a detached signature. OpenSSL removed the #if 0 that protected these users and added a new button OPENSSL_DONT_SUPPORT_OLD_NETSCAPE. It appears to be off by default to keep the hopes and dreams of very old Netscape users alive. We decided to be rebels and disable support. If you installed your browser from floppy disks, it's time to upgrade! Based on OpenSSL commit: 02a938c953b3e1ced71d9a832de1618f907eb96d ok tedu@, miod@, jsing@
2015-02-07Delete a lot of #if 0 code in libressl.Doug Hogan
There are a few instances where #if 1 is removed but the code remains. Based on the following OpenSSL commits. Some of the commits weren't strictly deletions so they are going to be split up into separate commits. 6f91b017bbb7140f816721141ac156d1b828a6b3 3d47c1d331fdc7574d2275cda1a630ccdb624b08 dfb56425b68314b2b57e17c82c1df42e7a015132 c8fa2356a00cbaada8963f739e5570298311a060 f16a64d11f55c01f56baa62ebf1dec7f8fe718cb 9ccc00ef6ea65567622e40c49aca43f2c6d79cdb 02a938c953b3e1ced71d9a832de1618f907eb96d 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 d6fbb194095312f4722c81c9362dbd0de66cb656 6f1a93ad111c7dfe36a09a976c4c009079b19ea1 1a5adcfb5edfe23908b350f8757df405b0f5f71f 8de24b792743d11e1d5a0dcd336a49368750c577 a2b18e657ea1a932d125154f4e13ab2258796d90 8e964419603d2478dfb391c66e7ccb2dcc9776b4 32dfde107636ac9bc62a5b3233fe2a54dbc27008 input + ok jsing@, miod@, tedu@
2015-02-07Convert several of the server side handshake functions to the new handshakeJoel Sing
message handling routines. ok miod@
2015-02-07Crank major for libcrypto since symbols have been removed.Joel Sing
Requested by deraadt@
2015-02-07Don't allow tag number 31 in CBB_add_asn1().Doug Hogan
Tag 31 is invalid for a short form identifier octet (single byte). KNF a little more. Based on BoringSSL commit 5ba305643f55d37a3e45e8388a36d50c1b2d4ff5 ok miod@
2015-02-07Crank libssl major due to the recent changes and removals.Joel Sing
ok beck@ deraadt@ miod@
2015-02-07Clean up the {get,put}_cipher_by_char() implementations. Also useJoel Sing
ssl3_get_cipher_by_value() in other parts of the code where it simplifies things. ok doug@
2015-02-07Only call free in CBB_init().Doug Hogan
CBB_init_fixed() should not call free because it can lead to use after free or double free bugs. The caller should be responsible for creating and destroying the buffer. From BoringSSL commit a84f06fc1eee6ea25ce040675fbad72c532afece miod agrees with the reasoning ok jsing@, beck@
2015-02-07Provide a SSL_CIPHER_get_by_value() function that allows a cipher to beJoel Sing
retrieved via its cipher suite value. A corresponding SSL_CIPHER_by_value() function returns the cipher suite value for a given SSL_CIPHER. These functions should mean that software does not need to resort to put_cipher_by_char()/get_cipher_by_char() in order to locate a cipher. Begrudgingly also provide a SSL_CIPHER_get_by_id() function that locates a cipher via the internal cipher identifier. Unfortunately these have already been leaked outside the library via SSL_CIPHER_by_id() and the various SSL3_CK_* and TLS1_CK_* defines in the ssl3.h/tls1.h headers. ok beck@ miod@
2015-02-07Combine c_allc.c and c_alld.c into c_all.c - there is not much point havingJoel Sing
this split across files, especially when two of them have less code than license text. ok bcook@ beck@ doug@ miod@
2015-02-07Fix typo and ASN.1 tag number range comment in bytestring.h.Doug Hogan
CBS_get_asn1() and CBS_get_any_asn1_element() only support the single byte ASN.1 identifier octets (aka short form tags). Tag number 31 is the start of the multi-byte long form per X.690 section 8.1.2.4. From BoringSSL commit 2683af70e73f116e14db2bca6290fa4a010a2ee4 ok miod@
2015-02-06KNF bytestring files.Doug Hogan
I checked that this doesn't change anything. Compiled with clang using -Wno-pointer-sign -g0 to reduce the differences. Only difference in the asm is due to assert(0) line number changes in bs_cbs.c and bs_cbb.c. miod is ok with the general process.
2015-02-06Remove accidental, commented out code.Doug Hogan
This was to test a patch for upstream.
2015-02-06Unifdef NETSCAPE_HANG_BUG.Joel Sing
If you're still using a buggy version of Netscape from 2000, for HTTPS with client certificates, it is probably a good time to find a new browser. "kill it softly... with napalm and kisses" miod@
2015-02-06Add additional checks to ssl3_send_client_key_exchange() that ensuresJoel Sing
ephemeral keys exist for SSL_kDHE and SSL_kECDHE. This would have prevented CVE-2014-3572. ok doug@
2015-02-06Import BoringSSL's crypto bytestring and crypto bytebuilder APIs.Doug Hogan
This is imported with as few changes as possible for the initial commit. I removed OPENSSL_EXPORT, replaced OPENSSL_malloc() etc with malloc() and changed a few header includes. BoringSSL has this as part of their public API. We're leaving it internal to libssl for now. Based on BoringSSL's CBB/CBS API as of commit c5cc15b4f5b1d6e9b9112cb8d30205a638aa2c54. input + ok jsing@, miod@
2015-02-06Bring back the horrible API that is get_cipher_by_char/put_cipher_by_char.Joel Sing
This API was intended to be an internal only, however like many things in OpenSSL, it is exposed externally and parts of the software ecosystem are now using it since there is no real alternative within the public API. ok doug@, tedu@ and reluctantly miod@
2015-02-06Rename SSL_CTX_use_certificate_chain() to SSL_CTX_use_certificate_chain_mem().Reyk Floeter
As discussed with beck@ jsing@ and others OK beck@
2015-02-05Declare the x509_(mem|file|dir)_lookup symbols as static because theyReyk Floeter
shouldn't be used directly. They aren't part of the API; each module (file, dir, mem) provides an actual function to export the now-static object. OK miod@
2015-01-28Fix a number of issues relating to algorithms in signatures, MostlyBob Beck
from OpenSSL with a hint of boring and some things done here. Addresses CVE-2014-8275 for OpenSSL fully ok miod@ doug@