[MNG-1349] openssl checksums are not accepted by maven

o Merged from r730631

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@730635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-01-01 23:14:07 +00:00
parent 970065b4bd
commit 6a3afa1c46
1 changed files with 3 additions and 2 deletions

View File

@ -800,8 +800,9 @@ public class DefaultWagonManager
// remove whitespaces at the end
expectedChecksum = expectedChecksum.trim();
// check for 'MD5 (name) = CHECKSUM'
if ( expectedChecksum.startsWith( "MD5" ) )
// check for 'ALGO (name) = CHECKSUM' like used by openssl
if ( expectedChecksum.regionMatches( true, 0, "MD", 0, 2 )
|| expectedChecksum.regionMatches( true, 0, "SHA", 0, 3 ) )
{
int lastSpacePos = expectedChecksum.lastIndexOf( ' ' );
expectedChecksum = expectedChecksum.substring( lastSpacePos + 1 );