cast-auth: Add clang-format configuration and run it
This adds .clang-format and PREUPLOAD.cfg files to enable
clang-format to run on every upload, and runs the tool
manually to ensure all files are correctly formatted.
Bug: None
Change-Id: I5a6e63b873b742d259fdb89b02a4db34139e9903
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..97e6791
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,24 @@
+# Trusty Style
+# This is a Google-derived style with 4-space indent and a few quirks for
+# systems code.
+BasedOnStyle: Chromium
+
+# 4-space indent, no tabs.
+IndentWidth: 4
+UseTab: Never
+TabWidth: 4
+
+# Double indent arguments when none of them are on the first line.
+ContinuationIndentWidth: 8
+ConstructorInitializerIndentWidth: 8
+
+# Don't indent public/private/protected.
+# It's a little more common to do a half indent, but folks didn't like that.
+AccessModifierOffset: -4
+
+# Don't indent case labels.
+IndentCaseLabels: false
+
+# Don't break strings to make it easier to grep for error messages.
+# Note: this can result in lines that exceed the column limit.
+BreakStringLiterals: false
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..587b0de
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,7 @@
+[Builtin Hooks]
+clang_format = true
+commit_msg_bug_field = true
+commit_msg_changeid_field = true
+
+[Builtin Hooks Options]
+clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp
diff --git a/app/cast_auth_impl.cc b/app/cast_auth_impl.cc
index 21e94e7..ef182a2 100644
--- a/app/cast_auth_impl.cc
+++ b/app/cast_auth_impl.cc
@@ -14,214 +14,214 @@
#include "lib/keybox/client/keybox.h"
-static const char *kKeyPath = "cast_auth_key";
+static const char* kKeyPath = "cast_auth_key";
const int RSA_2048_SIZE_BYTES = 256;
const int UNWRAPPED_KEY_MAX_BYTES = 1200;
const int WRAPPING_MAX_BYTES = 1024;
const int WRAPPED_KEY_MAX_BYTES = UNWRAPPED_KEY_MAX_BYTES + WRAPPING_MAX_BYTES;
const int PAYLOAD_MAX_BYTES = WRAPPED_KEY_MAX_BYTES;
-bool is_plaintext_rsa_2048_private_key(
- const ::tidl::Payload &req_payload) {
- bssl::UniquePtr<BIO> bio(
- BIO_new_mem_buf(req_payload.data(), req_payload.size()));
- if (!bio) {
- TLOGE(
- "is_plaintext_rsa_2048_private_key: failed to allocate memory for the "
- "device key\n");
- return ERR_NO_MEMORY;
- }
- bssl::UniquePtr<RSA> rsa(d2i_RSAPrivateKey_bio(bio.get(), NULL));
- return rsa && RSA_size(rsa.get()) == RSA_2048_SIZE_BYTES;
+bool is_plaintext_rsa_2048_private_key(const ::tidl::Payload& req_payload) {
+ bssl::UniquePtr<BIO> bio(
+ BIO_new_mem_buf(req_payload.data(), req_payload.size()));
+ if (!bio) {
+ TLOGE("is_plaintext_rsa_2048_private_key: failed to allocate memory for the "
+ "device key\n");
+ return ERR_NO_MEMORY;
+ }
+ bssl::UniquePtr<RSA> rsa(d2i_RSAPrivateKey_bio(bio.get(), NULL));
+ return rsa && RSA_size(rsa.get()) == RSA_2048_SIZE_BYTES;
}
class StorageSessionHandle {
public:
- StorageSessionHandle(const char *type) : mSession(STORAGE_INVALID_SESSION) {
- mError = storage_open_session(&mSession, type);
- }
- ~StorageSessionHandle() {
- storage_close_session(mSession);
- mSession = STORAGE_INVALID_SESSION;
- }
- bool valid() { return mSession != STORAGE_INVALID_SESSION; }
- storage_session_t get() { return mSession; }
- int error() { return mError; }
+ StorageSessionHandle(const char* type) : mSession(STORAGE_INVALID_SESSION) {
+ mError = storage_open_session(&mSession, type);
+ }
+ ~StorageSessionHandle() {
+ storage_close_session(mSession);
+ mSession = STORAGE_INVALID_SESSION;
+ }
+ bool valid() { return mSession != STORAGE_INVALID_SESSION; }
+ storage_session_t get() { return mSession; }
+ int error() { return mError; }
private:
- storage_session_t mSession;
- int mError;
+ storage_session_t mSession;
+ int mError;
};
CastAuthImpl::CastAuthImpl() : BnCastAuth(PORT, &kAcl, PAYLOAD_MAX_BYTES) {}
-int CastAuthImpl::ProvisionKey(const ::tidl::Payload &req_payload) {
- uint8_t unwrapped[UNWRAPPED_KEY_MAX_BYTES];
- size_t unwrapped_size = sizeof(unwrapped);
- if (!system_state_provisioning_allowed()) {
- TLOGE("CastAuthImpl::ProvisionKey: provisioning not allowed\n");
- return ERR_BAD_STATE;
- }
- int rc = NO_ERROR;
- if (is_plaintext_rsa_2048_private_key(req_payload)) {
- if (req_payload.size() > UNWRAPPED_KEY_MAX_BYTES)
- rc = ERR_NOT_ENOUGH_BUFFER;
- else {
- unwrapped_size = req_payload.size();
- memcpy(unwrapped, req_payload.data(), unwrapped_size);
+int CastAuthImpl::ProvisionKey(const ::tidl::Payload& req_payload) {
+ uint8_t unwrapped[UNWRAPPED_KEY_MAX_BYTES];
+ size_t unwrapped_size = sizeof(unwrapped);
+ if (!system_state_provisioning_allowed()) {
+ TLOGE("CastAuthImpl::ProvisionKey: provisioning not allowed\n");
+ return ERR_BAD_STATE;
}
- } else {
- rc = keybox_unwrap(req_payload.data(), req_payload.size(), unwrapped,
- unwrapped_size, &unwrapped_size);
- }
- if (rc != NO_ERROR) {
- TLOGE("CastAuthImpl::ProvisionKey: failed to unwrap key: %d\n", rc);
- return rc;
- }
- bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(unwrapped, unwrapped_size));
- if (!bio) {
- TLOGE("CastAuthImpl::ProvisionKey: failed to allocate memory for the "
- "device key\n");
- return ERR_NO_MEMORY;
- }
- bssl::UniquePtr<RSA> rsa(d2i_RSAPrivateKey_bio(bio.get(), NULL));
- if (!rsa || RSA_size(rsa.get()) != RSA_2048_SIZE_BYTES) {
- TLOGE("CastAuthImpl::ProvisionKey: failed to decode device key\n");
- return ERR_NOT_VALID;
- }
- return SaveKey(unwrapped, unwrapped_size);
+ int rc = NO_ERROR;
+ if (is_plaintext_rsa_2048_private_key(req_payload)) {
+ if (req_payload.size() > UNWRAPPED_KEY_MAX_BYTES)
+ rc = ERR_NOT_ENOUGH_BUFFER;
+ else {
+ unwrapped_size = req_payload.size();
+ memcpy(unwrapped, req_payload.data(), unwrapped_size);
+ }
+ } else {
+ rc = keybox_unwrap(req_payload.data(), req_payload.size(), unwrapped,
+ unwrapped_size, &unwrapped_size);
+ }
+ if (rc != NO_ERROR) {
+ TLOGE("CastAuthImpl::ProvisionKey: failed to unwrap key: %d\n", rc);
+ return rc;
+ }
+ bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(unwrapped, unwrapped_size));
+ if (!bio) {
+ TLOGE("CastAuthImpl::ProvisionKey: failed to allocate memory for the "
+ "device key\n");
+ return ERR_NO_MEMORY;
+ }
+ bssl::UniquePtr<RSA> rsa(d2i_RSAPrivateKey_bio(bio.get(), NULL));
+ if (!rsa || RSA_size(rsa.get()) != RSA_2048_SIZE_BYTES) {
+ TLOGE("CastAuthImpl::ProvisionKey: failed to decode device key\n");
+ return ERR_NOT_VALID;
+ }
+ return SaveKey(unwrapped, unwrapped_size);
}
-int CastAuthImpl::SignHash(const ::tidl::Payload &req_payload,
- ::tidl::Payload *resp_payload) {
- uint8_t key[UNWRAPPED_KEY_MAX_BYTES];
- size_t key_size = sizeof(key);
- int rc = LoadKey(key, &key_size);
- if (rc != NO_ERROR) {
- TLOGE("CastAuthImpl::SignHash: failed to load device key: %d\n", rc);
- return rc;
- }
- bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(key, key_size));
- if (!bio) {
- TLOGE("CastAuthImpl::SignHash: failed to allocate memory for the device "
- "key\n");
- return ERR_NO_MEMORY;
- }
- bssl::UniquePtr<RSA> rsa(d2i_RSAPrivateKey_bio(bio.get(), NULL));
- if (!rsa) {
- TLOGE("CastAuthImpl::SignHash: failed to decode device key\n");
- return ERR_GENERIC;
- }
- if (!RSA_check_key(rsa.get())) {
- TLOGE("CastAuthImpl::SignHash: RSA key failed check\n");
- return ERR_GENERIC;
- }
- size_t expected_size = (size_t)RSA_size(rsa.get());
- if (resp_payload->size() < expected_size) {
- TLOGE("CastAuthImpl::SignHash: response buffer too small\n");
- return ERR_NOT_ENOUGH_BUFFER;
- }
- resp_payload->resize(expected_size);
- rc = RSA_private_encrypt(req_payload.size(), req_payload.data(),
- resp_payload->data(), rsa.get(), RSA_PKCS1_PADDING);
- if (rc != (int)expected_size) {
- TLOGE("CastAuthImpl::SignHash: RSA_private_encrypt %d \n", rc);
- return ERR_GENERIC;
- }
- return NO_ERROR;
+int CastAuthImpl::SignHash(const ::tidl::Payload& req_payload,
+ ::tidl::Payload* resp_payload) {
+ uint8_t key[UNWRAPPED_KEY_MAX_BYTES];
+ size_t key_size = sizeof(key);
+ int rc = LoadKey(key, &key_size);
+ if (rc != NO_ERROR) {
+ TLOGE("CastAuthImpl::SignHash: failed to load device key: %d\n", rc);
+ return rc;
+ }
+ bssl::UniquePtr<BIO> bio(BIO_new_mem_buf(key, key_size));
+ if (!bio) {
+ TLOGE("CastAuthImpl::SignHash: failed to allocate memory for the device "
+ "key\n");
+ return ERR_NO_MEMORY;
+ }
+ bssl::UniquePtr<RSA> rsa(d2i_RSAPrivateKey_bio(bio.get(), NULL));
+ if (!rsa) {
+ TLOGE("CastAuthImpl::SignHash: failed to decode device key\n");
+ return ERR_GENERIC;
+ }
+ if (!RSA_check_key(rsa.get())) {
+ TLOGE("CastAuthImpl::SignHash: RSA key failed check\n");
+ return ERR_GENERIC;
+ }
+ size_t expected_size = (size_t)RSA_size(rsa.get());
+ if (resp_payload->size() < expected_size) {
+ TLOGE("CastAuthImpl::SignHash: response buffer too small\n");
+ return ERR_NOT_ENOUGH_BUFFER;
+ }
+ resp_payload->resize(expected_size);
+ rc = RSA_private_encrypt(req_payload.size(), req_payload.data(),
+ resp_payload->data(), rsa.get(),
+ RSA_PKCS1_PADDING);
+ if (rc != (int)expected_size) {
+ TLOGE("CastAuthImpl::SignHash: RSA_private_encrypt %d \n", rc);
+ return ERR_GENERIC;
+ }
+ return NO_ERROR;
}
-int CastAuthImpl::SaveKey(const uint8_t *key, size_t length) {
- if (key == NULL || !length) {
- TLOGE("CastAuthImpl::SaveKey: no keybox provided\n");
- return ERR_GENERIC;
- }
- StorageSessionHandle session(STORAGE_CLIENT_TDP_PORT);
- if (!session.valid()) {
- TLOGE("CastAuthImpl::SaveKey: couldn't open storage session\n");
- return session.error();
- }
- file_handle_t handle;
- int rc = storage_open_file(
- session.get(), &handle, kKeyPath,
- STORAGE_FILE_OPEN_CREATE | STORAGE_FILE_OPEN_TRUNCATE, 0);
- if (rc < 0) {
- TLOGE("CastAuthImpl::SaveKey: failed to open key file: %d\n", rc);
- return rc;
- }
- rc = storage_write(handle, 0, key, length, STORAGE_OP_COMPLETE);
- storage_close_file(handle);
- if (rc < 0) {
- TLOGE("CastAuthImpl::SaveKey: failed to write key: %d\n", rc);
- return rc;
- }
- return NO_ERROR;
-}
-
-int CastAuthImpl::LoadKey(uint8_t *key, size_t *length) {
- if (key == NULL || length == NULL) {
- TLOGE("CastAuthImpl::LoadKey: invalid parameters\n");
- return ERR_INVALID_ARGS;
- }
- StorageSessionHandle session(STORAGE_CLIENT_TDP_PORT);
- if (!session.valid()) {
- TLOGE("CastAuthImpl::LoadKey: couldn't open storage session\n");
- return session.error();
- }
-
- file_handle_t handle;
- int rc = storage_open_file(session.get(), &handle, kKeyPath, 0, 0);
- if (rc < 0) {
- TLOGE("CastAuthImpl::LoadKey: failed to open key file: %d\n", rc);
- return rc;
- }
- storage_off_t keysize;
- rc = storage_get_file_size(handle, &keysize);
- if (rc < 0) {
- TLOGE("CastAuthImpl::LoadKey: couldn't get file size: %d\n", rc);
+int CastAuthImpl::SaveKey(const uint8_t* key, size_t length) {
+ if (key == NULL || !length) {
+ TLOGE("CastAuthImpl::SaveKey: no keybox provided\n");
+ return ERR_GENERIC;
+ }
+ StorageSessionHandle session(STORAGE_CLIENT_TDP_PORT);
+ if (!session.valid()) {
+ TLOGE("CastAuthImpl::SaveKey: couldn't open storage session\n");
+ return session.error();
+ }
+ file_handle_t handle;
+ int rc = storage_open_file(
+ session.get(), &handle, kKeyPath,
+ STORAGE_FILE_OPEN_CREATE | STORAGE_FILE_OPEN_TRUNCATE, 0);
+ if (rc < 0) {
+ TLOGE("CastAuthImpl::SaveKey: failed to open key file: %d\n", rc);
+ return rc;
+ }
+ rc = storage_write(handle, 0, key, length, STORAGE_OP_COMPLETE);
storage_close_file(handle);
- return rc;
- }
+ if (rc < 0) {
+ TLOGE("CastAuthImpl::SaveKey: failed to write key: %d\n", rc);
+ return rc;
+ }
+ return NO_ERROR;
+}
- if (*length < keysize) {
- TLOGE("CastAuthImpl::LoadKey: output buffer too small, "
- "should be at least %zu bytes\n",
- (size_t)keysize);
+int CastAuthImpl::LoadKey(uint8_t* key, size_t* length) {
+ if (key == NULL || length == NULL) {
+ TLOGE("CastAuthImpl::LoadKey: invalid parameters\n");
+ return ERR_INVALID_ARGS;
+ }
+ StorageSessionHandle session(STORAGE_CLIENT_TDP_PORT);
+ if (!session.valid()) {
+ TLOGE("CastAuthImpl::LoadKey: couldn't open storage session\n");
+ return session.error();
+ }
+
+ file_handle_t handle;
+ int rc = storage_open_file(session.get(), &handle, kKeyPath, 0, 0);
+ if (rc < 0) {
+ TLOGE("CastAuthImpl::LoadKey: failed to open key file: %d\n", rc);
+ return rc;
+ }
+ storage_off_t keysize;
+ rc = storage_get_file_size(handle, &keysize);
+ if (rc < 0) {
+ TLOGE("CastAuthImpl::LoadKey: couldn't get file size: %d\n", rc);
+ storage_close_file(handle);
+ return rc;
+ }
+
+ if (*length < keysize) {
+ TLOGE("CastAuthImpl::LoadKey: output buffer too small, "
+ "should be at least %zu bytes\n",
+ (size_t)keysize);
+ storage_close_file(handle);
+ *length = keysize;
+ return ERR_NOT_ENOUGH_BUFFER;
+ }
+
+ rc = storage_read(handle, 0, key, keysize);
storage_close_file(handle);
+ if (rc < 0) {
+ TLOGE("CastAuthImpl::LoadKey: error reading key: %d\n", rc);
+ return rc;
+ }
+ if ((size_t)rc != keysize) {
+ TLOGE("CastAuthImpl::LoadKey: error reading key - size (%d) not matching "
+ "keysize (%zu)\n",
+ rc, (size_t)keysize);
+ return ERR_GENERIC;
+ }
*length = keysize;
- return ERR_NOT_ENOUGH_BUFFER;
- }
- rc = storage_read(handle, 0, key, keysize);
- storage_close_file(handle);
- if (rc < 0) {
- TLOGE("CastAuthImpl::LoadKey: error reading key: %d\n", rc);
- return rc;
- }
- if ((size_t)rc != keysize) {
- TLOGE("CastAuthImpl::LoadKey: error reading key - size (%d) not matching "
- "keysize (%zu)\n",
- rc, (size_t)keysize);
- return ERR_GENERIC;
- }
- *length = keysize;
-
- return NO_ERROR;
+ return NO_ERROR;
}
-int CastAuthImpl::get_payload_buffer(::tidl::Payload &payload,
- uint32_t size, bool) {
- if (size > PAYLOAD_MAX_BYTES) {
- return ERR_NOT_ENOUGH_BUFFER;
- }
+int CastAuthImpl::get_payload_buffer(::tidl::Payload& payload,
+ uint32_t size,
+ bool) {
+ if (size > PAYLOAD_MAX_BYTES) {
+ return ERR_NOT_ENOUGH_BUFFER;
+ }
- uint8_t *buffer = new uint8_t[PAYLOAD_MAX_BYTES];
- payload = ::tidl::Payload{buffer, size};
- return NO_ERROR;
+ uint8_t* buffer = new uint8_t[PAYLOAD_MAX_BYTES];
+ payload = ::tidl::Payload{buffer, size};
+ return NO_ERROR;
}
void CastAuthImpl::free_payload_buffer(::tidl::Payload payload) {
- delete[] payload.data();
- // Note that payload is passed by copy, so will be destroyed here, no
- // need to nullify the data member.
+ delete[] payload.data();
+ // Note that payload is passed by copy, so will be destroyed here, no
+ // need to nullify the data member.
}
diff --git a/app/cast_auth_impl.h b/app/cast_auth_impl.h
index f1b11fd..e0b0758 100644
--- a/app/cast_auth_impl.h
+++ b/app/cast_auth_impl.h
@@ -7,18 +7,19 @@
class CastAuthImpl : public BnCastAuth {
public:
- CastAuthImpl();
- int ProvisionKey(const ::tidl::Payload &req_payload) override;
- int SignHash(const ::tidl::Payload &req_payload,
- ::tidl::Payload *resp_payload) override;
+ CastAuthImpl();
+ int ProvisionKey(const ::tidl::Payload& req_payload) override;
+ int SignHash(const ::tidl::Payload& req_payload,
+ ::tidl::Payload* resp_payload) override;
private:
- static constexpr struct tipc_port_acl kAcl = {
- .flags = IPC_PORT_ALLOW_TA_CONNECT | IPC_PORT_ALLOW_NS_CONNECT,
- .uuid_num = 0};
- int SaveKey(const uint8_t *key, size_t length);
- int LoadKey(uint8_t *key, size_t *length);
- int get_payload_buffer(::tidl::Payload &payload, uint32_t size,
- bool) override;
- void free_payload_buffer(::tidl::Payload payload) override;
+ static constexpr struct tipc_port_acl kAcl = {
+ .flags = IPC_PORT_ALLOW_TA_CONNECT | IPC_PORT_ALLOW_NS_CONNECT,
+ .uuid_num = 0};
+ int SaveKey(const uint8_t* key, size_t length);
+ int LoadKey(uint8_t* key, size_t* length);
+ int get_payload_buffer(::tidl::Payload& payload,
+ uint32_t size,
+ bool) override;
+ void free_payload_buffer(::tidl::Payload payload) override;
};
diff --git a/app/main.cc b/app/main.cc
index d3e5cde..715dea7 100644
--- a/app/main.cc
+++ b/app/main.cc
@@ -8,6 +8,6 @@
#include "cast_auth_impl.h"
int main() {
- CastAuthImpl impl;
- return impl.run_service();
+ CastAuthImpl impl;
+ return impl.run_service();
}
diff --git a/app/test-app/main.cc b/app/test-app/main.cc
index fed2d8a..163e35d 100644
--- a/app/test-app/main.cc
+++ b/app/test-app/main.cc
@@ -31,116 +31,116 @@
* prefixed by the appropriate DER prefix for SHA256.
*/
unsigned char test_hash[] = {
- 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65,
- 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20, 0x00, 0xcf, 0x20,
- 0xe0, 0x7a, 0xa9, 0x69, 0x9f, 0x6c, 0x4f, 0x93, 0x42, 0x30, 0xee,
- 0xff, 0x8f, 0xc6, 0xf6, 0xcf, 0xdd, 0x57, 0xc8, 0xe5, 0xaf, 0x93,
- 0x49, 0x60, 0x82, 0xd7, 0x5c, 0xee, 0x42};
+ 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65,
+ 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20, 0x00, 0xcf, 0x20,
+ 0xe0, 0x7a, 0xa9, 0x69, 0x9f, 0x6c, 0x4f, 0x93, 0x42, 0x30, 0xee,
+ 0xff, 0x8f, 0xc6, 0xf6, 0xcf, 0xdd, 0x57, 0xc8, 0xe5, 0xaf, 0x93,
+ 0x49, 0x60, 0x82, 0xd7, 0x5c, 0xee, 0x42};
/* The following is a test RSA 2048 bit key, generated using openssl genrsa. It
* is in PKCS1 RSAPrivateKey (DER) format.
*/
unsigned char test_pkcs1_der[] = {
- 0x30, 0x82, 0x04, 0xa4, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
- 0xca, 0xc1, 0x47, 0xf3, 0x2f, 0xf9, 0xd8, 0x47, 0x7f, 0x3b, 0x14, 0xb7,
- 0xde, 0x0f, 0xa8, 0x41, 0xe6, 0x30, 0x01, 0x27, 0x1b, 0x8a, 0x30, 0x96,
- 0xd0, 0x50, 0xa7, 0xfc, 0x19, 0xe0, 0xdf, 0x71, 0x6d, 0x0e, 0x8b, 0x79,
- 0x01, 0xa8, 0xe2, 0x01, 0x2d, 0x26, 0x93, 0xad, 0x3a, 0x2d, 0x84, 0xa0,
- 0x52, 0x64, 0xc9, 0x49, 0xdc, 0xf5, 0xa0, 0xd0, 0xd6, 0xab, 0xe1, 0xc5,
- 0x3d, 0x39, 0x53, 0x6b, 0xd5, 0x12, 0x33, 0x6b, 0xcd, 0x88, 0xb1, 0xa4,
- 0x6c, 0x69, 0x7f, 0x1c, 0x74, 0x6c, 0x27, 0xd6, 0xb8, 0x09, 0x1b, 0x0d,
- 0xb3, 0xc7, 0xd2, 0xaf, 0x52, 0xad, 0xf7, 0x61, 0x91, 0xa1, 0x39, 0x58,
- 0x99, 0xa4, 0x9b, 0x7d, 0x76, 0xe2, 0x26, 0x56, 0x86, 0x60, 0x1a, 0x47,
- 0xba, 0xdd, 0x94, 0xf2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, 0x19, 0x34, 0xca, 0x6a, 0x5b, 0x43, 0x2c, 0x5b, 0x31, 0xaf,
+ 0xc5, 0x0e, 0xf8, 0x12, 0x91, 0x16, 0xb9, 0x8b, 0x01, 0xf9, 0xa8, 0x9c,
+ 0x5b, 0x9e, 0xbb, 0xc6, 0x8d, 0xf7, 0xe7, 0xeb, 0x6f, 0x04, 0xbe, 0xa9,
+ 0x06, 0xba, 0xed, 0x9a, 0xf9, 0x6c, 0xe1, 0x3f, 0x3e, 0x27, 0x79, 0xdb,
+ 0x5a, 0x8f, 0x5b, 0x4d, 0xd4, 0xd0, 0xf5, 0x2f, 0xc4, 0xaf, 0xc9, 0xc4,
+ 0x44, 0x5b, 0xf1, 0xde, 0x1a, 0x91, 0xb7, 0x2b, 0x24, 0xc0, 0xed, 0xdd,
+ 0xb1, 0x1f, 0x57, 0x82, 0x82, 0xd2, 0xa5, 0x58, 0x7e, 0xcd, 0x91, 0xf6,
+ 0x2c, 0x46, 0xb0, 0x9b, 0xc3, 0x01, 0x2c, 0x85, 0x38, 0xba, 0x6b, 0x8c,
+ 0xfc, 0x04, 0x0a, 0x8c, 0xc1, 0xde, 0x42, 0xd2, 0x14, 0x77, 0xe1, 0x1f,
+ 0x58, 0xe9, 0x78, 0x63, 0x10, 0xf9, 0x7d, 0x68, 0xdb, 0xb4, 0x63, 0xa5,
+ 0x58, 0x04, 0x33, 0xa5};
/* The following is the signature of the above message generated using
* "openssl dgst" with the above private key, using the PKCS1v1.5 signature
@@ -148,28 +148,28 @@
* This should be the output of the TA, given the above key and hash.
*/
unsigned char test_signature[] = {
- 0x9a, 0x89, 0x5b, 0x21, 0x8e, 0x01, 0x79, 0x59, 0x64, 0xf3, 0xbf, 0x8f,
- 0x82, 0x14, 0xe8, 0x39, 0x97, 0x96, 0x78, 0x96, 0xc1, 0xcb, 0x02, 0x91,
- 0xf2, 0xb3, 0x17, 0x7b, 0xe6, 0xaf, 0xa9, 0x67, 0x7a, 0xc1, 0x89, 0xac,
- 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 0xf9, 0xa2, 0x06, 0xec, 0x94, 0x29, 0xf1, 0x0b,
+ 0x6d, 0x06, 0xe3, 0xdf, 0xb3, 0x0b, 0xca, 0x77, 0x33, 0x59, 0xdc, 0xb7,
+ 0xd9, 0x45, 0x63, 0x2e, 0xa1, 0xdf, 0xc5, 0x48, 0x7c, 0x57, 0x82, 0xe3,
+ 0x34, 0x0d, 0xb6, 0xcb, 0xe0, 0xca, 0x14, 0x1d, 0x1b, 0x81, 0x93, 0x4b,
+ 0xc0, 0xc8, 0x2c, 0x33, 0xd9, 0x77, 0xd6, 0x5e, 0x47, 0x2a, 0x67, 0x5f,
+ 0xaa, 0xd1, 0x17, 0xe8, 0xa2, 0xe4, 0xa9, 0xac, 0xb2, 0x65, 0x49, 0x58,
+ 0x57, 0x7e, 0x00, 0xa8, 0xae, 0xd4, 0x38, 0x91, 0x6c, 0xb1, 0x00, 0xa0,
+ 0x4d, 0xaa, 0x1f, 0x77, 0xf3, 0x44, 0x6c, 0x81, 0xcf, 0xa5, 0x86, 0x43,
+ 0x02, 0x4a, 0x67, 0x01, 0x5e, 0x7a, 0xde, 0x98, 0x90, 0x1c, 0xbf, 0xfe,
+ 0xb5, 0xb1, 0x41, 0xdf, 0x2d, 0xfe, 0x80, 0x1e, 0xe2, 0x78, 0x50, 0xd0,
+ 0x7b, 0xde, 0x9e, 0xb2};
/* The following function is solely for the purpose of testing. It "wraps" a key
* such that it can be unwrapped by the sample keybox implementation in Trusty
@@ -186,81 +186,80 @@
* correctly i.e. such that the destination buffer (wrapped_keybox) is at least
* one byte bigger than the source buffer (keybox_plaintext).
*/
-void keybox_wrap_for_test(const uint8_t *keybox_plaintext,
- size_t keybox_plaintext_len, uint8_t *wrapped_keybox,
+void keybox_wrap_for_test(const uint8_t* keybox_plaintext,
+ size_t keybox_plaintext_len,
+ uint8_t* wrapped_keybox,
size_t wrapped_keybox_buf_len,
- size_t *wrapped_keybox_len) {
- /* Generate checksum */
- uint8_t checksum = 0;
- for (size_t i = 0; i < keybox_plaintext_len; i++) {
- checksum ^= keybox_plaintext[i];
- }
+ size_t* wrapped_keybox_len) {
+ /* Generate checksum */
+ uint8_t checksum = 0;
+ for (size_t i = 0; i < keybox_plaintext_len; i++) {
+ checksum ^= keybox_plaintext[i];
+ }
- /* Flip bits with masking byte */
- for (size_t i = 0; i < keybox_plaintext_len; i++) {
- wrapped_keybox[i] = keybox_plaintext[i] ^ 0x42;
- }
+ /* Flip bits with masking byte */
+ for (size_t i = 0; i < keybox_plaintext_len; i++) {
+ wrapped_keybox[i] = keybox_plaintext[i] ^ 0x42;
+ }
- *wrapped_keybox_len = keybox_plaintext_len + 1;
- wrapped_keybox[keybox_plaintext_len] = checksum;
+ *wrapped_keybox_len = keybox_plaintext_len + 1;
+ wrapped_keybox[keybox_plaintext_len] = checksum;
}
TEST(CastAuthTest, ProvisionAndSignHash) {
- int rc;
- BpCastAuth cast_auth;
- rc = cast_auth.connect(ICastAuth::PORT,
- IPC_CONNECT_WAIT_FOR_PORT);
- ASSERT_EQ(NO_ERROR, rc, "connect");
+ int rc;
+ BpCastAuth cast_auth;
+ rc = cast_auth.connect(ICastAuth::PORT, IPC_CONNECT_WAIT_FOR_PORT);
+ ASSERT_EQ(NO_ERROR, rc, "connect");
- uint8_t wrapped_keybox[sizeof(test_pkcs1_der) + 1];
- size_t wrapped_keybox_len;
- keybox_wrap_for_test(test_pkcs1_der, sizeof(test_pkcs1_der), wrapped_keybox,
- sizeof(wrapped_keybox), &wrapped_keybox_len);
- {
- ::tidl::Payload prov_req(wrapped_keybox, wrapped_keybox_len);
- rc = cast_auth.ProvisionKey(prov_req);
- ASSERT_EQ(NO_ERROR, rc, "ProvisionKey");
- }
-
- {
- ::tidl::Payload sign_req(test_hash, sizeof(test_hash));
- uint8_t signature[256];
- ::tidl::Payload sign_resp(signature, sizeof(signature));
- rc = cast_auth.SignHash(sign_req, &sign_resp);
- ASSERT_EQ(NO_ERROR, rc, "SignHash");
- ASSERT_EQ(sign_resp.size(), sizeof(test_signature), "signature size");
- for (unsigned int i = 0; i < sign_resp.size(); ++i) {
- EXPECT_EQ(sign_resp.data()[i], test_signature[i], "signature diff");
+ uint8_t wrapped_keybox[sizeof(test_pkcs1_der) + 1];
+ size_t wrapped_keybox_len;
+ keybox_wrap_for_test(test_pkcs1_der, sizeof(test_pkcs1_der), wrapped_keybox,
+ sizeof(wrapped_keybox), &wrapped_keybox_len);
+ {
+ ::tidl::Payload prov_req(wrapped_keybox, wrapped_keybox_len);
+ rc = cast_auth.ProvisionKey(prov_req);
+ ASSERT_EQ(NO_ERROR, rc, "ProvisionKey");
}
- }
+
+ {
+ ::tidl::Payload sign_req(test_hash, sizeof(test_hash));
+ uint8_t signature[256];
+ ::tidl::Payload sign_resp(signature, sizeof(signature));
+ rc = cast_auth.SignHash(sign_req, &sign_resp);
+ ASSERT_EQ(NO_ERROR, rc, "SignHash");
+ ASSERT_EQ(sign_resp.size(), sizeof(test_signature), "signature size");
+ for (unsigned int i = 0; i < sign_resp.size(); ++i) {
+ EXPECT_EQ(sign_resp.data()[i], test_signature[i], "signature diff");
+ }
+ }
test_abort:;
}
TEST(CastAuthTest, ProvisionUnwrappedAndSignHash) {
- int rc;
- BpCastAuth cast_auth;
- rc = cast_auth.connect(ICastAuth::PORT,
- IPC_CONNECT_WAIT_FOR_PORT);
- ASSERT_EQ(NO_ERROR, rc, "connect");
+ int rc;
+ BpCastAuth cast_auth;
+ rc = cast_auth.connect(ICastAuth::PORT, IPC_CONNECT_WAIT_FOR_PORT);
+ ASSERT_EQ(NO_ERROR, rc, "connect");
- {
- ::tidl::Payload prov_req(test_pkcs1_der, sizeof(test_pkcs1_der));
- rc = cast_auth.ProvisionKey(prov_req);
- ASSERT_EQ(NO_ERROR, rc, "ProvisionKey");
- }
-
- {
- ::tidl::Payload sign_req(test_hash, sizeof(test_hash));
- uint8_t signature[256];
- ::tidl::Payload sign_resp(signature, sizeof(signature));
- rc = cast_auth.SignHash(sign_req, &sign_resp);
- ASSERT_EQ(NO_ERROR, rc, "SignHash");
- ASSERT_EQ(sign_resp.size(), sizeof(test_signature), "signature size");
- for (unsigned int i = 0; i < sign_resp.size(); ++i) {
- EXPECT_EQ(sign_resp.data()[i], test_signature[i], "signature diff");
+ {
+ ::tidl::Payload prov_req(test_pkcs1_der, sizeof(test_pkcs1_der));
+ rc = cast_auth.ProvisionKey(prov_req);
+ ASSERT_EQ(NO_ERROR, rc, "ProvisionKey");
}
- }
+
+ {
+ ::tidl::Payload sign_req(test_hash, sizeof(test_hash));
+ uint8_t signature[256];
+ ::tidl::Payload sign_resp(signature, sizeof(signature));
+ rc = cast_auth.SignHash(sign_req, &sign_resp);
+ ASSERT_EQ(NO_ERROR, rc, "SignHash");
+ ASSERT_EQ(sign_resp.size(), sizeof(test_signature), "signature size");
+ for (unsigned int i = 0; i < sign_resp.size(); ++i) {
+ EXPECT_EQ(sign_resp.data()[i], test_signature[i], "signature diff");
+ }
+ }
test_abort:;
}