Hans Leidekker (@hans) commented about dlls/bcrypt/bcrypt_main.c:
case KDF_HASH_ALGORITHM:hash_alg = get_hash_handle( desc->pBuffers + i, TRUE );break;case KDF_SALT:salt = desc->pBuffers[i].pvBuffer;salt_size = desc->pBuffers[i].cbBuffer;break;case KDF_ITERATION_COUNT:if (desc->pBuffers[i].cbBuffer != sizeof(ULONGLONG)) return STATUS_INVALID_PARAMETER;iter_count = *(ULONGLONG *)desc->pBuffers[i].pvBuffer;break;}- }
- status = BCryptDeriveKeyPBKDF2( hash_alg, key->u.s.secret, key->u.s.secret_len,
salt, salt_size, iter_count, output, output_size, flags );
I'd rather call derive_key_pbkdf2() here because we don't need the validation or the trace in BCryptDeriveKeyPBKDF2(). So get_hash_handle() becomes get_hash_alg().