logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Crypt::U2F::Server - Low level wrapper around the U2F two factor authentication C library (server side)

Author

       Rene Schickbauer, <rene.schickbauer@magnapowertrain.com>
       Xavier Guimard, <x.guimard@free.fr>

Bugs

       Yes, there should be some in there. First of all, this is crypto stuff, so it's broken by default (it
       only depends on the time it takes to happen).

       Also, at the moment, this module has seen only very limited testing.

Description

       This is a very low level wrapper around the original C library. You probably shouldn't use it, but use
       Crypt::U2F::Server::Simple instead!

       This API is subject to change, depending on the underlying library, the weather and the whims of the
       developer.

       If you decide to use it anyway, it would probably be a good idea to specify the exact version number of
       Crypt::U2F::Server to use.

Installation

       This module requires the Yubico u2f-server shared library installed, please see the official project page
       at <https://developers.yubico.com/libu2f-server/> on how to do that.

Name

       Crypt::U2F::Server - Low level wrapper around the U2F two factor authentication C library (server side)

No Multithreading / Multi Instances

       The way this is currently implemented, i doubt very much that multithreading or even use in more than one
       instance in your program will work. Multi-Forking should be OK, though, if you only call u2fclib_init()
       after forking, but this isn't tested as of yet.

       The problem is how u2fclib_init() and u2fclib_deInit() are implemented. While the underlying library has
       a context-handle (not used here), u2fclib_deInit() will tear down everything as far as i can tell.

       Crypt::U2F::Server::Simple works around this problem by reference counting and always requiring all
       values to call the relevant u2fclib_set* functions.

   EXPORT
       None by default.

   Exportablefunctions
         char* u2fclib_calcRegistrationChallenge(void* ctx)
         int u2fclib_deInit(void)
         int u2fclib_free_context(void* ctx)
         char* u2fclib_getError(void)
         void* u2fclib_get_context(void)
         int u2fclib_init(bool debug)
         int u2fclib_setAppID(void* ctx, char* appid)
         int u2fclib_setChallenge(void* ctx, char* challenge)
         int u2fclib_setKeyHandle(void* ctx, char* buf)
         int u2fclib_setOrigin(void* ctx, char* origin)
         int u2fclib_setPublicKey(void* ctx, char* buf)
         int u2fclib_verifyAuthentication(void* ctx, char* buf)
         registrationData_t* u2fclib_verifyRegistration(void* ctx, char* buf)

See Also

       See Crypt::U2F::Server::Simple for the module you should actually be using.

Synopsis

         use Crypt::U2F::Server;

See Also