Rev 821 | Rev 852 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 821 | Rev 830 | ||
---|---|---|---|
Line 36... | Line 36... | ||
36 | _CheckParamExists($params, 'challenge'); |
36 | _CheckParamExists($params, 'challenge'); |
37 | 37 | ||
38 | $payload = 'oidplus-verify-pubkey:'.sha3_512($params['challenge']); |
38 | $payload = 'oidplus-verify-pubkey:'.sha3_512($params['challenge']); |
39 | 39 | ||
40 | $signature = ''; |
40 | $signature = ''; |
41 | if (!OIDplus::getPkiStatus() || !@openssl_sign($payload, $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
41 | if (!OIDplus::getPkiStatus() || !@openssl_sign($payload, $signature, OIDplus::getSystemPrivateKey())) { |
42 | throw new OIDplusException(_L('Signature failed')); |
42 | throw new OIDplusException(_L('Signature failed')); |
43 | } |
43 | } |
44 | 44 | ||
45 | return array( |
45 | return array( |
46 | "status" => 0, |
46 | "status" => 0, |
Line 145... | Line 145... | ||
145 | "lang" => OIDplus::getCurrentLang(), |
145 | "lang" => OIDplus::getCurrentLang(), |
146 | "system_id" => OIDplus::getSystemId(false) |
146 | "system_id" => OIDplus::getSystemId(false) |
147 | ); |
147 | ); |
148 | 148 | ||
149 | $signature = ''; |
149 | $signature = ''; |
150 | if (!OIDplus::getPkiStatus() || !@openssl_sign(json_encode($payload), $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
150 | if (!OIDplus::getPkiStatus() || !@openssl_sign(json_encode($payload), $signature, OIDplus::getSystemPrivateKey())) { |
151 | throw new OIDplusException(_L('Signature failed')); |
151 | throw new OIDplusException(_L('Signature failed')); |
152 | } |
152 | } |
153 | 153 | ||
154 | $data = array( |
154 | $data = array( |
155 | "payload" => $payload, |
155 | "payload" => $payload, |
Line 249... | Line 249... | ||
249 | "query" => $query, // we must include $query to the payload, because we want to sign it |
249 | "query" => $query, // we must include $query to the payload, because we want to sign it |
250 | "system_id" => OIDplus::getSystemId(false) |
250 | "system_id" => OIDplus::getSystemId(false) |
251 | ); |
251 | ); |
252 | 252 | ||
253 | $signature = ''; |
253 | $signature = ''; |
254 | if (!OIDplus::getPkiStatus() || !@openssl_sign(json_encode($payload), $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
254 | if (!OIDplus::getPkiStatus() || !@openssl_sign(json_encode($payload), $signature, OIDplus::getSystemPrivateKey())) { |
255 | return false; // throw new OIDplusException(_L('Signature failed')); |
255 | return false; // throw new OIDplusException(_L('Signature failed')); |
256 | } |
256 | } |
257 | 257 | ||
258 | $data = array( |
258 | $data = array( |
259 | "payload" => $payload, |
259 | "payload" => $payload, |
Line 335... | Line 335... | ||
335 | } |
335 | } |
336 | $payload = array( |
336 | $payload = array( |
337 | "query" => $query, // we must include $query to the payload, because we want to sign it |
337 | "query" => $query, // we must include $query to the payload, because we want to sign it |
338 | "privacy_level" => $privacy_level, |
338 | "privacy_level" => $privacy_level, |
339 | "system_id" => OIDplus::getSystemId(false), |
339 | "system_id" => OIDplus::getSystemId(false), |
340 | "public_key" => OIDplus::config()->getValue('oidplus_public_key'), |
340 | "public_key" => OIDplus::getSystemPublicKey(), |
341 | "system_url" => $system_url, |
341 | "system_url" => $system_url, |
342 | "hide_system_url" => 0, |
342 | "hide_system_url" => 0, |
343 | "hide_public_key" => 0, |
343 | "hide_public_key" => 0, |
344 | "admin_email" => OIDplus::config()->getValue('admin_email'), |
344 | "admin_email" => OIDplus::config()->getValue('admin_email'), |
345 | "system_title" => OIDplus::config()->getValue('system_title'), |
345 | "system_title" => OIDplus::config()->getValue('system_title'), |
Line 348... | Line 348... | ||
348 | "system_version" => OIDplus::getVersion(), |
348 | "system_version" => OIDplus::getVersion(), |
349 | "system_install_type" => OIDplus::getInstallType() |
349 | "system_install_type" => OIDplus::getInstallType() |
350 | ); |
350 | ); |
351 | 351 | ||
352 | $signature = ''; |
352 | $signature = ''; |
353 | if (!OIDplus::getPkiStatus() || !@openssl_sign(json_encode($payload), $signature, OIDplus::config()->getValue('oidplus_private_key'))) { |
353 | if (!OIDplus::getPkiStatus() || !@openssl_sign(json_encode($payload), $signature, OIDplus::getSystemPrivateKey())) { |
354 | return false; // throw new OIDplusException(_L('Signature failed')); |
354 | return false; // throw new OIDplusException(_L('Signature failed')); |
355 | } |
355 | } |
356 | 356 | ||
357 | $data = array( |
357 | $data = array( |
358 | "payload" => $payload, |
358 | "payload" => $payload, |