KeyStorage: improve logging for key generation
The error messages that are printed when probing for rollback resistance
support on a device that doesn't support rollback-resistant keys can
make it sound like something is going wrong. Print a WARNING message
afterwards to try to make it clear what is going on. Also adjust or add
DEBUG messages when starting to generate each key so that it's easier to
distinguish the log messages for different key generation operations.
Bug: 182815123
Test: boot on device that doesn't support rollback-resistant keys and
check log.
Change-Id: I37a13eb5c1e839fb94581f3e7ec1cd8da0263d2b
diff --git a/KeyUtil.cpp b/KeyUtil.cpp
index 9d01e1e..886054e 100644
--- a/KeyUtil.cpp
+++ b/KeyUtil.cpp
@@ -57,8 +57,10 @@
LOG(ERROR) << "Cannot generate a wrapped key " << gen.keysize << " bytes long";
return false;
}
+ LOG(DEBUG) << "Generating wrapped storage key";
return generateWrappedStorageKey(key);
} else {
+ LOG(DEBUG) << "Generating standard storage key";
return randomKey(gen.keysize, key);
}
}