crypt32/tests: Make some variables static.
This commit is contained in:
parent
55676e84ed
commit
d7bd274eed
|
@ -40,15 +40,12 @@
|
|||
#define X509_HEADER_NOCR "-----BEGIN X509 CRL-----\n"
|
||||
#define X509_TRAILER_NOCR "-----END X509 CRL-----\n"
|
||||
|
||||
typedef BOOL (WINAPI *CryptBinaryToStringAFunc)(const BYTE *pbBinary,
|
||||
static BOOL (WINAPI *pCryptBinaryToStringA)(const BYTE *pbBinary,
|
||||
DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD *pcchString);
|
||||
typedef BOOL (WINAPI *CryptStringToBinaryAFunc)(LPCSTR pszString,
|
||||
static BOOL (WINAPI *pCryptStringToBinaryA)(LPCSTR pszString,
|
||||
DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary,
|
||||
DWORD *pdwSkip, DWORD *pdwFlags);
|
||||
|
||||
CryptBinaryToStringAFunc pCryptBinaryToStringA;
|
||||
CryptStringToBinaryAFunc pCryptStringToBinaryA;
|
||||
|
||||
struct BinTests
|
||||
{
|
||||
const BYTE *toEncode;
|
||||
|
@ -64,7 +61,7 @@ static const BYTE toEncode4[] =
|
|||
"abcdefghijlkmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
|
||||
"abcdefghijlkmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
|
||||
|
||||
struct BinTests tests[] = {
|
||||
static const struct BinTests tests[] = {
|
||||
{ toEncode1, sizeof(toEncode1), "AA==\r\n", },
|
||||
{ toEncode2, sizeof(toEncode2), "AQI=\r\n", },
|
||||
/* { toEncode3, sizeof(toEncode3), "AQID\r\n", }, This test fails on Vista. */
|
||||
|
@ -76,7 +73,7 @@ struct BinTests tests[] = {
|
|||
"SElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODkwAA==\r\n" },
|
||||
};
|
||||
|
||||
struct BinTests testsNoCR[] = {
|
||||
static const struct BinTests testsNoCR[] = {
|
||||
{ toEncode1, sizeof(toEncode1), "AA==\n", },
|
||||
{ toEncode2, sizeof(toEncode2), "AQI=\n", },
|
||||
/* { toEncode3, sizeof(toEncode3), "AQID\n", }, This test fails on Vista. */
|
||||
|
@ -306,7 +303,7 @@ struct BadString
|
|||
DWORD format;
|
||||
};
|
||||
|
||||
struct BadString badStrings[] = {
|
||||
static const struct BadString badStrings[] = {
|
||||
{ "A\r\nA\r\n=\r\n=\r\n", CRYPT_STRING_BASE64 },
|
||||
{ "AA\r\n=\r\n=\r\n", CRYPT_STRING_BASE64 },
|
||||
{ "AA=\r\n=\r\n", CRYPT_STRING_BASE64 },
|
||||
|
@ -441,10 +438,8 @@ START_TEST(base64)
|
|||
{
|
||||
HMODULE lib = GetModuleHandleA("crypt32");
|
||||
|
||||
pCryptBinaryToStringA = (CryptBinaryToStringAFunc)GetProcAddress(lib,
|
||||
"CryptBinaryToStringA");
|
||||
pCryptStringToBinaryA = (CryptStringToBinaryAFunc)GetProcAddress(lib,
|
||||
"CryptStringToBinaryA");
|
||||
pCryptBinaryToStringA = (void *)GetProcAddress(lib, "CryptBinaryToStringA");
|
||||
pCryptStringToBinaryA = (void *)GetProcAddress(lib, "CryptStringToBinaryA");
|
||||
|
||||
if (pCryptBinaryToStringA)
|
||||
testBinaryToStringA();
|
||||
|
|
|
@ -2356,7 +2356,7 @@ struct EncodedRSAPubKey
|
|||
size_t decodedModulusLen;
|
||||
};
|
||||
|
||||
struct EncodedRSAPubKey rsaPubKeys[] = {
|
||||
static const struct EncodedRSAPubKey rsaPubKeys[] = {
|
||||
{ modulus1, sizeof(modulus1), mod1_encoded, sizeof(modulus1) },
|
||||
{ modulus2, sizeof(modulus2), mod2_encoded, 5 },
|
||||
{ modulus3, sizeof(modulus3), mod3_encoded, 5 },
|
||||
|
@ -7137,7 +7137,7 @@ static CERT_GENERAL_SUBTREE IPAddressWithMinSubtree = {
|
|||
static CERT_GENERAL_SUBTREE IPAddressWithMinMaxSubtree = {
|
||||
{ CERT_ALT_NAME_IP_ADDRESS, { 0 } }, 5, TRUE, 3 };
|
||||
|
||||
struct EncodedNameConstraints encodedNameConstraints[] = {
|
||||
static const struct EncodedNameConstraints encodedNameConstraints[] = {
|
||||
{ { sizeof(emptySequence), (LPBYTE)emptySequence }, { 0 } },
|
||||
{ { sizeof(emptyDNSPermittedConstraints), emptyDNSPermittedConstraints },
|
||||
{ 1, &emptyDNSSubtree, 0, NULL } },
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "wine/test.h"
|
||||
|
||||
HMODULE hCrypt;
|
||||
static HMODULE hCrypt;
|
||||
|
||||
static void test_findAttribute(void)
|
||||
{
|
||||
|
|
|
@ -191,7 +191,7 @@ typedef BOOL (WINAPI *CertStrToNameWFunc)(DWORD dwCertEncodingType,
|
|||
LPCWSTR pszX500, DWORD dwStrType, void *pvReserved, BYTE *pbEncoded,
|
||||
DWORD *pcbEncoded, LPCWSTR *ppszError);
|
||||
|
||||
HMODULE dll;
|
||||
static HMODULE dll;
|
||||
static CertNameToStrAFunc pCertNameToStrA;
|
||||
static CertNameToStrWFunc pCertNameToStrW;
|
||||
static CryptDecodeObjectFunc pCryptDecodeObject;
|
||||
|
@ -470,7 +470,7 @@ struct StrToNameA
|
|||
const BYTE *encoded;
|
||||
};
|
||||
|
||||
const BYTE encodedSimpleCN[] = {
|
||||
static const BYTE encodedSimpleCN[] = {
|
||||
0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x31 };
|
||||
static const BYTE encodedSingleQuotedCN[] = { 0x30,0x0e,0x31,0x0c,0x30,0x0a,
|
||||
0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x27,0x31,0x27 };
|
||||
|
@ -481,7 +481,7 @@ static const BYTE encodedQuotedCN[] = { 0x30,0x11,0x31,0x0f,0x30,0x0d,0x06,0x03,
|
|||
static const BYTE encodedMultipleAttrCN[] = { 0x30,0x0e,0x31,0x0c,0x30,0x0a,
|
||||
0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x31,0x2b,0x32 };
|
||||
|
||||
struct StrToNameA namesA[] = {
|
||||
static const struct StrToNameA namesA[] = {
|
||||
{ "CN=1", sizeof(encodedSimpleCN), encodedSimpleCN },
|
||||
{ "CN=\"1\"", sizeof(encodedSimpleCN), encodedSimpleCN },
|
||||
{ "CN = \"1\"", sizeof(encodedSimpleCN), encodedSimpleCN },
|
||||
|
@ -562,7 +562,7 @@ static const WCHAR japaneseCN_W[] = { 'C','N','=',0x226f,0x575b,0 };
|
|||
static const BYTE encodedJapaneseCN[] = { 0x30,0x0f,0x31,0x0d,0x30,0x0b,0x06,
|
||||
0x03,0x55,0x04,0x03,0x1e,0x04,0x22,0x6f,0x57,0x5b };
|
||||
|
||||
struct StrToNameW namesW[] = {
|
||||
static const struct StrToNameW namesW[] = {
|
||||
{ simpleCN_W, sizeof(encodedSimpleCN), encodedSimpleCN },
|
||||
{ simpleCN2_W, sizeof(encodedSimpleCN), encodedSimpleCN },
|
||||
{ simpleCN3_W, sizeof(encodedSimpleCN), encodedSimpleCN },
|
||||
|
|
Loading…
Reference in New Issue