Minor: if input OTP is empty and password looks like OTP, now copies password to OTP in memory and treats password field as OTP. Will require patch in Enano trunk to work for html login.
authorDan
Thu, 26 Feb 2009 01:19:45 -0500
changeset 2 6edc6ebb3b39
parent 1 86d41fd204a0
child 3 d0fe7acaf0e8
Minor: if input OTP is empty and password looks like OTP, now copies password to OTP in memory and treats password field as OTP. Will require patch in Enano trunk to work for html login.
plugins/yubikey/auth.php
--- a/plugins/yubikey/auth.php	Thu Feb 26 01:13:25 2009 -0500
+++ b/plugins/yubikey/auth.php	Thu Feb 26 01:19:45 2009 -0500
@@ -19,6 +19,12 @@
   
   $auth_log_prefix = ( $level >= USER_LEVEL_CHPREF ) ? 'admin_' : '';
   
+  // Sort of a hack: if the password looks like an OTP and the OTP field is empty, use the password as the OTP
+  if ( empty($userdata['yubikey_otp']) && preg_match('/^[cbdefghijklnrtuv]{44}$/', $userdata['password'] ) )
+  {
+    $userdata['yubikey_otp'] = $userdata['password'];
+  }
+  
   if ( !empty($userdata['username']) )
   {
     // get flags