Lines Matching refs:keymaster
43 namespace keymaster { namespace
60 using android::hardware::keymaster::V4_0::AuthorizationSet;
61 using android::hardware::keymaster::V4_0::AuthorizationSetBuilder;
62 using android::hardware::keymaster::V4_0::BlockMode;
63 using android::hardware::keymaster::V4_0::ErrorCode;
64 using android::hardware::keymaster::V4_0::IKeymasterDevice;
65 using android::hardware::keymaster::V4_0::KeyCharacteristics;
66 using android::hardware::keymaster::V4_0::SecurityLevel;
160 KeymasterWrapper(const sp<IKeymasterDevice> keymaster) { in KeymasterWrapper() argument
161 os_version_ = ::keymaster::GetOsVersion(); in KeymasterWrapper()
162 os_patch_level_ = ::keymaster::GetOsPatchlevel(); in KeymasterWrapper()
163 keymaster_ = keymaster; in KeymasterWrapper()
178 auto keymaster = IKeymasterDevice::getService(keymaster_name); in newInstance() local
179 if (!keymaster) { in newInstance()
184 return new KeymasterWrapper(keymaster); in newInstance()
396 KeymasterWrapper* keymaster; variable
404 switch (keymaster->getSecurityLevel()) { in addDefaultLabel()
415 state.SetLabel("hardware_name:" + keymaster->getHardwareName() + " sec_level:" + secLevel); in addDefaultLabel()
450 keymaster->GenerateKey(transform, keySize); in keygen()
452 keymaster->DeleteKey(); in keygen()
486 if (!keymaster->GenerateKey(transform, keySize, true)) { in sign()
488 ("Key generation error, " + std::to_string(keymaster->getError())).c_str()); in sign()
491 auto params = keymaster->getOperationParams(transform, true); in sign()
492 string message = keymaster->GenerateMessage(msgSize); in sign()
496 auto opHandle = keymaster->SignBegin(params); in sign()
499 ("Error beginning sign, " + std::to_string(keymaster->getError())).c_str()); in sign()
503 if (!keymaster->ProcessMessage(*opHandle, message, params)) { in sign()
504 state.SkipWithError(("Sign error, " + std::to_string(keymaster->getError())).c_str()); in sign()
512 if (!keymaster->GenerateKey(transform, keySize, true)) { in verify()
514 ("Key generation error, " + std::to_string(keymaster->getError())).c_str()); in verify()
518 AuthorizationSet in_params = keymaster->getOperationParams(transform, true); in verify()
519 string message = keymaster->GenerateMessage(msgSize); in verify()
520 auto opHandle = keymaster->SignBegin(in_params, &out_params); in verify()
523 ("Error beginning sign, " + std::to_string(keymaster->getError())).c_str()); in verify()
527 keymaster->ProcessMessage(*opHandle, message, in_params, &out_params); in verify()
529 state.SkipWithError(("Sign error, " + std::to_string(keymaster->getError())).c_str()); in verify()
535 opHandle = keymaster->VerifyBegin(in_params); in verify()
538 ("Verify begin error, " + std::to_string(keymaster->getError())).c_str()); in verify()
542 if (!keymaster->ProcessMessage(*opHandle, message, in_params, &out_params, *signature)) { in verify()
543 state.SkipWithError(("Verify error, " + std::to_string(keymaster->getError())).c_str()); in verify()
604 if (!keymaster->GenerateKey(transform, keySize)) { in encrypt()
606 ("Key generation error, " + std::to_string(keymaster->getError())).c_str()); in encrypt()
609 auto params = keymaster->getOperationParams(transform); in encrypt()
610 string message = keymaster->GenerateMessage(msgSize); in encrypt()
614 auto opHandle = keymaster->EncryptBegin(params); in encrypt()
617 ("Encryption begin error, " + std::to_string(keymaster->getError())).c_str()); in encrypt()
621 if (!keymaster->ProcessMessage(*opHandle, message, params)) { in encrypt()
623 ("Encryption error, " + std::to_string(keymaster->getError())).c_str()); in encrypt()
631 if (!keymaster->GenerateKey(transform, keySize)) { in decrypt()
633 ("Key generation error, " + std::to_string(keymaster->getError())).c_str()); in decrypt()
637 AuthorizationSet in_params = keymaster->getOperationParams(transform); in decrypt()
638 string message = keymaster->GenerateMessage(msgSize); in decrypt()
639 auto opHandle = keymaster->EncryptBegin(in_params, &out_params); in decrypt()
642 ("Encryption begin error, " + std::to_string(keymaster->getError())).c_str()); in decrypt()
645 auto encryptedMessage = keymaster->ProcessMessage(*opHandle, message, in_params, &out_params); in decrypt()
647 state.SkipWithError(("Encryption error, " + std::to_string(keymaster->getError())).c_str()); in decrypt()
653 opHandle = keymaster->DecryptBegin(in_params); in decrypt()
656 ("Decryption begin error, " + std::to_string(keymaster->getError())).c_str()); in decrypt()
660 if (!keymaster->ProcessMessage(*opHandle, *encryptedMessage, in_params)) { in decrypt()
662 ("Decryption error, " + std::to_string(keymaster->getError())).c_str()); in decrypt()
711 android::hardware::keymaster::V4_0::test::keymaster = in main()
712 android::hardware::keymaster::V4_0::test::KeymasterWrapper::newInstance(service_name); in main()
713 if (!android::hardware::keymaster::V4_0::test::keymaster) { in main()