public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-dev] [RFC] New Manifest hashes and how to enable them
@ 2017-04-03 17:09 99% Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2017-04-03 17:09 UTC (permalink / raw
  To: gentoo-dev; +Cc: infra, dev-portage

[-- Attachment #1: Type: text/plain, Size: 3947 bytes --]

Hi, everyone.

I'd like to open an early discussion and start planning transition to
an updated set of Manifest hashes.


Current state
=============

The current hash set includes the three following hashes:
- SHA256 (SHA2),
- SHA512 (SHA2),
- Whirlpool.

Of these three hashes, SHA256 is considered 'required' by Portage. All
current Manifests in Gentoo include it.

SHA512 and Whirlpool are included in the majority of Manifest.
The packages missing them are tracked in [1].

There are still some stale hashes present in some Manifests (e.g.
RMD160).


Supported hash algorithms in package managers
=============================================

The following hashes are supported by the stable version of Portage,
pkgcore and Paludis: MD5, SHA1, SHA256, SHA512, RMD160, WHIRLPOOL.

Support for MD5, SHA1, SHA256 and SHA512 in Portage and pkgcore is
provided unconditionally by all supported Python versions. For
WHIRLPOOL, a fallback implementation is always provided.

The following hashes are supported by the current git version of Portage
and are on the way of being integrated into pkgcore: BLAKE2B, BLAKE2S,
SHA3-256, SHA3-512. They are not currently supported by Paludis.

Support for those algorithms is guaranteed in Python 3.6+. Fallbacks for
older Python versions are supported -- using pygcrypt, pycryptodome
and pysha3 (the last one doesn't include BLAKE2) in Portage; and using
pycryptodome in pkgcore.

Additionally, the current git version of Portage supports
the STREEBOG256 and STREEBOG512 (GOST R 34.11-2012) algorithms. They can
be provided either using pygcrypt or pygost modules.

Of the listed fallbacks, the following limitations need to be noted:

A. pygcrypt requires old cffi, and therefore is not in ::gentoo. I have
contacted upstream and they are working on updating it.

B. pycryptodome blocks pycrypto, and some packages explicitly require
pycrypto (see tracker at [2]).

C. pygost is just horrible code-wise, and I've only added it so that we
can run tests without any special dependencies.


SHA256 deprecation
==================

I think the first reasonable change would be to deprecate SHA256. It is
pretty much the same algorithm as SHA512, except for different
parameters. It is weaker than SHA512, and SHA512 is supported on all
existing platforms anyway.

Therefore, I think the following procedure would apply (please correct
me if I'm wrong):

1. wait till all remaining blockers of [1] are fixed,

2. update the required hash from SHA256 to SHA512 in Portage,

3. wait till stable Portage carries the above change + (possibly some
upgrade time?),

4. remove SHA256 from list of hashes included in Manifests.


New hash set
============

After deprecating SHA256, the hash list would include only SHA512
and WHIRLPOOL. I think the first one should be kept as a portable
required hash, and I'm indifferent to keeping the second one.

Of the new hashes, I think it would be the most reasonable to add SHA3-
512. It is built-in since Python 3.6+, and multiple implementations are
available for older Python versions (cryptography [though I think it
doesn't work with current openssl], pycryptodome, pygcrypt, pysha3).

The alternative would be to use BLAKE2B hash (which provides similar
strength to SHA3-512). However, it provides less fallbacks (no support
in libgcypt nor cryptography).

For diversity, we could also consider including the Streebog hash
(a user has requested it already). However, it seems to be at SHA2 level
and does not have any reasonable implementation except for libgcrypt.

Therefore, my proposal would be to use the following set once their
support reaches the stable version of Portage:

  manifest-hashes = SHA512 SHA3-512 WHIRLPOOL


Your thoughts?



[1]:https://bugs.gentoo.org/612716
[2]:https://bugs.gentoo.org/611568

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-04-03 17:09 99% [gentoo-dev] [RFC] New Manifest hashes and how to enable them Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox