summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-11-22 11:21:57 (GMT)
committercatch2012-11-22 11:21:57 (GMT)
commit2e7f67b0b741d51a58d2d2807cc076796567ee7e (patch)
treed41daed6eb48e0e072271fdf1920c5039c2874ab
parentca820c7ef4172cb1266dea0920d77a8d0108e85b (diff)
Issue #1826190 by vijaycs85, Lukas von Blarer, alexpott: Covert mac_key() variable to CMI system.
-rw-r--r--core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php3
-rw-r--r--core/modules/openid/tests/openid_test.install17
-rw-r--r--core/modules/openid/tests/openid_test.module4
3 files changed, 4 insertions, 20 deletions
diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php
index b0c940e..71c6f02 100644
--- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php
+++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php
@@ -356,6 +356,7 @@ class OpenIDFunctionalTest extends OpenIDTestBase {
* Tests that openid.signed is verified.
*/
function testSignatureValidation() {
+ module_load_include('inc', 'openid');
// Use a User-supplied Identity that is the URL of an XRDS document.
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
@@ -372,7 +373,7 @@ class OpenIDFunctionalTest extends OpenIDTestBase {
// Sign all mandatory fields and a custom field.
$keys_to_sign = array('op_endpoint', 'claimed_id', 'identity', 'return_to', 'response_nonce', 'assoc_handle', 'foo');
$association = new stdClass();
- $association->mac_key = variable_get('mac_key');
+ $association->mac_key = NULL;
$response = array(
'openid.op_endpoint' => url('openid-test/endpoint', array('absolute' => TRUE)),
'openid.claimed_id' => $identity,
diff --git a/core/modules/openid/tests/openid_test.install b/core/modules/openid/tests/openid_test.install
deleted file mode 100644
index 3bd4978..0000000
--- a/core/modules/openid/tests/openid_test.install
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-
-/**
- * @file
- * Install, update and uninstall functions for the openid_test module.
- */
-
-/**
- * Implements hook_install().
- */
-function openid_test_install() {
- module_load_include('inc', 'openid');
- // Generate a MAC key (Message Authentication Code) used for signing messages.
- // The variable is base64-encoded, because variables cannot contain non-UTF-8
- // data.
- variable_set('openid_test_mac_key', base64_encode(_openid_get_bytes(20)));
-}
diff --git a/core/modules/openid/tests/openid_test.module b/core/modules/openid/tests/openid_test.module
index 719d48c..5fe64cf 100644
--- a/core/modules/openid/tests/openid_test.module
+++ b/core/modules/openid/tests/openid_test.module
@@ -271,7 +271,7 @@ function _openid_test_endpoint_associate() {
$shared = _openid_math_powmod($cpub, $private, $mod);
// Encrypt the MAC key using the shared secret.
- $enc_mac_key = base64_encode(_openid_dh_xorsecret($shared, base64_decode(variable_get('mac_key'))));
+ $enc_mac_key = base64_encode(_openid_dh_xorsecret($shared, NULL));
// Generate response including our public key and the MAC key. Using our
// public key and its own private key, the Relying Party can calculate the
@@ -343,7 +343,7 @@ function _openid_test_endpoint_authenticate() {
// Sign the message using the MAC key that was exchanged during association.
$association = new stdClass();
- $association->mac_key = variable_get('mac_key');
+ $association->mac_key = NULL;
if (!isset($response['openid.sig'])) {
$response['openid.sig'] = _openid_signature($association, $response, $keys_to_sign);
}