summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Moore <sethmo@google.com>2022-02-28 15:45:56 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-02-28 15:45:56 +0000
commitb1673e875ec4ddcd8de763d704f7a17f2a874b84 (patch)
tree7bdd4aa74f938d30074a26d14322b4a5bb03821d
parent7c95bff3562fd7188814de4392813ab93e7696ea (diff)
parent3ff2f52a221988324fc8622cb31cff1f150da1c5 (diff)
downloadkeymaster-b1673e875ec4ddcd8de763d704f7a17f2a874b84.tar.gz
Clean up some compiler warnings am: ad8d7e39d8 am: 984e211450 am: 3ff2f52a22
Original change: https://android-review.googlesource.com/c/platform/system/keymaster/+/1984095 Change-Id: I6062b9c45ff4798fb9da624ffba1593bf112f6b6
-rw-r--r--android_keymaster/android_keymaster.cpp2
-rw-r--r--include/keymaster/android_keymaster.h4
-rw-r--r--include/keymaster/android_keymaster_messages.h2
-rw-r--r--include/keymaster/remote_provisioning_utils.h4
4 files changed, 6 insertions, 6 deletions
diff --git a/android_keymaster/android_keymaster.cpp b/android_keymaster/android_keymaster.cpp
index 3a721d0..14fc367 100644
--- a/android_keymaster/android_keymaster.cpp
+++ b/android_keymaster/android_keymaster.cpp
@@ -131,7 +131,7 @@ constexpr int kP256AffinePointSize = 32;
} // anonymous namespace
AndroidKeymaster::AndroidKeymaster(KeymasterContext* context, size_t operation_table_size,
- uint32_t message_version)
+ int32_t message_version)
: context_(context), operation_table_(new (std::nothrow) OperationTable(operation_table_size)),
message_version_(message_version) {}
diff --git a/include/keymaster/android_keymaster.h b/include/keymaster/android_keymaster.h
index bbeb81a..c463e68 100644
--- a/include/keymaster/android_keymaster.h
+++ b/include/keymaster/android_keymaster.h
@@ -47,7 +47,7 @@ class OperationTable;
class AndroidKeymaster {
public:
AndroidKeymaster(KeymasterContext* context, size_t operation_table_size,
- uint32_t message_version = kDefaultMessageVersion);
+ int32_t message_version = kDefaultMessageVersion);
virtual ~AndroidKeymaster();
AndroidKeymaster(AndroidKeymaster&&);
@@ -103,7 +103,7 @@ class AndroidKeymaster {
// Returns the message version negotiated in GetVersion2. All response messages should have
// this passed to their constructors. This is done automatically for the methods that return a
// response by value. The caller must do it for the methods that take a response pointer.
- uint32_t message_version() const { return message_version_; }
+ int32_t message_version() const { return message_version_; }
private:
// Loads the KM key from `key_blob`, getting app ID and app data from `additional_params`, if
diff --git a/include/keymaster/android_keymaster_messages.h b/include/keymaster/android_keymaster_messages.h
index 2d21a62..de674b8 100644
--- a/include/keymaster/android_keymaster_messages.h
+++ b/include/keymaster/android_keymaster_messages.h
@@ -112,7 +112,7 @@ constexpr int32_t kDefaultMessageVersion = 3;
* date in YYYYMMDD format (it's not recommended to change message formats within a KM version, but
* it could happen).
*/
-inline constexpr int32_t MessageVersion(KmVersion version, uint32_t /* km_date */ = 0) {
+inline int32_t MessageVersion(KmVersion version, uint32_t /* km_date */ = 0) {
switch (version) {
case KmVersion::KEYMASTER_1:
return 1;
diff --git a/include/keymaster/remote_provisioning_utils.h b/include/keymaster/remote_provisioning_utils.h
index 76acdc7..9fc0d2e 100644
--- a/include/keymaster/remote_provisioning_utils.h
+++ b/include/keymaster/remote_provisioning_utils.h
@@ -35,8 +35,8 @@ template <typename T> class StatusOr {
public:
StatusOr(int32_t status_code) // NOLINT(google-explicit-constructor)
: status_code_(status_code) {}
- StatusOr(T val)
- : status_code_(0), value_(std::move(val)) {} // NOLINT(google-explicit-constructor)
+ StatusOr(T val) // NOLINT(google-explicit-constructor)
+ : status_code_(0), value_(std::move(val)) {}
bool isOk() { return status_code_ == 0; }