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-04-19Switch all 'num' parameters in crypto/modes to unsigned.David Benjamin
Also switch the EVP_CIPHER copy to cut down on how frequently we need to cast back and forth. BUG=22 Change-Id: I9af1e586ca27793a4ee6193bbb348cf2b28a126e Reviewed-on: https://boringssl-review.googlesource.com/7689 Reviewed-by: Steven Valdez <svaldez@google.com> 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-08-21Re-add |EVP_des_ede|, which is ECB.Matt Braithwaite
(I couldn't find an authoritative source of test data, including in OpenSSL's source, so I used OpenSSL's implementation to produce the test ciphertext.) This benefits globalplatform. Change-Id: Ifb79e77afb7efed1c329126a1a459bbf7ce6ca00 Reviewed-on: https://boringssl-review.googlesource.com/5725 Reviewed-by: Adam Langley <agl@google.com>
2015-08-21Re-add |EVP_des_ede_cbc|.Matt Braithwaite
Note that while |DES_ede2_cbc_encrypt| exists, I didn't use it: I think it's easier to see what's happening this way. (I couldn't find an authoritative source of test data, including in OpenSSL's source, so I used OpenSSL's implementation to produce the test ciphertext.) This benefits globalplatform. Change-Id: I7e17ca0b69067d7b3f4bc213b4616eb269882ae0 Reviewed-on: https://boringssl-review.googlesource.com/5724 Reviewed-by: Adam Langley <agl@google.com>
2015-08-20Add |EVP_des_ecb| from OpenSSL at fd682e4c.Matt Braithwaite
|DES_ecb_encrypt| was already present. This benefits globalplatform. Change-Id: I2ab41eb1936b3026439b5981fb27e29a12672b66 Reviewed-on: https://boringssl-review.googlesource.com/5723 Reviewed-by: Adam Langley <agl@google.com>
2015-08-19Re-add the C version (only) of |EVP_aes_256_xts|Matt Braithwaite
Change-Id: I63c70f93a0f9395673c9fbe01eb5d864a14a48b6 Reviewed-on: https://boringssl-review.googlesource.com/5520 Reviewed-by: Adam Langley <agl@google.com> Reviewed-by: Matt Braithwaite <mab@google.com>
2015-08-06Add |EVP_rc2_cbc| and implement |EVP_CTRL_SET_RC2_KEY_BITS|.Matt Braithwaite
Add it to |EVP_get_cipherbynid|, along with |EVP_rc2_40_cbc| and |EVP_aes_192_cbc|. Change-Id: Iee7621a91262359d1650684652995884a6cef37a Reviewed-on: https://boringssl-review.googlesource.com/5590 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-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-05Add AES-192 ECB.Adam Langley
I tried so hard to get rid of AES-192, but it's called from too many places. I suspect that those places don't actually use it, but it's dangerous to assume that. Change-Id: I6208b64a463e3539973532abd21882e0e4c55a1c
2015-04-14Compatibility changes for wpa_supplicant and OpenSSH.Adam Langley
OpenSSH, especially, does some terrible things that mean that it needs the EVP_CIPHER structure to be exposed ☹. Damian is open to a better API to replace this, but only if OpenSSL agree too. Either way, it won't be happening soon. Change-Id: I393b7a6af6694d4d2fe9ebcccd40286eff4029bd Reviewed-on: https://boringssl-review.googlesource.com/4330 Reviewed-by: Adam Langley <agl@google.com>
2015-04-13Remove crypto/obj dependencies from low-level crypto tests.Brian Smith
The only dependency the low-level crypto modules have on code in crypto/obj is their use of OBJ_nid2sn, which is trivial to avoid. This facilitates future simplification of crypto/obj, including possibly the removal of functions like OBJ_nid2sn and the complex build infrastructure that supports them. This change also removes EVP_CIPHER_name and EVP_MD_name. Change-Id: I34ce7dc7e58d5c08b52f95d25eba3963590cf2f7 Reviewed-on: https://boringssl-review.googlesource.com/3932 Reviewed-by: Adam Langley <agl@google.com>
2015-04-11Replace RC4 in examples with AES-128-GCM.Brian Smith
Avoiding superflous references to RC4 makes it easier to audit the code to find unsafe uses of it. It also avoids subtly encouraging users to choose RC4 instead of a better alternative. Change-Id: Ia27d7f4cd465e143d30a28b36c7871f7c30411ea Reviewed-on: https://boringssl-review.googlesource.com/3990 Reviewed-by: Adam Langley <agl@google.com>
2015-04-07Support several flavours of AES-192.Adam Langley
Change-Id: I28d302fad0d3d00fa69d3224a96366207729d8d5
2015-04-07Add OFB mode.Adam Langley
Change-Id: I267cf7897b5a9f73f8de729971cb9e92937011dd
2015-03-19Add AEADs for AES-CTR with HMAC-SHA256.Adam Langley
Change-Id: Id035d2c6ab9c6ae034326c313ffe35e0d035dec1 Reviewed-on: https://boringssl-review.googlesource.com/3911 Reviewed-by: Adam Langley <agl@google.com>
2015-03-06Don't delay-initialize legacy AEADs.David Benjamin
Instead, add a separate init_with_direction hook. Normal AEADs ignore the direction, while legacy AEADs must be initialized with it. This avoids maintaining extra state to support the delayed initialization. Change-Id: I25271f0e56ee2783a2fd4d4026434154d58dc0a8 Reviewed-on: https://boringssl-review.googlesource.com/3731 Reviewed-by: Adam Langley <agl@google.com>
2015-02-23EVP_CIPHER_CTX_cleanup cannot fail.David Benjamin
There is exactly one implementation and it doesn't fail. Plus a cleanup function that can fail is very bad manners; the caller has no choice but to leak at that point. Change-Id: I5b524617ef37bc7d92273472fa742416ea7dfd43 Reviewed-on: https://boringssl-review.googlesource.com/3564 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>
2015-01-14Implement SSLv3 ciphers with stateful AEADs.David Benjamin
This introduces another knob into SSL_AEAD_CTX to omit the version from the ad parameter. It also allows us to fold a few more SSL3_ENC_METHOD hooks together. Change-Id: I6540d410d4722f734093554fb434dab6e5217d4f Reviewed-on: https://boringssl-review.googlesource.com/2698 Reviewed-by: Adam Langley <agl@google.com>
2015-01-14Implement all TLS ciphers with stateful AEADs.David Benjamin
The EVP_CIPHER codepath should no longer be used with TLS. It still exists for DTLS and SSLv3. The AEAD construction in TLS does not allow for variable-overhead AEADs, so stateful AEADs do not include the length in the ad parameter. Rather the AEADs internally append the unpadded length once it is known. EVP_aead_rc4_md5_tls is modified to account for this. Tests are added (and RC4-MD5's regenerated) for each of the new AEADs. The cipher tests are all moved into crypto/cipher/test because there's now a lot of them and they clutter the directory listing. In ssl/, the stateful AEAD logic is also modified to account for stateful AEADs with a fixed IV component, and for AEADs which use a random nonce (for the explicit-IV CBC mode ciphers). The new implementation fixes a bug/quirk in stateless CBC mode ciphers where the fixed IV portion of the keyblock was generated regardless. This is at the end, so it's only relevant for EAP-TLS which generates a MSK from the end of the key block. Change-Id: I2d8b8aa11deb43bde2fd733f4f90b5d5b8cb1334 Reviewed-on: https://boringssl-review.googlesource.com/2692 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-18Update EVP_Cipher documentation some more.David Benjamin
It doesn't retain partial blocks but it DOES update internal cipher state. ssl/ depends on this property. Change-Id: I1e44b612c2e1549e096de8b71726007dcbc68de3 Reviewed-on: https://boringssl-review.googlesource.com/2640 Reviewed-by: Adam Langley <agl@google.com>
2014-12-16Fix EVP_Cipher error-handling.David Benjamin
Turns out the EVP_CIPH_FLAG_CUSTOM_CIPHER ciphers (i.e. legacy EVP_CIPHER AES-GCM) have a completely different return value setup than the normal ones which are the standard one/zero. (Except that they never return zero; see TODO.) Fix checks in ssl/ and remove remnants of EVP_CIPH_FLAG_CUSTOM_CIPHER in ssl/ as we're using EVP_AEAD now. See CHANGES entry added in upstream's 3da0ca796cae6625bd26418afe0a1dc47bf5a77f. Change-Id: Ia4d0ff59b03c35fab3a08141c60b9534cb7172e2 Reviewed-on: https://boringssl-review.googlesource.com/2606 Reviewed-by: Adam Langley <agl@google.com>
2014-09-27Add deprecated functions for tcpdump.Adam Langley
This reduces the delta for getting Android to compile and avoids having Android carry around diffs to upstream versions of tcpdump. Change-Id: I7f4cbb22b7a0f246bbebe960ca2139f0f42e14a0 Reviewed-on: https://boringssl-review.googlesource.com/1830 Reviewed-by: Adam Langley <agl@google.com>
2014-08-27Readd EVP_CIPHER_CTX_set_key_length.Adam Langley
This only applies to RC4, but it is still used by some Android code. Change-Id: I4cf86269ffb7a230576da1bb2bfef7e1d4f234d6 Reviewed-on: https://boringssl-review.googlesource.com/1621 Reviewed-by: Adam Langley <agl@google.com>
2014-08-26Add 40-bit RC2 support.Adam Langley
As useless as it might seem, the certificates in PKCS#12 files appear to always be encrypted with 40-bit RC2. OpenSSL, NSS and Windows are all the same on this point. Thus, in order to be able to import PKCS#12 files we need RC2 support. RC2 has deliberately not been added to EVP_get_cipherbynid so that the linker can drop the RC2 code unless the PKCS#12 functions are actually called. Change-Id: I5b2062fdf78cb622a8038c326da01aac8fb58962 Reviewed-on: https://boringssl-review.googlesource.com/1590 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-29Make EVP_CIPHER_CTX_copy work in GCM mode.Adam Langley
PR#3272 (Imported from upstream's 14183e50e75f54c44df6be69670180860ac19550 and 802fdcda1ebc4241a8e02af0046ba2f5264f71f6) Change-Id: Ied6183d938e320f953a18f6616890d88b74def3f
2014-07-29Add AES Key Wrap mode.Adam Langley
This is needed in order to support Web Crypto. https://code.google.com/p/chromium/issues/detail?id=396407 Change-Id: I900d8cad2716c2e3341eeae153659502326c9173 Reviewed-on: https://boringssl-review.googlesource.com/1335 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.)