diff options
author | Alex J. Malozemoff | 2017-06-02 10:58:58 -0700 |
---|---|---|
committer | Alex J. Malozemoff | 2017-06-02 10:58:58 -0700 |
commit | 5039909a098a12c0d908c58a1666e1f32b856f50 (patch) | |
tree | 7bb8535db9442c12b0887b2db75576e8332a63a5 | |
download | aur-5039909a098a12c0d908c58a1666e1f32b856f50.tar.gz |
libksi v3.13.2043
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 36 | ||||
-rw-r--r-- | openssl.1.1.0f.patch | 87 |
4 files changed, 147 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f7784c70ac00 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = libksi + pkgdesc = Guardtime KSI C SDK + pkgver = 3.13.2043 + pkgrel = 1 + url = https://github.com/guardtime/libksi + arch = i686 + arch = x86_64 + license = Apache + makedepends = automake + makedepends = gcc + depends = curl + depends = openssl + provides = libksi + source = https://github.com/guardtime/libksi/archive/v3.13.2043.tar.gz + source = openssl.1.1.0f.patch + md5sums = e0d99dc30db4889a39249fbc76f65459 + md5sums = b9fb84b5a027a948628dfe36046f7b3f + +pkgname = libksi + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d778e6b9e155 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.tar.xz +*.tar.gz +pkg/ +src/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..844c3c8e16d0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,36 @@ +# Maintainer: Alex J. Malozemoff <amaloz@galois.com> +pkgname=libksi +pkgver=3.13.2043 +pkgrel=1 +pkgdesc="Guardtime KSI C SDK" +arch=('i686' 'x86_64') +url="https://github.com/guardtime/libksi" +license=('Apache') +depends=('curl' 'openssl') +makedepends=('automake' 'gcc') +provides=('libksi') + +source=("https://github.com/guardtime/$pkgname/archive/v$pkgver.tar.gz" + "openssl.1.1.0f.patch") +md5sums=('e0d99dc30db4889a39249fbc76f65459' + 'b9fb84b5a027a948628dfe36046f7b3f') + +prepare() { + cd "$srcdir/$pkgname-$pkgver" + + patch -p1 -i "$srcdir/openssl.1.1.0f.patch" + autoreconf -i +} + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make DESTDIR="$pkgdir/" install +} diff --git a/openssl.1.1.0f.patch b/openssl.1.1.0f.patch new file mode 100644 index 000000000000..81854d267af6 --- /dev/null +++ b/openssl.1.1.0f.patch @@ -0,0 +1,87 @@ +diff --git a/configure.ac b/configure.ac +index 5b2a4bb..55078e2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -170,7 +170,7 @@ case "${target_os}" in + esac + + # To ensure compatibility with Microsoft compiler. +-CFLAGS+= " -Wdeclaration-after-statement" ++CFLAGS+=" -Wdeclaration-after-statement" + # Add more warnings + CFLAGS+=" -Wall" + AC_ARG_WITH(unit-test-xml, +diff --git a/src/ksi/hash_openssl.c b/src/ksi/hash_openssl.c +index 4eacc49..8d64c66 100644 +--- a/src/ksi/hash_openssl.c ++++ b/src/ksi/hash_openssl.c +@@ -101,9 +101,8 @@ int KSI_isHashAlgorithmSupported(KSI_HashAlgorithm algo_id) { + void KSI_DataHasher_free(KSI_DataHasher *hasher) { + if (hasher != NULL) { + if (hasher->hashContext != NULL) { +- EVP_MD_CTX_cleanup(hasher->hashContext); ++ EVP_MD_CTX_free(hasher->hashContext); + } +- KSI_free(hasher->hashContext); + KSI_free(hasher); + } + } +@@ -172,7 +171,7 @@ int KSI_DataHasher_reset(KSI_DataHasher *hasher) { + + context = hasher->hashContext; + if (context == NULL) { +- context = KSI_new(EVP_MD_CTX); ++ context = EVP_MD_CTX_new(); + if (context == NULL) { + KSI_pushError(hasher->ctx, res = KSI_OUT_OF_MEMORY, NULL); + goto cleanup; +diff --git a/src/ksi/pkitruststore_openssl.c b/src/ksi/pkitruststore_openssl.c +index f42a348..e213cc7 100644 +--- a/src/ksi/pkitruststore_openssl.c ++++ b/src/ksi/pkitruststore_openssl.c +@@ -1020,13 +1020,13 @@ cleanup: + int KSI_PKITruststore_verifyRawSignature(KSI_CTX *ctx, const unsigned char *data, size_t data_len, const char *algoOid, const unsigned char *signature, size_t signature_len, const KSI_PKICertificate *certificate) { + int res; + ASN1_OBJECT* algorithm = NULL; +- EVP_MD_CTX md_ctx; ++ EVP_MD_CTX *md_ctx; + X509 *x509 = NULL; + const EVP_MD *evp_md; + EVP_PKEY *pubKey = NULL; + + /* Needs to be initialized before jumping to cleanup. */ +- EVP_MD_CTX_init(&md_ctx); ++ md_ctx = EVP_MD_CTX_new(); + + KSI_ERR_clearErrors(ctx); + +@@ -1069,17 +1069,17 @@ int KSI_PKITruststore_verifyRawSignature(KSI_CTX *ctx, const unsigned char *data + goto cleanup; + } + +- if (!EVP_VerifyInit(&md_ctx, evp_md)) { ++ if (!EVP_VerifyInit(md_ctx, evp_md)) { + KSI_pushError(ctx, res = KSI_CRYPTO_FAILURE, NULL); + goto cleanup; + } + +- if (!EVP_VerifyUpdate(&md_ctx, (unsigned char *)data, data_len)) { ++ if (!EVP_VerifyUpdate(md_ctx, (unsigned char *)data, data_len)) { + KSI_pushError(ctx, res = KSI_CRYPTO_FAILURE, NULL); + goto cleanup; + } + +- res = EVP_VerifyFinal(&md_ctx, (unsigned char *)signature, (unsigned)signature_len, pubKey); ++ res = EVP_VerifyFinal(md_ctx, (unsigned char *)signature, (unsigned)signature_len, pubKey); + if (res < 0) { + KSI_pushError(ctx, res = KSI_CRYPTO_FAILURE, NULL); + goto cleanup; +@@ -1095,7 +1095,7 @@ int KSI_PKITruststore_verifyRawSignature(KSI_CTX *ctx, const unsigned char *data + + cleanup: + +- EVP_MD_CTX_cleanup(&md_ctx); ++ EVP_MD_CTX_free(md_ctx); + if (algorithm != NULL) ASN1_OBJECT_free(algorithm); + if (pubKey != NULL) EVP_PKEY_free(pubKey); + |