Fails to build:Linux arch-box 4.0.2-1-ARCH #1 SMP PREEMPT Thu May 7 06:47:54 CEST 2015 x86_64 GNU/Linux
make[4]: Leaving directory '/tmp/aur/gnutls2/src/gnutls-2.12.23/lib/openpgp'
Making all in nettle
make[4]: Entering directory '/tmp/aur/gnutls2/src/gnutls-2.12.23/lib/nettle'
CC pk.lo
pk.c:57:31: warning: 'struct dsa_public_key' declared inside parameter list
struct dsa_public_key *pub)
^
pk.c:57:31: warning: its scope is only this definition or declaration, which is probably not what you want
pk.c: In function '_dsa_params_to_pubkey':
pk.c:59:15: error: dereferencing pointer to incomplete type
memcpy (&pub->p, pk_params->params[0], sizeof (mpz_t));
^
pk.c:60:15: error: dereferencing pointer to incomplete type
memcpy (&pub->q, pk_params->params[1], sizeof (mpz_t));
^
pk.c:61:15: error: dereferencing pointer to incomplete type
memcpy (&pub->g, pk_params->params[2], sizeof (mpz_t));
^
pk.c:62:15: error: dereferencing pointer to incomplete type
memcpy (&pub->y, pk_params->params[3], sizeof (mpz_t));
^
pk.c: At top level:
pk.c:67:32: warning: 'struct dsa_private_key' declared inside parameter list
struct dsa_private_key *pub)
^
pk.c: In function '_dsa_params_to_privkey':
pk.c:69:15: error: dereferencing pointer to incomplete type
memcpy (&pub->x, pk_params->params[4], sizeof (mpz_t));
^
pk.c: In function '_wrap_nettle_pk_sign':
pk.c:283:31: error: storage size of 'pub' isn't known
struct dsa_public_key pub;
^
pk.c:284:32: error: storage size of 'priv' isn't known
struct dsa_private_key priv;
^
pk.c: In function '_wrap_nettle_pk_verify':
pk.c:424:31: error: storage size of 'pub' isn't known
struct dsa_public_key pub;
^
pk.c: In function 'wrap_nettle_pk_generate_params':
pk.c:515:31: error: storage size of 'pub' isn't known
struct dsa_public_key pub;
^
pk.c:516:32: error: storage size of 'priv' isn't known
struct dsa_private_key priv;
^
In file included from pk.c:41:0:
pk.c:529:11: error: too many arguments to function 'nettle_dsa_generate_keypair'
dsa_generate_keypair (&pub, &priv, NULL,
^
/usr/include/nettle/dsa.h:130:1: note: declared here
dsa_generate_keypair (const struct dsa_params *params,
^
pk.c:578:33: warning: passing argument 4 of 'nettle_rsa_generate_keypair' from incompatible pointer type
rnd_func, NULL, NULL, level, 0);
^
In file included from pk.c:42:0:
/usr/include/nettle/rsa.h:323:1: note: expected 'void (*)(void *, size_t, uint8_t *)' but argument is of type 'void (*)(void *, unsigned int, uint8_t *)'
rsa_generate_keypair(struct rsa_public_key *pub,
^
Makefile:1120: recipe for target 'pk.lo' failed
make[4]: *** [pk.lo] Error 1
make[4]: Leaving directory '/tmp/aur/gnutls2/src/gnutls-2.12.23/lib/nettle'
Makefile:1624: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/tmp/aur/gnutls2/src/gnutls-2.12.23/lib'
Makefile:1338: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/aur/gnutls2/src/gnutls-2.12.23/lib'
Makefile:1222: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/aur/gnutls2/src/gnutls-2.12.23'
Makefile:1151: recipe for target 'all' failed
make: *** [all] Error 2
Search Criteria
Package Details: gnutls2 2.12.23-1
Package Actions
| Package Base: | gnutls2 |
|---|---|
| Description: | gnutls version 2 |
| Upstream URL: | http://www.gnu.org/software/gnutls/ |
| Category: | lib |
| Licenses: | |
| Submitter: | opamp |
| Maintainer: | opamp |
| Last Packager: | None |
| Votes: | 2 |
| First Submitted: | 2011-11-14 19:04 |
| Last Updated: | 2013-02-19 05:54 |
Required by (0)
Sources
Latest Comments
Comment by red-lichtie
Comment by Durag
Actual version requires lib32-nettle and p11-kit for compilation.
Comment by maleadt
2.12.21 is out, with md5 93ffac7507dd39a4c6a672ca6976d397, fixing the build issue patched in the PKGBUILD below. Still needs removal of the "gets" reference though (see http://buildroot-busybox.2317881.n4.nabble.com/git-commit-gnutls-fix-build-failure-due-to-non-existing-gets-in-recent-C-libraries-td35149.html).
Anonymous comment
Here is a PKGBUILD that works...
pkgname=gnutls2
pkgver=2.12.20
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc="gnutls version 2"
url="http://www.gnu.org/software/gnutls/"
license=('GPL' 'LGPL')
source=("ftp://ftp.gnu.org/gnu/gnutls/gnutls-$pkgver.tar.bz2")
depends=('zlib' 'libtasn1')
makedepends=('pkg-config')
build() {
cd $srcdir/gnutls-$pkgver
sed -i -e '/gets is a security/d' lib/gl/stdio.in.h
sed -i -e '/gets is a security/d' gl/stdio.in.h
cat > ./x509.patch <<DELIM
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -2153,10 +2153,12 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
int irdn, int iava, gnutls_x509_ava_st * ava)
{
ASN1_TYPE rdn, elem;
+ ASN1_DATA_NODE vnode;
long len;
int lenlen, remlen, ret;
char rbuf[ASN1_MAX_NAME_SIZE];
- unsigned char cls, *ptr;
+ unsigned char cls;
+ const unsigned char *ptr;
iava++;
irdn++; /* 0->1, 1->2 etc */
@@ -2177,8 +2179,15 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
}
- ava->oid.data = elem->value;
- ava->oid.size = elem->value_len;
+ ret = asn1_read_node_value(elem, &vnode);
+ if (ret != ASN1_SUCCESS)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
+ }
+
+ ava->oid.data = (void*)vnode.value;
+ ava->oid.size = vnode.value_len;
snprintf (rbuf, sizeof (rbuf), "?%d.value", iava);
elem = asn1_find_node (rdn, rbuf);
@@ -2188,12 +2197,18 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
}
+ ret = asn1_read_node_value(elem, &vnode);
+ if (ret != ASN1_SUCCESS)
+ {
+ gnutls_assert ();
+ return GNUTLS_E_ASN1_ELEMENT_NOT_FOUND;
+ }
/* The value still has the previous tag's length bytes, plus the
* current value's tag and length bytes. Decode them.
*/
- ptr = elem->value;
- remlen = elem->value_len;
+ ptr = vnode.value;
+ remlen = vnode.value_len;
len = asn1_get_length_der (ptr, remlen, &lenlen);
if (len < 0)
{
@@ -2224,7 +2239,7 @@ gnutls_x509_dn_get_rdn_ava (gnutls_x509_dn_t dn,
}
ava->value.size = tmp;
}
- ava->value.data = ptr + lenlen;
+ ava->value.data = (void*)(ptr + lenlen);
return 0;
}
DELIM
patch -p1 < x509.patch
./configure --prefix=/usr/gnutls2 --with-libtasn1-prefix=/usr --with-libiconv-prefix=/usr --enable-threads=posix
make
}
package() {
cd $srcdir/gnutls-$pkgver
make DESTDIR="$pkgdir" install
}
md5sums=('f1dea97da5d4dcdbc675720c9aad9ee3')
Comment by saironiq
I don't think that's a good idea.
Comment by Gohu
Comment out the line
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
in both lib/gl/stdio.in.h and gl/stdio.in.h
Comment by intgr
Doesn't build here. Any ideas?
make[6]: Entering directory `/usr/src/builds/gnutls2/src/gnutls-2.12.20/lib/gl'
CC fd-hook.lo
CC read-file.lo
CC printf-args.lo
CC printf-parse.lo
CC vasnprintf.lo
In file included from read-file.h:25:0,
from read-file.c:20:
./stdio.h:1029:1: error: 'gets' undeclared here (not in a function)
In file included from vasnprintf.c:70:0:
./stdio.h:1029:1: error: 'gets' undeclared here (not in a function)
make[6]: *** [read-file.lo] Error 1