Android-cuttlefish cvd tool
Public Member Functions | Static Public Attributes | Private Types | Private Attributes | List of all members
gatekeeper::SoftGateKeeper Class Reference

#include <soft_gatekeeper.h>

Inheritance diagram for gatekeeper::SoftGateKeeper:
Inheritance graph
[legend]
Collaboration diagram for gatekeeper::SoftGateKeeper:
Collaboration graph
[legend]

Public Member Functions

 SoftGateKeeper ()
 
virtual ~SoftGateKeeper ()
 
virtual bool GetAuthTokenKey (const uint8_t **auth_token_key, uint32_t *length) const
 
virtual void GetPasswordKey (const uint8_t **password_key, uint32_t *length)
 
virtual void ComputePasswordSignature (uint8_t *signature, uint32_t signature_length, const uint8_t *, uint32_t, const uint8_t *password, uint32_t password_length, salt_t salt) const
 
virtual void GetRandom (void *random, uint32_t requested_length) const
 
virtual void ComputeSignature (uint8_t *signature, uint32_t signature_length, const uint8_t *, uint32_t, const uint8_t *, const uint32_t) const
 
virtual uint64_t GetMillisecondsSinceBoot () const
 
virtual bool IsHardwareBacked () const
 
virtual bool GetFailureRecord (uint32_t uid, secure_id_t user_id, failure_record_t *record, bool)
 
virtual bool ClearFailureRecord (uint32_t uid, secure_id_t user_id, bool)
 
virtual bool WriteFailureRecord (uint32_t uid, failure_record_t *record, bool)
 
fast_hash_t ComputeFastHash (const SizedBuffer &password, uint64_t salt)
 
bool VerifyFast (const fast_hash_t &fast_hash, const SizedBuffer &password)
 
bool DoVerify (const password_handle_t *expected_handle, const SizedBuffer &password)
 

Static Public Attributes

static const uint32_t SIGNATURE_LENGTH_BYTES = 32
 
static const uint64_t N = 16384
 
static const uint32_t r = 8
 
static const uint32_t p = 1
 
static const int MAX_UINT_32_CHARS = 11
 

Private Types

typedef std::unordered_map< uint32_t, failure_record_t > FailureRecordMap
 
typedef std::unordered_map< uint64_t, fast_hash_tFastHashMap
 

Private Attributes

std::unique_ptr< uint8_t[]> key_
 
FailureRecordMap failure_map_
 
FastHashMap fast_hash_map_
 

Member Typedef Documentation

◆ FailureRecordMap

typedef std::unordered_map<uint32_t, failure_record_t> gatekeeper::SoftGateKeeper::FailureRecordMap
private

◆ FastHashMap

typedef std::unordered_map<uint64_t, fast_hash_t> gatekeeper::SoftGateKeeper::FastHashMap
private

Constructor & Destructor Documentation

◆ SoftGateKeeper()

gatekeeper::SoftGateKeeper::SoftGateKeeper ( )
inline

◆ ~SoftGateKeeper()

virtual gatekeeper::SoftGateKeeper::~SoftGateKeeper ( )
inlinevirtual

Member Function Documentation

◆ ClearFailureRecord()

virtual bool gatekeeper::SoftGateKeeper::ClearFailureRecord ( uint32_t  uid,
secure_id_t  user_id,
bool   
)
inlinevirtual

◆ ComputeFastHash()

fast_hash_t gatekeeper::SoftGateKeeper::ComputeFastHash ( const SizedBuffer &  password,
uint64_t  salt 
)
inline

◆ ComputePasswordSignature()

virtual void gatekeeper::SoftGateKeeper::ComputePasswordSignature ( uint8_t *  signature,
uint32_t  signature_length,
const uint8_t *  ,
uint32_t  ,
const uint8_t *  password,
uint32_t  password_length,
salt_t  salt 
) const
inlinevirtual

◆ ComputeSignature()

virtual void gatekeeper::SoftGateKeeper::ComputeSignature ( uint8_t *  signature,
uint32_t  signature_length,
const uint8_t *  ,
uint32_t  ,
const uint8_t *  ,
const uint32_t   
) const
inlinevirtual

◆ DoVerify()

bool gatekeeper::SoftGateKeeper::DoVerify ( const password_handle_t *  expected_handle,
const SizedBuffer &  password 
)
inline

◆ GetAuthTokenKey()

virtual bool gatekeeper::SoftGateKeeper::GetAuthTokenKey ( const uint8_t **  auth_token_key,
uint32_t *  length 
) const
inlinevirtual

◆ GetFailureRecord()

virtual bool gatekeeper::SoftGateKeeper::GetFailureRecord ( uint32_t  uid,
secure_id_t  user_id,
failure_record_t *  record,
bool   
)
inlinevirtual

◆ GetMillisecondsSinceBoot()

virtual uint64_t gatekeeper::SoftGateKeeper::GetMillisecondsSinceBoot ( ) const
inlinevirtual

◆ GetPasswordKey()

virtual void gatekeeper::SoftGateKeeper::GetPasswordKey ( const uint8_t **  password_key,
uint32_t *  length 
)
inlinevirtual

◆ GetRandom()

virtual void gatekeeper::SoftGateKeeper::GetRandom ( void *  random,
uint32_t  requested_length 
) const
inlinevirtual

◆ IsHardwareBacked()

virtual bool gatekeeper::SoftGateKeeper::IsHardwareBacked ( ) const
inlinevirtual

◆ VerifyFast()

bool gatekeeper::SoftGateKeeper::VerifyFast ( const fast_hash_t fast_hash,
const SizedBuffer &  password 
)
inline

◆ WriteFailureRecord()

virtual bool gatekeeper::SoftGateKeeper::WriteFailureRecord ( uint32_t  uid,
failure_record_t *  record,
bool   
)
inlinevirtual

Member Data Documentation

◆ failure_map_

FailureRecordMap gatekeeper::SoftGateKeeper::failure_map_
private

◆ fast_hash_map_

FastHashMap gatekeeper::SoftGateKeeper::fast_hash_map_
private

◆ key_

std::unique_ptr<uint8_t[]> gatekeeper::SoftGateKeeper::key_
private

◆ MAX_UINT_32_CHARS

const int gatekeeper::SoftGateKeeper::MAX_UINT_32_CHARS = 11
static

◆ N

const uint64_t gatekeeper::SoftGateKeeper::N = 16384
static

◆ p

const uint32_t gatekeeper::SoftGateKeeper::p = 1
static

◆ r

const uint32_t gatekeeper::SoftGateKeeper::r = 8
static

◆ SIGNATURE_LENGTH_BYTES

const uint32_t gatekeeper::SoftGateKeeper::SIGNATURE_LENGTH_BYTES = 32
static

The documentation for this class was generated from the following file: