diff options
author | Michael Bestas <mkbestas@lineageos.org> | 2019-09-15 21:25:53 +0300 |
---|---|---|
committer | Paul Keith <javelinanddart@gmail.com> | 2019-10-05 13:22:08 -0500 |
commit | 8a47148339c77a53d76171aaf3b9668bf723cc2f (patch) | |
tree | 15e764e41258ae9899247cf5776b56482fd0c448 | |
parent | a0f54ed82c65070673990f32a3c17b9772cf1cb3 (diff) | |
download | hardware_lineage_interfaces-8a47148339c77a53d76171aaf3b9668bf723cc2f.tar.gz hardware_lineage_interfaces-8a47148339c77a53d76171aaf3b9668bf723cc2f.tar.bz2 hardware_lineage_interfaces-8a47148339c77a53d76171aaf3b9668bf723cc2f.zip |
Initial dummy cryptfshw implementation
* Generated with hidl-gen and added copyrights
Change-Id: I2741739faf33a1bafbbebbbbc63f13a4bd292877
-rw-r--r-- | cryptfshw/1.0/Android.bp | 39 | ||||
-rw-r--r-- | cryptfshw/1.0/CryptfsHw.cpp | 59 | ||||
-rw-r--r-- | cryptfshw/1.0/CryptfsHw.h | 57 |
3 files changed, 155 insertions, 0 deletions
diff --git a/cryptfshw/1.0/Android.bp b/cryptfshw/1.0/Android.bp new file mode 100644 index 0000000..8670d24 --- /dev/null +++ b/cryptfshw/1.0/Android.bp @@ -0,0 +1,39 @@ +// Copyright (C) 2019 The LineageOS 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. + +cc_library_shared { + // FIXME: this should only be -impl for a passthrough hal. + // In most cases, to convert this to a binderized implementation, you should: + // - change '-impl' to '-service' here and make it a cc_binary instead of a + // cc_library_shared. + // - add a *.rc file for this module. + // - delete HIDL_FETCH_I* functions. + // - call configureRpcThreadpool and registerAsService on the instance. + // You may also want to append '-impl/-service' with a specific identifier like + // '-vendor' or '-<hardware identifier>' etc to distinguish it. + name: "vendor.qti.hardware.cryptfshw@1.0-impl", + relative_install_path: "hw", + // FIXME: this should be 'vendor: true' for modules that will eventually be + // on AOSP. + proprietary: true, + srcs: [ + "CryptfsHw.cpp", + ], + shared_libs: [ + "libhidlbase", + "libhidltransport", + "libutils", + "vendor.qti.hardware.cryptfshw@1.0", + ], +} diff --git a/cryptfshw/1.0/CryptfsHw.cpp b/cryptfshw/1.0/CryptfsHw.cpp new file mode 100644 index 0000000..ab43760 --- /dev/null +++ b/cryptfshw/1.0/CryptfsHw.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2019 The LineageOS 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. + */ + +#include "CryptfsHw.h" + +namespace vendor { +namespace qti { +namespace hardware { +namespace cryptfshw { +namespace V1_0 { +namespace implementation { + +// Methods from ::vendor::qti::hardware::cryptfshw::V1_0::ICryptfsHw follow. +Return<int32_t> CryptfsHw::setIceParam(uint32_t flag) { + // TODO implement + return int32_t {}; +} + +Return<int32_t> CryptfsHw::setKey(const hidl_string& passwd, const hidl_string& enc_mode) { + // TODO implement + return int32_t {}; +} + +Return<int32_t> CryptfsHw::updateKey(const hidl_string& oldpw, const hidl_string& newpw, const hidl_string& enc_mode) { + // TODO implement + return int32_t {}; +} + +Return<int32_t> CryptfsHw::clearKey() { + // TODO implement + return int32_t {}; +} + + +// Methods from ::android::hidl::base::V1_0::IBase follow. + +//ICryptfsHw* HIDL_FETCH_ICryptfsHw(const char* /* name */) { + //return new CryptfsHw(); +//} +// +} // namespace implementation +} // namespace V1_0 +} // namespace cryptfshw +} // namespace hardware +} // namespace qti +} // namespace vendor diff --git a/cryptfshw/1.0/CryptfsHw.h b/cryptfshw/1.0/CryptfsHw.h new file mode 100644 index 0000000..c73984e --- /dev/null +++ b/cryptfshw/1.0/CryptfsHw.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2019 The LineageOS 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 <vendor/qti/hardware/cryptfshw/1.0/ICryptfsHw.h> +#include <hidl/MQDescriptor.h> +#include <hidl/Status.h> + +namespace vendor { +namespace qti { +namespace hardware { +namespace cryptfshw { +namespace V1_0 { +namespace implementation { + +using ::android::hardware::hidl_array; +using ::android::hardware::hidl_memory; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; +using ::android::hardware::Return; +using ::android::hardware::Void; +using ::android::sp; + +struct CryptfsHw : public ICryptfsHw { + // Methods from ::vendor::qti::hardware::cryptfshw::V1_0::ICryptfsHw follow. + Return<int32_t> setIceParam(uint32_t flag) override; + Return<int32_t> setKey(const hidl_string& passwd, const hidl_string& enc_mode) override; + Return<int32_t> updateKey(const hidl_string& oldpw, const hidl_string& newpw, const hidl_string& enc_mode) override; + Return<int32_t> clearKey() override; + + // Methods from ::android::hidl::base::V1_0::IBase follow. + +}; + +// FIXME: most likely delete, this is only for passthrough implementations +// extern "C" ICryptfsHw* HIDL_FETCH_ICryptfsHw(const char* name); + +} // namespace implementation +} // namespace V1_0 +} // namespace cryptfshw +} // namespace hardware +} // namespace qti +} // namespace vendor |