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
9d2c6a9c
Commit
9d2c6a9c
authored
Nov 14, 2005
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Nov 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't call missing API function.
parent
d40302a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
48 deletions
+52
-48
cert.c
dlls/crypt32/tests/cert.c
+52
-48
No files found.
dlls/crypt32/tests/cert.c
View file @
9d2c6a9c
...
...
@@ -1469,23 +1469,25 @@ static void testVerifyCertSig(HCRYPTPROV csp, const CRYPT_DATA_BLOB *toBeSigned,
DWORD
size
=
0
;
BOOL
ret
;
ret
=
pCryptVerifyCertificateSignatureEx
(
0
,
0
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
0
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
/* This crashes
ret = pCryptVerifyCertificateSignatureEx(csp, X509_ASN_ENCODING,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB, NULL, 0, NULL, 0, NULL);
*/
if
(
pCryptVerifyCertificateSignatureEx
)
{
ret
=
pCryptVerifyCertificateSignatureEx
(
0
,
0
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
0
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
/* This crashes
ret = pCryptVerifyCertificateSignatureEx(csp, X509_ASN_ENCODING,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB, NULL, 0, NULL, 0, NULL);
*/
}
info
.
ToBeSigned
.
cbData
=
toBeSigned
->
cbData
;
info
.
ToBeSigned
.
pbData
=
toBeSigned
->
pbData
;
info
.
SignatureAlgorithm
.
pszObjId
=
(
LPSTR
)
sigOID
;
...
...
@@ -1501,36 +1503,38 @@ static void testVerifyCertSig(HCRYPTPROV csp, const CRYPT_DATA_BLOB *toBeSigned,
CRYPT_DATA_BLOB
certBlob
=
{
0
,
NULL
};
PCERT_PUBLIC_KEY_INFO
pubKeyInfo
=
NULL
;
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
"Expected CRYPT_E_ASN1_EOD, got %08lx
\n
"
,
GetLastError
());
certBlob
.
cbData
=
1
;
certBlob
.
pbData
=
(
void
*
)
0xdeadbeef
;
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
GetLastError
());
certBlob
.
cbData
=
size
;
certBlob
.
pbData
=
cert
;
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
/* This crashes
ret = pCryptVerifyCertificateSignatureEx(csp, X509_ASN_ENCODING,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB, &certBlob,
CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY, NULL, 0, NULL);
*/
if
(
pCryptVerifyCertificateSignatureEx
)
{
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
CRYPT_E_ASN1_EOD
,
"Expected CRYPT_E_ASN1_EOD, got %08lx
\n
"
,
GetLastError
());
certBlob
.
cbData
=
1
;
certBlob
.
pbData
=
(
void
*
)
0xdeadbeef
;
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
STATUS_ACCESS_VIOLATION
,
"Expected STATUS_ACCESS_VIOLATION, got %08lx
\n
"
,
GetLastError
());
certBlob
.
cbData
=
size
;
certBlob
.
pbData
=
cert
;
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
0
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL
,
NULL
,
0
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
HRESULT_FROM_WIN32
(
ERROR_INVALID_PARAMETER
),
"Expected HRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER), got %08lx
\n
"
,
GetLastError
());
/* This crashes
ret = pCryptVerifyCertificateSignatureEx(csp, X509_ASN_ENCODING,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB, &certBlob,
CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY, NULL, 0, NULL);
*/
}
CryptExportPublicKeyInfoEx
(
csp
,
AT_SIGNATURE
,
X509_ASN_ENCODING
,
(
LPSTR
)
sigOID
,
0
,
NULL
,
NULL
,
&
size
);
pubKeyInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
...
...
@@ -1539,7 +1543,7 @@ static void testVerifyCertSig(HCRYPTPROV csp, const CRYPT_DATA_BLOB *toBeSigned,
ret
=
CryptExportPublicKeyInfoEx
(
csp
,
AT_SIGNATURE
,
X509_ASN_ENCODING
,
(
LPSTR
)
sigOID
,
0
,
NULL
,
pubKeyInfo
,
&
size
);
ok
(
ret
,
"CryptExportKey failed: %08lx
\n
"
,
GetLastError
());
if
(
ret
)
if
(
ret
&&
pCryptVerifyCertificateSignatureEx
)
{
ret
=
pCryptVerifyCertificateSignatureEx
(
csp
,
X509_ASN_ENCODING
,
CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB
,
&
certBlob
,
...
...
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