summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-06-22 01:10:43 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-06-22 01:10:43 +0000
commitc1994b29177d3f46f6824ade3f0c8a6978c0fb79 (patch)
treeb2809cfa3b4ec23bb8baa1a7971221a1441a442e
parent9658ea16a1c497909d7c9c73686780a6ded0a50a (diff)
parent7bd90714b659a78c5d52f55cfba1ae6d1f8e5876 (diff)
downloadkeymaster-c1994b29177d3f46f6824ade3f0c8a6978c0fb79.tar.gz
Snap for 7478986 from 7bd90714b659a78c5d52f55cfba1ae6d1f8e5876 to sc-release
Change-Id: I43f82341eb1376f34a794ca3cf4407c4f0829a66
-rw-r--r--android_keymaster/remote_provisioning_utils.cpp4
-rw-r--r--cppcose/cppcose.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/android_keymaster/remote_provisioning_utils.cpp b/android_keymaster/remote_provisioning_utils.cpp
index 926188f..c882b21 100644
--- a/android_keymaster/remote_provisioning_utils.cpp
+++ b/android_keymaster/remote_provisioning_utils.cpp
@@ -57,7 +57,7 @@ validateAndExtractEekPubAndId(bool testMode, const KeymasterBlob& endpointEncryp
const cppbor::Array* certArr = item->asArray();
std::vector<uint8_t> lastPubKey;
- for (int i = 0; i < certArr->size(); ++i) {
+ for (size_t i = 0; i < certArr->size(); ++i) {
auto cosePubKey =
verifyAndParseCoseSign1(testMode, certArr->get(i)->asArray(), lastPubKey, {} /* AAD */);
if (!cosePubKey) {
@@ -89,7 +89,7 @@ StatusOr<std::vector<uint8_t> /* pubkeys */>
validateAndExtractPubkeys(bool testMode, uint32_t numKeys, KeymasterBlob* keysToSign,
cppcose::HmacSha256Function macFunction) {
auto pubKeysToMac = cppbor::Array();
- for (int i = 0; i < numKeys; i++) {
+ for (size_t i = 0; i < numKeys; i++) {
auto [macedKeyItem, _, coseMacErrMsg] =
cppbor::parse(keysToSign[i].begin(), keysToSign[i].end());
if (!macedKeyItem || !macedKeyItem->asArray() ||
diff --git a/cppcose/cppcose.cpp b/cppcose/cppcose.cpp
index 2d8652e..b37900e 100644
--- a/cppcose/cppcose.cpp
+++ b/cppcose/cppcose.cpp
@@ -419,7 +419,7 @@ ErrMsgOr<bytevec> aesGcmEncrypt(const bytevec& key, const bytevec& nonce, const
plaintext.size())) {
return "Failed to encrypt plaintext";
}
- assert(plaintext.size() == outlen);
+ assert(plaintext.size() == static_cast<uint64_t>(outlen));
if (!EVP_CipherFinal_ex(ctx->get(), ciphertext.data() + outlen, &outlen)) {
return "Failed to finalize encryption";
@@ -447,7 +447,7 @@ ErrMsgOr<bytevec> aesGcmDecrypt(const bytevec& key, const bytevec& nonce, const
ciphertextWithTag.size() - kAesGcmTagSize)) {
return "Failed to decrypt plaintext";
}
- assert(plaintext.size() == outlen);
+ assert(plaintext.size() == static_cast<uint64_t>(outlen));
bytevec tag(ciphertextWithTag.end() - kAesGcmTagSize, ciphertextWithTag.end());
if (!EVP_CIPHER_CTX_ctrl(ctx->get(), EVP_CTRL_GCM_SET_TAG, kAesGcmTagSize, tag.data())) {