| #include <android/binder_parcel_utils.h> |
| #include <aidl/android/system/keystore2/BpKeystoreSecurityLevel.h> |
| #include <aidl/android/system/keystore2/BnKeystoreSecurityLevel.h> |
| #include <aidl/android/system/keystore2/IKeystoreSecurityLevel.h> |
| #include <aidl/android/system/keystore2/BpKeystoreService.h> |
| #include <aidl/android/system/keystore2/BnKeystoreService.h> |
| #include <aidl/android/system/keystore2/IKeystoreService.h> |
| |
| namespace aidl { |
| namespace android { |
| namespace system { |
| namespace keystore2 { |
| static binder_status_t _aidl_onTransact(AIBinder* _aidl_binder, transaction_code_t _aidl_code, const AParcel* _aidl_in, AParcel* _aidl_out) { |
| (void)_aidl_in; |
| (void)_aidl_out; |
| binder_status_t _aidl_ret_status = STATUS_UNKNOWN_TRANSACTION; |
| std::shared_ptr<BnKeystoreService> _aidl_impl = std::static_pointer_cast<BnKeystoreService>(::ndk::ICInterface::asInterface(_aidl_binder)); |
| switch (_aidl_code) { |
| case (FIRST_CALL_TRANSACTION + 0 /*getSecurityLevel*/): { |
| ::aidl::android::hardware::security::keymint::SecurityLevel in_securityLevel; |
| std::shared_ptr<::aidl::android::system::keystore2::IKeystoreSecurityLevel> _aidl_return; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, reinterpret_cast<int32_t*>(&in_securityLevel)); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getSecurityLevel(in_securityLevel, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::aidl::android::system::keystore2::IKeystoreSecurityLevel::writeToParcel(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 1 /*getKeyEntry*/): { |
| ::aidl::android::system::keystore2::KeyDescriptor in_key; |
| ::aidl::android::system::keystore2::KeyEntryResponse _aidl_return; |
| |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_key); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getKeyEntry(in_key, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 2 /*updateSubcomponent*/): { |
| ::aidl::android::system::keystore2::KeyDescriptor in_key; |
| std::optional<std::vector<uint8_t>> in_publicCert; |
| std::optional<std::vector<uint8_t>> in_certificateChain; |
| |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_key); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_publicCert); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_in, &in_certificateChain); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->updateSubcomponent(in_key, in_publicCert, in_certificateChain); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 3 /*listEntries*/): { |
| ::aidl::android::system::keystore2::Domain in_domain; |
| int64_t in_nspace; |
| std::vector<::aidl::android::system::keystore2::KeyDescriptor> _aidl_return; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, reinterpret_cast<int32_t*>(&in_domain)); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt64(_aidl_in, &in_nspace); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->listEntries(in_domain, in_nspace, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 4 /*deleteKey*/): { |
| ::aidl::android::system::keystore2::KeyDescriptor in_key; |
| |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_key); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->deleteKey(in_key); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 5 /*grant*/): { |
| ::aidl::android::system::keystore2::KeyDescriptor in_key; |
| int32_t in_granteeUid; |
| int32_t in_accessVector; |
| ::aidl::android::system::keystore2::KeyDescriptor _aidl_return; |
| |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_key); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_granteeUid); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_accessVector); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->grant(in_key, in_granteeUid, in_accessVector, &_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 6 /*ungrant*/): { |
| ::aidl::android::system::keystore2::KeyDescriptor in_key; |
| int32_t in_granteeUid; |
| |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_in, &in_key); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| _aidl_ret_status = AParcel_readInt32(_aidl_in, &in_granteeUid); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->ungrant(in_key, in_granteeUid); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/): { |
| int32_t _aidl_return; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceVersion(&_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| case (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/): { |
| std::string _aidl_return; |
| |
| ::ndk::ScopedAStatus _aidl_status = _aidl_impl->getInterfaceHash(&_aidl_return); |
| _aidl_ret_status = AParcel_writeStatusHeader(_aidl_out, _aidl_status.get()); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| if (!AStatus_isOk(_aidl_status.get())) break; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeString(_aidl_out, _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) break; |
| |
| break; |
| } |
| } |
| return _aidl_ret_status; |
| } |
| |
| static AIBinder_Class* _g_aidl_clazz = ::ndk::ICInterface::defineClass(IKeystoreService::descriptor, _aidl_onTransact); |
| |
| BpKeystoreService::BpKeystoreService(const ::ndk::SpAIBinder& binder) : BpCInterface(binder) {} |
| BpKeystoreService::~BpKeystoreService() {} |
| |
| ::ndk::ScopedAStatus BpKeystoreService::getSecurityLevel(::aidl::android::hardware::security::keymint::SecurityLevel in_securityLevel, std::shared_ptr<::aidl::android::system::keystore2::IKeystoreSecurityLevel>* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), static_cast<int32_t>(in_securityLevel)); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 0 /*getSecurityLevel*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->getSecurityLevel(in_securityLevel, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::aidl::android::system::keystore2::IKeystoreSecurityLevel::readFromParcel(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::getKeyEntry(const ::aidl::android::system::keystore2::KeyDescriptor& in_key, ::aidl::android::system::keystore2::KeyEntryResponse* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_in.get(), in_key); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 1 /*getKeyEntry*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->getKeyEntry(in_key, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::updateSubcomponent(const ::aidl::android::system::keystore2::KeyDescriptor& in_key, const std::optional<std::vector<uint8_t>>& in_publicCert, const std::optional<std::vector<uint8_t>>& in_certificateChain) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_in.get(), in_key); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_publicCert); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeVector(_aidl_in.get(), in_certificateChain); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 2 /*updateSubcomponent*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->updateSubcomponent(in_key, in_publicCert, in_certificateChain); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::listEntries(::aidl::android::system::keystore2::Domain in_domain, int64_t in_nspace, std::vector<::aidl::android::system::keystore2::KeyDescriptor>* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), static_cast<int32_t>(in_domain)); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt64(_aidl_in.get(), in_nspace); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 3 /*listEntries*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->listEntries(in_domain, in_nspace, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readVector(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::deleteKey(const ::aidl::android::system::keystore2::KeyDescriptor& in_key) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_in.get(), in_key); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 4 /*deleteKey*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->deleteKey(in_key); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::grant(const ::aidl::android::system::keystore2::KeyDescriptor& in_key, int32_t in_granteeUid, int32_t in_accessVector, ::aidl::android::system::keystore2::KeyDescriptor* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_in.get(), in_key); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_granteeUid); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_accessVector); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 5 /*grant*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->grant(in_key, in_granteeUid, in_accessVector, _aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readParcelable(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::ungrant(const ::aidl::android::system::keystore2::KeyDescriptor& in_key, int32_t in_granteeUid) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = ::ndk::AParcel_writeParcelable(_aidl_in.get(), in_key); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_writeInt32(_aidl_in.get(), in_granteeUid); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 6 /*ungrant*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->ungrant(in_key, in_granteeUid); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::getInterfaceVersion(int32_t* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| if (_aidl_cached_version != -1) { |
| *_aidl_return = _aidl_cached_version; |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 16777214 /*getInterfaceVersion*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->getInterfaceVersion(_aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = AParcel_readInt32(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_cached_version = *_aidl_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus BpKeystoreService::getInterfaceHash(std::string* _aidl_return) { |
| binder_status_t _aidl_ret_status = STATUS_OK; |
| ::ndk::ScopedAStatus _aidl_status; |
| const std::lock_guard<std::mutex> lock(_aidl_cached_hash_mutex); |
| if (_aidl_cached_hash != "-1") { |
| *_aidl_return = _aidl_cached_hash; |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAParcel _aidl_in; |
| ::ndk::ScopedAParcel _aidl_out; |
| |
| _aidl_ret_status = AIBinder_prepareTransaction(asBinder().get(), _aidl_in.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AIBinder_transact( |
| asBinder().get(), |
| (FIRST_CALL_TRANSACTION + 16777213 /*getInterfaceHash*/), |
| _aidl_in.getR(), |
| _aidl_out.getR(), |
| 0 |
| #ifdef BINDER_STABILITY_SUPPORT |
| | FLAG_PRIVATE_LOCAL |
| #endif // BINDER_STABILITY_SUPPORT |
| ); |
| if (_aidl_ret_status == STATUS_UNKNOWN_TRANSACTION && IKeystoreService::getDefaultImpl()) { |
| _aidl_status = IKeystoreService::getDefaultImpl()->getInterfaceHash(_aidl_return); |
| goto _aidl_status_return; |
| } |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_ret_status = AParcel_readStatusHeader(_aidl_out.get(), _aidl_status.getR()); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| if (!AStatus_isOk(_aidl_status.get())) goto _aidl_status_return; |
| _aidl_ret_status = ::ndk::AParcel_readString(_aidl_out.get(), _aidl_return); |
| if (_aidl_ret_status != STATUS_OK) goto _aidl_error; |
| |
| _aidl_cached_hash = *_aidl_return; |
| _aidl_error: |
| _aidl_status.set(AStatus_fromStatus(_aidl_ret_status)); |
| _aidl_status_return: |
| return _aidl_status; |
| } |
| // Source for BnKeystoreService |
| BnKeystoreService::BnKeystoreService() {} |
| BnKeystoreService::~BnKeystoreService() {} |
| ::ndk::SpAIBinder BnKeystoreService::createBinder() { |
| AIBinder* binder = AIBinder_new(_g_aidl_clazz, static_cast<void*>(this)); |
| #ifdef BINDER_STABILITY_SUPPORT |
| AIBinder_markVintfStability(binder); |
| #endif // BINDER_STABILITY_SUPPORT |
| return ::ndk::SpAIBinder(binder); |
| } |
| ::ndk::ScopedAStatus BnKeystoreService::getInterfaceVersion(int32_t* _aidl_return) { |
| *_aidl_return = IKeystoreService::version; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| ::ndk::ScopedAStatus BnKeystoreService::getInterfaceHash(std::string* _aidl_return) { |
| *_aidl_return = IKeystoreService::hash; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| // Source for IKeystoreService |
| const char* IKeystoreService::descriptor = "android.system.keystore2.IKeystoreService"; |
| IKeystoreService::IKeystoreService() {} |
| IKeystoreService::~IKeystoreService() {} |
| |
| |
| std::shared_ptr<IKeystoreService> IKeystoreService::fromBinder(const ::ndk::SpAIBinder& binder) { |
| if (!AIBinder_associateClass(binder.get(), _g_aidl_clazz)) { return nullptr; } |
| std::shared_ptr<::ndk::ICInterface> interface = ::ndk::ICInterface::asInterface(binder.get()); |
| if (interface) { |
| return std::static_pointer_cast<IKeystoreService>(interface); |
| } |
| return ::ndk::SharedRefBase::make<BpKeystoreService>(binder); |
| } |
| |
| binder_status_t IKeystoreService::writeToParcel(AParcel* parcel, const std::shared_ptr<IKeystoreService>& instance) { |
| return AParcel_writeStrongBinder(parcel, instance ? instance->asBinder().get() : nullptr); |
| } |
| binder_status_t IKeystoreService::readFromParcel(const AParcel* parcel, std::shared_ptr<IKeystoreService>* instance) { |
| ::ndk::SpAIBinder binder; |
| binder_status_t status = AParcel_readStrongBinder(parcel, binder.getR()); |
| if (status != STATUS_OK) return status; |
| *instance = IKeystoreService::fromBinder(binder); |
| return STATUS_OK; |
| } |
| bool IKeystoreService::setDefaultImpl(const std::shared_ptr<IKeystoreService>& impl) { |
| // Only one user of this interface can use this function |
| // at a time. This is a heuristic to detect if two different |
| // users in the same process use this function. |
| assert(!IKeystoreService::default_impl); |
| if (impl) { |
| IKeystoreService::default_impl = impl; |
| return true; |
| } |
| return false; |
| } |
| const std::shared_ptr<IKeystoreService>& IKeystoreService::getDefaultImpl() { |
| return IKeystoreService::default_impl; |
| } |
| std::shared_ptr<IKeystoreService> IKeystoreService::default_impl = nullptr; |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::getSecurityLevel(::aidl::android::hardware::security::keymint::SecurityLevel /*in_securityLevel*/, std::shared_ptr<::aidl::android::system::keystore2::IKeystoreSecurityLevel>* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::getKeyEntry(const ::aidl::android::system::keystore2::KeyDescriptor& /*in_key*/, ::aidl::android::system::keystore2::KeyEntryResponse* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::updateSubcomponent(const ::aidl::android::system::keystore2::KeyDescriptor& /*in_key*/, const std::optional<std::vector<uint8_t>>& /*in_publicCert*/, const std::optional<std::vector<uint8_t>>& /*in_certificateChain*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::listEntries(::aidl::android::system::keystore2::Domain /*in_domain*/, int64_t /*in_nspace*/, std::vector<::aidl::android::system::keystore2::KeyDescriptor>* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::deleteKey(const ::aidl::android::system::keystore2::KeyDescriptor& /*in_key*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::grant(const ::aidl::android::system::keystore2::KeyDescriptor& /*in_key*/, int32_t /*in_granteeUid*/, int32_t /*in_accessVector*/, ::aidl::android::system::keystore2::KeyDescriptor* /*_aidl_return*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::ungrant(const ::aidl::android::system::keystore2::KeyDescriptor& /*in_key*/, int32_t /*in_granteeUid*/) { |
| ::ndk::ScopedAStatus _aidl_status; |
| _aidl_status.set(AStatus_fromStatus(STATUS_UNKNOWN_TRANSACTION)); |
| return _aidl_status; |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::getInterfaceVersion(int32_t* _aidl_return) { |
| *_aidl_return = 0; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| ::ndk::ScopedAStatus IKeystoreServiceDefault::getInterfaceHash(std::string* _aidl_return) { |
| *_aidl_return = ""; |
| return ::ndk::ScopedAStatus(AStatus_newOk()); |
| } |
| ::ndk::SpAIBinder IKeystoreServiceDefault::asBinder() { |
| return ::ndk::SpAIBinder(); |
| } |
| bool IKeystoreServiceDefault::isRemote() { |
| return false; |
| } |
| } // namespace keystore2 |
| } // namespace system |
| } // namespace android |
| } // namespace aidl |