Set default private DO at configure time

Do not hardcode the default private DO for scdtotp. Use instead
a configure-time variable to select it.
develop
Damien Goutte-Gattat 8 years ago
parent dd1ab20a27
commit 12fe96409f
  1. 12
      configure.ac
  2. 2
      man/scdtotp.1.in
  3. 1
      src/scdtotp.c

@ -33,6 +33,18 @@ AM_PATH_GPG_ERROR([1.11],
LIBS="$LIBS $GPG_ERROR_LIBS"],
[AC_MSG_ERROR([libgpg-error not found])])
dnl Default private DO for scdtotp
AC_ARG_WITH([default-do],
[AS_HELP_STRING([--with-default-do=N],
[Specify default private DO for scdtotp @<:@default=1@:>@])])
case $with_default_do in
1|2|3|4) ;;
*) with_default_do=1;;
esac
AC_DEFINE_UNQUOTED([DEFAULT_PRIVATE_DO], [$with_default_do],
[Default private DO for scdtotp.])
AC_SUBST([DEFAULT_PRIVATE_DO], [$with_default_do])
dnl Output files
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile
man/Makefile man/scdrand.1 man/scdtotp.1])

@ -57,7 +57,7 @@ Select the HMAC algorithm to use among
.TP
.BR -n ", " --private-do " " \fiN\fR
Read key from private DO slot #\fiN\fR
(default is 1).
(default is @DEFAULT_PRIVATE_DO@.)
.SH REPORTING BUGS
.PP

@ -35,7 +35,6 @@
#define DEFAULT_TIME_STEP 30
#define DEFAULT_DIGITS 6
#define MAX_KEY_SIZE 64
#define DEFAULT_PRIVATE_DO 1
static void
usage(int status)

Loading…
Cancel
Save