.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Crypt::U2F::Server 3pm" .TH Crypt::U2F::Server 3pm "2018-11-02" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Crypt::U2F::Server \- Low level wrapper around the U2F two factor authentication C library (server side) .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Crypt::U2F::Server; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a very low level wrapper around the original C library. You probably \fBshouldn't\fR use it, but use Crypt::U2F::Server::Simple instead! .PP This \s-1API\s0 is subject to change, depending on the underlying library, the weather and the whims of the developer. .PP 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. .SH "INSTALLATION" .IX Header "INSTALLATION" This module requires the Yubico u2f\-server shared library installed, please see the official project page at on how to do that. .SH "NO MULTITHREADING / MULTI INSTANCES" .IX Header "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 \s-1OK,\s0 though, if you only call \fBu2fclib_init()\fR after forking, but this isn't tested as of yet. .PP The problem is how \fBu2fclib_init()\fR and \fBu2fclib_deInit()\fR are implemented. While the underlying library has a context-handle (not used here), \fBu2fclib_deInit()\fR will tear down everything as far as i can tell. .PP Crypt::U2F::Server::Simple works around this problem by reference counting and always requiring all values to call the relevant u2fclib_set* functions. .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" None by default. .SS "Exportable functions" .IX Subsection "Exportable functions" .Vb 10 \& 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) .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" See Crypt::U2F::Server::Simple for the module you should actually be using. .SH "BUGS" .IX Header "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). .PP Also, at the moment, this module has seen only very limited testing. .SH "AUTHOR" .IX Header "AUTHOR" .IP "Rene Schickbauer, " 4 .IX Item "Rene Schickbauer, " .PD 0 .IP "Xavier Guimard, " 4 .IX Item "Xavier Guimard, " .PD .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Adapted as a Perl library by Rene 'cavac' Schickbauer .PP This roughly based on u2f\-server.c from Yubico's C library, see .PP In order for this to work, you need to install that library. .PP This adaption is (C) 2014\-2018 Rene 'cavac' Schickbauer and 2018 Xavier Guimard, but as it is based on Yubico's code, the licence below applies! .PP \&\fIWe, the community, would hereby thank Yubico for open sourcing their code!\fR .PP .Vb 10 \& /* \& * Copyright (c) 2014 Yubico AB \& * All rights reserved. \& * \& * Redistribution and use in source and binary forms, with or without \& * modification, are permitted provided that the following conditions are \& * met: \& * \& * * Redistributions of source code must retain the above copyright \& * notice, this list of conditions and the following disclaimer. \& * \& * * Redistributions in binary form must reproduce the above \& * copyright notice, this list of conditions and the following \& * disclaimer in the documentation and/or other materials provided \& * with the distribution. \& * \& * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \& * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \& * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR \& * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \& * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \& * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \& * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, \& * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY \& * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \& * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \& * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \& */ .Ve