diff -Nru stoken-0.91/debian/changelog stoken-0.91/debian/changelog --- stoken-0.91/debian/changelog 2017-01-09 06:08:58.000000000 +0000 +++ stoken-0.91/debian/changelog 2017-11-01 23:13:39.000000000 +0000 @@ -1,3 +1,9 @@ +stoken (0.91-1+rpi1) buster-staging; urgency=medium + + * Apply patch from BTS to fix build failure with new tomcrypt (Closes: 878883) + + -- Peter Michael Green Wed, 01 Nov 2017 23:13:39 +0000 + stoken (0.91-1) unstable; urgency=medium * Imported Upstream version 0.91 diff -Nru stoken-0.91/debian/patches/0001-stc-tomcrypt-be-compatible-with-libtomcrypt-1.18.patch stoken-0.91/debian/patches/0001-stc-tomcrypt-be-compatible-with-libtomcrypt-1.18.patch --- stoken-0.91/debian/patches/0001-stc-tomcrypt-be-compatible-with-libtomcrypt-1.18.patch 1970-01-01 00:00:00.000000000 +0000 +++ stoken-0.91/debian/patches/0001-stc-tomcrypt-be-compatible-with-libtomcrypt-1.18.patch 2017-11-01 23:13:39.000000000 +0000 @@ -0,0 +1,62 @@ +From ad699a86e0f9d8c19eabccba5610b4746a5e00e3 Mon Sep 17 00:00:00 2001 +From: Mike Miller +Date: Wed, 18 Oct 2017 16:10:44 -0700 +Subject: [PATCH] stc-tomcrypt: be compatible with libtomcrypt 1.18 + +In libtomcrypt 1.18 the LTC_LTC_PKCS_1_* constants were renamed to +LTC_PKCS_1_*. Add an autoconf test for this change and define an alias +to the old name when building against the older API. + +Signed-off-by: Mike Miller +--- + configure.ac | 8 ++++++++ + src/stc-tomcrypt.c | 7 ++++++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index f198048a29fa..3b93bc781597 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -185,6 +185,14 @@ if test "$with_tomcrypt" != no -a "$with_nettle" != yes; then + EXTRA_PC_LIBS="$EXTRA_PC_LIBS $TOMCRYPT_PC_LIBS"], + [AC_MSG_RESULT([no])]) + ++ AC_MSG_CHECKING([whether libtomcrypt uses newer LTC_PKCS_1_V1_5 naming convention]) ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include ], ++ [int padding = LTC_PKCS_1_V1_5;])], ++ [AC_MSG_RESULT([yes])], ++ [AC_MSG_RESULT([no]) ++ AC_DEFINE([LIBTOMCRYPT_OLD_PKCS_NAMES], [1], ++ [libtomcrypt uses the pre-1.18 PKCS #1 constant naming convention])]) ++ + LIBS="$saved_LIBS" + CFLAGS="$saved_CFLAGS" + fi +diff --git a/src/stc-tomcrypt.c b/src/stc-tomcrypt.c +index 45b1bee7faf2..424c7360cd64 100644 +--- a/src/stc-tomcrypt.c ++++ b/src/stc-tomcrypt.c +@@ -37,6 +37,11 @@ + #define AES_KEY_SIZE 16 + #define AES256_KEY_SIZE 32 + ++/* Backwards compatibility support for pre-1.18 versions of libtomcrypt */ ++#ifdef LIBTOMCRYPT_OLD_PKCS_NAMES ++#define LTC_PKCS_1_V1_5 LTC_LTC_PKCS_1_V1_5 ++#endif ++ + int stc_standalone_init(void) + { + /* libtomcrypt init for sdtid BatchSignature generation */ +@@ -190,7 +195,7 @@ int stc_rsa_sha1_sign_digest(const uint8_t *privkey_der, size_t privkey_len, + if (rsa_import(privkey_der, privkey_len, &key) != CRYPT_OK) + return ERR_GENERAL; + if (rsa_sign_hash_ex(digest, (160 / 8), out, outlen, +- LTC_LTC_PKCS_1_V1_5, NULL, 0, ++ LTC_PKCS_1_V1_5, NULL, 0, + hash_idx, 0, &key) != CRYPT_OK) + rc = ERR_GENERAL; + +-- +2.14.2 + diff -Nru stoken-0.91/debian/patches/series stoken-0.91/debian/patches/series --- stoken-0.91/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ stoken-0.91/debian/patches/series 2017-11-01 23:13:39.000000000 +0000 @@ -0,0 +1 @@ +0001-stc-tomcrypt-be-compatible-with-libtomcrypt-1.18.patch diff -Nru stoken-0.91/debian/.pc/.quilt_patches stoken-0.91/debian/.pc/.quilt_patches --- stoken-0.91/debian/.pc/.quilt_patches 1970-01-01 00:00:00.000000000 +0000 +++ stoken-0.91/debian/.pc/.quilt_patches 2017-11-01 23:13:39.000000000 +0000 @@ -0,0 +1 @@ +patches diff -Nru stoken-0.91/debian/.pc/.quilt_series stoken-0.91/debian/.pc/.quilt_series --- stoken-0.91/debian/.pc/.quilt_series 1970-01-01 00:00:00.000000000 +0000 +++ stoken-0.91/debian/.pc/.quilt_series 2017-11-01 23:13:39.000000000 +0000 @@ -0,0 +1 @@ +series diff -Nru stoken-0.91/debian/.pc/.version stoken-0.91/debian/.pc/.version --- stoken-0.91/debian/.pc/.version 1970-01-01 00:00:00.000000000 +0000 +++ stoken-0.91/debian/.pc/.version 2017-11-01 23:13:39.000000000 +0000 @@ -0,0 +1 @@ +2