Go to the documentation of this file.
17 #ifndef USGOV_623b2ff2c7648665400db382bc9542b909646b0c7f35010ee4d34b7a4e819d4c
18 #define USGOV_623b2ff2c7648665400db382bc9542b909646b0c7f35010ee4d34b7a4e819d4c
23 namespace us{
namespace gov {
34 constexpr
static array<const char*,num_stages> stagestr={
"denied",
"authorized"};
38 uint32_t successful_verifications{0};
39 uint32_t failed_verifications{0};
40 uint32_t successful_authorizations{0};
41 uint32_t failed_authorizations{0};
43 void dump(ostream&os)
const;
45 static counters_t counters;
53 void dump_all(
const string& prefix, ostream& os)
const override;
54 void dump(
const string& prefix, ostream& os)
const;
@ role_peer
Definition: peer_t.h:53
string age(chrono::system_clock::time_point time)
Definition: daemon.cpp:263
static readonly short gov_id_request
Definition: protocol.cs:38
ko connect(const string &host, uint16_t port, uint16_t pport, role_t, bool block)
static bool is_ko(const std::string &s)
Definition: ko.h:30
void dump_all(const string &prefix, ostream &os) const override
static constexpr uint16_t svc_encrypted_from
Definition: protocol.h:26
stage_t stage_peer
Definition: peer_t.h:114
void process_peer_challenge(datagram *d, const keys &)
#define CFG_AUTH_TIMEOUT_SECS
Definition: config.h:38
handshake_t()
Definition: peer_t.cpp:336
virtual const keys & get_keys() const
uint16_t decode_sequence() const
crypto::symmetric_encryption * se
Definition: peer_t.h:121
pair< ko, datagram * > encrypt(crypto::symmetric_encryption &) const
relay::peer_t peer_t
Definition: daemon.h:31
#define unlikely(x)
Definition: likely.h:30
@ authorized
Definition: peer_t.h:31
ko init(const keys::priv_t &sk, const keys::pub_t &pub_other)
f first
Definition: pair.java:20
string codehash
Definition: vcs.h:30
bool is_finished() const
Definition: client.h:95
role_t parse_role() const
Definition: peer_t.cpp:352
id::peer_t b
Definition: peer_t.h:28
role_t role
Definition: peer_t.h:116
us::gov::auth::peer_t c
Definition: peer_t.cpp:22
~handshakes_t()
Definition: peer_t.cpp:319
static constexpr uint32_t output_size
Definition: sha256.h:35
uint16_t parse_pin() const
Definition: peer_t.cpp:348
static pub_t get_pubkey(const priv_t &privkey)
Definition: datagram.h:44
constexpr static array< const char *, num_roles > rolestr
Definition: peer_t.h:58
bool process_work(datagram *d)
id::daemon daemon
Definition: daemon.h:25
pub_t pubkey
Definition: peer_t.h:117
virtual void verification_completed()
Definition: peer_t.cs:214
@ verified
Definition: peer_t.h:46
handshake_t * peer
Definition: peer_t.h:111
uint16_t service
Definition: datagram.h:200
peer::daemon::pub_t pub_t
Definition: auth_app.h:53
void dump(const string &prefix, ostream &os) const
handshake_t * me
Definition: peer_t.h:110
s second
Definition: pair.java:21
Definition: peer_t.java:71
server * parent
Definition: client.h:107
stage_t
Definition: peer_t.h:44
stage_t stage
Definition: peer_t.h:56
const ko_t * ko
Definition: ko.h:27
uint16_t decode_service() const
void disconnect()
Definition: client.cs:81
Definition: peer_t.java:23
static constexpr ko ok
Definition: ko.h:28
void verification_completed(uint16_t rpport) override
@ verified_fail
Definition: peer_t.h:47
virtual bool authorize(const pub_t &p, uint16_t pin) const =0
void dump(const string &pfx, ostream &os) const
Definition: peer_t.cpp:356
crypto::ec::keys keys
Definition: app.h:52
uint16_t version_fingerprint
Definition: peer_t.h:118
ko connect0(uint32_t host, uint16_t port, bool block)
handshakes_t()
Definition: peer_t.cpp:315
sigmsg_hash_t msg
Definition: peer_t.h:104
#define likely(x)
Definition: likely.h:29
Definition: networking.h:32
long size()
Definition: datagram.cs:178
ko parse(vector< t > &content) const
Definition: datagram.h:170
@ denied
Definition: peer_t.h:30
std::string encode(const std::string &s)
Definition: base58.cpp:62
void process_challenge_response(datagram *d)
virtual ko send1(datagram *)
condition_variable cv_auth
Definition: peer_t.h:120
mutex mx_auth
Definition: peer_t.h:119
Definition: stdint.java:95
string parse_string() const
chrono::system_clock::time_point since
Definition: client.h:71
@ role_device
Definition: peer_t.h:55
static readonly short gov_id_peer_challenge
Definition: protocol.cs:39
pair< security_level_t, string > security_level() const override
static readonly short gov_id_challenge_response
Definition: protocol.cs:40
static const char * KO_6017
Definition: peer_t.h:42
virtual void dump_all(const string &prefix, ostream &os) const override
uint16_t parse_pport() const
Definition: peer_t.cpp:344
#define log
Definition: gov.h:83
#define logdump
Definition: gov.h:84
nodes_t nodes
Definition: daemon.h:170
void process_request(datagram *d, const keys &)
pair< ko, datagram * > decrypt(crypto::symmetric_encryption &) const
uint16_t parse_version_fingerprint() const
Definition: peer_t.cpp:340