| 778 | } |
| 779 | |
| 780 | bool 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 | |
| 801 | LPBYTE WINAPI CascFindEncryptionKey(HANDLE hStorage, ULONGLONG KeyName) |
| 802 | { |
nothing calls this directly
no test coverage detected