Lines Matching refs:ErrorCode
67 ErrorCode KeymasterHidlTest::GenerateKey(const AuthorizationSet& key_desc, HidlBuf* key_blob, in GenerateKey()
74 ErrorCode error; in GenerateKey()
77 [&](ErrorCode hidl_error, const HidlBuf& hidl_key_blob, in GenerateKey()
85 if (error != ErrorCode::OK) { in GenerateKey()
93 ErrorCode KeymasterHidlTest::GenerateKey(const AuthorizationSet& key_desc) { in GenerateKey()
97 ErrorCode KeymasterHidlTest::ImportKey(const AuthorizationSet& key_desc, KeyFormat format, in ImportKey()
100 ErrorCode error; in ImportKey()
103 [&](ErrorCode hidl_error, const HidlBuf& hidl_key_blob, in ImportKey()
111 if (error != ErrorCode::OK) { in ImportKey()
119 ErrorCode KeymasterHidlTest::ImportKey(const AuthorizationSet& key_desc, KeyFormat format, in ImportKey()
124 ErrorCode KeymasterHidlTest::ImportWrappedKey(string wrapped_key, string wrapping_key, in ImportWrappedKey()
128 ErrorCode error; in ImportWrappedKey()
129 EXPECT_EQ(ErrorCode::OK, ImportKey(wrapping_key_desc, KeyFormat::PKCS8, wrapping_key)); in ImportWrappedKey()
134 [&](ErrorCode hidl_error, const HidlBuf& hidl_key_blob, in ImportWrappedKey()
144 ErrorCode KeymasterHidlTest::ExportKey(KeyFormat format, const HidlBuf& key_blob, in ExportKey()
147 ErrorCode error; in ExportKey()
150 [&](ErrorCode hidl_error_code, const HidlBuf& hidl_key_material) { in ExportKey()
156 if (error != ErrorCode::OK) { in ExportKey()
162 ErrorCode KeymasterHidlTest::ExportKey(KeyFormat format, HidlBuf* key_material) { in ExportKey()
167 ErrorCode KeymasterHidlTest::DeleteKey(HidlBuf* key_blob, bool keep_key_blob) { in DeleteKey()
170 if (!rc.isOk()) return ErrorCode::UNKNOWN_ERROR; in DeleteKey()
174 ErrorCode KeymasterHidlTest::DeleteKey(bool keep_key_blob) { in DeleteKey()
178 ErrorCode KeymasterHidlTest::DeleteAllKeys() { in DeleteAllKeys()
179 ErrorCode error = keymaster_->deleteAllKeys(); in DeleteAllKeys()
185 EXPECT_TRUE(rc == ErrorCode::OK || rc == ErrorCode::UNIMPLEMENTED); in CheckedDeleteKey()
196 EXPECT_EQ(ErrorCode::OK, in CheckGetCharacteristics()
203 EXPECT_EQ(ErrorCode::INVALID_KEY_BLOB, in CheckGetCharacteristics()
208 EXPECT_EQ(ErrorCode::INVALID_KEY_BLOB, in CheckGetCharacteristics()
213 EXPECT_EQ(ErrorCode::INVALID_KEY_BLOB, in CheckGetCharacteristics()
219 ErrorCode KeymasterHidlTest::GetCharacteristics(const HidlBuf& key_blob, const HidlBuf& client_id, in GetCharacteristics()
222 ErrorCode error = ErrorCode::UNKNOWN_ERROR; in GetCharacteristics()
227 [&](ErrorCode hidl_error, const KeyCharacteristics& hidl_key_characteristics) { in GetCharacteristics()
234 ErrorCode KeymasterHidlTest::GetCharacteristics(const HidlBuf& key_blob, in GetCharacteristics()
240 ErrorCode KeymasterHidlTest::GetDebugInfo(DebugInfo* debug_info) { in GetDebugInfo()
244 return ErrorCode::OK; in GetDebugInfo()
247 ErrorCode KeymasterHidlTest::Begin(KeyPurpose purpose, const HidlBuf& key_blob, in Begin()
251 ErrorCode error; in Begin()
255 [&](ErrorCode hidl_error, const hidl_vec<KeyParameter>& hidl_out_params, in Begin()
262 if (error != ErrorCode::OK) { in Begin()
269 ErrorCode KeymasterHidlTest::Begin(KeyPurpose purpose, const AuthorizationSet& in_params, in Begin()
276 ErrorCode KeymasterHidlTest::Begin(KeyPurpose purpose, const AuthorizationSet& in_params) { in Begin()
279 ErrorCode error = Begin(purpose, in_params, &out_params); in Begin()
284 ErrorCode KeymasterHidlTest::Update(OperationHandle op_handle, const AuthorizationSet& in_params, in Update()
288 ErrorCode error; in Update()
292 [&](ErrorCode hidl_error, uint32_t hidl_input_consumed, in Update()
304 ErrorCode KeymasterHidlTest::Update(const string& input, string* out, size_t* input_consumed) { in Update()
307 ErrorCode error = Update(op_handle_, AuthorizationSet() /* in_params */, input, &out_params, in Update()
313 ErrorCode KeymasterHidlTest::Finish(OperationHandle op_handle, const AuthorizationSet& in_params, in Finish()
317 ErrorCode error; in Finish()
322 [&](ErrorCode hidl_error, const hidl_vec<KeyParameter>& hidl_out_params, in Finish()
333 ErrorCode KeymasterHidlTest::Finish(const string& message, string* output) { in Finish()
337 ErrorCode error = Finish(op_handle_, AuthorizationSet() /* in_params */, message, in Finish()
339 if (error != ErrorCode::OK) { in Finish()
346 ErrorCode KeymasterHidlTest::Finish(const string& message, const string& signature, in Finish()
350 ErrorCode error = Finish(op_handle_, AuthorizationSet() /* in_params */, message, signature, in Finish()
353 if (error != ErrorCode::OK) { in Finish()
360 ErrorCode KeymasterHidlTest::Abort(OperationHandle op_handle) { in Abort()
370 EXPECT_EQ(ErrorCode::OK, Abort(op_handle_)); in AbortIfNeeded()
375 ErrorCode KeymasterHidlTest::AttestKey(const HidlBuf& key_blob, in AttestKey()
379 ErrorCode error; in AttestKey()
382 [&](ErrorCode hidl_error, const hidl_vec<hidl_vec<uint8_t>>& hidl_cert_chain) { in AttestKey()
388 if (!rc.isOk()) return ErrorCode::UNKNOWN_ERROR; in AttestKey()
393 ErrorCode KeymasterHidlTest::AttestKey(const AuthorizationSet& attest_params, in AttestKey()
404 EXPECT_EQ(ErrorCode::OK, Begin(operation, key_blob, in_params, &begin_out_params, &op_handle_)); in ProcessMessage()
410 EXPECT_EQ(ErrorCode::OK, in ProcessMessage()
416 EXPECT_EQ(ErrorCode::OK, Finish(op_handle_, finish_params, message.substr(consumed), unused, in ProcessMessage()
456 ASSERT_EQ(ErrorCode::OK, GenerateKey(builder)); in CheckAesIncrementalEncryptOperation()
466 EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::ENCRYPT, params, &output_params)); in CheckAesIncrementalEncryptOperation()
473 EXPECT_EQ(ErrorCode::OK, Update(to_send, &ciphertext, &input_consumed)); in CheckAesIncrementalEncryptOperation()
492 EXPECT_EQ(ErrorCode::OK, Finish(to_send, &ciphertext)) << "Error sending " << to_send; in CheckAesIncrementalEncryptOperation()
522 EXPECT_EQ(ErrorCode::OK, Begin(KeyPurpose::DECRYPT, params)) in CheckAesIncrementalEncryptOperation()
528 EXPECT_EQ(ErrorCode::OK, Update(to_send, &plaintext, &input_consumed)); in CheckAesIncrementalEncryptOperation()
531 ErrorCode error = Finish(to_send, &plaintext); in CheckAesIncrementalEncryptOperation()
532 ASSERT_EQ(ErrorCode::OK, error) << "Decryption failed for block mode " << block_mode in CheckAesIncrementalEncryptOperation()
534 if (error == ErrorCode::OK) { in CheckAesIncrementalEncryptOperation()
544 ASSERT_EQ(ErrorCode::OK, in CheckHmacTestVector()
562 ASSERT_EQ(ErrorCode::OK, ImportKey(AuthorizationSetBuilder() in CheckAesCtrTestVector()
589 ASSERT_EQ(ErrorCode::OK, ImportKey(authset, KeyFormat::RAW, key)); in CheckTripleDesTestVector()
601 ASSERT_EQ(ErrorCode::OK, in VerifyMessage()
608 ASSERT_EQ(ErrorCode::OK, in VerifyMessage()
616 EXPECT_EQ(ErrorCode::OK, Finish(op_handle_, finish_params, message.substr(consumed), signature, in VerifyMessage()
723 std::pair<ErrorCode, HidlBuf> KeymasterHidlTest::UpgradeKey(const HidlBuf& key_blob) { in UpgradeKey()
724 std::pair<ErrorCode, HidlBuf> retval; in UpgradeKey()
726 [&](ErrorCode error, const hidl_vec<uint8_t>& upgraded_blob) { in UpgradeKey()