Remove IOperation and beginOp.

The way I planned for this to work doesn't work.  We'll revisit in
Keymaster5.  For now, removing IOperation and beginOp.

Test: Build & boot
Merged-In: I017d17079380cc3bacc6f05b2486e1b6e6c3f675
Change-Id: I017d17079380cc3bacc6f05b2486e1b6e6c3f675
This commit is contained in:
Shawn Willden 2020-03-23 13:04:53 -06:00
parent 5fe9f89858
commit e32c142da4
7 changed files with 1 additions and 115 deletions

View file

@ -621,8 +621,7 @@ e2f8bc1868fd4a3fd587c172773ea5a8c2f5a3deaf7958394102ca455252b255 android.hardwar
bbeee9604128ede83ee755b67e73b5ad29e6e1dbac9ec41fea6ffe2745b0c50a android.hardware.identity@1.0::IIdentityCredential
96ce8aad80f4c476f25261f790d357c117e79e18474c7dadd850dac704bbe65e android.hardware.identity@1.0::IIdentityCredentialStore
8da9c938e58f7d636ddd2f92c646f99d9a9e79612e6441b6380ab12744251873 android.hardware.identity@1.0::IWritableIdentityCredential
27ae3724053940462114228872b3ffaf0b8e6177d5ba97f5a76339d12b8a99dd android.hardware.keymaster@4.1::IKeymasterDevice
adb0efdf1462e9b2e742c0dcadd598666aac551f178be06e755bfcdf5797abd0 android.hardware.keymaster@4.1::IOperation
c5da8636c14cd30f1ae9f10c2219e35b4e29a64443103a5842352dd070afe514 android.hardware.keymaster@4.1::IKeymasterDevice
ddcf89cd8ee2df0d32aee55050826446fb64f7aafde0a7cd946c64f61b1a364c android.hardware.keymaster@4.1::types
65c16331e57f6dd68b3971f06f78fe9e3209afb60630c31705aa355f9a52bf0d android.hardware.neuralnetworks@1.3::IBuffer
9db064ee44268a876be0367ff771e618362d39ec603b6ecab17e1575725fcd87 android.hardware.neuralnetworks@1.3::IDevice

View file

@ -9,7 +9,6 @@ hidl_interface {
srcs: [
"types.hal",
"IKeymasterDevice.hal",
"IOperation.hal",
],
interfaces: [
"android.hardware.keymaster@3.0",

View file

@ -24,8 +24,6 @@ import @4.0::KeyPurpose;
import @4.0::OperationHandle;
import @4.0::VerificationToken;
import IOperation;
/**
* @4.1::IKeymasterDevice is a minor extension to @4.0::IKeymasterDevice. It adds support for
*
@ -78,18 +76,4 @@ interface IKeymasterDevice extends @4.0::IKeymasterDevice {
* an EARLY_BOOT_ONLY key after this method is called must fail with Error::INVALID_KEY_BLOB.
*/
earlyBootEnded() generates (ErrorCode error);
/**
* Begins a cryptographic operation. beginOp() is a variation on begin(). beginOp() has
* identical functionality to begin, but instead of an OperationHandle it returns an IOperation
* object. An IKeymasterDevice HAL service must call linkToDeath() on the Operation before
* returning it, and the provided hidl_death_recipient, if called, must abort() the operation.
* This is to ensure that in the event a client crashes while an operation is in progress, the
* operation slot is freed and available for use by other clients.
*
* @4.1::IKeymasterDevices must implement both beginOp() and begin().
*/
beginOp(KeyPurpose purpose, vec<uint8_t> keyBlob, vec<KeyParameter> inParams,
HardwareAuthToken authToken)
generates (ErrorCode error, vec<KeyParameter> outParam, IOperation operation);
};

View file

@ -1,31 +0,0 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.keymaster@4.1;
import @4.0::ErrorCode;
import @4.0::OperationHandle;
/**
* IOperation represents an in-progress IKeymasterDevice operation. It is returned by
* IKeymasterDevice.beginOp().
*/
interface IOperation {
/**
* Returns the operation handle to be used as an authentication challenge.
*/
getOperationChallenge() generates (ErrorCode error, OperationHandle operation);
};

View file

@ -19,7 +19,6 @@
#include <android/hardware/keymaster/3.0/IKeymasterDevice.h>
#include "Keymaster.h"
#include "Operation.h"
namespace android::hardware::keymaster::V4_1::support {
@ -122,17 +121,6 @@ class Keymaster3 : public Keymaster {
Return<ErrorCode> earlyBootEnded() override { return ErrorCode::UNIMPLEMENTED; }
Return<void> beginOp(KeyPurpose purpose, const hidl_vec<uint8_t>& keyBlob,
const hidl_vec<KeyParameter>& inParams, const HardwareAuthToken& authToken,
beginOp_cb _hidl_cb) override {
return begin(purpose, keyBlob, inParams, authToken,
[&_hidl_cb](V4_0::ErrorCode errorCode, const hidl_vec<KeyParameter>& outParams,
OperationHandle operationHandle) {
_hidl_cb(static_cast<ErrorCode>(errorCode), outParams,
new Operation(operationHandle));
});
}
private:
void getVersionIfNeeded();

View file

@ -17,7 +17,6 @@
#pragma once
#include "Keymaster.h"
#include "Operation.h"
namespace android::hardware::keymaster::V4_1::support {
@ -171,20 +170,6 @@ class Keymaster4 : public Keymaster {
return ErrorCode::UNIMPLEMENTED;
}
Return<void> beginOp(KeyPurpose purpose, const hidl_vec<uint8_t>& keyBlob,
const hidl_vec<KeyParameter>& inParams, const HardwareAuthToken& authToken,
beginOp_cb _hidl_cb) override {
if (km4_1_dev_) return km4_1_dev_->beginOp(purpose, keyBlob, inParams, authToken, _hidl_cb);
return km4_0_dev_->begin(
purpose, keyBlob, inParams, authToken,
[&_hidl_cb](V4_0::ErrorCode errorCode, const hidl_vec<KeyParameter>& outParams,
OperationHandle operationHandle) {
_hidl_cb(static_cast<ErrorCode>(errorCode), outParams,
new Operation(operationHandle));
});
}
private:
void getVersionIfNeeded();

View file

@ -1,38 +0,0 @@
/*
** Copyright 2020, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#pragma once
#include <android/hardware/keymaster/4.1/IOperation.h>
#include <keymasterV4_1/keymaster_tags.h>
namespace android::hardware::keymaster::V4_1::support {
class Operation : public IOperation {
public:
Operation(OperationHandle handle) : handle_(handle) {}
Return<void> getOperationChallenge(getOperationChallenge_cb _hidl_cb) override {
_hidl_cb(V4_1::ErrorCode::OK, handle_);
return Void();
}
private:
OperationHandle handle_;
};
} // namespace android::hardware::keymaster::V4_1::support