Mir
|
A source of moderately-difficult-to-spoof cookies. More...
#include <authority.h>
Public Member Functions | |
Authority (Authority const &authority)=delete | |
Authority & | operator= (Authority const &authority)=delete |
virtual | ~Authority () noexcept=default |
virtual std::unique_ptr< Cookie > | make_cookie (uint64_t const ×tamp)=0 |
Creates a cookie from a timestamp. More... | |
virtual std::unique_ptr< Cookie > | make_cookie (std::vector< uint8_t > const &raw_cookie)=0 |
Creates a cookie from a serialized representation. More... | |
Static Public Member Functions | |
static size_t | optimal_secret_size () |
Optimal size for the provided Secret. More... | |
static std::unique_ptr< Authority > | create_from (Secret const &secret) |
Construction function used to create an Authority. More... | |
static std::unique_ptr< Authority > | create_saving (Secret &save_secret) |
Construction function used to create an Authority as well as a secret. More... | |
static std::unique_ptr< Authority > | create () |
Construction function used to create an Authority and a secret which it keeps internally. More... | |
Static Public Attributes | |
static unsigned const | minimum_secret_size = 8 |
Absolute minimum size of secret key the Authority will accept. More... | |
Protected Member Functions | |
Authority ()=default | |
A source of moderately-difficult-to-spoof cookies.
The primary motivation for this is to provide event timestamps that clients find it difficult to spoof. This is useful for focus grant and similar operations where shell behaviour should be dependent on the timestamp of the client event that caused the request.
Some spoofing protection is desirable; experience with X clients shows that they will go to some effort to attempt to bypass focus stealing prevention.
|
delete |
|
virtualdefaultnoexcept |
|
protecteddefault |
|
static |
|
pure virtual |
Creates a cookie from a timestamp.
[in] | timestamp | A timestamp |
|
pure virtual |
Creates a cookie from a serialized representation.
[in] | raw_cookie | A blob of bytes representing a serialized cookie |
|
static |
Optimal size for the provided Secret.
This is the maximum useful size of the secret key. Keys of greater size will be reduced to this size internally, and keys of smaller size may be internally extended to this size.
|
static |
Absolute minimum size of secret key the Authority will accept.
Code should be using optimum_secret_size(); this minimum size is provided as a user convenience to guard against catastrophically bad initialisation.
Copyright © 2012-2016 Canonical Ltd.
Generated on Sat Dec 3 12:48:59 UTC 2016