VirtualBox

Changeset 102361 in vbox


Ignore:
Timestamp:
Nov 28, 2023 12:53:33 PM (12 months ago)
Author:
vboxsync
Message:

IPRT/crypto: Changed the signature of RTCrShaCryptGenerateSalt(). bugref:10551

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/crypto/shacrypt.h

    r102360 r102361  
    6262 *
    6363 * @returns IPRT status code.
    64  * @param   szSalt      Where to store the generated salt.
    65  * @param   cchSalt     Number of characters the generated salt should use.
     64 * @param   pszSalt     Where to store the generated salt.
     65 * @param   cchSalt     Size of \a pszSalt.
     66 *                      Also marks the number of characters the generated salt should use.
    6667 *                      Must be >= RT_SHACRYPT_MIN_SALT_LEN and <= RT_SHACRYPT_MAX_SALT_LEN.
    6768 */
    68 RTR3DECL(int) RTCrShaCryptGenerateSalt(char szSalt[RT_SHACRYPT_MAX_SALT_LEN + 1], size_t cchSalt);
     69RTR3DECL(int) RTCrShaCryptGenerateSalt(char *pszSalt, size_t cchSalt);
    6970
    7071
  • trunk/src/VBox/Runtime/common/crypto/shacrypt.cpp

    r102336 r102361  
    4949
    5050
    51 RTR3DECL(int) RTCrShaCryptGenerateSalt(char szSalt[RT_SHACRYPT_MAX_SALT_LEN + 1], size_t cchSalt)
     51RTR3DECL(int) RTCrShaCryptGenerateSalt(char *pszSalt, size_t cchSalt)
    5252{
    5353    AssertMsgReturn(cchSalt >= RT_SHACRYPT_MIN_SALT_LEN && cchSalt <= RT_SHACRYPT_MAX_SALT_LEN, ("len=%zu\n", cchSalt),
     
    5656    static const char aRange[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890./";
    5757    for (size_t i = 0; i < cchSalt; i++)
    58         szSalt[i] = aRange[RTRandU32Ex(0, sizeof(aRange) - 2)];
    59 
    60     szSalt[RT_SHACRYPT_MAX_SALT_LEN] = '\0';
     58        pszSalt[i] = aRange[RTRandU32Ex(0, sizeof(aRange) - 2)];
     59
     60    pszSalt[cchSalt] = '\0';
    6161    return VINF_SUCCESS;
    6262}
Note: See TracChangeset for help on using the changeset viewer.

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