Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
73e825fb
Commit
73e825fb
authored
May 16, 2006
by
Juan Lang
Committed by
Alexandre Julliard
May 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crypt32: Add more tests for adding certs to a store.
parent
d0505de6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
2 deletions
+45
-2
store.c
dlls/crypt32/tests/store.c
+45
-2
No files found.
dlls/crypt32/tests/store.c
View file @
73e825fb
...
...
@@ -98,6 +98,17 @@ static const BYTE bigCert2[] = { 0x30, 0x7a, 0x02, 0x01, 0x01, 0x30, 0x02, 0x06,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x07
,
0x30
,
0x02
,
0x06
,
0x00
,
0x03
,
0x01
,
0x00
,
0xa3
,
0x16
,
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
const
BYTE
bigCert2WithDifferentSerial
[]
=
{
0x30
,
0x7a
,
0x02
,
0x01
,
0x02
,
0x30
,
0x02
,
0x06
,
0x00
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x41
,
0x6c
,
0x65
,
0x78
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x22
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x41
,
0x6c
,
0x65
,
0x78
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x07
,
0x30
,
0x02
,
0x06
,
0x00
,
0x03
,
0x01
,
0x00
,
0xa3
,
0x16
,
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
const
BYTE
subjectName2
[]
=
{
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x41
,
0x6c
,
0x65
,
0x78
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
};
...
...
@@ -116,6 +127,17 @@ static const BYTE certWithUsage[] = { 0x30, 0x81, 0x93, 0x02, 0x01, 0x01, 0x30,
0x05
,
0x05
,
0x07
,
0x03
,
0x03
,
0x06
,
0x08
,
0x2b
,
0x06
,
0x01
,
0x05
,
0x05
,
0x07
,
0x03
,
0x02
,
0x06
,
0x09
,
0x2a
,
0x86
,
0x48
,
0x86
,
0xf7
,
0x0d
,
0x01
,
0x01
,
0x01
};
static
const
BYTE
serialNum
[]
=
{
1
};
static
const
BYTE
bigCertWithDifferentIssuer
[]
=
{
0x30
,
0x7a
,
0x02
,
0x01
,
0x01
,
0x30
,
0x02
,
0x06
,
0x00
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x4a
,
0x75
,
0x61
,
0x6e
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x22
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x18
,
0x0f
,
0x31
,
0x36
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x31
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x30
,
0x5a
,
0x30
,
0x15
,
0x31
,
0x13
,
0x30
,
0x11
,
0x06
,
0x03
,
0x55
,
0x04
,
0x03
,
0x13
,
0x0a
,
0x41
,
0x6c
,
0x65
,
0x78
,
0x20
,
0x4c
,
0x61
,
0x6e
,
0x67
,
0x00
,
0x30
,
0x07
,
0x30
,
0x02
,
0x06
,
0x00
,
0x03
,
0x01
,
0x00
,
0xa3
,
0x16
,
0x30
,
0x14
,
0x30
,
0x12
,
0x06
,
0x03
,
0x55
,
0x1d
,
0x13
,
0x01
,
0x01
,
0xff
,
0x04
,
0x08
,
0x30
,
0x06
,
0x01
,
0x01
,
0xff
,
0x02
,
0x01
,
0x01
};
static
void
testAddCert
(
void
)
{
...
...
@@ -180,9 +202,30 @@ static void testAddCert(void)
CertFreeCertificateContext
(
context
);
}
/*
FIXME: test whether adding a cert with the same subject name and
* s
erial number (but different otherwise) as an existing cert work
s.
/*
Adding a cert that differs by nothing more than serial number
* s
ucceed
s.
*/
context
=
NULL
;
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCert2WithDifferentSerial
,
sizeof
(
bigCert2WithDifferentSerial
),
CERT_STORE_ADD_NEW
,
&
context
);
ok
(
ret
,
"CertAddEncodedCertificateToStore failed: %08lx
\n
"
,
GetLastError
());
if
(
context
)
CertDeleteCertificateFromStore
(
context
);
/* Adding a cert with the same issuer name and serial number (but
* different otherwise) as an existing cert succeeds.
*/
context
=
NULL
;
ret
=
CertAddEncodedCertificateToStore
(
store
,
X509_ASN_ENCODING
,
bigCertWithDifferentIssuer
,
sizeof
(
bigCertWithDifferentIssuer
),
CERT_STORE_ADD_NEW
,
&
context
);
ok
(
ret
,
"CertAddEncodedCertificateToStore failed: %08lx
\n
"
,
GetLastError
());
if
(
context
)
CertDeleteCertificateFromStore
(
context
);
collection
=
CertOpenStore
(
CERT_STORE_PROV_COLLECTION
,
0
,
0
,
CERT_STORE_CREATE_NEW_FLAG
,
NULL
);
ok
(
collection
!=
NULL
,
"CertOpenStore failed: %08lx
\n
"
,
GetLastError
());
...
...
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