Package pyrad :: Module packet :: Class AuthPacket
[show private | hide private]
[frames | no frames]

Class AuthPacket

UserDict --+    
           |    
      Packet --+
               |
              AuthPacket


Method Summary
  __init__(self, code, id, secret, authenticator, **attributes)
Constructor
  CreateReply(self, **attributes)
string PwCrypt(self, password)
Obfuscate password
string PwDecrypt(self, password)
Unobfuscate a RADIUS password
string RequestPacket(self)
Create a ready-to-transmit authentication request packet
    Inherited from Packet
  __getitem__(self, key)
  __setitem__(self, key, item)
  AddAttribute(self, key, value)
Add an attribute to the packet.
string CreateAuthenticator(self)
Create a packet autenticator.
integer CreateID(self)
Create a packet ID
  DecodePacket(self, packet)
Initialize the object from raw packet data.
  has_key(self, key)
  keys(self)
string ReplyPacket(self)
Create a ready-to-transmit authentication reply packet
  VerifyReply(self, reply, rawreply)
    Inherited from UserDict
  __cmp__(self, dict)
  __contains__(self, key)
  __delitem__(self, key)
  __len__(self)
  __repr__(self)
  clear(self)
  copy(self)
  fromkeys(cls, iterable, value)
(Class method)
  get(self, key, failobj)
  items(self)
  iteritems(self)
  iterkeys(self)
  itervalues(self)
  pop(self, key, *args)
  popitem(self)
  setdefault(self, key, failobj)
  update(self, dict)
  values(self)

Instance Method Details

__init__(self, code=1, id=None, secret='', authenticator=None, **attributes)
(Constructor)

Constructor
Parameters:
code - packet type code
           (type=integer (8bits))
id - packet identifaction number
           (type=integer (8 bits))
secret - secret needed to communicate with a RADIUS server
           (type=string)
Overrides:
pyrad.packet.Packet.__init__

PwCrypt(self, password)

Obfuscate password

RADIUS hides passwords in packets by using an algorithm based on the MD5 hash of the pacaket authenticator and RADIUS secret. If no authenticator has been set before calling PwCrypt one is created automatically. Changing the authenticator after setting a password that has been encrypted using this function will not work.
Parameters:
password - plaintext password
           (type=string)
Returns:
obfuscated version of the password
           (type=string)

PwDecrypt(self, password)

Unobfuscate a RADIUS password

RADIUS hides passwords in packets by using an algorithm based on the MD5 hash of the pacaket authenticator and RADIUS secret. This function reverses the obfuscation process.
Parameters:
password - obfuscated form of password
           (type=string)
Returns:
plaintext password
           (type=string)

RequestPacket(self)

Create a ready-to-transmit authentication request packet

Return a RADIUS packet which can be directly transmitted to a RADIUS server.
Returns:
raw packet
           (type=string)

Generated by Epydoc 2.1 on Wed Jun 2 14:19:55 2004 http://epydoc.sf.net