ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
Auth_OpenID_DiffieHellmanSHA1ConsumerSession Class Reference
+ Inheritance diagram for Auth_OpenID_DiffieHellmanSHA1ConsumerSession:
+ Collaboration diagram for Auth_OpenID_DiffieHellmanSHA1ConsumerSession:

Public Member Functions

 Auth_OpenID_DiffieHellmanSHA1ConsumerSession ($dh=null)
 
 getRequest ()
 
 extractSecret ($response)
 

Data Fields

 $session_type = 'DH-SHA1'
 
 $hash_func = 'Auth_OpenID_SHA1'
 
 $secret_size = 20
 
 $allowed_assoc_types = array('HMAC-SHA1')
 

Detailed Description

Definition at line 453 of file Consumer.php.

Member Function Documentation

◆ Auth_OpenID_DiffieHellmanSHA1ConsumerSession()

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::Auth_OpenID_DiffieHellmanSHA1ConsumerSession (   $dh = null)

Definition at line 459 of file Consumer.php.

460  {
461  if ($dh === null) {
462  $dh = new Auth_OpenID_DiffieHellman();
463  }
464 
465  $this->dh = $dh;
466  }

◆ extractSecret()

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::extractSecret (   $response)

Definition at line 487 of file Consumer.php.

References Auth_OpenID_getMathLib(), and Auth_OpenID_OPENID_NS.

488  {
489  if (!$response->hasKey(Auth_OpenID_OPENID_NS,
490  'dh_server_public')) {
491  return null;
492  }
493 
494  if (!$response->hasKey(Auth_OpenID_OPENID_NS,
495  'enc_mac_key')) {
496  return null;
497  }
498 
499  $math = Auth_OpenID_getMathLib();
500 
501  $spub = $math->base64ToLong($response->getArg(Auth_OpenID_OPENID_NS,
502  'dh_server_public'));
503  $enc_mac_key = base64_decode($response->getArg(Auth_OpenID_OPENID_NS,
504  'enc_mac_key'));
505 
506  return $this->dh->xorSecret($spub, $enc_mac_key, $this->hash_func);
507  }
const Auth_OpenID_OPENID_NS
Definition: Message.php:42
Auth_OpenID_getMathLib()
Definition: BigMath.php:400
+ Here is the call graph for this function:

◆ getRequest()

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::getRequest ( )

Definition at line 468 of file Consumer.php.

References Auth_OpenID_getMathLib().

469  {
470  $math = Auth_OpenID_getMathLib();
471 
472  $cpub = $math->longToBase64($this->dh->public);
473 
474  $args = array('dh_consumer_public' => $cpub);
475 
476  if (!$this->dh->usingDefaultValues()) {
477  $args = array_merge($args, array(
478  'dh_modulus' =>
479  $math->longToBase64($this->dh->mod),
480  'dh_gen' =>
481  $math->longToBase64($this->dh->gen)));
482  }
483 
484  return $args;
485  }
Auth_OpenID_getMathLib()
Definition: BigMath.php:400
+ Here is the call graph for this function:

Field Documentation

◆ $allowed_assoc_types

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::$allowed_assoc_types = array('HMAC-SHA1')

Definition at line 457 of file Consumer.php.

◆ $hash_func

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::$hash_func = 'Auth_OpenID_SHA1'

Definition at line 455 of file Consumer.php.

◆ $secret_size

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::$secret_size = 20

Definition at line 456 of file Consumer.php.

◆ $session_type

Auth_OpenID_DiffieHellmanSHA1ConsumerSession::$session_type = 'DH-SHA1'

Definition at line 454 of file Consumer.php.


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