Rev 224 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 224 | Rev 277 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | * See the License for the specific language governing permissions and |
16 | * See the License for the specific language governing permissions and |
17 | * limitations under the License. |
17 | * limitations under the License. |
18 | */ |
18 | */ |
19 | 19 | ||
20 | if (!defined('IN_OIDPLUS')) die(); |
- | |
21 | - | ||
22 | class OIDplusAuthPluginSha3SaltedBase64 extends OIDplusAuthPlugin { |
20 | class OIDplusAuthPluginSha3SaltedBase64 extends OIDplusAuthPlugin { |
23 | public static function getPluginInformation() { |
- | |
24 | $out = array(); |
- | |
25 | $out['name'] = 'SHA3 salted hash (base64 notation)'; |
- | |
26 | $out['author'] = 'ViaThinkSoft'; |
- | |
27 | $out['version'] = null; |
- | |
28 | $out['descriptionHTML'] = |
- | |
29 | '<p>This auth method is the default method OIDplus uses for new passwords</p>'. |
- | |
30 | '<p>The format is:</p>'. |
- | |
31 | '<p><code>A2#X</code> with X being <code>sha3{base64}(salt+password)</code></p>'; |
- | |
32 | return $out; |
- | |
33 | } |
21 | |
34 | public function verify($authKey, $salt, $check_password) { |
22 | public function verify($authKey, $salt, $check_password) { |
35 | @list($s_authmethod, $s_authkey) = explode('#', $authKey, 2); |
23 | @list($s_authmethod, $s_authkey) = explode('#', $authKey, 2); |
36 | 24 | ||
37 | if ($s_authmethod == 'A2') { |
25 | if ($s_authmethod == 'A2') { |
38 | // Default OIDplus 2.0 behavior |
26 | // Default OIDplus 2.0 behavior |
Line 43... | Line 31... | ||
43 | return false; |
31 | return false; |
44 | } |
32 | } |
45 | 33 | ||
46 | return hash_equals($calc_authkey, $s_authkey); |
34 | return hash_equals($calc_authkey, $s_authkey); |
47 | } |
35 | } |
- | 36 | ||
48 | } |
37 | } |