VirtualBox

Changeset 48868 in vbox for trunk


Ignore:
Timestamp:
Oct 4, 2013 1:42:42 AM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89537
Message:

XAR: The checksum style is case insensitive.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/zip/xarvfs.cpp

    r48844 r48868  
    469469static int rtZipXarParseChecksumStyle(const char *pszStyle, uint8_t *puHashFunction)
    470470{
    471     if (!strcmp(pszStyle, "sha1"))
     471    size_t cchStyle = strlen(pszStyle);
     472    if (   cchStyle == 4
     473        && (pszStyle[0] == 's' || pszStyle[0] == 'S')
     474        && (pszStyle[1] == 'h' || pszStyle[1] == 'H')
     475        && (pszStyle[2] == 'a' || pszStyle[2] == 'A')
     476        &&  pszStyle[3] == '1' )
    472477        *puHashFunction = XAR_HASH_SHA1;
    473     else if (!strcmp(pszStyle, "md5"))
     478    else if (   cchStyle == 3
     479             && (pszStyle[0] == 'm' || pszStyle[0] == 'M')
     480             && (pszStyle[1] == 'd' || pszStyle[1] == 'D')
     481             &&  pszStyle[2] == '5' )
    474482        *puHashFunction = XAR_HASH_MD5;
    475     else if (!strcmp(pszStyle, "none"))
     483    else if (   cchStyle == 4
     484             && (pszStyle[0] == 'n' || pszStyle[0] == 'N')
     485             && (pszStyle[1] == 'o' || pszStyle[1] == 'O')
     486             && (pszStyle[2] == 'n' || pszStyle[2] == 'N')
     487             && (pszStyle[3] == 'e' || pszStyle[3] == 'E') )
    476488        *puHashFunction = XAR_HASH_NONE;
    477489    else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette