OPAL  Version 3.18.8
IAX2IeCallToken Class Reference

#include <ies.h>

Inheritance diagram for IAX2IeCallToken:
Collaboration diagram for IAX2IeCallToken:

Public Member Functions

 IAX2IeCallToken (BYTE length, BYTE *srcData)
 
 IAX2IeCallToken ()
 
virtual void PrintOn (ostream &str) const
 
virtual BYTE GetKeyValue () const
 
virtual void StoreDataIn (IAX2IeData &res)
 
void WriteKeySequence (PIPSocket::Address &remoteAddress)
 
- Public Member Functions inherited from IAX2IeBinary
 IAX2IeBinary (BYTE length, BYTE *srcData)
 
 IAX2IeBinary (PBYTEArray newValue)
 
 IAX2IeBinary ()
 
virtual BYTE GetLengthOfData () const
 
void SetData (const PBYTEArray &newData)
 
void GetData (PBYTEArray &answer)
 
void CopyData (IAX2IeBinary *src)
 
- Public Member Functions inherited from IAX2Ie
 IAX2Ie ()
 
virtual ~IAX2Ie ()
 
virtual PBoolean IsValid ()
 
int GetBinarySize () const
 
void SetData (int &)
 
int ReadData ()
 
void WriteBinary (void *data, PINDEX &writeIndex)
 

Static Public Member Functions

static void InitialiseKey ()
 
static PBoolean ValidKeySequence (IAX2IeCallToken &cf, PIPSocket::Address &remote)
 
- Static Public Member Functions inherited from IAX2Ie
static IAX2IeBuildInformationElement (BYTE _typeCode, BYTE length, BYTE *srcData)
 

Protected Types

enum  { iKeyValue = 0x36, oKeyValue = 0x5c, blockSize = 64 }
 

Static Protected Member Functions

static PString ReportKeySequence (const PString &time, PIPSocket::Address &remote)
 

Static Protected Attributes

static PString secretKey
 
static BYTE iKeyPad [blockSize]
 
static BYTE oKeyPad [blockSize]
 

Additional Inherited Members

- Public Types inherited from IAX2Ie
enum  IAX2IeTypeCode {
  ie_calledNumber = 1, ie_callingNumber = 2, ie_callingAni = 3, ie_callingName = 4,
  ie_calledContext = 5, ie_userName = 6, ie_password = 7, ie_capability = 8,
  ie_format = 9, ie_language = 10, ie_version = 11, ie_adsicpe = 12,
  ie_dnid = 13, ie_authMethods = 14, ie_challenge = 15, ie_md5Result = 16,
  ie_rsaResult = 17, ie_apparentAddr = 18, ie_refresh = 19, ie_dpStatus = 20,
  ie_callNo = 21, ie_cause = 22, ie_iaxUnknown = 23, ie_msgCount = 24,
  ie_autoAnswer = 25, ie_musicOnHold = 26, ie_transferId = 27, ie_rdnis = 28,
  ie_provisioning = 29, ie_aesProvisioning = 30, ie_dateTime = 31, ie_deviceType = 32,
  ie_serviceIdent = 33, ie_firmwareVer = 34, ie_fwBlockDesc = 35, ie_fwBlockData = 36,
  ie_provVer = 37, ie_callingPres = 38, ie_callingTon = 39, ie_callingTns = 40,
  ie_samplingRate = 41, ie_causeCode = 42, ie_encryption = 43, ie_encKey = 44,
  ie_codecPrefs = 45, ie_recJitter = 46, ie_recLoss = 47, ie_recPackets = 48,
  ie_recDelay = 49, ie_recDropped = 50, ie_recOoo = 51, ie_variable = 52,
  ie_ospToken = 53, ie_callToken = 54, ie_capability2 = 55, ie_format2 = 56,
  ie_countEntries
}
 
- Protected Member Functions inherited from IAX2IeBinary
virtual void WriteBinary (BYTE *data)
 
- Protected Attributes inherited from IAX2IeBinary
PBYTEArray dataValue
 
- Protected Attributes inherited from IAX2Ie
PBoolean validData
 

Detailed Description

An Information Element that contains the Call Token - a mechanism to stop DOS attacks through setting up lots of calls

The IAX2IeCallToken uses the HMAC SHA1 algorithm to secure the challenge message sent to the initiating computer. With this approach, it is not feasible for spoofing etc of the reply. You can readup on hmac-sha1 at http://en.wikipedia.org/wiki/HMAC

Member Enumeration Documentation

anonymous enum
protected

The internal size of the hmac sha1 key, which the protocol sets at 64 bytes, as this is a 512 bit hash

Enumerator
iKeyValue 

Speced in protocol, an ambiguitating value

oKeyValue 

Same as iKeyValue, bitwise is very different.

blockSize 

Size of the cypher. 64 bytes = 512 bits.

Constructor & Destructor Documentation

IAX2IeCallToken::IAX2IeCallToken ( BYTE  length,
BYTE *  srcData 
)
inline
Constructor from data read from the network.  Contents are

undefined if the network data is bogus/invalid

IAX2IeCallToken::IAX2IeCallToken ( )
inline

Build an empty IAX2IeCallToken, which is used in the new packet, as sent by the node initiating a call

Member Function Documentation

virtual BYTE IAX2IeCallToken::GetKeyValue ( ) const
inlinevirtual

Get the key value for this particular Information Element class

Reimplemented from IAX2Ie.

References IAX2Ie::ie_callToken.

static void IAX2IeCallToken::InitialiseKey ( )
static

Initialise the internal key, and the iKeyPad and oKeyPad variables, for the generation of the SHA1-HMAC keysequence. This initialisation happens once, at program startup.

virtual void IAX2IeCallToken::PrintOn ( ostream &  str) const
virtual

print this class (nicely) to the designated stream

Reimplemented from IAX2IeBinary.

static PString IAX2IeCallToken::ReportKeySequence ( const PString &  time,
PIPSocket::Address &  remote 
)
staticprotected

Report the key sequence that should be built, provided the supplied time string and address

virtual void IAX2IeCallToken::StoreDataIn ( IAX2IeData res)
inlinevirtual

Take the data from this IAX2Ie, and copy it into the IAX2IeData structure. This is done on processing an incoming frame which contains IAX2Ie in the data section.

Reimplemented from IAX2Ie.

References IAX2IeData::callToken, and IAX2IeBinary::dataValue.

static PBoolean IAX2IeCallToken::ValidKeySequence ( IAX2IeCallToken cf,
PIPSocket::Address &  remote 
)
static

Examine the hash key sequence in the supplied IE, and see if it is valid.

void IAX2IeCallToken::WriteKeySequence ( PIPSocket::Address &  remoteAddress)

Fill with a hash key sequence, that we will later verify

Field Documentation

BYTE IAX2IeCallToken::iKeyPad[blockSize]
staticprotected

Used for generating the SHA1-HMAC hash. Initialised at program startup, saves on time later.

BYTE IAX2IeCallToken::oKeyPad[blockSize]
staticprotected

Similar to the iKeyPad, an internal variable

PString IAX2IeCallToken::secretKey
staticprotected

The key used in generating the SHA1-HMAC hash. Key is required for handling incoming calls


The documentation for this class was generated from the following file: