./security/nettle, Cryptographic library

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 3.4.1, Package name: nettle-3.4.1, Maintainer: pkgsrc-users

Nettle is a cryptographic library that is designed to fit easily in more
or less any context: In crypto toolkits for object-oriented languages
(C++, Python, Pike, ...), in applications like LSH or GNUPG, or even in
kernel space. In most contexts, you need more than the basic
cryptographic algorithms, you also need some way to keep track of available
algorithms, their properties and variants. You often have some algorithm
selection process, often dictated by a protocol you want to implement.

And as the requirements of applications differ in subtle and not so
subtle ways, an API that fits one application well can be a pain to use
in a different context. And that is why there are so many different
cryptographic libraries around.

Nettle tries to avoid this problem by doing one thing, the low-level
crypto stuff, and providing a simple but general interface to it.
In particular, Nettle doesn't do algorithm selection. It doesn't do
memory allocation. It doesn't do any I/O.

The idea is that one can build several application and context specific
interfaces on top of Nettle, and share the code, test cases, benchmarks,
documentation, etc. Examples are the Nettle module for the Pike
language, and LSH, which both use an object-oriented abstraction on top
of the library.


Required to run:
[devel/gmp]

Required to build:
[pkgtools/cwrappers]

Master sites:

SHA1: 56a81ed4a8d35489d8bddd99d5262fe3958a52b4
RMD160: ecf0b73ffa9020037161fa10bc3d7e0e578e5b3e
Filesize: 1901.419 KB

Version history: (Expand)


CVS history: (Expand)


   2018-12-13 11:49:38 by Andreas Gustafsson | Files touched by this commit (1)
Log message:
nettle: use c99

Add c99 to USE_LANGUAGES as nettle 3.4.1 uses c99 for loop syntax, and
won't build on NetBSD 7.1 without it.
   2018-12-09 21:11:40 by Leonardo Taccari | Files touched by this commit (3) | Package updated
Log message:
nettle: Update security/nettle to 3.4.1

Changes:
3.4.1
-----
This release fixes a few bugs, and makes the RSA private key
operations side channel silent. The RSA improvements are
contributed by Simo Sorce and Red Hat, and include one new
public function, rsa_sec_decrypt, see below.

All functions using RSA private keys are now side-channel
silent, meaning that they try hard to avoid any branches or
memory accesses depending on secret data. This applies both to
the bignum calculations, which now use GMP's mpn_sec_* family
of functions, and the processing of PKCS#1 padding needed for
RSA decryption.

Nettle's ECC functions were already side-channel silent, while
the DSA functions still aren't. There's also one caveat
regarding the improved RSA functions: due to small table
lookups in relevant mpn_sec_* functions in GMP-6.1.2, the
lowest and highest few bits of the secret factors p and q may
still leak. I'm not aware of any attacks on RSA where knowing
a few bits of the factors makes a significant difference. This
leak will likely be plugged in later GMP versions.

Changes in behavior:

* The functions rsa_decrypt and rsa_decrypt_tr may now clobber
  all of the provided message buffer, independent of the
  actual message length. They are side-channel silent, in that
  branches and memory accesses don't depend on the validity or
  length of the message. Side-channel leakage from the
  caller's use of length and return value may still provide an
  oracle useable for a Bleichenbacher-style chosen ciphertext
  attack. Which is why the new function rsa_sec_decrypt is
  recommended.

New features:

* A new function rsa_sec_decrypt. It differs from
  rsa_decrypt_tr in that the length of the decrypted message
  is given a priori, and PKCS#1 padding indicating a different
  length is treated as an error. For applications that may be
  subject to chosen ciphertext attacks, it is recommended to
  initialize the message area with random data, call this
  function, and ignore the return value. This applies in
  particular to RSA-based key exchange in the TLS protocol.

Bug fixes:

* Fix bug in pkcs1-conv, missing break statements in the
  parsing of PEM input files.

* Fix link error on the pss-mgf1-test test, affecting builds
  without public key support.

Performance regression:

* All RSA private key operations employing RSA blinding, i.e.,
  rsa_decrypt_tr, rsa_*_sign_tr, the new rsa_sec_decrypt, and
  rsa_compute_root_tr, are significantly slower. This is
  because (i) RSA blinding now use side-channel silent
  operations, (ii) blinding includes a modular inversion, and
  (iii) side-channel silent modular inversion, implemented as
  mpn_sec_invert, is very expensive. A 60% slowdown for
  2048-bit RSA keys have been measured.

Miscellaneous:

* Building the public key support of nettle now requires GMP
  version 6.0 or later (unless --enable-mini-gmp is used).

The shared library names are libnettle.so.6.5 and
libhogweed.so.4.5, with sonames still libnettle.so.6 and
libhogweed.so.4. It is intended to be fully binary compatible
with nettle-3.1.
   2018-01-07 14:04:44 by Roland Illig | Files touched by this commit (583)
Log message:
Fix indentation in buildlink3.mk files.

The actual fix as been done by "pkglint -F */*/buildlink3.mk", and was
reviewed manually.

There are some .include lines that still are indented with zero spaces
although the surrounding .if is indented. This is existing practice.
   2017-11-28 15:06:12 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
nettle: update to 3.4.

NEWS for the Nettle 3.4 release

	This release fixes bugs and adds a few new features. It also
	addresses an ABI compatibility issue affecting Nettle-3.1 and
	later, see below.

	Bug fixes:

	* Fixed an improper use of GMP mpn_mul, breaking curve2559 and
	  eddsa on certain platforms. Reported by Sergei Trofimovich.

	* Fixed memory leak when handling invalid signatures in
	  ecdsa_verify. Fix contributed by Nikos Mavrogiannopoulos.

	* Fix compilation error with --enable-fat om ARM. Fix
	  contributed by Andreas Schneider.

	* Reorganized the way certain data items are made available.

	  Short version: Nettle header files now define the symbols
	  nettle_hashes, nettle_ciphers, and nettle_aeads, as
	  preprocessor macros invoking a corresponding accessor
	  function. For backwards ABI compatibility, the symbols are
	  still present in the compiled libraries, and with the same
	  sizes as in nettle-3.3.

	New features:

	* Support for RSA-PSS signatures, contributed by Daiki Ueno.

	* Support for the HKDF key derivation function, defined by RFC
	  5869. Contributed by Nikos Mavrogiannopoulos.

	* Support for the Cipher Feedback Mode (CFB), contributed by
	  Dmitry Eremin-Solenikov.

	* New accessor functions: nettle_get_hashes,
	  nettle_get_ciphers, nettle_get_aeads, nettle_get_secp_192r1,
	  nettle_get_secp_224r1, nettle_get_secp_256r1,
	  nettle_get_secp_384r1, nettle_get_secp_521r1.

	  For source-level compatibility with future versions,
	  applications are encouraged to migrate to using these
	  functions instead of referring to the corresponding data
	  items directly.

	Miscellaneous:

	* The base16 and base64 functions now use the type char * for
	  ascii data, rather than uint8_t *. This eliminates the last
	  pointer-signedness warnings when building Nettle. This is a
	  minor API change, and applications may need to be adjusted,
	  but the ABI is unaffected on all platforms I'm aware of.

	* The contents of the header file nettle/version.h is now
	  architecture independent, except in --enable-mini-gmp
	  configurations.

	ABI issue:

	  Since the breakage was a bit subtle, let me document it
	  here. The nettle and hogweed libraries export a couple of
	  data symbols, and for some of these, the size was never
	  intended to be part of the ABI. E.g.,

	    extern const struct nettle_hash * const nettle_hashes[];

	  which is an NULL-terminated array.

	  It turns out the sizes nevertheless may leak into the ABI, and
	  that increasing the sizes can break old executables linked
	  with a newer version of the library.

	  When linking a classic non-PIE executable with a shared
	  library, we get ELF relocations of type R_X86_64_COPY for
	  references to data items. These mean that the linker allocates
	  space for the data item in the data segment of executable, at
	  a fixed address determined at link-time, and with size
	  extracted from the version of the .so-file seen when linking.

	  At load time, the run time linker then copies the contents of
	  the symbol from the .so file to that location, and uses the
	  copy instead of the version loaded with the .so-file. And if
	  the data item in the .so file used at load time is larger than
	  the data item seen at link time, it is silently truncated in
	  the process.

	  So when SHA3 hashes were was added to the nettle_hashes array
	  in the nettle-3.3 release, this way of linking produces a
	  truncated array at load time, no longer NULL-terminated.

	  We will get similar problems for planned extensions of the
	  internal struct ecc_curve, and exported data items like

	    extern const struct ecc_curve nettle_secp_256r1;

	  where the ecc_curve struct is only forward declared in the
	  public headers. To prepare, applications should migrate to
	  using the new function nettle_get_secp_256r1, and similarly
	  for the other curves.

	  In some future version, the plan is to add a leading
	  underscore to the name of the actual data items. E.g.,
	  nettle_hashes --> _nettle_hashes, breaking the ABI, while
	  keeping the nettle_get_hashes function and the nettle_hashes
	  macro as the supported ways to access it. We will also
	  rename nettle_secp_256r1 --> _nettle_secp_256r1, breaking
	  both ABI and API.

	  Note that data items like nettle_sha256 are *not* affected,
	  since the size and layout of this struct is considered part
	  of the ABI, and R_X86_64_COPY-relocations then work fine.
   2017-01-19 19:52:30 by Alistair G. Crooks | Files touched by this commit (352)
Log message:
Convert all occurrences (353 by my count) of

	MASTER_SITES= 	site1 \
			site2

style continuation lines to be simple repeated

	MASTER_SITES+= site1
	MASTER_SITES+= site2

lines. As previewed on tech-pkg. With thanks to rillig for fixing pkglint
accordingly.
   2016-10-03 14:28:19 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
Updated nettle to 3.3.

NEWS for the Nettle 3.3 release

	This release fixes a couple of bugs, and improves resistance
	to side-channel attacks on RSA and DSA private key operations.

	Changes in behavoir:

	* Invalid private RSA keys, with an even modulo, are now
	  rejected by rsa_private_key_prepare. (Earlier versions
	  allowed such keys, even if results of using them were bogus).

	  Nettle applications are required to call
	  rsa_private_key_prepare and check the return value, before
	  using any other RSA private key functions; failing to do so
	  may result in crashes for invalid private keys. As a
	  workaround for versions of Gnutls which don't use
	  rsa_private_key_prepare, additional checks for even moduli
	  are added to the rsa_*_tr functions which are used by all
	  recent versions of Gnutls.

	* Ignore bit 255 of the x coordinate of the input point to
	  curve25519_mul, as required by RFC 7748. To differentiate at
	  compile time, curve25519.h defines the constant
	  NETTLE_CURVE25519_RFC7748.

	Security:

	* RSA and DSA now use side-channel silent modular
	  exponentiation, to defend against attacks on the private key
	  from evil processes sharing the same processor cache. This
	  attack scenario is of particular relevance when running an
	  HTTPS server on a virtual machine, where you don't know who
	  you share the cache hardware with.

	  (Private key operations on elliptic curves were already
	  side-channel silent).

	Bug fixes:

	* Fix sexp-conv crashes on invalid input. Reported by Hanno
	  Böck.

	* Fix out-of-bounds read in des_weak_p. Fixed by Nikos
	  Mavrogiannopoulos.

	* Fix a couple of formally undefined shift operations,
	  reported by Nikos Mavrogiannopoulos.

	* Fix compilation with c89. Reported by Henrik Grubbström.

	New features:

	* New function memeql_sec, for side-channel silent comparison
	  of two memory areas.

	Miscellaneous:

	* Building the public key support of nettle now requires GMP
	  version 5.0 or later (unless --enable-mini-gmp is used).

	* Filenames of windows DLL libraries now include major number
	  only. So the dll names change at the same time as the
	  corresponding soname on ELF platforms. Fixed by Nikos
	  Mavrogiannopoulos.

	* Eliminate most pointer-signedness warnings. In the process,
	  the strings representing expression type for sexp_interator
	  functions were changed from const uint8_t * to const char *.
	  These functions are undocumented, and it doesn't change the
	  ABI on any platform I'm aware of.

	The shared library names are libnettle.so.6.3 and
	libhogweed.so.4.3, with sonames still libnettle.so.6 and
	libhogweed.so.4. It is intended to be fully binary compatible
	with nettle-3.1.
   2016-02-01 14:27:37 by Thomas Klausner | Files touched by this commit (3) | Package updated
Log message:
Update nettle to 3.2.

Fix some pkglint while here.

NEWS for the Nettle 3.2 release

	Bug fixes:

	* The SHA3 implementation is updated according to the FIPS 202
	  standard. It is not interoperable with earlier versions of
	  Nettle. Thanks to Nikos Mavrogiannopoulos. To easily
	  differentiate at compile time, sha3.h defines the constant
	  NETTLE_SHA3_FIPS202.

	* Fix corner-case carry propagation bugs affecting elliptic
	  curve operations on the curves secp_256r1 and secp_384r1 on
	  certain platforms, including x86_64. Reported by Hanno Böck.

	New features:

	* New functions for RSA private key operations, identified by
	  the "_tr" suffix, with better resistance to side channel
	  attacks and to hardware or software failures which could
	  break the CRT optimization. See the Nettle manual for
	  details. Initial patch by Nikos Mavrogiannopoulos.

	* New functions nettle_version_major, nettle_version_minor, as
	  a run-time variant of the compile-time constants
	  NETTLE_VERSION_MAJOR and NETTLE_VERSION_MINOR.

	Optimizations:

	* New ARM Neon implementation of the chacha stream cipher.

	Miscellaneous:

	* ABI detection on mips, with improved default libdir
	  location. Contributed by Klaus Ziegler.

	* Fixes for ARM assembly syntax, to work better with the clang
	  assembler. Thanks to Jukka Ukkonen.

	* Disabled use of ifunc relocations for fat builds, to fix
	  problems most easily triggered by using dlopen RTLD_NOW.

	The shared library names are libnettle.so.6.2 and
	libhogweed.so.4.2, with sonames still libnettle.so.6 and
	libhogweed.so.4. It is intended to be fully binary compatible
	with nettle-3.1.
   2015-11-04 02:18:12 by Alistair G. Crooks | Files touched by this commit (434)
Log message:
Add SHA512 digests for distfiles for security category

Problems found locating distfiles:
	Package f-prot-antivirus6-fs-bin: missing distfile fp-NetBSD.x86.32-fs-6.2.3.tar.gz
	Package f-prot-antivirus6-ws-bin: missing distfile fp-NetBSD.x86.32-ws-6.2.3.tar.gz
	Package libidea: missing distfile libidea-0.8.2b.tar.gz
	Package openssh: missing distfile openssh-7.1p1-hpn-20150822.diff.bz2
	Package uvscan: missing distfile vlp4510e.tar.Z

Otherwise, existing SHA1 digests verified and found to be the same on
the machine holding the existing distfiles (morden).  All existing
SHA1 digests retained for now as an audit trail.