Method: OpenID::Consumer::DiffieHellmanSession#extract_secret

Defined in:
lib/openid/consumer/associationmanager.rb

#extract_secret(response) ⇒ Object

Process the response from a successful association request and return the shared secret for this association



39
40
41
42
43
44
45
46
47
# File 'lib/openid/consumer/associationmanager.rb', line 39

def extract_secret(response)
  dh_server_public64 = response.get_arg(OPENID_NS, 'dh_server_public',
                                        NO_DEFAULT)
  enc_mac_key64 = response.get_arg(OPENID_NS, 'enc_mac_key', NO_DEFAULT)
  dh_server_public = CryptUtil.base64_to_num(dh_server_public64)
  enc_mac_key = Util.from_base64(enc_mac_key64)
  return @dh.xor_secret(self.class.hashfunc,
                        dh_server_public, enc_mac_key)
end