Home | History | Annotate | Download | only in keymaster

Lines Matching refs:response

86                      SupportedResponse<T>* response) {
88 response->error = KM_ERROR_UNSUPPORTED_ALGORITHM;
105 SupportedAlgorithmsResponse* response) {
106 if (response == NULL)
109 response->error = KM_ERROR_OK;
115 response->results_length = algorithm_count;
116 response->results = dup_array(algorithms, algorithm_count);
117 if (!response->results)
118 response->error = KM_ERROR_MEMORY_ALLOCATION_FAILED;
125 SupportedResponse<T>* response) {
126 if (response == NULL || !check_supported(context, algorithm, response))
131 response->error = KM_ERROR_UNSUPPORTED_PURPOSE;
137 response->SetResults(supported, count);
141 SupportedBlockModesResponse* response) {
143 &OperationFactory::SupportedBlockModes, response);
147 SupportedPaddingModesResponse* response) {
149 &OperationFactory::SupportedPaddingModes, response);
153 SupportedDigestsResponse* response) {
155 response);
159 SupportedImportFormatsResponse* response) {
160 if (response == NULL || !check_supported(*context_, request.algorithm, response))
166 response->SetResults(formats, count);
170 SupportedExportFormatsResponse* response) {
171 if (response == NULL || !check_supported(*context_, request.algorithm, response))
177 response->SetResults(formats, count);
181 AddEntropyResponse* response) {
182 response->error = context_->AddRngEntropy(request.random_data.peek_read(),
187 GenerateKeyResponse* response) {
188 if (response == NULL)
196 response->error = KM_ERROR_UNSUPPORTED_ALGORITHM;
199 response->enforced.Clear();
200 response->unenforced.Clear();
201 response->error = factory->GenerateKey(request.key_description, &key_blob,
202 &response->enforced, &response->unenforced);
203 if (response->error == KM_ERROR_OK)
204 response->key_blob = key_blob.release();
209 GetKeyCharacteristicsResponse* response) {
210 if (response == NULL)
214 response->error =
216 &key_material, &response->enforced, &response->unenforced);
217 if (response->error != KM_ERROR_OK)
220 response->error = CheckVersionInfo(response->enforced, response->unenforced, *context_);
238 BeginOperationResponse* response) {
239 if (response == NULL)
241 response->op_handle = 0;
247 response->error = LoadKey(request.key_blob, request.additional_params, &hw_enforced,
249 if (response->error != KM_ERROR_OK)
252 response->error = KM_ERROR_UNKNOWN_ERROR;
257 response->error = KM_ERROR_UNSUPPORTED_PURPOSE;
263 factory->CreateOperation(*key, request.additional_params, &response->error));
269 response->error = KM_ERROR_UNKNOWN_ERROR;
273 response->error = context_->enforcement_policy()->AuthorizeOperation(
276 if (response->error != KM_ERROR_OK)
280 response->output_params.Clear();
281 response->error = operation->Begin(request.additional_params, &response->output_params);
282 if (response->error != KM_ERROR_OK)
286 response->error = operation_table_->Add(operation.release(), &response->op_handle);
290 UpdateOperationResponse* response) {
291 if (response == NULL)
294 response->error = KM_ERROR_INVALID_OPERATION_HANDLE;
300 response->error = context_->enforcement_policy()->AuthorizeOperation(
303 if (response->error != KM_ERROR_OK) {
309 response->error =
310 operation->Update(request.additional_params, request.input, &response->output_params,
311 &response->output, &response->input_consumed);
312 if (response->error != KM_ERROR_OK) {
319 FinishOperationResponse* response) {
320 if (response == NULL)
323 response->error = KM_ERROR_INVALID_OPERATION_HANDLE;
329 response->error = context_->enforcement_policy()->AuthorizeOperation(
332 if (response->error != KM_ERROR_OK) {
338 response->error = operation->Finish(request.additional_params, request.input, request.signature,
339 &response->output_params, &response->output);
344 AbortOperationResponse* response) {
345 if (!response)
350 response->error = KM_ERROR_INVALID_OPERATION_HANDLE;
354 response->error = operation->Abort();
358 void AndroidKeymaster::ExportKey(const ExportKeyRequest& request, ExportKeyResponse* response) {
359 if (response == NULL)
365 response->error =
368 if (response->error != KM_ERROR_OK)
373 GetKeyFactory(*context_, hw_enforced, sw_enforced, &algorithm, &response->error);
378 response->error = key_factory->LoadKey(key_material, request.additional_params, hw_enforced,
380 if (response->error != KM_ERROR_OK)
385 response->error = key->formatted_key_material(request.key_format, &out_key, &size);
386 if (response->error == KM_ERROR_OK) {
387 response->key_data = out_key.release();
388 response->key_data_length = size;
392 void AndroidKeymaster::AttestKey(const AttestKeyRequest& request, AttestKeyResponse* response) {
393 if (!response)
400 response->error = LoadKey(request.key_blob, request.attest_params, &tee_enforced, &sw_enforced,
402 if (response->error != KM_ERROR_OK)
405 response->error = key->GenerateAttestation(*context_, request.attest_params, tee_enforced,
406 sw_enforced, &response->certificate_chain);
409 void AndroidKeymaster::UpgradeKey(const UpgradeKeyRequest& request, UpgradeKeyResponse* response) {
410 if (!response)
414 response->error = context_->UpgradeKeyBlob(KeymasterKeyBlob(request.key_blob),
416 if (response->error != KM_ERROR_OK)
418 response->upgraded_key = upgraded_key.release();
421 void AndroidKeymaster::ImportKey(const ImportKeyRequest& request, ImportKeyResponse* response) {
422 if (response == NULL)
430 response->error = KM_ERROR_UNSUPPORTED_ALGORITHM;
434 response->error = factory->ImportKey(request.key_description, request.key_format,
436 &response->enforced, &response->unenforced);
437 if (response->error == KM_ERROR_OK)
438 response->key_blob = key_blob.release();
442 void AndroidKeymaster::DeleteKey(const DeleteKeyRequest& request, DeleteKeyResponse* response) {
443 if (!response)
445 response->error = context_->DeleteKey(KeymasterKeyBlob(request.key_blob));
448 void AndroidKeymaster::DeleteAllKeys(const DeleteAllKeysRequest&, DeleteAllKeysResponse* response) {
449 if (!response)
451 response->error = context_->DeleteAllKeys();