ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
Auth_OpenID_DiffieHellmanSHA1ServerSession Class Reference
+ Inheritance diagram for Auth_OpenID_DiffieHellmanSHA1ServerSession:
+ Collaboration diagram for Auth_OpenID_DiffieHellmanSHA1ServerSession:

Public Member Functions

 Auth_OpenID_DiffieHellmanSHA1ServerSession ($dh, $consumer_pubkey)
 
 answer ($secret)
 

Static Public Member Functions

static getDH ($message)
 
static fromMessage ($message)
 

Data Fields

 $session_type = 'DH-SHA1'
 An object that knows how to handle association requests with the Diffie-Hellman session type. More...
 
 $needs_math = true
 
 $allowed_assoc_types = array('HMAC-SHA1')
 
 $hash_func = 'Auth_OpenID_SHA1'
 

Detailed Description

Definition at line 455 of file Server.php.

Member Function Documentation

◆ answer()

Auth_OpenID_DiffieHellmanSHA1ServerSession::answer (   $secret)

Definition at line 539 of file Server.php.

References Auth_OpenID_getMathLib().

540  {
541  $lib = Auth_OpenID_getMathLib();
542  $mac_key = $this->dh->xorSecret($this->consumer_pubkey, $secret,
543  $this->hash_func);
544  return array(
545  'dh_server_public' =>
546  $lib->longToBase64($this->dh->public),
547  'enc_mac_key' => base64_encode($mac_key));
548  }
Auth_OpenID_getMathLib()
Definition: BigMath.php:400
+ Here is the call graph for this function:

◆ Auth_OpenID_DiffieHellmanSHA1ServerSession()

Auth_OpenID_DiffieHellmanSHA1ServerSession::Auth_OpenID_DiffieHellmanSHA1ServerSession (   $dh,
  $consumer_pubkey 
)

Definition at line 466 of file Server.php.

467  {
468  $this->dh = $dh;
469  $this->consumer_pubkey = $consumer_pubkey;
470  }

◆ fromMessage()

static Auth_OpenID_DiffieHellmanSHA1ServerSession::fromMessage (   $message)
static

Definition at line 526 of file Server.php.

References $result, and getDH().

527  {
529 
530  if (is_a($result, 'Auth_OpenID_ServerError')) {
531  return $result;
532  } else {
533  list($dh, $consumer_pubkey) = $result;
535  $consumer_pubkey);
536  }
537  }
$result
Auth_OpenID_DiffieHellmanSHA1ServerSession($dh, $consumer_pubkey)
Definition: Server.php:466
+ Here is the call graph for this function:

◆ getDH()

static Auth_OpenID_DiffieHellmanSHA1ServerSession::getDH (   $message)
static

Definition at line 472 of file Server.php.

References Auth_OpenID_getMathLib(), Auth_OpenID_OPENID_NS, and Auth_OpenID_ServerError\Auth_OpenID_ServerError().

Referenced by fromMessage(), and Auth_OpenID_DiffieHellmanSHA256ServerSession\fromMessage().

473  {
474  $dh_modulus = $message->getArg(Auth_OpenID_OPENID_NS, 'dh_modulus');
475  $dh_gen = $message->getArg(Auth_OpenID_OPENID_NS, 'dh_gen');
476 
477  if ((($dh_modulus === null) && ($dh_gen !== null)) ||
478  (($dh_gen === null) && ($dh_modulus !== null))) {
479 
480  if ($dh_modulus === null) {
481  $missing = 'modulus';
482  } else {
483  $missing = 'generator';
484  }
485 
486  return new Auth_OpenID_ServerError($message,
487  'If non-default modulus or generator is '.
488  'supplied, both must be supplied. Missing '.
489  $missing);
490  }
491 
492  $lib = Auth_OpenID_getMathLib();
493 
494  if ($dh_modulus || $dh_gen) {
495  $dh_modulus = $lib->base64ToLong($dh_modulus);
496  $dh_gen = $lib->base64ToLong($dh_gen);
497  if ($lib->cmp($dh_modulus, 0) == 0 ||
498  $lib->cmp($dh_gen, 0) == 0) {
499  return new Auth_OpenID_ServerError(
500  $message, "Failed to parse dh_mod or dh_gen");
501  }
502  $dh = new Auth_OpenID_DiffieHellman($dh_modulus, $dh_gen);
503  } else {
504  $dh = new Auth_OpenID_DiffieHellman();
505  }
506 
507  $consumer_pubkey = $message->getArg(Auth_OpenID_OPENID_NS,
508  'dh_consumer_public');
509  if ($consumer_pubkey === null) {
510  return new Auth_OpenID_ServerError($message,
511  'Public key for DH-SHA1 session '.
512  'not found in query');
513  }
514 
515  $consumer_pubkey =
516  $lib->base64ToLong($consumer_pubkey);
517 
518  if ($consumer_pubkey === false) {
519  return new Auth_OpenID_ServerError($message,
520  "dh_consumer_public is not base64");
521  }
522 
523  return array($dh, $consumer_pubkey);
524  }
const Auth_OpenID_OPENID_NS
Definition: Message.php:42
Auth_OpenID_getMathLib()
Definition: BigMath.php:400
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $allowed_assoc_types

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

Definition at line 463 of file Server.php.

◆ $hash_func

Auth_OpenID_DiffieHellmanSHA1ServerSession::$hash_func = 'Auth_OpenID_SHA1'

Definition at line 464 of file Server.php.

◆ $needs_math

Auth_OpenID_DiffieHellmanSHA1ServerSession::$needs_math = true

Definition at line 462 of file Server.php.

◆ $session_type

Auth_OpenID_DiffieHellmanSHA1ServerSession::$session_type = 'DH-SHA1'

An object that knows how to handle association requests with the Diffie-Hellman session type.

Definition at line 461 of file Server.php.


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