Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-12Revert scoped_types.h change.Adam Langley
This reverts commits: 8d79ed67407e433d80ebc8d3aa080e8ce16e6eb7 19fdcb523402ed13ab798cf811fb0119e3e7b104 8d79ed67407e433d80ebc8d3aa080e8ce16e6eb7 Because WebRTC (at least) includes our headers in an extern "C" block, which precludes having any C++ in them. Change-Id: Ia849f43795a40034cbd45b22ea680b51aab28b2d
2016-07-12Assume that MSVC supports C++11.Adam Langley
MSVC doesn't define __cplusplus as 201103 to indicate C++11 support, so just assume that the compiler supports C++11 if _MSC_VER is defined. Change-Id: I27f6eeefe6e8dc522470f36fab76ab36d85eebac Reviewed-on: https://boringssl-review.googlesource.com/8734 Reviewed-by: David Benjamin <davidben@google.com>
2016-07-12Remove scoped_types.h.Adam Langley
This change scatters the contents of the two scoped_types.h files into the headers for each of the areas of the code. The types are now in the |bssl| namespace. Change-Id: I802b8de68fba4786b6a0ac1bacd11d81d5842423 Reviewed-on: https://boringssl-review.googlesource.com/8731 Reviewed-by: Adam Langley <agl@google.com>
2016-06-08Test both synchronous and asynchronous DTLS retransmit.David Benjamin
The two modes are quite different. One of them requires the BIO honor an extra BIO_ctrl. Also add an explanation at the top of addDTLSRetransmitTests for how these tests work. The description is scattered across many different places. BUG=63 Change-Id: Iff4cdd1fbf4f4439ae0c293f565eb6780c7c84f9 Reviewed-on: https://boringssl-review.googlesource.com/8121 Reviewed-by: David Benjamin <davidben@google.com>
2016-06-06Match OpenSSL's values for BIO_CTRL_*.David Benjamin
The fake numbers collide with other numbers defined below. Also PUSH and POP are actually used. DUP legitimately isn't though. Change-Id: Iaa15a065d846b89b9b7958b78068393cfee2bd6f Reviewed-on: https://boringssl-review.googlesource.com/8143 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com>
2016-06-06Add BIO_set_conn_int_port.David Benjamin
Make building against software that expects OpenSSL easier. Change-Id: I1af090ae8208218d6e226ee0baf51053699d85cc Reviewed-on: https://boringssl-review.googlesource.com/8141 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com>
2016-05-19Remove references to non-existent BIO functions.David Benjamin
We don't have any of these. Change-Id: I8d12284fbbab0ff35ac32d35a5f2eba326ab79f8 Reviewed-on: https://boringssl-review.googlesource.com/7981 Reviewed-by: Steven Valdez <svaldez@google.com> Reviewed-by: David Benjamin <davidben@google.com>
2016-04-15Only use recv/send for socket BIOs on Windows.David Benjamin
In OpenSSL, socket BIOs only used recv/send on Windows and read/write on POSIX. Align our socket BIOs with that behavior. This should be a no-op, but avoids frustrating consumers overly sensitive to the syscalls used now that SSL_set_fd has switched to socket BIOs to align with OpenSSL. b/28138582. Change-Id: Id4870ef8e668e587d6ef51c5b5f21e03af66a288 Reviewed-on: https://boringssl-review.googlesource.com/7686 Reviewed-by: Adam Langley <agl@google.com>
2016-03-08Include buffer.h from bio.h.Adam Langley
We shouldn't really have to do this, but there's a lot of code that doesn't always include what it uses. In this case, since bio.h references |BUF_MEM| in function signatures, it seems a little less distasteful. Change-Id: Ifb50f8bce40639f977b4447404597168a68c8388 Reviewed-on: https://boringssl-review.googlesource.com/7361 Reviewed-by: David Benjamin <davidben@google.com>
2016-03-07SSL_set_fd should create socket BIOs, not fd BIOs.David Benjamin
In OpenSSL, they create socket BIOs. The distinction isn't important on UNIX. On Windows, file descriptors are provided by the C runtime, while sockets must use separate recv and send APIs. Document how these APIs are intended to work. Also add a TODO to resolve the SOCKET vs int thing. This code assumes that Windows HANDLEs only use the bottom 32 bits of precision. (Which is currently true and probably will continue to be true for the foreseeable future[*], but it'd be nice to do this right.) Thanks to Gisle Vanem and Daniel Stenberg for reporting the bug. [*] Both so Windows can continue to run 32-bit programs and because of all the random UNIX software, like OpenSSL and ourselves, out there which happily assumes sockets are ints. Change-Id: I67408c218572228cb1a7d269892513cda4261c82 Reviewed-on: https://boringssl-review.googlesource.com/7333 Reviewed-by: David Benjamin <davidben@google.com>
2016-02-26Add BIO_do_connect.David Benjamin
Some consumers of connect BIOs connect them explicitly, and we already have the BIO_ctrl hooked up. Change-Id: Ie6b14f8ceb272b560e2b534e0b6c32fae050475b Reviewed-on: https://boringssl-review.googlesource.com/7217 Reviewed-by: Adam Langley <agl@google.com>
2016-02-24BIO_new_mem_buf should take const void *Steven Valdez
BIO_FLAGS_MEM_RDONLY keeps the invariant. (Imported from upstream's a38a159bfcbc94214dda00e0e6b1fc6454a23b78) Change-Id: I4cb35615d76b77929915e370dbb7fec1455da069 Reviewed-on: https://boringssl-review.googlesource.com/7214 Reviewed-by: David Benjamin <davidben@google.com>
2016-01-27Tweaks for node.jsAdam Langley
node.js is, effectively, another bindings library. However, it's better written than most and, with these changes, only a couple of tiny fixes are needed in node.js. Some of these changes are a little depressing however so we'll need to push node.js to use APIs where possible. Changes: ∙ Support verify_recover. This is very obscure and the motivation appears to be https://github.com/nodejs/node/issues/477 – where it's not clear that anyone understands what it means :( ∙ Add a few, no-op #defines ∙ Add some members to |SSL_CTX| and |SSL| – node.js needs to not reach into these structs in the future. ∙ Add EC_get_builtin_curves. ∙ Add EVP_[CIPHER|MD]_do_all_sorted – these functions are limited to decrepit. Change-Id: I9a3566054260d6c4db9d430beb7c46cc970a9d46 Reviewed-on: https://boringssl-review.googlesource.com/6952 Reviewed-by: Adam Langley <agl@google.com>
2016-01-22Fix some documentation comments.David Benjamin
The new OPENSSL_PRINTF_FORMAT_FUNC macro let doc.go catch a few problems. It also confuses doc.go, but this CL doesn't address that. At some point we probably need to give it a real C parser. Change-Id: I39f945df04520d1e0a0ba390cac7b308baae0622 Reviewed-on: https://boringssl-review.googlesource.com/6940 Reviewed-by: Adam Langley <agl@google.com>
2016-01-21Define |OPENSSL_PRINTF_FORMAT_FUNC| for format string annotations.Brian Smith
This centralizes the conditional logic into openssl/base.h so that it doesn't have to be repeated. The name |OPENSSL_PRINTF_FORMAT_FUNC| was chosen in anticipation of eventually defining an |OPENSSL_PRINTF_FORMAT_ARG| for MSVC-style parameter annotations. Change-Id: I273e6eddd209e696dc9f82099008c35b6d477cdb Reviewed-on: https://boringssl-review.googlesource.com/6909 Reviewed-by: David Benjamin <davidben@google.com>
2015-11-07Use typedef names, not struct names.David Benjamin
Not sure if we want to leave bio.h and bytestring.h's instance as-is, but the evp.h ones are just baffling. Change-Id: I485c2e355ba93764da0c4c72c48af48b055a8500 Reviewed-on: https://boringssl-review.googlesource.com/6454 Reviewed-by: Adam Langley <agl@google.com>
2015-11-05Fix up several comments and detect problems in the future.Adam Langley
This change fixes up several comments (many of which were spotted by Kenny Root) and also changes doc.go to detect cases where comments don't start with the correct word. (This is a common error.) Since we have docs builders now, these errors will be found automatically in the future. Change-Id: I58c6dd4266bf3bd4ec748763c8762b1a67ae5ab3 Reviewed-on: https://boringssl-review.googlesource.com/6440 Reviewed-by: Adam Langley <agl@google.com>
2015-10-27Better handle IPv6.Matt Braithwaite
∙ host:port parsing, where unavoidable, is now IPv6-friendly. ∙ |BIO_C_GET_CONNECT| is simply removed. ∙ bssl -accept now listens on both IPv6 and IPv4. Change-Id: I1cbd8a79c0199bab3ced4c4fd79d2cc5240f250c Reviewed-on: https://boringssl-review.googlesource.com/6214 Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-13Align BIO_get_fd with upstream.David Benjamin
OpenSSL's BIO_get_fd returns the fd or -1, not a boolean. Change-Id: I12a3429c71bb9c9064f9f91329a88923025f1fb5 Reviewed-on: https://boringssl-review.googlesource.com/6080 Reviewed-by: Adam Langley <agl@google.com>
2015-09-11Some documentation fixes.David Benjamin
We had a few duplicate section names. Change-Id: I0c9b2a1669ac14392fd577097d5ee8dd80f7c73c Reviewed-on: https://boringssl-review.googlesource.com/5824 Reviewed-by: Adam Langley <agl@google.com>
2015-08-06Drop DEFINE_STACK_OF.Adam Langley
We never need to define the actual structs because we always cast them before use. The types only exist to be distinct, and they can do that without a definition. Change-Id: I1e1ca0833b383f3be422675cb7b90dacbaf82acf Reviewed-on: https://boringssl-review.googlesource.com/5593 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-07-16Get rid of err function codes.David Benjamin
Running make_errors.go every time a function is renamed is incredibly tedious. Plus we keep getting them wrong. Instead, sample __func__ (__FUNCTION__ in MSVC) in the OPENSSL_PUT_ERROR macro and store it alongside file and line number. This doesn't change the format of ERR_print_errors, however ERR_error_string_n now uses the placeholder "OPENSSL_internal" rather than an actual function name since that only takes the uint32_t packed error code as input. This updates err scripts to not emit the function string table. The OPENSSL_PUT_ERROR invocations, for now, still include the extra parameter. That will be removed in a follow-up. BUG=468039 Change-Id: Iaa2ef56991fb58892fa8a1283b3b8b995fbb308d Reviewed-on: https://boringssl-review.googlesource.com/5275 Reviewed-by: Adam Langley <agl@google.com>
2015-06-24Restore |ERR_print_errors()|.Matt Braithwaite
Change-Id: If289c4aa2804727d6c5e8386b5a2b559cf006415 Reviewed-on: https://boringssl-review.googlesource.com/5152 Reviewed-by: Adam Langley <agl@google.com>
2015-06-24Restore |BIO_f_base64| from OpenSSL at b4f0d1a, modulo style fixes.Matt Braithwaite
Change-Id: Ia7f4f4f6d063d882cf3d3ac0f5f33ad8d8cd9875 Reviewed-on: https://boringssl-review.googlesource.com/5151 Reviewed-by: Adam Langley <agl@google.com>
2015-06-11Correct various documentation typosKenny Root
Some of the documentation had the right explanation but the incorrect function names attached. Change-Id: I7b479dae6d71a5ac7bc86df5a3890508c3b3d09f Reviewed-on: https://boringssl-review.googlesource.com/5090 Reviewed-by: Adam Langley <agl@google.com>
2015-05-28Add |BIO_read_asn1| to read a single ASN.1 object.Adam Langley
Android needs to be able to read a PKCS#7 blob from a Java InputStream. This change adds |BIO_read_asn1| which reads a single ASN.1 object from the start of a BIO without overreading. Change-Id: I74776e686529c8e58af1c26a4909f9bd4e87b707
2015-05-21Fix some malloc test crashs.David Benjamin
This isn't exhaustive. There are still failures in some tests which probably ought to get C++'d first. Change-Id: Iac58df9d98cdfd94603d54374a531b2559df64c3 Reviewed-on: https://boringssl-review.googlesource.com/4795 Reviewed-by: Adam Langley <agl@google.com>
2015-05-20Convert reference counts in crypto/Adam Langley
This change converts the reference counts in crypto/ to use |CRYPTO_refcount_t|. The reference counts in |X509_PKEY| and |X509_INFO| were never actually used and so were dropped. Change-Id: I75d572cdac1f8c1083c482e29c9519282d7fd16c Reviewed-on: https://boringssl-review.googlesource.com/4772 Reviewed-by: Adam Langley <agl@google.com>
2015-05-05Add |BIO_up_ref| and |EVP_PKEY_up_ref|.Adam Langley
This avoids callers having to worry about |CRYPTO_add| and what the correct lock to use it with is. (Esp since we'll probably change the way that reference counts work in the future.) Change-Id: I972bf0cc3be6099e0255e64a0fd50249062d1eb4 Reviewed-on: https://boringssl-review.googlesource.com/4623 Reviewed-by: Adam Langley <agl@google.com>
2015-05-05Revert "bio: remove reference count."Adam Langley
Android uses BIO reference counting. This reverts commit 9bde6aeb76b1d2a45d76637553c3fb3f31e4ecbd. Change-Id: Ibf4a7f42477549d10829a424ea3b52f09098666c Reviewed-on: https://boringssl-review.googlesource.com/4472 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-04-16bio: remove BIO_CTRL_PUSH/_POP.Adam Langley
We don't support the SSL BIO so this is a no-op change. Change-Id: Iba9522b837ebb0eb6adc80d5df6dcac99abf2552 Reviewed-on: https://boringssl-review.googlesource.com/4360 Reviewed-by: Adam Langley <agl@google.com>
2015-04-16Remove BIO's ex_data.David Benjamin
No wrappers were ever added and codesearch confirms no one ever added to it manually. Probably anyone doing complex things with BIOs just made a custom BIO_METHOD. We can put it back with proper functions if the need ever arises. Change-Id: Icb5da7ceeb8f1da6d08f4a8854d53dfa75827d9c Reviewed-on: https://boringssl-review.googlesource.com/4373 Reviewed-by: Adam Langley <agl@google.com>
2015-04-14bio: remove reference count.Adam Langley
It appears that this reference “count” is set to one at creation and never touched after that. Change-Id: I3238a6d3dd702953771b8ec725c1c5712c648fba Reviewed-on: https://boringssl-review.googlesource.com/4320 Reviewed-by: Adam Langley <agl@google.com>
2015-04-13Eliminate unnecessary includes from low-level crypto modules.Brian Smith
Beyond generally eliminating unnecessary includes, eliminate as many includes of headers that declare/define particularly error-prone functionality like strlen, malloc, and free. crypto/err/internal.h was added to remove the dependency on openssl/thread.h from the public openssl/err.h header. The include of <stdlib.h> in openssl/mem.h was retained since it defines OPENSSL_malloc and friends as macros around the stdlib.h functions. The public x509.h, x509v3.h, and ssl.h headers were not changed in order to minimize breakage of source compatibility with external code. Change-Id: I0d264b73ad0a720587774430b2ab8f8275960329 Reviewed-on: https://boringssl-review.googlesource.com/4220 Reviewed-by: Adam Langley <agl@google.com>
2015-04-13Rename BIO_print_errors_fp back to ERR_print_errors_fp & refactor it.Brian Smith
A previous change in BoringSSL renamed ERR_print_errors_fp to BIO_print_errors_fp as part of refactoring the code to improve the layering of modules within BoringSSL. Rename it back for better compatibility with code that was using the function under the original name. Move its definition back to crypto/err using an implementation that avoids depending on crypto/bio. Change-Id: Iee7703bb1eb4a3d640aff6485712bea71d7c1052 Reviewed-on: https://boringssl-review.googlesource.com/4310 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Typo fix in comment.Adam Langley
(Thanks to William Hesse.) Change-Id: I8479663250546a5ec0a024f80e50541f91d833bc Reviewed-on: https://boringssl-review.googlesource.com/4020 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-02-12Reset all the error codes.David Benjamin
This saves about 6-7k of error data. Change-Id: Ic28593d4a1f5454f00fb2399d281c351ee57fb14 Reviewed-on: https://boringssl-review.googlesource.com/3385 Reviewed-by: Adam Langley <agl@google.com>
2014-11-24Cleanup of setting external bufferHåvard Molland
Don't use |BIO_set_foo_buffer_size| when setting the sizes of the buffers while making buffer pair. Since it happens in pair.c we know the BIOs are BIO pairs and using bio_ctrl here complicates setting external buffers. Also zero out bio_bio_st during construction. This fixes a problem that would happen if the default buffer sizes were not set, since buf_externally_allocated was not yet initialized. Remove BIO_C_SET_BUFF_SIZE and BIO_CTRL_RESET which are not used for bio pairs. Change-Id: I365091d5f44f6f1c5522c325a771bdf03d8fe950 Reviewed-on: https://boringssl-review.googlesource.com/2370 Reviewed-by: Adam Langley <agl@google.com>
2014-11-19Add zero copy read and write api for bio pairs.Håvard Molland
Also add functionality for setting external buffers to give the caller better control of the buffers. This is typical needed if OS sockets can outlive the bio pair. Change-Id: I500f0c522011ce76e9a9bce5d7b43c93d9d11457
2014-09-19Add misc functions for easier porting.Adam Langley
Android requested that the wpa_supplicant go upstream. This change adds some dummy functions and reinstates DSA_dup_DH in order to make the diff smaller and easier for upstream. Change-Id: I77ac271b8652bae5a0bbe16afde51d9096f3dfb5 Reviewed-on: https://boringssl-review.googlesource.com/1740 Reviewed-by: Adam Langley <agl@google.com>
2014-08-14Recover BIO_number_{read|written}.Adam Langley
Android needs it. These functions were removed in the move to BoringSSL. Change-Id: Ice24a0a1c390930cf07dbd00f72a3e12e6c241f9 Reviewed-on: https://boringssl-review.googlesource.com/1510 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-08-05Fix BIO_printf crash on Mac.David Benjamin
A single va_list may not be used twice. Nothing calls BIO_vprintf and it just (v)snprintfs into a buffer anyway, so remove it. If it's actually needed, we can fiddle with va_copy and the lack of it in C89 later, but anything that actually cares can just assemble the output externally. Add a test in bio_test.c. BUG=399546 Change-Id: Ia40a68b31cb5984d817e9c55351f49d9d6c964c1 Reviewed-on: https://boringssl-review.googlesource.com/1391 Reviewed-by: Adam Langley <agl@google.com>
2014-08-01Add visibility rules.Adam Langley
This change marks public symbols as dynamically exported. This means that it becomes viable to build a shared library of libcrypto and libssl with -fvisibility=hidden. On Windows, one not only needs to mark functions for export in a component, but also for import when using them from a different component. Because of this we have to build with |BORINGSSL_IMPLEMENTATION| defined when building the code. Other components, when including our headers, won't have that defined and then the |OPENSSL_EXPORT| tag becomes an import tag instead. See the #defines in base.h In the asm code, symbols are now hidden by default and those that need to be exported are wrapped by a C function. In order to support Chromium, a couple of libssl functions were moved to ssl.h from ssl_locl.h: ssl_get_new_session and ssl_update_cache. Change-Id: Ib4b76e2f1983ee066e7806c24721e8626d08a261 Reviewed-on: https://boringssl-review.googlesource.com/1350 Reviewed-by: Adam Langley <agl@google.com>
2014-07-18Have BIO_get_mem_data return a size_t and uint8_t*Adam Langley
Change-Id: I883f9c3527b572a2140ae4899cf4409cdc25c6dc Reviewed-on: https://boringssl-review.googlesource.com/1261 Reviewed-by: Adam Langley <agl@google.com>
2014-07-16Add functions for setting a BIO callback and arg.Adam Langley
These were omitted, but are needed by Chromium now. Change-Id: I17e1672674311c8dc2ede21539c82b8e2e50f376 Reviewed-on: https://boringssl-review.googlesource.com/1201 Reviewed-by: Adam Langley <agl@google.com>
2014-07-15Move public headers to include/openssl/Adam Langley
Previously, public headers lived next to the respective code and there were symlinks from include/openssl to them. This doesn't work on Windows. This change moves the headers to live in include/openssl. In cases where some symlinks pointed to the same header, I've added a file that just includes the intended target. These cases are all for backwards-compat. Change-Id: I6e285b74caf621c644b5168a4877db226b07fd92 Reviewed-on: https://boringssl-review.googlesource.com/1180 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-06-21Inital import.Adam Langley
Initial fork from f2d678e6e89b6508147086610e985d4e8416e867 (1.0.2 beta). (This change contains substantial changes from the original and effectively starts a new history.)