Commit 6d0feef5 authored by Simon Josefsson's avatar Simon Josefsson

Imported Upstream version 0.0.4

parent c9e6322a
2015-01-22 Simon Josefsson <simon@josefsson.org>
* Makefile.am: Typo.
2015-01-22 Simon Josefsson <simon@josefsson.org>
* NEWS: Version 0.0.4.
2015-01-22 Simon Josefsson <simon@josefsson.org>
* maint.mk: Update gnulib files.
2015-01-22 Simon Josefsson <simon@josefsson.org>
* src/u2f-host.c, u2f-host/b64/cdecode.h, u2f-host/b64/cencode.h,
u2f-host/cdecode.c, u2f-host/cencode.c, u2f-host/devs.c,
u2f-host/inc/u2f.h, u2f-host/inc/u2f_hid.h, u2f-host/internal.h,
u2f-host/u2fmisc.c: Indent.
2015-01-22 Simon Josefsson <simon@josefsson.org>
* NEWS: Add NEWS item.
2015-01-20 Klas Lindfors <klas@yubico.com>
* u2f-host/u2fmisc.c: add an exponential growing timeout for slow
devices relates yubico/pam-u2f#5
2015-01-20 Klas Lindfors <klas@yubico.com>
* NEWS, configure.ac: bump versions after release
2015-01-08 Simon Josefsson <simon@josefsson.org>
* NEWS: Version 0.0.3.
......
......@@ -47,7 +47,6 @@ my-release:
gpg --detach-sign $(PACKAGE)-$(VERSION).tar.xz
gpg --detach-sign $(PACKAGE)-$(VERSION)-win32.zip
gpg --detach-sign $(PACKAGE)-$(VERSION)-win64.zip
gpg --verify $(PACKAGE)-$(VERSION).tar.xz.sig
gpg --verify $(PACKAGE)-$(VERSION)-win32.zip.sig
gpg --verify $(PACKAGE)-$(VERSION)-win64.zip.sig
......
......@@ -99,9 +99,9 @@ DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog THANKS \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in $(dist_udevrules_DATA) COPYING \
build-aux/ar-lib build-aux/compile build-aux/config.guess \
build-aux/config.sub build-aux/install-sh build-aux/missing \
build-aux/ltmain.sh $(top_srcdir)/build-aux/ar-lib \
$(top_srcdir)/build-aux/compile \
build-aux/config.sub build-aux/depcomp build-aux/install-sh \
build-aux/missing build-aux/ltmain.sh \
$(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \
$(top_srcdir)/build-aux/config.guess \
$(top_srcdir)/build-aux/config.sub \
$(top_srcdir)/build-aux/install-sh \
......@@ -1065,7 +1065,6 @@ my-release:
gpg --detach-sign $(PACKAGE)-$(VERSION).tar.xz
gpg --detach-sign $(PACKAGE)-$(VERSION)-win32.zip
gpg --detach-sign $(PACKAGE)-$(VERSION)-win64.zip
gpg --verify $(PACKAGE)-$(VERSION).tar.xz.sig
gpg --verify $(PACKAGE)-$(VERSION)-win32.zip.sig
gpg --verify $(PACKAGE)-$(VERSION)-win64.zip.sig
......
Copyright (C) 2013-2015 Yubico AB. Licensed under GPLv3+.
Copyright (C) 2013-2015 Yubico AB. Licensed under GPLv3+ . -*- outline -*-
* Version 0.0.4 (released 2015-01-22)
** Add an exponential growing timeout for slow devices (PlugUp).
* Version 0.0.3 (released 2015-01-08)
** Change license to LGPLv2+ for the library.
** Some improvements to internal communication code.
** Some debug mode improvements, from Bram Vandoren.
** Change license to LGPLv2+ for the library.
** Some improvements to internal communication code.
** Some debug mode improvements, from Bram Vandoren.
* Version 0.0.2 (released 2014-11-28)
** Add more devices to udev.
** Add more devices to udev.
* Version 0.0.1 (released 2014-10-29)
** Use semantic versioning.
** Correct json key for keyHandle in signResponse
** Fix the udev rule
** Add option to install udev rule
** Use semantic versioning.
** Correct json key for keyHandle in signResponse
** Fix the udev rule
** Add option to install udev rule
* Version 0.0 (released 2014-09-16)
** Initial release.
** Initial release.
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libu2f-host 0.0.3.
# Generated by GNU Autoconf 2.69 for libu2f-host 0.0.4.
#
# Report bugs to <yubico-devel@googlegroups.com>.
#
......@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libu2f-host'
PACKAGE_TARNAME='libu2f-host'
PACKAGE_VERSION='0.0.3'
PACKAGE_STRING='libu2f-host 0.0.3'
PACKAGE_VERSION='0.0.4'
PACKAGE_STRING='libu2f-host 0.0.4'
PACKAGE_BUGREPORT='yubico-devel@googlegroups.com'
PACKAGE_URL=''
......@@ -1491,7 +1491,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libu2f-host 0.0.3 to adapt to many kinds of systems.
\`configure' configures libu2f-host 0.0.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1561,7 +1561,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libu2f-host 0.0.3:";;
short | recursive ) echo "Configuration of libu2f-host 0.0.4:";;
esac
cat <<\_ACEOF
......@@ -1691,7 +1691,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libu2f-host configure 0.0.3
libu2f-host configure 0.0.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -2297,7 +2297,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libu2f-host $as_me 0.0.3, which was
It was created by libu2f-host $as_me 0.0.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -2685,7 +2685,7 @@ LT_CURRENT=0
# Interfaces removed: CURRENT++, AGE=0, REVISION=0
LT_AGE=0
# Interfaces added: CURRENT++, AGE++, REVISION=0
LT_REVISION=3
LT_REVISION=4
# No interfaces changed: REVISION++
am__api_version='1.14'
......@@ -3174,7 +3174,7 @@ fi
# Define the identity of the package.
PACKAGE='libu2f-host'
VERSION='0.0.3'
VERSION='0.0.4'
cat >>confdefs.h <<_ACEOF
......@@ -16917,7 +16917,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libu2f-host $as_me 0.0.3, which was
This file was extended by libu2f-host $as_me 0.0.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -16987,7 +16987,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libu2f-host config.status 0.0.3
libu2f-host config.status 0.0.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
......@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([libu2f-host], [0.0.3], [yubico-devel@googlegroups.com])
AC_INIT([libu2f-host], [0.0.4], [yubico-devel@googlegroups.com])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
......@@ -21,7 +21,7 @@ AC_CONFIG_AUX_DIR([build-aux])
# http://www.gnu.org/s/libtool/manual/html_node/Updating-version-info.html
AC_SUBST(LT_CURRENT, 0) # Interfaces removed: CURRENT++, AGE=0, REVISION=0
AC_SUBST(LT_AGE, 0) # Interfaces added: CURRENT++, AGE++, REVISION=0
AC_SUBST(LT_REVISION, 3) # No interfaces changed: REVISION++
AC_SUBST(LT_REVISION, 4) # No interfaces changed: REVISION++
AM_INIT_AUTOMAKE([gnits dist-xz no-dist-gzip std-options -Wall])
AM_SILENT_RULES([yes])
......
......@@ -121,7 +121,7 @@ run-time library does not meet the required version number.</p>
<a name="u2f-host-u2f-host-version.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="U2FH-VERSION-STRING:CAPS"></a><h3>U2FH_VERSION_STRING</h3>
<pre class="programlisting">#define U2FH_VERSION_STRING "0.0.3"
<pre class="programlisting">#define U2FH_VERSION_STRING "0.0.4"
</pre>
<p>Pre-processor symbol with a string that describe the header file
version number. Used together with <a class="link" href="u2f-host-u2f-host-version.html#u2fh-check-version" title="u2fh_check_version ()"><code class="function">u2fh_check_version()</code></a> to verify
......@@ -130,7 +130,7 @@ header file and run-time library consistency.</p>
<hr>
<div class="refsect2">
<a name="U2FH-VERSION-NUMBER:CAPS"></a><h3>U2FH_VERSION_NUMBER</h3>
<pre class="programlisting">#define U2FH_VERSION_NUMBER 0x000003
<pre class="programlisting">#define U2FH_VERSION_NUMBER 0x000004
</pre>
<p>Pre-processor symbol with a hexadecimal value describing the header
file version number. For example, when the header version is 1.2.3
......@@ -158,7 +158,7 @@ header version is 1.2.3 this symbol will be 2.</p>
<hr>
<div class="refsect2">
<a name="U2FH-VERSION-PATCH:CAPS"></a><h3>U2FH_VERSION_PATCH</h3>
<pre class="programlisting">#define U2FH_VERSION_PATCH 3
<pre class="programlisting">#define U2FH_VERSION_PATCH 4
</pre>
<p>Pre-processor symbol with a decimal value that describe the patch
level of the header file version number. For example, when the
......
No preview for this file type
......@@ -1648,14 +1648,14 @@ _gl_tight_scope: $(bin_PROGRAMS)
perl -lne \
'$(_gl_TS_function_match) and print "^$$1\$$"' $$hdr; \
) | sort -u > $$t; \
nm -e $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \
nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \
&& { echo the above functions should have static scope >&2; \
exit 1; } || : ; \
( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \
perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' \
$$hdr $(_gl_TS_other_headers) \
) | sort -u > $$t; \
nm -e $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \
nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \
| sort -u | grep -Ev -f $$t \
&& { echo the above variables should have static scope >&2; \
exit 1; } || :
......
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.46.4.
.TH LIBU2F-HOST "1" "January 2015" "libu2f-host 0.0.3" "User Commands"
.TH LIBU2F-HOST "1" "January 2015" "libu2f-host 0.0.4" "User Commands"
.SH NAME
libu2f-host \- Yubico Universal 2nd Factor (U2F) Host Tool
.SH SYNOPSIS
.B libu2f-host
[\fI\,OPTIONS\/\fR]...
.SH DESCRIPTION
libu2f\-host 0.0.3
libu2f\-host 0.0.4
.PP
Perform U2F host\-side operations on the command line. Reads challenge from
standard input and writes a response to standard output.
......
......@@ -58,21 +58,24 @@ main (int argc, char *argv[])
rc = u2fh_global_init (args_info.debug_flag ? U2FH_DEBUG : 0);
if (rc != U2FH_OK)
{
fprintf (stderr, "error: u2fh_global_init (%d): %s\n", rc, u2fh_strerror (rc));
fprintf (stderr, "error: u2fh_global_init (%d): %s\n", rc,
u2fh_strerror (rc));
exit (EXIT_FAILURE);
}
rc = u2fh_devs_init (&devs);
if (rc != U2FH_OK)
{
fprintf (stderr, "error: u2fh_devs_init (%d): %s\n", rc, u2fh_strerror (rc));
fprintf (stderr, "error: u2fh_devs_init (%d): %s\n", rc,
u2fh_strerror (rc));
goto done;
}
rc = u2fh_devs_discover (devs, NULL);
if (rc != U2FH_OK)
{
fprintf (stderr, "error: u2fh_devs_discover (%d): %s\n", rc, u2fh_strerror (rc));
fprintf (stderr, "error: u2fh_devs_discover (%d): %s\n", rc,
u2fh_strerror (rc));
goto done;
}
......
......@@ -27,19 +27,20 @@ For details, see http://sourceforge.net/projects/libb64
typedef enum
{
step_a, step_b, step_c, step_d
step_a, step_b, step_c, step_d
} base64_decodestep;
typedef struct
{
base64_decodestep step;
char plainchar;
base64_decodestep step;
char plainchar;
} base64_decodestate;
void base64_init_decodestate(base64_decodestate* state_in);
void base64_init_decodestate (base64_decodestate * state_in);
int base64_decode_value(char value_in);
int base64_decode_value (char value_in);
int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in);
int base64_decode_block (const char *code_in, const int length_in,
char *plaintext_out, base64_decodestate * state_in);
#endif /* BASE64_CDECODE_H */
......@@ -27,22 +27,23 @@ For details, see http://sourceforge.net/projects/libb64
typedef enum
{
step_A, step_B, step_C
step_A, step_B, step_C
} base64_encodestep;
typedef struct
{
base64_encodestep step;
char result;
int stepcount;
base64_encodestep step;
char result;
int stepcount;
} base64_encodestate;
void base64_init_encodestate(base64_encodestate* state_in);
void base64_init_encodestate (base64_encodestate * state_in);
char base64_encode_value(char value_in);
char base64_encode_value (char value_in);
int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);
int base64_encode_block (const char *plaintext_in, int length_in,
char *code_out, base64_encodestate * state_in);
int base64_encode_blockend(char* code_out, base64_encodestate* state_in);
int base64_encode_blockend (char *code_out, base64_encodestate * state_in);
#endif /* BASE64_CENCODE_H */
......@@ -26,81 +26,101 @@ For details, see http://sourceforge.net/projects/libb64
#include <b64/cdecode.h>
int base64_decode_value(char value_in)
int
base64_decode_value (char value_in)
{
static const char decoding[] = {62,-1,-1,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,63,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
static const char decoding_size = sizeof(decoding);
value_in -= 45;
if (value_in < 0 || value_in >= decoding_size) return -1;
return decoding[(int)value_in];
static const char decoding[] =
{ 62, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -2, -1,
-1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25,
-1, -1, -1, -1, 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51
};
static const char decoding_size = sizeof (decoding);
value_in -= 45;
if (value_in < 0 || value_in >= decoding_size)
return -1;
return decoding[(int) value_in];
}
void base64_init_decodestate(base64_decodestate* state_in)
void
base64_init_decodestate (base64_decodestate * state_in)
{
state_in->step = step_a;
state_in->plainchar = 0;
state_in->step = step_a;
state_in->plainchar = 0;
}
int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in)
int
base64_decode_block (const char *code_in, const int length_in,
char *plaintext_out, base64_decodestate * state_in)
{
const char* codechar = code_in;
char* plainchar = plaintext_out;
char fragment;
*plainchar = state_in->plainchar;
switch (state_in->step)
const char *codechar = code_in;
char *plainchar = plaintext_out;
char fragment;
*plainchar = state_in->plainchar;
switch (state_in->step)
{
while (1)
{
while (1)
case step_a:
do
{
if (codechar == code_in + length_in)
{
state_in->step = step_a;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char) base64_decode_value (*codechar++);
}
while (fragment < 0);
*plainchar = (fragment & 0x03f) << 2;
case step_b:
do
{
if (codechar == code_in + length_in)
{
state_in->step = step_b;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char) base64_decode_value (*codechar++);
}
while (fragment < 0);
*plainchar++ |= (fragment & 0x030) >> 4;
*plainchar = (fragment & 0x00f) << 4;
case step_c:
do
{
if (codechar == code_in + length_in)
{
state_in->step = step_c;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char) base64_decode_value (*codechar++);
}
while (fragment < 0);
*plainchar++ |= (fragment & 0x03c) >> 2;
*plainchar = (fragment & 0x003) << 6;
case step_d:
do
{
if (codechar == code_in + length_in)
{
case step_a:
do {
if (codechar == code_in+length_in)
{
state_in->step = step_a;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char)base64_decode_value(*codechar++);
} while (fragment < 0);
*plainchar = (fragment & 0x03f) << 2;
case step_b:
do {
if (codechar == code_in+length_in)
{
state_in->step = step_b;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char)base64_decode_value(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x030) >> 4;
*plainchar = (fragment & 0x00f) << 4;
case step_c:
do {
if (codechar == code_in+length_in)
{
state_in->step = step_c;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char)base64_decode_value(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x03c) >> 2;
*plainchar = (fragment & 0x003) << 6;
case step_d:
do {
if (codechar == code_in+length_in)
{
state_in->step = step_d;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char)base64_decode_value(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x03f);
state_in->step = step_d;
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
fragment = (char) base64_decode_value (*codechar++);
}
while (fragment < 0);
*plainchar++ |= (fragment & 0x03f);
}
/* control should not reach here */
return plainchar - plaintext_out;
}
/* control should not reach here */
return plainchar - plaintext_out;
}
......@@ -28,100 +28,107 @@ For details, see http://sourceforge.net/projects/libb64
const int CHARS_PER_LINE = 72;
void base64_init_encodestate(base64_encodestate* state_in)
void
base64_init_encodestate (base64_encodestate * state_in)
{
state_in->step = step_A;
state_in->result = 0;
state_in->stepcount = 0;
state_in->step = step_A;
state_in->result = 0;
state_in->stepcount = 0;
}
char base64_encode_value(char value_in)
char
base64_encode_value (char value_in)
{
static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
if (value_in > 63) return '=';
return encoding[(int)value_in];
static const char *encoding =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
if (value_in > 63)
return '=';
return encoding[(int) value_in];
}
int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in)
int
base64_encode_block (const char *plaintext_in, int length_in, char *code_out,
base64_encodestate * state_in)
{
const char* plainchar = plaintext_in;
const char* const plaintextend = plaintext_in + length_in;
char* codechar = code_out;
char result;
char fragment;
result = state_in->result;
switch (state_in->step)
const char *plainchar = plaintext_in;
const char *const plaintextend = plaintext_in + length_in;
char *codechar = code_out;
char result;
char fragment;
result = state_in->result;
switch (state_in->step)
{
while (1)
{
while (1)
{
case step_A:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_A;
return codechar - code_out;
}
fragment = *plainchar++;
result = (fragment & 0x0fc) >> 2;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x003) << 4;
case step_B:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_B;
return codechar - code_out;
}
fragment = *plainchar++;
result |= (fragment & 0x0f0) >> 4;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x00f) << 2;
case step_C:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_C;
return codechar - code_out;
}
fragment = *plainchar++;
result |= (fragment & 0x0c0) >> 6;
*codechar++ = base64_encode_value(result);
result = (fragment & 0x03f) >> 0;
*codechar++ = base64_encode_value(result);
++(state_in->stepcount);
if (state_in->stepcount == CHARS_PER_LINE/4)
{
/* *codechar++ = '\n'; */
state_in->stepcount = 0;
}
}
case step_A:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_A;
return codechar - code_out;
}
fragment = *plainchar++;
result = (fragment & 0x0fc) >> 2;
*codechar++ = base64_encode_value (result);
result = (fragment & 0x003) << 4;
case step_B:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_B;
return codechar - code_out;
}
fragment = *plainchar++;
result |= (fragment & 0x0f0) >> 4;
*codechar++ = base64_encode_value (result);
result = (fragment & 0x00f) << 2;
case step_C:
if (plainchar == plaintextend)
{
state_in->result = result;
state_in->step = step_C;
return codechar - code_out;
}
fragment = *plainchar++;
result |= (fragment & 0x0c0) >> 6;
*codechar++ = base64_encode_value (result);
result = (fragment & 0x03f) >> 0;
*codechar++ = base64_encode_value (result);
++(state_in->stepcount);
if (state_in->stepcount == CHARS_PER_LINE / 4)
{
/* *codechar++ = '\n'; */
state_in->stepcount = 0;
}
}
/* control should not reach here */
return codechar - code_out;
}
/* control should not reach here */
return codechar - code_out;
}
int base64_encode_blockend(char* code_out, base64_encodestate* state_in)
int
base64_encode_blockend (char *code_out, base64_encodestate * state_in)
{
char* codechar = code_out;
switch (state_in->step)
{
case step_B:
*codechar++ = base64_encode_value(state_in->result);
*codechar++ = '=';
*codechar++ = '=';
break;
case step_C:
*codechar++ = base64_encode_value(state_in->result);
*codechar++ = '=';
break;
case step_A:
break;
}
*codechar++ = '\0';
return codechar - code_out;
char *codechar = code_out;
switch (state_in->step)
{
case step_B:
*codechar++ = base64_encode_value (state_in->result);
*codechar++ = '=';
*codechar++ = '=';
break;
case step_C:
*codechar++ = base64_encode_value (state_in->result);
*codechar++ = '=';
break;
case step_A:
break;
}
*codechar++ = '\0';
return codechar - code_out;
}
......@@ -354,8 +354,7 @@ u2fh_devs_discover (u2fh_devs * devs, unsigned *max_index)
dev->versionInterface,
dev->versionMajor,
dev->versionMinor,
dev->versionBuild,
dev->capFlags);
dev->versionBuild, dev->capFlags);
}
}
res = U2FH_OK;
......
......@@ -21,115 +21,121 @@
#ifndef __U2F_H_INCLUDED__
#define __U2F_H_INCLUDED__
#ifdef _MSC_VER // Windows
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#ifdef _MSC_VER // Windows
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long int uint64_t;