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 "Move C++ helpers into |bssl| namespace."Adam Langley
This reverts commit 09feb0f3d95a2bc58ce0faaf14256d3bd30f52a4. (In order to make WebRTC happy this also needs to be reverted.)
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-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-07-12Move C++ helpers into |bssl| namespace.Adam Langley
We currently have the situation where the |tool| and |bssl_shim| code includes scoped_types.h from crypto/test and ssl/test. That's weird and shouldn't happen. Also, our C++ consumers might quite like to have access to the scoped types. Thus this change moves some of the template code to base.h and puts it all in a |bssl| namespace to prepare for scattering these types into their respective headers. In order that all the existing test code be able to access these types, it's all moved into the same namespace. Change-Id: I3207e29474dc5fcc344ace43119df26dae04eabb Reviewed-on: https://boringssl-review.googlesource.com/8730 Reviewed-by: David Benjamin <davidben@google.com>
2016-06-10Wrap MSVC-only warning pragmas in a macro.David Benjamin
There's a __pragma expression which allows this. Android builds us Windows with MinGW for some reason, so we actually do have to tolerate non-MSVC-compatible Windows compilers. (Clang for Windows is much more sensible than MinGW and intentionally mimicks MSVC.) MinGW doesn't understand MSVC's pragmas and warns a lot. #pragma warning is safe to suppress, so wrap those to shush them. This also lets us do away with a few ifdefs. Change-Id: I1f5a8bec4940d4b2d947c4c1cc9341bc15ec4972 Reviewed-on: https://boringssl-review.googlesource.com/8236 Reviewed-by: Adam Langley <agl@google.com>
2016-05-19Rename NEWHOPE functions to offer/accept/finish.Matt Braithwaite
This is consistent with the new convention in ssl_ecdh.c. Along the way, change newhope_test.c to not iterate 1000 times over each test. Change-Id: I7a500f45b838eba8f6df96957891aa8e880ba089 Reviewed-on: https://boringssl-review.googlesource.com/8012 Reviewed-by: David Benjamin <davidben@google.com>
2016-04-27Pass array by reference in newhope speed test.Adam Langley
This is another thing that MSVC can't cope with: ..\tool\speed.cc(537) : error C2536: 'SpeedNewHope::<⋯>::SpeedNewHope::<⋯>::clientmsg' : cannot specify explicit initializer for arrays Change-Id: I6b4cb430895f7794e9cef1b1c12b57ba5d537c64
2016-04-27Import `newhope' (post-quantum key exchange).Matt Braithwaite
This derives from the reference implementation: Source: https://github.com/tpoeppelmann/newhope/tree/master/ref at bc06c1ac Paper: https://eprint.iacr.org/2015/1092 However, it does not interoperate, due to the replacement of SHAKE-128 with AES-CTR (for polynomial generation) and the replacement of SHA-3 with SHA-256 (for key whitening). Change-Id: I6a55507aea85331245e2fbd41bae5cc049fdca3c Reviewed-on: https://boringssl-review.googlesource.com/7690 Reviewed-by: Adam Langley <agl@google.com>
2016-03-31Remove some easy obj.h dependencies.David Benjamin
A lot of consumers of obj.h only want the NID values. Others didn't need it at all. This also removes some OBJ_nid2sn and OBJ_nid2ln calls in EVP error paths which isn't worth pulling a large table in for. BUG=chromium:499653 Change-Id: Id6dff578f993012e35b740a13b8e4f9c2edc0744 Reviewed-on: https://boringssl-review.googlesource.com/7563 Reviewed-by: David Benjamin <davidben@google.com>
2016-03-01Pass |alice_msg| by reference in the SPAKE2 speed test.Adam Langley
This is an attempt to make MSVC happy. Currently it's saying: ..\tool\speed.cc(508) : error C2536: 'SpeedSPAKE2::<lambda_…>::SpeedSPAKE2::<lambda_…>::alice_msg' : cannot specify explicit initializer for arrays Change-Id: Ifba1df26b5d734f142668a41834645c1549f9f52 Reviewed-on: https://boringssl-review.googlesource.com/7248 Reviewed-by: David Benjamin <davidben@google.com>
2016-03-01Add SPAKE2 over Ed25519.Arnar Birgisson
SPAKE2 is a password-authenticated key exchange. This implementation is over the twisted Edwards curve Ed25519, and uses SHA-512 as the hash primitive. See https://tools.ietf.org/html/draft-irtf-cfrg-spake2-03 Change-Id: I2cd3c3ebdc3d55ac3aea3a9eb0d06275509597ac Reviewed-on: https://boringssl-review.googlesource.com/7114 Reviewed-by: Adam Langley <agl@google.com>
2015-12-19Enable Ed25519 when building with OPENSSL_SMALL.Adam Langley
OPENSSL_SMALL will still cause the smaller base-point table to be used and so won't be as fast at signing as the full version, but Ed25519 will now work in those builds. Without OPENSSL_SMALL: Did 20000 Ed25519 key generation operations in 1008347us (19834.4 ops/sec) Did 20000 Ed25519 signing operations in 1025594us (19500.9 ops/sec) Did 6138 Ed25519 verify operations in 1001712us (6127.5 ops/sec) Did 21000 Curve25519 base-point multiplication operations in 1019237us (20603.6 ops/sec) Did 7095 Curve25519 arbitrary point multiplication operations in 1065986us (6655.8 ops/sec) With (on the same machine): Did 8415 Ed25519 key generation operations in 1020958us (8242.3 ops/sec) Did 8952 Ed25519 signing operations in 1077635us (8307.1 ops/sec) Did 6358 Ed25519 verify operations in 1047533us (6069.5 ops/sec) Did 6620 Curve25519 base-point multiplication operations in 1008922us (6561.5 ops/sec) Did 7183 Curve25519 arbitrary point multiplication operations in 1096285us (6552.1 ops/sec) Change-Id: Ib443c0e2bdfd11e044087e66efd55b651a5667e7 Reviewed-on: https://boringssl-review.googlesource.com/6772 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-12-17Add RC4-SHA1 and DES-EDE3-CBC-SHA1 to bssl speed.David Benjamin
For completeness. In so far as we care about legacy ciphers' performance at all, we should have the others too. Change-Id: Idd2d93345f3af8b6ac5772a1cb3c201f84fe3197 Reviewed-on: https://boringssl-review.googlesource.com/6750 Reviewed-by: Adam Langley <agl@google.com>
2015-12-17Point EVP_aead_chacha20_poly1305 at the standardized version.David Benjamin
The consumers have all been updated, so we can move EVP_aead_chacha20_poly1305 to its final state. Unfortunately, the _rfc7539-suffixed version will need to stick around for just a hair longer. Also the tls1.h macros, but the remaining consumers are okay with that changing underneath them. Change-Id: Ibbb70ec1860d6ac6a7e1d7b45e70fe692bf5ebe5 Reviewed-on: https://boringssl-review.googlesource.com/6600 Reviewed-by: Adam Langley <agl@google.com>
2015-11-18Fix curve25519 code for MSVC.Adam Langley
MSVC doesn't like unary minus on unsigned types. Also, the speed test always failed because the inputs were all zeros and thus had small order. Change-Id: Ic2d3c2c9bd57dc66295d93891396871cebac1e0b
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-10-27For now, give the unsuffixed ChaCha20 AEAD name to the old version.Adam Langley
QUIC has a complex relationship with BoringSSL owing to it living both in Chromium and the Google-internal repository. In order for it to handle the ChaCha20-Poly1305 AEAD switch more easily this change gives the unsuffixed name to the old AEAD, for now. Once QUIC has moved to the “_old” version the unsuffixed name can be given to the new version. Change-Id: Id8a77be6e3fe2358d78e022413fe088e5a274dca Reviewed-on: https://boringssl-review.googlesource.com/6361 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <alangley@gmail.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-07-08Parse RSAPrivateKey with CBS.David Benjamin
This removes the version field from RSA and instead handles versioning as part of parsing. (As a bonus, we now correctly limit multi-prime RSA to version 1 keys.) Most consumers are also converted. old_rsa_priv_{de,en}code are left alone for now. Those hooks are passed in parameters which match the old d2i/i2d pattern (they're only used in d2i_PrivateKey and i2d_PrivateKey). Include a test which, among other things, checks that public keys being serialized as private keys are handled properly. BUG=499653 Change-Id: Icdd5f0382c4a84f9c8867024f29756e1a306ba08 Reviewed-on: https://boringssl-review.googlesource.com/5273 Reviewed-by: Adam Langley <agl@google.com>
2015-06-09Make constants in bssl tool actually const.David Benjamin
Change-Id: Iedf6a1bafbe195b689e1aebd2293332e38c1f4c7 Reviewed-on: https://boringssl-review.googlesource.com/5042 Reviewed-by: Adam Langley <agl@google.com>
2015-06-05Multi-prime RSA support.Adam Langley
RSA with more than two primes is specified in https://tools.ietf.org/html/rfc3447, although the idea goes back far earier than that. This change ports some of the changes in http://rt.openssl.org/Ticket/Display.html?id=3477&user=guest&pass=guest to BoringSSL—specifically those bits that are under an OpenSSL license. Change-Id: I51e8e345e2148702b8ce12e00518f6ef4683d3e1 Reviewed-on: https://boringssl-review.googlesource.com/4870 Reviewed-by: Adam Langley <agl@google.com>
2015-04-17tool: include base.h before testing OPENSSL_WINDOWS.Adam Langley
Even though windows.h etc are system headers, conditional includes have to come after the others. Change-Id: I839b3b6c32a76c806698e2cdc71e50433fa900b2
2015-04-16Add 64-bit, P-256 implementation.Adam Langley
This is taken from upstream, although it originally came from us. This will only take effect on 64-bit systems (x86-64 and aarch64). Before: Did 1496 ECDH P-256 operations in 1038743us (1440.2 ops/sec) Did 2783 ECDSA P-256 signing operations in 1081006us (2574.5 ops/sec) Did 2400 ECDSA P-256 verify operations in 1059508us (2265.2 ops/sec) After: Did 4147 ECDH P-256 operations in 1061723us (3905.9 ops/sec) Did 9372 ECDSA P-256 signing operations in 1040589us (9006.4 ops/sec) Did 4114 ECDSA P-256 verify operations in 1063478us (3868.4 ops/sec) Change-Id: I11fabb03239cc3a7c4a97325ed4e4c97421f91a9
2015-04-14tool: benchmark the RNG.Adam Langley
This change adds a benchmark for the RNG and also allows specific speed tests to be selected via a command-line argument, since the full speed suite is getting quite lengthy now and is only going to get longer in the future. Change-Id: If62c69177d58d3eb945d6108524c144ea0044137 Reviewed-on: https://boringssl-review.googlesource.com/4326 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-01Lowercase some Windows headers.Adam Langley
MinGW on Linux needs lowercase include files. On Windows this doesn't matter since the filesystems are case-insensitive, but building BoringSSL on Linux with MinGW has case-sensitive filesystems. Change-Id: Id9c120d819071b041341fbb978352812d6d073bc Reviewed-on: https://boringssl-review.googlesource.com/4090 Reviewed-by: Adam Langley <agl@google.com>
2015-03-18Fix bssl speed.David Benjamin
The TLS AEADs require EVP_AEAD_CTX_init_with_direction now. The speed command was never updated to account for this. BUG=467762 Change-Id: I8c7d4566b51d54d91d17318b8f4813ad8f19c777 Reviewed-on: https://boringssl-review.googlesource.com/3971 Reviewed-by: Adam Langley <agl@google.com>
2015-03-18Free new[]'d array using delete[] instead of free in speed.cc.Brian Smith
Change-Id: Ic3d5e8de0b6800c0852c2057427836302c1f1aaa Reviewed-on: https://boringssl-review.googlesource.com/3962 Reviewed-by: Adam Langley <agl@google.com>
2015-03-17Fix out-of-bounds memory write in speed.cc.Brian Smith
Windows x64 uses the IL32P64 data model, which means that unsigned int is 32 bits and size_t is 64 bits. Previously, the expression |~(alignment - 1)| resulted in the 32-bit value 0xFFFFFFF0, which was then extended to the 64-bit value 0x00000000FFFFFFF0 when promoted to size_t. When the input pointer was masked with this value, the result was a pointer that was usually way outside the boundaries of the array. The new code casts |alignment| to size_t first prior to the bitwise negation, resulting in the correct mask value of 0xFFFFFFFFFFFFFFF0. Change-Id: I04754aa9e1ce7a615c2b4c74051cfcca38dbb52f Reviewed-on: https://boringssl-review.googlesource.com/3961 Reviewed-by: Adam Langley <agl@google.com>
2015-02-02Remove string.h from base.h.Adam Langley
Including string.h in base.h causes any file that includes a BoringSSL header to include string.h. Generally this wouldn't be a problem, although string.h might slow down the compile if it wasn't otherwise needed. However, it also causes problems for ipsec-tools in Android because OpenSSL didn't have this behaviour. This change removes string.h from base.h and, instead, adds it to each .c file that requires it. Change-Id: I5968e50b0e230fd3adf9b72dd2836e6f52d6fb37 Reviewed-on: https://boringssl-review.googlesource.com/3200 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-01-31Enable more warnings & treat warnings as errors on Windows.Brian Smith
Change-Id: I2bf0144aaa8b670ff00b8e8dfe36bd4d237b9a8a Reviewed-on: https://boringssl-review.googlesource.com/3140 Reviewed-by: Adam Langley <agl@google.com>
2015-01-29Align pointers by hand.Adam Langley
This avoids having Windows be different and is also easier for testing because it's a simple matter to unalign the pointer if needed. Change-Id: I32cfa5834e3fe4f16304a25092b9c71946d4744d Reviewed-on: https://boringssl-review.googlesource.com/3131 Reviewed-by: Adam Langley <agl@google.com>
2015-01-29Define WIN32_LEAN_AND_MEAN in the build system, not in the code.Brian Smith
This avoids a conflict with the Chromium build system, which defines WIN32_LEAN_AND_MEAN with a different value. BUG=crbug.com/453196 Change-Id: Ia15ec7c20325c1961af4f32e5208266e5f846f35 Reviewed-on: https://boringssl-review.googlesource.com/3150 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-01-28Clean up use of Windows Platform SDK headers.Brian Smith
Define WIN32_LEAN_AND_MEAN before including Windows Platform SDK headers to preempt naming conflicts and to make the build faster. Avoid including those headers in BoringSSL headers. Document that Platform SDK 8.1 or later is required on Windows. Change-Id: I907ada21dc722527ea37e839c71c5157455a7003 Reviewed-on: https://boringssl-review.googlesource.com/3100 Reviewed-by: Adam Langley <agl@google.com>
2015-01-22Fix tool build on Windows.David Benjamin
C++ doesn't allow implicit void* casts. Change-Id: I50a2ab3fce6a38470b4e8216bd461ba2cd2c2215 Reviewed-on: https://boringssl-review.googlesource.com/2971 Reviewed-by: Adam Langley <agl@google.com>
2015-01-16Also test AES-CBC modes in the speed tool.Adam Langley
This change adds the AES-128-CBC-SHA and AES-256-CBC-SHA AEADs to the speed test. These AEADs need an 11 byte additional data so the test is extended to be able to provide that. Change-Id: I9a57c2321a979a68ab0df9faf1bb26b44a3009c4 Reviewed-on: https://boringssl-review.googlesource.com/2922 Reviewed-by: Adam Langley <agl@google.com>
2015-01-16Benchmark AEADs with aligned buffers.Adam Langley
This eliminates a source of variability from the benchmarks. Change-Id: I8ce07bd68e7591f8c5545040b02b96d21609a0e5 Reviewed-on: https://boringssl-review.googlesource.com/2920 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-07-01Add stitched RC4-MD5 as an AEAD.Adam Langley
This change adds the stitched RC4-MD5 code from upstream OpenSSL but exposes it as an AEAD. It's not a normal AEAD (it's stateful thus doesn't take an nonce) but forcing pre-AEAD cipher suites in the AEAD interface is less painful than forcing AEADs into the EVP_CIPHER interface. Over time, more and more cipher suites will be exposed as TLS-specific AEADs and then ssl/ can drop support for EVP_CIPHER. See original code from upstream: https://github.com/openssl/openssl/blob/master/crypto/evp/e_rc4_hmac_md5.c Change-Id: Ia9267b224747f02be6b934ea0b2b50e1f529fab9 Reviewed-on: https://boringssl-review.googlesource.com/1043 Reviewed-by: Adam Langley <agl@google.com>
2014-06-24Include some build fixes for OS X.Adam Langley
Apart from the obvious little issues, this also works around a (seeming) libtool/linker: a.c defines a symbol: int kFoo; b.c uses it: extern int kFoo; int f() { return kFoo; } compile them: $ gcc -c a.c $ gcc -c b.c and create a dummy main in order to run it, main.c: int f(); int main() { return f(); } this works as expected: $ gcc main.c a.o b.o but, if we make an archive: $ ar q lib.a a.o b.o and use that: $ gcc main.c lib.a Undefined symbols for architecture x86_64 "_kFoo", referenced from: _f in lib.a(b.o) (It doesn't matter what order the .o files are put into the .a) Linux and Windows don't seem to have this problem. nm on a.o shows that the symbol is of type "C", which is a "common symbol"[1]. Basically the linker will merge multiple common symbol definitions together. If ones makes a.c read: int kFoo = 0; Then one gets a type "D" symbol - a "data section symbol" and everything works just fine. This might actually be a libtool bug instead of an ld bug: Looking at `xxd lib.a | less`, the __.SYMDEF SORTED index at the beginning of the archive doesn't contain an entry for kFoo unless initialised. Change-Id: I4cdad9ba46e9919221c3cbd79637508959359427
2014-06-21Add benchmarks for hash functions to bssl speed.Adam Langley
2014-06-21Split the speed tests into their own file.Adam Langley