MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / CascAddStringEncryptionKey

Function CascAddStringEncryptionKey

src/External/CascLib/src/CascDecrypt.cpp:780–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780bool WINAPI CascAddStringEncryptionKey(HANDLE hStorage, ULONGLONG KeyName, LPCSTR szKey)
781{
782 BYTE Key[CASC_KEY_LENGTH];
783
784 // Check the length of the string key
785 if(strlen(szKey) != CASC_KEY_LENGTH * 2)
786 {
787 SetCascError(ERROR_INVALID_PARAMETER);
788 return false;
789 }
790
791 // Convert the string key to the binary array
792 if(BinaryFromString(szKey, CASC_KEY_LENGTH * 2, Key) != ERROR_SUCCESS)
793 {
794 SetCascError(ERROR_INVALID_PARAMETER);
795 return false;
796 }
797
798 return CascAddEncryptionKey(hStorage, KeyName, Key);
799}
800
801LPBYTE WINAPI CascFindEncryptionKey(HANDLE hStorage, ULONGLONG KeyName)
802{

Callers

nothing calls this directly

Calls 3

SetCascErrorFunction · 0.85
BinaryFromStringFunction · 0.85
CascAddEncryptionKeyFunction · 0.85

Tested by

no test coverage detected