Package Peach :: Package Generators :: Module stun :: Class StunMessageIntegrityAttribute
[hide private]

Class StunMessageIntegrityAttribute

source code


MESSAGE-INTEGRITY

The MESSAGE-INTEGRITY attribute contains an HMAC-SHA1 [13] of the STUN message. It can be present in Binding Requests or Binding Responses. Since it uses the SHA1 hash, the HMAC will be 20 bytes. The text used as input to HMAC is the STUN message, including the header, up to and including the attribute preceding the MESSAGE- INTEGRITY attribute. That text is then padded with zeroes so as to be a multiple of 64 bytes. As a result, the MESSAGE-INTEGRITY attribute MUST be the last attribute in any STUN message. The key used as input to HMAC depends on the context.

Instance Methods [hide private]
 
__init__(self, group, hmac) source code

Inherited from StunAttribute: getRawValue

Inherited from StunAttribute (private): _getValue

Class Variables [hide private]

Inherited from StunAttribute: CHANGED_ADDRESS, CHANGE_REQUEST, ERROR_CODE, MAPPED_ADDRESS, MESSAGE_INTEGRITY, PASSWORD, REFLECTED_FROM, RESPONSE_ADDRESS, SOURCE_ADDRESS, UNKNOWN_ATTRIBUTES, USERNAME

Inherited from StunAttribute (private): _generator, _length, _type

Method Details [hide private]

__init__(self, group, hmac)
(Constructor)

source code 
Parameters:
  • group (Group) - Group to use
  • hmac (Generator) - HMAC-SHA1
Overrides: StunAttribute.__init__