Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
09765f7d
Commit
09765f7d
authored
Sep 25, 2006
by
Juan Lang
Committed by
Alexandre Julliard
Sep 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Reduce indent level of tests.
parent
581c24ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
33 deletions
+28
-33
cert.c
dlls/crypt32/tests/cert.c
+28
-33
No files found.
dlls/crypt32/tests/cert.c
View file @
09765f7d
...
...
@@ -132,15 +132,15 @@ static const BYTE certWithUsage[] = { 0x30, 0x81, 0x93, 0x02, 0x01, 0x01, 0x30,
static
void
testAddCert
(
void
)
{
HCERTSTORE
store
;
HCERTSTORE
collection
;
PCCERT_CONTEXT
context
;
BOOL
ret
;
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
store
!=
NULL
,
"CertOpenStore failed: %ld
\n
"
,
GetLastError
());
if
(
store
!=
NULL
)
{
HCERTSTORE
collection
;
PCCERT_CONTEXT
context
;
BOOL
ret
;
if
(
!
store
)
return
;
/* Weird--bad add disposition leads to an access violation in Windows.
*/
...
...
@@ -287,7 +287,6 @@ static void testAddCert(void)
}
CertCloseStore
(
store
,
0
);
}
}
static
void
checkHash
(
const
BYTE
*
data
,
DWORD
dataLen
,
ALG_ID
algID
,
...
...
@@ -317,11 +316,6 @@ static void testCertProperties(void)
{
PCCERT_CONTEXT
context
=
CertCreateCertificateContext
(
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
));
ok
(
context
!=
NULL
,
"CertCreateCertificateContext failed: %08lx
\n
"
,
GetLastError
());
if
(
context
)
{
DWORD
propID
,
numProps
,
access
,
size
;
BOOL
ret
;
BYTE
hash
[
20
]
=
{
0
},
hashProperty
[
20
];
...
...
@@ -329,6 +323,11 @@ static void testCertProperties(void)
CERT_KEY_CONTEXT
keyContext
;
HCRYPTPROV
csp
;
ok
(
context
!=
NULL
,
"CertCreateCertificateContext failed: %08lx
\n
"
,
GetLastError
());
if
(
!
context
)
return
;
/* This crashes
propID = CertEnumCertificateContextProperties(NULL, 0);
*/
...
...
@@ -497,20 +496,19 @@ static void testCertProperties(void)
CryptReleaseContext
(
csp
,
0
);
CertFreeCertificateContext
(
context
);
}
}
static
void
testDupCert
(
void
)
{
HCERTSTORE
store
;
PCCERT_CONTEXT
context
,
dupContext
;
BOOL
ret
;
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
store
!=
NULL
,
"CertOpenStore failed: %ld
\n
"
,
GetLastError
());
if
(
store
!=
NULL
)
{
PCCERT_CONTEXT
context
,
dupContext
;
BOOL
ret
;
if
(
!
store
)
return
;
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
CERT_STORE_ADD_ALWAYS
,
&
context
);
...
...
@@ -535,23 +533,22 @@ static void testDupCert(void)
CertFreeCertificateContext
(
context
);
}
CertCloseStore
(
store
,
0
);
}
}
static
void
testFindCert
(
void
)
{
HCERTSTORE
store
;
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
store
!=
NULL
,
"CertOpenStore failed: %ld
\n
"
,
GetLastError
());
if
(
store
)
{
PCCERT_CONTEXT
context
=
NULL
;
BOOL
ret
;
CERT_INFO
certInfo
=
{
0
};
CRYPT_HASH_BLOB
blob
;
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
store
!=
NULL
,
"CertOpenStore failed: %ld
\n
"
,
GetLastError
());
if
(
!
store
)
return
;
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
CERT_STORE_ADD_NEW
,
NULL
);
ok
(
ret
,
"CertAddEncodedCertificateToStore failed: %08lx
\n
"
,
...
...
@@ -602,7 +599,7 @@ static void testFindCert(void)
if
(
context
)
{
context
=
CertFindCertificateInStore
(
store
,
X509_ASN_ENCODING
,
0
,
CERT_FIND_ISSUER
_NAME
,
&
certInfo
.
Subject
,
context
);
CERT_FIND_SUBJECT
_NAME
,
&
certInfo
.
Subject
,
context
);
ok
(
context
==
NULL
,
"Expected one cert only
\n
"
);
}
...
...
@@ -623,7 +620,7 @@ static void testFindCert(void)
if
(
context
)
{
context
=
CertFindCertificateInStore
(
store
,
X509_ASN_ENCODING
,
0
,
CERT_FIND_ISSUER_NAME
,
&
certInfo
.
Subject
,
context
);
CERT_FIND_SUBJECT_CERT
,
&
certInfo
.
Subject
,
context
);
ok
(
context
==
NULL
,
"Expected one cert only
\n
"
);
}
...
...
@@ -637,26 +634,25 @@ static void testFindCert(void)
if
(
context
)
{
context
=
CertFindCertificateInStore
(
store
,
X509_ASN_ENCODING
,
0
,
CERT_FIND_ISSUER_NAME
,
&
certInfo
.
Subject
,
context
);
CERT_FIND_SHA1_HASH
,
&
certInfo
.
Subject
,
context
);
ok
(
context
==
NULL
,
"Expected one cert only
\n
"
);
}
CertCloseStore
(
store
,
0
);
}
}
static
void
testGetSubjectCert
(
void
)
{
HCERTSTORE
store
;
PCCERT_CONTEXT
context1
,
context2
;
CERT_INFO
info
=
{
0
};
BOOL
ret
;
store
=
CertOpenStore
(
CERT_STORE_PROV_MEMORY
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
store
!=
NULL
,
"CertOpenStore failed: %ld
\n
"
,
GetLastError
());
if
(
store
!=
NULL
)
{
PCCERT_CONTEXT
context1
,
context2
;
CERT_INFO
info
=
{
0
};
BOOL
ret
;
if
(
!
store
)
return
;
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCert
,
sizeof
(
bigCert
),
CERT_STORE_ADD_ALWAYS
,
NULL
);
...
...
@@ -700,7 +696,6 @@ static void testGetSubjectCert(void)
CertFreeCertificateContext
(
context1
);
CertCloseStore
(
store
,
0
);
}
}
/* This expires in 1970 or so */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment