Fix OpenSSL Builds

(This is a merge of the parts of http://go/wvgerrit/105985 that affect
Android.)

This patch fixes some files that, after recent changes, were no longer
building when using OpenSSL instead of BoringSSL. <memory> was missing
in a header, and a function whose return type is different on OpenSSL
was tripping up the format-string warnings.

Bug: 168553979
Test: jenkins/ce_cdm_tests
Test: Android CDM Build
Change-Id: Id6a33d0ce0d3cbe5fe33b3f22aa3ee6b03ac76dd
This commit is contained in:
John W. Bruce
2020-10-22 18:00:09 -07:00
parent 1381746ecb
commit 0f2a4a40dc
2 changed files with 4 additions and 2 deletions

View File

@@ -336,11 +336,12 @@ bool ExtractExtensionValueFromCertificate(const std::string& cert,
STACK_OF(X509)* certs = pkcs7->d.sign->cert;
// Find the desired certificate from the stack.
if (cert_index >= static_cast<size_t>(sk_X509_num(certs))) {
const size_t num_certs = static_cast<size_t>(sk_X509_num(certs));
if (cert_index >= num_certs) {
LOGE(
"Unexpected number of certificates in chain: "
"count = %zu, minimum = %zu",
sk_X509_num(certs), cert_index + 1);
num_certs, cert_index + 1);
return false;
}

View File

@@ -9,6 +9,7 @@
#include <stdint.h>
#include <map>
#include <memory>
#include <string>
#include <vector>