Commit Graph

818 Commits

Author SHA1 Message Date
Juan Lang 15cab33041 crypt32: Implement opening file name stores from files that contain PKCS7 messages. 2007-10-01 12:32:20 +02:00
Juan Lang 99981716b2 crypt32: Allow file stores to support more than one type of file. 2007-10-01 12:32:12 +02:00
Juan Lang 60fcce5558 crypt32: Create file store directly in CRYPT_FileNameOpenStoreW. 2007-10-01 12:32:03 +02:00
Juan Lang 2373b8bc80 crypt32: Add a helper function to create a file store from an already-initialized memory store. 2007-10-01 12:31:55 +02:00
Juan Lang f6ebeba5a2 crypt32: Move CertSaveStore to serialize.c. 2007-09-28 11:35:03 +02:00
Juan Lang 9c55a71f8f crypt32: Use CertSaveStore to save file stores. 2007-09-28 11:31:32 +02:00
Juan Lang 6471621f5e crypt32: Implement CertSaveStore. 2007-09-28 11:31:26 +02:00
Juan Lang bba9587f40 crypt32: Implement CRYPT_WriteSerializedStoreToFile using CRYPT_WriteSerializedStoreToStream. 2007-09-28 11:31:08 +02:00
Juan Lang 779dd45e6b crypt32: Add a function to serialize a store to an arbitrary stream. 2007-09-28 11:31:01 +02:00
Juan Lang bc81929519 crypt32: Rename a couple of functions. 2007-09-28 11:30:48 +02:00
Juan Lang 36886f7dd1 crypt32: Add/improve some traces. 2007-09-28 11:30:40 +02:00
Juan Lang f8ff1c3237 crypt32: Support PKCS messages wrapped in a PKCS content info in CryptQueryObject. 2007-09-27 21:03:16 +02:00
Juan Lang f880982176 crypt32: Fix CryptQueryObject for embedded PKCS7 signatures. 2007-09-27 21:03:12 +02:00
Michael Stefaniuc a624fb044c crypt32: Add missing parameter to a TRACE. 2007-09-27 11:08:23 +02:00
Juan Lang 8e1151ec18 crypt32: Partially implement CryptQueryObject. 2007-09-26 14:27:02 +02:00
Juan Lang 91f2a4d687 crypt32: Fix alignment for 64-bit systems. 2007-09-19 11:41:18 +02:00
Juan Lang 71b5ba0336 crypt32: Implement streamed encoding of an indefinite-length data message. 2007-09-19 11:40:44 +02:00
Juan Lang 19956d6e97 crypt32: Pass length rather than entire message to CRYPT_EncodeContentLength. 2007-09-19 11:40:38 +02:00
Juan Lang 0bd29b1243 crypt32: Use decode function's returned decoded length to advance pointer when decoding an array. 2007-09-18 11:57:56 +02:00
Juan Lang ee28204fcf crypt32: ret is already true, don't retest it. 2007-09-18 11:57:48 +02:00
Juan Lang 9c4c856fde crypt32: Explicitly count bytes to copy in DecodeCopyBytes. 2007-09-18 11:57:41 +02:00
Juan Lang 7e475b4a77 crypt32: Test and correct decoding indefinite-length-encoded PKCS content. 2007-09-18 11:57:33 +02:00
Juan Lang 43e6b48b33 crypt32: Use correct encoded length when decoding a sequence. 2007-09-18 11:57:24 +02:00
Juan Lang f534a67bfc crypt32: Simplify AsnDecodeSequenceItems a tiny bit. 2007-09-18 11:57:17 +02:00
Juan Lang 34aaabca83 crypt32: Allow indefinite-length encoding of sequence items. 2007-09-18 11:57:10 +02:00
Juan Lang be91ad3604 crypt32: Simplify DecodePathLenConstraint. 2007-09-18 11:57:02 +02:00
Juan Lang 4fd90ddad3 crypt32: Allow a sequence to have an indefinite-length encoding. 2007-09-18 11:56:55 +02:00
Juan Lang 2e8ae598e1 crypt32: Set *pcbDecoded in every function. 2007-09-18 11:56:48 +02:00
Juan Lang e03864a205 crypt32: Use internal form for all internal decoding functions. 2007-09-18 11:56:40 +02:00
Juan Lang ce47433d94 crypt32: Get rid of encoding type argument to AsnDecodeSequence, it isn't used. 2007-09-18 11:56:24 +02:00
Juan Lang 19fd9872a6 crypt32: Get rid of encoding type from AsnDecodeSequenceItems, it's never checked. 2007-09-18 11:56:09 +02:00
Juan Lang 21246938c4 crypt32: Don't use exception handler when decoding time zone, caller already does. 2007-09-18 11:56:01 +02:00
Juan Lang ad94982284 crypt32: Implement DecodeAltName with DecodeAltNameInternal. 2007-09-18 11:55:50 +02:00
Juan Lang 89a541a493 crypt32: Use AsnDecodeIntInternal where an internal function is called for. 2007-09-18 11:55:43 +02:00
Juan Lang f2bff633ac crypt32: Temporarily change prototype of AsnDecodeIntInternal to the CryptDecodeObjectEx form. 2007-09-18 11:55:35 +02:00
Juan Lang 205c733b13 crypt32: Use internal decode int function a couple more places. 2007-09-18 11:55:26 +02:00
Juan Lang 8c5bd5f5ca crypt32: Introduce a space checking helper for functions that don't allocate memory and use it where appropriate. 2007-09-18 11:55:20 +02:00
Juan Lang 9d0dccf164 crypt32: Move a comment that belonged elsewhere. 2007-09-18 11:55:05 +02:00
Juan Lang 5fbca384e4 crypt32: Separate DecodeInt into an internal and external version. 2007-09-18 11:54:39 +02:00
Juan Lang a538e95c1d crypt32: Use simpler form for internal time decoding functions. 2007-09-18 11:54:30 +02:00
Juan Lang 52be131a29 crypt32: Allow items in an array to be indefinite-length encoded. 2007-09-18 11:54:18 +02:00
Juan Lang 5d168bd4c0 crypt32: Support indefinite-length encoded arrays. 2007-09-18 11:54:10 +02:00
Juan Lang 159a369318 crypt32: Set bytes decoded in all success paths. 2007-09-18 11:54:02 +02:00
Juan Lang 7ecf5becbd crypt32: Introduce a helper function to get encoded length that allows indefinite-length encoding. 2007-09-18 11:53:54 +02:00
Juan Lang 54a51afcd7 crypt32: Remove an unneeded WINAPI. 2007-09-18 11:53:47 +02:00
Juan Lang deb07ccb1c crypt32: Return bytes decoded from AsnDecodeArray. 2007-09-18 11:53:41 +02:00
Juan Lang b2f02f3bf7 crypt32: Pass bytes decoded pointer to AsnDecodeArray. 2007-09-18 11:53:32 +02:00
Juan Lang 1f4bcb4a3d crypt32: Return bytes decoded when decoding an alt name entry. 2007-09-18 11:53:24 +02:00
Juan Lang d7e8eed944 crypt32: Return bytes decoded when copying DER-encoded bytes. 2007-09-18 11:53:17 +02:00
Juan Lang fd982c8597 crypt32: Return bytes decoded when decoding a sequence. 2007-09-18 11:53:11 +02:00
Juan Lang 1dd1c6c2c8 crypt32: Make a decode OID function that returns the number of bytes decoded. 2007-09-18 11:53:05 +02:00
Juan Lang f3490f3ed8 crypt32: Add a decoded parameter to AsnDecodeSequence. 2007-09-18 11:52:57 +02:00
Juan Lang 731d37b049 crypt32: Use a simpler prototype for array decoding functions. 2007-09-18 11:52:50 +02:00
Juan Lang cc2059b67c crypt32: Fix alignment on 64-bit systems. 2007-09-18 11:52:32 +02:00
Juan Lang 09447fb605 crypt32: Correct an optimization. 2007-09-18 11:52:25 +02:00
Juan Lang e747f706b1 crypt32: Correct GET_LEN_BYTES for the indefinite-length form. 2007-09-18 11:52:18 +02:00
Juan Lang 15b19f1d16 crypt32: Add a test of an indefinite-length sequence. 2007-09-18 11:52:09 +02:00
Juan Lang 716a7405e4 crypt32: Update comments. 2007-09-18 11:52:00 +02:00
Andrew Talbot f19086e9d3 crypt32: Fix some memory leaks. 2007-09-17 13:48:32 +02:00
Francois Gouget 5ac6e1f5c5 crypt32: We don't consider sys/types.h to be a conditional include. 2007-09-13 11:01:00 +02:00
Juan Lang f0add11007 crypt32: Make chain tests more strict. 2007-09-12 11:33:11 +02:00
Juan Lang a5833ac9f4 crypt32: Set subject's info status from method used to find issuer. 2007-09-12 11:33:11 +02:00
Juan Lang 54428bfb99 crypt32: Pass subject's info status when adding an issuer to a chain. 2007-09-12 11:33:11 +02:00
Juan Lang 5c8254886f crypt32: Only decode authority key ID in subject cert once when looking for issuer. 2007-09-12 11:33:11 +02:00
Juan Lang 05492ae907 crypt32: (Re)introduce helper function to get issuer certificate. 2007-09-12 11:33:11 +02:00
Rob Shearman 9ddc872a1a crypt32: Fix a compile failure on *BSD systems.
Include limits.h for the definition of PATH_MAX.
2007-09-12 11:33:10 +02:00
Francois Gouget b7bf91f5e8 crypt32: Fix the I_Crypt*Asn1*() prototypes. Add the i_cryptasn1tls.h header and use it. 2007-09-12 11:33:10 +02:00
Juan Lang 039beff441 crypt32: Implement CertVerifyCertificateChainPolicy for the basic constraints policy. 2007-09-11 12:36:41 +02:00
Juan Lang 5f06293eb1 crypt32: Implement CertVerifyCertificateChainPolicy for the authenticode policy. 2007-09-11 12:36:34 +02:00
Juan Lang b56f0c5b68 crypt32: Implement CertVerifyCertificateChainPolicy for the base policy. 2007-09-11 12:36:27 +02:00
Juan Lang f23ec30534 crypt32: Add initial tests for CertVerifyCertificateChainPolicy. 2007-09-11 12:36:15 +02:00
Juan Lang 91c76955e7 crypt32: Add a stub for CertVerifyCertificateChainPolicy. 2007-09-11 12:36:10 +02:00
Juan Lang d7115ce33c crypt32: Support CRYPT_DECODE_TO_BE_SIGNED_FLAG. 2007-09-11 12:35:57 +02:00
Juan Lang 9663f9427b crypt32: Add a root store implementation that reads trusted certificates from well-known locations on the local system. 2007-09-11 11:57:06 +02:00
Juan Lang 391f826d49 crypt32: Add a function to create a certificate chain engine potentially before the root store is created. 2007-09-11 11:50:23 +02:00
Juan Lang 5e674f3580 crypt32: Consider alternate issuers when building chains. 2007-09-10 15:50:01 +02:00
Juan Lang 1fc8c60788 crypt32: Flags weren't set, so don't bother passing them. 2007-09-10 15:49:55 +02:00
Juan Lang a040dd22e7 crypt32: Defer checking signatures until chain is complete. 2007-09-10 15:49:50 +02:00
Juan Lang 56d4a3c392 crypt32: Don't ask CertGetIssuerCertificateFromStore to verify revocation status, it almost certainly doesn't do what we want. 2007-09-10 15:49:44 +02:00
Juan Lang dfd2d3d9bc crypt32: Don't abort chain creation if the root signature isn't valid. 2007-09-10 15:49:38 +02:00
Juan Lang 5b02947937 crypt32: Add special case for certificates with no signature algorithm. 2007-09-10 15:49:31 +02:00
Juan Lang d82f3f37a2 crypt32: Remove a misplaced todo_wine. 2007-09-10 15:49:24 +02:00
Juan Lang 69834b16ac crypt32: Set *ppChainContext even on error. 2007-09-10 15:49:13 +02:00
Juan Lang 31618f91dd crypt32: Test whether chain creation should fail when a root signature is invalid. 2007-09-10 15:49:07 +02:00
Juan Lang c4e07a5bfc crypt32: Separate allocating a simple chain and checking it from building it. 2007-09-10 15:49:01 +02:00
Juan Lang a82b36ac98 crypt32: Store world store in chain. 2007-09-10 15:48:55 +02:00
Juan Lang 818634d69a crypt32: Not finding an issuer shouldn't cause chain creation to fail. 2007-09-10 15:48:49 +02:00
Juan Lang 8698a598fc crypt32: Don't add end cert's store to world. 2007-09-10 15:48:43 +02:00
Juan Lang e9ee8c8717 crypt32: Open world store when creating chain, not when building a simple chain. 2007-09-10 15:48:35 +02:00
Juan Lang 1a059879bf crypt32: Make a helper function to create initial candidate chain. 2007-09-10 15:48:27 +02:00
Juan Lang 192ed7353d crypt32: Test that the end cert in a chain's store isn't implicitly searched for issuers. 2007-09-10 15:48:15 +02:00
Juan Lang 6aa03fc4c3 crypt32: Add more tests for getting issuer cert from store.
Show that certificates are added to memory stores at the head rather
than the tail.
2007-09-10 15:48:10 +02:00
Juan Lang 6c9b788fb8 crypt32: Check path length constraint on a chain. 2007-08-31 19:12:38 +02:00
Juan Lang 14b0df1fef crypt32: Set error status on issued certificate, not on issuer. 2007-08-31 19:12:33 +02:00
Juan Lang 1ce46d5e4a crypt32: Check whether each signing certificate can be a CA. 2007-08-31 19:12:28 +02:00
Juan Lang 51948b0c98 crypt32: Check time of each element in chain against requested time. 2007-08-31 19:12:23 +02:00
Juan Lang d06a24517f crypt32: Time validity nesting doesn't appear to be checked, so don't check it. 2007-08-31 19:12:18 +02:00
Juan Lang 03d76d97ec crypt32: Correct combining trust status of a chain's elements into the chain's trust status. 2007-08-31 19:12:12 +02:00
Juan Lang c39696eb14 crypt32: Don't fail chain creation if signature doesn't match. 2007-08-31 19:12:04 +02:00
Juan Lang 1540f24e92 crypt32: Don't fail chain creation if root isn't self-signed. 2007-08-31 19:11:53 +02:00
Juan Lang b8b787a810 crypt32: Halt chain creation when a cycle is detected. 2007-08-31 19:11:46 +02:00
Juan Lang 51a9d208ee crypt32: Implement CertDuplicateCertificateChain. 2007-08-31 19:11:41 +02:00
Juan Lang 3ef4c7e1cc crypt32: Remove unneeded WINAPI from internal function. 2007-08-31 19:11:35 +02:00
Juan Lang 0dc82780ca crypt32: Free lower quality chain contexts. 2007-08-31 19:11:30 +02:00
Juan Lang a4e88cb644 crypt32: Check chain root's trusted status regardless of whether its signature is valid. 2007-08-31 19:11:25 +02:00
Juan Lang 8cd7abf1be crypt32: Properly reference count certificate contexts referenced by a chain. 2007-08-31 19:11:19 +02:00
Juan Lang 45eef63a35 crypt32: Add a default cycle detection modulus. 2007-08-31 19:11:11 +02:00
Juan Lang cf2047fd72 crypt32: The preferred issuer flag appears to be a bug in XP, so don't set it. 2007-08-31 19:11:06 +02:00
Juan Lang 6a8a7362cc crypt32: Greatly expand certificate chain tests. 2007-08-31 18:01:56 +02:00
Juan Lang eda48d8868 crypt32: Set trust status on root element in chain. 2007-08-29 11:59:34 +02:00
Juan Lang ff26d428e3 crypt32: Partially implement CMSG_CTRL_VERIFY_SIGNATURE_EX. 2007-08-27 11:59:19 +02:00
Juan Lang f5b4806159 crypt32: Implement CryptVerifyMessageSignature. 2007-08-23 12:38:05 +02:00
Juan Lang 3a9e1d6648 crypt32: Test and correct verifying the signature of a valid signed message. 2007-08-23 12:37:59 +02:00
Juan Lang 4fb26709cd crypt32: Test encoding a signed message with a valid public key. 2007-08-22 12:59:37 +02:00
Juan Lang 6acd761646 crypt32: Explicitly terminate loop when a matching signer cert is found. 2007-08-22 12:59:32 +02:00
Juan Lang d4c318f295 crypt32: Only free allocated handles. 2007-08-22 12:34:04 +02:00
Juan Lang e52c80e53b crypt32: Test and implement CryptGetMessageSignerCount. 2007-08-22 12:33:59 +02:00
Juan Lang b9038be1ff crypt32: Implement CryptGetMessageCertificates. 2007-08-22 12:33:55 +02:00
Juan Lang b6032a41b3 crypt32: Trace encoding and decoding public keys on crypt channel. 2007-08-22 12:33:50 +02:00
Juan Lang b7e420429d crypt32: Implement verifying a decoded signed message's signature. 2007-08-21 22:09:35 +02:00
Juan Lang d3431271fa crypt32: Test and implement getting the computed hash from a decoded signed message. 2007-08-21 22:09:31 +02:00
Juan Lang ed6fbb2712 crypt32: Update a hash message's hash handles when decoding it. 2007-08-21 22:09:27 +02:00
Juan Lang d2dc7d78a9 crypt32: Move signed message data functions together. 2007-08-21 22:09:19 +02:00
Juan Lang f1f8e87b33 crypt32: Make constructing handles a member of signed msg data. 2007-08-21 22:09:15 +02:00
Juan Lang 07ba16c291 crypt32: Use a helper function to allocate signer handles. 2007-08-21 22:09:12 +02:00
Juan Lang 1f9d9be762 crypt32: Don't keep an unneeded copy of the crypto provider for each signer. 2007-08-21 22:09:08 +02:00
Juan Lang bfbc159d1e crypt32: Separate construction of signer handles from signer info. 2007-08-21 22:09:03 +02:00
Juan Lang c4dd74d84c crypt32: Add a helper function to construct a signer handles structure. 2007-08-21 22:08:59 +02:00
Juan Lang de88fedcce crypt32: Add helper function to update signed message data. 2007-08-21 22:08:54 +02:00
Juan Lang 1522282673 crypt32: Make more functions members of signed message data, rather than message. 2007-08-21 22:08:49 +02:00
Juan Lang bfde05d8b6 crypt32: Make updating a hash a member of signed message data, not signed message. 2007-08-21 22:08:45 +02:00
Juan Lang 0080d3d691 crypt32: Make a helper function to a free a signed message's handles. 2007-08-21 22:08:41 +02:00
Juan Lang 5e9299d980 crypt32: Use signed message data type for decoded signed messages. 2007-08-21 22:08:37 +02:00
Juan Lang 7748905743 crypt32: Make a signed message data type. 2007-08-21 22:08:24 +02:00
Juan Lang 3e88838b60 crypt32: Implement verifying the hash of a decoded hash message. 2007-08-21 22:08:20 +02:00
Juan Lang e7ce5ae2bc crypt32: Add a couple tests that show you can't get the hash from an encoded hash message, and fix encoded hash messages to match. 2007-08-21 22:08:15 +02:00
Juan Lang 163e8d6256 crypt32: Add a mostly stub control function for decode messages. 2007-08-21 22:08:11 +02:00
Juan Lang 31c414f4b4 crypt32: Add a default message control function pointer. 2007-08-21 22:08:06 +02:00
Juan Lang cc8948fefa crypt32: Add tests for CryptMsgControl. 2007-08-21 22:08:01 +02:00
Juan Lang 8c4330e732 crypt32: Test an encoded signed message with a cert with a public key. 2007-08-21 22:07:56 +02:00
Juan Lang 1d53424470 crypt32: Don't store the crypto provider when it isn't needed. 2007-08-20 11:52:21 +02:00
Juan Lang 9be5007669 crypt32: Don't store redundant copy of crypto provider in file store. 2007-08-20 11:52:12 +02:00
Juan Lang 065ed54f69 crypt32: Don't store redundant copy of crypto provider in reg store. 2007-08-20 11:52:05 +02:00
Juan Lang 4e1108533b crypt32: Pass crypto provider and appropriate flags when opening PKCS messages, and don't store a redundant copy of the crypto provider in message stores. 2007-08-20 11:51:57 +02:00
Juan Lang 71dffcee84 crypt32: Move file store to a separate file. 2007-08-17 12:01:38 +02:00
Juan Lang 0070d8226f crypt32: Move registry stores to a separate file. 2007-08-17 12:01:38 +02:00
Juan Lang 131f1d20e7 crypt32: Move provider stores to a separate file. 2007-08-17 12:01:38 +02:00
Juan Lang 9f85156e23 crypt32: Move collection stores to a separate file. 2007-08-17 12:01:38 +02:00
Juan Lang adaaab923d crypt32: Move cert store definitions to header. 2007-08-17 12:01:38 +02:00
Juan Lang f3128c9244 crypt32: Where possible, pass a pointer rather than an offset, it's less confusing. 2007-08-17 12:01:38 +02:00