summaryrefslogtreecommitdiffstats
path: root/misc/ykpers
diff options
context:
space:
mode:
Diffstat (limited to 'misc/ykpers')
-rw-r--r--misc/ykpers/README19
-rw-r--r--misc/ykpers/fix-boolean-value-with-json-c-0.14.patch83
-rw-r--r--misc/ykpers/ykpers.SlackBuild25
-rw-r--r--misc/ykpers/ykpers.info2
4 files changed, 114 insertions, 15 deletions
diff --git a/misc/ykpers/README b/misc/ykpers/README
index 606e3c3d76..6c2f96c4ad 100644
--- a/misc/ykpers/README
+++ b/misc/ykpers/README
@@ -1,12 +1,13 @@
-ykpers (yubikey-personalization) is a library and command-line tool to perform
-personalization of Yubico YubiKeys and is a reference implementation for
-YubiKey configuration.
+ykpers (yubikey-personalization) is a library and command-line tool
+to perform personalization of Yubico YubiKeys and is a reference
+implementation for YubiKey configuration.
-For challenge-response mode to work as a normal user, you will have to create
-a 'yubikey' group and add your user to it. The recommended GID is 288. You can
-create this by doing the following:
-groupadd -g 288 yubikey
+For challenge-response mode to work as a normal user, you will have
+to create a 'yubikey' group and add your user to it. The recommended
+GID is 288. You can create this by doing the following: groupadd -g
+288 yubikey
+
+You can use the plugdev group (or another group) if you like, by passing
+a group name to the script:
-You can use the plugdev group (or another group) if you like, by passing a
-group name to the script:
GROUPNAME=plugdev ./ykpers.SlackBuild
diff --git a/misc/ykpers/fix-boolean-value-with-json-c-0.14.patch b/misc/ykpers/fix-boolean-value-with-json-c-0.14.patch
new file mode 100644
index 0000000000..8a57ea3184
--- /dev/null
+++ b/misc/ykpers/fix-boolean-value-with-json-c-0.14.patch
@@ -0,0 +1,83 @@
+From 0aa2e2cae2e1777863993a10c809bb50f4cde7f8 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <mail@eworm.de>
+Date: Sat, 25 Apr 2020 20:55:28 +0200
+Subject: [PATCH 1/1] fix boolean value with json-c 0.14
+
+Upstream removed the TRUE and FALSE defines in commit
+0992aac61f8b087efd7094e9ac2b84fa9c040fcd.
+---
+ ykpers-json.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/ykpers-json.c b/ykpers-json.c
+index a62e907..15ad380 100644
+--- a/ykpers-json.c
++++ b/ykpers-json.c
+@@ -40,7 +40,7 @@
+ #define yk_json_object_object_get(obj, key, value) json_object_object_get_ex(obj, key, &value)
+ #else
+ typedef int json_bool;
+-#define yk_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? (json_bool)FALSE : (json_bool)TRUE
++#define yk_json_object_object_get(obj, key, value) (value = json_object_object_get(obj, key)) == NULL ? 0 : 1
+ #endif
+
+ static void set_json_value(struct map_st *p, int mode, json_object *options, YKP_CONFIG *cfg) {
+@@ -50,7 +50,7 @@ static void set_json_value(struct map_st *p, int mode, json_object *options, YKP
+ if(p->mode && (mode & p->mode) == mode) {
+ json_object *joption;
+ json_bool ret = yk_json_object_object_get(options, p->json_text, joption);
+- if(ret == TRUE && json_object_get_type(joption) == json_type_boolean) {
++ if(ret == 1 && json_object_get_type(joption) == json_type_boolean) {
+ int value = json_object_get_boolean(joption);
+ if(value == 1) {
+ p->setter(cfg, true);
+@@ -230,20 +230,20 @@ int _ykp_json_import_cfg(YKP_CONFIG *cfg, const char *json, size_t len) {
+ ykp_errno = YKP_EINVAL;
+ goto out;
+ }
+- if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == FALSE) {
++ if(yk_json_object_object_get(jobj, "yubiProdConfig", yprod_json) == 0) {
+ ykp_errno = YKP_EINVAL;
+ goto out;
+ }
+- if(yk_json_object_object_get(yprod_json, "mode", jmode) == FALSE) {
++ if(yk_json_object_object_get(yprod_json, "mode", jmode) == 0) {
+ ykp_errno = YKP_EINVAL;
+ goto out;
+ }
+- if(yk_json_object_object_get(yprod_json, "options", options) == FALSE) {
++ if(yk_json_object_object_get(yprod_json, "options", options) == 0) {
+ ykp_errno = YKP_EINVAL;
+ goto out;
+ }
+
+- if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == TRUE) {
++ if(yk_json_object_object_get(yprod_json, "targetConfig", jtarget) == 1) {
+ int target_config = json_object_get_int(jtarget);
+ int command;
+ if(target_config == 1) {
+@@ -275,13 +275,13 @@ int _ykp_json_import_cfg(YKP_CONFIG *cfg, const char *json, size_t len) {
+ if(mode == MODE_OATH_HOTP) {
+ json_object *jdigits, *jrandom;
+ ykp_set_tktflag_OATH_HOTP(cfg, true);
+- if(yk_json_object_object_get(options, "oathDigits", jdigits) == TRUE) {
++ if(yk_json_object_object_get(options, "oathDigits", jdigits) == 1) {
+ int digits = json_object_get_int(jdigits);
+ if(digits == 8) {
+ ykp_set_cfgflag_OATH_HOTP8(cfg, true);
+ }
+ }
+- if(yk_json_object_object_get(options, "randomSeed", jrandom) == TRUE) {
++ if(yk_json_object_object_get(options, "randomSeed", jrandom) == 1) {
+ int random = json_object_get_boolean(jrandom);
+ int seed = 0;
+ if(random == 1) {
+@@ -290,7 +290,7 @@ int _ykp_json_import_cfg(YKP_CONFIG *cfg, const char *json, size_t len) {
+ goto out;
+ } else {
+ json_object *jseed;
+- if(yk_json_object_object_get(options, "fixedSeedvalue", jseed) == TRUE) {
++ if(yk_json_object_object_get(options, "fixedSeedvalue", jseed) == 1) {
+ seed = json_object_get_int(jseed);
+ }
+ }
diff --git a/misc/ykpers/ykpers.SlackBuild b/misc/ykpers/ykpers.SlackBuild
index f6aca572e7..ceb96b89f9 100644
--- a/misc/ykpers/ykpers.SlackBuild
+++ b/misc/ykpers/ykpers.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for ykpers
@@ -22,10 +22,13 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=ykpers
VERSION=${VERSION:-1.20.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +38,14 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -71,7 +81,10 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-CFLAGS="$SLKCFLAGS" \
+# Thanks archlinux!
+patch -p1 < $CWD/fix-boolean-value-with-json-c-0.14.patch
+
+CFLAGS="$SLKCFLAGS -fcommon" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
@@ -104,8 +117,10 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+rm -f $PKG/usr/lib*/*.la
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/misc/ykpers/ykpers.info b/misc/ykpers/ykpers.info
index 6667c26b02..077916cd82 100644
--- a/misc/ykpers/ykpers.info
+++ b/misc/ykpers/ykpers.info
@@ -1,7 +1,7 @@
PRGNAM="ykpers"
VERSION="1.20.0"
HOMEPAGE="https://developers.yubico.com/yubikey-personalization/"
-DOWNLOAD="https://developers.yubico.com/yubikey-personalization/releases/ykpers-1.20.0.tar.gz"
+DOWNLOAD="https://developers.yubico.com/yubikey-personalization/Releases/ykpers-1.20.0.tar.gz"
MD5SUM="8749113ce5a0164fe2b429b61242ba0f"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""