ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
Association.php File Reference

Go to the source code of this file.

Data Structures

class  Auth_OpenID_Association
 
class  Auth_OpenID_SessionNegotiator
 

Namespaces

 OpenID
 This module contains code for dealing with associations between consumers and servers.
 

Functions

 Auth_OpenID_getSecretSize ($assoc_type)
 
 Auth_OpenID_getAllAssociationTypes ()
 
 Auth_OpenID_getSupportedAssociationTypes ()
 
 Auth_OpenID_getSessionTypes ($assoc_type)
 
 Auth_OpenID_checkSessionType ($assoc_type, $session_type)
 
 Auth_OpenID_getDefaultAssociationOrder ()
 
 Auth_OpenID_getOnlyEncryptedOrder ()
 
 Auth_OpenID_getDefaultNegotiator ()
 
 Auth_OpenID_getEncryptedNegotiator ()
 

Function Documentation

◆ Auth_OpenID_checkSessionType()

Auth_OpenID_checkSessionType (   $assoc_type,
  $session_type 
)

Definition at line 421 of file Association.php.

References Auth_OpenID_getSessionTypes().

Referenced by Auth_OpenID_SessionNegotiator\addAllowedType(), and Auth_OpenID_SessionNegotiator\setAllowedTypes().

422 {
423  if (!in_array($session_type,
424  Auth_OpenID_getSessionTypes($assoc_type))) {
425  return false;
426  }
427 
428  return true;
429 }
Auth_OpenID_getSessionTypes($assoc_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Auth_OpenID_getAllAssociationTypes()

Auth_OpenID_getAllAssociationTypes ( )

Definition at line 392 of file Association.php.

393 {
394  return array('HMAC-SHA1', 'HMAC-SHA256');
395 }

◆ Auth_OpenID_getDefaultAssociationOrder()

Auth_OpenID_getDefaultAssociationOrder ( )

Definition at line 431 of file Association.php.

References Auth_OpenID_noMathSupport().

Referenced by Auth_OpenID_getDefaultNegotiator(), and Auth_OpenID_getOnlyEncryptedOrder().

432 {
433  $order = array();
434 
435  if (!Auth_OpenID_noMathSupport()) {
436  $order[] = array('HMAC-SHA1', 'DH-SHA1');
437 
438  if (Auth_OpenID_HMACSHA256_SUPPORTED) {
439  $order[] = array('HMAC-SHA256', 'DH-SHA256');
440  }
441  }
442 
443  $order[] = array('HMAC-SHA1', 'no-encryption');
444 
445  if (Auth_OpenID_HMACSHA256_SUPPORTED) {
446  $order[] = array('HMAC-SHA256', 'no-encryption');
447  }
448 
449  return $order;
450 }
Auth_OpenID_noMathSupport()
Definition: BigMath.php:447
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Auth_OpenID_getDefaultNegotiator()

Auth_OpenID_getDefaultNegotiator ( )

Definition at line 472 of file Association.php.

References Auth_OpenID_getDefaultAssociationOrder().

Referenced by Auth_OpenID_GenericConsumer\Auth_OpenID_GenericConsumer(), and Auth_OpenID_Server\Auth_OpenID_Server().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Auth_OpenID_getEncryptedNegotiator()

Auth_OpenID_getEncryptedNegotiator ( )

Definition at line 478 of file Association.php.

References Auth_OpenID_getOnlyEncryptedOrder().

+ Here is the call graph for this function:

◆ Auth_OpenID_getOnlyEncryptedOrder()

Auth_OpenID_getOnlyEncryptedOrder ( )

Definition at line 452 of file Association.php.

References $result, and Auth_OpenID_getDefaultAssociationOrder().

Referenced by Auth_OpenID_getEncryptedNegotiator().

453 {
454  $result = array();
455 
456  foreach (Auth_OpenID_getDefaultAssociationOrder() as $pair) {
457  list($assoc, $session) = $pair;
458 
459  if ($session != 'no-encryption') {
460  if (Auth_OpenID_HMACSHA256_SUPPORTED &&
461  ($assoc == 'HMAC-SHA256')) {
462  $result[] = $pair;
463  } else if ($assoc != 'HMAC-SHA256') {
464  $result[] = $pair;
465  }
466  }
467  }
468 
469  return $result;
470 }
$result
Auth_OpenID_getDefaultAssociationOrder()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Auth_OpenID_getSecretSize()

Auth_OpenID_getSecretSize (   $assoc_type)

Definition at line 381 of file Association.php.

Referenced by Auth_OpenID_Signatory\createAssociation().

382 {
383  if ($assoc_type == 'HMAC-SHA1') {
384  return 20;
385  } else if ($assoc_type == 'HMAC-SHA256') {
386  return 32;
387  } else {
388  return null;
389  }
390 }
+ Here is the caller graph for this function:

◆ Auth_OpenID_getSessionTypes()

Auth_OpenID_getSessionTypes (   $assoc_type)

Definition at line 408 of file Association.php.

References Auth_OpenID\arrayGet().

Referenced by Auth_OpenID_SessionNegotiator\addAllowedType(), Auth_OpenID_checkSessionType(), and Auth_OpenID_SessionNegotiator\isAllowed().

409 {
410  $assoc_to_session = array(
411  'HMAC-SHA1' => array('DH-SHA1', 'no-encryption'));
412 
413  if (Auth_OpenID_HMACSHA256_SUPPORTED) {
414  $assoc_to_session['HMAC-SHA256'] =
415  array('DH-SHA256', 'no-encryption');
416  }
417 
418  return Auth_OpenID::arrayGet($assoc_to_session, $assoc_type, array());
419 }
static arrayGet($arr, $key, $fallback=null)
Convenience function for getting array values.
Definition: OpenID.php:242
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Auth_OpenID_getSupportedAssociationTypes()

Auth_OpenID_getSupportedAssociationTypes ( )

Definition at line 397 of file Association.php.

Referenced by Auth_OpenID_Association\Auth_OpenID_Association().

398 {
399  $a = array('HMAC-SHA1');
400 
401  if (Auth_OpenID_HMACSHA256_SUPPORTED) {
402  $a[] = 'HMAC-SHA256';
403  }
404 
405  return $a;
406 }
+ Here is the caller graph for this function: