fedora 24
crypto weakness #278

4

Weakness Breakdown


Definition:

This weakness involves creating non-standard or non-tested algorithms, using weak algorithms or applying cryptographic algorithms incorrectly. Algorithms that were once considered safe are commonly later found to be unsafe, as the algorithms were broken.

Warning code(s):

The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment.

File Name:

grive2-ae06eccb38b2fe250c9ddeac3e3973f80b8a0aa9/libgrive/src/util/Crypt.cc

Context:

The highlighted line of code below is the trigger point of this particular Fedora 24 crypto weakness.

 	return ss.str() ;
}

std::string MD5::Get( const fs::path& file )
{
	try
	{
		File sfile( file ) ;
		return Get( sfile ) ;
	}
	catch ( File::Error& )
	{
		return "" ;
	}
}

std::string MD5::Get( File& file )
{
	MD5 crypt ;
	
	u64_t size = file.Size() ;
	for ( u64_t i = 0 ; i < size ; i += read_size )
	{
		MemMap map( file, i, static_cast<std::size_t>(std::min(read_size, size-i)) ) ;
		crypt.Write( map.Addr(), map.Length() ) ;
	}

	return crypt.Get() ;
}

} } // end of namespaces 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.