30static char secret[] =
"I am a super secret string that no one can see!";
31static char secret2[] =
"I am a super secret string indescribable string";
32static char key[] =
"Wibble wibble wibble";
52 ok(!
protected,
"Encrypting without plain data source.\n");
58 ok(!
protected,
"Encrypting without cipher destination.\n");
68 ok(
protected,
"Encrypting without entropy.\n");
81 ok(
protected,
"Encrypting with entropy.\n");
91 ok(
protected,
"Encrypting with entropy.\n");
110 ok(!okay,
"Decrypting without destination\n");
116 ok(!okay,
"Decrypting without source\n");
125 ok(!okay,
"Decrypting without needed entropy\n");
136 ok(okay,
"Decrypting without entropy\n");
138 ok(plain.
pbData!=
NULL,
"Plain DATA_BLOB missing data\n");
141 ok(data_desc!=
NULL,
"Description not allocated\n");
142 ok(!
lstrcmpW(data_desc,
L"Ultra secret test message"),
"Description does not match\n");
154 ok(!okay,
"Decrypting with wrong entropy\n");
161 ok(okay,
"Decrypting with entropy\n");
163 ok(plain.
pbData!=
NULL,
"Plain DATA_BLOB missing data\n");
166 ok(data_desc!=
NULL,
"Description not allocated\n");
167 ok(!
lstrcmpW(data_desc,
L"Ultra secret test message"),
"Description does not match\n");
179 ok(okay,
"Decrypting with entropy and no description\n");
181 ok(plain.
pbData!=
NULL,
"Plain DATA_BLOB missing data\n");
184 ok(data_desc!=
NULL,
"Description not allocated\n");
185 ok(data_desc[0]==
'\0',
"Description not empty\n");
203 input.pbData = (
unsigned char *)plaintext;
206 ok(
res != 0,
"can't protect\n");
210 ok(output.
cbData ==
strlen(plaintext),
"output wrong length %ld for input '%s', wanted %d\n", output.
cbData, plaintext,
lstrlenA(plaintext));
211 ok(!
memcmp(plaintext, (
char *)output.
pbData, output.
cbData),
"output wrong contents for input '%s'\n", plaintext);
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
BOOL WINAPI CryptUnprotectData(DATA_BLOB *pDataIn, LPWSTR *ppszDataDescr, DATA_BLOB *pOptionalEntropy, PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT *pPromptStruct, DWORD dwFlags, DATA_BLOB *pDataOut)
BOOL WINAPI CryptProtectData(DATA_BLOB *pDataIn, LPCWSTR szDataDescr, DATA_BLOB *pOptionalEntropy, PVOID pvReserved, CRYPTPROTECT_PROMPTSTRUCT *pPromptStruct, DWORD dwFlags, DATA_BLOB *pDataOut)
#define ERROR_INVALID_PARAMETER
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
GLdouble GLdouble GLdouble r
GLenum GLenum GLenum input
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static const WCHAR emptyW[]
int WINAPI lstrlenA(LPCSTR lpString)
static DATA_BLOB cipher_no_desc
static void test_simpleroundtrip(const char *plaintext)
static void test_cryptprotectdata(void)
static void test_cryptunprotectdata(void)
static DATA_BLOB cipher_entropy
DWORD WINAPI GetLastError(void)
#define ERROR_INVALID_DATA