Browse Source

n/gnupg2: Upgraded to gnupg2-2.1.0.

slackware-14.2
Damien Goutte-Gattat 7 years ago
parent
commit
a0a4d0517f
  1. 95
      n/gnupg2/gnupg-2.0.26-gpgsm-sha2.diff
  2. 1
      n/gnupg2/gnupg-2.0.26.tar.bz2.sha1
  3. 1
      n/gnupg2/gnupg-2.1.0.tar.bz2.sha1
  4. 16
      n/gnupg2/gnupg2.SlackBuild

95
n/gnupg2/gnupg-2.0.26-gpgsm-sha2.diff

@ -1,95 +0,0 @@
commit 431f4a3e4db197a663264d628cd7db4b0352f64c
Author: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Date: Sun Sep 7 13:53:13 2014 +0200
Fix usage of SHA-2 algorithm with OpenPGP cards.
Backport commit 1c09def22d97de3738a2bec4970504bfc155680b into the
2.0.26 version.
diff --git a/agent/agent.h b/agent/agent.h
index 938a9aa..2c8dc75 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -370,6 +370,7 @@ int agent_card_pksign (ctrl_t ctrl,
const char *keyid,
int (*getpin_cb)(void *, const char *, char*, size_t),
void *getpin_cb_arg,
+ int mdalgo,
const unsigned char *indata, size_t indatalen,
unsigned char **r_buf, size_t *r_buflen);
int agent_card_pkdecrypt (ctrl_t ctrl,
diff --git a/agent/call-scd.c b/agent/call-scd.c
index 9a2e65e..9785696 100644
--- a/agent/call-scd.c
+++ b/agent/call-scd.c
@@ -804,13 +804,32 @@ inq_needpin (void *opaque, const char *line)
}
+/* Helper returning a command option to describe the used hash
+ algorithm. See scd/command.c:cmd_pksign. */
+static const char *
+hash_algo_option (int algo)
+{
+ switch (algo)
+ {
+ case GCRY_MD_MD5 : return "--hash=md5";
+ case GCRY_MD_RMD160: return "--hash=rmd160";
+ case GCRY_MD_SHA1 : return "--hash=sha1";
+ case GCRY_MD_SHA224: return "--hash=sha224";
+ case GCRY_MD_SHA256: return "--hash=sha256";
+ case GCRY_MD_SHA384: return "--hash=sha384";
+ case GCRY_MD_SHA512: return "--hash=sha512";
+ default: return "";
+ }
+}
-/* Create a signature using the current card */
+/* Create a signature using the current card. MDALGO is either 0 or
+ gives the digest algorithm. */
int
agent_card_pksign (ctrl_t ctrl,
const char *keyid,
int (*getpin_cb)(void *, const char *, char*, size_t),
void *getpin_cb_arg,
+ int mdalgo,
const unsigned char *indata, size_t indatalen,
unsigned char **r_buf, size_t *r_buflen)
{
@@ -844,8 +863,11 @@ agent_card_pksign (ctrl_t ctrl,
inqparm.getpin_cb = getpin_cb;
inqparm.getpin_cb_arg = getpin_cb_arg;
inqparm.passthru = 0;
- snprintf (line, DIM(line)-1,
- ctrl->use_auth_call? "PKAUTH %s":"PKSIGN %s", keyid);
+ if (ctrl->use_auth_call)
+ snprintf (line, DIM(line)-1, "PKAUTH %s", keyid);
+ else
+ snprintf (line, DIM(line)-1, "PKSIGN %s %s",
+ hash_algo_option (mdalgo), keyid);
line[DIM(line)-1] = 0;
rc = assuan_transact (ctrl->scd_local->ctx, line,
membuf_data_cb, &data,
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index 1f36f6e..ee5bcc7 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -347,7 +347,7 @@ divert_pksign (ctrl_t ctrl,
int save = ctrl->use_auth_call;
ctrl->use_auth_call = 1;
rc = agent_card_pksign (ctrl, kid, getpin_cb, ctrl,
- digest, digestlen, &sigval, &siglen);
+ algo, digest, digestlen, &sigval, &siglen);
ctrl->use_auth_call = save;
}
else
@@ -359,7 +359,7 @@ divert_pksign (ctrl_t ctrl,
if (!rc)
{
rc = agent_card_pksign (ctrl, kid, getpin_cb, ctrl,
- data, ndata, &sigval, &siglen);
+ algo, data, ndata, &sigval, &siglen);
xfree (data);
}
}

1
n/gnupg2/gnupg-2.0.26.tar.bz2.sha1

@ -1 +0,0 @@
3ff5b38152c919724fd09cf2f17df704272ba192 gnupg-2.0.26.tar.bz2

1
n/gnupg2/gnupg-2.1.0.tar.bz2.sha1

@ -0,0 +1 @@
2fcd0ca6889ef6cb59e3275e8411f8b7778c2f33 gnupg-2.1.0.tar.bz2

16
n/gnupg2/gnupg2.SlackBuild

@ -22,21 +22,17 @@
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest gnupg sourcecode is available at: <http://www.incenp.org/>.
#
# This script builds a patched version of the GnuPG 2.0.26 to replace
# the package provided by Slackware-14.1. The applied patch makes
# GPG-Agent work with Scute for TLS 1.2 authentication.
# Latest gnupg sourcecode is available at: <http://www.gnupg.org/>.
# Source package infos
NAMESRC=${NAMESRC:-gnupg}
VERSION=${VERSION:-2.0.26}
VERSION=${VERSION:-2.1.0}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.bz2}
WGET=${WGET:-ftp://ftp.gnupg.org/gcrypt/gnupg/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-gnupg2}
BUILD=${BUILD:-5GGD}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
@ -87,7 +83,6 @@ cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
patch -p 1 < $CWD/gnupg-2.0.26-gpgsm-sha2.diff
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
@ -97,7 +92,6 @@ CXXFLAGS=$CPUOPT \
--mandir=/usr/man \
--infodir=/usr/info \
--docdir=/usr/doc/$NAMEPKG-$VERSION \
--enable-standard-socket \
--build=$ARCH-slackware-linux
make -j $JOBS
make install-strip DESTDIR=$PKG
@ -106,10 +100,6 @@ rm $PKG/usr/info/dir
# Compress man and info pages
find $PKG/usr/man -type f -exec gzip -9 {} \;
find $PKG/usr/info -type f -exec gzip -9 {} \;
for manpage in $(find $PKG/usr/man -type l); do
ln -s $(readlink $manpage).gz $manpage.gz
rm -f $manpage
done
# Install the documentation
(cd doc

Loading…
Cancel
Save