From 2b6d451b11a1c2bec9468ec858f125bf8bba32d8 Mon Sep 17 00:00:00 2001
From: Lukas von Blarer <lukas.vonblarer@gmail.com>
Date: Sun, 4 Nov 2012 16:25:19 +0100
Subject: [PATCH] #1826190: Covert mac_key variable to CMI system

---
 core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php | 2 +-
 core/modules/openid/tests/openid_test.install                        | 2 +-
 core/modules/openid/tests/openid_test.module                         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php
index 525e64d..351d012 100644
--- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php
+++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php
@@ -362,7 +362,7 @@ function testSignatureValidation() {
     // 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 = state()->get('openid_test.mac_key');
     $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
index 3bd4978..6f10236 100644
--- a/core/modules/openid/tests/openid_test.install
+++ b/core/modules/openid/tests/openid_test.install
@@ -13,5 +13,5 @@ function openid_test_install() {
   // 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)));
+  state()->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 89f3ddf..08db77c 100644
--- a/core/modules/openid/tests/openid_test.module
+++ b/core/modules/openid/tests/openid_test.module
@@ -339,7 +339,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 = state()->get('openid_test.mac_key');
   if (!isset($response['openid.sig'])) {
     $response['openid.sig'] = _openid_signature($association, $response, $keys_to_sign);
   }
-- 
1.7.11.1

