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-02-16Parse BER for PKCS#12 more accurately.David Benjamin
CBS_asn1_ber_to_der currently uses heuristics because implicitly-tagged constructed strings in BER are ambiguous with implicitly-tagged sequences. It's not possible to convert BER to DER without knowing the schema. Fortunately, implicitly tagged strings don't appear often so instead split the job up: CBS_asn1_ber_to_der fixes indefinite-length elements and constructed strings it can see. Implicitly-tagged strings it leaves uncoverted, but they will only nest one level down (because BER kindly allows one to nest constructed strings arbitrarily!). CBS_get_asn1_implicit_string then performs the final concatenation at parse time. This isn't much more complex and lets us parse BER more accurately and also reject a number of mis-encoded values (e.g. constructed INTEGERs are not a thing) we'd previously let through. The downside is the post-conversion parsing code must be aware of this limitation of CBS_asn1_ber_to_der. Fortunately, there's only one implicitly-tagged string in our PKCS#12 code. (In the category of things that really really don't matter, but I had spare cycles and the old BER converter is weird.) Change-Id: Iebdd13b08559fa158b308ef83a5bb07bfdf80ae8 Reviewed-on: https://boringssl-review.googlesource.com/7052 Reviewed-by: Adam Langley <agl@google.com>
2016-02-02Changes to support node.js's use of PKCS#12.Adam Langley
node.js uses a memory BIO in the wrong mode which, for now, we work around. It also passes in NULL (rather than empty) strings and a non-NULL out-arg for |d2i_PKCS12_bio|. Change-Id: Ib565b4a202775bb32fdcb76db8a4e8c54268c052 Reviewed-on: https://boringssl-review.googlesource.com/7012 Reviewed-by: Adam Langley <agl@google.com>
2015-11-17Check for overflow when parsing a CBS with d2i_*.David Benjamin
Until we've done away with the d2i_* stack completely, boundaries need to be mindful of the type mismatch. d2i_* takes a long, not a size_t. Change-Id: If02f9ca2cfde02d0929ac18275d09bf5df400f3a Reviewed-on: https://boringssl-review.googlesource.com/6491 Reviewed-by: Adam Langley <agl@google.com>
2015-09-29Add |PKCS12_verify_mac|.Adam Langley
This utility function is provided for API-compatibility and simply calls |PKCS12_parse| internally. BUG=536939 Change-Id: I86c548e5dfd64b6c473e497b95adfa5947fe9529 Reviewed-on: https://boringssl-review.googlesource.com/6008 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-05Consistently participate in err for PKCS12_* functions.David Benjamin
err is a horrible API, but functions should consistently participate or not participate in it. We were missing a few codepaths. Change-Id: I762074d5030b8e9d3e5bba9f8fa91fbdccbee25a Reviewed-on: https://boringssl-review.googlesource.com/5571 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-05-05Remove unnecessary NULL checks, part 4.David Benjamin
Finish up crypto, minus the legacy modules we haven't been touching much. Change-Id: I0e9e1999a627aed5fb14841f8a2a7d0b68398e85 Reviewed-on: https://boringssl-review.googlesource.com/4517 Reviewed-by: Adam Langley <agl@google.com>
2015-02-12Add in missing curly braces part 3.David Benjamin
Everything else. Change-Id: Iac02b144465b4e7b6d69ea22ff2aaf52695ae732
2015-02-11Fix some function parameters in OPENSSL_PUT_ERROR.David Benjamin
We have got to get rid of that parameter... Change-Id: I17f2d1282636f7d077f21dabdc135eecf9300998 Reviewed-on: https://boringssl-review.googlesource.com/3384 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-06Add void in place of empty function arguments.Adam Langley
Since this is C89 we need to maintain this ancient practice. Change-Id: I7223e7c38a35cf551b6e3c9159d2e21ebf7e62be Reviewed-on: https://boringssl-review.googlesource.com/2631 Reviewed-by: David Benjamin <davidben@chromium.org> Reviewed-by: Adam Langley <agl@google.com>
2014-09-20Provide compatibility functions for PKCS#12 parsing.Adam Langley
In order to minimise the upstream diffs needed for bits of Android to build with BoringSSL, this change implements the old style PKCS#12 functions as wrappers around the modern parser. The function to read all the contents of a BIO could almost be a utility function but I'll wait until there are two uses for it first. The important change from the original functions is that these will always read the complete buffer/BIO/FILE passed in. Based on a survey of uses of d2i_PKCS12 that I found, this appears to be universally what callers want anyway. Change-Id: I3f5b84e710b161d975f91f4d16c83d44371368d1 Reviewed-on: https://boringssl-review.googlesource.com/1791 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-27Remove hack in parsing PKCS#12.Adam Langley
This change removes the previous OpenSSL/NSS hack in PKCS#12 parsing and limits the hacks purely to the BER->DER conversion function, where they belong. PKCS#7 and #12 switch between implicit and explicit tags in different places and sometimes only implicitly define that they are using implicit tags. This change fixes a previous confusion where an implicit tag was thought to be explicit. Change-Id: Ib68c78cf2a1bfcbf90a296cb98313ab86ed2a1f3 Reviewed-on: https://boringssl-review.googlesource.com/1640 Reviewed-by: Adam Langley <agl@google.com>
2014-08-26Add PKCS#12 parser.Adam Langley
This is cleaner than the OpenSSL code was, at least, but it's hardly beautiful due to the "standard" that it's trying to implement. (See [1].) The references from the PKCS#8 code to various ciphers have digests have been made into function pointer references rather than NIDs so that the linker will be able to drop RC2 code for binaries that don't call PKCS#8 or #12 functions. A bug that crashed OpenSSL/BoringSSL when parsing a malformed PKCS#8 structure has been fixed too. See https://www.cs.auckland.ac.nz/~pgut001/pubs/pfx.html Change-Id: Iaa1039e04ed7877b90792835e8ce3ebc3b29f89e Reviewed-on: https://boringssl-review.googlesource.com/1592 Reviewed-by: Adam Langley <agl@google.com>
2014-08-01Add PKCS8_{decrypt,encrypt}_pbe.David Benjamin
The original functions do an ascii_to_ucs2 transformation on the password. Deprecate them in favor of making that encoding the caller's problem. ascii_to_ucs2 doesn't handle, say, UTF-8 anyway. And with the original OpenSSL function, some ciphers would do the transformation, and some wouldn't making the text-string/bytes-string confusion even messier. BUG=399121 Change-Id: I7d1cea20a260f21eec2e8ffb7cd6be239fe92873 Reviewed-on: https://boringssl-review.googlesource.com/1347 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.)