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
2015-12-15Limit depth of ASN1 parse printing.David Benjamin
(Imported from upstream's d88ef40a1e5c81d0d32b4a431e55f5456e678dd2 and 943c4ca62b3f5a160340d57aecb9413407a06e15.) Change-Id: Idd52aebae6839695be0f3a8a7659adeec6650b98 Reviewed-on: https://boringssl-review.googlesource.com/6556 Reviewed-by: Adam Langley <agl@google.com>
2015-12-03Fix leak with ASN.1 combine.David Benjamin
When parsing a combined structure pass a flag to the decode routine so on error a pointer to the parent structure is not zeroed as this will leak any additional components in the parent. This can leak memory in any application parsing PKCS#7 or CMS structures. CVE-2015-3195. Thanks to Adam Langley (Google/BoringSSL) for discovering this bug using libFuzzer. PR#4131 (Imported from upstream's cc598f321fbac9c04da5766243ed55d55948637d, with test from our original report. Verified ASan trips up on the test without the fix.) Change-Id: I007d93f172b2f16bf6845d685d72717ed840276c Reviewed-on: https://boringssl-review.googlesource.com/6615 Reviewed-by: Adam Langley <agl@google.com>
2015-11-12Become partially -Wmissing-variable-declarations-clean.David Benjamin
There's a few things that will be kind of a nuisance and possibly not worth it (crypto/asn1 dumps a lot of undeclared things, etc.). But it caught some mistakes. Even without the warning, making sure to include the externs before defining a function helps catch type mismatches. Change-Id: I3dab282aaba6023e7cebc94ed7a767a5d7446b08 Reviewed-on: https://boringssl-review.googlesource.com/6484 Reviewed-by: Adam Langley <agl@google.com>
2015-10-31Fix several warnings that arise in Android.Adam Langley
Android is now using Ninja so it doesn't spew so much to the terminal and thus any warnings in BoringSSL (which builds really early in the process) and much more obvious. Thus this change fixes a few warnings that appear in the Android build. Change-Id: Id255ace90fece772a1c3a718c877559ce920b960 Reviewed-on: https://boringssl-review.googlesource.com/6400 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-09-29d2i: don't update input pointer on failureDavid Benjamin
(Imported from upstream's 728bcd59d3d41e152aead0d15acc51a8958536d3.) Actually this one was reported by us, but the commit message doesn't mention this. This is slightly modified from upstream's version to fix some problems noticed in import. Specifically one of d2i_X509_AUX's success paths is bust and d2i_PrivateKey still updates on one error path. Resolve the latter by changing both it and d2i_AutoPrivateKey to explicitly hit the error path on ret == NULL. This lets us remove the NULL check in d2i_AutoPrivateKey. We'll want to report the problems back upstream. Change-Id: Ifcfc965ca6d5ec0a08ac154854bd351cafbaba25 Reviewed-on: https://boringssl-review.googlesource.com/5948 Reviewed-by: Adam Langley <agl@google.com>
2015-08-29Fix the type of ASN1_i2d_bio's last argument.David Benjamin
It's supposed to be void*. The only reason this was working was that it was only called in C which happily casts from void* to T*. (But if called in C++ in a macro, it breaks.) Change-Id: I7f765c3572b9b4815ae58da852be1e742de1bd96 Reviewed-on: https://boringssl-review.googlesource.com/5760 Reviewed-by: Adam Langley <agl@google.com>
2015-08-26Move arm_arch.h and fix up lots of include paths.Adam Langley
arm_arch.h is included from ARM asm files, but lives in crypto/, not openssl/include/. Since the asm files are often built from a different location than their position in the source tree, relative include paths are unlikely to work so, rather than having crypto/ be a de-facto, second global include path, this change moves arm_arch.h to include/openssl/. It also removes entries from many include paths because they should be needed as relative includes are always based on the locations of the source file. Change-Id: I638ff43d641ca043a4fc06c0d901b11c6ff73542 Reviewed-on: https://boringssl-review.googlesource.com/5746 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-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-05-05Don't set *pval to NULL in asn1_item_ex_combine_new.David Benjamin
While *pval is usually a pointer in rare circumstances it can be a long value. One some platforms (e.g. WIN64) where sizeof(long) < sizeof(ASN1_VALUE *) this will write past the field. *pval is initialised correctly in the rest of ASN1_item_ex_new so setting it to NULL is unecessary anyway. Thanks to Julien Kauffmann for reporting this issue. (Imported from upstream's f617b4969a9261b9d7d381670aefbe2cf766a2cb.) Change-Id: I8cc777f7ab126dcef3a0278a82d3fc91faf4c231 Reviewed-on: https://boringssl-review.googlesource.com/4510 Reviewed-by: Adam Langley <agl@google.com>
2015-04-23Ensure BN_asc2bn, BN_dec2bn, and BN_hex2bn never give -0.David Benjamin
See upstream's a0eed48d37a4b7beea0c966caf09ad46f4a92a44. Rather than import that, we should just ensure neg + zero isn't a possible state. Add some tests for asc2bn and dec2bn while we're here. Also fix a bug with dec2bn where it doesn't actually ignore trailing data as it's supposed to. Change-Id: I2385b67b740e57020c75a247bee254085ab7ce15 Reviewed-on: https://boringssl-review.googlesource.com/4484 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-13Enable MSVC warning C4701, use of potentially uninitialized variable.Brian Smith
C4701 is "potentially uninitialized local variable 'buf' used". It sometimes results in false positives, which can now be suppressed using the macro OPENSSL_SUPPRESS_POTENTIALLY_UNINITIALIZED_WARNINGS. Change-Id: I15068b5a48e1c704702e7752982b9ead855e7633 Reviewed-on: https://boringssl-review.googlesource.com/3160 Reviewed-by: Adam Langley <agl@google.com>
2015-04-08Prune away (almost) all of asn1_mac.hDavid Benjamin
Amazingly, asn1_GetSequence isn't completely unused? Keep that around for now and ditch everything else. This lets us enable C4311 in MSVC which is actually a pretty reasonable warning. Change-Id: I43bb9206b1745e8a68224f3a435713d2a74e04ea Reviewed-on: https://boringssl-review.googlesource.com/4256 Reviewed-by: Adam Langley <agl@google.com>
2015-03-21Clean up error reporting.HÃ¥vard Molland
Quite a few functions reported wrong function names when pushing to the error stack. Change-Id: I84d89dbefd2ecdc89ffb09799e673bae17be0e0f Reviewed-on: https://boringssl-review.googlesource.com/4080 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Fix ASN1_TYPE_cmpDavid Benjamin
Fix segmentation violation when ASN1_TYPE_cmp is passed a boolean type. This can be triggered during certificate verification so could be a DoS attack against a client or a server enabling client authentication. CVE-2015-0286 (Imported from upstream's e677e8d13595f7b3287f8feef7676feb301b0e8a.) Change-Id: I5faefc190568504bb5895ed9816a6d80432cfa45 Reviewed-on: https://boringssl-review.googlesource.com/4048 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Free up ADB and CHOICE if already initialised.David Benjamin
CVE-2015-0287 (Imported from upstream's b485d976340d3ca080060c3c7dee9102e2200762.) Change-Id: Ie8dac46ccc95a4eee9ef535d8620217202f13ca1 Reviewed-on: https://boringssl-review.googlesource.com/4046 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Allocate string types directly.David Benjamin
Allocate and free ASN.1 string types directly instead of going through the ASN.1 item code. (Imported from upstream's 3d6aa6d441fe8124d247dffee5c68c2e5efd8258.) Change-Id: I617283e67071a792f219ed08f19078afc223e2f5 Reviewed-on: https://boringssl-review.googlesource.com/4041 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Fix regression in ASN1_UTCTIME_cmp_time_tDavid Benjamin
Previously, ASN1_UTCTIME_cmp_time_t would return 1 if s > t, -1 if s < t, and 0 if s == t. This behavior was broken in upstream's 904348a4922333106b613754136305db229475ea, resulting in the opposite time comparison behavior. PR#3706 (Imported from upstream's da27006df06853a33b132133699a7aa9d4277920.) Change-Id: I9c1c28ba21d82ff4b587e33b262f46be4e846ff9 Reviewed-on: https://boringssl-review.googlesource.com/4043 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19ASN.1 print fix.David Benjamin
When printing out an ASN.1 structure, if the type is an item template don't fall through and attempt to interpret as a primitive type. (Imported from upstream's 5dc1247a7494f50c88ce7492518bbe0ce6f124fa.) Change-Id: Ica39757792cbf3f83879953b67838927ddbdb809 Reviewed-on: https://boringssl-review.googlesource.com/4009 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Fix asn1_item_print_ctxDavid Benjamin
The call to asn1_do_adb can return NULL on error, so we should check the return value before attempting to use it. (Imported from upstream's 34a7ed0c39aa3ab67eea1e106577525eaf0d7a00.) Change-Id: Ia43cdc73b5f1d16e6fc907b5aaf13c9df5a9958c Reviewed-on: https://boringssl-review.googlesource.com/4007 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19ASN1_primitive_new NULL param handlingDavid Benjamin
ASN1_primitive_new takes an ASN1_ITEM * param |it|. There are a couple of conditional code paths that check whether |it| is NULL or not - but later |it| is deref'd unconditionally. If |it| was ever really NULL then this would seg fault. In practice ASN1_primitive_new is marked as an internal function in the public header file. The only places it is ever used internally always pass a non NULL parameter for |it|. Therefore, change the code to sanity check that |it| is not NULL, and remove the conditional checking. (Imported from upstream's 9e488fd6ab2c295941e91a47ab7bcd346b7540c7) Change-Id: Icbb13cd00d0ec5529871b678b0bcc465956a7572 Reviewed-on: https://boringssl-review.googlesource.com/4006 Reviewed-by: Adam Langley <agl@google.com>
2015-03-19Fix wrong numbers being passed as string lengthsDavid Benjamin
(Imported from upstream's 0b142f022e2c5072295e00ebc11c5b707a726d74.) Modified further because these ought to just be BIO_puts. Change-Id: I8b70d70d0f626bb19b455adb4f0e08bacf453c1d Reviewed-on: https://boringssl-review.googlesource.com/4002 Reviewed-by: Adam Langley <agl@google.com>
2015-03-13Error codes are uint32_t, not unsigned long.David Benjamin
Fix a few remnants of them being unsigned long. Also rename extremely unhelpful variable names in SSL_get_error. i is now ret_code to match the header. Change-Id: Ic31d6626bfe09c9e21c03691dfc716c5573833ea Reviewed-on: https://boringssl-review.googlesource.com/3881 Reviewed-by: Adam Langley <agl@google.com>
2015-03-10Fix two unchecked mallocs in crypto/asn1.David Benjamin
Imported from upstream's 918bb8652969fd53f0c390c1cd909265ed502c7e. (The remainder is in code we've since deleted.) Change-Id: Ie878272114086ba60a0fd5eae059b641b00ec0c4 Reviewed-on: https://boringssl-review.googlesource.com/3831 Reviewed-by: Adam Langley <agl@google.com>
2015-02-13Fix more memory leaks on malloc failure.David Benjamin
Caught by malloc valgrind tests on Basic-Client-Sync. Also one by inspection and verified with valgrind. Those should pass now with the exception of CRYPTO_free_ex_data being internally implemented with malloc. (Clearly we next should make our malloc tests assert that the containing function fails to catch when we fail to check for some error and things silently move one.) Change-Id: I56c51dc8a32a7d3c7ac907d54015dc241728c761 Reviewed-on: https://boringssl-review.googlesource.com/3440 Reviewed-by: Adam Langley <agl@google.com>
2015-02-12Fix cross-module errors.David Benjamin
Some files in crypto/x509 were moved from crypto/asn1, so they emit errors from another module. Fix make_errors.go to account for this: cross module errors must use the foreign module as the first argument to OPENSSL_PUT_ERROR. Both the function code and the error code should be declared in the foreign module. Update make_errors.go to ignore cross-module error lines when deciding which function tokens to emit. Change-Id: Ic38377ddd56e22d033ef91318c30510762f6445d Reviewed-on: https://boringssl-review.googlesource.com/3383 Reviewed-by: Adam Langley <agl@google.com>
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-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-29Change CMakeLists.txt to two-space indent.Adam Langley
find -name CMakeLists.txt -type f | xargs sed -e 's/\t/ /g' -i Change-Id: I01636b1849c00ba918f48828252492d99b0403ac
2015-01-15Tag a number of globals as const.David Benjamin
Change-Id: I6f334911f153395a2e5e26adfd08912a1d8c558b Reviewed-on: https://boringssl-review.googlesource.com/2847 Reviewed-by: Adam Langley <agl@google.com>
2015-01-15Return error when a bit string indicates an invalid amount of bits leftDavid Benjamin
(Imported from upstream's 5a1e8c67a90aead86ccc2dda324e8f897d1a044d) Change-Id: Idfba7eb8244c1926e7921119767cb32605a74202 Reviewed-on: https://boringssl-review.googlesource.com/2836 Reviewed-by: Adam Langley <agl@google.com>
2015-01-15Reject invalid constructed encodings.David Benjamin
According to X6.90 null, object identifier, boolean, integer and enumerated types can only have primitive encodings: return an error if any of these are received with a constructed encoding. (Imported from upstream's 89f40f369f414b52e00f7230b0e3ce99e430a508.) Change-Id: Ia5d15eef72e379119f50fdbac4e92c4761bf5eaf Reviewed-on: https://boringssl-review.googlesource.com/2835 Reviewed-by: Adam Langley <agl@google.com>
2015-01-09Fix various certificate fingerprint issues.Adam Langley
By using non-DER or invalid encodings outside the signed portion of a certificate the fingerprint can be changed without breaking the signature. Although no details of the signed portion of the certificate can be changed this can cause problems with some applications: e.g. those using the certificate fingerprint for blacklists. 1. Reject signatures with non zero unused bits. If the BIT STRING containing the signature has non zero unused bits reject the signature. All current signature algorithms require zero unused bits. 2. Check certificate algorithm consistency. Check the AlgorithmIdentifier inside TBS matches the one in the certificate signature. NB: this will result in signature failure errors for some broken certificates. 3. Check DSA/ECDSA signatures use DER. Reencode DSA/ECDSA signatures and compare with the original received signature. Return an error if there is a mismatch. This will reject various cases including garbage after signature (thanks to Antti Karjalainen and Tuomo Untinen from the Codenomicon CROSS program for discovering this case) and use of BER or invalid ASN.1 INTEGERs (negative or with leading zeroes). CVE-2014-8275 (Imported from upstream's 85cfc188c06bd046420ae70dd6e302f9efe022a9 and 4c52816d35681c0533c25fdd3abb4b7c6962302d) Change-Id: Ic901aea8ea6457df27dc542a11c30464561e322b Reviewed-on: https://boringssl-review.googlesource.com/2783 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-11-19Add malloc failure tests.Adam Langley
This commit fixes a number of crashes caused by malloc failures. They were found using the -malloc-test=0 option to runner.go which runs tests many times, causing a different allocation call to fail in each case. (This test only works on Linux and only looks for crashes caused by allocation failures, not memory leaks or other errors.) This is not the complete set of crashes! More can be found by collecting core dumps from running with -malloc-test=0. Change-Id: Ia61d19f51e373bccb7bc604642c51e043a74bd83 Reviewed-on: https://boringssl-review.googlesource.com/2320 Reviewed-by: Adam Langley <agl@google.com>
2014-11-06Shush some dead assignments.David Benjamin
Appease clang scan-build a bit. I'm not sure it's actually worth silencing all of them because some of them look like preserving invariants between local variables, but some are clearly pointless or can be restructured slightly. Change-Id: I0bc81e2589bb402ff3ef0182d7a8921e31b85052 Reviewed-on: https://boringssl-review.googlesource.com/2205 Reviewed-by: Adam Langley <agl@google.com>
2014-11-06Fix a2i_ASN1_* leak on failure.David Benjamin
Caught by clang scan-build. Change-Id: I1097848052026361e24fd1202cc0c831c3f83e49 Reviewed-on: https://boringssl-review.googlesource.com/2201 Reviewed-by: Adam Langley <agl@google.com>
2014-10-29Move the X509_NAME typedef into x509.h.David Benjamin
X509_NAME is one of the symbols that collide with wincrypt.h. Move it to x509.h so libraries which only use the pure-crypto portions of BoringSSL without X.509 needn't have to resolve the collision. Change-Id: I057873498e58fe4a4cf264356f9a58d7a15397b7 Reviewed-on: https://boringssl-review.googlesource.com/2080 Reviewed-by: Adam Langley <agl@google.com>
2014-10-14Don't mix and match libraries and errors.David Benjamin
The same library code applies for both the error and the function, so modules cannot easily report errors from each other. Switch evp/algorithm.c's error codes to the EVP library. Remove the original error codes so it's obvious some changes are needed. - X509_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED -> EVP_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED -> EVP_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED (Actually, the X509 version of this error code doesn't exist in OpenSSL. It should have been ASN1.) - ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM -> EVP_R_UNKNOWN_SIGNATURE_ALGORITHM - ASN1_R_WRONG_PUBLIC_KEY_TYPE -> EVP_R_WRONG_PUBLIC_KEY_TYPE - ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM -> EVP_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM Change-Id: I05b1a05b465d800c85f7d63ca74588edf40847b9 Reviewed-on: https://boringssl-review.googlesource.com/1940 Reviewed-by: Adam Langley <agl@google.com>
2014-10-10Remove misspelled error code.David Benjamin
One ASN1_R_UNKNOWN_FORMAT got mispelled into ASN1_R_UNKOWN_FORMAT and duplicated. Change-Id: If123ef848ffe68afa021f5f3e3fb08eac92c5f94 Reviewed-on: https://boringssl-review.googlesource.com/1911 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-19Remove some dead code.Adam Langley
This change removes the old ASN.1 functions (ASN1_seq_unpack and ASN1_seq_pack) which have always been disabled in BoringSSL. It also removes code enabled by OPENSSL_EXPORT_VAR_AS_FUNCTION, which we have never used. Change-Id: I1fe323abf945a8a5828a04cc195c072e100a5095 Reviewed-on: https://boringssl-review.googlesource.com/1556 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-08-08Fix OID handling.Emilia Kasper
- Upon parsing, reject OIDs with invalid base-128 encoding. - Always NUL-terminate the destination buffer in OBJ_obj2txt printing function. CVE-2014-3508 (Imported from upstream's c01618dd822cc724c05eeb52455874ad068ec6a5) Change-Id: I12bdeeaa700183195e4c2f474f964f8ae7a04549 Reviewed-on: https://boringssl-review.googlesource.com/1440 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-29ASN1 sanity check.Adam Langley
Primitive encodings shouldn't use indefinite length constructed form. PR#2438 (partial). (Imported from upstream's 9223a31eb72dc46085ce97736c119c541973511e) Change-Id: I832d0bcda491c03c799b7b70184a1a3ec16b1592
2014-07-29Memory leak and NULL dereference fixes.Adam Langley
PR#3403 (Imported from upstream's e42c208235a86beee16ff0d0e6ca4e164a57d21a) Change-Id: Ibcdd8c95604f661055bfb1e91b15fd3686a04c0d
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-07-07Remove CHARSET_EBCDICAlex Chernyakhovsky
Since crypto/ebcdic.{c,h} are not present in BoringSSL, remove the #ifdefs Changes were made by running find . -type f -name *.c | xargs unifdef -m -U CHARSET_EBCDIC find . -type f -name *.h | xargs unifdef -m -U CHARSET_EBCDIC using unifdef 2.10. An additional two ifdefs (CHARSET_EBCDIC_not) were removed manually. Change-Id: Ie174bb00782cc44c63b0f9fab69619b3a9f66d42 Reviewed-on: https://boringssl-review.googlesource.com/1093 Reviewed-by: Adam Langley <agl@google.com>
2014-07-01Add license to charmap.pl.Adam Langley
I have confirmed with Dr. Stephen Henson (the author) that the file is licensed under the OpenSSL license. Change-Id: I97dc4c74b363184e1b36e5835bad684d66696d54