Commit graph

2158 commits

Author SHA1 Message Date
Dmitry Timoshkov 23a042dd06 crypt32: Make CertFindCertificateInStore(CERT_FIND_ISSUER_NAME) work.
1. dwType (CERT_INFO_xxxx_FLAG) is not a mask. CERT_INFO_xxxx_FLAGs have
values from 0 to 11, so for instance CERT_INFO_SUBJECT_FLAG is equal to 7
and CERT_INFO_ISSUER_FLAG is equal to 4.
2. CERT_COMPARE_xxxx have values from 0 to 10, so CERT_COMPARE_NAME is
equal to 2 and CERT_COMPARE_SUBJECT_CERT is equal to 11, therefore
combining CERT_COMPARE_NAME | CERT_COMPARE_SUBJECT_CERT doesn't make
sense.
3. Because of 1 and 2 CertFindCertificateInStore(CERT_FIND_ISSUER_NAME)
currently looks up a certificate by Subject instead of Issuer.

Fixing just one of the problems above leads to test failures. Existing
tests work because they use a self-signed certificate where Issuer and
Subject are the same.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2024-07-11 14:11:20 +02:00
Daniel Lehman 99511bde63 crypt32: Allow overriding GnuTLS debug level. 2024-06-12 20:53:18 +02:00
Paul Gofman 7300b40b47 crypt32: Mind constructor tag in CRYPT_AsnDecodeOCSPSignatureInfoCertEncoded(). 2024-04-25 12:55:00 +02:00
Santino Mazza 624e87a725 crypt32: Fix CryptBinaryToString not adding a separator. 2024-03-25 18:03:37 +01:00
Paul Gofman 164520f593 crypt32: Force debug info in critical sections. 2024-02-20 10:44:14 +01:00
Hans Leidekker 0ceb41a5fd crypt32: Pad R/S values with zeroes if smaller than their counterpart.
Fixes certificate verification in Brawlhalla.
2024-01-18 18:09:09 +01:00
Alexandre Julliard e7d3c4294f crypt32: Remove DECLSPEC_HIDDEN usage. 2023-11-23 22:51:07 +01:00
Alexandre Julliard acad49573a makefiles: Always use the global SOURCES variable for .c files. 2023-11-01 22:44:03 +01:00
Alexandre Julliard 7ccb5df0fc makefiles: Always use the global SOURCES variable for .rc files. 2023-11-01 22:43:56 +01:00
Dmitry Timoshkov c23865d9c3 crypt32: Add support for CERT_NAME_STR_NO_QUOTING_FLAG to CertNameToStr().
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2023-10-18 20:47:00 +02:00
Dmitry Timoshkov 1252426d71 crypt32/tests: Add some tests for quoted RDN values.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2023-10-18 20:47:00 +02:00
Dmitry Timoshkov c2962b2283 crypt32: Avoid truncating unicode chars.
So that strings containing Cyrillic Capital Letter ER (0x420) won't be
quoted when not needed.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
2023-10-18 20:47:00 +02:00
Brendan Shanks 495e1a0c5b crypt32: Ensure unixlib function tables and enum stay in sync. 2023-09-14 11:11:55 +02:00
Torge Matthies 75488b303b crypt32: Fix CMS SignedData encoding.
Several items here were encoded conditionally even though they aren't marked
as optional in the spec.

Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
2023-08-24 16:40:59 +02:00
Alexandre Julliard 7bcfc123e6 crypt32/tests: Use nameless unions/structs. 2023-07-19 12:18:10 +02:00
Alexandre Julliard febb06ce77 crypt32: Use nameless union/structs. 2023-07-05 17:03:30 +02:00
Paul Gofman 650fe1fd78 crypt32: Support CNG keys in CDecodeSignedMsg_VerifySignatureWithKey(). 2023-06-30 17:34:50 +02:00
Paul Gofman 8436f03862 crypt32: Factor out cng_prepare_signature(). 2023-06-30 17:34:50 +02:00
Paul Gofman 6b8cf4dcd3 crypt32: Factor out extract_hash() helper. 2023-06-30 17:34:49 +02:00
Paul Gofman cbfcfc2313 crypt32: Add OID info for szOID_ECC_PUBLIC_KEY. 2023-06-30 17:34:49 +02:00
Paul Gofman 073c23940b crypt32/tests: Test ECC message signature verification. 2023-06-30 17:34:49 +02:00
Paul Gofman e6f7e3a0cb crypt32/tests: Add test for CryptVerifyCertificateSignature() with ECC public key. 2023-06-30 17:34:49 +02:00
Paul Gofman e647719eb0 crypt32/tests: Test CertCreateSelfSignCertificate() without provider info. 2023-06-27 11:58:05 +02:00
Paul Gofman 7861b1e8f0 Revert "crypt32: Do not create persistent container in CRYPT_CreateKeyProv().".
This reverts commit a19c871291.
2023-06-27 11:58:05 +02:00
Paul Gofman a19c871291 crypt32: Do not create persistent container in CRYPT_CreateKeyProv(). 2023-06-21 18:15:43 +02:00
Alex Henrie 8102e2ca2b crypt32: Don't export CRYPT_CopyReversed. 2023-06-20 20:31:05 +02:00
Paul Gofman caf5ae1981 crypt32: Keep root certs cached in registry unless some are deleted on host. 2023-03-24 16:06:08 +01:00
Paul Gofman 463bd7c3e0 crypt32: Refactor read_trusted_roots_from_known_locations(). 2023-03-24 16:06:08 +01:00
Paul Gofman 330d6ab88f crypt32: Refactor CRYPT_ImportSystemRootCertsToReg(). 2023-03-24 16:06:08 +01:00
Paul Gofman 49f0331cef crypt32: Use CERT_STORE_ADD_ALWAYS when reading certs from registry. 2023-03-24 16:06:08 +01:00
Paul Gofman 3d38e85964 crypt32: Support user properties for certificates. 2023-03-24 16:06:08 +01:00
Tyson Whitehead 0065b2449a crypt32/tests: Document fields in original test certificate. 2023-03-20 17:10:45 +01:00
Tyson Whitehead 554a23d227 crypt32/tests: Test for CertGetNameStringW fallback cases. 2023-03-20 17:10:45 +01:00
Tyson Whitehead 01c69eb302 crypt32: Add some CertGetNameStringW fallback cases.
When called with CERT_NAME_ATTR_TYPE and pvTypePara=NULL, Windows
did the first of email, CN, OU, or O while Wine just did email.
2023-03-20 17:10:45 +01:00
Francois Gouget 98d7826d0e crypt32/tests: Fix a typo in a comment. 2023-02-14 09:58:02 +01:00
Alexandre Julliard f9ee565c23 include: Use proper dllimports for crypt32 functions. 2022-12-07 13:51:37 +01:00
Brendan Shanks c39e229163 configure: Remove Security.framework check (always present on macOS). 2022-12-02 11:04:46 +01:00
Alexandre Julliard f340406417 crypt32: Use the Unix call helpers. 2022-11-25 10:10:59 +01:00
Hans Leidekker c1aee64eb2 crypt32/tests: Remove OCSP revoked cert test.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53919
2022-11-14 17:03:55 +01:00
Hans Leidekker d393709fe4 crypt32: Parse OCSP responder name.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53813
2022-10-21 23:18:11 +02:00
Alistair Leslie-Hughes 42bd5ea4c4 crypt32: Only report Unimplemented decoder when not found in external dll.
Some applications spam this fixme.
fixme:cryptasn:CRYPT_GetBuiltinDecoder Unsupported decoder for lpszStructType 1.3.6.1.4.1.311.2.1.4

This OID is supported in wintrust.dll which crypt32 uses, so this console fixme doesn't make sense.
The fixme will only appear if no support for the requested decoder is available.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53800
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
2022-10-19 18:48:30 +02:00
Paul Gofman cc3fc9a47d crypt32: Set correct exponent length in decoded BCRYPT_RSAKEY_BLOB. 2022-09-30 11:53:35 +02:00
Paul Gofman 1120a1cb29 crypt32: Support CRYPT_STRING_HEX in CryptStringToBinary(). 2022-09-21 21:26:37 +02:00
Paul Gofman a79ec1c584 crypt32: Support CRYPT_STRING_HEXRAW in CryptBinaryToStringA(). 2022-09-21 21:26:37 +02:00
Hans Leidekker 7780caf4ee crypt32: Use BCrypt algorithm pseudo-handles. 2022-09-13 16:22:21 +02:00
Nikolay Sivov a63d7c06a9 crypt32/tests: Use CRT allocation functions.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-09-07 20:07:18 +02:00
Francois Gouget 49d4fb0d66 crypt32: Remove WINAPI on static functions where not needed. 2022-08-31 18:31:24 +02:00
Paul Gofman 5f3cd85361 crypt32: Support MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG.
Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
2022-07-11 18:55:11 +02:00
Alexandre Julliard 194e09baec makefiles: Add separate variables for Unix flags and libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-29 23:23:41 +02:00
Dmitry Timoshkov 559a83a8f4 crypt32: CryptAcquireCertificatePrivateKey() should reset last error code on success.
One of Chrome crypto plugins depends on this.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-27 15:26:16 +02:00