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
path: root/util
AgeCommit message (Collapse)Author
2015-12-16Chromium's update.sh is dead, long live update.pyNico Weber
update.py used to be used only on Windows until very recently, but Windows and non-Windows have been at the same clang revision for a while now. So even a few months ago update.py and update.sh would've contained the same clang revision. BUG=chromium:494442 Change-Id: Ie9127a1c49e31a7810ee431f8e662350c245917c Reviewed-on: https://boringssl-review.googlesource.com/6620 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-12-15Don't leak Android hacks to other build platforms.Piotr Sikora
Previously, android_compat_hacks.c and android_compat_keywrap.c were added to crypto_sources when multiple build platforms were specified in one invocation. Change-Id: I4fd8bffc4785bef0148d12cd6f292d79c043b806 Signed-off-by: Piotr Sikora <piotrsikora@google.com> Reviewed-on: https://boringssl-review.googlesource.com/6566 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-11-19Add NEON implementation of curve25519.Adam Langley
Nexus 7 goes from 1002.8 ops/sec to 4704.8 at a cost of 10KB of code. (It'll actually save code if built with -mfpu=neon because then the generic version can be discarded by the compiler.) Change-Id: Ia6d02efb2c2d1bb02a07eb56ec4ca3b0dba99382 Reviewed-on: https://boringssl-review.googlesource.com/6524 Reviewed-by: Adam Langley <agl@google.com>
2015-11-18Add X25519 and Ed25519 support.Adam Langley
(Ed25519 support is disabled when |OPENSSL_SMALL| is defined.) libcrypto.a sizes: x86-64 -O3 -march=native: +78012 (1584902 → 1662914) x86-64 -O3 -march=native -DOPENSSL_SMALL: +10596 (1356206 → 1366802) Android armv7 Thumb -O2 -DOPENSSL_SMALL: +13132 (1258462 → 1271594) Change-Id: I6a7e64d481e4ce4daa7d5057578081358746cfb9 Reviewed-on: https://boringssl-review.googlesource.com/6497 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-28Support Bazel builds on other platforms.Piotr Sikora
This change causes the generated Bazel files to include the assembly file lists for other platforms. Change-Id: Ic474b6900f8c109393baac1ec9cc2d112f155a56 Reviewed-on: https://boringssl-review.googlesource.com/6390 Reviewed-by: Adam Langley <agl@google.com>
2015-10-27Add the RFC 7539 ChaCha20-Poly1305 AEAD.Brian Smith
Change-Id: I07dfde7cc304d903c2253600905cc3e6257716c5 Reviewed-on: https://boringssl-review.googlesource.com/6101 Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-27Fix the shared builders by exporting GCM symbols.Adam Langley
gcm_test.cc needs to access the internal GCM symbols. This is unfortunate because it means that they have to be marked OPENSSL_EXPORT just for this. To compensate, modes.h is removed and its contents copied into crypto/modes/internal.h. Change-Id: I1777b2ef8afd154c43417137673a28598a7ec30e Reviewed-on: https://boringssl-review.googlesource.com/6360 Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-26Linkify pipe words.David Benjamin
This required switching anchors from <a name> to id attributes, which also works. HTML gets unhappy when you nest <a> tags inside each other and tagging the elements is somewhat tidier. Change-Id: I64094d35a0e820e37be9e5dc8db013a50774190f Reviewed-on: https://boringssl-review.googlesource.com/6314 Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-26Hide some sections from the docs.David Benjamin
Private structs shouldn't be shown. Also there's a few sections that are really more implementation details than anything else. Change-Id: Ibc5a23ba818ab0531d9c68e7ce348f1eabbcd19a Reviewed-on: https://boringssl-review.googlesource.com/6313 Reviewed-by: Adam Langley <alangley@gmail.com>
2015-10-07Updating Bazel outputs to work on other platforms.Chuck Hays
Bazel on Mac requires some alterations to the generated build files. This change updates generate_build_files.py to emit suitable Bazel files. This will require some tweaks to projects that build with Bazel. Change-Id: I3d68ec754b8abaa41a348f86c32434477f2c5e1c Reviewed-on: https://boringssl-review.googlesource.com/6146 Reviewed-by: Adam Langley <agl@google.com>
2015-09-30Go's darwin filenames have changed.David Benjamin
32-bit is gone (wasn't being used anyway) and the -osx10.8 suffix is gone. Still looking into why the Linux bots are unhappy. Change-Id: If3a35d20fb1cc6f1e3f023d792dc78b5c5aac72a Reviewed-on: https://boringssl-review.googlesource.com/6061 Reviewed-by: Adam Langley <agl@google.com>
2015-09-30Move the bots to Go 1.5.1.David Benjamin
Nothing in particular, but probably good to match the version of Go on our workstations. Change-Id: I5f4828299d56d25cd8c0dadfa91e9f18212a178d Reviewed-on: https://boringssl-review.googlesource.com/6060 Reviewed-by: Adam Langley <agl@google.com>
2015-09-30Take thread.h out of the documentation.David Benjamin
There's nothing in there that isn't deprecated, since BoringSSL is thread-safe by default now. Change-Id: Idfd9de8bd3a6544b1d4176b2d115eef9eefa63d0 Reviewed-on: https://boringssl-review.googlesource.com/6031 Reviewed-by: Adam Langley <agl@google.com>
2015-09-15Replace skipPast with strings.TrimPrefix.David Benjamin
There was a bug in skipPast; it was skipping to the start of the string, rather than the end of it. But more of an issue is that it would skip if it was in the middle of the string, which caused problems when STACK_OF(FOO) was used as a parameter. At some point, we'll probably need to give this a real C declaration parser. We still have declarations (like those that return function pointers) which we can't parse. But for now let's clear the low-hanging fruit. Change-Id: Ic2cee452cc8cf6887a6ff1b00cea353cec361955 Reviewed-on: https://boringssl-review.googlesource.com/5875 Reviewed-by: Adam Langley <agl@google.com>
2015-09-12Generate stable URL fragments.David Benjamin
Using numbers is sensitive to moving things around. Instead, use the names and enforce, for sections, that they are unique. Names would be enforced too, but there's a table-of-contents bug around #ifdefs to resolve first. Change-Id: I8822e8ba8da9ed3ee4984365b8a64932d16d5baf Reviewed-on: https://boringssl-review.googlesource.com/5826 Reviewed-by: Adam Langley <agl@google.com>
2015-09-11Deprecated functions get their own sections.David Benjamin
A small handful of functions got a 'Deprecated:' prefix instead in documentation. Change-Id: Ic151fb7d797514add66bc6465b6851b666a471bc Reviewed-on: https://boringssl-review.googlesource.com/5825 Reviewed-by: Adam Langley <agl@google.com>
2015-09-09Drop urandom_test.Adam Langley
It didn't do too much and I didn't notice that CRYPTO_sysrand wasn't OPENSSL_EXPORTed, which makes the test impossible on shared-library builds. Change-Id: I38986572aa34fa9c0f30075d562b8ee4e1a0c8b8
2015-09-09Buffer reads of urandom, if you promise no forking.Matt Braithwaite
Callers that lack hardware random may obtain a speed improvement by calling |RAND_enable_fork_unsafe_buffering|, which enables a thread-local buffer around reads from /dev/urandom. Change-Id: I46e675d1679b20434dd520c58ece0f888f38a241 Reviewed-on: https://boringssl-review.googlesource.com/5792 Reviewed-by: Adam Langley <agl@google.com>
2015-09-03Markdown-ify BUILDING.David Benjamin
Change-Id: Icd3cba6522ce47a4dfe699204982b5b692d3d62e Reviewed-on: https://boringssl-review.googlesource.com/5811 Reviewed-by: Adam Langley <agl@google.com>
2015-08-28pkcs8.c: Add PBES2 to list of password-based encryption methods.Matt Braithwaite
This consists mostly of re-adding OpenSSL's implementation of PBKDF2 (very loosely based upon e0d26bb3). The meat of it, namely |PKCS5_PBKDF2_HMAC|, was already present, but unused. In addition, |PKCS8_encrypt| and |PKCS8_decrypt| must be changed to not perform UCS-2 conversion in the PBES2 case. Change-Id: Id170ecabc43c79491600051147d1d6d3c7273dbc Reviewed-on: https://boringssl-review.googlesource.com/5745 Reviewed-by: Adam Langley <agl@google.com>
2015-08-19Fix documentation generation on Windows.Brian Smith
Previously doc/doc.css was a symlink to util/doc.css, but symlinks don't work well on Windows. Now util/doc.css is copied to the output directory when the documentation is generated. Change-Id: I2c9f4fee4f4307cc3dd70c4be380b4551d5e9ab5 Reviewed-on: https://boringssl-review.googlesource.com/5677 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-07-10Add standalone tests for Poly1305.David Benjamin
RFC 7359 includes tests for various edge cases. Also, as CRYPTO_poly1305_update can be used single-shot and streaming, we should explicitly stress both. Change-Id: Ie44c203a77624be10397ad05f06ca98d937db76f Reviewed-on: https://boringssl-review.googlesource.com/5410 Reviewed-by: Adam Langley <agl@google.com>
2015-07-02Add tests for low-level AES functions.David Benjamin
May as well. Depending on the implementation chosen in cipher/e_aes.c, AES_encrypt may or may not be hit, so test this entry point explicitly. Change-Id: Icb02bf3f4b6e5ecbb9e5111f44fbb1b267ead6c3 Reviewed-on: https://boringssl-review.googlesource.com/5312 Reviewed-by: Adam Langley <agl@google.com>
2015-06-25Remove EVP_PKEY_HMAC.David Benjamin
This removes EVP_PKEY_HMAC and all the support code around it. EVP_MD requires a lot of extra glue to support HMAC. This lets us prune it all away. As a bonus, it removes a (minor) dependency from EVP to the legacy ASN.1 stack. Change-Id: I5a9e3e39f518429828dbf13d14647fb37d9dc35a Reviewed-on: https://boringssl-review.googlesource.com/5120 Reviewed-by: Adam Langley <agl@google.com>
2015-06-23Give generated assembly files different names for arm and aarch64.William Hesse
Change-Id: I843e43ec56e14a2697bbdd5d6093fdb4d7cf15c2 Reviewed-on: https://boringssl-review.googlesource.com/5200 Reviewed-by: Adam Langley <agl@google.com>
2015-06-16Output test configs for Bazel builds.Adam Langley
This change amends generate_build_files.py so that Bazel output includes rules for the (no-Go) tests. Change-Id: I0c8dca599d6f828191eb665332af3193c650bc1a Reviewed-on: https://boringssl-review.googlesource.com/5102 Reviewed-by: Adam Langley <agl@google.com>
2015-06-16Move test configuration into a separate file.Adam Langley
Change-Id: I4e84a5fa1c73ed3da06d5a277df4eb2a85a6534a Reviewed-on: https://boringssl-review.googlesource.com/5100 Reviewed-by: Adam Langley <agl@google.com>
2015-06-16Updates to the build-file generation script.Adam Langley
This change adds ‘android-standalone’ and ‘bazel’ targets to the build-file generation script. It also allows multiple build outputs to be written in one invocation, which saves the cost of Perl to build all the assembly files multiple times. Note that this will require changes to the Chromium GYP files when its rolled out because “boringssl_lib_sources” has been broken into “boringssl_crypto_sources” and “boringssl_ssl_sources”. Change-Id: Icfe9678d08fba74fd215cf92521831e9cdc265da Reviewed-on: https://boringssl-review.googlesource.com/5070 Reviewed-by: Adam Langley <agl@google.com>
2015-06-03Sync vs_toolschain.py up with Chromium.David Benjamin
win8sdk got renamed to win_sdk. Also minor fixes from upstream, mostly pylint. Upstream also no longer keeps the toolchain hash in a separate file. Change-Id: Iefc8bb6a487f0cdb13fcf3131b0fba317ca6548b Reviewed-on: https://boringssl-review.googlesource.com/4982 Reviewed-by: Adam Langley <agl@google.com>
2015-05-21Add malloc test support to unit tests.David Benjamin
Currently far from passing and I haven't even tried with a leak checker yet. Also bn_test is slow. Change-Id: I4fe2783aa5f7897839ca846062ae7e4a367d2469 Reviewed-on: https://boringssl-review.googlesource.com/4794 Reviewed-by: Adam Langley <agl@google.com>
2015-05-21Also skip #elif lines.David Benjamin
One of these days we may need to get a more aggressive C parser... Change-Id: I7c6a848fb3b7f41083ac70542aa17e971baf10a4 Reviewed-on: https://boringssl-review.googlesource.com/4786 Reviewed-by: Adam Langley <agl@google.com>
2015-05-21Parse macros in getNameFromDecl.David Benjamin
Fleshes out the table of contents more. Change-Id: I8f8f0e43bdf7419f978b4fc66de80922ed1ae425 Reviewed-on: https://boringssl-review.googlesource.com/4785 Reviewed-by: Adam Langley <agl@google.com>
2015-05-20Add infrastructure for reference counts.Adam Langley
OpenSSL has traditionally done reference counting with |int|s and the |CRYPTO_add| function. Unless a special callback is installed (rare), this is implemented by doing the reference count operations under a lock. This change adds infrastructure for handling reference counts and uses atomic operations when C11 support is available. Change-Id: Ia023ce432319efd00f77a7340da27d16ee4b63c3 Reviewed-on: https://boringssl-review.googlesource.com/4771 Reviewed-by: Adam Langley <agl@google.com>
2015-05-12Fix generate_build_files.py to account for crypto/test.David Benjamin
crypto/test contains not tests, but a test support library that should be linked into each test. Change-Id: If1c85eda2a3df1717edd38575e1ec792323c400b Reviewed-on: https://boringssl-review.googlesource.com/4720 Reviewed-by: Adam Langley <agl@google.com>
2015-05-12Add evp_test, loosely based on upstream's version.David Benjamin
This imports the EVP_PKEY test data of upstream's evptests.txt, but modified to fit our test framework and with a new test driver. The remainder of the test data will be imported separately into aead_test and cipher_test. Some minor changes to the test format were made to account for test framework differences. One test has different results since we don't support RSA signatures with omitted (rather than NULL) parameters. Otherwise, the biggest difference in test format is that the ad-hoc result strings are replaced with checking ERR_peek_error. Change-Id: I758869abbeb843f5f2ac6c1cbd87333baec08ec3 Reviewed-on: https://boringssl-review.googlesource.com/4703 Reviewed-by: Adam Langley <agl@google.com>
2015-05-12Rename evp_test to evp_extra_test.David Benjamin
This matches how upstream imported that test. evp_test will be used for the subset of upstream's evp_test which land in our crypto/evp layer. (Some of crypto/evp is in crypto/cipher for us, so those tests will be in a ported cipher_test.) Change-Id: Ic899442794b66350e73a706bb7c77a6ff3d2564b Reviewed-on: https://boringssl-review.googlesource.com/4702 Reviewed-by: Adam Langley <agl@google.com>
2015-05-12Add file-based test framework and convert hmac_test.David Benjamin
This adds a file-based test framework to crypto/test. It knows how to parse formats similar to either upstream's evp_test and our aead_test. hmac_test has been converted to that with tests from upstream's evp_test. Upstream tests it against the deprecated EVP_PKEY_HMAC API, which will be tested by running evp_test against the same input file, to avoid having to duplicate the test vectors. hmac_test runs those same inputs against the supported HMAC_CTX APIs. Change-Id: I9d2b6adb9be519760d1db282b9d43efd6f9adffb Reviewed-on: https://boringssl-review.googlesource.com/4701 Reviewed-by: Adam Langley <agl@google.com>
2015-05-08Add support for CMAC (RFC 4493).Adam Langley
The interface for this is very similar to upstream, but the code is quite different. Support for “resuming” (i.e. calling |CMAC_Final| and then computing the CMAC for an extension of the message) has been dropped. Also, calling |CMAC_Init| with magic argument to reset it has been replaced with |CMAC_Reset|. Lastly, a one-shot function has been added because it can save an allocation and that's what most callers actually appear to want to do. Change-Id: I9345220218bdb16ebe6ca356928d7c6f055d83f6 Reviewed-on: https://boringssl-review.googlesource.com/4630 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-05-07Add generate_build_files.py.Adam Langley
generate_build_files.py is a generalisation of update_gypi_and_asm.py that works for both Chromium and Android. In the future, these projects will drop their copies of update_gypi_and_asm.py and will use this script instead. Change-Id: Ie32ce629ef44a6c070e329c7bc5e4531205b9709 Reviewed-on: https://boringssl-review.googlesource.com/4631 Reviewed-by: Adam Langley <agl@google.com>
2015-05-05Add support for building with the Android NDK.Adam Langley
Previously I've been using the Linaro toolchains and just building static binaries. However, the Linaro toolchains have a broken pthread_rwlock_wrlock—it does nothing and then unlocking corrupts the lock. Building with the Android NDK avoids this. These build instructions depend on https://github.com/taka-no-me/android-cmake which people will need to clone into util/ if they want to use the Android NDK. Change-Id: Ic64919f9399af2a57e8df4fb4b3400865ddb2427 Reviewed-on: https://boringssl-review.googlesource.com/4600 Reviewed-by: Adam Langley <agl@google.com>
2015-04-20Add a tool to download Chromium's prebuilt clang.David Benjamin
See tools/clang/scripts/update.sh. This'll be used to run ASan on the bots. BUG=469928 Change-Id: I6b5093c2db21ad4ed742852944e77a6b32e29e29 Reviewed-on: https://boringssl-review.googlesource.com/4402 Reviewed-by: Adam Langley <agl@google.com>
2015-04-14Add some missing headers to doc.config.David Benjamin
Change-Id: I9d9c055c6cd2c51183f704d61aea6ccbfc218629 Reviewed-on: https://boringssl-review.googlesource.com/4294 Reviewed-by: Adam Langley <agl@google.com>
2015-04-14Skip #if lines in getNameFromDecl.David Benjamin
Otherwise we get all these 'defined' symbols everywhere. Change-Id: I4c21a4df8963146a79af3511a400f06698f1078a Reviewed-on: https://boringssl-review.googlesource.com/4292 Reviewed-by: Adam Langley <agl@google.com>
2015-04-14Start generating documentation for ssl.h.David Benjamin
There's this giant "Underdocumented functions" section in the middle, but it doesn't look too silly once the "Deprecated methods" section is merged in with the other deprecated functions. Change-Id: Ib97d88b0f915f60e9790264474a9e4aa3e115382 Reviewed-on: https://boringssl-review.googlesource.com/4291 Reviewed-by: Adam Langley <agl@google.com>
2015-04-11Fix some parsing bugs in doc.go.David Benjamin
skipPast got confused when STACK_OF wasn't in the front of the string (which it rarely was due to OPENSSL_EXPORT). It also couldn't parse comments which end with a '*/' on their own. (Stylistically we don't do this, but ssl_cipher_preference_list_st ends with an ASCII art diagram which probably shouldn't gain a comment marker in the middle.) Change-Id: I7687f4fd126003108906b995da0f2cd53f7d693a Reviewed-on: https://boringssl-review.googlesource.com/4288 Reviewed-by: Adam Langley <agl@google.com>
2015-04-09Fix up whitespace in headers for doc.go.Adam Langley
Also, set sensible defaults for the command-line arguments to doc.go. Change-Id: Iefd2ade4c9095489efa0ae1059007593fc84923a
2015-04-06runner and all_tests should exit with failure on failing tests.David Benjamin
Otherwise the bots don't notice. BUG=473924 Change-Id: Idb8cc4c255723ebbe2d52478040a70648910bf37 Reviewed-on: https://boringssl-review.googlesource.com/4232 Reviewed-by: Adam Langley <agl@google.com>
2015-04-06Add the is_unexpected key to the test output.David Benjamin
If the key is missing, it seems the failure is assumed to be expected. BUG=473924 Change-Id: I62edd9110fa74bee5e6425fd6786badf5398728c Reviewed-on: https://boringssl-review.googlesource.com/4231 Reviewed-by: Adam Langley <agl@google.com>