Package common :: Module stanza_session :: Class EncryptedStanzaSession
[hide private]
[frames] | no frames]

Class EncryptedStanzaSession

source code


An encrypted stanza negotiation has several states. They arerepresented as the following values in the 'status' attribute of the session object:

  1. None:

    default state

  2. 'requested-e2e':

    this client has initiated an esession negotiation and is waiting for a response

  3. 'responded-e2e':

    this client has responded to an esession negotiation request and is waiting for the initiator to identify itself and complete the negotiation

  4. 'identified-alice':

    this client identified itself and is waiting for the responder to identify itself and complete the negotiation

  5. 'active':

    an encrypted session has been successfully negotiated. messages of any of the types listed in 'encryptable_stanzas' should be encrypted before they're sent.

The transition between these states is handled in gajim.py's handle_session_negotiation method.

Instance Methods [hide private]
 
__init__(self, conn, jid, thread_id, type_='chat')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_get_contact(self) source code
 
_is_buggy_gajim(self) source code
 
set_kc_s(self, value)
Keep the encrypter updated with my latest cipher key
source code
 
get_kc_s(self) source code
 
set_kc_o(self, value)
Keep the decrypter updated with the other party's latest cipher key
source code
 
get_kc_o(self) source code
 
encryptcounter(self) source code
 
decryptcounter(self) source code
 
sign(self, string) source code
 
encrypt_stanza(self, stanza) source code
 
is_xep_200_encrypted(self, msg) source code
 
hmac(self, key, content) source code
 
generate_initiator_keys(self, k) source code
 
generate_responder_keys(self, k) source code
 
compress(self, plaintext) source code
 
decompress(self, compressed) source code
 
encrypt(self, encryptable) source code
 
decrypt_stanza(self, stanza)
Delete the unencrypted explanation body, if it exists
source code
 
decrypt(self, ciphertext) source code
 
logging_preference(self) source code
 
get_shared_secret(self, e, y, p) source code
 
c7lize_mac_id(self, form) source code
 
verify_identity(self, form, dh_i, sigmai, i_o) source code
 
make_identity(self, form, dh_i) source code
 
negotiate_e2e(self, sigmai) source code
 
verify_options_bob(self, form)
4.3 esession response (bob)
source code
 
respond_e2e_bob(self, form, negotiated, not_acceptable)
4.3 esession response (bob)
source code
 
verify_options_alice(self, form)
'Alice Accepts'
source code
 
accept_e2e_alice(self, form, negotiated)
'Alice Accepts', continued
source code
 
accept_e2e_bob(self, form)
4.5 esession accept (bob)
source code
 
final_steps_alice(self, form) source code
 
do_retained_secret(self, k, old_srs)
Calculate the new retained secret.
source code
 
_verified_srs_cb(self) source code
 
_unverified_srs_cb(self) source code
 
make_dhfield(self, modp_options, sigmai) source code
 
terminate_e2e(self) source code
 
acknowledge_termination(self) source code
 
fail_bad_negotiation(self, reason, fields=None)
Send an error and cancels everything
source code
 
cancelled_negotiation(self)
A negotiation has been cancelled, so reset this session to its default state
source code

Inherited from StanzaSession: generate_thread_id, get_to, is_loggable, reject_negotiation, remove_events, send, terminate

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  kc_s = property(get_kc_s, set_kc_s)
  kc_o = property(get_kc_o, set_kc_o)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, conn, jid, thread_id, type_='chat')
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

_get_contact(self)

source code 

_is_buggy_gajim(self)

source code 

set_kc_s(self, value)

source code 
Keep the encrypter updated with my latest cipher key

get_kc_s(self)

source code 

set_kc_o(self, value)

source code 
Keep the decrypter updated with the other party's latest cipher key

get_kc_o(self)

source code 

encryptcounter(self)

source code 

decryptcounter(self)

source code 

sign(self, string)

source code 

encrypt_stanza(self, stanza)

source code 

is_xep_200_encrypted(self, msg)

source code 

hmac(self, key, content)

source code 

generate_initiator_keys(self, k)

source code 

generate_responder_keys(self, k)

source code 

compress(self, plaintext)

source code 

decompress(self, compressed)

source code 

encrypt(self, encryptable)

source code 

decrypt_stanza(self, stanza)

source code 
Delete the unencrypted explanation body, if it exists

decrypt(self, ciphertext)

source code 

logging_preference(self)

source code 

get_shared_secret(self, e, y, p)

source code 

c7lize_mac_id(self, form)

source code 

verify_identity(self, form, dh_i, sigmai, i_o)

source code 

make_identity(self, form, dh_i)

source code 

negotiate_e2e(self, sigmai)

source code 

verify_options_bob(self, form)

source code 
4.3 esession response (bob)

respond_e2e_bob(self, form, negotiated, not_acceptable)

source code 
4.3 esession response (bob)

verify_options_alice(self, form)

source code 
'Alice Accepts'

accept_e2e_alice(self, form, negotiated)

source code 
'Alice Accepts', continued

accept_e2e_bob(self, form)

source code 
4.5 esession accept (bob)

final_steps_alice(self, form)

source code 

do_retained_secret(self, k, old_srs)

source code 
Calculate the new retained secret. determine if the user needs to check the remote party's identity. Set up callbacks for when the identity has been verified

_verified_srs_cb(self)

source code 

_unverified_srs_cb(self)

source code 

make_dhfield(self, modp_options, sigmai)

source code 

terminate_e2e(self)

source code 

acknowledge_termination(self)

source code 
Overrides: StanzaSession.acknowledge_termination

fail_bad_negotiation(self, reason, fields=None)

source code 

Send an error and cancels everything

If fields is None, the remote party has given us a bad cryptographic value of some kind. Otherwise, list the fields we haven't implemented.

cancelled_negotiation(self)

source code 
A negotiation has been cancelled, so reset this session to its default state
Overrides: StanzaSession.cancelled_negotiation
(inherited documentation)

Class Variable Details [hide private]

kc_s

Value:
property(get_kc_s, set_kc_s)

kc_o

Value:
property(get_kc_o, set_kc_o)