function _acquia_agent_hmac in Acquia Connector 6
Same name and namespace in other branches
- 6.2 acquia_agent/acquia_agent_streams.inc \_acquia_agent_hmac()
- 7.3 acquia_agent/acquia_agent.module \_acquia_agent_hmac()
- 7 acquia_agent/acquia_agent.module \_acquia_agent_hmac()
- 7.2 acquia_agent/acquia_agent.module \_acquia_agent_hmac()
Calculates a HMAC-SHA1 according to RFC2104 (http://www.ietf.org/rfc/rfc2104.txt). With addition of xmlrpc params.
4 calls to _acquia_agent_hmac()
- acquia_agent_valid_response in acquia_agent/
acquia_agent_streams.inc - Determine if a response from the Acquia Network is valid.
- _acquia_agent_authenticator in acquia_agent/
acquia_agent_streams.inc - Creates an authenticator based on xmlrpc params and a HMAC-SHA1.
- _acquia_agent_call_provision_freetrial in acquia_agent/
acquia_agent.pages.inc - Helper function that creates a new AN subscription via xmlrpc call. It stores id/key if success and sets page error otherwise
- _acquia_agent_create_authenticator in acquia_agent/
acquia_agent.pages.inc - Helper function. Creates an authenticator for xmlrpc calls
File
- acquia_agent/
acquia_agent_streams.inc, line 332 - XML-RPC communication functions for Acquia communication.
Code
function _acquia_agent_hmac($key, $time, $nonce, $params) {
return base64_encode(pack("H*", sha1((str_pad($key, 64, chr(0x0)) ^ str_repeat(chr(0x5c), 64)) . pack("H*", sha1((str_pad($key, 64, chr(0x0)) ^ str_repeat(chr(0x36), 64)) . $time . ':' . $nonce . ':' . $key . ':' . serialize($params))))));
}