Subversion Repositories oidplus

Rev

Rev 1267 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1267 Rev 1293
Line 56... Line 56...
56
                if ($actionID == 'verify_pubkey') return true;
56
                if ($actionID == 'verify_pubkey') return true;
57
                return parent::csrfUnlock($actionID);
57
                return parent::csrfUnlock($actionID);
58
        }
58
        }
59
 
59
 
60
        /**
60
        /**
61
         * @param string $actionID
61
         * This action is called by the ViaThinkSoft server in order to verify that the system is in the ownership of the correct private key
62
         * @param array $params
62
         * @param array $params
63
         * @return array
63
         * @return array
64
         * @throws OIDplusException
64
         * @throws OIDplusException
65
         */
65
         */
66
        public function action(string $actionID, array $params): array {
66
        private function action_VerifyPubKey(array $params): array {
67
                if ($actionID == 'verify_pubkey') {
-
 
68
                        // This action is called by the ViaThinkSoft server in order to verify that the system is in the ownership of the correct private key
-
 
69
 
-
 
70
                        _CheckParamExists($params, 'challenge');
67
                _CheckParamExists($params, 'challenge');
71
 
68
 
72
                        $payload = 'oidplus-verify-pubkey:'.sha3_512($params['challenge']);
69
                $payload = 'oidplus-verify-pubkey:'.sha3_512($params['challenge']);
73
 
70
 
74
                        $signature = '';
71
                $signature = '';
Line 78... Line 75...
78
 
75
 
79
                        return array(
76
                return array(
80
                                "status" => 0,
77
                        "status" => 0,
81
                                "response" => base64_encode($signature)
78
                        "response" => base64_encode($signature)
82
                        );
79
                );
-
 
80
        }
-
 
81
 
-
 
82
        /**
-
 
83
         * @param string $actionID
-
 
84
         * @param array $params
-
 
85
         * @return array
-
 
86
         * @throws OIDplusException
-
 
87
         */
-
 
88
        public function action(string $actionID, array $params): array {
-
 
89
                if ($actionID == 'verify_pubkey') {
-
 
90
                        return $this->action_VerifyPubKey($params);
83
                } else {
91
                } else {
84
                        return parent::action($actionID, $params);
92
                        return parent::action($actionID, $params);
85
                }
93
                }
86
        }
94
        }
87
 
95