Codebase list ykclient / e11e981
Imported Upstream version 2.15 Simon Josefsson 7 years ago
23 changed file(s) with 552 addition(s) and 516 deletion(s). Raw diff Collapse all Expand all
0 2015-11-12 Klas Lindfors <klas@yubico.com>
1
2 * NEWS: NEWS for 2.15
3
4 2015-11-11 Klas Lindfors <klali@avm.se>
5
6 * : Merge pull request #36 from mikemn/master Add proxy support via Curl
7
8 2015-07-09 Klas Lindfors <klas@yubico.com>
9
10 * ykclient.c: make sure there is always at least one handle found with clang scan-build
11
12 2015-07-05 Klas Lindfors <klas@yubico.com>
13
14 * Makefile.am, configure.ac: add help2adoc for releases
15
16 2015-06-24 Klas Lindfors <klas@yubico.com>
17
18 * configure.ac: bump libtool variables correctly since a symbol was
19 added
20
21 2015-06-24 Klas Lindfors <klas@yubico.com>
22
23 * tool.c: tool: use server response to print out more debug info
24
25 2015-06-24 Klas Lindfors <klas@yubico.com>
26
27 * libykclient.map, ykclient.c, ykclient.h: add an interface to fetch
28 the last server response
29
30 2015-06-24 Klas Lindfors <klas@yubico.com>
31
32 * ykclient.c: add timestamp to the default query
33
34 2015-06-15 Klas Lindfors <klas@yubico.com>
35
36 * tool.c: add --cai to commandline tool help
37
38 2015-03-05 Klas Lindfors <klas@yubico.com>
39
40 * NEWS, configure.ac: bump versions
41
042 2015-03-05 Klas Lindfors <klas@yubico.com>
143
244 * NEWS: NEWS for 2.14
133133 cd $(srcdir) && git tag -u $(KEYID) -m $(VERSION) $(PACKAGE)-$(VERSION)
134134 cd $(srcdir) && git push --tags
135135 $(YUBICO_WWW_REPO)/publish $(PROJECT) $(VERSION) $(PACKAGE)-$(VERSION).tar.gz*
136 $(HELP2ADOC) -e ./ykclient -n "YubiCloud One-Time-Password Validation Client" > ykclient.1.txt
137 $(YUBICO_WWW_REPO)/save-mans $(PROJECT) ykclient.1.txt
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
4444
4545
4646 VPATH = @srcdir@
47 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
47 am__is_gnu_make = { \
48 if test -z '$(MAKELEVEL)'; then \
49 false; \
50 elif test -n '$(MAKE_HOST)'; then \
51 true; \
52 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
53 true; \
54 else \
55 false; \
56 fi; \
57 }
4858 am__make_running_with_option = \
4959 case $${target_option-} in \
5060 ?) ;; \
112122 bin_PROGRAMS = ykclient$(EXEEXT)
113123 @ENABLE_COV_TRUE@am__append_3 = --coverage
114124 subdir = .
115 DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
116 $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
117 $(top_srcdir)/configure $(am__configure_deps) \
118 $(srcdir)/ykclient_version.h.in \
119 $(top_srcdir)/build-aux/depcomp $(dist_man_MANS) \
120 $(include_HEADERS) COPYING build-aux/ar-lib build-aux/compile \
121 build-aux/config.guess build-aux/config.sub build-aux/depcomp \
122 build-aux/install-sh build-aux/missing build-aux/ltmain.sh \
123 $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \
124 $(top_srcdir)/build-aux/config.guess \
125 $(top_srcdir)/build-aux/config.sub \
126 $(top_srcdir)/build-aux/install-sh \
127 $(top_srcdir)/build-aux/ltmain.sh \
128 $(top_srcdir)/build-aux/missing
129125 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
130126 am__aclocal_m4_deps = $(top_srcdir)/m4/ld-version-script.m4 \
131127 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
136132 $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac
137133 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
138134 $(ACLOCAL_M4)
135 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
136 $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON)
139137 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
140138 configure.lineno config.status.lineno
141139 mkinstalldirs = $(install_sh) -d
271269 CTAGS = ctags
272270 CSCOPE = cscope
273271 DIST_SUBDIRS = $(SUBDIRS)
272 am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
273 $(srcdir)/ykclient_version.h.in $(top_srcdir)/build-aux/ar-lib \
274 $(top_srcdir)/build-aux/compile \
275 $(top_srcdir)/build-aux/config.guess \
276 $(top_srcdir)/build-aux/config.sub \
277 $(top_srcdir)/build-aux/depcomp \
278 $(top_srcdir)/build-aux/install-sh \
279 $(top_srcdir)/build-aux/ltmain.sh \
280 $(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \
281 INSTALL NEWS README build-aux/ar-lib build-aux/compile \
282 build-aux/config.guess build-aux/config.sub build-aux/depcomp \
283 build-aux/install-sh build-aux/ltmain.sh build-aux/missing
274284 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
275285 distdir = $(PACKAGE)-$(VERSION)
276286 top_distdir = $(distdir)
340350 EXEEXT = @EXEEXT@
341351 FGREP = @FGREP@
342352 GREP = @GREP@
353 HELP2ADOC = @HELP2ADOC@
343354 HELP2MAN = @HELP2MAN@
344355 INSTALL = @INSTALL@
345356 INSTALL_DATA = @INSTALL_DATA@
489500 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
490501 $(am__cd) $(top_srcdir) && \
491502 $(AUTOMAKE) --gnu Makefile
492 .PRECIOUS: Makefile
493503 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
494504 @case '$?' in \
495505 *config.status*) \
901911 $(am__post_remove_distdir)
902912
903913 dist-tarZ: distdir
904 @echo WARNING: "Support for shar distribution archives is" \
905 "deprecated." >&2
914 @echo WARNING: "Support for distribution archives compressed with" \
915 "legacy program 'compress' is deprecated." >&2
906916 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
907917 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
908918 $(am__post_remove_distdir)
909919
910920 dist-shar: distdir
911 @echo WARNING: "Support for distribution archives compressed with" \
912 "legacy program 'compress' is deprecated." >&2
921 @echo WARNING: "Support for shar distribution archives is" \
922 "deprecated." >&2
913923 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
914924 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
915925 $(am__post_remove_distdir)
945955 esac
946956 chmod -R a-w $(distdir)
947957 chmod u+w $(distdir)
948 mkdir $(distdir)/_build $(distdir)/_inst
958 mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
949959 chmod a-w $(distdir)
950960 test -d $(distdir)/_build || exit 0; \
951961 dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
952962 && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
953963 && am__cwd=`pwd` \
954 && $(am__cd) $(distdir)/_build \
955 && ../configure \
964 && $(am__cd) $(distdir)/_build/sub \
965 && ../../configure \
956966 $(AM_DISTCHECK_CONFIGURE_FLAGS) \
957967 $(DISTCHECK_CONFIGURE_FLAGS) \
958 --srcdir=.. --prefix="$$dc_install_base" \
968 --srcdir=../.. --prefix="$$dc_install_base" \
959969 && $(MAKE) $(AM_MAKEFLAGS) \
960970 && $(MAKE) $(AM_MAKEFLAGS) dvi \
961971 && $(MAKE) $(AM_MAKEFLAGS) check \
11501160 uninstall-binPROGRAMS uninstall-includeHEADERS \
11511161 uninstall-libLTLIBRARIES uninstall-man uninstall-man1
11521162
1163 .PRECIOUS: Makefile
1164
11531165
11541166 ykclient.1: $(builddir)/ykclient $(srcdir)/tool.c $(srcdir)/configure.ac
11551167 $(HELP2MAN) \
12091221 cd $(srcdir) && git tag -u $(KEYID) -m $(VERSION) $(PACKAGE)-$(VERSION)
12101222 cd $(srcdir) && git push --tags
12111223 $(YUBICO_WWW_REPO)/publish $(PROJECT) $(VERSION) $(PACKAGE)-$(VERSION).tar.gz*
1224 $(HELP2ADOC) -e ./ykclient -n "YubiCloud One-Time-Password Validation Client" > ykclient.1.txt
1225 $(YUBICO_WWW_REPO)/save-mans $(PROJECT) ykclient.1.txt
12121226
12131227 # Tell versions [3.59,3.63) of GNU make to not export all variables.
12141228 # Otherwise a system limit (for SysV at least) may be exceeded.
00 Yubikey-c-client NEWS -- History of user-visible changes. -*- outline -*-
1
2 * Version 2.15 (released 2015-11-12)
3
4 ** Add ykclient_get_server_response() to the library.
5
6 ** Show more information from the commandline on debug.
7
8 ** Add proxy support via Curl.
19
210 * Version 2.14 (released 2015-03-05)
311
0 # generated automatically by aclocal 1.14.1 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
0 # generated automatically by aclocal 1.15 -*- Autoconf -*-
1
2 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2121
22 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
22 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
2323 #
2424 # This file is free software; the Free Software Foundation
2525 # gives unlimited permission to copy and/or distribute it,
3131 # generated from the m4 files accompanying Automake X.Y.
3232 # (This private macro should not be called outside this file.)
3333 AC_DEFUN([AM_AUTOMAKE_VERSION],
34 [am__api_version='1.14'
34 [am__api_version='1.15'
3535 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3636 dnl require some minimum version. Point them to the right macro.
37 m4_if([$1], [1.14.1], [],
37 m4_if([$1], [1.15], [],
3838 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3939 ])
4040
5050 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5151 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5252 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53 [AM_AUTOMAKE_VERSION([1.14.1])dnl
53 [AM_AUTOMAKE_VERSION([1.15])dnl
5454 m4_ifndef([AC_AUTOCONF_VERSION],
5555 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5656 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5757
58 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
58 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
5959 #
6060 # This file is free software; the Free Software Foundation
6161 # gives unlimited permission to copy and/or distribute it,
117117
118118 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
119119
120 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
120 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
121121 #
122122 # This file is free software; the Free Software Foundation
123123 # gives unlimited permission to copy and/or distribute it,
162162 # configured tree to be moved without reconfiguration.
163163
164164 AC_DEFUN([AM_AUX_DIR_EXPAND],
165 [dnl Rely on autoconf to set up CDPATH properly.
166 AC_PREREQ([2.50])dnl
167 # expand $ac_aux_dir to an absolute path
168 am_aux_dir=`cd $ac_aux_dir && pwd`
165 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
166 # Expand $ac_aux_dir to an absolute path.
167 am_aux_dir=`cd "$ac_aux_dir" && pwd`
169168 ])
170169
171170 # AM_CONDITIONAL -*- Autoconf -*-
172171
173 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
172 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
174173 #
175174 # This file is free software; the Free Software Foundation
176175 # gives unlimited permission to copy and/or distribute it,
201200 Usually this means the macro was only invoked conditionally.]])
202201 fi])])
203202
204 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
203 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
205204 #
206205 # This file is free software; the Free Software Foundation
207206 # gives unlimited permission to copy and/or distribute it,
392391
393392 # Generate code to set up dependency tracking. -*- Autoconf -*-
394393
395 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
394 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
396395 #
397396 # This file is free software; the Free Software Foundation
398397 # gives unlimited permission to copy and/or distribute it,
468467
469468 # Do all the work for Automake. -*- Autoconf -*-
470469
471 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
470 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
472471 #
473472 # This file is free software; the Free Software Foundation
474473 # gives unlimited permission to copy and/or distribute it,
558557 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
559558 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
560559 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
561 # We need awk for the "check" target. The system "awk" is bad on
562 # some platforms.
560 # We need awk for the "check" target (and possibly the TAP driver). The
561 # system "awk" is bad on some platforms.
563562 AC_REQUIRE([AC_PROG_AWK])dnl
564563 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
565564 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
632631 END
633632 AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
634633 fi
635 fi])
634 fi
635 dnl The trailing newline in this macro's definition is deliberate, for
636 dnl backward compatibility and to allow trailing 'dnl'-style comments
637 dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
638 ])
636639
637640 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
638641 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
661664 done
662665 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
663666
664 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
667 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
665668 #
666669 # This file is free software; the Free Software Foundation
667670 # gives unlimited permission to copy and/or distribute it,
672675 # Define $install_sh.
673676 AC_DEFUN([AM_PROG_INSTALL_SH],
674677 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
675 if test x"${install_sh}" != xset; then
678 if test x"${install_sh+set}" != xset; then
676679 case $am_aux_dir in
677680 *\ * | *\ *)
678681 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
682685 fi
683686 AC_SUBST([install_sh])])
684687
685 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
688 # Copyright (C) 2003-2014 Free Software Foundation, Inc.
686689 #
687690 # This file is free software; the Free Software Foundation
688691 # gives unlimited permission to copy and/or distribute it,
703706
704707 # Check to see how 'make' treats includes. -*- Autoconf -*-
705708
706 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
709 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
707710 #
708711 # This file is free software; the Free Software Foundation
709712 # gives unlimited permission to copy and/or distribute it,
753756
754757 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
755758
756 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
759 # Copyright (C) 1997-2014 Free Software Foundation, Inc.
757760 #
758761 # This file is free software; the Free Software Foundation
759762 # gives unlimited permission to copy and/or distribute it,
792795
793796 # Helper functions for option handling. -*- Autoconf -*-
794797
795 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
798 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
796799 #
797800 # This file is free software; the Free Software Foundation
798801 # gives unlimited permission to copy and/or distribute it,
821824 AC_DEFUN([_AM_IF_OPTION],
822825 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
823826
824 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
827 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
825828 #
826829 # This file is free software; the Free Software Foundation
827830 # gives unlimited permission to copy and/or distribute it,
868871 # For backward compatibility.
869872 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
870873
871 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
874 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
872875 #
873876 # This file is free software; the Free Software Foundation
874877 # gives unlimited permission to copy and/or distribute it,
887890
888891 # Check to make sure that the build environment is sane. -*- Autoconf -*-
889892
890 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
893 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
891894 #
892895 # This file is free software; the Free Software Foundation
893896 # gives unlimited permission to copy and/or distribute it,
968971 rm -f conftest.file
969972 ])
970973
971 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
974 # Copyright (C) 2009-2014 Free Software Foundation, Inc.
972975 #
973976 # This file is free software; the Free Software Foundation
974977 # gives unlimited permission to copy and/or distribute it,
10281031 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10291032 ])
10301033
1031 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1034 # Copyright (C) 2001-2014 Free Software Foundation, Inc.
10321035 #
10331036 # This file is free software; the Free Software Foundation
10341037 # gives unlimited permission to copy and/or distribute it,
10561059 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10571060 AC_SUBST([INSTALL_STRIP_PROGRAM])])
10581061
1059 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
1062 # Copyright (C) 2006-2014 Free Software Foundation, Inc.
10601063 #
10611064 # This file is free software; the Free Software Foundation
10621065 # gives unlimited permission to copy and/or distribute it,
10751078
10761079 # Check how to create a tarball. -*- Autoconf -*-
10771080
1078 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
1081 # Copyright (C) 2004-2014 Free Software Foundation, Inc.
10791082 #
10801083 # This file is free software; the Free Software Foundation
10811084 # gives unlimited permission to copy and/or distribute it,
33 me=ar-lib
44 scriptversion=2012-03-01.08; # UTC
55
6 # Copyright (C) 2010-2013 Free Software Foundation, Inc.
6 # Copyright (C) 2010-2014 Free Software Foundation, Inc.
77 # Written by Peter Rosin <peda@lysator.liu.se>.
88 #
99 # This program is free software; you can redistribute it and/or modify
22
33 scriptversion=2012-10-14.11; # UTC
44
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
66 # Written by Tom Tromey <tromey@cygnus.com>.
77 #
88 # This program is free software; you can redistribute it and/or modify
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright 1992-2013 Free Software Foundation, Inc.
3
4 timestamp='2013-06-10'
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-03-23'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
4949 GNU config.guess ($timestamp)
5050
5151 Originally written by Per Bothner.
52 Copyright 1992-2013 Free Software Foundation, Inc.
52 Copyright 1992-2014 Free Software Foundation, Inc.
5353
5454 This is free software; see the source for copying conditions. There is NO
5555 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
148148 LIBC=gnu
149149 #endif
150150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
152152 ;;
153153 esac
154154
825825 *:MINGW*:*)
826826 echo ${UNAME_MACHINE}-pc-mingw32
827827 exit ;;
828 i*:MSYS*:*)
828 *:MSYS*:*)
829829 echo ${UNAME_MACHINE}-pc-msys
830830 exit ;;
831831 i*:windows32*:*)
968968 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
969969 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
970970 ;;
971 or1k:Linux:*:*)
972 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
973 exit ;;
974 or32:Linux:*:*)
971 openrisc*:Linux:*:*)
972 echo or1k-unknown-linux-${LIBC}
973 exit ;;
974 or32:Linux:*:* | or1k*:Linux:*:*)
975975 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
976976 exit ;;
977977 padre:Linux:*:*)
12591259 if test "$UNAME_PROCESSOR" = unknown ; then
12601260 UNAME_PROCESSOR=powerpc
12611261 fi
1262 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1263 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1264 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1265 grep IS_64BIT_ARCH >/dev/null
1266 then
1267 case $UNAME_PROCESSOR in
1268 i386) UNAME_PROCESSOR=x86_64 ;;
1269 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1270 esac
1262 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1263 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1264 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1265 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1266 grep IS_64BIT_ARCH >/dev/null
1267 then
1268 case $UNAME_PROCESSOR in
1269 i386) UNAME_PROCESSOR=x86_64 ;;
1270 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1271 esac
1272 fi
12711273 fi
1274 elif test "$UNAME_PROCESSOR" = i386 ; then
1275 # Avoid executing cc on OS X 10.9, as it ships with a stub
1276 # that puts up a graphical alert prompting to install
1277 # developer tools. Any system running Mac OS X 10.7 or
1278 # later (Darwin 11 and later) is required to have a 64-bit
1279 # processor. This is not true of the ARM version of Darwin
1280 # that Apple uses in portable devices.
1281 UNAME_PROCESSOR=x86_64
12721282 fi
12731283 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12741284 exit ;;
13601370 exit ;;
13611371 esac
13621372
1363 eval $set_cc_for_build
1364 cat >$dummy.c <<EOF
1365 #ifdef _SEQUENT_
1366 # include <sys/types.h>
1367 # include <sys/utsname.h>
1368 #endif
1369 main ()
1370 {
1371 #if defined (sony)
1372 #if defined (MIPSEB)
1373 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1374 I don't know.... */
1375 printf ("mips-sony-bsd\n"); exit (0);
1376 #else
1377 #include <sys/param.h>
1378 printf ("m68k-sony-newsos%s\n",
1379 #ifdef NEWSOS4
1380 "4"
1381 #else
1382 ""
1383 #endif
1384 ); exit (0);
1385 #endif
1386 #endif
1387
1388 #if defined (__arm) && defined (__acorn) && defined (__unix)
1389 printf ("arm-acorn-riscix\n"); exit (0);
1390 #endif
1391
1392 #if defined (hp300) && !defined (hpux)
1393 printf ("m68k-hp-bsd\n"); exit (0);
1394 #endif
1395
1396 #if defined (NeXT)
1397 #if !defined (__ARCHITECTURE__)
1398 #define __ARCHITECTURE__ "m68k"
1399 #endif
1400 int version;
1401 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1402 if (version < 4)
1403 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1404 else
1405 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1406 exit (0);
1407 #endif
1408
1409 #if defined (MULTIMAX) || defined (n16)
1410 #if defined (UMAXV)
1411 printf ("ns32k-encore-sysv\n"); exit (0);
1412 #else
1413 #if defined (CMU)
1414 printf ("ns32k-encore-mach\n"); exit (0);
1415 #else
1416 printf ("ns32k-encore-bsd\n"); exit (0);
1417 #endif
1418 #endif
1419 #endif
1420
1421 #if defined (__386BSD__)
1422 printf ("i386-pc-bsd\n"); exit (0);
1423 #endif
1424
1425 #if defined (sequent)
1426 #if defined (i386)
1427 printf ("i386-sequent-dynix\n"); exit (0);
1428 #endif
1429 #if defined (ns32000)
1430 printf ("ns32k-sequent-dynix\n"); exit (0);
1431 #endif
1432 #endif
1433
1434 #if defined (_SEQUENT_)
1435 struct utsname un;
1436
1437 uname(&un);
1438
1439 if (strncmp(un.version, "V2", 2) == 0) {
1440 printf ("i386-sequent-ptx2\n"); exit (0);
1441 }
1442 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1443 printf ("i386-sequent-ptx1\n"); exit (0);
1444 }
1445 printf ("i386-sequent-ptx\n"); exit (0);
1446
1447 #endif
1448
1449 #if defined (vax)
1450 # if !defined (ultrix)
1451 # include <sys/param.h>
1452 # if defined (BSD)
1453 # if BSD == 43
1454 printf ("vax-dec-bsd4.3\n"); exit (0);
1455 # else
1456 # if BSD == 199006
1457 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1458 # else
1459 printf ("vax-dec-bsd\n"); exit (0);
1460 # endif
1461 # endif
1462 # else
1463 printf ("vax-dec-bsd\n"); exit (0);
1464 # endif
1465 # else
1466 printf ("vax-dec-ultrix\n"); exit (0);
1467 # endif
1468 #endif
1469
1470 #if defined (alliant) && defined (i860)
1471 printf ("i860-alliant-bsd\n"); exit (0);
1472 #endif
1473
1474 exit (1);
1475 }
1476 EOF
1477
1478 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1479 { echo "$SYSTEM_NAME"; exit; }
1480
1481 # Apollos put the system type in the environment.
1482
1483 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1484
1485 # Convex versions that predate uname can use getsysinfo(1)
1486
1487 if [ -x /usr/convex/getsysinfo ]
1488 then
1489 case `getsysinfo -f cpu_type` in
1490 c1*)
1491 echo c1-convex-bsd
1492 exit ;;
1493 c2*)
1494 if getsysinfo -f scalar_acc
1495 then echo c32-convex-bsd
1496 else echo c2-convex-bsd
1497 fi
1498 exit ;;
1499 c34*)
1500 echo c34-convex-bsd
1501 exit ;;
1502 c38*)
1503 echo c38-convex-bsd
1504 exit ;;
1505 c4*)
1506 echo c4-convex-bsd
1507 exit ;;
1508 esac
1509 fi
1510
15111373 cat >&2 <<EOF
15121374 $0: unable to guess system type
15131375
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright 1992-2013 Free Software Foundation, Inc.
3
4 timestamp='2013-08-10'
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-09-11'
55
66 # This file is free software; you can redistribute it and/or modify it
77 # under the terms of the GNU General Public License as published by
6767 version="\
6868 GNU config.sub ($timestamp)
6969
70 Copyright 1992-2013 Free Software Foundation, Inc.
70 Copyright 1992-2014 Free Software Foundation, Inc.
7171
7272 This is free software; see the source for copying conditions. There is NO
7373 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
264264 | hexagon \
265265 | i370 | i860 | i960 | ia64 \
266266 | ip2k | iq2000 \
267 | k1om \
267268 | le32 | le64 \
268269 | lm32 \
269270 | m32c | m32r | m32rle | m68000 | m68k | m88k \
281282 | mips64vr5900 | mips64vr5900el \
282283 | mipsisa32 | mipsisa32el \
283284 | mipsisa32r2 | mipsisa32r2el \
285 | mipsisa32r6 | mipsisa32r6el \
284286 | mipsisa64 | mipsisa64el \
285287 | mipsisa64r2 | mipsisa64r2el \
288 | mipsisa64r6 | mipsisa64r6el \
286289 | mipsisa64sb1 | mipsisa64sb1el \
287290 | mipsisa64sr71k | mipsisa64sr71kel \
288291 | mipsr5900 | mipsr5900el \
294297 | nds32 | nds32le | nds32be \
295298 | nios | nios2 | nios2eb | nios2el \
296299 | ns16k | ns32k \
297 | open8 \
298 | or1k | or32 \
300 | open8 | or1k | or1knd | or32 \
299301 | pdp10 | pdp11 | pj | pjl \
300302 | powerpc | powerpc64 | powerpc64le | powerpcle \
301303 | pyramid \
304 | riscv32 | riscv64 \
302305 | rl78 | rx \
303306 | score \
304307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
323326 c6x)
324327 basic_machine=tic6x-unknown
325328 ;;
326 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
329 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
327330 basic_machine=$basic_machine-unknown
328331 os=-none
329332 ;;
380383 | hexagon-* \
381384 | i*86-* | i860-* | i960-* | ia64-* \
382385 | ip2k-* | iq2000-* \
386 | k1om-* \
383387 | le32-* | le64-* \
384388 | lm32-* \
385389 | m32c-* | m32r-* | m32rle-* \
399403 | mips64vr5900-* | mips64vr5900el-* \
400404 | mipsisa32-* | mipsisa32el-* \
401405 | mipsisa32r2-* | mipsisa32r2el-* \
406 | mipsisa32r6-* | mipsisa32r6el-* \
402407 | mipsisa64-* | mipsisa64el-* \
403408 | mipsisa64r2-* | mipsisa64r2el-* \
409 | mipsisa64r6-* | mipsisa64r6el-* \
404410 | mipsisa64sb1-* | mipsisa64sb1el-* \
405411 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
406412 | mipsr5900-* | mipsr5900el-* \
412418 | nios-* | nios2-* | nios2eb-* | nios2el-* \
413419 | none-* | np1-* | ns16k-* | ns32k-* \
414420 | open8-* \
421 | or1k*-* \
415422 | orion-* \
416423 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
417424 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
821828 basic_machine=powerpc-unknown
822829 os=-morphos
823830 ;;
831 moxiebox)
832 basic_machine=moxie-unknown
833 os=-moxiebox
834 ;;
824835 msdos)
825836 basic_machine=i386-pc
826837 os=-msdos
13661377 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
13671378 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
13681379 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1369 | -uxpv* | -beos* | -mpeix* | -udk* \
1380 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
13701381 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13711382 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13721383 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13731384 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13741385 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13751386 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1376 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1387 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
13771388 # Remember, each alternative MUST END IN *, to match a version number.
13781389 ;;
13791390 -qnx*)
15911602 mips*-*)
15921603 os=-elf
15931604 ;;
1594 or1k-*)
1595 os=-elf
1596 ;;
15971605 or32-*)
15981606 os=-coff
15991607 ;;
22
33 scriptversion=2013-05-30.07; # UTC
44
5 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2014 Free Software Foundation, Inc.
66
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2011-11-20.07; # UTC
3 scriptversion=2013-12-25.23; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
4040 # This script is compatible with the BSD install script, but was written
4141 # from scratch.
4242
43 tab=' '
4344 nl='
4445 '
45 IFS=" "" $nl"
46
47 # set DOITPROG to echo to test this script
48
49 # Don't use :- since 4.3BSD and earlier shells don't like it.
46 IFS=" $tab$nl"
47
48 # Set DOITPROG to "echo" to test this script.
49
5050 doit=${DOITPROG-}
51 if test -z "$doit"; then
52 doit_exec=exec
53 else
54 doit_exec=$doit
55 fi
51 doit_exec=${doit:-exec}
5652
5753 # Put in absolute file names if you don't have them in your path;
5854 # or use environment vars.
6763 rmprog=${RMPROG-rm}
6864 stripprog=${STRIPPROG-strip}
6965
70 posix_glob='?'
71 initialize_posix_glob='
72 test "$posix_glob" != "?" || {
73 if (set -f) 2>/dev/null; then
74 posix_glob=
75 else
76 posix_glob=:
77 fi
78 }
79 '
80
8166 posix_mkdir=
8267
8368 # Desired mode of installed file.
9681 dst_arg=
9782
9883 copy_on_change=false
99 no_target_directory=
84 is_target_a_directory=possibly
10085
10186 usage="\
10287 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
136121 -d) dir_arg=true;;
137122
138123 -g) chgrpcmd="$chgrpprog $2"
139 shift;;
124 shift;;
140125
141126 --help) echo "$usage"; exit $?;;
142127
143128 -m) mode=$2
144 case $mode in
145 *' '* | *' '* | *'
146 '* | *'*'* | *'?'* | *'['*)
147 echo "$0: invalid mode: $mode" >&2
148 exit 1;;
149 esac
150 shift;;
129 case $mode in
130 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
131 echo "$0: invalid mode: $mode" >&2
132 exit 1;;
133 esac
134 shift;;
151135
152136 -o) chowncmd="$chownprog $2"
153 shift;;
137 shift;;
154138
155139 -s) stripcmd=$stripprog;;
156140
157 -t) dst_arg=$2
158 # Protect names problematic for 'test' and other utilities.
159 case $dst_arg in
160 -* | [=\(\)!]) dst_arg=./$dst_arg;;
161 esac
162 shift;;
163
164 -T) no_target_directory=true;;
141 -t)
142 is_target_a_directory=always
143 dst_arg=$2
144 # Protect names problematic for 'test' and other utilities.
145 case $dst_arg in
146 -* | [=\(\)!]) dst_arg=./$dst_arg;;
147 esac
148 shift;;
149
150 -T) is_target_a_directory=never;;
165151
166152 --version) echo "$0 $scriptversion"; exit $?;;
167153
168 --) shift
169 break;;
170
171 -*) echo "$0: invalid option: $1" >&2
172 exit 1;;
154 --) shift
155 break;;
156
157 -*) echo "$0: invalid option: $1" >&2
158 exit 1;;
173159
174160 *) break;;
175161 esac
176162 shift
177163 done
164
165 # We allow the use of options -d and -T together, by making -d
166 # take the precedence; this is for compatibility with GNU install.
167
168 if test -n "$dir_arg"; then
169 if test -n "$dst_arg"; then
170 echo "$0: target directory not allowed when installing a directory." >&2
171 exit 1
172 fi
173 fi
178174
179175 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
180176 # When -d is used, all remaining arguments are directories to create.
207203 fi
208204
209205 if test -z "$dir_arg"; then
206 if test $# -gt 1 || test "$is_target_a_directory" = always; then
207 if test ! -d "$dst_arg"; then
208 echo "$0: $dst_arg: Is not a directory." >&2
209 exit 1
210 fi
211 fi
212 fi
213
214 if test -z "$dir_arg"; then
210215 do_exit='(exit $ret); exit $ret'
211216 trap "ret=129; $do_exit" 1
212217 trap "ret=130; $do_exit" 2
222227
223228 *[0-7])
224229 if test -z "$stripcmd"; then
225 u_plus_rw=
230 u_plus_rw=
226231 else
227 u_plus_rw='% 200'
232 u_plus_rw='% 200'
228233 fi
229234 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
230235 *)
231236 if test -z "$stripcmd"; then
232 u_plus_rw=
237 u_plus_rw=
233238 else
234 u_plus_rw=,u+rw
239 u_plus_rw=,u+rw
235240 fi
236241 cp_umask=$mode$u_plus_rw;;
237242 esac
268273 # If destination is a directory, append the input filename; won't work
269274 # if double slashes aren't ignored.
270275 if test -d "$dst"; then
271 if test -n "$no_target_directory"; then
272 echo "$0: $dst_arg: Is a directory" >&2
273 exit 1
276 if test "$is_target_a_directory" = never; then
277 echo "$0: $dst_arg: Is a directory" >&2
278 exit 1
274279 fi
275280 dstdir=$dst
276281 dst=$dstdir/`basename "$src"`
277282 dstdir_status=0
278283 else
279 # Prefer dirname, but fall back on a substitute if dirname fails.
280 dstdir=`
281 (dirname "$dst") 2>/dev/null ||
282 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
283 X"$dst" : 'X\(//\)[^/]' \| \
284 X"$dst" : 'X\(//\)$' \| \
285 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
286 echo X"$dst" |
287 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
288 s//\1/
289 q
290 }
291 /^X\(\/\/\)[^/].*/{
292 s//\1/
293 q
294 }
295 /^X\(\/\/\)$/{
296 s//\1/
297 q
298 }
299 /^X\(\/\).*/{
300 s//\1/
301 q
302 }
303 s/.*/./; q'
304 `
305
284 dstdir=`dirname "$dst"`
306285 test -d "$dstdir"
307286 dstdir_status=$?
308287 fi
313292 if test $dstdir_status != 0; then
314293 case $posix_mkdir in
315294 '')
316 # Create intermediate dirs using mode 755 as modified by the umask.
317 # This is like FreeBSD 'install' as of 1997-10-28.
318 umask=`umask`
319 case $stripcmd.$umask in
320 # Optimize common cases.
321 *[2367][2367]) mkdir_umask=$umask;;
322 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
323
324 *[0-7])
325 mkdir_umask=`expr $umask + 22 \
326 - $umask % 100 % 40 + $umask % 20 \
327 - $umask % 10 % 4 + $umask % 2
328 `;;
329 *) mkdir_umask=$umask,go-w;;
330 esac
331
332 # With -d, create the new directory with the user-specified mode.
333 # Otherwise, rely on $mkdir_umask.
334 if test -n "$dir_arg"; then
335 mkdir_mode=-m$mode
336 else
337 mkdir_mode=
338 fi
339
340 posix_mkdir=false
341 case $umask in
342 *[123567][0-7][0-7])
343 # POSIX mkdir -p sets u+wx bits regardless of umask, which
344 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
345 ;;
346 *)
347 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
348 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
349
350 if (umask $mkdir_umask &&
351 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
352 then
353 if test -z "$dir_arg" || {
354 # Check for POSIX incompatibilities with -m.
355 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
356 # other-writable bit of parent directory when it shouldn't.
357 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
358 ls_ld_tmpdir=`ls -ld "$tmpdir"`
359 case $ls_ld_tmpdir in
360 d????-?r-*) different_mode=700;;
361 d????-?--*) different_mode=755;;
362 *) false;;
363 esac &&
364 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
365 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
366 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
367 }
368 }
369 then posix_mkdir=:
370 fi
371 rmdir "$tmpdir/d" "$tmpdir"
372 else
373 # Remove any dirs left behind by ancient mkdir implementations.
374 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
375 fi
376 trap '' 0;;
377 esac;;
295 # Create intermediate dirs using mode 755 as modified by the umask.
296 # This is like FreeBSD 'install' as of 1997-10-28.
297 umask=`umask`
298 case $stripcmd.$umask in
299 # Optimize common cases.
300 *[2367][2367]) mkdir_umask=$umask;;
301 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
302
303 *[0-7])
304 mkdir_umask=`expr $umask + 22 \
305 - $umask % 100 % 40 + $umask % 20 \
306 - $umask % 10 % 4 + $umask % 2
307 `;;
308 *) mkdir_umask=$umask,go-w;;
309 esac
310
311 # With -d, create the new directory with the user-specified mode.
312 # Otherwise, rely on $mkdir_umask.
313 if test -n "$dir_arg"; then
314 mkdir_mode=-m$mode
315 else
316 mkdir_mode=
317 fi
318
319 posix_mkdir=false
320 case $umask in
321 *[123567][0-7][0-7])
322 # POSIX mkdir -p sets u+wx bits regardless of umask, which
323 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
324 ;;
325 *)
326 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
327 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
328
329 if (umask $mkdir_umask &&
330 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
331 then
332 if test -z "$dir_arg" || {
333 # Check for POSIX incompatibilities with -m.
334 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
335 # other-writable bit of parent directory when it shouldn't.
336 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
337 ls_ld_tmpdir=`ls -ld "$tmpdir"`
338 case $ls_ld_tmpdir in
339 d????-?r-*) different_mode=700;;
340 d????-?--*) different_mode=755;;
341 *) false;;
342 esac &&
343 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
344 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
345 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
346 }
347 }
348 then posix_mkdir=:
349 fi
350 rmdir "$tmpdir/d" "$tmpdir"
351 else
352 # Remove any dirs left behind by ancient mkdir implementations.
353 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
354 fi
355 trap '' 0;;
356 esac;;
378357 esac
379358
380359 if
381360 $posix_mkdir && (
382 umask $mkdir_umask &&
383 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
361 umask $mkdir_umask &&
362 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
384363 )
385364 then :
386365 else
390369 # directory the slow way, step by step, checking for races as we go.
391370
392371 case $dstdir in
393 /*) prefix='/';;
394 [-=\(\)!]*) prefix='./';;
395 *) prefix='';;
372 /*) prefix='/';;
373 [-=\(\)!]*) prefix='./';;
374 *) prefix='';;
396375 esac
397
398 eval "$initialize_posix_glob"
399376
400377 oIFS=$IFS
401378 IFS=/
402 $posix_glob set -f
379 set -f
403380 set fnord $dstdir
404381 shift
405 $posix_glob set +f
382 set +f
406383 IFS=$oIFS
407384
408385 prefixes=
409386
410387 for d
411388 do
412 test X"$d" = X && continue
413
414 prefix=$prefix$d
415 if test -d "$prefix"; then
416 prefixes=
417 else
418 if $posix_mkdir; then
419 (umask=$mkdir_umask &&
420 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
421 # Don't fail if two instances are running concurrently.
422 test -d "$prefix" || exit 1
423 else
424 case $prefix in
425 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
426 *) qprefix=$prefix;;
427 esac
428 prefixes="$prefixes '$qprefix'"
429 fi
430 fi
431 prefix=$prefix/
389 test X"$d" = X && continue
390
391 prefix=$prefix$d
392 if test -d "$prefix"; then
393 prefixes=
394 else
395 if $posix_mkdir; then
396 (umask=$mkdir_umask &&
397 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
398 # Don't fail if two instances are running concurrently.
399 test -d "$prefix" || exit 1
400 else
401 case $prefix in
402 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
403 *) qprefix=$prefix;;
404 esac
405 prefixes="$prefixes '$qprefix'"
406 fi
407 fi
408 prefix=$prefix/
432409 done
433410
434411 if test -n "$prefixes"; then
435 # Don't fail if two instances are running concurrently.
436 (umask $mkdir_umask &&
437 eval "\$doit_exec \$mkdirprog $prefixes") ||
438 test -d "$dstdir" || exit 1
439 obsolete_mkdir_used=true
412 # Don't fail if two instances are running concurrently.
413 (umask $mkdir_umask &&
414 eval "\$doit_exec \$mkdirprog $prefixes") ||
415 test -d "$dstdir" || exit 1
416 obsolete_mkdir_used=true
440417 fi
441418 fi
442419 fi
471448
472449 # If -C, don't bother to copy if it wouldn't change the file.
473450 if $copy_on_change &&
474 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
475 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
476
477 eval "$initialize_posix_glob" &&
478 $posix_glob set -f &&
451 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
452 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
453 set -f &&
479454 set X $old && old=:$2:$4:$5:$6 &&
480455 set X $new && new=:$2:$4:$5:$6 &&
481 $posix_glob set +f &&
482
456 set +f &&
483457 test "$old" = "$new" &&
484458 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
485459 then
492466 # to itself, or perhaps because mv is so ancient that it does not
493467 # support -f.
494468 {
495 # Now remove or move aside any old file at destination location.
496 # We try this two ways since rm can't unlink itself on some
497 # systems and the destination file might be busy for other
498 # reasons. In this case, the final cleanup might fail but the new
499 # file should still install successfully.
500 {
501 test ! -f "$dst" ||
502 $doit $rmcmd -f "$dst" 2>/dev/null ||
503 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
504 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
505 } ||
506 { echo "$0: cannot unlink or rename $dst" >&2
507 (exit 1); exit 1
508 }
509 } &&
510
511 # Now rename the file to the real destination.
512 $doit $mvcmd "$dsttmp" "$dst"
469 # Now remove or move aside any old file at destination location.
470 # We try this two ways since rm can't unlink itself on some
471 # systems and the destination file might be busy for other
472 # reasons. In this case, the final cleanup might fail but the new
473 # file should still install successfully.
474 {
475 test ! -f "$dst" ||
476 $doit $rmcmd -f "$dst" 2>/dev/null ||
477 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
478 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
479 } ||
480 { echo "$0: cannot unlink or rename $dst" >&2
481 (exit 1); exit 1
482 }
483 } &&
484
485 # Now rename the file to the real destination.
486 $doit $mvcmd "$dsttmp" "$dst"
513487 }
514488 fi || exit 1
515489
6969 # compiler: $LTCC
7070 # compiler flags: $LTCFLAGS
7171 # linker: $LD (gnu? $with_gnu_ld)
72 # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1
72 # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11
7373 # automake: $automake_version
7474 # autoconf: $autoconf_version
7575 #
7979
8080 PROGRAM=libtool
8181 PACKAGE=libtool
82 VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1"
82 VERSION="2.4.2 Debian-2.4.2-1.11"
8383 TIMESTAMP=""
8484 package_revision=1.3337
8585
22
33 scriptversion=2013-10-28.13; # UTC
44
5 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
5 # Copyright (C) 1996-2014 Free Software Foundation, Inc.
66 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
77
88 # This program is free software; you can redistribute it and/or modify
22
33 scriptversion=2013-07-13.22; # UTC
44
5 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
5 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
66 #
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
105105 # Test script is run here.
106106 "$@" >$log_file 2>&1
107107 estatus=$?
108
108109 if test $enable_hard_errors = no && test $estatus -eq 99; then
109 estatus=1
110 tweaked_estatus=1
111 else
112 tweaked_estatus=$estatus
110113 fi
111114
112 case $estatus:$expect_failure in
115 case $tweaked_estatus:$expect_failure in
113116 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
114117 0:*) col=$grn res=PASS recheck=no gcopy=no;;
115118 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
117120 *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
118121 *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
119122 esac
123
124 # Report the test outcome and exit status in the logs, so that one can
125 # know whether the test passed or failed simply by looking at the '.log'
126 # file, without the need of also peaking into the corresponding '.trs'
127 # file (automake bug#11814).
128 echo "$res $test_name (exit status: $estatus)" >>$log_file
120129
121130 # Report outcome to console.
122131 echo "${col}${res}${std}: $test_name"
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for ykclient 2.14.
2 # Generated by GNU Autoconf 2.69 for ykclient 2.15.
33 #
44 # Report bugs to <yubico-devel@googlegroups.com>.
55 #
589589 # Identity of this package.
590590 PACKAGE_NAME='ykclient'
591591 PACKAGE_TARNAME='ykclient'
592 PACKAGE_VERSION='2.14'
593 PACKAGE_STRING='ykclient 2.14'
592 PACKAGE_VERSION='2.15'
593 PACKAGE_STRING='ykclient 2.15'
594594 PACKAGE_BUGREPORT='yubico-devel@googlegroups.com'
595595 PACKAGE_URL=''
596596
678678 build_vendor
679679 build_cpu
680680 build
681 HELP2ADOC
681682 HELP2MAN
682683 ac_ct_AR
683684 AR
13371338 # Omit some internal or obsolete options to make the list less imposing.
13381339 # This message is too long to be a string in the A/UX 3.1 sh.
13391340 cat <<_ACEOF
1340 \`configure' configures ykclient 2.14 to adapt to many kinds of systems.
1341 \`configure' configures ykclient 2.15 to adapt to many kinds of systems.
13411342
13421343 Usage: $0 [OPTION]... [VAR=VALUE]...
13431344
14071408
14081409 if test -n "$ac_init_help"; then
14091410 case $ac_init_help in
1410 short | recursive ) echo "Configuration of ykclient 2.14:";;
1411 short | recursive ) echo "Configuration of ykclient 2.15:";;
14111412 esac
14121413 cat <<\_ACEOF
14131414
15271528 test -n "$ac_init_help" && exit $ac_status
15281529 if $ac_init_version; then
15291530 cat <<\_ACEOF
1530 ykclient configure 2.14
1531 ykclient configure 2.15
15311532 generated by GNU Autoconf 2.69
15321533
15331534 Copyright (C) 2012 Free Software Foundation, Inc.
18051806 This file contains any messages produced by compilers while
18061807 running configure, to aid debugging if configure makes a mistake.
18071808
1808 It was created by ykclient $as_me 2.14, which was
1809 It was created by ykclient $as_me 2.15, which was
18091810 generated by GNU Autoconf 2.69. Invocation command line was
18101811
18111812 $ $0 $@
21882189 # Interfaces changed/added/removed: CURRENT++ REVISION=0
21892190 # Interfaces added: AGE++
21902191 # Interfaces removed: AGE=0
2191 LT_CURRENT=8
2192
2193 LT_REVISION=4
2194
2195 LT_AGE=5
2196
2197
2198 am__api_version='1.14'
2192 LT_CURRENT=9
2193
2194 LT_REVISION=0
2195
2196 LT_AGE=6
2197
2198
2199 am__api_version='1.15'
21992200
22002201 # Find a good install program. We prefer a C program (faster),
22012202 # so one script is as good as another. But avoid the broken or
23672368 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
23682369 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
23692370
2370 # expand $ac_aux_dir to an absolute path
2371 am_aux_dir=`cd $ac_aux_dir && pwd`
2371 # Expand $ac_aux_dir to an absolute path.
2372 am_aux_dir=`cd "$ac_aux_dir" && pwd`
23722373
23732374 if test x"${MISSING+set}" != xset; then
23742375 case $am_aux_dir in
23872388 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
23882389 fi
23892390
2390 if test x"${install_sh}" != xset; then
2391 if test x"${install_sh+set}" != xset; then
23912392 case $am_aux_dir in
23922393 *\ * | *\ *)
23932394 install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
26812682
26822683 # Define the identity of the package.
26832684 PACKAGE='ykclient'
2684 VERSION='2.14'
2685 VERSION='2.15'
26852686
26862687
26872688 cat >>confdefs.h <<_ACEOF
27152716 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
27162717 mkdir_p='$(MKDIR_P)'
27172718
2718 # We need awk for the "check" target. The system "awk" is bad on
2719 # some platforms.
2719 # We need awk for the "check" target (and possibly the TAP driver). The
2720 # system "awk" is bad on some platforms.
27202721 # Always define AMTAR for backward compatibility. Yes, it's still used
27212722 # in the wild :-( We should find a proper way to deprecate it ...
27222723 AMTAR='$${TAR-tar}'
27732774 as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
27742775 fi
27752776 fi
2777
27762778 # Check whether --enable-silent-rules was given.
27772779 if test "${enable_silent_rules+set}" = set; then :
27782780 enableval=$enable_silent_rules;
40274029
40284030
40294031 HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
4032
4033
4034 HELP2ADOC=${HELP2ADOC-"${am_missing_run}help2adoc"}
40304035
40314036 # Make sure we can run config.sub.
40324037 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
1317313178 # report actual input values of CONFIG_FILES etc. instead of their
1317413179 # values after options handling.
1317513180 ac_log="
13176 This file was extended by ykclient $as_me 2.14, which was
13181 This file was extended by ykclient $as_me 2.15, which was
1317713182 generated by GNU Autoconf 2.69. Invocation command line was
1317813183
1317913184 CONFIG_FILES = $CONFIG_FILES
1323013235 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1323113236 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1323213237 ac_cs_version="\\
13233 ykclient config.status 2.14
13238 ykclient config.status 2.15
1323413239 configured by $0, generated by GNU Autoconf 2.69,
1323513240 with options \\"\$ac_cs_config\\"
1323613241
2525 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2626 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28 AC_INIT([ykclient], [2.14], [yubico-devel@googlegroups.com])
28 AC_INIT([ykclient], [2.15], [yubico-devel@googlegroups.com])
2929 AC_CONFIG_AUX_DIR([build-aux])
3030 AC_CONFIG_MACRO_DIR([m4])
3131
3333 # Interfaces changed/added/removed: CURRENT++ REVISION=0
3434 # Interfaces added: AGE++
3535 # Interfaces removed: AGE=0
36 AC_SUBST(LT_CURRENT, 8)
37 AC_SUBST(LT_REVISION, 4)
38 AC_SUBST(LT_AGE, 5)
36 AC_SUBST(LT_CURRENT, 9)
37 AC_SUBST(LT_REVISION, 0)
38 AC_SUBST(LT_AGE, 6)
3939
4040 AM_INIT_AUTOMAKE([1.11 -Wall -Werror])
4141 AM_SILENT_RULES([yes])
4444 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
4545
4646 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
47 AM_MISSING_PROG(HELP2ADOC, help2adoc, $missing_dir)
4748 AC_LIBTOOL_WIN32_DLL
4849 AC_PROG_LIBTOOL
4950
6464 ykclient_set_ca_info;
6565 ykclient_set_url_bases;
6666 } Base;
67
68 YKCLIENT_2.15 {
69 global:
70 ykclient_get_server_response;
71 ykclient_set_proxy;
72 } YKCLIENT_2.12;
0 # Makefile.in generated by automake 1.14.1 from Makefile.am.
0 # Makefile.in generated by automake 1.15 from Makefile.am.
11 # @configure_input@
22
3 # Copyright (C) 1994-2013 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2014 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
4343
4444 # Self tests.
4545 VPATH = @srcdir@
46 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
46 am__is_gnu_make = { \
47 if test -z '$(MAKELEVEL)'; then \
48 false; \
49 elif test -n '$(MAKE_HOST)'; then \
50 true; \
51 elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
52 true; \
53 else \
54 false; \
55 fi; \
56 }
4757 am__make_running_with_option = \
4858 case $${target_option-} in \
4959 ?) ;; \
108118 host_triplet = @host@
109119 check_PROGRAMS = selftest$(EXEEXT)
110120 subdir = tests
111 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
112 $(top_srcdir)/build-aux/depcomp \
113 $(top_srcdir)/build-aux/test-driver
114121 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
115122 am__aclocal_m4_deps = $(top_srcdir)/m4/ld-version-script.m4 \
116123 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
121128 $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac
122129 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
123130 $(ACLOCAL_M4)
131 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
124132 mkinstalldirs = $(install_sh) -d
125133 CONFIG_CLEAN_FILES =
126134 CONFIG_CLEAN_VPATH_FILES =
396404 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
397405 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
398406 $(TEST_LOG_FLAGS)
407 am__DIST_COMMON = $(srcdir)/Makefile.in \
408 $(top_srcdir)/build-aux/depcomp \
409 $(top_srcdir)/build-aux/test-driver
399410 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
400411 ACLOCAL = @ACLOCAL@
401412 AMTAR = @AMTAR@
424435 EXEEXT = @EXEEXT@
425436 FGREP = @FGREP@
426437 GREP = @GREP@
438 HELP2ADOC = @HELP2ADOC@
427439 HELP2MAN = @HELP2MAN@
428440 INSTALL = @INSTALL@
429441 INSTALL_DATA = @INSTALL_DATA@
549561 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
550562 $(am__cd) $(top_srcdir) && \
551563 $(AUTOMAKE) --gnu tests/Makefile
552 .PRECIOUS: Makefile
553564 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
554565 @case '$?' in \
555566 *config.status*) \
698709 if test -n "$$am__remaking_logs"; then \
699710 echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
700711 "recursion detected" >&2; \
701 else \
712 elif test -n "$$redo_logs"; then \
702713 am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
703714 fi; \
704715 if $(am__make_dryrun); then :; else \
987998 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
988999 recheck tags tags-am uninstall uninstall-am
9891000
1001 .PRECIOUS: Makefile
1002
9901003
9911004 # Tell versions [3.59,3.63) of GNU make to not export all variables.
9921005 # Otherwise a system limit (for SysV at least) may be exceeded.
5252 " \"http://api.yubico.com/wsapi/verify\"\n"
5353 " --ca CADIR Path to directory containing Certificate Authoritity,\n"
5454 " e.g., \"/usr/local/etc/CERTS\"\n"
55 " --cai CAFILE Path to a file holding one or more certificated to\n"
56 " verify the peer with\n"
5557 " --apikey Key API key for HMAC validation of request/response\n"
58 " --proxy ip:port Connect to validation service through a proxy,\n"
59 " e.g., \"socks5h://user:pass@127.0.0.1:1080\"\n"
5660 "\n"
5761 "Exit status is 0 on success, 1 if there is a hard failure, 2 if the\n"
5862 "OTP was replayed, 3 for other soft OTP-related failures.\n"
6367 {"ca", 1, 0, 'c'},
6468 {"cai", 1, 0, 'i'},
6569 {"apikey", 1, 0, 'a'},
70 {"proxy", 1, 0, 'p'},
6671 {"debug", 0, 0, 'd'},
6772 {"help", 0, 0, 'h'},
6873 {"version", 0, 0, 'V'},
7378 static void
7479 parse_args (int argc, char *argv[],
7580 unsigned int *client_id, char **token, char **url, char **ca,
76 char **cai, char **api_key, int *debug)
81 char **cai, char **api_key, char **proxy, int *debug)
7782 {
7883 while (1)
7984 {
130135 *cai = optarg;
131136 break;
132137
138 case 'p':
139 if (strlen(optarg) < 1)
140 {
141 fprintf (stderr, "error: must give a valid proxy [scheme]://ip:port");
142 exit (EXIT_FAILURE);
143 }
144 *proxy = optarg;
145 break;
146
133147 case 'h':
134148 printf ("%s", usage);
135149 exit (EXIT_SUCCESS);
171185 main (int argc, char *argv[])
172186 {
173187 unsigned int client_id;
174 char *token, *url = NULL, *ca = NULL, *api_key = NULL, *cai = NULL;
188 char *token, *url = NULL, *ca = NULL, *api_key = NULL, *cai = NULL, *proxy = NULL;
175189 int debug = 0;
176190 ykclient_rc ret;
177191 ykclient_t *ykc = NULL;
178192
179 parse_args (argc, argv, &client_id, &token, &url, &ca, &cai, &api_key,
193 parse_args (argc, argv, &client_id, &token, &url, &ca, &cai, &api_key, &proxy,
180194 &debug);
181195
182 if (ca || cai)
183 {
184 ret = ykclient_init (&ykc);
185 if (ret != YKCLIENT_OK)
186 return EXIT_FAILURE;
187 }
196 ret = ykclient_init (&ykc);
197 if (ret != YKCLIENT_OK)
198 return EXIT_FAILURE;
188199
189200 if (ca)
190201 {
194205 if (cai)
195206 {
196207 ykclient_set_ca_info (ykc, cai);
208 }
209 if (proxy)
210 {
211 ykclient_set_proxy (ykc, proxy);
197212 }
198213
199214 if (debug)
209224 fprintf (stderr, " token: %s\n", token);
210225 if (api_key != NULL)
211226 fprintf (stderr, " api key: %s\n", api_key);
227 if (proxy != NULL)
228 fprintf (stderr, "Using proxy: %s\n", proxy);
212229 }
213230
214231 ret = ykclient_verify_otp_v2 (ykc, token, client_id, NULL, 1,
215232 (const char **) &url, api_key);
216233
217234 if (debug)
218 printf ("Verification output (%d): %s\n", ret, ykclient_strerror (ret));
235 {
236 const ykclient_server_response_t *srv_response = ykclient_get_server_response (ykc);
237 printf ("Response from: %s\n", ykclient_get_last_url (ykc));
238 printf ("Verification output (%d): %s\n", ret, ykclient_strerror (ret));
239 printf (" otp: %s\n", ykclient_server_response_get (srv_response, "otp"));
240 printf (" nonce: %s\n", ykclient_server_response_get (srv_response, "nonce"));
241 printf (" t: %s\n", ykclient_server_response_get (srv_response, "t"));
242 printf (" timestamp: %s\n", ykclient_server_response_get (srv_response, "timestamp"));
243 printf (" sessioncounter: %s\n", ykclient_server_response_get (srv_response, "sessioncounter"));
244 printf (" sessionuse: %s\n", ykclient_server_response_get (srv_response, "sessionuse"));
245 printf (" sl: %s\n", ykclient_server_response_get (srv_response, "sl"));
246 printf (" status: %s\n", ykclient_server_response_get (srv_response, "status"));
247 }
248
249 ykclient_done(&ykc);
219250
220251 if (ret == YKCLIENT_REPLAYED_OTP)
221252 return 2;
0 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.44.1.
1 .TH YKCLIENT "1" "March 2015" "ykclient 2.14" "User Commands"
0 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.2.
1 .TH YKCLIENT "1" "November 2015" "ykclient 2.15" "User Commands"
22 .SH NAME
33 ykclient \- YubiCloud One-Time-Password Validation Client
44 .SH SYNOPSIS
55 .B ykclient
6 [\fIOPTION\fR]... \fICLIENTID YUBIKEYOTP\fR
6 [\fI\,OPTION\/\fR]... \fI\,CLIENTID YUBIKEYOTP\/\fR
77 .SH DESCRIPTION
88 Validate the YUBIKEYOTP one\-time\-password against the YubiCloud
99 using CLIENTID as the client identifier.
2727 Path to directory containing Certificate Authoritity,
2828 e.g., "/usr/local/etc/CERTS"
2929 .TP
30 \fB\-\-cai\fR CAFILE
31 Path to a file holding one or more certificated to
32 verify the peer with
33 .TP
3034 \fB\-\-apikey\fR Key
3135 API key for HMAC validation of request/response
36 .TP
37 \fB\-\-proxy\fR ip:port
38 Connect to validation service through a proxy,
39 e.g., "socks5h://user:pass@127.0.0.1:1080"
3240 .PP
3341 Exit status is 0 on success, 1 if there is a hard failure, 2 if the
3442 OTP was replayed, 3 for other soft OTP\-related failures.
5151 #define ADD_OTP "&otp="
5252 #define ADD_HASH "&h="
5353 #define ADD_ID "?id="
54 #define ADD_TS "&timestamp=1"
5455
5556 #define TEMPLATE_FORMAT_OLD 1
5657 #define TEMPLATE_FORMAT_NEW 2
5960 {
6061 const char *ca_path;
6162 const char *ca_info;
63 const char *proxy;
6264 size_t num_templates;
6365 char **url_templates;
6466 int template_format;
7072 char *nonce;
7173 char nonce_supplied;
7274 int verify_signature;
75 ykclient_server_response_t *srv_response;
7376 };
7477
7578 struct curl_data
151154
152155 p->ca_path = NULL;
153156 p->ca_info = NULL;
157 p->proxy = NULL;
154158
155159 p->key = NULL;
156160 p->keylen = 0;
160164
161165 p->nonce = NULL;
162166 p->nonce_supplied = 0;
167
168 p->srv_response = NULL;
163169
164170 /*
165171 * Verification of server signature can only be done if there is
201207 free ((*ykc)->url_templates);
202208 }
203209
210 if ((*ykc)->srv_response)
211 {
212 ykclient_server_response_free((*ykc)->srv_response);
213 }
214
204215 free ((*ykc)->key_buf);
205216 free (*ykc);
206217 }
319330 curl_easy_setopt (easy, CURLOPT_CAINFO, ykc->ca_info);
320331 }
321332
333 if (ykc->proxy)
334 {
335 /*
336 * The proxy string may be prefixed with [scheme]://ip:port to specify which kind of proxy is used.
337 * Valid choices are: socks4://, socks4a://, socks5:// or socks5h://
338 * Use socks5h to ask the proxy to do the dns resolving.
339 * If no scheme or port is specified HTTP proxy port 1080 will be used.
340 */
341 curl_easy_setopt (easy, CURLOPT_PROXY, ykc->proxy);
342 }
343
322344 curl_easy_setopt (easy, CURLOPT_WRITEDATA, (void *) data);
323345 curl_easy_setopt (easy, CURLOPT_PRIVATE, (void *) data);
324346 curl_easy_setopt (easy, CURLOPT_WRITEFUNCTION, curl_callback);
327349 curl_multi_add_handle (p->multi, easy);
328350 p->easy[p->num_easy] = easy;
329351 }
352
353 if(p->num_easy == 0) {
354 ykclient_handle_done (&p);
355 return YKCLIENT_BAD_INPUT;
356 }
330357
331358 /* Take this opportunity to allocate the array for expanded URLs */
332359 p->url_exp = malloc (sizeof (char *) * p->num_easy);
561588 ykc->ca_info = ca_info;
562589 }
563590
591 /** Set the proxy
592 *
593 * Must be called before creating handles.
594 */
595 void
596 ykclient_set_proxy (ykclient_t * ykc, const char *proxy)
597 {
598 ykc->proxy = proxy;
599 }
600
601
564602 /** Set a single URL template
565603 *
566604 * @param ykc Yubikey client configuration.
837875 {
838876 size_t len =
839877 strlen (template) + strlen (encoded_otp) + strlen (ADD_OTP) +
840 strlen (ADD_ID) + 1;
878 strlen (ADD_ID) + strlen(ADD_TS) + 1;
841879 len += snprintf (NULL, 0, "%d", client_id);
842880
843881 if (nonce)
853891
854892 if (nonce)
855893 {
856 snprintf (*url_exp, len, "%s" ADD_ID "%d" ADD_NONCE "%s" ADD_OTP "%s",
894 snprintf (*url_exp, len, "%s" ADD_ID "%d" ADD_NONCE "%s" ADD_OTP "%s" ADD_TS,
857895 template, client_id, nonce, encoded_otp);
858896 }
859897 else
860898 {
861 snprintf (*url_exp, len, "%s" ADD_ID "%d" ADD_OTP "%s", template,
899 snprintf (*url_exp, len, "%s" ADD_ID "%d" ADD_OTP "%s" ADD_TS, template,
862900 client_id, encoded_otp);
863901 }
864902 return YKCLIENT_OK;
11611199 {
11621200 ykclient_rc out = YKCLIENT_OK;
11631201 int requests;
1164 ykclient_server_response_t *srv_response = NULL;
11651202
11661203 if (!ykc->num_templates)
11671204 {
12671304 curl_easy_getinfo (curl_easy, CURLINFO_EFFECTIVE_URL, &url_used);
12681305 strncpy (ykc->last_url, url_used, sizeof (ykc->last_url));
12691306
1270 srv_response = ykclient_server_response_init ();
1271 if (srv_response == NULL)
1307 if(ykc->srv_response)
1308 {
1309 ykclient_server_response_free (ykc->srv_response);
1310 }
1311
1312 ykc->srv_response = ykclient_server_response_init ();
1313 if (ykc->srv_response == NULL)
12721314 {
12731315 out = YKCLIENT_PARSE_ERROR;
12741316 goto finish;
12751317 }
12761318
12771319 out = ykclient_server_response_parse (data->curl_chunk,
1278 srv_response);
1320 ykc->srv_response);
12791321 if (out != YKCLIENT_OK)
12801322 {
12811323 goto finish;
12821324 }
12831325
12841326 if (ykc->verify_signature != 0 &&
1285 ykclient_server_response_verify_signature (srv_response,
1327 ykclient_server_response_verify_signature (ykc->srv_response,
12861328 ykc->key,
12871329 ykc->keylen))
12881330 {
12901332 goto finish;
12911333 }
12921334
1293 status = ykclient_server_response_get (srv_response, "status");
1335 status = ykclient_server_response_get (ykc->srv_response, "status");
12941336 if (!status)
12951337 {
12961338 out = YKCLIENT_PARSE_ERROR;
13131355 if (nonce)
13141356 {
13151357 char *server_nonce =
1316 ykclient_server_response_get (srv_response,
1358 ykclient_server_response_get (ykc->srv_response,
13171359 "nonce");
13181360 if (server_nonce == NULL || strcmp (nonce, server_nonce))
13191361 {
13221364 }
13231365 }
13241366
1325 server_otp = ykclient_server_response_get (srv_response, "otp");
1367 server_otp = ykclient_server_response_get (ykc->srv_response, "otp");
13261368 if (server_otp == NULL || strcmp (yubikey, server_otp))
13271369 {
13281370 out = YKCLIENT_HMAC_ERROR;
13361378 goto finish;
13371379 }
13381380
1339 ykclient_server_response_free (srv_response);
1340 srv_response = NULL;
1381 ykclient_server_response_free (ykc->srv_response);
1382 ykc->srv_response = NULL;
13411383 }
13421384 }
13431385 while (requests);
13441386 finish:
1345 if (srv_response)
1346 {
1347 ykclient_server_response_free (srv_response);
1348 }
1349
13501387 return out;
13511388 }
13521389
15051542 yubikey_otp,
15061543 client_id, hexkey, 0, NULL, NULL);
15071544 }
1545
1546 /**
1547 * Fetch out server response of last query
1548 */
1549 const ykclient_server_response_t *
1550 ykclient_get_server_response(ykclient_t *ykc) {
1551 return ykc->srv_response;
1552 }
3737
3838 #include <ykclient_errors.h>
3939 #include <ykclient_version.h>
40 #include <ykclient_server_response.h>
4041
4142 #ifdef __cplusplus
4243 extern "C"
9596
9697 extern void ykclient_set_ca_info (ykclient_t * ykc, const char *ca_info);
9798
99 extern void ykclient_set_proxy (ykclient_t * ykc, const char *proxy);
100
98101 /*
99102 * Set the nonce. A default nonce is generated in ykclient_init(), but
100103 * if you either want to specify your own nonce, or want to remove the
128131 const char **urls,
129132 const char *api_key);
130133
134 /* Fetch out the server response form the last query */
135 extern const ykclient_server_response_t *ykclient_get_server_response(ykclient_t *ykc);
131136 #ifdef __cplusplus
132137 }
133138 #endif
4141 * version number. Used together with ykclient_check_version() to
4242 * verify header file and run-time library consistency.
4343 */
44 #define YKCLIENT_VERSION_STRING "2.14"
44 #define YKCLIENT_VERSION_STRING "2.15"
4545
4646 /**
4747 * YKCLIENT_VERSION_NUMBER
5151 * this symbol will have the value 0x01020300. The last two digits
5252 * are only used between public releases, and will otherwise be 00.
5353 */
54 #define YKCLIENT_VERSION_NUMBER 0x020e00
54 #define YKCLIENT_VERSION_NUMBER 0x020f00
5555
5656 /**
5757 * YKCLIENT_VERSION_MAJOR
6969 * level of the header file version number. For example, when the
7070 * header version is 1.2.3 this symbol will be 2.
7171 */
72 #define YKCLIENT_VERSION_MINOR 14
72 #define YKCLIENT_VERSION_MINOR 15
7373
7474 /**
7575 * YKCLIENT_VERSION_PATCH