Remove more crypto (sha256, sha512, hmac-sha256) (was: Re: [PATCH] Remove lib/crypto/crc32.[ch])

Andreas Schneider asn at samba.org
Wed Oct 10 08:47:58 UTC 2018


On Wednesday, 10 October 2018 10:33:14 CEST Andrew Bartlett wrote:
> On Wed, 2018-10-10 at 10:09 +0200, Andreas Schneider via samba-
> 
> technical wrote:
> > On Tuesday, 9 October 2018 21:08:44 CEST Volker Lendecke via
> > samba-technical> 
> > wrote:
> > > Hi!
> > > 
> > > Metze tells me that we have libz always available, and that contains a
> > > crc32 implementation. Use that. I've written a small test comparing
> > > the result of both implementations, and it was the same.
> > > 
> > > Review appreciated!
> > 
> > Thanks for the cleanup that helps me in my crypto efforts :-)
> 
> Thinking about how we could remove other files from lib/crypto could we
> move our use of
> 
> - HMAC-SHA256
>  - SMB2 < 2.24 SMB signing
>  - SMB2 Key derivation
> 
>  # GNUTLS (>= 3.0.0)
>  # NETTLE
> 
> SHA256
>  - Security Descriptor hash for vfs_acl_xattr
>  - oLschema2ldif
> 
>  # GNUTLS (>= 3.0.0)
>  # NETTLE
> 
> SHA512
>  - SMB2 Pre-auth integrity verification
>  - BackupKey ClientWrap
> 
>  # GNUTLS (>= 3.0.0)
>  # NETTLE
> 
> 
> over to GnuTLS and require that?
> 
> https://www.gnutls.org/manual/html_node/Hash-and-MAC-functions.html
> 
> This would seem to avoid the issues of needing accelerated AES at one
> end and the 'banned by FIPS but needed' at the other.

That's my plan and I've started to look into this, but there are still some 
blocking things.

The question is do we one to move all of the crypto to gnutls or just parts 
for now. My plan was to either use gnutls or our own crypto implementation if 
the gnutls verison is not recent enough. GnuTLS misses some features but they 
will be implemented soon. You can find the information about that in the 
following milestone for GnuTLS.

https://gitlab.com/gnutls/gnutls/milestones/14

AES-CMAC has been added to libnettle (based on the Samba implementation) for 
example. nettle is used by gnutls.

I could start to require gnutls and start migrating the hashing functions. 
This would mean we directly use the gnutls functions.

For other crypto we would need to have an abstraction which either uses 
Samba's crypto or GnuTLS.


	Andreas


-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D





More information about the samba-technical mailing list