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-01-27Have doc.go parse struct comments.Adam Langley
In code, structs that happened to have a '(' somewhere in their body would cause the parser to go wrong. This change fixes that and updates the comments on a number of structs. Change-Id: Ia76ead266615a3d5875b64a0857a0177fec2bd00 Reviewed-on: https://boringssl-review.googlesource.com/6970 Reviewed-by: Adam Langley <agl@google.com>
2016-01-21Annotate |ERR_add_error_dataf| as |OPENSSL_PRINTF_FORMAT_FUNC|.Brian Smith
Besides being a good idea anyway, this avoids clang warning about using a non-literal format string when |ERR_add_error_dataf| calls |BIO_vsnprintf|. Change-Id: Iebc84d9c9d85e08e93010267d473387b661717a5 Reviewed-on: https://boringssl-review.googlesource.com/6920 Reviewed-by: David Benjamin <davidben@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-11-04Don't bother sampling __func__.David Benjamin
Removing the function codes continued to sample __func__ for compatibility with ERR_print_errors_cb, but not ERR_error_string_n. We can just emit OPENSSL_internal for both. ERR_print_errors_cb already has the file and line number available which is strictly more information than the function name. (ERR_error_string_n does not, but we'd already turned that to OPENSSL_internal.) This shaves 100kb from a release build of the bssl tool. In doing so, put an unused function code parameter back into ERR_put_error to align with OpenSSL. We don't need to pass an additional string in anymore, so OpenSSL compatibility with anything which uses ERR_LIB_USER or ERR_get_next_error_library costs nothing. (Not that we need it.) Change-Id: If6af34628319ade4145190b6f30a0d820e00b20d Reviewed-on: https://boringssl-review.googlesource.com/6387 Reviewed-by: Adam Langley <agl@google.com>
2015-09-16Fix minor documentation mistake.David Benjamin
Change-Id: Ia31c0c04c0dbb00cf55db7fdf2c4641a2287f012 Reviewed-on: https://boringssl-review.googlesource.com/5890 Reviewed-by: Adam Langley <agl@google.com>
2015-07-16ERR_LIB_USER should be the last error.David Benjamin
Consumers sometimes use ERR_LIB_USER + <favorite number> instead of ERR_get_next_error_library. To avoid causing them grief, keep ERR_LIB_USER last. Change-Id: Id19ae7836c41d5b156044bd20d417daf643bdda2 Reviewed-on: https://boringssl-review.googlesource.com/5290 Reviewed-by: Adam Langley <agl@google.com>
2015-07-16Remove the func parameter to OPENSSL_PUT_ERROR.David Benjamin
Much of this was done automatically with find . -name '*.c' | xargs sed -E -i '' -e 's/(OPENSSL_PUT_ERROR\([a-zA-Z_0-9]+, )[a-zA-Z_0-9]+, ([a-zA-Z_0-9]+\);)/\1\2/' find . -name '*.c' | xargs sed -E -i '' -e 's/(OPENSSL_PUT_ERROR\([a-zA-Z_0-9]+, )[a-zA-Z_0-9]+, ([a-zA-Z_0-9]+\);)/\1\2/' BUG=468039 Change-Id: I4c75fd95dff85ab1d4a546b05e6aed1aeeb499d8 Reviewed-on: https://boringssl-review.googlesource.com/5276 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-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-12Define compatibility function |ERR_remove_state|.Matt Braithwaite
(It was already declared.) Change-Id: Ifcda07fe85a6d5d9e2d3b5c387793413f5048515 Reviewed-on: https://boringssl-review.googlesource.com/4713 Reviewed-by: Adam Langley <agl@google.com>
2015-05-05Add do-nothing compatibility function |ERR_load_ERR_strings|.Matt Braithwaite
Change-Id: I9ad06017b7b726e4529367ad244ae8945853ce62 Reviewed-on: https://boringssl-review.googlesource.com/4603 Reviewed-by: Adam Langley <agl@google.com>
2015-04-15Fix Windows newline in err.h from commit 83a8298.Brian Smith
Change-Id: I2caa65b35e80233009e82599838f65aaf2e73cf4 Reviewed-on: https://boringssl-review.googlesource.com/4341 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-04-09Use thread-local storage for ERR.Adam Langley
Change-Id: I012bff37094ecb29621197ea1d52626bb87f2f0f
2015-04-09Remove the implementation abstraction from ERR.Adam Langley
Since ERR will soon have thread-local storage, we don't need to worry about high-performance implementations and thus don't need to be able to switch two different implementations at run-time. Change-Id: I0598054ee8a8b499ac686ea635a96f5d03c754e0
2015-02-10Precompute sorted array for error strings.Adam Langley
Previously, error strings were kept in arrays for each subdirectory and err.c would iterate over them all and insert them at init time to a hash table. This means that, even if you have a shared library and lots of processes using that, each process has ~30KB of private memory from building that hash table. This this change, all the error strings are built into a sorted list and are thus static data. This means that processes can share the error information and it actually saves binary space because of all the pointer overhead in the old scheme. Also it saves the time taken building the hash table at startup. This removes support for externally-supplied error string data. Change-Id: Ifca04f335c673a048e1a3e76ff2b69c7264635be
2015-01-16Free all error queues on shutdown.Adam Langley
As feared, 2bca0988 did cause some leak checkers to get upset about the state_hash pointer getting cleared. This change makes err_shutdown free all the error queues to try and avoid this. Hopefully this doesn't upset TSAN in turn. BUG=448296 Change-Id: I827da63c793dcabc73168ece052cdcd3d3cc64e3 Reviewed-on: https://boringssl-review.googlesource.com/2890 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-01-15Various documentation fixes.David Benjamin
Add some missing headers and ensure each header has a short description. doc.go gets confused at declarations that break before the first (, so avoid doing that. Also skip a/an/deprecated: in markupFirstWord and process pipe words in the table of contents. Change-Id: Ia08ec5ae8e496dd617e377e154eeea74f4abf435 Reviewed-on: https://boringssl-review.googlesource.com/2839 Reviewed-by: Adam Langley <agl@google.com>
2015-01-13Free more memory in cleanup functions.Adam Langley
The extra free in ex_data_impl.c is fixing a mistake: when calling |CRYPTO_cleanup_all_ex_data| the |EX_CLASS_ITEM| itself wouldn't be freed. The change in err_impl.c is to free the thread-id hash also. This allows programs to free absolutely all memory allocated by BoringSSL, which allows fuzz testing to find any memory leaks. Change-Id: I1e518adf2b3e0efa7d7f00f7ab4e65e1dc70161e Reviewed-on: https://boringssl-review.googlesource.com/2670 Reviewed-by: Adam Langley <agl@google.com>
2015-01-08Add declarations for Android compatibility funcs.Adam Langley
Some parts of Android can't be updated yet so this change adds declarations (only) for some functions that will be stubbed in Android-specific code. (That Android-specific code will live in the Android repo, not the BoringSSL repo.) Trying to use these functions outside of Android will result in a link error. Change-Id: Iaa9b956e6408d21cd8fc34d90d9c15657e429877 Reviewed-on: https://boringssl-review.googlesource.com/2760 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-12-18Implement HKDF.Nick Harper
See https://tools.ietf.org/html/rfc5869. Change-Id: I6d012d8c38806df80aa44350d3a86eaff499ac05 Reviewed-on: https://boringssl-review.googlesource.com/2533 Reviewed-by: Adam Langley <agl@google.com>
2014-10-31Remove ERR_LIB_PKCS12.Adam Langley
This is no longer used but, by retaining it, we might miss cases where code is still testing against it. Change-Id: I40ed47e41f903aaf2c5e5354d4348f8890021382 Reviewed-on: https://boringssl-review.googlesource.com/2110 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-10-07Retain ownership of malloced error data.Adam Langley
I misunderstood the OpenSSL semantics here. When receiving an error data pointer via ERR_get_error_line_data and friends, although the error is cleared, OpenSSL retains ownership of the data pointer. It's kept in the cleared error until another error overrides it, or the whole error queue is cleared. It's pretty odd to have live pointers in empty errors so this change allows an error queue to retain one data pointer. Thus the pointer returned from ERR_get_error_line_data is valid until the next call to ERR_get_error_line_data, or until the queue is freed. From reviewing uses of the API, this is sufficient for all of them. Change-Id: I73cb8e9c792452ae3c1a934ac8bbe8b5353b65b2 Reviewed-on: https://boringssl-review.googlesource.com/1880 Reviewed-by: Adam Langley <agl@google.com>
2014-10-01ERR_GET_* macros return int.David Benjamin
The corresponding constants are ints, so these should match. This appeases MSVC on some Chromium DCHECK. Change-Id: I7a5db41fa072c2850841a102917163af5e90d860 Reviewed-on: https://boringssl-review.googlesource.com/1867 Reviewed-by: Adam Langley <agl@google.com>
2014-08-21Convert all zero-argument functions to '(void)'David Benjamin
Otherwise, in C, it becomes a K&R function declaration which doesn't actually type-check the number of arguments. Change-Id: I0731a9fefca46fb1c266bfb1c33d464cf451a22e Reviewed-on: https://boringssl-review.googlesource.com/1582 Reviewed-by: Adam Langley <agl@google.com>
2014-08-14Add EVP_EncodedLength.Adam Langley
Several callers of EVP_EncodeBlock are doing ad-hoc versions of this function without any overflow checks. Change-Id: I4d0cad2347ea8c44b42465e8b14b2783db69ee8f Reviewed-on: https://boringssl-review.googlesource.com/1511 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-08-12Add ERR_remove_thread_state (for Android).Adam Langley
Change-Id: I908d207ccd3d529ec09c687effc2aeb4631127d9 Reviewed-on: https://boringssl-review.googlesource.com/1470 Reviewed-by: David Benjamin <davidben@chromium.org> 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-28Add OpenSSL-compatible alias for ERR_FLAG_STRING flag.Piotr Sikora
A lot of applications use ERR_TXT_STRING flag in order to determine whether the error string is printable or not. Change-Id: Ic79cdb55d43fdfac48da5de5e18c0c9c03c8f747 Signed-off-by: Piotr Sikora <piotr@cloudflare.com> Reviewed-on: https://boringssl-review.googlesource.com/1192 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.)