• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1############################################################################
2#
3# GnuTLS dual versions
4#
5# Works with CentOS 7
6#
7############################################################################
8#
9# Add in alternative GnuTLS support into /usr/local, and put all the
10# libraries into /usr/local/lib.
11#
12# Need the latest of the following packages
13#
14# gmp    (used 6.2.0)  https://gmplib.org/#DOWNLOAD
15# nettle (used 3.6)    https://ftp.gnu.org/gnu/nettle/
16# gnutls (used 3.6.13) https://www.gnutls.org/download.html
17#
18
19GMP_VER=6.2.0
20NETTLE_VER=3.6
21GNUTLS_VER=3.6.13
22
23#
24# gmp
25#
26tar xovf gmp-${GMP_VER}.tar.xz
27cd gmp-${GMP_VER}
28./configure
29make
30sudo make install
31cd ..
32
33#
34# nettle (by default wants to go into /usr/local/lib64 which gets messy)
35#
36tar zxovf nettle-${NETTLE_VER}.tar.gz
37cd nettle-${NETTLE_VER}
38PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --libdir=/usr/local/lib \
39  LDFLAGS="-L/usr/local/lib"
40make
41sudo make install
42cd ..
43
44tar xovf gnutls-${GNUTLS_VER}.tar.xz
45cd gnutls-${GNUTLS_VER}
46#
47#
48# You may need to make the following change if you have an old version of
49# p11-kit
50#
51# $ diff -Nau a/lib/pkcs11_privkey.c b/lib/pkcs11_privkey.c
52# --- a/lib/pkcs11_privkey.c        2020-05-26 11:49:27.374385645 +0100
53# +++ b/lib/pkcs11_privkey.c        2020-05-26 11:58:24.300510455 +0100
54# @@ -265,13 +265,13 @@
55#  # define CKG_MGF1_SHA384 0x00000003UL
56#  # define CKG_MGF1_SHA512 0x00000004UL
57#
58# +#endif
59#  struct ck_rsa_pkcs_pss_params {
60#         ck_mechanism_type_t hash_alg;
61#         /* ck_rsa_pkcs_mgf_type_t is not defined in old versions of p11-kit */
62#         unsigned long mgf;
63#         unsigned long s_len;
64#  };
65# -#endif
66#
67#  static const struct hash_mappings_st hash_mappings[] =
68#  {
69#
70#
71PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --with-included-unistring \
72  --disable-hardware-acceleration --disable-tests --with-included-libtasn1 \
73  --disable-doc LDFLAGS="-L/usr/local/lib"
74make
75sudo make install
76cd ..
77
78############################################################################
79#
80# libcoap build with updated GnuTLS
81#
82############################################################################
83
84# Get the latest libcoap
85git clone https://github.com/obgm/libcoap.git
86
87# Build code
88cd libcoap
89./autogen.sh
90# Update --enable- / --disable- options as appropriate
91# libcoap libraries are put into /usr/lib64 for ease of linking
92PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --libdir=/usr/lib64 \
93  --with-gnutls --enable-tests --enable-examples --disable-doxygen \
94  --enable-manpages
95make
96sudo make install
97cd ..
98
99