123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #ifndef IGATEKEEPER_SERVICE_H_
- #define IGATEKEEPER_SERVICE_H_
- #include <binder/IInterface.h>
- #include <binder/Parcel.h>
- namespace android {
- class IGateKeeperService : public IInterface {
- public:
- enum {
- ENROLL = IBinder::FIRST_CALL_TRANSACTION + 0,
- VERIFY = IBinder::FIRST_CALL_TRANSACTION + 1,
- VERIFY_CHALLENGE = IBinder::FIRST_CALL_TRANSACTION + 2,
- GET_SECURE_USER_ID = IBinder::FIRST_CALL_TRANSACTION + 3,
- CLEAR_SECURE_USER_ID = IBinder::FIRST_CALL_TRANSACTION + 4,
- REPORT_DEVICE_SETUP_COMPLETE = IBinder::FIRST_CALL_TRANSACTION + 5,
- };
- enum {
- GATEKEEPER_RESPONSE_OK = 0,
- GATEKEEPER_RESPONSE_RETRY = 1,
- GATEKEEPER_RESPONSE_ERROR = -1,
- };
-
- static const android::String16 descriptor;
- virtual const android::String16& getInterfaceDescriptor() const;
- IGateKeeperService() {}
- virtual ~IGateKeeperService() {}
-
- virtual int enroll(uint32_t uid,
- const uint8_t *current_password_handle, uint32_t current_password_handle_length,
- const uint8_t *current_password, uint32_t current_password_length,
- const uint8_t *desired_password, uint32_t desired_password_length,
- uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length) = 0;
-
- virtual int verify(uint32_t uid, const uint8_t *enrolled_password_handle,
- uint32_t enrolled_password_handle_length,
- const uint8_t *provided_password, uint32_t provided_password_length,
- bool *request_reenroll) = 0;
-
- virtual int verifyChallenge(uint32_t uid, uint64_t challenge,
- const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length,
- const uint8_t *provided_password, uint32_t provided_password_length,
- uint8_t **auth_token, uint32_t *auth_token_length, bool *request_reenroll) = 0;
-
- virtual uint64_t getSecureUserId(uint32_t uid) = 0;
-
- virtual void clearSecureUserId(uint32_t uid) = 0;
-
- virtual void reportDeviceSetupComplete() = 0;
- };
- class BnGateKeeperService: public BnInterface<IGateKeeperService> {
- public:
- virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply,
- uint32_t flags = 0);
- };
- }
- #endif
|