VirtualBox

Changeset 102294 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Nov 24, 2023 1:40:35 PM (13 months ago)
Author:
vboxsync
Message:

IPRT: Implemented SHA-crypt 256 / 512 variants, along with testcases. Needed for password hashing in cloud-init-based Linux installers [docs fixes]. bugref:10551

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/crypto/shacrypt.cpp

    r102292 r102294  
    4848
    4949
    50 RTR3DECL(int) RTShaCrypt256(const char *pszKey, const char *pszSalt, uint32_t cRounds, uint8_t pabHash[RTSHA256_HASH_SIZE])
     50RTR3DECL(int) RTShaCrypt256(const char *pszKey, const char *pszSalt, uint32_t cRounds, uint8_t abHash[RTSHA256_HASH_SIZE])
    5151{
    5252    AssertPtrReturn(pszKey,   VERR_INVALID_POINTER);
     
    159159    }
    160160
    161     memcpy(pabHash, abDigest, RTSHA256_HASH_SIZE);
     161    memcpy(abHash, abDigest, RTSHA256_HASH_SIZE);
    162162
    163163    RTMemWipeThoroughly(abDigestTemp, RTSHA256_HASH_SIZE, 3);
     
    222222
    223223
    224 RTR3DECL(int) RTShaCrypt512(const char *pszKey, const char *pszSalt, uint32_t cRounds, uint8_t pabHash[RTSHA512_HASH_SIZE])
     224RTR3DECL(int) RTShaCrypt512(const char *pszKey, const char *pszSalt, uint32_t cRounds, uint8_t abHash[RTSHA512_HASH_SIZE])
    225225{
    226226    AssertPtrReturn(pszKey,   VERR_INVALID_POINTER);
     
    333333    }
    334334
    335     memcpy(pabHash, abDigest, RTSHA512_HASH_SIZE);
     335    memcpy(abHash, abDigest, RTSHA512_HASH_SIZE);
    336336
    337337    RTMemWipeThoroughly(abDigestTemp, RTSHA512_HASH_SIZE, 3);
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