Changeset 102361 in vbox for trunk/src/VBox/Runtime/common/crypto
- Timestamp:
- Nov 28, 2023 12:53:33 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/crypto/shacrypt.cpp
r102336 r102361 49 49 50 50 51 RTR3DECL(int) RTCrShaCryptGenerateSalt(char szSalt[RT_SHACRYPT_MAX_SALT_LEN + 1], size_t cchSalt)51 RTR3DECL(int) RTCrShaCryptGenerateSalt(char *pszSalt, size_t cchSalt) 52 52 { 53 53 AssertMsgReturn(cchSalt >= RT_SHACRYPT_MIN_SALT_LEN && cchSalt <= RT_SHACRYPT_MAX_SALT_LEN, ("len=%zu\n", cchSalt), … … 56 56 static const char aRange[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890./"; 57 57 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'; 61 61 return VINF_SUCCESS; 62 62 }
Note:
See TracChangeset
for help on using the changeset viewer.