Git Product home page Git Product logo

php-yubico's People

Contributors

bjoneill avatar brentboghosian avatar dainnilsson avatar gregorwolf avatar jas4711 avatar jeanpaulgalea avatar klali avatar minisu avatar nrw505 avatar odanielson avatar rjkip avatar rmallensb avatar yubi-david avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-yubico's Issues

Follow PSR-0/1/2

These standards are becoming very prevalent in the PHP community. I wouldn't mind going through and refactoring if you guys don't have the time.

DVORAK mangles key IDs

In parsePasswordOTP, if the user is using the DVORAK keyboard layout, you take care of fixing the OTP, but leave the rest of the values mangled.

This means that if they switch back to a QWERTY based keyboard layout, their key ID will no longer match.

I would suggest something like this instead:

    function parsePasswordOTP($str, $delim = '[:]')
    {
        /* Dvorak? */
        if (preg_match("/^((.*)" . $delim . ")?" .
            "(([jxe.uidchtnbpygkJXE.UIDCHTNBPYGK]{0,16})" .
            "([jxe.uidchtnbpygkJXE.UIDCHTNBPYGK]{32}))$/",
            $str, $matches))
        {
            // Un-mangle the OTP (convert from DVORAK -> QWERTY)
            $str = strtr($str, "jxe.uidchtnbpygk", "cbdefghijklnrtuv");
        }
        if (!preg_match("/^((.*)" . $delim . ")?" .
            "(([cbdefghijklnrtuvCBDEFGHIJKLNRTUV]{0,16})" .
            "([cbdefghijklnrtuvCBDEFGHIJKLNRTUV]{32}))$/",
            $str, $matches))
        {
            return false;
        }
        $ret['otp'] = $matches[3];
        $ret['password'] = $matches[2];
        $ret['prefix'] = $matches[4];
        $ret['ciphertext'] = $matches[5];
        return $ret;
    }

Use of flush() function prevents modification of header

Function function _make_curl_handle($query, $timeout=null) calls function
flush();
This function modifies headers.
And then it is not possible to modify headers (redirect pages etc) in main php code that uses Yubico library.
After validzteing the password I get PHP Warning: Cannot modify header information - headers already sent in /home/benjaminas/new.velsiga.lt/htdocs/login.php on line .
I have traced the problem and that was fush() function.
After commenting this function everything works fine. Authentications works fine and I'm able to modify headers in my main program.

Why does this function needs to flush all the buffer before calling curl?

Auth_Yubico has a deprecated constructor

Hey Guys,
have a note at deprecated warnings.

Rename the file to Auth_Yubico.php and change the Constructor to __construct.

Line: 35
Methods with the same name as their class will not be constructors in a future version of PHP; Auth_Yubico has a deprecated constructor

Silence warnings

The following changes should be made to Auth/Yubico.php to silence some warnings PHP gives with strict error reporting:

$ch[$handle] = $handle;

on line 331 should be

$ch[(int)$handle] = $handle;

and on line 431:

if ($replay) return PEAR::raiseError('REPLAYED_OTP');

should be

if ($replay) return (new PEAR)->raiseError('REPLAYED_OTP');

And finally, line 433:

return (PEAR::raiseError($status);

should be

return ((new PEAR)->raiseError($status);

Packagist/Composer Support

Hello!
I would like to integrate this into my project, I can do so but inconvieniently by manual implementation.
Could the package maintainers please import this project into Packagist for everyone, making installing the library a composer require yubico/php-yubico away?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.