feisty meow concerns codebase
2.140
|
Processes the encryption_infoton object for setting up an encrypted channel. More...
#include <encryption_tentacle.h>
Public Member Functions | |
encryption_tentacle () | |
this tentacle will implement the server side. More... | |
encryption_tentacle (const basis::byte_array &rsa_key) | |
this is the client side tentacle. More... | |
encryption_tentacle (int key_size) | |
automatically creates a private key of the "key_size". More... | |
virtual | ~encryption_tentacle () |
DEFINE_CLASS_NAME ("encryption_tentacle") | |
virtual basis::outcome | reconstitute (const structures::string_array &classifier, basis::byte_array &packed_form, infoton *&reformed) |
recreates a "reformed" infoton from a packed form. More... | |
virtual basis::outcome | consume (infoton &to_chow, const octopus_request_id &item_id, basis::byte_array &transformed) |
the base class handles the processing of the request in "to_chow". More... | |
virtual void | expunge (const octopus_entity &to_remove) |
throws out any keys we were maintaining for this entity. More... | |
key_repository & | keys () const |
provides access to our list of keys. More... | |
const crypto::rsa_crypto & | private_key () const |
provides access to the key held here. More... | |
Public Member Functions inherited from octopi::tentacle_helper< encryption_infoton > | |
tentacle_helper (const structures::string_array &classifier, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE) | |
virtual | ~tentacle_helper () |
force a virtual destructor. More... | |
virtual basis::outcome | consume (infoton &formal(to_chow), const octopus_request_id &formal(item_id), basis::byte_array &transformed) |
consume is not really provided here. remember to implement for servers! More... | |
virtual void | expunge (const octopus_entity &formal(to_remove)) |
no general actions for expunge; they are all class-specific. More... | |
Public Member Functions inherited from octopi::tentacle | |
tentacle (const structures::string_array &group_name, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE) | |
constructs a tentacle that handles infotons with the "group_name". More... | |
virtual | ~tentacle () |
DEFINE_CLASS_NAME ("tentacle") | |
const structures::string_array & | group () const |
returns the name of the group that this tentacle services. More... | |
bool | backgrounding () const |
reports on whether this tentacle supports background operation or not. More... | |
int | motivational_rate () const |
returns the background processing rate this was constructed with. More... | |
basis::outcome | enqueue (infoton *to_chow, const octopus_request_id &item_id) |
holds onto infotons coming from the octopus for backgrounding. More... | |
infoton * | next_request (octopus_request_id &item_id) |
pops out the next queued request for processing. More... | |
bool | store_product (infoton *product, const octopus_request_id &original_id) |
used by tentacles to store the objects they produce from infotons. More... | |
void | attach_storage (entity_data_bin &storage) |
used when a tentacle is being integrated with an octopus. More... | |
void | detach_storage () |
unhooks the storage bin from this tentacle. More... | |
entity_data_bin * | get_storage () |
returns the current pointer, which might be nil. More... | |
void | propel_arm () |
invoked by our thread to cause requests to be processed. More... | |
Additional Inherited Members | |
Public Types inherited from octopi::tentacle | |
enum | constants { DEFAULT_RATE = 40 } |
enum | outcomes { OKAY = basis::common::OKAY , NOT_FOUND = basis::common::NOT_FOUND , ALREADY_EXISTS = basis::common::EXISTING , BAD_INPUT = basis::common::BAD_INPUT , NO_SPACE = basis::common::NO_SPACE , GARBAGE = basis::common::GARBAGE , DISALLOWED = basis::common::DISALLOWED , NO_HANDLER = basis::common::NO_HANDLER , PARTIAL = basis::common::PARTIAL , ENCRYPTION_MISMATCH = basis::common::ENCRYPTION_MISMATCH } |
Static Public Member Functions inherited from octopi::tentacle | |
static const char * | outcome_name (const basis::outcome &to_name) |
returns the textual form of the outcome "to_name". More... | |
Processes the encryption_infoton object for setting up an encrypted channel.
NOTE: to use encryption, both the client and the server need to have an encryption_tentacle added as a filter. it should be the first filter added by users and it must be before any security tentacles (otherwise, the security info would not be encrypted). further, an unwrapping_tentacle (see encryption_wrapper.h) must also be added. it must not be added as a filter. this is what allows the octopus to reconstitute the encoded infotons when encryption is active.
Definition at line 40 of file encryption_tentacle.h.
octopi::encryption_tentacle::encryption_tentacle | ( | ) |
this tentacle will implement the server side.
it will expect only to see public keys from clients and to respond with encrypted blowfish keys.
Definition at line 41 of file encryption_tentacle.cpp.
octopi::encryption_tentacle::encryption_tentacle | ( | const basis::byte_array & | rsa_key | ) |
this is the client side tentacle.
it will only deal with unwrapping a server's response with the encrypted blowfish key. the "rsa_key" is the private key that will be used for decrypting the key response.
Definition at line 50 of file encryption_tentacle.cpp.
octopi::encryption_tentacle::encryption_tentacle | ( | int | key_size | ) |
automatically creates a private key of the "key_size".
this is for use by the client side's encryption needs.
Definition at line 59 of file encryption_tentacle.cpp.
|
virtual |
Definition at line 68 of file encryption_tentacle.cpp.
References basis::WHACK().
|
virtual |
the base class handles the processing of the request in "to_chow".
it will generally perform all the services needed to start the encrypted connection up. the "transformed" array will be filled with the actual infoton if decryption is successful. if the outcome is ENCRYPTION_MISMATCH, then the infoton is not encrypted but was expected to be.
Implements octopi::tentacle.
Definition at line 96 of file encryption_tentacle.cpp.
References octopi::octopus_request_id::_entity, octopi::octenc_key_record::_key, octopi::encryption_wrapper::_wrapped, octopi::key_repository::add(), octopi::encryption_infoton::clone(), crypto::blowfish_crypto::decrypt(), octopi::tentacle::DISALLOWED, octopi::tentacle::ENCRYPTION_MISMATCH, octopi::encryption_infoton::extract_response(), FUNCDEF, octopi::key_repository::lock(), LOG, octopi::octopus_entity::mangled_form(), octopi::tentacle::NO_SPACE, octopi::tentacle::OKAY, octopi::tentacle::PARTIAL, octopi::encryption_infoton::prepare_blowfish_key(), basis::array< contents >::reset(), octopi::tentacle::store_product(), and octopi::key_repository::unlock().
Referenced by cromp::cromp_client::decrypt_package_as_needed(), and cromp::cromp_client::login().
octopi::encryption_tentacle::DEFINE_CLASS_NAME | ( | "encryption_tentacle" | ) |
|
virtual |
throws out any keys we were maintaining for this entity.
Implements octopi::tentacle.
Definition at line 89 of file encryption_tentacle.cpp.
key_repository & octopi::encryption_tentacle::keys | ( | ) | const |
provides access to our list of keys.
this is very private info, but it's needed for encrypting items going back to the client.
Definition at line 74 of file encryption_tentacle.cpp.
Referenced by cromp::cromp_client::login(), and cromp::cromp_server::wrap_infoton().
const rsa_crypto & octopi::encryption_tentacle::private_key | ( | ) | const |
provides access to the key held here.
this is an important object; do not expose it externally.
Definition at line 76 of file encryption_tentacle.cpp.
Referenced by cromp::cromp_client::login().
|
virtual |
recreates a "reformed" infoton from a packed form.
the "classifier" is provided as well as the packed infoton data in "packed_form". this will only succeed if the classifier's first name is understood here.
Reimplemented from octopi::tentacle_helper< encryption_infoton >.
Definition at line 79 of file encryption_tentacle.cpp.
References octopi::encryption_infoton::encryption_classifier(), octopi::tentacle::NO_HANDLER, NULL_POINTER, and octopi::reconstituter().