Browse Source

l/scute: Upgraded to scute-1.6.0.

slackware-14.2
Damien Goutte-Gattat 2 years ago
parent
commit
f5b0ac7376
  1. 33
      l/scute/scute-1.5.0-LEARN-sendinfo.patch
  2. 84
      l/scute/scute-1.5.0-scutesig.patch
  3. 1
      l/scute/scute-1.5.0.tar.bz2.sha256
  4. 1
      l/scute/scute-1.6.0.tar.bz2.sha256
  5. 22
      l/scute/scute.SlackBuild

33
l/scute/scute-1.5.0-LEARN-sendinfo.patch

@ -1,33 +0,0 @@
commit f31e6af6e2d9e320dedc89e0b6b2692b7d72cda7
Author: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Date: Sat May 19 23:03:21 2018 +0100
Do not request certificate data when LEARNing.
* src/agent.c (scute_agent_learn): Use LEARN --sendinfo instead
of LEARN --send.
--
Using --send is useless here and we don't even collect the data
that the agent may send (no data callback), which may cause the
LEARN command to fail.
Of note, the --sendinfo option is available since GnuPG 2.1.1,
meaning Scute would not work anymore with GnuPG 2.0.x. Since that
branch is now EOLed, this should not be a concern.
Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
diff --git a/src/agent.c b/src/agent.c
index 108e1ea..46d56d5 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -640,7 +640,7 @@ scute_agent_learn (struct agent_card_info_s *info)
gpg_error_t err;
memset (info, 0, sizeof (*info));
- err = assuan_transact (agent_ctx, "LEARN --send",
+ err = assuan_transact (agent_ctx, "LEARN --sendinfo",
NULL, NULL, default_inq_cb,
NULL, learn_status_cb, info);

84
l/scute/scute-1.5.0-scutesig.patch

@ -1,84 +0,0 @@
commit 219120376e0b984f2c85aea27929c81b326365b2
Author: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Date: Sun May 20 16:52:45 2018 +0100
Allow to use the signing key.
* configure.ac: New flag --enable-signing-key.
* src/Makefile.am: Build scutesig, which uses the signing key.
* src/slots.c (slot_init): Use the signing key if building scutesig.
(session_sign): Likewise.
--
This patch allows to build scutesig.so, a version of Scute which
uses the signing key, along with the normal scute.so which uses
the authentication key.
Suggested-by: Dirk Gottschalk <dirk.gottschalk1980@googlemail.com>
Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
diff --git a/configure.ac b/configure.ac
index 3615a49..8c8f1b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -313,6 +313,11 @@ else
fi
AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no")
+# Use signing key?
+AC_ARG_ENABLE([signing-key],
+ AS_HELP_STRING([--enable-signing-key],
+ [Build a version of Scute using the signing key]))
+AM_CONDITIONAL([ENABLE_SCUTESIG], [test "$enable_signing_key" = yes])
dnl Check for GPGSM version requirement.
GPGSM_VERSION=unknown
diff --git a/src/Makefile.am b/src/Makefile.am
index 9ceef93..8063ab9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -133,3 +133,12 @@ scute_la_LIBADD = $(scute_libadd) \
scute_la_CPPFLAGS = -I$(srcdir)/../include \
@LIBASSUAN_CFLAGS@ @GPG_ERROR_CFLAGS@
scute_la_SOURCES = $(sources)
+
+if ENABLE_SCUTESIG
+lib_LTLIBRARIES += scutesig.la
+scutesig_la_LDFLAGS = $(scute_la_LDFLAGS)
+scutesig_la_DEPENDENCIES = $(scute_la_DEPENDENCIES)
+scutesig_la_LIBADD = $(scute_la_LIBADD)
+scutesig_la_CPPFLAGS = $(scute_la_CPPFLAGS) -DENABLE_SIGNING_KEY
+scutesig_la_SOURCES = $(scute_la_SOURCES)
+endif
diff --git a/src/slots.c b/src/slots.c
index fc69d15..f414331 100644
--- a/src/slots.c
+++ b/src/slots.c
@@ -385,7 +385,12 @@ slot_init (slot_iterator_t id)
gpg_error_t err = 0;
struct slot *slot = scute_table_data (slots, id);
+#if ENABLE_SIGNING_KEY
+ err = scute_gpgsm_get_cert (slot->info.grip1, 1, add_object, slot);
+#else
err = scute_gpgsm_get_cert (slot->info.grip3, 3, add_object, slot);
+#endif
+
if (err)
goto init_out;
@@ -1033,8 +1038,14 @@ session_sign (slot_iterator_t id, session_iterator_t sid,
}
sig_len = *pulSignatureLen;
+#if ENABLE_SIGNING_KEY
+ err = scute_agent_sign (slot->info.grip1, pData, ulDataLen,
+ pSignature, &sig_len);
+#else
err = scute_agent_sign (slot->info.grip3, pData, ulDataLen,
pSignature, &sig_len);
+#endif
+
/* FIXME: Oh well. */
if (gpg_err_code (err) == GPG_ERR_INV_ARG)
return CKR_BUFFER_TOO_SMALL;

1
l/scute/scute-1.5.0.tar.bz2.sha256

@ -1 +0,0 @@
6199d28d8ce17f979f67059b461ab55a2276fc390eaa45e5ce6ff615bf81ab96 scute-1.5.0.tar.bz2

1
l/scute/scute-1.6.0.tar.bz2.sha256

@ -0,0 +1 @@
511be523407590a586b7d61b5985af965dd91901b75d9650b55e9ae1d86d0ab0 scute-1.6.0.tar.bz2

22
l/scute/scute.SlackBuild

@ -1,6 +1,6 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2014,2015,2017,2018 Damien Goutte-Gattat
# Copyright (C) 2014,2015,2017,2018,2019 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
@ -23,16 +23,18 @@
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest scute sourcecode is available at: <http://www.scute.org/>.
#
# Depends: l/libassuan
# Source package infos
NAMESRC=${NAMESRC:-scute}
VERSION=${VERSION:-1.5.0}
VERSION=${VERSION:-1.6.0}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.bz2}
WGET=${WGET:-https://gnupg.org/ftp/gcrypt/scute/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-scute}
BUILD=${BUILD:-2GGD}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -83,21 +85,14 @@ cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
# Use LEARN --sendinfo instead of LEARN --send
patch -p 1 < $CWD/scute-1.5.0-LEARN-sendinfo.patch
# Allow use of signing key
patch -p 1 < $CWD/scute-1.5.0-scutesig.patch
# Build
./autogen.sh
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
--prefix=/usr \
--libdir=/usr/lib$LIBDIRSUFFIX \
--infodir=/usr/info \
--with-gpg-connect-agent=/usr/bin/gpg-connect-agent \
--enable-signing-key \
--build=$ARCH-slackware-linux
make -j $JOBS
make install-strip DESTDIR=$PKG
@ -108,11 +103,16 @@ find $PKG/usr/info -type f -exec gzip -9 {} \;
# Install the documentation
mkdir -p $PKG/usr/doc/$NAMEPKG-$VERSION
install -m 644 AUTHORS COPYING ChangeLog NEWS README TODO $PKG/usr/doc/$NAMEPKG-$VERSION
install -m 644 AUTHORS COPYING.LESSER ChangeLog NEWS README TODO $PKG/usr/doc/$NAMEPKG-$VERSION
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Add dependency infos
cat <<EOF > $PKG/install/slack-required
libassuan
EOF
# Package the tree
cd $PKG
mkdir -p $OUT

Loading…
Cancel
Save