Restrict uses of BoringSSL.

(This is a merge of http://go/wvgerrit/71883)

This moves all the SSL code to privacy_crypto so we can use the
iOS-specific versions and not use any BoringSSL.  The iOS version
doesn't support OEM certificates.

Note that the tests still use BoringSSL.

Bug: 126559819
Test: build_and_run_all_unit_tests.sh
Change-Id: Ib0fad5d95b283b6cd6e02d8a08bcf248c5900bc4
This commit is contained in:
John W. Bruce
2019-02-28 17:32:22 -08:00
parent 50e4d67415
commit e5380ca59f
5 changed files with 200 additions and 168 deletions

View File

@@ -68,6 +68,23 @@ class RsaPublicKey {
CORE_DISALLOW_COPY_AND_ASSIGN(RsaPublicKey);
};
/**
* Extracts an integer value from the extensions in a certificate.
* @param cert A PKCS7 encoded X.509 certificate chain.
* @param extension_oid The ID of the extension to get.
* @param cert_index The zero-based index of the certificate in the chain to
* fetch from.
* @param value [OUT] Will contain the extracted value.
* @return True on success, false on error.
*/
bool ExtractExtensionValueFromCertificate(const std::string& cert,
const std::string& extension_oid,
size_t cert_index, uint32_t* value);
std::string Md5Hash(const std::string& data);
std::string Sha256Hash(const std::string& data);
} // namespace wvcdm
#endif // WVCDM_CORE_PRIVACY_CRYPTO_H_