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-23Move some typedefs to base.h.Matt Braithwaite
Change-Id: I48bcf3a989752901903d68b50665910b9372a2ff Reviewed-on: https://boringssl-review.googlesource.com/8860 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
2016-06-20Compute kinv in DSA with Fermat's Little Theorem.David Benjamin
It's a prime, so computing a constant-time mod inverse is straight-forward. Change-Id: Ie09b84363c3d5da827989300a844c470437fd8f2 Reviewed-on: https://boringssl-review.googlesource.com/8308 Reviewed-by: Adam Langley <agl@google.com>
2016-03-08Add DSA_generate_parameters to decrepit.Adam Langley
This function was deprecated by OpenSSL in 0.9.8 but code that uses it still exists. This change adds an implementation of this function to decreipt/ to support these programs. Change-Id: Ie99cd00ff8b0ab2675f2b1c821c3d664b9811f16 Reviewed-on: https://boringssl-review.googlesource.com/7360 Reviewed-by: David Benjamin <davidben@google.com>
2016-02-17Reimplement DSA parsing logic with crypto/asn1.David Benjamin
Functions which lose object reuse and need auditing: - d2i_DSA_SIG - d2i_DSAPublicKey - d2i_DSAPrivateKey - d2i_DSAparams BUG=499653 Change-Id: I1cc2ae10e1e77eb57da3a858ac8734a95715ce4b Reviewed-on: https://boringssl-review.googlesource.com/7022 Reviewed-by: Adam Langley <agl@google.com>
2016-02-17Remove DSA write_params.David Benjamin
This imports upstream's ea6b07b54c1f8fc2275a121cdda071e2df7bd6c1 along with a bugfix in 987157f6f63fa70dbeffca3c8bc62f26e9767ff2. In an SPKI, a DSA key is only an INTEGER, with the group information in the AlgorithmIdentifier. But a standalone DSAPublicKey is more complex (and apparently made up by OpenSSL). OpenSSL implemented this with a write_params boolean and making DSAPublicKey a CHOICE. Instead, have p_dsa_asn1.c encode an INTEGER directly. d2i_DSAPublicKey only parses the standalone form. (That code will be replaced later, but first do this in preparation for rewriting the DSA ASN.1 code.) Change-Id: I6fbe298d2723b9816806e9c196c724359b9ffd63 Reviewed-on: https://boringssl-review.googlesource.com/7021 Reviewed-by: Adam Langley <agl@google.com>
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-19Update comments to better document in-place semantics.Adam Langley
(Comment-only change; no functional difference.) Some code was broken by the |d2i_ECDSA_SIG| change in 87897a8c. It was passing in a pointer to an existing |ECDSA_SIG| as the first argument and then simply assuming that the structure would be updated in place. The comments on the function suggested that this was reasonable. This change updates the comments that use similar wording to either note that the function will never update in-place, or else to note that depending on that is a bad idea for the future. I've also audited all the uses of these functions that I can find and, in addition to the one case with |d2i_ECDSA_SIG|, there are several users of |d2i_PrivateKey| that could become a problem in the future. I'll try to fix them before it does become an issue. Change-Id: I769f7b2e0b5308d09ea07dd447e02fc161795071 Reviewed-on: https://boringssl-review.googlesource.com/6902 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-12-16Remove the CRYPTO_EX_new callback.David Benjamin
This callback is never used. The one caller I've ever seen is in Android code which isn't built with BoringSSL and it was a no-op. It also doesn't actually make much sense. A callback cannot reasonably assume that it sees every, say, SSL_CTX created because the index may be registered after the first SSL_CTX is created. Nor is there any point in an EX_DATA consumer in one file knowing about an SSL_CTX created in completely unrelated code. Replace all the pointers with a typedef to int*. This will ensure code which passes NULL or 0 continues to compile while breaking code which passes an actual function. This simplifies some object creation functions which now needn't worry about CRYPTO_new_ex_data failing. (Also avoids bouncing on the lock, but it's taking a read lock, so this doesn't really matter.) BUG=391192 Change-Id: I02893883c6fa8693682075b7b130aa538a0a1437 Reviewed-on: https://boringssl-review.googlesource.com/6625 Reviewed-by: Adam Langley <agl@google.com>
2015-11-04Unwind DH_METHOD and DSA_METHOD.David Benjamin
This will allow a static linker (with -ffunction-sections since things aren't split into files) to drop unused parts of DH and DSA. Notably, the parameter generation bits pull in primality-checking code. Change-Id: I25087e4cb91bc9d0ab43bcb267c2e2c164e56b59 Reviewed-on: https://boringssl-review.googlesource.com/6388 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-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-04-16Unexpose the generic ex_data functions.David Benjamin
Callers are required to use the wrappers now. They still need OPENSSL_EXPORT since crypto and ssl get built separately in the standalone shared library build. Change-Id: I61186964e6099b9b589c4cd45b8314dcb2210c89 Reviewed-on: https://boringssl-review.googlesource.com/4372 Reviewed-by: Adam Langley <agl@google.com>
2015-04-14Convert BN_MONT_CTX to new-style locking.Adam Langley
This introduces a per-RSA/DSA/DH lock. This is good for lock contention, although pthread locks are depressingly bloated. Change-Id: I07c4d1606fc35135fc141ebe6ba904a28c8f8a0c Reviewed-on: https://boringssl-review.googlesource.com/4324 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-13Fix DER checks for DSA_check_signature and add tests.David Benjamin
DSA_verify and DSA_check_signature didn't share a codepath, so the fix was only applied to the former. Implement verify in terms of check_signature and add tests for bad DER variants. Change-Id: I6577f96b13b57fc89a5308bd8a7c2318defa7ee1 Reviewed-on: https://boringssl-review.googlesource.com/2820 Reviewed-by: Adam Langley <agl@google.com>
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-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-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.)