From 0f2a4a40dc4e7eb1cd3aecf2920c2b1548138f3b Mon Sep 17 00:00:00 2001 From: "John W. Bruce" Date: Thu, 22 Oct 2020 18:00:09 -0700 Subject: [PATCH] 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. 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 --- libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp | 5 +++-- libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp b/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp index 908cb7dc..13156209 100644 --- a/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp +++ b/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp @@ -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(sk_X509_num(certs))) { + const size_t num_certs = static_cast(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; } diff --git a/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h b/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h index a2d87d01..d112695b 100644 --- a/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h +++ b/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h @@ -9,6 +9,7 @@ #include #include +#include #include #include