Browse Source

n/gnupg2: Added gnupg2-2.0.26.

slackware-14.2
Damien Goutte-Gattat 7 years ago
parent
commit
513bcf8536
  1. 61
      n/gnupg2/gnupg-2.0.26-tls12.diff
  2. 1
      n/gnupg2/gnupg-2.0.26.tar.bz2.sha1
  3. 137
      n/gnupg2/gnupg2.SlackBuild
  4. 12
      n/gnupg2/slack-desc

61
n/gnupg2/gnupg-2.0.26-tls12.diff

@ -0,0 +1,61 @@
diff --git a/agent/agent.h b/agent/agent.h
index 938a9aa..6431bb2 100644
--- a/agent/agent.h
+++ b/agent/agent.h
@@ -41,6 +41,7 @@
#define GCRY_MODULE_ID_USER 1024
#endif
#define MD_USER_TLS_MD5SHA1 (GCRY_MODULE_ID_USER+1)
+#define MD_USER_TLS_DIGEST (GCRY_MODULE_ID_USER+2)
/* Maximum length of a digest. */
#define MAX_DIGEST_LEN 64
diff --git a/agent/command.c b/agent/command.c
index 2405c54..31e7b93 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -624,6 +624,8 @@ cmd_sethash (assuan_context_t ctx, char *line)
algo = GCRY_MD_MD5;
else if (has_option (line, "--hash=tls-md5sha1"))
algo = MD_USER_TLS_MD5SHA1;
+ else if (has_option (line, "--hash=tls-digest"))
+ algo = MD_USER_TLS_DIGEST;
else
return set_error (GPG_ERR_ASS_PARAMETER, "invalid hash algorithm");
}
@@ -651,6 +653,8 @@ cmd_sethash (assuan_context_t ctx, char *line)
n /= 2;
if (algo == MD_USER_TLS_MD5SHA1 && n == 36)
;
+ else if (algo == MD_USER_TLS_DIGEST && (n == 35 || n == 51))
+ ;
else if (n != 16 && n != 20 && n != 24
&& n != 28 && n != 32 && n != 48 && n != 64)
return set_error (GPG_ERR_ASS_PARAMETER, "unsupported length of hash");
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index 1f36f6e..b3c1301 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -342,7 +342,7 @@ divert_pksign (ctrl_t ctrl,
if (rc)
return rc;
- if (algo == MD_USER_TLS_MD5SHA1)
+ if (algo == MD_USER_TLS_MD5SHA1 || algo == MD_USER_TLS_DIGEST)
{
int save = ctrl->use_auth_call;
ctrl->use_auth_call = 1;
diff --git a/agent/pksign.c b/agent/pksign.c
index 25cadb2..9f19478 100644
--- a/agent/pksign.c
+++ b/agent/pksign.c
@@ -184,7 +184,8 @@ agent_pksign_do (ctrl_t ctrl, const char *desc_text,
gcry_sexp_t s_hash = NULL;
/* Put the hash into a sexp */
- if (ctrl->digest.algo == MD_USER_TLS_MD5SHA1)
+ if (ctrl->digest.algo == MD_USER_TLS_MD5SHA1
+ || ctrl->digest.algo == MD_USER_TLS_DIGEST)
rc = do_encode_raw_pkcs1 (ctrl->digest.value,
ctrl->digest.valuelen,
gcry_pk_get_nbits (s_skey),

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

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

137
n/gnupg2/gnupg2.SlackBuild

@ -0,0 +1,137 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2014 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# 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.
# Source package infos
NAMESRC=${NAMESRC:-gnupg}
VERSION=${VERSION:-2.0.26}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.bz2}
WGET=${WGET:-ftp://ftp.gnupg.org/gcrypt/gnupg/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-gnupg2}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exists or is not a directory!"
exit 1
fi
# Compilation flags
LIBDIRSUFFIX=""
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
LIBDIRSUFFIX="64"
;;
*)
CPUOPT="-O2"
;;
esac
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Compile
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
patch -p 1 < $CWD/gnupg-2.0.26-tls12.diff
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
./configure \
--prefix=/usr \
--libdir=/usr/lib$LIBDIRSUFFIX \
--sysconfdir=/etc \
--mandir=/usr/man \
--infodir=/usr/info \
--docdir=/usr/doc/$NAMEPKG-$VERSION \
--build=$ARCH-slackware-linux
make -j $JOBS
make install-strip DESTDIR=$PKG
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
make gnupg.html
mv gnupg.html $PKG/usr/doc/$NAMEPKG-$VERSION/html
)
install -m 644 AUTHORS COPYING COPYING.LIB ChangeLog NEWS THANKS TODO \
$PKG/usr/doc/$NAMEPKG-$VERSION
# Copy slack-desc file
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

12
n/gnupg2/slack-desc

@ -0,0 +1,12 @@
|-----handy-ruler-----------------------------------------------------|
gnupg2: gnupg2 (The GNU Privacy Guard version 2.x)
gnupg2:
gnupg2: GnuPG is GNU's tool for secure communication and data storage. It can
gnupg2: be used to encrypt data and to create digital signatures. It includes
gnupg2: an advanced key management facility and is compliant with the proposed
gnupg2: OpenPGP Internet standard as described in RFC2440 and the S/MIME
gnupg2: standard as described by several RFCs.
gnupg2:
gnupg2: GnuPG 2.0 is the stable version of GnuPG integrating support for
gnupg2: OpenPGP and S/MIME. It does not conflict with an installed 1.4.x
gnupg2: OpenPGP-only version.
Loading…
Cancel
Save